Roberto Santini il y a 1 an
Parent
révision
c6e7826264

+ 12
- 4
app/Http/Controllers/IssueController.php Voir le fichier

@@ -314,7 +314,13 @@ class IssueController extends Controller
314 314
     ]);
315 315
 
316 316
     $folder_name = Storage::disk('temp')->getDriver()->getAdapter()->getPathPrefix();
317
-    $pdf->save($folder_name."/issue_".$request->issue_id.".pdf");
317
+    if($request->has('token_remoto')){
318
+      $filenameSavedPdf = "issue_".$request->token_remoto.".pdf";
319
+    }else{
320
+      $filenameSavedPdf = "issue_".$request->issue_id.".pdf";
321
+    }
322
+
323
+    $pdf->save($folder_name."/".$filenameSavedPdf);
318 324
     // return $pdf->stream();
319 325
 
320 326
     $uploads = array();
@@ -528,6 +534,7 @@ class IssueController extends Controller
528 534
     $request->session()->put('success_issue_id', $request->issue_id);
529 535
     if($request->has('token_remoto')){
530 536
       Issue::where('token', $request->token_remoto)->delete();
537
+      $request->session()->put('success_issue_token', $request->token_remoto);
531 538
       return redirect()->route('issue.success_remoto');
532 539
     }else{
533 540
       return redirect()->route('issue.success');
@@ -545,10 +552,11 @@ class IssueController extends Controller
545 552
   }
546 553
 
