From 61727aca0200af515c7fe44dfa6fc3412dc53ef9 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 5 Aug 2011 13:28:21 +0000 Subject: [PATCH] New configuration parameter: display_actions_at_top: avoid scrolling to see the buttons when assigning a ticket ! SVN:trunk[1425] --- core/config.class.inc.php | 9 +++++++++ pages/UI.php | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/core/config.class.inc.php b/core/config.class.inc.php index b52b21d26f..c5b05a6324 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -401,6 +401,15 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => true, ), + 'display_actions_at_top' => array( + 'type' => 'bool', + 'description' => 'Whether or not the actions/buttons should be displayed at the top of the screen', + // examples... not used + 'default' => true, + 'value' => false, + 'source_of_value' => '', + 'show_in_conf_sample' => true, + ), ); public function IsProperty($sPropCode) diff --git a/pages/UI.php b/pages/UI.php index 12207f6d8b..5c459d6c73 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -1510,9 +1510,14 @@ EOF $iFieldIndex++; } } - $oP->add('
'); - $oObj->DisplayBareProperties($oP); - $oP->add('
'); + $bDisplayFormAtTop = MetaModel::GetConfig()->Get('display_actions_at_top'); + if (!$bDisplayFormAtTop) + { + // Displays the ticket details BEFORE the actions + $oP->add('
'); + $oObj->DisplayBareProperties($oP); + $oP->add('
'); + } $oP->add("
\n"); $oP->add("
\n"); $oP->add("
\n"); @@ -1532,6 +1537,13 @@ EOF $oP->add("\n"); $oP->add("\n"); $oP->add("\n"); + if ($bDisplayFormAtTop) + { + // Displays the ticket details BEFORE the actions + $oP->add('
'); + $oObj->DisplayBareProperties($oP); + $oP->add('
'); + } $iFieldsCount = count($aFieldsMap); $sJsonFieldsMap = json_encode($aFieldsMap); @@ -1718,12 +1730,17 @@ EOF $oP->add("

$sActionLabel - {$oObj->GetName()}

\n"); $oP->set_title($sActionLabel); $oP->add("\n"); - $oP->add('
'); - $oObj->DisplayBareProperties($oP); - $oP->add('
'); $aTargetState = $aTargetStates[$sTargetState]; $aExpectedAttributes = $aTargetState['attribute_list']; $oP->add("

$sActionDetails

\n"); + $bDisplayFormAtTop = MetaModel::GetConfig()->Get('display_actions_at_top'); + if (!$bDisplayFormAtTop) + { + // Displays the ticket details BEFORE the actions + $oP->add('
'); + $oObj->DisplayBareProperties($oP); + $oP->add('
'); + } $oP->add("
\n"); $oP->add("
\n"); $aDetails = array(); @@ -1798,6 +1815,13 @@ EOF $oP->add("\n"); $oP->add("
\n"); $oP->add("
\n"); + if ($bDisplayFormAtTop) + { + // Displays the ticket details AFTER the actions + $oP->add('
'); + $oObj->DisplayBareProperties($oP); + $oP->add('
'); + } $iFieldsCount = count($aFieldsMap); $sJsonFieldsMap = json_encode($aFieldsMap);