Introduce version on resource link, so no cache effect after upgrading

This commit is contained in:
Laurent Destailleur 2015-11-21 00:52:20 +01:00
parent a79e8d33f1
commit 1bea9917c4

View File

@ -1011,8 +1011,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
else print "<title>".dol_htmlentities($appli)."</title>";
print "\n";
$ext='';
if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION);
//$ext='';
//if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION);
$ext='version='.urlencode(DOL_VERSION);
if (GETPOST('version')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js
if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax)
@ -1268,7 +1269,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
// Global js function
print '<!-- Includes JS of Dolibarr -->'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js'.($ext?'?'.$ext:'').'"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js?version='.urlencode(DOL_VERSION).($ext?'&amp;'.$ext:'').'"></script>'."\n";
// Add datepicker default options
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.($ext?'&amp;'.$ext:'').'"></script>'."\n";