Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

todoview.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: todoview.php 8503 2001-11-19 09:37:02Z jhe $
5 //
6 // Definition of todo list.
7 //
8 // Created on: <04-Sep-2000 16:53:15 ce>
9 //
10 // This source file is part of Exponential Basic, publishing software.
11 //
12 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
28
29 // include_once( "classes/INIFile.php" );
30
31 $ini = eZINI::instance( 'site.ini' );
32 $Language = $ini->variable( "eZTodoMain", "Language" );
33
34 $lanugageIni = new eZINI( "kernel/eztodo/user/intl/" . $Language . "/todoview.php.ini", false );
35
36 // include_once( "classes/eztemplate.php" );
37 // include_once( "eztodo/classes/eztodo.php" );
38 // include_once( "eztodo/classes/ezcategory.php" );
39 // include_once( "eztodo/classes/ezpriority.php" );
40 // include_once( "eztodo/classes/ezstatus.php" );
41 // include_once( "classes/ezlocale.php" );
42 // include_once( "classes/ezdatetime.php" );
43
44 // include_once( "ezuser/classes/ezuser.php" );
45 // include_once( "ezuser/classes/ezpermission.php" );
46
47 $locale = new eZLocale( $Language );
48
49 // Setup template.
50 $t = new eZTemplate( "kernel/eztodo/user/" . $ini->variable( "eZTodoMain", "TemplateDir" ),
51 "kernel/eztodo/user/intl", $Language, "todoview.php" );
52 $t->setAllStrings();
53
54 $t->set_file( "todo_edit_page", "todoview.tpl" );
55
56 $t->set_block( "todo_edit_page", "category_select_tpl", "category_select" );
57 $t->set_block( "todo_edit_page", "priority_select_tpl", "priority_select" );
58 $t->set_block( "todo_edit_page", "status_select_tpl", "status_select" );
59 $t->set_block( "todo_edit_page", "todo_is_public_tpl", "todo_is_public" );
60 $t->set_block( "todo_edit_page", "todo_is_private_tpl", "todo_is_private" );
61 //$t->set_block( "todo_edit_page", "mark_as_done", "mark_done" );
62 $t->set_block( "todo_edit_page", "user_item_tpl", "user_item" );
63 $t->set_block( "todo_edit_page", "deadline_tpl", "deadline" );
64
65 $t->set_block( "todo_edit_page", "list_logs_tpl", "list_logs" );
66 $t->set_block( "list_logs_tpl", "log_item_tpl", "log_item" );
67
68
69 $t->set_block( "todo_edit_page", "errors_tpl", "errors" );
70 $t->set_var( "errors", "&nbsp;" );
71 $t->set_var( "log_item", "&nbsp;" );
72 $t->set_var( "list_logs", "&nbsp;" );
73
74 $todo = new eZTodo();
75 $todo->get( $TodoID );
76
77 if ( $todo->IsPublic() )
78 {
79 $t->set_var( "todo_is_private", "" );
80 $t->parse( "todo_is_public", "todo_is_public_tpl" );
81 }
82 else
83 {
84 $t->set_var( "todo_is_private", "" );
85 $t->parse( "todo_is_public", "todo_is_private_tpl" );
86 }
87
88 $t->set_var( "todo_name", $todo->name() );
89 $t->set_var( "todo_description", $todo->description() );
90 $t->set_var( "todo_id", $todo->id() );
91
92 $logs = $todo->logs();
93
94 if ( is_array( $logs ) && count( $logs ) > 0 )
95 {
96 foreach ( $logs as $log )
97 {
98 $t->set_var( "log_view", $log->log() );
99 $t->set_var( "log_created", $locale->format( $log->created() ) );
100
101 $t->parse( "log_item", "log_item_tpl", true );
102 }
103 $t->parse( "list_logs", "list_logs_tpl" );
104 }
105
106 $owner = new eZUser( $todo->ownerID() );
107 $t->set_var( "first_name", $owner->firstName() );
108 $t->set_var( "last_name", $owner->lastName() );
109
110 $category = new eZCategory();
111 $category_array =& $category->getAll();
112
113 for ( $i = 0; $i < count( $category_array ); $i++ )
114 {
115 if ( $todo->categoryID() == $category_array[$i]->id() )
116 {
117 $t->set_var( "todo_category", $category_array[$i]->name() );
118 }
119 else
120 {
121 $t->set_var( "todo_category", "" );
122 }
123 $t->parse( "category_select", "category_select_tpl", true );
124 }
125
126 $priority = new eZPriority();
127 $priority_array =& $priority->getAll();
128
129 for ( $i = 0; $i < count( $priority_array ); $i++ )
130 {
131 if ( $todo->priorityID() == $priority_array[$i]->id() )
132 {
133 $t->set_var( "todo_priority", $priority_array[$i]->name() );
134 }
135 else
136 {
137 $t->set_var( "todo_priority", "" );
138 }
139 $t->parse( "priority_select", "priority_select_tpl", true );
140 }
141
142 $status = new eZStatus();
143 $status_array =& $status->getAll();
144
145 for ( $i = 0; $i < count( $status_array ); $i++ )
146 {
147 if ( $todo->statusID() == $status_array[$i]->id() )
148 {
149 $t->set_var( "todo_status", $status_array[$i]->name() );
150 }
151 else
152 {
153 $t->set_var( "todo_status", "" );
154 }
155 $t->parse( "status_select", "status_select_tpl", true );
156 }
157
158 $due = $todo->due();
159 if ( $due )
160 {
161 $duedate = new eZDate();
162 $duedate->setTimeStamp( $due->timeStamp() );
163 $locale = new eZLocale( $Language );
164 $t->set_var( "todo_deadline", $locale->format( $duedate ) );
165 $t->parse( "deadline", "deadline_tpl" );
166 }
167 else
168 {
169 $t->set_var( "deadline", "" );
170 }
171
172 $user = new eZUser( $todo->userID() );
173
174 $t->set_var( "user_id", $user->id() );
175 $t->set_var( "user_firstname", $user->firstName() );
176 $t->set_var( "user_lastname", $user->lastName() );
177
178 $t->pparse( "output", "todo_edit_page" );
179
180 ?>
$i
$i
Definition: admin/adlist.php:91
eZCategory
Definition: ezcategory.php:36
eZDate
Definition: ezdate.php:46
eZINI
Reads and writes .ini style configuration files.
eZLocale
Definition: ezlocale.php:119
eZPriority
Definition: ezpriority.php:35
eZStatus
Definition: ezstatus.php:36
eZTemplate
Definition: eztemplate.php:107
eZTodo
Definition: eztodo.php:39
eZUser
Definition: ezuser.php:76
$due
for( $i=0; $i< count( $status_array); $i++) $due
Definition: todoview.php:158
$owner
if(is_array( $logs) &&count( $logs) > 0) $owner
Definition: todoview.php:106
$status
for( $i=0; $i< count( $priority_array); $i++) $status
Definition: todoview.php:142
$category
$category
Definition: todoview.php:110
$logs
$logs
Definition: todoview.php:92
$lanugageIni
$lanugageIni
Definition: todoview.php:34
$priority_array
$priority_array
Definition: todoview.php:127
$locale
$locale
Definition: todoview.php:47
$t
$t
Definition: todoview.php:50
$user
$user
Definition: todoview.php:172
$category_array
$category_array
Definition: todoview.php:111
$priority
for( $i=0; $i< count( $category_array); $i++) $priority
Definition: todoview.php:126
$Language
$Language
Definition: todoview.php:32
$ini
$ini
Definition: todoview.php:31
$todo
$todo
Definition: todoview.php:74
$status_array
$status_array
Definition: todoview.php:143
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.