Index: /branches/version-2_5-dev/html/install/sql/insert_data.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/insert_data.sql	(revision 20592)
+++ /branches/version-2_5-dev/html/install/sql/insert_data.sql	(revision 20595)
@@ -611,4 +611,5 @@
 INSERT INTO dtb_products (product_id, name, maker_id, status, comment1, comment2, comment3, comment4, comment5, comment6, note, main_list_comment, main_list_image, main_comment, main_image, main_large_image, sub_title1, sub_comment1, sub_image1, sub_large_image1, sub_title2, sub_comment2, sub_image2, sub_large_image2, sub_title3, sub_comment3, sub_image3, sub_large_image3, sub_title4, sub_comment4, sub_image4, sub_large_image4, sub_title5, sub_comment5, sub_image5, sub_large_image5, sub_title6, sub_comment6, sub_image6, sub_large_image6, del_flg, creator_id, create_date, update_date, deliv_date_id) VALUES (3, 'おなべレシピ', NULL, 1, NULL, NULL, '鍋,なべ,ナベ,レシピ,作り方', NULL, NULL, NULL, NULL, 'あの、秘伝のお鍋レシピです。', 'recipe130.jpg', '自分でチャレンジしてみたい方に。', 'recipe260.jpg', 'recipe500.jpg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1);
 
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(0, 1, NULL, 'ice-01', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
 INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(1, 1, 10, 'ice-01', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
 INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(2, 1, 11, 'ice-02', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
Index: /branches/version-2_5-dev/html/user_data/packages/admin/js/admin.js
===================================================================
--- /branches/version-2_5-dev/html/user_data/packages/admin/js/admin.js	(revision 20566)
+++ /branches/version-2_5-dev/html/user_data/packages/admin/js/admin.js	(revision 20595)
@@ -243,35 +243,4 @@
 }
 
-// 在庫数制限判定
-function fnCheckStockNoLimit(no, icolor) {
-    $check_key = "stock_unlimited:"+no;
-    $input_key = "stock:"+no;
-
-    list = new Array($input_key );
-    if(document.form1[$check_key].checked) {
-        fnChangeDisabled(list, icolor);
-        document.form1[$input_key].value = "";
-    } else {
-        fnChangeDisabled(list, '');
-    }
-}
-
-// 在庫数判定
-function fnCheckAllStockLimit(max, icolor) {
-    for(no = 1; no <= max; no++) {
-        $check_key = "stock_unlimited:"+no;
-        $input_key = "stock:"+no;
-
-        list = new Array($input_key);
-
-        if(document.form1[$check_key].checked) {
-            fnChangeDisabled(list, icolor);
-            document.form1[$input_key].value = "";
-        } else {
-            fnChangeDisabled(list, '');
-        }
-    }
-}
-
 // Form指定のSubmit
 function fnFormSubmit(form) {
Index: /branches/version-2_5-dev/data/Smarty/templates/admin/products/product_class.tpl
===================================================================
--- /branches/version-2_5-dev/data/Smarty/templates/admin/products/product_class.tpl	(revision 20514)
+++ /branches/version-2_5-dev/data/Smarty/templates/admin/products/product_class.tpl	(revision 20595)
@@ -22,17 +22,46 @@
  */
 *}-->
+<script type="text/javascript">//<![CDATA[
+$(function() {
+    $('input[id^=stock_unlimited_]').each(function() {
+        var index = $(this).attr('id').replace(/^stock_unlimited_/ig, '');
+        var checked = $(this).attr('checked');
+
+        if (checked) {
+            $('#stock_' + index)
+                .attr('readonly', true)
+                .css('background-color', '<!--{$smarty.const.DISABLED_RGB}-->');
+        }
+    });
+
+    $('input[id^=stock_unlimited_]').change(function() {
+        var index = $(this).attr('id').replace(/^stock_unlimited_/ig, '');
+        var checked = $(this).attr('checked');
+
+        if (checked) {
+            $('#stock_' + index)
+                .attr('readonly', true)
+                .css('background-color', '<!--{$smarty.const.DISABLED_RGB}-->');
+        } else {
+            $('#stock_' + index)
+                .attr('readonly', false)
+                .css('background-color', '');
+        }
+    });
+});
+//]]>
+</script>
 <h2>商品規格登録</h2>
 <form name="form1" id="form1" method="post" action="" enctype="multipart/form-data">
 <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
-<!--{foreach key=key item=item from=$arrSearchHidden}-->
-<input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" />
-<!--{/foreach}-->
+<!--{* foreach key=name item=item from=$arrSearchHidden *}-->
+<input type="hidden" name="<!--{$name}-->" value="<!--{$item|h}-->" />
+<!--{* /foreach *}-->
 <input type="hidden" name="mode" value="edit" />
-<input type="hidden" name="product_id" value="<!--{$tpl_product_id}-->" />
-<input type="hidden" name="pageno" value="<!--{$tpl_pageno}-->" />
+<input type="hidden" name="product_id" value="<!--{$arrForm.product_id.value|h}-->" />
 <input type="hidden" name="down_key" value="">
-<!--{foreach key=key item=item from=$arrHidden}-->
-<input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" />
-<!--{/foreach}-->
+<!--{* foreach key=name item=item from=$arrHidden *}-->
+<input type="hidden" name="<!--{$name}-->" value="<!--{$item|h}-->" />
+<!--{* /foreach *}-->
 <div id="products" class="contents-main">
 
@@ -40,15 +69,17 @@
         <tr>
             <th>商品名</th>
-            <td><!--{$arrForm.product_name|h}--></td>
+            <td><!--{$arrForm.product_name.value|h}--></td>
         </tr>
         <tr>
             <th>規格1<span class="attention">*</span></th>
             <td>
-                <!--{if $arrErr.select_class_id1}-->
-                <span class="attention"><!--{$arrErr.select_class_id1}--></span>
+                <!--{assign var=key value="select_class_id1"}-->
+                <!--{if $arrErr[$key]}-->
+                <span class="attention"><!--{$arrErr[$key]}--></span>
                 <!--{/if}-->
-                <select name="select_class_id1">
+
+                <select name="<!--{$key}-->">
                     <option value="">選択してください</option>
-                    <!--{html_options options=$arrClass selected=$arrForm.select_class_id1}-->
+                    <!--{html_options options=$arrClass selected=$arrForm[$key].value}-->
                 </select>
             </td>
@@ -57,10 +88,11 @@
             <th>規格2</th>
             <td>
-                <!--{if $arrErr.select_class_id2}-->
-                <span class="attention"><!--{$arrErr.select_class_id2}--></span>
+                <!--{assign var=key value="select_class_id2"}-->
+                <!--{if $arrErr[$key]}-->
+                <span class="attention"><!--{$arrErr[$key]}--></span>
                 <!--{/if}-->
-                <select name="select_class_id2">
+                <select name="<!--{$key}-->">
                     <option value="">選択してください</option>
-                    <!--{html_options options=$arrClass selected=$arrForm.select_class_id2}-->
+                    <!--{html_options options=$arrClass selected=$arrForm[$key].value}-->
                 </select>
             </td>
@@ -71,5 +103,5 @@
             <li><a class="btn-action" href="javascript:;" onclick="fnChangeAction('<!--{$smarty.const.ADMIN_PRODUCTS_URLPATH}-->'); fnModeSubmit('search','',''); return false;" ><span class="btn-prev">検索結果へ戻る</span></a></li>
             <li><a class="btn-action" href="javascript:;" onclick="fnModeSubmit('disp','',''); return false;"><span class="btn-next">表示する</span></a></li>
-        <!--{if count($arrClassCat) > 0}-->
+        <!--{if $arrForm.total.value > 0}-->
             <li><a class="btn-action" href="javascript:;" onclick="fnModeSubmit('delete','',''); return false;"><span class="btn-next">削除する</span></a></li>
         <!--{/if}-->
@@ -77,5 +109,5 @@
     </div>
 
-    <!--{if count($arrClassCat) > 0}-->
+    <!--{if $arrForm.total.value > 0}-->
 
     <!--{foreach item=item name=i from=$arrClassCat}-->
@@ -90,8 +122,10 @@
     </div>
 
-    <!--{assign var=class_id1 value=$arrForm.class_id1}-->
-    <!--{assign var=class_id2 value=$arrForm.class_id2}-->
-    <input type="hidden" name="class_id1" value="<!--{$class_id1}-->" />
-    <input type="hidden" name="class_id2" value="<!--{$class_id2}-->" />
+    <!--{assign var=key1 value="class_id1"}-->
+    <!--{assign var=key2 value="class_id2"}-->
+    <!--{assign var=class_id1 value=$arrForm[$key1].value|h}-->
+    <!--{assign var=class_id2 value=$arrForm[$key2].value|h}-->
+    <input type="hidden" name="<!--{$key1}-->" value="<!--{$class_id1}-->" />
+    <input type="hidden" name="<!--{$key2}-->" value="<!--{$class_id2}-->" />
     <table class="list" width="900">
         <colgroup width="5%">
@@ -108,6 +142,6 @@
         <tr>
             <th><input type="checkbox" onclick="fnAllCheck(this, 'input[name^=check]')" id="allCheck" /> <label for="allCheck"><br>登録</label></th>
-            <th>規格1<br>(<!--{$arrClass[$class_id1]|default:"未選択"}-->)</th>
-            <th>規格2<br>(<!--{$arrClass[$class_id2]|default:"未選択"}-->)</th>
+            <th>規格1<br>(<!--{$arrClass[$class_id1]|default:"未選択"|h}-->)</th>
+            <th>規格2<br>(<!--{$arrClass[$class_id2]|default:"未選択"|h}-->)</th>
             <th>商品コード</th>
             <th>在庫数<span class="attention">*</span></th>
@@ -118,5 +152,8 @@
             <th>ダウンロード商品用<br>ファイル</th>
         </tr>
-        <!--{section name=cnt loop=$arrClassCat}-->
+        <!--{section name=cnt loop=$arrForm.total.value}-->
+            <!--{assign var=index value=$smarty.section.cnt.index}-->
+
+            <!--{* TODO *}-->
             <!--{assign var=key value="error:`$smarty.section.cnt.iteration`"}-->
             <!--{if $arrErr[$key] != ""}-->
@@ -126,46 +163,62 @@
             <!--{/if}-->
             <tr >
-                <!--{assign var=key value="check:`$smarty.section.cnt.iteration`"}-->
+
                 <td class="center" >
-                    <!--{assign var=id value="product_class_id:`$smarty.section.cnt.iteration`"}-->
-                    <input type="hidden" name="classcategory_id1:<!--{$smarty.section.cnt.iteration}-->" value="<!--{$arrClassCat[cnt].classcategory_id1}-->" />
-                    <input type="hidden" name="classcategory_id2:<!--{$smarty.section.cnt.iteration}-->" value="<!--{$arrClassCat[cnt].classcategory_id2}-->" />
-                    <input type="hidden" name="name1:<!--{$smarty.section.cnt.iteration}-->" value="<!--{$arrClassCat[cnt].name1}-->" />
-                    <input type="hidden" name="name2:<!--{$smarty.section.cnt.iteration}-->" value="<!--{$arrClassCat[cnt].name2}-->" />
-                    <input type="hidden" name="product_class_id:<!--{$smarty.section.cnt.iteration}-->" value="<!--{$arrForm[$id]}-->" />
-                    <input type="checkbox" name="check:<!--{$smarty.section.cnt.iteration}-->" value="1" <!--{if $arrForm[$key] == 1}-->checked="checked"<!--{/if}-->>
-                </td>
-                <td class="center"><!--{$arrClassCat[cnt].name1}--></td>
-                <td class="center"><!--{$arrClassCat[cnt].name2}--></td>
-                <!--{assign var=key value="product_code:`$smarty.section.cnt.iteration`"}-->
-                <td class="center"><input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key]}-->" size="6" class="box6" maxlength="<!--{$smarty.const.STEXT_LEN}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}-->></td>
-                <!--{assign var=key value="stock:`$smarty.section.cnt.iteration`"}-->
-                <!--{assign var=chkkey value="stock_unlimited:`$smarty.section.cnt.iteration`"}-->
-                <td class="center">
-                    <input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key]}-->" size="6" class="box6" maxlength="<!--{$smarty.const.AMOUNT_LEN}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}-->>
-                    <!--{assign var=key value="stock_unlimited:`$smarty.section.cnt.iteration`"}--><br />
-                    <input type="checkbox" name="<!--{$key}-->" value="1" <!--{if $arrForm[$key] == "1"}-->checked<!--{/if}--> onClick="fnCheckStockNoLimit('<!--{$smarty.section.cnt.iteration}-->','<!--{$smarty.const.DISABLED_RGB}-->');"/>無制限
-                </td>
-                <!--{assign var=key value="price01:`$smarty.section.cnt.iteration`"}-->
-                <td class="center"><input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key]}-->" size="6" class="box6" maxlength="<!--{$smarty.const.PRICE_LEN}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}-->></td>
-                <!--{assign var=key value="price02:`$smarty.section.cnt.iteration`"}-->
-                <td class="center"><input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key]}-->" size="6" class="box6" maxlength="<!--{$smarty.const.PRICE_LEN}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}-->></td>
+                    <!--{assign var=key value="classcategory_id1"}-->
+                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
+                    <!--{assign var=key value="classcategory_id2"}-->
+                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
+                    <!--{assign var=key value="product_class_id"}-->
+                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
+                    <!--{assign var=key value="check"}-->
+                    <input type="checkbox" name="<!--{$key}-->[<!--{$index}-->]" value="1" <!--{if $arrForm[$key].value[$index] == 1}-->checked="checked"<!--{/if}--> />
+                </td>
+                <td class="center">
+                    <!--{assign var=key value="classcategory_name1"}-->
+                    <!--{$arrForm[$key].value[$index]|h}-->
+                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
+                </td>
+                <td class="center">
+                    <!--{assign var=key value="classcategory_name2"}-->
+                    <!--{$arrForm[$key].value[$index]|h}-->
+                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
+                </td>
+                <td class="center">
+                    <!--{assign var=key value="product_code"}-->
+                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> />
+                </td>
+                <td class="center">
+                    <!--{assign var=key value="stock"}-->
+                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" />
+                    <!--{assign var=key value="stock_unlimited"}--><br />
+                    <input type="checkbox" name="<!--{$key}-->[<!--{$index}-->]" value="1" <!--{if $arrForm[$key].value[$index] == "1"}-->checked="checked"<!--{/if}--> onClick="fnCheckStockNoLimit('<!--{$index}-->','<!--{$smarty.const.DISABLED_RGB}-->');" id="<!--{$key}-->_<!--{$index}-->" /><label for="<!--{$key}-->_<!--{$index}-->">無制限</label>
+                </td>
+                <td class="center">
+                    <!--{assign var=key value="price01"}-->
+                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> />
+                </td>
+                <td class="center">
+                    <!--{assign var=key value="price02"}-->
+                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> />
+                </td>
                 <td class="class-product-type">
