From 325c2b03f839044b27fd185193e481b9ce5b0329 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 29 Dec 2020 16:43:41 +0100 Subject: [PATCH] FIX step by step --- htdocs/admin/accountant.php | 24 ++++++++--------- htdocs/admin/company_socialnetworks.php | 6 ++--- htdocs/admin/modules.php | 26 ++++++++++++++----- htdocs/admin/openinghours.php | 14 +++++----- htdocs/core/modules/DolibarrModules.class.php | 1 + htdocs/core/modules/modStock.class.php | 2 +- htdocs/includes/parsedown/Parsedown.php | 2 +- 7 files changed, 45 insertions(+), 30 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 7a1d5b66ece..c8fccb6073d 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -114,57 +114,57 @@ print ''.$langs->trans( // Name print ''; -print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>'."\n"; +print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>'."\n"; // Address print ''; -print ''."\n"; +print ''."\n"; print ''; -print ''."\n"; +print ''."\n"; print ''; -print ''."\n"; +print ''."\n"; // Country print ''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); -print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); +print $form->select_country((!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : GETPOST('country_id', 'int')), 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''."\n"; print ''; -$formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); +$formcompany->select_departement((!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : GETPOST('state_id', 'alpha')), (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : GETPOST('country_id', 'int')), 'state_id'); print ''."\n"; print ''; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; print ''; print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; print ''; print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; // Web print ''; print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; // Code print ''; -print ''."\n"; +print ''."\n"; // Note print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 5cbdb948b4a..93c6739d37d 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -117,11 +117,11 @@ foreach ($listofnetworks as $key => $value) { $networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL'; $networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key); print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''.dol_print_socialnetworks($conf->global->$networkconstid, 0, 0, $key, $listofnetworks).''; + print ''.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : ''), 0, 0, $key, $listofnetworks).''; print ''."\n"; } } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index e9984316394..4fc07fa1172 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -497,13 +497,19 @@ if ($mode == 'common' || $mode == 'commonkanban') { dol_set_focus('#search_keyword'); print '
'; - if ($optioncss != '') { + print ''; + if (isset($optioncss) && $optioncss != '') { print ''; } - print ''; - print ''; - print ''; - print ''; + if (isset($sortfield) && $sortfield != '') { + print ''; + } + if (isset($sortorder) && $sortorder != '') { + print ''; + } + if (isset($page) && $page != '') { + print ''; + } print ''; print dol_get_fiche_head($head, 'modules', '', -1); @@ -1001,7 +1007,7 @@ if ($mode == 'marketplace') {
- get_products($categorie); ?> + get_products(!empty($categorie) ? $categorie: ''); ?>
@@ -1082,28 +1088,36 @@ if ($mode == 'deploy') { $max = $conf->global->MAIN_UPLOAD_DOC; // In Kb $maxphp = @ini_get('upload_max_filesize'); // In unknown if (preg_match('/k$/i', $maxphp)) { + $maxphp = preg_replace('/k$/i', '', $maxphp); $maxphp = $maxphp * 1; } if (preg_match('/m$/i', $maxphp)) { + $maxphp = preg_replace('/m$/i', '', $maxphp); $maxphp = $maxphp * 1024; } if (preg_match('/g$/i', $maxphp)) { + $maxphp = preg_replace('/g$/i', '', $maxphp); $maxphp = $maxphp * 1024 * 1024; } if (preg_match('/t$/i', $maxphp)) { + $maxphp = preg_replace('/t$/i', '', $maxphp); $maxphp = $maxphp * 1024 * 1024 * 1024; } $maxphp2 = @ini_get('post_max_size'); // In unknown if (preg_match('/k$/i', $maxphp2)) { + $maxphp2 = preg_replace('/k$/i', '', $maxphp2); $maxphp2 = $maxphp2 * 1; } if (preg_match('/m$/i', $maxphp2)) { + $maxphp2 = preg_replace('/m$/i', '', $maxphp2); $maxphp2 = $maxphp2 * 1024; } if (preg_match('/g$/i', $maxphp2)) { + $maxphp2 = preg_replace('/g$/i', '', $maxphp2); $maxphp2 = $maxphp2 * 1024 * 1024; } if (preg_match('/t$/i', $maxphp2)) { + $maxphp2 = preg_replace('/t$/i', '', $maxphp2); $maxphp2 = $maxphp2 * 1024 * 1024 * 1024; } // Now $max and $maxphp and $maxphp2 are in Kb diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index c3cbcb3d0ae..d50be27e97b 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -95,37 +95,37 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') print ''; print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>'."\n"; + print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>'."\n"; print ''; print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print ''."\n"; + print ''."\n"; print ''; print $form->textwithpicto($langs->trans("Wednesday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print ''."\n"; + print ''."\n"; print ''; print $form->textwithpicto($langs->trans("Thursday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print ''."\n"; + print ''."\n"; print ''; print $form->textwithpicto($langs->trans("Friday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print ''."\n"; + print ''."\n"; print ''; print $form->textwithpicto($langs->trans("Saturday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print ''."\n"; + print ''."\n"; print ''; print $form->textwithpicto($langs->trans("Sunday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print ''."\n"; + print ''."\n"; print ''; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 510ec8ef55a..cfcb85054d2 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -622,6 +622,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + $content=''; $pathoffile = $this->getDescLongReadmeFound(); if ($pathoffile) // Mostly for external modules diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 1e36bcb66ff..5ae6688a31f 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -327,7 +327,7 @@ class modStock extends DolibarrModules 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product' ); // We define here only fields that use another icon that the one defined into export_icon - if ($conf->productbatch->enabled) + if (!empty($conf->productbatch->enabled)) { $this->export_fields_array[$r]['sm.batch'] = 'Batch'; $this->export_TypeFields_array[$r]['sm.batch'] = 'Text'; diff --git a/htdocs/includes/parsedown/Parsedown.php b/htdocs/includes/parsedown/Parsedown.php index df718bce111..cc110c318c8 100644 --- a/htdocs/includes/parsedown/Parsedown.php +++ b/htdocs/includes/parsedown/Parsedown.php @@ -1182,7 +1182,7 @@ class Parsedown 'src' => $Link['element']['attributes']['href'], 'alt' => $Link['element']['text'], // @CHANGE LDR - 'class' => $Link['element']['attributes']['class'] + 'class' => (!empty($Link['element']['attributes']['class']) ? $Link['element']['attributes']['class'] : '') ), ), );