Ignore:
Timestamp:
2011/03/20 07:57:42 (13 years ago)
Author:
AMUAMU
Message:

#657 (CSVダウンロードの改善) 受注ダウンロードの修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order.php

    r20538 r20736  
    133133                // CSVを送信する。 
    134134                case 'csv': 
    135                     list($file_name, $data) = $this->getCSV($where, $arrval, 
    136                                                             $order); 
    137                     $this->sendResponseCSV($file_name, $data); 
     135                    $this->doOutputCSV($where, $arrval,$order); 
    138136                    exit; 
    139137                    break; 
     
    412410     * 
    413411     * @param string $where 検索条件の WHERE 句 
    414      * @param array $arrValues 検索条件のパラメータ 
     412     * @param array $arrVal 検索条件のパラメータ 
    415413     * @param string $order 検索結果の並び順 
    416      * @return array|boolean 構築に成功した場合, ファイルと出力内容の配列; 
    417      *                       失敗した場合 false 
    418      */ 
    419     function getCSV($where, $arrValues, $order) { 
     414     * @return void 
     415     */ 
     416    function doOutputCSV($where, $arrVal, $order) { 
    420417        require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php'; 
     418        if($where != "") { 
     419            $where = " WHERE $where "; 
     420        } 
     421 
    421422        $objCSV = new SC_Helper_CSV_Ex(); 
    422  
    423         $option = "ORDER BY $order"; 
    424  
    425         // CSV出力タイトル行の作成 
    426         $arrCsvOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfGetCsvOutput(3, 'status = 1')); 
    427  
    428         if (count($arrCsvOutput) <= 0) { 
    429             return false; 
    430         } 
    431  
    432         $arrCsvOutputCols = $arrCsvOutput['col']; 
    433         $arrCsvOutputConvs = $arrCsvOutput['conv']; 
    434         $arrCsvOutputTitle = $arrCsvOutput['disp_name']; 
    435         $head = SC_Utils_Ex::sfGetCSVList($arrCsvOutputTitle); 
    436         $data = $objCSV->lfGetCSV("dtb_order", $where, $option, $arrValues, 
    437                                   $arrCsvOutputCols, $arrCsvOutputConvs); 
    438         return SC_Utils_Ex::sfGetCSVData($head . $data); 
     423        $objCSV->sfDownloadCsv("3", $where, $arrVal, $order, true); 
    439424    } 
    440425 
Note: See TracChangeset for help on using the changeset viewer.