From 25cf36597780bec1110a73ba8ad43b51f63922dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 14:59:11 +0100 Subject: [PATCH] Clean code --- htdocs/awstats/admin/about.php | 2 +- htdocs/awstats/admin/awstats.php | 4 ++-- htdocs/billedonorders/admin/about.php | 2 +- htdocs/billedonorders/admin/billedonorders.php | 3 ++- htdocs/captureserver/captureserver_card.php | 4 ++-- htdocs/concatpdf/admin/about.php | 4 +++- htdocs/ecotaxdeee/admin/index.php | 2 +- htdocs/externalbackup/admin/about.php | 2 +- htdocs/externalbackup/admin/externalbackup.php | 2 +- htdocs/facturxutil/admin/about.php | 2 +- htdocs/filemanager/admin/about.php | 2 +- htdocs/google/index.php | 4 ++-- htdocs/memcached/admin/about.php | 2 +- htdocs/monitoring/admin/about.php | 2 +- htdocs/monitoring/admin/monitoring.php | 10 +++++----- htdocs/mywidgets/admin/about.php | 4 ++-- htdocs/mywidgets/admin/mywidgets.php | 8 +++++--- htdocs/numberwords/admin/about.php | 2 +- htdocs/ovh/admin/about.php | 2 +- htdocs/phpsysinfo/admin/about.php | 2 +- htdocs/phpsysinfo/admin/phpsysinfo.php | 2 +- htdocs/saftpt/admin/saftpt.php | 10 +++++----- htdocs/saftpt/exportsaft.php | 4 ++-- htdocs/selectbank/admin/about.php | 2 +- htdocs/selectbank/admin/selectbank.php | 2 +- htdocs/sendgrid/admin/about.php | 2 +- htdocs/skincoloreditor/admin/about.php | 2 +- htdocs/skincoloreditor/admin/advancededitor.php | 2 +- htdocs/skincoloreditor/admin/quickeditor.php | 2 +- htdocs/tawkto/admin/about.php | 2 +- htdocs/zipautofillfr/admin/about.php | 2 +- htdocs/zipautofillfr/admin/zipautofillfr.php | 2 +- 32 files changed, 52 insertions(+), 47 deletions(-) diff --git a/htdocs/awstats/admin/about.php b/htdocs/awstats/admin/about.php index 377fec14d..77d48d35c 100644 --- a/htdocs/awstats/admin/about.php +++ b/htdocs/awstats/admin/about.php @@ -69,7 +69,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/awstats/core/modules/modAWStats.class.php'); $tmpmodule = new modAWStats($db); diff --git a/htdocs/awstats/admin/awstats.php b/htdocs/awstats/admin/awstats.php index 681a4ec2a..6ee885fca 100644 --- a/htdocs/awstats/admin/awstats.php +++ b/htdocs/awstats/admin/awstats.php @@ -112,10 +112,10 @@ print '
'; -dol_fiche_head($head, 'tabsetup', ''); +dol_fiche_head($head, 'tabsetup', '', -1); -print ""; +print "
"; $var=true; print ""; diff --git a/htdocs/billedonorders/admin/about.php b/htdocs/billedonorders/admin/about.php index 668e9f2c8..f6c5ba74f 100644 --- a/htdocs/billedonorders/admin/about.php +++ b/htdocs/billedonorders/admin/about.php @@ -71,7 +71,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/billedonorders/core/modules/modBilledOnOrders.class.php'); $tmpmodule = new modBilledOnOrders($db); diff --git a/htdocs/billedonorders/admin/billedonorders.php b/htdocs/billedonorders/admin/billedonorders.php index 334ab69d1..9df7ed80b 100755 --- a/htdocs/billedonorders/admin/billedonorders.php +++ b/htdocs/billedonorders/admin/billedonorders.php @@ -91,6 +91,7 @@ clearstatcache(); +$head = array(); $h=0; $head[$h][0] = $_SERVER["PHP_SELF"]; @@ -108,7 +109,7 @@ print ''; print ''; -dol_fiche_head($head, 'tabsetup', ''); +dol_fiche_head($head, 'tabsetup', '', -1); //print $langs->trans("BilledOnOrdersNothingToSetup"); $var=true; diff --git a/htdocs/captureserver/captureserver_card.php b/htdocs/captureserver/captureserver_card.php index 0b9ccc3d6..16c57e409 100644 --- a/htdocs/captureserver/captureserver_card.php +++ b/htdocs/captureserver/captureserver_card.php @@ -187,7 +187,7 @@ function init_myfunc() print ''; print ''; - dol_fiche_head(array(), ''); + dol_fiche_head(array(), '', '', -1); print '
'."\n"; @@ -220,7 +220,7 @@ function init_myfunc() print ''; print ''; - dol_fiche_head(); + dol_fiche_head(array(), '', '', -1); print '
'."\n"; diff --git a/htdocs/concatpdf/admin/about.php b/htdocs/concatpdf/admin/about.php index 4a9fad577..c4ac53b7e 100644 --- a/htdocs/concatpdf/admin/about.php +++ b/htdocs/concatpdf/admin/about.php @@ -57,6 +57,8 @@ $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("ConcatPdfSetup"), $linkback, 'setup'); +$head = array(); + $h=0; $head[$h][0] = 'concatpdf.php'; $head[$h][1] = $langs->trans("Setup"); @@ -68,7 +70,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/concatpdf/core/modules/modConcatPdf.class.php'); $tmpmodule = new modConcatPdf($db); diff --git a/htdocs/ecotaxdeee/admin/index.php b/htdocs/ecotaxdeee/admin/index.php index 2963988bb..3b72f8826 100644 --- a/htdocs/ecotaxdeee/admin/index.php +++ b/htdocs/ecotaxdeee/admin/index.php @@ -109,7 +109,7 @@ print ''; -dol_fiche_head($head, 'tabsetup', '', (((float) DOL_VERSION < 6) ? 0 : -1)); +dol_fiche_head($head, 'tabsetup', '', -1); $elements=''; diff --git a/htdocs/externalbackup/admin/about.php b/htdocs/externalbackup/admin/about.php index 8d334c477..e39f39197 100644 --- a/htdocs/externalbackup/admin/about.php +++ b/htdocs/externalbackup/admin/about.php @@ -72,7 +72,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/externalbackup/core/modules/modExternalBackup.class.php'); $tmpmodule = new modExternalBackup($db); diff --git a/htdocs/externalbackup/admin/externalbackup.php b/htdocs/externalbackup/admin/externalbackup.php index f8d188155..5280e31ca 100755 --- a/htdocs/externalbackup/admin/externalbackup.php +++ b/htdocs/externalbackup/admin/externalbackup.php @@ -122,7 +122,7 @@ print ''; print ''; -dol_fiche_head($head, 'tabsetup'); +dol_fiche_head($head, 'tabsetup', '', -1); print '
'; diff --git a/htdocs/facturxutil/admin/about.php b/htdocs/facturxutil/admin/about.php index e6e00f413..b2c6e8cd0 100644 --- a/htdocs/facturxutil/admin/about.php +++ b/htdocs/facturxutil/admin/about.php @@ -57,7 +57,7 @@ $head = facturxUtilAdminPrepareHead(); -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/facturxutil/core/modules/modFacturXUtil.class.php'); $tmpmodule = new modFacturXUtil($db); diff --git a/htdocs/filemanager/admin/about.php b/htdocs/filemanager/admin/about.php index 6a17f5051..623ec5452 100644 --- a/htdocs/filemanager/admin/about.php +++ b/htdocs/filemanager/admin/about.php @@ -68,7 +68,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/filemanager/core/modules/modFileManager.class.php'); $tmpmodule = new modFileManager($db); diff --git a/htdocs/google/index.php b/htdocs/google/index.php index 39298d612..e602b0ce5 100644 --- a/htdocs/google/index.php +++ b/htdocs/google/index.php @@ -136,8 +136,8 @@ $finaltext=''; -$found=0; -$MAXAGENDA=empty($conf->global->GOOGLE_AGENDA_NB)?5:$conf->global->GOOGLE_AGENDA_NB; +$found = 0; +$MAXAGENDA = getDolGlobalInt('GOOGLE_AGENDA_NB', 5); $i=1; while ($i <= $MAXAGENDA) { diff --git a/htdocs/memcached/admin/about.php b/htdocs/memcached/admin/about.php index cffb1ed92..4399f81c8 100644 --- a/htdocs/memcached/admin/about.php +++ b/htdocs/memcached/admin/about.php @@ -61,7 +61,7 @@ $head=memcached_prepare_head(); -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/memcached/core/modules/modMemcached.class.php'); $tmpmodule = new modMemcached($db); diff --git a/htdocs/monitoring/admin/about.php b/htdocs/monitoring/admin/about.php index f69faa7f1..7a5d687eb 100644 --- a/htdocs/monitoring/admin/about.php +++ b/htdocs/monitoring/admin/about.php @@ -69,7 +69,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/monitoring/core/modules/modMonitoring.class.php'); $tmpmodule = new modMonitoring($db); diff --git a/htdocs/monitoring/admin/monitoring.php b/htdocs/monitoring/admin/monitoring.php index 1d0b972d2..5caaa6ced 100755 --- a/htdocs/monitoring/admin/monitoring.php +++ b/htdocs/monitoring/admin/monitoring.php @@ -206,12 +206,13 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tabsetup', ''); +dol_fiche_head($head, 'tabsetup', '', -1); print ''; -print "
"; -$var=true; +print ''; + +print "
"; print ""; print ""; @@ -219,8 +220,7 @@ print ""; print ""; -$var=!$var; -print ""; +print ""; print ""; print ""; print ''; - + print '
".$langs->trans("Parameter")."".$langs->trans("Examples")."
".$langs->trans("MONITORING_COMMANDLINE_TOOL")."global->MONITORING_COMMANDLINE_TOOL) . "\" size=\"50\">/usr/bin/rrdtool
diff --git a/htdocs/mywidgets/admin/about.php b/htdocs/mywidgets/admin/about.php index 668e9f2c8..07504e473 100644 --- a/htdocs/mywidgets/admin/about.php +++ b/htdocs/mywidgets/admin/about.php @@ -61,7 +61,7 @@ print '
'; $h=0; -$head[$h][0] = 'billedonorders.php'; +$head[$h][0] = 'mywidgets.php'; $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'tabsetup'; $h++; @@ -71,7 +71,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/billedonorders/core/modules/modBilledOnOrders.class.php'); $tmpmodule = new modBilledOnOrders($db); diff --git a/htdocs/mywidgets/admin/mywidgets.php b/htdocs/mywidgets/admin/mywidgets.php index 334ab69d1..dbdd4f6bc 100755 --- a/htdocs/mywidgets/admin/mywidgets.php +++ b/htdocs/mywidgets/admin/mywidgets.php @@ -83,10 +83,12 @@ $form=new Form($db); $formfile=new FormFile($db); -llxHeader('', 'billedonorders', $linktohelp); +$linktohelp = ''; + +llxHeader('', 'mywidgets', $linktohelp); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("BilledOnOrdersSetup"), $linkback, 'setup'); +print_fiche_titre($langs->trans("Setup"), $linkback, 'setup'); print '
'; clearstatcache(); @@ -108,7 +110,7 @@ print ''; print ''; -dol_fiche_head($head, 'tabsetup', ''); +dol_fiche_head($head, 'tabsetup', '', -1); //print $langs->trans("BilledOnOrdersNothingToSetup"); $var=true; diff --git a/htdocs/numberwords/admin/about.php b/htdocs/numberwords/admin/about.php index 77b0e7b46..a69d997c5 100644 --- a/htdocs/numberwords/admin/about.php +++ b/htdocs/numberwords/admin/about.php @@ -70,7 +70,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/numberwords/core/modules/modNumberWords.class.php'); $tmpmodule = new modNumberWords($db); diff --git a/htdocs/ovh/admin/about.php b/htdocs/ovh/admin/about.php index 59fda3144..329426d92 100644 --- a/htdocs/ovh/admin/about.php +++ b/htdocs/ovh/admin/about.php @@ -61,7 +61,7 @@ $head=ovhadmin_prepare_head(); -dol_fiche_head($head, 'tababout', $langs->trans("Ovh")); +dol_fiche_head($head, 'tababout', $langs->trans("Ovh"), -1); dol_include_once('/ovh/core/modules/modOvh.class.php'); $tmpmodule = new modOvh($db); diff --git a/htdocs/phpsysinfo/admin/about.php b/htdocs/phpsysinfo/admin/about.php index 71a5d49ac..7cd596f6a 100644 --- a/htdocs/phpsysinfo/admin/about.php +++ b/htdocs/phpsysinfo/admin/about.php @@ -68,7 +68,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/phpsysinfo/core/modules/modPHPSysInfo.class.php'); $tmpmodule = new modPHPSysInfo($db); diff --git a/htdocs/phpsysinfo/admin/phpsysinfo.php b/htdocs/phpsysinfo/admin/phpsysinfo.php index 62274dad4..b56845f37 100755 --- a/htdocs/phpsysinfo/admin/phpsysinfo.php +++ b/htdocs/phpsysinfo/admin/phpsysinfo.php @@ -88,7 +88,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tabsetup', ''); +dol_fiche_head($head, 'tabsetup', '', -1); print $langs->trans("phpsysinfoNothingToSetup"); diff --git a/htdocs/saftpt/admin/saftpt.php b/htdocs/saftpt/admin/saftpt.php index da85c532d..1e5bfcd08 100644 --- a/htdocs/saftpt/admin/saftpt.php +++ b/htdocs/saftpt/admin/saftpt.php @@ -44,10 +44,10 @@ //set constant in table llx_const $taxexemption = GETPOST('taxexemption_code','alpha'); - + $res=dolibarr_set_const($db, "TAX_EXEMPTION_REASON",$taxexemption,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - + if (! $error) { $db->commit(); @@ -66,7 +66,7 @@ */ $formtaxexemption = new FormSaftPt($db); - + llxHeader('',$langs->trans("SaftSetup")); $linkback=''.$langs->trans("BackToModuleList").''; @@ -80,7 +80,7 @@ $hselected=$h; $h++; -dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"), -1); print '
'; print ''; @@ -104,7 +104,7 @@ if (empty($conf->global->TAX_EXEMPTION_REASON)) print ' '.img_warning($langs->trans("TaxExemptionEmpty")); print '
'; print '
'; diff --git a/htdocs/saftpt/exportsaft.php b/htdocs/saftpt/exportsaft.php index 1ecac707e..6bf5d12b3 100644 --- a/htdocs/saftpt/exportsaft.php +++ b/htdocs/saftpt/exportsaft.php @@ -115,7 +115,7 @@ $head[$h][1] = $langs->trans("Step")." 1"; $hselected=$h; $h++; - dol_fiche_head($head, $hselected, $langs->trans("MenuSaft")); + dol_fiche_head($head, $hselected, $langs->trans("MenuSaft"), -1); // Security check if(!$user->hasRight('saftpt', 'exesaftpt', 'write')) { @@ -248,7 +248,7 @@ $hselected=$h; $h++; - dol_fiche_head($head, $hselected, $langs->trans("MenuSaft")); + dol_fiche_head($head, $hselected, $langs->trans("MenuSaft"), -1); print $langs->trans("PeriodOf").' '.dol_print_date($date_ini, '%Y-%m-%d'). ' '. $langs->trans("PeriodTo"). ' '.dol_print_date($date_fim, '%Y-%m-%d').'
'; print $langs->trans("TaxExemptionDef").': '.$saft->taxexemption.'
'; diff --git a/htdocs/selectbank/admin/about.php b/htdocs/selectbank/admin/about.php index 9204a931b..53501244f 100644 --- a/htdocs/selectbank/admin/about.php +++ b/htdocs/selectbank/admin/about.php @@ -68,7 +68,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/selectbank/core/modules/modSelectBank.class.php'); $tmpmodule = new modSelectBank($db); diff --git a/htdocs/selectbank/admin/selectbank.php b/htdocs/selectbank/admin/selectbank.php index 2f433f598..fa1da9187 100755 --- a/htdocs/selectbank/admin/selectbank.php +++ b/htdocs/selectbank/admin/selectbank.php @@ -88,7 +88,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tabsetup', ''); +dol_fiche_head($head, 'tabsetup', '', -1); print $langs->trans("SelectBankNothingToSetup"); diff --git a/htdocs/sendgrid/admin/about.php b/htdocs/sendgrid/admin/about.php index 4b93c92e8..c04910da5 100644 --- a/htdocs/sendgrid/admin/about.php +++ b/htdocs/sendgrid/admin/about.php @@ -61,7 +61,7 @@ $head=sendgridadmin_prepare_head(); -dol_fiche_head($head, 'tababout', $langs->trans("SendGrid")); +dol_fiche_head($head, 'tababout', $langs->trans("SendGrid"), -1); dol_include_once('/sendgrid/core/modules/modSendGrid.class.php'); $tmpmodule = new modSendGrid($db); diff --git a/htdocs/skincoloreditor/admin/about.php b/htdocs/skincoloreditor/admin/about.php index 5ce9ba5c1..869f523e6 100644 --- a/htdocs/skincoloreditor/admin/about.php +++ b/htdocs/skincoloreditor/admin/about.php @@ -74,7 +74,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/skincoloreditor/core/modules/modSkinColorEditor.class.php'); $tmpmodule = new modSkinColorEditor($db); diff --git a/htdocs/skincoloreditor/admin/advancededitor.php b/htdocs/skincoloreditor/admin/advancededitor.php index 10cd68792..d557b6052 100755 --- a/htdocs/skincoloreditor/admin/advancededitor.php +++ b/htdocs/skincoloreditor/admin/advancededitor.php @@ -129,7 +129,7 @@ $head[$h][2] = 'advancededitor'; $h++; - dol_fiche_head($head, 'advancededitor'); + dol_fiche_head($head, 'advancededitor', '', -1); print $langs->trans("FeatureNotYetAvailable"); diff --git a/htdocs/skincoloreditor/admin/quickeditor.php b/htdocs/skincoloreditor/admin/quickeditor.php index 20540ff59..368a56687 100755 --- a/htdocs/skincoloreditor/admin/quickeditor.php +++ b/htdocs/skincoloreditor/admin/quickeditor.php @@ -137,7 +137,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'fasteditor'); +dol_fiche_head($head, 'fasteditor', '', -1); print '
'; diff --git a/htdocs/tawkto/admin/about.php b/htdocs/tawkto/admin/about.php index b025f7c3a..2717e26fe 100644 --- a/htdocs/tawkto/admin/about.php +++ b/htdocs/tawkto/admin/about.php @@ -68,7 +68,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', ''); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/tawkto/core/modules/modTawkTo.class.php'); $tmpmodule = new modTawkTo($db); diff --git a/htdocs/zipautofillfr/admin/about.php b/htdocs/zipautofillfr/admin/about.php index 11cc060ad..06267290e 100644 --- a/htdocs/zipautofillfr/admin/about.php +++ b/htdocs/zipautofillfr/admin/about.php @@ -73,7 +73,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tababout', '', (((float) DOL_VERSION < 7.0) ? 0 : -1)); +dol_fiche_head($head, 'tababout', '', -1); dol_include_once('/zipautofillfr/core/modules/modZipAutoFillFr.class.php'); $tmpmodule = new modZipAutoFillFr($db); diff --git a/htdocs/zipautofillfr/admin/zipautofillfr.php b/htdocs/zipautofillfr/admin/zipautofillfr.php index 7a1a1a149..68112a628 100755 --- a/htdocs/zipautofillfr/admin/zipautofillfr.php +++ b/htdocs/zipautofillfr/admin/zipautofillfr.php @@ -121,7 +121,7 @@ $head[$h][2] = 'tababout'; $h++; -dol_fiche_head($head, 'tabsetup', '', (((float) DOL_VERSION < 7.0) ? 0 : -1)); +dol_fiche_head($head, 'tabsetup', '', -1); print '
';