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

Revision 23228, 6.9 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">
27<!--
28self.moveTo(20,20);self.focus();
29$(function() {
30    var product_class_id = window.opener.jQuery('input[id^=product_class_id]');
31    var product_code = window.opener.jQuery('input[id^=product_code]');
32    var product_name = window.opener.jQuery('input[id^=product_name]');
33    var classcategory_name1 = window.opener.jQuery('input[id^=classcategory_name1]');
34    var classcategory_name2 = window.opener.jQuery('input[id^=classcategory_name2]');
35    var price = window.opener.jQuery('input[id^=price]');
36    var quantity = window.opener.jQuery('input[id^=quantity]');
37    var shipping_id = window.opener.jQuery('input[id^=shipping_id]');
38    var shipping_name01 = window.opener.jQuery('input[name^=shipping_name01]');
39    var shipping_name02 = window.opener.jQuery('input[name^=shipping_name02]');
40    var shipping_pref = window.opener.jQuery('select[name^=shipping_pref] option:selected');
41    var shipping_addr01 = window.opener.jQuery('input[name^=shipping_addr01]');
42    var shipping_addr02 = window.opener.jQuery('input[name^=shipping_addr02]');
43
44    // 都道府県の入力チェック
45    shipping_pref.each(function() {
46        if (!$(this).val()) {
47            alert('お届け先住所が入力されていません。');
48            window.close();
49            return;
50        }
51    });
52
53    var index = 0;
54    for (var i = 0; i < product_class_id.length; i++) {
55        for (var j = 0; j < $(quantity[i]).val(); j++) {
56            // 表示商品名
57            var dispname = '';
58
59            // 商品規格ID
60            var idfield = $('<input type="hidden" name="multiple_product_class_id[' + index + ']" value="' + $(product_class_id[i]).val() + '" />"');
61
62            // 商品コード
63            var codefield = $('<input type="hidden" name="multiple_product_code['+ index + ']" value="' + $(product_code[i]).val() + '" />');
64
65            // 商品名
66            var namefield = $('<input type="hidden" name="multiple_product_name[' + index + ']" value="' + $(product_name[i]).val() + '" />');
67            dispname = $(product_name[i]).val();
68
69            // 規格1
70            var class1field = $('<input type="hidden" name="multiple_classcategory_name1[' + index + ']" value="' + $(classcategory_name1[i]).val() + '" />');
71            if ($(classcategory_name1[i]).val() != '') {
72                dispname += '<br />' + $(classcategory_name1[i]).val();
73            }
74
75            // 規格2
76            var class2field = $('<input type="hidden" name="multiple_classcategory_name2[' + index + ']" value="' + $(classcategory_name2[i]).val() + '" />');
77            if ($(classcategory_name2[i]).val() != '') {
78                dispname += '<br />' + $(classcategory_name2[i]).val();
79            }
80
81            // 単価
82            var pricefield = $('<input type="hidden" name="multiple_price[' + index + ']" value="' + $(price[i]).val() + '" />');
83
84            // 数量
85            var qfield = $('<input type="text" name="multiple_quantity[' + index + ']" size="4" value="1" />');
86
87            // 数量と hidden を設定
88            var q = $('<td />').addClass('center')
89                .append(idfield)
90                .append(codefield)
91                .append(namefield)
92                .append(class1field)
93                .append(class2field)
94                .append(pricefield)
95                .append(qfield);
96
97            // お届け先
98            var select = $('<select name="multiple_shipping_id[' + index + ']" />');
99            var s = $('<td />').append(select);
100
101            // 行を生成
102            var tr = $('<tr />')
103                .append($('<td />').text($(product_code[i]).val()))
104                .append($('<td />').html(dispname))
105                .append(q)
106                .append(s);
107
108            jQuery(tr).appendTo('tbody');
109            index++;
110        }
111    }
112
113    // プルダウンを生成
114    for (var i = 0; i < shipping_id.length; i++) {
115        var text = $(shipping_name01[i]).val() + $(shipping_name02[i]).val()
116            + ' ' + $(shipping_pref[i]).text()
117            + $(shipping_addr01[i]).val() + $(shipping_addr02[i]).val();
118
119        var option = $('<option value="' + $(shipping_id[i]).val() + '">' + text + '</option>');
120        $('select').append(option);
121    }
122});
123
124function func_submit() {
125    var err_text = '';
126    var fm = window.opener.document.form1;
127
128    fm.mode.value = 'multiple_set_to';
129    fm.anchor_key.value = 'shipping';
130
131    var div = $('<div />');
132    $('input[name^=multiple_], select[name^=multiple_]').each(function() {
133        // TODO タグをベタ書きにしないと, innerHTML で value が空になってしまう
134        $(div).append('<input type="hidden" name="'
135            + $(this).attr('name')
136            + '" value="' + $(this).val() + '" />');
137    });
138
139    // window.opener に対する append は IE で動作しない
140    window.opener.jQuery('#multiple').html(div.html());
141    fm.submit();
142    window.close();
143    return true;
144}
145//-->
146</script>
147
148<!--▼検索フォーム-->
149<form name="form1" id="form1" method="post" action="<!--{$smarty.server.REQUEST_URI|h}-->">
150    <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
151    <input name="mode" type="hidden" value="search" />
152    <input name="anchor_key" type="hidden" value="" />
153    <input name="search_pageno" type="hidden" value="" />
154    <input name="no" type="hidden" value="<!--{$tpl_no}-->" />
155    <table summary="配送情報" class="list">
156        <thead>
157            <tr>
158                <th>商品コード</th>
159                <th>商品名/規格1/規格2</th>
160                <th>数量</th>
161                <th>お届け先</th>
162            </tr>
163        </thead>
164        <tbody>
165        </tbody>
166    </table>
167    <div class="btn-area">
168        <ul>
169            <li><a class="btn-action" href="javascript:;" onclick="func_submit(); return false;"><span class="btn-next">決定</span></a></li>
170        </ul>
171    </div>
172</form>
173<!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_footer.tpl"}-->
Note: See TracBrowser for help on using the repository browser.