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

Revision 22445, 11.3 KB checked in by m_uehara, 11 years ago (diff)

#2060 メッセージIDの振り直し

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