Changeset 19963 for branches/version-2_5-dev/data
- Timestamp:
- 2011/01/19 04:13:21 (13 years ago)
- bzr:base-revision:
- svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:19962
- bzr:committer:
- Kentaro Ohkouchi <ohkouchi@loop-az.jp>
- bzr:file-ids:
data/Smarty/templates/admin/customer/search_customer.tpl 18068@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Fcustomer%2Fsearch_customer.tpl
data/Smarty/templates/admin/order/edit.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Forder%2Fedit.tpl
data/Smarty/templates/admin/order/multiple.tpl multiple.tpl-20110116173102-7dtlp9lt15miha2l-1
data/class/helper/SC_Helper_DB.php 15176@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_DB.php
data/class/helper/SC_Helper_Purchase.php sc_helper_purchase.p-20101020100530-jyaoa7ch9pdfjqzp-1
data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php 15594@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Forder%2FLC_Page_Admin_Order_Edit.php- bzr:mapping-version:
- v4
- bzr:merge:
ohkouchi@loop-az.jp-20110118191202-tmjlvrfe8ftnjeak- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- ohkouchi@loop-az.jp-20110118191310-c3ybk9px2xg63hkd
- bzr:revno:
- 2692
- bzr:revprop:branch-nick:
- branches/version-2_5-dev
- bzr:root:
- branches/version-2_5-dev
- bzr:text-revisions:
data/Smarty/templates/admin/customer/search_customer.tpl ohkouchi@loop-az.jp-20110118191202-tmjlvrfe8ftnjeak
data/Smarty/templates/admin/order/edit.tpl ohkouchi@loop-az.jp-20110118191202-tmjlvrfe8ftnjeak
data/Smarty/templates/admin/order/multiple.tpl ohkouchi@loop-az.jp-20110118191202-tmjlvrfe8ftnjeak
data/class/helper/SC_Helper_DB.php ohkouchi@loop-az.jp-20110118191202-tmjlvrfe8ftnjeak
data/class/helper/SC_Helper_Purchase.php ohkouchi@loop-az.jp-20110118191202-tmjlvrfe8ftnjeak
data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php ohkouchi@loop-az.jp-20110118191202-tmjlvrfe8ftnjeak- bzr:timestamp:
- 2011-01-19 04:13:10.059999943 +0900
- bzr:user-agent:
- bzr2.2.1+bzr-svn1.0.4
- svn:original-date:
- 2011-01-18T19:13:10.060000Z
- Location:
- branches/version-2_5-dev/data
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/Smarty/templates/admin/customer/search_customer.tpl
r19954 r19963 79 79 <!--{if $smarty.post.mode == 'search' }--> 80 80 <!--▼検索結果表示--> 81 <table width="420" border="0" cellspacing="0" cellpadding="0" summary=" " bgcolor="#FFFFFF">82 81 <!--{if $tpl_linemax > 0}--> 83 <tr class="fs12"> 84 <td align="left"><!--{$tpl_linemax}-->件が該当しました。 </td> 85 </tr> 82 <p><!--{$tpl_linemax}-->件が該当しました。<!--{$tpl_strnavi}--></p> 86 83 <!--{/if}--> 87 <tr class="fs12">88 <td align="center">89 <!--▼ページナビ-->90 <!--{$tpl_strnavi}-->91 <!--▲ページナビ-->92 </td>93 </tr>94 <tr><td height="10"></td></tr>95 </table>96 84 97 85 <!--▼検索後表示部分--> 98 <table width="420" border="0" cellspacing="1" cellpadding="5" bgcolor="#cccccc">99 <tr bgcolor="#f0f0f0" align="center" class="fs12">100 <t d>顧客ID</td>101 <t d>顧客名(カナ)</td>102 <t d>TEL</td>103 <t d>決定</td>86 <table class="list"> 87 <tr> 88 <th>顧客ID</th> 89 <th>顧客名(カナ)</th> 90 <th>TEL</th> 91 <th>決定</th> 104 92 </tr> 105 93 <!--{section name=cnt loop=$arrCustomer}--> 106 94 <!--▼顧客<!--{$smarty.section.cnt.iteration}-->--> 107 <tr bgcolor="#FFFFFF" class="fs12n">108 <td width="90" align="center">95 <tr> 96 <td> 109 97 <!--{$arrCustomer[cnt].customer_id|h}--> 110 98 </td> … … 115 103 <!--▲商品<!--{$smarty.section.cnt.iteration}-->--> 116 104 <!--{sectionelse}--> 117 <tr bgcolor="#FFFFFF" class="fs10n">105 <tr> 118 106 <td colspan="4">会員情報が存在しません。</td> 119 107 </tr> -
branches/version-2_5-dev/data/Smarty/templates/admin/order/edit.tpl
r19954 r19963 35 35 df = document.form1; 36 36 37 df. deliv_name01.value = df.order_name01.value;38 df. deliv_name02.value = df.order_name02.value;39 df. deliv_kana01.value = df.order_kana01.value;40 df. deliv_kana02.value = df.order_kana02.value;41 df. deliv_zip01.value = df.order_zip01.value;42 df. deliv_zip02.value = df.order_zip02.value;43 df. deliv_tel01.value = df.order_tel01.value;44 df. deliv_tel02.value = df.order_tel02.value;45 df. deliv_tel03.value = df.order_tel03.value;46 df. deliv_pref.value = df.order_pref.value;47 df. deliv_addr01.value = df.order_addr01.value;48 df. deliv_addr02.value = df.order_addr02.value;37 df.shipping_name01_0.value = df.order_name01.value; 38 df.shipping_name02_0.value = df.order_name02.value; 39 df.shipping_kana01_0.value = df.order_kana01.value; 40 df.shipping_kana02_0.value = df.order_kana02.value; 41 df.shipping_zip01_0.value = df.order_zip01.value; 42 df.shipping_zip02_0.value = df.order_zip02.value; 43 df.shipping_tel01_0.value = df.order_tel01.value; 44 df.shipping_tel02_0.value = df.order_tel02.value; 45 df.shipping_tel03_0.value = df.order_tel03.value; 46 df.shipping_pref_0.value = df.order_pref.value; 47 df.shipping_addr01_0.value = df.order_addr01.value; 48 df.shipping_addr02_0.value = df.order_addr02.value; 49 49 } 50 50 … … 62 62 return false; 63 63 } 64 65 function fnAppendShipping() { 66 document.form1.anchor_key.value = "shipping"; 67 document.form1.mode.value = "append_shipping"; 68 document.form1.submit(); 69 return false; 70 } 71 64 72 //--> 65 73 </script> … … 348 356 <!--{/if}--> 349 357 </table> 350 358 <!--{assign var=key value="shipping_quantity"}--> 359 <input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" /> 351 360 <!--▼お届け先情報ここから--> 352 361 <a name="shipping"></a> 353 362 <h2>お届け先情報 363 <!--{if $arrForm.shipping_quantity.value <= 1}--> 354 364 <a class="btn-normal" href="javascript:;" onclick="fnCopyFromOrderData();">お客様情報へお届けする</a> 355 <a class="btn-normal" href="javascript:;" onclick="fnCopyFromOrderData();">お届け先を新規追加</a> 365 <!--{/if}--> 366 <a class="btn-normal" href="javascript:;" onclick="fnAppendShipping();">お届け先を新規追加</a> 356 367 <a class="btn-normal" href="javascript:;" onclick="fnMultiple();">複数のお届け先を指定する</a> 357 368 </h2> 358 359 <!--{assign var=key value="shipping_quantity"}-->360 <input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" />361 369 362 370 <!--{section name=shipping loop=$arrForm.shipping_quantity.value}--> … … 367 375 <h3>お届け先<!--{$smarty.section.shipping.iteration}--></h3> 368 376 <!--{/if}--> 369 377 <input type="hidden" name="shipping_id_<!--{$shipping_id}-->" value="<!--{$shipping_id}-->" id="shipping_id_<!--{$shipping_id}-->" /> 370 378 <!--{if $arrForm.shipping_quantity.value > 1}--> 371 379 <!--{assign var=product_quantity value="shipping_product_quantity_`$shipping_id`"}--> 372 380 <input type="hidden" name="<!--{$product_quantity}-->" value="<!--{$arrForm[$product_quantity].value|h}-->" /> 373 <input type="hidden" name="shipping_id_<!--{$shipping_id}-->" value="<!--{$shipping_id}-->" id="shipping_id_<!--{$shipping_id}-->" /> 381 382 <!--{if $arrForm[$product_quantity].value > 0}--> 374 383 <table class="list" id="order-edit-products"> 375 384 <tr> … … 382 391 <!--{assign var=item_index value="`$smarty.section.item.index`"}--> 383 392 <!--{assign var=product_class_id value=$arrProductClassIds[$shipping_index][$item_index]}--> 393 384 394 <tr> 385 395 <td> 396 <!--{assign var=key value="product_class_id_`$shipping_id`_`$product_class_id`"}--> 397 <input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" /> 386 398 <!--{assign var=key value="product_code_`$shipping_id`_`$product_class_id`"}--> 387 399 <input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" /> … … 411 423 </table> 412 424 <!--{/if}--> 425 <!--{/if}--> 413 426 414 427 <table class="form"> -
branches/version-2_5-dev/data/Smarty/templates/admin/order/multiple.tpl
r19954 r19963 88 88 var q = $('<td />').addClass('center') 89 89 .append(idfield) 90 .append(codefield) 90 91 .append(namefield) 91 92 .append(class1field) … … 132 133 $('input[name^=multiple_], select[name^=multiple_]').each(function() { 133 134 // TODO タグをベタ書きにしないと, innerHTML で value が空になってしまう 134 $(div).append('<input type=" hidden" name="'135 $(div).append('<input type="text" name="' 135 136 + $(this).attr('name') 136 137 + '" value="' + $(this).val() + '" />'); -
branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
r19928 r19963 1768 1768 /** 1769 1769 * 受注の名称列を更新する 1770 * 1771 * FIXME 1770 1772 * 1771 1773 * @param integer $order_id 更新対象の注文番号 -
branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php
r19949 r19963 475 475 __EOS__; 476 476 $objQuery->setOrder("time_id"); 477 $where = "deliv_id = ?";478 477 $results = $objQuery->select("time_id, deliv_time", $from, 479 478 "product_type_id = ?", array($productTypeId)); -
branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
r19949 r19963 108 108 // 表示モード判定 109 109 if(isset($_GET['order_id']) && 110 110 SC_Utils_Ex::sfIsInt($_GET['order_id'])) { 111 111 $this->disp_mode = true; 112 112 $order_id = $_GET['order_id']; … … 117 117 118 118 // DBから受注情報を読み込む 119 $this->lfGetOrderData($order_id); 119 if (!SC_Utils_Ex::isBlank($order_id)) { 120 $this->lfGetOrderData($order_id); 121 } 120 122 121 123 switch($_POST['mode']) { … … 134 136 if(count($this->arrErr) == 0) { 135 137 if ($_POST['mode'] == 'add') { 136 $order_id = $this->lfRegistNewData( );138 $order_id = $this->lfRegistNewData($objPurchase); 137 139 138 140 $this->tpl_order_id = $order_id; … … 144 146 $text = "'新規受注を登録しました。'"; 145 147 } else { 146 $this->lfRegistData($_POST['order_id'] );148 $this->lfRegistData($_POST['order_id'], $objPurchase); 147 149 $text = "'受注履歴を編集しました。'"; 148 150 } 149 151 // DBから受注情報を再読込 150 152 $this->lfGetOrderData($order_id); 153 $this->lfInitShippingParam($this->arrShipping); 154 $this->objFormParam->setParam($_POST); 151 155 $this->tpl_onload = "window.alert(".$text.");"; 152 156 } 153 157 break; 154 158 // 再計算 155 159 case 'cheek': 156 160 //支払い方法の選択 157 161 case 'payment': 158 162 // POST情報で上書き 163 $this->lfInitShippingParam($this->arrShipping); 159 164 $this->objFormParam->setParam($_POST); 160 165 // 入力値の変換 … … 178 183 } 179 184 // 情報上書き 185 $this->lfInitShippingParam($this->arrShipping); 180 186 $this->objFormParam->setParam($arrData); 181 187 // 入力値の変換 … … 200 206 } 201 207 } 208 202 209 // 情報上書き 210 $this->lfInitShippingParam($this->arrShipping); 203 211 $this->objFormParam->setParam($arrData); 204 212 // 入力値の変換 … … 209 217 case 'search_customer': 210 218 // POST情報で上書き 219 $this->lfInitShippingParam($this->arrShipping); 211 220 $this->objFormParam->setParam($_POST); 212 221 … … 218 227 // 複数配送設定表示 219 228 case 'multiple': 229 $this->lfInitShippingParam($this->arrShipping); 220 230 $this->objFormParam->setParam($_POST); 231 // 入力値の変換 232 $this->objFormParam->convParam(); 233 $this->arrErr = $this->lfCheckError(); 221 234 break; 222 235 … … 226 239 $this->lfInitMultipleParam($multipleSize); 227 240 $this->objFormParam->setParam($_POST); 241 $this->lfInitShippingParam($this->arrShipping); 228 242 $this->setMultipleItemTo($multipleSize); 229 243 break; 244 245 // お届け先の追加 246 case 'append_shipping': 247 $this->lfInitShippingParam($this->arrShipping, true); 248 $this->objFormParam->setParam($_POST); 249 // 入力値の変換 250 $this->objFormParam->convParam(); 251 break; 252 230 253 default: 254 // お届け先の初期表示 255 $this->lfInitShippingParam(); 231 256 break; 232 257 } … … 236 261 237 262 $this->arrForm = $this->objFormParam->getFormParamList(); 263 238 264 // XXX 商品種別IDは0番目の配列を使用 239 265 $this->product_type_id = $this->arrForm['product_type_id']['value'][0]; … … 251 277 $objSiteInfo = new SC_SiteInfo(); 252 278 $this->arrInfo = $objSiteInfo->data; 253 254 279 // 表示モード判定 255 280 if(!$this->disp_mode) { … … 300 325 $this->objFormParam->addParam("対応状況", "status", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 301 326 $this->objFormParam->addParam("お支払方法名称", "payment_method"); 302 303 327 304 328 // 受注詳細情報 … … 334 358 * お届け先用フォームの初期化 335 359 */ 336 function lfInitShippingParam(&$arrShipping) { 337 $this->objFormParam->addParam("配送数", "shipping_quantity", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK")); 360 function lfInitShippingParam($arrShipping = array(), $add = false) { 361 if (empty($arrShipping) && !$add) { 362 $arrShipping[0]['shipping_id'] = 0; 363 $this->arrShippingIds[0] = 0; 364 $_POST['shipping_quantity'] = 1; 365 } 366 367 if ($add) { 368 $_POST['shipping_quantity'] = $_POST['shipping_quantity'] + 1; 369 } 370 for ($i = 0; $i < $_POST['shipping_quantity']; $i++) { 371 $arrShipping[$i]['shipping_id'] = $i; 372 $this->arrShippingIds[$i] = $i; 373 } 374 375 $this->objFormParam->addParam("配送数", "shipping_quantity", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), 1); 376 $this->objFormParam->setValue('shipping_quantity', $_POST['shipping_quantity']); 377 338 378 foreach ($arrShipping as $shipping) { 339 $this->objFormParam->addParam("配送ID", "shipping_id_" . $shipping['shipping_id'], INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK") );340 $this->objFormParam->addParam("お名前1", "shipping_name01_" . $shipping['shipping_id'], STEXT_LEN, "KVa", array(" SPTAB_CHECK", "MAX_LENGTH_CHECK"));341 $this->objFormParam->addParam("お名前2", "shipping_name02_" . $shipping['shipping_id'], STEXT_LEN, "KVa", array(" SPTAB_CHECK", "MAX_LENGTH_CHECK"));342 $this->objFormParam->addParam("お名前(フリガナ・姓)", "shipping_kana01_" . $shipping['shipping_id'], STEXT_LEN, "KVCa", array(" SPTAB_CHECK", "MAX_LENGTH_CHECK"));343 $this->objFormParam->addParam("お名前(フリガナ・名)", "shipping_kana02_" . $shipping['shipping_id'], STEXT_LEN, "KVCa", array(" SPTAB_CHECK", "MAX_LENGTH_CHECK"));379 $this->objFormParam->addParam("配送ID", "shipping_id_" . $shipping['shipping_id'], INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), 0); 380 $this->objFormParam->addParam("お名前1", "shipping_name01_" . $shipping['shipping_id'], STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK")); 381 $this->objFormParam->addParam("お名前2", "shipping_name02_" . $shipping['shipping_id'], STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK")); 382 $this->objFormParam->addParam("お名前(フリガナ・姓)", "shipping_kana01_" . $shipping['shipping_id'], STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK")); 383 $this->objFormParam->addParam("お名前(フリガナ・名)", "shipping_kana02_" . $shipping['shipping_id'], STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK")); 344 384 $this->objFormParam->addParam("郵便番号1", "shipping_zip01_" . $shipping['shipping_id'], ZIP01_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK")); 345 385 $this->objFormParam->addParam("郵便番号2", "shipping_zip02_" . $shipping['shipping_id'], ZIP02_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK")); … … 357 397 $this->objFormParam->addParam("お届け日", "shipping_date_" . $shipping['shipping_id'], STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK")); 358 398 $this->objFormParam->addParam("配送商品規格数", "shipping_product_quantity_" . $shipping['shipping_id'], INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK")); 359 foreach ( $shipping['shipment_item'] as $productClassId => $item) {399 foreach (array_keys($shipping['shipment_item']) as $productClassId) { 360 400 $this->objFormParam->addParam("商品規格ID", "product_class_id_" . $shipping['shipping_id'] . '_' . $productClassId, INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK")); 361 $this->objFormParam->addParam("商品コード", "product_code_" . $shipping['shipping_id'] . '_' . $productClassId );401 $this->objFormParam->addParam("商品コード", "product_code_" . $shipping['shipping_id'] . '_' . $productClassId, $item['product_code']); 362 402 $this->objFormParam->addParam("商品名", "product_name_" . $shipping['shipping_id'] . '_' . $productClassId); 363 403 $this->objFormParam->addParam("規格名1", "classcategory_name1_" . $shipping['shipping_id'] . '_' . $productClassId); … … 399 439 $quantity = $this->objFormParam->getValue('multiple_quantity' . $i); 400 440 401 $arrShipmentItem[$shippingId][$productClassId]['shipping_id'] = $shippingId; 402 $arrShipmentItem[$shippingId][$productClassId]['product_class_id'] = $productClassId; 403 $arrShipmentItem[$shippingId][$productClassId]['classcategory_name1'] = $class1; 404 $arrShipmentItem[$shippingId][$productClassId]['classcategory_name2'] = $class2; 405 $arrShipmentItem[$shippingId][$productClassId]['price'] = $price; 406 $arrShipmentItem[$shippingId][$productClassId]['quantity'] += $quantity; 441 $this->arrShipping[$shippingId]['shipment_item'][$productClassId]['shipping_id'] = $shippingId; 442 $this->arrShipping[$shippingId]['shipment_item'][$productClassId]['product_class_id'] = $productClassId; 443 $this->arrShipping[$shippingId]['shipment_item'][$productClassId]['product_name'] = $name; 444 $this->arrShipping[$shippingId]['shipment_item'][$productClassId]['product_code'] = $code; 445 $this->arrShipping[$shippingId]['shipment_item'][$productClassId]['classcategory_name1'] = $class1; 446 $this->arrShipping[$shippingId]['shipment_item'][$productClassId]['classcategory_name2'] = $class2; 447 $this->arrShipping[$shippingId]['shipment_item'][$productClassId]['price'] = $price; 448 $this->arrShipping[$shippingId]['shipment_item'][$productClassId]['quantity'] += $quantity; 407 449 } 408 450 … … 410 452 $this->arrShippingIds = array(); 411 453 $this->arrProductClassIds = array(); 412 foreach ($ arrShipmentItemas $shippingId => $items) {413 414 $this->objFormParam->setValue('shipping_product_quantity' . '_' . $shippingId, count($items ));454 foreach ($this->arrShipping as $shippingId => $items) { 455 456 $this->objFormParam->setValue('shipping_product_quantity' . '_' . $shippingId, count($items['shipment_item'])); 415 457 416 458 $this->arrShippingIds[] = $shippingId; 417 $this->arrProductClassIds[] = array_keys($items );418 419 foreach ($items as $productClassId => $item) {459 $this->arrProductClassIds[] = array_keys($items['shipment_item']); 460 461 foreach ($items['shipment_item'] as $productClassId => $item) { 420 462 $arrQuantity[$productClassId] += $item['quantity']; 421 463 foreach ($item as $itemKey => $itemVal) { 464 $arrParam[$itemKey . '_' . $shippingId . '_' . $productClassId] = $itemVal; 422 465 $this->objFormParam->setValue($itemKey . '_' . $shippingId . '_' . $productClassId, $itemVal); 466 $this->arrForm[$itemKey . '_' . $shippingId . '_' . $productClassId]['value'] = $itemVal; 423 467 } 424 468 } … … 435 479 } 436 480 481 // $this->arrShipping の内容で, 再度パラメータを初期化する 482 $this->lfInitShippingParam($this->arrShipping); 483 $this->objFormParam->setParam($arrParam); 437 484 $this->objFormParam->setParam($dest); 438 485 } … … 487 534 foreach ($item as $itemKey => $itemVal) { 488 535 $this->objFormParam->setValue($itemKey . '_' . $shipping['shipping_id'] . '_' . $productClassId, $itemVal); 536 $this->arrForm[$itemKey . '_' . $shipping['shipping_id'] . '_' . $productClassId]['value'] = $itemVal; 489 537 } 490 538 } … … 503 551 // 受注データを表示用配列に代入(各EC-CUBEバージョンと決済モジュールとのデータ連携保全のため) 504 552 $this->arrDisp = $this->arrForm; 553 } else { 554 $this->lfInitShippingParam($this->arrShipping); 555 $this->objFormParam->setParam($_POST); 505 556 } 506 557 } … … 515 566 dtb_order_detail T1 516 567 JOIN dtb_products_class T2 517 ON T1.product_class_id = T2.product_class_id568 ON T1.product_class_id = T2.product_class_id 518 569 __EOS__; 519 570 $arrRet = $objQuery->select($col, $from, … … 534 585 $objQuery->setOrder('shipping_id'); 535 586 $arrItems = $objQuery->select("*", "dtb_shipment_item", "order_id = ? AND shipping_id = ?", 536 array($orderId, $arrRet[$key]['shipping_id']));587 array($orderId, $arrRet[$key]['shipping_id'])); 537 588 foreach ($arrItems as $itemKey => $arrDetail) { 538 589 foreach ($arrDetail as $detailKey => $detailVal) { … … 605 656 if ($_POST['mode'] == "add") { 606 657 if ($arrVal['total_point'] < 0) { 607 658 $arrErr['use_point'] = '最終保持ポイントがマイナス表示にならないように調整して下さい。<br />'; 608 659 } 609 660 } … … 621 672 * @return void 622 673 */ 623 function lfRegistData($order_id ) {674 function lfRegistData($order_id, &$objPurchase) { 624 675 $objQuery = new SC_Query(); 625 676 … … 713 764 $objQuery->delete('dtb_shipment_item', "order_id = ?", array($order_id)); 714 765 715 $arrParams = $this->objFormParam->getHashArray(); 766 // $arrParams = $this->objFormParam->getHashArray(); 767 $arrParams = $_POST; 716 768 // 配送ID の配列を取得 717 769 $shippingIds = array(); … … 723 775 724 776 $cols = $objQuery->listTableFields('dtb_shipping'); 777 725 778 foreach ($shippingIds as $shipping_id) { 726 779 … … 735 788 } 736 789 } 790 791 if (SC_Utils::isBlank($dest['deliv_id'])) { 792 // XXX 商品種別IDは0番目の配列を使用 793 $product_type_id = $this->objFormParam->getValue('product_type_id'); 794 $dest['deliv_id'] = $objPurchase->getDeliv($product_type_id[0]); 795 } 796 737 797 $dest['shipping_id'] = $shipping_id; 738 798 $dest['order_id'] = $order_id; … … 770 830 * @return integer 注文番号 771 831 */ 772 function lfRegistNewData( ) {832 function lfRegistNewData(&$objPurchase) { 773 833 $objQuery = new SC_Query(); 774 834 … … 793 853 $order_id = $objQuery->nextVal('dtb_order_order_id'); 794 854 $sqlval['order_id'] = $order_id; 795 $objQuery->insert("dtb_order", $sqlval); 796 855 $this->registerOrder($sqlval, $order_id); 797 856 798 857 // 受注.対応状況の更新 … … 800 859 801 860 // 受注テーブルの名称列を更新 802 SC_Helper_DB_Ex::sfUpdateOrderNameCol($order_id);861 //SC_Helper_DB_Ex::sfUpdateOrderNameCol($order_id); 803 862 804 863 // 受注詳細データの更新 … … 831 890 if ($stock_sqlval['stock'] === 0) { 832 891 $stock_sqlval['stock'] = '0'; 833 }892 } 834 893 835 894 $st_params = array(); … … 838 897 $objQuery->update("dtb_products_class", $stock_sqlval, 'product_class_id = ?', $st_params); 839 898 } 899 900 $arrParams = $this->objFormParam->getHashArray(); 901 // 配送ID の配列を取得 902 $shippingIds = array(); 903 foreach (array_keys($arrParams) as $key) { 904 if (preg_match('/^shipping_id_/', $key)) { 905 $shippingIds[] = $arrParams[$key]; 906 } 907 } 908 909 $cols = $objQuery->listTableFields('dtb_shipping'); 910 foreach ($shippingIds as $shipping_id) { 911 912 $arrParams['shipping_date_' . $shipping_id] = SC_Utils_Ex::sfGetTimestamp($arrParams['shipping_date_year_' . $shipping_id], 913 $arrParams['shipping_date_month_' . $shipping_id], 914 $arrParams['shipping_date_day_' . $shipping_id]); 915 $dest = array(); 916 foreach ($arrParams as $key => $val) { 917 $key = preg_replace('/_' . $shipping_id . '$/', '', $key); 918 if (in_array($key, $cols)) { 919 $dest[$key] = $val; 920 } 921 } 922 if (SC_Utils::isBlank($dest['deliv_id'])) { 923 // XXX 商品種別IDは0番目の配列を使用 924 $product_type_id = $this->objFormParam->getValue('product_type_id'); 925 $dest['deliv_id'] = $objPurchase->getDeliv($product_type_id[0]); 926 } 927 928 $dest['shipping_id'] = $shipping_id; 929 $dest['order_id'] = $order_id; 930 $dest['create_date'] = 'Now()'; 931 $dest['update_date'] = 'Now()'; 932 $objQuery->insert('dtb_shipping', $dest); 933 934 // 商品規格ID の配列を取得 935 $productClassIds = array(); 936 foreach (array_keys($arrParams) as $key) { 937 if (preg_match('/^product_class_id_' . $shipping_id . '_/', $key)) { 938 $productClassIds[] = $arrParams[$key]; 939 } 940 } 941 942 foreach ($productClassIds as $product_class_id) { 943 $item['shipping_id'] = $shipping_id; 944 $item['order_id'] = $order_id; 945 $item['product_class_id'] = $product_class_id; 946 $item['product_name'] = $arrParams['product_name_' . $shipping_id . '_' . $product_class_id]; 947 $item['product_code'] = $arrParams['product_code_' . $shipping_id . '_' . $product_class_id]; 948 $item['classcategory_name1'] = $arrParams['classcategory_name1_' . $shipping_id . '_' . $product_class_id]; 949 $item['classcategory_name2'] = $arrParams['classcategory_name2_' . $shipping_id . '_' . $product_class_id]; 950 $item['price'] = $arrParams['price_' . $shipping_id . '_' . $product_class_id]; 951 $item['quantity'] = $arrParams['quantity_' . $shipping_id . '_' . $product_class_id]; 952 $objQuery->insert("dtb_shipment_item", $item); 953 } 954 } 955 840 956 $objQuery->commit(); 841 957 … … 861 977 $objQuery->update($table, $dest, "order_id = ?", array($order_id)); 862 978 } else { 863 // TODO864 979 $dest['order_id'] = $order_id; 865 980 $result = $objQuery->insert($table, $dest); … … 885 1000 886 1001 if ($existes) { 887 // 既に同じ商品がある場合1002 // 既に同じ商品がある場合 888 1003 ++$this->arrForm['quantity']['value'][$existes_key]; 889 1004 } else { 890 // 既に同じ商品がない場合1005 // 既に同じ商品がない場合 891 1006 $this->lfSetProductData($arrProduct); 892 1007 } … … 918 1033 $arrProduct['product_id'] = $productsClass['product_id']; 919 1034 $arrProduct['product_class_id'] = $productsClass['product_class_id']; 1035 $arrProduct['product_type_id'] = $productsClass['product_type_id']; 920 1036 $arrProduct['point_rate'] = $productsClass['point_rate']; 921 1037 $arrProduct['product_code'] = $productsClass['product_code']; … … 923 1039 $arrProduct['classcategory_name1'] = $productsClass['classcategory_name1']; 924 1040 $arrProduct['classcategory_name2'] = $productsClass['classcategory_name2']; 925 926 1041 return $arrProduct; 927 1042 } … … 992 1107 993 1108 return $sqlval; 994 }1109 } 995 1110 } 996 1111 ?>
Note: See TracChangeset
for help on using the changeset viewer.