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

Revision 23228, 12.0 KB checked in by pineray, 11 years ago (diff)

#2408 ポップアップのXML宣言前の改行を削除

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