From c8e32bf96ff9849c7968f394bc6dbf1a281774df Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 25 Feb 2023 07:29:57 +0100 Subject: [PATCH 01/17] FIX Activate widget Alert product on stock only on home --- htdocs/core/modules/modProduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 5224f82a2f5..ce08252ced4 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -104,7 +104,7 @@ class modProduct extends DolibarrModules // Boxes $this->boxes = array( 0=>array('file'=>'box_produits.php', 'enabledbydefaulton'=>'Home'), - 1=>array('file'=>'box_produits_alerte_stock.php', 'enabledbydefaulton'=>''), + 1=>array('file'=>'box_produits_alerte_stock.php', 'enabledbydefaulton'=>'Home'), 2=>array('file'=>'box_graph_product_distribution.php', 'enabledbydefaulton'=>'Home') ); From d7d8653603c2d18002806aa850ec666929c114c2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 25 Feb 2023 08:20:31 +0100 Subject: [PATCH 02/17] FIX Members Index - Missing colspan & language key on widget --- htdocs/core/boxes/box_members_by_type.php | 4 ++-- htdocs/core/boxes/box_members_subscriptions_by_year.php | 4 ++-- htdocs/langs/en_US/members.lang | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index b3f3504cee8..f400ae6fb3d 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -80,7 +80,7 @@ class box_members_by_type extends ModeleBoxes public function loadBox($max = 5) { global $user, $langs, $conf; - $langs->load("boxes"); + $langs->loadLangs(array("boxes", "members")); $this->max = $max; @@ -284,7 +284,7 @@ class box_members_by_type extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( - 'td' => 'class="center"', + 'td' => 'colspan="7" class="center"', 'text' => $langs->trans("NoRecordedMembersByType") ); } else { diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 716b8ed0482..b7f2ea47229 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -79,7 +79,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes public function loadBox($max = 5) { global $user, $langs, $conf; - $langs->load("boxes"); + $langs->loadLangs(array("boxes", "members")); $this->max = $max; @@ -191,7 +191,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( - 'td' => 'class="center"', + 'td' => 'colspan="4" class="center"', 'text' => $langs->trans("NoRecordedMembers"), ); } else { diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index f8981df17d9..1597f9f2719 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -4,6 +4,8 @@ MemberCard=Member card SubscriptionCard=Subscription card Member=Member Members=Members +NoRecordedMembers=No recorded members +NoRecordedMembersByType=No recorded members ShowMember=Show member card UserNotLinkedToMember=User not linked to a member ThirdpartyNotLinkedToMember=Third party not linked to a member @@ -231,4 +233,4 @@ ForceMemberNature=Force member nature (Individual or Corporation) CreateDolibarrLoginDesc=The creation of a user login for members allows them to connect to the application. Depending on the authorizations granted, they will be able, for example, to consult or modify their file themselves. CreateDolibarrThirdPartyDesc=A thirdparty is the legal entity that will be used on the invoice if you decide to generate invoice for each contribution. You will be able to create it later during the process of recording the contribution. MemberFirstname=Member firstname -MemberLastname=Member lastname \ No newline at end of file +MemberLastname=Member lastname From b83b9ff598bba7fc67bc4513d30bf784f73bb9ad Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Feb 2023 12:06:06 +0100 Subject: [PATCH 03/17] fix : Warning: Undefined array key tomail in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/actions_sendmails.inc.php on line 193 --- htdocs/core/actions_sendmails.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 4f7580bb8ca..e459437a74e 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -190,7 +190,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $tmparray[] = trim(GETPOST('sendto', 'alphawithlgt')); } - if (trim($_POST['tomail'])) { + if (isset($_POST['tomail']) && trim($_POST['tomail'])) { // Recipients are provided into free hidden text field $tmparray[] = trim(GETPOST('tomail', 'alphawithlgt')); } From 8b09e0f09024e5115922e2c0c4ae05ceef0d9210 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Feb 2023 12:38:01 +0100 Subject: [PATCH 04/17] fix : Warning: Undefined property: Societe:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/actions_sendmails.inc.php on line 350 --- htdocs/core/actions_sendmails.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index e459437a74e..5744316eb4a 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -346,7 +346,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO // Make substitution in email content $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object); $substitutionarray['__EMAIL__'] = $sendto; - $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '' : ''; + $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '' : ''; $parameters = array('mode'=>'formemail'); complete_substitutions_array($substitutionarray, $langs, $object, $parameters); From 05a32ab99368cfb42d3bf6007ac391ede2f000c6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Feb 2023 14:31:20 +0100 Subject: [PATCH 05/17] fix : Fatal error: Uncaught TypeError: Unsupported operand types: string / int in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/comm/propal/card.php on line 1420 --- htdocs/comm/propal/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f2c549f91f7..e14a2c05246 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1363,6 +1363,9 @@ if (empty($reshook)) { $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $remise_percent = price2num(GETPOST('remise_percent'), '', 2); + if (empty($remise_percent)) { + $remise_percent = 0; + } // Prepare a price equivalent for minimum price check $pu_equivalent = $pu_ht; From 822b81913fbd0df0642f8660e05a296f10176a2a Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sat, 25 Feb 2023 14:38:32 +0100 Subject: [PATCH 06/17] Fix dol_print_date warning --- htdocs/fichinter/class/fichinter.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 376e14c277f..d880673530d 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1738,8 +1738,8 @@ class FichinterLigne extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql .= " SET duree = ".((int) $total_duration); - $sql .= " , dateo = ".(!empty($obj->dateo) ? "'".$this->db->idate($obj->dateo)."'" : "null"); - $sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->idate($obj->datee)."'" : "null"); + $sql .= " , dateo = ".(!empty($obj->dateo) ? "'".$this->db->escape($obj->dateo)."'" : "null"); + $sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->escape($obj->datee)."'" : "null"); $sql .= " WHERE rowid = ".((int) $this->fk_fichinter); dol_syslog("FichinterLigne::update_total", LOG_DEBUG); From 2c57198de763e3c5c6122a82c58369304218acec Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Feb 2023 14:54:07 +0100 Subject: [PATCH 07/17] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/lib/files.lib.php on line 2847 and Attempt to read property lire on null in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/lib/files.lib.php on line 2847 --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 23659cd769b..e380563d6c8 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2842,9 +2842,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } $original_file = $conf->deplacement->dir_output.'/'.$original_file; //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; - } elseif (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) { + } elseif (($modulepart == 'propal' || $modulepart == 'propale') && isset($conf->propal->multidir_output[$entity])) { // Wrapping pour les propales - if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file)) { + if (property_exists($fuser->rights, 'propal') && ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file))) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; From ca1508e3331fff23e12c5734a5a12918558121ec Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Feb 2023 16:29:55 +0100 Subject: [PATCH 08/17] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/lib/files.lib.php on line 2953 --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index e380563d6c8..97b803822e9 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2950,7 +2950,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (empty($entity) || (empty($conf->product->multidir_output[$entity]) && empty($conf->service->multidir_output[$entity]))) { return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); } - if (($fuser->rights->produit->{$lire} || $fuser->rights->service->{$lire}) || preg_match('/^specimen/i', $original_file)) { + if ((isset($fuser->rights->produit) && $fuser->rights->produit->{$lire}) || (isset($fuser->rights->service) && $fuser->rights->service->{$lire}) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } if (isModEnabled("product")) { From 014aec72c22479ea92acedec0486b0a664e76415 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 26 Feb 2023 11:12:06 +0100 Subject: [PATCH 09/17] fix : Warning: Undefined array key height in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/lib/pdf.lib.php on line 2513 --- htdocs/core/lib/pdf.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 206fbb7b1c4..97425c00465 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2510,6 +2510,8 @@ function pdf_getSizeForImage($realpath) $maxheight = (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_HEIGHT) ? 32 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_HEIGHT); include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; $tmp = dol_getImageSize($realpath); + $width = 0; + $height = 0; if ($tmp['height']) { $width = (int) round($maxheight * $tmp['width'] / $tmp['height']); // I try to use maxheight if ($width > $maxwidth) { // Pb with maxheight, so i use maxwidth From 9f2c450953487606627a2efbf6eca60bef5230f4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 26 Feb 2023 10:17:38 +0000 Subject: [PATCH 10/17] Fixing style errors. --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 97425c00465..49e0672e462 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2511,7 +2511,7 @@ function pdf_getSizeForImage($realpath) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; $tmp = dol_getImageSize($realpath); $width = 0; - $height = 0; + $height = 0; if ($tmp['height']) { $width = (int) round($maxheight * $tmp['width'] / $tmp['height']); // I try to use maxheight if ($width > $maxwidth) { // Pb with maxheight, so i use maxwidth From 32ba0acb320f21d192f315ebcc700f05e7e9cdb6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Feb 2023 12:03:55 +0100 Subject: [PATCH 11/17] Fix navigation --- htdocs/comm/mailing/cibles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 106d6c3d12a..fae7df654b0 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -542,7 +542,7 @@ if ($object->fetch($id) >= 0) { $massactionbutton = ''; - print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit); + print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 0, 0, 1); print ''; From d97725173bcd4a18ed6190b4f82a0013492b5828 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Feb 2023 12:45:13 +0100 Subject: [PATCH 12/17] Fix sql error --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/partnership/partnership_card.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 835c81c7131..232cf479a1d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11546,7 +11546,7 @@ function forgeSQLFromUniversalSearchCriteria($filter, &$error = '') return '1 = 3'; // Bad syntax of the search string, we force a SQL not found } - return " AND (".preg_replace_callback('/'.$regexstring.'/', 'dolForgeCriteriaCallback', $filter).")"; + return " AND (".preg_replace_callback('/'.$regexstring.'/i', 'dolForgeCriteriaCallback', $filter).")"; } /** diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 2cb57ee44aa..b544ad94fc7 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -564,9 +564,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } - if ($object->status == $object::STATUS_DRAFT) { - print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); - } + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); // Back to draft if ($object->status != $object::STATUS_DRAFT) { From ac410a45185163a9ece5e1266e4c9680c3bb2ef8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Feb 2023 12:59:25 +0100 Subject: [PATCH 13/17] Fix missing url to check --- htdocs/partnership/class/partnership.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 15d75f20cb3..013323f3193 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -372,7 +372,7 @@ class Partnership extends CommonObject $sql = 'SELECT p.rowid, p.ref, p.fk_type, p.fk_soc, p.fk_member, p.status'; $sql .= ', p.entity, p.date_partnership_start, p.date_partnership_end, p.date_creation'; $sql .= ', p.fk_user_creat, p.tms, p.fk_user_modif, p.fk_user_modif'; - $sql .= ', p.note_private, p.note_public'; + $sql .= ', p.note_private, p.note_public, p.url_to_check'; $sql .= ', p.last_main_doc, p.count_last_url_check_error, p.last_check_backlink, p.reason_decline_or_cancel'; $sql .= ', p.import_key, p.model_pdf'; $sql .= ', pt.code as type_code, pt.label as type_label'; @@ -380,7 +380,7 @@ class Partnership extends CommonObject $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_partnership_type as pt ON p.fk_type = pt.rowid'; if ($id) { - $sql .= " WHERE p.rowid=".((int) $id); + $sql .= " WHERE p.rowid = ".((int) $id); } else { $sql .= " WHERE p.entity IN (0,".getEntity('partnership').")"; // Dont't use entity if you use rowid } @@ -427,6 +427,7 @@ class Partnership extends CommonObject $this->reason_decline_or_cancel = $obj->reason_decline_or_cancel; $this->import_key = $obj->import_key; $this->model_pdf = $obj->model_pdf; + $this->url_to_check = $obj->url_to_check; // Retrieve all extrafield // fetch optionals attributes and labels From bf544bef63f824c3bb2f022be2edd30315ce1542 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Feb 2023 13:13:58 +0100 Subject: [PATCH 14/17] css --- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 075813eaed9..abef03f283e 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -415,7 +415,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll // Example : Adding jquery code // print '