Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/orders/orders_event_handler.php
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | |||||
// user can't change status by himself | // user can't change status by himself | ||||
return false; | return false; | ||||
} | } | ||||
if ( $order_dummy->GetDBField($status_field) != ORDER_STATUS_INCOMPLETE ) { | if ( $order_dummy->GetDBField($status_field) != ORDER_STATUS_INCOMPLETE ) { | ||||
// user can't edit orders being processed | // user can't edit orders being processed | ||||
return false; | return false; | ||||
} | } | ||||
if ( $event->Name == 'OnUpdate' ) { | |||||
// all checks were ok -> it's user's order -> allow to modify | |||||
return true; | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
if ( $event->Name == 'OnQuietPreSave' ) { | if ( $event->Name == 'OnQuietPreSave' ) { | ||||
$section = $event->getSection(); | $section = $event->getSection(); | ||||
if ( $this->isNewItemCreate($event) ) { | if ( $this->isNewItemCreate($event) ) { | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
'OnUpdateCartJSON' => Array('self' => true), | 'OnUpdateCartJSON' => Array('self' => true), | ||||
'OnUpdateItemOptions' => Array('self' => true), | 'OnUpdateItemOptions' => Array('self' => true), | ||||
'OnCleanupCart' => Array('self' => true), | 'OnCleanupCart' => Array('self' => true), | ||||
'OnContinueShopping' => Array('self' => true), | 'OnContinueShopping' => Array('self' => true), | ||||
'OnCheckout' => Array('self' => true), | 'OnCheckout' => Array('self' => true), | ||||
'OnSelectAddress' => Array('self' => true), | 'OnSelectAddress' => Array('self' => true), | ||||
'OnProceedToBilling' => Array('self' => true), | 'OnProceedToBilling' => Array('self' => true), | ||||
'OnProceedToPreview' => Array('self' => true), | 'OnProceedToPreview' => Array('self' => true), | ||||
'OnProceedToPreviewAjax' => array('self' => true), | |||||
'OnCompleteOrder' => Array('self' => true), | 'OnCompleteOrder' => Array('self' => true), | ||||
'OnUpdate' => array('self' => true), | |||||
'OnUpdateAjax' => Array('self' => true), | 'OnUpdateAjax' => Array('self' => true), | ||||
'OnRemoveCoupon' => Array('self' => true), | 'OnRemoveCoupon' => Array('self' => true), | ||||
'OnRemoveGiftCertificate' => Array('self' => true), | 'OnRemoveGiftCertificate' => Array('self' => true), | ||||
'OnCancelRecurring' => Array('self' => true), | 'OnCancelRecurring' => Array('self' => true), | ||||
'OnAddVirtualProductToCart' => Array('self' => true), | 'OnAddVirtualProductToCart' => Array('self' => true), | ||||
'OnItemBuild' => Array('self' => true), | 'OnItemBuild' => Array('self' => true), | ||||
▲ Show 20 Lines • Show All 3934 Lines • ▼ Show 20 Line(s) | |||||
$object->SetError('BillingEmail', 'unique'); | $object->SetError('BillingEmail', 'unique'); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Performs order update and returns results in format, needed by FormManager | * Performs order update and returns results in format, needed by FormManager | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event Event. | ||||
* | |||||
* @return void | |||||
*/ | */ | ||||
function OnUpdateAjax($event) | protected function OnUpdateAjax(kEvent $event) | ||||
{ | { | ||||
/** @var AjaxFormHelper $ajax_form_helper */ | |||||
$ajax_form_helper = $this->Application->recallObject('AjaxFormHelper'); | $ajax_form_helper = $this->Application->recallObject('AjaxFormHelper'); | ||||
/* @var $ajax_form_helper AjaxFormHelper */ | |||||
$ajax_form_helper->transitEvent($event, 'OnUpdate'); | $ajax_form_helper->transitEvent($event, 'OnUpdate'); | ||||
} | } | ||||
/** | |||||
* Performs order update after billing step submission and returns results in format, needed by FormManager | |||||
* | |||||
* @param kEvent $event Event. | |||||
* | |||||
* @return void | |||||
*/ | |||||
protected function OnProceedToPreviewAjax(kEvent $event) | |||||
{ | |||||
/** @var AjaxFormHelper $ajax_form_helper */ | |||||
$ajax_form_helper = $this->Application->recallObject('AjaxFormHelper'); | |||||
$ajax_form_helper->transitEvent($event, 'OnProceedToPreview'); | |||||
} | |||||
} | } |