Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/db/cat_event_handler.php
Show First 20 Lines • Show All 901 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
} | } | ||||
// change category | // change category | ||||
$target_category = $object->GetDBField('CategoryId'); | $target_category = $object->GetDBField('CategoryId'); | ||||
if ( $object->GetOriginalField('CategoryId') != $target_category ) { | if ( $object->GetOriginalField('CategoryId') != $target_category ) { | ||||
$object->MoveToCat($target_category); | $object->MoveToCat($target_category); | ||||
} | } | ||||
if ( $object->GetChangedFields() ) { | |||||
$now = adodb_mktime(); | |||||
$object->SetDBField('Modified_date', $now); | |||||
$object->SetDBField('Modified_time', $now); | |||||
$object->SetDBField('ModifiedById', $this->Application->RecallVar('user_id')); | |||||
} | |||||
} | } | ||||
/** | /** | ||||
* Occurs after loading item, 'id' parameter | * Occurs after loading item, 'id' parameter | ||||
* allows to get id of item that was loaded | * allows to get id of item that was loaded | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
* @return void | * @return void | ||||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | |||||
FROM ' . $this->Application->getUnitOption('ci', 'TableName') . ' | FROM ' . $this->Application->getUnitOption('ci', 'TableName') . ' | ||||
WHERE ItemResourceId = ' . $object->GetDBField('ResourceId') . ' AND PrimaryCat = 1'; | WHERE ItemResourceId = ' . $object->GetDBField('ResourceId') . ' AND PrimaryCat = 1'; | ||||
$primary_category = $this->Conn->GetOne($sql); | $primary_category = $this->Conn->GetOne($sql); | ||||
if ( $primary_category == $recycle_bin ) { | if ( $primary_category == $recycle_bin ) { | ||||
$event->CallSubEvent('OnAfterItemDelete'); | $event->CallSubEvent('OnAfterItemDelete'); | ||||
} | } | ||||
} | } | ||||
if ( $object->GetChangedFields() ) { | |||||
$now = adodb_mktime(); | |||||
$object->SetDBField('Modified_date', $now); | |||||
$object->SetDBField('Modified_time', $now); | |||||
$object->SetDBField('ModifiedById', $this->Application->RecallVar('user_id')); | |||||
} | |||||
} | } | ||||
/** | /** | ||||
* Sets values for import process | * Sets values for import process | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
▲ Show 20 Lines • Show All 2068 Lines • Show Last 20 Lines |