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

Revision 23230, 12.3 KB checked in by m_uehara, 11 years ago (diff)

#2363 r23177, r23181 - r23186, r23188 - r23191, r23194, r23197, r23199 - r23218, r23220, r23223 - r23225 をマージ

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