diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a5aae13bf76..52d4519caea 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -265,7 +265,7 @@ class FormFile } if (getDolGlobalString('MAIN_UPLOAD_DOC')) { - if ($perm) { + if ($perm && empty($conf->dol_optimize_smallscreen)) { $langs->load('other'); $menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Security"); diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 1dd88cc04d6..fc793f5cf2a 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -12,7 +12,7 @@ WEBSITE_ALIASALTDesc=Use here list of other name/aliases so the page can also be WEBSITE_CSS_URL=URL of external CSS file WEBSITE_CSS_INLINE=CSS file content (common to all pages) WEBSITE_JS_INLINE=JavaScript file content (common to all pages) -WEBSITE_HTML_HEADER=Addition at bottom of HTML Header (common to all pages) +WEBSITE_HTML_HEADER=HTML Header (common to all pages) WEBSITE_ROBOT=Robot file (robots.txt) WEBSITE_HTACCESS=Website .htaccess file WEBSITE_MANIFEST_JSON=Website manifest.json file diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index e59490448bb..d41460f4028 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -12,7 +12,7 @@ WEBSITE_ALIASALTDesc=Utilisez ici la liste des autres noms / alias afin que la p WEBSITE_CSS_URL=URL du fichier de la feuille de style (CSS) externe WEBSITE_CSS_INLINE=Contenu du fichier CSS (commun à toute les pages) WEBSITE_JS_INLINE=Contenu du fichier JavaScript (commun à toutes les pages) -WEBSITE_HTML_HEADER=Ajout en bas de l'en-tête HTML (commun à toutes les pages) +WEBSITE_HTML_HEADER=En-tête HTML (commun à toutes les pages) WEBSITE_ROBOT=Fichier robot (robots.txt) WEBSITE_HTACCESS=Fichier .htaccess du site web WEBSITE_MANIFEST_JSON=Fichier manifest.json de site Web diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b3311f24be7..38976910f29 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1619,7 +1619,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if ($type == 1) { print ''.$langs->trans("Duration").''; print img_picto('', 'clock', 'class="pictofixedwidth"'); - print ''; + print ''; print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_unit') ? GETPOST('duration_unit', 'alpha') : 'h'), 0, 1); // Mandatory period @@ -2246,7 +2246,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if ($object->isService()) { // Duration print ''.$langs->trans("Duration").''; - print ' '; + print ' '; print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1); // Mandatory period diff --git a/htdocs/website/index.php b/htdocs/website/index.php index aff05a8bd9c..905d4ed6c2a 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1772,13 +1772,17 @@ if ($action == 'updatecss' && $usercanedit) { $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages if (!$errorphpcheck) { - $htaccesscontent = ''; - $htaccesscontent .= $dataposted."\n"; + if ($dataposted) { + $htaccesscontent = ''; + $htaccesscontent .= $dataposted."\n"; - $result = dolSaveHtaccessFile($filehtaccess, $htaccesscontent); - if (!$result) { - $error++; - setEventMessages('Failed to write file '.$filehtaccess, null, 'errors'); + $result = dolSaveHtaccessFile($filehtaccess, $htaccesscontent); + if (!$result) { + $error++; + setEventMessages('Failed to write file '.$filehtaccess, null, 'errors'); + } + } else { + dol_delete_file($filehtaccess, 0, 0); } } else { $error++; @@ -3868,10 +3872,6 @@ if ($action == 'editcss') { } else { $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " } - if (!trim($htaccesscontent)) { - $htaccesscontent .= "# Order allow,deny\n"; - $htaccesscontent .= "# Deny from all\n"; - } if (!GETPOSTISSET('WEBSITE_MANIFEST_JSON')) { $manifestjsoncontent = @file_get_contents($filemanifestjson); @@ -4034,7 +4034,13 @@ if ($action == 'editcss') { // .htaccess print ''; - print $langs->trans('WEBSITE_HTACCESS'); + + $textwithhelp3 = $langs->trans("Example"); + $textwithhelp3 .= "
# Order allow,deny\n"; + $textwithhelp3 .= "
# Deny from all\n"; + $textwithhelp3 .= "
# Require all granted\n"; + + print $form->textwithpicto($langs->trans('WEBSITE_HTACCESS'), $textwithhelp3, 1, 'help', '', 0, 2, 'htmlheadertooltip3'); print ''; $poscursor = array('x' => GETPOST('WEBSITE_HTACCESS_x'), 'y' => GETPOST('WEBSITE_HTACCESS_y'));