tiki-calendar_import.php 1.06 KB
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
rjsmelo's avatar
rjsmelo 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.
changi67's avatar
changi67 committed
9
// $Id$
10

11
$section = 'calendar';
rjsmelo's avatar
rjsmelo committed
12
require_once('tiki-setup.php');
lphuberdeau's avatar
lphuberdeau committed
13
$calendarlib = TikiLib::lib('calendar');
14

15 16
$access->check_feature('feature_calendar');
$access->check_permission('tiki_p_admin_calendar');
17 18

if (isset($_REQUEST["import"]) && isset($_REQUEST["calendarId"]) && isset($_FILES["fileCSV"])) {
rjsmelo's avatar
rjsmelo committed
19
	if ($calendarlib->importCSV($_FILES["fileCSV"]["tmp_name"], $_REQUEST["calendarId"])) {
20
		$smarty->assign('updated', "y");
rjsmelo's avatar
rjsmelo committed
21
	}
22 23 24 25
}
$calendars = $calendarlib->list_calendars(); // no check perm as p_admin only
$smarty->assign_by_ref('calendars', $calendars['data']);

rjsmelo's avatar
rjsmelo committed
26
include_once('tiki-section_options.php');
27

28 29 30
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');

31 32 33
// Display the template
$smarty->assign('mid', 'tiki-calendar_import.tpl');
$smarty->display("tiki.tpl");