Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

bugpreview.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: bugpreview.php 6208 2001-07-19 12:29:04Z jakobn $
5 //
6 // Created on: <03-Dec-2000 18:56:58 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
33 $ini =& eZINI::instance( 'site.ini' );
34
35 $Language =& $ini->variable( "eZBugMain", "Language" );
36
37 // include_once( "ezbug/classes/ezbug.php" );
38 // include_once( "ezbug/classes/ezbugcategory.php" );
39 // include_once( "ezbug/classes/ezbugmodule.php" );
40 // include_once( "ezbug/classes/ezbugpriority.php" );
41 // include_once( "ezbug/classes/ezbugstatus.php" );
42 // include_once( "ezbug/classes/ezbuglog.php" );
43
44 $t = new eZTemplate( "kernel/ezbug/admin/" . $ini->variable( "eZBugMain", "AdminTemplateDir" ),
45 "kernel/ezbug/admin/intl", $Language, "bugpreview.php" );
46 $t->setAllStrings();
47
48 $t->set_file( array(
49 "bug_edit_tpl" => "bugpreview.tpl"
50 ) );
51
52
53 $t->set_block( "bug_edit_tpl", "log_item_tpl", "log_item" );
54 $t->set_block( "bug_edit_tpl", "yes_tpl", "yes" );
55 $t->set_block( "bug_edit_tpl", "no_tpl", "no" );
56
57
58 $locale = new eZLocale( $Language );
59 $bug = new eZBug( $BugID );
60
61 $t->set_var( "bug_id", $bug->id() );
62 $t->set_var( "name_value", $bug->name() );
63 $t->set_var( "description_value", eZTextTool::nl2br( $bug->description() ) );
64 $t->set_var( "action_value", "Update" );
65
66 $date =& $bug->created();
67 $t->set_var( "bug_date", $locale->format( $date ) );
68
69
70 $pri =& $bug->priority();
71 $status =& $bug->status();
72 $module =& $bug->module();
73 $category =& $bug->category();
74
75 if ( $pri )
76 {
77 $t->set_var( "priority_name", $pri->name() );
78 }
79 else
80 {
81 $t->set_var( "priority_name", "" );
82 }
83
84 if ( $status )
85 {
86 $t->set_var( "status_name", $status->name() );
87 }
88 else
89 {
90 $t->set_var( "status_name", "" );
91 }
92
93 if ( $module )
94 {
95 $t->set_var( "module_name", $module->name() );
96 }
97 else
98 {
99 $t->set_var( "module_name", "" );
100 }
101
102 if ( $category )
103 {
104 $t->set_var( "category_name", $category->name() );
105 }
106 else
107 {
108 $t->set_var( "category_name", "" );
109 }
110
111 if ( $bug->isClosed() == true )
112 {
113 $t->parse( "yes", "yes_tpl" );
114 $t->set_var( "no", "" );
115 }
116 else
117 {
118 $t->parse( "no", "no_tpl" );
119 $t->set_var( "yes", "" );
120 }
121
122
123 $bugLog = new eZBugLog();
124 $logList = $bugLog->getByBug( $bug );
125 if( count( $logList ) > 0 )
126 {
127 foreach ( $logList as $log )
128 {
129 $date =& $log->created();
130
131 $t->set_var( "log_date", $locale->format( $date ) );
132
133
134 $t->set_var( "log_description", $log->description() );
135
136 $t->parse( "log_item", "log_item_tpl", true );
137 }
138 }
139 else
140 {
141 $t->set_var( "log_item", "" );
142 }
143
144 $t->pparse( "output", "bug_edit_tpl" );
145
146 ?>
$category
$category
Definition: bugpreview.php:73
$locale
$locale
Definition: bugpreview.php:58
$t
$t
Definition: bugpreview.php:44
$date
$date
Definition: bugpreview.php:66
$status
$status
Definition: bugpreview.php:71
$bug
$bug
Definition: bugpreview.php:59
$Language
$Language
Definition: bugpreview.php:35
$ini
$ini
Definition: bugpreview.php:33
$bugLog
$bugLog
Definition: bugpreview.php:123
$module
$module
Definition: bugpreview.php:72
$logList
$logList
Definition: bugpreview.php:124
$pri
$pri
Definition: bugpreview.php:70
eZBugLog
Definition: ezbuglog.php:42
eZBug
Definition: ezbug.php:80
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
eZTextTool\nl2br
static nl2br( $string, $xhtml=true)
Definition: eztexttool.php:65
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.