BUG-14788 Error en alerta de Campo Requerido
Al pasar de formulario no se valida el contenido de un campo tipo date
This commit is contained in:
@@ -4299,7 +4299,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText
|
|||||||
public $editable;
|
public $editable;
|
||||||
public $onchange;
|
public $onchange;
|
||||||
public $renderMode = '';
|
public $renderMode = '';
|
||||||
public $gridFieldType = '';
|
public $gridFieldType = 'date';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Verify the format of a date
|
* Verify the format of a date
|
||||||
@@ -4441,7 +4441,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText
|
|||||||
* @return <String>
|
* @return <String>
|
||||||
*/
|
*/
|
||||||
public function __draw_widget ($pID, $value, $owner = '', $inGrid = false)
|
public function __draw_widget ($pID, $value, $owner = '', $inGrid = false)
|
||||||
{
|
{
|
||||||
$startDate = G::replaceDataField( $this->startDate, $owner->values );
|
$startDate = G::replaceDataField( $this->startDate, $owner->values );
|
||||||
$endDate = G::replaceDataField( $this->endDate, $owner->values );
|
$endDate = G::replaceDataField( $this->endDate, $owner->values );
|
||||||
$beforeDate = G::replaceDataField( $this->beforeDate, $owner->values );
|
$beforeDate = G::replaceDataField( $this->beforeDate, $owner->values );
|
||||||
@@ -4560,17 +4560,25 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText
|
|||||||
$Time = "true";
|
$Time = "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
//$sizeend = strlen($valueDemo) + 3;
|
|
||||||
$sizeend = $this->size;
|
$sizeend = $this->size;
|
||||||
|
|
||||||
if ($this->required) {
|
if ($this->required) {
|
||||||
$isRequired = '1';
|
$isRequired = '1';
|
||||||
} else {
|
} else {
|
||||||
$isRequired = '0';
|
$isRequired = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($inGrid) {
|
||||||
|
$pmtype = 'pmgridtype="date"';
|
||||||
|
} else {
|
||||||
|
$pmtype = 'pmfieldtype="date"';
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->editable != "0") {
|
if ($this->editable != "0") {
|
||||||
$html = '<input ' . $this->NSFieldType() . ' pm:required="' . $isRequired . '" id="' . $pID . '" name="' . $pID . '" pm:mask="' . $mask . '" pm:start="' . $startDate . '" pm:end="' . $endDate . '" pm:time="' . $Time . '" ' . $onchange . ' class="module_app_input___gray" size="' . $sizeend . '" value="' . $value . '" pm:defaultvalue="' . $defaultValue . '" />' . '<a onclick="removeValue(\'' . $pID . '\'); return false;" style="position:relative;left:-17px;top:2px;" >' . ' <img src="/images/icons_silk/calendar_x_button.png" />' . '</a>' . '<a id="' . $pID . '[btn]" style="position: relative; top: 2px; left: -16px;" >' . ' <img src="/images/pmdateicon.png" border="0" width="12" height="14" />' . '</a>' . '<script>datePicker4("", \'' . $pID . '\', \'' . $mask . '\', \'' . $startDate . '\', \'' . $endDate . '\',' . $Time . ')</script>';
|
$html = '<input '.$pmtype.' pm:required="' . $isRequired . '" id="' . $pID . '" name="' . $pID . '" pm:mask="' . $mask . '" pm:start="' . $startDate . '" pm:end="' . $endDate . '" pm:time="' . $Time . '" class="module_app_input___gray" size="' . $sizeend . '" value="' . $value . '" pm:defaultvalue="' . $defaultValue . '" />';
|
||||||
|
$html .= '<a onclick="removeValue(\'' . $pID . '\'); return false;" style="position:relative;left:-17px;top:2px;" ><img src="/images/icons_silk/calendar_x_button.png" /></a>';
|
||||||
|
$html .= '<a id="' . $pID . '[btn]" style="position: relative; top: 2px; left: -16px;" ><img src="/images/pmdateicon.png" border="0" width="12" height="14" /></a>';
|
||||||
|
$html .= '<script>datePicker4("", \'' . $pID . '\', \'' . $mask . '\', \'' . $startDate . '\', \'' . $endDate . '\',' . $Time . ')</script>';
|
||||||
} else {
|
} else {
|
||||||
$html = '<input pm:required="' . $isRequired . '" id="' . $pID . '" name="' . $pID . '" pm:mask="' . $mask . '" pm:start="' . $startDate . '" pm:end="' . $endDate . '" pm:time="' . $Time . '" ' . $onchange . ' class="module_app_input___gray" size="' . $sizeend . '" value="' . $value . '" pm:defaultvalue="' . $defaultValue . '" readonly="readonly" />' . '<a onclick="removeValue(\'' . $pID . '\'); return false;" style="position:relative;left:-17px;top:2px;" >' . ' <img src="/images/icons_silk/calendar_x_button.png" />' . '</a>' . '<a id="' . $pID . '[btn]" style="position: relative; top: 2px; left: -16px;" >' . ' <img src="/images/pmdateicon.png" border="0" width="12" height="14" />' . '</a>' . '<script>datePicker4("", \'' . $pID . '\', \'' . $mask . '\', \'' . $startDate . '\', \'' . $endDate . '\',' . $Time . ')</script>';
|
$html = '<input pm:required="' . $isRequired . '" id="' . $pID . '" name="' . $pID . '" pm:mask="' . $mask . '" pm:start="' . $startDate . '" pm:end="' . $endDate . '" pm:time="' . $Time . '" ' . $onchange . ' class="module_app_input___gray" size="' . $sizeend . '" value="' . $value . '" pm:defaultvalue="' . $defaultValue . '" readonly="readonly" />' . '<a onclick="removeValue(\'' . $pID . '\'); return false;" style="position:relative;left:-17px;top:2px;" >' . ' <img src="/images/icons_silk/calendar_x_button.png" />' . '</a>' . '<a id="' . $pID . '[btn]" style="position: relative; top: 2px; left: -16px;" >' . ' <img src="/images/pmdateicon.png" border="0" width="12" height="14" />' . '</a>' . '<script>datePicker4("", \'' . $pID . '\', \'' . $mask . '\', \'' . $startDate . '\', \'' . $endDate . '\',' . $Time . ')</script>';
|
||||||
}
|
}
|
||||||
@@ -4593,9 +4601,9 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText
|
|||||||
* $html .= '<input type="hidden" id="'.$idIsoDate.'" name="'.$idIsoDate.'" value="'.$valisoDate.'"/>';
|
* $html .= '<input type="hidden" id="'.$idIsoDate.'" name="'.$idIsoDate.'" value="'.$valisoDate.'"/>';
|
||||||
* *
|
* *
|
||||||
*/
|
*/
|
||||||
if ($this->gridFieldType == '') {
|
/*if ($this->gridFieldType == '') {
|
||||||
$html .= $this->renderHint();
|
$html .= $this->renderHint();
|
||||||
}
|
}*/
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user