Index: admin_templates/payment_type/payment_type_edit.tpl =================================================================== --- admin_templates/payment_type/payment_type_edit.tpl (revision 15331) +++ admin_templates/payment_type/payment_type_edit.tpl (working copy) @@ -46,6 +46,8 @@ + + @@ -57,8 +59,8 @@ - - + + Index: install/install_data.sql =================================================================== --- install/install_data.sql (revision 15331) +++ install/install_data.sql (working copy) @@ -311,10 +311,10 @@ INSERT INTO ItemTypes VALUES (11, 'In-Commerce', 'p', 'Products', 'Name', 'CreatedById', NULL, NULL, '', 0, '', 'ProductsItem', 'Product'); INSERT INTO ItemTypes VALUES (13, 'In-Commerce', 'ord', 'Orders', 'OrderNumber', '', NULL, NULL, '', 0, '', 'OrdersItem', 'Order'); -INSERT INTO PaymentTypes VALUES (1, 'Credit Card (manual)', 'Credit Card', 'Please enter your credit card details.', NULL, 1, 0, 1, 1, 3, DEFAULT, DEFAULT, ',15,'); -INSERT INTO PaymentTypes VALUES (4, 'PayPal', 'PayPal', 'You will be redirected to PayPal site to make the payment after confirming your order on the next checkout step.', NULL, 0, 0, 0, 1, 4, DEFAULT, DEFAULT, ',15,'); -INSERT INTO PaymentTypes VALUES (2, 'Check/MO', 'Check or Money Order', NULL, NULL, 0, 0, 0, 1, 1, 1, DEFAULT, ',15,'); -INSERT INTO PaymentTypes VALUES (3, 'Authorize.Net', 'Credit Card', 'Please enter your Credit Card details below. Your credit card will not be charged until you confirm your purchase on the next(last) step of checkout process.', NULL, 0, 0, 0, 1, 2, DEFAULT, DEFAULT, ',15,'); +INSERT INTO PaymentTypes (PaymentTypeId, `Name`, l1_Description, l1_Instructions, AdminComments, `Status`, Priority, IsPrimary, BuiltIn, GatewayId, PlacedOrdersEdit, ProcessingFee, PortalGroups) VALUES (1, 'Credit Card (manual)', 'Credit Card', 'Please enter your credit card details.', NULL, 1, 0, 1, 1, 3, DEFAULT, DEFAULT, ',15,'); +INSERT INTO PaymentTypes (PaymentTypeId, `Name`, l1_Description, l1_Instructions, AdminComments, `Status`, Priority, IsPrimary, BuiltIn, GatewayId, PlacedOrdersEdit, ProcessingFee, PortalGroups) VALUES (4, 'PayPal', 'PayPal', 'You will be redirected to PayPal site to make the payment after confirming your order on the next checkout step.', NULL, 0, 0, 0, 1, 4, DEFAULT, DEFAULT, ',15,'); +INSERT INTO PaymentTypes (PaymentTypeId, `Name`, l1_Description, l1_Instructions, AdminComments, `Status`, Priority, IsPrimary, BuiltIn, GatewayId, PlacedOrdersEdit, ProcessingFee, PortalGroups) VALUES (2, 'Check/MO', 'Check or Money Order', NULL, NULL, 0, 0, 0, 1, 1, 1, DEFAULT, ',15,'); +INSERT INTO PaymentTypes (PaymentTypeId, `Name`, l1_Description, l1_Instructions, AdminComments, `Status`, Priority, IsPrimary, BuiltIn, GatewayId, PlacedOrdersEdit, ProcessingFee, PortalGroups) VALUES (3, 'Authorize.Net', 'Credit Card', 'Please enter your Credit Card details below. Your credit card will not be charged until you confirm your purchase on the next(last) step of checkout process.', NULL, 0, 0, 0, 1, 2, DEFAULT, DEFAULT, ',15,'); INSERT INTO PaymentTypeCurrencies VALUES (DEFAULT, 4, 131); INSERT INTO PaymentTypeCurrencies VALUES (DEFAULT, 2, 131); Index: install/install_schema.sql =================================================================== --- install/install_schema.sql (revision 15331) +++ install/install_schema.sql (working copy) @@ -251,8 +251,16 @@ CREATE TABLE PaymentTypes ( PaymentTypeId int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(100) NOT NULL DEFAULT '', - Description varchar(255) DEFAULT NULL, - Instructions text, + l1_Description varchar(255) DEFAULT '', + l2_Description varchar(255) DEFAULT '', + l3_Description varchar(255) DEFAULT '', + l4_Description varchar(255) DEFAULT '', + l5_Description varchar(255) DEFAULT '', + l1_Instructions text, + l2_Instructions text, + l3_Instructions text, + l4_Instructions text, + l5_Instructions text, AdminComments text, `Status` int(11) NOT NULL DEFAULT '0', Priority int(11) NOT NULL DEFAULT '0', @@ -267,7 +275,17 @@ KEY Priority (Priority), KEY GatewayId (GatewayId), KEY BuiltIn (BuiltIn), - KEY IsPrimary (IsPrimary) + KEY IsPrimary (IsPrimary), + KEY l1_Description (l1_Description(5)), + KEY l2_Description (l2_Description(5)), + KEY l3_Description (l3_Description(5)), + KEY l4_Description (l4_Description(5)), + KEY l5_Description (l5_Description(5)), + KEY l1_Instructions (l1_Instructions(5)), + KEY l2_Instructions (l2_Instructions(5)), + KEY l3_Instructions (l3_Instructions(5)), + KEY l4_Instructions (l4_Instructions(5)), + KEY l5_Instructions (l5_Instructions(5)) ); CREATE TABLE Products ( Index: install/upgrades.php =================================================================== --- install/upgrades.php (revision 15331) +++ install/upgrades.php (working copy) @@ -142,4 +142,45 @@ } } + /** + * Update to 5.2.0-RC1 + * + * @param string $mode when called mode {before, after) + */ + public function Upgrade_5_2_0_RC1($mode) + { + if ( $mode != 'before' ) { + return; + } + + $table_name = $this->Application->getUnitOption('pt', 'TableName'); + $table_structure = $this->Conn->Query('DESCRIBE ' . $table_name, 'Field'); + + if ( isset($table_structure['Description']) ) { + $sql = 'UPDATE ' . $table_name . ' + SET Description = "" + WHERE Description IS NULL'; + $this->Conn->Query($sql); + + $sql = 'ALTER TABLE ' . $table_name . ' + CHANGE `Description` `Description` VARCHAR(255) NOT NULL DEFAULT ""'; + $this->Conn->Query($sql); + } + + $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); + /* @var $ml_helper kMultiLanguageHelper */ + + $ml_helper->createFields('pt'); + + if ( isset($table_structure['Description']) ) { + $sql = 'UPDATE ' . $table_name . ' + SET + l' . $this->Application->GetDefaultLanguageId() . '_Description = Description, + l' . $this->Application->GetDefaultLanguageId() . '_Instructions = Instructions'; + $this->Conn->Query($sql); + + $sql = 'ALTER TABLE ' . $table_name . ' DROP Description, DROP Instructions'; + $this->Conn->Query($sql); + } + } } \ No newline at end of file Index: install/upgrades.sql =================================================================== --- install/upgrades.sql (revision 15331) +++ install/upgrades.sql (working copy) @@ -274,3 +274,5 @@ UPDATE ProductOptionCombinations SET CombinationCRC = CAST((CombinationCRC & 0xFFFFFFFF) AS UNSIGNED INTEGER) WHERE CombinationCRC < 0; + +# ===== v 5.2.0-RC1 ===== Index: units/gateways/gw_classes/atosorigin.php =================================================================== --- units/gateways/gw_classes/atosorigin.php (revision 15331) +++ units/gateways/gw_classes/atosorigin.php (working copy) @@ -118,7 +118,7 @@ exec ($run_line, $rets); $ret = $rets[0]; - $result = $this->parseGWResponce($ret); + $result = $this->parseGWResponce($ret, $gw_params); list ($sid, $auth_code) = explode(',', $result['caddie']); $session = $this->Application->recallObject('Session'); @@ -132,7 +132,7 @@ return $result['response_code'] === '00' ? 1 : 0; } - function parseGWResponce($str) + function parseGWResponce($str, $gw_params) { $response = explode ("!", $str); Index: units/gateways/gw_classes/gw_base.php =================================================================== --- units/gateways/gw_classes/gw_base.php (revision 15331) +++ units/gateways/gw_classes/gw_base.php (working copy) @@ -57,8 +57,10 @@ /** * Process notification about payment from payment gateway * + * @param Array $gw_params + * @return bool */ - function processNotification() + function processNotification($gw_params) { } @@ -122,9 +124,10 @@ } /** - * Parse previosly saved gw responce into associative array + * Parse previously saved gw responce into associative array * * @param string $gw_responce + * @param Array $gw_params * @return Array */ function parseGWResponce($gw_responce, $gw_params) @@ -191,7 +194,7 @@ $payment_type->Clear(); $fields_hash = Array ( 'Name' => $data['Gateway']['Name'], - 'Description' => $data['Gateway']['Name'], + 'l' . $this->Application->GetDefaultLanguageId() . '_Description' => $data['Gateway']['Name'], 'BuiltIn' => 1, 'GatewayId' => $gw_id, ); Index: units/gateways/gw_classes/paybox.php =================================================================== --- units/gateways/gw_classes/paybox.php (revision 15331) +++ units/gateways/gw_classes/paybox.php (working copy) @@ -124,7 +124,7 @@ return $result['error'] === '00000' ? 1 : 0; } - function parseGWResponce($str) + function parseGWResponce($str, $gw_params) { $response = explode ("!", $str); Index: units/gateways/gw_classes/sella_guestpay.php =================================================================== --- units/gateways/gw_classes/sella_guestpay.php (revision 15331) +++ units/gateways/gw_classes/sella_guestpay.php (working copy) @@ -96,7 +96,7 @@ /* @var $curl_helper kCurlHelper */ $ret = $curl_helper->Send($url); - $result = $this->parseGWResponce($ret); + $result = $this->parseGWResponce($ret, $gw_params); list ($sid, $auth_code) = explode(',', $result['CUSTOM_INFO']); $session = $this->Application->recallObject('Session'); @@ -123,7 +123,7 @@ return $result['PAY1_TRANSACTIONRESULT'] == 'OK' ? 1 : 0; } - function parseGWResponce($str) + function parseGWResponce($str, $gw_params) { if (preg_match('/#decryptstring#(.*)#\/decryptstring#/', $str, $matches)) { $separator = '*P1*'; Index: units/gateways/gw_classes/verisign_pflink.php =================================================================== --- units/gateways/gw_classes/verisign_pflink.php (revision 15331) +++ units/gateways/gw_classes/verisign_pflink.php (working copy) @@ -89,7 +89,7 @@ function processNotification($gw_params) { - $result = $this->parseGWResponce($_POST); + $result = $this->parseGWResponce($_POST, $gw_params); $session = $this->Application->recallObject('Session'); $session->SID = $_POST['USER2']; @@ -113,7 +113,7 @@ return $result['RESULT'] == '0' ? 1 : 0; } - function parseGWResponce($res) + function parseGWResponce($res, $gw_params) { $this->parsed_responce = $res; return $res; Index: units/orders/orders_config.php =================================================================== --- units/orders/orders_config.php (revision 15331) +++ units/orders/orders_config.php (working copy) @@ -368,7 +368,7 @@ 'PaymentType' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', - 'options_sql' => 'SELECT %s + 'options_sql' => 'SELECT IF(l%2$s_Description <> "", l%2$s_Description, l%3$s_Description) AS Description, PaymentTypeId FROM ' . TABLE_PREFIX . 'PaymentTypes WHERE Status = 1 ORDER BY Priority DESC, Name ASC', Index: units/payment_type/payment_type_config.php =================================================================== --- units/payment_type/payment_type_config.php (revision 15331) +++ units/payment_type/payment_type_config.php (working copy) @@ -101,8 +101,16 @@ 'Fields' => Array ( 'PaymentTypeId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), 'Name' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'required' =>true, 'max_len' => 100), - 'Description' => Array ('type' => 'string', 'max_len' => 255, 'default' => null), - 'Instructions' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null), + 'Description' => Array ( + 'type' => 'string', 'max_len' => 255, + 'formatter' => 'kMultiLanguage', 'db_type' => 'varchar(255)', + 'default' => null + ), + 'Instructions' => Array ( + 'type' => 'string', + 'formatter' => 'kMultiLanguage', 'db_type' => 'text', 'using_fck' => 1, + 'default' => null + ), 'AdminComments' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null), 'Status' => Array ( 'type' => 'int',