From ad07fdfd79a9bc7510eb958b71b9b6dc250d841d Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Sun, 27 Nov 2022 01:06:40 +0100 Subject: [PATCH 1/5] FIX #22837 --- htdocs/core/class/html.formticket.class.php | 12 +++++++----- htdocs/ticket/card.php | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 7d116fd692a..cea007f8e61 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -127,12 +127,14 @@ class FormTicket /** * Show the form to input ticket * - * @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end() - * @param string $mode Mode ('create' or 'edit') - * @param int $public 1=If we show the form for the public interface + * @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end() + * @param string $mode Mode ('create' or 'edit') + * @param int $public 1=If we show the form for the public interface + * @param Contact|null $with_contact [=NULL] Contact to link to this ticket if exists + * @param string $action [=''] Action in card * @return void */ - public function showForm($withdolfichehead = 0, $mode = 'edit', $public = 0) + public function showForm($withdolfichehead = 0, $mode = 'edit', $public = 0, Contact $with_contact = null, $action = '') { global $conf, $langs, $user, $hookmanager; @@ -441,7 +443,7 @@ class FormTicket // Other attributes $parameters = array(); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $this->action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { print $ticketstat->showOptionals($extrafields, 'create'); } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 9c1a7c709b7..1b3dd4c8e37 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -700,7 +700,7 @@ if ($action == 'create' || $action == 'presend') { $formticket->withextrafields = 1; $formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid')); - $formticket->showForm(1, 'create', 0); + $formticket->showForm(1, 'create', 0, null, $action); /*} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) { $formticket = new FormTicket($db); From 1d7c550adb1d6c90a80535bdc17657bb794281ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Dec 2022 16:09:05 +0100 Subject: [PATCH 2/5] Fix add BARCODE_INIT_MAX to solve timeout in barcode generation --- htdocs/barcode/codeinit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 2293f7d9c27..f6977db8baf 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -44,7 +44,7 @@ $thirdpartytmp = new Societe($db); $modBarCodeProduct = ''; -$maxperinit = 1000; +$maxperinit = empty($conf->global->BARCODE_INIT_MAX) ? 1000 : $conf->global->BARCODE_INIT_MAX; /* From 20f7263587fe0935d78634b6e7bbec15cb050a38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Dec 2022 01:45:00 +0100 Subject: [PATCH 3/5] Debug v17 --- htdocs/categories/viewcat.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 194229725c3..329c9473cc7 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -374,7 +374,7 @@ if ($cats < 0) { dol_print_error($db, $object->error, $object->errors); } elseif (count($cats) < 1) { print ''; - print ''.$langs->trans("NoSubCat").''; + print ''.$langs->trans("NoSubCat").''; print ''; } else { $categstatic = new Categorie($db); @@ -461,7 +461,7 @@ if ($cats < 0) { print ''; print ''.img_picto_common('', 'treemenu/branchbottom.gif').''; - print ''.$langs->trans("NoCategoryYet").''; + print ''.$langs->trans("NoCategoryYet").''; print ' '; print ''; @@ -1145,7 +1145,7 @@ if ($type == Categorie::TYPE_USER) { // List of warehouses if ($type == Categorie::TYPE_WAREHOUSE) { - if ($user->hasRight("warehouse", "read")) { + if ($user->hasRight("stock", "read")) { $permission = $user->rights->stock->creer; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; From a4c1ae1b8271ce30ddd544ae242b942ba4087f30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Dec 2022 01:41:20 +0100 Subject: [PATCH 4/5] Fix permission --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index be5a1283d73..10eb7b389a8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4083,7 +4083,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes', 'currency', 'multicurrency', 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice', - 'edit', 'ellipsis-h', 'email', 'entity', 'envelope', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt', + 'edit', 'ellipsis-h', 'email', 'entity', 'envelope', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt', 'eye', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus', 'generate', 'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group', 'help', 'holiday', @@ -4547,7 +4547,7 @@ function img_view($titlealt = 'default', $float = 0, $other = 'class="valignmidd $moreatt = ($float ? 'style="float: right" ' : '').$other; - return img_picto($titlealt, 'view.png', $moreatt); + return img_picto($titlealt, 'eye', $moreatt); } /** From 69a25712f4122121e8c8a17f32e0ea6349184437 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Dec 2022 11:10:53 +0100 Subject: [PATCH 5/5] FIX black theme management --- htdocs/theme/eldy/btn.inc.php | 8 ++++---- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/btn.inc.php | 8 ++++---- htdocs/theme/md/style.css.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index b29c55bd02d..28ae22e9696 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -18,7 +18,9 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { if (!empty($conf->global->THEME_DARKMODEENABLED)) { print "/* For dark mode */\n"; if ($conf->global->THEME_DARKMODEENABLED != 2) { - print "@media (prefers-color-scheme: dark) {"; + print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes + } else { + print "@media not print {"; } print " :root { @@ -32,9 +34,7 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) { --textbutaction: rgb(255,255,255); }\n"; - if ($conf->global->THEME_DARKMODEENABLED != 2) { - print "}"; - } + print "}"; } ?> diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 993a8da554d..b78428deadd 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -60,7 +60,7 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) { print "/* For dark mode */\n"; if ($conf->global->THEME_DARKMODEENABLED != 2) { - print "@media not print and (prefers-color-scheme: dark) {"; + print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes } else { print "@media not print {"; } diff --git a/htdocs/theme/md/btn.inc.php b/htdocs/theme/md/btn.inc.php index a668876b0a3..5ccd2e100dd 100644 --- a/htdocs/theme/md/btn.inc.php +++ b/htdocs/theme/md/btn.inc.php @@ -18,7 +18,9 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { if (!empty($conf->global->THEME_DARKMODEENABLED)) { print "/* For dark mode */\n"; if ($conf->global->THEME_DARKMODEENABLED != 2) { - print "@media (prefers-color-scheme: dark) {"; + print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes + } else { + print "@media not print {"; } print " :root { @@ -32,9 +34,7 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) { --textbutaction: rgb(255,255,255); }\n"; - if ($conf->global->THEME_DARKMODEENABLED != 2) { - print "}"; - } + print "}"; } ?> diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index bfbedc6830a..ac5a712b395 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -360,7 +360,7 @@ print '*/'."\n"; if (!empty($conf->global->THEME_DARKMODEENABLED)) { print "/* For dark mode */\n"; if ($conf->global->THEME_DARKMODEENABLED != 2) { - print "@media not print and (prefers-color-scheme: dark) {"; + print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes } else { print "@media not print {"; }