Skip to content

Commit aee46c4

Browse files
committed
refactor: miglioria grafica header interventi
1 parent 243aeae commit aee46c4

1 file changed

Lines changed: 33 additions & 26 deletions

File tree

modules/interventi/header.php

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@
110110
<hr>
111111
<div class="row">
112112
<div class="col-md-4">
113-
<div class="card card-outline card-primary shadow">
113+
<div class="card card-primary card-outline shadow">
114114
<div class="card-header">
115-
<h3 class="card-title"><i class="fa fa-vcard"></i> <span style="color: #000;">'.tr('Cliente').'</span></h3>
115+
<h3 class="card-title"><i class="fa fa-vcard"></i> <span class="text-dark">'.tr('Cliente').'</span></h3>
116116
</div>
117117
<div class="card-body">
118118
<div class="row">
@@ -133,11 +133,11 @@
133133
</p>
134134
135135
<div class="mt-3">
136-
'.($sede['telefono'] ? '<a class="btn btn-light btn-xs mr-1 mb-1" href="tel:'.$sede['telefono'].'" target="_blank"><i class="fa fa-phone text-primary"></i> '.$sede['telefono'].'</a>' : '').'
137-
'.($sede['email'] ? '<a class="btn btn-light btn-xs mr-1 mb-1" href="mailto:'.$sede['email'].'"><i class="fa fa-envelope text-primary"></i> '.$sede['email'].'</a>' : '').'
136+
'.($sede['telefono'] ? '<a class="btn btn-light btn-sm mr-1 mb-1" href="tel:'.$sede['telefono'].'" target="_blank"><i class="fa fa-phone text-primary"></i> '.$sede['telefono'].'</a>' : '').'
137+
'.($sede['email'] ? '<a class="btn btn-light btn-sm mr-1 mb-1" href="mailto:'.$sede['email'].'"><i class="fa fa-envelope text-primary"></i> '.$sede['email'].'</a>' : '').'
138138
'.($referente['nome'] ? '<div class="mt-2"><i class="fa fa-user-o text-muted"></i> '.$referente['nome'].'</div>' : '').'
139-
'.($referente['telefono'] ? '<a class="btn btn-light btn-xs mr-1 mb-1" href="tel:'.$referente['telefono'].'" target="_blank"><i class="fa fa-phone text-primary"></i> '.$referente['telefono'].'</a>' : '').'
140-
'.($referente['email'] ? '<a class="btn btn-light btn-xs mr-1 mb-1" href="mailto:'.$referente['email'].'"><i class="fa fa-envelope text-primary"></i> '.$referente['email'].'</a>' : '').'
139+
'.($referente['telefono'] ? '<a class="btn btn-light btn-sm mr-1 mb-1" href="tel:'.$referente['telefono'].'" target="_blank"><i class="fa fa-phone text-primary"></i> '.$referente['telefono'].'</a>' : '').'
140+
'.($referente['email'] ? '<a class="btn btn-light btn-sm mr-1 mb-1" href="mailto:'.$referente['email'].'"><i class="fa fa-envelope text-primary"></i> '.$referente['email'].'</a>' : '').'
141141
</div>
142142
</div>
143143
</div>
@@ -150,15 +150,18 @@
150150
$prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA');
151151

