]>
src.bluestatic.org Git - bugdar.git/blob - admin/resolution.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
. "resolution WHERE resolutionid = " . intval($bugsys->in
['resolutionid']));
34 $admin->redirect('resolution.php?do=modify');
37 // ###################################################################
39 if ($_REQUEST['do'] == 'delete')
41 $admin->page_confirm(lang
::p('confirm_delete_resolution'), 'resolution.php?do=kill&resolutionid=' . intval($bugsys->in
['resolutionid']));
44 // ###################################################################
46 if ($_POST['do'] == 'insert')
48 $db->query("INSERT INTO " . TABLE_PREFIX
. "resolution (resolution, displayorder) VALUES ('" . $bugsys->in
['resolution'] . "', " . intval($bugsys->in
['displayorder']) . ")");
50 $admin->redirect('resolution.php?do=modify');
53 // ###################################################################
55 if ($_REQUEST['do'] == 'add')
57 $admin->page_start(lang
::p('add_new_resolution'));
59 $admin->form_start('resolution.php', 'insert');
60 $admin->table_start();
61 $admin->table_head(lang
::p('new_resolution'));
62 $admin->row_input(lang
::p('resolution_title'), 'resolution');
63 $admin->row_input(lang
::p('resolution_display_order'), 'displayorder');
71 // ###################################################################
73 if ($_POST['do'] == 'update')
75 $db->query("UPDATE " . TABLE_PREFIX
. "resolution SET resolution = '" . $bugsys->in
['resolution'] . "', displayorder = " . intval($bugsys->in
['displayorder']) . " WHERE resolutionid = " . intval($bugsys->in
['resolutionid']));
77 $admin->redirect('resolution.php?do=modify');
80 // ###################################################################
82 if ($_REQUEST['do'] == 'edit')
84 $resolution = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "resolution WHERE resolutionid = " . intval($bugsys->in
['resolutionid']));
85 if (!is_array($resolution))
87 $admin->error(lang
::p('error_invalid_id'));
90 $admin->page_start(lang
::p('edit_resolution'));
92 $admin->form_start('resolution.php', 'update');
93 $admin->form_hidden_field('resolutionid', $resolution['resolutionid']);
94 $admin->table_start();
95 $admin->table_head(lang
::p('edit_resolution_title', $resolution['resolution'], $resolution['resolutionid']));
96 $admin->row_input(lang
::p('resolution_title'), 'resolution', $resolution['resolution']);
97 $admin->row_input(lang
::p('resolution_display_order'), 'displayorder', $resolution['displayorder']);
105 // ###################################################################
107 if ($_REQUEST['do'] == 'modify')
109 $admin->page_start(lang
::p('resolution_manager'));
111 $resolutions = $db->query("SELECT * FROM " . TABLE_PREFIX
. "resolution ORDER BY displayorder");
113 $admin->form_start('resolution.php', 'null');
114 $admin->table_start();
115 $admin->table_head(lang
::p('resolution_manager'));
117 while ($resolution = $db->fetch_array($resolutions))
119 $admin->row_text("$resolution[displayorder]: <a href=\"resolution.php?do=edit&resolutionid=$resolution[resolutionid]\">$resolution[resolution]</a>", "(resolutionid: $resolution[resolutionid]) <a href=\"resolution.php?do=edit&resolutionid=$resolution[resolutionid]\">" . lang
::p('edit_wraplink') . "</a> <a href=\"resolution.php?do=delete&resolutionid=$resolution[resolutionid]\">" . lang
::p('delete_wraplink') . "</a>");
121 $db->free_result($resolutiones);
123 $admin->row_span('<input type="button" name="addug" value=" ' . lang
::p('add_new_resolution') . ' " onclick="window.location = \'resolution.php?do=add\';" />', 'tfoot', 'center', 3);
130 /*=====================================================================*\
131 || ###################################################################
134 || ###################################################################
135 \*=====================================================================*/