From b3ca9de39947ecdc77dcc35142174db7797963ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Jun 2013 02:09:34 +0200 Subject: [PATCH 1/7] Fix: Update select with list --- htdocs/core/modules/modSociete.class.php | 54 +++++++++---------- .../core/tpl/admin_extrafields_edit.tpl.php | 14 ++--- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 93700ec55b2..0f2e7ed5bb6 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -258,33 +258,33 @@ class modSociete extends DolibarrModules $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { - while ($obj=$this->db->fetch_object($resql)) - { - $fieldname='extra.'.$obj->name; - $fieldlabel=ucfirst($obj->label); - $typeFilter="Text"; - switch($obj->type) - { - case 'int': - case 'double': - case 'price': - $typeFilter="Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter="Date"; - break; - case 'boolean': - $typeFilter="Boolean"; - break; - case 'sellist': - $typeFilter="List:".$obj->param; - break; - } - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]='company'; - } + while ($obj=$this->db->fetch_object($resql)) + { + $fieldname='extra.'.$obj->name; + $fieldlabel=ucfirst($obj->label); + $typeFilter="Text"; + switch($obj->type) + { + case 'int': + case 'double': + case 'price': + $typeFilter="Numeric"; + break; + case 'date': + case 'datetime': + $typeFilter="Date"; + break; + case 'boolean': + $typeFilter="Boolean"; + break; + case 'sellist': + $typeFilter="List:".$obj->param; + break; + } + $this->export_fields_array[$r][$fieldname]=$fieldlabel; + $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; + $this->export_entities_array[$r][$fieldname]='company'; + } } // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 25c8ede2227..3d1bdc4a9be 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -61,12 +61,14 @@ if((($type == 'select') || ($type == 'checkbox') ||(($type == 'radio'))) && is_a $param_chain = ''; foreach ($param['options'] as $key => $value) { - if(strlen($key)) + if(strlen($key)) { - $param_chain .= $key.', '.$value."\n"; + $param_chain .= $key.','.$value."\n"; } } -}elseif ($type== 'sellist') { +} +elseif ($type== 'sellist') +{ $paramlist=array_keys($param['options']); $param_chain = $paramlist[0]; } @@ -83,8 +85,8 @@ if((($type == 'select') || ($type == 'checkbox') ||(($type == 'radio'))) && is_a - @@ -99,7 +101,7 @@ if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($typ - From 8ed5dfededf4ac88ca57fc44f94b9d492b93fb60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Jun 2013 02:15:43 +0200 Subject: [PATCH 2/7] Fix: Bad styles of html elements --- htdocs/core/class/extrafields.class.php | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 146237122ca..206856c3530 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -559,7 +559,7 @@ class ExtraFields $this->attribute_pos[$tab->name]=$tab->pos; } } - + return $array_name_label; } else @@ -626,11 +626,11 @@ class ExtraFields { $tmp=explode(',',$size); $newsize=$tmp[0]; - $out=''; + $out=''; } elseif ($type == 'varchar') { - $out=''; + $out=''; } elseif ($type == 'text') { @@ -646,27 +646,27 @@ class ExtraFields } else { $checked=' value="1" '; } - $out=''; + $out=''; } elseif ($type == 'mail') { - $out=''; + $out=''; } elseif ($type == 'phone') { - $out=''; + $out=''; } elseif ($type == 'price') { - $out=' '.$langs->getCurrencySymbol($conf->currency); + $out=' '.$langs->getCurrencySymbol($conf->currency); } elseif ($type == 'double') { - $out=' '; + $out=' '; } elseif ($type == 'select') { - $out=''; foreach ($param['options'] as $key=>$val ) { $out.='