-                    <!--{assign var=key value="product_type_id:`$smarty.section.cnt.iteration`"}-->
-                    <!--{html_radios name=$key options=$arrProductType selected=$arrForm[$key] separator='<br />'}-->
-                </td>
-                <td class="center">
-                    <!--{assign var=key value="down_filename:`$smarty.section.cnt.iteration`"}-->
+                    <!--{assign var=key value="product_type_id"}-->
+                    <!--{html_radios name="`$key`[`$index`]" options=$arrProductType selected=$arrForm[$key].value[$index]|h separator='<br />'}-->
+                </td>
+                <td class="center">
+                    <!--{assign var=key value="down_filename}-->
                     <span class="attention"><!--{$arrErr[$key]}--></span>
-                    <input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key]|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" style="<!--{if $arrErr[$key] != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}--><!--{/if}-->" size="10" />
-                </td>
-                <!--{assign var=key value="down_realfilename:`$smarty.section.cnt.iteration`"}-->
-                <td><span class="attention"><!--{$arrErr[$key]}--></span>
-                    <!--{if $arrForm[$key] != ""}-->
-                        <!--{$arrForm[$key]|h}--><input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key]|h}-->">
-                        <a href="" onclick="fnFormModeSubmit('form1', 'delete_down', 'down_key', '<!--{$key}-->'); return false;">[ファイルの取り消し]</a><br>
+                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{if $arrErr[$key] != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}--><!--{/if}-->" size="10" />
+                </td>
+                <td>
+                    <!--{assign var=key value="down_realfilename"}-->
+                    <span class="attention"><!--{$arrErr[$key]}--></span>
+                    <!--{if $arrForm[$key].value[$index] != ""}-->
+                        <!--{$arrForm[$key].value[$index]|h}-->
+                        <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
+                        <a href="?" onclick="fnFormModeSubmit('form1', 'delete_down', 'down_key[<!--{$index}-->]', '<!--{$key}-->'); return false;">[ファイルの取り消し]</a><br />
                     <!--{/if}-->
