2
0
forked from Wavyzz/dolibarr

Merge origin/patch-modulebuilder-supportsellist into patch-modulebuilder-supportsellist

This commit is contained in:
patrick Delcroix
2018-05-26 23:43:17 +02:00
2 changed files with 6 additions and 7 deletions

View File

@@ -5033,10 +5033,11 @@ abstract class CommonObject
* @param string $moreparam To add more parameters on html input tag * @param string $moreparam To add more parameters on html input tag
* @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names)
* @param string|int $showsize Value for css to define size. May also be a numeric. * @param string|int $morecss Value for css to define style/length of field. May also be a numeric.
* @return string * @return string
*/ */
function showInputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss=0){ function showInputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss=0)
{
global $conf,$langs,$form; global $conf,$langs,$form;
if (! is_object($form)) if (! is_object($form))
@@ -5044,13 +5045,13 @@ abstract class CommonObject
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form=new Form($this->db); $form=new Form($this->db);
} }
$val=$this->fields[$key];
$val=$this->fields[$key];
$out=''; $out='';
$type=''; $type='';
$param['options']=array(); $param['options']=array();
$size =$this->fields[$key]['size']; $size =$this->fields[$key]['size'];
$keyprefix = $keyprefix.'options_';
// Because we work on extrafields // Because we work on extrafields
if(preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)){ if(preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)){
$param['options']=array($reg[1].':'.$reg[2]=>'N'); $param['options']=array($reg[1].':'.$reg[2]=>'N');
@@ -5081,7 +5082,6 @@ $val=$this->fields[$key];
} }
$label=$this->fields[$key]['label']; $label=$this->fields[$key]['label'];
$size =$this->fields[$key]['size'];
//$elementtype=$this->fields[$key]['elementtype']; // Seems not used //$elementtype=$this->fields[$key]['elementtype']; // Seems not used
$default=$this->fields[$key]['default']; $default=$this->fields[$key]['default'];
$computed=$this->fields[$key]['computed']; $computed=$this->fields[$key]['computed'];
@@ -5108,7 +5108,6 @@ $val=$this->fields[$key];
$showsize = $val['css']; $showsize = $val['css'];
} }
if (empty($morecss)) if (empty($morecss))
{ {
if ($type == 'date') if ($type == 'date')
{ {

View File

@@ -64,7 +64,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
return -2; return -2;
} }
if (! preg_match('/^(price|boolean|sellist|integer|date|timestamp|varchar|double)/', $addfieldentry['type'])) if (! preg_match('/^(price|boolean|sellist|integer|date|timestamp|varchar|double|text|html)/', $addfieldentry['type']))
{ {
setEventMessages($langs->trans('BadFormatForType', $objectname), null, 'errors'); setEventMessages($langs->trans('BadFormatForType', $objectname), null, 'errors');