Changeset 18545


Ignore:
Timestamp:
2010/02/03 15:37:12 (14 years ago)
Author:
nanasess
bzr:base-revision:
ohkouchi@loop-az.jp-20100203061657-95zs5i4upxoc23qk
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/class/helper/SC_Helper_CSV.php 15535@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_CSV.php
bzr:mapping-version:
v4
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20100203063708-xz6vu301v9y9yevz
bzr:revno:
2155
bzr:revprop:branch-nick:
branches/comu-ver2
bzr:root:
branches/comu-ver2
bzr:timestamp:
2010-02-03 15:37:08.894000053 +0900
bzr:user-agent:
bzr2.0.4+bzr-svn1.0.1
svn:original-date:
2010-02-03T06:37:08.894000Z
Message:

r18544 のコミットミスを修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/helper/SC_Helper_CSV.php

    r18544 r18545  
    9999    } 
    100100 
     101 
    101102    // CSVを送信する。(商品) 
    102103    function sfDownloadProductsCsv($where, $arrval, $order) { 
     
    116117            ,$arrval 
    117118        ); 
    118  
     119         
    119120        // 規格分類名一覧 
    120121        if (in_array('classcategory_id1', $arrOutputCols) || in_array('classcategory_id2', $arrOutputCols)) { 
     
    124125 
    125126        $outputArray = array(); 
    126  
     127         
    127128        // ヘッダ行 
    128129        $outputArray[] = $arrOutput['disp_name']; 
    129  
     130         
    130131        // データ行 
    131132        foreach ($dataRows as $row) { 
     
    145146                                  "category_id", 
    146147                                  "product_id = ?", 
    147                                    array($row['product_id'])); 
    148          } 
    149  
    150            $outputArray[] = $row; 
    151        } 
    152  
    153        // CSVを送信する。 
    154        $this->lfDownloadCsv($outputArray); 
    155  
    156        // 成功終了 
    157        return true; 
     148                                  array($row['product_id'])); 
     149            } 
     150 
     151            $outputArray[] = $row; 
     152        } 
     153         
     154        // CSVを送信する。 
     155        $this->lfDownloadCsv($outputArray); 
     156         
     157        // 成功終了 
     158        return true; 
    158159    } 
    159160 
     
    200201    function sfDownloadCategoryCsv() { 
    201202 
    202     // CSV出力タイトル行の作成 
    203     $arrOutput = SC_Utils_Ex::sfSwapArray($this->sfgetCsvOutput(5, " WHERE csv_id = 5 AND status = 1")); 
    204     if (count($arrOutput) <= 0) return false; // 失敗終了 
     203        // CSV出力タイトル行の作成 
     204        $arrOutput = SC_Utils_Ex::sfSwapArray($this->sfgetCsvOutput(5, " WHERE csv_id = 5 AND status = 1")); 
     205        if (count($arrOutput) <= 0) return false; // 失敗終了 
    205206        $arrOutputCols = $arrOutput['col']; 
    206207 
     
    213214            ,'del_flg = 0' 
    214215        ); 
    215  
     216         
    216217        $outputArray = array(); 
    217  
     218         
    218219        // ヘッダ行 
    219220        $outputArray[] = $arrOutput['disp_name']; 
    220  
     221         
    221222        // データ行 
    222223        foreach ($dataRows as $row) { 
    223224            $outputArray[] = $row; 
    224225        } 
    225  
     226         
    226227        // CSVを送信する。 
    227228        $this->lfDownloadCsv($outputArray, 'category'); 
    228  
     229         
    229230        // 成功終了 
    230231        return true; 
     
    253254    function lfMakeCSV($list) { 
    254255        $line = ""; 
    255  
    256         eset($list); 
    257         while(list($key, $val) = each($list)){ 
     256         
     257        foreach($list as $key => $val) { 
    258258            $tmp = ""; 
    259259            switch($key) { 
    260             case 'order_pref': 
    261             case 'deliv_pref': 
    262                 $tmp = $this->arrPref[$val]; 
    263                 break; 
    264             default: 
    265                 $tmp = $val; 
    266                 break; 
     260                case 'order_pref': 
     261                case 'deliv_pref': 
     262                    $tmp = $this->arrPref[$val]; 
     263                    break; 
     264                default: 
     265                    $tmp = $val; 
     266                    break; 
    267267            } 
    268268 
     
    278278    function lfMakeReviewCSV($list) { 
    279279        $line = ""; 
    280         reset($list); 
    281         while(list($key, $val) = each($list)){ 
     280 
     281        foreach($list as $key => $val) { 
    282282            $tmp = ""; 
    283283            switch($key) { 
     
    307307    // 各項目をCSV出力用に変換する。(トラックバック) 
    308308    function lfMakeTrackbackCSV($list) { 
     309 
    309310        $line = ""; 
    310         reset($list); 
    311         while(list($key, $val) = each($list)){ 
     311 
     312        foreach($list as $key => $val) { 
    312313            $tmp = ""; 
    313314            switch($key) { 
     
    403404                                           ); 
    404405    } 
    405  
    406  
     406     
    407407    /** 
    408408     * 1次元配列を1行のCSVとして返す 
     
    410410     */ 
    411411    function sfArrayToCsv($fields, $delimiter = ',', $enclosure = '"', $arrayDelimiter = '|') { 
    412  
     412         
    413413        if( strlen($delimiter) != 1 ) { 
    414414            trigger_error('delimiter must be a single character', E_USER_WARNING); 
    415415            return ""; 
    416416        } 
    417  
     417         
    418418        if( strlen($enclosure) < 1 ) { 
    419419            trigger_error('enclosure must be a single character', E_USER_WARNING); 
    420420            return ""; 
    421421        } 
    422  
     422         
    423423        foreach (array_keys($fields) as $key) { 
    424424            $field =& $fields[$key]; 
    425  
     425             
    426426            // 配列を「|」区切りの文字列に変換する 
    427427            if (is_array($field)) { 
    428428                $field = implode($arrayDelimiter, $field); 
    429429            } 
    430  
     430             
    431431            /* enclose a field that contains a delimiter, an enclosure character, or a newline */ 
    432432            if ( 
     
    437437            } 
    438438        } 
    439  
     439         
    440440        return implode($delimiter, $fields); 
    441441    } 
    442  
     442     
    443443    /** 
    444444     * CSVを送信する。 
Note: See TracChangeset for help on using the changeset viewer.