Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/categories/categories_event_handler.php
Show First 20 Lines • Show All 1588 Lines • ▼ Show 20 Line(s) | |||||
if ( $object->Update() ) { | if ( $object->Update() ) { | ||||
if ( $propagate_category_status ) { | if ( $propagate_category_status ) { | ||||
$sql = 'UPDATE ' . $object->TableName . ' | $sql = 'UPDATE ' . $object->TableName . ' | ||||
SET ' . $status_field . ' = ' . $object->GetDBField($status_field) . ' | SET ' . $status_field . ' = ' . $object->GetDBField($status_field) . ' | ||||
WHERE TreeLeft BETWEEN ' . $object->GetDBField('TreeLeft') . ' AND ' . $object->GetDBField('TreeRight'); | WHERE TreeLeft BETWEEN ' . $object->GetDBField('TreeLeft') . ' AND ' . $object->GetDBField('TreeRight'); | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
} | } | ||||
$event->status = kEvent::erSUCCESS; | |||||
$email_event = $event->Name == 'OnMassApprove' ? 'CATEGORY.APPROVE' : 'CATEGORY.DENY'; | $email_event = $event->Name == 'OnMassApprove' ? 'CATEGORY.APPROVE' : 'CATEGORY.DENY'; | ||||
$this->Application->emailUser($email_event, $object->GetDBField('CreatedById')); | $this->Application->emailUser($email_event, $object->GetDBField('CreatedById')); | ||||
} | } | ||||
else { | |||||
$event->status = kEvent::erFAIL; | |||||
$event->redirect = false; | |||||
break; | |||||
} | |||||
} | } | ||||
} | } | ||||
$this->clearSelectedIDs($event); | $this->clearSelectedIDs($event); | ||||
$this->Application->StoreVar('RefreshStructureTree', 1); | $this->Application->StoreVar('RefreshStructureTree', 1); | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 1536 Lines • Show Last 20 Lines |