source: branches/version-2_5-dev/data/Smarty/templates/admin/products/product_class.tpl @ 20595

Revision 20595, 12.6 KB checked in by nanasess, 13 years ago (diff)
  • #1097([管理画面]商品管理(商品規格登録):規格編集で、登録されていない行にもチェックが入っている)
  • #1064([管理画面]商品管理(商品規格登録):規格編集で、登録されている規格を外して登録しても削除されない)
  • #991(商品規格登録での不具合)
  • #1101([フロント]商品(一覧、詳細):規格削除しても価格表記に削除した価格も出ている)
  • 商品規格管理画面を全面的にリファクタリング
  • TODO 入力チェック, ダウンロード販売用ファイルには後続のコミットで対応します
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-smarty-template; charset=UTF-8
Line 
1<!--{*
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23*}-->
24<script type="text/javascript">//<![CDATA[
25$(function() {
26    $('input[id^=stock_unlimited_]').each(function() {
27        var index = $(this).attr('id').replace(/^stock_unlimited_/ig, '');
28        var checked = $(this).attr('checked');
29
30        if (checked) {
31            $('#stock_' + index)
32                .attr('readonly', true)
33                .css('background-color', '<!--{$smarty.const.DISABLED_RGB}-->');
34        }
35    });
36
37    $('input[id^=stock_unlimited_]').change(function() {
38        var index = $(this).attr('id').replace(/^stock_unlimited_/ig, '');
39        var checked = $(this).attr('checked');
40
41        if (checked) {
42            $('#stock_' + index)
43                .attr('readonly', true)
44                .css('background-color', '<!--{$smarty.const.DISABLED_RGB}-->');
45        } else {
46            $('#stock_' + index)
47                .attr('readonly', false)
48                .css('background-color', '');
49        }
50    });
51});
52//]]>
53</script>
54<h2>商品規格登録</h2>
55<form name="form1" id="form1" method="post" action="" enctype="multipart/form-data">
56<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
57<!--{* foreach key=name item=item from=$arrSearchHidden *}-->
58<input type="hidden" name="<!--{$name}-->" value="<!--{$item|h}-->" />
59<!--{* /foreach *}-->
60<input type="hidden" name="mode" value="edit" />
61<input type="hidden" name="product_id" value="<!--{$arrForm.product_id.value|h}-->" />
62<input type="hidden" name="down_key" value="">
63<!--{* foreach key=name item=item from=$arrHidden *}-->
64<input type="hidden" name="<!--{$name}-->" value="<!--{$item|h}-->" />
65<!--{* /foreach *}-->
66<div id="products" class="contents-main">
67
68    <table>
69        <tr>
70            <th>商品名</th>
71            <td><!--{$arrForm.product_name.value|h}--></td>
72        </tr>
73        <tr>
74            <th>規格1<span class="attention">*</span></th>
75            <td>
76                <!--{assign var=key value="select_class_id1"}-->
77                <!--{if $arrErr[$key]}-->
78                <span class="attention"><!--{$arrErr[$key]}--></span>
79                <!--{/if}-->
80
81                <select name="<!--{$key}-->">
82                    <option value="">選択してください</option>
83                    <!--{html_options options=$arrClass selected=$arrForm[$key].value}-->
84                </select>
85            </td>
86        </tr>
87        <tr>
88            <th>規格2</th>
89            <td>
90                <!--{assign var=key value="select_class_id2"}-->
91                <!--{if $arrErr[$key]}-->
92                <span class="attention"><!--{$arrErr[$key]}--></span>
93                <!--{/if}-->
94                <select name="<!--{$key}-->">
95                    <option value="">選択してください</option>
96                    <!--{html_options options=$arrClass selected=$arrForm[$key].value}-->
97                </select>
98            </td>
99        </tr>
100    </table>
101    <div class="btn-area">
102        <ul>
103            <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>
104            <li><a class="btn-action" href="javascript:;" onclick="fnModeSubmit('disp','',''); return false;"><span class="btn-next">表示する</span></a></li>
105        <!--{if $arrForm.total.value > 0}-->
106            <li><a class="btn-action" href="javascript:;" onclick="fnModeSubmit('delete','',''); return false;"><span class="btn-next">削除する</span></a></li>
107        <!--{/if}-->
108        </ul>
109    </div>
110
111    <!--{if $arrForm.total.value > 0}-->
112
113    <!--{foreach item=item name=i from=$arrClassCat}-->
114        <!--{if $smarty.foreach.i.first}-->
115            <!--{assign var=cnt value=$smarty.foreach.i.total}-->
116        <!--{/if}-->
117    <!--{/foreach}-->
118
119    <div class="list-info clearfix">
120        <div class="btn"><a class="btn-normal" href="javascript:;" onclick="fnCopyValue('<!--{$cnt}-->', '<!--{$smarty.const.DISABLED_RGB}-->'); return false;"><span>一行目のデータをコピーする</span></a></div>
121        <p><span class="bold">アップロード可能な拡張子:</span><!--{$smarty.const.DOWNLOAD_EXTENSION}-->(パラメータ DOWNLOAD_EXTENSION)</p>
122    </div>
123
124    <!--{assign var=key1 value="class_id1"}-->
125    <!--{assign var=key2 value="class_id2"}-->
126    <!--{assign var=class_id1 value=$arrForm[$key1].value|h}-->
127    <!--{assign var=class_id2 value=$arrForm[$key2].value|h}-->
128    <input type="hidden" name="<!--{$key1}-->" value="<!--{$class_id1}-->" />
129    <input type="hidden" name="<!--{$key2}-->" value="<!--{$class_id2}-->" />
130    <table class="list" width="900">
131        <colgroup width="5%">
132        <colgroup width="9%">
133        <colgroup width="9%">
134        <colgroup width="9%">
135        <colgroup width="10%">
136        <colgroup width="10%">
137        <colgroup width="10%">
138        <colgroup width="10%">
139        <colgroup width="8%">
140        <colgroup width="8%">
141        <colgroup width="8%">
142        <tr>
143            <th><input type="checkbox" onclick="fnAllCheck(this, 'input[name^=check]')" id="allCheck" /> <label for="allCheck"><br>登録</label></th>
144            <th>規格1<br>(<!--{$arrClass[$class_id1]|default:"未選択"|h}-->)</th>
145            <th>規格2<br>(<!--{$arrClass[$class_id2]|default:"未選択"|h}-->)</th>
146            <th>商品コード</th>
147            <th>在庫数<span class="attention">*</span></th>
148            <th><!--{$smarty.const.NORMAL_PRICE_TITLE}-->(円)</th>
149            <th><!--{$smarty.const.SALE_PRICE_TITLE}-->(円)<span class="attention">*</span></th>
150            <th>商品種別<span class="attention">*</span></th>
151            <th>ダウンロード<br>ファイル名<span class="red"><br>上限<!--{$smarty.const.STEXT_LEN}-->文字</span></th>
152            <th>ダウンロード商品用<br>ファイル</th>
153        </tr>
154        <!--{section name=cnt loop=$arrForm.total.value}-->
155            <!--{assign var=index value=$smarty.section.cnt.index}-->
156
157            <!--{* TODO *}-->
158            <!--{assign var=key value="error:`$smarty.section.cnt.iteration`"}-->
159            <!--{if $arrErr[$key] != ""}-->
160            <tr>
161                <td colspan="10"><span class="attention"><!--{$arrErr[$key]}--></span></td>
162            </tr>
163            <!--{/if}-->
164            <tr >
165
166                <td class="center" >
167                    <!--{assign var=key value="classcategory_id1"}-->
168                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
169                    <!--{assign var=key value="classcategory_id2"}-->
170                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
171                    <!--{assign var=key value="product_class_id"}-->
172                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
173                    <!--{assign var=key value="check"}-->
174                    <input type="checkbox" name="<!--{$key}-->[<!--{$index}-->]" value="1" <!--{if $arrForm[$key].value[$index] == 1}-->checked="checked"<!--{/if}--> />
175                </td>
176                <td class="center">
177                    <!--{assign var=key value="classcategory_name1"}-->
178                    <!--{$arrForm[$key].value[$index]|h}-->
179                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
180                </td>
181                <td class="center">
182                    <!--{assign var=key value="classcategory_name2"}-->
183                    <!--{$arrForm[$key].value[$index]|h}-->
184                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
185                </td>
186                <td class="center">
187                    <!--{assign var=key value="product_code"}-->
188                    <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}--> />
189                </td>
190                <td class="center">
191                    <!--{assign var=key value="stock"}-->
192                    <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}-->" />
193                    <!--{assign var=key value="stock_unlimited"}--><br />
194                    <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>
195                </td>
196                <td class="center">
197                    <!--{assign var=key value="price01"}-->
198                    <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}--> />
199                </td>
200                <td class="center">
201                    <!--{assign var=key value="price02"}-->
202                    <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}--> />
203                </td>
204                <td class="class-product-type">
205                    <!--{assign var=key value="product_type_id"}-->
206                    <!--{html_radios name="`$key`[`$index`]" options=$arrProductType selected=$arrForm[$key].value[$index]|h separator='<br />'}-->
207                </td>
208                <td class="center">
209                    <!--{assign var=key value="down_filename}-->
210                    <span class="attention"><!--{$arrErr[$key]}--></span>
211                    <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" />
212                </td>
213                <td>
214                    <!--{assign var=key value="down_realfilename"}-->
215                    <span class="attention"><!--{$arrErr[$key]}--></span>
216                    <!--{if $arrForm[$key].value[$index] != ""}-->
217                        <!--{$arrForm[$key].value[$index]|h}-->
218                        <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
219                        <a href="?" onclick="fnFormModeSubmit('form1', 'delete_down', 'down_key[<!--{$index}-->]', '<!--{$key}-->'); return false;">[ファイルの取り消し]</a><br />
220                    <!--{/if}-->
221                    <input type="file" name="<!--{$key}-->[<!--{$index}-->]" size="10" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" /><br />
222                    <a class="btn-normal" href="javascript:;" name="btn" onclick="fnFormModeSubmit('form1', 'upload_down', 'down_key', '<!--{$key}-->[<!--{$index}-->]'); return false;">アップロード</a>
223                </td>
224            </tr>
225        <!--{/section}-->
226    </table>
227
228    <div class="btn-area">
229        <ul>
230            <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'edit', '', ''); return false;"><span class="btn-next">確認ページへ</span></a></li>
231        </ul>
232    </div>
233
234    <!--{/if}-->
235
236</div>
237</form>
Note: See TracBrowser for help on using the repository browser.