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

Revision 20636, 16.4 KB checked in by nanasess, 13 years ago (diff)
  • #1098(新規規格登録で、商品種別がデフォルトでチェック入っていない)
  • #1099(「1行目のデータをコピーする」で「商品種別」「ダウンロードファイル名」がコピーされない)
  • 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    // 無制限チェックボックスの初期化
27    $('input[id^=stock_unlimited_]').each(function() {
28        var index = $(this).attr('id').replace(/^stock_unlimited_/ig, '');
29        var checked = $(this).attr('checked');
30
31        if (checked) {
32            $('#stock_' + index)
33                .attr('readonly', true)
34                .css('background-color', '<!--{$smarty.const.DISABLED_RGB}-->');
35        }
36    });
37
38    // 無制限チェックボックス
39    $('input[id^=stock_unlimited_]').change(function() {
40        var index = $(this).attr('id').replace(/^stock_unlimited_/ig, '');
41        var checked = $(this).attr('checked');
42
43        if (checked) {
44            $('#stock_' + index)
45                .attr('readonly', true)
46                .css('background-color', '<!--{$smarty.const.DISABLED_RGB}-->');
47        } else {
48            $('#stock_' + index)
49                .attr('readonly', false)
50                .css('background-color', '');
51        }
52    });
53
54    // 1行目をコピーボタン
55    $('#copy_from_first').click(function() {
56        var check = $('#check_0').attr('checked');
57        $('input[id^=check_]').attr('checked', check);
58
59        var product_code = $('#product_code_0').val();
60        $('input[id^=product_code_]').val(product_code);
61
62        var stock = $('#stock_0').val();
63        $('input[id^=stock_]').val(stock);
64
65        var stock_unlimited = $('#stock_unlimited_0').attr('checked');
66        $('input[id^=stock_unlimited_]').each(function() {
67            var checked = stock_unlimited;
68            var index = $(this).attr('id').replace(/^stock_unlimited_/ig, '');
69            $(this).attr('checked', checked);
70            if (checked) {
71                $('#stock_' + index)
72                    .attr('readonly', true)
73                    .css('background-color', '<!--{$smarty.const.DISABLED_RGB}-->');
74            } else {
75                $('#stock_' + index)
76                    .attr('readonly', false)
77                    .css('background-color', '');
78            }
79        });
80
81        var price01 = $('#price01_0').val();
82        $('input[id^=price01_]').val(price01);
83
84        var price02 = $('#price02_0').val();
85        $('input[id^=price02_]').val(price02);
86
87        var product_type_id_value = '';
88        $('input[id^=product_type_id_0_]').each(function() {
89            if ($(this).attr('checked')) {
90                product_type_id_value = $(this).val();
91            }
92        });
93        $('input[id^=product_type_id_]').each(function() {
94            if ($(this).val() == product_type_id_value) {
95                $(this).attr('checked', true);
96            }
97        });
98
99        var down_filename = $('#down_filename_0').val();
100        $('input[id^=down_filename_]').val(down_filename);
101    });
102});
103//]]>
104</script>
105<h2>商品規格登録</h2>
106<form name="form1" id="form1" method="post" action="" enctype="multipart/form-data">
107<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
108<!--{foreach key=key item=item from=$arrSearchHidden}-->
109    <!--{if is_array($item)}-->
110        <!--{foreach item=c_item from=$item}-->
111        <input type="hidden" name="<!--{$key|h}-->[]" value="<!--{$c_item|h}-->" />
112        <!--{/foreach}-->
113    <!--{else}-->
114        <input type="hidden" name="<!--{$key|h}-->" value="<!--{$item|h}-->" />
115    <!--{/if}-->
116<!--{/foreach}-->
117<input type="hidden" name="mode" value="edit" />
118<input type="hidden" name="product_id" value="<!--{$arrForm.product_id.value|h}-->" />
119<input type="hidden" name="upload_index" value="">
120<input type="hidden" name="total" value="<!--{$arrForm.total.value|h}-->" />
121
122<div id="products" class="contents-main">
123
124    <table>
125        <tr>
126            <th>商品名</th>
127            <td><!--{$arrForm.product_name.value|h}--></td>
128        </tr>
129        <tr>
130            <th>規格1<span class="attention">*</span></th>
131            <td>
132                <!--{assign var=key value="class_id1"}-->
133                <!--{if $arrErr[$key]}-->
134                <span class="attention"><!--{$arrErr[$key]}--></span>
135                <!--{/if}-->
136
137                <select name="<!--{$key}-->">
138                    <option value="">選択してください</option>
139                    <!--{html_options options=$arrClass selected=$arrForm[$key].value}-->
140                </select>
141            </td>
142        </tr>
143        <tr>
144            <th>規格2</th>
145            <td>
146                <!--{assign var=key value="class_id2"}-->
147                <!--{if $arrErr[$key]}-->
148                <span class="attention"><!--{$arrErr[$key]}--></span>
149                <!--{/if}-->
150                <select name="<!--{$key}-->">
151                    <option value="">選択してください</option>
152                    <!--{html_options options=$arrClass selected=$arrForm[$key].value}-->
153                </select>
154            </td>
155        </tr>
156    </table>
157    <div class="btn-area">
158        <ul>
159            <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>
160            <li><a class="btn-action" href="javascript:;" onclick="fnModeSubmit('disp','',''); return false;"><span class="btn-next">表示する</span></a></li>
161        <!--{if $arrForm.total.value > 0}-->
162            <li><a class="btn-action" href="javascript:;" onclick="fnModeSubmit('delete','',''); return false;"><span class="btn-next">削除する</span></a></li>
163        <!--{/if}-->
164        </ul>
165    </div>
166
167    <!--{if $arrForm.total.value > 0}-->
168
169    <!--{foreach item=item name=i from=$arrClassCat}-->
170        <!--{if $smarty.foreach.i.first}-->
171            <!--{assign var=cnt value=$smarty.foreach.i.total}-->
172        <!--{/if}-->
173    <!--{/foreach}-->
174
175    <div class="list-info clearfix">
176        <div class="btn"><a class="btn-normal" href="javascript:;" id="copy_from_first"><span>一行目のデータをコピーする</span></a></div>
177        <p><span class="bold">アップロード可能な拡張子:</span><!--{$smarty.const.DOWNLOAD_EXTENSION}-->(パラメータ DOWNLOAD_EXTENSION)</p>
178    </div>
179
180    <!--{if $arrErr.check_empty}-->
181        <span class="attention"><!--{$arrErr.check_empty}--></span>
182    <!--{/if}-->
183
184    <table class="list" width="900">
185        <colgroup width="5%">
186        <colgroup width="9%">
187        <colgroup width="9%">
188        <colgroup width="9%">
189        <colgroup width="10%">
190        <colgroup width="10%">
191        <colgroup width="10%">
192        <colgroup width="10%">
193        <colgroup width="8%">
194        <colgroup width="8%">
195        <colgroup width="8%">
196        <tr>
197            <th><input type="checkbox" onclick="fnAllCheck(this, 'input[name^=check]')" id="allCheck" /> <label for="allCheck"><br>登録</label></th>
198            <th>規格1<br>(<!--{$arrClass[$class_id1]|default:"未選択"|h}-->)</th>
199            <th>規格2<br>(<!--{$arrClass[$class_id2]|default:"未選択"|h}-->)</th>
200            <th>商品コード</th>
201            <th>在庫数<span class="attention">*</span></th>
202            <th><!--{$smarty.const.NORMAL_PRICE_TITLE}-->(円)</th>
203            <th><!--{$smarty.const.SALE_PRICE_TITLE}-->(円)<span class="attention">*</span></th>
204            <th>商品種別<span class="attention">*</span></th>
205            <th>ダウンロード<br>ファイル名<span class="red"><br>上限<!--{$smarty.const.STEXT_LEN}-->文字</span></th>
206            <th>ダウンロード商品用<br>ファイル</th>
207        </tr>
208        <!--{section name=cnt loop=$arrForm.total.value}-->
209            <!--{assign var=index value=$smarty.section.cnt.index}-->
210
211            <tr>
212                <td class="center">
213                    <!--{assign var=key value="classcategory_id1"}-->
214                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
215                    <!--{assign var=key value="classcategory_id2"}-->
216                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
217                    <!--{assign var=key value="product_class_id"}-->
218                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
219                    <!--{assign var=key value="check"}-->
220                    <!--{if $arrErr[$key][$index]}-->
221                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
222                    <!--{/if}-->
223                    <input type="checkbox" name="<!--{$key}-->[<!--{$index}-->]" value="1" <!--{if $arrForm[$key].value[$index] == 1}-->checked="checked"<!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" />
224                </td>
225                <td class="center">
226                    <!--{assign var=key value="classcategory_name1"}-->
227                    <!--{if $arrErr[$key][$index]}-->
228                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
229                    <!--{/if}-->
230                    <!--{$arrForm[$key].value[$index]|h}-->
231                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
232                </td>
233                <td class="center">
234                    <!--{assign var=key value="classcategory_name2"}-->
235                    <!--{if $arrErr[$key][$index]}-->
236                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
237                    <!--{/if}-->
238                    <!--{$arrForm[$key].value[$index]|h}-->
239                    <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
240                </td>
241                <td class="center">
242                    <!--{assign var=key value="product_code"}-->
243                    <!--{if $arrErr[$key][$index]}-->
244                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
245                    <!--{/if}-->
246                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key][$index] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" />
247                </td>
248                <td class="center">
249                    <!--{assign var=key value="stock"}-->
250                    <!--{if $arrErr[$key][$index]}-->
251                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
252                    <!--{/if}-->
253                     <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key][$index] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" />
254                    <!--{assign var=key value="stock_unlimited"}--><br />
255                    <!--{if $arrErr[$key][$index]}-->
256                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
257                    <!--{/if}-->
258                    <input type="checkbox" name="<!--{$key}-->[<!--{$index}-->]" value="1" <!--{if $arrForm[$key].value[$index] == "1"}-->checked="checked"<!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" /><label for="<!--{$key}-->_<!--{$index}-->">無制限</label>
259                </td>
260                <td class="center">
261                    <!--{assign var=key value="price01"}-->
262                    <!--{if $arrErr[$key][$index]}-->
263                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
264                    <!--{/if}-->
265                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key][$index] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" />
266                </td>
267                <td class="center">
268                    <!--{assign var=key value="price02"}-->
269                    <!--{if $arrErr[$key][$index]}-->
270                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
271                    <!--{/if}-->
272                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key][$index] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" />
273                </td>
274                <td class="class-product-type">
275                    <!--{assign var=key value="product_type_id"}-->
276                    <!--{if $arrErr[$key][$index]}-->
277                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
278                    <!--{/if}-->
279                    <!--{foreach from=$arrProductType key=productTypeKey item=productType name=productType}-->
280                        <input type="radio" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$productTypeKey}-->" <!--{if $arrForm[$key].value[$index] == $productTypeKey}-->checked="checked"<!--{/if}--> <!--{if $arrErr[$key][$index] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> id="<!--{$key}-->_<!--{$index}-->_<!--{$smarty.foreach.productType.index}-->"><label for="<!--{$key}-->_<!--{$index}-->_<!--{$smarty.foreach.productType.index}-->"<!--{if $arrErr[$key][$index] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> ><!--{$productType}--></label><!--{if !$smarty.foreach.productType.last}--><br /><!--{/if}-->
281                    <!--{/foreach}-->
282                </td>
283                <td class="center">
284                    <!--{assign var=key value="down_filename}-->
285                    <!--{if $arrErr[$key][$index]}-->
286                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
287                    <!--{/if}-->
288                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{if $arrErr[$key][$index] != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}--><!--{/if}-->" size="10" id="<!--{$key}-->_<!--{$index}-->" />
289                </td>
290                <td>
291                    <!--{assign var=key value="down_realfilename"}-->
292                    <!--{if $arrErr[$key][$index]}-->
293                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
294                    <!--{/if}-->
295                    <!--{if $arrForm[$key].value[$index] != ""}-->
296                        <!--{$arrForm[$key].value[$index]|h}--><br />
297                        <input type="hidden" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" />
298                        <a href="?" onclick="fnFormModeSubmit('form1', 'file_delete', 'upload_index', '<!--{$index}-->'); return false;">[ファイルの取り消し]</a>
299                    <!--{else}-->
300                    <input type="file" name="<!--{$key}-->[<!--{$index}-->]" size="10" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" /><br />
301                    <a class="btn-normal" href="javascript:;" name="btn" onclick="fnFormModeSubmit('form1', 'file_upload', 'upload_index', '<!--{$index}-->'); return false;">アップロード</a>
302                    <!--{/if}-->
303                </td>
304            </tr>
305        <!--{/section}-->
306    </table>
307
308    <div class="btn-area">
309        <ul>
310            <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'edit', '', ''); return false;"><span class="btn-next">確認ページへ</span></a></li>
311        </ul>
312    </div>
313
314    <!--{/if}-->
315
316</div>
317</form>
Note: See TracBrowser for help on using the repository browser.