From 25eb177bea63333a9a52e53d3b55e8b6dfa736f9 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 8 May 2023 22:39:52 +0200 Subject: [PATCH 01/54] Fix search in hidden ecotaxe dictionary by code. --- htdocs/admin/dict.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 774ade233bd..8c3317a46c9 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1250,6 +1250,8 @@ if ($id > 0) { $sql .= natural_search("f.code", $search_code); } elseif ($search_code != '' && $id == 2) { $sql .= natural_search("d.code_departement", $search_code); + } elseif ($search_code != '' && $id == 14) { + $sql .= natural_search("e.code", $search_code); } elseif ($search_code != '' && $id != 9) { $sql .= natural_search("code", $search_code); } From fbda1c87cde2be15cf279c3b4aa243d070007e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Tue, 9 May 2023 14:38:20 +0200 Subject: [PATCH 02/54] FIX token errors on public interface --- htdocs/public/ticket/index.php | 2 +- htdocs/public/ticket/list.php | 5 +++-- htdocs/public/ticket/view.php | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index e4e46938122..692656f8ad1 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -86,7 +86,7 @@ print '

'.(getDolGlobalString("TICKET_PUBLIC_TEXT_H print '
'; print '

'; -print '

'.dol_escape_htmltag($langs->trans("CreateTicket")).'
'; +print '

'.dol_escape_htmltag($langs->trans("CreateTicket")).'
'; print '

'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'
'; print '
'.img_picto('', 'ticket', 'class="fa-15"').'
'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'
'; print '
'; diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 9ac4b25cb04..f03d9aaea76 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -195,7 +195,6 @@ llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); if ($action == "view_ticketlist") { - print '
'; print '
'; print '
'; @@ -236,6 +235,8 @@ if ($action == "view_ticketlist") { $param .= '&entity='.((int) $entity); } + $param .= '&token='.newToken(); + // Definition of fields for list $arrayfields = array( 't.datec' => array('label' => $langs->trans("Date"), 'checked' => 1), @@ -415,6 +416,7 @@ if ($action == "view_ticketlist") { // Search bar print '
'."\n"; print ''; + print ''; print ''; print ''; print ''; @@ -724,7 +726,6 @@ if ($action == "view_ticketlist") { } print '
'; - print '
'; } else { print '
'; diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 9f2eee2a6ea..04ffd53f2f3 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -171,7 +171,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if ($object->dao->close($user)) { setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); - $url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:''); + $url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'&token='.newToken(); header("Location: ".$url); exit; } else { @@ -372,11 +372,11 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) { // New message - print ''; + print ''; // Close ticket if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) { - print ''; + print ''; } } From 120d750f432eb5afd190d5a5e8428204f66e64ef Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 9 May 2023 16:44:26 +0200 Subject: [PATCH 03/54] FIX missing constant and avoid submit button conflict --- htdocs/core/class/html.formticket.class.php | 27 ++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 08ccfc10190..976177aba5b 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1384,7 +1384,7 @@ class FormTicket print '}); '; - print ''; + print ''; print ''; print ''; print ''; @@ -1534,6 +1534,14 @@ class FormTicket $out .= ''."\n"; $out .= ''; + } + print "\n"; } } From e74945e9cf62d231d7c939e74a76e721a8982cb9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 9 May 2023 16:54:39 +0200 Subject: [PATCH 04/54] FIX missing checking if file is uploaded --- htdocs/core/class/html.formticket.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 976177aba5b..fe4a04c517b 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1635,8 +1635,13 @@ class FormTicket print ''; print '

'; - print ''; - if ($this->withcancel) { + print 'withfile == 2 && !empty($conf->use_javascript_ajax)) { + print ' onClick="if (document.ticket.addedfile.value != \'\') { alert(\''.dol_escape_js($langs->trans("FileWasNotUploaded")).'\'); return false; } else { return true; }"'; + } + print ' />'; + if (!empty($this->withcancel)) { print "     "; print ''; } From 0ca6ab84a35e30079a71c1a75c96c2cc50c239ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 10 May 2023 13:55:41 +0200 Subject: [PATCH 05/54] fix hidden condition --- htdocs/core/boxes/box_scheduled_jobs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index 915884d6f43..f0868036e9d 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -63,7 +63,7 @@ class box_scheduled_jobs extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->hasRight('service', 'lire') && $user->hasRight('contrat', 'lire')); + $this->hidden = !($user->hasRight('cron', 'read')); } /** @@ -79,7 +79,7 @@ class box_scheduled_jobs extends ModeleBoxes $langs->load("cron"); $this->info_box_head = array('text' => $langs->trans("BoxScheduledJobs", $max)); - if ($user->rights->cron->read) { + if ($user->hasRight('cron', 'read')) { include_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php'; $cronstatic = new Cronjob($this->db); $resultarray = array(); From bc42bdef49b688d954b776cf4f4d7b1d74da53d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Thu, 11 May 2023 09:25:07 +0200 Subject: [PATCH 06/54] FIX: wrong colspan for tasks list --- htdocs/projet/tasks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 64d134a7254..53ad98eb194 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -773,7 +773,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; // Other options - $parameters = array(); + $parameters = array('arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $taskstatic, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1046,7 +1046,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third $j = 0; $level = 0; $nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields); } else { - $colspan = 10; + $colspan = count($arrayfields); if ($object->usage_bill_time) { $colspan += 2; } From fc78b2e882a48099174ee84ef8b3e218db517de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 11 May 2023 11:22:02 +0200 Subject: [PATCH 07/54] can use isModEnabled("module") in extrafield enabled --- htdocs/core/actions_extrafields.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 83fd8d47c4f..e8c4154c85b 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -367,7 +367,7 @@ if ($action == 'update') { $computedvalue, (GETPOST('entitycurrentorall', 'alpha') ? 0 : ''), GETPOST('langfile'), - GETPOST('enabled', 'alpha'), + GETPOST('enabled', 'restricthtml'), (GETPOST('totalizable', 'alpha') ? 1 : 0), GETPOST('printable', 'alpha'), array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist) From 69dcd9dfd098110414ea40dfe7b111e5705e10b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 11 May 2023 11:23:30 +0200 Subject: [PATCH 08/54] Update admin_extrafields_edit.tpl.php --- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 2e8511acf8e..e12c6c17ce6 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -1,7 +1,7 @@ * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2023 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -143,7 +143,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con - + From 4ad585facc76bc62ff2f3c841bb4bd3b914275e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Thu, 11 May 2023 11:41:58 +0200 Subject: [PATCH 09/54] FIX: Add Missing rights check on holiday calendar --- htdocs/comm/action/index.php | 132 +++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 61 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9b451a47659..4878ecaa13c 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -582,10 +582,18 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on // Local calendar $s .= '
'.$langs->trans("LocalAgenda").'  
'; - // Holiday calendar - $s .= '
 
'; + if ($user->rights->holiday->read) { + // Holiday calendar + $s .= ' +
+   +
'; + } - // External calendars + // External calendars if (is_array($showextcals) && count($showextcals) > 0) { $s .= '