NEW formconfirm can support field with format datetime

This commit is contained in:
Laurent Destailleur 2023-01-03 12:08:04 +01:00
parent e5a5237452
commit 7fd82ccc45

View File

@ -5010,7 +5010,7 @@ class Form
* @param string $question Question
* @param string $action Action
* @param array|string $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...'))
* 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'select', 'multiselect', 'morecss',
* 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss',
* 'other', 'onecolumn' or 'hidden'...
* @param int|string $selectedchoice '' or 'no', or 'yes' or '1', 1, '0' or 0
* @param int|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
@ -5141,11 +5141,11 @@ class Form
$more .= '</div></div>'."\n";
$i++;
}
} elseif ($input['type'] == 'date') {
} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
$more .= '<div class="tagtd">';
$addnowlink = (empty($input['datenow']) ? 0 : 1);
$more .= $this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, $addnowlink);
$more .= $this->selectDate($input['value'], $input['name'], ($input['type'] == 'datetime' ? 1 : 0), ($input['type'] == 'datetime' ? 1 : 0), 0, '', 1, $addnowlink);
$more .= '</div></div>'."\n";
$formquestion[] = array('name'=>$input['name'].'day');
$formquestion[] = array('name'=>$input['name'].'month');