Skip to content

Commit e0494b8

Browse files
committed
Merge branch 'develop' of [email protected]:Dolibarr/dolibarr.git into
develop
2 parents 65ba6c7 + a121e52 commit e0494b8

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

htdocs/core/class/html.form.class.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -934,9 +934,10 @@ function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of pa
934934
* @param int<0,1> $addspecialentries 1=Add dedicated entries for group of countries (like 'European Economic Community', ...)
935935
* @param string[] $exclude_country_code Array of country code (iso2) to exclude
936936
* @param int<0,1> $hideflags Hide flags
937+
* @param int<0,1> $forcecombo Force to load all values and output a standard combobox (with no beautification)
937938
* @return string HTML string with select
938939
*/
939-
public function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0, $exclude_country_code = array(), $hideflags = 0)
940+
public function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0, $exclude_country_code = array(), $hideflags = 0, $forcecombo = 0)
940941
{
941942
// phpcs:enable
942943
global $conf, $langs, $mysoc;
@@ -1048,8 +1049,10 @@ public function select_country($selected = '', $htmlname = 'country_id', $htmlop
10481049
}
10491050

10501051
// Make select dynamic
1051-
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1052-
$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1052+
if (empty($forcecombo)) {
1053+
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1054+
$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1055+
}
10531056

10541057
return $out;
10551058
}
@@ -1077,7 +1080,7 @@ public function select_incoterms($selected = '', $location_incoterms = '', $page
10771080
$langs->load("dict");
10781081

10791082
$out = '';
1080-
$moreattrib = '';
1083+
//$moreattrib = '';
10811084
$incotermArray = array();
10821085

10831086
$sql = "SELECT rowid, code";
@@ -1130,7 +1133,7 @@ public function select_incoterms($selected = '', $location_incoterms = '', $page
11301133

11311134
if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
11321135
$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1133-
$moreattrib .= ' autocomplete="off"';
1136+
//$moreattrib .= ' autocomplete="off"';
11341137
}
11351138
$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
11361139

htdocs/core/lib/website2.lib.php

+11-6
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,23 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
302302

303303
// Add manifest.json. Do we have to add it only on home page ?
304304
$tplcontent .= '<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'."\n";
305-
$tplcontent .= '<!-- Include link to CSS file -->'."\n";
306-
// Add js
307-
$tplcontent .= '<link rel="stylesheet" href="/styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
308-
$tplcontent .= '<!-- Include link to JS file -->'."\n";
309-
$tplcontent .= '<script nonce="'.getNonce().'" async src="/javascript.js.php?website=<?php echo $websitekey; ?>"></script>'."\n";
310-
// Add headers
305+
306+
// Add HTML headers (must be before the Add of the common CSS and js). The common js may content javascript using jquery or a framework loaded by the HTML header.
311307
$tplcontent .= '<!-- Include HTML header from common file -->'."\n";
312308
$tplcontent .= '<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; ?>'."\n";
313309
$tplcontent .= '<!-- Include HTML header from page header block -->'."\n";
314310
$tplcontent .= preg_replace('/<\/?html>/ims', '', $objectpage->htmlheader)."\n";
311+
312+
// Add css
313+
$tplcontent .= '<!-- Include link to common CSS file -->'."\n";
314+
$tplcontent .= '<link rel="stylesheet" href="/styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
315+
316+
// Add js
317+
$tplcontent .= '<!-- Include link to common JS file -->'."\n";
318+
$tplcontent .= '<script nonce="'.getNonce().'" async src="/javascript.js.php?website=<?php echo $websitekey; ?>"></script>'."\n";
315319
$tplcontent .= '</head>'."\n";
316320

321+
// Page content
317322
$tplcontent .= '<!-- File content defined in Dolibarr website module editor -->'."\n";
318323
$tplcontent .= '<body id="bodywebsite" class="bodywebsite bodywebpage-'.$objectpage->ref.'">'."\n";
319324
$tplcontent .= $objectpage->content."\n";

htdocs/core/tpl/contacts.tpl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224

225225
// Prepare list
226226

227-
// TODO: replace this with 1 single direct SQL (for both eyernal and external string to use $db->sort($sortfield, $sortorder)
227+
// TODO: replace this with 1 single direct SQL (for both internal and external string to use $db->sort($sortfield, $sortorder)
228228
$list = array();
229229
foreach (array('internal', 'external') as $source) {
230230
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) {

htdocs/website/samples/wrapper.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@
129129
$original_file = str_replace("../", "/", $original_file);
130130

131131
// Cache or not
132-
if (GETPOST("cache", 'aZ09') || image_format_supported($original_file) >= 0) {
132+
$cachestring = GETPOST("cache", 'aZ09'); // May be 1, or an int, or a hash
133+
if ($cachestring || image_format_supported($original_file) >= 0) {
133134
// Important: Following code is to avoid page request by browser and PHP CPU at
134135
// each Dolibarr page access.
135-
header('Cache-Control: max-age=3600, public, must-revalidate');
136+
header('Cache-Control: max-age='.((is_numeric($cachestring) && (int) $cachestring > 1 && (int) $cachestring < 999999) ? $cachestring : '3600').', public, must-revalidate');
136137
header('Pragma: cache'); // This is to avoid having Pragma: no-cache
137138
}
138139

0 commit comments

Comments
 (0)