From b0ea9fed0a9947dff210e230c88062e0fb7eebf1 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Mon, 16 Aug 2021 18:05:29 +0800 Subject: [PATCH 01/18] fix warnings 1 Removing all PHP8 warnings from error logs --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c87af9558e8..7eeda32dfed 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -528,7 +528,7 @@ $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { $tmpforcreatebutton = dol_getdate(dol_now(), true); - $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + $newparam = 'month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; From d2e2dcf27e7ae8b98b885aa0f2bffc0008fae29a Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Mon, 16 Aug 2021 18:10:04 +0800 Subject: [PATCH 02/18] fix warnings 2 Fixing PHP8 warnings --- htdocs/main.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e3ada0c6c59..30b92cd82fd 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2016,24 +2016,24 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $dropdownBody .= '
'; if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { - $dropdownBody .= '
'.$langs->transcountry("ProfId1", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).''; + $dropdownBody .= '
'.$langs->transcountry("ProfId1", $mysoc->country_code).': '.showValueWithClipboardCPButton(getDolGlobalString("MAIN_INFO_SIREN")).''; } if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { - $dropdownBody .= '
'.$langs->transcountry("ProfId2", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).''; + $dropdownBody .= '
'.$langs->transcountry("ProfId2", $mysoc->country_code).': '.showValueWithClipboardCPButton(getDolGlobalString("MAIN_INFO_SIRET")).''; } if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { - $dropdownBody .= '
'.$langs->transcountry("ProfId3", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).''; + $dropdownBody .= '
'.$langs->transcountry("ProfId3", $mysoc->country_code).': '.showValueWithClipboardCPButton(getDolGlobalString("MAIN_INFO_APE")).''; } if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { - $dropdownBody .= '
'.$langs->transcountry("ProfId4", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).''; + $dropdownBody .= '
'.$langs->transcountry("ProfId4", $mysoc->country_code).': '.showValueWithClipboardCPButton(getDolGlobalString("MAIN_INFO_RCS")).''; } if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { - $dropdownBody .= '
'.$langs->transcountry("ProfId5", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).''; + $dropdownBody .= '
'.$langs->transcountry("ProfId5", $mysoc->country_code).': '.showValueWithClipboardCPButton(getDolGlobalString("MAIN_INFO_PROFID5")).''; } if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { - $dropdownBody .= '
'.$langs->transcountry("ProfId6", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).''; + $dropdownBody .= '
'.$langs->transcountry("ProfId6", $mysoc->country_code).': '.showValueWithClipboardCPButton(getDolGlobalString("MAIN_INFO_PROFID6")).''; } - $dropdownBody .= '
'.$langs->trans("VATIntraShort").': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).''; + $dropdownBody .= '
'.$langs->trans("VATIntraShort").': '.showValueWithClipboardCPButton(getDolGlobalString("MAIN_INFO_TVAINTRA")).''; $dropdownBody .= '
'; From f9c4ea8f6a9a49066c6a0db16b5c54322fa958db Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Mon, 16 Aug 2021 18:37:39 +0800 Subject: [PATCH 03/18] fix warnings3 Fixing PHP8 warnings --- htdocs/supplier_proposal/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 3c89be6bfe4..7dc284c3edf 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -202,6 +202,9 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } +//to remove PHP8 warnings down the line +$search_product_category = 0; + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? From 1bd7b4a439bfca557ea7ec8cc0b040d1b7ab495e Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Mon, 16 Aug 2021 18:52:44 +0800 Subject: [PATCH 04/18] fix warnings 4 Fixing PHP8 warnings --- htdocs/contrat/services_list.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 8368bffbab2..82ca1669384 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -412,18 +412,28 @@ if (!empty($filter_op2) && $filter_op2 != -1) { if (!empty($filter_opcloture) && $filter_opcloture != -1) { $param .= '&filter_opcloture='.urlencode($filter_opcloture); } +//removing PHP warnings +$filter_dateouvertureprevue = isset($filter_dateouvertureprevue) ? $filter_dateouvertureprevue : '' ; if ($filter_dateouvertureprevue != '') { $param .= '&opouvertureprevueday='.$opouvertureprevueday.'&opouvertureprevuemonth='.$opouvertureprevuemonth.'&opouvertureprevueyear='.$opouvertureprevueyear; } +//removing PHP warnings +$filter_date1 = isset($filter_date1) ? $filter_date1 : ''; if ($filter_date1 != '') { $param .= '&op1day='.$op1day.'&op1month='.$op1month.'&op1year='.$op1year; } +//removing PHP8 warnings +$filter_date2 = isset($filter_date2) ? $filter_date2 : ''; if ($filter_date2 != '') { $param .= '&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year; } +//removing PHP8 warnings +$filter_datecloture = isset($filter_datecloture) ? $filter_datecloture : ''; if ($filter_datecloture != '') { $param .= '&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year; } +//removing PHP8 warnings +$optioncss = isset($optioncss) ? $optioncss : ''; if ($optioncss != '') { $param .= '&optioncss='.$optioncss; } @@ -467,7 +477,8 @@ if ($mode == "5") { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contract', 0, '', '', $limit); -if ($sall) { +//adding isset to remove PHP8 warnings +if (isset($sall)) { foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); } @@ -475,6 +486,8 @@ if ($sall) { } $morefilter = ''; +//removing PHP8 warnings +$moreforfilter = ''; // If the user can view categories of products if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) { From 031e13d438fd98ba3bba43fcdbae8c60341528fc Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Mon, 16 Aug 2021 18:55:49 +0800 Subject: [PATCH 05/18] fix warnings 5 Removing PHP8 warnings --- htdocs/societe/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index cdbacd5ffca..cb5dc4500ca 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -672,6 +672,8 @@ if (empty($reshook)) { } $sql .= $hookmanager->resPrint; // Add GroupBy from hooks +//removing PHP8 warnings +$all, = isset($all,) ? $all, : ''; $parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; From 9f1ced1fd01695bf9576c4631d8221ece37dc1c3 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Mon, 16 Aug 2021 19:06:38 +0800 Subject: [PATCH 06/18] fix warnings 6 Removing PHP8 warnings --- htdocs/comm/action/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 245f90edf72..6862296d18b 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1187,7 +1187,8 @@ if ($action == 'create') { print img_picto('', 'project', 'class="pictofixedwidth"'); print $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); - print ' '; + //duplicating test from line above to remove PHP8 warning + print ' '; print ''; $urloption = '?action=create&donotclearsession=1'; $url = dol_buildpath('comm/action/card.php', 2).$urloption; From af1f29bb16e98d040b12235dbe33515129ab6e40 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 16 Aug 2021 11:22:49 +0000 Subject: [PATCH 07/18] Fixing style errors. --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6862296d18b..2d513e5477e 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1187,7 +1187,7 @@ if ($action == 'create') { print img_picto('', 'project', 'class="pictofixedwidth"'); print $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); - //duplicating test from line above to remove PHP8 warning + //duplicating test from line above to remove PHP8 warning print ' '; print ''; $urloption = '?action=create&donotclearsession=1'; From 925303400733f02b54c44debd368b04094fba5f4 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Wed, 18 Aug 2021 17:43:45 +0800 Subject: [PATCH 08/18] Update list.php --- htdocs/supplier_proposal/list.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 7dc284c3edf..6b5ba8c7506 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -202,7 +202,6 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -//to remove PHP8 warnings down the line $search_product_category = 0; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; From 66495f3a9dd997d1327cfe34edd522edc0969fe6 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Wed, 18 Aug 2021 17:47:59 +0800 Subject: [PATCH 09/18] Update services_list.php --- htdocs/contrat/services_list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 82ca1669384..ce9d0aa47a4 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -291,6 +291,11 @@ if ($socid > 0) { $sql .= " AND s.rowid = ".((int) $socid); } +$filter_dateouvertureprevue = ''; +$filter_date1 = ''; +$filter_date2 = ''; +$filter_opcloture = ''; + $filter_dateouvertureprevue_start = dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); $filter_dateouvertureprevue_end = dol_mktime(23, 59, 59, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); if ($filter_dateouvertureprevue_start != '' && $filter_opouvertureprevue == -1) { @@ -422,18 +427,15 @@ $filter_date1 = isset($filter_date1) ? $filter_date1 : ''; if ($filter_date1 != '') { $param .= '&op1day='.$op1day.'&op1month='.$op1month.'&op1year='.$op1year; } -//removing PHP8 warnings -$filter_date2 = isset($filter_date2) ? $filter_date2 : ''; + if ($filter_date2 != '') { $param .= '&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year; } -//removing PHP8 warnings -$filter_datecloture = isset($filter_datecloture) ? $filter_datecloture : ''; + if ($filter_datecloture != '') { $param .= '&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year; } -//removing PHP8 warnings -$optioncss = isset($optioncss) ? $optioncss : ''; + if ($optioncss != '') { $param .= '&optioncss='.$optioncss; } @@ -477,7 +479,6 @@ if ($mode == "5") { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contract', 0, '', '', $limit); -//adding isset to remove PHP8 warnings if (isset($sall)) { foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); @@ -486,7 +487,6 @@ if (isset($sall)) { } $morefilter = ''; -//removing PHP8 warnings $moreforfilter = ''; // If the user can view categories of products From 3cde9a27abf31f9f424f3d0b4bb49b6236df9050 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Wed, 18 Aug 2021 17:50:10 +0800 Subject: [PATCH 10/18] Update list.php --- htdocs/societe/list.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index cb5dc4500ca..160440c2394 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -672,9 +672,7 @@ if (empty($reshook)) { } $sql .= $hookmanager->resPrint; // Add GroupBy from hooks -//removing PHP8 warnings -$all, = isset($all,) ? $all, : ''; -$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); +$parameters = array('fieldstosearchall' => $fieldstosearchall); $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; From 2d35106e0b38261eaef9de6e5f8347c5321a8ce6 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Wed, 18 Aug 2021 17:52:21 +0800 Subject: [PATCH 11/18] Update card.php --- htdocs/comm/action/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 2d513e5477e..e5a83348db3 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1187,7 +1187,6 @@ if ($action == 'create') { print img_picto('', 'project', 'class="pictofixedwidth"'); print $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); - //duplicating test from line above to remove PHP8 warning print ' '; print ''; $urloption = '?action=create&donotclearsession=1'; From ab95c5f463ca6537aef8c0b1bfbb5750e0df5aa5 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Wed, 18 Aug 2021 21:55:00 +0800 Subject: [PATCH 12/18] Update index.php --- htdocs/comm/action/index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 7eeda32dfed..8f23d472dbb 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -528,7 +528,12 @@ $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { $tmpforcreatebutton = dol_getdate(dol_now(), true); - $newparam = 'month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + if(isset($newparam)) { + $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + } + else { + $newparam = 'month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + } //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; From 88b0408e420d3f66a9504039312f8fdc1246a695 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 18 Aug 2021 13:57:19 +0000 Subject: [PATCH 13/18] Fixing style errors. --- htdocs/comm/action/index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 8f23d472dbb..2610f8a51c8 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -528,10 +528,9 @@ $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { $tmpforcreatebutton = dol_getdate(dol_now(), true); - if(isset($newparam)) { + if (isset($newparam)) { $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; - } - else { + } else { $newparam = 'month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; } From 1df2aeb23357c472235ebc1ca99bb5fd24535a78 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Aug 2021 22:01:53 +0200 Subject: [PATCH 14/18] Update card.php --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index e5a83348db3..b9586e1b1bb 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1185,7 +1185,7 @@ if ($action == 'create') { print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + print $formproject->select_projects((empty($societe->id) ? '' : $societe->id), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); print ' '; print ''; From 7af265db8a2ea7a7a8ff31eb36b8aa3c418f35d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Aug 2021 22:03:16 +0200 Subject: [PATCH 15/18] Update card.php --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b9586e1b1bb..97a573ce86f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1187,7 +1187,7 @@ if ($action == 'create') { print img_picto('', 'project', 'class="pictofixedwidth"'); print $formproject->select_projects((empty($societe->id) ? '' : $societe->id), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); - print ' '; + print ' '; print ''; $urloption = '?action=create&donotclearsession=1'; $url = dol_buildpath('comm/action/card.php', 2).$urloption; From 4d20ba2e4ede30fd0926a56f73e259e9b1511206 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Thu, 19 Aug 2021 04:29:09 +0800 Subject: [PATCH 16/18] Update services_list.php --- htdocs/contrat/services_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index ce9d0aa47a4..24b6e643b51 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -479,7 +479,7 @@ if ($mode == "5") { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contract', 0, '', '', $limit); -if (isset($sall)) { +if (!empty($sall)) { foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); } From 476dfc289e30ed738a9c6021bdd9b1497b88b741 Mon Sep 17 00:00:00 2001 From: Gurvan Kervern Date: Thu, 19 Aug 2021 18:16:47 +0800 Subject: [PATCH 17/18] Update index.php --- htdocs/comm/action/index.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 2610f8a51c8..4100cd6dd22 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -59,6 +59,8 @@ if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) { $filtert = $user->id; } +$newparam = ''; + $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -527,13 +529,9 @@ $viewmode .= ''; // To add a space before t $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { $tmpforcreatebutton = dol_getdate(dol_now(), true); - - if (isset($newparam)) { - $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; - } else { - $newparam = 'month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; - } - + + $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); From 172b6724375421cee9bdaa8a36fe6953cd51dcae Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 19 Aug 2021 10:19:25 +0000 Subject: [PATCH 18/18] Fixing style errors. --- htdocs/comm/action/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 4100cd6dd22..8c514c0989b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -529,9 +529,9 @@ $viewmode .= ''; // To add a space before t $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { $tmpforcreatebutton = dol_getdate(dol_now(), true); - + $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; - + //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));