-                    <input type="file" name="<!--{$key}-->" size="10" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" /><br />
-                    <a class="btn-normal" href="javascript:;" name="btn" onclick="fnFormModeSubmit('form1', 'upload_down', 'down_key', '<!--{$key}-->'); return false;">アップロード</a>
+                    <input type="file" name="<!--{$key}-->[<!--{$index}-->]" size="10" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" /><br />
+                    <a class="btn-normal" href="javascript:;" name="btn" onclick="fnFormModeSubmit('form1', 'upload_down', 'down_key', '<!--{$key}-->[<!--{$index}-->]'); return false;">アップロード</a>
                 </td>
             </tr>
Index: /branches/version-2_5-dev/data/Smarty/templates/admin/products/product_class_confirm.tpl
===================================================================
--- /branches/version-2_5-dev/data/Smarty/templates/admin/products/product_class_confirm.tpl	(revision 20514)
+++ /branches/version-2_5-dev/data/Smarty/templates/admin/products/product_class_confirm.tpl	(revision 20595)
@@ -24,21 +24,38 @@
 <h2>確認</h2>
 <form name="form1" id="form1" method="post" action="?" enctype="multipart/form-data">
+<input type="hidden" name="mode" value="" />
 <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
-<!--{foreach key=key item=item from=$arrForm}-->
-    <input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" />
+<!--{foreach key=key item=items from=$arrForm}-->
+    <!--{if is_array($items.value)}-->
+        <!--{foreach key=index item=item from=$items.value}-->
+            <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$item|h}-->" />
+        <!--{/foreach}-->
+    <!--{else}-->
+        <input type="hidden" name="<!--{$key}-->" value="<!--{$items.value|h}-->" />
+    <!--{/if}-->
 <!--{/foreach}-->
 
-<!--{foreach key=key item=item from=$arrHidden}-->
-    <input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" />
+<!--{* TODO 不要？ *}-->
+<!--{foreach key=key item=items from=$arrSearchHidden}-->
+    <!--{if is_array($items.value)}-->
+        <!--{foreach key=index item=item from=$items.value}-->
+            <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$item|h}-->" />
+        <!--{/foreach}-->
+    <!--{else}-->
+        <input type="hidden" name="<!--{$key}-->" value="<!--{$items|h}-->" />
+    <!--{/if}-->
 <!--{/foreach}-->
+
 <div id="products" class="contents-main">
 
-    <!--{if $tpl_check > 0}-->
+    <!--{if count($arrForm.check.value) > 0}-->
+        <!--{assign var=key1 value="class_id1"}-->
+        <!--{assign var=key2 value="class_id2"}-->
+        <!--{assign var=class_id1 value=$arrForm[$key1].value|h}-->
+        <!--{assign var=class_id2 value=$arrForm[$key2].value|h}-->
         <table class="list">
-            <!--{assign var=class_id1 value=$arrForm.class_id1}-->
-            <!--{assign var=class_id2 value=$arrForm.class_id2}-->
-            <tr>
-                <th>規格1(<!--{$arrClass[$class_id1]|default:"未選択"}-->)</th>
-                <th>規格2(<!--{$arrClass[$class_id2]|default:"未選択"}-->)</th>
+                <tr>
+                <th>規格1(<!--{$arrClass[$class_id1]|default:"未選択"|h}-->)</th>
+                <th>規格2(<!--{$arrClass[$class_id2]|default:"未選択"|h}-->)</th>
                 <th>商品コード</th>
                 <th>在庫数</th>
@@ -49,37 +66,38 @@
                 <th>ダウンロード商品用ファイルアップロード</th>
             </tr>
-            <!--{section name=cnt loop=$tpl_count}-->
-                <!--{assign var=key value="check:`$smarty.section.cnt.iteration`"}-->
-                <!--{if $arrForm[$key] == 1}-->
+            <!--{section name=cnt loop=$arrForm.total.value}-->
+                <!--{assign var=index value=$smarty.section.cnt.index}-->
+
+                <!--{if $arrForm.check.value[$index] == 1}-->
                     <tr>
-                        <!--{assign var=key value="name1:`$smarty.section.cnt.iteration`"}-->
-                        <td><!--{$arrForm[$key]}--></td>
-                        <!--{assign var=key value="name2:`$smarty.section.cnt.iteration`"}-->
-                        <td><!--{$arrForm[$key]}--></td>
-                        <!--{assign var=key value="product_code:`$smarty.section.cnt.iteration`"}-->
-                        <td><!--{$arrForm[$key]}--></td>
-                        <!--{assign var=key1 value="stock:`$smarty.section.cnt.iteration`"}-->
-                        <!--{assign var=key2 value="stock_unlimited:`$smarty.section.cnt.iteration`"}-->
+                        <!--{assign var=key value="classcategory_name1"}-->
+                        <td><!--{$arrForm[$key].value[$index]|h}--></td>
+                        <!--{assign var=key value="classcategory_name2"}-->
+                        <td><!--{$arrForm[$key].value[$index]|h}--></td>
+                        <!--{assign var=key value="product_code"}-->
+                        <td><!--{$arrForm[$key].value[$index]|h}--></td>
+                        <!--{assign var=key1 value="stock"}-->
+                        <!--{assign var=key2 value="stock_unlimited"}-->
                         <td class="right">
-                            <!--{if $arrForm[$key2] == 1}-->
+                            <!--{if $arrForm[$key2].value[$index] == 1}-->
                                 無制限
                             <!--{else}-->
