Index: branches/5.1.x/install/upgrades.sql
===================================================================
diff -u -r13672 -r13745
--- branches/5.1.x/install/upgrades.sql (.../upgrades.sql) (revision 13672)
+++ branches/5.1.x/install/upgrades.sql (.../upgrades.sql) (revision 13745)
@@ -135,6 +135,12 @@
# ===== v 5.0.3 =====
+# ===== v 5.0.4-B1 =====
+
+# ===== v 5.0.4-B2 =====
+
+# ===== v 5.0.4 =====
+
# ===== v 5.1.0-B1 =====
UPDATE Modules SET Path = 'modules/in-commerce/' WHERE `Name` = 'In-Commerce';
Index: branches/5.1.x/units/product_option_combinations/product_option_combinations_event_handler.php
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/units/product_option_combinations/product_option_combinations_event_handler.php (.../product_option_combinations_event_handler.php) (revision 13100)
+++ branches/5.1.x/units/product_option_combinations/product_option_combinations_event_handler.php (.../product_option_combinations_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
Create($event->getEventParam('ForceCreateId')) )
{
- if( $object->IsTempTable() ) $object->setTempID();
$this->customProcessing($event,'after');
$event->status=erSUCCESS;
}
Index: branches/5.1.x/units/destinations/dst_event_handler.php
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/units/destinations/dst_event_handler.php (.../dst_event_handler.php) (revision 13100)
+++ branches/5.1.x/units/destinations/dst_event_handler.php (.../dst_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
- if( $object->Create() )
- {
- if( $object->IsTempTable() ) $object->setTempID();
+ if ( $object->Create() ) {
$this->customProcessing($event, 'after');
- $event->status=erSUCCESS;
+ $event->status = erSUCCESS;
}
- else
- {
- $event->status=erFAIL;
- $event->redirect=false;
+ else {
+ $event->status = erFAIL;
+ $event->redirect = false;
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$object->setID(0);
}
@@ -106,7 +103,6 @@
$object->SetDBField('StdDestId', $dest_id);
$object->SetDBField('DestValue', $dest_value);
$object->Create();
- $object->setTempID();
}
}
Index: branches/5.1.x/units/taxesdestinations/taxes_dst_event_handler.php
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/units/taxesdestinations/taxes_dst_event_handler.php (.../taxes_dst_event_handler.php) (revision 13100)
+++ branches/5.1.x/units/taxesdestinations/taxes_dst_event_handler.php (.../taxes_dst_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
SetFieldsFromHash($field_values);
$this->customProcessing($event,'before');
- if( $object->Create() )
- {
- if( $object->IsTempTable() ) $object->setTempID();
+ if ( $object->Create() ) {
$this->customProcessing($event,'after');
- $event->status=erSUCCESS;
+ $event->status = erSUCCESS;
}
- else
- {
- $event->status=erFAIL;
- $event->redirect=false;
+ else {
+ $event->status = erFAIL;
+ $event->redirect = false;
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$object->setID(0);
}
@@ -155,7 +152,6 @@
$object->SetDBField('StdDestId', $dest_id);
$object->SetDBField('DestValue', $dest_value);
$object->Create();
- $object->setTempID();
}
}
Index: branches/5.1.x/units/coupon_items/coupon_items_event_handler.php
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/units/coupon_items/coupon_items_event_handler.php (.../coupon_items_event_handler.php) (revision 13100)
+++ branches/5.1.x/units/coupon_items/coupon_items_event_handler.php (.../coupon_items_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
SetDBField('ItemResourceId', -1);
$object->SetDBField('ItemType', 0);
- if( $object->Create() )
- {
- if( $object->IsTempTable() ) $object->setTempID();
+ if ( $object->Create() ) {
$this->customProcessing($event, 'after');
- $event->status=erSUCCESS;
+ $event->status = erSUCCESS;
$event->redirect_params = Array('opener' => 's'); //stay!
}
- else
- {
- $event->status=erFAIL;
+ else {
+ $event->status = erFAIL;
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$object->setID(0);
}
Index: branches/5.1.x/units/discount_items/discount_items_event_handler.php
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/units/discount_items/discount_items_event_handler.php (.../discount_items_event_handler.php) (revision 13100)
+++ branches/5.1.x/units/discount_items/discount_items_event_handler.php (.../discount_items_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
SetDBField('ItemResourceId', $resource_id);
$object->SetDBField('ItemType', 1);
$object->Create();
- $object->setTempID();
}
}
$this->finalizePopup($event);
@@ -108,16 +107,13 @@
$object->SetDBField('ItemResourceId', -1);
$object->SetDBField('ItemType', 0);
- if( $object->Create() )
- {
- if( $object->IsTempTable() ) $object->setTempID();
+ if ( $object->Create() ) {
$this->customProcessing($event,'after');
- $event->status=erSUCCESS;
+ $event->status = erSUCCESS;
$event->redirect_params = Array('opener' => 's'); //stay!
}
- else
- {
- $event->status=erFAIL;
+ else {
+ $event->status = erFAIL;
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$object->setID(0);
}
Index: branches/5.1.x/units/shipping_costs/shipping_costs_event_handler.php
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/units/shipping_costs/shipping_costs_event_handler.php (.../shipping_costs_event_handler.php) (revision 13100)
+++ branches/5.1.x/units/shipping_costs/shipping_costs_event_handler.php (.../shipping_costs_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
SetFieldsFromHash($field_values);
$this->customProcessing($event,'before');
- if( $object->Create() )
- {
- if ( $object->IsTempTable() ) $object->setTempID();
+ if( $object->Create() ) {
$this->customProcessing($event,'after');
- $event->status=erSUCCESS;
+ $event->status = erSUCCESS;
}
- else
- {
- $event->status=erFAIL;
- $event->redirect=false;
+ else {
+ $event->status = erFAIL;
+ $event->redirect = false;
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$object->setID(0);
}
Index: branches/5.1.x/units/orders/orders_event_handler.php
===================================================================
diff -u -r13578 -r13745
--- branches/5.1.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 13578)
+++ branches/5.1.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
Special == 'last') {
// return last order id (for using on thank you page)
- return $this->Application->RecallVar('front_order_id');
+ $order_id = $this->Application->RecallVar('front_order_id');
+
+ return $order_id > 0 ? $order_id : FAKE_ORDER_ID; // FAKE_ORDER_ID helps to keep parent filter for order items set in "kDBList::linkToParent"
}
$ses_id = $this->Application->RecallVar( $event->getPrefixSpecial(true) . '_id' );
@@ -1093,7 +1095,7 @@
$object->SetDBField('Number', $this->getNextOrderNumber($event));
$object->SetDBField('SubNumber', 0);
- $object->SetDBField('Type', ORDER_STATUS_INCOMPLETE);
+ $object->SetDBField('Status', ORDER_STATUS_INCOMPLETE);
$object->SetDBField('VisitId', $this->Application->RecallVar('visit_id') );
// get user
@@ -2644,7 +2646,6 @@
$item_data = $passed_item_data;
$object->SetDBField('ItemData', serialize($item_data));
$object->Create();
- if( $this->UseTempTables($event) ) $object->SetTempId();
}
else {
return false; // item requiring to set qty to 0, meaning already does not exist
@@ -2794,9 +2795,6 @@
}
else {
$object->Create();
- if ($this->UseTempTables($event)) {
- $object->setTempID();
- }
}
$this->Application->HandleEvent($ord_event, 'ord:OnRecalculateItems');
Index: branches/5.1.x/units/products/products_event_handler.php
===================================================================
diff -u -r13578 -r13745
--- branches/5.1.x/units/products/products_event_handler.php (.../products_event_handler.php) (revision 13578)
+++ branches/5.1.x/units/products/products_event_handler.php (.../products_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
'.$field_values['ProductName'].' (id: '.$field_values['ProductId'].')');
+ trigger_error('Invalid product '.$field_values['ProductName'].' (id: '.$field_values['ProductId'].')', E_USER_WARNING);
return false;
}
@@ -904,9 +904,9 @@
$has_required = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$opt_object->TableName.' WHERE Required = 1 AND ProductId = '.$object->GetDBField('ProductId'));
//we need to imitate data sumbit, as parent' PreSave sets object values from $items_info
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- $items_info[$object->GetDBField('ProductId')]['HasRequiredOptions'] = $has_required ? 1:0;
+ $items_info[$object->GetDBField('ProductId')]['HasRequiredOptions'] = $has_required ? '1' : '0';
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
- $object->SetDBField('HasRequiredOptions', $has_required ? 1:0);
+ $object->SetDBField('HasRequiredOptions', $has_required ? 1 : 0);
}
/**
@@ -944,11 +944,8 @@
$field_values = Array('ProductId' => $product_id, 'IsPrimary' => 1, 'MinQty' => 1, 'MaxQty' => -1, 'GroupId'=>$group_id);
$pr_object->SetDBFieldsFromHash($field_values);
$pr_object->SetField('Price', $price);
- $ret = $pr_object->Create();
- if ($pr_object->mode == 't') {
- $pr_object->setTempID();
- }
- return $ret;
+
+ return $pr_object->Create();
}
}
Index: branches/5.1.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl (.../affiliate_plans_brackets.tpl) (revision 13100)
+++ branches/5.1.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl (.../affiliate_plans_brackets.tpl) (revision 13745)
@@ -35,19 +35,19 @@
{
submit_event('apbrackets', 'OnMoreBrackets')
}
- a_toolbar.AddButton( new ToolBarButton('more_brackets', '', add_brackets) );
+ a_toolbar.AddButton( new ToolBarButton('in-commerce:more_brackets', '', add_brackets) );
function infinity()
{
submit_event('apbrackets', 'OnInfinity');
}
- a_toolbar.AddButton( new ToolBarButton('infinity', '', infinity) );
+ a_toolbar.AddButton( new ToolBarButton('in-commerce:infinity', '', infinity) );
function arrange_brackets()
{
submit_event('apbrackets', 'OnArrange')
}
- a_toolbar.AddButton( new ToolBarButton('arrange', '', arrange_brackets) );
+ a_toolbar.AddButton( new ToolBarButton('in-commerce:arrange', '', arrange_brackets) );
a_toolbar.Render();
Index: branches/5.1.x/units/order_items/order_items_tag_processor.php
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/units/order_items/order_items_tag_processor.php (.../order_items_tag_processor.php) (revision 13100)
+++ branches/5.1.x/units/order_items/order_items_tag_processor.php (.../order_items_tag_processor.php) (revision 13745)
@@ -1,6 +1,6 @@
Application->recallObject('p', 'p', Array('skip_autoload' => true));
/* @var $product_object kCatDBItem */
- $product_id = $product_object->GetID();
+ $product_id = $product_object->GetID();
+ $product_id_get = $this->Application->GetVar('p_id');
while (!$list->EOL()) {
// load product used in orderitem
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
+ $this->Application->SetVar('p_id', $list->GetDBField('ProductId'));
$product_object->Load( $list->GetDBField('ProductId') ); // correct product load
$this->Application->SetVar('m_cat_id', $product_object->GetDBField('CategoryId'));
@@ -226,6 +228,7 @@
}
// restore IDs used in cycle
+ $this->Application->SetVar('p_id', $product_id_get);
$this->Application->DeleteVar($this->getPrefixSpecial().'_id');
$product_object->Load($product_id);
Index: branches/5.1.x/units/orders/orders_tag_processor.php
===================================================================
diff -u -r13578 -r13745
--- branches/5.1.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 13578)
+++ branches/5.1.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 13745)
@@ -1,6 +1,6 @@
getObject($params);
- if ($object->GetDBField('Status') != ORDER_STATUS_INCOMPLETE) {
+ if ($object->GetDBField('Status') != ORDER_STATUS_INCOMPLETE || $object->GetID() == FAKE_ORDER_ID) {
return 0;
}
@@ -183,7 +183,7 @@
{
$object =& $this->getObject($params);
- if ($object->GetDBField('Status') != ORDER_STATUS_INCOMPLETE) {
+ if ($object->GetDBField('Status') != ORDER_STATUS_INCOMPLETE || $object->GetID() == FAKE_ORDER_ID) {
return 0;
}
Index: branches/5.1.x/units/pricing/pricing_event_handler.php
===================================================================
diff -u -r13110 -r13745
--- branches/5.1.x/units/pricing/pricing_event_handler.php (.../pricing_event_handler.php) (revision 13110)
+++ branches/5.1.x/units/pricing/pricing_event_handler.php (.../pricing_event_handler.php) (revision 13745)
@@ -1,6 +1,6 @@
Create() )
{
- $object->setTempID();
$event->status=erSUCCESS;
}
}
Index: branches/5.1.x/units/products/products_config.php
===================================================================
diff -u -r13632 -r13745
--- branches/5.1.x/units/products/products_config.php (.../products_config.php) (revision 13632)
+++ branches/5.1.x/units/products/products_config.php (.../products_config.php) (revision 13745)
@@ -1,6 +1,6 @@
TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
'ParentPath' => TABLE_PREFIX.'Category.ParentPath',
'Manufacturer' => TABLE_PREFIX.'Manufacturers.Name',
- 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
+ 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
+ 'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath',
'FileSize' => 'files.Size',
'FilePath' => 'files.FilePath',
'FileVersion' => 'files.Version',
@@ -404,25 +405,28 @@
'FilePath' => 'files.FilePath',
'FileVersion' => 'files.Version',
'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
+ 'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath',
),
),
+ 'CacheModRewrite' => true,
+
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalGroup ON '.TABLE_PREFIX.'PortalGroup.GroupId = %1$s.AccessGroupId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
- LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
- LEFT JOIN '.TABLE_PREFIX.'ProductFiles files ON files.ProductId = %1$s.ProductId AND files.IsPrimary = 1
- LEFT JOIN '.TABLE_PREFIX.'ProductsPricing pricing ON pricing.ProductId = %1$s.ProductId AND pricing.IsPrimary = 1
+ LEFT JOIN '.TABLE_PREFIX.'%3$sImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
+ LEFT JOIN '.TABLE_PREFIX.'%3$sProductFiles files ON files.ProductId = %1$s.ProductId AND files.IsPrimary = 1
+ LEFT JOIN '.TABLE_PREFIX.'%3$sProductsPricing pricing ON pricing.ProductId = %1$s.ProductId AND pricing.IsPrimary = 1
LEFT JOIN '.TABLE_PREFIX.'Manufacturers ON '.TABLE_PREFIX.'Manufacturers.ManufacturerId = %1$s.ManufacturerId
LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sProductsCustomData cust ON %1$s.ResourceId = cust.ResourceId',
'showall' => 'SELECT %1$s.* %2$s FROM %1$s
- LEFT JOIN '.TABLE_PREFIX.'ProductsPricing pricing ON pricing.ProductId = %1$s.ProductId AND pricing.IsPrimary = 1
- LEFT JOIN '.TABLE_PREFIX.'ProductFiles files ON files.ProductId = %1$s.ProductId AND files.IsPrimary = 1
+ LEFT JOIN '.TABLE_PREFIX.'%3$sProductsPricing pricing ON pricing.ProductId = %1$s.ProductId AND pricing.IsPrimary = 1
+ LEFT JOIN '.TABLE_PREFIX.'%3$sProductFiles files ON files.ProductId = %1$s.ProductId AND files.IsPrimary = 1
LEFT JOIN '.TABLE_PREFIX.'Manufacturers ON '.TABLE_PREFIX.'Manufacturers.ManufacturerId = %1$s.ManufacturerId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
@@ -440,9 +444,9 @@
LEFT JOIN '.TABLE_PREFIX.'PortalGroup pg ON pg.GroupId = %1$s.AccessGroupId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
- LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
- LEFT JOIN '.TABLE_PREFIX.'ProductFiles files ON files.ProductId = %1$s.ProductId AND files.IsPrimary = 1
- LEFT JOIN '.TABLE_PREFIX.'ProductsPricing pricing ON pricing.ProductId = %1$s.ProductId AND pricing.IsPrimary = 1
+ LEFT JOIN '.TABLE_PREFIX.'%3$sImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
+ LEFT JOIN '.TABLE_PREFIX.'%3$sProductFiles files ON files.ProductId = %1$s.ProductId AND files.IsPrimary = 1
+ LEFT JOIN '.TABLE_PREFIX.'%3$sProductsPricing pricing ON pricing.ProductId = %1$s.ProductId AND pricing.IsPrimary = 1
LEFT JOIN '.TABLE_PREFIX.'Manufacturers ON '.TABLE_PREFIX.'Manufacturers.ManufacturerId = %1$s.ManufacturerId
LEFT JOIN '.TABLE_PREFIX.'%3$sProductsCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
Index: branches/5.1.x/admin_templates/products/products_pricing.tpl
===================================================================
diff -u -r13100 -r13745
--- branches/5.1.x/admin_templates/products/products_pricing.tpl (.../products_pricing.tpl) (revision 13100)
+++ branches/5.1.x/admin_templates/products/products_pricing.tpl (.../products_pricing.tpl) (revision 13745)
@@ -13,24 +13,19 @@