Aggiunta variabile random per evitare la cache del browser

in fase di link pdf o anteprima stampa
This commit is contained in:
Luca 2024-01-26 12:34:14 +01:00
parent 921fc0ad98
commit fbdd4f4587
2 changed files with 3 additions and 3 deletions

View File

@ -143,7 +143,7 @@ if (!empty($sessioni)) {
// ORE
echo '
<td style="border-right:1px solid #aaa;">'.($ore <= 0 ? '<i title="'.tr('Questa sessione non ha una durata valida.').'" class="fa fa-warning tip text-warning"></i>' : '').'
<td style="border-right:1px solid #aaa;">'.(((\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_inizio'])->eq(\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_fine']))) || (\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_inizio'])->gt(\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_fine'])))) ? '<i title="'.tr('Questa sessione non ha una durata valida.').'" class="fa fa-warning tip text-warning"></i>' : '').'
</td>
<td style="border-right:1px solid #aaa;">
{[ "type": "number", "name": "ore_'.$sessione['id'].'", "required": 1, "value": "'.numberFormat($ore, 'qta').'", "disabled": "1" ]}

View File

@ -260,7 +260,7 @@ class Prints
{
$info = self::render($print, $id_record, $directory);
return self::getPDFLink($info['path']);
return self::getPDFLink($info['path'].'?'.rand());
}
/**
@ -272,7 +272,7 @@ class Prints
*/
public static function getPDFLink($path)
{
return base_path().'/assets/dist/pdfjs/web/viewer.html?file='.base_url().'/'.ltrim(str_replace(base_dir(), '', $path), '/');
return base_path().'/assets/dist/pdfjs/web/viewer.html?file='.base_url().'/'.ltrim(str_replace(base_dir(), '', $path.'?'.rand()), '/');
}
/**