Changeset View
Changeset View
Standalone View
Standalone View
modules/in-commerce/units/addresses/addresses_event_handler.php
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
protected function OnBeforeItemUpdate(kEvent $event) | protected function OnBeforeItemUpdate(kEvent $event) | ||||
{ | { | ||||
parent::OnBeforeItemUpdate($event); | parent::OnBeforeItemUpdate($event); | ||||
$object = $event->getObject(); | $object = $event->getObject(); | ||||
/* @var $object kDBItem */ | /* @var $object kDBItem */ | ||||
if ( !$object->isLoaded() || !$this->checkItemStatus($event) ) { | if ( !$object->isLoaded() || ($this->Application->isWebRequest() && !$this->checkItemStatus($event)) ) { | ||||
Lint: Generic.WhiteSpace.ScopeIndent.IncorrectExact: Line indented incorrectly; expected 2 tabs, found 3 | |||||
// not trivially loaded object OR not current user address | // Not trivially loaded object OR not current user address. | ||||
$event->status = kEvent::erPERM_FAIL; | $event->status = kEvent::erPERM_FAIL; | ||||
return ; | return ; | ||||
} | } | ||||
$cs_helper = $this->Application->recallObject('CountryStatesHelper'); | $cs_helper = $this->Application->recallObject('CountryStatesHelper'); | ||||
/* @var $cs_helper kCountryStatesHelper */ | /* @var $cs_helper kCountryStatesHelper */ | ||||
$cs_helper->CheckStateField($event, 'State', 'Country'); | $cs_helper->CheckStateField($event, 'State', 'Country'); | ||||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
protected function OnBeforeItemDelete(kEvent $event) | protected function OnBeforeItemDelete(kEvent $event) | ||||
{ | { | ||||
parent::OnBeforeItemDelete($event); | parent::OnBeforeItemDelete($event); | ||||
$object = $event->getObject(); | $object = $event->getObject(); | ||||
/* @var $object kDBItem */ | /* @var $object kDBItem */ | ||||
if ( !$object->isLoaded() || !$this->checkItemStatus($event) ) { | if ( !$object->isLoaded() || ($this->Application->isWebRequest() && !$this->checkItemStatus($event)) ) { | ||||
Line indented incorrectly; expected 2 tabs, found 3 Lint: Generic.WhiteSpace.ScopeIndent.IncorrectExact: Line indented incorrectly; expected 2 tabs, found 3 | |||||
// not trivially loaded object OR not current user address | // Not trivially loaded object OR not current user address. | ||||
$event->status = kEvent::erPERM_FAIL; | $event->status = kEvent::erPERM_FAIL; | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Sets default country for new addresses to Latvia | * Sets default country for new addresses to Latvia | ||||
* | * | ||||
Show All 39 Lines | |||||
)); | )); | ||||
$config->addEditTabPresetTabs('Default', Array ( | $config->addEditTabPresetTabs('Default', Array ( | ||||
'addresses' => Array ( | 'addresses' => Array ( | ||||
'title' => 'la_tab_Addresses', 't' => 'in-commerce/users/user_edit_addresses', 'priority' => 6 | 'title' => 'la_tab_Addresses', 't' => 'in-commerce/users/user_edit_addresses', 'priority' => 6 | ||||
) | ) | ||||
)); | )); | ||||
} | } | ||||
} | } | ||||
Line indented incorrectly; expected 0 tabs, found 1 Lint: Generic.WhiteSpace.ScopeIndent.IncorrectExact: Line indented incorrectly; expected 0 tabs, found 1 | |||||
Expected 0 spaces before closing brace; 4 found Lint: CodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBrace: Expected 0 spaces before closing brace; 4 found | |||||
No newline at end of file |
Line indented incorrectly; expected 2 tabs, found 3