source: branches/version-2_13_0/data/Smarty/templates/admin/products/product_class.tpl @ 23194

Revision 23194, 18.3 KB checked in by m_uehara, 11 years ago (diff)

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