-                                <!--{$arrForm[$key1]}-->
+                                <!--{$arrForm[$key1].value[$index]|h}-->
                             <!--{/if}-->
                         </td>
-                        <!--{assign var=key value="price01:`$smarty.section.cnt.iteration`"}-->
-                        <td class="right"><!--{$arrForm[$key]}--></td>
-                        <!--{assign var=key value="price02:`$smarty.section.cnt.iteration`"}-->
-                        <td class="right"><!--{$arrForm[$key]}--></td>
-                        <!--{assign var=key value="product_type_id:`$smarty.section.cnt.iteration`"}-->
+                        <!--{assign var=key value="price01"}-->
+                        <td class="right"><!--{$arrForm[$key].value[$index]|h}--></td>
+                        <!--{assign var=key value="price02"}-->
+                        <td class="right"><!--{$arrForm[$key].value[$index]|h}--></td>
+                        <!--{assign var=key value="product_type_id"}-->
                         <td class="right">
-                            <!--{foreach from=$arrForm[$key] item=product_type_id}-->
+                            <!--{foreach from=$arrForm[$key].value[$index] item=product_type_id}-->
                                 <!--{$arrProductType[$product_type_id]|h}-->
                             <!--{/foreach}-->
                         </td>
-                        <!--{assign var=key value="down_filename:`$smarty.section.cnt.iteration`"}-->
-                        <td class="right"><!--{$arrForm[$key]}--></td>
-                        <!--{assign var=key value="down_realfilename:`$smarty.section.cnt.iteration`"}-->
-                        <td class="right"><!--{$arrForm[$key]}--></td>
+                        <!--{assign var=key value="down_filename"}-->
+                        <td class="right"><!--{$arrForm[$key].value[$index]}--></td>
+                        <!--{assign var=key value="down_realfilename"}-->
+                        <td class="right"><!--{$arrForm[$key].value[$index]}--></td>
                     </tr>
                 <!--{/if}-->
@@ -93,6 +111,6 @@
         <ul>
             <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'confirm_return','',''); return false"><span class="btn-prev">前へ戻る</span></a></li>
-        <!--{if $tpl_check > 0}-->
-            <li><a class="btn-action" href="javascript:;" onclick="document.form1.submit(); return false;"><span class="btn-next">この内容で登録する</span></a></li>
+        <!--{if count($arrForm.check.value) > 0}-->
+            <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'complete','',''); return false;"><span class="btn-next">この内容で登録する</span></a></li>
         <!--{/if}-->
         </ul>
Index: /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products.php	(revision 20538)
+++ /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products.php	(revision 20595)
@@ -378,5 +378,5 @@
         // 読み込む列とテーブルの指定
         $col = "product_id, name, main_list_image, status, product_code_min, product_code_max, price02_min, price02_max, stock_min, stock_max, stock_unlimited_min, stock_unlimited_max, update_date";
-        $from = $objProduct->alldtlSQL();
+        $from = $objProduct->alldtlSQL('del_flg = 0');
 
         $objQuery->setLimitOffset($limit, $offset);
Index: /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php	(revision 20562)
+++ /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php	(revision 20595)
@@ -162,5 +162,5 @@
 
         $where = "del_flg <> 1 AND class_id = ?";
-        $objQuery->setOrder("rank DESC");
+        $objQuery->setOrder("rank DESC"); // XXX 降順
         $arrClassCat = $objQuery->select("name, classcategory_id", "dtb_classcategory", $where, array($class_id));
         return $arrClassCat;
Index: /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php	(revision 20538)
+++ /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php	(revision 20595)
@@ -56,4 +56,6 @@
         $masterData = new SC_DB_MasterData_Ex();
         $this->arrProductType = $masterData->getMasterData("mtb_product_type");
+        // 規格プルダウンのリスト
+        $this->arrClass = $this->getAllClass();
     }
 
@@ -78,14 +80,8 @@
         $this->initParam($objFormParam);
 
-        // 規格行のPOSTパラメータを初期化
-        $count = $this->getRowMax($_POST);
-        $this->initRowParam($count, $objFormParam);
         $objFormParam->setParam($_POST);
         $objFormParam->convParam();
 
         $this->arrSearchHidden = $objFormParam->getSearchArray();
-
-        $this->tpl_product_id = $objFormParam->getValue('product_id');
-        $this->tpl_pageno = $objFormParam->getValue('pageno');
 
         // Downファイル管理クラスを初期化
@@ -93,6 +89,4 @@
         $this->initDownFile($count, $this->objDownFile);
 
-        $this->arrForm = $objFormParam->getHashArray();
-
         switch ($this->getMode()) {
 
@@ -100,10 +94,14 @@
         case 'edit':
             // エラーチェック
-            $this->arrErr = $this->lfProductClassError($this->arrForm);
+            $this->arrErr = $this->lfProductClassError($objFormParam->getHashArray());
             if (empty($this->arrErr)){
                 $this->tpl_mainpage = 'products/product_class_confirm.tpl';
-                $this->lfProductConfirmPage($this->arrForm); // 確認ページ表示
+                $this->doDisp($objFormParam);
+                $objFormParam->setParam($_POST);
+                $objFormParam->convParam();
+
             } else {
                 $this->doPreEdit($objFormParam->getValue('product_id'), false ,true);
+                /* TODO
                 // Hiddenからのデータを引き継ぐ
                 $this->objDownFile->setHiddenFileList($_POST);
@@ -112,7 +110,9 @@
                 // Form用に配列を渡す。
                 $this->arrForm = array_merge((array)$this->arrForm, (array)$this->objDownFile->getFormKikakuDownFile());
-                $this->doDisp($objFormParam->getValue('product_id'),
-                              $objFormParam->getValue('select_class_id1'),
-                              $objFormParam->getValue('select_class_id2'));
+                */
+                $this->doDisp($objFormParam);
+                $objFormParam->setParam($_POST);
+                $objFormParam->convParam();
+
             }
             break;
@@ -125,18 +125,22 @@
         // 初期表示
         case 'pre_edit':
-            $this->doPreEdit($objFormParam->getValue('product_id'));
+            $this->doPreEdit($objFormParam);
+            /* TODO
             // HIDDEN用に配列を渡す。
             $this->arrHidden = array_merge((array)$this->arrHidden, (array)$this->objDownFile->getHiddenFileList());
+            */
             break;
 
         // 「表示する」ボタン押下時
         case 'disp':
-            $this->doDisp($objFormParam->getValue('product_id'),
-                          $objFormParam->getValue('select_class_id1'),
-                          $objFormParam->getValue('select_class_id2'));
+            $this->arrErr = $this->lfClassError();
+            if (SC_Utils_Ex::isBlank($this->arrErr)) {
+                $this->doDisp($objFormParam);
+            }
             break;
 
         // ダウンロード商品ファイルアップロード
         case 'upload_down':
+            /* TODO
             $product_id = $objFormParam->getValue('product_id');
             $down_key   = $objFormParam->getValue('down_key');
@@ -156,9 +160,11 @@
             $this->doDisp($product_id,
                           $objFormParam->getValue('select_class_id1'),
-                          $objFormParam->getValue('select_class_id2'));
+                          $objFormParam->getValue('select_class_id2'), $objFormParam);
+            */
             break;
 
         // ダウンロードファイルの削除
         case 'delete_down':
+            /* TODO
             $product_id = $objFormParam->getValue('product_id');
             $down_key   = $objFormParam->getValue('down_key');
@@ -176,13 +182,15 @@
             $this->doDisp($product_id,
                           $objFormParam->getValue('select_class_id1'),
-                          $objFormParam->getValue('select_class_id2'));
+                          $objFormParam->getValue('select_class_id2'), $objFormParam);
+            */
             break;
 
         // 確認画面からの戻り
         case 'confirm_return':
-            // 規格の選択情報は引き継がない。
-            $this->arrForm['select_class_id1'] = "";
-            $this->arrForm['select_class_id2'] = "";
-            $this->doPreEdit($objFormParam->getValue('product_id'), false, true);
+            $this->doPreEdit($objFormParam);
+            $objFormParam->setParam($_POST);
+            $objFormParam->convParam();
+
+            /* TODO
             // Hiddenからのデータを引き継ぐ
             $this->objDownFile->setHiddenFileList($_POST);
@@ -191,7 +199,6 @@
             // Form用に配列を渡す。
             $this->arrForm = array_merge((array)$this->arrForm, (array)$this->objDownFile->getFormKikakuDownFile());
-            $this->doDisp($objFormParam->getValue('product_id'),
-                          $objFormParam->getValue('select_class_id1'),
-                          $objFormParam->getValue('select_class_id2'));
+            */
+
             break;
         case 'complete':
@@ -203,5 +210,6 @@
             // 商品規格の登録
             $arrList = $objFormParam->getHashArray();
-            $this->registerProductClass($arrList, $objFormParam->getValue('product_id'));
+            $this->registerProductClass($arrList, $objFormParam->getValue('product_id'),
+                                        $objFormParam->getValue('total'));
             // 一時ファイルを本番ディレクトリに移動する
             $this->objDownFile->moveTempDownFile();
@@ -211,8 +219,8 @@
         }
 
