|
|
@@ -1,5 +1,6 @@
|
|
1
|
1
|
<?php
|
|
2
|
2
|
use Carbon\Carbon;
|
|
|
3
|
+use App\Models\Config;
|
|
3
|
4
|
?>
|
|
4
|
5
|
<style>
|
|
5
|
6
|
[type="file"] {
|
|
|
@@ -41,7 +42,7 @@ use Carbon\Carbon;
|
|
41
|
42
|
</h2>
|
|
42
|
43
|
</x-slot>
|
|
43
|
44
|
|
|
44
|
|
- {!! Form::open(['route' => 'issue.firma_rapporto', 'files' => true]) !!}
|
|
|
45
|
+ {!! Form::open(['route' => 'issue.firma_rapporto', 'files' => true, 'id' => 'form_firma']) !!}
|
|
45
|
46
|
{!! Form::hidden('issue_id', $issue->id) !!}
|
|
46
|
47
|
|
|
47
|
48
|
<div class="row justify-content-center mb-4">
|
|
|
@@ -62,9 +63,9 @@ use Carbon\Carbon;
|
|
62
|
63
|
{!! Form::select('activity_id', $attivita, null, ['class' => 'form-control']) !!}
|
|
63
|
64
|
</div>
|
|
64
|
65
|
|
|
65
|
|
- <div class="form-group col-md">
|
|
|
66
|
+ <div class="form-group col-md" id="div_stato_segnalazione" style="display: none">
|
|
66
|
67
|
{!! Form::label('status_id', 'Stato segnalazione') !!}
|
|
67
|
|
- {!! Form::select('status_id', $issueStatus, $issue->status->id, ['class' => 'form-control']) !!}
|
|
|
68
|
+ {!! Form::select('status_id', $issueStatus, Config::getValue(Config::STATO_DA_COMPLETARE), ['class' => 'form-control']) !!}
|
|
68
|
69
|
</div>
|
|
69
|
70
|
</div>
|
|
70
|
71
|
|
|
|
@@ -93,6 +94,15 @@ use Carbon\Carbon;
|
|
93
|
94
|
{!! Form::label('ora_fine', 'Fine') !!}
|
|
94
|
95
|
{!! Form::text('ora_fine', Carbon::now()->addMinutes(15)->format('H:i'), ['class' => 'form-control']) !!}
|
|
95
|
96
|
</div>
|
|
|
97
|
+
|
|
|
98
|
+ <div class="form-group col-md" id="div_button_ore_viaggio">
|
|
|
99
|
+ <button class="btn btn-primary" onclick="imputa_ore_viaggio()" type="button">Imputa ore viaggio</button>
|
|
|
100
|
+ </div>
|
|
|
101
|
+
|
|
|
102
|
+ <div class="form-group col-md" id="div_ore_viaggio" style="display: none">
|
|
|
103
|
+ {!! Form::label('ore_viaggio', 'Ore viaggio') !!}
|
|
|
104
|
+ {!! Form::number('ore_viaggio', null, ['class' => 'form-control', 'min' => 0, 'step' => 0,01]) !!}
|
|
|
105
|
+ </div>
|
|
96
|
106
|
</div>
|
|
97
|
107
|
|
|
98
|
108
|
<div class="form-row">
|
|
|
@@ -225,7 +235,7 @@ use Carbon\Carbon;
|
|
225
|
235
|
|
|
226
|
236
|
<div class="form-row">
|
|
227
|
237
|
<div class="form-group col-md">
|
|
228
|
|
- <button type="submit" class="btn btn-primary">Salva</button>
|
|
|
238
|
+ <button type="button" onclick="submitForm()" class="btn btn-primary">Salva</button>
|
|
229
|
239
|
</div>
|
|
230
|
240
|
</div>
|
|
231
|
241
|
|
|
|
@@ -348,4 +358,23 @@ function file_selezionato(input){
|
|
348
|
358
|
}
|
|
349
|
359
|
}
|
|
350
|
360
|
|
|
|
361
|
+function imputa_ore_viaggio(){
|
|
|
362
|
+ $('#div_stato_segnalazione').show();
|
|
|
363
|
+ $('#div_button_ore_viaggio').hide();
|
|
|
364
|
+ $('#div_ore_viaggio').show();
|
|
|
365
|
+}
|
|
|
366
|
+
|
|
|
367
|
+function submitForm(){
|
|
|
368
|
+ // controllo se le ore del viaggio sono state imputate
|
|
|
369
|
+ if($("#div_ore_viaggio").is(":visible") && isNaN(parseInt($('#ore_viaggio').val()))){
|
|
|
370
|
+ bootbox.alert("Devi imputare le ore di viaggio!");
|
|
|
371
|
+ return;
|
|
|
372
|
+ }
|
|
|
373
|
+
|
|
|
374
|
+ if($('#signature_image_cliente').val() == ''){
|
|
|
375
|
+ bootbox.alert("Manca la firma del cliente!");
|
|
|
376
|
+ return;
|
|
|
377
|
+ }
|
|
|
378
|
+ $('#form_firma').submit();
|
|
|
379
|
+}
|
|
351
|
380
|
</script>
|