From e6d35039c9bc14fe1ff58aa5a8c1197ffd7b9779 Mon Sep 17 00:00:00 2001 From: abb Date: Sun, 14 Feb 2021 17:59:12 +0100 Subject: [PATCH 001/108] fix:Handle constant MAIN_SHOW_SOCIETE2EXTERN in checkUserAccessToObject --- htdocs/core/lib/security.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 2f1e3d5596b..13f93ec59d4 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -584,7 +584,8 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand } } elseif (!in_array($feature, $nocheck)) { // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield // If external user: Check permission for external users - if ($user->socid > 0) { + if ($user->socid > 0 && empty($conf->global->MAIN_SHOW_SOCIETE2EXTERN)) + { if (empty($dbt_keyfield)) dol_print_error('', 'Param dbt_keyfield is required but not defined'); $sql = "SELECT COUNT(dbt.".$dbt_keyfield.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; From 3841005806af3b6e2a1703e46bd67a34578ed4ff Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 12 Mar 2021 10:41:21 +0100 Subject: [PATCH 002/108] fix message creted teicket trans no entities --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 1c81faca1ad..c8decabb83a 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -307,7 +307,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('add', 'alpha')) { //setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); // Make a redirect to avoid to have ticket submitted twice if we make back - setEventMessages($langs->trans('MesgInfosPublicTicketCreatedWithTrackId', ''.$object->track_id.'', ''.$object->ref.''), null, 'warnings'); + setEventMessages($langs->transnoentities('MesgInfosPublicTicketCreatedWithTrackId', ''.$object->track_id.'', ''.$object->ref.''), null, 'warnings'); setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); header("Location: index.php"); exit; From dcb7958be9ee104be290711f16d0cf6fee133d60 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Sat, 13 Mar 2021 08:44:16 +0100 Subject: [PATCH 003/108] Update list.php Changed the presentation of the stock to show decimals and thousands separator. changes price2num to price and use MAIN_MAX_DECIMALS_STOCK --- htdocs/product/list.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 5bc973e56b7..3d471ff314f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1643,7 +1643,9 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - print price2num($product_static->stock_reel, 'MS'); + $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; + print price($product_static->stock_reel, 0, $langs->defaultlang,1,-1,$decimals); + //print price2num($product_static->stock_reel, 'MS'); } print ''; if (!$i) { @@ -1657,7 +1659,9 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - print price2num($product_static->stock_theorique, 'MS'); + $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; + print price($product_static->stock_theorique, 0, $langs->defaultlang,1,-1,$decimals); + //print price2num($product_static->stock_theorique, 'MS'); } print ''; if (!$i) { From f68bbdcf45d6754e1c381e69983dc9ccb9274163 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 13 Mar 2021 07:46:46 +0000 Subject: [PATCH 004/108] Fixing style errors. --- htdocs/product/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 3d471ff314f..bae9fe991d3 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1644,7 +1644,7 @@ if ($resql) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; - print price($product_static->stock_reel, 0, $langs->defaultlang,1,-1,$decimals); + print price($product_static->stock_reel, 0, $langs->defaultlang, 1, -1, $decimals); //print price2num($product_static->stock_reel, 'MS'); } print ''; @@ -1660,7 +1660,7 @@ if ($resql) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; - print price($product_static->stock_theorique, 0, $langs->defaultlang,1,-1,$decimals); + print price($product_static->stock_theorique, 0, $langs->defaultlang, 1, -1, $decimals); //print price2num($product_static->stock_theorique, 'MS'); } print ''; From ba4fd3d44f66b4f196e1f990d1c7b2702eb470b7 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Mon, 15 Mar 2021 13:44:40 +0100 Subject: [PATCH 005/108] Update list.php --- htdocs/product/list.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index bae9fe991d3..36c2de9e3ba 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1643,9 +1643,7 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; - print price($product_static->stock_reel, 0, $langs->defaultlang, 1, -1, $decimals); - //print price2num($product_static->stock_reel, 'MS'); + print price(price2num($product_static->stock_reel, 'MS')); } print ''; if (!$i) { @@ -1659,9 +1657,7 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; - print price($product_static->stock_theorique, 0, $langs->defaultlang, 1, -1, $decimals); - //print price2num($product_static->stock_theorique, 'MS'); + print price(price2num($product_static->stock_theorique, 'MS')); } print ''; if (!$i) { From 9c51e62d0f3cffd632f069fa23156ec6f724b321 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Tue, 16 Mar 2021 12:25:17 +0100 Subject: [PATCH 006/108] Update security.lib.php MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 13f93ec59d4..381745a5359 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -584,7 +584,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand } } elseif (!in_array($feature, $nocheck)) { // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield // If external user: Check permission for external users - if ($user->socid > 0 && empty($conf->global->MAIN_SHOW_SOCIETE2EXTERN)) + if ($user->socid > 0 && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) { if (empty($dbt_keyfield)) dol_print_error('', 'Param dbt_keyfield is required but not defined'); $sql = "SELECT COUNT(dbt.".$dbt_keyfield.") as nb"; From f59c19b573d4c1658fc890dc4f3cc7de5b83bab7 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 16 Mar 2021 16:50:59 +0100 Subject: [PATCH 007/108] search on lots or serials --- htdocs/core/ajax/selectsearchbox.php | 4 ++++ htdocs/langs/en_US/main.lang | 3 ++- htdocs/langs/fr_FR/main.lang | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 2e19d68109a..2794243b7f3 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -79,6 +79,10 @@ if (!empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONT if (((!empty($conf->product->enabled) && $user->rights->produit->lire) || (!empty($conf->service->enabled) && $user->rights->service->lire)) && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { $arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); + // search on lot/serial numbers + if ( ! empty($conf->productbatch->enabled) ) { + $arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_plot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); + } } if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED)) { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 444ceb7f64e..e27ec6d9c43 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -389,7 +389,7 @@ AmountTotal=Total amount AmountAverage=Average amount PriceQtyMinHT=Price quantity min. (excl. tax) PriceQtyMinHTCurrency=Price quantity min. (excl. tax) (currency) -PercentOfOriginalObject=Percent of original object +PercentOfOriginalObject=Percent of original object AmountOrPercent=Amount or percent Percentage=Percentage Total=Total @@ -1017,6 +1017,7 @@ SearchIntoContacts=Contacts SearchIntoMembers=Members SearchIntoUsers=Users SearchIntoProductsOrServices=Products or services +SearchIntoBatch=Lots / Serials SearchIntoProjects=Projects SearchIntoMO=Manufacturing Orders SearchIntoTasks=Tasks diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 70f50c7eea3..86ba2247682 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -548,7 +548,7 @@ None=Aucun NoneF=Aucune NoneOrSeveral=Aucun ou plusieurs Late=Retard -LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes +LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes NoItemLate=Aucun élément en retard Photo=Photo Photos=Photos @@ -1013,6 +1013,7 @@ SearchIntoContacts=Contacts SearchIntoMembers=Adhérents SearchIntoUsers=Utilisateurs SearchIntoProductsOrServices=Produits ou services +SearchIntoBatch=Lots / N° de série SearchIntoProjects=Projets SearchIntoMO=Ordres de fabrication SearchIntoTasks=Tâches From 18ef8031cd16644b914d6d28086c6ec596f3b77b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 17 Mar 2021 17:57:07 +0100 Subject: [PATCH 008/108] Update ftpclient.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $help_url = 'EN:Module_FTP_En|FR:Module_FTP|ES:Módulo_FTP'; llxHeader('', 'FTP', $help_url); --- htdocs/ftp/admin/ftpclient.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index 85039a3e6e1..ab673e45447 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -148,7 +148,10 @@ if (GETPOST('delete', 'alpha')) { $form = new Form($db); -llxHeader(); + +$help_url = 'EN:Module_FTP_En|FR:Module_FTP|ES:Módulo_FTP'; + +llxHeader('', 'FTP', $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("FTPClientSetup"), $linkback, 'title_setup'); From 373e225dd0589c2eeb757d7ab55026ce59d561df Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 17 Mar 2021 18:17:03 +0100 Subject: [PATCH 009/108] Update card.php translations of comments (fr->en) ---------------------------------------------------- insert: $help_url = 'EN:Module_Holiday'; llxHeader('', $langs->trans('CPTitreMenu'), $help_url); -------------------------------------------------------------------- start creatrion of https://wiki.dolibarr.org/index.php/Module_Holiday --- htdocs/holiday/card.php | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 76d0e607e47..bab0655b4c2 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -6,6 +6,7 @@ * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2014-2017 Ferran Marcet * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020-2021 Udo Tamm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -408,7 +409,7 @@ if (empty($reshook)) { $verif = $object->validate($user); - // Si pas d'erreur SQL on redirige vers la fiche de la demande + // If no SQL error, we redirect to the request form if ($verif > 0) { // To $destinataire = new User($db); @@ -446,7 +447,7 @@ if (empty($reshook)) { $nextMonth = dol_time_plus_duree($now, $delayForRequest, 'd'); - // Si l'option pour avertir le valideur en cas de délai trop court + // option to warn the validator in case of too short delay if ($object->getConfCP('AlertValidatorDelay')) { if ($object->date_debut < $nextMonth) { $message .= "\n"; @@ -454,7 +455,7 @@ if (empty($reshook)) { } } - // Si l'option pour avertir le valideur en cas de solde inférieur à la demande + // option to notify the validator if the balance is less than the request if ($object->getConfCP('AlertValidatorSolde')) { $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type)) { @@ -473,7 +474,7 @@ if (empty($reshook)) { $mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid); - // Envoi du mail + // Sending the email $result = $mail->sendfile(); if (!$result) { @@ -533,21 +534,21 @@ if (empty($reshook)) { $error++; } - // Si pas d'erreur SQL on redirige vers la fiche de la demande + // If no SQL error, we redirect to the request form if (!$error) { // Calculcate number of days consummed $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type); $newSolde = ($soldeActuel - $nbopenedday); - // On ajoute la modification dans le LOG + // The modification is added to the LOG $result = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $object->fk_type); if ($result < 0) { $error++; setEventMessages(null, $object->errors, 'errors'); } - //Update balance + // Update balance $result = $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type); if ($result < 0) { $error++; @@ -593,7 +594,7 @@ if (empty($reshook)) { $mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid); - // Envoi du mail + // Sending email $result = $mail->sendfile(); if (!$result) { @@ -619,7 +620,7 @@ if (empty($reshook)) { if (!empty($_POST['detail_refuse'])) { $object->fetch($id); - // Si statut en attente de validation et valideur = utilisateur + // If status pending validation and validator = user if ($object->statut == Holiday::STATUS_VALIDATED && $user->id == $object->fk_validator) { $object->date_refuse = dol_print_date('dayhour', dol_now()); $object->fk_user_refuse = $user->id; @@ -634,7 +635,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - // Si pas d'erreur SQL on redirige vers la fiche de la demande + // If no SQL error, we redirect to the request form if (!$error) { // To $destinataire = new User($db); @@ -674,7 +675,7 @@ if (empty($reshook)) { $mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid); - // Envoi du mail + // sending email $result = $mail->sendfile(); if (!$result) { @@ -703,7 +704,7 @@ if (empty($reshook)) { } - // Si Validation de la demande + // If the request is validated if ($action == 'confirm_draft' && GETPOST('confirm') == 'yes') { $error = 0; @@ -728,13 +729,13 @@ if (empty($reshook)) { } } - // Si confirmation of cancellation + // If confirmation of cancellation if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') { $error = 0; $object->fetch($id); - // Si statut en attente de validation et valideur = valideur ou utilisateur, ou droits de faire pour les autres + // If status pending validation and validator = validator or user, or rights to do for others if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) && ($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance)))) { $db->begin(); @@ -753,10 +754,10 @@ if (empty($reshook)) { $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type); $newSolde = ($soldeActuel + $nbopenedday); - // On ajoute la modification dans le LOG + // The modification is added to the LOG $result1 = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde, $object->fk_type); - // Mise à jour du solde + // Update of the balance $result2 = $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type); if ($result1 < 0 || $result2 < 0) { @@ -771,7 +772,7 @@ if (empty($reshook)) { $db->rollback(); } - // Si pas d'erreur SQL on redirige vers la fiche de la demande + // If no SQL error, we redirect to the request form if (!$error && $result > 0) { // To $destinataire = new User($db); @@ -811,7 +812,7 @@ if (empty($reshook)) { $mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid); - // Envoi du mail + // sending email $result = $mail->sendfile(); if (!$result) { @@ -853,7 +854,9 @@ $object = new Holiday($db); $listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon")); -llxHeader('', $langs->trans('CPTitreMenu')); +$help_url = 'EN:Module_Holiday'; + +llxHeader('', $langs->trans('CPTitreMenu'), $help_url); if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { // If user has no permission to create a leave From 0080d42b66e532c3591db1ee8445db315e778adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 17 Mar 2021 21:49:05 +0100 Subject: [PATCH 010/108] fix php8 warnings --- htdocs/core/boxes/box_graph_nb_tickets_type.php | 5 +++++ htdocs/core/boxes/box_graph_ticket_by_severity.php | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index eea0f0ccf77..44c883e6096 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -128,6 +128,11 @@ class box_graph_nb_tickets_type extends ModeleBoxes } $dataseries = array(); $data = array(); + $data['COM'] = 0; + $data['HELP'] = 0; + $data['ISSUE'] = 0; + $data['REQUEST'] = 0; + $data['OTHER'] = 0; $sql = "SELECT t.type_code, COUNT(t.type_code) as nb"; $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; $sql .= " WHERE t.fk_statut <> 8"; diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php index 252769abd0e..feec768446b 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -138,6 +138,10 @@ class box_graph_ticket_by_severity extends ModeleBoxes $dataseries = array(); $data = array(); + $data['LOW'] = 0; + $data['NORMAL'] = 0; + $data['HIGH'] = 0; + $data['BLOCKING'] = 0; $sql = "SELECT t.severity_code, COUNT(t.severity_code) as nb"; $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; $sql .= " WHERE t.fk_statut <> 8"; From b3757a6f697264521f86aa4fd58ae00622950929 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 18 Mar 2021 11:07:48 +0100 Subject: [PATCH 011/108] FIX: fix checkbox displayed according to module project setup parameters - work in progress --- htdocs/projet/card.php | 104 ++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index db710e2715d..50cf57f1863 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -841,17 +841,17 @@ elseif ($object->id > 0) print ''; // Usage - print ''; - print $langs->trans("Usage"); - print ''; - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) - { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print ''; - print '
'; + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Thirdparty if ($conf->societe->enabled) @@ -1022,32 +1021,31 @@ elseif ($object->id > 0) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print ''; $boxgraph .=''; $boxgraph .= ''; $boxgraph .= '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) - { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; From df4a243f18434f395f813d2059fb94d15a01721a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 18 Mar 2021 17:13:34 +0100 Subject: [PATCH 012/108] fix: PRODUIT_PDF_MERGE_PROPAL options do not work with new product feature --- htdocs/comm/propal/card.php | 1 + htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6779adc60c6..73ea01bc3f8 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -285,6 +285,7 @@ if (empty($reshook)) } elseif ($action == 'setecheance' && $usercancreate) { $result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); + $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db, $object->error); } elseif ($action == 'setdate_livraison' && $usercancreate) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 0ad654e49d0..856828edc00 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -762,9 +762,9 @@ class pdf_azur extends ModelePDFPropales } } else { if (!empty($conf->product->enabled)) { - $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product').dol_sanitizeFileName($product->ref); + $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product'); } elseif (!empty($conf->service->enabled)) { - $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product').dol_sanitizeFileName($product->ref); + $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product'); } } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index c4f11568456..c82fb592d82 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -907,9 +907,9 @@ class pdf_cyan extends ModelePDFPropales } } else { if (!empty($conf->product->enabled)) { - $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product').dol_sanitizeFileName($product->ref); + $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product'); } elseif (!empty($conf->service->enabled)) { - $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product').dol_sanitizeFileName($product->ref); + $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product'); } } From bd44658cbd6b516f1055679b7fd9755a7ad249dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 18 Mar 2021 23:09:13 +0100 Subject: [PATCH 013/108] fix php8 warning --- htdocs/contact/document.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 6118553914d..cbe1d1a6194 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -1,7 +1,7 @@ - * Copyright (C) 2015 Frederic France - * Copyright (C) 2017 Regis Houssin +/* Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2015-2021 Frederic France + * Copyright (C) 2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -107,7 +107,7 @@ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $c $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $helpurl); +llxHeader('', $title, $help_url); if ($object->id) { $head = contact_prepare_head($object); From 071b6a1bdc8d175a331af1d90c7248db8c059f95 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Thu, 18 Mar 2021 23:11:19 +0100 Subject: [PATCH 014/108] Code translation --- htdocs/adherents/index.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 4a4724593e4..33afa113078 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -193,11 +193,11 @@ if ($conf->use_javascript_ajax) { $boxgraph .='
'.$langs->trans("Statistics").'
'; - $SommeA = 0; - $SommeB = 0; + $SumToValidate = 0; + $SumValidated = 0; - $SommeC = 0; - $SommeD = 0; + $SumUpToDate = 0; + $SumResiliated = 0; $total = 0; $dataval = array(); $i = 0; @@ -206,18 +206,18 @@ if ($conf->use_javascript_ajax) { $dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0); $dataval['uptodate'][] = array($i, isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0); $dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0); - $SommeA += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; - $SommeB += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; - $SommeC += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; - $SommeD += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; + $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; + $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; + $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; + $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; $i++; } - $total = $SommeA + $SommeB + $SommeC + $SommeD; + $total = $SumToValidate + $SumValidated + $SumUpToDate + $SumResiliated; $dataseries = array(); - $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SommeB)); - $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SommeC)); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SommeD)); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SommeA)); + $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SumValidated)); + $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SumUpToDate)); + $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SumResiliated)); + $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SumToValidate)); include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; @@ -234,7 +234,7 @@ if ($conf->use_javascript_ajax) { $boxgraph .= '
'.$langs->trans("Total").''; - $boxgraph .= $SommeA + $SommeB + $SommeC + $SommeD; + $boxgraph .= $SumToValidate + $SumValidated + $SumUpToDate + $SumResiliated; $boxgraph .= '
'; $boxgraph .= ''; @@ -484,10 +484,10 @@ foreach ($AdherentType as $key => $adhtype) { } print ''; print ''.$langs->trans("Total").''; -print ''.$SommeA.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; -print ''.$SommeB.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; -print ''.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; -print ''.$SommeD.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; +print ''.$SumToValidate.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; +print ''.$SumValidated.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; +print ''.$SumUpToDate.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; +print ''.$SumResiliated.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; print ''; print "\n"; From 5b253eeb479ff9548ad4b9c36021d362d37430f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 18 Mar 2021 23:30:42 +0100 Subject: [PATCH 015/108] fix the fix --- htdocs/core/boxes/box_graph_nb_tickets_type.php | 10 ++++------ htdocs/core/boxes/box_graph_ticket_by_severity.php | 9 ++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index 44c883e6096..735dbed27dc 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -128,11 +128,6 @@ class box_graph_nb_tickets_type extends ModeleBoxes } $dataseries = array(); $data = array(); - $data['COM'] = 0; - $data['HELP'] = 0; - $data['ISSUE'] = 0; - $data['REQUEST'] = 0; - $data['OTHER'] = 0; $sql = "SELECT t.type_code, COUNT(t.type_code) as nb"; $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; $sql .= " WHERE t.fk_statut <> 8"; @@ -147,7 +142,10 @@ class box_graph_nb_tickets_type extends ModeleBoxes $i++; } foreach ($listofoppcode as $rowid => $code) { - $dataseries[] = array('label' => $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $code, 'c_ticket_category', 'code', 'label', $code), 'data' => $data[$code]); + $dataseries[] = array( + 'label' => $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $code, 'c_ticket_category', 'code', 'label', $code), + 'data' => (empty($data[$code]) ? 0 : $data[$code]) + ); } } else { dol_print_error($this->db); diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php index feec768446b..ce769da4752 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -138,10 +138,6 @@ class box_graph_ticket_by_severity extends ModeleBoxes $dataseries = array(); $data = array(); - $data['LOW'] = 0; - $data['NORMAL'] = 0; - $data['HIGH'] = 0; - $data['BLOCKING'] = 0; $sql = "SELECT t.severity_code, COUNT(t.severity_code) as nb"; $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; $sql .= " WHERE t.fk_statut <> 8"; @@ -156,7 +152,10 @@ class box_graph_ticket_by_severity extends ModeleBoxes $i++; } foreach ($listofoppcode as $rowid => $code) { - $dataseries[] = array('label' => $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $code, 'c_ticket_category', 'code', 'label', $code), 'data' => $data[$code]); + $dataseries[] = array( + 'label' => $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $code, 'c_ticket_category', 'code', 'label', $code), + 'data' => (empty($data[$code]) ? 0 : $data[$code]) + ); } } else { dol_print_error($this->db); From 27c7950417bd22e4c603c716637109c7a3ffc6b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Mar 2021 23:39:19 +0100 Subject: [PATCH 016/108] Fix migration of boxes --- htdocs/core/boxes/box_members_by_type.php | 2 +- htdocs/core/boxes/box_members_subscriptions_by_year.php | 2 +- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index cf81eaac57c..2d388feedeb 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -34,7 +34,7 @@ class box_members_by_type extends ModeleBoxes { public $boxcode = "box_members_by_type"; public $boximg = "object_user"; - public $boxlabel = "BoxMembersByType"; + public $boxlabel = "BoxTitleMembersByType"; public $depends = array("adherent"); /** diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 55a11339c0f..738793510a5 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -34,7 +34,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes { public $boxcode = "box_members_subscriptions_by_year"; public $boximg = "object_user"; - public $boxlabel = "BoxMembersSubscriptionsByYear"; + public $boxlabel = "BoxTitleMembersSubscriptionsByYear"; public $depends = array("adherent"); /** diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 2e60f214c77..cfc03e7bb5d 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -266,8 +266,8 @@ UPDATE llx_payment_salary as ps SET ps.ref = ps.rowid WHERE ps.ref IS NULL; ALTER TABLE llx_salary CHANGE paye paye smallint default 0 NOT NULL; -DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php')); -DELETE FROM llx_boxes_def WHERE file IN ('box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php'); +DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php')); +DELETE FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php'); -- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_ticket_by_severity.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_ticket_by_severity.php' AND entity = 1); -- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_ticket_last_x_days.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_ticket_last_x_days.php' AND entity = 1); From 3785346835e0961048b172760ddbc09970d914d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Mar 2021 23:57:48 +0100 Subject: [PATCH 017/108] Revert " fix:Handle constant MAIN_SHOW_SOCIETE2EXTERN in checkUserAccessToObject" --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 66496aa9089..c8c2c5cdc2b 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -709,7 +709,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand } } elseif (!in_array($feature, $nocheck)) { // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield // If external user: Check permission for external users - if ($user->socid > 0 && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) { + if ($user->socid > 0) { if (empty($dbt_keyfield)) { dol_print_error('', 'Param dbt_keyfield is required but not defined'); } From 78aec3daae452f8702bb216e5c0ac527602c3bb3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 00:00:06 +0100 Subject: [PATCH 018/108] Removed option MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES. The implmentation did not make any test on subsidiaries. It has same effect than being an internal user. --- htdocs/core/lib/security.lib.php | 2 +- htdocs/societe/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index c8c2c5cdc2b..5bcad053795 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -621,7 +621,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand } } elseif (in_array($feature, $checksoc)) { // We check feature = checksoc // If external user: Check permission for external users - if ($user->socid > 0 && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) { + if ($user->socid > 0) { if ($user->socid <> $objectid) { return false; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6f9ee362a82..e7d40037155 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -80,7 +80,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); -if ($user->socid && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) { +if ($user->socid) { $socid = $user->socid; } if (empty($socid) && $action == 'view') { From b9aacca7718a689b2770f4d88c19fd241f13084a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 00:04:43 +0100 Subject: [PATCH 019/108] Fix css --- htdocs/core/boxes/box_members_subscriptions_by_year.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 738793510a5..ef796b75044 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -122,7 +122,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $line = 0; $this->info_box_contents[$line][] = array( - 'td' => 'class="liste_titre"', + 'td' => 'class=""', 'text' => $langs->trans("Year"), ); $this->info_box_contents[$line][] = array( From 6cf970df8edb670346309e92130346317729a0e4 Mon Sep 17 00:00:00 2001 From: Chl Date: Fri, 19 Mar 2021 02:42:47 +0100 Subject: [PATCH 020/108] FIX #16143 Old PG requires "()" on DROP FUNCTION On PostgreSQL 9.6 and previous, the upgrade script fails with a syntax error if the dropped function's name is not followed by parentheses. Patch tested on 9.6 and 13.2. --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index abbeadf7166..e69cad3564c 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -579,7 +579,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); -- Removed no more used function --- VPGSQL8.2 DROP FUNCTION IF EXISTS update_modified_column_date_m CASCADE; +-- VPGSQL8.2 DROP FUNCTION IF EXISTS update_modified_column_date_m() CASCADE; insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 6,'AC_EMAIL_IN','system','reception Email',NULL, 1, 4); From 6713d9b099bcacbb98d9e08af7bd3c52e2904ad2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:05:49 +0100 Subject: [PATCH 021/108] Update fiscalyear.php $help_url = "EN:Module_Double_Entry_Accounting"; llxHeader('', $title, $help_url); --- htdocs/accountancy/admin/fiscalyear.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index ac8a8c6354d..4338d7ad803 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -91,8 +91,10 @@ $form = new Form($db); $fiscalyearstatic = new Fiscalyear($db); $title = $langs->trans('AccountingPeriods'); -$helpurl = ""; -llxHeader('', $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); $sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f"; From 19f7b10e4f41dfb8c1ba59494809f699a9fe5068 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:07:27 +0100 Subject: [PATCH 022/108] Update fiscalyear_card.php $help_url = "EN:Module_Double_Entry_Accounting"; llxHeader('', $title, $help_url); --- htdocs/accountancy/admin/fiscalyear_card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 7fdd7c19e32..410807144f5 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -149,8 +149,10 @@ if ($action == 'confirm_delete' && $confirm == "yes") { $form = new Form($db); $title = $langs->trans("Fiscalyear")." - ".$langs->trans("Card"); -$helpurl = ""; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); if ($action == 'create') { print load_fiche_titre($langs->trans("NewFiscalYear")); From a0feed25179d7f5beb3af3c974fb1f583b714ae8 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:08:55 +0100 Subject: [PATCH 023/108] Update fiscalyear_info.php $help_url = "EN:Module_Double_Entry_Accounting"; llxHeader('', $title, $help_url); --- htdocs/accountancy/admin/fiscalyear_info.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index 6fc5ac3cad8..d472350fab7 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -39,10 +39,14 @@ if (!$user->rights->accounting->fiscalyear->write) { $id = GETPOST('id', 'int'); + // View + $title = $langs->trans("Fiscalyear")." - ".$langs->trans("Info"); -$helpurl = ""; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); if ($id) { $object = new Fiscalyear($db); From d76bd583f5701f147cf0a77689fcc68078f8e31f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:13:06 +0100 Subject: [PATCH 024/108] Update agenda.php $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; llxHeader("", $title, $help_url); --- htdocs/adherents/agenda.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index edb2e9ba4dc..b123432166d 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -122,8 +122,10 @@ if ($object->id > 0) { $langs->load("companies"); $title = $langs->trans("Member")." - ".$langs->trans("Agenda"); - $helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; - llxHeader("", $title, $helpurl); + + $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + + llxHeader("", $title, $help_url); if (!empty($conf->notification->enabled)) { $langs->load("mails"); From b0f26ca2ee5bf6728493357847c98ffd0d718bb5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:14:47 +0100 Subject: [PATCH 025/108] Update document.php $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; llxHeader("", $title, $help_url); --- htdocs/adherents/document.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 349cf5e7b75..61e486ddf1c 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -89,8 +89,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("Member")." - ".$langs->trans("Documents"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); if ($id > 0) { $result = $membert->fetch($object->typeid); From e5eddff0a5bec929a6e9bbf9d128950a6159c869 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 19 Mar 2021 08:15:14 +0000 Subject: [PATCH 026/108] Fixing style errors. --- htdocs/adherents/agenda.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index b123432166d..3f7114380f3 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -122,9 +122,9 @@ if ($object->id > 0) { $langs->load("companies"); $title = $langs->trans("Member")." - ".$langs->trans("Agenda"); - + $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; - + llxHeader("", $title, $help_url); if (!empty($conf->notification->enabled)) { From 7183bfeb940878e64eafc4e8262c40f1de4db134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Mar 2021 09:15:35 +0100 Subject: [PATCH 027/108] fix new boxes add --- htdocs/core/boxes/box_members_last_modified.php | 6 +++--- htdocs/core/boxes/box_members_last_subscriptions.php | 6 +++--- htdocs/core/modules/modAdherent.class.php | 8 ++++---- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 5 +++++ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 9ec1bf70558..1315ac9895b 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/boxes/box_last_modified_members.php + * \file htdocs/core/boxes/box_members_last_modified.php * \ingroup adherent * \brief Module to show box of members */ @@ -30,9 +30,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** * Class to manage the box to show last modofied members */ -class box_last_modified_members extends ModeleBoxes +class box_members_last_modified extends ModeleBoxes { - public $boxcode = "box_last_modified_members"; + public $boxcode = "box_members_last_modified"; public $boximg = "object_user"; public $boxlabel = "BoxLastModifiedMembers"; public $depends = array("adherent"); diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 0b2cb02d920..6da20bf28d0 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/boxes/box_last_members_subscriptions.php + * \file htdocs/core/boxes/box_members_last_subscriptions.php * \ingroup adherent * \brief Module to show box of members */ @@ -30,9 +30,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** * Class to manage the box to show last modofied members */ -class box_last_members_subscriptions extends ModeleBoxes +class box_members_last_subscriptions extends ModeleBoxes { - public $boxcode = "box_last_members_subscriptions"; + public $boxcode = "box_members_last_subscriptions"; public $boximg = "object_user"; public $boxlabel = "BoxLastMembersSubscriptions"; public $depends = array("adherent"); diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 74c67d217d6..57ec76e319d 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -194,10 +194,10 @@ class modAdherent extends DolibarrModules $this->boxes = array( 0 => array('file'=>'box_members.php', 'enabledbydefaulton'=>'Home'), 2 => array('file'=>'box_birthdays_members.php', 'enabledbydefaulton'=>'Home'), - 3 => array('file'=>'box_members_last_modified', 'enabledbydefaulton'=>'membersindex'), - 4 => array('file'=>'box_members_last_subscriptions', 'enabledbydefaulton'=>'membersindex'), - 5 => array('file'=>'box_members_subscriptions_by_year', 'enabledbydefaulton'=>'membersindex'), - 6 => array('file'=>'box_members_by_type', 'enabledbydefaulton'=>'membersindex'), + 3 => array('file'=>'box_members_last_modified.php', 'enabledbydefaulton'=>'membersindex'), + 4 => array('file'=>'box_members_last_subscriptions.php', 'enabledbydefaulton'=>'membersindex'), + 5 => array('file'=>'box_members_subscriptions_by_year.php', 'enabledbydefaulton'=>'membersindex'), + 6 => array('file'=>'box_members_by_type.php', 'enabledbydefaulton'=>'membersindex'), ); // Permissions diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 2e60f214c77..0f1706f011e 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -77,6 +77,11 @@ ALTER TABLE llx_facture MODIFY COLUMN date_valid DATETIME NULL DEFAULT NULL; -- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_dolibarr_state_board.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_dolibarr_state_board.php' AND entity = 1); +-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_members_last_modified.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_members_last_modified.php' AND entity = 1); +-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_members_last_subscriptions.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_members_last_subscriptions.php' AND entity = 1); +-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_members_subscriptions_by_year.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_members_subscriptions_by_year.php' AND entity = 1); +-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_members_by_type.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_members_by_type.php' AND entity = 1); + ALTER TABLE llx_website ADD COLUMN lastaccess datetime NULL; ALTER TABLE llx_website ADD COLUMN pageviews_month BIGINT UNSIGNED DEFAULT 0; From b17c5b50cdad1e86aca818f0a53bd024315304c0 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:15:48 +0100 Subject: [PATCH 028/108] Update note.php $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; llxHeader("", $title, $help_url); --- htdocs/adherents/note.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 437a8c0c577..26fec04a5e6 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -57,9 +57,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, /* * View */ + $title = $langs->trans("Member")." - ".$langs->trans("Note"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); $form = new Form($db); From 668deefc9e8e47b7c9546a3135fb2dee5a4497d0 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 19 Mar 2021 08:16:44 +0000 Subject: [PATCH 029/108] Fixing style errors. --- htdocs/adherents/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 61e486ddf1c..88e31ebffb6 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -91,7 +91,7 @@ $form = new Form($db); $title = $langs->trans("Member")." - ".$langs->trans("Documents"); $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; - + llxHeader("", $title, $help_url); if ($id > 0) { From c0a420bcb7ed021bc1ce72d22b39875b9be51642 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:17:24 +0100 Subject: [PATCH 030/108] Update subscription.php $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; llxHeader("", $title, $help_url); --- htdocs/adherents/subscription.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 79f1a4da036..5862b807671 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -428,8 +428,10 @@ $form = new Form($db); $now = dol_now(); $title = $langs->trans("Member")." - ".$langs->trans("Subscriptions"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); $param = ''; From 74de2722365869ab52bcaa239bb56ff55f2721ea Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:19:28 +0100 Subject: [PATCH 031/108] Update type_translation.php $help_url = ''; .... $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; llxHeader('', $title, $help_url); --- htdocs/adherents/type_translation.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 0ce4b2314b4..a99f1f990ad 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -142,13 +142,16 @@ $result = $object->fetch($id); */ $title = $langs->trans('MemberTypeCard'); -$helpurl = ''; + +$help_url = ''; + $shortlabel = dol_trunc($object->label, 16); $title = $langs->trans('MemberType')." ".$shortlabel." - ".$langs->trans('Translation'); -$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; -llxHeader('', $title, $helpurl); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url); $form = new Form($db); $formadmin = new FormAdmin($db); From 01e4f4bff5d6824f8a652bc0514d1a5ee224853f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:20:43 +0100 Subject: [PATCH 032/108] Update document.php $help_url = ''; llxHeader('', $title, $help_url); --- htdocs/asset/document.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index e5db1465fb6..ce8adad8e34 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -82,8 +82,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; */ $title = $langs->trans('Assets')." - ".$langs->trans('Documents'); -$helpurl = ''; -llxHeader('', $title, $helpurl); + +$help_url = ''; + +llxHeader('', $title, $help_url); $form = new Form($db); From 8c59ad974b0df27deb9beefe0b5bfc83f25f638d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:22:58 +0100 Subject: [PATCH 033/108] Update info.php $help_url = ""; llxHeader('', $title, $help_url); --- htdocs/asset/info.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index f6d34454ad4..7a8f4c20ce2 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -57,8 +57,10 @@ $object->fetch($id); $form = new Form($db); $title = $langs->trans('Asset')." - ".$langs->trans('Info'); -$helpurl = ""; -llxHeader('', $title, $helpurl); + +$help_url = ""; + +llxHeader('', $title, $help_url); $object->info($id); From 21963dbc656a06edcbe2b8373dfadd6b1750606a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:23:57 +0100 Subject: [PATCH 034/108] Update type.php $help_url = ''; llxHeader('', $langs->trans("AssetsTypeSetup"), $help_url); --- htdocs/asset/type.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 9d7e848b6d3..6103b963e21 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -196,8 +196,9 @@ if ($action == 'confirm_delete' && $user->rights->asset->write) { $form = new Form($db); -$helpurl = ''; -llxHeader('', $langs->trans("AssetsTypeSetup"), $helpurl); +$help_url = ''; + +llxHeader('', $langs->trans("AssetsTypeSetup"), $help_url); // List of asset type From 31e018636d22d22e1e449e41298f4a8ea4e325b7 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:25:47 +0100 Subject: [PATCH 035/108] Update card.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $help_url = 'EN:Module_Categories|FR:Module_Catégories|DE:Modul_Kategorien'; llxHeader("", $langs->trans("Categories"), $help_url); --- htdocs/categories/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 9f275033b01..734f2e89506 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -208,8 +208,9 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr $form = new Form($db); $formother = new FormOther($db); -$helpurl = 'EN:Module_Categories|FR:Module_Catégories'; -llxHeader("", $langs->trans("Categories"), $helpurl); +$help_url = 'EN:Module_Categories|FR:Module_Catégories|DE:Modul_Kategorien'; + +llxHeader("", $langs->trans("Categories"), $help_url); if ($user->rights->categorie->creer) { // Create or add From 953b09adf68a1c9bebd6095595e2c53cfa80dcc6 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:27:29 +0100 Subject: [PATCH 036/108] Update viewcat.php $helpurl -> $help_url --- htdocs/categories/viewcat.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index dedb368202d..817c750a571 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -207,8 +207,10 @@ $formother = new FormOther($db); $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); -$helpurl = ''; -llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss); + +$help_url = ''; + +llxHeader("", $langs->trans("Categories"), $help_url, '', 0, 0, $arrayofjs, $arrayofcss); $title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; From e5f8ca77a9b80d5a59bf950e5a65dd00428e7285 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:30:28 +0100 Subject: [PATCH 037/108] Update card.php $help_url = "EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses"; llxHeader("", $title, $help_url); --- htdocs/compta/bank/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index ccc834835a4..bf74035d553 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -305,8 +305,10 @@ if (!empty($conf->accounting->enabled)) { $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; $title = $langs->trans("FinancialAccount")." - ".$langs->trans("Card"); -$helpurl = "EN:Module_Banks_and_Cash"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses"; + +llxHeader("", $title, $help_url); // Creation From 6e6609d8766d6b739c55be7ce7957917253a4c3d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:33:10 +0100 Subject: [PATCH 038/108] Update document.php $help_url = "EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses"; llxHeader("", $title, $help_url); --- htdocs/compta/bank/document.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 35102281ae9..6f0ffed4153 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -92,8 +92,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; */ $title = $langs->trans("FinancialAccount").' - '.$langs->trans("Documents"); -$helpurl = ""; -llxHeader('', $title, $helpurl); + +$help_url = "EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses"; + +llxHeader("", $title, $help_url); $form = new Form($db); From b5905bb03253e62b0b49a862c4777df9c7d7d75b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Mar 2021 09:34:40 +0100 Subject: [PATCH 039/108] FIX php 8 warning --- htdocs/product/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index bd38e41f4dd..92f302fc177 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -59,6 +59,7 @@ $toselect = GETPOST('toselect', 'array'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_ref = GETPOST("search_ref", 'alpha'); +$search_ref_supplier = GETPOST("search_ref_supplier", 'alpha'); $search_barcode = GETPOST("search_barcode", 'alpha'); $search_label = GETPOST("search_label", 'alpha'); $search_type = GETPOST("search_type", 'int'); @@ -299,6 +300,7 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $sall = ""; $search_ref = ""; + $search_ref_supplier = ""; $search_label = ""; $search_barcode = ""; $searchCategoryProductOperator = 0; @@ -567,6 +569,7 @@ if ($resql) { } } + $paramsCat = ''; foreach ($searchCategoryProductList as $searchCategoryProduct) { $paramsCat .= "&search_category_product_list[]=".urlencode($searchCategoryProduct); } From b4e929e57f676cf6f064020bb45943d8baf9486c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:36:49 +0100 Subject: [PATCH 040/108] Update card.php $helpurl -> $help_url --- htdocs/compta/facture/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index cd1905f528f..925885e4e7a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2815,9 +2815,10 @@ if (!empty($conf->projet->enabled)) { $now = dol_now(); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Card'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; -llxHeader('', $title, $helpurl); +$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $help_url); // Mode creation From 46c23807e9970b2998d38fe52df2c8bc0c8eabc1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:38:33 +0100 Subject: [PATCH 041/108] Update document.php $helpurl -> $help_url --- htdocs/compta/facture/document.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 4c0544e3810..f4937679504 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -91,8 +91,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; */ $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; -llxHeader('', $title, $helpurl); + +$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $help_url); $form = new Form($db); From 91ed200a1f878ea8a6330ed203024e82e464e2c2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:51:27 +0100 Subject: [PATCH 042/108] Update llx_20_c_departements.sql --- .../mysql/data/llx_20_c_departements.sql | 102 +++++++++--------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index acd9f0532b5..d85a0b0b52e 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -36,6 +36,57 @@ insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 0, '0', '0',0,'-','-'); +-- Algeria Provinces (id country=13) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL01', '', 0, '', 'Wilaya d''Adrar', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL02', '', 0, '', 'Wilaya de Chlef', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL03', '', 0, '', 'Wilaya de Laghouat', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL04', '', 0, '', 'Wilaya d''Oum El Bouaghi', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL05', '', 0, '', 'Wilaya de Batna', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL06', '', 0, '', 'Wilaya de Béjaïa', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL07', '', 0, '', 'Wilaya de Biskra', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL08', '', 0, '', 'Wilaya de Béchar', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL09', '', 0, '', 'Wilaya de Blida', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL10', '', 0, '', 'Wilaya de Bouira', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL11', '', 0, '', 'Wilaya de Tamanrasset', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL12', '', 0, '', 'Wilaya de Tébessa', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL13', '', 0, '', 'Wilaya de Tlemcen', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL14', '', 0, '', 'Wilaya de Tiaret', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL15', '', 0, '', 'Wilaya de Tizi Ouzou', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL16', '', 0, '', 'Wilaya d''Alger', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL17', '', 0, '', 'Wilaya de Djelfa', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL18', '', 0, '', 'Wilaya de Jijel', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL19', '', 0, '', 'Wilaya de Sétif ', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL20', '', 0, '', 'Wilaya de Saïda', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL21', '', 0, '', 'Wilaya de Skikda', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL22', '', 0, '', 'Wilaya de Sidi Bel Abbès', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL23', '', 0, '', 'Wilaya d''Annaba', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL24', '', 0, '', 'Wilaya de Guelma', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL25', '', 0, '', 'Wilaya de Constantine', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL26', '', 0, '', 'Wilaya de Médéa', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL27', '', 0, '', 'Wilaya de Mostaganem', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL28', '', 0, '', 'Wilaya de M''Sila', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL29', '', 0, '', 'Wilaya de Mascara', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL30', '', 0, '', 'Wilaya d''Ouargla', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL31', '', 0, '', 'Wilaya d''Oran', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL32', '', 0, '', 'Wilaya d''El Bayadh', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL33', '', 0, '', 'Wilaya d''Illizi', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL34', '', 0, '', 'Wilaya de Bordj Bou Arreridj', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL35', '', 0, '', 'Wilaya de Boumerdès', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL36', '', 0, '', 'Wilaya d''El Tarf', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL37', '', 0, '', 'Wilaya de Tindouf', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL38', '', 0, '', 'Wilaya de Tissemsilt', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL39', '', 0, '', 'Wilaya d''El Oued', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL40', '', 0, '', 'Wilaya de Khenchela', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL41', '', 0, '', 'Wilaya de Souk Ahras', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL42', '', 0, '', 'Wilaya de Tipaza', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL43', '', 0, '', 'Wilaya de Mila', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL44', '', 0, '', 'Wilaya d''Aïn Defla', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL45', '', 0, '', 'Wilaya de Naâma', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL46', '', 0, '', 'Wilaya d''Aïn Témouchent', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL47', '', 0, '', 'Wilaya de Ghardaia', 1); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL48', '', 0, '', 'Wilaya de Relizane', 1); + + -- Andorra Parròquies (id country=34) INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-002', 'AD100', NULL, NULL, 'Canillo'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-003', 'AD200', NULL, NULL, 'Encamp'); @@ -46,7 +97,7 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-008', 'AD700', NULL, NULL, 'Escaldes-Engordany'); --- Austria States (Bundesländer) (id country=41) +-- Austria States / Österreich Bundesländer (id country=41) INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'B','BURGENLAND','Burgenland',1); INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'K','KAERNTEN','Kärnten',1); INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'N','NIEDEROESTERREICH','Niederösterreich',1); @@ -288,55 +339,6 @@ insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VI',320,NULL,NULL,NULL,'VICENZA'); insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VT',307,NULL,NULL,NULL,'VITERBO'); --- Provinces Algeria (id country=13) -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL01', 1301, '', 0, '', 'Wilaya d''Adrar', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL02', 1301, '', 0, '', 'Wilaya de Chlef', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL03', 1301, '', 0, '', 'Wilaya de Laghouat', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL04', 1301, '', 0, '', 'Wilaya d''Oum El Bouaghi', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL05', 1301, '', 0, '', 'Wilaya de Batna', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL06', 1301, '', 0, '', 'Wilaya de Béjaïa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL07', 1301, '', 0, '', 'Wilaya de Biskra', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL08', 1301, '', 0, '', 'Wilaya de Béchar', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL09', 1301, '', 0, '', 'Wilaya de Blida', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL10', 1301, '', 0, '', 'Wilaya de Bouira', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL11', 1301, '', 0, '', 'Wilaya de Tamanrasset', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL12', 1301, '', 0, '', 'Wilaya de Tébessa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL13', 1301, '', 0, '', 'Wilaya de Tlemcen', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL14', 1301, '', 0, '', 'Wilaya de Tiaret', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL15', 1301, '', 0, '', 'Wilaya de Tizi Ouzou', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL16', 1301, '', 0, '', 'Wilaya d''Alger', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL17', 1301, '', 0, '', 'Wilaya de Djelfa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL18', 1301, '', 0, '', 'Wilaya de Jijel', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL19', 1301, '', 0, '', 'Wilaya de Sétif ', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL20', 1301, '', 0, '', 'Wilaya de Saïda', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL21', 1301, '', 0, '', 'Wilaya de Skikda', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL22', 1301, '', 0, '', 'Wilaya de Sidi Bel Abbès', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL23', 1301, '', 0, '', 'Wilaya d''Annaba', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL24', 1301, '', 0, '', 'Wilaya de Guelma', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL25', 1301, '', 0, '', 'Wilaya de Constantine', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL26', 1301, '', 0, '', 'Wilaya de Médéa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL27', 1301, '', 0, '', 'Wilaya de Mostaganem', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL28', 1301, '', 0, '', 'Wilaya de M''Sila', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL29', 1301, '', 0, '', 'Wilaya de Mascara', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL30', 1301, '', 0, '', 'Wilaya d''Ouargla', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL31', 1301, '', 0, '', 'Wilaya d''Oran', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL32', 1301, '', 0, '', 'Wilaya d''El Bayadh', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL33', 1301, '', 0, '', 'Wilaya d''Illizi', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL34', 1301, '', 0, '', 'Wilaya de Bordj Bou Arreridj', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL35', 1301, '', 0, '', 'Wilaya de Boumerdès', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL36', 1301, '', 0, '', 'Wilaya d''El Tarf', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL37', 1301, '', 0, '', 'Wilaya de Tindouf', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL38', 1301, '', 0, '', 'Wilaya de Tissemsilt', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL39', 1301, '', 0, '', 'Wilaya d''El Oued', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL40', 1301, '', 0, '', 'Wilaya de Khenchela', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL41', 1301, '', 0, '', 'Wilaya de Souk Ahras', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL42', 1301, '', 0, '', 'Wilaya de Tipaza', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL43', 1301, '', 0, '', 'Wilaya de Mila', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL44', 1301, '', 0, '', 'Wilaya d''Aïn Defla', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL45', 1301, '', 0, '', 'Wilaya de Naâma', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL46', 1301, '', 0, '', 'Wilaya d''Aïn Témouchent', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL47', 1301, '', 0, '', 'Wilaya de Ghardaia', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('AL48', 1301, '', 0, '', 'Wilaya de Relizane', 1); -- Provinces Maroc - Moroco (id country=12) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA', 1209, '', 0, '', 'Province de Benslimane', 1); From d8528161016e6df5d88ade1031bf61cb09ae0865 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 18 Mar 2021 11:07:48 +0100 Subject: [PATCH 043/108] FIX: fix checkbox displayed according to module project setup parameters --- htdocs/projet/card.php | 231 ++++++++++++++++--------------- htdocs/projet/contact.php | 198 +++++++++++++------------- htdocs/projet/element.php | 51 +++---- htdocs/projet/tasks.php | 51 +++---- htdocs/projet/tasks/comment.php | 51 +++---- htdocs/projet/tasks/contact.php | 51 +++---- htdocs/projet/tasks/document.php | 51 +++---- htdocs/projet/tasks/note.php | 51 +++---- htdocs/projet/tasks/task.php | 51 +++---- htdocs/projet/tasks/time.php | 51 +++---- 10 files changed, 436 insertions(+), 401 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index db710e2715d..9adfd8130c6 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -550,50 +550,53 @@ if ($action == 'create' && $user->rights->projet->creer) print ''.$langs->trans("Label").''; // Usage (opp, task, bill time, ...) - print ''; - print $langs->trans("Usage"); - print ''; - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print ' '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print ''; - print '
'; + print ''; + print $langs->trans("Usage"); + print ''; + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print ' '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print ' '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print ' '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + /* + print ' '; + $htmltext = $langs->trans("OrganizeEvent"); + print $form->textwithpicto($langs->trans("OrganizeEvent"), $htmltext);*/ + print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print ' '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print ' '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - /* - print ' '; - $htmltext = $langs->trans("OrganizeEvent"); - print $form->textwithpicto($langs->trans("OrganizeEvent"), $htmltext);*/ - print ''; - print ''; // Thirdparty if ($conf->societe->enabled) @@ -841,17 +844,19 @@ elseif ($object->id > 0) print ''; // Usage - print ''; - print $langs->trans("Usage"); - print ''; - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print ''; - print '
'; + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Thirdparty if ($conf->societe->enabled) @@ -923,18 +929,18 @@ elseif ($object->id > 0) print ''; print ''; - // Opportunity probability - print ''.$langs->trans("OpportunityProbability").''; - print ' %'; - print ''; - print ''; - print ''; + // Opportunity probability + print ''.$langs->trans("OpportunityProbability").''; + print ' %'; + print ''; + print ''; + print ''; - // Opportunity amount - print ''.$langs->trans("OpportunityAmount").''; - print ''; - print ''; - } + // Opportunity amount + print ''.$langs->trans("OpportunityAmount").''; + print ''; + print ''; + } // Date start print ''.$langs->trans("DateStart").''; @@ -1022,32 +1028,35 @@ elseif ($object->id > 0) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print ''; - // Opportunity Weighted Amount - print ''; + // Opportunity Weighted Amount + print ''; } // Date start - end diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 93ced9392c4..2faa9868e07 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -63,11 +63,11 @@ if ($action == 'addcontact' && $user->rights->projet->creer) $result = 0; $result = $object->fetch($id); - if ($result > 0 && $id > 0) - { - $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); - $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); - } + if ($result > 0 && $id > 0) + { + $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + } if ($result >= 0) { @@ -93,7 +93,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) { if ($object->fetch($id)) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } else { @@ -153,100 +153,102 @@ if ($id > 0 || !empty($ref)) dol_fiche_head($head, 'contact', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); - // Project card + // Project card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = '
'; - // Title - $morehtmlref .= $object->title; - // Thirdparty - if ($object->thirdparty->id > 0) - { - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); - } - $morehtmlref .= '
'; + $morehtmlref = '
'; + // Title + $morehtmlref .= $object->title; + // Thirdparty + if ($object->thirdparty->id > 0) + { + $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + } + $morehtmlref .= '
'; - // Define a complementary filter for search of next/prev ref. - if (!$user->rights->projet->all->lire) - { - $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = " rowid in (".(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")"; - } + // Define a complementary filter for search of next/prev ref. + if (!$user->rights->projet->all->lire) + { + $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); + $object->next_prev_filter = " rowid in (".(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")"; + } - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
'; - print '
'; - print '
'; + print '
'; + print '
'; + print '
'; - print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; @@ -1071,16 +1080,16 @@ elseif ($object->id > 0) // Opportunity Amount print '
'.$langs->trans("OpportunityAmount").''; /*if ($object->opp_status) - { - print price($obj->opp_amount, 1, $langs, 1, 0, -1, $conf->currency); - }*/ + { + print price($obj->opp_amount, 1, $langs, 1, 0, -1, $conf->currency); + }*/ if (strcmp($object->opp_amount, '')) print price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency); print '
'.$langs->trans('OpportunityWeightedAmount').''; - if (strcmp($object->opp_amount, '') && strcmp($object->opp_percent, '')) print price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency); - print '
'.$langs->trans('OpportunityWeightedAmount').''; + if (strcmp($object->opp_amount, '') && strcmp($object->opp_percent, '')) print price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency); + print '
'; - - // Usage - print ''; - print ''; + print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) - { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print '
'; + // Usage + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) + { + print ''; + print ''; + } // Visibility print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $object->opp_status) - { - // Opportunity status - print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $object->opp_status) + { + // Opportunity status + print ''; - // Opportunity percent - print ''; + // Opportunity percent + print ''; - // Opportunity Amount - print ''; - } + // Opportunity Amount + print ''; + } - // Date start - end - print ''; + print ''; - // Budget + // Budget print ''; @@ -257,36 +259,36 @@ if ($id > 0 || !empty($ref)) print "
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; if ($object->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print '
'.$langs->trans("OpportunityStatus").''; - $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); - if ($code) print $langs->trans("OppStatus".$code); - print '
'.$langs->trans("OpportunityStatus").''; + $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); + if ($code) print $langs->trans("OppStatus".$code); + print '
'.$langs->trans("OpportunityProbability").''; - if (strcmp($object->opp_percent, '')) print price($object->opp_percent, '', $langs, 1, 0).' %'; - print '
'.$langs->trans("OpportunityProbability").''; + if (strcmp($object->opp_percent, '')) print price($object->opp_percent, '', $langs, 1, 0).' %'; + print '
'.$langs->trans("OpportunityAmount").''; - if (strcmp($object->opp_amount, '')) print price($object->opp_amount, '', $langs, 0, 0, 0, $conf->currency); - print '
'.$langs->trans("OpportunityAmount").''; + if (strcmp($object->opp_amount, '')) print price($object->opp_amount, '', $langs, 0, 0, 0, $conf->currency); + print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Date start - end + print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); print ' - '; print ($end ? $end : '?'); if ($object->hasDelay()) print img_warning("Late"); - print '
'.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) print price($object->budget_amount, '', $langs, 0, 0, 0, $conf->currency); print '
"; - print ''; - print '
'; - print '
'; - print '
'; + print '
'; + print '
'; + print '
'; + print '
'; - print ''; + print '
'; - // Description - print ''; + // Description + print ''; - // Categories - if ($conf->categorie->enabled) { - print '"; - } + // Categories + if ($conf->categorie->enabled) { + print '"; + } - print '
'.$langs->trans("Description").''; - print nl2br($object->description); - print '
'.$langs->trans("Description").''; + print nl2br($object->description); + print '
'.$langs->trans("Categories").''; - print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); - print "
'.$langs->trans("Categories").''; + print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); + print "
'; + print ''; - print '
'; - print '
'; - print '
'; + print ''; + print ''; + print ''; - print '
'; + print '
'; - dol_fiche_end(); + dol_fiche_end(); - print '
'; + print '
'; // Contacts lines (modules that overwrite templates must declare this into descriptor) $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl')); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 3d6f954f439..abee780cb41 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -163,32 +163,35 @@ print '
'; print ''; // Usage -print ''; -print ''; + print ''; } -if (empty($conf->global->PROJECT_HIDE_TASKS)) -{ - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; -} -if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) -{ - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; -} -print ''; // Visibility print '
'; -print $langs->trans("Usage"); -print ''; -if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) +if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index ebc6a7dc556..3f4b1e9a429 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -409,32 +409,35 @@ if ($id > 0 || !empty($ref)) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 82b4d8fdc10..0141b85a8cd 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -151,32 +151,35 @@ if ($id > 0 || !empty($ref)) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 415859127db..5c9df2ea2ef 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -223,32 +223,35 @@ if ($id > 0 || !empty($ref)) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index bd4335f747f..a8f0c2c9d57 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -167,32 +167,35 @@ if ($object->id > 0) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 4967257570e..77ee70a6829 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -146,32 +146,35 @@ if ($object->id > 0) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print ''; } diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 26d1578b24c..2b832b3b467 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -548,9 +548,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } }*/ if ($permissiontoadd) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index a72dde04fb1..d4373812f61 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1821,12 +1821,12 @@ if ($action == 'create' || $action == 'adduserldap') { // Enable user if ($user->id <> $id && $candisableuser && $object->statut == 0 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; + print ''; } // Disable user if ($user->id <> $id && $candisableuser && $object->statut == 1 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; + print ''; } else { if ($user->id == $id) { print ''; @@ -1836,7 +1836,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ($user->id <> $id && $candisableuser && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { if ($user->admin || !$object->admin) { // If user edited is admin, delete is possible on for an admin - print ''; + print ''; } else { print ''; } diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index e63c3cb8fef..957173335c0 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -332,17 +332,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($object->status == 1) { - print ''."\n"; + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } } */ if ($user->rights->website->delete) { - print ''."\n"; + print ''."\n"; } } print ''."\n"; diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index c15053bad5e..61686423d4c 100755 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -469,16 +469,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php index 455efc95cc9..f57f8873aba 100644 --- a/htdocs/zapier/hook_card.php +++ b/htdocs/zapier/hook_card.php @@ -351,11 +351,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($object->status == 1) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } */ From 14611f3f7aa2be01b77c84aa46e9cbc6d02ff7dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 12:49:28 +0100 Subject: [PATCH 054/108] More complete protection for doprev donext, dvprev, dvnext action. --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 108a25e1877..019e30dca25 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -436,6 +436,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl 'activate', 'add', 'addtimespent', 'update', 'install', 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_reject_check', 'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'disable', + 'doprev', 'donext', 'dvprev', 'dvnext', 'enable' ); $sensitiveget = false; From 5a4ffc18b9e4616bea8176aa216ea07a232f85b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 13:02:55 +0100 Subject: [PATCH 055/108] FIx #yogosha5667 --- htdocs/adherents/cartes/carte.php | 3 +++ htdocs/adherents/list.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 9d403d88320..be9c654941a 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -50,6 +50,9 @@ $extrafields = new ExtraFields($db); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +// Security check +$result = restrictedArea($user, 'adherent'); + /* * Actions diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index c37e9e325cf..cebd634fa56 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -41,9 +41,6 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search -// Security check -$result = restrictedArea($user, 'adherent'); - $search = GETPOST("search", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha'); @@ -162,6 +159,9 @@ $arrayfields = array( // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; +// Security check +$result = restrictedArea($user, 'adherent'); + /* * Actions From aef2f1713e7e96a2066ff4ab3519b24a06153af9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 13:25:58 +0100 Subject: [PATCH 056/108] FIX #yogosha5673 --- htdocs/admin/mails_senderprofile_list.php | 32 ++++++++++--------- htdocs/admin/mails_ticket.php | 8 ++--- .../core/class/emailsenderprofile.class.php | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 9f766d76266..a24033637d1 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -76,14 +76,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -$socid = 0; -if ($user->socid > 0) { // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'mymodule', $id, ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -133,6 +125,19 @@ if ($id > 0) { $object->fetch($id); } +// Security check +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +// A non admin user can see profiles but limited to its own user +if (!$user->admin) { + if ($object->private != $user->id) { + accessforbidden(); + } +} + /* * Actions @@ -261,6 +266,10 @@ foreach ($search as $key => $val) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +// If non admin, restrict list to itself +if (empty($user->admin)) { + $sql .= " AND private = ".((int) $user->id); +} //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -315,13 +324,6 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit $num = $db->num_rows($resql); } -// Direct jump if only one record found -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".DOL_URL_ROOT.'/monmodule/emailsenderprofile_card.php?id='.$id); - exit; -} // Output page // -------------------------------------------------------------------- diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 1d3faf71f1b..14960db11d7 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -32,10 +32,6 @@ $langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'err $action = GETPOST('action', 'aZ09'); -if (!$user->admin) { - accessforbidden(); -} - $usersignature = $user->signature; // For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html. if ($action == 'test' || $action == 'send') { @@ -53,6 +49,10 @@ $substitutionarrayfortest = array( ); complete_substitutions_array($substitutionarrayfortest, $langs); +// Security check +if (!$user->admin) { + accessforbidden(); +} /* diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index d4b9f0bd93e..7b9ee37225e 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -54,7 +54,7 @@ class EmailSenderProfile extends CommonObject /** * @var string String with name of icon for emailsenderprofile */ - public $picto = 'emailsenderprofile@monmodule'; + public $picto = 'emailsenderprofile'; const STATUS_DISABLED = 0; From ff7f1feaae6c808283d938f9363df9dbad177011 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 13:28:04 +0100 Subject: [PATCH 057/108] Fix test on perm --- htdocs/admin/mails_senderprofile_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index a24033637d1..4eeeb21c8ae 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -133,7 +133,7 @@ if ($user->socid > 0) { // Protection if external user } // A non admin user can see profiles but limited to its own user if (!$user->admin) { - if ($object->private != $user->id) { + if ($object->id > 0 && $object->private != $user->id) { accessforbidden(); } } From 8462c4d3d349fc7d22fabf58b3dbce64ccd0855e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 13:37:43 +0100 Subject: [PATCH 058/108] Clean menu --- htdocs/admin/mails_senderprofile_list.php | 15 --------------- htdocs/core/lib/admin.lib.php | 3 ++- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 4eeeb21c8ae..8f781318995 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -328,21 +328,6 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit // Output page // -------------------------------------------------------------------- -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 759b97aaedb..6715ded36fa 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1886,7 +1886,8 @@ function email_admin_prepare_head() } } - if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) { + // admin and non admin can view this menu entry, but it is not shown yet when we on user menu "Email templates" + if (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates') { $head[$h][0] = DOL_URL_ROOT."/admin/mails_senderprofile_list.php"; $head[$h][1] = $langs->trans("EmailSenderProfiles"); $head[$h][2] = 'senderprofiles'; From ae7261c0a7b8f53f53e5e5294e27152b1a5cba0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 14:12:08 +0100 Subject: [PATCH 059/108] FIX #yogosha5677 --- htdocs/compta/accounting-files.php | 56 +++++++++++++++++------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 596abdf0e97..fed0e025f4c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -34,6 +34,7 @@ if ((array_key_exists('action', $_GET) && $_GET['action'] == 'dl') || (array_key require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; @@ -56,13 +57,12 @@ $date_start = GETPOST('date_start', 'alpha'); $date_startDay = GETPOST('date_startday', 'int'); $date_startMonth = GETPOST('date_startmonth', 'int'); $date_startYear = GETPOST('date_startyear', 'int'); -$date_start = ($date_startDay) ?dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear) : strtotime($date_start); +$date_start = ($date_startDay ? dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear, 'tzuserrel') : dol_stringtotime($date_start)); $date_stop = GETPOST('date_stop', 'alpha'); $date_stopDay = GETPOST('date_stopday', 'int'); $date_stopMonth = GETPOST('date_stopmonth', 'int'); $date_stopYear = GETPOST('date_stopyear', 'int'); -//FIXME doldate -$date_stop = ($date_stopDay) ?dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear) : strtotime($date_stop); +$date_stop = ($date_stopDay ? dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear, 'tzuserrel') : dol_stringtotime($date_stop)); $action = GETPOST('action', 'aZ09'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context @@ -126,6 +126,17 @@ if (empty($entity)) { $error = 0; +$listofchoices = array( + 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled), 'perms' => !empty($user->rights->facture->lire)), + 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->facture->lire)), + 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)), + 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)), + 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled), 'perms' => !empty($user->rights->tax->charges->lire)), + 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled), 'perms' => !empty($user->rights->salaries->read)), + 'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled), 'perms' => !empty($user->rights->banque->lire)), + 'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled), 'perms' => !empty($user->rights->loan->read)), +); + /* @@ -155,7 +166,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $wheretail = " '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'"; // Customer invoices - if (GETPOST('selectinvoices')) { + if (GETPOST('selectinvoices') && !empty($listofchoices['selectinvoices']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -166,7 +177,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".Facture::STATUS_DRAFT; } // Vendor invoices - if (GETPOST('selectsupplierinvoices')) { + if (GETPOST('selectsupplierinvoices') && !empty($listofchoices['selectsupplierinvoices']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -177,7 +188,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT; } // Expense reports - if (GETPOST('selectexpensereports')) { + if (GETPOST('selectexpensereports') && !empty($listofchoices['selectexpensereports']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -188,7 +199,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".ExpenseReport::STATUS_DRAFT; } // Donations - if (GETPOST('selectdonations')) { + if (GETPOST('selectdonations') && !empty($listofchoices['selectdonations']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -199,7 +210,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".Don::STATUS_DRAFT; } // Payments of salaries - if (GETPOST('selectpaymentsofsalaries')) { + if (GETPOST('selectpaymentsofsalaries') && !empty($listofchoices['selectpaymentsofsalaries']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -210,7 +221,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { //$sql.=" AND fk_statut <> ".PaymentSalary::STATUS_DRAFT; } // Social contributions - if (GETPOST('selectsocialcontributions')) { + if (GETPOST('selectsocialcontributions') && !empty($listofchoices['selectsocialcontributions']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -221,7 +232,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; } // Various payments - if (GETPOST('selectvariouspayment')) { + if (GETPOST('selectvariouspayment') && !empty($listofchoices['selectvariouspayment']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -231,7 +242,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; } // Loan payments - if (GETPOST('selectloanspayment')) { + if (GETPOST('selectloanspayment') && !empty($listofchoices['selectloanspayment']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -539,8 +550,11 @@ print ''; print ''.$langs->trans("ExportAccountingSourceDocHelp", $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Journals")).'
'; print '
'; -print $langs->trans("ReportPeriod").': '.$form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0); -print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n"; +print $langs->trans("ReportPeriod").': '; +print $form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0, '', '', '', '', 1, '', '', 'tzuserrel'); +print ' - '; +print $form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0, '', '', '', '', 1, '', '', 'tzuserrel'); +print "\n"; // Export is for current company only if (!empty($conf->multicompany->enabled) && is_object($mc)) { @@ -558,22 +572,16 @@ if (!empty($conf->multicompany->enabled) && is_object($mc)) { print '
'; -$listofchoices = array( - 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled)), - 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled)), - 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled)), - 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled)), - 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled)), - 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled)), - 'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled)), - 'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled)), -); foreach ($listofchoices as $choice => $val) { if (empty($val['enabled'])) { continue; // list not qualified } + $disabled = ''; + if (empty($val['perms'])) { + $disabled = ' disabled'; + } $checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : ''); - print '
'; + print '
'; } print ''; From 1540f62df065c45dab4b977b6bde29e22cd12e64 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 14:25:59 +0100 Subject: [PATCH 060/108] FIX #yogosha5678 --- htdocs/bom/bom_list.php | 19 +++---- .../conferenceorbooth_agenda.php | 11 ++-- .../conferenceorbooth_card.php | 7 +-- .../conferenceorbooth_contact.php | 15 +++--- .../conferenceorbooth_document.php | 11 ++-- .../conferenceorbooth_list.php | 9 +--- .../conferenceorbooth_note.php | 6 +++ .../eventorganizationindex.php | 53 ++++--------------- htdocs/intracommreport/list.php | 11 +++- .../modulebuilder/template/myobject_list.php | 2 +- htdocs/mrp/mo_list.php | 19 +++---- htdocs/product/list.php | 17 +++--- 12 files changed, 75 insertions(+), 105 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index eb1852699c0..62fb6002760 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -76,18 +76,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -if (empty($conf->bom->enabled)) { - accessforbidden('Module not enabled'); -} -$socid = 0; -if ($user->socid > 0) { - // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'bom', $id, ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -133,6 +121,13 @@ $permissiontoread = $user->rights->bom->read; $permissiontoadd = $user->rights->bom->write; $permissiontodelete = $user->rights->bom->delete; +// Security check +if ($user->socid > 0) { + // Protection if external user + accessforbidden(); +} +$result = restrictedArea($user, 'bom'); + /* * Actions diff --git a/htdocs/eventorganization/conferenceorbooth_agenda.php b/htdocs/eventorganization/conferenceorbooth_agenda.php index 54a3e5b9a4c..bd50df31a91 100644 --- a/htdocs/eventorganization/conferenceorbooth_agenda.php +++ b/htdocs/eventorganization/conferenceorbooth_agenda.php @@ -132,14 +132,17 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->eventorganization->multidir_output[$object->entity]."/".$object->id; } -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'eventorganization', $object->id); +// Security check +if ($user->socid > 0) { + accessforbidden(); +} +$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); +$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissiontoadd = $user->rights->eventorganization->conferenceorbooth->write; // Used by the include of actions_addupdatedelete.inc.php + /* * Actions */ diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index e27e909d071..6f223821bd3 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -85,14 +85,11 @@ $permissionnote = $user->rights->eventorganization->write; // Used by the includ $permissiondellink = $user->rights->eventorganization->write; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; -// Security check - Protection if external user +// Security check if ($user->socid > 0) { accessforbidden(); } -if ($user->socid > 0) { - $socid = $user->socid; -} -$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); +$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); if (!$permissiontoread) { diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index e29252aef1e..d42cc78adcb 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -78,18 +78,21 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'eventorganization', $object->id); +// Security check +if ($user->socid > 0) { + accessforbidden(); +} +$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); +$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permission = $user->rights->eventorganization->conferenceorbooth->write; + /* - * Add a new contact + * Actions */ -if ($action == 'addcontact' && $permission) { +if ($action == 'addcontact' && $permission) { // Add a new contact $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 7b8094e3034..1f354453fd1 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -124,13 +124,14 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->eventorganization->multidir_output[$object->entity ? $object->entity : $conf->entity]."/conferenceorbooth/".get_exdir(0, 0, 0, 1, $object); } -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'eventorganization', $object->id); - $permissiontoadd = $user->rights->eventorganization->conferenceorbooth->write; // Used by the include of actions_addupdatedelete.inc.php +// Security check +if ($user->socid > 0) { + accessforbidden(); +} +$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); +$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); /* diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 6632e8a1f29..f4cda255cdb 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -132,17 +132,12 @@ $permissiontoadd = $user->rights->eventorganization->write; $permissiontodelete = $user->rights->eventorganization->delete; // Security check -if (empty($conf->eventorganization->enabled)) { - accessforbidden('Module not enabled'); -} -$socid = 0; +//$socid = 0; if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -//$result = restrictedArea($user, 'eventorganization', $id, ''); -//if (!$permissiontoread) accessforbidden(); - +$result = restrictedArea($user, 'eventorganization'); /* diff --git a/htdocs/eventorganization/conferenceorbooth_note.php b/htdocs/eventorganization/conferenceorbooth_note.php index 61c8ba957e6..634877d82fe 100644 --- a/htdocs/eventorganization/conferenceorbooth_note.php +++ b/htdocs/eventorganization/conferenceorbooth_note.php @@ -109,6 +109,12 @@ if ($id > 0 || !empty($ref)) { $permissionnote = $user->rights->eventorganization->conferenceorbooth->write; // Used by the include of actions_setnotes.inc.php $permissiontoadd = $user->rights->eventorganization->conferenceorbooth->write; // Used by the include of actions_addupdatedelete.inc.php +// Security check +if ($user->socid > 0) { + accessforbidden(); +} +$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); +$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); /* diff --git a/htdocs/eventorganization/eventorganizationindex.php b/htdocs/eventorganization/eventorganizationindex.php index 999d85255d0..d5c158ab860 100644 --- a/htdocs/eventorganization/eventorganizationindex.php +++ b/htdocs/eventorganization/eventorganizationindex.php @@ -25,57 +25,26 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page -$langs->loadLangs(array("eventorganization@eventorganization")); +$langs->loadLangs(array("eventorganization")); $action = GETPOST('action', 'aZ09'); - -// Security check -// if (! $user->rights->eventorganization->myobject->read) { -// accessforbidden(); -// } -$socid = GETPOST('socid', 'int'); -if (isset($user->socid) && $user->socid > 0) { - $action = ''; - $socid = $user->socid; -} - $max = 5; $now = dol_now(); +// Security check +//$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +$result = restrictedArea($user, 'eventorganization'); + + /* * Actions diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index e43dc33e700..d3fd0ff2fb1 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -39,8 +39,6 @@ $toselect = GETPOST('toselect', 'array'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_ref = GETPOST("search_ref", 'alpha'); $search_type = GETPOST("search_type", 'int'); -$fourn_id = GETPOST("fourn_id", 'int'); -$catid = GETPOST('catid', 'int'); $optioncss = GETPOST('optioncss', 'alpha'); $type = GETPOST("type", "int"); @@ -139,6 +137,14 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Security check +if ($search_type == '0') { + $result = restrictedArea($user, 'produit', '', '', '', '', '', 0); +} elseif ($search_type == '1') { + $result = restrictedArea($user, 'service', '', '', '', '', '', 0); +} else { + $result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0); +} /* @@ -192,6 +198,7 @@ if (empty($reshook)) { /* * View */ + $formother = new FormOther($db); $title = $langs->trans('IntracommReportList'.$type); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index aa616709a7d..47afaa55b55 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -187,7 +187,7 @@ if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -//$result = restrictedArea($user, 'mymodule', $id, ''); +//$result = restrictedArea($user, 'mymodule'); //if (!$permissiontoread) accessforbidden(); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 841dba3ea20..30fe3e8d9fa 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -82,18 +82,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -if (empty($conf->mrp->enabled)) { - accessforbidden('Module not enabled'); -} -$socid = 0; -if ($user->socid > 0) { // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'mrp', $id, ''); - - // Initialize array of search criterias $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); @@ -139,6 +127,13 @@ $permissiontoread = $user->rights->mrp->read; $permissiontoadd = $user->rights->mrp->write; $permissiontodelete = $user->rights->mrp->delete; +// Security check +if ($user->socid > 0) { + // Protection if external user + accessforbidden(); +} +$result = restrictedArea($user, 'mrp'); + /* * Actions diff --git a/htdocs/product/list.php b/htdocs/product/list.php index bd38e41f4dd..4d8f07ab9a5 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -146,15 +146,6 @@ if (!empty($canvas)) { $objcanvas->getCanvas('product', 'list', $canvas); } -// Security check -if ($search_type == '0') { - $result = restrictedArea($user, 'produit', '', '', '', '', '', 0); -} elseif ($search_type == '1') { - $result = restrictedArea($user, 'service', '', '', '', '', '', 0); -} else { - $result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0); -} - // Define virtualdiffersfromphysical $virtualdiffersfromphysical = 0; if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) @@ -267,6 +258,14 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Security check +if ($search_type == '0') { + $result = restrictedArea($user, 'produit', '', '', '', '', '', 0); +} elseif ($search_type == '1') { + $result = restrictedArea($user, 'service', '', '', '', '', '', 0); +} else { + $result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0); +} /* From 3a9a3b2b3e901abc58b19c35bbd71f66d202abb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 14:41:57 +0100 Subject: [PATCH 061/108] FIX #yogosha5665 --- htdocs/product/stock/productlot_card.php | 22 ++++++++++++------- htdocs/product/stock/productlot_document.php | 22 +++++++++++++++++++ htdocs/product/stock/productlot_list.php | 23 +++++++++++++++++--- 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 94ecdc8e13a..646f3d322d7 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -92,14 +92,6 @@ if ($id || $ref) { $object->ref = $object->batch; // For document management ( it use $object->ref) } -// Protection if external user -if ($user->socid > 0) { - //accessforbidden(); -} -//$result = restrictedArea($user, 'mymodule', $id); - - - // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('productlotcard', 'globalcard')); @@ -114,7 +106,21 @@ $usercandelete = $user->rights->produit->supprimer; $upload_dir = $conf->productbatch->multidir_output[$conf->entity]; +$permissiontoread = $usercanread; $permissiontoadd = $usercancreate; +//$permissiontodelete = $usercandelete; + +// Security check +if (empty($conf->productbatch->enabled)) { + accessforbidden('Module not enabled'); +} +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +//$result = restrictedArea($user, 'productbatch'); +if (!$permissiontoread) accessforbidden(); /* diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 81f68487cf6..97eaace9ee4 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -90,6 +90,28 @@ if ($id || $ref) { } } +$usercanread = $user->rights->produit->lire; +$usercancreate = $user->rights->produit->creer; +$usercandelete = $user->rights->produit->supprimer; + +$upload_dir = $conf->productbatch->multidir_output[$conf->entity]; + +$permissiontoread = $usercanread; +$permissiontoadd = $usercancreate; +//$permissiontodelete = $usercandelete; + +// Security check +if (empty($conf->productbatch->enabled)) { + accessforbidden('Module not enabled'); +} +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +//$result = restrictedArea($user, 'productbatch'); +if (!$permissiontoread) accessforbidden(); + /* * Actions diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index e04b3f2e59b..e467aa80d95 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -129,10 +129,27 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->stock->lire; -$permissiontoadd = $user->rights->stock->mouvement->creer; -//$permissiontodelete = $user->rights->stock->supprimer; +$usercanread = $user->rights->produit->lire; +$usercancreate = $user->rights->produit->creer; +$usercandelete = $user->rights->produit->supprimer; +$upload_dir = $conf->productbatch->multidir_output[$conf->entity]; + +$permissiontoread = $usercanread; +$permissiontoadd = $usercancreate; +//$permissiontodelete = $usercandelete; + +// Security check +if (empty($conf->productbatch->enabled)) { + accessforbidden('Module not enabled'); +} +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +//$result = restrictedArea($user, 'productbatch'); +if (!$permissiontoread) accessforbidden(); /* From a3be3dd0e2edaeb8b57d1a16606d446cf1ee68fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 14:46:30 +0100 Subject: [PATCH 062/108] Responsive --- htdocs/barcode/printsheet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index a8033cf1c7a..ff57587d1b4 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -286,7 +286,7 @@ print '
'; // Sheet format print '
'; -print '
'; +print '
'; print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").'   '; print '
'; // List of possible labels (defined into $_Avery_Labels variable set into core/lib/format_cards.lib.php) @@ -302,7 +302,7 @@ print '
'; // Number of stickers to print print '
'; -print '
'; +print '
'; print $langs->trans("NumberOfStickers").'   '; print '
'; print ''; From be90f5f2deba04615fd6fef54048d36ce3f7734e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 15:00:22 +0100 Subject: [PATCH 063/108] Fix id of advanced perm --- htdocs/core/modules/modBarcode.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index 93c67f63b3c..a3e2796aed6 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -79,13 +79,13 @@ class modBarcode extends DolibarrModules $this->rights = array(); $this->rights_class = 'barcode'; - $this->rights[1][0] = 300; // id de la permission + $this->rights[1][0] = 301; // id de la permission $this->rights[1][1] = 'Read barcodes'; // libelle de la permission $this->rights[1][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[1][3] = 1; // La permission est-elle une permission par defaut $this->rights[1][4] = 'lire_advance'; - $this->rights[2][0] = 301; // id de la permission + $this->rights[2][0] = 302; // id de la permission $this->rights[2][1] = 'Create/modify barcodes'; // libelle de la permission $this->rights[2][2] = 'w'; // type de la permission (deprecie a ce jour) $this->rights[2][3] = 0; // La permission est-elle une permission par defaut From 7056cf7614f8a3c621e0b2b11f8e84419f1d9c37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 15:05:28 +0100 Subject: [PATCH 064/108] FIX #yogosha5675 --- htdocs/user/group/card.php | 15 +++++++-------- htdocs/user/group/list.php | 26 +++++++++++++++----------- htdocs/user/list.php | 8 ++++---- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 05945c02855..0d6d413ba0f 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -57,14 +57,6 @@ $backtopage = GETPOST('backtopage', 'alpha'); $userid = GETPOST('user', 'int'); -// Security check -$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2); - -// Users/Groups management only in master entity if transverse mode -if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { - accessforbidden(); -} - $object = new Usergroup($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels @@ -77,6 +69,13 @@ $object->getrights(); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('groupcard', 'globalcard')); +// Security check +$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2); + +// Users/Groups management only in master entity if transverse mode +if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { + accessforbidden(); +} /** diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 7281bc93639..edd34dfe9b8 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -28,17 +28,6 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; -if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - if (!$user->rights->user->group_advance->read && !$user->admin) { - accessforbidden(); - } -} - -// Users/Groups management only in master entity if transverse mode -if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { - accessforbidden(); -} - // Load translation files required by page $langs->load("users"); @@ -78,6 +67,21 @@ $fieldstosearchall = array( 'g.note'=>"Note" ); +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + if (!$user->rights->user->group_advance->read && !$user->admin) { + accessforbidden(); + } +} + +// Users/Groups management only in master entity if transverse mode +if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { + accessforbidden(); +} + +if (!$user->rights->user->user->lire && !$user->admin) { + accessforbidden(); +} + /* * Actions diff --git a/htdocs/user/list.php b/htdocs/user/list.php index f9703116d62..aef0d3e31c9 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -31,10 +31,6 @@ if (!empty($conf->categorie->enabled)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } -if (!$user->rights->user->user->lire && !$user->admin) { - accessforbidden(); -} - // Load translation files required by page $langs->loadLangs(array('users', 'companies', 'hrm', 'salaries')); @@ -185,6 +181,10 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $error = 0; +if (!$user->rights->user->user->lire && !$user->admin) { + accessforbidden(); +} + $childids = $user->getAllChildIds(1); From 3414511d7f9749d240fe4722d57205070e00acea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 15:09:06 +0100 Subject: [PATCH 065/108] Code position --- htdocs/user/group/ldap.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index dcefbf4a413..aee79688aee 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -33,16 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; // Load translation files required by page $langs->loadLangs(array('companies', 'ldap', 'users', 'admin')); -// Users/Groups management only in master entity if transverse mode -if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { - accessforbidden(); -} - -$canreadperms = true; -if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreadperms = ($user->admin || $user->rights->user->group_advance->read); -} - $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); @@ -55,6 +45,16 @@ $object = new Usergroup($db); $object->fetch($id); $object->getrights(); +// Users/Groups management only in master entity if transverse mode +if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { + accessforbidden(); +} + +$canreadperms = true; +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + $canreadperms = ($user->admin || $user->rights->user->group_advance->read); +} + /* * Actions From 84b71dbcc8c8f8e02bba930e1c101b4a45597785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Mar 2021 16:34:17 +0100 Subject: [PATCH 066/108] fix php8 warning --- htdocs/adherents/subscription.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 79f1a4da036..c32ea99b3bd 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -121,6 +121,7 @@ $paymentdate = -1; * Actions */ +$parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 239dae03bfe8d793176907f6324ebd7db98155d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Mar 2021 16:57:12 +0100 Subject: [PATCH 067/108] fix php8 warnings --- htdocs/core/ajax/ajaxdirtree.php | 7 +++++-- htdocs/core/tpl/filemanager.tpl.php | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 1977cfac6e4..9a0a11f04d4 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -58,8 +58,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call if ($selecteddir != '/') { $selecteddir = preg_replace('/\/$/', '', $selecteddir); // We removed last '/' except if it is '/' } -} else // For no ajax call -{ +} else { + // For no ajax call //if (GETPOST('preopened')) { $_GET['dir'] = $_POST['dir'] = GETPOST('preopened'); } $openeddir = GETPOST('openeddir'); @@ -76,6 +76,9 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call } } +$websitekey = GETPOST('websitekey', 'alpha'); +$pageid = GETPOST('pageid', 'int'); + // Load translation files required by the page $langs->load("ecm"); diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index de165c8c752..6ff7bba2390 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -71,7 +71,8 @@ print '
'; // Toolbar if ($permtoadd) { - print ''; + $websitekeyandpageid = (!empty($websitekey) ? '&website='.$websitekey : '').(!empty($pageid) ? '&pageid='.$pageid : ''); + print ''; print ''; print ''; } else { From 93ae7a3fed715cd9b2790d6c77f669a11c61b128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Mar 2021 17:01:14 +0100 Subject: [PATCH 068/108] fix php8 warning --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 4a0114b5244..498078b6b15 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1778,7 +1778,7 @@ class FormFile // Share link print '
'; print ''; @@ -657,65 +658,46 @@ if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { } print ''; print ''; +*/ /* // Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. // Ask for payment bank during order -if ($conf->banque->enabled) -{ +if ($conf->banque->enabled) { print ''; -} -else -{ +} else { print ''; } // Ask for warehouse during order -if ($conf->stock->enabled) -{ - +if ($conf->stock->enabled) { print ''; -} -else -{ - +} else { print ''; } From 2de2f1ce4dbe6394ff4f6fdf175f31e9a7030852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 09:02:29 +0100 Subject: [PATCH 077/108] fix nested comments for doxygen --- htdocs/compta/facture/class/api_invoices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 85da9cd5c37..befc4e20e13 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 1a2b22def49682d2737a5a2c961e9388bca67090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 09:14:52 +0100 Subject: [PATCH 078/108] fix doxygen --- htdocs/core/modules/delivery/mod_delivery_saphir.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index ef3e7f7b7c0..af1900803c8 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/modules/delivery/mod_livraison_saphir.php + * \file htdocs/core/modules/delivery/mod_delivery_saphir.php * \ingroup expedition * \brief Fichier contenant la classe du modele de numerotation de reference de livraison Saphir */ From 48e1a796e0adf380342577b5f49f472905e6f557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 09:16:38 +0100 Subject: [PATCH 079/108] fix doxygen --- htdocs/eventorganization/conferenceorbooth_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 6f223821bd3..495d0334a10 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -17,7 +17,7 @@ */ /** - * \file event.php + * \file htdocs/eventorganization/conferenceorbooth_card.php * \ingroup eventorganization * \brief Page to create/edit/view conferenceorbooth */ From 53ff22d6259ec54564252a1d31cfc207af9ff8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 09:18:40 +0100 Subject: [PATCH 080/108] fix doxygen --- htdocs/adherents/vcard.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php index dbdbbc687ea..a53cacd2212 100644 --- a/htdocs/adherents/vcard.php +++ b/htdocs/adherents/vcard.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,9 +20,9 @@ */ /** - * \file htdocs/adherent/vcard.php + * \file htdocs/adherents/vcard.php * \ingroup societe - * \brief Onglet vcard d'un adherent + * \brief Vcard tab of a member */ require '../main.inc.php'; From 3b673d0acda3830a8f4811ac20145cb26e8b04fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 09:28:21 +0100 Subject: [PATCH 081/108] fix nested comments --- htdocs/takepos/ajax/ajax.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 136841a8683..c9cdb681267 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,10 +21,6 @@ * \brief Ajax search component for TakePos. It search products of a category. */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (!defined('NOCSRFCHECK')) { define('NOCSRFCHECK', '1'); } From ed341197ea9b5336a5aff703b4c83207dbb904d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 09:30:09 +0100 Subject: [PATCH 082/108] fix nested comments --- htdocs/user/class/api_users.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index d50fec76353..9415366061d 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 434f5821f72ca2a0736398f8289cbe4a218a812d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 09:38:21 +0100 Subject: [PATCH 083/108] fix nested comments --- htdocs/mrp/tpl/originproductline.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 75147a3c3f9..fb1c1c0c1ee 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2017 Charlie Benke + * Copyright (C) 2017 Charlie Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From bae1770176c379558bb651574a0db8f5517ba87c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:00:24 +0100 Subject: [PATCH 084/108] uniformise comments to remove nested comments --- htdocs/adherents/admin/adherent_extrafields.php | 13 ++----------- .../adherents/admin/adherent_type_extrafields.php | 13 ++----------- htdocs/admin/agenda_extrafields.php | 13 +++---------- .../commande_fournisseur_dispatch_extrafields.php | 13 ++----------- htdocs/admin/delivery_extrafields.php | 13 ++----------- htdocs/admin/deliverydet_extrafields.php | 13 ++----------- htdocs/admin/ecm_directories_extrafields.php | 13 ++----------- htdocs/admin/ecm_files_extrafields.php | 13 ++----------- htdocs/admin/expedition_extrafields.php | 14 ++------------ htdocs/admin/expeditiondet_extrafields.php | 13 ++----------- htdocs/admin/expensereport_extrafields.php | 12 ++---------- htdocs/admin/holiday_extrafields.php | 14 +++----------- htdocs/admin/order_extrafields.php | 13 ++----------- htdocs/admin/orderdet_extrafields.php | 13 ++----------- htdocs/admin/reception_extrafields.php | 13 ++----------- htdocs/admin/resource_extrafields.php | 14 ++------------ htdocs/admin/supplierinvoice_extrafields.php | 14 ++------------ htdocs/admin/supplierinvoicedet_extrafields.php | 14 ++------------ htdocs/admin/supplierorder_extrafields.php | 14 ++------------ htdocs/admin/supplierorderdet_extrafields.php | 14 ++------------ htdocs/admin/ticket_extrafields.php | 13 ++----------- htdocs/asset/admin/assets_type_extrafields.php | 14 ++------------ htdocs/categories/admin/categorie_extrafields.php | 14 ++------------ htdocs/comm/admin/propal_extrafields.php | 14 ++------------ htdocs/comm/admin/propaldet_extrafields.php | 14 ++------------ .../facture/admin/facturedet_cust_extrafields.php | 4 ++-- .../admin/facturedet_rec_cust_extrafields.php | 4 ++-- htdocs/contrat/admin/contract_extrafields.php | 14 ++------------ htdocs/contrat/admin/contractdet_extrafields.php | 14 ++------------ htdocs/fichinter/admin/fichinter_extrafields.php | 14 ++------------ .../fichinter/admin/fichinterdet_extrafields.php | 14 ++------------ htdocs/product/admin/product_extrafields.php | 13 ++----------- htdocs/product/admin/product_lot_extrafields.php | 14 ++------------ .../product/admin/product_supplier_extrafields.php | 14 ++------------ htdocs/product/admin/stock_extrafields.php | 14 ++------------ htdocs/projet/admin/project_extrafields.php | 14 ++------------ htdocs/projet/admin/project_task_extrafields.php | 14 ++------------ htdocs/salaries/admin/salaries_extrafields.php | 14 ++------------ htdocs/societe/admin/contact_extrafields.php | 14 ++------------ htdocs/societe/admin/societe_extrafields.php | 14 ++------------ .../admin/supplier_proposal_extrafields.php | 14 ++------------ .../admin/supplier_proposaldet_extrafields.php | 14 ++------------ htdocs/user/admin/group_extrafields.php | 14 ++------------ htdocs/user/admin/user_extrafields.php | 14 ++------------ 44 files changed, 90 insertions(+), 490 deletions(-) diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 0465b7eee4f..ec3b3824db7 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -89,12 +89,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '

