From af8d2e0e1adf9de4ba156752e605d5ffecf85d0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 May 2019 12:31:51 +0200 Subject: [PATCH 1/2] Fix error message when module disabled --- htdocs/admin/emailcollector_card.php | 4 ++-- htdocs/admin/emailcollector_list.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index eaef18c9543..ca30af7ae69 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -33,8 +33,8 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectorfilter.class include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php'; include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; -if (!$user->admin) - accessforbidden(); +if (!$user->admin) accessforbidden(); +if (empty($conf->emailcollector->enabled)) accessforbidden(); // Load traductions files requiredby by page $langs->loadLangs(array("admin", "mails", "other")); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index cacebb8e55d..f56afd9074d 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; dol_include_once('/emailcollector/class/emailcollector.class.php'); if (!$user->admin) accessforbidden(); +if (empty($conf->emailcollector->enabled)) accessforbidden(); // Load traductions files requiredby by page $langs->loadLangs(array("admin", "other")); @@ -450,10 +451,10 @@ while ($i < min($num, $limit)) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - + if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; - + if (! empty($arrayfields['t.'.$key]['checked'])) { print ' Date: Thu, 9 May 2019 12:38:00 +0200 Subject: [PATCH 2/2] FIX: Add hidden option MAIN_PDF_HIDE_SITUATION to hide situation (quick hack to fix output pb). --- ChangeLog | 1 + htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 143aa9859f3..b92b23a0748 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,6 +34,7 @@ FIX: Total per day in timespent per week FIX: Total per day shows 00:00 if the total time spent is equal to 12:00 FIX: Update/delete currency on same languages FIX: Wrong variable name make contact of supplier order not used on PDF. +FIX: Add hidden option MAIN_PDF_HIDE_SITUATION to hide situation (quick hack to fix output pb). ***** ChangeLog for 9.0.2 compared to 9.0.1 ***** FIX: #10822 diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index d6eb5191bb4..c1172587ab5 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -378,7 +378,7 @@ class pdf_crabe extends ModelePDFFactures $progress_width = 0; // Situation invoice handling - if ($object->situation_cycle_ref) + if ($object->situation_cycle_ref && empty($conf->global->MAIN_PDF_HIDE_SITUATION)) { $this->situationinvoice = true; $progress_width = 10;