Histo prêts : ajout bouton détails + navigation + mutualisation js

This commit is contained in:
Jean-Christophe Engel 2025-10-29 14:20:58 +01:00
parent 65ee10453c
commit 572dfc172a
8 changed files with 86 additions and 34 deletions

View file

@ -222,7 +222,12 @@
transactions=$transactions
return_date=$return_date|parse_date
}}
{{:redirect force="../equipment_history.html?ok=1&key=%s&prop=%s&msg=modification"|args:$eqpmt_key:$prop}}
{{if $_GET.from == "lh"}}
{{:assign from="../loan_history.html"}}
{{else}}
{{:assign from="../equipment_history.html"}}
{{/if}}
{{:redirect force="%s?ok=1&key=%s&prop=%s&msg=modification"|args:$from:$eqpmt_key:$prop}}
{{/form}}
{{if $mvt_new.direction == "input"}}
@ -231,8 +236,8 @@
{{:assign mvt_label="sortie"}}
{{/if}}
{{:admin_header title="Modifier une %s"|args:$mvt_label custom_css="./../style.css" current="module_equipment"}}
{{:form_errors}}
{{:form_errors}}
{{*
-------------------- Préparer la saisie --------------------
*}}
@ -338,11 +343,9 @@ function changeVisibility(evt, idcheck = 'f_set_return_date_1', fields = ['div_r
toggleVisibility(idcheck, fields);
}
function changeReturnDate(evt, id_date = 'f_date', id_return_date = 'f_return_date', id_loan_duration='loan_duration') {
const loan_duration = document.getElementById(id_loan_duration).value;
let nbsec = getDate(id_date) + loan_duration*24*60*60;
const date_retour = new Date(nbsec * 1000);
document.getElementById(id_return_date).value = date_retour.toLocaleDateString();
function changeReturnDate(evt, id_date = 'f_date', id_return_date = 'f_return_date', id_loan_duration='loan_duration')
{
setReturnDate(id_date, id_return_date, id_loan_duration);
}
(function () {