For extrafield with date type show calendar instead basic input field
This commit is contained in:
parent
520e235207
commit
c53564c454
@ -582,7 +582,7 @@ class ExtraFields
|
|||||||
* Return HTML string to put an input field into a page
|
* Return HTML string to put an input field into a page
|
||||||
*
|
*
|
||||||
* @param string $key Key of attribute
|
* @param string $key Key of attribute
|
||||||
* @param string $value Value to show
|
* @param string $value Value to show (for date type it must be in timestamp format)
|
||||||
* @param string $moreparam To add more parametes on html input tag
|
* @param string $moreparam To add more parametes on html input tag
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -619,7 +619,13 @@ class ExtraFields
|
|||||||
{
|
{
|
||||||
$tmp=explode(',',$size);
|
$tmp=explode(',',$size);
|
||||||
$newsize=$tmp[0];
|
$newsize=$tmp[0];
|
||||||
$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
|
if(!class_exists('Form'))
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||||
|
$formstat = new Form($db);
|
||||||
|
|
||||||
|
$showtime = in_array($type,array('datetime')) ? 1 : 0;
|
||||||
|
$out = $formstat->select_date($value, 'options_'.$key, $showtime, $showtime, $required, '', 1, 1, 0, 0, 1);
|
||||||
|
//$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
|
||||||
}
|
}
|
||||||
elseif (in_array($type,array('int','double')))
|
elseif (in_array($type,array('int','double')))
|
||||||
{
|
{
|
||||||
@ -670,9 +676,10 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
$out.='</select>';
|
$out.='</select>';
|
||||||
}
|
}
|
||||||
// Add comments
|
/* Add comments
|
||||||
if ($type == 'date') $out.=' (YYYY-MM-DD)';
|
if ($type == 'date') $out.=' (YYYY-MM-DD)';
|
||||||
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
|
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
|
||||||
|
*/
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user