質問 > その他 > 管理画面のカテゴリ管理からcsvダウンロードでエラー |
その他
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
pororin |
投稿日時: 2010/6/22 0:49
対応状況: −−−
|
半人前 登録日: 2009/9/22 居住地: 福岡県 投稿: 14 |
管理画面のカテゴリ管理からcsvダウンロードでエラー EC-CUBE は 2.4.3
DBサーバ PostgreSQL 7.4.29 PHP 5.2.13 でWadaxのレンタルサーバー(共有)を使っています。 エラーの内容は下記です。 ───────────────────────── Fatal error: Call to undefined method SC_Helper_CSV_Ex::lfGetCategoryCSV() in /home/******/public_html/data/class_extends/page_extends/admin/products/LC_Page_Admin_Products_Category_Ex.php on line 198 ───────────────────────── LC_Page_Admin_Products_Category_Ex.phpの中身は下記です。 ───────────────────────── <?php /* * This file is part of EC-CUBE * * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. * * http://www.lockon.co.jp/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // {{{ requires require_once(CLASS_PATH . "pages/admin/products/LC_Page_Admin_Products_Category.php"); /** * カテゴリ管理 のページクラス(拡張). * * LC_Page_Admin_Products_Category をカスタマイズする場合はこのクラスを編集する. * * @package Page * @author LOCKON CO.,LTD. * @version $Id: LC_Page_Admin_Products_Category_Ex.php 16741 2007-11-08 00:43:24Z adachi $ */ class LC_Page_Admin_Products_Category_Ex extends LC_Page_Admin_Products_Category { // }}} // {{{ functions /** * Page を初期化する. * * @return void */ function init() { parent::init(); } /** * Page のプロセス. * * @return void */ function process() { //parent::process(); $conn = new SC_DBConn(); $objView = new SC_AdminView(); $objSess = new SC_Session(); $objDb = new SC_Helper_DB_Ex(); // 認証可否の判定 SC_Utils_Ex::sfIsSuccess($objSess); // パラメータ管理クラス $this->objFormParam = new SC_FormParam(); // パラメータ情報の初期化 $this->lfInitParam(); // POST値の取得 $this->objFormParam->setParam($_POST); // 通常時は親カテゴリを0に設定する。 $this->arrForm['parent_category_id'] = isset($_POST['parent_category_id']) ? $_POST['parent_category_id'] : ""; if (!isset($_POST['mode'])) $_POST['mode'] = ""; switch($_POST['mode']) { case 'edit': $this->objFormParam->convParam(); $arrRet = $this->objFormParam->getHashArray(); $this->arrErr = $this->lfCheckError($arrRet); if(count($this->arrErr) == 0) { if($_POST['category_id'] == "") { $objQuery = new SC_Query(); $count = $objQuery->count("dtb_category"); if($count < CATEGORY_MAX) { $this->lfInsertCat($_POST['parent_category_id']); } else { print("カテゴリの登録最大数を超えました。"); } } else { $this->lfUpdateCat($_POST['category_id']); } } else { $this->arrForm = array_merge($this->arrForm, $this->objFormParam->getHashArray()); $this->arrForm['category_id'] = $_POST['category_id']; } break; case 'pre_edit': // 編集項目のカテゴリ名をDBより取得する。 //$oquery = new SC_Query(); $objQuery = new SC_Query(); $where = "category_id = ?"; //$cat_name = $oquery->get("dtb_category", "category_name", $where, array($_POST['category_id'])); $col = "category_name, category_info, info_flg, level"; $arrRet = $objQuery->select($col, "dtb_category", $where, array($_POST['category_id'])); // 入力項目にカテゴリ名を入力する。 //$this->arrForm['category_name'] = $cat_name; $this->arrForm['category_name'] = $arrRet[0]['category_name']; $this->arrForm['category_info'] = $arrRet[0]['category_info']; $this->arrForm['info_flg'] = $arrRet[0]['info_flg']; $this->arrForm['level'] = $arrRet[0]['level']; // POSTデータを引き継ぐ $this->arrForm['category_id'] = $_POST['category_id']; break; case 'delete': $objQuery = new SC_Query(); // 子カテゴリのチェック $where = "parent_category_id = ? AND del_flg = 0"; $count = $objQuery->count("dtb_category", $where, array($_POST['category_id'])); if($count != 0) { $this->arrErr['category_name'] = "※ 子カテゴリが存在するため削除できません。<br>"; } // 登録商品のチェック $table = "dtb_product_categories AS T1 LEFT JOIN dtb_products AS T2 ON T1.product_id = T2.product_id"; $where = "T1.category_id = ? AND T2.del_flg = 0"; $count = $objQuery->count($table, $where, array($_POST['category_id'])); if($count != 0) { $this->arrErr['category_name'] = "※ カテゴリ内に商品が存在するため削除できません。<br>"; } if(!isset($this->arrErr['category_name'])) { // ランク付きレコードの削除(※処理負荷を考慮してレコードごと削除する。) $objDb->sfDeleteRankRecord("dtb_category", "category_id", $_POST['category_id'], "", true); } break; case 'up': $objQuery = new SC_Query(); $objQuery->begin(); $up_id = $this->lfGetUpRankID($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']); if($up_id != "") { // 上のグループのrankから減算する数 $my_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']); // 自分のグループのrankに加算する数 $up_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $up_id); if($my_count > 0 && $up_count > 0) { // 自分のグループに加算 $this->lfUpRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id'], $up_count); // 上のグループから減算 $this->lfDownRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $up_id, $my_count); } } $objQuery->commit(); break; case 'down': $objQuery = new SC_Query(); $objQuery->begin(); $down_id = $this->lfGetDownRankID($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']); if($down_id != "") { // 下のグループのrankに加算する数 $my_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']); // 自分のグループのrankから減算する数 $down_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $down_id); if($my_count > 0 && $down_count > 0) { // 自分のグループから減算 $this->lfUpRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $down_id, $my_count); // 下のグループに加算 $this->lfDownRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id'], $down_count); } } $objQuery->commit(); break; case 'tree': break; case 'csv': require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php"); $objCSV = new SC_Helper_CSV_Ex(); // オプションの指定 $option = "ORDER BY rank DESC"; // CSV出力タイトル行の作成 $arrOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput(5, " WHERE csv_id = 5 AND status = 1")); if (count($arrOutput) <= 0) break; $arrOutputCols = $arrOutput['col']; $arrOutputTitle = $arrOutput['disp_name']; $head = SC_Utils_Ex::sfGetCSVList($arrOutputTitle); $where = "del_flg = 0"; $data = $objCSV->lfGetCategoryCSV($where, $option, $arrval, $arrOutputCols); // CSVを送信する。 SC_Utils_Ex::sfCSVDownload($head.$data, 'category'); exit; break; default: $this->arrForm['parent_category_id'] = 0; break; } $this->arrList = $this->lfGetCat($this->arrForm['parent_category_id']); $this->arrTree = $objDb->sfGetCatTree($this->arrForm['parent_category_id']); $objView->assignobj($this); $objView->display(MAIN_FRAME); } /** * デストラクタ. * * @return void */ function destroy() { parent::destroy(); } // カテゴリの新規追加 function lfInsertCat($parent_category_id) { $objQuery = new SC_Query(); $objQuery->begin(); // トランザクションの開始 if($parent_category_id == 0) { // ROOT階層で最大のランクを取得する。 $where = "parent_category_id = ?"; $rank = $objQuery->max("dtb_category", "rank", $where, array($parent_category_id)) + 1; } else { // 親のランクを自分のランクとする。 $where = "category_id = ?"; $rank = $objQuery->get("dtb_category", "rank", $where, array($parent_category_id)); // 追加レコードのランク以上のレコードを一つあげる。 $sqlup = "UPDATE dtb_category SET rank = (rank + 1) WHERE rank >= ?"; $objQuery->exec($sqlup, array($rank)); } $where = "category_id = ?"; // 自分のレベルを取得する(親のレベル + 1) $level = $objQuery->get("dtb_category", "level", $where, array($parent_category_id)) + 1; // 入力データを渡す。 $sqlval = $this->objFormParam->getHashArray(); $sqlval['create_date'] = "Now()"; $sqlval['update_date'] = "Now()"; $sqlval['creator_id'] = $_SESSION['member_id']; $sqlval['parent_category_id'] = $parent_category_id; $sqlval['rank'] = $rank; $sqlval['level'] = $level; //追記:親の設定を引き継ぐ時 if($sqlval['info_flg']) { $sqlval['category_info'] = $this->lfGetParentInfo($objQuery, $parent_category_id); } // INSERTの実行 $objQuery->insert("dtb_category", $sqlval); $objQuery->commit(); // トランザクションの終了 } // カテゴリの編集 function lfUpdateCat($category_id) { $objQuery = new SC_Query(); // 入力データを渡す。 $sqlval = $this->objFormParam->getHashArray(); $sqlval['update_date'] = "Now()"; $where = "category_id = ?"; //追記:親の設定を引き継ぐ時 if($sqlval['info_flg']) { $parent_category_id = $objQuery->get("dtb_category", "parent_category_id", $where, array($category_id)); $sqlval['category_info'] = $this->lfGetParentInfo($objQuery, $parent_category_id); } $objQuery->update("dtb_category", $sqlval, $where, array($category_id)); } /* パラメータ情報の初期化 */ function lfInitParam() { $this->objFormParam->addParam("カテゴリ名", "category_name", STEXT_LEN, "KVa", array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK")); $this->objFormParam->addParam("カテゴリ説明", "category_info", LLTEXT_LEN, "KVa", array("SPTAB_CHECK","MAX_LENGTH_CHECK")); $this->objFormParam->addParam("親カテゴリ説明のコピー", "info_flg", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK")); } // 追記:親のcategory_infoを取得する function lfGetParentInfo($objQuery, $pid) { $where = "category_id = ?"; $parent_info = $objQuery->get("dtb_category", "category_info", $where, array($pid)); return $parent_info; } } ?> ───────────────────────── コードを何度も調べましたが、原因が分かりません。 教えて頂けると助かります。 |
フラット表示 | 前のトピック | 次のトピック |
題名 | 投稿者 | 日時 |
---|---|---|
» 管理画面のカテゴリ管理からcsvダウンロードでエラー | pororin | 2010/6/22 0:49 |
Re: 管理画面のカテゴリ管理からcsvダウンロードでエラー | AMUAMU | 2010/6/22 1:29 |
Re: 管理画面のカテゴリ管理からcsvダウンロードでエラー | pororin | 2010/6/22 20:21 |