source: branches/version-2_12-multilang/data/Smarty/templates/admin/order/product_select.tpl @ 22171

Revision 22171, 11.2 KB checked in by m_uehara, 11 years ago (diff)

#1991 Syntax Error を修正しました。

  • 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-2012 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<!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_header.tpl"}-->
26
27<script type="text/javascript">//<![CDATA[
28    self.moveTo(20,20);self.focus();
29
30    function func_submit(product_id, class_name1, class_name2) {
31        var err_text = '';
32        var fm = window.opener.document.form1;
33        var fm1 = window.opener.document;
34        var class1 = "classcategory_id" + product_id + "_1";
35        var class2 = "classcategory_id" + product_id + "_2";
36
37        var class1_id = document.getElementById(class1).value;
38        var class2_id = document.getElementById(class2).value;
39        var product_class_id = document.getElementById("product_class_id" + product_id).value;
40        var opner_product_id = 'add_product_id';
41        var opner_product_class_id = 'add_product_class_id';
42        var tpl_no = '<!--{$tpl_no}-->';
43
44        if (tpl_no != '') {
45            opner_product_id = 'edit_product_id';
46            opner_product_class_id = 'edit_product_class_id';
47            fm1.getElementById("no").value = escape('<!--{$tpl_no}-->');
48        }
49        if (document.getElementById(class1).type == 'select-one' && class1_id == '__unselected') {
50            err_text = class_name1 + "を選択してください。\n";
51            err_text = class_name1 + "を選択してください。\n";
52        }
53        if (document.getElementById(class2).type == 'select-one' && class2_id == '') {
54            err_text = err_text + class_name2 + "を選択してください。\n";
55        }
56        if (err_text != '') {
57            alert(err_text);
58            return false;
59        }
60
61        fm1.getElementById(opner_product_id).value = product_id;
62        fm1.getElementById(opner_product_class_id).value = product_class_id;
63
64        fm.mode.value = 'select_product_detail';
65        fm.anchor_key.value = 'order_products';
66        fm.submit();
67        window.close();
68
69        return true;
70    }
71
72    // 規格2に選択肢を割り当てる。
73    function fnSetClassCategories(form, classcat_id2_selected) {
74        sele1 = form.classcategory_id1;
75        sele2 = form.classcategory_id2;
76        product_id = form.product_id.value;
77
78        if (sele1) {
79            if (sele2) {
80                // 規格2の選択肢をクリア
81                count = sele2.options.length;
82                for(i = count; i >= 0; i--) {
83                    sele2.options[i] = null;
84                }
85
86                // 規格2に選択肢を割り当てる
87                classcats = productsClassCategories[product_id][sele1.value];
88                i = 0;
89                for (var classcat_id2_key in classcats) {
90                    classcategory_id2 = classcats[classcat_id2_key].classcategory_id2;
91                    sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcategory_id2);
92                    if (classcategory_id2 == classcat_id2_selected) {
93                        sele2.options[i].selected = true;
94                    }
95                    i++;
96                }
97            }
98            fnCheckStock(form);
99        }
100    }
101
102    function fnCheckStock(form) {
103        product_id = form.product_id.value;
104        classcat_id1 = form.classcategory_id1.value;
105        classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : '';
106        classcat2 = productsClassCategories[product_id][classcat_id1]['#' + classcat_id2];
107        // 商品規格
108        eleDynamic = document.getElementById('product_class_id' + product_id);
109        if (
110            classcat2
111            && typeof classcat2.product_class_id != 'undefined'
112            && String(classcat2.product_class_id).length >= 1
113        ) {
114            eleDynamic.value = classcat2.product_class_id;
115        } else {
116            // 規格が1つのみの場合
117            classcat1 = productsClassCategories[product_id][classcat_id1]['#0'];
118            eleDynamic.value = classcat1.product_class_id;
119        }
120    }
121//]]></script>
122
123<!--▼検索フォーム-->
124<form name="form1" id="form1" method="post" action="?">
125<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
126<input name="mode" type="hidden" value="search" />
127<input name="anchor_key" type="hidden" value="" />
128<input name="search_pageno" type="hidden" value="" />
129<input name="no" type="hidden" value="<!--{$tpl_no|h}-->" />
130<table class="form">
131    <col width="20%" />
132    <col width="80%" />
133    <tr>
134        <th><!--{t string="tpl_191"}--></th>
135        <td>
136            <select name="search_category_id">
137                <option value="" selected="selected"><!--{t string="tpl_068"}--></option>
138                <!--{html_options options=$arrCatList selected=$arrForm.search_category_id}-->
139            </select>
140        </td>
141    </tr>
142    <tr>
143        <th><!--{t string="tpl_189"}--></th>
144        <td><input type="text" name="search_name" value="<!--{$arrForm.search_name|h}-->" size="35" class="box35" /></td>
145    </tr>
146    <tr>
147        <th><!--{t string="tpl_192"}--></th>
148        <td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code|h}-->" size="35" class="box35" /></td>
149    </tr>
150</table>
151<div class="btn-area">
152    <ul>
153        <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'search', '', ''); return false;"><span class="btn-next"><!--{t string="tpl_193"}--></span></a></li>
154    </ul>
155</div>
156</form>
157<!--▼検索結果表示-->
158<!--{if $tpl_linemax}-->
159    <p>
160        <!--{t string="tpl_194" T_FIELD=$tpl_linemax}-->
161        <!--{$tpl_strnavi}-->
162    </p>
163
164    <!--▼検索後表示部分-->
165    <table class="list">
166    <col width="20%" />
167    <col width="20%" />
168    <col width="50%" />
169    <col width="10%" />
170        <tr>
171            <th class="image"><!--{t string="tpl_195"}--></th>
172            <th class="id"><!--{t string="tpl_192"}--></th>
173            <th class="name"><!--{t string="tpl_189"}--></th>
174            <th class="action"><!--{t string="tpl_196"}--></th>
175        </tr>
176        <!--{section name=cnt loop=$arrProducts}-->
177            <!--{assign var=id value=$arrProducts[cnt].product_id}-->
178            <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;">
179                <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
180                <!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
181                <!--{assign var=status value="`$arrProducts[cnt].status`"}-->
182                <tr style="background:<!--{$arrPRODUCTSTATUS_COLOR[$status]}-->;">
183                    <td class="center">
184                        <img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrProducts[cnt].main_list_image|sfNoImageMainList|h}-->&width=65&height=65" alt="<!--{$arrRecommend[$recommend_no].name|h}-->" />
185                    </td>
186                    <td>
187                        <!--{assign var=codemin value=`$arrProducts[cnt].product_code_min`}-->
188                        <!--{assign var=codemax value=`$arrProducts[cnt].product_code_max`}-->
189                        <!--{* 商品コード *}-->
190                        <!--{if $codemin != $codemax}-->
191                            <!--{$codemin|h}--><!--{t string="-"}--><!--{$codemax|h}-->
192                        <!--{else}-->
193                            <!--{$codemin|h}-->
194                        <!--{/if}-->
195                    </td>
196                    <td>
197                        <!--{$arrProducts[cnt].name|h}-->
198
199                        <!--{assign var=class1 value=classcategory_id`$id`_1}-->
200                        <!--{assign var=class2 value=classcategory_id`$id`_2}-->
201                        <!--{if $tpl_classcat_find1[$id]}-->
202                        <dl>
203                            <dt><!--{$tpl_class_name1[$id]|h}-->:</dt>
204                            <dd>
205                                <select name="classcategory_id1" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->"    onchange="fnSetClassCategories(this.form);">
206                                    <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}-->
207                                </select>
208                                <!--{if $arrErr[$class1] != ""}-->
209                                <br /><span class="attention"><!--{t string="tpl_436" T_FIELD=$tpl_class_name1[$id]}--></span>
210                                <!--{/if}-->
211                            </dd>
212                        </dl>
213                        <!--{else}-->
214                        <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="" />
215                        <!--{/if}-->
216
217                        <!--{if $tpl_classcat_find2[$id]}-->
218                        <dl>
219                            <dt><!--{$tpl_class_name2[$id]|h}-->:</dt>
220                            <dd>
221                                <select name="classcategory_id2" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);"></select>
222                                <!--{if $arrErr[$class2] != ""}-->
223                                <br /><span class="attention"><!--{t string="tpl_436" T_FIELD=$tpl_class_name2[$id]}--></span>
224                                <!--{/if}-->
225                            </dd>
226                        </dl>
227                        <!--{else}-->
228                        <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" />
229                        <!--{/if}-->
230                        <input type="hidden" name="product_id" value="<!--{$id|h}-->" />
231                        <input type="hidden" name="product_class_id<!--{$id|h}-->" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" />
232                        <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" />
233                    </td>
234                    <td class="center"><a href="javascript:;" onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->'); return false;"><!--{t string="tpl_196"}--></a></td>
235                </tr>
236                <!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
237            </form>
238        <!--{sectionelse}-->
239            <tr>
240                <td colspan="4"><!--{t string="tpl_197"}--></td>
241            </tr>
242        <!--{/section}-->
243    </table>
244<!--{/if}-->
245<!--▲検索結果表示-->
246
247
248<!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_footer.tpl"}-->
Note: See TracBrowser for help on using the repository browser.