query("DELETE FROM " . TABLE_PREFIX . "resolution WHERE resolutionid = " . intval($bugsys->in['resolutionid']));
build_resolutions();
$admin->redirect('resolution.php?do=modify');
}
// ###################################################################
if ($_REQUEST['do'] == 'delete')
{
$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&resolutionid=' . intval($bugsys->in['resolutionid']));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
$db->query("INSERT INTO " . TABLE_PREFIX . "resolution (resolution, displayorder) VALUES ('" . $bugsys->in['resolution'] . "', " . intval($bugsys->in['displayorder']) . ")");
build_resolutions();
$admin->redirect('resolution.php?do=modify');
}
// ###################################################################
if ($_REQUEST['do'] == 'add')
{
$admin->page_start($lang->string('Add New Resolution'));
$admin->form_start('resolution.php', 'insert');
$admin->table_start();
$admin->table_head($lang->string('New Resolution'), 2, 'standard_bug_fields');
$admin->row_input($lang->string('Resolution Title
The title of this resolution flag (eg: `Fixed` or `Bogus`)
'), 'resolution');
$admin->row_input($lang->string('Display OrderThe order in which the resolutions are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder');
$admin->row_submit();
$admin->table_end();
$admin->form_end();
$admin->page_end();
}
// ###################################################################
if ($_POST['do'] == 'update')
{
$db->query("UPDATE " . TABLE_PREFIX . "resolution SET resolution = '" . $bugsys->in['resolution'] . "', displayorder = " . intval($bugsys->in['displayorder']) . " WHERE resolutionid = " . intval($bugsys->in['resolutionid']));
build_resolutions();
$admin->redirect('resolution.php?do=modify');
}
// ###################################################################
if ($_REQUEST['do'] == 'edit')
{
$resolution = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "resolution WHERE resolutionid = " . intval($bugsys->in['resolutionid']));
if (!is_array($resolution))
{
$admin->error($lang->getlex('error_invalid_id'));
}
$admin->page_start($lang->string('Edit Resolution'), 2, 'standard_bug_fields');
$admin->form_start('resolution.php', 'update');
$admin->form_hidden_field('resolutionid', $resolution['resolutionid']);
$admin->table_start();
$admin->table_head(sprintf($lang->string('Edit Resolution - %1$s (id: %2$s)'), $resolution['resolution'], $resolution['resolutionid']));
$admin->row_input($lang->string('Resolution TitleThe title of this resolution flag (eg: `Fixed` or `Bogus`)
'), 'resolution', $resolution['resolution']);
$admin->row_input($lang->string('Display OrderThe order in which the resolutions are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder', $resolution['displayorder']);
$admin->row_submit();
$admin->table_end();
$admin->form_end();
$admin->page_end();
}
// ###################################################################
if ($_REQUEST['do'] == 'modify')
{
$admin->page_start($lang->string('Resolution Manager'));
$resolutions = $db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder");
$admin->form_start('resolution.php', 'null');
$admin->table_start();
$admin->table_head($lang->string('Resolution Manager'), 2, 'standard_bug_fields');
while ($resolution = $db->fetch_array($resolutions))
{
$admin->row_text("$resolution[displayorder]: $resolution[resolution]", "(resolutionid: $resolution[resolutionid]) [" . $lang->string('Edit') . "] [" . $lang->string('Delete') . "]");
}
$db->free_result($resolutiones);
$admin->row_span('[' . $lang->string('Add New Resolution') . ']', 'tfoot', 'center', 3);
$admin->table_end();
$admin->form_end();
$admin->page_end();
}
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>