Changeset 23126 for branches/version-2_13_0/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
- Timestamp:
- 2013/08/26 15:52:37 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13_0/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
r23053 r23126 33 33 class LC_Page_Admin_Order_Edit extends LC_Page_Admin_Order_Ex 34 34 { 35 var$arrShippingKeys = array(35 public $arrShippingKeys = array( 36 36 'shipping_id', 37 37 'shipping_name01', … … 59 59 ); 60 60 61 var$arrShipmentItemKeys = array(61 public $arrShipmentItemKeys = array( 62 62 'shipment_product_class_id', 63 63 'shipment_product_code', … … 69 69 ); 70 70 71 var$arrProductKeys = array(71 public $arrProductKeys = array( 72 72 'product_id', 73 73 'product_class_id', … … 89 89 * @return void 90 90 */ 91 function init()91 public function init() 92 92 { 93 93 parent::init(); … … 124 124 * @return void 125 125 */ 126 function process()126 public function process() 127 127 { 128 128 $this->action(); … … 135 135 * @return void 136 136 */ 137 function action()137 public function action() 138 138 { 139 139 $objPurchase = new SC_Helper_Purchase_Ex(); … … 258 258 $objFormParam); 259 259 // 加算ポイントの計算 260 if (USE_POINT === true && $this->tpl_mode == 'add') {260 if (USE_POINT === true && $this->tpl_mode == 'add') { 261 261 $birth_point = 0; 262 if ($customer_birth) {262 if ($customer_birth) { 263 263 $arrRet = preg_split('|[- :/]|', $customer_birth); 264 264 $birth_date = intval($arrRet[1]); … … 312 312 * パラメーター情報の初期化を行う. 313 313 * 314 * @param SC_FormParam $objFormParam SC_FormParam インスタンス315 * @return void 316 */ 317 function lfInitParam(&$objFormParam)314 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 315 * @return void 316 */ 317 public function lfInitParam(&$objFormParam) 318 318 { 319 319 // 検索条件のパラメーターを初期化 … … 439 439 * 複数配送用フォームの初期化を行う. 440 440 * 441 * @param SC_FormParam $objFormParam SC_FormParam インスタンス442 * @return void 443 */ 444 function lfInitMultipleParam(&$objFormParam)441 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 442 * @return void 443 */ 444 public function lfInitMultipleParam(&$objFormParam) 445 445 { 446 446 $objFormParam->addParam('商品規格ID', 'multiple_product_class_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); … … 457 457 * 複数配送入力フォームで入力された値を SC_FormParam へ設定する. 458 458 * 459 * @param SC_FormParam $objFormParam SC_FormParam インスタンス460 * @return void 461 */ 462 function setMultipleItemTo(&$objFormParam)459 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 460 * @return void 461 */ 462 public function setMultipleItemTo(&$objFormParam) 463 463 { 464 464 $arrMultipleKey = array('multiple_shipping_id', … … 534 534 * 受注データを取得して, SC_FormParam へ設定する. 535 535 * 536 * @param SC_FormParam $objFormParam SC_FormParam インスタンス537 * @param integer $order_id取得元の受注ID538 * @return void 539 */ 540 function setOrderToFormParam(&$objFormParam, $order_id)536 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 537 * @param integer $order_id 取得元の受注ID 538 * @return void 539 */ 540 public function setOrderToFormParam(&$objFormParam, $order_id) 541 541 { 542 542 $objPurchase = new SC_Helper_Purchase_Ex(); … … 604 604 * 入力内容のチェックを行う. 605 605 * 606 * @param SC_FormParam $objFormParam SC_FormParam インスタンス607 * @return array エラーメッセージの配列608 */ 609 function lfCheckError(&$objFormParam)606 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 607 * @return array エラーメッセージの配列 608 */ 609 public function lfCheckError(&$objFormParam) 610 610 { 611 611 $objProduct = new SC_Product_Ex(); … … 625 625 } 626 626 $arrErrTemp = array_merge($arrErrTemp, $arrErrDate); 627 628 627 629 628 // 商品の種類数 … … 695 694 * DB更新処理 696 695 * 697 * @param integer $order_id受注ID698 * @param SC_Helper_Purchase $objPurchaseSC_Helper_Purchase インスタンス699 * @param SC_FormParam $objFormParamSC_FormParam インスタンス700 * @param string $message通知メッセージ701 * @param array$arrValuesBefore 更新前の受注情報702 * @return integer $order_id 受注ID696 * @param integer $order_id 受注ID 697 * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス 698 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 699 * @param string $message 通知メッセージ 700 * @param array $arrValuesBefore 更新前の受注情報 701 * @return integer $order_id 受注ID 703 702 * 704 703 * エラー発生時は負数を返す。 705 704 */ 706 function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, &$arrValuesBefore)705 public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, &$arrValuesBefore) 707 706 { 708 707 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 799 798 foreach ($arrDetail as $product_detail) { 800 799 foreach ($arrAllShipmentItem[$shipping_index]['shipment_product_class_id'] as $relation_index => $shipment_product_class_id) { 801 if ($product_detail['product_class_id'] == $shipment_product_class_id){800 if ($product_detail['product_class_id'] == $shipment_product_class_id) { 802 801 $arrAllShipmentItem[$shipping_index]['shipment_price'][$relation_index] = $product_detail['price']; 803 802 } … … 837 836 * 小画面で選択した受注商品をフォームに反映させる. 838 837 * 839 * @param SC_FormParam $objFormParam SC_FormParam インスタンス840 * @return void 841 */ 842 function doRegisterProduct(&$objFormParam)838 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 839 * @return void 840 */ 841 public function doRegisterProduct(&$objFormParam) 843 842 { 844 843 $product_class_id = $objFormParam->getValue('add_product_class_id'); … … 847 846 $changed_no = $objFormParam->getValue('no'); 848 847 $this->shipmentEditProduct($objFormParam, $product_class_id, $changed_no); 849 } else{848 } else { 850 849 $this->shipmentAddProduct($objFormParam, $product_class_id); 851 850 } … … 855 854 * 受注商品を削除する. 856 855 * 857 * @param integer $delete_no削除する受注商品の項番858 * @param SC_FormParam $objFormParam SC_FormParam インスタンス859 * @return void 860 */ 861 function doDeleteProduct($delete_no, &$objFormParam)856 * @param integer $delete_no 削除する受注商品の項番 857 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 858 * @return void 859 */ 860 public function doDeleteProduct($delete_no, &$objFormParam) 862 861 { 863 862 $select_shipping_id = $objFormParam->getValue('select_shipping_id'); … … 875 874 foreach ($arrNewShipments['shipment_product_class_id'] as $shipping_id => $arrShipmentProductClassIds) { 876 875 foreach ($arrShipmentProductClassIds as $relation_index => $shipment_product_class_id) { 877 if (in_array($delete_product_class_id, $arrShipmentProductClassIds)){876 if (in_array($delete_product_class_id, $arrShipmentProductClassIds)) { 878 877 $is_product_delete = false; 879 878 break; … … 883 882 884 883 //商品情報から削除 885 if ($is_product_delete){884 if ($is_product_delete) { 886 885 $this->checkDeleteProducts($objFormParam, $arrPreProductClassIds, $delete_product_class_id, $this->arrProductKeys); 887 886 } … … 891 890 * お届け先を追加する. 892 891 * 893 * @param SC_FormParam $objFormParam SC_FormParam インスタンス894 * @return void 895 */ 896 function addShipping(&$objFormParam)892 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 893 * @return void 894 */ 895 public function addShipping(&$objFormParam) 897 896 { 898 897 $objFormParam->setValue('shipping_quantity', … … 906 905 * 会員情報をフォームに設定する. 907 906 * 908 * @param integer $customer_id会員ID909 * @param SC_FormParam $objFormParam SC_FormParam インスタンス910 * @return void 911 */ 912 function setCustomerTo($customer_id, &$objFormParam)907 * @param integer $customer_id 会員ID 908 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 909 * @return void 910 */ 911 public function setCustomerTo($customer_id, &$objFormParam) 913 912 { 914 913 $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); … … 925 924 * アンカーキーを取得する. 926 925 * 927 * @param SC_FormParam$objFormParam SC_FormParam インスタンス926 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 928 927 * @return アンカーキーの文字列 929 928 */ 930 function getAnchorKey(&$objFormParam)929 public function getAnchorKey(&$objFormParam) 931 930 { 932 931 $ancor_key = $objFormParam->getValue('anchor_key'); … … 941 940 * 商品を追加 942 941 * 943 * @param SC_FormParam $objFormParamSC_FormParam インスタンス944 * @param integer$add_product_class_id 追加商品規格ID945 * @return void 946 */ 947 function shipmentAddProduct(&$objFormParam, $add_product_class_id)942 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 943 * @param integer $add_product_class_id 追加商品規格ID 944 * @return void 945 */ 946 public function shipmentAddProduct(&$objFormParam, $add_product_class_id) 948 947 { 949 948 //複数配送に商品情報追加 … … 953 952 $arrShipmentProducts = $this->getShipmentProducts($objFormParam); 954 953 955 if( in_array($add_product_class_id, $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id])){954 if($arrShipmentProducts['shipment_product_class_id'] && in_array($add_product_class_id, $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id])){ 956 955 foreach ($arrShipmentProducts['shipment_product_class_id'][$select_shipping_id] as $relation_index => $shipment_product_class_id) { 957 if ($shipment_product_class_id == $add_product_class_id){956 if ($shipment_product_class_id == $add_product_class_id) { 958 957 $arrShipmentProducts['shipment_quantity'][$select_shipping_id][$relation_index]++; 959 958 break; 960 959 } 961 960 } 962 } else{961 } else { 963 962 //届け先に選択商品がない場合 964 963 $objProduct = new SC_Product_Ex(); … … 982 981 * 商品を変更 983 982 * 984 * @param SC_FormParam $objFormParamSC_FormParam インスタンス985 * @param integer$add_product_class_id 変更商品規格ID986 * @param integer $change_no変更対象987 * @return void 988 */ 989 function shipmentEditProduct(&$objFormParam, $edit_product_class_id, $change_no)983 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 984 * @param integer $add_product_class_id 変更商品規格ID 985 * @param integer $change_no 変更対象 986 * @return void 987 */ 988 public function shipmentEditProduct(&$objFormParam, $edit_product_class_id, $change_no) 990 989 { 991 990 $arrPreProductClassIds = $objFormParam->getValue('product_class_id'); … … 996 995 //既にあるデータは1つだけ数量を1増やす 997 996 $pre_shipment_product_class_id = $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id][$change_no]; 998 if ($pre_shipment_product_class_id == $edit_product_class_id) {997 if ($pre_shipment_product_class_id == $edit_product_class_id) { 999 998 $arrShipmentProducts['shipment_quantity'][$select_shipping_id][$change_no] ++; 1000 } elseif(in_array($edit_product_class_id, $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id])){999 } elseif (in_array($edit_product_class_id, $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id])) { 1001 1000 //配送先データ削除 1002 1001 $arrShipmentProducts = $this->deleteShipment($objFormParam, $this->arrShipmentItemKeys , $select_shipping_id, $change_no); 1003 1002 foreach ($arrShipmentProducts['shipment_product_class_id'][$select_shipping_id] as $relation_index => $shipment_product_class_id) { 1004 if ($shipment_product_class_id == $edit_product_class_id){1003 if ($shipment_product_class_id == $edit_product_class_id) { 1005 1004 $arrShipmentProducts['shipment_quantity'][$select_shipping_id][$relation_index] ++; 1006 1005 break; 1007 1006 } 1008 1007 } 1009 } else{1008 } else { 1010 1009 $objProduct = new SC_Product_Ex(); 1011 1010 $arrAddProductInfo = $objProduct->getDetailAndProductsClass($edit_product_class_id); … … 1024 1023 //変更前のproduct_class_idが他の届け先にも存在するか 1025 1024 foreach ($arrNewShipmentProducts['shipment_product_class_id'] as $shipping_id => $arrShipmentProductClassIds) { 1026 if (in_array($pre_shipment_product_class_id, $arrShipmentProductClassIds)){1025 if (in_array($pre_shipment_product_class_id, $arrShipmentProductClassIds)) { 1027 1026 $is_product_delete = false; 1028 1027 break; … … 1031 1030 1032 1031 //商品情報から削除 1033 if ($is_product_delete){1032 if ($is_product_delete) { 1034 1033 $this->checkDeleteProducts($objFormParam, $arrPreProductClassIds, $pre_shipment_product_class_id, $this->arrProductKeys); 1035 1034 } … … 1039 1038 * 複数配送のパラメータを取り出す 1040 1039 * 1041 * @param SC_FormParam $objFormParam SC_FormParam インスタンス1042 * @return array 配送データ1043 */ 1044 function getShipmentProducts(&$objFormParam)1040 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 1041 * @return array 配送データ 1042 */ 1043 public function getShipmentProducts(&$objFormParam) 1045 1044 { 1046 1045 $arrShipmentProducts['shipment_product_class_id'] = $objFormParam->getValue('shipment_product_class_id'); … … 1053 1052 1054 1053 foreach ($arrShipmentProducts as $key => $value) { 1055 if (!is_array($value)){1054 if (!is_array($value)) { 1056 1055 $arrShipmentProducts[$key] = array(); 1057 1056 } … … 1064 1063 * 変更対象のデータを上書きする 1065 1064 * 1066 * @param array $arrShipmentProducts変更対象配列1067 * @param array $arrProductInfo上書きデータ1068 * @param integer $shipping_id配送先ID1069 * @param array $no変更対象1070 * @return void 1071 */ 1072 function changeShipmentProducts(&$arrShipmentProducts, $arrProductInfo, $shipping_id, $no)1065 * @param array $arrShipmentProducts 変更対象配列 1066 * @param array $arrProductInfo 上書きデータ 1067 * @param integer $shipping_id 配送先ID 1068 * @param array $no 変更対象 1069 * @return void 1070 */ 1071 public function changeShipmentProducts(&$arrShipmentProducts, $arrProductInfo, $shipping_id, $no) 1073 1072 { 1074 1073 $arrShipmentProducts['shipment_product_class_id'][$shipping_id][$no] = $arrProductInfo['product_class_id']; … … 1084 1083 * 商品側の総量計算&セット 1085 1084 * 1086 * @param SC_FormParam $objFormParam SC_FormParam インスタンス1087 * @return void 1088 */ 1089 function setProductsQuantity(&$objFormParam)1085 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 1086 * @return void 1087 */ 1088 public function setProductsQuantity(&$objFormParam) 1090 1089 { 1091 1090 $arrShipmentsItems = $objFormParam->getSwapArray(array('shipment_product_class_id','shipment_quantity')); … … 1107 1106 * 削除対象の確認、削除をする 1108 1107 * 1109 * @param SC_FormParam $objFormParamSC_FormParam インスタンス1110 * @param array $arrProductClassIds削除対象配列の商品規格ID1111 * @param integer $delete_product_class_id 削除商品規格ID1112 * @param array $arrDeleteKeys削除項目1113 * @return void 1114 */ 1115 function checkDeleteProducts(&$objFormParam, $arrProductClassIds, $delete_product_class_id, $arrDeleteKeys)1108 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 1109 * @param array $arrProductClassIds 削除対象配列の商品規格ID 1110 * @param integer $delete_product_class_id 削除商品規? ?ID 1111 * @param array $arrDeleteKeys 削除項目 1112 * @return void 1113 */ 1114 public function checkDeleteProducts(&$objFormParam, $arrProductClassIds, $delete_product_class_id, $arrDeleteKeys) 1116 1115 { 1117 1116 foreach ($arrProductClassIds as $relation_index => $product_class_id) { 1118 1117 //product_class_idの重複はないので、1つ削除したら完了 1119 if ($product_class_id == $delete_product_class_id){1118 if ($product_class_id == $delete_product_class_id) { 1120 1119 foreach ($arrDeleteKeys as $delete_key) { 1121 1120 $arrProducts = $objFormParam->getValue($delete_key); 1122 1121 foreach ($arrProducts as $index => $product_info) { 1123 if ($index != $relation_index){1122 if ($index != $relation_index) { 1124 1123 $arrUpdateParams[$delete_key][] = $product_info; 1125 1124 } … … 1135 1134 * 配送先商品の削除の削除 1136 1135 * 1137 * @param SC_FormParam $objFormParamSC_FormParam インスタンス1138 * @param array $arrShipmentDeleteKeys削除項目1139 * @param integer $delete_shipping_id削除配送ID1140 * @param array $delete_no削除対象1141 * @return void 1142 */ 1143 function deleteShipment(&$objFormParam, $arrShipmentDeletKeys, $delete_shipping_id, $delete_no)1136 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 1137 * @param array $arrShipmentDeleteKeys 削除項目 1138 * @param integer $delete_shipping_id 削除配送ID 1139 * @param array $delete_no 削除対象 1140 * @return void 1141 */ 1142 public function deleteShipment(&$objFormParam, $arrShipmentDeletKeys, $delete_shipping_id, $delete_no) 1144 1143 { 1145 1144 foreach ($arrShipmentDeletKeys as $delete_key) { 1146 1145 $arrShipments = $objFormParam->getValue($delete_key); 1147 foreach ($arrShipments as $shipp_id => $arrKeyData) {1146 foreach ($arrShipments as $shipp_id => $arrKeyData) { 1148 1147 foreach ($arrKeyData as $relation_index => $shipment_info) { 1149 if ($relation_index != $delete_no || $shipp_id != $delete_shipping_id){1148 if ($relation_index != $delete_no || $shipp_id != $delete_shipping_id) { 1150 1149 $arrUpdateParams[$delete_key][$shipp_id][] = $shipment_info; 1151 1150 } … … 1160 1159 * 受注商品一覧側に商品を追加 1161 1160 * 1162 * @param SC_FormParam $objFormParamSC_FormParam インスタンス1163 * @param array $arrProductClassIds対象配列の商品規格ID1164 * @param integer $indert_product_class_id 追加商品規格ID1165 * @param array $arrAddProductInfo追加データ1166 * @return array $arrAddProducts 更新データ1167 */ 1168 function checkInsertOrderProducts(&$objFormParam, $arrProductClassIds, $insert_product_class_id, $arrAddProductInfo)1169 { 1170 if( is_array($arrProductClassIds) &&!in_array($insert_product_class_id, $arrProductClassIds)){1161 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 1162 * @param array $arrProductClassIds 対象配列の商品規格ID 1163 * @param integer $indert_product_class_id 追?? 商品規格ID 1164 * @param array $arrAddProductInfo 追加データ 1165 * @return array $arrAddProducts 更新データ 1166 */ 1167 public function checkInsertOrderProducts(&$objFormParam, $arrProductClassIds, $insert_product_class_id, $arrAddProductInfo) 1168 { 1169 if(!$arrProductClassIds || !in_array($insert_product_class_id, $arrProductClassIds)){ 1171 1170 $arrAddProducts = array(); 1172 1171 … … 1185 1184 $arrAddProducts[$insert_key][] = $arrAddProductInfo[$insert_key]; 1186 1185 } 1186 1187 1187 return $arrAddProducts; 1188 } else{1188 } else { 1189 1189 //受注商品の数量は、複数配送側の集計で出しているので、重複しても数量を増やさない。 1190 1190 return null;
Note: See TracChangeset
for help on using the changeset viewer.