-        // 規格プルダウンのリストを取得
-        $this->arrClass = $this->getAllClass();
         // 登録対象の商品名を取得
-        $this->arrForm['product_name'] = $this->getProductName($objFormParam->getValue('product_id'));
+        $objFormParam->setValue('product_name',
+                $this->getProductName($objFormParam->getValue('product_id')));
+        $this->arrForm = $objFormParam->getFormParamList();
     }
 
@@ -228,8 +236,8 @@
      * パラメータ初期化
      *
-     * @param <type> $objFormParam
+     * @param SC_FormParam $objFormParam SC_FormParam インスタンス
+     * @return void
      */
     function initParam(&$objFormParam) {
-        $objFormParam->addParam();
         // 商品マスタ検索パラメータ引き継ぎ
         $objFormParam->addParam("商品ID", "product_id", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"));
@@ -251,36 +259,28 @@
 
         // 規格プルダウン
-        $objFormParam->addParam("規格1", "select_class_id1", null, null, array());
-        $objFormParam->addParam("規格2", "select_class_id2", null, null, array());
-        $objFormParam->addParam("規格1", "class_id1", null, null, array());
-        $objFormParam->addParam("規格2", "class_id2", null, null, array());
-
-        // ファイルアップロード用
-        $objFormParam->addParam("ファイルアップロード用キー", "down_key", null, null, array());
-    }
-
-    /**
-     * 規格行ごとのパラメータを初期化する
-     *
-     * @param 行数 $count
-     * @param SC_FormParam $objFormParam
-     */
-    function initRowParam($count, &$objFormParam) {
-        for ($i = 1; $i < $count; $i++) {
-            $objFormParam->addParam("規格ID1", "classcategory_id1:$i", null, null, array());
-            $objFormParam->addParam("規格ID2", "classcategory_id2:$i", null, null, array());
-            $objFormParam->addParam("規格名", "name1:$i", null, null, array());
-            $objFormParam->addParam("企画名", "name2:$i", null, null, array());
-            $objFormParam->addParam("product_class_id", "product_class_id:$i", null, null, array());
-            $objFormParam->addParam("商品コード", "product_code:$i", STEXT_LEN, 'KVa', array("MAX_LENGTH_CHECK"));
-            $objFormParam->addParam("在庫数", "stock:$i", AMOUNT_LEN, 'n', array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
-            $objFormParam->addParam("在庫数", "stock_unlimited:$i", null, null, array());
-            $objFormParam->addParam(NORMAL_PRICE_TITLE, "price01:$i", PRICE_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"));
-            $objFormParam->addParam(SALE_PRICE_TITLE, "price02:$i", PRICE_LEN, 'n', array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
-            $objFormParam->addParam("商品種別", "product_type_id:$i", null, null, array());
-            $objFormParam->addParam("DLファイル名", "down_filename:$i", null, null, array());
-            $objFormParam->addParam("DLファイル名", "down_realfilename:$i", null, null, array());
-            $objFormParam->addParam("チェックボックス", "check:$i", null, null, array());
-        }
+        $objFormParam->addParam("規格1", "select_class_id1", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("規格2", "select_class_id2", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("規格1", "class_id1", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("規格2", "class_id2", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+
+        // 商品規格
+        $objFormParam->addParam("商品規格数", "total", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("商品名", "product_name", STEXT_LEN, 'KVa', array("MAX_LENGTH_CHECK"));
+        $objFormParam->addParam("商品コード", "product_code", STEXT_LEN, 'KVa', array("MAX_LENGTH_CHECK"));
+        $objFormParam->addParam("規格ID1", "classcategory_id1", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("規格ID2", "classcategory_id2", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("規格名1", "classcategory_name1", STEXT_LEN, 'KVa', array("MAX_LENGTH_CHECK"));
+        $objFormParam->addParam("規格名2", "classcategory_name2", STEXT_LEN, 'KVa', array("MAX_LENGTH_CHECK"));
+        $objFormParam->addParam("商品規格ID", "product_class_id", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("在庫数", "stock", AMOUNT_LEN, 'n', array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
+        $objFormParam->addParam("在庫数", "stock_unlimited", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam(NORMAL_PRICE_TITLE, "price01", PRICE_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"));
+        $objFormParam->addParam(SALE_PRICE_TITLE, "price02", PRICE_LEN, 'n', array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
+        $objFormParam->addParam("商品種別", "product_type_id", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("削除フラグ", "del_flg", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("DLファイル名", "down_filename", STEXT_LEN, 'KVa', array("MAX_LENGTH_CHECK"));
+        $objFormParam->addParam("DLファイル名", "down_realfilename", STEXT_LEN, 'KVa', array("MAX_LENGTH_CHECK"));
+        $objFormParam->addParam("チェックボックス", "check", INT_LEN, 'n', array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $objFormParam->addParam("ファイルアップロード用キー", "down_key", STEXT_LEN, 'KVa', array("MAX_LENGTH_CHECK"));
     }
 
@@ -299,20 +299,4 @@
 
     /**
-     * 規格行の最大値を返す
-     *
-     * @param array $arrPost POSTパラメータ
-     * @return int 規格行の最大値
-     */
-    function getRowMax($arrPost) {
-        $i = 1;
-        foreach ($arrPost as $key => $value) {
-            if ($key == "classcategory_id1:$i") {
-                $i++;
-            }
-        }
-        return $i;
-    }
-
-    /**
      * 規格の登録または更新を行う.
      *
@@ -323,5 +307,5 @@
      * @param integer $product_id 登録を行う商品ID
      */
-    function registerProductClass($arrList, $product_id) {
+    function registerProductClass($arrList, $product_id, $total) {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
         $objDb = new SC_Helper_DB_Ex();
@@ -329,46 +313,52 @@
         $objQuery->begin();
 
-        $productsClass = $objQuery->select("*", "dtb_products_class", "product_id = ?", array($product_id));
-
-        $exists = array();
-        foreach ($productsClass as $val) {
-            $exists[$val['product_class_id']] = $val;
-        }
-        $i = 1;
-        while (!SC_Utils_Ex::isBlank($arrList['check:' . $i])) {
-            $pVal = array();
-            $pVal['product_id'] = $product_id;;
-            $pVal['product_code'] = $arrList["product_code:".$i];
-            $pVal['stock'] = $arrList["stock:".$i];
-            $pVal['stock_unlimited'] = ($arrList["stock_unlimited:".$i]) ? '1' : '0';
-            $pVal['price01'] = $arrList['price01:'.$i];
-            $pVal['price02'] = $arrList['price02:'.$i];
-            $pVal['product_type_id'] = $arrList['product_type_id:'.$i];
-            $pVal['down_filename'] = $arrList['down_filename:'.$i];
-            $pVal['down_realfilename'] = $arrList['down_realfilename:'.$i];
-            $pVal['creator_id'] = $_SESSION['member_id'];
-            $pVal['update_date'] = "now()";
-
-            if($arrList["check:".$i] == 1) {
-                $pVal['del_flg'] = 0;
-            } else {
-                $pVal['del_flg'] = 1;
-            }
-
-            // 更新 or 登録
-            $isUpdate = false;
-            if (!SC_Utils_Ex::isBlank($arrList["product_class_id:".$i])) {
-                $isUpdate = true;
+        $arrProductsClass = $objQuery->select("*", "dtb_products_class", "product_id = ?", array($product_id));
+        $arrExists = array();
+        foreach ($arrProductsClass as $val) {
+            $arrExists[$val['product_class_id']] = $val;
+        }
+
+        // デフォルト値として設定する値を取得しておく
+        $arrDefault = $this->getProductsClass($product_id);
+
+        for ($i = 0; $i < $total; $i++) {
+            $del_flg = SC_Utils_Ex::isBlank($arrList['check'][$i]) ? 1 : 0;
+            $stock_unlimited = SC_Utils_Ex::isBlank($arrList['stock_unlimited'][$i]) ? 0 : 1;
+
+            // dtb_products_class 登録/更新用
+            $registerKeys = array('product_code', 'stock',
+                                  'price01', 'price02', 'product_type_id',
+                                  'down_filename', 'down_realfilename');
+
+            $arrPC = array();
+            foreach ($registerKeys as $key) {
+                $arrPC[$key] = $arrList[$key][$i];
+            }
+            $arrPC['product_id'] = $product_id;
+            $arrPC['sale_limit'] = $arrDefault['sale_limit'];
+            $arrPC['deliv_fee'] = $arrDefault['deliv_fee'];
+            $arrPC['point_rate'] = $arrDefault['point_rate'];
+            $arrPC['stock_unlimited'] = $stock_unlimited;
+
+            // 該当関数が無いため, セッションの値を直接代入
+            $arrPC['creator_id'] = $_SESSION['member_id'];
+            $arrPC['update_date'] = 'now()';
+            $arrPC['del_flg'] = $del_flg;
+
+            // 登録 or 更新
+            $is_update = false;
+            if (!SC_Utils_Ex::isBlank($arrList['product_class_id'][$i])) {
+                $is_update = true;
+
                 // 更新の場合は規格組み合わせを検索し, 削除しておく
-                $class_combination_id = $exists[$arrList["product_class_id:".$i]]['class_combination_id'];
+                $class_combination_id = $arrExists[$arrList['product_class_id'][$i]]['class_combination_id'];
                 $existsCombi = $objQuery->getRow(
-                    "*",
-                    "dtb_class_combination",
-                    "class_combination_id = ?",
-                    array($class_combination_id)
-                );
-
-                $objQuery->delete("dtb_class_combination",
-                                  "class_combination_id IN (?, ?)",
+                    '*',
+                    'dtb_class_combination',
+                    'class_combination_id = ?',
+                    array($class_combination_id));
+
+                $objQuery->delete('dtb_class_combination',
+                                  'class_combination_id IN (?, ?)',
                                   array($existsCombi['class_combination_id'],
                                         $existsCombi['parent_class_combination_id']));
@@ -376,46 +366,43 @@
 
             // 規格組み合わせを登録
-            $cVal1['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id');
-
-            $cVal1['classcategory_id'] = $arrList["classcategory_id1:".$i];
-            $cVal1['level'] = 1;
-            $objQuery->insert("dtb_class_combination", $cVal1);
-
-            $pVal['class_combination_id'] = $cVal1['class_combination_id'];
+            $arrComb1['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id');
+            $arrComb1['classcategory_id'] = $arrList['classcategory_id1'][$i];
+            $arrComb1['level'] = 1;
+            $objQuery->insert('dtb_class_combination', $arrComb1);
 
             // 規格2も登録する場合
-            if (!SC_Utils_Ex::isBlank($arrList["classcategory_id2:".$i])) {
-                $cVal2['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id');
-                $cVal2['classcategory_id'] = $arrList["classcategory_id2:".$i];
-                $cVal2['parent_class_combination_id'] = $cVal1['class_combination_id'];
-                $cVal2['level'] = 2;
-                $objQuery->insert("dtb_class_combination", $cVal2);
-
-                $pVal['class_combination_id'] = $cVal2['class_combination_id'];
+            if (!SC_Utils_Ex::isBlank($arrList['classcategory_id2'][$i])) {
+                $arrComb2['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id');
+                $arrComb2['classcategory_id'] = $arrList['classcategory_id2'][$i];
+                $arrComb2['parent_class_combination_id'] = $arrComb1['class_combination_id'];
+                $arrComb2['level'] = 2;
+                $objQuery->insert('dtb_class_combination', $arrComb2);
+
+                $arrPC['class_combination_id'] = $arrComb2['class_combination_id'];
+            } else {
+                $arrPC['class_combination_id'] = $arrComb1['class_combination_id'];
             }
 
             // 更新
-            if ($isUpdate) {
-                $pVal['product_class_id'] = $arrList["product_class_id:".$i];
-                $objQuery->update("dtb_products_class", $pVal,
+            if ($is_update) {
+                $arrPC['product_class_id'] = $arrList['product_class_id'][$i];
+                $objQuery->update("dtb_products_class", $arrPC,
                                   "product_class_id = ?",
-                                  array($pVal['product_class_id']));
+                                  array($arrPC['product_class_id']));
             }
             // 新規登録
             else {
-                $pVal['create_date'] = "now()";
-                $pVal['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id');
-                $objQuery->insert("dtb_products_class", $pVal);
-            }
-
-            $i++;
+                $arrPC['create_date'] = "now()";
+                $arrPC['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id');
+                $objQuery->insert("dtb_products_class", $arrPC);
+            }
         }
 
         // 規格無し用の商品規格を非表示に
-        $bVal['del_flg'] = 1;
-        $bVal['update_date'] = 'now()';
-        $objQuery->update("dtb_products_class", $bVal,
-                          "product_class_id = ? AND class_combination_id IS NULL",
-                          array($pVal['product_class_id']));
+        $arrBlank['del_flg'] = 1;
+        $arrBlank['update_date'] = 'now()';
+        $objQuery->update("dtb_products_class", $arrBlank,
+                          "product_id = ? AND class_combination_id IS NULL",
+                          array($product_id));
 
         // 件数カウントバッチ実行
@@ -491,49 +478,38 @@
 
     /**
-     * 確認ページを表示する
-     *
-     */
-    function lfProductConfirmPage($arrPost) {
-        $objDb = new SC_Helper_DB_Ex();
-        $this->arrForm['mode'] = 'complete';
-        $this->arrClass = $objDb->sfGetIDValueList("dtb_class", 'class_id', 'name');
-        $cnt = 0;
-        $check = 0;
-        $no = 1;
-        while ($arrPost["classcategory_id1:".$no] != "") {
-            if ($arrPost["check:".$no] != "") {
-                $check++;
-            }
-            $no++;
-            $cnt++;
-        }
-        $this->tpl_check = $check;
-        $this->tpl_count = $cnt;
-    }
-
-    /**
      * 規格の組み合わせ一覧を表示する.
      *
-     * 1. 規格1, 規格2を組み合わせた場合の妥当性を検証する.
-     * 2. 規格1, 規格2における規格分類のすべての組み合わせを取得し,
-     *    該当商品の商品規格の内容を取得し, フォームに設定する.
-     */
-    function doDisp($product_id, $select_class_id1, $select_class_id2) {
-        $this->arrForm['select_class_id1'] = $select_class_id1;
-        $this->arrForm['select_class_id2'] = $select_class_id2;
-        $dispError = $this->lfClassError();
-        if (SC_Utils_Ex::isBlank($dispError)) {
-            $this->arrClassCat = $this->getAllClassCategory($select_class_id1, $select_class_id2);
-            $productsClass = $this->getProductsClass($product_id);
-
-            $total = count($this->arrClassCat);
-            for ($i = 1; $i <= $total; $i++) {
-                foreach ($productsClass as $key => $val) {
-                    $this->arrForm[$key . ":" . $i] = $val;
-                }
-            }
-        }
-        $this->arrErr = array_merge((array) $this->arrErr, $dispError);
-        $this->tpl_onload.= "fnCheckAllStockLimit('$total', '" . DISABLED_RGB . "');";
+     * 規格1, 規格2における規格分類のすべての組み合わせを取得し,
+     * 該当商品の商品規格の内容を取得後, フォームに設定する.
+     *
+     * @param SC_FormParam $objFormParam SC_FormParam インスタンス
+     * @return void
+     */
+    function doDisp(&$objFormParam) {
+        $product_id = $objFormParam->getValue('product_id');
+        $select_class_id1 = $objFormParam->getValue('select_class_id1');
+        $select_class_id2 = $objFormParam->getValue('select_class_id2');
+
+        // すべての組み合わせを取得し, フォームに設定
+        $arrClassCat = $this->getAllClassCategory($select_class_id1, $select_class_id2);
+        $total = count($arrClassCat);
+        $objFormParam->setValue('total', $total);
+        $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrClassCat));
+
+        // class_id1, class_id2 は select_class_id1 で上書き
+        $objFormParam->setValue('class_id1', $select_class_id1);
+        $objFormParam->setValue('class_id2', $select_class_id2);
+
+        // 商品情報を取得し, フォームに設定
+        $arrProductsClass = $this->getProductsClass($product_id);
+
+        foreach ($arrProductsClass as $key => $val) {
+            // 組み合わせ数分の値の配列を生成する
+            $arrValues = array();
+            for ($i = 0; $i < $total; $i++) {
+                $arrValues[] = $val;
+            }
+            $objFormParam->setValue($key, $arrValues);
+        }
     }
 
@@ -545,46 +521,32 @@
      * @param bool $usepostValue
      */
-    function doPreEdit($product_id, $existsValue = true, $usepostValue = false) {
+    function doPreEdit(&$objFormParam) {
+        $product_id = $objFormParam->getValue('product_id');
         $existsProductsClass = $this->getProductsClassAndClasscategory($product_id);
-        $productsClass = $this->getProductsClass($product_id);
-        $this->arrForm["class_id1"] = $existsProductsClass[0]['class_id1'];
-        $this->arrForm["class_id2"] = $existsProductsClass[0]['class_id2'];
-        $this->arrForm['select_class_id1'] = $this->arrForm["class_id1"];
-        $this->arrForm['select_class_id2'] = $this->arrForm["class_id2"];
-        $this->arrClassCat = $this->getAllClassCategory($this->arrForm["class_id1"], $this->arrForm["class_id2"]);
-
-        $total = count($this->arrClassCat);
-        $line  = '';
-
-        for ($i = 0; $i < $total; $i++) {
-            $no = $i + 1;
-            if ($existsValue) {
-                foreach ($productsClass as $key => $val) {
-                    if(!$usepostValue){
-                        $this->arrForm[$key . ":" . $no] = $val;
-                    }
-                }
-            }
-            foreach ($existsProductsClass[$i] as $key => $val) {
-                if (!$usepostValue) {
-                    $this->arrForm[$key . ":" . $no] = $val;
-                }
-                switch ($key) {
-                case 'down':
-                    $this->objDownFile->addFile("ダウンロード販売用ファイル". ":" . $no, 'down_realfilename'. ":" . $no, explode(",", DOWNLOAD_EXTENSION),DOWN_SIZE, true, 0, 0);
-                    break;
-                default:
-                }
-            }
-            if (!SC_Utils_Ex::isBlank($this->arrForm['product_id:' . $no])
-                && $this->arrForm["del_flg:" . $no] == 0) {
-                $line .= "'check:" . $no . "',";
-            }
-        }
-
-        $line = preg_replace("/,$/", "", $line);
-        $this->tpl_javascript = "list = new Array($line);";
-        $color = DISABLED_RGB;
-        $this->tpl_onload.= "fnListCheck(list); fnCheckAllStockLimit('$total', '$color');";
+
+        $class_id1 = $existsProductsClass[0]['class_id1'];
+        $class_id2 = $existsProductsClass[0]['class_id2'];
+        $objFormParam->setValue('class_id1', $class_id1);
+        $objFormParam->setValue('class_id2', $class_id2);
+        $objFormParam->setValue('select_class_id1', $class_id1);
+        $objFormParam->setValue('select_class_id2', $class_id2);
+        $this->doDisp($objFormParam);
+
+        // 登録済みのデータで上書き
+        $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($existsProductsClass));
+
+        // $existsProductsClass で product_id が配列になってしまうため数値で上書き
+        $objFormParam->setValue('product_id', $product_id);
+
+        // check を設定
+        $arrChecks = array();
+        $index = 0;
+        foreach ($objFormParam->getValue('del_flg') as $key => $val) {
+            if ($val == 0) {
+                $arrChecks[$index] = 1;
+            }
+            $index++;
+        }
+        $objFormParam->setValue('check', $arrChecks);
 
         // DBデータからダウンロードファイル名の読込
@@ -604,12 +566,8 @@
 
         $objQuery->begin();
-
-        $arrProductsClass = array();
-        $arrProductsClass['del_flg'] = 0;
-        $objQuery->update("dtb_products_class", $arrProductsClass, "product_id = ? AND class_combination_id IS NULL", array($product_id));
-
-        $arrProductsClass['del_flg'] = 1;
-        $objQuery->update("dtb_products_class", $arrProductsClass, "product_id = ? AND class_combination_id IS NOT NULL", array($product_id));
-
+        $objQuery->update("dtb_products_class", array('del_flg' => 0),
+                          "product_id = ? AND class_combination_id IS NULL", array($product_id));
+        $objQuery->update("dtb_products_class", array('del_flg' => 1),
+                          "product_id = ? AND class_combination_id IS NOT NULL", array($product_id));
         $objQuery->commit();
 
@@ -634,5 +592,5 @@
         $col = "T1.class_id AS class_id1, "
             . " T1.classcategory_id AS classcategory_id1, "
-            . " T1.name AS name1, "
+            . " T1.name AS classcategory_name1, "
             . " T1.rank AS rank1 ";
 
@@ -648,5 +606,5 @@
                 . "T2.class_id AS class_id2,"
                 . "T2.classcategory_id AS classcategory_id2,"
-                . "T2.name AS name2,"
+                . "T2.name AS classcategory_name2,"
                 . "T2.rank AS rank2";
             $table = "dtb_classcategory AS T1, dtb_classcategory AS T2";
@@ -667,5 +625,5 @@
     function getProductName($product_id) {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
-        return $objQuery->getOne("SELECT name FROM dtb_products WHERE product_id = ?", array($product_id));
+        return $objQuery->get('name', 'dtb_products', 'product_id = ?', array($product_id));
     }
 
@@ -698,6 +656,5 @@
      */
     function getAllClass() {
-        $objDb = new SC_Helper_DB_Ex();
-        $arrClass = $objDb->sfGetIDValueList("dtb_class", 'class_id', 'name');
+        $arrClass = SC_Helper_DB_Ex::sfGetIDValueList("dtb_class", 'class_id', 'name');
 
         // 規格分類が登録されていない規格は表示しないようにする。
@@ -716,5 +673,7 @@
 
     /**
-     * 商品IDをキーにして, 商品規格を取得する.
+     * 商品IDをキーにして, 商品規格の初期値を取得する.
+     *
+     * 商品IDをキーにし, デフォルトに設定されている商品規格を取得する.
      *
      * @param integer $product_id 商品ID
@@ -723,6 +682,6 @@
     function getProductsClass($product_id) {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
-        $col = "product_id, product_code, price01, price02, stock,  stock_unlimited, point_rate";
-        return $objQuery->getRow($col, "dtb_products_class", "product_id = ?", array($product_id));
+        $col = "product_code, price01, price02, stock, stock_unlimited, sale_limit, deliv_fee, point_rate";
+        return $objQuery->getRow($col, "dtb_products_class", "product_id = ? AND class_combination_id IS NULL", array($product_id));
     }
 
@@ -735,5 +694,5 @@
     function getProductsClassAndClasscategory($productId) {
         $objProduct = new SC_Product_Ex();
-        return $objProduct->getProductsClassFullByProductId($productId);
+        return $objProduct->getProductsClassFullByProductId($productId, true);
     }
 }
Index: /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php	(revision 20567)
+++ /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php	(revision 20595)
@@ -298,4 +298,6 @@
             $where = '0<>0';
         }
+
+        $where .= ' AND del_flg = 0'; // 商品規格の削除フラグ
         $objQuery =& SC_Query_Ex::getSingletonInstance();
         $objQuery->setWhere($where);
Index: /branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
===================================================================
--- /branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	(revision 20541)
+++ /branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	(revision 20595)
@@ -1448,5 +1448,5 @@
 
         $objQuery =& SC_Query_Ex::getSingletonInstance();
-        $where = 'product_id = ? AND class_combination_id IS NOT NULL';
+        $where = 'product_id = ? AND del_flg = 0 AND class_combination_id IS NOT NULL';
         $count = $objQuery->count('dtb_products_class', $where, array($product_id));
 
Index: /branches/version-2_5-dev/data/class/SC_Product.php
===================================================================
--- /branches/version-2_5-dev/data/class/SC_Product.php	(revision 20538)
+++ /branches/version-2_5-dev/data/class/SC_Product.php	(revision 20595)
@@ -178,5 +178,5 @@
     function getDetail($productId) {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
-        $result = $objQuery->select("*", $this->alldtlSQL("product_id = ?"),
+        $result = $objQuery->select("*", $this->alldtlSQL("product_id = ? AND del_flg = 0"),
                                     "product_id = ?",
                                     array($productId, $productId));
@@ -203,11 +203,12 @@
      *
      * @param array $arrProductId 商品ID の配列
+     * @param boolean $has_deleted 削除された商品規格も含む場合 true; 初期値 false
      * @return void
      */
-    function setProductsClassByProductIds($arrProductId) {
+    function setProductsClassByProductIds($arrProductId, $has_deleted = false) {
 
         $arrProductsClass = array();
         foreach ($arrProductId as $productId) {
-            $arrProductClass = $this->getProductsClassFullByProductId($productId);
+            $arrProductClass = $this->getProductsClassFullByProductId($productId, $has_deleted);
 
             $classCats1 = array();
@@ -326,4 +327,5 @@
             T2.level,
             T3.name AS classcategory_name,
+            T3.rank,
             T4.name AS class_name,
             T4.class_id
@@ -338,4 +340,6 @@
                    ON T3.class_id = T4.class_id
 __EOS__;
+
+        $objQuery->setOrder('T3.rank DESC'); // XXX
         $arrRet = $objQuery->select($col, $table, "", $params);
         $levels = array();
@@ -358,4 +362,5 @@
                 T1.level,
                 T2.name AS classcategory_name,
+                T2.rank,
                 T3.name AS class_name,
                 T3.class_id
@@ -369,7 +374,7 @@
 __EOS__;
 
+            $objQuery->setOrder('T2.rank DESC'); // XXX
             $arrParents = $objQuery->select($col, $table, "", $parents);
 
-            unset($parents);
             foreach ($arrParents as $rows) {
                 $parents[] = $rows['parent_class_combination_id'];
@@ -396,5 +401,4 @@
             $arrProductsClass[] = $val;
         }
-
         return $arrProductsClass;
     }
@@ -402,8 +406,13 @@
     /**
      * 商品規格IDから商品規格を取得する.
+     *
+     * 削除された商品規格は取得しない.
+     *
+     * @param integer $productClassId 商品規格ID
+     * @return array 商品規格の配列
      */
     function getProductsClass($productClassId) {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
-        $objQuery->setWhere('product_class_id = ?');
+        $objQuery->setWhere('product_class_id = ? AND T1.del_flg = 0');
         $objQuery->setOrder("T2.level DESC");
         $results = $this->getProductsClassByQuery($objQuery, $productClassId);
@@ -416,12 +425,17 @@
      *
      * @param array $productIds 商品IDの配列
+     * @param boolean $has_deleted 削除された商品規格も含む場合 true; 初期値 false
      * @return array 商品規格の配列
      */
-    function getProductsClassByProductIds($productIds = array()) {
+    function getProductsClassByProductIds($productIds = array(), $has_deleted = false) {
         if (empty($productIds)) {
             return array();
         }
         $objQuery =& SC_Query_Ex::getSingletonInstance();
-        $objQuery->setWhere('product_id IN (' . implode(', ', array_pad(array(), count($productIds), '?')) . ')');
+        $where = 'product_id IN (' . implode(', ', array_pad(array(), count($productIds), '?')) . ')';
+        if (!$has_deleted) {
+            $where .= ' AND T1.del_flg = 0';
+        }
+        $objQuery->setWhere($where);
         $objQuery->setOrder("T2.level DESC");
         return $this->getProductsClassByQuery($objQuery, $productIds);
@@ -443,8 +457,9 @@
      *
      * @param array $productId 商品ID
+     * @param boolean $has_deleted 削除された商品規格も含む場合 true; 初期値 false
      * @return array すべての組み合わせの商品規格の配列
      */
-    function getProductsClassFullByProductId($productId) {
-        $results = $this->getProductsClassByProductIds(array($productId));
+    function getProductsClassFullByProductId($productId, $has_deleted = false) {
+        $results = $this->getProductsClassByProductIds(array($productId), $has_deleted);
         return $this->getProductsClassFull($results);
     }
