From b1469ba7617f60f76d7ed96f455b30470d850e27 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 9 Apr 2018 07:06:20 +0200 Subject: [PATCH 01/16] add doActions hook on projettaskcard --- htdocs/projet/tasks.php | 4 +++- htdocs/projet/tasks/task.php | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index c00e93e239f..9121f0d5776 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -77,7 +77,9 @@ $planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60; $userAccess=0; - +$parameters=array('id'=>$id); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /* * Actions */ diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index db56534f851..24799c18354 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -60,6 +60,9 @@ $projectstatic = new Project($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); +$parameters=array('id'=>$id); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /* * Actions From 976b5c26c76335e59dc1fb8ec8858a2a095b101d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Apr 2018 12:26:39 +0200 Subject: [PATCH 02/16] Fix: TODO get_charset() function don't exists --- htdocs/install/upgrade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index fce91f7925d..6186cee02b3 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -183,7 +183,8 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 print ''.$langs->trans("ServerVersion").''; print ''.$version.''; dolibarr_install_syslog("upgrade: " . $langs->transnoentities("ServerVersion") . ": " .$version); - if ($db->type == 'mysqli') + // TODO get_charset() function don't exists + /*if ($db->type == 'mysqli') { $tmparray = $db->db->get_charset(); print ''.$langs->trans("ClientCharset").''; @@ -192,7 +193,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 print ''.$langs->trans("ClientSortingCharset").''; print ''.$tmparray->collation.''; dolibarr_install_syslog("upgrade: " . $langs->transnoentities("ClientCollation") . ": " .$tmparray->collation); - } + }*/ // Test database version requirement $versionmindb=explode('.',$db::VERSIONMIN); From 89ec185f514528c5461a1776b54410b02ce967c8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Apr 2018 12:53:03 +0200 Subject: [PATCH 03/16] Fix: avoid Error: Call to undefined method mysqli::get_charset() --- htdocs/install/upgrade.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 6186cee02b3..5132168c076 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -183,8 +183,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 print ''.$langs->trans("ServerVersion").''; print ''.$version.''; dolibarr_install_syslog("upgrade: " . $langs->transnoentities("ServerVersion") . ": " .$version); - // TODO get_charset() function don't exists - /*if ($db->type == 'mysqli') + if ($db->type == 'mysqli' && function_exists('mysqli_get_charset')) { $tmparray = $db->db->get_charset(); print ''.$langs->trans("ClientCharset").''; @@ -193,7 +192,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 print ''.$langs->trans("ClientSortingCharset").''; print ''.$tmparray->collation.''; dolibarr_install_syslog("upgrade: " . $langs->transnoentities("ClientCollation") . ": " .$tmparray->collation); - }*/ + } // Test database version requirement $versionmindb=explode('.',$db::VERSIONMIN); From 97bf6fff7f8ed115355a907909f07a3534b2a1de Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Apr 2018 08:07:23 +0200 Subject: [PATCH 04/16] Fix: missing User object with API REST --- htdocs/blockedlog/class/blockedlog.class.php | 5 ++++- .../interface_50_modBlockedlog_ActionsBlockedLog.class.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 77bf90e2717..20dda286dbd 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -313,12 +313,15 @@ class BlockedLog * @param Object $object object to store * @param string $action action * @param string $amounts amounts + * @param User $fuser User object (forced) * @return int >0 if OK, <0 if KO */ - public function setObjectData(&$object, $action, $amounts) + public function setObjectData(&$object, $action, $amounts, $fuser = null) { global $langs, $user, $mysoc; + if (is_object($fuser)) $user = $fuser; + // Generic fields // action diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index f97d1400018..6666cdec47b 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -111,7 +111,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers return 0; // not implemented action log } - $result = $b->setObjectData($object, $action, $amounts); // Set field date_object, ref_object, fk_object, element, object_data + $result = $b->setObjectData($object, $action, $amounts, $user); // Set field date_object, ref_object, fk_object, element, object_data if ($result < 0) { From 6277928b6773f2e02ac1bc65085c6727a3084665 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 10 Apr 2018 14:01:35 +0200 Subject: [PATCH 05/16] FIX issue #8470 --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e36caf49a3e..9dcd4c67035 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -942,7 +942,7 @@ class Societe extends CommonObject $sql .= ",fk_effectif = ".(! empty($this->effectif_id)?"'".$this->db->escape($this->effectif_id)."'":"null"); if (isset($this->stcomm_id)) { - $sql .= ",fk_stcomm=".($this->stcomm_id > 0 ? $this->stcomm_id : "0"); + $sql .= ",fk_stcomm=".(!empty($this->stcomm_id) ? $this->stcomm_id : "0"); } $sql .= ",fk_typent = ".(! empty($this->typent_id)?"'".$this->db->escape($this->typent_id)."'":"0"); From d24b36f768e921763e978924db5c412366ea0a82 Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Tue, 10 Apr 2018 14:10:40 +0200 Subject: [PATCH 06/16] FIX #8359 --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index daa5ade05b5..c613190588a 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -674,7 +674,7 @@ if ($type == Categorie::TYPE_PROJECT) { print "\t".''."\n"; print ''; - print $project->getNomUrl(1,0); + print $project->getNomUrl(1); print "\n"; print ''.$project->ref."\n"; print ''.$project->title."\n"; From cb1a011b507d83da73823a09aead4a81b567d163 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 10 Apr 2018 14:14:16 +0200 Subject: [PATCH 07/16] Fix default currency not set on supplier order creation from commercial menu #8459 --- htdocs/fourn/commande/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ad27a496672..294f1da7f62 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1356,6 +1356,8 @@ if ($action=='create') dol_htmloutput_events(); + $currency_code = $conf->currency; + $societe=''; if ($socid>0) { From 307ede8b22180dfbb531160036c321c10f319819 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Tue, 10 Apr 2018 15:03:50 +0200 Subject: [PATCH 08/16] FIX: weird password autocompletion in Goocle Chrome (issue #8479) --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 495ff14a062..5e83ee81fd0 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1990,7 +1990,7 @@ else } else if ($caneditpassword) { - $text=''; + $text=''; if ($dolibarr_main_authentication && $dolibarr_main_authentication == 'http') { $text=$form->textwithpicto($text,$langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless",$dolibarr_main_authentication),1,'warning'); From 809b2a91ed4bfacb8797f45306312241bd7076bd Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 10 Apr 2018 16:27:18 +0200 Subject: [PATCH 09/16] FIX issue #8037 --- htdocs/product/traduction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 791da80c05d..b8cdb1fbe39 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -251,7 +251,7 @@ if ($action == 'edit') print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans('Label').'
'.$langs->trans('Label').'
'.$langs->trans('Description').''; $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); From 7cdc1c8befef03b8e8fe34e88574e2f8455947d9 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 11 Apr 2018 07:08:40 +0200 Subject: [PATCH 10/16] Fix #8259 can't update contact birthday with REST API --- htdocs/contact/class/contact.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 21c7527dae2..63bc433535b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -311,6 +311,7 @@ class Contact extends CommonObject $sql .= ", email='".$this->db->escape($this->email)."'"; $sql .= ", skype='".$this->db->escape($this->skype)."'"; $sql .= ", photo='".$this->db->escape($this->photo)."'"; + $sql .= ", birthday='".$this->db->idate($this->birthday)."'"; $sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); $sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null"); $sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null"); From 2c76a6cd807f3dcf89d3892dda4e9d1e909a2672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Apr 2018 11:44:22 +0200 Subject: [PATCH 11/16] Update combinations.php --- htdocs/variants/combinations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 0ec1bf07b68..8b3335a37d6 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -383,7 +383,7 @@ if (! empty($id) || ! empty($ref)) select.empty().append(''); - jQuery.getJSON("", { + jQuery.getJSON("ajax/get_attribute_values.php", { id: jQuery(this).val() }, function(data) { if (data.error) { From bc7623d3832e0922244e9ca8b4a14bc52fb543e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Apr 2018 12:05:23 +0200 Subject: [PATCH 12/16] Update getCombinations.php --- htdocs/variants/ajax/getCombinations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/variants/ajax/getCombinations.php b/htdocs/variants/ajax/getCombinations.php index 8b7baaee27e..5c57191c3eb 100644 --- a/htdocs/variants/ajax/getCombinations.php +++ b/htdocs/variants/ajax/getCombinations.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; header('Content-Type: application/json'); -$id = GETPOST('id'); +$id = GETPOST('id', 'int'); if (!$id) { print json_encode(array( From a95bc76afb1bd614f6d2f645493c24810f9fc879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Apr 2018 12:10:58 +0200 Subject: [PATCH 13/16] Update combinations.php --- htdocs/variants/combinations.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 8b3335a37d6..ef7dffd9ed0 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -699,8 +699,12 @@ if (! empty($id) || ! empty($ref)) print ''; print ''; } +} else { + llxHeader(); + // not found } + llxFooter(); $db->close(); From 7d7c0624d2e7c3e81f153f1f18308f73915b788d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Apr 2018 12:59:24 +0200 Subject: [PATCH 14/16] Update traduction.php --- htdocs/product/traduction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index b8cdb1fbe39..20e0bd4c8ad 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -251,7 +251,7 @@ if ($action == 'edit') print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans('Label').'
'.$langs->trans('Label').'
'.$langs->trans('Description').''; $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); From 560038fa183a29482bb529d09cb7b5f03952489a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Apr 2018 14:38:56 +0200 Subject: [PATCH 15/16] Fix regression in update contact --- htdocs/contact/class/contact.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 63bc433535b..95897271f1a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -311,7 +311,7 @@ class Contact extends CommonObject $sql .= ", email='".$this->db->escape($this->email)."'"; $sql .= ", skype='".$this->db->escape($this->skype)."'"; $sql .= ", photo='".$this->db->escape($this->photo)."'"; - $sql .= ", birthday='".$this->db->idate($this->birthday)."'"; + $sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : ""); $sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); $sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null"); $sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null"); @@ -501,8 +501,8 @@ class Contact extends CommonObject $resql = $this->db->query($sql); if (! $resql) { - $error++; - $this->error=$this->db->lasterror(); + $error++; + $this->error=$this->db->lasterror(); } // Mis a jour alerte birthday From 804703c9c97b86bafaab6cf070dc876d9529ae76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Apr 2018 14:43:16 +0200 Subject: [PATCH 16/16] Fix regression --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 95897271f1a..b5f714131d9 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -311,7 +311,7 @@ class Contact extends CommonObject $sql .= ", email='".$this->db->escape($this->email)."'"; $sql .= ", skype='".$this->db->escape($this->skype)."'"; $sql .= ", photo='".$this->db->escape($this->photo)."'"; - $sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : ""); + $sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null"); $sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); $sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null"); $sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null");