From e4f7f2a0b2e7ac05d6917781eb8e0e14ffeee444 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 26 May 2017 12:39:49 +0200 Subject: [PATCH 01/10] $resaction need in 5.0.x too --- htdocs/core/class/hookmanager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 24ba86c7115..89a9b834482 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -233,7 +233,7 @@ class HookManager if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; //dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); - $result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) + $resaction = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; From 18799c3a7f1bddfbe7a2f3c27994e290a2de4d0e Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Mon, 29 May 2017 11:00:08 +0200 Subject: [PATCH 02/10] Changes Done question need to change $actionclassinstance->results in $actionclassinstance->resactionss ??? --- htdocs/core/class/hookmanager.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 89a9b834482..0c78e89fa9e 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -238,10 +238,10 @@ class HookManager if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; // TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string. we must use $actionclassinstance->resprints to return a string - if (! is_array($result) && ! is_numeric($result)) + if (! is_array($resaction) && ! is_numeric($resaction)) { dol_syslog('Error: Bug into hook '.$method.' of module class '.get_class($actionclassinstance).'. Method must not return a string but an int (0=OK, 1=Replace, -1=KO) and set string into ->resprints', LOG_ERR); - if (empty($actionclassinstance->resprints)) { $this->resPrint.=$result; $result=0; } + if (empty($actionclassinstance->resprints)) { $this->resPrint.=$resaction; $resaction=0; } } } From 19b8918caf5ec68a00fe94af99d6bebeb3748570 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 13:35:51 +0200 Subject: [PATCH 03/10] FIX #6881 --- htdocs/install/upgrade2.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 09aa85d48c3..42c8f50632e 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -453,11 +453,11 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $db->close(); - // Actions for all version (not in database) + // Actions for all versions (not in database) migrate_delete_old_files($db, $langs, $conf); - migrate_delete_old_dir($db, $langs, $conf); + dol_mkdir(DOL_DATA_ROOT.'/bank'); migrate_directories($db, $langs, $conf, '/banque/bordereau', '/bank/checkdeposits'); } @@ -3926,7 +3926,11 @@ function migrate_delete_old_files($db,$langs,$conf) DOL_DOCUMENT_ROOT.'/core/modules/mailings/poire.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/kiwi.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_crabe.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_oursin.modules.php' + DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_oursin.modules.php', + + DOL_DOCUMENT_ROOT.'/compta/facture/class/api_invoice.class.php', + DOL_DOCUMENT_ROOT.'/commande/class/api_commande.class.php', + DOL_DOCUMENT_ROOT.'/user/class/api_user.class.php' ); foreach ($filetodeletearray as $filetodelete) From d2813eabbcad08127c92d07534b7554b33c43d77 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 13:39:07 +0200 Subject: [PATCH 04/10] FIX #6877 Conflicts: htdocs/install/mysql/migration/5.0.0-6.0.0.sql --- htdocs/install/mysql/migration/4.0.0-5.0.0.sql | 1 + htdocs/install/mysql/tables/llx_projet.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index fa185f2864b..b5978efac99 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -45,6 +45,7 @@ ALTER TABLE llx_facture_fourn_det ADD INDEX idx_facture_fourn_det_fk_product (fk ALTER TABLE llx_facture_rec ADD COLUMN fk_user_modif integer; ALTER TABLE llx_expedition ADD COLUMN fk_user_modif integer; +ALTER TABLE llx_projet ADD COLUMN fk_user_modif integer; ALTER TABLE llx_adherent ADD COLUMN model_pdf varchar(255); diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index d50547b711b..8ca404d3a0e 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -30,6 +30,7 @@ create table llx_projet title varchar(255) NOT NULL, description text, fk_user_creat integer NOT NULL, -- createur du projet + fk_user_modif integer, public integer, -- project is public or not fk_statut integer DEFAULT 0 NOT NULL, -- open or close fk_opp_status integer DEFAULT NULL, -- if project is used to manage opportunities From 96b8339d21eab4bc275d365b9ba51c24108feda7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 May 2017 17:38:57 +0200 Subject: [PATCH 05/10] Fix: [Restler] Delete the cache file otherwise it does not update --- htdocs/api/admin/index.php | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index 8142b564c1e..8ea22cee1d3 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -43,12 +43,29 @@ if ($action == 'setproductionmode') if (dolibarr_set_const($db, 'API_PRODUCTION_MODE', $status, 'chaine', 0, '', $conf->entity) > 0) { - $result = dol_mkdir($conf->api->dir_temp); - if ($result < 0) - { - setEventMessages($langs->trans("ErrorFaildToCreateDir", $conf->api->dir_temp), null, 'errors'); - } - else + $error=0; + + if ($status == 1) + { + $result = dol_mkdir($conf->api->dir_temp); + if ($result < 0) + { + setEventMessages($langs->trans("ErrorFailedToCreateDir", $conf->api->dir_temp), null, 'errors'); + $error++; + } + } + else + { + // Delete the cache file otherwise it does not update + $result = dol_delete_file($conf->api->dir_temp.'/routes.php'); + if ($result < 0) + { + setEventMessages($langs->trans("ErrorFailedToDeleteFile", $conf->api->dir_temp.'/routes.php'), null, 'errors'); + $error++; + } + } + + if (!$error) { header("Location: ".$_SERVER["PHP_SELF"]); exit; From d8c5ec2aefb9d6e1abf4a313b287c0167a535e54 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 23 May 2017 18:27:41 +0200 Subject: [PATCH 06/10] FIX: REST API not possible to add agendaevents --- htdocs/comm/action/class/api_agendaevents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 5eeca63a4aa..b1014b9171a 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -289,7 +289,7 @@ class AgendaEvents extends DolibarrApi function _validate($data) { $event = array(); - foreach (Events::$FIELDS as $field) { + foreach (AgendaEvents::$FIELDS as $field) { if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $event[$field] = $data[$field]; From f21ec76bc040638768dcd572e388ac020d2274ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 21:16:37 +0200 Subject: [PATCH 07/10] Exclude dir --- build/makepack-dolibarr.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c06d8f0730f..1dbd6f6fd5e 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -518,6 +518,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/forceproject*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; From eea6461369088e27ab0208d7c3313865ed6e2cac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 21:27:22 +0200 Subject: [PATCH 08/10] Update ChangeLog for 4.0.6 --- ChangeLog | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5fe3c741499..e69b2a9d203 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,29 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 4.0.6 to 4.0.5 ***** +FIX: #6613 Default subject for Supplier proposal emails is filled with a non-existing key +FIX: #6623 User card shows "Return to list" link even if the user has no rights to list users +FIX: #6636 Complete fix +FIX: #6669 User with no permission to edit customer invoices can see a edit button in project entry +FIX: #6671 Cannot remove thirdparty type with "#" in its name +FIX: #6673 Missing "nature" table header in thirdparty list +FIX: #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list +FIX: #6677 Expired contracts dashboard box does not show the name of the thirdparty +FIX: #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode +FIX: #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it +FIX: #6813 +FIX: Correction with author and validator user on orders +FIX: doactions hook missing in invoice model page +FIX: dont get empty "Incoterms : - " string if no incoterm +FIX: dont lose supplier ref if no supplier price in database +FIX: forgotten parameter for right multicompany use +FIX: global $dateSelector isn't the good one, then date selector on objectline_create tpl was hidden +FIX: limit+1 dosn't show Total line +FIX: supplier order line were always created with rang = 0 +FIX: All known CVE at the date 31th of may. + + ***** ChangeLog for 4.0.5 to 4.0.4 ***** FIX: #6234 FIX: #6259 From 8edce66c08679e79634d7a22c510317aeb3c2d68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 21:27:22 +0200 Subject: [PATCH 09/10] Update ChangeLog for 4.0.6 --- ChangeLog | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5fe3c741499..e4c07380aae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,28 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 4.0.6 to 4.0.5 ***** +FIX: #6613 Default subject for Supplier proposal emails is filled with a non-existing key +FIX: #6623 User card shows "Return to list" link even if the user has no rights to list users +FIX: #6636 Complete fix +FIX: #6669 User with no permission to edit customer invoices can see a edit button in project entry +FIX: #6671 Cannot remove thirdparty type with "#" in its name +FIX: #6673 Missing "nature" table header in thirdparty list +FIX: #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list +FIX: #6677 Expired contracts dashboard box does not show the name of the thirdparty +FIX: #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode +FIX: #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it +FIX: #6813 +FIX: Correction with author and validator user on orders +FIX: doactions hook missing in invoice model page +FIX: dont get empty "Incoterms : - " string if no incoterm +FIX: dont lose supplier ref if no supplier price in database +FIX: forgotten parameter for right multicompany use +FIX: global $dateSelector isn't the good one, then date selector on objectline_create tpl was hidden +FIX: limit+1 dosn't show Total line +FIX: supplier order line were always created with rang = 0 + + ***** ChangeLog for 4.0.5 to 4.0.4 ***** FIX: #6234 FIX: #6259 From bd891ea56ab2de44ce7fc3f5ffe538d51ba7e9bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 May 2017 00:26:02 +0200 Subject: [PATCH 10/10] Deploy to server works even when cloudflare is active. --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 1dbd6f6fd5e..20dfc2579aa 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Cwd; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages