Changeset 23408
- Timestamp:
- 2014/05/12 13:36:22 (12 years ago)
- Location:
- branches/version-2_13_2
- Files:
-
- 7 edited
-
data/class/helper/SC_Helper_Address.php (modified) (7 diffs)
-
data/class/pages/mypage/LC_Page_Mypage_Delivery.php (modified) (1 diff)
-
data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php (modified) (2 diffs)
-
data/class/pages/shopping/LC_Page_Shopping_Deliv.php (modified) (2 diffs)
-
data/class/pages/shopping/LC_Page_Shopping_Multiple.php (modified) (1 diff)
-
tests/class/helper/SC_Helper_Address/SC_Helper_Address_deleteAddressTest.php (modified) (2 diffs)
-
tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13_2/data/class/helper/SC_Helper_Address.php
r23279 r23408 40 40 { 41 41 if (self::delivErrorCheck($sqlval)) { 42 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 43 SC_Response_Ex::actionExit(); 42 return false; 44 43 } 45 44 … … 56 55 $deliv_count = $objQuery->count($from, $where, $arrVal); 57 56 if ($deliv_count >= DELIV_ADDR_MAX) { 58 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先最大登録数に達しています。'); 59 SC_Response_Ex::actionExit(); 57 return false; 60 58 } 61 59 62 60 // 別のお届け先を追加 63 61 $sqlval['other_deliv_id'] = $objQuery->nextVal('dtb_other_deliv_other_deliv_id'); 64 $ objQuery->insert($from, $sqlval);62 $ret = $objQuery->insert($from, $sqlval); 65 63 66 64 // 変更 … … 71 69 $deliv_count = $objQuery->count($from, $where, $arrVal); 72 70 if ($deliv_count != 1) { 73 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '一致する別のお届け先がありません。'); 74 SC_Response_Ex::actionExit(); 71 return false; 75 72 } 76 73 77 74 // 別のお届け先を変更 78 $ objQuery->update($from, $sqlval, $where, $arrVal);75 $ret = $objQuery->update($from, $sqlval, $where, $arrVal); 79 76 } 77 78 return $ret; 80 79 } 81 80 … … 86 85 * @return array() 87 86 */ 88 public function getAddress($other_deliv_id )87 public function getAddress($other_deliv_id, $customer_id = '') 89 88 { 90 $objCustomer = new SC_Customer_Ex();91 $customer_id = $objCustomer->getValue('customer_id');92 93 89 if (self::delivErrorCheck(array('customer_id' => $customer_id, 'other_deliv_id' => $other_deliv_id))) { 94 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 95 SC_Response_Ex::actionExit(); 90 return false; 96 91 } 97 92 … … 117 112 { 118 113 if (self::delivErrorCheck(array('customer_id' => $customer_id))) { 119 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 120 SC_Response_Ex::actionExit(); 114 return false; 121 115 } 122 116 … … 141 135 * @return void 142 136 */ 143 public function deleteAddress($other_deliv_id )137 public function deleteAddress($other_deliv_id, $customer_id = '') 144 138 { 145 $objCustomer = new SC_Customer_Ex();146 $customer_id = $objCustomer->getValue('customer_id');147 148 139 if (self::delivErrorCheck(array('customer_id' => $customer_id, 'other_deliv_id' => $other_deliv_id))) { 149 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 150 SC_Response_Ex::actionExit(); 140 return false; 151 141 } 152 142 … … 156 146 $where = 'customer_id = ? AND other_deliv_id = ?'; 157 147 $arrVal = array($customer_id, $other_deliv_id); 158 $objQuery->delete($from, $where, $arrVal);148 return $objQuery->delete($from, $where, $arrVal); 159 149 } 160 150 -
branches/version-2_13_2/data/class/pages/mypage/LC_Page_Mypage_Delivery.php
r23124 r23408 83 83 } 84 84 85 $objAddress->deleteAddress($objFormParam->getValue('other_deliv_id')); 85 if (!$objAddress->deleteAddress($objFormParam->getValue('other_deliv_id'), $customer_id)) { 86 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); 87 SC_Response_Ex::actionExit(); 88 } 86 89 break; 87 90 -
branches/version-2_13_2/data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php
r23279 r23408 141 141 142 142 if ($_GET['other_deliv_id'] != '') { 143 $arrOtherDeliv = $objAddress->getAddress($_SESSION['other_deliv_id'] );143 $arrOtherDeliv = $objAddress->getAddress($_SESSION['other_deliv_id'], $objCustomer->getValue('customer_id')); 144 144 145 145 //不正アクセス判定 … … 172 172 $sqlval['customer_id'] = $customer_id; 173 173 174 $objAddress->registAddress($sqlval); 174 if (!$objAddress->registAddress($sqlval)) { 175 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を登録できませんでした。'); 176 SC_Response_Ex::actionExit(); 177 } 175 178 } 176 179 -
branches/version-2_13_2/data/class/pages/shopping/LC_Page_Shopping_Deliv.php
r23256 r23408 112 112 // 削除 113 113 case 'delete': 114 $objAddress->deleteAddress($arrForm['other_deliv_id']); 114 if (!$objAddress->deleteAddress($arrForm['other_deliv_id'], $objCustomer->getValue('customer_id'))) { 115 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); 116 SC_Response_Ex::actionExit(); 117 } 115 118 break; 116 119 … … 225 228 // 別のお届け先がチェックされている場合 226 229 else { 227 $arrOtherDeliv = $objAddress->getAddress($other_deliv_id );230 $arrOtherDeliv = $objAddress->getAddress($other_deliv_id, $objCustomer->getValue('customer_id')); 228 231 if (!$arrOtherDeliv) { 229 232 return false; -
branches/version-2_13_2/data/class/pages/shopping/LC_Page_Shopping_Multiple.php
r23230 r23408 302 302 if ($objCustomer->isLoginSuccess(true)) { 303 303 if ($other_deliv_id != 0) { 304 $otherDeliv = $objAddress->getAddress($other_deliv_id); 304 $otherDeliv = $objAddress->getAddress($other_deliv_id, $objCustomer->getValue('customer_id')); 305 306 if (!$otherDeliv) { 307 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 308 SC_Response_Ex::actionExit(); 309 } 310 305 311 foreach ($otherDeliv as $key => $val) { 306 312 $arrValues[$other_deliv_id]['shipping_' . $key] = $val; -
branches/version-2_13_2/tests/class/helper/SC_Helper_Address/SC_Helper_Address_deleteAddressTest.php
r23294 r23408 13 13 parent::setUp(); 14 14 $this->objAddress = new SC_Helper_Address_Ex(); 15 $_SESSION['customer']['customer_id'] = 1; // 会員じゃないとテストが落ちる16 15 } 17 16 … … 27 26 $this->setUpAddress(); 28 27 $other_deliv_id = '1000'; 28 $customer_id = 1; 29 29 $this->expected = NULL; 30 $this->objAddress->deleteAddress($other_deliv_id );30 $this->objAddress->deleteAddress($other_deliv_id, $customer_id); 31 31 $objQuery =& SC_Query_Ex::getSingletonInstance(); 32 32 $select = '*'; 33 33 $from = 'dtb_other_deliv'; 34 $where = 'other_deliv_id = ? ';35 $whereVal = array($other_deliv_id );34 $where = 'other_deliv_id = ? AND customer_id = ?'; 35 $whereVal = array($other_deliv_id, $customer_id); 36 36 $this->actual = $objQuery->getRow($select, $from, $where, $whereVal); 37 37 38 38 $this->verify('登録配送先削除'); 39 39 } 40 41 public function testdeleteAddressTest_会員IDを設定しない場合_FALSEを返す() 42 { 43 $this->setUpAddress(); 44 $other_deliv_id = '1000'; 45 $this->expected = FALSE; 46 $this->actual = $this->objAddress->deleteAddress($other_deliv_id); 47 48 $this->verify('登録配送先削除'); 49 } 40 50 } -
branches/version-2_13_2/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php
r23294 r23408 13 13 parent::setUp(); 14 14 $this->objAddress = new SC_Helper_Address_Ex(); 15 $_SESSION['customer']['customer_id'] = 1; // 会員じゃないとテストが落ちる16 15 } 17 16 … … 28 27 $this->setUpAddress(); 29 28 $other_deliv_id = '999'; 29 $customer_id = 1; 30 $this->expected = FALSE; 31 $this->actual = $this->objAddress->getAddress($other_deliv_id, $customer_id); 32 33 $this->verify('登録配送先取得'); 34 } 35 36 public function testgetAddressTest_会員IDを設定しない場合_FALSEを返す() 37 { 38 $this->setUpAddress(); 39 $other_deliv_id = '1001'; 30 40 $this->expected = FALSE; 31 41 $this->actual = $this->objAddress->getAddress($other_deliv_id); … … 38 48 $this->setUpAddress(); 39 49 $other_deliv_id = '1001'; 50 $customer_id = 1; 40 51 $this->expected = array( 41 52 'other_deliv_id' => '1001', … … 60 71 'zipcode' => null 61 72 ); 62 $this->actual = $this->objAddress->getAddress($other_deliv_id );73 $this->actual = $this->objAddress->getAddress($other_deliv_id, $customer_id); 63 74 64 75 $this->verify('登録配送先取得');
Note: See TracChangeset
for help on using the changeset viewer.
