Changeset View
Changeset View
Standalone View
Standalone View
modules/in-link/units/listings/listings_event_handler.php
Show First 20 Lines • Show All 577 Lines • ▼ Show 20 Line(s) | |||||
parent::iterateItems($event); | parent::iterateItems($event); | ||||
// extend period for pending/renewal links (if owner has agreed) | // extend period for pending/renewal links (if owner has agreed) | ||||
if ( $event->Name == 'OnMassApprove' ) { | if ( $event->Name == 'OnMassApprove' ) { | ||||
$lst_object = $this->Application->recallObject('lst', null, Array ('skip_autoload' => true)); | $lst_object = $this->Application->recallObject('lst', null, Array ('skip_autoload' => true)); | ||||
/* @var $lst_object kDBItem */ | /* @var $lst_object kDBItem */ | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
$object->Clear(); | |||||
$object->Load($id); | $object->Load($id); | ||||
$sql = 'SELECT CreatedById | $sql = 'SELECT CreatedById | ||||
FROM ' . $this->Application->getUnitOption('l', 'TableName') . ' | FROM ' . $this->Application->getUnitOption('l', 'TableName') . ' | ||||
WHERE ResourceId = ' . $object->GetDBField('ItemResourceId'); | WHERE ResourceId = ' . $object->GetDBField('ItemResourceId'); | ||||
$owner_id = $this->Conn->GetOne($sql); | $owner_id = $this->Conn->GetOne($sql); | ||||
if ( $object->GetDBField('PendingRenewal') == 1 ) { | if ( $object->GetDBField('PendingRenewal') == 1 ) { | ||||
Show All 10 Lines | |||||
$object->SetDBField('ExpiresOn_date', $expiration_date); | $object->SetDBField('ExpiresOn_date', $expiration_date); | ||||
$object->SetDBField('ExpiresOn_time', $expiration_date); | $object->SetDBField('ExpiresOn_time', $expiration_date); | ||||
$object->SetDBField('RenewalReminderSent', 0); | $object->SetDBField('RenewalReminderSent', 0); | ||||
$object->SetDBField('PendingRenewal', 0); | $object->SetDBField('PendingRenewal', 0); | ||||
if ( $object->Update() ) { | if ( $object->Update() ) { | ||||
$event->status = kEvent::erSUCCESS; | $event->status = kEvent::erSUCCESS; | ||||
alex: Please remove this line.
---
Same changes was done in other, but not this place. | |||||
$event->SetRedirectParam('opener', 's'); | $event->SetRedirectParam('opener', 's'); | ||||
$this->Application->emailUser('LINK.ENHANCE.RENEW', $owner_id); | $this->Application->emailUser('LINK.ENHANCE.RENEW', $owner_id); | ||||
$this->Application->emailAdmin('LINK.ENHANCE.RENEW'); | $this->Application->emailAdmin('LINK.ENHANCE.RENEW'); | ||||
} | } | ||||
else { | |||||
$event->status = kEvent::erFAIL; | |||||
$event->redirect = false; | |||||
break; | |||||
} | |||||
} | } | ||||
else { | else { | ||||
$this->Application->emailUser('LINK.ENHANCE.APPROVE', $owner_id); | $this->Application->emailUser('LINK.ENHANCE.APPROVE', $owner_id); | ||||
$this->Application->emailAdmin('LINK.ENHANCE.APPROVE'); | $this->Application->emailAdmin('LINK.ENHANCE.APPROVE'); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 208 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
parent::OnAfterConfigRead($event); | parent::OnAfterConfigRead($event); | ||||
$language_id = $this->Application->GetVar('m_lang'); | $language_id = $this->Application->GetVar('m_lang'); | ||||
$calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields'); | $calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields'); | ||||
$calculated_fields['']['LinkName'] = 'CONCAT(item_table.l' . $language_id . '_Name, " (", item_table.Url, ")")'; | $calculated_fields['']['LinkName'] = 'CONCAT(item_table.l' . $language_id . '_Name, " (", item_table.Url, ")")'; | ||||
$this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields); | $this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |
Please remove this line.
Same changes was done in other, but not this place.