From 93ee9a7496d7e6a355d73d9c3623624c475c9a07 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 9 Dec 2022 12:56:35 +0100 Subject: [PATCH 01/32] Delete links when MO is deleted --- htdocs/mrp/class/mo.class.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index d186c6e533b..9aa1ef5bd8e 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -744,8 +744,31 @@ class Mo extends CommonObject */ public function delete(User $user, $notrigger = false) { - return $this->deleteCommon($user, $notrigger); - //return $this->deleteCommon($user, $notrigger, 1); + $this->db->begin(); + + $error = 0; + + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) { + $error++; + } + + if(!$error){ + $res = $this->deleteCommon($user, $notrigger); + if($res < 0){ + $error++; + } + } + + if(!$error){ + dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG); + $this->db->commit(); + return $res; + } else { + $this->db->rollback(); + return -1; + } } /** From 488a434c8b031230e87980af561aa45321056ca0 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 9 Dec 2022 11:58:27 +0000 Subject: [PATCH 02/32] Fixing style errors. --- htdocs/mrp/class/mo.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 9aa1ef5bd8e..5eeb387fc88 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -754,14 +754,14 @@ class Mo extends CommonObject $error++; } - if(!$error){ + if (!$error) { $res = $this->deleteCommon($user, $notrigger); - if($res < 0){ + if ($res < 0) { $error++; } } - if(!$error){ + if (!$error) { dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG); $this->db->commit(); return $res; From 95f437b45c8103cb8a871e49939fd1cb81bbf238 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 12 Dec 2022 10:05:44 +0100 Subject: [PATCH 03/32] deleteObjectLinked() in deleteCommon() function --- htdocs/core/class/commonobject.class.php | 6 ++++++ htdocs/mrp/class/mo.class.php | 27 ++---------------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3e10ea82eaa..de19d651ba2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9472,6 +9472,12 @@ abstract class CommonObject } } + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) { + $error++; + } + // Commit or rollback if ($error) { $this->db->rollback(); diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 9aa1ef5bd8e..d186c6e533b 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -744,31 +744,8 @@ class Mo extends CommonObject */ public function delete(User $user, $notrigger = false) { - $this->db->begin(); - - $error = 0; - - // Delete linked object - $res = $this->deleteObjectLinked(); - if ($res < 0) { - $error++; - } - - if(!$error){ - $res = $this->deleteCommon($user, $notrigger); - if($res < 0){ - $error++; - } - } - - if(!$error){ - dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG); - $this->db->commit(); - return $res; - } else { - $this->db->rollback(); - return -1; - } + return $this->deleteCommon($user, $notrigger); + //return $this->deleteCommon($user, $notrigger, 1); } /** From b906619ce1826babbaca1c8fd89914fb6349bb67 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 14 Dec 2022 10:31:11 +0100 Subject: [PATCH 04/32] FIX : methods declaration (backport fix 67b9a7dc07d708231d12b5e58800334d4a01ef98) --- htdocs/projet/class/taskstats.class.php | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/htdocs/projet/class/taskstats.class.php b/htdocs/projet/class/taskstats.class.php index a5b088f01e8..16bd0afd480 100644 --- a/htdocs/projet/class/taskstats.class.php +++ b/htdocs/projet/class/taskstats.class.php @@ -193,4 +193,35 @@ class TaskStats extends Stats // var_dump($res);print '
'; return $res; } + + /** + * Return the Task amount by month for a year + * + * @param int $year Year to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array with amount by month + */ + public function getAmountByMonth($year, $format = 0) + { + // Return an empty array at the moment because task has no amount + return array(); + } + + /** + * Return average of entity by month + * @param int $year year number + * @return int value + */ + protected function getAverageByMonth($year) + { + $sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")"; + $sql .= " FROM ".$this->from; + $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; + $sql .= " AND ".$this->where; + $sql .= " GROUP BY dm"; + $sql .= $this->db->order('dm', 'DESC'); + + return $this->_getAverageByMonth($year, $sql); + } + } From d679a321551fc33cc610ef66770326088e157eb9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 14 Dec 2022 09:36:25 +0000 Subject: [PATCH 05/32] Fixing style errors. --- htdocs/projet/class/taskstats.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/projet/class/taskstats.class.php b/htdocs/projet/class/taskstats.class.php index 16bd0afd480..39efd957bb5 100644 --- a/htdocs/projet/class/taskstats.class.php +++ b/htdocs/projet/class/taskstats.class.php @@ -223,5 +223,4 @@ class TaskStats extends Stats return $this->_getAverageByMonth($year, $sql); } - } From ed8900594190903165a2ef87fe9e810cd87961f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Prud=27homme?= Date: Wed, 14 Dec 2022 11:45:40 +0100 Subject: [PATCH 06/32] Fix #23019 Impossible to add task times to an existing draft invoice --- htdocs/projet/tasks/time.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index debfb427111..6ff81ff3fbf 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1240,7 +1240,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print $langs->trans('InvoiceToUse'); print ''; print ''; - $form->selectInvoice('invoice', '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'), 1, 0, 0, 'maxwidth500', '', 'all'); + $form->selectInvoice($projectstatic->thirdparty->id, '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'), 1, 0, 0, 'maxwidth500', '', 'all'); print ''; print ''; /*print ''; From 4c43d81872e9e5d70d6f84e67c0d09e44fcdb402 Mon Sep 17 00:00:00 2001 From: hystepik Date: Wed, 14 Dec 2022 15:39:02 +0100 Subject: [PATCH 07/32] Fix #23064 : diplays total at end of inter list --- htdocs/fichinter/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 4ab4f0a90e3..9f887c36900 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -496,7 +496,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; -print ''."\n"; +print '
'."\n"; // Fields title search // -------------------------------------------------------------------- @@ -844,6 +844,9 @@ while ($i < $imaxinloop) { if (!$i) { $totalarray['type'][$totalarray['nbfield']] = 'duration'; } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'fd.duree'; + } $totalarray['val']['fd.duree'] += $obj->duree; } // Action column From 1a16e41ce3f49d17c807fa159842ad645fd8af3d Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 14 Dec 2022 16:04:35 +0100 Subject: [PATCH 08/32] FIX : Can't see all time spent by all user --- htdocs/projet/tasks/time.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index ef8ac6aa9df..3be8c731545 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -162,7 +162,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_date_update = ''; $search_task_ref = ''; $search_task_label = ''; - $search_user = 0; + $search_user = -1; $search_valuebilled = ''; $toselect = ''; $search_array_options = array(); @@ -1277,7 +1277,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (empty($search_user)) { $search_user = $user->id; } - $sql .= " AND t.fk_user = ".((int) $search_user); + if($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); } if ($search_note) { From 70b6b3d82d5053816d3f9b6be918588a52727a30 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 14 Dec 2022 15:21:42 +0000 Subject: [PATCH 09/32] Fixing style errors. --- htdocs/projet/tasks/time.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 3be8c731545..67024ee8fa5 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1277,7 +1277,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (empty($search_user)) { $search_user = $user->id; } - if($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); + if ($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); } if ($search_note) { From eff01374b1163a8bf304f5c1a7a190bef44e5c43 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 15 Dec 2022 15:09:50 +0100 Subject: [PATCH 10/32] Change place of deleteobjectlinked in deletecommon function --- htdocs/core/class/commonobject.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index de19d651ba2..d7d41a545ef 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9455,6 +9455,12 @@ abstract class CommonObject } } + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) { + $error++; + } + if (!$error && !empty($this->isextrafieldmanaged)) { $result = $this->deleteExtraFields(); if ($result < 0) { @@ -9472,12 +9478,6 @@ abstract class CommonObject } } - // Delete linked object - $res = $this->deleteObjectLinked(); - if ($res < 0) { - $error++; - } - // Commit or rollback if ($error) { $this->db->rollback(); From c0a0b977bf223d884dad6b2e41bf909ebbad7a0f Mon Sep 17 00:00:00 2001 From: hystepik Date: Fri, 16 Dec 2022 16:20:43 +0100 Subject: [PATCH 11/32] Fix #19485 : add of missing tickets trad key for menu --- htdocs/langs/en_US/ticket.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 0b54b1d5fa8..9897422d0c9 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -27,6 +27,7 @@ Permission56003=Delete tickets Permission56004=Manage tickets Permission56005=See tickets of all third parties (not effective for external users, always be limited to the third party they depend on) +Tickets=Tickets TicketDictType=Ticket - Types TicketDictCategory=Ticket - Groupes TicketDictSeverity=Ticket - Severities From 55b51b94f11c89c0d3f116ccce7b1b01a94171ab Mon Sep 17 00:00:00 2001 From: Braito Date: Tue, 20 Dec 2022 10:13:47 +0100 Subject: [PATCH 12/32] php 8 warning --- htdocs/projet/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index aabf14e8655..c4b5c29a149 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -489,11 +489,11 @@ llxHeader("", $title, $help_url); $titleboth = $langs->trans("LeadsOrProjects"); $titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default -if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { +if (!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES')) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } -if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only +if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only $titleboth = $langs->trans("Leads"); $titlenew = $langs->trans("NewLead"); } From ec32d284eb0acb59ff9bc720f6170934579006d8 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 20 Dec 2022 11:31:44 +0100 Subject: [PATCH 13/32] FIX : Product list in setup.php in new Module --- htdocs/modulebuilder/template/admin/setup.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 1c46028b142..9ee07b3a1fd 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -55,6 +55,8 @@ global $langs, $user; // Libraries require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once '../lib/mymodule.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + //require_once "../class/myclass.class.php"; // Translations From 2f64eaff0514d8d3b1506fdbf26c485f000cfeb1 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 20 Dec 2022 12:25:20 +0100 Subject: [PATCH 14/32] FIX : CI --- htdocs/modulebuilder/template/admin/setup.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 9ee07b3a1fd..7bf97081341 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -57,6 +57,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once '../lib/mymodule.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + //require_once "../class/myclass.class.php"; // Translations From 47b71775ceadcfa1ff0d8a0c6368c2bbddc2f588 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 20 Dec 2022 13:11:54 +0100 Subject: [PATCH 15/32] FIX #21711 --- htdocs/core/js/lib_foot.js.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index 764fde5097e..08b4e48c68d 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -111,6 +111,7 @@ if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) { console.log("toggle dropdown dt a"); //$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\'); + $(".ulselectedfields").removeClass("open"); $(this).parent().parent().find(\'dd ul\').toggleClass("open"); if ($(this).parent().parent().find(\'dd ul\').hasClass("open")) { From 7d647fedc5df149d1c4c3ff02d5d9e787bb34d57 Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 20 Dec 2022 15:17:55 +0100 Subject: [PATCH 16/32] Fix validation for min string --- htdocs/core/class/validate.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/validate.class.php b/htdocs/core/class/validate.class.php index 9d8832c36ce..31cf6300aff 100644 --- a/htdocs/core/class/validate.class.php +++ b/htdocs/core/class/validate.class.php @@ -191,7 +191,7 @@ class Validate */ public function isMinLength($string, $length) { - if (!strlen($string) < $length) { + if (strlen($string) < $length) { $this->error = $this->outputLang->trans('RequireMinLength', $length); return false; } From 6c24230d9e911512c8ca321a1623689c01668498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Dec 2022 18:34:50 +0100 Subject: [PATCH 17/32] fix typo --- htdocs/admin/system/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index f8f47baebf9..cab41cc6263 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -598,7 +598,7 @@ print ''; print '
'; $urlexamplebase = 'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/fail2ban/filter.d/'; print '- Login process (see fail2ban example on GitHub)
'; -print '- '.DOL_URL_ROOT.'/passwordforgotten.php (see fail2ban example on GitHub)
'; +print '- '.DOL_URL_ROOT.'/passwordforgotten.php (see fail2ban example on GitHub)
'; print '- '.DOL_URL_ROOT.'/public/* (see fail2ban example on GitHub)
'; print '
'; $urlexamplebase = 'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/apache/'; From e97104fcaaf6e809ddb40e775bcbac82395de853 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Dec 2022 13:49:44 +0100 Subject: [PATCH 18/32] Fix selection of opp status --- htdocs/langs/en_US/projects.lang | 5 +- htdocs/projet/card.php | 187 ++++++++++++++++++++++++------- 2 files changed, 152 insertions(+), 40 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 2407d4b2d86..6d2f67ee675 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -125,7 +125,8 @@ ValidateProject=Validate projet ConfirmValidateProject=Are you sure you want to validate this project? CloseAProject=Close project ConfirmCloseAProject=Are you sure you want to close this project? -AlsoCloseAProject=Also close project (keep it open if you still need to follow production tasks on it) +AlsoCloseAProject=Also close project +AlsoCloseAProjectTooltip=Keep it open if you still need to follow production tasks on it ReOpenAProject=Open project ConfirmReOpenAProject=Are you sure you want to re-open this project? ProjectContact=Contacts of project @@ -168,7 +169,7 @@ OpportunityProbability=Lead probability OpportunityProbabilityShort=Lead probab. OpportunityAmount=Lead amount OpportunityAmountShort=Lead amount -OpportunityWeightedAmount=Opportunity weighted amount +OpportunityWeightedAmount=Amount of opportunity, weighted by probability OpportunityWeightedAmountShort=Opp. weighted amount OpportunityAmountAverageShort=Average lead amount OpportunityAmountWeigthedShort=Weighted lead amount diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 1bdcccbaecf..78dd11c9fd0 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -567,7 +567,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // Label - print '
'; + print ''; // Usage (opp, task, bill time, ...) if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) { @@ -602,12 +602,46 @@ if ($action == 'create' && $user->rights->projet->creer) { print ' '; $htmltext = $langs->trans("ProjectFollowTasks"); print ''; + print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print ''; + print ''; print '
'; } if (isModEnabled('eventorganization')) { @@ -706,24 +740,26 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print ''; // Opportunity probability - print ''; - print ''; print ''; // Opportunity amount print ''; - print ''; + print ''; print ''; } // Budget - print ''; - print ''; + print ''; + print ''; print ''; // Date project @@ -780,6 +816,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // Change probability from status or role of project + // Set also dependencies between use taks and bill time print ''; print '
'; @@ -930,12 +972,52 @@ if ($action == 'create' && $user->rights->projet->creer) { print 'usage_task ? ' checked="checked"' : '')) . '"> '; $htmltext = $langs->trans("ProjectFollowTasks"); print ''; + print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print 'usage_bill_time ? ' checked="checked"' : '')) . '"> '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print ''; + print ''; print '
'; } if (isModEnabled('eventorganization')) { @@ -944,7 +1026,14 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print ''; } @@ -1013,32 +1100,34 @@ if ($action == 'create' && $user->rights->projet->creer) { // Opportunity status print ''; print ''; - print ''; + print '
'; + print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 1, 1); // Opportunity probability - print '
'; - print ''; print ''; // Opportunity amount print ''; - print ''; print ''; } // Budget - print ''; - print ''; + print ''; print ''; @@ -1180,14 +1269,13 @@ if ($action == 'create' && $user->rights->projet->creer) { if ($code) { print $langs->trans("OppStatus".$code); } - print ''; // Opportunity percent - print ''; + print ''; // Opportunity Amount print '
'.$langs->trans("ProjectLabel").'
'.$langs->trans("Label").'
'.$langs->trans("OpportunityStatus").''; print $formproject->selectOpportunityStatus('opp_status', GETPOSTISSET('opp_status') ? GETPOST('opp_status') : $object->opp_status, 1, 0, 0, 0, '', 0, 1); - print '
'.$langs->trans("OpportunityProbability").' %'; + print ' %'; print ''; print '
'.$langs->trans("OpportunityAmount").''; + print ' '.$langs->getCurrencySymbol($conf->currency); + print '
'.$langs->trans("Budget").'
'.$langs->trans("Budget").''; + print ' '.$langs->getCurrencySymbol($conf->currency); + print '
'.$langs->trans("OpportunityStatus").''; - print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 0, 1); - print ''; - print '
'.$langs->trans("OpportunityProbability").' %'; - print ''; + print ' %'; + print ''; + print ''; + + print ''; + print '
'.$langs->trans("OpportunityAmount").''; + print ''; print $langs->getCurrencySymbol($conf->currency); print '
'.$langs->trans("Budget").''; + print '
'.$langs->trans("Budget").''; print $langs->getCurrencySymbol($conf->currency); print '
'.$langs->trans("OpportunityProbability").''; + print ' / '; if (strcmp($object->opp_percent, '')) { print price($object->opp_percent, 0, $langs, 1, 0).' %'; } - print '
'.$langs->trans("OpportunityAmount").''; @@ -1268,6 +1356,25 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; + // Set also dependencies between use taks and bill time + print ''; + // Change probability from status if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Default value to close or not when we set opp to 'WON'. @@ -1308,19 +1415,23 @@ if ($action == 'create' && $user->rights->projet->creer) { } /* Change percent with default percent (defaultpercent) if new status (defaultpercent) is higher than current (jQuery("#opp_percent").val()) */ - console.log("oldpercent="+oldpercent); if (oldpercent != \'\' && (parseFloat(defaultpercent) < parseFloat(oldpercent))) { - if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+oldpercent+\' %\'); - if (parseFloat(oldpercent) != 100) { jQuery("#opp_percent").val(oldpercent); } - else { jQuery("#opp_percent").val(defaultpercent); } + console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent+" def < old"); + if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') { + jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+price2numjs(oldpercent)+\' %\'); + } + + if (parseFloat(oldpercent) != 100 && elemcode != \'LOST\') { jQuery("#opp_percent").val(oldpercent); } + else { jQuery("#opp_percent").val(price2numjs(defaultpercent)); } } else { + console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent); if ((parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent))); { - if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+oldpercent+\' %\'); - jQuery("#opp_percent").val(defaultpercent); + if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+price2numjs(oldpercent)+\' %\'); + jQuery("#opp_percent").val(price2numjs(defaultpercent)); } } } From fec9184cfd2fb7e3977b52ef6c520a8d0eb1c9e1 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 21 Dec 2022 17:43:50 +0100 Subject: [PATCH 19/32] Fix box member and dolgraph should display same info --- htdocs/core/boxes/box_members_by_type.php | 49 +++++++++++++++++++++-- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 2e25da59564..9fcfb7e325a 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -92,6 +92,7 @@ class box_members_by_type extends ModeleBoxes if ($user->rights->adherent->lire) { $MembersToValidate = array(); + $MembersPending = array(); $MembersValidated = array(); $MembersUpToDate = array(); $MembersExcluded = array(); @@ -169,34 +170,63 @@ class box_members_by_type extends ModeleBoxes } $this->db->free($result); } + // Members pendding (Waiting for first subscription) + $sql = "SELECT count(*) as somme , d.fk_adherent_type"; + $sql .= " FROM " . MAIN_DB_PREFIX . "adherent as d, " . MAIN_DB_PREFIX . "adherent_type as t"; + $sql .= " WHERE d.entity IN (" . getEntity('adherent') . ")"; + $sql .= " AND d.statut = 1 AND (d.datefin IS NULL AND t.subscription = 1)"; + $sql .= " AND t.rowid = d.fk_adherent_type"; + $sql .= " GROUP BY d.fk_adherent_type"; + + dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + $num2 = $this->db->num_rows($result); + $i = 0; + while ($i < $num2) { + $objp = $this->db->fetch_object($result); + $MembersPending[$objp->fk_adherent_type] = $objp->somme; + $i++; + } + $this->db->free($result); + } $line = 0; $this->info_box_contents[$line][] = array( 'td' => 'class=""', 'text' => '', ); + // Draft $labelstatus = $staticmember->LibStatut($staticmember::STATUS_DRAFT, 0, 0, 1); $this->info_box_contents[$line][] = array( 'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"', 'text' => $labelstatus ); - $labelstatus = $langs->trans("UpToDate"); + // Pending (Waiting for first subscription) + $labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, 0, 1); + $this->info_box_contents[$line][] = array( + 'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"', + 'text' => $labelstatus + ); + // Up to date $labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, dol_now() + 86400, 1); $this->info_box_contents[$line][] = array( 'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"', 'text' => $labelstatus, ); - $labelstatus = $langs->trans("OutOfDate"); + // Expired $labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, dol_now() - 86400, 1); $this->info_box_contents[$line][] = array( 'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"', 'text' => $labelstatus ); + // Excluded $labelstatus = $staticmember->LibStatut($staticmember::STATUS_EXCLUDED, 0, 0, 1); $this->info_box_contents[$line][] = array( 'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"', 'text' => $labelstatus ); + // Resiliated $labelstatus = $staticmember->LibStatut($staticmember::STATUS_RESILIATED, 0, 0, 1); $this->info_box_contents[$line][] = array( 'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"', @@ -205,7 +235,8 @@ class box_members_by_type extends ModeleBoxes $line++; foreach ($AdherentType as $key => $adhtype) { $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; - $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; + $SumPending += isset($MembersPending[$key]) ? $MembersPending[$key] : 0; + $SumExpired += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) - (isset($MembersPending[$key]) ? $MembersPending[$key] : 0): 0; $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; $SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; @@ -220,6 +251,11 @@ class box_members_by_type extends ModeleBoxes 'text' => (isset($MembersToValidate[$key]) && $MembersToValidate[$key] > 0 ? $MembersToValidate[$key] : '') . ' ' . $staticmember->LibStatut(Adherent::STATUS_DRAFT, 1, 0, 3), 'asis' => 1, ); + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => (isset($MembersPending[$key]) && $MembersPending[$key] > 0 ? $MembersPending[$key] : '') . ' ' . $staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, 0, 3), + 'asis' => 1, + ); $this->info_box_contents[$line][] = array( 'td' => 'class="right"', 'text' => (isset($MembersUpToDate[$key]) && $MembersUpToDate[$key] > 0 ? $MembersUpToDate[$key] : '') . ' ' . $staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, $now, 3), @@ -260,6 +296,11 @@ class box_members_by_type extends ModeleBoxes 'text' => $SumToValidate.' '.$staticmember->LibStatut(Adherent::STATUS_DRAFT, 1, 0, 3), 'asis' => 1 ); + $this->info_box_contents[$line][] = array( + 'td' => 'class="liste_total right"', + 'text' => $SumPending.' '.$staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, 0, 3), + 'asis' => 1 + ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', 'text' => $SumUpToDate.' '.$staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, $now, 3), @@ -267,7 +308,7 @@ class box_members_by_type extends ModeleBoxes ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SumValidated.' '.$staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, 1, 3), + 'text' => $SumExpired.' '.$staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, 1, 3), 'asis' => 1 ); $this->info_box_contents[$line][] = array( From c09751dfd54e78bd7140da84caf1bb811eac37c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2022 19:26:17 +0100 Subject: [PATCH 20/32] FIx #23288 --- htdocs/takepos/send.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index ffa7e0c5c35..a8e13ac01a9 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -81,7 +81,7 @@ if ($action == "send") { $msg = "".$arraydefaultmessage->content."
".$receipt.""; $sendto = $email; $from = $mysoc->email; - $mail = new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(), '', '', 0, 1); + $mail = new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(), '', '', 0, 1, '', '', '', '', '', '', DOL_DOCUMENT_ROOT.'/documents/takepos/temp'); if ($mail->error || !empty($mail->errors)) { setEventMessages($mail->error, $mail->errors, 'errors'); } else { From 45fdebcda279a3d1b2d39c7ab66752c7b39847d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2022 19:33:02 +0100 Subject: [PATCH 21/32] Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 --- htdocs/takepos/invoice.php | 2 +- htdocs/takepos/receipt.php | 2 +- htdocs/takepos/send.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6be323a1a7a..ccc1fde97eb 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1094,7 +1094,7 @@ function Print(id, gift){ function TakeposPrinting(id){ var receipt; console.log("TakeposPrinting" + id); - $.get("receipt.php?facid="+id, function(data, status){ + $.get("receipt.php?facid="+id, function(data, status) { receipt=data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, ''); $.ajax({ type: "POST", diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 400d05415aa..39fe2113071 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -85,7 +85,7 @@ $hookmanager->initHooks(array('takeposfrontend'), $facid); $reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object); if (!empty($hookmanager->resPrint)) { print $hookmanager->resPrint; - exit; + return; // Receipt page can be called by the takepos/send.php page that use ob_start/end so we must use return and not exit to stop page } // IMPORTANT: This file is sended to 'Takepos Printing' application. Keep basic file. No external files as css, js... If you need images use absolute path. diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index a8e13ac01a9..7397c962555 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -69,12 +69,12 @@ if ($action == "send") { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $outputlangs = new Translate('', $conf); - $model_id = $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE; + $model_id = getDolGlobalString('TAKEPOS_EMAIL_TEMPLATE_INVOICE'); $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, $model_id); $subject = $arraydefaultmessage->topic; ob_start(); // turn on output receipt - include 'receipt.php'; + include DOL_DOCUMENT_ROOT.'/takepos/receipt.php'; $receipt = ob_get_contents(); // get the contents of the output buffer ob_end_clean(); From 1681674cdf7d0b14f4986630bb8b3bc58937fd27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2022 20:45:11 +0100 Subject: [PATCH 22/32] Update card.php --- htdocs/projet/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c4b5c29a149..7fe1f8f77e0 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -493,7 +493,7 @@ if (!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES')) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } -if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only +if (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only $titleboth = $langs->trans("Leads"); $titlenew = $langs->trans("NewLead"); } From 9c0b2e6abe2eae73c6d8fdfd91758b23aa421527 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2022 21:15:21 +0100 Subject: [PATCH 23/32] Too many bug in module. Restore the develop status. --- htdocs/core/modules/modAsset.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index 3a7caa1cb57..a0fb405887e 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -63,7 +63,7 @@ class modAsset extends DolibarrModules $this->descriptionlong = "Asset module to manage assets module and depreciation charge on Dolibarr"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = 'experimental'; + $this->version = 'development'; // Key used in llx_const table to save module status enabled/disabled (where ASSETS is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. From a5e5362cb0e540d2cb5841c9451dde9bd95feaea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2022 21:24:54 +0100 Subject: [PATCH 24/32] FIX Trigger must be inside the transaction --- htdocs/core/class/commonobject.class.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 574553016b4..d1b0ca0164c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9729,23 +9729,24 @@ abstract class CommonObject $tmpforobjectclass = get_class($this); $tmpforobjectlineclass = ucfirst($tmpforobjectclass).'Line'; + $this->db->begin(); + // Call trigger $result = $this->call_trigger('LINE'.strtoupper($tmpforobjectclass).'_DELETE', $user); if ($result < 0) { - return -1; + $error++; } // End call triggers - $this->db->begin(); + if (empty($error)) { + $sql = "DELETE FROM ".$this->db->prefix().$this->table_element_line; + $sql .= " WHERE rowid = ".((int) $idline); - $sql = "DELETE FROM ".$this->db->prefix().$this->table_element_line; - $sql .= " WHERE rowid = ".((int) $idline); - - dol_syslog(get_class($this)."::deleteLineCommon", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->error = "Error ".$this->db->lasterror(); - $error++; + $resql = $this->db->query($sql); + if (!$resql) { + $this->error = "Error ".$this->db->lasterror(); + $error++; + } } if (empty($error)) { From a0f282d100b9d87ad92690e60dffcb2ae053751a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2022 23:34:32 +0100 Subject: [PATCH 25/32] Try a fix of phpunit regression --- test/phpunit/phpunittest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/phpunittest.xml b/test/phpunit/phpunittest.xml index 84b31a8dd3b..8157d3f3e7a 100644 --- a/test/phpunit/phpunittest.xml +++ b/test/phpunit/phpunittest.xml @@ -1,8 +1,8 @@ Date: Thu, 22 Dec 2022 00:02:22 +0100 Subject: [PATCH 26/32] Add log to test phpunit pb --- test/phpunit/AdminLibTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 9ce135da263..0273960fb30 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -69,6 +69,8 @@ class AdminLibTest extends PHPUnit\Framework\TestCase $this->savdb=$db; print __METHOD__." db->type=".$db->type." user->id=".$user->id; + var_dump($GLOBALS); + //print " - db ".$db->db; print "\n"; } From 49e8b53fabaddd349b316104026ac4b6270687bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 00:33:03 +0100 Subject: [PATCH 27/32] Try fix for phpunit regression --- .travis.yml | 2 +- test/phpunit/AdminLibTest.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45be1a9a6ba..4cf634d6b03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,7 +86,7 @@ install: rm $TRAVIS_BUILD_DIR/composer.json rm $TRAVIS_BUILD_DIR/composer.lock composer -V - composer self-update + composer self-update 2.4.4 composer -n init composer -n config vendor-dir htdocs/includes composer -n config -g vendor-dir htdocs/includes diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 0273960fb30..95a54fe6502 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -69,7 +69,6 @@ class AdminLibTest extends PHPUnit\Framework\TestCase $this->savdb=$db; print __METHOD__." db->type=".$db->type." user->id=".$user->id; - var_dump($GLOBALS); //print " - db ".$db->db; print "\n"; From 599aa6009a686ced404e35879d4439e4510779c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 00:37:33 +0100 Subject: [PATCH 28/32] Try to solve phpunit regression --- test/phpunit/AdminLibTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 95a54fe6502..a40e2257f3e 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -46,6 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class AdminLibTest extends PHPUnit\Framework\TestCase { + protected $backupGlobalsBlacklist = array('conf', 'user', 'langs', 'db'); protected $savconf; protected $savuser; protected $savlangs; From bd90d783c7eedb015069e84e7a0da37e11117178 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 00:48:56 +0100 Subject: [PATCH 29/32] Reduce code --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4cf634d6b03..ec2205eb718 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,8 +87,8 @@ install: rm $TRAVIS_BUILD_DIR/composer.lock composer -V composer self-update 2.4.4 - composer -n init - composer -n config vendor-dir htdocs/includes + #composer -n init + #composer -n config vendor-dir htdocs/includes composer -n config -g vendor-dir htdocs/includes echo From 394c3d5c3c1d33e3ef68567ab2c8c0342a9e24a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 00:59:54 +0100 Subject: [PATCH 30/32] Fix var --- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 2fe7d983513..afd7b4860fb 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -853,7 +853,7 @@ class MyObject extends CommonObject //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); global $action, $hookmanager; - $hookmanager->initHooks(array('myobjectdao')); + $hookmanager->initHooks(array($this->element.'dao')); $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { From e75617268b1e6ee71cbbfd77363fdbf0952329c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 01:04:06 +0100 Subject: [PATCH 31/32] Log --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ec2205eb718..62d04901e17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,7 +82,7 @@ before_install: install: - | - echo "Updating Composer" + echo "Updating Composer (version 2.5 is bugged and generate phpunit error Exception: Serialization of 'Closure' is not allowed)" rm $TRAVIS_BUILD_DIR/composer.json rm $TRAVIS_BUILD_DIR/composer.lock composer -V From 5dfd9af695eb06aa9015539c033df633adac055e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 01:07:02 +0100 Subject: [PATCH 32/32] Removed not required rm --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d23f98a7eca..39b0f2042a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,8 +83,8 @@ before_install: install: - | echo "Updating Composer (version 2.5 is bugged and generate phpunit error Exception: Serialization of 'Closure' is not allowed)" - rm $TRAVIS_BUILD_DIR/composer.json - rm $TRAVIS_BUILD_DIR/composer.lock + #rm $TRAVIS_BUILD_DIR/composer.json + #rm $TRAVIS_BUILD_DIR/composer.lock composer -V composer self-update 2.4.4 #composer -n init