mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Fix for Trac #569: Mandatory date (and time) fields are prefilled with the current date (and time).
SVN:trunk[2483]
This commit is contained in:
@@ -1513,6 +1513,10 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
||||
$aEventsList[] ='validate';
|
||||
$aEventsList[] ='keyup';
|
||||
$aEventsList[] ='change';
|
||||
if (($iFlags & OPT_ATT_MANDATORY) && (empty($sDisplayValue)))
|
||||
{
|
||||
$sDisplayValue = date($oAttDef->GetDateFormat());
|
||||
}
|
||||
$sHTMLValue = "<input title=\"$sHelpText\" class=\"date-pick\" type=\"text\" size=\"12\" name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" value=\"".htmlentities($sDisplayValue, ENT_QUOTES, 'UTF-8')."\" id=\"$iId\"/> {$sValidationField}";
|
||||
break;
|
||||
|
||||
@@ -1520,6 +1524,10 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
||||
$aEventsList[] ='validate';
|
||||
$aEventsList[] ='keyup';
|
||||
$aEventsList[] ='change';
|
||||
if (($iFlags & OPT_ATT_MANDATORY) && (empty($sDisplayValue)))
|
||||
{
|
||||
$sDisplayValue = date($oAttDef->GetDateFormat());
|
||||
}
|
||||
$sHTMLValue = "<input title=\"$sHelpText\" class=\"datetime-pick\" type=\"text\" size=\"20\" name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" value=\"".htmlentities($sDisplayValue, ENT_QUOTES, 'UTF-8')."\" id=\"$iId\"/> {$sValidationField}";
|
||||
break;
|
||||
|
||||
|
||||
@@ -2384,7 +2384,7 @@ class AttributeEnum extends AttributeString
|
||||
*/
|
||||
class AttributeDateTime extends AttributeDBField
|
||||
{
|
||||
static protected function GetDateFormat()
|
||||
static public function GetDateFormat()
|
||||
{
|
||||
return "Y-m-d H:i:s";
|
||||
}
|
||||
@@ -2692,7 +2692,7 @@ class AttributeDate extends AttributeDateTime
|
||||
{
|
||||
const MYDATEFORMAT = "Y-m-d";
|
||||
|
||||
static protected function GetDateFormat()
|
||||
static public function GetDateFormat()
|
||||
{
|
||||
return "Y-m-d";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user