]> src.bluestatic.org Git - bugdar.git/blob - admin/resolution.php
r496: Removing #submitrow from report.css to global.css
[bugdar.git] / admin / resolution.php
1 <?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 \*=====================================================================*/
12
13 require_once('./global.php');
14 require_once('./includes/functions_datastore.php');
15
16 if (!can_perform('canadminfields'))
17 {
18 admin_login();
19 }
20
21 // ###################################################################
22
23 if (empty($_REQUEST['do']))
24 {
25 $_REQUEST['do'] = 'modify';
26 }
27
28 // ###################################################################
29
30 if ($_REQUEST['do'] == 'kill')
31 {
32 $db->query("DELETE FROM " . TABLE_PREFIX . "resolution WHERE resolutionid = " . intval($bugsys->in['resolutionid']));
33 build_resolutions();
34 $admin->redirect('resolution.php?do=modify');
35 }
36
37 // ###################################################################
38
39 if ($_REQUEST['do'] == 'delete')
40 {
41 $admin->page_confirm($lang->string('Are you sure you want to delete this resolution? Doing so will revert all bugs to the default resolution (which is set in the options panel)?'), 'resolution.php?do=kill&amp;resolutionid=' . intval($bugsys->in['resolutionid']));
42 }
43
44 // ###################################################################
45
46 if ($_POST['do'] == 'insert')
47 {
48 $db->query("INSERT INTO " . TABLE_PREFIX . "resolution (resolution, displayorder) VALUES ('" . $bugsys->in['resolution'] . "', " . intval($bugsys->in['displayorder']) . ")");
49 build_resolutions();
50 $admin->redirect('resolution.php?do=modify');
51 }
52
53 // ###################################################################
54
55 if ($_REQUEST['do'] == 'add')
56 {
57 $admin->page_start($lang->string('Add New Resolution'));
58
59 $admin->form_start('resolution.php', 'insert');
60 $admin->table_start();
61 $admin->table_head($lang->string('New Resolution'));
62 $admin->row_input($lang->string('Resolution Title<div><dfn>The title of this resolution flag (eg: `Fixed` or `Bogus`)</dfn></div>'), 'resolution');
63 $admin->row_input($lang->string('Display Order<div><dfn>The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder');
64 $admin->row_submit();
65 $admin->table_end();
66 $admin->form_end();
67
68 $admin->page_end();
69 }
70
71 // ###################################################################
72
73 if ($_POST['do'] == 'update')
74 {
75 $db->query("UPDATE " . TABLE_PREFIX . "resolution SET resolution = '" . $bugsys->in['resolution'] . "', displayorder = " . intval($bugsys->in['displayorder']) . " WHERE resolutionid = " . intval($bugsys->in['resolutionid']));
76 build_resolutions();
77 $admin->redirect('resolution.php?do=modify');
78 }
79
80 // ###################################################################
81
82 if ($_REQUEST['do'] == 'edit')
83 {
84 $resolution = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "resolution WHERE resolutionid = " . intval($bugsys->in['resolutionid']));
85 if (!is_array($resolution))
86 {
87 $admin->error($lang->getlex('error_invalid_id'));
88 }
89
90 $admin->page_start($lang->string('Edit Resolution'));
91
92 $admin->form_start('resolution.php', 'update');
93 $admin->form_hidden_field('resolutionid', $resolution['resolutionid']);
94 $admin->table_start();
95 $admin->table_head(sprintf($lang->string('Edit Resolution - %1$s (id: %2$s)'), $resolution['resolution'], $resolution['resolutionid']));
96 $admin->row_input($lang->string('Resolution Title<div><dfn>The title of this resolution flag (eg: `Fixed` or `Bogus`)</dfn></div>'), 'resolution', $resolution['resolution']);
97 $admin->row_input($lang->string('Display Order<div><dfn>The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $resolution['displayorder']);
98 $admin->row_submit();
99 $admin->table_end();
100 $admin->form_end();
101
102 $admin->page_end();
103 }
104
105 // ###################################################################
106
107 if ($_REQUEST['do'] == 'modify')
108 {
109 $admin->page_start($lang->string('Resolution Manager'));
110
111 $resolutions = $db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder");
112
113 $admin->form_start('resolution.php', 'null');
114 $admin->table_start();
115 $admin->table_head($lang->string('Resolution Manager'));
116
117 while ($resolution = $db->fetch_array($resolutions))
118 {
119 $admin->row_text("$resolution[displayorder]: <a href=\"resolution.php?do=edit&amp;resolutionid=$resolution[resolutionid]\">$resolution[resolution]</a>", "(resolutionid: $resolution[resolutionid]) <a href=\"resolution.php?do=edit&amp;resolutionid=$resolution[resolutionid]\">[" . $lang->string('Edit') . "]</a> <a href=\"resolution.php?do=delete&amp;resolutionid=$resolution[resolutionid]\">[" . $lang->string('Delete') . "]</a>");
120 }
121 $db->free_result($resolutiones);
122
123 $admin->row_span('<a href="resolution.php?do=add">[' . $lang->string('Add New Resolution') . ']</a>', 'tfoot', 'center', 3);
124 $admin->table_end();
125 $admin->form_end();
126
127 $admin->page_end();
128 }
129
130 /*=====================================================================*\
131 || ###################################################################
132 || # $HeadURL$
133 || # $Id$
134 || ###################################################################
135 \*=====================================================================*/
136 ?>