aboutsummaryrefslogtreecommitdiffstats
path: root/includes/todo.php
blob: 1cefcdce10dbd6edbf0eb459f8a8839cf8c4b3ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php 

define('BASE', '../');
include_once(BASE.'functions/init.inc.php');
include_once(BASE.'functions/date_functions.php');
require_once(BASE.'functions/template.php');
$current_view = 'todo';
$vtodo_array = unserialize(urldecode(base64_decode($_REQUEST['todo_data'])));

// Set the variables from the array
$vtodo_text		= (isset($vtodo_array['vtodo_text'])) ? $vtodo_array['vtodo_text'] : ('');
$description	= (isset($vtodo_array['description'])) ? $vtodo_array['description'] : ('');
$completed_date	= (isset($vtodo_array['completed_date'])) ? localizeDate ($dateFormat_day, strtotime($vtodo_array['completed_date'])) : ('');
$status			= (isset($vtodo_array['status'])) ? $vtodo_array['status'] : ('');
$calendar_name  = (isset($vtodo_array['cal'])) ? $vtodo_array['cal'] : ('');
$start_date 	= (isset($vtodo_array['start_date'])) ? localizeDate ($dateFormat_day, strtotime($vtodo_array['start_date'])) : ('');
$due_date 		= (isset($vtodo_array['due_date'])) ? localizeDate ($dateFormat_day, strtotime($vtodo_array['due_date'])) : ('');
$priority 		= (isset($vtodo_array['priority'])) ? $vtodo_array['priority'] : ('');

$cal_title_full = $calendar_name.' '.$lang['l_calendar'];
$description	= ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", '<a target="_new" href="\0">\0</a>', $description);
$vtodo_text		= ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$vtodo_text);


if ((!isset($status) || $status == "COMPLETED") && isset($completed_date)) {
	$status = $lang['l_completed_date'] . ' ' . $completed_date;
} elseif ($status == "COMPLETED") {
	$status = $lang['l_completed'];
} else {
	$status = $lang['l_unfinished'];
}

if ($priority >= 1 && $priority <= 4) {
	$priority = $lang['l_priority_high'];
} else if ($priority == 5) {
	$priority = $lang['l_priority_medium'];
} else if ($priority >= 6 && $priority <= 9) {
	$priority = $lang['l_priority_low'];
} else {
	$priority = $lang['l_priority_none'];
}

$page = new Page(BASE.'templates/'.$template.'/todo.tpl');

$page->replace_tags(array(
	'charset'			=> $phpiCal_config->charset,
	'cal' 				=> $cal_title_full,
	'vtodo_text' 		=> $vtodo_text,
	'description' 		=> $description,
	'priority'	 		=> $priority,
	'start_date' 		=> $start_date,
	'status'	 		=> $status,
	'due_date' 			=> $due_date,
	'cal_title_full'	=> $cal_title_full,
	'template'			=> $phpiCal_config->template,
	'l_created'			=> $lang['l_created'],
	'l_priority'		=> $lang['l_priority'],
	'l_status'			=> $lang['l_status'],
	'l_due'				=> $lang['l_due']
		
	));

$page->output();

?>

© 2014-2020 Faster IT GmbH | imprint | privacy policy