diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 9ec6d46fe..5851b5d00 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1737,14 +1737,15 @@ EOF } } - $bDisplayActionsAtTop = MetaModel::GetConfig()->Get('display_actions_at_top'); + $sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position'); $iTransactionId = utils::GetNewTransactionId(); $oPage->SetTransactionId($iTransactionId); $oPage->add("
m_iFormId}\" enctype=\"multipart/form-data\" method=\"post\" onSubmit=\"return OnSubmit('form_{$this->m_iFormId}');\">\n"); $oPage->add_ready_script("$(window).unload(function() { OnUnload('$iTransactionId') } );\n"); - if ($bDisplayActionsAtTop) + if ($sButtonsPosition != 'bottom') { + // top or both, display the buttons here $oPage->add($sButtons); } @@ -1767,8 +1768,9 @@ EOF $oPage->add("\n"); } $oPage->add($oAppContext->GetForForm()); - if ($bDisplayActionsAtTop) + if ($sButtonsPosition != 'top') { + // bottom or both: display the buttons here $oPage->add($sButtons); } diff --git a/core/config.class.inc.php b/core/config.class.inc.php index c5b05a632..758f7630a 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -401,12 +401,12 @@ 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', + 'buttons_position' => array( + 'type' => 'string', + 'description' => 'Position of the forms buttons: bottom | top | both', // examples... not used - 'default' => true, - 'value' => false, + 'default' => 'both', + 'value' => 'both', 'source_of_value' => '', 'show_in_conf_sample' => true, ), diff --git a/pages/UI.php b/pages/UI.php index 61196f934..81f68c952 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -1577,10 +1577,10 @@ EOF $iFieldIndex++; } } - $bDisplayFormAtTop = MetaModel::GetConfig()->Get('display_actions_at_top'); - if (!$bDisplayFormAtTop) + $sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position'); + if ($sButtonsPosition != 'bottom') { - // Displays the ticket details BEFORE the actions + // top or both: Displays the ticket details BEFORE the actions $oP->add('
'); $oObj->DisplayBareProperties($oP); $oP->add('
'); @@ -1604,9 +1604,9 @@ EOF $oP->add("\n"); $oP->add("
\n"); $oP->add("\n"); - if ($bDisplayFormAtTop) + if ($sButtonsPosition == 'bottom') { - // Displays the ticket details BEFORE the actions + // bottom or both: Displays the ticket details AFTER the actions $oP->add('
'); $oObj->DisplayBareProperties($oP); $oP->add('
'); @@ -1800,10 +1800,10 @@ EOF $aTargetState = $aTargetStates[$sTargetState]; $aExpectedAttributes = $aTargetState['attribute_list']; $oP->add("

$sActionDetails

\n"); - $bDisplayFormAtTop = MetaModel::GetConfig()->Get('display_actions_at_top'); - if (!$bDisplayFormAtTop) + $sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position'); + if ($sButtonsPosition == 'bottom') { - // Displays the ticket details BEFORE the actions + // bottom: Displays the ticket details BEFORE the actions $oP->add('
'); $oObj->DisplayBareProperties($oP); $oP->add('
'); @@ -1882,9 +1882,9 @@ EOF $oP->add("\n"); $oP->add("\n"); $oP->add("\n"); - if ($bDisplayFormAtTop) + if ($sButtonsPosition != 'top') { - // Displays the ticket details AFTER the actions + // bottom or both: Displays the ticket details AFTER the actions $oP->add('
'); $oObj->DisplayBareProperties($oP); $oP->add('
');