]>
src.bluestatic.org Git - bugdar.git/blob - admin/severity.php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 require_once('./global.php');
14 require_once('./includes/functions_datastore.php');
16 if (!can_perform('canadminfields'))
21 // ###################################################################
23 if (empty($_REQUEST['do']))
25 $_REQUEST['do'] = 'modify';
28 // ###################################################################
30 if ($_REQUEST['do'] == 'kill')
32 $db->query("DELETE FROM " . TABLE_PREFIX
. "severity WHERE severityid = " . intval($bugsys->in
['serverityid']));
34 $admin->redirect('severity.php?do=modify');
37 // ###################################################################
39 if ($_REQUEST['do'] == 'delete')
41 $admin->page_confirm(lang
::p('confirm_delete_severity'), 'severity.php?do=kill&severityid=' . intval($bugsys->in
['severityid']));
44 // ###################################################################
46 if ($_POST['do'] == 'insert')
48 $db->query("INSERT INTO " . TABLE_PREFIX
. "severity (severity, displayorder) VALUES ('" . $bugsys->in
['severity'] . "', " . intval($bugsys->in
['displayorder']) . ")");
50 $admin->redirect('severity.php?do=modify');
53 // ###################################################################
55 if ($_REQUEST['do'] == 'add')
57 $admin->page_start(lang
::p('add_new_severity'));
59 $admin->form_start('severity.php', 'insert');
60 $admin->table_start();
61 $admin->table_head(lang
::p('new_severity'));
62 $admin->row_input(lang
::p('severity_title'), 'severity');
63 $admin->row_input(lang
::p('severity_display_order'), 'displayorder');
71 // ###################################################################
73 if ($_POST['do'] == 'update')
75 sanitize(array('severityid' => INT, 'severity' => STR
, 'displayorder' => INT));
76 $db->query("UPDATE " . TABLE_PREFIX
. "severity SET severity = '" . $bugsys->in
['severity'] . "', displayorder = " . intval($bugsys->in
['displayorder']) . " WHERE severityid = " . intval($bugsys->in
['severityid']));
78 $admin->redirect('severity.php?do=modify');
81 // ###################################################################
83 if ($_REQUEST['do'] == 'edit')
85 $severity = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "severity WHERE severityid = " . intval($bugsys->in
['severityid']));
86 if (!is_array($severity))
88 $admin->error(lang
::p('error_invalid_id'));
91 $admin->page_start(lang
::p('edit_severity'));
93 $admin->form_start('severity.php', 'update');
94 $admin->form_hidden_field('severityid', $severity['severityid']);
95 $admin->table_start();
96 $admin->table_head(lang
::p('edit_severity_title', $severity['severity'], $severity['severityid']));
97 $admin->row_input(lang
::p('severity_title'), 'severity', $severity['severity']);
98 $admin->row_input(lang
::p('severity_display_order'), 'displayorder', $severity['displayorder']);
106 // ###################################################################
108 if ($_REQUEST['do'] == 'modify')
110 $admin->page_start('Severity Manager');
112 $severities = $db->query("SELECT * FROM " . TABLE_PREFIX
. "severity ORDER BY displayorder");
114 $admin->form_start('severity.php', 'null');
115 $admin->table_start();
116 $admin->table_head('Severity Manager');
118 while ($severity = $db->fetch_array($severities))
120 $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
::p('edit_wraplink') . "</a> <a href=\"severity.php?do=delete&severityid=$severity[severityid]\">" . lang
::p('delete_wraplink') . "</a>");
122 $db->free_result($severityes);
124 $admin->row_span('<input type="button" name="addug" value=" ' . lang
::p('add_new_severity') . ' " onclick="window.location = \'severity.php?do=add\';" />', 'tfoot', 'center', 3);
131 /*=====================================================================*\
132 || ###################################################################
135 || ###################################################################
136 \*=====================================================================*/