Index: /branches/version-2_11-dev/html/install/sql/insert_data.sql
===================================================================
--- /branches/version-2_11-dev/html/install/sql/insert_data.sql	(revision 20848)
+++ /branches/version-2_11-dev/html/install/sql/insert_data.sql	(revision 20852)
@@ -320,4 +320,8 @@
 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (213, 6, 'down_filename', 'ダウンロードファイル名', 13, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (214, 6, 'down_realfilename', 'ダウンロード実ファイル', 14, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 'LTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,DOWN_FILE_EXISTS');
+
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (251, 8, 'product_id', '商品ID', 1, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (252, 8, 'category_id', 'カテゴリID', 2, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (253, 8, 'rank', '表示ランク', 3, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
 
 INSERT INTO dtb_deliv (deliv_id, product_type_id, name, service_name, confirm_url, rank, status, del_flg, creator_id, create_date, update_date) VALUES (1, 1, 'サンプル業者', 'サンプル業者', NULL, 2, 1, 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
Index: /branches/version-2_11-dev/html/admin/products/upload_csv_productcategory.php
===================================================================
--- /branches/version-2_11-dev/html/admin/products/upload_csv_productcategory.php	(revision 20852)
+++ /branches/version-2_11-dev/html/admin/products/upload_csv_productcategory.php	(revision 20852)
@@ -0,0 +1,35 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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 '../require.php';
+require_once CLASS_EX_REALDIR . 'page_extends/admin/products/LC_Page_Admin_Products_UploadCSVProductCategory_Ex.php';
+
+// }}}
+// {{{ generate page
+
+$objPage = new LC_Page_Admin_Products_UploadCSVProductCategory_Ex();
+register_shutdown_function(array($objPage, 'destroy'));
+$objPage->init();
+$objPage->process();
+?>
Index: /branches/version-2_11-dev/data/class_extends/page_extends/admin/products/LC_Page_Admin_Products_UploadCSVProductCategory_Ex.php
===================================================================
--- /branches/version-2_11-dev/data/class_extends/page_extends/admin/products/LC_Page_Admin_Products_UploadCSVProductCategory_Ex.php	(revision 20852)
+++ /branches/version-2_11-dev/data/class_extends/page_extends/admin/products/LC_Page_Admin_Products_UploadCSVProductCategory_Ex.php	(revision 20852)
@@ -0,0 +1,68 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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_REALDIR . 'pages/admin/products/LC_Page_Admin_Products_UploadCSVProductCategory.php';
+
+/**
+ * CSV アップロード のページクラス(拡張)
+ *
+ * LC_Page_Admin_Products_UploadCSV をカスタマイズする場合はこのクラスを編集する.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $$Id: LC_Page_Admin_Products_UploadCSVCategory_Ex.php 20764 2011-03-22 06:26:40Z nanasess $$
+ */
+class LC_Page_Admin_Products_UploadCSVProductCategory_Ex extends LC_Page_Admin_Products_UploadCSVProductCategory {
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init() {
+        parent::init();
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process() {
+        parent::process();
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy() {
+        parent::destroy();
+    }
+}
+?>
Index: /branches/version-2_11-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVProductCategory.php
===================================================================
--- /branches/version-2_11-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVProductCategory.php	(revision 20852)
+++ /branches/version-2_11-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVProductCategory.php	(revision 20852)
@@ -0,0 +1,496 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
+require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
+
+/**
+ * カテゴリ登録CSVのページクラス
+ *
+ * LC_Page_Admin_Products_UploadCSV をカスタマイズする場合はこのクラスを編集する.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $$Id: LC_Page_Admin_Products_UploadCSVCategory.php 20851 2011-04-17 02:34:46Z saiteisan $$
+ */
+class LC_Page_Admin_Products_UploadCSVProductCategory extends LC_Page_Admin_Ex {
+
+    // {{{ properties
+    /** エラー情報 **/
+    var $arrErr;
+
+    /** 表示用項目 **/
+    var $arrTitle;
+
+    /** 結果行情報 **/
+    var $arrRowResult;
+
+    /** エラー行情報 **/
+    var $arrRowErr;
+
+    /** TAGエラーチェックフィールド情報 */
+    var $arrTagCheckItem;
+
+    /** テーブルカラム情報 (登録処理用) **/
+    var $arrRegistColumn;
+
+    /** 登録フォームカラム情報 **/
+    var $arrFormKeyList;
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init() {
+        parent::init();
+        $this->tpl_mainpage = 'products/upload_csv_productcategory.tpl';
+        $this->tpl_subnavi  = 'products/subnavi.tpl';
+        $this->tpl_mainno   = 'products';
+        $this->tpl_subno    = 'upload_csv_productcategory';
+        $this->tpl_subtitle = '商品カテゴリ登録CSV';
+        $this->csv_id = '8';
+
+        $masterData = new SC_DB_MasterData_Ex();
+        $this->arrAllowedTag = $masterData->getMasterData("mtb_allowed_tag");
+        $this->arrTagCheckItem = array();
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process() {
+        $this->action();
+        $this->sendResponse();
+    }
+
+    /**
+     * Page のアクション.
+     *
+     * @return void
+     */
+    function action() {
+        // CSV管理ヘルパー
+        $objCSV = new SC_Helper_CSV_Ex();
+        // CSV構造読み込み
+        $arrCSVFrame = $objCSV->sfGetCsvOutput($this->csv_id);
+
+        // CSV構造がインポート可能かのチェック
+        if(!$objCSV->sfIsImportCSVFrame($arrCSVFrame) ) {
+            // 無効なフォーマットなので初期状態に強制変更
+            $arrCSVFrame = $objCSV->sfGetCsvOutput($this->csv_id, '', array(), 'no');
+            $this->tpl_is_format_default = true;
+        }
+        // CSV構造は更新可能なフォーマットかのフラグ取得
+        $this->tpl_is_update = $objCSV->sfIsUpdateCSVFrame($arrCSVFrame);
+
+        // CSVファイルアップロード情報の初期化
+        $objUpFile = new SC_UploadFile_Ex(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR);
+        $this->lfInitFile($objUpFile);
+
+        // パラメータ情報の初期化
+        $objFormParam = new SC_FormParam_Ex();
+        $this->lfInitParam($objFormParam, $arrCSVFrame);
+
+        $objFormParam->setHtmlDispNameArray();
+        $this->arrTitle = $objFormParam->getHtmlDispNameArray();
+
+        switch($this->getMode()) {
+        case 'csv_upload':
+            $this->doUploadCsv($objFormParam, $objUpFile);
+            break;
+        default:
+            break;
+        }
+    }
+
+    /**
+     * 登録/編集結果のメッセージをプロパティへ追加する
+     *
+     * @param integer $line_count 行数
+     * @param stirng $message メッセージ
+     * @return void
+     */
+    function addRowResult($line_count, $message) {
+        $this->arrRowResult[] = $line_count . "行目：" . $message;
+    }
+
+    /**
+     * 登録/編集結果のエラーメッセージをプロパティへ追加する
+     *
+     * @param integer $line_count 行数
+     * @param stirng $message メッセージ
+     * @return void
+     */
+    function addRowErr($line_count, $message) {
+        $this->arrRowErr[] = $line_count . "行目：" . $message;
+    }
+
+    /**
+     * CSVアップロードを実行する
+     *
+     * @param SC_FormParam  $objFormParam
+     * @param SC_UploadFile $objUpFile
+     * @param SC_Helper_DB  $objDb
+     * @return void
+     */
+    function doUploadCsv(&$objFormParam, &$objUpFile) {
+        // ファイルアップロードのチェック
+        $objUpFile->makeTempFile('csv_file');
+        $arrErr = $objUpFile->checkExists();
+        if (count($arrErr) > 0) {
+            $this->arrErr = $arrErr;
+            return;
+        }
+        // 一時ファイル名の取得
+        $filepath = $objUpFile->getTempFilePath('csv_file');
+        // CSVファイルの文字コード変換
+        $enc_filepath = SC_Utils_Ex::sfEncodeFile($filepath, CHAR_CODE, CSV_TEMP_REALDIR);
+        // CSVファイルのオープン
+        $fp = fopen($enc_filepath, 'r');
+        // 失敗した場合はエラー表示
+        if (!$fp) {
+             SC_Utils_Ex::sfDispError("");
+        }
+
+        // 登録先テーブル カラム情報の初期化
+        $this->lfInitTableInfo();
+
+        // 登録フォーム カラム情報
+        $this->arrFormKeyList = $objFormParam->getKeyList();
+
+        // 登録対象の列数
+        $col_max_count = $objFormParam->getCount();
+        // 行数
+        $line_count = 0;
+
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        $objQuery->begin();
+
+        $errFlag = false;
+
+        while (!feof($fp)) {
+            $arrCSV = fgetcsv($fp, CSV_LINE_MAX);
+            // 行カウント
+            $line_count++;
+            // ヘッダ行はスキップ
+            if ($line_count == 1) {
+                continue;
+            }
+            // 空行はスキップ
+            if (empty($arrCSV)) {
+                continue;
+            }
+            // 列数が異なる場合はエラー
+            $col_count = count($arrCSV);
+            if ($col_max_count != $col_count) {
+                $this->addRowErr($line_count, "※ 項目数が" . $col_count . "個検出されました。項目数は" . $col_max_count . "個になります。");
+                $errFlag = true;
+                break;
+            }
+            // シーケンス配列を格納する。
+            $objFormParam->setParam($arrCSV, true);
+            $arrRet = $objFormParam->getHashArray();
+            $objFormParam->setParam($arrRet);
+            // 入力値の変換
+            $objFormParam->convParam();
+            // <br>なしでエラー取得する。
+            $arrCSVErr = $this->lfCheckError($objFormParam);
+
+            // 入力エラーチェック
+            if (count($arrCSVErr) > 0) {
+                foreach ($arrCSVErr as $err) {
+                    $this->addRowErr($line_count, $err);
+                }
+                $errFlg = true;
+                break;
+            }
+
+            $this->lfRegistProductCategory($objQuery, $line_count, $objFormParam);
+            $this->addRowResult($line_count, "商品ID：" . $objFormParam->getValue('product_id') . " / カテゴリID：" . $objFormParam->getValue('category_id'));
+        }
+
+        // 実行結果画面を表示
+        $this->tpl_mainpage = 'products/upload_csv_productcategory_complete.tpl';
+
+        fclose($fp);
+
+        if ($errFlg) {
+            $objQuery->rollback();
+            return;
+        }
+
+        $objQuery->commit();
+
+        // カテゴリ件数を更新
+        $objDb = new SC_Helper_DB_Ex();
+        $objDb->sfCountCategory($objQuery);
+        return;
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy() {
+        parent::destroy();
+    }
+
+    /**
+     * ファイル情報の初期化を行う.
+     *
+     * @return void
+     */
+    function lfInitFile(&$objUpFile) {
+        $objUpFile->addFile("CSVファイル", 'csv_file', array('csv'), CSV_SIZE, true, 0, 0, false);
+    }
+
+    /**
+     * 入力情報の初期化を行う.
+     *
+     * @param array CSV構造設定配列
+     * @return void
+     */
+    function lfInitParam(&$objFormParam, &$arrCSVFrame) {
+        // 固有の初期値調整
+        $arrCSVFrame = $this->lfSetParamDefaultValue($arrCSVFrame);
+        // CSV項目毎の処理
+        foreach($arrCSVFrame as $item) {
+            if($item['status'] == CSV_COLUMN_STATUS_FLG_DISABLE) continue;
+            //サブクエリ構造の場合は AS名 を使用
+            if(preg_match_all('/\(.+\) as (.+)$/i', $item['col'], $match, PREG_SET_ORDER)) {
+                $col = $match[0][1];
+            }else{
+                $col = $item['col'];
+            }
+            // HTML_TAG_CHECKは別途実行なので除去し、別保存しておく
+            if(strpos(strtoupper($item['error_check_types']), 'HTML_TAG_CHECK') !== FALSE) {
+                $this->arrTagCheckItem[] = $item;
+                $error_check_types = str_replace('HTML_TAG_CHECK', '', $item['error_check_types']);
+            }else{
+                $error_check_types = $item['error_check_types'];
+            }
+            $arrErrorCheckTypes = explode(',', $error_check_types);
+            foreach($arrErrorCheckTypes as $key => $val) {
+                if(trim($val) == "") {
+                    unset($arrErrorCheckTypes[$key]);
+                }else{
+                    $arrErrorCheckTypes[$key] = trim($val);
+                }
+            }
+            // パラメーター登録
+            $objFormParam->addParam(
+                    $item['disp_name']
+                    , $col
+                    , constant($item['size_const_type'])
+                    , $item['mb_convert_kana_option']
+                    , $arrErrorCheckTypes
+                    , $item['default']
+                    , ($item['rw_flg'] != CSV_COLUMN_RW_FLG_READ_ONLY) ? true : false
+                    );
+        }
+    } 
+
+    /**
+     * 入力チェックを行う.
+     *
+     * @return void
+     */
+    function lfCheckError(&$objFormParam) {
+        // 入力データを渡す。
+        $arrRet =  $objFormParam->getHashArray();
+        $objErr = new SC_CheckError_Ex($arrRet);
+        $objErr->arrErr = $objFormParam->checkError(false);
+        // HTMLタグチェックの実行
+        foreach($this->arrTagCheckItem as $item) {
+            $objErr->doFunc(array( $item['disp_name'], $item['col'], $this->arrAllowedTag), array("HTML_TAG_CHECK"));
+        }
+        // このフォーム特有の複雑系のエラーチェックを行う
+        if(count($objErr->arrErr) == 0) {
+            $objErr->arrErr = $this->lfCheckErrorDetail($arrRet, $objErr->arrErr);
+        }
+        return $objErr->arrErr;
+    }
+
+    /**
+     * 保存先テーブル情報の初期化を行う.
+     *
+     * @return void
+     */
+    function lfInitTableInfo() {
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        $this->arrRegistColumn = $objQuery->listTableFields('dtb_product_categories');
+    }
+
+    /**
+     * カテゴリ登録を行う.
+     *
+     * FIXME: 登録の実処理自体は、LC_Page_Admin_Products_Categoryと共通化して欲しい。
+     *
+     * @param SC_Query $objQuery SC_Queryインスタンス
+     * @param string|integer $line 処理中の行数
+     * @return integer カテゴリID
+     */
+    function lfRegistProductCategory($objQuery, $line, &$objFormParam) {
+        // 登録データ対象取得
+        $arrList = $objFormParam->getHashArray();
+        // 登録時間を生成(DBのnow()だとcommitした際、すべて同一の時間になってしまう)
+        $arrList['update_date'] = $this->lfGetDbFormatTimeWithLine($line);
+
+        // 登録情報を生成する。
+        // テーブルのカラムに存在しているもののうち、Form投入設定されていないデータは上書きしない。
+        $sqlval = SC_Utils_Ex::sfArrayIntersectKeys($arrList, $this->arrRegistColumn);
+
+        // 必須入力では無い項目だが、空文字では問題のある特殊なカラム値の初期値設定
+        $sqlval = $this->lfSetCategoryDefaultData($sqlval);
+
+        $this->registerCategory($sqlval, $objQuery);
+    }
+
+    /**
+     * 初期値の設定
+     *
+     * @param array $arrCSVFrame CSV構造配列
+     * @return array $arrCSVFrame CSV構造配列
+     */
+    function lfSetParamDefaultValue(&$arrCSVFrame) {
+        foreach($arrCSVFrame as $key => $val) {
+            switch($val['col']) {
+                default:
+                    break;
+            }
+        }
+        return $arrCSVFrame;
+    }
+
+    /**
+     * データ登録前に特殊な値の持ち方をする部分のデータ部分の初期値補正を行う
+     *
+     * @param array $sqlval 商品登録情報配列
+     * @return $sqlval 登録情報配列
+     */
+    function lfSetCategoryDefaultData(&$sqlval) {
+        return $sqlval;
+    }
+
+    /**
+     * このフォーム特有の複雑な入力チェックを行う.
+     *
+     * @param array 確認対象データ
+     * @param array エラー配列
+     * @return array エラー配列
+     */
+    function lfCheckErrorDetail($item, $arrErr) {
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        // カテゴリIDの存在チェック
+        if(!$this->lfIsDbRecord('dtb_category', 'category_id', $item)) {
+            $arrErr['category_id'] = "※ 指定のカテゴリIDは、登録されていません。";
+        }
+        // 商品IDの存在チェック
+        if(!$this->lfIsDbRecord('dtb_products', 'product_id', $item)) {
+            $arrErr['category_id'] = "※ 指定の商品IDは、登録されていません。";
+        }
+        // 重複チェック
+        if($item['product_id'] != "" && $item['category_id'] != ""){
+            $where = "product_id = ? AND category_id = ?";
+            $count = $objQuery->count('dtb_product_categories',
+                        $where,
+                        array(  $item['product_id'],
+                                $item['category_id']));
+            if($count > 0) {
+                $arrErr['category_name'] = "※ 該当商品は既に該当カテゴリに登録されています。";
+            }
+        }
+        return $arrErr;
+    }
+
+    /**
+     * カテゴリを登録する
+     *
+     * @param integer 親カテゴリID
+     * @param string カテゴリ名
+     * @param integer 作成者のID
+     * @param integer 指定カテゴリID
+     * @return integer カテゴリID
+     */
+    function registerCategory($sqlval, $objQuery) {
+        if($sqlval['rank'] == ""){
+            // 現在の商品カテゴリを取得
+            $arrCat = $objQuery->select("product_id, category_id, rank",
+                                    "dtb_product_categories",
+                                    "category_id = ?",
+                                    array($sqlval['category_id']));
+
+            $max = "0";
+            foreach ($arrCat as $val) {
+                // 最上位ランクを取得
+                $max = ($max < $val['rank']) ? $val['rank'] : $max;
+            }
+            $sqlval['rank'] = $max + 1;
+        }
+        $objQuery->insert("dtb_product_categories", $sqlval);
+    }
+
+    /**
+     * 指定された行番号をmicrotimeに付与してDB保存用の時間を生成する。
+     * トランザクション内のnow()は全てcommit()時の時間に統一されてしまう為。
+     *
+     * @param string $line_no 行番号
+     * @return string $time DB保存用の時間文字列
+     */
+    function lfGetDbFormatTimeWithLine($line_no = '') {
+        $time = date("Y-m-d H:i:s");
+        // 秒以下を生成
+        if($line_no != '') {
+            $microtime = sprintf("%06d", $line_no);
+            $time .= ".$microtime";
+        }
+        return $time;
+    }
+
+    /**
+     * 指定されたキーと値の有効性のDB確認
+     *
+     * @param string $table テーブル名
+     * @param string $keyname キー名
+     * @param array  $item 入力データ配列
+     * @return boolean true:有効なデータがある false:有効ではない
+     */
+    function lfIsDbRecord($table, $keyname, $item) {
+        if(array_search($keyname, $this->arrFormKeyList) !== FALSE  //入力対象である
+                and $item[$keyname] != ""   // 空ではない
+                and !SC_Helper_DB_EX::sfIsRecord($table, $keyname, (array)$item[$keyname]) //DBに存在するか
+                ) {
+            return false;
+        }
+        return true;
+    }
+
+}
Index: /branches/version-2_11-dev/data/Smarty/templates/admin/products/upload_csv_productcategory.tpl
===================================================================
--- /branches/version-2_11-dev/data/Smarty/templates/admin/products/upload_csv_productcategory.tpl	(revision 20852)
+++ /branches/version-2_11-dev/data/Smarty/templates/admin/products/upload_csv_productcategory.tpl	(revision 20852)
@@ -0,0 +1,90 @@
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+*}-->
+<!--★★メインコンテンツ★★-->
+<form name="form1" id="form1" method="post" action="?" enctype="multipart/form-data" onSubmit="winSubmit('','form1', 'upload', 500, 400)">
+<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
+<input type="hidden" name="mode" value="csv_upload" />
+<div id="products" class="contents-main">
+    <!--{if $tpl_errtitle != ""}-->
+    <p>
+        <span class="attention"><!--{$tpl_errtitle}--><br />
+        <!--{foreach key=key item=item from=$arrCSVErr}-->
+        <!--{$item}-->
+        <!--{if $key != 'blank'}-->
+        [値：<!--{$arrParam[$key]}-->]
+        <!--{/if}-->
+        <br />
+        <!--{/foreach}-->
+        </span>
+    </p>
+    <!--{/if}-->
+
+    <!--▼登録テーブルここから-->
+    <table class="form">
+        <tr>
+            <th>CSVファイル</th>
+            <td>
+                <!--{if $arrErr.csv_file}--><span class="attention"><!--{$arrErr.csv_file}--></span><!--{/if}-->
+                <input type="file" name="csv_file" size="60" class="box60" /><span class="attention"> (1行目タイトル行)</span>
+            </td>
+        </tr>
+        <tr>
+            <th>登録情報</th>
+            <td>
+                <!--{foreach name=title key=key item=item from=$arrTitle}-->
+                <!--{$smarty.foreach.title.iteration}-->項目：<!--{$item}--><br>
+                <!--{/foreach}-->
+            </td>
+        </tr>
+    </table>
+    <!--▲登録テーブルここまで-->
+    <div class="btn-area">
+        <ul>
+            <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'csv_upload', '', ''); return false;"><span class="btn-next">この内容で登録する</span></a></li>
+        </ul>
+    </div>
+    <!--{if $arrRowErr}-->
+    <table class="form">
+        <tr>
+            <td>
+                <!--{foreach item=err from=$arrRowErr}-->
+                <span class="attention"><!--{$err}--></span>
+                <!--{/foreach}-->
+            </td>
+        </tr>
+    </table>
+    <!--{/if}-->
+    <!--{if $arrRowResult}-->
+    <table class="form">
+        <tr>
+            <td>
+                <!--{foreach item=result from=$arrRowResult}-->
+                <span><!--{$result}--><br/></span>
+                <!--{/foreach}-->
+            </td>
+        </tr>
+    </table>
+    <!--{/if}-->
+</div>
+</form>
Index: /branches/version-2_11-dev/data/Smarty/templates/admin/products/subnavi.tpl
===================================================================
--- /branches/version-2_11-dev/data/Smarty/templates/admin/products/subnavi.tpl	(revision 20818)
+++ /branches/version-2_11-dev/data/Smarty/templates/admin/products/subnavi.tpl	(revision 20852)
@@ -32,4 +32,5 @@
 <li<!--{if $tpl_subno == 'category'}--> class="on"<!--{/if}--> id="navi-products-category"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->products/category.php"><span>カテゴリ登録</span></a></li>
 <li<!--{if $tpl_subno == 'upload_csv_category'}--> class="on"<!--{/if}--> id="navi-products-upload-csv-category"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->products/upload_csv_category.php"><span>カテゴリ登録CSV</span></a></li>
+<li<!--{if $tpl_subno == 'upload_csv_productcategory'}--> class="on"<!--{/if}--> id="navi-products-upload-csv-productcategory"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->products/upload_csv_productcategory.php"><span>商品カテゴリ登録CSV</span></a></li>
 <li<!--{if $tpl_subno == 'maker'}--> class="on"<!--{/if}--> id="navi-products-maker"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->products/maker.php"><span>メーカー登録</span></a></li>
 <li<!--{if $tpl_subno == 'product_rank'}--> class="on"<!--{/if}--> id="navi-products-rank"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->products/product_rank.php"><span>商品並び替え</span></a></li>
Index: /branches/version-2_11-dev/data/Smarty/templates/admin/products/upload_csv_productcategory_complete.tpl
===================================================================
--- /branches/version-2_11-dev/data/Smarty/templates/admin/products/upload_csv_productcategory_complete.tpl	(revision 20852)
+++ /branches/version-2_11-dev/data/Smarty/templates/admin/products/upload_csv_productcategory_complete.tpl	(revision 20852)
@@ -0,0 +1,55 @@
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+*}-->
+<div id="products" class="contents-main">
+    <div class="message">
+        <span>CSV登録を実行しました。</span>
+    </div>
+    <!--{if $arrRowErr}-->
+        <table class="form">
+            <tr>
+                <td>
+                    <!--{foreach item=err from=$arrRowErr}-->
+                        <span class="attention"><!--{$err}--></span>
+                    <!--{/foreach}-->
+                </td>
+            </tr>
+        </table>
+    <!--{/if}-->
+    <!--{if $arrRowResult}-->
+        <table class="form">
+            <tr>
+                <td>
+                    <!--{foreach item=result from=$arrRowResult}-->
+                    <span><!--{$result}--><br/></span>
+                    <!--{/foreach}-->
+                </td>
+            </tr>
+        </table>
+    <!--{/if}-->
+    <div class="btn-area">
+        <ul>
+            <li><a class="btn-action" href="./upload_csv_productcategory.php"><span class="btn-prev">戻る</span></a></li>
+        </ul>
+    </div>
+</div>
