Changeset 17305


Ignore:
Timestamp:
2008/05/13 12:15:47 (16 years ago)
Author:
Yammy
Message:

納品書PDF一括出力
http://svn.ec-cube.net/open_trac/ticket/297
コミット

Location:
branches/comu-ver2/data
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/Smarty/templates/default/admin/order/index.tpl

    r17269 r17305  
    305305                <td><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="8" height="1" alt=""></td> 
    306306                <td><a href="../contents/csv.php?tpl_subno_csv=order"><span class="fs12n"> >> CSV出力項目設定 </span></a></td> 
     307                <td><input type="button" name="pdf" value="PDF一括出力" onclick="fnSelectCheckSubmit();"></td> 
    307308            </tr> 
    308309        </table> 
     
    340341                            <td width="100"><span class="white">全商品発送日</span></td> 
    341342                            <td width="75"><span class="white">対応状況</span></td> 
    342                             <td width="90"><span class="white">帳票</span></td> 
     343                            <td width="90"><span class="white">帳票</span><br /><input type="button" name="btn01" value="全て選択" onclick="fnBoxChecked(true);"> <input type="button" name="btn01" value="全て解除" onclick="fnBoxChecked(false);"></td> 
    343344                            <td width="45"><span class="white">編集</span></td> 
    344345                            <td width="45"><span class="white">メール</span></td> 
     
    357358                            <td align="center"><!--{$arrResults[cnt].commit_date|sfDispDBDate|default:"未発送"}--></td> 
    358359                            <td align="center"><!--{$arrORDERSTATUS[$status]}--></td> 
    359                             <td align="center"><a href="./" onClick="win02('pdf.php?order_id=<!--{$arrResults[cnt].order_id}-->','pdf','1000','800'); return false;">帳票生成</a><br /></td> 
     360                            <td align="center"><a href="./" onClick="win02('pdf.php?order_id=<!--{$arrResults[cnt].order_id}-->','pdf','1000','800'); return false;">帳票生成</a><br /><input type="checkbox" name="pdf_order_id[]" value="<!--{$arrResults[cnt].order_id}-->" ></td> 
    360361                            <td align="center"><a href="<!--{$smarty.server.PHP_SELF|escape}-->" onclick="fnChangeAction('<!--{$smarty.const.URL_ORDER_EDIT}-->'); fnModeSubmit('pre_edit', 'order_id', '<!--{$arrResults[cnt].order_id}-->'); return false;"><span class="icon_edit">編集</span></a></td> 
    361362                            <td align="center"><a href="<!--{$smarty.server.PHP_SELF|escape}-->" onclick="fnChangeAction('<!--{$smarty.const.URL_ORDER_MAIL}-->'); fnModeSubmit('pre_edit', 'order_id', '<!--{$arrResults[cnt].order_id}-->'); return false;"><span class="icon_mail">通知</span></a></td> 
     
    379380 
    380381<!--{/if}--> 
     382<script type="text/javascript"> 
     383<!-- 
     384    function fnSelectCheckSubmit(){  
     385 
     386        var fm = document.form1; 
     387                 
     388        var i; 
     389        var checkflag = 0; 
     390        var max = fm["pdf_order_id[]"].length; 
     391         
     392        if(max) { 
     393            for (i=0;i<max;i++){ 
     394                if(fm["pdf_order_id[]"][i].checked == true){ 
     395                    checkflag = 1; 
     396                } 
     397            } 
     398        } else { 
     399            if(fm["pdf_order_id[]"].checked == true) { 
     400                checkflag = 1; 
     401            } 
     402        } 
     403 
     404        if(checkflag == 0){ 
     405            alert('チェックボックスが選択されていません'); 
     406            return false; 
     407        } 
     408         
     409        if(checkflag == 1){  
     410      window.open("about:blank", "pdf", "width=1000,height=800,scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); 
     411      document.form1.target = "pdf"; 
     412          document.form1.mode.value = 'pdf'; 
     413          document.form1.action = 'pdf.php'; 
     414          document.form1.submit();  
     415        } 
     416    } 
     417     
     418    function fnBoxChecked(check){ 
     419        var count; 
     420        var fm = document.form1; 
     421        var max = fm["pdf_order_id[]"].length; 
     422        for(count=0; count<max; count++){ 
     423            fm["pdf_order_id[]"][count].checked = check; 
     424        } 
     425    } 
     426     
     427//--> 
     428</script> 
  • branches/comu-ver2/data/Smarty/templates/default/admin/order/pdf_input.tpl

    r17182 r17305  
    2727<form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF}-->"> 
    2828<input type="hidden" name="mode" value="confirm"> 
    29 <input type="hidden" name="order_id" value="<!--{$arrForm.order_id}-->"> 
     29<!--{foreach from=$arrForm.order_id item=order_id}--> 
     30<input type="hidden" name="order_id[]" value="<!--{$order_id}-->"> 
     31<!--{/foreach}--> 
    3032<input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->"> 
    3133 
     
    3941  <tr class="fs12n"> 
    4042    <td width="120" bgcolor="#f3f3f3">受注番号</td> 
    41     <td width="307" bgcolor="#ffffff"><!--{$arrForm.order_id}--></td> 
     43    <td width="307" bgcolor="#ffffff"> 
     44    <!--{foreach from=$arrForm.order_id item=order_id}--> 
     45    <!--{$order_id}-->, 
     46    <!--{/foreach}--> 
     47    </td> 
    4248  </tr> 
    4349  <tr class="fs12n"> 
  • branches/comu-ver2/data/class/SC_Fpdf.php

    r17182 r17305  
    3333class SC_Fpdf { 
    3434       
    35     function SC_Fpdf($arrData, $tpl_pdf = "template_nouhin01.pdf") { 
    36         $this->arrData = $arrData; 
     35    function SC_Fpdf($download, $title, $tpl_pdf = "template_nouhin01.pdf") { 
    3736        // デフォルトの設定 
    3837        $this->tpl_pdf = PDF_TEMPLATE_DIR . $tpl_pdf;  // テンプレートファイル 
    39         $this->pdf_download = $arrData[download];      // PDFのダウンロード形式(0:表示、1:ダウンロード) 
    40         $this->tpl_title = $arrData['title']; 
     38        $this->pdf_download = $download;      // PDFのダウンロード形式(0:表示、1:ダウンロード) 
     39        $this->tpl_title = $title; 
    4140        $this->tpl_dispmode = "real";      // 表示モード 
    4241        $masterData = new SC_DB_MasterData_Ex(); 
     
    6867        // PDFを読み込んでページ数を取得 
    6968        $pageno = $this->pdf->setSourceFile($this->tpl_pdf); 
     69        #$this->createPdf(); 
     70    } 
     71 
     72    function setData($arrData) { 
     73        $this->arrData = $arrData; 
    7074 
    7175        // ページ番号よりIDを取得 
     
    9296 
    9397        //ロゴ画像 
    94         $this->pdf->Image(PDF_TEMPLATE_DIR . 'logo.png', 124, 46, 60); 
    95  
    96         $this->createPdf(); 
     98        $logo_file = PDF_TEMPLATE_DIR . 'logo.png'; 
     99        $this->pdf->Image($logo_file, 124, 46, 40); 
     100 
    97101    } 
    98102 
     
    111115        $this->lfText(125, 74, $text, 8);  //都道府県+住所1 
    112116        $this->lfText(125, 77, $arrInfo['addr02'], 8);          //住所2 
    113         $text = "TEL: ".$arrInfo['tel01']."-".$arrInfo['tel02']."-".$arrInfo['tel03']." "."FAX: ".$arrInfo['fax01']."-".$arrInfo['fax02']."-".$arrInfo['fax03']; 
     117 
     118        $text = "TEL: ".$arrInfo['tel01']."-".$arrInfo['tel02']."-".$arrInfo['tel03']; 
     119        if (!empty($arrInfo['fax01']) && $arrInfo['fax02'] && $arrInfo['fax03']) { 
     120            $text .= " FAX: ".$arrInfo['fax01']."-".$arrInfo['fax02']."-".$arrInfo['fax03']; 
     121        } 
    114122        $this->lfText(125, 80, $text, 8);  //TEL・FAX 
    115         $text = "Email: ".$arrInfo['law_email']; 
    116         $this->lfText(125, 83, $text, 8);      //Email 
     123 
     124        if (!empty($arrInfo['law_email'])) { 
     125            $text = "Email: ".$arrInfo['law_email']; 
     126            $this->lfText(125, 83, $text, 8);      //Email 
     127        } 
    117128    } 
    118129 
     
    159170        $this->pdf->Cell(0, 45, '', 0, 2, '', 0, ''); 
    160171 
    161         $this->pdf->SetFont('SJIS', '', 9); 
     172        $this->pdf->SetFont('SJIS', '', 8); 
    162173 
    163174        $monetary_unit = $this->sjis_conv("円"); 
     
    270281ob_clean(); 
    271282        if($this->pdf_download == 1) { 
    272           $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 
     283          if ($this->pdf->PageNo() == 1) { 
     284            $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 
     285          } else { 
     286            $filename = "nouhinsyo.pdf"; 
     287          } 
    273288          $this->pdf->Output($this->sjis_conv($filename), D); 
    274289        } else { 
  • branches/comu-ver2/data/class/pages/admin/order/LC_Page_Admin_Order.php

    r17279 r17305  
    124124            case 'delete': 
    125125            case 'csv': 
     126            case 'pdf': 
    126127            case 'delete_all': 
    127128            case 'search': 
     
    289290                            SC_Utils_Ex::sfCSVDownload($head.$data); 
    290291                            exit; 
     292                            break; 
     293                        case 'pdf': 
     294                            $objFpdf = new SC_Fpdf(1, '納品書'); 
     295                            $objFpdf->setData($arrRet); 
     296                            $objFpdf->createPdf(); 
    291297                            break; 
    292298                        case 'delete_all': 
  • branches/comu-ver2/data/class/pages/admin/order/LC_Page_Admin_Order_Pdf.php

    r17182 r17305  
    102102            // エラー入力なし 
    103103            if (count($this->arrErr) == 0) { 
    104                 $objFpdf = new SC_Fpdf($arrRet); 
     104                $i = 0; 
     105                $objFpdf = new SC_Fpdf($arrRet['download'], $arrRet['title']); 
     106                foreach ($arrRet['order_id'] AS $key=>$val) { 
     107                    $arrPdfData = $arrRet; 
     108                    $arrPdfData['order_id'] = $val; 
     109                    $objFpdf->setData($arrPdfData); 
     110                    ++$i; 
     111                } 
     112                $objFpdf->createPdf(); 
    105113            } 
    106114            break; 
     
    121129            // 受注番号があったら、セットする 
    122130            if(SC_Utils_Ex::sfIsInt($_GET['order_id'])) { 
    123                   $arrForm['order_id'] = $_GET['order_id']; 
     131                  $arrForm['order_id'][0] = $_GET['order_id']; 
     132            } elseif (is_array($_POST['pdf_order_id'])) { 
     133                sort($_POST['pdf_order_id']); 
     134                foreach ($_POST['pdf_order_id'] AS $key=>$val) { 
     135                      $arrForm['order_id'][] = $val; 
     136                } 
    124137            } 
    125138 
  • branches/comu-ver2/data/pdf/japanese.php

    r17182 r17305  
    533533    $this->SetFont('Arial','I',8); 
    534534    //¸½ºß¤Î¥Ú¡¼¥¸ÈÖ¹æ¤ÈÁí¥Ú¡¼¥¸¿ô¤ò½ÐÎÏ 
    535     $this->Cell(0,10,''.$this->PageNo().' / {nb}',0,0,'C'); 
     535    #$this->Cell(0,10,''.$this->PageNo().' / {nb}',0,0,'C'); 
    536536} 
    537537 
Note: See TracChangeset for help on using the changeset viewer.