152152
$stato = Modules\Interventi\Stato::find($intervento->stato->id);
153+
$stato_colore = $stato->colore;
154+
$stato_testo_colore = color_inverse($stato_colore);
155+
153156
echo '
154157
<div class="col-md-4">
155-
<div class="card card-outline card-primary shadow">
158+
<div class="card card-primary card-outline shadow">
156159
157160
<div class="card-header">
158161
<div class="d-flex justify-content-between align-items-center">
159-
<h3 class="card-title"><i class="fa fa-wrench"></i> <span style="color: #000;">'.tr('Attività').'</span> <strong class="text-primary">'.$intervento->codice.'</strong> <span style="color: #000;">'.tr('del').'</span> <strong>'.Translator::dateToLocale($intervento->data_richiesta).'</strong></h3>
162+
<h3 class="card-title"><i class="fa fa-wrench"></i> <span class="text-dark">'.tr('Attività').'</span> <strong class="text-primary">'.$intervento->codice.'</strong> <span class="text-dark">'.tr('del').'</span> <strong>'.Translator::dateToLocale($intervento->data_richiesta).'</strong></h3>
160163
<div class="ml-auto">
161-
<button type="button" class="btn btn-sm" style="background-color: '.$stato->colore.'; color: <?php echo color_inverse($stato->colore); ?>;">
164+
<button type="button" class="btn btn-sm" style="background-color: '.$stato_colore.'; color: '.$stato_testo_colore.';">
162165
<i class="fa fa-calendar-check-o mr-1"></i> '.$intervento->stato->name.'
163166
</button>
164167
</div>
@@ -170,28 +173,28 @@
170173
<div class="col-md-3 text-center">
171174
<div class="d-flex flex-column">
172175
<span class="text-muted small mb-1">'.tr('Sessioni').'</span>
173-
<span class="badge badge-light p-2 font-weight-bold"><i class="fa fa-user text-primary mr-1"></i> '.$intervento->sessioni->count().'</span>
176+
<span class="badge bg-light p-2 fw-bold"><i class="fa fa-user text-primary mr-1"></i> '.$intervento->sessioni->count().'</span>
174177
</div>
175178
</div>
176179
177180
<div class="col-md-3 text-center">
178181
<div class="d-flex flex-column">
179182
<span class="text-muted small mb-1">'.tr('Ore').'</span>
180-
<span class="badge badge-light p-2 font-weight-bold"><i class="fa fa-hourglass text-primary mr-1"></i> '.Translator::numberToLocale($intervento->sessioni->sum('ore')).'</span>
183+
<span class="badge bg-light p-2 fw-bold"><i class="fa fa-hourglass text-primary mr-1"></i> '.Translator::numberToLocale($intervento->sessioni->sum('ore')).'</span>
181184
</div>
182185
</div>
183186
184187
<div class="col-md-3 text-center">
185188
<div class="d-flex flex-column">
186189
<span class="text-muted small mb-1">'.tr('Distanza').'</span>
187-
<span class="badge badge-light p-2 font-weight-bold"><i class="fa fa-truck text-primary mr-1"></i> '.Translator::numberToLocale($intervento->sessioni->sum('km')).' '.tr('km').'</span>
190+
<span class="badge bg-light p-2 fw-bold"><i class="fa fa-truck text-primary mr-1"></i> '.Translator::numberToLocale($intervento->sessioni->sum('km')).' '.tr('km').'</span>
188191
</div>
189192
</div>
190193
191194
<div class="col-md-3 text-center">
192195
<div class="d-flex flex-column">
193196
<span class="text-muted small mb-1">'.tr('Importo').'</span>
194-
<span class="badge badge-light p-2 font-weight-bold"><i class="fa fa-money text-primary mr-1"></i> '.($show_prezzi ? moneyFormat($prezzi_ivati ? $intervento->totale : $intervento->totale_imponibile, 2) : '-').'</span>
197+
<span class="badge bg-light p-2 fw-bold"><i class="fa fa-money text-primary mr-1"></i> '.($show_prezzi ? moneyFormat($prezzi_ivati ? $intervento->totale : $intervento->totale_imponibile, 2) : '-').'</span>
195198
</div>
196199
</div>
197200
</div>
@@ -214,7 +217,7 @@
214217
$diffTime = (new Carbon($intervento_programmato->data_richiesta))->diffForHumans();
215218
// Remove the "days" label by using a regex to extract just the number
216219
$diffTime = preg_replace('/(\d+)\s+giorni?.*/', '$1', $diffTime);
217-
echo ' <a class="btn btn-outline-primary btn-sm mr-1 mb-1" href="'.base_path_osm().'/editor.php?id_module='.$id_module.'&id_record='.$intervento_programmato->id.'" target="_blank"><i class="fa fa-calendar-check-o mr-1"></i>'.$intervento_programmato->codice.' <span class="badge badge-light ml-1">('.$diffTime.')</span></a>';
220+
echo ' <a class="btn btn-outline-primary btn-sm mr-1 mb-1" href="'.base_path_osm().'/editor.php?id_module='.$id_module.'&id_record='.$intervento_programmato->id.'" target="_blank"><i class="fa fa-calendar-check-o mr-1"></i>'.$intervento_programmato->codice.' <span class="badge bg-light ml-1">('.$diffTime.')</span></a>';
218221
}
219222
echo ' </div>';
220223
}
@@ -224,17 +227,21 @@
224227
if ($contratto) {
225228
echo '
226229
<div class="mb-3 status-item contratto-item">
227-
<div class="d-flex align-items-center">
228-
<span class="status-icon badge badge-info mr-2"><i class="fa fa-book"></i></span>
229-
<span class="status-text">'.Modules::link('Contratti', $contratto->id, tr('Contratto num. _NUM_ del _DATA_', ['_NUM_' => '<strong>'.$contratto->numero.'</strong>', '_DATA_' => Translator::dateToLocale($contratto->data_bozza)])).'</span>
230+
<div class="d-flex align-items-center justify-content-between">
231+
<div class="d-flex align-items-center">
232+
<span class="status-icon badge badge-info mr-2"><i class="fa fa-book"></i></span>
233+
<span class="status-text">'.Modules::link('Contratti', $contratto->id, tr('Contratto num. _NUM_ del _DATA_', ['_NUM_' => '<strong>'.$contratto->numero.'</strong>', '_DATA_' => Translator::dateToLocale($contratto->data_bozza)])).'</span>
234+
</div>';
235+
if ($ore_previste > 0) {
236+
echo '
237+
<span>'.Translator::numberToLocale($ore_erogate, 2).'/'.$ore_previste.' '.tr('ore').'</span>';
238+
}
239+
echo '
230240
</div>';
231241
if ($ore_previste > 0) {
232242
echo '
233-
<div class="mt-1 ml-4">
234-
<span class="badge badge-light">'.Translator::numberToLocale($ore_erogate, 2).'/'.$ore_previste.' '.tr('ore').'</span>
235-
<div class="progress mt-1" style="height:6px; border-radius:3px;">
236-
<div class="progress-bar bg-'.$color.'" style="width:'.$perc_ore.'%"></div>
237-
</div>
243+
<div class="progress mt-1" style="height: 6px; border-radius:3px;">
244+
<div class="progress-bar bg-'.$color.'" style="width:'.$perc_ore.'%"></div>
238245
</div>';
239246
}
240247
echo '
@@ -279,15 +286,15 @@
279286

280287
echo '
281288
<div class="col-md-4">
282-
<div class="card card-outline card-primary shadow">
289+
<div class="card card-primary card-outline shadow">
283290
<div class="card-header">
284-
<h3 class="card-title"><i class="fa fa-map"></i> <span style="color: #000;">'.tr('Geolocalizzazione').'</span></h3>
291+
<h3 class="card-title"><i class="fa fa-map"></i> <span class="text-dark">'.tr('Geolocalizzazione').'</span></h3>
285292
</div>
286293
<div class="card-body">';
287294

288295
if (!empty($sede_cliente->gaddress) || (!empty($sede_cliente->lat) && !empty($sede_cliente->lng))) {
289296
echo '
290-
<div id="map-edit" style="width: 100%; min-height: 150px; border-radius: 4px; border: 1px solid #eee;"></div>
297+
<div id="map-edit" class="w-100 rounded border border-light-subtle" style="min-height: 150px;"></div>
291298
292299
<div class="clearfix"></div>
293300
<div class="mt-3">
@@ -463,7 +470,7 @@ function caricaMappa() {
463470
$map_container.css("height", "320px");
464471
alignMaxHeight(".module-header .card");
465472
$("#" + map_id).css("height", "85%");
466-
$("#" + map_id).css("border", "none");
473+
$("#" + map_id).removeClass("border border-light-subtle");
467474
468475
$map_container.find(".load").addClass("hidden");
469476
$map_container.find(".go-to").removeClass("hidden");

0 commit comments

Comments
 (0)