[Svn-src-all:1479] [version-2_5-dev 20371] #1010 カテゴリ登録CSVリファクタリング

adachi admin @ mail.ec-cube.net
2011年 2月 24日 (木) 12:47:51 JST


Subversion committed to /home/svn/open 20371
http://svn.ec-cube.net/open_trac/changeset/20371
┌────────────────────────────┐
│更新者 :  adachi                                       │
│更新日時:  2011-02-24 12:47:51 +0900 (木, 24  2月 2011)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#1010 カテゴリ登録CSVリファクタリング
- 実行結果画面を商品登録CSVに合わせる

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
A   branches/version-2_5-dev/data/Smarty/templates/admin/products/upload_csv_category_complete.tpl
U   branches/version-2_5-dev/data/class/pages/LC_Page.php
U   branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php
U   branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php

追加: branches/version-2_5-dev/data/Smarty/templates/admin/products/upload_csv_category_complete.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/admin/products/upload_csv_category_complete.tpl	                        (rev 0)
+++ branches/version-2_5-dev/data/Smarty/templates/admin/products/upload_csv_category_complete.tpl	2011-02-24 03:47:51 UTC (rev 20371)
@@ -0,0 +1,78 @@
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2010 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.
+ */
+*}-->
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2010 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_category.php"><span class="btn-prev">戻る</span></a></li>
+      </ul>
+  </div>
+</div>


Property changes on: branches/version-2_5-dev/data/Smarty/templates/admin/products/upload_csv_category_complete.tpl
___________________________________________________________________
追加: svn:mime-type
   + text/html
追加: svn:eol-style
   + LF

変更: branches/version-2_5-dev/data/class/pages/LC_Page.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/LC_Page.php	2011-02-24 03:41:11 UTC (rev 20370)
+++ branches/version-2_5-dev/data/class/pages/LC_Page.php	2011-02-24 03:47:51 UTC (rev 20371)
@@ -101,8 +101,8 @@
         $this->objPlugin->preProcess($this);
 
         // トランザクショントークンの検証と生成
-        $this->doValidToken();
-        $this->setTokenTo();
+        //$this->doValidToken();
+        //$this->setTokenTo();
     }
 
     /**

変更: branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php	2011-02-24 03:41:11 UTC (rev 20370)
+++ branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php	2011-02-24 03:47:51 UTC (rev 20371)
@@ -209,7 +209,7 @@
             }
             // 列数が異なる場合はエラー
             $col_count = count($arrCSV);
-            if ($col_max_count != count($arrCSV)) {
+            if ($col_max_count != $col_count) {
                 $this->addRowErr($line_count, "※ 項目数が" . $col_count . "個検出されました。項目数は" . $col_max_count . "個になります。");
                 $errFlag = true;
                 break;

変更: branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php	2011-02-24 03:41:11 UTC (rev 20370)
+++ branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php	2011-02-24 03:47:51 UTC (rev 20371)
@@ -147,8 +147,10 @@
                 continue;
             }
             // 列数が異なる場合はエラー
-            if ($col_max_count != count($arrRow)) {
+            $col_count = count($arrRow);
+            if ($col_max_count != $col_count) {
                 $errFlg = true;
+                $this->addRowErr($line_count, "※ 項目数が" . $col_count . "個検出されました。項目数は" . $col_max_count . "個になります。");
                 break;
             }
             // 数値インデックスから, カラム名 => 値の連想配列へ変換
@@ -241,9 +243,12 @@
                 $this->addRowResult($line_count, $message);
             }
         }
-        
+
         fclose($fp);
 
+        // 実行結果画面を表示
+        $this->tpl_mainpage = 'products/upload_csv_category_complete.tpl';
+
         if ($errFlg) {
             $objQuery->rollback();
             return;




Svn-src-all メーリングリストの案内