set_focus('tab', 'fields', null);
if (!can_perform('canadminfields'))
{
admin_login();
}
// ###################################################################
if (empty($_REQUEST['do']))
{
$_REQUEST['do'] = 'modify';
}
// ###################################################################
if ($_REQUEST['do'] == 'kill')
{
$resolution = new ResolutionAPI($bugsys);
$resolution->set('resolutionid', $bugsys->in['resolutionid']);
$resolution->set_condition();
$resolution->delete();
$admin->redirect('resolution.php?do=modify');
}
// ###################################################################
if ($_REQUEST['do'] == 'delete')
{
$admin->page_confirm(_('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', 'kill', array('resolutionid' => $bugsys->input_clean('resolutionid', TYPE_UINT)));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
$resolution = new ResolutionAPI($bugsys);
$resolution->set('resolution', $bugsys->in['resolution']);
$resolution->set('displayorder', $bugsys->in['displayorder']);
$resolution->insert();
$admin->redirect('resolution.php?do=modify');
}
// ###################################################################
if ($_REQUEST['do'] == 'add')
{
NavLinks::resolutionsAdd();
$navigator->set_focus('link', 'resolutions-add', 'resolutions');
$admin->page_start(_('Add New Resolution'));
$admin->form_start('resolution.php', 'insert');
$admin->table_start();
$admin->table_head(_('New Resolution'));
$admin->row_input(_('Resolution Title
The title of this resolution flag (eg: `Fixed` or `Bogus`)
'), 'resolution');
$admin->row_input(_('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')
{
$resolution = new ResolutionAPI($bugsys);
$resolution->set('resolutionid', $bugsys->in['resolutionid']);
$resolution->set_condition();
$resolution->set('resolution', $bugsys->in['resolution']);
$resolution->set('displayorder', $bugsys->in['displayorder']);
$resolution->update();
$admin->redirect('resolution.php?do=modify');
}
// ###################################################################
if ($_REQUEST['do'] == 'edit')
{
NavLinks::resolutionsEdit($bugsys->in['resolutionid']);
$navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages');
$resolution = new ResolutionAPI($bugsys);
$resolution->set('resolutionid', $bugsys->in['resolutionid']);
$resolution->set_condition();
$resolution->fetch();
$admin->page_start(_('Edit Resolution'));
$admin->form_start('resolution.php', 'update');
$admin->form_hidden_field('resolutionid', $resolution->objdata['resolutionid']);
$admin->table_start();
$admin->table_head(sprintf(_('Edit Resolution - %1$s (id: %2$s)'), $resolution->objdata['resolution'], $resolution->objdata['resolutionid']));
$admin->row_input(_('Resolution TitleThe title of this resolution flag (eg: `Fixed` or `Bogus`)
'), 'resolution', $resolution->objdata['resolution']);
$admin->row_input(_('Display OrderThe order in which the resolutions are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder', $resolution->objdata['displayorder']);
$admin->row_submit();
$admin->table_end();
$admin->form_end();
$admin->page_end();
}
// ###################################################################
if ($_REQUEST['do'] == 'modify')
{
NavLinks::resolutionsAdd();
$navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages');
$admin->page_start(_('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(_('Resolution Manager'));
while ($resolution = $db->fetch_array($resolutions))
{
$admin->row_text("$resolution[displayorder]: $resolution[resolution]", "(resolutionid: $resolution[resolutionid]) [" . _('Edit') . "] [" . _('Delete') . "]");
}
$db->free_result($resolutions);
$admin->table_end();
$admin->form_end();
$admin->page_end();
}
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>