Ignore:
Timestamp:
2013/05/02 18:11:36 (13 years ago)
Author:
h_yoshimoto
Message:

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/helper/SC_Helper_CSV.php

    r22567 r22796  
    1313   * @version $Id$ 
    1414   */ 
    15 class SC_Helper_CSV  
    16 { 
     15class SC_Helper_CSV { 
    1716 
    1817    // {{{ properties 
     
    3029     * デフォルトコンストラクタ. 
    3130     */ 
    32     function __construct() 
    33     { 
     31    function __construct() { 
    3432        $this->init(); 
    3533    } 
     
    4442     * @return void 
    4543     */ 
    46     function init() 
    47     { 
     44    function init() { 
    4845        $this->arrSubnavi = array( 
    4946            1 => 'product', 
     
    7370     * @return mixed $is_download = true時 成功失敗フラグ(boolean) 、$is_downalod = false時 string 
    7471     */ 
    75     function sfDownloadCsv($csv_id, $where = '', $arrVal = array(), $order = '', $is_download = false) 
    76     { 
     72    function sfDownloadCsv($csv_id, $where = '', $arrVal = array(), $order = '', $is_download = false) { 
    7773        // CSV出力タイトル行の作成 
    7874        $arrOutput = SC_Utils_Ex::sfSwapArray($this->sfGetCsvOutput($csv_id, 'status = ' . CSV_COLUMN_STATUS_FLG_ENABLE)); 
     
    104100            $sql = 'SELECT ' . $cols . ' FROM dtb_category ' . $where; 
    105101        } 
    106         // 「getSqlを使っているcsv_id=1」以外で「order指定」がある場合は末尾に付与 
    107         // 全csv_idでgetSqlを使用して生成するよう統一する場合は当メソッドの呼び元も要修正 
    108         $sql = ($csv_id != '1' && strlen($order) >= 1) ? $sql.' order by '.$order : $sql; 
    109102        // 固有処理ここまで 
    110103        return $this->sfDownloadCsvFromSql($sql, $arrVal, $this->arrSubnavi[$csv_id], $arrOutput['disp_name'], $is_download); 
     
    120113     * @return array CSV 項目の配列 
    121114     */ 
    122     function sfGetCsvOutput($csv_id = '', $where = '', $arrVal = array(), $order = 'rank, no') 
    123     { 
     115    function sfGetCsvOutput($csv_id = '', $where = '', $arrVal = array(), $order = 'rank, no') { 
    124116        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    125117 
     
    147139     * @return boolean true:インポート可能、false:インポート不可 
    148140     */ 
    149     function sfIsImportCSVFrame(&$arrCSVFrame) 
    150     { 
     141    function sfIsImportCSVFrame(&$arrCSVFrame) { 
    151142        $result = true; 
    152143        foreach ($arrCSVFrame as $val) { 
     
    169160     * @return boolean true:更新可能、false:新規追加のみ不可 
    170161     */ 
    171     function sfIsUpdateCSVFrame(&$arrCSVFrame) 
    172     { 
     162    function sfIsUpdateCSVFrame(&$arrCSVFrame) { 
    173163        $result = true; 
    174164        foreach ($arrCSVFrame as $val) { 
     
    189179     * @return integer CSV のカウント数 
    190180     */ 
    191     function sfGetCSVRecordCount($fp) 
    192     { 
     181    function sfGetCSVRecordCount($fp) { 
    193182        $count = 0; 
    194183        while (!feof($fp)) { 
     
    210199     * @return boolean true (true:固定 false:中断) 
    211200     */ 
    212     function cbOutputCSV($data) 
    213     { 
     201    function cbOutputCSV($data) { 
    214202        $line = $this->sfArrayToCSV($data); 
    215203        $line = mb_convert_encoding($line, 'SJIS-Win'); 
     
    230218     * @return mixed $is_download = true時 成功失敗フラグ(boolean) 、$is_downalod = false時 string 
    231219     */ 
    232     function sfDownloadCsvFromSql($sql, $arrVal = array(), $file_head = 'csv', $arrHeader = array(), $is_download = false) 
    233     { 
     220    function sfDownloadCsvFromSql($sql, $arrVal = array(), $file_head = 'csv', $arrHeader = array(), $is_download = false) { 
    234221        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    235222 
     
    275262     * @return string 結果行 
    276263     */ 
    277     function sfArrayToCsv($fields, $delimiter = ',', $enclosure = '"', $arrayDelimiter = '|') 
    278     { 
     264    function sfArrayToCsv($fields, $delimiter = ',', $enclosure = '"', $arrayDelimiter = '|') { 
    279265        if (strlen($delimiter) != 1) { 
    280266            trigger_error('delimiter must be a single character', E_USER_WARNING); 
     
    313299     * @return void 
    314300     */ 
    315     function lfDownloadCsv($arrData, $prefix = '') 
    316     { 
     301    function lfDownloadCsv($arrData, $prefix = '') { 
    317302 
    318303        if ($prefix == '') { 
     
    344329     * @return void 
    345330     */ 
    346     function lfDownloadCSVFile($filepath, $prefix = '') 
    347     { 
     331    function lfDownloadCSVFile($filepath, $prefix = '') { 
    348332        $file_name = $prefix . date('YmdHis') . '.csv'; 
    349333 
Note: See TracChangeset for help on using the changeset viewer.