From a915a4faaf118f898d3938e5194766e3039214ca Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 7 Feb 2020 11:14:13 +0100 Subject: [PATCH 1/6] FIX missing hook parameter --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ae713bbab20..7f5c80b11e8 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -996,7 +996,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation From 14531bf16092f9287a97e9622ad6504b49f16e27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 15:28:40 +0100 Subject: [PATCH 2/6] Fix #13046 - Bad parenthesis on test --- htdocs/core/class/html.formmail.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index db758f6c614..10bbda7647b 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -593,7 +593,7 @@ class FormMail extends Form $out.= ' <'.$this->tomail.'>'; if ($this->withtofree) { - $out.= '
'.$langs->trans("and").' withto) :"").'" />'; + $out.= '
'.$langs->trans("and").' withto) : "").'" />'; } } else @@ -606,7 +606,7 @@ class FormMail extends Form { if (! empty($this->withtofree)) { - $out.= 'withto) :"").'" />'; + $out.= 'withto) : "").'" />'; } if (! empty($this->withto) && is_array($this->withto)) { From 6badf724cf3dbfbccd3ace3523f1d75e110cfd9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 15:51:43 +0100 Subject: [PATCH 3/6] FIX Mail smtps truncated if content has a line with single . Conflicts: htdocs/core/class/CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 809cf15edbf..853f2f98b05 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -176,7 +176,7 @@ class CMailFile if (empty($msg)) { dol_syslog("CMailFile::CMailfile: Try to send an email with empty body"); - $msg='.'; // Avoid empty message (with empty message conten show a multipart structure) + $msg = '.'; // Avoid empty message (with empty message content, you will see a multipart structure) } // Detect if message is HTML (use fast method) @@ -198,7 +198,7 @@ class CMailFile //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Replace relative /viewimage to absolute path - $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT, '/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep); + $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT, '/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1); if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html. @@ -330,6 +330,9 @@ class CMailFile $msg = $this->checkIfHTML($msg); } + // Replace . alone on a new line with .. to avoid to have SMTP interpret this as end of message + $msg = preg_replace('/(\r|\n)\.(\r|\n)/ims', '\1..\2', $msg); + if ($this->msgishtml) $smtps->setBodyContent($msg, 'html'); else $smtps->setBodyContent($msg, 'plain'); From c77169ad878e49fec353f4e720bc8be972ae913b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 Feb 2020 16:01:09 +0100 Subject: [PATCH 4/6] FIX : Problem with column label in subscription list --- htdocs/adherents/subscription/list.php | 51 ++++++-------------------- 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index e7967aa4782..512f3935177 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -387,46 +387,17 @@ print "\n"; print ''; -if (! empty($arrayfields['d.ref']['checked'])) -{ - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "c.rowid", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['d.fk_type']['checked'])) -{ - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "c.fk_type", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['d.lastname']['checked'])) -{ - print_liste_field_titre("LastName", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['d.firstname']['checked'])) -{ - print_liste_field_titre("FirstName", $_SERVER["PHP_SELF"], "d.firstname", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['d.login']['checked'])) -{ - print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['t.libelle']['checked'])) -{ - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder); -} -if (! empty($arrayfields['d.bank']['checked'])) -{ - print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['c.dateadh']['checked'])) -{ - print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); -} -if (! empty($arrayfields['c.datef']['checked'])) -{ - print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); -} -if (! empty($arrayfields['d.amount']['checked'])) -{ - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", '', $sortfield, $sortorder, 'right '); -} +if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], "c.rowid", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.fk_type']['checked'])) print_liste_field_titre($arrayfields['d.fk_type']['label'], $_SERVER["PHP_SELF"], "c.fk_type", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'], $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'], $_SERVER["PHP_SELF"], "d.firstname", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['t.libelle']['checked'])) print_liste_field_titre($arrayfields['t.libelle']['label'], $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder); +if (! empty($arrayfields['d.bank']['checked'])) print_liste_field_titre($arrayfields['d.bank']['label'], $_SERVER["PHP_SELF"], "b.fk_account", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['c.dateadh']['checked'])) print_liste_field_titre($arrayfields['c.dateadh']['label'], $_SERVER["PHP_SELF"], "c.dateadh", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); +if (! empty($arrayfields['c.datef']['checked'])) print_liste_field_titre($arrayfields['c.datef']['label'], $_SERVER["PHP_SELF"], "c.datef", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); +if (! empty($arrayfields['d.amount']['checked'])) print_liste_field_titre($arrayfields['d.amount']['label'], $_SERVER["PHP_SELF"], "c.subscription", $param, "", '', $sortfield, $sortorder, 'right '); + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; From c7181830fc3539f0388f8e68dff097997a90bf26 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Wed, 12 Feb 2020 09:11:39 +0100 Subject: [PATCH 5/6] Fix the display of the banner with multicompany Before : if a account of a entity require to define the Journal code, Banner displayed in all entities. Now : Show the banner only in the entity concerned. --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 16996358425..2c59d677d96 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -972,7 +972,7 @@ if (empty($action) || $action == 'view') { // Test that setup is complete - $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL AND clos=0'; + $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity IN ('.getEntity('bank_account').') AND fk_accountancy_journal IS NULL AND clos=0'; $resql = $db->query($sql); if ($resql) { From 50f0b61f1ea538f49056000592c95cce548bab1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 18:50:33 +0100 Subject: [PATCH 6/6] Update bankjournal.php --- htdocs/accountancy/journal/bankjournal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 2c59d677d96..362c1b1708f 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -971,8 +971,8 @@ if (empty($action) || $action == 'view') { journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); - // Test that setup is complete - $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity IN ('.getEntity('bank_account').') AND fk_accountancy_journal IS NULL AND clos=0'; + // Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed) + $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0'; $resql = $db->query($sql); if ($resql) {