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

Revision 21864, 10.9 KB checked in by h_yoshimoto, 12 years ago (diff)

#1831 Copyrightを更新

  • 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        }
52        if (document.getElementById(class2).type == 'select-one' && class2_id == '') {
53            err_text = err_text + class_name2 + "を選択してください。\n";
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            eleDynamic.value = ''
116        }
117    }
118//]]></script>
119
120<!--▼検索フォーム-->
121<form name="form1" id="form1" method="post" action="?">
122<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
123<input name="mode" type="hidden" value="search" />
124<input name="anchor_key" type="hidden" value="" />
125<input name="search_pageno" type="hidden" value="" />
126<input name="no" type="hidden" value="<!--{$tpl_no|h}-->" />
127<table class="form">
128    <col width="20%" />
129    <col width="80%" />
130    <tr>
131        <th>カテゴリ</th>
132        <td>
133            <select name="search_category_id">
134                <option value="" selected="selected">選択してください</option>
135                <!--{html_options options=$arrCatList selected=$arrForm.search_category_id}-->
136            </select>
137        </td>
138    </tr>
139    <tr>
140        <th>商品名</th>
141        <td><input type="text" name="search_name" value="<!--{$arrForm.search_name|h}-->" size="35" class="box35" /></td>
142    </tr>
143    <tr>
144        <th>商品コード</th>
145        <td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code|h}-->" size="35" class="box35" /></td>
146    </tr>
147</table>
148<div class="btn-area">
149    <ul>
150        <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'search', '', ''); return false;"><span class="btn-next">検索を開始</span></a></li>
151    </ul>
152</div>
153</form>
154<!--▼検索結果表示-->
155<!--{if $tpl_linemax}-->
156    <p>
157        <!--{$tpl_linemax}-->件が該当しました。
158        <!--{$tpl_strnavi}-->
159    </p>
160
161    <!--▼検索後表示部分-->
162    <table class="list">
163    <col width="20%" />
164    <col width="20%" />
165    <col width="50%" />
166    <col width="10%" />
167        <tr>
168            <th class="image">商品画像</th>
169            <th class="id">商品コード</th>
170            <th class="name">商品名</th>
171            <th class="action">決定</th>
172        </tr>
173        <!--{section name=cnt loop=$arrProducts}-->
174            <!--{assign var=id value=$arrProducts[cnt].product_id}-->
175            <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;">
176                <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
177                <!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
178                <!--{assign var=status value="`$arrProducts[cnt].status`"}-->
179                <tr style="background:<!--{$arrPRODUCTSTATUS_COLOR[$status]}-->;">
180                    <td class="center">
181                        <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}-->" />
182                    </td>
183                    <td>
184                        <!--{assign var=codemin value=`$arrProducts[cnt].product_code_min`}-->
185                        <!--{assign var=codemax value=`$arrProducts[cnt].product_code_max`}-->
186                        <!--{* 商品コード *}-->
187                        <!--{if $codemin != $codemax}-->
188                            <!--{$codemin|h}-->~<!--{$codemax|h}-->
189                        <!--{else}-->
190                            <!--{$codemin|h}-->
191                        <!--{/if}-->
192                    </td>
193                    <td>
194                        <!--{$arrProducts[cnt].name|h}-->
195
196                        <!--{assign var=class1 value=classcategory_id`$id`_1}-->
197                        <!--{assign var=class2 value=classcategory_id`$id`_2}-->
198                        <!--{if $tpl_classcat_find1[$id]}-->
199                        <dl>
200                            <dt><!--{$tpl_class_name1[$id]|h}-->:</dt>
201                            <dd>
202                                <select name="classcategory_id1" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->"    onchange="fnSetClassCategories(this.form);">
203                                    <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}-->
204                                </select>
205                                <!--{if $arrErr[$class1] != ""}-->
206                                <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span>
207                                <!--{/if}-->
208                            </dd>
209                        </dl>
210                        <!--{else}-->
211                        <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="" />
212                        <!--{/if}-->
213
214                        <!--{if $tpl_classcat_find2[$id]}-->
215                        <dl>
216                            <dt><!--{$tpl_class_name2[$id]|h}-->:</dt>
217                            <dd>
218                                <select name="classcategory_id2" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);"></select>
219                                <!--{if $arrErr[$class2] != ""}-->
220                                <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span>
221                                <!--{/if}-->
222                            </dd>
223                        </dl>
224                        <!--{else}-->
225                        <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" />
226                        <!--{/if}-->
227                        <input type="hidden" name="product_id" value="<!--{$id|h}-->" />
228                        <input type="hidden" name="product_class_id<!--{$id|h}-->" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" />
229                        <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" />
230                    </td>
231                    <td class="center"><a href="javascript:;" onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->'); return false;">決定</a></td>
232                </tr>
233                <!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
234            </form>
235        <!--{sectionelse}-->
236            <tr>
237                <td colspan="4">商品が登録されていません</td>
238            </tr>
239        <!--{/section}-->
240    </table>
241<!--{/if}-->
242<!--▲検索結果表示-->
243
244
245<!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_footer.tpl"}-->
Note: See TracBrowser for help on using the repository browser.