Hi there
In the setting "Handle Old Evens" I have the choice between:
- Do nothing
- Delete old events
- Archive old events
- Trash old events
I would like to add
- Deactivate old events
or
- Unpublish old events
This is usefull when I want to reuse the events, but I want to prevent visitors to still find them in the archive.
As I can see this an easy change:
in
components/com_jem/helpers/helper.php add after line 266 (//Set state trashed of outdated events) and before line 268 (// Set timestamp of last cleanup)
//Set state unpublished of outdated events
if ($jemsettings->oldevent == 4) {
$query = 'UPDATE #__jem_events SET published = 0 WHERE dates > 0 AND '
.' DATE_SUB(NOW(), INTERVAL '.(int)$jemsettings->minus.' DAY) > (IF (enddates IS NOT NULL, enddates, dates)) '
.' AND published = 1';
$db->SetQuery($query);
$db->execute();
}
in
administrator/components/com_jem/models/forms/settings.xml after line 323 (<option value="1">COM_JEM_DELETE_OLD_EVENTS</option>)
add
<option value="4">COM_JEM_UNPUBLISH_OLD_EVENTS</option>
and in the language file
administrator/components/com_jem/language/en-GB/en-GB.com_jem.ini add after line 848 (COM_JEM_TRASH_OLD_EVENTS="Trash old events")
add
COM_JEM_UNPUBLISH_OLD_EVENTS="Unpublish old events"
The only thing I couldn't figure out in this quick hack is where to modify the javascript that it displays the connected field "number of days" …