Index: /branches/version-2_5-dev/html/admin/order/multiple.php
===================================================================
--- /branches/version-2_5-dev/html/admin/order/multiple.php	(revision 19934)
+++ /branches/version-2_5-dev/html/admin/order/multiple.php	(revision 19934)
@@ -0,0 +1,35 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once '../require.php';
+require_once CLASS_EX_REALDIR . 'page_extends/admin/order/LC_Page_Admin_Order_Multiple_Ex.php';
+
+// }}}
+// {{{ generate page
+
+$objPage = new LC_Page_Admin_Order_Multiple_Ex();
+register_shutdown_function(array($objPage, 'destroy'));
+$objPage->init();
+$objPage->process();
+?>
Index: /branches/version-2_5-dev/data/class_extends/page_extends/admin/order/LC_Page_Admin_Order_Multiple_Ex.php
===================================================================
--- /branches/version-2_5-dev/data/class_extends/page_extends/admin/order/LC_Page_Admin_Order_Multiple_Ex.php	(revision 19934)
+++ /branches/version-2_5-dev/data/class_extends/page_extends/admin/order/LC_Page_Admin_Order_Multiple_Ex.php	(revision 19934)
@@ -0,0 +1,68 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once(CLASS_REALDIR . "pages/admin/order/LC_Page_Admin_Order_Multiple.php");
+
+/**
+ * 商品選択 のページクラス(拡張).
+ *
+ * LC_Page_Admin_Order_Multiple をカスタマイズする場合はこのクラスを編集する.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class LC_Page_Admin_Order_Multiple_Ex extends LC_Page_Admin_Order_Multiple {
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init() {
+        parent::init();
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process() {
+        parent::process();
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy() {
+        parent::destroy();
+    }
+}
+?>
Index: /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 19928)
+++ /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 19934)
@@ -216,4 +216,17 @@
             break;
 
+        // 複数配送設定表示
+        case 'multiple':
+            $this->objFormParam->setParam($_POST);
+            $this->tpl_onload = "win03('" . URL_PATH . ADMIN_DIR . "order/multiple.php', 'multiple', '600', '500');";
+            break;
+
+        // 複数配送設定を反映
+        case 'multiple_set_to':
+            $multipleSize = $_POST['multiple_size'];
+            $this->lfInitMultipleParam($multipleSize);
+            $this->objFormParam->setParam($_POST);
+            $this->setMultipleItemTo($multipleSize);
+            break;
         default:
             break;
@@ -357,4 +370,61 @@
     }
 
+    /**
+     * 複数配送用フォームの初期化
+     */
+    function lfInitMultipleParam($size) {
+        for ($i = 0; $i < $size; $i++) {
+            $this->objFormParam->addParam("商品規格ID", "multiple_product_class_id" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
+            $this->objFormParam->addParam("商品コード", "multiple_product_code" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
+            $this->objFormParam->addParam("商品名", "multiple_product_name" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
+            $this->objFormParam->addParam("規格1", "multiple_classcategory_name1" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
+            $this->objFormParam->addParam("規格2", "multiple_classcategory_name2" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
+            $this->objFormParam->addParam("単価", "multiple_price" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
+            $this->objFormParam->addParam("数量", "multiple_quantity" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
+            $this->objFormParam->addParam("配送先住所", "multiple_shipping" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
+        }
+    }
+
+
+    function setMultipleItemTo($size) {
+        $arrShipmentItem = array();
+        for ($i = 0; $i < $size; $i++) {
+            $shippingId = $this->objFormParam->getValue('multiple_shipping' . $i);
+            $productClassId = $this->objFormParam->getValue('multiple_product_class_id' . $i);
+
+            $name = $this->objFormParam->getValue('multiple_product_name' . $i);
+            $code = $this->objFormParam->getValue('multiple_product_code' . $i);
+            $class1 = $this->objFormParam->getValue('multiple_classcategory_name1' . $i);
+            $class2 = $this->objFormParam->getValue('multiple_classcategory_name2' . $i);
+            $price = $this->objFormParam->getValue('multiple_price' . $i);
+            $quantity = $this->objFormParam->getValue('multiple_quantity' . $i);
+
+            $arrShipmentItem[$shippingId][$productClassId]['shipping_id'] = $shippingId;
+            $arrShipmentItem[$shippingId][$productClassId]['product_class_id'] = $productClassId;
+            $arrShipmentItem[$shippingId][$productClassId]['classcategory_name1'] = $class1;
+            $arrShipmentItem[$shippingId][$productClassId]['classcategory_name2'] = $class2;
+            $arrShipmentItem[$shippingId][$productClassId]['price'] = $price;
+            $arrShipmentItem[$shippingId][$productClassId]['quantity'] += $quantity;
+        }
+
+        $this->arrShippingIds = array();
+        $this->arrProductClassIds = array();
+        foreach ($arrShipmentItem as $shippingId => $items) {
+
+            $this->arrForm['shipping_product_quantity' . '_' . $shippingId] = count($items);
+            $this->objFormParam->setValue('shipping_product_quantity' . '_' . $shippingId,
+                                          $this->arrForm['shipping_product_quantity' . '_' . $shippingId]);
+
+            $this->arrShippingIds[] = $shippingId;
+            $this->arrProductClassIds[] = array_keys($items);
+
+            foreach ($items as $productClassId => $item) {
+                foreach ($item as $itemKey => $itemVal) {
+                    $this->arrForm[$itemKey . '_' . $shippingId . '_' . $productClassId] = $itemVal;
+                    $this->objFormParam->setValue($itemKey . '_' . $shippingId . '_' . $productClassId, $itemVal);
+                }
+            }
+        }
+    }
 
     function lfGetOrderData($order_id) {
Index: /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Multiple.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Multiple.php	(revision 19934)
+++ /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Multiple.php	(revision 19934)
@@ -0,0 +1,84 @@
+
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once(CLASS_REALDIR . "pages/admin/LC_Page_Admin.php");
+
+/**
+ * 複数配送設定 のページクラス.
+ *
+ * @package Page
+ * @author Kentaro Ohkouchi
+ * @version $Id$
+ */
+class LC_Page_Admin_Order_Multiple extends LC_Page_Admin {
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init() {
+        parent::init();
+        $this->tpl_mainpage = 'order/multiple.tpl';
+        $this->tpl_mainno = 'order';
+        $this->tpl_subnavi = '';
+        $this->tpl_subno = "";
+        $this->tpl_subtitle = '複数配送設定';
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process() {
+        $this->action();
+        $this->sendResponse();
+    }
+
+    /**
+     * Page のアクション.
+     *
+     * @return void
+     */
+    function action() {
+        // 認証可否の判定
+        SC_Utils_Ex::sfIsSuccess(new SC_Session());
+        $this->setTemplate($this->tpl_mainpage);
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy() {
+        parent::destroy();
+    }
+}
+?>
Index: /branches/version-2_5-dev/data/Smarty/templates/admin/order/multiple.tpl
===================================================================
--- /branches/version-2_5-dev/data/Smarty/templates/admin/order/multiple.tpl	(revision 19934)
+++ /branches/version-2_5-dev/data/Smarty/templates/admin/order/multiple.tpl	(revision 19934)
@@ -0,0 +1,180 @@
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+*}-->
+<!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_header.tpl"}-->
+
+<script type="text/javascript">
+<!--
+self.moveTo(20,20);self.focus();
+$(function() {
+
+    var product_class_id = window.opener.jQuery('input[id^=product_class_id_]');
+    var product_code = window.opener.jQuery('input[id^=product_code_]');
+    var product_name = window.opener.jQuery('input[id^=product_name_]');
+    var classcategory_name1 = window.opener.jQuery('input[id^=classcategory_name1_]');
+    var classcategory_name2 = window.opener.jQuery('input[id^=classcategory_name2_]');
+    var price = window.opener.jQuery('input[id^=price_]');
+    var quantity = window.opener.jQuery('input[id^=quantity_]');
+    var shipping_id = window.opener.jQuery('input[id^=shipping_id_]');
+    var shipping_name01 = window.opener.jQuery('input[name^=shipping_name01_]');
+    var shipping_name02 = window.opener.jQuery('input[name^=shipping_name02_]');
+    var shipping_pref = window.opener.jQuery('select[name^=shipping_pref_] option:selected');
+    var shipping_addr01 = window.opener.jQuery('input[name^=shipping_addr01_]');
+    var shipping_addr02 = window.opener.jQuery('input[name^=shipping_addr02_]');
+
+    var index = 0;
+    for (var i = 0; i < product_class_id.length; i++) {
+
+        for (var j = 0; j < $(quantity[i]).val(); j++) {
+
+            // 商品規格ID
+            var idfield = jQuery('<input />')
+                .attr({'name': 'multiple_product_class_id' + index,
+                       'type': 'hidden'})
+                .val($(product_class_id[i]).val());
+
+            // 商品コード
+            var codefield = jQuery('<input />')
+                .attr({'name': 'multiple_product_code' + index,
+                       'type': 'hidden'})
+                .val($(product_code[i]).val());
+
+            // 商品名
+            var namefield = jQuery('<input />')
+                .attr({'name': 'multiple_product_name' + index,
+                       'type': 'hidden'})
+                .val($(product_name[i]).val());
+
+            // 規格1
+            var class1field = jQuery('<input />')
+                .attr({'name': 'multiple_classcategory_name1' + index,
+                       'type': 'hidden'})
+                .val($(classcategory_name1[i]).val());
+
+            // 規格2
+            var class2field = jQuery('<input />')
+                .attr({'name': 'multiple_classcategory_name2' + index,
+                       'type': 'hidden'})
+                .val($(classcategory_name2[i]).val());
+
+            // 単価
+            var pricefield = jQuery('<input />')
+                .attr({'name': 'multiple_price' + index,
+                       'type': 'hidden'})
+                .val($(price[i]).val());
+
+
+            // 数量
+            var qfield = jQuery('<input />')
+                .attr({'name': 'multiple_quantity' + index,
+                       'type': 'text',
+                       'size': 4})
+                .val(1);
+
+            // 数量と hidden を設定
+            var q = jQuery('<td />').addClass('center')
+                .append(idfield)
+                .append(namefield)
+                .append(class1field)
+                .append(class2field)
+                .append(pricefield)
+                .append(qfield);
+
+            // お届け先
+            var select = jQuery('<select />').attr('name', 'multiple_shipping' + index);
+            var s = jQuery('<td />').append(select);
+
+            // 行を生成
+            var tr = jQuery('<tr />')
+                .append(jQuery('<td />').text($(product_code[i]).val()))
+                .append(jQuery('<td />').text($(product_name[i]).val()))
+                .append(q)
+                .append(s);
+
+            jQuery(tr).appendTo('tbody');
+            index++;
+        }
+    }
+
+    // プルダウンを生成
+    for (var i = 0; i < shipping_id.length; i++) {
+        var text = $(shipping_name01[i]).val() + $(shipping_name02[i]).val()
+            + ' ' + $(shipping_pref[i]).text()
+            + $(shipping_addr01[i]).val() + $(shipping_addr02[i]).val();
+        var option = jQuery('<option />')
+            .val($(shipping_id[i]).val())
+            .text(text);
+        $('select').append(option);
+    }
+});
+function func_submit() {
+    var err_text = '';
+    var fm = window.opener.jQuery('form');;
+
+    fm.get(0).mode.value = 'multiple_set_to';
+    fm.get(0).anchor_key.value = 'shipping';
+
+    $('input[name^=multiple_], select[name^=multiple_]').each(function() {
+        var input = jQuery('<input />')
+            .attr({'name': $(this).attr('name'),
+                   'type': 'hidden'})
+            .val($(this).val());
+        fm.append(input);
+    });
+    fm.append(jQuery('<input />')
+              .attr({'name': 'multiple_size',
+                     'type': 'hidden'})
+              .val($('input[name^=multiple_product_class_id]').length));
+    fm.submit();
+    window.close();
+
+    return true;
+}
+//-->
+</script>
+
+<!--▼検索フォーム-->
+<form name="form1" id="form1" method="post" action="<!--{$smarty.server.REQUEST_URI|h}-->">
+<input name="mode" type="hidden" value="search" />
+<input name="anchor_key" type="hidden" value="" />
+<input name="search_pageno" type="hidden" value="" />
+<input name="no" type="hidden" value="<!--{$tpl_no}-->" />
+<table summary="配送情報" class="list">
+  <thead>
+    <tr>
+      <th>商品コード</th>
+      <th>商品名/規格1/規格2</th>
+      <th>数量</th>
+      <th>お届け先</th>
+    </tr>
+  </thead>
+  <tbody>
+  </tbody>
+</table>
+<div class="btn-area">
+  <ul>
+    <li><a class="btn-action" href="javascript:;" onclick="func_submit();"><span class="btn-next">決定</span></a></li>
+  </ul>
+</div>
+</form>
+<!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_footer.tpl"}-->
Index: /branches/version-2_5-dev/data/Smarty/templates/admin/order/edit.tpl
===================================================================
--- /branches/version-2_5-dev/data/Smarty/templates/admin/order/edit.tpl	(revision 19923)
+++ /branches/version-2_5-dev/data/Smarty/templates/admin/order/edit.tpl	(revision 19934)
@@ -54,4 +54,10 @@
         }
     }
+
+    function fnMultiple() {
+        document.form1.mode.value = "multiple";
+        document.form1.submit();
+        return false;
+    }
 //-->
 </script>
@@ -217,6 +223,7 @@
 
     <!--▼受注商品情報ここから-->
+    <a name="order_products"></a>
     <h2 id="order_products">
-        <a name="order_products">受注商品情報</a>
+        受注商品情報
         <a class="btn-normal" href="javascript:;" name="cheek" onclick="fnModeSubmit('cheek','anchor_key','order_products');">計算結果の確認</a>
         <a class="btn-normal" href="javascript:;" name="add_product" onclick="win03('<!--{$smarty.const.URL_PATH}--><!--{$smarty.const.ADMIN_DIR}-->order/product_select.php<!--{if $tpl_order_id}-->?order_id=<!--{$tpl_order_id}--><!--{/if}-->', 'search', '600', '500'); ">商品の追加</a>
@@ -259,5 +266,5 @@
             </td>
             <td align="center"><input type="text" name="price[<!--{$key}-->]" value="<!--{$arrForm.price.value[$key]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm.price.length}-->" id="price_<!--{$key}-->"/> 円</td>
-            <td align="center"><input type="text" name="quantity[<!--{$key}-->]" value="<!--{$arrForm.quantity.value[$key]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm.quantity.length}-->"/></td>
+            <td align="center"><input type="text" name="quantity[<!--{$key}-->]" value="<!--{$arrForm.quantity.value[$key]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm.quantity.length}-->" id="quantity_<!--{$key}-->" /></td>
             <!--{assign var=price value=`$arrForm.price.value[$key]`}-->
             <!--{assign var=quantity value=`$arrForm.quantity.value[$key]`}-->
@@ -342,8 +349,9 @@
 
     <!--▼お届け先情報ここから-->
+    <a name="shipping"></a>
     <h2>お届け先情報
         <a class="btn-normal" href="javascript:;" name="input_from_order_data" onclick="fnCopyFromOrderData();">お客様情報へお届けする</a>
         <a class="btn-normal" href="javascript:;" name="input_from_order_data" onclick="fnCopyFromOrderData();">お届け先を新規追加</a>
-        <a class="btn-normal" href="javascript:;" name="input_from_order_data" onclick="fnCopyFromOrderData();">複数のお届け先を指定する</a>
+        <a class="btn-normal" href="javascript:;" name="input_from_order_data" onclick="fnModeSubmit('multiple','anchor_key','shipping');">複数のお届け先を指定する</a>
     </h2>
 
@@ -356,5 +364,5 @@
     <!--{assign var=shipping_id value=$arrShippingIds[$shipping_index]}-->
     <!--{if $arrForm.shipping_quantity.value > 1}-->
-    <h3>お届け先<!--{$smarty.section.shipping.iteration}--></h3
+    <h3>お届け先<!--{$smarty.section.shipping.iteration}--></h3>
     <!--{/if}-->
 
@@ -362,4 +370,5 @@
     <!--{assign var=product_quantity value="shipping_product_quantity_`$shipping_id`"}-->
     <input type="hidden" name="<!--{$product_quantity}-->" value="<!--{$arrForm[$product_quantity].value|h}-->" />
+    <input type="hidden" name="shipping_id_<!--{$shipping_id}-->" value="<!--{$shipping_id}-->" id="shipping_id_<!--{$shipping_id}-->" />
     <table class="list" id="order-edit-products">
       <tr>