'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +97,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index c33ee5a4739..34175da465f 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -92,12 +92,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -105,11 +100,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index f140b207aaf..50e4a3e92c7 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -94,12 +94,8 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +103,8 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ + +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index 1acad0506c0..d0c7c85463e 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -99,12 +99,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -112,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/delivery_extrafields.php b/htdocs/admin/delivery_extrafields.php index 7222880ae47..cf712bc6ecf 100644 --- a/htdocs/admin/delivery_extrafields.php +++ b/htdocs/admin/delivery_extrafields.php @@ -96,12 +96,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +104,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/deliverydet_extrafields.php b/htdocs/admin/deliverydet_extrafields.php index 45068a252b3..c74f5235d42 100644 --- a/htdocs/admin/deliverydet_extrafields.php +++ b/htdocs/admin/deliverydet_extrafields.php @@ -97,12 +97,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -110,11 +105,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/ecm_directories_extrafields.php b/htdocs/admin/ecm_directories_extrafields.php index 99cedac9f3f..d913826b245 100644 --- a/htdocs/admin/ecm_directories_extrafields.php +++ b/htdocs/admin/ecm_directories_extrafields.php @@ -96,23 +96,14 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/ecm_files_extrafields.php b/htdocs/admin/ecm_files_extrafields.php index d7d9f809534..b260eff55fa 100644 --- a/htdocs/admin/ecm_files_extrafields.php +++ b/htdocs/admin/ecm_files_extrafields.php @@ -96,23 +96,14 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index 70a9629e1d6..b76ee35b76c 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -95,13 +95,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +103,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index 7df27d0d84b..4f807ee9da3 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -97,12 +97,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -110,11 +105,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 716ba5d1a03..25771ef63d0 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -90,12 +90,8 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +99,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/holiday_extrafields.php b/htdocs/admin/holiday_extrafields.php index 732eb0997d7..609187058e3 100644 --- a/htdocs/admin/holiday_extrafields.php +++ b/htdocs/admin/holiday_extrafields.php @@ -90,12 +90,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +98,8 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ + +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 701156303bb..e11ac077cc6 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -93,12 +93,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -106,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 6869d7897b3..c89ff3e3655 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -94,12 +94,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php index 9dea1bf8fd7..ab7d18b1331 100644 --- a/htdocs/admin/reception_extrafields.php +++ b/htdocs/admin/reception_extrafields.php @@ -99,12 +99,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -112,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index ff13b5f4573..c4967f75313 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -92,13 +92,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -106,11 +100,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 59e0e857161..4121073dec2 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -93,13 +93,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index 61a14a34844..0156eed5072 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -95,13 +95,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +103,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 5e0cfb38d4c..5a49c8f5bfd 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -93,13 +93,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 25689c7b9f5..07f223d59c8 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -94,13 +94,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -108,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 4a50beaa32e..0a4a851dae2 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -84,12 +84,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -97,11 +92,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php index 6d2799e0228..165361f7f57 100644 --- a/htdocs/asset/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -82,13 +82,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -96,11 +90,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 0d691995c29..02cd6e2a784 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -86,13 +86,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -100,11 +94,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index e314d0b3e66..bfa62eba7fc 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -86,13 +86,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -100,11 +94,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 4cbe35b31c5..834722f2afd 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -94,13 +94,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -108,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index 82520c02fac..05aa47737be 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -91,7 +91,7 @@ if ($action != 'create' && $action != 'edit') { /* * - * Creation d'un champ optionnel + * Creation of an optional field * */ @@ -104,7 +104,7 @@ if ($action == 'create') { /* * - * Edition d'un champ optionnel + * Edition of an optional field * */ if ($action == 'edit' && !empty($attrname)) { diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index 5264ee5472c..6ebdfae6277 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -91,7 +91,7 @@ if ($action != 'create' && $action != 'edit') { /* * - * Creation d'un champ optionnel + * Creation of an optional field * */ @@ -104,7 +104,7 @@ if ($action == 'create') { /* * - * Edition d'un champ optionnel + * Edition of an optional field * */ if ($action == 'edit' && !empty($attrname)) { diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index dc361a1f0b6..b725ef6f3f4 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index 6e83f0a4c1b..70d3193c12f 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel - /* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php index 2fec51a0f5b..552d9f70c97 100644 --- a/htdocs/fichinter/admin/fichinter_extrafields.php +++ b/htdocs/fichinter/admin/fichinter_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/fichinter/admin/fichinterdet_extrafields.php b/htdocs/fichinter/admin/fichinterdet_extrafields.php index 1cbdeb4cf0a..439cad6c532 100644 --- a/htdocs/fichinter/admin/fichinterdet_extrafields.php +++ b/htdocs/fichinter/admin/fichinterdet_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel - /* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 0962d1ddf44..aea75f78aa8 100644 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -99,12 +99,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -112,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/product/admin/product_lot_extrafields.php b/htdocs/product/admin/product_lot_extrafields.php index 91e19ee1fa7..fc14b4c142c 100644 --- a/htdocs/product/admin/product_lot_extrafields.php +++ b/htdocs/product/admin/product_lot_extrafields.php @@ -91,13 +91,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -105,11 +99,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/product/admin/product_supplier_extrafields.php b/htdocs/product/admin/product_supplier_extrafields.php index 8c3a10a4b74..daafa2f668d 100644 --- a/htdocs/product/admin/product_supplier_extrafields.php +++ b/htdocs/product/admin/product_supplier_extrafields.php @@ -99,13 +99,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -113,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/product/admin/stock_extrafields.php b/htdocs/product/admin/stock_extrafields.php index 3f860564b48..e72c9f1b1bf 100644 --- a/htdocs/product/admin/stock_extrafields.php +++ b/htdocs/product/admin/stock_extrafields.php @@ -86,13 +86,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -100,11 +94,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/projet/admin/project_extrafields.php b/htdocs/projet/admin/project_extrafields.php index e011b1a02c3..c4a4caa47fb 100644 --- a/htdocs/projet/admin/project_extrafields.php +++ b/htdocs/projet/admin/project_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/projet/admin/project_task_extrafields.php b/htdocs/projet/admin/project_task_extrafields.php index 5222706d7d0..da79010076a 100644 --- a/htdocs/projet/admin/project_task_extrafields.php +++ b/htdocs/projet/admin/project_task_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php index 59074e582d2..38303518ac4 100644 --- a/htdocs/salaries/admin/salaries_extrafields.php +++ b/htdocs/salaries/admin/salaries_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '

'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index 3841a7c66ea..6607efa554d 100644 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index d1ffffd6b87..a785b95c892 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel - /* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '
'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index 035be6ff86d..66bcf2c61e4 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -82,13 +82,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -96,11 +90,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index f4b63f25cd7..5a061101fab 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index 627af1c3b9d..b258f991a47 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -89,13 +89,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +97,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 25141ed4fcd..7e22a1c7122 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Editing an optional field */ -/* */ -/* ************************************************************************** */ +// Editing an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); From a872f6ebd374f4664539d3c5ceafaeef68a4ac27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:06:59 +0100 Subject: [PATCH 085/108] fix doxygen --- htdocs/public/project/new.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 51b8dbf9aa1..f25843f69e4 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -4,7 +4,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ */ /** - * \file htdocs/public/lead/new.php + * \file htdocs/public/project/new.php * \ingroup project * \brief Example of form to add a new lead */ From 1552c16dd3ab043452ad3262c5eef16c5b066694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:08:22 +0100 Subject: [PATCH 086/108] fix doxygen --- htdocs/public/cron/cron_run_jobs_by_url.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/cron/cron_run_jobs_by_url.php b/htdocs/public/cron/cron_run_jobs_by_url.php index aaf7e38cac8..133c5d1b18a 100644 --- a/htdocs/public/cron/cron_run_jobs_by_url.php +++ b/htdocs/public/cron/cron_run_jobs_by_url.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/public/cron/cron_run_jobs.php + * \file htdocs/public/cron/cron_run_jobs_by_url.php * \ingroup cron * \brief Execute pendings jobs */ From 283cf9b8d2d637a435e007ab30cba1a13834566c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:08:57 +0100 Subject: [PATCH 087/108] Create index.html --- htdocs/public/project/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/public/project/index.html diff --git a/htdocs/public/project/index.html b/htdocs/public/project/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/public/project/index.html @@ -0,0 +1 @@ + From 1bc3301a7f50e8586911cbaccb0c0010690c3085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:10:41 +0100 Subject: [PATCH 088/108] fix doxygen --- htdocs/fourn/paiement/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 02adee36149..305c7bedba5 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2020 Tobias Sekan * * This program is free software; you can redistribute it and/or modify @@ -27,7 +27,7 @@ */ /** - * \file htdocs/fourn/paiment/list.php + * \file htdocs/fourn/paiement/list.php * \ingroup fournisseur,facture * \brief Payment list for supplier invoices */ @@ -59,9 +59,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->loadLangs(array('companies', 'bills', 'banks', 'compta')); $action = GETPOST('action', 'alpha'); -$massaction = GETPOST('massaction', 'alpha'); +$massaction = GETPOST('massaction', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist'; +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist'; $socid = GETPOST('socid', 'int'); From 0cacdf332016d6bd65e95723dd2dca6bffb7bb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:11:56 +0100 Subject: [PATCH 089/108] fix doxygen --- htdocs/fourn/facture/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index 8904310bf3e..1e3c4f5e686 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/forun/facture/index.php + * \file htdocs/fourn/facture/index.php * \ingroup facture * \brief Home page of customer invoices area */ From 9f02d8cdb11c3611a43114200d5590488fa033ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:15:00 +0100 Subject: [PATCH 090/108] fix doxygen --- htdocs/recruitment/admin/candidature_extrafields.php | 2 +- htdocs/recruitment/admin/jobposition_extrafields.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/recruitment/admin/candidature_extrafields.php b/htdocs/recruitment/admin/candidature_extrafields.php index 984d92ce913..1f0ac538d0b 100644 --- a/htdocs/recruitment/admin/candidature_extrafields.php +++ b/htdocs/recruitment/admin/candidature_extrafields.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/recruitement/admin/candidature_extrafields.php + * \file htdocs/recruitment/admin/candidature_extrafields.php * \ingroup recruitment * \brief Page to setup extra fields of Candidature */ diff --git a/htdocs/recruitment/admin/jobposition_extrafields.php b/htdocs/recruitment/admin/jobposition_extrafields.php index 7df03c0c543..3b17322d5eb 100644 --- a/htdocs/recruitment/admin/jobposition_extrafields.php +++ b/htdocs/recruitment/admin/jobposition_extrafields.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/recruitement/admin/jobposition_extrafields.php + * \file htdocs/recruitment/admin/jobposition_extrafields.php * \ingroup recruitment * \brief Page to setup extra fields of Candidature */ From 8af1f278ae6d08c4b23b58802cd462054fe813d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:19:03 +0100 Subject: [PATCH 091/108] fix doxygen --- .../core/modules/member/doc/doc_generic_member_odt.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 5f2ad86c7b5..5ff5a1f767a 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/modules/member/doc/doc_generic_member_odt.modules.php + * \file htdocs/core/modules/member/doc/doc_generic_member_odt.class.php * \ingroup societe * \brief File of class to build ODT documents for members */ From 49ff44e4140fc41c1fe003a22542eb1466c57b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:21:23 +0100 Subject: [PATCH 092/108] fix doxygen --- htdocs/core/class/defaultvalues.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index da9d0ad9f19..8c835ed649e 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 Florian HENRY + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +18,7 @@ */ /** - * \file htdocs/code/class/defaultvalues.class.php + * \file htdocs/core/class/defaultvalues.class.php * \brief This file is a CRUD class file for DefaultValues (Create/Read/Update/Delete) */ From dad7038a0d7220b498c3f0bb1cdcbc8c1412d3da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:22:34 +0100 Subject: [PATCH 093/108] fix doxygen --- htdocs/core/modules/member/modules_member.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/member/modules_member.class.php b/htdocs/core/modules/member/modules_member.class.php index 2166fd9ccb7..1ff1ffc3d30 100644 --- a/htdocs/core/modules/member/modules_member.class.php +++ b/htdocs/core/modules/member/modules_member.class.php @@ -26,7 +26,7 @@ */ /** - * \file htdocs/core/modules/member/modules_member.php + * \file htdocs/core/modules/member/modules_member.class.php * \ingroup members * \brief File with parent class for generating members to PDF */ From a8d8775328638c093692ee7f8bdf239196866081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:30:26 +0100 Subject: [PATCH 094/108] fix doxygen --- htdocs/core/modules/movement/modules_movement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/movement/modules_movement.php b/htdocs/core/modules/movement/modules_movement.php index 0116a87ff38..77ff0c42fab 100644 --- a/htdocs/core/modules/movement/modules_movement.php +++ b/htdocs/core/modules/movement/modules_movement.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/modules/stock/modules_movement.php + * \file htdocs/core/modules/movement/modules_movement.php * \ingroup stock * \brief File with parent class for generating PDF of a stock movements */ From 5da597d94728bc0852ed9c894995285afb9cfd2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:32:18 +0100 Subject: [PATCH 095/108] fix doxygen --- htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 31b6bb20a8d..18ce00d0af3 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -2,7 +2,7 @@ /* Module descriptor for ticket system * Copyright (C) 2013-2016 Jean-François FERRY * 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ */ /** - * \file core/boxes/box_nb_ticket_last_x_days.php + * \file htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php * \ingroup ticket * \brief This box shows the number of new daily tickets the last X days */ From 65c3dced1cb62a1baae50da084f23324836d2d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:34:23 +0100 Subject: [PATCH 096/108] fix doxygen --- htdocs/core/boxes/box_graph_nb_tickets_type.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index 735dbed27dc..aee3e68ee5d 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -2,7 +2,7 @@ /* Module descriptor for ticket system * Copyright (C) 2013-2016 Jean-François FERRY * 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,9 +19,9 @@ */ /** - * \file core/boxes/box_nb_ticket_last_x_days.php + * \file htdocs/core/boxes/box_graph_nb_tickets_type.php * \ingroup ticket - * \brief This box shows the number of new daily tickets the last X days + * \brief This box shows the number of tickets types */ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; From 81c885dbf1e68029b065ac005bd5f78d9d5a4f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:36:53 +0100 Subject: [PATCH 097/108] fix doxygen --- htdocs/compta/stats/supplier_turnover.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index 141db21b73e..bf91d8b4d6a 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/compta/stats/supplier_ca.php + * \file htdocs/compta/stats/supplier_turnover.php * \brief Page reporting purchase turnover */ From 3d3715f55d1db63b07961bb43bb1301d824c0b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:37:51 +0100 Subject: [PATCH 098/108] fix doxygen --- htdocs/compta/stats/supplier_turnover_by_thirdparty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 0530d58ee87..4b64b2e5942 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/compta/stats/supplier_ca_by_thirdparty.php + * \file htdocs/compta/stats/supplier_turnover_by_thirdparty.php * \brief Page reporting purchase turnover by thirdparty */ From 8142d76394502790d21e751bb39c4afeaa9be6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 10:50:02 +0100 Subject: [PATCH 099/108] fix php8 warnings --- htdocs/core/class/commonobject.class.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4f5ad18768e..253ed9a1d02 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1293,10 +1293,24 @@ abstract class CommonObject if (!$list) { $transkey = "TypeContact_".$obj->element."_".$obj->source."_".$obj->code; $libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle); - $tab[$i] = array('source'=>$obj->source, 'socid'=>$obj->socid, 'id'=>$obj->id, - 'nom'=>$obj->lastname, // For backward compatibility - 'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email, 'login'=>$obj->login, 'photo'=>$obj->photo, 'statuscontact'=>$obj->statuscontact, - 'rowid'=>$obj->rowid, 'code'=>$obj->code, 'libelle'=>$libelle_type, 'status'=>$obj->statuslink, 'fk_c_type_contact'=>$obj->fk_c_type_contact); + $tab[$i] = array( + 'source' => $obj->source, + 'socid' => $obj->socid, + 'id' => $obj->id, + 'nom' => $obj->lastname, // For backward compatibility + 'civility' => $obj->civility, + 'lastname' => $obj->lastname, + 'firstname' => $obj->firstname, + 'email'=>$obj->email, + 'login'=> (empty($obj->login) ? '' : $obj->login), + 'photo' => (empty($obj->photo) ? '' : $obj->photo), + 'statuscontact' => $obj->statuscontact, + 'rowid' => $obj->rowid, + 'code' => $obj->code, + 'libelle' => $libelle_type, + 'status' => $obj->statuslink, + 'fk_c_type_contact' => $obj->fk_c_type_contact + ); } else { $tab[$i] = $obj->id; } From 7b7db144738b4cd91ad039d9b2f7c47f4f2902a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Mar 2021 11:23:32 +0100 Subject: [PATCH 100/108] Fix regression --- .../install/mysql/tables/llx_user_clicktodial.sql | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_user_clicktodial.sql b/htdocs/install/mysql/tables/llx_user_clicktodial.sql index 878802c9a47..e421028faa0 100644 --- a/htdocs/install/mysql/tables/llx_user_clicktodial.sql +++ b/htdocs/install/mysql/tables/llx_user_clicktodial.sql @@ -17,12 +17,13 @@ -- =========================================================================== -- --- Table to store each different IP / devices / public key used for login +-- Save data relative to click to dial -- create table llx_user_clicktodial ( - rowid integer PRIMARY KEY, - fk_user integer NOT NULL, -- ID llx_user - ip varchar(64), - user_agent varchar(255) NULL -- user agent -)ENGINE=innodb; + fk_user integer PRIMARY KEY, + url varchar(255), + login varchar(32), + pass varchar(64), + poste varchar(20) +)ENGINE=innodb; \ No newline at end of file From 4cb7c901846a557bb8237383968121b60913bd7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 11:38:53 +0100 Subject: [PATCH 101/108] fix stats --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 47d714e08db..c141290d9e9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Philippe Grand * Copyright (C) 2019-2020 Josep Lluís Amador - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2020 Open-Dsi * * This program is free software; you can redistribute it and/or modify @@ -4247,7 +4247,7 @@ class Societe extends CommonObject $table = 'supplier_proposal'; } - $sql = "SELECT rowid, total_ht, total as total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f"; + $sql = "SELECT rowid, total_ht, total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f"; $sql .= " WHERE fk_soc = ".$this->id; if ($mode == 'supplier') { $sql .= " AND entity IN (".getEntity('supplier_proposal').")"; From 36baf9b76b52051218f3d357f173797d72bff941 Mon Sep 17 00:00:00 2001 From: Chl Date: Fri, 19 Mar 2021 02:42:47 +0100 Subject: [PATCH 102/108] FIX #16143 Old PG requires "()" on DROP FUNCTION On PostgreSQL 9.6 and previous, the upgrade script fails with a syntax error if the dropped function's name is not followed by parentheses. Patch tested on 9.6 and 13.2. --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index cc0386621a8..bfa8bf01b39 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -575,7 +575,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); -- Removed no more used function --- VPGSQL8.2 DROP FUNCTION IF EXISTS update_modified_column_date_m CASCADE; +-- VPGSQL8.2 DROP FUNCTION IF EXISTS update_modified_column_date_m() CASCADE; insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 6,'AC_EMAIL_IN','system','reception Email',NULL, 1, 4); From 29e090b02560c0253afd2187f0734b09e19fa0c5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 20 Mar 2021 12:35:41 +0100 Subject: [PATCH 103/108] FIX force to entity 0 for all entities --- htdocs/core/ajax/pingresult.php | 6 +++--- htdocs/main.inc.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index fa7f4d0e68b..8c73ec23a13 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -67,14 +67,14 @@ print ''."\n"; + print "\n".''."\n"; print "\n\n"; $url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING); // Try to guess the distrib used @@ -3168,8 +3168,8 @@ if (!function_exists("llxFooter")) { $now = dol_now(); print "\n\n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', 0); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', 0); } } } From 972380860aafbb404d6a5cd9d5d8292468db8000 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 20 Mar 2021 12:40:24 +0100 Subject: [PATCH 104/108] FIX use new function getDolGlobalInt() instead --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2ddb9455a8e..2bae455383c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1438,7 +1438,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&userid='.$user->id.'&entity='.$conf->entity; - $themeparam .= ($ext ? '&'.$ext : '').'&revision='.(empty($conf->global->MAIN_IHM_PARAMS_REV) ? '0' : $conf->global->MAIN_IHM_PARAMS_REV); + $themeparam .= ($ext ? '&'.$ext : '').'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); if (!empty($_SESSION['dol_resetcache'])) { $themeparam .= '&dol_resetcache='.$_SESSION['dol_resetcache']; } From 625f72303b7a49c40c79c96dd846a83b058e221d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 20 Mar 2021 11:43:13 +0000 Subject: [PATCH 105/108] Fixing style errors. --- htdocs/core/ajax/pingresult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index 8c73ec23a13..3a98fba8e85 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -74,7 +74,7 @@ if ($action == 'firstpingok') { } elseif ($action == 'firstpingko') { // If ko // Note: pings are by installation, done on entity 1. - dolibarr_set_const($db, 'MAIN_LAST_PING_KO_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', 0); // erase last value + dolibarr_set_const($db, 'MAIN_LAST_PING_KO_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', 0); // erase last value print 'First ping KO saved for entity '.$conf->entity; } else { print 'Error action='.$action.' not supported'; From e1f23105a67aaaa6dce435744d18fd7aabd823ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Mar 2021 12:49:44 +0100 Subject: [PATCH 106/108] Finally try to follow install per entity instead of per instance. --- htdocs/core/ajax/pingresult.php | 6 +++--- htdocs/main.inc.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index 3a98fba8e85..c1b75fb92d2 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -67,14 +67,14 @@ print '\n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', 0); - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', 0); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity); } } } From 7df344191fd64df6988280844db81e2117f801f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 13:07:46 +0100 Subject: [PATCH 107/108] fix php8 warnings --- htdocs/admin/mails.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 515357df904..72d16569b25 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -677,17 +677,17 @@ if ($action == 'edit') { // Domain print '
'; - print ''; // Selector print ''; - print ''; // PRIVATE KEY print ''; - print ''; } From c1cab767228035c97d6ec0686dfa9c4279e1baf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 13:15:54 +0100 Subject: [PATCH 108/108] fix php8 warning --- htdocs/admin/mails_emailing.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 34da40010b5..cb5df373645 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -446,12 +446,12 @@ if ($action == 'edit') { // SMTPS ID if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // SMTPS PW if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // TLS @@ -484,7 +484,7 @@ if ($action == 'edit') { print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 1ba2373f35d..d912286b3c8 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -261,32 +261,35 @@ if ($id > 0 || !empty($ref)) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print ''; print '"; print ''; @@ -130,9 +130,9 @@ print ''; print '"; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 0671783615c..65029a9246a 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -89,7 +89,7 @@ $picto = array( */ foreach ($modules as $const => $desc) { - if ($action == 'activate_'.strtolower($const)) { + if ($action == 'enable_'.strtolower($const)) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity); // If fckeditor is active in the product/service description, it is activated in the forms if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { @@ -166,9 +166,9 @@ if (empty($conf->use_javascript_ajax)) { $constante = 'FCKEDITOR_ENABLE_'.$const; $value = (isset($conf->global->$constante) ? $conf->global->$constante : 0); if ($value == 0) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } elseif ($value == 1) { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print ""; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 011b28e7421..98b6c996181 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -406,7 +406,7 @@ if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) { if ($allow_disable_encryption) { //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes //Do not allow "disable encryption" as passwords cannot be decrypted - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; } else { print '-'; } @@ -432,10 +432,10 @@ if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) { print img_warning($langs->trans("WarningPassIsEmpty")); } else { if (empty($dolibarr_main_db_encrypted_pass)) { - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; } if (!empty($dolibarr_main_db_encrypted_pass)) { - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; } } print ""; @@ -455,12 +455,12 @@ if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print ''; if (empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print '"; } if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print '"; } print ""; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 6d2047d3f49..fa2ef014d17 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -656,11 +656,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($object->status == 1) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } */ diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 167e9e4a577..4f0148a05a1 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1658,15 +1658,15 @@ if ($action == 'create') { if ($user->rights->facture->creer) { if (empty($object->suspended)) { - print ''; + print ''; } else { - print ''; + print ''; } } //if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer) if ($user->rights->facture->supprimer) { - print ''; + print ''; } print ''; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index bae45672257..421b88ea6b8 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1470,11 +1470,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Activer if ($object->statut == 0 && $user->rights->societe->contact->creer) { - print ''.$langs->trans("Reactivate").''; + print ''.$langs->trans("Reactivate").''; } // Desactiver if ($object->statut == 1 && $user->rights->societe->contact->creer) { - print ''.$langs->trans("DisableUser").''; + print ''.$langs->trans("DisableUser").''; } // Delete diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 817be70ab79..e27e909d071 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -476,16 +476,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } if ($permissiontoadd) { if ($object->status == $object::STATUS_VALIDATED) { - print ''.$langs->trans("Cancel").''."\n"; + print ''.$langs->trans("Cancel").''."\n"; } else { - print ''.$langs->trans("Re-Open").''."\n"; + print ''.$langs->trans("Re-Open").''."\n"; } } */ diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d77b1479102..108a25e1877 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -431,11 +431,26 @@ if (!defined('NOTOKENRENEWAL')) { // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set into page if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) { - // Check all cases that need a token (all POST actions + all login, actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set + all sensitive GET actions) + // Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request) + $arrayofactiontoforcetokencheck = array( + 'activate', 'add', 'addtimespent', 'update', 'install', + 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_reject_check', + 'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'disable', + 'enable' + ); + $sensitiveget = false; + if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) { + $sensitiveget = true; + } + if (preg_match('/^(disable_|enable_)/', GETPOST('action', 'aZ09'))) { + $sensitiveget = true; + } + + // Check all cases that need a mandatory token (all POST actions + all login, actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set + all sensitive GET actions) if ( $_SERVER['REQUEST_METHOD'] == 'POST' || - ((GETPOSTISSET('actionlogin') || GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) || - in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_reject_check')) + $sensitiveget || + ((GETPOSTISSET('actionlogin') || GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) ) { if (!GETPOST('token', 'alpha')) { // If token is not provided or empty if (GETPOST('uploadform', 'int')) { diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index e99acc0b913..8e40c1071e2 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -514,16 +514,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } if ($permissiontoadd) { if ($object->status == $object::STATUS_VALIDATED) { - print ''.$langs->trans("Cancel").''."\n"; + print ''.$langs->trans("Cancel").''."\n"; } else { - print ''.$langs->trans("Re-Open").''."\n"; + print ''.$langs->trans("Re-Open").''."\n"; } } */ diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 015b061119b..ee86d43c09f 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -942,10 +942,10 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ } print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index b95f285c628..3b2e36d34c6 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -656,32 +656,35 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) - { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print ''; } From ee701bb4802ec3e185aaf3bd245d3211b6ade7f3 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 19 Mar 2021 09:05:20 +0000 Subject: [PATCH 045/108] Fixing style errors. --- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0ea4ce1dbe3..2ca0bf6b439 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1666,7 +1666,7 @@ class ExtraFields $value = price($value, 0, $langs, 0, 0, -1); } } elseif ($type == 'select') { - $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : ''); + $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : ''); if (($pos = strpos($valstr, "|")) !== false) { $valstr = substr($valstr, 0, $pos); } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 4b27ecc4496..4c56b0223cd 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -35,7 +35,7 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table } $value = $datenotinstring; } else { - $value = (!empty($obj->$tmpkey) ? $obj->$tmpkey : ''); + $value = (!empty($obj->$tmpkey) ? $obj->$tmpkey : ''); } // If field is a computed field, we make computation to get value if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { From 43e1dbb9efc8bb3c587b730aca0b7de0d6757be4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Mar 2021 11:27:31 +0100 Subject: [PATCH 046/108] FIX avoid php8 warning with multicompany --- htdocs/core/ajax/pingresult.php | 6 +++--- htdocs/core/boxes/box_services_contracts.php | 2 +- htdocs/main.inc.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index 4398a3e8d4c..fa7f4d0e68b 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -67,14 +67,14 @@ print ''."\n"; + print "\n".''."\n"; print "\n\n"; $url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING); // Try to guess the distrib used From 5978196e3bcbc91dddbffbba0321550caecfa279 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Mar 2021 11:31:46 +0100 Subject: [PATCH 047/108] FIX missing current entity id --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1001eccf78f..86ee87edb2a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -3150,8 +3150,8 @@ if (!function_exists("llxFooter")) { $now = dol_now(); print "\n\n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt')); - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled'); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity)); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity)); } } } From a8ecdc14dd0fe5bc7c1c5ca4a3451c725aaaebd0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Mar 2021 11:46:57 +0100 Subject: [PATCH 048/108] FIX syntax error --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 86ee87edb2a..d3632605351 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -3150,8 +3150,8 @@ if (!function_exists("llxFooter")) { $now = dol_now(); print "\n\n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity)); - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity)); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity); } } } From ebf409f831e4cc8203e8e2e85169475b3c3882f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 12:08:40 +0100 Subject: [PATCH 049/108] FIX #yogosha5668 --- htdocs/compta/bank/bankentries_list.php | 25 ++++++++------ htdocs/compta/bank/class/account.class.php | 12 +++---- htdocs/compta/bank/line.php | 40 +++++++++++++++++----- htdocs/compta/bank/releve.php | 32 +++++++++++++++-- htdocs/core/ajax/bankconciliate.php | 12 +++---- htdocs/main.inc.php | 12 ++++--- 6 files changed, 92 insertions(+), 41 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index b621ad9752f..37ef8a5da76 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -898,18 +898,21 @@ if ($resql) { print '
'; } - /// ajax to adjust value date with plus and less picto + // Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page + $urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken(); print ' + '; + */ print ''; print dol_get_fiche_end(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 53d43583a9c..be91d475d4d 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -454,11 +454,14 @@ if (empty($numref)) { // Date de valeur print '
\n"; // Type and num @@ -656,6 +659,29 @@ if (empty($numref)) { print "\n"; print "
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + print '
'.$langs->trans("Visibility").''; From a1f6886e97089c2f6f11dffeaf33894487395157 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Mar 2021 10:01:40 +0100 Subject: [PATCH 044/108] FIX avoid php8 warning in products list --- htdocs/core/class/extrafields.class.php | 4 ++-- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- htdocs/core/tpl/extrafields_list_search_input.tpl.php | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index ca703979a7d..0ea4ce1dbe3 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1597,7 +1597,7 @@ class ExtraFields if (!empty($extrafieldsobjectkey)) { $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; + $size = (int) $this->attributes[$extrafieldsobjectkey]['size'][$key]; $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; @@ -1666,7 +1666,7 @@ class ExtraFields $value = price($value, 0, $langs, 0, 0, -1); } } elseif ($type == 'select') { - $valstr = $param['options'][$value]; + $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : ''); if (($pos = strpos($valstr, "|")) !== false) { $valstr = substr($valstr, 0, $pos); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8b0b482f33f..b18ed68eaa2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6684,7 +6684,7 @@ class Form if (!dol_eval($val['enabled'], 1, 1)) { continue; } - if ($val['showoncombobox']) { + if (!empty($val['showoncombobox'])) { $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; } } @@ -6817,7 +6817,7 @@ class Form if (!$forcecombo) { include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode); + $out .= ajax_combobox($htmlname, null, (!empty($conf->global->$confkeyforautocompletemode) ? $conf->global->$confkeyforautocompletemode : 0)); } } else { dol_print_error($this->db); diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 5ea0e4821d6..4b27ecc4496 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -35,7 +35,7 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table } $value = $datenotinstring; } else { - $value = $obj->$tmpkey; + $value = (!empty($obj->$tmpkey) ? $obj->$tmpkey : ''); } // If field is a computed field, we make computation to get value if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php index 77329eb06a4..72f888f256a 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -37,17 +37,17 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table if (in_array($typeofextrafield, array('int', 'double'))) { $searchclass = 'searchnum'; } - print ''; + print ''; } elseif (in_array($typeofextrafield, array('datetime', 'timestamp'))) { $morecss = ''; - echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1); + echo $extrafields->showInputField($key, (empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1); } else { // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') $morecss = ''; if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) { $morecss = 'maxwidth200'; } - echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1); + echo $extrafields->showInputField($key, (empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1); } print ''; - print dol_print_date($db->jdate($objp->dv), "day").' '; - print ''; + print ''.dol_print_date($db->jdate($objp->dv), "day").''; + print ' '; + print ''; + print ''; print img_edit_remove()." "; - print ''; + print ''; print img_edit_add().""; + print ''; print "
"; + // Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page + $urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken(); + print ' + + '; + print ""; print "\n"; diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index adcd1290fed..351903ea1f7 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -48,10 +48,6 @@ $action = GETPOST('action', 'aZ09'); * View */ -// Ajout directives pour resoudre bug IE -//header('Cache-Control: Public, must-revalidate'); -//header('Pragma: public'); - //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header. top_httphead(); @@ -63,7 +59,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al->datev_next(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->datev), "day").''; + print ''.dol_print_date($db->jdate($al->datev), "day").''; exit; } @@ -74,7 +70,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al->datev_previous(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->datev), "day").''; + print ''.dol_print_date($db->jdate($al->datev), "day").''; exit; } @@ -85,7 +81,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al->dateo_next(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->dateo), "day").''; + print ''.dol_print_date($db->jdate($al->dateo), "day").''; exit; } @@ -96,7 +92,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al->dateo_previous(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->dateo), "day").''; + print ''.dol_print_date($db->jdate($al->dateo), "day").''; exit; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f6376a650b7..d77b1479102 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -427,7 +427,7 @@ if (!defined('NOTOKENRENEWAL')) { dol_syslog("NEW TOKEN reclaimed by : " . $_SERVER['PHP_SELF'], LOG_DEBUG); } -//dol_syslog("aaaa - ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha').' '.$_SESSION['token']); +//dol_syslog("aaaa - ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha')); // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set into page if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) { @@ -457,7 +457,9 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl } } - if (GETPOSTISSET('token') && GETPOST('token', 'alpha') != $_SESSION['token']) { + $sessiontokenforthisurl = $_SESSION['token']; + // TODO Get the sessiontokenforthisurl into the array of session token + if (GETPOSTISSET('token') && GETPOST('token', 'alpha') != $sessiontokenforthisurl) { dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." refused due to invalid token, so we disable POST and some GET parameters - referer=".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING); //print 'Unset POST by CSRF protection in main.inc.php.'; // Do not output anything because this create problems when using the BACK button on browsers. setEventMessages('SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry', null, 'warnings'); @@ -1094,7 +1096,7 @@ if (!defined('NOLOGIN')) { dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.(defined('NOTOKENRENEWAL') ?constant('NOTOKENRENEWAL') : '')); //Another call for easy debugg -//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST)); +//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' '.$_SERVER["HTTP_REFERER"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST)); // Load main languages files if (!defined('NOREQUIRETRAN')) { @@ -1237,7 +1239,7 @@ if (!function_exists("llxHeader")) { /** - * Show HTTP header + * Show HTTP header. Called by top_htmlhead(). * * @param string $contenttype Content type. For example, 'text/html' * @param int $forcenocache Force disabling of cache for the page @@ -1303,7 +1305,7 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0) } /** - * Ouput html header of a page. + * Ouput html header of a page. It calls also top_httphead() * This code is also duplicated into security2.lib.php::dol_loginfunction * * @param string $head Optionnal head lines From 3df866518d59da547d46cb5e0a1273a4d29721fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 12:15:46 +0100 Subject: [PATCH 050/108] FIx #yogosha5676 --- htdocs/printing/admin/printing.php | 8 ++++---- htdocs/printing/index.php | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 5c79be62197..2b86efa507c 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -33,10 +33,6 @@ use OAuth\Common\Storage\DoliStorage; // Load translation files required by the page $langs->loadLangs(array('admin', 'printing', 'oauth')); -if (!$user->admin) { - accessforbidden(); -} - $action = GETPOST('action', 'aZ09'); $mode = GETPOST('mode', 'alpha'); $value = GETPOST('value', 'alpha', 0, null, null, 1); // The value may be __google__docs so we force disable of replace @@ -53,6 +49,10 @@ if (!$mode) { $OAUTH_SERVICENAME_GOOGLE = 'Google'; +if (!$user->admin) { + accessforbidden(); +} + /* * Action diff --git a/htdocs/printing/index.php b/htdocs/printing/index.php index e0dcaf86e44..84132c784f4 100644 --- a/htdocs/printing/index.php +++ b/htdocs/printing/index.php @@ -28,6 +28,10 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; // Load translation files required by the page $langs->load("printing"); +if (!$user->admin) { + accessforbidden(); +} + /* * Actions From a9398e5630b70a2f172100ca43bbf0db73858c0b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 19 Mar 2021 12:39:38 +0100 Subject: [PATCH 051/108] FIx get optionnal in membertype with API --- htdocs/adherents/class/adherent_type.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 9acecaab1ce..a5f9e53d694 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -479,6 +479,9 @@ class AdherentType extends CommonObject if (!empty($conf->global->MAIN_MULTILANGS)) { $this->getMultiLangs(); } + + // fetch optionals attributes and labels + $this->fetch_optionals(); } return 1; From ba29f327a9892afb723867daedbad91208aa609c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 19 Mar 2021 11:41:27 +0000 Subject: [PATCH 052/108] Fixing style errors. --- htdocs/adherents/class/adherent_type.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index a5f9e53d694..5932bf58e6d 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -479,7 +479,7 @@ class AdherentType extends CommonObject if (!empty($conf->global->MAIN_MULTILANGS)) { $this->getMultiLangs(); } - + // fetch optionals attributes and labels $this->fetch_optionals(); } From d83d0052846104321ac598f80049a8080f88380f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Mar 2021 12:44:59 +0100 Subject: [PATCH 053/108] FIX #yogosha5674 --- htdocs/accountancy/admin/account.php | 8 +++---- htdocs/accountancy/admin/subaccount.php | 4 ++-- htdocs/accountancy/bookkeeping/card.php | 4 ++-- htdocs/admin/confexped.php | 8 +++---- htdocs/admin/fckeditor.php | 6 +++--- htdocs/admin/security.php | 10 ++++----- htdocs/bom/bom_card.php | 4 ++-- htdocs/compta/facture/card-rec.php | 6 +++--- htdocs/contact/card.php | 4 ++-- .../conferenceorbooth_card.php | 8 +++---- htdocs/main.inc.php | 21 ++++++++++++++++--- .../modulebuilder/template/myobject_card.php | 8 +++---- htdocs/product/price.php | 4 ++-- .../recruitmentjobposition_card.php | 4 ++-- htdocs/user/card.php | 6 +++--- htdocs/website/websiteaccount_card.php | 6 +++--- htdocs/workstation/workstation_card.php | 6 +++--- htdocs/zapier/hook_card.php | 4 ++-- 18 files changed, 68 insertions(+), 53 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index faf55427786..8982376ded6 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -529,11 +529,11 @@ if ($resql) { if (!empty($arrayfields['aa.reconcilable']['checked'])) { print '
'; if (empty($obj->reconcilable)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } @@ -548,11 +548,11 @@ if ($resql) { if (!empty($arrayfields['aa.active']['checked'])) { print ''; if (empty($obj->active)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 341fddf113c..ad1804048c3 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -419,11 +419,11 @@ if ($resql) { if (!empty($arrayfields['reconcilable']['checked'])) { print ''; if (empty($obj->reconcilable)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 60645353976..e3cac139c08 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -543,11 +543,11 @@ if ($action == 'create') { print '' . $langs->trans("Status") . ''; if (empty($object->validated)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index fbf347a45a9..b218a245c99 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -110,11 +110,11 @@ print ''; print $langs->trans("Required"); /*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; }*/ print "
'; if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "'; - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; print "'; - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; print "
'; - print '('.$langs->trans("DisablePriceByQty").')'; + print '('.$langs->trans("DisablePriceByQty").')'; } else { print $langs->trans("No"); - print '  ('.$langs->trans("Activate").')'; + print '  ('.$langs->trans("Activate").')'; } print '
'; - if ($file['share']) { + if (!empty($file['share'])) { // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file From d20e8798e8f005bbd0a2999c0cf19a84310b1ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Mar 2021 17:14:05 +0100 Subject: [PATCH 069/108] fix warning --- htdocs/contact/perso.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 5c7356fae00..8d2969a1370 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,7 +119,7 @@ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $c $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $helpurl); +llxHeader('', $title, $help_url); $form = new Form($db); From 19079dcae6c69d23198de18b3327f5245184dceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Mar 2021 17:17:08 +0100 Subject: [PATCH 070/108] fix php8 warning --- htdocs/adherents/type.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index a867a884775..25ee4a8e39f 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -43,12 +43,13 @@ $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $search_lastname = GETPOST('search_lastname', 'alpha'); -$search_login = GETPOST('search_login', 'alpha'); -$search_email = GETPOST('search_email', 'alpha'); +$search_login = GETPOST('search_login', 'alpha'); +$search_email = GETPOST('search_email', 'alpha'); $type = GETPOST('type', 'intcomma'); -$status = GETPOST('status', 'alpha'); +$status = GETPOST('status', 'alpha'); +$optioncss = GETPOST('optioncss', 'alpha'); -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); From 65e4acdb82e169ec29f59832c1f42a12953f4c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Mar 2021 17:23:28 +0100 Subject: [PATCH 071/108] fix php8 warnings --- htdocs/adherents/cartes/carte.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index be9c654941a..8d9ed70a925 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -262,7 +262,7 @@ dol_htmloutput_errors($mesg); print '
'; -print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", (!empty($conf->global->ADHERENT_CARD_TYPE) ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; print '
'; print ''; print ''; @@ -275,13 +275,13 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : $conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print '
'; print '

'; -print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", (!empty($conf->global->ADHERENT_CARD_TYPE) ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; print '
'; print ''; print ''; @@ -293,14 +293,14 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : $conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'.$langs->trans("Login").': '; print '
'; print '
'; print '

'; -print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForLabels", (empty($conf->global->ADHERENT_ETIQUETTE_TYPE) ? '' : $conf->global->ADHERENT_ETIQUETTE_TYPE)).' '; print '
'; print ''; print ''; @@ -312,7 +312,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ?GETPOST('modellabel') : $conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ? GETPOST('modellabel') : (empty($conf->global->ADHERENT_ETIQUETTE_TYPE) ? '' : $conf->global->ADHERENT_ETIQUETTE_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print '
'; From 4c5ddc44dc949d9cb6fcc245ec9a7ff46eccac12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Mar 2021 17:58:01 +0100 Subject: [PATCH 072/108] get conf global function --- htdocs/admin/mails.php | 6 +++--- htdocs/core/lib/functions.lib.php | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 1c59d1bb26d..515357df904 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -562,9 +562,9 @@ if ($action == 'edit') { if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { // Force e-mail recipient - print '
'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.$conf->global->MAIN_MAIL_FORCE_SENDTO; - if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) { - if (!isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) { + print '
'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); + if (!empty(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { + if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { print img_warning($langs->trans("ErrorBadEMail")); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e3a218711dd..5151a0a39dc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -41,6 +41,29 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; +/** + * Return dolibarr global constant string value + * @param string $key key to return value, return '' if not set + * @return string + */ +function getDolGlobalString($key) +{ + global $conf; + // return $conf->global->$key ?? ''; + return (string) (empty($conf->global->$key) ? '' : $conf->global->$key); +} + +/** + * Return dolibarr global constant int value + * @param string $key key to return value, return 0 if not set + * @return int + */ +function getDolGlobalInt($key) +{ + global $conf; + // return $conf->global->$key ?? 0; + return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); +} /** * Return a DoliDB instance (database handler). From 85b76cc4dfdf0a7bde00b5d21e04f047b13b9253 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Mar 2021 01:22:09 +0100 Subject: [PATCH 073/108] Fix title --- build/doxygen/doxygen_header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/doxygen/doxygen_header.html b/build/doxygen/doxygen_header.html index 235797bb6c9..f60f4829d76 100644 --- a/build/doxygen/doxygen_header.html +++ b/build/doxygen/doxygen_header.html @@ -2,7 +2,7 @@ -$title +Dolibarr source code documentation Date: Sat, 20 Mar 2021 08:15:05 +0100 Subject: [PATCH 074/108] FIX SQL Error on fresh install --- htdocs/install/mysql/tables/llx_events.sql | 2 +- htdocs/install/mysql/tables/llx_user_clicktodial.sql | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_events.sql b/htdocs/install/mysql/tables/llx_events.sql index 16d65c442ab..82ea0f0eee3 100644 --- a/htdocs/install/mysql/tables/llx_events.sql +++ b/htdocs/install/mysql/tables/llx_events.sql @@ -33,7 +33,7 @@ create table llx_events description varchar(250) NOT NULL, -- full description of action ip varchar(250) NOT NULL, -- ip (must contains ip v4 and v6 or dns names) user_agent varchar(255) NULL, -- user agent - fk_object integer NULL -- id of related object + fk_object integer NULL, -- id of related object authentication_method varchar(64) NULL, -- type of authentication mode used if internal login event fk_oauth_token integer NULL -- id in oauth_token if internal login event done using an oauth_token ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_user_clicktodial.sql b/htdocs/install/mysql/tables/llx_user_clicktodial.sql index d9941a09ab0..878802c9a47 100644 --- a/htdocs/install/mysql/tables/llx_user_clicktodial.sql +++ b/htdocs/install/mysql/tables/llx_user_clicktodial.sql @@ -17,12 +17,12 @@ -- =========================================================================== -- --- Table to store each different IP / devices / puclib key used for login +-- Table to store each different IP / devices / public key used for login -- -create table llx_user_ipdevices +create table llx_user_clicktodial ( rowid integer PRIMARY KEY, fk_user integer NOT NULL, -- ID llx_user ip varchar(64), - user_agent varchar(255) NULL, -- user agent + user_agent varchar(255) NULL -- user agent )ENGINE=innodb; From 0b23ea072be7fb2f2ec17b8664aefd92e573c142 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 20 Mar 2021 08:15:16 +0100 Subject: [PATCH 075/108] FIX SQL Error on fresh install --- htdocs/install/mysql/tables/llx_societe.key.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_societe.key.sql b/htdocs/install/mysql/tables/llx_societe.key.sql index b681343fe38..3a2c9540229 100644 --- a/htdocs/install/mysql/tables/llx_societe.key.sql +++ b/htdocs/install/mysql/tables/llx_societe.key.sql @@ -33,7 +33,7 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_prospectlevel(fk_prospectlevel); ALTER TABLE llx_societe ADD INDEX idx_societe_typent(fk_typent); ALTER TABLE llx_societe ADD INDEX idx_societe_forme_juridique(fk_forme_juridique); ALTER TABLE llx_societe ADD INDEX idx_societe_shipping_method(fk_shipping_method); -ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); +-- ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); -- ALTER TABLE llx_societe ADD FOREIGN KEY fk_prospectlevel llx_c_prospectlevel(code); From e2fcadef4ae227f058b1d17b47e8ae4b0d4475e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Mar 2021 08:59:54 +0100 Subject: [PATCH 076/108] fix nested comments for doxygen --- htdocs/admin/commande.php | 48 ++++++++++++--------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 6fb4430d88e..89363a9027b 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -9,6 +9,7 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2016 Philippe Grand * Copyright (C) 2013 Florian Henry + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -642,7 +643,7 @@ print ''; // Shippable Icon in List /* Kept as hidden feature for the moment, result seems bugged. -Whet is definition of "shippable" according to all different STOCK_CALCULATE_... options ? +Where is definition of "shippable" according to all different STOCK_CALCULATE_... options ? print '
'.$langs->trans("ShippableOrderIconInList").'
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) - { + if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); - } - else - { - if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) - { + } else { + if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - else - { + } else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '.$langs->trans('NotAvailable').'
'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) - { + if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); - } - else - { - if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) - { + } else { + if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - else - { + } else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print '
'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '.$langs->trans('NotAvailable').'
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_DOMAIN; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_DOMAIN'); print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_SELECTOR; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_SELECTOR'); print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY'); print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID_EMAILING.'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING').'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING')).'
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING); + print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING')); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -503,11 +503,9 @@ if ($action == 'edit') { print '
'; /* // Warning 1 - if ($linuxlike) - { + if ($linuxlike) { $sendmailoption=ini_get('mail.force_extra_parameters'); - if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) - { + if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) { print info_admin($langs->trans("SendmailOptionNotComplete")); } }*/