Changeset 18544


Ignore:
Timestamp:
2010/02/03 15:17:02 (14 years ago)
Author:
nanasess
bzr:base-revision:
ohkouchi@loop-az.jp-20100202103421-3rbbop6uzpfn6g0j
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-20100203061657-95zs5i4upxoc23qk
bzr:revno:
2154
bzr:revprop:branch-nick:
branches/comu-ver2
bzr:root:
branches/comu-ver2
bzr:text-parents:

data/class/helper/SC_Helper_CSV.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/comu-ver2:18234
bzr:timestamp:
2010-02-03 15:16:57.414999962 +0900
bzr:user-agent:
bzr2.0.4+bzr-svn1.0.1
svn:original-date:
2010-02-03T06:16:57.415000Z
Message:

merged r18542

  • Fix typo
File:
1 edited

Legend:

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

    r18234 r18544  
    9999    } 
    100100 
    101  
    102101    // CSVを送信する。(商品) 
    103102    function sfDownloadProductsCsv($where, $arrval, $order) { 
     
    117116            ,$arrval 
    118117        ); 
    119          
     118 
    120119        // 規格分類名一覧 
    121120        if (in_array('classcategory_id1', $arrOutputCols) || in_array('classcategory_id2', $arrOutputCols)) { 
     
    125124 
    126125        $outputArray = array(); 
    127          
     126 
    128127        // ヘッダ行 
    129128        $outputArray[] = $arrOutput['disp_name']; 
    130          
     129 
    131130        // データ行 
    132131        foreach ($dataRows as $row) { 
     
    146145                                  "category_id", 
    147146                                  "product_id = ?", 
    148                                   array($row['product_id'])); 
    149             } 
    150  
    151             $outputArray[] = $row; 
    152         } 
    153          
    154         // CSVを送信する。 
    155         $this->lfDownloadCsv($outputArray); 
    156          
    157         // 成功終了 
    158         return ture; 
     147                                   array($row['product_id'])); 
     148         } 
     149 
     150           $outputArray[] = $row; 
     151       } 
     152 
     153       // CSVを送信する。 
     154       $this->lfDownloadCsv($outputArray); 
     155 
     156       // 成功終了 
     157       return true; 
    159158    } 
    160159 
     
    201200    function sfDownloadCategoryCsv() { 
    202201 
    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; // 失敗終了 
     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; // 失敗終了 
    206205        $arrOutputCols = $arrOutput['col']; 
    207206 
     
    214213            ,'del_flg = 0' 
    215214        ); 
    216          
     215 
    217216        $outputArray = array(); 
    218          
     217 
    219218        // ヘッダ行 
    220219        $outputArray[] = $arrOutput['disp_name']; 
    221          
     220 
    222221        // データ行 
    223222        foreach ($dataRows as $row) { 
    224223            $outputArray[] = $row; 
    225224        } 
    226          
     225 
    227226        // CSVを送信する。 
    228227        $this->lfDownloadCsv($outputArray, 'category'); 
    229          
     228 
    230229        // 成功終了 
    231         return ture; 
     230        return true; 
    232231    } 
    233232 
     
    254253    function lfMakeCSV($list) { 
    255254        $line = ""; 
    256          
    257         foreach($list as $key => $val) { 
     255 
     256        eset($list); 
     257        while(list($key, $val) = each($list)){ 
    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  
    281         foreach($list as $key => $val) { 
     280        reset($list); 
     281        while(list($key, $val) = each($list)){ 
    282282            $tmp = ""; 
    283283            switch($key) { 
     
    307307    // 各項目をCSV出力用に変換する。(トラックバック) 
    308308    function lfMakeTrackbackCSV($list) { 
    309  
    310309        $line = ""; 
    311  
    312         foreach($list as $key => $val) { 
     310        reset($list); 
     311        while(list($key, $val) = each($list)){ 
    313312            $tmp = ""; 
    314313            switch($key) { 
     
    404403                                           ); 
    405404    } 
    406      
     405 
     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.