Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/buglist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: buglist.php 7766 2001-10-10 20:18:53Z fh $
5 //
6 // Created on: <04-Dec-2000 11:36:41 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30
31 // include_once( "ezbug/classes/ezbugcategory.php" );
32 // include_once( "ezbug/classes/ezbugmodule.php" );
33 // include_once( "ezbug/classes/ezbug.php" );
34
35 // include_once( "ezuser/classes/ezuser.php" );
36 // include_once( "ezuser/classes/ezpermission.php" );
37 // include_once( "ezuser/classes/ezobjectpermission.php" );
38
39 $ini =& eZINI::instance( 'site.ini' );
40
41 $Language = $ini->variable( "eZBugMain", "Language" );
42
43 $t = new eZTemplate( "kernel/ezbug/user/" . $ini->variable( "eZBugMain", "TemplateDir" ),
44 "kernel/ezbug/user/intl/", $Language, "buglist.php" );
45
46 $t->setAllStrings();
47
48 $t->set_file( array(
49 "bug_list_page_tpl" => "buglist.tpl"
50 ) );
51
52 // path
53 $t->set_block( "bug_list_page_tpl", "path_item_tpl", "path_item" );
54
55 // module
56 $t->set_block( "bug_list_page_tpl", "module_list_tpl", "module_list" );
57 $t->set_block( "module_list_tpl", "module_item_tpl", "module_item" );
58
59 // bug
60 $t->set_block( "bug_list_page_tpl", "bug_list_tpl", "bug_list" );
61 $t->set_block( "bug_list_tpl", "bug_item_tpl", "bug_item" );
62 $t->set_block( "bug_item_tpl", "bug_is_closed_tpl", "bug_is_closed" );
63 $t->set_block( "bug_item_tpl", "bug_is_open_tpl", "bug_is_open" );
64 $t->set_block( "bug_item_tpl", "bug_edit_tpl", "bug_edit" );
65
66 $t->set_block( "bug_list_page_tpl", "bug_edit_buttons_tpl", "bug_edit_buttons" );
67 $module = new eZBugModule( $ModuleID );
68
69 $t->set_var( "current_module_id", $module->id() );
70 $t->set_var( "current_module_name", $module->name() );
71 $t->set_var( "current_module_description", $module->description() );
72
73 // check user rights
74 $user =& eZUser::currentUser();
75 $gotRights = false;
76
77 if ( eZObjectPermission::hasPermission( $module->id(), "bug_module", "w", $user ) )
78 {
79 $gotRights = true;
80 }
81
82 // check if delete was pressed && if the user has rights to delete
83 if( isset( $Delete ) && $gotRights == true )
84 {
85 if( count( $BugArrayID ) > 0 )
86 {
87 foreach( $BugArrayID as $doomedBugID )
88 {
89 $bug = new eZBug( $doomedBugID );
90 $bug->delete();
91 }
92 }
93
94 }
95
96 // path
97 $pathArray = $module->path();
98
99 $t->set_var( "path_item", "" );
100 foreach ( $pathArray as $path )
101 {
102 $t->set_var( "module_id", $path[0] );
103
104 $t->set_var( "module_name", $path[1] );
105
106 $t->parse( "path_item", "path_item_tpl", true );
107 }
108
109 $moduleList =& $module->getByParent( $module, true );
110
111
112 // categories
113 $i=0;
114 $t->set_var( "module_list", "" );
115 foreach ( $moduleList as $moduleItem )
116 {
117 $t->set_var( "module_id", $moduleItem->id() );
118
119 $t->set_var( "module_name", $moduleItem->name() );
120
121 $parent =& $moduleItem->parent();
122
123 $totalCount = $moduleItem->countBugs( true, false , true );
124 $t->set_var( "bug_count", $totalCount );
125
126 $openCount = $moduleItem->countBugs( true, true , true );
127 $t->set_var( "open_bug_count", $openCount );
128
129
130
131 if ( ( $i % 2 ) == 0 )
132 {
133 $t->set_var( "td_class", "bglight" );
134 }
135 else
136 {
137 $t->set_var( "td_class", "bgdark" );
138 }
139
140 $t->set_var( "module_description", $moduleItem->description() );
141
142 $t->parse( "module_item", "module_item_tpl", true );
143 $i++;
144 }
145
146 if ( count( $moduleList ) > 0 )
147 $t->parse( "module_list", "module_list_tpl" );
148 else
149 $t->set_var( "module_list", "" );
150
151
152 // bugs
153 $bugList =& $module->bugs( "time", true );
154 $locale = new eZLocale( $Language );
155 $i=0;
156 $t->set_var( "bug_list", "" );
157 foreach ( $bugList as $bug )
158 {
159 $t->set_var( "bug_id", $bug->id() );
160 $t->set_var( "bug_name", $bug->name() );
161
162 $pri =& $bug->priority();
163 $status =& $bug->status();
164
165 if ( $pri )
166 {
167 $t->set_var( "bug_priority", $pri->name() );
168 }
169 else
170 {
171 $t->set_var( "bug_priority", "" );
172 }
173
174 if ( $status )
175 {
176 $t->set_var( "bug_status", $status->name() );
177 }
178 else
179 {
180 $t->set_var( "bug_status", "" );
181 }
182
183 if ( $bug->isClosed() == true )
184 {
185 $t->parse( "bug_is_closed", "bug_is_closed_tpl" );
186 $t->set_var( "bug_is_open", "" );
187 }
188 else
189 {
190 $t->set_var( "bug_is_closed", "" );
191 $t->parse( "bug_is_open", "bug_is_open_tpl" );
192 }
193
194 if ( ( $i % 2 ) == 0 )
195 {
196 $t->set_var( "td_class", "bglight" );
197 $td_class = "bglight";
198 }
199 else
200 {
201 $t->set_var( "td_class", "bgdark" );
202 $td_class = "bgdark";
203 }
204
205 if( $gotRights == true ) // insert the checkbox and edit button
206 {
207 $t->parse( "bug_edit", "bug_edit_tpl" );
208 }
209 else
210 {
211 $t->set_var( "bug_edit", "" );
212 }
213
214 $t->parse( "bug_item", "bug_item_tpl", true );
215 $i++;
216 }
217
218
219 if ( count( $bugList ) > 0 )
220 $t->parse( "bug_list", "bug_list_tpl" );
221 else
222 $t->set_var( "bug_list", "" );
223
224 if( $gotRights == true ) // insert the buttons
225 {
226 $t->parse( "bug_edit_buttons", "bug_edit_buttons_tpl" );
227 }
228 else
229 {
230 $t->set_var( "bug_edit_buttons", "" );
231 }
232
233 $t->pparse( "output", "bug_list_page_tpl" );
234
235 ?>
$status
$status
Definition: bugedit.php:473
$bug
$bug
Definition: bugpreview.php:59
$pri
$pri
Definition: bugpreview.php:70
eZBugModule
Definition: ezbugmodule.php:56
eZBug
Definition: ezbug.php:80
eZLocale
Definition: ezlocale.php:119
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$totalCount
$totalCount
Definition: ezarticle/admin/formlist.php:73
$pathArray
if(eZObjectPermission::hasPermission( $module->id(), "bug_module", "w", $user)) if(isset( $Delete) && $gotRights==true) $pathArray
Definition: user/buglist.php:97
$locale
$locale
Definition: user/buglist.php:154
$t
$t
Definition: user/buglist.php:43
$user
$user
Definition: user/buglist.php:74
$i
$i
Definition: user/buglist.php:113
$Language
$Language
Definition: user/buglist.php:41
$ini
$ini
Definition: user/buglist.php:39
$module
$module
Definition: user/buglist.php:67
$moduleList
foreach( $pathArray as $path) $moduleList
Definition: user/buglist.php:109
$gotRights
$gotRights
Definition: user/buglist.php:75
$bugList
$bugList
Definition: user/buglist.php:153
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.