Compare commits

...

6 Commits

10 changed files with 167 additions and 77 deletions

View File

@ -1601,6 +1601,29 @@ body:not(.sidebar-collapse) .sidebar .nav-treeview .nav-treeview .nav-link {
z-index: 99999;
}
.module-header p{
margin: 3px 0;
}
.module-header h3,
.module-header h4,
.module-header h5{
margin: 4px 0;
}
.round-16{
border-radius: 16px;
width: 16px;
height: 16px;
display: inline-block;
vertical-align: middle;
}
.module-header .separator{
color: #ccc;
padding: 0 5px;
}
@media screen and (max-width: 767px) {
.navbar-left {
display: inline-block;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
assets/src/img/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -24,6 +24,7 @@ use Models\Module;
// Disabilitazione dei campi
$read_only = $structure->permission == 'r';
$module_header_html = '';
if (empty($id_record) && !empty($id_module) && empty($id_plugin)) {
redirect(base_path().'/controller.php?id_module='.$id_module);
@ -171,7 +172,16 @@ if (empty($record) || !$has_access) {
<i class="fa fa-chevron-left"></i> '.tr("Torna all'elenco").'
</a>
<div class="float-right d-none d-sm-inline">
<div class="float-right d-none d-sm-inline">';
// Pulsanti personalizzati
$buttons = $structure->filepath('buttons.php');
if (!empty($buttons)) {
include $buttons;
}
echo '
{( "name": "button", "type": "print", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}
{( "name": "button", "type": "email", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}';
@ -224,25 +234,21 @@ if (empty($record) || !$has_access) {
<div class="clearfix"></div>
<br>';
// Pulsanti personalizzati
$buttons = $structure->filepath('buttons.php');
if (!empty($buttons)) {
// Eventuale header personalizzato
$module_header = $structure->filepath('header.php');
$module_header_html = '';
if (!empty($module_header)) {
ob_start();
include $buttons;
$buttons = ob_get_clean();
include $module_header;
$module_header_html = ob_get_clean();
}
echo '
<div class="float-right d-none d-sm-inline" id="pulsanti-modulo">
'.$buttons.'
</div>
<div class="clearfix"></div>
<br>';
// Eventuale header personalizzato
$header = $structure->filepath('header.php');
if ($header) {
include_once $header;
}
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
// Contenuti del modulo
@ -296,6 +302,13 @@ if (empty($record) || !$has_access) {
if ($structure->permission != '-' && $structure->use_notes && $user->gruppo != 'Clienti') {
echo '
<div id="tab_note" class="tab-pane">';
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
include base_dir().'/plugins/notes.php';
@ -307,6 +320,13 @@ if (empty($record) || !$has_access) {
echo '
<div id="tab_checks" class="tab-pane">';
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
include base_dir().'/plugins/checks.php';
echo '
@ -316,7 +336,16 @@ if (empty($record) || !$has_access) {
// Informazioni sulle operazioni
if (Auth::admin()) {
echo '
<div id="tab_info" class="tab-pane">
<div id="tab_info" class="tab-pane">';
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
echo '
<div class="timeline">';
$operations = $dbo->fetchArray('SELECT `zz_operations`.*, `zz_users`.`username` FROM `zz_operations` LEFT JOIN `zz_users` ON `zz_operations`.`id_utente` = `zz_users`.`id` WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($id_record).' ORDER BY `created_at` DESC LIMIT 200');
@ -390,6 +419,13 @@ if (empty($record) || !$has_access) {
echo '
<div id="tab_'.$plugin['id'].'" class="tab-pane">';
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
$id_plugin = $plugin['id'];
include base_dir().'/include/manager.php';

View File

@ -469,15 +469,10 @@ if (Auth::check()) {
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">';
$user_photo = $user->photo;
if ($user_photo) {
echo '
<img src="'.$user_photo.'" class="img-circle elevation-2" alt="'.$user['username'].'" />';
} else {
echo '
<i class="fa fa-user-circle-o fa-2x" alt="'.tr('Utente').'"></i>';
}
$user_photo = $user->photo ?: $rootdir.'/assets/dist/img/user.png';
echo '
<img src="'.$user_photo.'" class="img-circle elevation-2" alt="'.$user['username'].'" />
</div>
<div class="info">

View File

@ -39,15 +39,18 @@ echo '
<button type="button" class="btn btn-primary '.(!empty($info_firma) ? 'tip' : '').'" title="'.$info_firma.'" onclick="anteprimaFirma()" '.($record['flag_completato'] ? 'disabled' : '').'>
<i class="fa fa-'.(!empty($info_firma) ? 'refresh' : 'desktop').'"></i> '.$frase.'...
</button>
</button>';
<a class="btn btn-info'.($prev ? '' : ' disabled').'" href="'.base_path().'/editor.php?id_module=3&id_record='.$prev.'">
// TODO: da standardizzare in struttura per tutti i moduli di tipo table
/*<a class="btn btn-info'.($prev ? '' : ' disabled').'" href="'.base_path().'/editor.php?id_module=3&id_record='.$prev.'">
<i class="fa fa-arrow-circle-left"></i> '.tr('Precedente').'
</a>
<a class="btn btn-info'.($next ? '' : ' disabled').'" href="'.base_path().'/editor.php?id_module=3&id_record='.$next.'">
'.tr('Successivo').' <i class="fa fa-arrow-circle-right"></i>
</a>
</a>*/
echo '
<script>
function duplicaIntervento() {
openModal("'.tr('Duplica attività').'", "'.$module->fileurl('modals/duplicazione.php').'?id_module='.$id_module.'&id_record='.$id_record.'");

View File

@ -54,11 +54,6 @@ echo '
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="id_record" value="'.$id_record.'">
<div class="row">
<div class="col-md-2 offset-md-10">
{[ "type": "select", "label": "'.tr('Stato').'", "name": "idstatointervento", "required": 1, "values": "query=SELECT `in_statiintervento`.`id`, `title` as descrizione, `colore` AS _bgcolor_ FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento`.`id` = `in_statiintervento_lang`.`id_record` AND `in_statiintervento_lang`.`id_lang` ='.prepare(Models\Locale::getDefault()->id).') WHERE `deleted_at` IS NULL ORDER BY `title`", "value": "$idstatointervento$", "class": "unblockable" ]}
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- DATI CLIENTE -->
@ -189,7 +184,7 @@ $sede_azienda = $anagrafica_azienda->sedeLegale;
{[ "type": "select", "label": "<?php echo tr('Tipo attività'); ?>", "name": "idtipointervento", "required": 1, "ajax-source": "tipiintervento", "value": "$idtipointervento$", "readonly": "<?php echo $record['flag_completato']; ?>" ]}
</div>
<div class="col-md-3">
{[ "type": "select", "label": "<?php echo tr('Tags'); ?>", "multiple": "1", "name": "tags[]", "values": "query=SELECT `id`, `name` as descrizione FROM `in_tags` ORDER BY `name`", "value": "<?php echo implode(',', $tags); ?>", "icon-after": "add|<?php echo Module::where('name', 'Tags')->first()->id; ?>|" ]}
{[ "type": "select", "label": "<?php echo tr('Stato'); ?>", "name": "idstatointervento", "required": 1, "values": "query=SELECT `in_statiintervento`.`id`, `title` as descrizione, `colore` AS _bgcolor_ FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento`.`id` = `in_statiintervento_lang`.`id_record` AND `in_statiintervento_lang`.`id_lang` =<?php echo prepare(Models\Locale::getDefault()->id); ?>) WHERE `deleted_at` IS NULL ORDER BY `title`", "value": "$idstatointervento$", "class": "unblockable" ]}
</div>
</div>
@ -200,19 +195,22 @@ $tecnici_assegnati = array_column($tecnici_assegnati, 'id_tecnico');
echo '
<!-- RIGA 4 -->
<div class="row">
<div class="col-md-4">
<div class="col-md-3">
{[ "type": "select", "label": "'.tr('Tecnici assegnati').'", "multiple": "1", "name": "tecnici_assegnati[]", "ajax-source": "tecnici", "value": "'.implode(',', $tecnici_assegnati).'", "icon-after": "add|'.$id_modulo_anagrafiche.'|tipoanagrafica=Tecnico&readonly_tipo=1" ]}
</div>
';
// Conteggio numero articoli intervento per eventuale blocco della sede di partenza
$articoli = $intervento->articoli;
echo '
<div class="col-md-4">
<div class="col-md-3">
{[ "type": "select", "label": "'.tr('Partenza merce').'", "name": "idsede_partenza", "ajax-source": "sedi_azienda", "value": "$idsede_partenza$", "readonly": "'.(($record['flag_completato'] || !$articoli->isEmpty()) ? 1 : 0).'" ]}
</div>
<div class="col-md-4">
<div class="col-md-3">
{[ "type": "select", "label": "'.tr('Sede destinazione').'", "name": "idsede_destinazione","value": "$idsede_destinazione$", "ajax-source": "sedi", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "placeholder": "'.tr('Sede legale').'", "readonly": "'.$record['flag_completato'].'" ]}
</div>
<div class="col-md-3">
{[ "type": "select", "label": "'.tr('Tags').'", "multiple": "1", "name": "tags[]", "values": "query=SELECT `id`, `name` as descrizione FROM `in_tags` ORDER BY `name`", "value": "'.implode(',', $tags).'", "icon-after": "add|'.(Module::where('name', 'Tags')->first()->id).'|" ]}
</div>
</div>
<!-- RIGA 5 -->
<div class="row">

View File

@ -99,44 +99,78 @@ $logo = $logo ? base_path().'/files/anagrafiche/'.$logo : App::getPaths()['img']
echo '
<hr>
<div class="row">
<div class="col-md-1">
<img src="'.$logo.'" class="img-fluid">
</div>';
<div class="col-md-4">
<div class="card card-primary shadow">
<div class="card-header">
<h3 class="card-title"><i class="fa fa-vcard"></i> '.tr('Cliente').'</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3">
<img src="'.$logo.'" class="img-fluid">
</div>
<div class="col-md-9">';
// Cliente
echo '
<div class="col-md-3">
<h4 style="margin:4px 0;"><b>'.$anagrafica->ragione_sociale.'</b></h4>
<h4><b>'.Modules::link('Anagrafiche', $intervento->idanagrafica, $intervento->anagrafica->ragione_sociale, $intervento->anagrafica->ragione_sociale).'</b></h4>
<p style="margin:3px 0;">
'.($sede['nomesede'] ? $sede['nomesede'].'<br>' : '').'
'.$sede['indirizzo'].'<br>
'.$sede['cap'].' - '.$sede['citta'].' ('.$sede['provincia'].')
</p>
<p>
'.($sede['nomesede'] ? $sede['nomesede'].'<br>' : '').'
'.$sede['indirizzo'].'<br>
'.$sede['cap'].' - '.$sede['citta'].' ('.$sede['provincia'].')
</p>
<p style="margin:3px 0;">
'.($sede['telefono'] ? '<a class="btn btn-default btn-xs" href="tel:'.$sede['telefono'].'" target="_blank"><i class="fa fa-phone text-maroon"></i> '.$sede['telefono'].'</a>' : '').'
'.($sede['email'] ? '<a class="btn btn-default btn-xs" href="mailto:'.$sede['email'].'"><i class="fa fa-envelope text-maroon"></i> '.$sede['email'].'</a>' : '').'
'.($referente['nome'] ? '<p></p><i class="fa fa-user-o text-muted"></i> '.$referente['nome'].'<br>' : '').'
'.($referente['telefono'] ? '<a class="btn btn-default btn-xs" href="tel:'.$referente['telefono'].'" target="_blank"><i class="fa fa-phone text-maroon"></i> '.$referente['telefono'].'</a>' : '').'
'.($referente['email'] ? '<a class="btn btn-default btn-xs" href="mailto:'.$referente['email'].'"><i class="fa fa-envelope text-maroon"></i> '.$referente['email'].'</a>' : '').'
</p>
<p>
'.($sede['telefono'] ? '<a class="btn btn-default btn-xs" href="tel:'.$sede['telefono'].'" target="_blank"><i class="fa fa-phone text-maroon"></i> '.$sede['telefono'].'</a>' : '').'
'.($sede['email'] ? '<a class="btn btn-default btn-xs" href="mailto:'.$sede['email'].'"><i class="fa fa-envelope text-maroon"></i> '.$sede['email'].'</a>' : '').'
'.($referente['nome'] ? '<p></p><i class="fa fa-user-o text-muted"></i> '.$referente['nome'].'<br>' : '').'
'.($referente['telefono'] ? '<a class="btn btn-default btn-xs" href="tel:'.$referente['telefono'].'" target="_blank"><i class="fa fa-phone text-maroon"></i> '.$referente['telefono'].'</a>' : '').'
'.($referente['email'] ? '<a class="btn btn-default btn-xs" href="mailto:'.$referente['email'].'"><i class="fa fa-envelope text-maroon"></i> '.$referente['email'].'</a>' : '').'
</p>
</div>
</div>
</div>
</div>
</div>';
// Panoramica
$show_prezzi = Auth::user()['gruppo'] != 'Tecnici' || (Auth::user()['gruppo'] == 'Tecnici' && setting('Mostra i prezzi al tecnico'));
$prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA');
$stato = \Modules\Interventi\Stato::find($intervento->stato->id);
echo '
<div class="col-md-4">
<div class="card card-info">
<div class="card card-primary shadow">
<div class="card-header">
<h3 class="card-title"><i class="fa fa-map"></i> '.tr('Panoramica attività num. ').$intervento->codice.'</h3>
<h3 class="card-title"><i class="fa fa-map"></i> '.tr('Attività _NUM_ del _DATA_', [
'_NUM_' => $intervento->codice,
'_DATA_' => Translator::dateToLocale($intervento->data_richiesta)
]).'</h3>
</div>
<div class="card-body">
<p style="margin:3px 0;"><i class="fa fa-'.($insoluti ? 'warning text-danger' : 'check text-success').'"></i>
<p>
<span class="tip" title="'.tr('Numero sessioni di lavoro').'"><i class="fa fa-user text-gray"></i> '.$intervento->sessioni->count().'</span>
<span class="separator">|</span>
<span class="tip" title="'.tr('Numero di ore totali').'"><i class="fa fa-hourglass text-gray"></i> '.Translator::numberToLocale($intervento->sessioni->sum('ore')).'</span>
<span class="separator">|</span>
<span class="tip" title="'.tr('Numero di km percorsi').'"><i class="fa fa-truck text-gray"></i> '.Translator::numberToLocale($intervento->sessioni->sum('km')).' '.tr('km').'</span>
<span class="separator">|</span>
<span class="tip" title="'.tr('Importo totale del lavoro').'"><i class="fa fa-money text-gray"></i> '.($show_prezzi ? moneyFormat(($prezzi_ivati ? $intervento->totale : $intervento->totale_imponibile), 2) : '-').'</span>
<span class="separator">|</span>
<span class="round-16" style="background-color:'.$stato->colore.';"></span> '.$stato->getTranslation('title').'
</p>
<hr>
<p><i class="fa fa-'.($insoluti ? 'warning text-danger' : 'check text-success').'"></i>
'.($insoluti ? tr('Sono presenti insoluti') : tr('Non sono presenti insoluti')).'
</p>
<p style="margin:3px 0;"><i class="fa '.(count($interventi_programmati) == 0 ? 'fa-clock-o text-success' : 'fa-clock-o text-warning').'"></i> '.(count($interventi_programmati) == 0 ? tr('Non sono presenti altre attività programmate') : 'Attività aperte:');
<p><i class="fa '.(count($interventi_programmati) == 0 ? 'fa-clock-o text-success' : 'fa-clock-o text-warning').'"></i> '.(count($interventi_programmati) == 0 ? tr('Non sono presenti altre attività programmate') : 'Attività aperte:');
if (count($interventi_programmati) != 0) {
foreach ($interventi_programmati as $intervento_programmato) {
echo ' <a class="btn btn-default btn-xs" href="'.base_path().'/editor.php?id_module='.Modules::get('Interventi')['id'].'&id_record='.$intervento_programmato->id.'" target="_blank">'.$intervento_programmato->codice.' ('.(new Carbon($intervento_programmato->data_richiesta))->diffForHumans().')</a>';
@ -147,11 +181,11 @@ echo '
// Contratto
if ($contratto) {
echo '
<p style="margin:3px 0;"><i class="fa fa-book text-info"></i>
<p><i class="fa fa-book text-info"></i>
'.Modules::link('Contratti', $contratto->id, tr('Contratto num. _NUM_ del _DATA_', ['_NUM_' => $contratto->numero, '_DATA_' => Translator::dateToLocale($contratto->data_bozza)]));
if ($ore_previste > 0) {
echo '
- '.$ore_erogate.'/'.$ore_previste.' '.tr('ore').'<br>
- '.Translator::numberToLocale($ore_erogate, 2).'/'.$ore_previste.' '.tr('ore').'<br>
<div class="progress" style="margin:0; height:8px;">
<div class="progress-bar progress-bar-'.$color.'" style="width:'.$perc_ore.'%"></div>
@ -164,7 +198,7 @@ if ($contratto) {
// Preventivo
if ($preventivo) {
echo '
<p style="margin:3px 0;"><i class="fa fa-book text-info"></i>
<p><i class="fa fa-book text-info"></i>
'.Modules::link('Preventivi', $preventivo->id, tr('Preventivo num. _NUM_ del _DATA_', ['_NUM_' => $preventivo->numero, '_DATA_' => Translator::dateToLocale($preventivo->data_bozza)])).'
</p>';
}
@ -172,7 +206,7 @@ if ($preventivo) {
// Ordine
if ($ordine) {
echo '
<p style="margin:3px 0;"><i class="fa fa-book text-info"></i>
<p><i class="fa fa-book text-info"></i>
'.Modules::link('Ordini cliente', $ordine->id, tr('Ordine num. _NUM_ del _DATA_', ['_NUM_' => $ordine->numero, '_DATA_' => Translator::dateToLocale($ordine->data)])).'
</p>';
}
@ -193,7 +227,7 @@ $sede_azienda = $anagrafica_azienda->sedeLegale;
echo '
<div class="col-md-4">
<div class="card card-info">
<div class="card card-primary shadow">
<div class="card-header">
<h3 class="card-title"><i class="fa fa-map"></i> '.tr('Geolocalizzazione').'</h3>
</div>
@ -347,4 +381,12 @@ echo '
map.setView([lat, lng], 10);
}
max_height = 0;
$(".module-header .card").each( function(){
if($(this).height() > max_height){
max_height = $(this).height();
}
});
$(".module-header .card").height(max_height);
</script>';

View File

@ -44,23 +44,16 @@ $module = Module::where('name', 'Utenti e permessi')->first();
echo '
<div class="card card-widget widget-user">
<div class="widget-user-header bg-'.(($theme != 'default') ? $theme : 'primary').'">
<div class="widget-user-header bg-orange">
<h3 class="widget-user-username">'.$user['username'].'</h3>
<h5 class="widget-user-desc">'.$user['gruppo'].'</h5>
</div>
<div class="widget-user-image">';
$user_photo = $user->photo;
if ($user_photo) {
echo '
<img src="'.$user_photo.'" class="img-circle" alt="'.$user['username'].'" />';
} else {
echo '
<i style="color:white;margin-left:5px;" class="fa fa-user-circle-o fa-5x" alt="'.tr('OpenSTAManager').'"></i>';
}
$user_photo = $user->photo ?: $rootdir.'/assets/dist/img/user.png';
echo '
<img src="'.$user_photo.'" class="img-circle" alt="'.$user['username'].'" />
</div>
<div class="card-footer">
<div class="row">

View File

@ -11,7 +11,7 @@ ALTER TABLE `in_tags`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
-- Aggiunta modulo Tags
INSERT INTO `zz_modules` (`name`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`, `use_notes`, `use_checklists`) VALUES ('Tags', 'tags', 'SELECT |select| FROM `in_tags` WHERE 1=1 HAVING 2=2', '', 'fa fa-angle-right', '2.5.2', '2.5.2', '2', (SELECT `id` FROM `zz_modules` as b WHERE `name` = 'Interventi'), '1', '1', '1', '0');
INSERT INTO `zz_modules` (`name`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`, `use_notes`, `use_checklists`) VALUES ('Tags', 'tags', 'SELECT |select| FROM `in_tags` WHERE 1=1 HAVING 2=2', '', 'fa fa-angle-right', '2.5.2', '2.5.2', '2', (SELECT `id` FROM `zz_modules` as b WHERE `name` = 'Tabelle'), '1', '1', '1', '0');
INSERT INTO `zz_modules_lang` (`id_lang`, `id_record`, `title`) VALUES ('1', (SELECT MAX(id) FROM `zz_modules`), 'Tags');
-- Aggiunta viste Tags