From f37d48233183d8fc1c7cf24a167d83cfd013c696 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 9 Mar 2018 11:37:23 +0100 Subject: [PATCH 1/6] fix warning and sql error --- htdocs/blockedlog/class/blockedlog.class.php | 1 + htdocs/core/modules/modFournisseur.class.php | 6 +++++- htdocs/holiday/define_holiday.php | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 8c35ec11834..77bf90e2717 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -103,6 +103,7 @@ class BlockedLog public $ref_object = ''; public $object_data = null; + public $user_fullname=''; /** * Array of tracked event codes diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 9e8bdc8ea03..d8ed86907fd 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -531,7 +531,11 @@ class modFournisseur extends DolibarrModules case 'sellist': $tmp=''; $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp=array_shift(array_keys($tmpparam['options'])); + + if ($tmpparam['options'] && is_array($tmpparam['options'])) { + $tmpparam_param_key=array_keys($tmpparam['options']); + $tmp=array_shift($tmpparam_param_key); + } if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; break; } diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index a7d4789468e..e5bd8c0e8c0 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -216,8 +216,9 @@ if (empty($user->rights->holiday->read_all)) $userchilds=$user->getAllChildIds(1); $filters.=' AND u.rowid IN ('.join(', ',$userchilds).')'; } - -$filters.=natural_search(array('u.firstname','u.lastname'), $search_name); +if (!empty($search_name)) { + $filters.=natural_search(array('u.firstname','u.lastname'), $search_name); +} if ($search_supervisor > 0) $filters.=natural_search(array('u.fk_user'), $search_supervisor, 2); $listUsers = $holiday->fetchUsers(false, true, $filters); From ee557768865200c759948872bd4aa6919f0b811a Mon Sep 17 00:00:00 2001 From: Romain DELVAL Date: Fri, 9 Mar 2018 12:38:28 +0100 Subject: [PATCH 2/6] FIX Duplicate product_type asignement on order addline On addline order method, ther is a duplicate assignation on line->product_type before call to "insert" method. The second assignement always make product_type to "0" while it was fetched from product himsel like it was made on first asignement few lines above --- htdocs/commande/class/commande.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c107dff6960..b7b92eb997d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1405,7 +1405,6 @@ class Commande extends CommonOrder $this->line->total_localtax1=$total_localtax1; $this->line->total_localtax2=$total_localtax2; $this->line->total_ttc=$total_ttc; - $this->line->product_type=$type; $this->line->special_code=$special_code; $this->line->origin=$origin; $this->line->origin_id=$origin_id; From 5a56e802d9bcdc39409394539a98153b16d18033 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 9 Mar 2018 19:10:52 +0100 Subject: [PATCH 3/6] FIX #8232 --- htdocs/core/class/commonobject.class.php | 4 +++- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 54eeffdc4b6..a632a29b0f3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5835,9 +5835,11 @@ abstract class CommonObject jQuery(document).ready(function() { function showOptions(child_list, parent_list) { - var val = $("select[name=\"options_"+parent_list+"\"]").val(); + var val = $("select[name="+parent_list+"]").val(); + var parentVal = parent_list + ":" + val; if(val > 0) { + $("select[name=\""+child_list+"\"] option[parent]").hide(); $("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show(); } else { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 3559df44c9c..e7abadac599 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -151,7 +151,7 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][ jQuery(document).ready(function() { function showOptions(child_list, parent_list) { - var val = $("select[name=\"options_"+parent_list+"\"]").val(); + var val = $("select[name="+parent_list+"]").val(); var parentVal = parent_list + ":" + val; if(val > 0) { $("select[name=\""+child_list+"\"] option[parent]").hide(); From 02beed265eac5f9e6acd27c7fccafe6e96301973 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 9 Mar 2018 19:14:43 +0100 Subject: [PATCH 4/6] better space --- htdocs/core/class/commonobject.class.php | 3 +-- htdocs/core/tpl/extrafields_view.tpl.php | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a632a29b0f3..d9e08070f8b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5836,10 +5836,9 @@ abstract class CommonObject function showOptions(child_list, parent_list) { var val = $("select[name="+parent_list+"]").val(); - var parentVal = parent_list + ":" + val; - if(val > 0) { + if(val > 0) { $("select[name=\""+child_list+"\"] option[parent]").hide(); $("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show(); } else { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index e7abadac599..dffd0e739f6 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -153,6 +153,7 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][ { var val = $("select[name="+parent_list+"]").val(); var parentVal = parent_list + ":" + val; + if(val > 0) { $("select[name=\""+child_list+"\"] option[parent]").hide(); $("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show(); From 42fed5981d2f5617188d55ce0c6be73263255856 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 9 Mar 2018 19:16:06 +0100 Subject: [PATCH 5/6] bettre syntax --- htdocs/core/class/commonobject.class.php | 1 - htdocs/core/tpl/extrafields_view.tpl.php | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d9e08070f8b..d55e564d774 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5837,7 +5837,6 @@ abstract class CommonObject { var val = $("select[name="+parent_list+"]").val(); var parentVal = parent_list + ":" + val; - if(val > 0) { $("select[name=\""+child_list+"\"] option[parent]").hide(); $("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show(); diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index dffd0e739f6..e7abadac599 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -153,7 +153,6 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][ { var val = $("select[name="+parent_list+"]").val(); var parentVal = parent_list + ":" + val; - if(val > 0) { $("select[name=\""+child_list+"\"] option[parent]").hide(); $("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show(); From d82c62b638191f5ec960af456c8a841e306f8210 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 9 Mar 2018 21:51:59 +0100 Subject: [PATCH 6/6] Fix supplier order clone was keeping objectlinked --- htdocs/fourn/class/fournisseur.commande.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index a42546fdb84..a58f33502aa 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -321,8 +321,6 @@ class CommandeFournisseur extends CommonOrder if ($this->statut == 0) $this->brouillon = 1; - $this->fetchObjectLinked(); - //$result=$this->fetch_lines(); $this->lines=array();