mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-06-27 00:54:25 +02:00
GeneralForm: Code fixes
Made that the user's last configuration is previewed in case the input is invalid. refs #4609
This commit is contained in:
parent
29068269dc
commit
cb8bf4cba7
@ -66,7 +66,7 @@ class GeneralForm extends Form
|
|||||||
*
|
*
|
||||||
* @var null
|
* @var null
|
||||||
*/
|
*/
|
||||||
private $resources = null;
|
private $resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The view helper to format date/time strings
|
* The view helper to format date/time strings
|
||||||
@ -239,7 +239,10 @@ class GeneralForm extends Form
|
|||||||
$phpUrl = '<a href="http://php.net/manual/en/function.date.php" target="_new">'
|
$phpUrl = '<a href="http://php.net/manual/en/function.date.php" target="_new">'
|
||||||
. 'the official PHP documentation</a>';
|
. 'the official PHP documentation</a>';
|
||||||
|
|
||||||
$dateFormatValue = $this->getRequest()->getParam('date_format', $cfg->get('dateFormat', 'd/m/Y'));
|
$dateFormatValue = $this->getRequest()->getParam('date_format', '');
|
||||||
|
if (empty($dateFormatValue)) {
|
||||||
|
$dateFormatValue = $cfg->get('dateFormat', 'd/m/Y');
|
||||||
|
}
|
||||||
$txtDefaultDateFormat = new Zend_Form_Element_Text(
|
$txtDefaultDateFormat = new Zend_Form_Element_Text(
|
||||||
array(
|
array(
|
||||||
'name' => 'date_format',
|
'name' => 'date_format',
|
||||||
@ -253,7 +256,10 @@ class GeneralForm extends Form
|
|||||||
$this->addElement($txtDefaultDateFormat);
|
$this->addElement($txtDefaultDateFormat);
|
||||||
$txtDefaultDateFormat->addValidator(new DateFormatValidator());
|
$txtDefaultDateFormat->addValidator(new DateFormatValidator());
|
||||||
|
|
||||||
$timeFormatValue = $this->getRequest()->getParam('time_format', $cfg->get('timeFormat', 'g:i A'));
|
$timeFormatValue = $this->getRequest()->getParam('time_format', '');
|
||||||
|
if (empty($timeFormatValue)) {
|
||||||
|
$timeFormatValue = $cfg->get('timeFormat', 'g:i A');
|
||||||
|
}
|
||||||
$txtDefaultTimeFormat = new Zend_Form_Element_Text(
|
$txtDefaultTimeFormat = new Zend_Form_Element_Text(
|
||||||
array(
|
array(
|
||||||
'name' => 'time_format',
|
'name' => 'time_format',
|
||||||
|
@ -192,10 +192,10 @@ class GeneralForm extends Form
|
|||||||
'required' => true
|
'required' => true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$dateFormatValue = $this->getRequest()->getParam(
|
$dateFormatValue = $this->getRequest()->getParam('date_format', '');
|
||||||
'date_format',
|
if (empty($dateFormatValue)) {
|
||||||
$prefs->get('app.dateFormat', $cfg->get('dateFormat', 'd/m/Y'))
|
$dateFormatValue = $prefs->get('app.dateFormat', $cfg->get('dateFormat', 'd/m/Y'));
|
||||||
);
|
}
|
||||||
$txtDefaultDateFormat = new Zend_Form_Element_Text(
|
$txtDefaultDateFormat = new Zend_Form_Element_Text(
|
||||||
array(
|
array(
|
||||||
'name' => 'date_format',
|
'name' => 'date_format',
|
||||||
@ -222,10 +222,10 @@ class GeneralForm extends Form
|
|||||||
'required' => !$useGlobalTimeFormat
|
'required' => !$useGlobalTimeFormat
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$timeFormatValue = $this->getRequest()->getParam(
|
$timeFormatValue = $this->getRequest()->getParam('time_format', '');
|
||||||
'time_format',
|
if (empty($timeFormatValue)) {
|
||||||
$prefs->get('app.timeFormat', $cfg->get('timeFormat', 'g:i A'))
|
$timeFormatValue = $prefs->get('app.timeFormat', $cfg->get('timeFormat', 'g:i A'));
|
||||||
);
|
}
|
||||||
$txtDefaultTimeFormat = new Zend_Form_Element_Text(
|
$txtDefaultTimeFormat = new Zend_Form_Element_Text(
|
||||||
array(
|
array(
|
||||||
'name' => 'time_format',
|
'name' => 'time_format',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user