]>
src.bluestatic.org Git - bugdar.git/blob - admin/severity.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 require_once ( './global.php' );
23 require_once ( './includes/api_severity.php' );
25 NavLinks
:: fieldsPages ();
26 $navigator- > set_focus ( 'tab' , 'fields' , null );
28 if (! can_perform ( 'canadminfields' ))
33 // ###################################################################
35 if ( empty ( $_REQUEST [ 'do' ]))
37 $_REQUEST [ 'do' ] = 'modify' ;
40 // ###################################################################
42 if ( $_REQUEST [ 'do' ] == 'kill' )
44 $severity = new SeverityAPI ( $bugsys );
45 $severity- > set ( 'severityid' , $bugsys- > in
[ 'severityid' ]);
46 $severity- > set_condition ();
49 $admin- > redirect ( 'severity.php?do=modify' );
52 // ###################################################################
54 if ( $_REQUEST [ 'do' ] == 'delete' )
56 $admin- > page_confirm ( $lang- > string ( 'Are you sure you want to delete this severity? Doing so will revert all bugs to the default severity (which is set in the options panel)?' ), 'severity.php?do=kill&severityid=' . $bugsys- > input_clean ( 'severityid' , TYPE_UINT
));
59 // ###################################################################
61 if ( $_POST [ 'do' ] == 'insert' )
63 $severity = new SeverityAPI ( $bugsys );
64 $severity- > set ( 'severity' , $bugsys- > in
[ 'severity' ]);
65 $severity- > set ( 'displayorder' , $bugsys- > in
[ 'displayorder' ]);
68 $admin- > redirect ( 'severity.php?do=modify' );
71 // ###################################################################
73 if ( $_REQUEST [ 'do' ] == 'add' )
75 NavLinks
:: severitiesAdd ();
76 $navigator- > set_focus ( 'link' , 'severities-add' , 'severities' );
78 $admin- > page_start ( $lang- > string ( 'Add New Severity' ));
80 $admin- > form_start ( 'severity.php' , 'insert' );
81 $admin- > table_start ();
82 $admin- > table_head ( $lang- > string ( 'New Severity' ));
83 $admin- > row_input ( $lang- > string ( 'Severity Title<div><dfn>The title of this severity flag (eg: `Major` or `Critical`)</dfn></div>' ), 'severity' );
84 $admin- > row_input ( $lang- > string ( 'Display Order<div><dfn>The order in which the severities are displayed. The higher the number, the lower down in the list it is.</dfn></div>' ), 'displayorder' );
92 // ###################################################################
94 if ( $_POST [ 'do' ] == 'update' )
96 $severity = new SeverityAPI ( $bugsys );
97 $severity- > set ( 'severityid' , $bugsys- > in
[ 'severityid' ]);
98 $severity- > set_condition ();
99 $severity- > set ( 'severity' , $bugsys- > in
[ 'severity' ]);
100 $severity- > set ( 'displayorder' , $bugsys- > in
[ 'displayorder' ]);
103 $admin- > redirect ( 'severity.php?do=modify' );
106 // ###################################################################
108 if ( $_REQUEST [ 'do' ] == 'edit' )
110 NavLinks
:: severitiesEdit ( $bugsys- > in
[ 'severityid' ]);
111 $navigator- > set_focus ( 'link' , 'fields-pages-severities' , 'fields-pages' );
113 $severity = new SeverityAPI ( $bugsys );
114 $severity- > set ( 'severityid' , $bugsys- > in
[ 'severityid' ]);
115 $severity- > set_condition ();
118 $admin- > page_start ( $lang- > string ( 'Edit Severity' ));
120 $admin- > form_start ( 'severity.php' , 'update' );
121 $admin- > form_hidden_field ( 'severityid' , $severity- > objdata
[ 'severityid' ]);
122 $admin- > table_start ();
123 $admin- > table_head ( sprintf ( $lang- > string ( 'Edit Severity - %1 $s (id: %2 $s )' ), $severity- > objdata
[ 'severity' ], $severity- > objdata
[ 'severityid' ]));
124 $admin- > row_input ( $lang- > string ( 'Severity Title<div><dfn>The title of this severity flag (eg: `Major` or `Critical`)</dfn></div>' ), 'severity' , $severity- > objdata
[ 'severity' ]);
125 $admin- > row_input ( $lang- > string ( 'Display Order<div><dfn>The order in which the severities are displayed. The higher the number, the lower down in the list it is.</dfn></div>' ), 'displayorder' , $severity- > objdata
[ 'displayorder' ]);
126 $admin- > row_submit ();
133 // ###################################################################
135 if ( $_REQUEST [ 'do' ] == 'modify' )
137 NavLinks
:: severitiesAdd ();
138 $navigator- > set_focus ( 'link' , 'fields-pages-severities' , 'fields-pages' );
140 $admin- > page_start ( $lang- > string ( 'Severity Manager' ));
142 $severities = $db- > query ( "SELECT * FROM " . TABLE_PREFIX
. "severity ORDER BY displayorder" );
144 $admin- > form_start ( 'severity.php' , 'null' );
145 $admin- > table_start ();
146 $admin- > table_head ( $lang- > string ( 'Severity Manager' ));
148 while ( $severity = $db- > fetch_array ( $severities ))
150 $admin- > row_text ( " $severity [displayorder]: <a href= \" severity.php?do=edit&severityid= $severity [severityid] \" > $severity [severity]</a>" , "(severityid: $severity [severityid]) <a href= \" severity.php?do=edit&severityid= $severity [severityid] \" >[" . $lang- > string ( 'Edit' ) . "]</a> <a href= \" severity.php?do=delete&severityid= $severity [severityid] \" >[" . $lang- > string ( 'Delete' ) . "]</a>" );
152 $db- > free_result ( $severities );
160 /*=====================================================================*\
161 || ###################################################################
164 || ###################################################################
165 \*=====================================================================*/