From 35a3f808905f3c77518b79a1ec38e13a62ae71a2 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 23 Jul 2015 21:25:27 -0400 Subject: [PATCH] #209 Only show move up/down if at the right point --- admin/manage_statuses.php | 49 +++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/admin/manage_statuses.php b/admin/manage_statuses.php index 7a630f30..4409150c 100644 --- a/admin/manage_statuses.php +++ b/admin/manage_statuses.php @@ -78,6 +78,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); hesk_handle_messages(); //-- We need to get all of the statuses and dump the information to the page. + $numOfStatusesRS = hesk_dbQuery('SELECT 1 FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`'); + $numberOfStatuses = hesk_dbNumRows($numOfStatusesRS); + $statusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`'; $closedStatusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 1'; $openStatusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0'; @@ -92,22 +95,16 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); - - - - - - + + - + @@ -134,13 +131,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); - - - - + + + + + - + @@ -285,6 +283,23 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); require_once(HESK_PATH . 'inc/footer.inc.php'); exit(); +function echoArrows($index, $numberOfStatuses) { + if ($index !== 1) { + // Display move up + echo ' '; + } else { + echo ' '; + } + + if ($index !== $numberOfStatuses) { + // Display move down + echo ''; + } else { + echo ''; + } + +} + function save() { global $hesklang, $hesk_settings;