Skip to content

Commit 88289b3

Browse files
committed
fix: #1758 selezione data in aggiunta danno plugin Danni in Automezzi
1 parent 695c464 commit 88289b3

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

plugins/automezzi_danni/modals/manage_danno.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
4646
<div class="row">
4747
<div class="col-md-4">
48-
{[ "type": "date", "label": "'.tr('Data').'", "name": "data", "required": 1, "value": "'.($record['data'] ?? '').'" ]}
48+
{[ "type": "date", "label": "'.tr('Data').'", "name": "data", "required": 1, "value": "-now-", "data-edit-value": "'.($record['data'] ?? '').'" ]}
4949
</div>
5050
<div class="col-md-8">
5151
{[ "type": "text", "label": "'.tr('Luogo').'", "name": "luogo", "required": 1, "value": "'.($record['dove'] ?? '').'" ]}
@@ -64,9 +64,21 @@
6464
</div>
6565
</div>
6666
</form>';
67-
6867
if ($record['id']) {
6968
echo '
7069
<hr>
7170
{( "name": "filelist_and_upload", "id_module": "'.$id_module.'", "id_record": "'.$iddanno.'", "id_plugin": "'.$id_plugin.'" )}';
7271
}
72+
73+
echo '
74+
<script>
75+
$(document).ready(function() {
76+
// Se siamo in modalità edit, aggiorna il valore del campo data
77+
var editValue = $("input[name=\'data\']").data("edit-value");
78+
if (editValue) {
79+
$("input[name=\'data\']").val(editValue);
80+
}
81+
82+
init();
83+
});
84+
</script>';

0 commit comments

Comments
 (0)