diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 71f6df7c1cb..f3d61f71fdc 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -90,9 +90,9 @@ class ExtraFields 'ip' => 'ExtrafieldIP', 'icon' => 'Icon', 'password' => 'ExtrafieldPassword', + 'radio' => 'ExtrafieldRadio', 'select' => 'ExtrafieldSelect', 'sellist' => 'ExtrafieldSelectList', - 'radio' => 'ExtrafieldRadio', 'checkbox' => 'ExtrafieldCheckBox', 'chkbxlst' => 'ExtrafieldCheckBoxFromList', 'link' => 'ExtrafieldLink', @@ -2585,23 +2585,24 @@ class ExtraFields { global $langs; + $arraytype2label = array(''); + $tmptype2label = ExtraFields::$type2label; - $type2label = array(''); foreach ($tmptype2label as $key => $val) { - $type2label[$key] = $langs->transnoentitiesnoconv($val); + $arraytype2label[$key] = $langs->transnoentitiesnoconv($val); } if (!getDolGlobalString('MAIN_USE_EXTRAFIELDS_ICON')) { - unset($type2label['icon']); + unset($arraytype2label['icon']); } if (!getDolGlobalString('MAIN_USE_GEOPHP')) { - unset($type2label['point']); - unset($type2label['multipts']); - unset($type2label['linestrg']); - unset($type2label['polygon']); + unset($arraytype2label['point']); + unset($arraytype2label['multipts']); + unset($arraytype2label['linestrg']); + unset($arraytype2label['polygon']); } - return $type2label; + return $arraytype2label; } /** diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5a6dada732a..14b4f94b15e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4860,8 +4860,8 @@ function getPictoForType($key, $morecss = '') 'select' => 'list', 'sellist' => 'list', 'radio' => 'check-circle', - 'checkbox' => 'check-square', - 'chkbxlst' => 'check-square', + 'checkbox' => 'list', + 'chkbxlst' => 'list', 'link' => 'link', 'icon' => "question", 'point' => "country", diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 94a7f990810..254442a8df4 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -223,7 +223,8 @@ if (in_array($type, array_keys($typewecanchangeinto))) { } print $formadmin->selectTypeOfFields('type', GETPOST('type', 'alpha') ? GETPOST('type', 'alpha') : $type, $typewecanchangeinto); } else { - print getPictoForType($type).$type2label[$type]; + print getPictoForType($type); + print $type2label[$type]; print ''; } ?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 737b283f08e..bd7939331c9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -454,13 +454,13 @@ ExtrafieldPriceWithCurrency=Price with currency ExtrafieldMail = Email ExtrafieldUrl = Url ExtrafieldIP = IP -ExtrafieldSelect = Select list -ExtrafieldSelectList = Select from table +ExtrafieldSelect=Select list +ExtrafieldSelectList=Select from table ExtrafieldSeparator=Separator (not a field) ExtrafieldPassword=Password -ExtrafieldRadio=Radio buttons (one choice only) -ExtrafieldCheckBox=Checkboxes -ExtrafieldCheckBoxFromList=Checkboxes from table +ExtrafieldRadio=Radio buttons (1 choice only) +ExtrafieldCheckBox=Select list (n choices) +ExtrafieldCheckBoxFromList=Select from table (n choices) ExtrafieldLink=Link to an object ExtrafieldPointGeo=Geometric Point ExtrafieldMultiPointGeo=Geometric Multi Point @@ -475,7 +475,7 @@ ExtrafieldParamHelpselect=List of values must be lines with format key,value (wh ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
3,value3
... ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
3,value3
... ExtrafieldParamHelpsellist=List of values comes from a table
Syntax: table_name:label_field:id_field::filtersql
Example: c_typent:libelle:id::filtersql

- id_field is necessarily a primary int key
- filtersql is a condition. It must use the USF syntax. Example: (active:=:1) to display only active value
You can also use $ID$ in filter which is the current id of current object
If you want to filter on extrafields use syntax extra.fieldcode=... (where fieldcode is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter -ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax: table_name:label_field:id_field::filtersql
Example: c_typent:libelle:id::filtersql

filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax: table_name:label_field:id_field::filtersql
Example: c_typent:libelle:id::filtersql

filter can be a simple test (eg active=1 to display only active value)
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax: ObjectName:Classpath ExtrafieldParamHelpSeparator=Keep empty for a simple separator
Set this to 1 for a collapsing separator (open by default for new session, then status is kept for each user session)
Set this to 2 for a collapsing separator (collapsed by default for new session, then status is kept fore each user session) LibraryToBuildPDF=Library used for PDF generation