547 554
   public function success_remoto(Request $request){
555
+    $success_issue_token = session('success_issue_token');
548 556
     $success_issue_id = session('success_issue_id');
549
-    if($success_issue_id != null){
550
-      $request->session()->forget('success_issue_id');
551
-      return view('issue.success_remoto')->with(['issue_id' => $success_issue_id]);
557
+    if($success_issue_token != null){
558
+      $request->session()->forget('success_issue_token');
559
+      return view('issue.success_remoto')->with(['issue_token' => $success_issue_token, 'issue_id' => $success_issue_id]);
552 560
     }else{
553 561
       return redirect()->route('home');
554 562
     }

+ 3
- 2
app/Notifications/InviaLinkPerFirma.php Voir le fichier

@@ -43,8 +43,9 @@ class InviaLinkPerFirma extends Notification
43 43
   {
44 44
     $message = (new MailMessage)
45 45
     ->subject("Firma rapporto d'intervento")
46
-    ->line("clicca sul pulsante per firmare")
47
-    ->action('CLicca qui per firmare', route('issue.firma_remota', ['token' => $this->issue->token]));
46
+    ->greeting("Buongiorno")
47
+    ->line("Per firmare il rapporto d'intervento #".json_decode($this->issue->campi)->issue_id." inviato da ".$this->issue->user->azienda->ragione_sociale.", clicca sul pulsante sottostante")
48
+    ->action('Clicca qui per firmare', route('issue.firma_remota', ['token' => $this->issue->token]));
48 49
 
49 50
     return $message;
50 51
   }

+ 1
- 1
resources/views/issue/success_remoto.blade.php Voir le fichier

@@ -13,7 +13,7 @@
13 13
       <div class="card">
14 14
         <div class="card-body" style="text-align: center">
15 15
           <h2 style="text-align: center">Rapportino per la segnalazione #{{ $issue_id }} firmato correttamente</h2><br>
16
-          <a href="{{ Storage::disk('temp')->url('issue_'.$issue_id.'.pdf') }}" class="btn btn-primary">Scarica rapporto firmato</a><br><br>
16
+          <a href="{{ Storage::disk('temp')->url('issue_'.$issue_token.'.pdf') }}" class="btn btn-primary">Scarica rapporto firmato</a><br><br>
17 17
         </div>
18 18
       </div>
19 19
     </div>

+ 19
- 0
resources/views/vendor/mail/html/button.blade.php Voir le fichier

@@ -0,0 +1,19 @@
1
+<table class="action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
2
+<tr>
3
+<td align="center">
4
+<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
5
+<tr>
6
+<td align="center">
7
+<table border="0" cellpadding="0" cellspacing="0" role="presentation">
8
+<tr>
9
+<td>
10
+<a href="{{ $url }}" class="button button-{{ $color ?? 'primary' }}" target="_blank" rel="noopener">{{ $slot }}</a>
11
+</td>
12
+</tr>
13
+</table>
14
+</td>
15
+</tr>
16
+</table>
17
+</td>
18
+</tr>
19
+</table>

+ 11
- 0
resources/views/vendor/mail/html/footer.blade.php Voir le fichier

@@ -0,0 +1,11 @@
1
+<tr>
2
+<td>
3
+<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
4
+<tr>
5
+<td class="content-cell" align="center">
6
+{{ Illuminate\Mail\Markdown::parse($slot) }}
7
+</td>
8
+</tr>
9
+</table>
10
+</td>
11
+</tr>

+ 11
- 0
resources/views/vendor/mail/html/header.blade.php Voir le fichier

@@ -0,0 +1,11 @@
1
+<tr>
2
+<td class="header">
3
+<a href="{{ $url }}" style="display: inline-block;">
4
+@if (trim($slot) === 'Laravel')
5
+<img src="https://laravel.com/img/notification-logo.png" class="logo" alt="Laravel Logo">
6
+@else
7
+{{ $slot }}
8
+@endif
9
+</a>
10
+</td>
11
+</tr>

+ 56
- 0
resources/views/vendor/mail/html/layout.blade.php Voir le fichier

@@ -0,0 +1,56 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+<html xmlns="http://www.w3.org/1999/xhtml">
3
+<head>
4
+<meta name="viewport" content="width=device-width, initial-scale=1.0" />
5
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+<meta name="color-scheme" content="light">
7
+<meta name="supported-color-schemes" content="light">
8
+<style>
9
+@media only screen and (max-width: 600px) {
10
+.inner-body {
11
+width: 100% !important;
12
+}
13
+
14
+.footer {
15
+width: 100% !important;
16
+}
17
+}
18
+
19
+@media only screen and (max-width: 500px) {
20
+.button {
21
+width: 100% !important;
22
+}
23
+}
24
+</style>
25
+</head>
26
+<body>
27
+
28
+<table class="wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation">
29
+<tr>
30
+<td align="center">
31
+<table class="content" width="100%" cellpadding="0" cellspacing="0" role="presentation">
32
+{{ $header ?? '' }}
33
+
34
+<!-- Email Body -->
35
+<tr>
36
+<td class="body" width="100%" cellpadding="0" cellspacing="0">
37
+<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
38
+<!-- Body content -->
39
+<tr>
40
+<td class="content-cell">
41
+{{ Illuminate\Mail\Markdown::parse($slot) }}
42
+
43
+{{ $subcopy ?? '' }}
44
+</td>
45
+</tr>
46
+</table>
47
+</td>
48
+</tr>
49
+
50
+{{ $footer ?? '' }}
51
+</table>
52
+</td>
53
+</tr>
54
+</table>
55
+</body>
56
+</html>

+ 27
- 0
resources/views/vendor/mail/html/message.blade.php Voir le fichier

@@ -0,0 +1,27 @@
1
+@component('mail::layout')
2
+{{-- Header --}}
3
+@slot('header')
4
+@component('mail::header', ['url' => config('app.url')])
5
+{{ config('app.name') }}
6
+@endcomponent
7
+@endslot
8
+
9
+{{-- Body --}}
10
+{{ $slot }}
11
+
12
+{{-- Subcopy --}}
13
+@isset($subcopy)
14
+@slot('subcopy')
15
+@component('mail::subcopy')
16
+{{ $subcopy }}
17
+@endcomponent
18
+@endslot
19
+@endisset
20
+
21
+{{-- Footer --}}
22
+@slot('footer')
23
+@component('mail::footer')
24
+© {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.')
25
+@endcomponent
26
+@endslot
27
+@endcomponent

+ 14
- 0
resources/views/vendor/mail/html/panel.blade.php Voir le fichier

@@ -0,0 +1,14 @@
1
+<table class="panel" width="100%" cellpadding="0" cellspacing="0" role="presentation">
2
+<tr>
3
+<td class="panel-content">
4
+<table width="100%" cellpadding="0" cellspacing="0" role="presentation">
5
+<tr>
6
+<td class="panel-item">
7
+{{ Illuminate\Mail\Markdown::parse($slot) }}
8
+</td>
9
+</tr>
10
+</table>
11
+</td>
12
+</tr>
13
+</table>
14
+

+ 7
- 0
resources/views/vendor/mail/html/subcopy.blade.php Voir le fichier

@@ -0,0 +1,7 @@
1
+<table class="subcopy" width="100%" cellpadding="0" cellspacing="0" role="presentation">
2
+<tr>
3
+<td>
4
+{{ Illuminate\Mail\Markdown::parse($slot) }}
5
+</td>
6
+</tr>
7
+</table>

+ 3
- 0
resources/views/vendor/mail/html/table.blade.php Voir le fichier

@@ -0,0 +1,3 @@
1
+<div class="table">
2
+{{ Illuminate\Mail\Markdown::parse($slot) }}
3
+</div>

+ 290
- 0
resources/views/vendor/mail/html/themes/default.css Voir le fichier

@@ -0,0 +1,290 @@
1
+/* Base */
2
+
3
+body,
4
+body *:not(html):not(style):not(br):not(tr):not(code) {
5
+    box-sizing: border-box;
6
+    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
7
+        'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
8
+    position: relative;
9
+}
10
+
11
+body {
12
+    -webkit-text-size-adjust: none;
13
+    background-color: #ffffff;
14
+    color: #718096;
15
+    height: 100%;
16
+    line-height: 1.4;
17
+    margin: 0;
18
+    padding: 0;
19
+    width: 100% !important;
20
+}
21
+
22
+p,
23
+ul,
24
+ol,
25
+blockquote {
26
+    line-height: 1.4;
27
+    text-align: left;
28
+}
29
+
30
+a {
31
+    color: #3869d4;
32
+}
33
+
34
+a img {
35
+    border: none;
36
+}
37
+
38
+/* Typography */
39
+
40
+h1 {
41
+    color: #3d4852;
42
+    font-size: 18px;
43
+    font-weight: bold;
44
+    margin-top: 0;
45
+    text-align: left;
46
+}
47
+
48
+h2 {
49
+    font-size: 16px;
50
+    font-weight: bold;
51
+    margin-top: 0;
52
+    text-align: left;
53
+}
54
+
55
+h3 {
56
+    font-size: 14px;
57
+    font-weight: bold;
58
+    margin-top: 0;
59
+    text-align: left;
60
+}
61
+
62
+p {
63
+    font-size: 16px;
64
+    line-height: 1.5em;
65
+    margin-top: 0;
66
+    text-align: left;
67
+}
68
+
69
+p.sub {
70
+    font-size: 12px;
71
+}
72
+
73
+img {
74
+    max-width: 100%;
75
+}
76
+
77
+/* Layout */
78
+
79
+.wrapper {
80
+    -premailer-cellpadding: 0;
81
+    -premailer-cellspacing: 0;
82
+    -premailer-width: 100%;
83
+    background-color: #edf2f7;
84
+    margin: 0;
85
+    padding: 0;
86
+    width: 100%;
87
+}
88
+
89
+.content {
90
+    -premailer-cellpadding: 0;
91
+    -premailer-cellspacing: 0;
92
+    -premailer-width: 100%;
93
+    margin: 0;
94
+    padding: 0;
95
+    width: 100%;
96
+}
97
+
98
+/* Header */
99
+
100
+.header {
101
+    padding: 25px 0;
102
+    text-align: center;
103
+}
104
+
105
+.header a {
106
+    color: #3d4852;
107
+    font-size: 19px;
108
+    font-weight: bold;
109
+    text-decoration: none;
110
+}
111
+
112
+/* Logo */
113
+
114
+.logo {
115
+    height: 75px;
116
+    max-height: 75px;
117
+    width: 75px;
118
+}
119
+
120
+/* Body */
121
+
122
+.body {
123
+    -premailer-cellpadding: 0;
124
+    -premailer-cellspacing: 0;
125
+    -premailer-width: 100%;
126
+    background-color: #edf2f7;
127
+    border-bottom: 1px solid #edf2f7;
128
+    border-top: 1px solid #edf2f7;
129
+    margin: 0;
130
+    padding: 0;
131
+    width: 100%;
132
+}
133
+
134
+.inner-body {
135
+    -premailer-cellpadding: 0;
136
+    -premailer-cellspacing: 0;
137
+    -premailer-width: 570px;
138
+    background-color: #ffffff;
139
+    border-color: #e8e5ef;
140
+    border-radius: 2px;
141
+    border-width: 1px;
142
+    box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015);
143
+    margin: 0 auto;
144
+    padding: 0;
145
+    width: 570px;
146
+}
147
+
148
+/* Subcopy */
149
+
150
+.subcopy {
151
+    border-top: 1px solid #e8e5ef;
152
+    margin-top: 25px;
153
+    padding-top: 25px;
154
+}
155
+
156
+.subcopy p {
157
+    font-size: 14px;
158
+}
159
+
160
+/* Footer */
161
+
162
+.footer {
163
+    -premailer-cellpadding: 0;
164
+    -premailer-cellspacing: 0;
165
+    -premailer-width: 570px;
166
+    margin: 0 auto;
167
+    padding: 0;
168
+    text-align: center;
169
+    width: 570px;
170
+}
171
+
172
+.footer p {
173
+    color: #b0adc5;
174
+    font-size: 12px;
175
+    text-align: center;
176
+}
177
+
178
+.footer a {
179
+    color: #b0adc5;
180
+    text-decoration: underline;
181
+}
182
+
183
+/* Tables */
184
+
185
+.table table {
186
+    -premailer-cellpadding: 0;
187
+    -premailer-cellspacing: 0;
188
+    -premailer-width: 100%;
189
+    margin: 30px auto;
190
+    width: 100%;
191
+}
192
+
193
+.table th {
194
+    border-bottom: 1px solid #edeff2;
195
+    margin: 0;
196
+    padding-bottom: 8px;
197
+}
198
+
199
+.table td {
200
+    color: #74787e;
201
+    font-size: 15px;
202
+    line-height: 18px;
203
+    margin: 0;
204
+    padding: 10px 0;
205
+}
206
+
207
+.content-cell {
208
+    max-width: 100vw;
209
+    padding: 32px;
210
+}
211
+
212
+/* Buttons */
213
+
214
+.action {
215
+    -premailer-cellpadding: 0;
216
+    -premailer-cellspacing: 0;
217
+    -premailer-width: 100%;
218
+    margin: 30px auto;
219
+    padding: 0;
220
+    text-align: center;
221
+    width: 100%;
222
+}
223
+
224
+.button {
225
+    -webkit-text-size-adjust: none;
226
+    border-radius: 4px;
227
+    color: #fff;
228
+    display: inline-block;
229
+    overflow: hidden;
230
+    text-decoration: none;
231
+}
232
+
233
+.button-blue,
234
+.button-primary {
235
+    background-color: #2d3748;
236
+    border-bottom: 8px solid #2d3748;
237
+    border-left: 18px solid #2d3748;
238
+    border-right: 18px solid #2d3748;
239
+    border-top: 8px solid #2d3748;
240
+}
241
+
242
+.button-green,
243
+.button-success {
244
+    background-color: #48bb78;
245
+    border-bottom: 8px solid #48bb78;
246
+    border-left: 18px solid #48bb78;
247
+    border-right: 18px solid #48bb78;
248
+    border-top: 8px solid #48bb78;
249
+}
250
+
251
+.button-red,
252
+.button-error {
253
+    background-color: #e53e3e;
254
+    border-bottom: 8px solid #e53e3e;
255
+    border-left: 18px solid #e53e3e;
256
+    border-right: 18px solid #e53e3e;
257
+    border-top: 8px solid #e53e3e;
258
+}
259
+
260
+/* Panels */
261
+
262
+.panel {
263
+    border-left: #2d3748 solid 4px;
264
+    margin: 21px 0;
265
+}
266
+
267
+.panel-content {
268
+    background-color: #edf2f7;
269
+    color: #718096;
270
+    padding: 16px;
271
+}
272
+
273
+.panel-content p {
274
+    color: #718096;
275
+}
276
+
277
+.panel-item {
278
+    padding: 0;
279
+}
280
+
281
+.panel-item p:last-of-type {
282
+    margin-bottom: 0;
283
+    padding-bottom: 0;
284
+}
285
+
286
+/* Utilities */
287
+
288
+.break-all {
289
+    word-break: break-all;
290
+}

+ 1
- 0
resources/views/vendor/mail/text/button.blade.php Voir le fichier

@@ -0,0 +1 @@
1
+{{ $slot }}: {{ $url }}

+ 1
- 0
resources/views/vendor/mail/text/footer.blade.php Voir le fichier

@@ -0,0 +1 @@
1
+{{ $slot }}

+ 1
- 0
resources/views/vendor/mail/text/header.blade.php Voir le fichier

@@ -0,0 +1 @@
1
+[{{ $slot }}]({{ $url }})

+ 9
- 0
resources/views/vendor/mail/text/layout.blade.php Voir le fichier

@@ -0,0 +1,9 @@
1
+{!! strip_tags($header) !!}
2
+
3
+{!! strip_tags($slot) !!}
4
+@isset($subcopy)
5
+
6
+{!! strip_tags($subcopy) !!}
7
+@endisset
8
+
9
+{!! strip_tags($footer) !!}

+ 27
- 0
resources/views/vendor/mail/text/message.blade.php Voir le fichier

@@ -0,0 +1,27 @@
1
+@component('mail::layout')
2
+    {{-- Header --}}
3
+    @slot('header')
4
+        @component('mail::header', ['url' => config('app.url')])
5
+            {{ config('app.name') }}
6
+        @endcomponent
7
+    @endslot
8
+
9
+    {{-- Body --}}
10
+    {{ $slot }}
11
+
12
+    {{-- Subcopy --}}
13
+    @isset($subcopy)
14
+        @slot('subcopy')
15
+            @component('mail::subcopy')
16
+                {{ $subcopy }}
17
+            @endcomponent
18
+        @endslot
19
+    @endisset
20
+
21
+    {{-- Footer --}}
22
+    @slot('footer')
23
+        @component('mail::footer')
24
+            © {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.')
25
+        @endcomponent
26
+    @endslot
27
+@endcomponent

+ 1
- 0
resources/views/vendor/mail/text/panel.blade.php Voir le fichier

@@ -0,0 +1 @@
1
+{{ $slot }}

+ 1
- 0
resources/views/vendor/mail/text/subcopy.blade.php Voir le fichier

@@ -0,0 +1 @@
1
+{{ $slot }}

+ 1
- 0
resources/views/vendor/mail/text/table.blade.php Voir le fichier

@@ -0,0 +1 @@
1
+{{ $slot }}

+ 62
- 0
resources/views/vendor/notifications/email.blade.php Voir le fichier

@@ -0,0 +1,62 @@
1
+@component('mail::message')
2
+{{-- Greeting --}}
3
+@if (! empty($greeting))
4
+# {{ $greeting }}
5
+@else
6
+@if ($level === 'error')
7
+# @lang('Whoops!')
8
+@else
9
+# @lang('Hello!')
10
+@endif
11
+@endif
12
+
13
+{{-- Intro Lines --}}
14
+@foreach ($introLines as $line)
15
+{{ $line }}
16
+
17
+@endforeach
18
+
19
+{{-- Action Button --}}
20
+@isset($actionText)
21
+<?php
22
+    switch ($level) {
23
+        case 'success':
24
+        case 'error':
25
+            $color = $level;
26
+            break;
27
+        default:
28
+            $color = 'primary';
29
+    }
30
+?>
31
+@component('mail::button', ['url' => $actionUrl, 'color' => $color])
32
+{{ $actionText }}
33
+@endcomponent
34
+@endisset
35
+
36
+{{-- Outro Lines --}}
37
+@foreach ($outroLines as $line)
38
+{{ $line }}
39
+
40
+@endforeach
41
+
42
+{{-- Salutation --}}
43
+@if (! empty($salutation))
44
+{{ $salutation }}
45
+@else
46
+@lang('Regards'),<br>
47
+{{ config('app.name') }}
48
+@endif
49
+
50
+{{-- Subcopy --}}
51
+@isset($actionText)
52
+@slot('subcopy')
53
+@lang(
54
+    "Se hai problemi a fare clic sul pulsante \":actionText\", copia e incolla il link sottostante\n".
55
+    'nel tuo web browser:',
56
+    [
57
+        'actionText' => $actionText,
58
+    ]
59
+) <span class="break-all">[{{ $displayableActionUrl }}]({{ $actionUrl }})</span>
60
+@endslot
61
+@endisset
62
+@endcomponent

Chargement…
Annuler
Enregistrer