tiki-minical_reminders.php 984 Bytes
Newer Older
awcolley's avatar
awcolley committed
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
changi67's avatar
changi67 committed
6
// 
7 8
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9
// $Id$
changi67's avatar
changi67 committed
10

changi67's avatar
changi67 committed
11
include_once ("lib/init/initlib.php");
12 13
include_once ('tiki-setup_base.php');
include_once ('lib/minical/minicallib.php');
14
$access->check_feature('feature_minical');
changi67's avatar
changi67 committed
15
if (!$prefs['minical_reminders']) die;
awcolley's avatar
awcolley committed
16
//$refresh=$_REQUEST['refresh']*1000;
17
$refresh = 1000 * 60 * 1;
18
$evs = $minicallib->minical_get_events_to_remind($user, $prefs['minical_reminders']);
19
foreach ($evs as $ev) {
changi67's avatar
changi67 committed
20
	$command = "<script type='text/javascript'>alert('event " . $ev['title'] . " will start at " . date("h:i", $ev['start']) . "');</script>";
21 22
	print ($command);
	$minicallib->minical_event_reminded($user, $ev['eventId']);
awcolley's avatar
awcolley committed
23
}
24
print ('<body onload="window.setInterval(\'location.reload()\',' . $refresh . ');">');