Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

bugview.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: bugview.php 7590 2001-09-29 12:35:15Z kaid $
5 //
6 // Created on: <04-Dec-2000 11:44:31 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/ezlog.php" );
30 // include_once( "classes/ezlocale.php" );
31 // include_once( "classes/eztexttool.php" );
32 // include_once( "classes/ezhttptool.php" );
33
34 $ini =& eZINI::instance( 'site.ini' );
35
36 $Language = $ini->variable( "eZBugMain", "Language" );
37
38 // include_once( "ezbug/classes/ezbug.php" );
39 // include_once( "ezbug/classes/ezbugcategory.php" );
40 // include_once( "ezbug/classes/ezbugmodule.php" );
41 // include_once( "ezbug/classes/ezbugpriority.php" );
42 // include_once( "ezbug/classes/ezbugstatus.php" );
43 // include_once( "ezbug/classes/ezbuglog.php" );
44
45 $t = new eZTemplate( "kernel/ezbug/user/" . $ini->variable( "eZBugMain", "TemplateDir" ),
46 "kernel/ezbug/user/intl", $Language, "bugview.php" );
47 $t->setAllStrings();
48
49 $t->set_file( array(
50 "bug_edit_tpl" => "bugview.tpl"
51 ) );
52
53 // path
54 $t->set_block( "bug_edit_tpl", "path_item_tpl", "path_item" );
55
56 $t->set_block( "bug_edit_tpl", "log_item_tpl", "log_item" );
57 $t->set_block( "bug_edit_tpl", "yes_tpl", "yes" );
58 $t->set_block( "bug_edit_tpl", "no_tpl", "no" );
59
60 $t->set_block( "bug_edit_tpl", "screenshots_tpl", "screenshots" );
61 $t->set_block( "screenshots_tpl", "screenshot_item_tpl", "screenshot_item" );
62 $t->set_block( "bug_edit_tpl", "patches_tpl", "patches" );
63 $t->set_block( "patches_tpl", "patch_item_tpl", "patch_item" );
64 $t->set_block( "bug_edit_tpl", "version_number_tpl", "version_number" );
65
66 $t->set_var( "version_number", "" );
67
68 $locale = new eZLocale( $Language );
69 $bug = new eZBug( $BugID );
70
71 // path
72 $module = $bug->module();
73 if( $module == false )
74 {
75 eZHTTPTool::header( "Location: /bug/archive/0" );
76 exit();
77 }
78
79 $pathArray = $module->path();
80
81 $t->set_var( "path_item", "" );
82 foreach ( $pathArray as $path )
83 {
84 $t->set_var( "module_id", $path[0] );
85
86 $t->set_var( "module_name", $path[1] );
87
88 $t->parse( "path_item", "path_item_tpl", true );
89 }
90
91 if( $bug->version() != "" )
92 {
93 $t->set_var( "version_number_value", $bug->version() );
94 $t->parse( "version_number", "version_number_tpl", false );
95 }
96
97 $t->set_var( "bug_id", $bug->id() );
98
99 $tmp = $bug->name();
100 $t->set_var( "name_value", $tmp );
101
102 $bug_reporter = $bug->user();
103 if( $bug_reporter )
104 {
105 $t->set_var( "reporter_name_value", $bug_reporter->name() );
106 }
107 else
108 {
109 $t->set_var( "reporter_name_value", "Unknown" );
110 }
111
112 $t->set_var( "description_value", eZTextTool::nl2br( $bug->description() ) );
113 $t->set_var( "action_value", "Update" );
114
115 $date =& $bug->created();
116 $t->set_var( "bug_date", $locale->format( $date ) );
117
118 $pri =& $bug->priority();
119 $status =& $bug->status();
120 $module =& $bug->module();
121 $category =& $bug->category();
122
123 if ( $pri )
124 {
125 $t->set_var( "priority_name", $pri->name() );
126 }
127 else
128 {
129 $t->set_var( "priority_name", "" );
130 }
131
132 if ( $status )
133 {
134 $t->set_var( "status_name", $status->name() );
135 }
136 else
137 {
138 $t->set_var( "status_name", "" );
139 }
140
141 if ( $module )
142 {
143 $t->set_var( "module_name", $module->name() );
144 }
145 else
146 {
147 $t->set_var( "module_name", "" );
148 }
149
150 if ( $category )
151 {
152 $t->set_var( "category_name", $category->name() );
153 }
154 else
155 {
156 $t->set_var( "category_name", "" );
157 }
158
159 if ( $bug->isClosed() == true )
160 {
161 $t->parse( "yes", "yes_tpl" );
162 $t->set_var( "no", "" );
163 }
164 else
165 {
166 $t->parse( "no", "no_tpl" );
167 $t->set_var( "yes", "" );
168 }
169
170 /* screenshot */
171 $images = $bug->images();
172 if( count( $images ) > 0 )
173 {
174 $i = 0;
175 foreach( $images as $image )
176 {
177 if ( ( $i % 2 ) == 0 )
178 {
179 $t->set_var( "td_class", "bglight" );
180 }
181 else
182 {
183 $t->set_var( "td_class", "bgdark" );
184 }
185 $t->set_var( "image_number", $i + 1 );
186 $t->set_var( "image_id", $image->id() );
187
188 $tmp = $image->caption();
189 $t->set_var( "image_name", "<a href=\"".$GlobalSiteIni->WWWDir.$GlobalSiteIni->Index."/imagecatalogue/imageview/" . $image->id()
190 . "?RefererURL=/bug/bugview/$BugID" . "\">" . $tmp . "</a>" );
191 $t->parse( "screenshot_item", "screenshot_item_tpl", true );
192
193 $i++;
194 }
195 $t->parse( "screenshots", "screenshots_tpl", true );
196
197 }
198 else
199 {
200 $t->set_var( "screenshots", "" );
201 }
202
203 /* Paths */
204 $files = $bug->files();
205 if( count( $files ) > 0 )
206 {
207 $i = 0;
208 foreach( $files as $file )
209 {
210 if ( ( $i % 2 ) == 0 )
211 {
212 $t->set_var( "td_class", "bglight" );
213 }
214 else
215 {
216 $t->set_var( "td_class", "bgdark" );
217 }
218
219 $t->set_var( "file_number", $i + 1 );
220 // $t->set_var( "file_id", $file->id() );
221 $tmp = $file->name();
222 $t->set_var( "file_name", "<a href=\"".$GlobalSiteIni->WWWDir.$GlobalSiteIni->Index."/filemanager/download/" . $file->id() . "/" . $file->originalFileName() . "\">" . $tmp . "</a>" );
223
224 $t->parse( "patch_item", "patch_item_tpl", true );
225
226 $i++;
227 }
228 $t->parse( "patches", "patches_tpl", true );
229 }
230 else
231 {
232 $t->set_var( "patches", "" );
233 }
234
235
236 $bugLog = new eZBugLog();
237 $logList = $bugLog->getByBug( $bug );
238
239
240 foreach ( $logList as $log )
241 {
242 $date =& $log->created();
243
244 $t->set_var( "log_date", $locale->format( $date ) );
245
246 $t->set_var( "log_description", $log->description() );
247
248 $t->parse( "log_item", "log_item_tpl", true );
249 }
250
251 if ( count( $logList ) == 0 )
252 {
253 $t->set_var( "log_item", "" );
254 }
255
256 $t->pparse( "output", "bug_edit_tpl" );
257
258 ?>
$i
$i
Definition: admin/adlist.php:91
$category
$category
Definition: bugview.php:121
$locale
$locale
Definition: bugview.php:68
$t
$t
Definition: bugview.php:45
$date
$date
Definition: bugview.php:115
$tmp
$tmp
Definition: bugview.php:99
$status
$status
Definition: bugview.php:119
$bug
$bug
Definition: bugview.php:69
$Language
$Language
Definition: bugview.php:36
$ini
$ini
Definition: bugview.php:34
$files
$files
Definition: bugview.php:204
$bugLog
$bugLog
Definition: bugview.php:236
$pathArray
if( $module==false) $pathArray
Definition: bugview.php:79
$images
$images
Definition: bugview.php:171
$module
$module
Definition: bugview.php:72
$logList
$logList
Definition: bugview.php:237
$pri
$pri
Definition: bugview.php:118
$bug_reporter
$bug_reporter
Definition: bugview.php:102
eZBugLog
Definition: ezbuglog.php:42
eZBug
Definition: ezbug.php:80
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
eZTextTool\nl2br
static nl2br( $string, $xhtml=true)
Definition: eztexttool.php:65
$GlobalSiteIni
$GlobalSiteIni
Definition: ezarticle/xmlrpc/xmlrpcserver.php:33
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
exit
exit
Definition: folder.php:81
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.