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

@ -205,7 +205,12 @@
transactions=$transactions
return_date=$return_date|parse_date
}}
{{:redirect force="../equipment_history.html?ok=1&key=%s&prop=%s&msg=copie"|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=copie"|args:$from:$eqpmt_key:$prop}}
{{/form}}
{{if $mvt_new.direction == "input"}}
@ -292,6 +297,7 @@
{{:input id="set_return_date" type="checkbox" value=1 name="set_return_date" label="Fixer une date de retour" help="Cocher pour fixer une date de retour" checked="%s"|args:$checked}}
<div id="div_return_date" style="visibility:{{$visibility}}">
{{:input type="date" name="return_date" label="Date de retour" default=$return_date}}
<input type="hidden" id="loan_duration" name="loan_duration" value="{{$loan_duration}}">
</div>
{{/if}}
</dl>
@ -311,7 +317,13 @@ 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')
{
setReturnDate(id_date, id_return_date, id_loan_duration);
}
(function () {
document.getElementById('f_set_return_date_1').onclick = changeVisibility;
document.getElementById('f_date').onchange = changeReturnDate;
})();
</script>