Index: branches/5.2.x/units/affiliate_plans_items/affiliate_plans_items_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/affiliate_plans_items/affiliate_plans_items_config.php (.../affiliate_plans_items_config.php) (revision 13845) +++ branches/5.2.x/units/affiliate_plans_items/affiliate_plans_items_config.php (.../affiliate_plans_items_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array( - 'ProductId' => Array(), - 'ItemName' => Array(), - 'SKU' => Array(), - 'Weight' => Array('type'=>'float', 'min_value_exc'=>0, 'formatter' => 'kFormatter', 'format' => '%0.2f'), - 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'BackOrderDate' => Array('formatter' => 'kDateFormatter', 'default' => NULL), + 'ProductId' => Array('type' => 'int', 'default' => 0), + 'ItemName' => Array('type' => 'string', 'default' => ''), + 'SKU' => Array('type' => 'string', 'default' => ''), + 'Weight' => Array('type' => 'float', 'min_value_exc' => 0, 'formatter' => 'kFormatter', 'format' => '%0.2f', 'default' => NULL), + 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), + 'BackOrderDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL), + 'Status' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, + 'default' => 2, + ), + 'CategoryId' => Array ('type' => 'int', 'default' => 0), ), 'Grids' => Array( Index: branches/5.2.x/admin_templates/export_finish.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/export_finish.tpl (.../export_finish.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/export_finish.tpl (.../export_finish.tpl) (revision 14089) @@ -25,7 +25,7 @@
- + Index: branches/5.2.x/units/files/files_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/files/files_config.php (.../files_config.php) (revision 13845) +++ branches/5.2.x/units/files/files_config.php (.../files_config.php) (revision 14089) @@ -1,6 +1,6 @@ true, 'AutoClone' => true, - 'ListSQLs' => Array ( '' => 'SELECT * FROM %s', - ), // key - special, value - list select sql - 'ItemSQLs' => Array ( '' => 'SELECT * FROM %s', - ), - 'FilterMenu' => Array ( - 'Groups' => Array ( - Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_disabled'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array ( - 'show_active' => Array ('label' => 'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - ) - ), + 'ListSQLs' => Array ( + '' => 'SELECT * FROM %s', + ), // key - special, value - list select sql + + 'ItemSQLs' => Array ( + '' => 'SELECT * FROM %s', + ), + 'ListSortings' => Array ( - '' => Array ( - 'ForcedSorting' => Array ('IsPrimary' => 'desc', 'Priority' => 'desc'), - 'Sorting' => Array ('AddedOn' => 'desc', 'Version' => 'desc'), - ) - ), + '' => Array ( + 'ForcedSorting' => Array ('IsPrimary' => 'desc', 'Priority' => 'desc'), + 'Sorting' => Array ('AddedOn' => 'desc', 'Version' => 'desc'), + ) + ), + 'Fields' => Array ( 'FileId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), 'ProductId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), @@ -87,8 +83,8 @@ 'upload_dir' => ITEM_FILES_PATH, 'include_path' => 0, 'size_field' => 'Size', 'max_size' => 50000000, 'orig_name_field' => 'FilePath', - 'content_type_field' => 'MIMEType', - 'not_null' => 1, 'skip_empty' =>1, 'default' => '', + 'content_type_field' => 'MIMEType', + 'not_null' => 1, 'skip_empty' =>1, 'default' => '', 'error_msgs' => Array ( 'bad_file_format' => '!la_error_InvalidFileFormat!', 'bad_file_size' => '!la_error_FileTooLarge!', @@ -102,24 +98,24 @@ ), 'Status' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', - 'options' => Array ( 0 => 'la_Disabled', 1 => 'la_Active', ), 'use_phrases' => 1, - 'not_null' => 1, 'default' => 0, + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( 0 => 'la_Disabled', 1 => 'la_Active', ), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 0, ), 'IsPrimary' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', - 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, ), 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'AddedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'AddedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'AddedById' => Array ('type' => 'int', 'default' => NULL), 'MIMEType' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''), ), - + 'VirtualFields' => Array ( - + ), 'Grids' => Array ( @@ -140,6 +136,7 @@ 'Version' => Array ( 'title' => 'la_col_Version', 'filter_block' => 'grid_like_filter'), 'Size' => Array ( 'title' => 'la_col_Size', 'filter_block' => 'grid_float_range_filter'), 'AddedOn' => Array ( 'title' => 'la_col_AddedOn', 'format' => '_regional_DateFormat', 'filter_block' => 'grid_date_range_filter'), + 'Status' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'), ), ), ), Index: branches/5.2.x/units/products/products_item.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/products/products_item.php (.../products_item.php) (revision 13845) +++ branches/5.2.x/units/products/products_item.php (.../products_item.php) (revision 14089) @@ -1,6 +1,6 @@ Application->getCache($cache_key); + // don't cache, while in temp table + $price_info = $this->IsTempTable() ? false : $this->Application->getCache($cache_key); if ($price_info === false) { if (!$this->Application->isAdmin && $this->Application->LoggedIn()) { Index: branches/5.2.x/admin_templates/orders/export/export.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/orders/export/export.tpl (.../export.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/orders/export/export.tpl (.../export.tpl) (revision 14089) @@ -34,7 +34,7 @@
- + @@ -43,19 +43,17 @@ - - + - + - - + - - + @@ -113,7 +110,7 @@ $kf.elements['events[ord.export]'].value = tmp; Request.makeRequest('', delete_busy, '', function() { presets = document.getElementById(''); - + for (i=0; i< presets.options.length; i++) { if (presets.options[i].selected) { presets.options.remove[i]; Index: branches/5.2.x/units/shipping_quote_engines/shipping_quote_engine.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/shipping_quote_engines/shipping_quote_engine.php (.../shipping_quote_engine.php) (revision 13845) +++ branches/5.2.x/units/shipping_quote_engines/shipping_quote_engine.php (.../shipping_quote_engine.php) (revision 14089) @@ -1,6 +1,6 @@
   " onclick="delete_preset()">
@@ -87,8 +85,7 @@
- + - + - - + + - - - + + + - + - - + + Index: branches/5.2.x/units/shipping/shipping_event_handler.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/shipping/shipping_event_handler.php (.../shipping_event_handler.php) (revision 13845) +++ branches/5.2.x/units/shipping/shipping_event_handler.php (.../shipping_event_handler.php) (revision 14089) @@ -1,6 +1,6 @@ Application->isAdminUser) { + return ; + } + $object =& $event->getObject(); $format = '%01.'.$object->GetDBField('PrecisionAfterSep').'f'; // %01.2f @@ -44,6 +50,7 @@ $sc_object =& $this->Application->recallObject('sc', null, Array ('raise_warnings' => 0)); /* @var $sc_object kDBItem */ + // change default shipping cost values ("Costs" tab on shipping editing) based on field from "Shipping Type" $flat_options = $sc_object->GetFieldOptions('Flat'); $flat_options['format'] = $format; $flat_options['default'] = $zero_if_empty ? 0 : null; Index: branches/5.2.x/admin_templates/discounts/discounts_list.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/discounts/discounts_list.tpl (.../discounts_list.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/discounts/discounts_list.tpl (.../discounts_list.tpl) (revision 14089) @@ -53,7 +53,7 @@
- + Index: branches/5.2.x/install/upgrades.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/install/upgrades.php (.../upgrades.php) (revision 13845) +++ branches/5.2.x/install/upgrades.php (.../upgrades.php) (revision 14089) @@ -1,6 +1,6 @@ Array ('Core' => '5.1.0-B2'), '5.1.0-RC1' => Array ('Core' => '5.1.0-RC1'), '5.1.0' => Array ('Core' => '5.1.0'), + '5.1.1-B1' => Array ('Core' => '5.1.1-B1'), + '5.1.1-B2' => Array ('Core' => '5.1.1-B2'), + '5.1.1-RC1' => Array ('Core' => '5.1.1-RC1'), + '5.1.1' => Array ('Core' => '5.1.1'), ); } Index: branches/5.2.x/admin_templates/payment_type/payment_type_list.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/payment_type/payment_type_list.tpl (.../payment_type_list.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/payment_type/payment_type_list.tpl (.../payment_type_list.tpl) (revision 14089) @@ -81,7 +81,7 @@ - + Index: branches/5.2.x/admin_templates/affiliate_plans/affiliate_payment_types_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/affiliate_plans/affiliate_payment_types_edit.tpl (.../affiliate_payment_types_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/affiliate_plans/affiliate_payment_types_edit.tpl (.../affiliate_payment_types_edit.tpl) (revision 14089) @@ -56,12 +56,12 @@
- - - - - - + + + + + +
Index: branches/5.2.x/admin_templates/products/products_options.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/products_options.tpl (.../products_options.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/products_options.tpl (.../products_options.tpl) (revision 14089) @@ -115,7 +115,7 @@ Open - +
Index: branches/5.2.x/units/orders/orders_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/orders/orders_config.php (.../orders_config.php) (revision 13845) +++ branches/5.2.x/units/orders/orders_config.php (.../orders_config.php) (revision 14089) @@ -1,6 +1,6 @@ TABLE_PREFIX.'Orders', + 'TableName' => TABLE_PREFIX . 'Orders', - 'FilterMenu' => Array ( - 'Groups' => Array ( - Array ('mode' => 'AND', 'filters' => Array (0,1,2,3,4,5,6), 'type' => WHERE_FILTER), - ), - - 'Filters' => Array ( - 0 => Array ('label' => 'la_Incomplete', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 1 => Array ('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 2 => Array ('label' => 'la_BackOrders', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 3 => Array ('label' => 'la_ToShip', 'on_sql' => '', 'off_sql' => '%1$s.Status != 3' ), - 4 => Array ('label' => 'la_Processed', 'on_sql' => '', 'off_sql' => '%1$s.Status != 4' ), - 5 => Array ('label' => 'la_Denied', 'on_sql' => '', 'off_sql' => '%1$s.Status != 5' ), - 6 => Array ('label' => 'la_Archived', 'on_sql' => '', 'off_sql' => '%1$s.Status != 6' ), - ) - ), - 'CalculatedFields' => Array ( '' => Array ( 'CustomerName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', IF (%1$s.PortalUserId = ' . USER_GUEST . ', \'Guest\', \'n/a\')), CONCAT(u.FirstName,\' \',u.LastName) )', @@ -415,7 +399,7 @@ 'ReturnTotal' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00'), 'CostTotal' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00'), 'OriginalAmount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00'), - 'ShippingOption' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (0 => 'la_ship_all_together', 1 => 'la_ship_backorder_separately', 2 => 'la_ship_backorders_upon_avail'), 'default' =>0), + 'ShippingOption' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (0 => 'la_ship_all_together', 1 => 'la_ship_backorder_separately', 2 => 'la_ship_backorders_upon_avail'), 'not_null' => 1, 'default' =>0), 'ShippingGroupOption' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (0 => 'la_auto_group_shipments', 1 => 'la_manual_group_shipments'), 'default' =>0), 'GiftCertificateId' => Array ('type' => 'int', 'default' => null), 'GiftCertificateDiscount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00',), @@ -452,11 +436,15 @@ 'VirtualFields' => Array ( 'CustomerName' => Array ('type' => 'string', 'default' => '', 'filter_type' => 'like'), - 'TotalAmount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00'), - 'AmountWithoutVAT' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00'), - 'SubtotalWithDiscount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00'), - 'SubtotalWithoutDiscount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00'), + 'TotalAmount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'default' => '0.00'), + 'AmountWithoutVAT' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'default' => '0.00'), + 'SubtotalWithDiscount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'default' => '0.00'), + 'SubtotalWithoutDiscount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'default' => '0.00'), 'OrderNumber' => Array ('type' => 'string', 'default' => '', 'filter_type' => 'like'), + 'CouponCode' => Array ('type' => 'string', 'default' => ''), + 'CouponName' => Array ('type' => 'string', 'default' => ''), + 'GiftCertificateCode' => Array ('type' => 'string', 'default' => ''), + 'GiftCertificateRecipient' => Array ('type' => 'string', 'default' => ''), // for ResetToUser 'UserTo' => Array ('type' => 'string', 'default' => ''), @@ -472,16 +460,11 @@ 'UserCountry' => Array ('type' => 'string', 'default' => ''), // for Search - 'Username' => Array ('type' => 'string', 'filter_type' => 'like'), - 'OrderSearchId' => Array ('type' => 'int', 'filter_type' => 'equals', 'filter_field' => 'OrderId'), - 'FromDateTime' => Array ('formatter' => 'kDateFormatter', 'default' => '', 'filter_type' => 'range_from', 'filter_field' => 'OrderDate' ), - 'ToDateTime' => Array ('formatter' => 'kDateFormatter', 'default' => '', 'filter_type' => 'range_to', 'filter_field' => 'OrderDate', 'empty_time' => adodb_mktime(23,59,59) ), - 'FromAmount' => Array ('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'filter_type' => 'range_from', 'filter_field' => 'TotalAmount'), - 'ToAmount' => Array ('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'filter_type' => 'range_to', 'filter_field' => 'TotalAmount'), - 'HasBackOrders' => Array ('default' =>false), - 'PaymentCVV2' => Array ('type' => 'string', 'default' =>false), - 'AffiliateUser' => Array ('type' => 'string', 'filter_type' => 'like'), - 'AffiliatePortalUserId' => Array ('type' => 'int'), + 'Username' => Array ('type' => 'string', 'filter_type' => 'like', 'default' => ''), + 'HasBackOrders' => Array ('type' => 'int', 'default' => 0), + 'PaymentCVV2' => Array ('type' => 'string', 'default' => ''), + 'AffiliateUser' => Array ('type' => 'string', 'filter_type' => 'like', 'default' => ''), + 'AffiliatePortalUserId' => Array ('type' => 'int', 'default' => 0), // export related fields: begin 'ExportFormat' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'CSV', /*2 => 'XML'*/), 'default' => 1), @@ -494,18 +477,18 @@ 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), - 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, + 'use_phrases' => 1, 'default' => 1, ), - 'ExportColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()), - 'AvailableColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()), - 'ExportPresets' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()), + 'ExportColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''), + 'AvailableColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''), + 'ExportPresets' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''), 'ExportSavePreset' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), - 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, + 'use_phrases' => 1, 'default' => 0, ), - 'ExportPresetName' => Array ('type' => 'string'), + 'ExportPresetName' => Array ('type' => 'string', 'default' => ''), // export related fields: end ), 'Grids' => Array ( Index: branches/5.2.x/admin_templates/manufacturers/manufacturers_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/manufacturers/manufacturers_edit.tpl (.../manufacturers_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/manufacturers/manufacturers_edit.tpl (.../manufacturers_edit.tpl) (revision 14089) @@ -59,23 +59,23 @@
- - - - + + + + - - - - - - - - - + + + + + + + + +
Index: branches/5.2.x/units/shipping_quote_engines/shipping_quote_engines_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/shipping_quote_engines/shipping_quote_engines_config.php (.../shipping_quote_engines_config.php) (revision 13845) +++ branches/5.2.x/units/shipping_quote_engines/shipping_quote_engines_config.php (.../shipping_quote_engines_config.php) (revision 14089) @@ -1,6 +1,6 @@ TABLE_PREFIX.'ShippingQuoteEngines', - 'FilterMenu' => Array ( - 'Groups' => Array ( - Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_disabled'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array ( - 'show_active' => Array ('label' => 'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - ) - ), - 'ListSQLs' => Array ( '' => 'SELECT * FROM %s'), // key - special, value - list select sql 'ItemSQLs' => Array ( '' => 'SELECT * FROM %s'), 'ListSortings' => Array ( - '' => Array ( - 'Sorting' => Array ('Name' => 'asc'), - ) - ), + '' => Array ( + 'Sorting' => Array ('Name' => 'asc'), + ) + ), + 'Fields' => Array ( 'EngineId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'Name' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), @@ -106,82 +97,96 @@ ), 'VirtualFields' => Array ( - 'AccountLogin' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), - 'AccountPassword' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'AccountLogin' => Array ('type' => 'string', 'default' => ''), + 'AccountPassword' => Array ('type' => 'string', 'default' => ''), 'UPSEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), - 'UPSAccount' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'UPSAccount' => Array ('type' => 'string', 'default' => ''), 'UPSInvoiced' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced'), + 'default' => 0 ), 'FDXEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), - 'FDXAccount' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'FDXAccount' => Array ('type' => 'string', 'default' => ''), 'FDXInvoiced' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced'), + 'default' => 0 ), 'DHLEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), - 'DHLAccount' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'DHLAccount' => Array ('type' => 'string', 'default' => ''), 'DHLInvoiced' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced'), + 'default' => 0 ), 'USPEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), - 'USPAccount' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'USPAccount' => Array ('type' => 'string', 'default' => ''), 'USPInvoiced' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced'), + 'default' => 0 ), 'ARBEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), - 'ARBAccount' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'ARBAccount' => Array ('type' => 'string', 'default' => ''), 'ARBInvoiced' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced'), + 'default' => 0 ), '1DYEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), '2DYEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), '3DYEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), 'GNDEnabled' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled'), + 'default' => 0 ), 'ShipMethod' => Array ( 'type' => 'string', @@ -190,6 +195,7 @@ 'DRP' => 'Drop-Off At Carrier Location', 'PCK' => 'Schedule A Special Pickup', 'SCD' => 'Regularly Scheduled Pickup'), + 'default' => null ), ), 'Grids' => Array ( Index: branches/5.2.x/admin_templates/payment_type/payment_type_gateway.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/payment_type/payment_type_gateway.tpl (.../payment_type_gateway.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/payment_type/payment_type_gateway.tpl (.../payment_type_gateway.tpl) (revision 14089) @@ -124,7 +124,7 @@
- +
Index: branches/5.2.x/admin_templates/orders/order_product_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/orders/order_product_edit.tpl (.../order_product_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/orders/order_product_edit.tpl (.../order_product_edit.tpl) (revision 14089) @@ -57,13 +57,9 @@ - - - - -
- -
+ + +
@@ -145,7 +141,7 @@
- + Index: branches/5.2.x/admin_templates/shipping/shipping_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/shipping/shipping_edit.tpl (.../shipping_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/shipping/shipping_edit.tpl (.../shipping_edit.tpl) (revision 14089) @@ -58,21 +58,21 @@
- - - - - - - - - - - - + + + + + + + + + + + + - - + +
Index: branches/5.2.x/units/gift_certificates/gift_certificates_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/gift_certificates/gift_certificates_config.php (.../gift_certificates_config.php) (revision 13845) +++ branches/5.2.x/units/gift_certificates/gift_certificates_config.php (.../gift_certificates_config.php) (revision 14089) @@ -1,6 +1,6 @@ 3.3, // ., because this section replaces parent in tree 'type' => stTAB, ), - ), + ), - 'FilterMenu' => Array ( - 'Groups' => Array( - Array ('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER), - ), - - 'Filters' => Array( - 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => 'Status != 1' ), - 1 => Array('label' => 'la_Used', 'on_sql' => '', 'off_sql' => 'Status != 2' ), - 2 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ), - ) - ), - 'ListSQLs' => Array ('' => 'SELECT %1$s.* %2$s FROM %1$s',), 'ItemSQLs' => Array ('' => 'SELECT * FROM %1$s',), Index: branches/5.2.x/units/shipping_quote_engines/shipping_quote_collector.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/shipping_quote_engines/shipping_quote_collector.php (.../shipping_quote_collector.php) (revision 13845) +++ branches/5.2.x/units/shipping_quote_engines/shipping_quote_collector.php (.../shipping_quote_collector.php) (revision 14089) @@ -1,6 +1,6 @@ getEngineClasses(); @@ -46,7 +47,13 @@ /* @var $object ShippingQuoteEngine */ $new_shipping_types = $object->GetShippingQuotes($params); - $shipping_types = array_merge($shipping_types, $new_shipping_types); + + if (is_array($new_shipping_types)) { + $shipping_types = array_merge($shipping_types, $new_shipping_types); + } + else { + $quotes_valid = false; + } } uasort($shipping_types, Array(&$this, 'price_sort')); @@ -95,7 +102,9 @@ $shipping_types = $available_types; - $this->Application->setDBCache($cached_var_name, serialize($shipping_types), 24 * 3600); + if ($quotes_valid) { + $this->Application->setDBCache($cached_var_name, serialize($shipping_types), 24 * 3600); + } return $shipping_types; } @@ -136,6 +145,38 @@ return $classes; } + /** + * Returns shipping quote engine, that matches shipping type used in order + * + * @param Array $shipping_info + * @param int $package_num + * @return ShippingQuoteEngine + */ + function &GetClassByType($shipping_info, $package_num = 1) + { + if ( !$shipping_info || !array_key_exists($package_num, $shipping_info) ) { + return false; + } + + $classes = $this->getEngineClasses(); + $shipping_id = $shipping_info[$package_num]['ShippingId']; + + foreach ($classes as $class) { + $object =& $this->Application->recallObject($class); + /* @var $object ShippingQuoteEngine */ + + $shipping_types = $object->GetAvailableTypes(); + + foreach ($shipping_types as $index => $shipping_type) { + if ( preg_match('/^' . preg_quote($shipping_type['_Id'], '/') . '/', $shipping_id) ) { + return $class; + } + } + } + + return false; + } + function SortShippingTypes($elem1, $elem2) { if ($elem1['_Name'] == $elem2['_Name']) { Index: branches/5.2.x/admin_templates/discounts/coupon_selector.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/discounts/coupon_selector.tpl (.../coupon_selector.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/discounts/coupon_selector.tpl (.../coupon_selector.tpl) (revision 14089) @@ -42,6 +42,6 @@ - + \ No newline at end of file Index: branches/5.2.x/admin_templates/products/option_combinations.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/option_combinations.tpl (.../option_combinations.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/option_combinations.tpl (.../option_combinations.tpl) (revision 14089) @@ -138,22 +138,22 @@
- + - + - - - - - + + + + +
- + Index: branches/5.2.x/admin_templates/products/review_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/review_edit.tpl (.../review_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/review_edit.tpl (.../review_edit.tpl) (revision 14089) @@ -42,16 +42,16 @@
- + - - - - - - - + + + + + + +
Index: branches/5.2.x/units/pricing/pricing_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/pricing/pricing_config.php (.../pricing_config.php) (revision 13845) +++ branches/5.2.x/units/pricing/pricing_config.php (.../pricing_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array ( 'PriceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), 'ProductId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'MinQty' => Array ('type' => 'int', 'default' => 0), - 'MaxQty' => Array ('type' => 'int', 'default' => 0), + 'MinQty' => Array ('type' => 'int', 'default' => null), + 'MaxQty' => Array ('type' => 'int', 'default' => null), 'Cost' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0), 'Price' => Array ('type' => 'float', 'not_null' => 1, 'formatter' => 'kFormatter', 'min_value_inc' => 0, 'format' => '%.2f', 'default' => 0), 'Negotiated' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', - 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, - 'not_null' => 1, 'default' => 0, + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, + 'default' => NULL, ), - 'Points' => Array ('type' => 'int', 'default' => 0), + 'Points' => Array ('type' => 'int', 'default' => null), 'AccessDuration'=> Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), 'AccessUnit' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (1 => 'la_opt_sec', 2 => 'la_opt_min', 3 => 'la_opt_hour', 4 => 'la_opt_day', 5 => 'la_opt_week', 6 => 'la_opt_month', 7 => 'la_opt_year'), 'not_null' => 1, 'default' => 0,), 'Description' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL), 'IsPrimary' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', - 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, ), 'GroupId' => Array ('type' => 'int', 'default' => 0, 'not_null' => 1), @@ -108,7 +108,7 @@ // 'AccessExpiration' => Array ('type' => 'int', 'formatter' => 'kDateFormatter'), // Customization healtheconomics.org -- ), - + 'VirtualFields' => Array ( ), Index: branches/5.2.x/admin_templates/products/option_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/option_edit.tpl (.../option_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/option_edit.tpl (.../option_edit.tpl) (revision 14089) @@ -304,15 +304,15 @@
- + - - - - - - - + + + + + + +
Index: branches/5.2.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl (.../affiliate_plans_brackets.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl (.../affiliate_plans_brackets.tpl) (revision 14089) @@ -162,9 +162,9 @@ - - - + + +
Index: branches/5.2.x/admin_templates/shipping/shipping_type_groups.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/shipping/shipping_type_groups.tpl (.../shipping_type_groups.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/shipping/shipping_type_groups.tpl (.../shipping_type_groups.tpl) (revision 14089) @@ -74,8 +74,8 @@
- - + +
Index: branches/5.2.x/admin_templates/shipping/shipping_list.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/shipping/shipping_list.tpl (.../shipping_list.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/shipping/shipping_list.tpl (.../shipping_list.tpl) (revision 14089) @@ -45,7 +45,7 @@
- + Index: branches/5.2.x/units/addresses/addresses_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/addresses/addresses_config.php (.../addresses_config.php) (revision 13845) +++ branches/5.2.x/units/addresses/addresses_config.php (.../addresses_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array( - 'ShortAddress' => Array('type'=>'string'), + 'ShortAddress' => Array('type'=>'string', 'default' => ''), ), 'Grids' => Array(), Index: branches/5.2.x/admin_templates/products/pricing_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/pricing_edit.tpl (.../pricing_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/pricing_edit.tpl (.../pricing_edit.tpl) (revision 14089) @@ -29,16 +29,16 @@
- + - - - + + + - - + +
Index: branches/5.2.x/units/discount_items/discount_items_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/discount_items/discount_items_config.php (.../discount_items_config.php) (revision 13845) +++ branches/5.2.x/units/discount_items/discount_items_config.php (.../discount_items_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array ( 'DiscountItemId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0, ), - 'DiscountId' => Array('type' => 'int', 'default' => 0, ), - 'ItemResourceId' => Array('type' => 'int', 'default' => 0, ), + 'DiscountId' => Array('type' => 'int', 'default' => null, ), + 'ItemResourceId' => Array('type' => 'int', 'default' => null, ), 'ItemType' => Array('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Product', 2 => 'la_Category', 0 => 'la_WholeOrder' ), 'default' => 1, ), ), 'VirtualFields' => Array( - 'ProductId' => Array(), - 'ItemName' => Array(), - 'SKU' => Array(), - 'Weight' => Array('type'=>'float', 'min_value_exc'=>0, 'formatter' => 'kFormatter', 'format' => '%0.2f'), - 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'BackOrderDate' => Array('formatter' => 'kDateFormatter', 'default' => NULL), + 'ProductId' => Array('type' => 'int', 'default' => 0), + 'ItemName' => Array('type' => 'string', 'default' => ''), + 'SKU' => Array('type' => 'string', 'default' => ''), + 'Weight' => Array('type' => 'float', 'min_value_exc' => 0, 'formatter' => 'kFormatter', 'format' => '%0.2f', 'default' => NULL), + 'CreatedOn' => Array('type' => 'int','formatter' => 'kDateFormatter', 'default' => '#NOW#'), + 'BackOrderDate' => Array('type' => 'int','formatter' => 'kDateFormatter', 'default' => NULL), + 'Status' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, + 'default' => 2, + ), + 'CategoryId' => Array ('type' => 'int', 'default' => 0), ), 'Grids' => Array( Index: branches/5.2.x/units/products/products_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/products/products_config.php (.../products_config.php) (revision 13845) +++ branches/5.2.x/units/products/products_config.php (.../products_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array ( - 'Groups' => Array ( - Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_pending', 'show_disabled'), 'type' => WHERE_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_tang', 'show_sub', 'show_serv', 'show_download', 'show_package'), 'type' => WHERE_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_new'), 'type' => HAVING_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_hot'), 'type' => HAVING_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_pop'), 'type' => HAVING_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array ( - 'show_active' => Array ('label' => 'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array ('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 's1' => Array (), - 'show_tang' => Array ('label' => 'la_product_tangible', 'on_sql' => '', 'off_sql' => '%1$s.Type != 1' ), - 'show_sub' => Array ('label' => 'la_product_subscription', 'on_sql' => '', 'off_sql' => '%1$s.Type != 2' ), - 'show_serv' => Array ('label' => 'la_product_service', 'on_sql' => '', 'off_sql' => '%1$s.Type != 3' ), - 'show_download' => Array ('label' => 'la_product_downloadable', 'on_sql' => '', 'off_sql' => '%1$s.Type != 4' ), - 'show_package' => Array ('label' => 'la_product_package', 'on_sql' => '', 'off_sql' => '%1$s.Type != 5' ), - 's2' => Array (), - 'show_new' => Array ('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array ('label' => 'la_Text_TopSellers', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array ('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array ('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), - ) - ), + 'Groups' => Array ( + Array ('mode' => 'AND', 'filters' => Array ('show_new'), 'type' => HAVING_FILTER), + Array ('mode' => 'AND', 'filters' => Array ('show_hot'), 'type' => HAVING_FILTER), + Array ('mode' => 'AND', 'filters' => Array ('show_pop'), 'type' => HAVING_FILTER), + Array ('mode' => 'AND', 'filters' => Array ('show_pick'), 'type' => WHERE_FILTER), + ), + 'Filters' => Array ( + 'show_new' => Array ('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), + 'show_hot' => Array ('label' => 'la_Text_TopSellers', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), + 'show_pop' => Array ('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), + 'show_pick' => Array ('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), + ) + ), - 'TableName' => TABLE_PREFIX.'Products', + 'TableName' => TABLE_PREFIX . 'Products', + 'CalculatedFields' => Array ( '' => Array ( 'AltName' => 'img.AltName', @@ -503,9 +492,9 @@ 'Expire' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' =>null), 'Type' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' =>Array (1=> 'la_product_tangible', 2=> 'la_product_subscription', 4=> 'la_product_downloadable', 3=> 'la_product_service'/*, 6=> 'la_gift_certificate', 5=> 'la_product_package'*/), 'not_null' => 1, 'default' => 1 ), 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'ModifiedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'CreatedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array ('type' => 'int', 'default' => 0), + 'ModifiedById' => Array ('type' => 'int', 'default' => NULL), + 'CreatedById' => Array ('type' => 'int', 'required' => 1, 'default' => NULL), + 'ResourceId' => Array ('type' => 'int', 'default' => null), 'CachedReviewsQty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0), 'InventoryStatus' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Disabled', 1 => 'la_by_product', 2 => 'la_by_options'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), 'QtyInStock' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), @@ -550,13 +539,15 @@ ), 'VirtualFields' => Array ( - 'Qty' => 1, + 'Qty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'regexp' => '/^[\d]+$/', 'default' => 0), 'Price' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => NULL), 'Cost' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => NULL), - 'IsHot' => Array ('type' => 'int'), - 'IsNew' => Array ('type' => 'int'), - 'IsPop' => Array ('type' => 'int'), - 'Manufacturer' => Array (), + 'CategoryFilename' => Array ('type' => 'string', 'default' => ''), + 'PrimaryCat' => Array ('type' => 'int', 'default' => 0), + 'IsHot' => Array ('type' => 'int', 'default' => 0), + 'IsNew' => Array ('type' => 'int', 'default' => 0), + 'IsPop' => Array ('type' => 'int', 'default' => 0), + 'Manufacturer' => Array ('type' => 'string', 'default' => ''), // export related fields: begin 'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0), @@ -570,24 +561,24 @@ 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), - 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, + 'use_phrases' => 1, 'default' => 1, ), - 'ExportColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()), - 'AvailableColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()), + 'ExportColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''), + 'AvailableColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''), 'CategoryFormat' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'use_phrases' => 1, 'default' => 1), 'CategorySeparator' => Array ('type' => 'string', 'default' => ':'), 'IsBaseCategory' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), - 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, + 'use_phrases' => 1, 'default' => 0, ), // export related fields: end // import related fields: begin 'FieldTitles' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Automatic', 2 => 'la_Manual'), 'use_phrases' => 1, 'default' => 1), 'ImportSource' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Upload', 2 => 'la_Local'), 'use_phrases' => 1, 'default' => 2), - 'ImportFilename' => Array ('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => EXPORT_BASE_PATH . '/'), + 'ImportFilename' => Array ('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => EXPORT_BASE_PATH . '/', 'default' => ''), 'ImportLocalFilename' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), 'CheckDuplicatesMethod' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_IDField', 2 => 'la_OtherFields'), 'use_phrases' => 1, 'default' => 1), 'ReplaceDuplicates' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), @@ -599,13 +590,13 @@ 'FullImage' => Array ('type' => 'string', 'default' => ''), 'ImageAlt' => Array ('type' => 'string', 'default' => ''), - 'Filename' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''), + 'Filename' => Array ('type' => 'string', 'default' => ''), 'CachedNavbar' => Array ('type' => 'string', 'default' => ''), 'ParentPath' => Array ('type' => 'string', 'default' => ''), - 'FileSize' => Array ('type' => 'int', 'formatter' => 'kFilesizeFormatter', 'not_null' => 1, 'default' => 0), - 'FilePath' => Array (), - 'FileVersion' => Array (), + 'FileSize' => Array ('type' => 'int', 'formatter' => 'kFilesizeFormatter', 'default' => 0), + 'FilePath' => Array ('type' => 'string', 'default' => ''), + 'FileVersion' => Array ('type' => 'string', 'default' => ''), // for primary image 'AltName' => Array ('type' => 'string', 'default' => ''), Index: branches/5.2.x/units/affiliates/affiliates_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/affiliates/affiliates_config.php (.../affiliates_config.php) (revision 13845) +++ branches/5.2.x/units/affiliates/affiliates_config.php (.../affiliates_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array( 'UserName' => Array('type'=>'string', 'default' => ''), 'PlanName' => Array('type'=>'string', 'default' => ''), + 'UserId' => Array('type'=>'int', 'default' => 0), ), 'Grids' => Array( Index: branches/5.2.x/admin_templates/products/products_access.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/products_access.tpl (.../products_access.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/products_access.tpl (.../products_access.tpl) (revision 14089) @@ -81,16 +81,16 @@
- + - - - - + + + +
Index: branches/5.2.x/units/product_option_combinations/product_option_combinations_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/product_option_combinations/product_option_combinations_config.php (.../product_option_combinations_config.php) (revision 13845) +++ branches/5.2.x/units/product_option_combinations/product_option_combinations_config.php (.../product_option_combinations_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array ('type' => 'float', 'formatter' => 'kFormatter', 'default' => 0, ), 'Availability' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', - 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, ), 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, ), @@ -91,7 +91,8 @@ ), ), 'VirtualFields' => Array ( - 'FinalPrice' => Array ('formatter' => 'kCombPriceFormatter', 'format' => '%.2f'), + 'FinalPrice' => Array ('type' => 'float', 'formatter' => 'kCombPriceFormatter', 'format' => '%.2f', 'default' => NULL), + 'BasePrice' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => NULL), ), 'Grids' => Array ( 'Default' => Array ( Index: branches/5.2.x/admin_templates/orders/orders_blocks.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/orders/orders_blocks.tpl (.../orders_blocks.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/orders/orders_blocks.tpl (.../orders_blocks.tpl) (revision 14089) @@ -279,11 +279,11 @@ - 43" class="order-totals-name">: + 43" class="order-totals-name">: - 43" class="order-totals-name">: + 43" class="order-totals-name">: Index: branches/5.2.x/admin_templates/orders/orders_toship_list.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/orders/orders_toship_list.tpl (.../orders_toship_list.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/orders/orders_toship_list.tpl (.../orders_toship_list.tpl) (revision 14089) @@ -62,17 +62,15 @@ - - - - - -
- Order: . USPS error: -
+ + Order: . Error:
- + + + + + Index: branches/5.2.x/admin_templates/discounts/coupon_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/discounts/coupon_edit.tpl (.../coupon_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/discounts/coupon_edit.tpl (.../coupon_edit.tpl) (revision 14089) @@ -71,52 +71,38 @@ } - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - + + + + - + + + - - + - - + + - + + + + + + +
+ + + + + +
Index: branches/5.2.x/units/discounts/discounts_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/discounts/discounts_config.php (.../discounts_config.php) (revision 13845) +++ branches/5.2.x/units/discounts/discounts_config.php (.../discounts_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array(4,5,6), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 0 => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Status != 1' ), - 1 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => 'Status != 2' ), - 2 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ), - 3 => Array(), - 4 => Array('label' => 'la_Flat', 'on_sql' => '', 'off_sql' => 'Type != 1' ), - 5 => Array('label' => 'la_Percent', 'on_sql' => '', 'off_sql' => 'Type != 2' ), - 6 => Array('label' => 'la_FreeShipping', 'on_sql' => '', 'off_sql' => 'Type != 3' ), - ) - ), - 'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s', ), // key - special, value - list select sql 'ItemSQLs' => Array( ''=>'SELECT * FROM %1$s', @@ -111,41 +95,47 @@ 'Sorting' => Array('Name' => 'asc'), ) ), - 'Fields' => Array( - 'DiscountId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ( 1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'default' => 2 ), - 'Name' => Array('type'=>'string','required' => 1, 'default' => null, 'max_len'=>255), - 'Start' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'End' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null), - 'GroupId' => Array( - 'type' => 'int', - 'formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalGroup WHERE Personal = 0 ORDER BY Name', 'option_key_field'=>'GroupId', 'option_title_field'=>'Name', - 'required' => 1, 'default' => NULL - ), - 'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Flat', 2 => 'la_Percent'/*, 3 => 'la_FreeShipping' */), 'default' => 1 ), - 'Amount' => Array('type'=>'double', 'default' => null), + 'Fields' => Array ( + 'DiscountId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ( 1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'default' => 2 ), + 'Name' => Array('type'=>'string','required' => 1, 'default' => null, 'max_len'=>255), + 'Start' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), + 'End' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null), + 'GroupId' => Array( + 'type' => 'int', + 'formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalGroup WHERE Personal = 0 ORDER BY Name', 'option_key_field'=>'GroupId', 'option_title_field'=>'Name', + 'required' => 1, 'default' => NULL + ), + 'Type' => Array( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( + 1 => 'la_Flat', 2 => 'la_Percent'/*, 3 => 'la_FreeShipping' */ + ), + 'use_phrases' => 1, 'default' => 1, + ), + 'Amount' => Array('type'=>'double', 'default' => null), + ), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array( - 'default' => 'icon16_item.png', - 0 => 'icon16_disabled.png', - 1 => 'icon16_item.png', - 2 => 'icon16_pending.png', - 'module' => 'core', - ), - 'Fields' => Array( - 'DiscountId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ), - 'Start' => Array( 'title'=>'la_col_Start', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), - 'End' => Array( 'title'=>'la_col_End', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), - 'GroupId' => Array( 'title'=>'la_col_Group', 'filter_block' => 'grid_options_filter', 'width' => 150, ), - 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 90, ), - 'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ), - ), - - ), - ), + 'Grids' => Array ( + 'Default' => Array ( + 'Icons' => Array( + 'default' => 'icon16_item.png', + 0 => 'icon16_disabled.png', + 1 => 'icon16_item.png', + 2 => 'icon16_pending.png', + 'module' => 'core', + ), + 'Fields' => Array ( + 'DiscountId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), + 'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'Start' => Array( 'title'=>'la_col_Start', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), + 'End' => Array( 'title'=>'la_col_End', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), + 'GroupId' => Array( 'title'=>'la_col_Group', 'filter_block' => 'grid_options_filter', 'width' => 150, ), + 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 90, ), + 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 90, ), + 'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ), + ), + ), + ), ); \ No newline at end of file Index: branches/5.2.x/admin_templates/discounts/discount_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/discounts/discount_edit.tpl (.../discount_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/discounts/discount_edit.tpl (.../discount_edit.tpl) (revision 14089) @@ -58,15 +58,15 @@
- - - - - - - - - + + + + + + + + +
Index: branches/5.2.x/admin_templates/affiliate_plans/affiliates_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/affiliate_plans/affiliates_edit.tpl (.../affiliates_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/affiliate_plans/affiliates_edit.tpl (.../affiliates_edit.tpl) (revision 14089) @@ -63,18 +63,18 @@
- - - - - - - - - + + + + + + + + + - + - + Index: branches/5.2.x/admin_templates/products/products_inventory.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/products_inventory.tpl (.../products_inventory.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/products_inventory.tpl (.../products_inventory.tpl) (revision 14089) @@ -73,23 +73,6 @@
@@ -87,7 +87,7 @@
- - - - - - " id="" value="" tabindex="" size="" />  - " onclick="processButton('p', 'OnQtyAdd')">  - " onclick="processButton('p', 'OnQtyRemove')">  - " onclick="processButton('p', 'OnQtyOrder')">  - " onclick="processButton('p', 'OnQtyReceiveOrder')">  - " onclick="processButton('p', 'OnQtyCancelOrder')">  - - - - - - @@ -98,19 +81,29 @@
style="height: 142px;"> style="border-bottom: 1px solid black;"> - + - - - - + + + + - - + + + + +
+ " id="" value="" tabindex="" size="" />  + " onclick="processButton('p', 'OnQtyAdd')">  + " onclick="processButton('p', 'OnQtyRemove')">  + " onclick="processButton('p', 'OnQtyOrder')">  + " onclick="processButton('p', 'OnQtyReceiveOrder')">  + " onclick="processButton('p', 'OnQtyCancelOrder')">  +
Index: branches/5.2.x/install/install_schema.sql =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/install/install_schema.sql (.../install_schema.sql) (revision 13845) +++ branches/5.2.x/install/install_schema.sql (.../install_schema.sql) (revision 14089) @@ -171,7 +171,7 @@ ReturnTotal decimal(20,4) NOT NULL DEFAULT '0.0000', CostTotal decimal(20,4) NOT NULL DEFAULT '0.0000', OriginalAmount decimal(20,4) NOT NULL DEFAULT '0.0000', - ShippingOption tinyint(4) DEFAULT NULL, + ShippingOption tinyint(4) NOT NULL DEFAULT '0', ShippingInfo text, CouponId int(11) DEFAULT NULL, CouponDiscount decimal(20,4) NOT NULL DEFAULT '0.0000', @@ -301,11 +301,11 @@ Modified int(10) unsigned DEFAULT NULL, Expire int(10) unsigned DEFAULT NULL, Hits double NOT NULL DEFAULT '0', - CachedRating varchar(10) NOT NULL default '0', + CachedRating varchar(10) NOT NULL DEFAULT '0', CachedVotesQty int(11) NOT NULL DEFAULT '0', CachedReviewsQty int(11) NOT NULL DEFAULT '0', - CreatedById int(11) NOT NULL DEFAULT '0', - ModifiedById int(11) NOT NULL DEFAULT '0', + CreatedById int(11) DEFAULT NULL, + ModifiedById int(11) DEFAULT NULL, Priority int(11) NOT NULL DEFAULT '0', `Status` tinyint(4) NOT NULL DEFAULT '2', EditorsPick tinyint(4) NOT NULL DEFAULT '0', @@ -444,7 +444,7 @@ IsPrimary tinyint(4) NOT NULL DEFAULT '0', Priority smallint(6) NOT NULL DEFAULT '0', AddedOn int(11) DEFAULT NULL, - AddedById int(11) NOT NULL DEFAULT '0', + AddedById int(11) DEFAULT NULL, MIMEType varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (FileId), KEY ProductId (ProductId), Index: branches/5.2.x/admin_templates/orders/export/export_finish.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/orders/export/export_finish.tpl (.../export_finish.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/orders/export/export_finish.tpl (.../export_finish.tpl) (revision 14089) @@ -25,7 +25,7 @@
- + Index: branches/5.2.x/units/order_items/order_items_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/order_items/order_items_config.php (.../order_items_config.php) (revision 13845) +++ branches/5.2.x/units/order_items/order_items_config.php (.../order_items_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array('type'=>'int','default'=>0), 'DiscountType' => Array('type'=>'string','default'=>''), 'DiscountId' => Array('type'=>'int','default'=>0), - 'Name' => Array('formatter' => 'kMultiLanguage'), + 'Name' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => ''), 'ItemDiscount' => Array('type'=>'double','formatter'=>'kFormatter','format'=>'%01.2f','default'=>'0.00'), 'SKU' => Array('type' => 'string', 'default' => ''), - 'MinQtyFreeShipping'=> Array('type' => 'int', 'not_null' => 1, 'default' => 0,), + 'MinQtyFreeShipping'=> Array('type' => 'int', 'default' => 0,), ), 'Grids' => Array ( Index: branches/5.2.x/units/payment_type/payment_type_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/payment_type/payment_type_config.php (.../payment_type_config.php) (revision 13845) +++ branches/5.2.x/units/payment_type/payment_type_config.php (.../payment_type_config.php) (revision 14089) @@ -1,6 +1,6 @@ 'Name', // field, used in bluebar when editing existing item 'SubItems' => Array ('gwfv', 'ptc'), - 'FilterMenu' => Array ( - 'Groups' => Array ( - Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_disabled'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array ( - 'show_active' => Array ('label' => 'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - ) - ), - 'CalculatedFields' => Array ( - '' => Array ( - 'Gateway' => TABLE_PREFIX.'Gateways.Name', - ), - ), + '' => Array ( + 'Gateway' => TABLE_PREFIX . 'Gateways.Name', + ), + ), 'ListSQLs' => Array ( '' => ' SELECT %1$s.* %2$s FROM %1$s @@ -102,11 +92,12 @@ 'ItemSQLs' => Array ( '' => 'SELECT * FROM %s', ), 'ListSortings' => Array ( - '' => Array ( - 'ForcedSorting' => Array ('Priority' => 'desc'), - 'Sorting' => Array ('Name' => 'asc'), - ) - ), + '' => Array ( + 'ForcedSorting' => Array ('Priority' => 'desc'), + 'Sorting' => Array ('Name' => 'asc'), + ) + ), + 'Fields' => Array ( 'PaymentTypeId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), 'Name' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'required' =>true, 'max_len' => 100), @@ -115,15 +106,15 @@ 'AdminComments' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null), 'Status' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', - 'options' => Array ( 0 => 'la_Disabled', 1 => 'la_Active', ), 'use_phrases' => 1, - 'not_null' => 1, 'default' => 0, + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( 0 => 'la_Disabled', 1 => 'la_Active', ), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 0, ), 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'IsPrimary' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', - 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, ), 'BuiltIn' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_BuiltIn', 0 => 'la_UserDefined' ), 'default' => 0, 'not_null' => 1 ), @@ -137,18 +128,18 @@ ), 'PlacedOrdersEdit' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', - 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, ), 'ProcessingFee' => Array ('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%.02f', 'not_null' => 1, 'default' => '0.00'), 'PortalGroups' => Array ('type' => 'string', 'default' => null), ), - /* + 'VirtualFields' => Array ( - 'Qty' => 1, + 'Gateway' => Array ('type' => 'string', 'default' => ''), ), - */ + 'Grids' => Array ( 'Default' => Array ( 'Icons' => Array ( Index: branches/5.2.x/units/gateways/gateways_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/gateways/gateways_config.php (.../gateways_config.php) (revision 13845) +++ branches/5.2.x/units/gateways/gateways_config.php (.../gateways_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array ( 'GWConfigFieldId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0, ), - 'SystemFieldName' => Array('type' => 'string', 'not_null' => 1, 'default' => 0, ), - 'FieldName' => Array('type' => 'string', 'required' => true, 'max_len' => 100, 'not_null' => 1, 'default' => 0, ), - 'ElementType' => Array('type' => 'string', 'not_null' => 1, 'default' => 0, ), + 'SystemFieldName' => Array('type' => 'string', 'not_null' => 1, 'default' => '', ), + 'FieldName' => Array('type' => 'string', 'required' => true, 'max_len' => 100, 'not_null' => 1, 'default' => '', ), + 'ElementType' => Array('type' => 'string', 'not_null' => 1, 'default' => 'text', ), 'ValueList' => Array('type' => 'string', 'default' => NULL), 'GatewayId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0, ), ), 'VirtualFields' => Array ( - 'Value' => Array(), + 'Value' => Array('type' => 'string', 'default' => ''), ), 'Grids' => Array( Index: branches/5.2.x/units/affiliate_payments/affiliate_payments_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/affiliate_payments/affiliate_payments_config.php (.../affiliate_payments_config.php) (revision 13845) +++ branches/5.2.x/units/affiliate_payments/affiliate_payments_config.php (.../affiliate_payments_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array( - 'Username' => Array('type' => 'string'), - 'PortalUserId' => Array('type' => 'int'), + 'Username' => Array('type' => 'string', 'default' => ''), + 'PortalUserId' => Array('type' => 'int', 'default' => 0), ), 'Grids' => Array( Index: branches/5.2.x/units/coupon_items/coupon_items_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/coupon_items/coupon_items_config.php (.../coupon_items_config.php) (revision 13845) +++ branches/5.2.x/units/coupon_items/coupon_items_config.php (.../coupon_items_config.php) (revision 14089) @@ -1,6 +1,6 @@ 'coupi', - 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'CouponItemsEventHandler','file'=>'coupon_items_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'CouponItemsTagProcessor','file'=>'coupon_items_tag_processor.php','build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'Hooks' => Array( - Array( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => 'p', - 'HookToSpecial' => '-item', - 'HookToEvent' => Array('OnAfterItemDelete'), - 'DoPrefix' => '', - 'DoSpecial' => '', - 'DoEvent' => 'OnDeleteCouponItem', - ), - ), - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'PerPage', - 4 => 'event', - ), - 'IDField' => 'CouponItemId', - 'StatusField' => Array('Status'), - 'TitleField' => 'Name', - 'TableName' => TABLE_PREFIX.'ProductsCouponItems', + $config = Array( + 'Prefix' => 'coupi', + 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array('class' => 'CouponItemsEventHandler', 'file' => 'coupon_items_event_handler.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array('class' => 'CouponItemsTagProcessor', 'file' => 'coupon_items_tag_processor.php', 'build_event' => 'OnBuild'), + 'AutoLoad' => true, + 'Hooks' => Array( + Array( + 'Mode' => hAFTER, + 'Conditional' => false, + 'HookToPrefix' => 'p', + 'HookToSpecial' => '-item', + 'HookToEvent' => Array('OnAfterItemDelete'), + 'DoPrefix' => '', + 'DoSpecial' => '', + 'DoEvent' => 'OnDeleteCouponItem', + ), + ), + + 'QueryString' => Array( + 1 => 'id', + 2 => 'Page', + 3 => 'PerPage', + 4 => 'event', + ), - 'CalculatedFields' => Array( - '' => Array( - 'ProductId' => 'p.ProductId', - 'ItemName' => 'IF(p.Name IS NULL,c.Name,p.l1_Name)', - 'SKU' => 'p.SKU', - 'Weight' => 'p.Weight', - 'CreatedOn' => 'p.CreatedOn', - 'BackOrderDate' => 'p.BackOrderDate', - 'Status' => 'p.Status', - 'CategoryId' => 'c.CategoryId', + 'IDField' => 'CouponItemId', + 'StatusField' => Array('Status'), + 'TitleField' => 'Name', + 'TableName' => TABLE_PREFIX . 'ProductsCouponItems', - ), + 'ForeignKey' => 'CouponId', + 'ParentTableKey' => 'CouponId', + 'ParentPrefix' => 'coup', + 'AutoDelete' => true, + 'AutoClone' => true, + + 'ListSQLs' => Array( + '' => ' SELECT %1$s.* %2$s + FROM %1$s + LEFT JOIN ' . TABLE_PREFIX . 'Products p ON %1$s.ItemResourceId = p.ResourceId + LEFT JOIN ' . TABLE_PREFIX . 'Category c ON %1$s.ItemResourceId = c.ResourceId', + ), // key - special, value - list select sql + + 'ItemSQLs' => Array( + '' => 'SELECT * FROM %s', + ), - ), - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Products p ON %1$s.ItemResourceId = p.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category c ON %1$s.ItemResourceId = c.ResourceId', - ), // key - special, value - list select sql - 'ItemSQLs' => Array( ''=>'SELECT * FROM %s', - ), + /*'BelongsTo' => Array( + Array( + 'prefix' => 'd', 'key' => 'DiscountId', 'ForeignKey' => 'DiscountId'), + ),*/ + + 'ListSortings' => Array( + '' => Array( + 'Sorting' => Array('ItemName' => 'asc'), + ), + ), + + 'CalculatedFields' => Array( + '' => Array( + 'ProductId' => 'p.ProductId', + 'ItemName' => 'IF(p.Name IS NULL,c.Name,p.l1_Name)', + 'SKU' => 'p.SKU', + 'Weight' => 'p.Weight', + 'CreatedOn' => 'p.CreatedOn', + 'BackOrderDate' => 'p.BackOrderDate', + 'Status' => 'p.Status', + 'CategoryId' => 'c.CategoryId', + ), + ), - /*'BelongsTo' => Array( - Array('prefix' => 'd', 'key' => 'DiscountId', 'ForeignKey' => 'DiscountId'), - ),*/ - 'ForeignKey' => 'CouponId', - 'ParentTableKey' => 'CouponId', - 'ParentPrefix' => 'coup', - 'AutoDelete' => true, - 'AutoClone' => true, + 'Fields' => Array ( + 'CouponItemId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), + 'CouponId' => Array('type' => 'int', 'default' => null, ), + 'ItemResourceId' => Array('type' => 'int', 'default' => null, ), + 'ItemType' => Array( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (1 => 'la_Product', 2 => 'la_Category', 0 => 'la_WholeOrder'), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 1 + ), + ), - 'ListSortings' => Array( - '' => Array( - 'Sorting' => Array('ItemName' => 'asc'), - ) - ), + 'VirtualFields' => Array( + 'ProductId' => Array('type' => 'int', 'default' => 0), + 'ItemName' => Array('type' => 'string', 'default' => ''), + 'SKU' => Array('type' => 'string', 'default' => ''), + 'Weight' => Array( + 'type' => 'float', + 'formatter' => 'kFormatter', 'format' => '%0.2f', + 'min_value_exc' => 0, 'default' => NULL, + ), + 'CreatedOn' => Array( + 'type' => 'int', + 'formatter' => 'kDateFormatter', + 'default' => '#NOW#', + ), + 'BackOrderDate' => Array( + 'type' => 'int', + 'formatter' => 'kDateFormatter', + 'default' => NULL, + ), + 'Status' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, + 'default' => 2, + ), + 'CategoryId' => Array ('type' => 'int', 'default' => 0), + ), - 'Fields' => Array ( - 'CouponItemId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0, ), - 'CouponId' => Array('type' => 'int', 'default' => 0, ), - 'ItemResourceId' => Array('type' => 'int', 'default' => 0, ), - 'ItemType' => Array('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Product', 2 => 'la_Category', 0 => 'la_WholeOrder' ), 'default' => 1, ), - ), - - 'VirtualFields' => Array( - 'ProductId' => Array(), - 'ItemName' => Array(), - 'SKU' => Array(), - 'Weight' => Array('type'=>'float', 'min_value_exc'=>0, 'formatter' => 'kFormatter', 'format' => '%0.2f'), - 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'BackOrderDate' => Array('formatter' => 'kDateFormatter', 'default' => NULL), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array('default'=>'icon16_entire_order.gif'), - 'Fields' => Array( - 'ItemType' => Array( 'title'=>'la_col_ItemType', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_empty_filter', 'width' => 200, ), - ), - - ), - 'CouponItems' => Array( - 'Icons' => Array( - 'default' => 'icon16_product.png', - 0 => 'icon16_product_disabled.png', - 1 => 'icon16_product.png', - 2 => 'icon16_product_pending.png', - ), - 'Fields' => Array( - 'ProductId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_item_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'ItemName' => Array( 'title'=>'la_col_ItemName', 'filter_block' => 'grid_like_filter', 'width' => 250, ), - 'ItemType' => Array( 'title'=>'la_col_CouponItemType', 'filter_block' => 'grid_options_filter', 'width' => 150, ), - ), - - ), - ), + 'Grids' => Array( + 'Default' => Array( + 'Icons' => Array('default'=>'icon16_entire_order.gif'), + 'Fields' => Array( + 'ItemType' => Array( 'title'=>'la_col_ItemType', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_empty_filter', 'width' => 200, ), + ), + ), + 'CouponItems' => Array( + 'Icons' => Array( + 'default' => 'icon16_product.png', + 0 => 'icon16_product_disabled.png', + 1 => 'icon16_product.png', + 2 => 'icon16_product_pending.png', + ), + 'Fields' => Array( + 'ProductId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_item_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), + 'ItemName' => Array( 'title'=>'la_col_ItemName', 'filter_block' => 'grid_like_filter', 'width' => 250, ), + 'ItemType' => Array( 'title'=>'la_col_CouponItemType', 'filter_block' => 'grid_options_filter', 'width' => 150, ), + ), + ), + ), + ); \ No newline at end of file Index: branches/5.2.x/admin_templates/orders/orders_edit_shipping.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/orders/orders_edit_shipping.tpl (.../orders_edit_shipping.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/orders/orders_edit_shipping.tpl (.../orders_edit_shipping.tpl) (revision 14089) @@ -69,33 +69,26 @@ - -
- - - -
- - -
- +
- + - - - - - - - - + + + + + + + + - - - + + + name="" id="_" value=""> 
- +
@@ -153,28 +146,27 @@ - +
- + + + + + - - - - - - - - - - - - - + + + + + + + + - - + + - + - + - - + - - + @@ -211,32 +203,31 @@   - + - + - - + + - - +    ', 'OnDownloadLabel'); return false;"> - + - + - + @@ -247,4 +238,13 @@ + + + + \ No newline at end of file Index: branches/5.2.x/admin_templates/shipping/shipping_quote_engine_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/shipping/shipping_quote_engine_edit.tpl (.../shipping_quote_engine_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/shipping/shipping_quote_engine_edit.tpl (.../shipping_quote_engine_edit.tpl) (revision 14089) @@ -73,41 +73,37 @@
- - - - - + + + + + - - - - - - - + + + - + - - - - - + + + + + - - + + - - + +
- " id="" value=""> -
+ " id="" value=""> +
Index: branches/5.2.x/units/coupons/coupons_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/coupons/coupons_config.php (.../coupons_config.php) (revision 13845) +++ branches/5.2.x/units/coupons/coupons_config.php (.../coupons_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array(4,5/*,6*/), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => 'Status != 1' ), - 1 => Array('label' => 'la_Used', 'on_sql' => '', 'off_sql' => 'Status != 2' ), - 2 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ), - 3 => Array(), - 4 => Array('label' => 'la_Flat', 'on_sql' => '', 'off_sql' => 'Type != 1' ), - 5 => Array('label' => 'la_Percent', 'on_sql' => '', 'off_sql' => 'Type != 2' ), - // 6 => Array('label' => 'la_FreeShipping', 'on_sql' => '', 'off_sql' => 'Type != 3' ), - ) - ), - 'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s', ), // key - special, value - list select sql 'ItemSQLs' => Array( ''=>'SELECT * FROM %1$s', ), - 'ListSortings' => Array( - '' => Array( - 'Sorting' => Array('Name' => 'asc'), - ) - ), + 'ListSortings' => Array ( + '' => Array( + 'Sorting' => Array('Name' => 'asc'), + ) + ), + 'Fields' => Array( 'CouponId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'Status' => Array ( @@ -164,6 +149,7 @@ 'Code' => Array( 'title'=>'la_col_CouponCode', 'filter_block' => 'grid_like_filter', 'width' => 100, ), 'Expiration' => Array( 'title'=>'la_col_Expiration', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100, ), + 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ), 'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ), 'LastUsedBy' => Array('title'=>'la_col_LastUsedBy', 'filter_block' => 'grid_like_filter', 'width' => 140, ), 'LastUsedOn' => Array('title'=>'la_col_LastUsedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), @@ -184,6 +170,7 @@ 'Code' => Array( 'title'=>'la_col_CouponCode', 'filter_block' => 'grid_like_filter', 'width' => 100, ), 'Expiration' => Array( 'title'=>'la_col_Expiration', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100, ), + 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ), 'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ), 'LastUsedBy' => Array('title'=>'la_col_LastUsedBy', 'filter_block' => 'grid_like_filter', 'width' => 140, ), 'LastUsedOn' => Array('title'=>'la_col_LastUsedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), Index: branches/5.2.x/admin_templates/products/products_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/products_edit.tpl (.../products_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/products_edit.tpl (.../products_edit.tpl) (revision 14089) @@ -62,27 +62,27 @@
- - + + - + - - + + - - + + - + - + @@ -107,48 +107,48 @@ - + - + - + - + - - + + - - - - - - - + + + + + + + - - + + - - + + - - - - + + + + - - - - + + + + " /> Index: branches/5.2.x/admin_templates/shipping/shipping_brackets.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/shipping/shipping_brackets.tpl (.../shipping_brackets.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/shipping/shipping_brackets.tpl (.../shipping_brackets.tpl) (revision 14089) @@ -254,8 +254,8 @@
- - + +
Index: branches/5.2.x/admin_templates/products/shipping_options.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/shipping_options.tpl (.../shipping_options.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/shipping_options.tpl (.../shipping_options.tpl) (revision 14089) @@ -32,9 +32,9 @@
- + - + @@ -63,7 +63,7 @@ Index: branches/5.2.x/admin_templates/shipping/zone_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/shipping/zone_edit.tpl (.../zone_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/shipping/zone_edit.tpl (.../zone_edit.tpl) (revision 14089) @@ -165,14 +165,14 @@

- - + + - + - - - + + + Index: branches/5.2.x/admin_templates/shipping/shipping_custom_list.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/shipping/shipping_custom_list.tpl (.../shipping_custom_list.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/shipping/shipping_custom_list.tpl (.../shipping_custom_list.tpl) (revision 14089) @@ -61,7 +61,7 @@
- + Index: branches/5.2.x/admin_templates/products/relations_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/relations_edit.tpl (.../relations_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/relations_edit.tpl (.../relations_edit.tpl) (revision 14089) @@ -47,17 +47,17 @@
- + - - - - - + + + + +
Index: branches/5.2.x/install/upgrades.sql =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/install/upgrades.sql (.../upgrades.sql) (revision 13845) +++ branches/5.2.x/install/upgrades.sql (.../upgrades.sql) (revision 14089) @@ -180,3 +180,21 @@ # ===== v 5.1.0 ===== ALTER TABLE Products CHANGE CachedRating CachedRating varchar(10) NOT NULL default '0'; + +# ===== v 5.1.1-B1 ===== +ALTER TABLE Orders CHANGE ShippingOption ShippingOption TINYINT(4) NOT NULL DEFAULT '0'; + +ALTER TABLE ProductFiles CHANGE AddedById AddedById INT(11) NULL DEFAULT NULL; +UPDATE ProductFiles SET AddedById = NULL WHERE AddedById = 0; + +ALTER TABLE Products + CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL , + CHANGE ModifiedById ModifiedById INT(11) NULL DEFAULT NULL; +UPDATE Products SET CreatedById = NULL WHERE CreatedById = 0; +UPDATE Products SET ModifiedById = NULL WHERE ModifiedById = 0; + +# ===== v 5.1.1-B2 ===== + +# ===== v 5.1.1-RC1 ===== + +# ===== v 5.1.1 ===== \ No newline at end of file Index: branches/5.2.x/units/zones/zones_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/zones/zones_config.php (.../zones_config.php) (revision 13845) +++ branches/5.2.x/units/zones/zones_config.php (.../zones_config.php) (revision 14089) @@ -1,6 +1,6 @@ 'ZoneID', 'TitleField' => 'Name', 'TitlePresets' => Array ( - 'default' => Array ( 'new_status_labels' => Array ('z' => '!la_title_AddingShippingZone!'), - 'edit_status_labels' => Array ('z' => '!la_title_EditingShippingZone!'), - 'new_titlefield' => Array ('z' => '!la_title_NewShippingZone!'), - ), + 'default' => Array ( + 'new_status_labels' => Array ('z' => '!la_title_AddingShippingZone!'), + 'edit_status_labels' => Array ('z' => '!la_title_EditingShippingZone!'), + ), 'zones_edit' => Array ( 'prefixes' => Array ('z'), 'format' => "#z_status# - '#z_titlefield#'"), - ), - 'TableName' => TABLE_PREFIX.'ShippingZones', + ), + 'TableName' => TABLE_PREFIX . 'ShippingZones', 'ForeignKey' => 'ShippingTypeID', //Name of the field in this table used as ForeignKey 'ParentTableKey' => 'ShippingID', //Name of the field in parent table linked with ForeignKey 'ParentPrefix' => 's', //Prefix of parent item Index: branches/5.2.x/admin_templates/import.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/import.tpl (.../import.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/import.tpl (.../import.tpl) (revision 14089) @@ -90,10 +90,8 @@
- - - - + + - - + - - + - - + @@ -178,22 +173,19 @@ - - + - - + - - + - - +
@@ -124,17 +122,15 @@
@@ -166,8 +162,7 @@
', 'ImportCategory', null, 'OnSaveSettings');">  
@@ -218,8 +210,7 @@
Index: branches/5.2.x/admin_templates/taxes/taxes_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/taxes/taxes_edit.tpl (.../taxes_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/taxes/taxes_edit.tpl (.../taxes_edit.tpl) (revision 14089) @@ -164,14 +164,14 @@
- - + + - - - - - + + + + + Index: branches/5.2.x/units/orders/orders_event_handler.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 13845) +++ branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 14089) @@ -1,6 +1,6 @@ Name == 'OnQuietPreSave') { + $section = $event->getSection(); + + if ($this->isNewItemCreate($event)) { + return $this->Application->CheckPermission($section.'.add', 1); + } + else { + return $this->Application->CheckPermission($section.'.add', 1) || $this->Application->CheckPermission($section.'.edit', 1); + } + } + return parent::CheckPermission($event); } @@ -1236,7 +1247,9 @@ */ function CheckUser(&$event) { - if ($this->Application->isAdminUser) { + if ($this->Application->isAdminUser || defined('GW_NOTIFY')) { + // don't check for user in order while processing payment + // gateways, because they can do cross-domain ssl redirects return; } @@ -1783,12 +1796,23 @@ case 'OnMassOrderShip': case 'OnOrderShip': - $ret = Array(); + $ret = Array (); + $shipping_info = $object->GetDBField('ShippingInfo'); + if ($shipping_info) { + $quote_engine_collector =& $this->Application->recallObject('ShippingQuoteCollector'); + /* @var $quote_engine_collector ShippingQuoteCollector */ + + $shipping_info = unserialize($shipping_info); + $shipping_quote_engine = $quote_engine_collector->GetClassByType($shipping_info, 1); + } + // try to create usps order - if ( $object->GetDBField('ShippingType') == 0 && strpos($object->GetDBField('ShippingInfo'), 'USPS')) { - $ses_usps_erros = Array(); - $ret = $this->MakeUSPSOrder($object); + if (($object->GetDBField('ShippingType') == 0) && ($shipping_quote_engine !== false)) { + $shipping_quote_engine =& $this->Application->recallObject($shipping_quote_engine); + /* @var $shipping_quote_engine ShippingQuoteEngine */ + + $ret = $shipping_quote_engine->MakeOrder($object); } if ( !array_key_exists('error_number', $ret) ) { @@ -1811,15 +1835,12 @@ $gateway_object->OrderShipped($object->FieldValues, $gw_data['gw_params']); } else { - $usps_errors[$object->GetField('OrderNumber')] = $ret['error_description']; - $ses_usps_erros = Array(); - $ses_usps_erros = unserialize($this->Application->RecallVar('usps_errors')); - if ( is_array($ses_usps_erros) ) { - $usps_errors = array_merge($usps_errors, $ses_usps_erros); - } - $this->Application->StoreVar('usps_errors', serialize($usps_errors)); - } + $sqe_errors = $this->Application->RecallVar('sqe_errors'); + $sqe_errors = $sqe_errors ? unserialize($sqe_errors) : Array (); + $sqe_errors[ $object->GetField('OrderNumber') ] = $ret['error_description']; + $this->Application->StoreVar('sqe_errors', serialize($sqe_errors)); + } break; case 'OnMassOrderProcess': @@ -3471,50 +3492,71 @@ } } + /** + * Updates shipping types + * + * @param kEvent $event + * @return bool + */ function UpdateShippingTypes(&$event) { - $object =& $this->Application->recallObject($event->getPrefixSpecial()); - $ord_id = $object->GetId(); + $object =& $event->getObject(); + /* @var $object OrdersItem */ + $ord_id = $object->GetID(); + $order_info = $this->Application->GetVar('ord'); $shipping_ids = getArrayValue($order_info, $ord_id, 'ShippingTypeId'); - if (!$shipping_ids) - { + if (!$shipping_ids) { return; } - $last_shippings = unserialize($this->Application->RecallVar('LastShippings')); + $ret = true; $shipping_types = Array(); + $last_shippings = unserialize( $this->Application->RecallVar('LastShippings') ); - $ret = true; - foreach($shipping_ids as $package => $id) - { + $template = $this->Application->GetVar('t'); + $shipping_templates = Array ('in-commerce/checkout/shipping', 'in-commerce/orders/orders_edit_shipping'); + + $quote_engine_collector =& $this->Application->recallObject('ShippingQuoteCollector'); + /* @var $quote_engine_collector ShippingQuoteCollector */ + + foreach ($shipping_ids as $package => $id) { // try to validate - if ( $object->GetDBField('ShippingType') == 0 && (strpos($id, 'USPS') !== false) && in_array($this->Application->GetVar('t'), Array('in-commerce/checkout/shipping','in-commerce/orders/orders_edit_shipping'))) { + $shipping_types[$package] = $last_shippings[$package][$id]; + $shipping_quote_engine = $quote_engine_collector->GetClassByType($shipping_types, $package); + + if (($object->GetDBField('ShippingType') == 0) && ($shipping_quote_engine !== false) && in_array($template, $shipping_templates)) { + $shipping_quote_engine =& $this->Application->recallObject($shipping_quote_engine); + /* @var $shipping_quote_engine ShippingQuoteEngine */ + + // set first of found shippings just to check if any errors are returned $current_usps_shipping_types = unserialize($this->Application->RecallVar('current_usps_shipping_types')); - $object->SetDBField('ShippingInfo', serialize(Array($package => $current_usps_shipping_types[$id]))); - $usps_data = $this->MakeUSPSOrder($object, true); - if ( !isset($usps_data['error_number']) ) { + $object->SetDBField('ShippingInfo', serialize( Array($package => $current_usps_shipping_types[$id])) ); + + $sqe_data = $shipping_quote_engine->MakeOrder($object, true); + + if ( !isset($sqe_data['error_number']) ) { // update only international shipping if ( $object->GetDBField('ShippingCountry') != 'USA') { - $last_shippings[$package][$id]['TotalCost'] = $usps_data['Postage']; + $shipping_types[$package]['TotalCost'] = $sqe_data['Postage']; } } else { - $this->Application->SetVar('usps_errors', $usps_data['error_description']); $ret = false; + $this->Application->StoreVar('sqe_error', $sqe_data['error_description']); } + $object->SetDBField('ShippingInfo', ''); } - $shipping_types[$package] = $last_shippings[$package][$id]; } + $object->SetDBField('ShippingInfo', serialize($shipping_types)); return $ret; } - /*function shipOrder(&$order_items) { $product_object =& $this->Application->recallObject('p', null, Array('skip_autoload' => true)); @@ -3751,6 +3793,11 @@ $this->Conn->Query($sql); } + if ( !is_object($event->MasterEvent) ) { + // not called as hook + return ; + } + $pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24; $to_charge = $this->getRecurringOrders($pre_expiration); @@ -4036,137 +4083,6 @@ } /** - * Creates new USPS order - * - * @param OrdersItem $object - * @param bool $fake_mode - * @return Array - */ - function MakeUSPSOrder(&$object, $fake_mode = false) - { - $this->Application->recallObject('ShippingQuoteEngine'); - - $aUSPS = $this->Application->recallObject('USPS', 'USPS'); - /* @var $aUSPS USPS */ - - $ShippingInfo = unserialize($object->GetDBField('ShippingInfo')); - $ShippingCode = $USPSMethod = ''; - $ShippingCountry = $aUSPS->GetUSPSCountry($object->GetDBField('ShippingCountry')); - - $UserName = explode(" ", $object->GetDBField('ShippingTo')); - - $item_table = TABLE_PREFIX.'OrderItems'; - if ($this->Application->isAdminUser) { - // this strange contraption actually uses temp table from object (when in temp mode) - $order_table = $object->TableName; - $item_table = str_replace('Orders', 'OrderItems', $order_table); - } - - $sOrder = Array ( - 'FirstName' => $UserName[0], - 'LastName' => $UserName[1], - 'ShippingCompany' => $object->GetDBField('ShippingCompany'), - 'ShippingAddress1' => $object->GetDBField('ShippingAddress1'), - 'ShippingAddress2' => $object->GetDBField('ShippingAddress2'), - 'ShippingCity' => $object->GetDBField('ShippingCity'), - 'ShippingZip' => $object->GetDBField('ShippingZip'), - 'ShippingCountry' => $ShippingCountry, - 'ShippingPhone' => $aUSPS->PhoneClean($object->GetDBField('ShippingPhone')), - 'ShippingFax' => $aUSPS->PhoneClean($object->GetDBField('ShippingFax')), - 'ShippingNumBoxes' => '1', - ); - - $sql = 'SELECT SUM(`Quantity` * `Weight`) - FROM ' . $item_table . ' - WHERE ' . $object->IDField . ' = ' . $object->GetID(); - $weight = $this->Application->Conn->GetOne($sql); - - $f_weight = Kg2Pounds($weight); - $sOrder['ShippingWeight'] = $f_weight[0].'.'.$f_weight[1]; - - foreach ($ShippingInfo as $k => $ShippingRow) { - $ShippingCode = $ShippingRow['Code']; - } - - if ( $object->GetDBField('ShippingCountry') == 'USA' ) { - $sOrder['ShippingState'] = $object->GetDBField('ShippingState'); - $USPSMethod = $ShippingCode; - unset($sOrder['ShippingZip']); - - $sOrder['ShippingZip5'] = substr(trim($object->GetDBField('ShippingZip')), 0, 5); - $sOrder['ShippingZip4'] = ''; - $sOrder['SubTotal'] = $object->GetDBField('SubTotal'); - } - else { - $USPSMethod = array_search($ShippingCode, $aUSPS->intl_types); - $sOrder['ShippingProvince'] = ''; - - if ( $ShippingCountry == 'CA' ) { - $sOrder['ShippingProvince'] = $object->GetField('ShippingState'); - } - - // add items - $sql = 'SELECT `Quantity`, `Weight`, `Price` - FROM ' . $item_table . ' - WHERE ' . $object->IDField . ' = ' . $object->GetID(); - $order_items = $this->Application->Conn->Query($sql); - - $i = 1; - $Items = Array(); - - foreach ($order_items as $k => $order_item) { - $p_weight = Array(); - $p_weight = Kg2Pounds($order_item['Weight']); - $Items[$i] = Array('Qty' => $order_item['Quantity'], 'Price' => $order_item['Price'], 'NetPounds' => $p_weight[0], 'NetOunces' => $p_weight[1]); - $i++; - } - - $sOrder['Items'] = $Items; - $sOrder['InvoiceNumber'] = $object->GetDBField('OrderNumber'); - } - - $sOrder['ShippingService'] = $USPSMethod; - - // make USPS order - $aUSPS->order = $sOrder; - $usps_data = $aUSPS->PostOrder(); - - // if errors - if ( array_key_exists('error_number', $usps_data) ) { - return $usps_data; - } - - if ( array_key_exists('Postage', $usps_data) ) { - $ShippingPrice = ''; - $ShippingPrice = $usps_data['Postage']; - } - - $ShippingTracking = ''; - - if ( isset($usps_data['TrackingNumber']) && $usps_data['TrackingNumber'] != '' ) { - $ShippingTracking = $usps_data['TrackingNumber']; - } - - if ( isset($usps_data['PostnetBarCode']) && $usps_data['PostnetBarCode'] != '' && $ShippingTracking == '' ) { - $ShippingTracking = $usps_data['PostnetBarCode']; - } - - if ($fake_mode == false) { - $object->SetDBField('ShippingTracking', $ShippingTracking); - $object->Update(); - } - else { - $full_path = USPS_LABEL_FOLDER . $ShippingTracking . ".pdf"; - - if (file_exists($full_path)) { - unlink($full_path); - } - } - - return $usps_data; - } - - /** * Downloads shipping tracking bar code, that was already generated by USPS service * * @param kEvent $event Index: branches/5.2.x/admin_templates/discounts/gift_certificate_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/discounts/gift_certificate_edit.tpl (.../gift_certificate_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/discounts/gift_certificate_edit.tpl (.../gift_certificate_edit.tpl) (revision 14089) @@ -77,51 +77,38 @@ } - - - - - - - - - -
- - -
- + - - - - + + + + - + - - - - + + + + - + - + - + - + - + @@ -145,24 +132,30 @@ - + - + - + + + + - + - + - +
+ + +
Index: branches/5.2.x/admin_templates/affiliate_plans/affiliate_plans_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/affiliate_plans/affiliate_plans_edit.tpl (.../affiliate_plans_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/affiliate_plans/affiliate_plans_edit.tpl (.../affiliate_plans_edit.tpl) (revision 14089) @@ -56,24 +56,20 @@
- - - - - - - + + + + + + + - - - - - - - + + +
- - () -
+ + () +
Index: branches/5.2.x/admin_templates/orders/orders_search_list.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/orders/orders_search_list.tpl (.../orders_search_list.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/orders/orders_search_list.tpl (.../orders_search_list.tpl) (revision 14089) @@ -53,7 +53,7 @@ - + Index: branches/5.2.x/admin_templates/affiliate_plans/affiliates_payout.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/affiliate_plans/affiliates_payout.tpl (.../affiliates_payout.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/affiliate_plans/affiliates_payout.tpl (.../affiliates_payout.tpl) (revision 14089) @@ -29,9 +29,9 @@
- + - + Index: branches/5.2.x/admin_templates/products/products_categories.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/products_categories.tpl (.../products_categories.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/products_categories.tpl (.../products_categories.tpl) (revision 14089) @@ -73,7 +73,7 @@
- + Index: branches/5.2.x/admin_templates/discounts/coupons_list.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/discounts/coupons_list.tpl (.../coupons_list.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/discounts/coupons_list.tpl (.../coupons_list.tpl) (revision 14089) @@ -59,7 +59,7 @@ - + Index: branches/5.2.x/units/orders/orders_tag_processor.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 13845) +++ branches/5.2.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 14089) @@ -1,6 +1,6 @@ Application->RecallVar('sqe_errors'); + + if (!$sqe_errors) { + return ''; + } + $o = ''; - $ses_usps_erros = Array(); - $ses_usps_erros = unserialize($this->Application->RecallVar('usps_errors')); - if ( count($ses_usps_erros) > 0 && is_array($ses_usps_erros)) { - foreach ( $ses_usps_erros as $order_number => $error_description ) { - $block_params = Array(); - $block_params['name'] = $params['render_as']; - $block_params['order_number'] = $order_number; - $block_params['error_description'] = $error_description; - $o.=$this->Application->ParseBlock($block_params, 1); - } - $this->Application->RemoveVar('usps_errors'); + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $params['render_as']; + $sqe_errors = unserialize($sqe_errors); + + foreach ($sqe_errors as $order_number => $error_description) { + $block_params['order_number'] = $order_number; + $block_params['error_description'] = $error_description; + + $o .= $this->Application->ParseBlock($block_params); } + $this->Application->RemoveVar('sqe_errors'); + return $o; } Index: branches/5.2.x/admin_templates/products/products_pricing_grid.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/products/products_pricing_grid.tpl (.../products_pricing_grid.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/products/products_pricing_grid.tpl (.../products_pricing_grid.tpl) (revision 14089) @@ -69,17 +69,17 @@ "> - + - + - + - + - + @@ -89,14 +89,14 @@ - - - - + + + + - +
Index: branches/5.2.x/units/sections/section_eh.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/sections/section_eh.php (.../section_eh.php) (revision 13845) +++ branches/5.2.x/units/sections/section_eh.php (.../section_eh.php) (revision 14089) @@ -1,6 +1,6 @@ Application->setUnitOption($event->MasterEvent->Prefix, 'Grids', $grids); - if (!$this->Application->isAdmin) { + if (!$this->Application->isAdmin && is_object($this->Application->siteDomain)) { // re-configure object, because it's recalled before kUnitConfigReader::AfterConfigRead is called $this->Application->siteDomain->defineFields(); } Index: branches/5.2.x/admin_templates/reports/reports.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/reports/reports.tpl (.../reports.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/reports/reports.tpl (.../reports.tpl) (revision 14089) @@ -27,13 +27,13 @@ - - +
+ - - + + - - + - - + @@ -89,131 +87,123 @@
: ')">
- + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - + - - - - + + + + - - - - - - - + + + - - - + + + - - + + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - + - - - - + + + + - - - - - - - + + + - - + + - - + + - + - + - + - - + + - - + + - - + + - + - +
- " id="" value=""> - / - " id="" value=""> -
+ " id="" value=""> + / + " id="" value=""> +
- / -
+ / +
Index: branches/5.2.x/admin_templates/payment_type/payment_type_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/payment_type/payment_type_edit.tpl (.../payment_type_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/payment_type/payment_type_edit.tpl (.../payment_type_edit.tpl) (revision 14089) @@ -55,15 +55,15 @@
- - - - - - - - - + + + + + + + + +
Index: branches/5.2.x/admin_templates/currencies/currencies_edit.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/currencies/currencies_edit.tpl (.../currencies_edit.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/currencies/currencies_edit.tpl (.../currencies_edit.tpl) (revision 14089) @@ -55,40 +55,32 @@
- - - + + + - - - - - - - + + + - - - - - - - + + + - + - - - - + + + +
- - - 1 = ? -
+ + + 1 = ? +
- - - -
+ + + +
Index: branches/5.2.x/admin_templates/shipping/shipping_costs.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/shipping/shipping_costs.tpl (.../shipping_costs.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/shipping/shipping_costs.tpl (.../shipping_costs.tpl) (revision 14089) @@ -94,28 +94,6 @@ - - - - -  ,  - - - - - " id="" value="" onclick="reflect_toolbar('', , '')"> @@ -171,16 +149,34 @@
- - - - + + + + + + + +
+  ,  +
- +
Index: branches/5.2.x/admin_templates/discounts/gift_certificate_list.tpl =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/admin_templates/discounts/gift_certificate_list.tpl (.../gift_certificate_list.tpl) (revision 13845) +++ branches/5.2.x/admin_templates/discounts/gift_certificate_list.tpl (.../gift_certificate_list.tpl) (revision 14089) @@ -46,7 +46,7 @@ - +