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

Revision 22856, 6.8 KB checked in by Seasoft, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.13.0)

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