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

Revision 20941, 10.6 KB checked in by Seasoft, 13 years ago (diff)

#1312 (ログインブロックからのログインでURL復帰が不十分)
#1313 (URL の searchpart が必要ないケースで REQUEST_URI が使用されている)

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