2017-08-04 16:28:16 +02:00
< ? php
2020-09-07 15:04:06 +02:00
/*
* OpenSTAManager : il software gestionale open source per l ' assistenza tecnica e la fatturazione
2021-01-20 15:08:51 +01:00
* Copyright ( C ) DevCode s . r . l .
2020-09-07 15:04:06 +02:00
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < https :// www . gnu . org / licenses />.
*/
2017-08-04 16:28:16 +02:00
2024-03-05 16:01:45 +01:00
use Models\Module ;
2024-03-22 15:52:24 +01:00
use Util\FileSystem ;
2022-07-31 00:51:07 +02:00
2024-05-21 16:26:19 +02:00
include_once __DIR__ . '/../core.php' ;
2017-08-04 16:28:16 +02:00
2018-02-14 11:10:03 +01:00
$paths = App :: getPaths ();
2018-02-20 14:23:00 +01:00
$user = Auth :: user ();
2018-02-14 11:10:03 +01:00
2024-03-20 11:13:28 +01:00
$pageTitle = ! empty ( $pageTitle ) ? $pageTitle : $structure -> getTranslation ( 'title' );
2018-09-19 10:44:32 +02:00
2023-08-04 14:54:28 +02:00
$lang = ( empty ( $lang ) || $lang == '|lang|' ) ? 'it_IT' : $lang ;
2022-07-31 19:20:49 +02:00
2018-07-19 17:29:21 +02:00
$messages = flash () -> getMessages ();
2018-07-07 13:56:22 +02:00
2018-02-04 17:31:33 +01:00
echo ' <! DOCTYPE html >
2017-08-04 16:28:16 +02:00
< html >
< head >
< meta charset = " UTF-8 " >
2024-05-21 16:26:19 +02:00
< title > '.$pageTitle.' - '.tr(' OpenSTAManager ').' </ title >
2017-08-04 16:28:16 +02:00
< meta http - equiv = " X-UA-Compatible " content = " IE=edge " >
< meta content = " width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no " name = " viewport " >
2018-06-28 15:52:56 +02:00
< meta name = " robots " content = " noindex,nofollow " >
2024-05-21 16:26:19 +02:00
< meta name = " description " content = " '.tr('OpenSTAManager, il software gestionale open source per assistenza tecnica e fatturazione elettronica.').' " >
2022-06-21 18:38:39 +02:00
< meta name = " author " content = " DevCode s.r.l. " >
2020-06-30 17:38:19 +02:00
2024-05-21 16:26:19 +02:00
< link href = " '. $paths['img'] .'/favicon.png " rel = " icon " type = " image/x-icon " /> ' ;
2017-08-04 16:28:16 +02:00
2024-05-21 16:26:19 +02:00
if ( file_exists ( base_dir () . '/manifest.json' )) {
2019-08-02 10:38:55 +02:00
echo '
2024-05-21 16:26:19 +02:00
< link rel = " manifest " href = " '.base_path().'/manifest.json?r='.random_int(0, mt_getrandmax()).' " > ' ;
2019-08-02 10:38:55 +02:00
}
2018-06-23 15:41:32 +02:00
// CSS
foreach ( App :: getAssets ()[ 'css' ] as $style ) {
echo '
2024-05-21 16:26:19 +02:00
< link rel = " stylesheet " type = " text/css " media = " all " href = " '. $style .' " /> ' ;
2018-06-23 15:41:32 +02:00
}
2017-08-04 16:28:16 +02:00
2018-06-23 15:41:32 +02:00
// Print CSS
foreach ( App :: getAssets ()[ 'print' ] as $style ) {
2017-08-04 16:28:16 +02:00
echo '
2024-05-21 16:26:19 +02:00
< link rel = " stylesheet " type = " text/css " media = " print " href = " '. $style .' " /> ' ;
2017-08-04 16:28:16 +02:00
}
if ( Auth :: check ()) {
echo '
< script >
search = [] ' ;
2024-05-21 16:26:19 +02:00
$array = $_SESSION [ 'module_' . $id_module ];
2018-09-27 10:15:04 +02:00
if ( ! empty ( $array )) {
foreach ( $array as $field => $value ) {
2020-10-29 16:48:37 +01:00
if ( ! empty ( $value ) && string_starts_with ( $field , 'search_' )) {
2018-09-27 10:15:04 +02:00
$field_name = str_replace ( 'search_' , '' , $field );
echo '
2024-05-21 16:26:19 +02:00
search . push ( " search_'. $field_name .' " );
2024-05-23 11:36:25 +02:00
search [ " search_'. $field_name .' " ] = " '.addslashes((string) $value ).' " ; ' ;
2017-08-04 16:28:16 +02:00
}
}
}
echo '
translations = { ' ;
$translations = [
2017-09-04 12:02:29 +02:00
'day' => tr ( 'Giorno' ),
'week' => tr ( 'Settimana' ),
'month' => tr ( 'Mese' ),
'today' => tr ( 'Oggi' ),
2017-09-14 16:20:11 +02:00
'firstThreemester' => tr ( 'I trimestre' ),
'secondThreemester' => tr ( 'II trimestre' ),
'thirdThreemester' => tr ( 'III trimestre' ),
'fourthThreemester' => tr ( 'IV trimestre' ),
'firstSemester' => tr ( 'I semestre' ),
'secondSemester' => tr ( 'II semestre' ),
2017-09-04 12:02:29 +02:00
'thisMonth' => tr ( 'Questo mese' ),
'lastMonth' => tr ( 'Mese scorso' ),
2021-10-05 11:31:26 +02:00
'nextMonth' => tr ( 'Mese prossimo' ),
2017-09-04 12:02:29 +02:00
'thisYear' => tr ( " Quest'anno " ),
'lastYear' => tr ( 'Anno scorso' ),
2024-03-19 17:11:54 +01:00
'lastYear_thisYear' => tr ( " Quest'anno + prec. " ),
2017-09-04 12:02:29 +02:00
'apply' => tr ( 'Applica' ),
'cancel' => tr ( 'Annulla' ),
'from' => tr ( 'Da' ),
'to' => tr ( 'A' ),
'custom' => tr ( 'Personalizzato' ),
'delete' => tr ( 'Elimina' ),
'deleteTitle' => tr ( 'Sei sicuro?' ),
'deleteMessage' => tr ( 'Eliminare questo elemento?' ),
2018-08-31 18:06:44 +02:00
'errorTitle' => tr ( 'Errore' ),
'errorMessage' => tr ( " Si è verificato un errore nell'esecuzione dell'operazione richiesta " ),
2017-09-04 12:02:29 +02:00
'close' => tr ( 'Chiudi' ),
'filter' => tr ( 'Filtra' ),
'long' => tr ( 'La ricerca potrebbe richiedere del tempo' ),
'details' => tr ( 'Dettagli' ),
2020-09-14 10:22:04 +02:00
'loading' => tr ( 'Caricamento' ),
2017-09-04 12:02:29 +02:00
'waiting' => tr ( 'Impossibile procedere' ),
2022-02-05 22:37:45 +01:00
'waitingMessage' => tr ( 'Prima di proseguire devi selezionare alcuni elementi.' ),
2019-05-24 21:36:35 +02:00
'hooksExecuting' => tr ( 'Hooks in esecuzione' ),
2019-05-17 05:56:10 +02:00
'hookExecuting' => tr ( 'Hook "_NAME_" in esecuzione' ),
'hookMultiple' => tr ( 'Hai _NUM_ notifiche' ),
'hookSingle' => tr ( 'Hai 1 notifica' ),
'hookNone' => tr ( 'Nessuna notifica' ),
2022-02-05 22:37:45 +01:00
'singleCalendar' => tr ( " E' presente un solo periodo. " ),
2021-07-27 11:37:04 +02:00
'noResults' => tr ( 'Nessun elemento trovato' ),
2022-02-05 22:37:45 +01:00
'signatureMissing' => tr ( 'Firma mancante.' ),
2017-08-04 16:28:16 +02:00
];
foreach ( $translations as $key => $value ) {
echo '
2024-05-21 16:26:19 +02:00
'.$key.' : " '.addslashes( $value ).' " , ' ;
2017-08-04 16:28:16 +02:00
}
echo '
2021-07-20 15:23:39 +02:00
allegati : {
2024-05-21 16:26:19 +02:00
messaggio : " '.tr('Clicca o trascina qui per caricare uno o più file').' " ,
maxFilesize : " '.tr('Dimensione massima: _SIZE_ MB').' " ,
errore : " '.tr('Errore').' " ,
modifica : " '.tr('Modifica allegato').' " ,
elimina : " '.tr('Vuoi eliminare questo file?').' " ,
procedi : " '.tr('Procedi').' " ,
2021-07-20 15:23:39 +02:00
},
2020-08-03 12:08:52 +02:00
ajax : {
" missing " : {
2024-05-21 16:26:19 +02:00
" title " : " '.tr('Errore').' " ,
" text " : " '.tr('Alcuni campi obbligatori non sono stati compilati correttamente').' " ,
2020-08-03 12:08:52 +02:00
},
" error " : {
2024-05-21 16:26:19 +02:00
" title " : " '.tr('Errore').' " ,
" text " : " '.tr('Errore durante il salvataggio del record').' " ,
2020-08-03 12:08:52 +02:00
}
},
2019-08-02 15:58:31 +02:00
password : {
2024-05-21 16:26:19 +02:00
" wordMinLength " : " '.tr('La password è troppo corta').' " ,
" wordMaxLength " : " '.tr('La password è troppo lunga').' " ,
" wordInvalidChar " : " '.tr('La password contiene un carattere non valido').' " ,
" wordNotEmail " : " '.tr('Non usare la tua e-mail come password').' " ,
" wordSimilarToUsername " : " '.tr('La password non può contenere il tuo nome').' " ,
" wordTwoCharacterClasses " : " '.tr('Usa classi di caratteri diversi').' " ,
" wordRepetitions " : " '.tr('La password contiene ripetizioni').' " ,
" wordSequences " : " '.tr('La password contiene sequenze').' " ,
" errorList " : " '.tr('Attenzione').': " ,
" veryWeak " : " '.tr('Molto debole').' " ,
" weak " : " '.tr('Debole').' " ,
" normal " : " '.tr('Normale').' " ,
" medium " : " '.tr('Media').' " ,
" strong " : " '.tr('Forte').' " ,
" veryStrong " : " '.tr('Molto forte').' " ,
2019-07-19 09:32:50 +02:00
},
2019-08-02 15:58:31 +02:00
datatables : {
2024-05-21 16:26:19 +02:00
" emptyTable " : " '.tr('Nessun dato presente nella tabella').' " ,
" info " : " '.tr('Vista da _START_ a _END_ di _TOTAL_ elementi').' " ,
" infoEmpty " : " '.tr('Vista da 0 a 0 di 0 elementi').' " ,
" infoFiltered " : " ('.tr('filtrati da _MAX_ elementi totali').') " ,
2019-08-02 15:58:31 +02:00
" infoPostFix " : " " ,
2024-05-21 16:26:19 +02:00
" lengthMenu " : " '.tr('Visualizza _MENU_ elementi').' " ,
2019-08-02 15:58:31 +02:00
" loadingRecords " : " " ,
2024-05-21 16:26:19 +02:00
" processing " : " '.tr('Elaborazione').'... " ,
" search " : " '.tr('Cerca').': " ,
" zeroRecords " : " '.tr('La ricerca non ha portato alcun risultato').'. " ,
2019-08-02 15:58:31 +02:00
" paginate " : {
2024-05-21 16:26:19 +02:00
" first " : " '.tr('Inizio').' " ,
" previous " : " '.tr('Precedente').' " ,
" next " : " '.tr('Successivo').' " ,
" last " : " '.tr('Fine').' "
2019-08-02 15:58:31 +02:00
},
},
2017-08-04 16:28:16 +02:00
};
globals = {
2024-05-21 16:26:19 +02:00
rootdir : " '.base_path().' " ,
js : " '. $paths['js'] .' " ,
css : " '. $paths['css'] .' " ,
img : " '. $paths['img'] .' " ,
2018-02-23 09:49:31 +01:00
2024-05-21 16:26:19 +02:00
id_module : " '. $id_module .' " ,
id_record : " '. $id_record .' " ,
2020-06-30 17:38:19 +02:00
2024-05-21 16:26:19 +02:00
is_mobile : '.isMobile().' ,
2018-02-23 09:49:31 +01:00
2024-05-21 16:26:19 +02:00
cifre_decimali : '.setting(' Cifre decimali per importi ').' ,
2018-02-23 09:49:31 +01:00
2024-05-21 16:26:19 +02:00
timestamp_format : " '.formatter()->getTimestampPattern().' " ,
date_format : " '.formatter()->getDatePattern().' " ,
time_format : " '.formatter()->getTimePattern().' " ,
decimals : " '.formatter()->getNumberSeparators()['decimals'].' " ,
thousands : " '.formatter()->getNumberSeparators()['thousands'].' " ,
currency : " '.currency().' " ,
2018-02-23 09:49:31 +01:00
2017-08-04 16:28:16 +02:00
search : search ,
translations : translations ,
2024-05-23 11:36:25 +02:00
locale : " '.explode('_', (string) $lang )[0].' " ,
2024-05-21 16:26:19 +02:00
full_locale : " '. $lang .' " ,
2018-02-23 09:49:31 +01:00
2024-05-21 16:26:19 +02:00
start_date : " '. $_SESSION['period_start'] .' " ,
start_date_formatted : " '.Translator::dateToLocale( $_SESSION['period_start'] ).' " ,
end_date : " '. $_SESSION['period_end'] .' " ,
end_date_formatted : " '.Translator::dateToLocale( $_SESSION['period_end'] ).' " ,
minute_stepping : '.setting(' Numero di minuti di avanzamento delle sessioni delle attività ').' ,
2018-02-23 09:49:31 +01:00
2024-05-21 16:26:19 +02:00
collapse_plugin_sidebar : '.intval(setting(' Nascondere la barra dei plugin di default ')).' ,
2021-07-27 11:37:04 +02:00
2018-02-23 09:49:31 +01:00
ckeditorToolbar : [
2022-07-31 02:59:22 +02:00
[ " Undo " , " Redo " , " - " , " Cut " , " Copy " , " Paste " , " PasteText " , " PasteFromWord " , " - " , " SpellChecker " , " Scayt " , " - " , " Link " , " Unlink " , " - " , " Bold " , " Italic " , " Underline " , " Superscript " , " SpecialChar " , " HorizontalRule " , " - " , " JustifyLeft " , " JustifyCenter " , " JustifyRight " , " JustifyBlock " , " - " , " NumberedList " , " BulletedList " , " Outdent " , " Indent " , " Blockquote " , " - " , " Styles " , " Format " , " Image " , " Table " , " TextColor " , " BGColor " , " EmojiPanel " ],
2018-02-23 09:49:31 +01:00
],
2021-05-26 14:08:21 +02:00
ckeditorToolbar_Full : [
2021-10-25 16:39:37 +02:00
{ name : " document " , items : [ " Source " , " ExportPdf " , " Preview " , " Print " , " - " , " Templates " ] },
2021-05-26 14:08:21 +02:00
{ name : " clipboard " , items : [ " Cut " , " Copy " , " Paste " , " PasteText " , " PasteFromWord " , " - " , " Undo " , " Redo " ] },
{ name : " editing " , items : [ " Find " , " Replace " , " - " , " SelectAll " , " - " , " SpellChecker " , " Scayt " ] },
{ name : " forms " , items : [ " Form " , " Checkbox " , " Radio " , " TextField " , " Textarea " , " Select " , " Button " , " ImageButton " ,
" HiddenField " ] },
" / " ,
2021-10-25 16:39:37 +02:00
{ name : " basicstyles " , items : [ " Bold " , " Italic " , " Underline " , " Strike " , " Subscript " , " Superscript " , " - " , " CopyFormatting " , " RemoveFormat " ] },
2021-05-26 14:08:21 +02:00
{ name : " paragraph " , items : [ " NumberedList " , " BulletedList " , " - " , " Outdent " , " Indent " , " - " , " Blockquote " , " CreateDiv " ,
2021-10-25 16:39:37 +02:00
" - " , " JustifyLeft " , " JustifyCenter " , " JustifyRight " , " JustifyBlock " , " - " , " BidiLtr " , " BidiRtl " , " Language " ] },
2021-05-26 14:08:21 +02:00
{ name : " links " , items : [ " Link " , " Unlink " , " Anchor " ] },
2022-07-31 02:59:22 +02:00
{ name : " insert " , items : [ " Image " , " Flash " , " Table " , " HorizontalRule " , " EmojiPanel " , " SpecialChar " , " PageBreak " , " Iframe " ] },
2021-05-26 14:08:21 +02:00
" / " ,
{ name : " styles " , items : [ " Styles " , " Format " , " Font " , " FontSize " ] },
{ name : " colors " , items : [ " TextColor " , " BGColor " ] },
2021-10-25 16:39:37 +02:00
{ name : " tools " , items : [ " Maximize " , " ShowBlocks " ] },
{ name : " about " , items : [ " About " ] }
2021-05-26 14:08:21 +02:00
],
2024-05-21 16:26:19 +02:00
order_manager_id : " '.( $dbo->isInstalled () ? (new Module())->getByField('title', 'Stato dei servizi', Models \ Locale::getPredefined()->id) : '').' " ,
dataload_page_buffer : '.setting(' Lunghezza in pagine del buffer Datatables ').' ,
tempo_attesa_ricerche : '.setting(' Tempo di attesa ricerche in secondi ').' ,
restrict_summables_to_selected : '.setting(' Totali delle tabelle ristretti alla selezione ').' ,
snapDuration : " '.setting('Tempo predefinito di snap attività sul calendario').' "
2017-08-04 16:28:16 +02:00
};
</ script > ' ;
2018-07-03 11:12:32 +02:00
} else {
echo '
2018-07-09 10:44:54 +02:00
< script >
globals = {
2024-05-21 16:26:19 +02:00
rootdir : " '.base_path().' " ,
2020-06-30 17:38:19 +02:00
2019-07-08 12:41:37 +02:00
search : {},
2019-07-19 09:32:50 +02:00
translations : {
password : {
2024-05-21 16:26:19 +02:00
" wordMinLength " : " '.tr('La tua password è troppo corta').' " ,
" wordMaxLength " : " '.tr('La tua password è troppo lunga').' " ,
" wordInvalidChar " : " '.tr('La tua password contiene un carattere non valido').' " ,
" wordNotEmail " : " '.tr('Non usare la tua e-mail come password').' " ,
" wordSimilarToUsername " : " '.tr('La tua password non può contenere il tuo nome').' " ,
" wordTwoCharacterClasses " : " '.tr('Usa classi di caratteri diversi').' " ,
" wordRepetitions " : " '.tr('Troppe ripetizioni').' " ,
" wordSequences " : " '.tr('La tua password contiene sequenze').' " ,
" errorList " : " '.tr('Errori').': " ,
" veryWeak " : " '.tr('Molto debole').' " ,
" weak " : " '.tr('Debole').' " ,
" normal " : " '.tr('Normale').' " ,
" medium " : " '.tr('Media').' " ,
" strong " : " '.tr('Forte').' " ,
" veryStrong " : " '.tr('Molto forte').' " ,
2019-07-19 09:32:50 +02:00
},
},
2020-06-30 17:38:19 +02:00
2024-05-21 16:26:19 +02:00
timestamp_format : " '.formatter()->getTimestampPattern().' " ,
date_format : " '.formatter()->getDatePattern().' " ,
time_format : " '.formatter()->getTimePattern().' " ,
2019-08-02 15:58:31 +02:00
2024-05-23 11:36:25 +02:00
locale : " '.explode('_', (string) $lang )[0].' " ,
2024-05-21 16:26:19 +02:00
full_locale : " '. $lang .' " ,
2018-07-09 10:44:54 +02:00
};
</ script > ' ;
2017-08-04 16:28:16 +02:00
}
2018-06-23 15:41:32 +02:00
// JS
foreach ( App :: getAssets ()[ 'js' ] as $js ) {
2017-08-04 16:28:16 +02:00
echo '
2024-05-21 16:26:19 +02:00
< script type = " text/javascript " charset = " utf-8 " src = " '. $js .' " ></ script > ' ;
2017-08-04 16:28:16 +02:00
}
// Impostazioni di default per gli alert
echo '
< script >
swal . setDefaults ({
buttonsStyling : false ,
confirmButtonClass : " btn btn-lg btn-primary " ,
cancelButtonClass : " btn btn-lg " ,
2024-05-21 16:26:19 +02:00
cancelButtonText : " '.tr('Annulla').' " ,
2017-08-04 16:28:16 +02:00
});
</ script > ' ;
2018-07-02 16:56:00 +02:00
if ( Auth :: check ()) {
2018-07-09 10:44:54 +02:00
if ( setting ( 'Abilita esportazione Excel e PDF' )) {
2018-07-02 16:56:00 +02:00
echo '
2024-02-23 12:08:25 +01:00
< script type = " text/javascript " charset = " utf-8 " src = " https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js " ></ script >
< script type = " text/javascript " charset = " utf-8 " src = " https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.9/pdfmake.min.js " ></ script >
< script type = " text/javascript " charset = " utf-8 " src = " https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.9/vfs_fonts.min.js " ></ script > ' ;
2018-07-02 16:56:00 +02:00
}
2020-02-20 02:02:01 +01:00
if ( setting ( 'Attiva scorciatoie da tastiera' )) {
2024-05-21 16:26:19 +02:00
echo '<script type="text/javascript" charset="utf-8" src="' . App :: getPaths ()[ 'js' ] . '/hotkeys-js/hotkeys.min.js?v=' . $version . '"></script>' ;
2020-02-20 02:02:01 +01:00
echo '
< script >
2021-05-26 16:42:53 +02:00
hotkeys ( " f1,f2,f3,f4 " , function ( event , handler ) {
switch ( handler . key ) {
2021-07-20 15:23:39 +02:00
case " f1 " :
2021-05-26 16:42:53 +02:00
event . preventDefault ();
$ ( " button[data-toggle] " ) . first () . trigger ( " click " );
break ;
case " f2 " :
event . preventDefault ();
$ ( " #save " ) . first () . trigger ( " click " );
break ;
case " f3 " :
event . preventDefault ();
2021-11-15 12:02:21 +01:00
window . open ( $ ( " #print-button_p " ) . first () . attr ( " href " ));
2021-05-26 16:42:53 +02:00
break ;
case " f4 " :
event . preventDefault ();
$ ( " #email-button_p " ) . first () . trigger ( " click " );
break ;
default : alert ( event );
}
2020-02-20 02:02:01 +01:00
});
2021-05-26 16:42:53 +02:00
2020-02-20 02:02:01 +01:00
</ script > ' ;
}
2017-08-04 16:28:16 +02:00
}
2024-01-31 14:23:46 +01:00
// Set the group theme
if ( isset ( $user )) {
if ( $user -> getThemeAttribute ()) {
2024-01-19 10:32:20 +01:00
$theme = $user -> getThemeAttribute ();
}
}
2024-05-17 12:11:00 +02:00
if ( $theme == 'default' ) {
$theme = 'sidebar-dark-secondary' ;
} else {
$theme = 'bg-' . $theme ;
}
2020-09-23 17:53:19 +02:00
$settings_collapse = session_get ( 'settings.sidebar-collapse' ) ? 1 : 0 ;
2020-09-22 20:28:37 +02:00
$hide_sidebar = Auth :: check () && ( setting ( 'Nascondere la barra sinistra di default' ) || $settings_collapse );
2017-08-04 16:28:16 +02:00
echo '
</ head >
2024-05-21 16:26:19 +02:00
< body class = " sidebar-mini layout-fixed '.(!empty( $hide_sidebar ) ? ' sidebar-collapse' : '').(!Auth::check() ? ' hold-transition login-page' : '').' " >
< div class = " '.(!Auth::check() ? '' : 'wrapper').' " > ' ;
2017-08-04 16:28:16 +02:00
if ( Auth :: check ()) {
2024-05-21 16:26:19 +02:00
$calendar_color_label = ( $_SESSION [ 'period_start' ] != date ( 'Y' ) . '-01-01' || $_SESSION [ 'period_end' ] != date ( 'Y' ) . '-12-31' ) ? 'danger' : 'secondary' ;
2017-08-04 16:28:16 +02:00
echo '
<!-- Loader principale -->
2024-05-17 00:32:46 +02:00
<!-- Preloader -->
< div id = " main_loading " class = " preloader flex-column justify-content-center align-items-center " >
< img class = " animation__shake " src = " '. $rootdir .'/assets/dist/img/logo.png " alt = " OSM " height = " 60 " width = " 60 " >
</ div >
2017-08-04 16:28:16 +02:00
<!-- Loader secondario -->
< div id = " mini-loader " style = " display:none; " >
< div ></ div >
</ div >
2017-09-10 18:29:51 +02:00
2017-08-31 19:06:23 +02:00
<!-- Loader senza overlay -->
< div id = " tiny-loader " style = " display:none; " ></ div >
2017-08-04 16:28:16 +02:00
2024-05-17 00:32:46 +02:00
<!-- Navbar -->
< nav class = " main-header navbar navbar-expand navbar-white navbar-light " >
< ul class = " navbar-nav " >
< li class = " nav-item " >
< a class = " nav-link " data - widget = " pushmenu " href = " # " role = " button " >< i class = " fa fa-bars " ></ i ></ a >
</ li >
< li class = " nav-item " >
< a href = " # " id = " daterange " class = " nav-link " role = " button " >
< i class = " fa fa-calendar " ></ i > < i class = " fa fa-caret-down " ></ i >
</ a >
</ li >
< li class = " nav-item d-none d-sm-inline-block " >
2024-05-21 16:26:19 +02:00
< a class = " nav-link text-'. $calendar_color_label .' " >
'.Translator::dateToLocale($_SESSION[' period_start ']).' - '.Translator::dateToLocale($_SESSION[' period_end ']).'
2024-05-17 00:32:46 +02:00
</ a >
</ li >
</ ul >
2019-08-02 15:58:31 +02:00
2024-05-22 09:50:22 +02:00
<!-- Navbar Right Menu -->
< ul class = " navbar-nav ml-auto " > ' ;
2024-03-22 15:52:24 +01:00
// Visualizzo gli hooks solo se non sono stati disabilitati
2024-03-05 17:39:32 +01:00
if ( ! $config [ 'disable_hooks' ]) {
2023-08-04 14:54:28 +02:00
echo '
2024-05-22 09:50:22 +02:00
< div class = " nav-item dropdown " >
< a href = " # " class = " nav-link dropdown-toggle " data - toggle = " dropdown " >
< i class = " fa fa-bell-o " ></ i >
< span id = " hooks-badge " class = " badge badge-warning " >
< span id = " hooks-loading " >< i class = " fa fa-spinner fa-spin " ></ i ></ span >
< span id = " hooks-notified " ></ span >
< span id = " hooks-counter " class = " d-none " > 0 </ span >
< span id = " hooks-number " class = " d-none " > 0 </ span >
</ span >
</ a >
< div class = " dropdown-menu dropdown-menu-lg dropdown-menu-right " >
< a href = " # " class = " dropdown-item " >
< span class = " small " id = " hooks-header " ></ span >
2024-05-17 00:32:46 +02:00
</ a >
2024-05-22 09:50:22 +02:00
< div id = " hooks " ></ div >
</ div >
</ div > ' ;
2024-03-05 17:39:32 +01:00
}
2023-03-22 17:00:48 +01:00
2024-03-05 17:39:32 +01:00
echo '
2024-05-22 09:50:22 +02:00
< li class = " nav-item " >
< a href = " # " onclick = " window.print() " class = " nav-link " title = " '.tr('Stampa').' " >
< i class = " fa fa-print nav-icon " ></ i >
</ a >
</ li >
2019-08-02 15:58:31 +02:00
2024-05-22 09:50:22 +02:00
< li class = " nav-item " >
< a href = " '.base_path().'/log.php " class = " nav-link " title = " '.tr('Log accessi').' " >
< i class = " fa fa-book nav-icon " ></ i >
</ a >
</ li >
2019-08-02 15:58:31 +02:00
2024-05-22 09:50:22 +02:00
< li class = " nav-item " >
< a href = " '.base_path().'/shortcuts.php " class = " nav-link " title = " '.tr('Scorciatoie').' " >
< i class = " fa fa-keyboard-o nav-icon " ></ i >
</ a >
</ li >
2019-08-02 15:58:31 +02:00
2024-05-22 09:50:22 +02:00
< li class = " nav-item " >
< a href = " '.base_path().'/info.php " class = " nav-link " title = " '.tr('Informazioni').' " >
< i class = " fa fa-info nav-icon " ></ i >
</ a >
</ li >
2023-06-13 13:15:31 +02:00
2024-05-22 09:50:22 +02:00
< li class = " nav-item " >
< a href = " '.base_path().'/index.php?op=logout " onclick = " sessionStorage.clear() " class = " nav-link bg-danger " title = " '.tr('Esci').' " >
< i class = " fa fa-power-off nav-icon " ></ i >
</ a >
</ li >
</ ul >
</ nav >
<!-- /. navbar -->
2024-05-17 00:32:46 +02:00
2024-05-22 09:50:22 +02:00
<!-- Main Sidebar Container -->
< aside class = " main-sidebar '. $theme .' elevation-4 " >
< a href = " '.tr('https://www.openstamanager.com').' " class = " brand-link " title = " '.tr( " Il gestionale open source per l 'assistenza tecnica e la fatturazione").' " target= " _blank " >
< img src = " '. $rootdir .'/assets/dist/img/logo_completo.png " alt = " '.tr( " Il gestionale open source per l 'assistenza tecnica e la fatturazione").' " class= " img - fluid " >
< span class = " brand-text font-weight-light " >& nbsp ; </ span >
</ a >
2024-05-17 00:32:46 +02:00
2024-05-22 09:50:22 +02:00
<!-- Sidebar -->
< div class = " sidebar " >
2024-05-17 00:32:46 +02:00
2024-05-22 09:50:22 +02:00
<!-- Sidebar user panel ( optional ) -->
< div class = " user-panel mt-3 pb-3 mb-3 d-flex " >
< div class = " image " > ' ;
2019-07-18 18:33:56 +02:00
$user_photo = $user -> photo ;
if ( $user_photo ) {
echo '
2024-05-22 09:50:22 +02:00
< img src = " '. $user_photo .' " class = " img-circle elevation-2 " alt = " '. $user['username'] .' " /> ' ;
2019-07-18 18:33:56 +02:00
} else {
echo '
2024-05-22 09:50:22 +02:00
< i class = " fa fa-user-circle-o fa-2x " alt = " '.tr('Utente').' " ></ i > ' ;
2019-07-18 18:33:56 +02:00
}
echo '
2024-05-22 09:50:22 +02:00
</ div >
2024-05-17 00:32:46 +02:00
2024-05-22 09:50:22 +02:00
< div class = " info " >
< a href = " '.base_path().'/modules/utenti/info.php " class = " d-block " >
'.$user[' username '].'
</ a >
2017-08-04 16:28:16 +02:00
</ div >
2024-05-22 09:50:22 +02:00
</ div >
2017-08-04 16:28:16 +02:00
2024-05-17 00:32:46 +02:00
2024-05-22 09:50:22 +02:00
<!-- SidebarSearch Form -->
< div class = " form-inline " >
< div class = " input-group " data - widget = " sidebar-search " >
< input class = " form-control form-control-sidebar " id = " supersearch " type = " search " placeholder = " '.tr('Cerca').' " aria - label = " '.tr('Cerca').' " >
< div class = " input-group-append " >
< button class = " btn btn-sidebar " >
< i class = " fa fa-search fa-fw " ></ i >
</ button >
2017-08-04 16:28:16 +02:00
</ div >
</ div >
2024-05-22 09:50:22 +02:00
</ div >
2017-08-04 16:28:16 +02:00
2024-05-22 09:50:22 +02:00
<!-- Sidebar Menu -->
< nav class = " mt-2 " >
< ul class = " nav nav-pills nav-sidebar flex-column " data - widget = " treeview " role = " menu " > ' ;
2017-08-04 16:28:16 +02:00
echo Modules :: getMainMenu ();
echo '
2024-05-22 09:50:22 +02:00
</ ul >
</ section >
<!-- /. sidebar -->
</ aside > ' ;
2017-08-04 16:28:16 +02:00
2020-10-29 16:48:37 +01:00
if ( string_contains ( $_SERVER [ 'SCRIPT_FILENAME' ], 'editor.php' )) {
2020-08-26 16:17:04 +02:00
// Menu laterale per la visualizzazione dei plugin
echo '
2024-05-23 17:51:21 +02:00
< div class = " control-sidebar-button " >< i class = " fa fa-chevron-left " ></ i ></ div >
2021-07-27 11:37:04 +02:00
< aside class = " control-sidebar control-sidebar-light " >
2024-05-21 16:26:19 +02:00
< h4 >< i class = " fa fa-plug " ></ i > '.tr(' Plugin ').' </ h4 >
2020-08-26 16:17:04 +02:00
< ul class = " nav nav-tabs nav-pills nav-stacked " >
2024-05-16 18:02:50 +02:00
< li data - toggle = " control-sidebar " class = " active btn-default nav-item " >
2024-05-21 17:00:50 +02:00
< a class = " nav-link " data - toggle = " tab " href = " #tab_0 " >
'.$structure->getTranslation(' title ').'
</ a >
</ li > ' ;
2020-08-26 16:17:04 +02:00
2024-05-17 00:32:46 +02:00
// Tab dei plugin
if ( ! empty ( $id_record )) {
2024-05-21 16:26:19 +02:00
$plugins = $dbo -> fetchArray ( 'SELECT `zz_plugins`.`id`, `title`, `options`, `options2` FROM `zz_plugins` LEFT JOIN `zz_plugins_lang` ON (`zz_plugins`.`id` = `zz_plugins_lang`.`id_record` AND `zz_plugins_lang`.`id_lang` = ' . prepare ( Models\Locale :: getDefault () -> id ) . ') WHERE `idmodule_to`=' . prepare ( $id_module ) . " AND `position`='tab' AND `enabled` = 1 ORDER BY `zz_plugins`.`order` DESC " );
2024-05-17 00:32:46 +02:00
foreach ( $plugins as $plugin ) {
// Badge count per record plugin
$count = 0 ;
$opt = '' ;
if ( ! empty ( $plugin [ 'options2' ])) {
2024-05-23 11:36:25 +02:00
$opt = json_decode (( string ) $plugin [ 'options2' ], true );
2024-05-17 00:32:46 +02:00
} elseif ( ! empty ( $plugin [ 'options' ])) {
2024-05-23 11:36:25 +02:00
$opt = json_decode (( string ) $plugin [ 'options' ], true );
2024-05-17 00:32:46 +02:00
}
if ( ! empty ( $opt )) {
$q = str_replace ( '|id_parent|' , $id_record , $opt [ 'main_query' ][ 0 ][ 'query' ]);
$count = $dbo -> fetchNum ( $q );
}
echo '
2024-05-21 17:00:50 +02:00
< li data - toggle = " control-sidebar " class = " btn-default nav-item " >
< a class = " nav-link " data - toggle = " tab " href = " #tab_'. $plugin['id'] .' " id = " link-tab_'. $plugin['id'] .' " >
2024-05-21 16:26:19 +02:00
'.$plugin[' title '].'
< span class = " right badge badge-danger " > '.($count > 0 ? $count : ' ').' </ span >
2024-05-16 18:02:50 +02:00
</ a >
</ li > ' ;
2024-05-17 00:32:46 +02:00
}
}
// Tab per le note interne
if ( $structure -> permission != '-' && $structure -> use_notes ) {
$notes = $structure -> recordNotes ( $id_record );
echo '
2024-05-21 17:00:50 +02:00
< li data - toggle = " control-sidebar " class = " btn-default nav-item " >
< a class = " bg-info nav-link " data - toggle = " tab " href = " #tab_note " id = " link-tab_note " >
'.tr(' Note interne ').'
2024-05-21 16:26:19 +02:00
< span class = " badge pull-right " > '.($notes->count() ?: ' ').' </ span >
2024-05-16 18:02:50 +02:00
</ a >
</ li > ' ;
2024-05-17 00:32:46 +02:00
}
2024-05-21 17:00:50 +02:00
// Tab per le checklist
2024-05-17 00:32:46 +02:00
// Tab per le checklist
if ( $structure -> permission != '-' && $structure -> use_checklists ) {
$checklists_unchecked = $structure -> recordChecks ( $id_record ) -> where ( 'checked_at' , null );
$checklists_total = $structure -> recordChecks ( $id_record );
2024-05-23 11:36:25 +02:00
2024-05-17 00:32:46 +02:00
echo '
2024-05-21 17:00:50 +02:00
< li data - toggle = " control-sidebar " class = " btn-default nav-item " >
< a class = " bg-info nav-link " data - toggle = " tab " href = " #tab_checks " id = " link-tab_checks " >
'.tr(' Checklist ' )
2024-05-23 11:36:25 +02:00
. ( $checklists_total ? ' <span class="badge pull-right">' . $checklists_unchecked -> count () . tr ( ' / ' ) . $checklists_total -> count () . '</span>' : '' )
. '
2024-05-21 17:00:50 +02:00
</ a >
</ li > ' ;
2024-05-17 00:32:46 +02:00
}
// Tab per le informazioni sulle operazioni
if ( Auth :: admin ()) {
echo '
2024-05-21 17:00:50 +02:00
< li data - toggle = " control-sidebar " class = " btn-default nav-item " >
< a class = " bg-info nav-link " data - toggle = " tab " href = " #tab_info " id = " link-tab_info " >
'.tr(' Info ').'
2024-05-16 18:02:50 +02:00
</ a >
</ li > ' ;
2024-05-17 00:32:46 +02:00
}
echo '
2020-08-26 16:17:04 +02:00
</ ul >
</ aside >
< div class = " control-sidebar-bg " ></ div > ' ;
}
echo '
2024-05-17 00:32:46 +02:00
<!-- Main content -->
< div class = " content-wrapper " >
< section class = " content " > ' ;
2017-08-04 16:28:16 +02:00
2020-10-29 16:48:37 +01:00
if ( string_contains ( $_SERVER [ 'SCRIPT_FILENAME' ], 'editor.php' )) {
2017-08-04 16:28:16 +02:00
$location = 'editor_right' ;
2020-10-29 16:48:37 +01:00
} elseif ( string_contains ( $_SERVER [ 'SCRIPT_FILENAME' ], 'controller.php' )) {
2017-08-04 16:28:16 +02:00
$location = 'controller_right' ;
}
2018-09-04 12:30:22 +02:00
// Eventuale messaggio personalizzato per l'installazione corrente
2020-09-22 20:28:37 +02:00
$extra_file = App :: filepath ( 'include/custom/extra' , 'extra.php' );
if ( $extra_file ) {
include_once $extra_file ;
}
2018-09-04 12:30:22 +02:00
} else {
// Eventuale messaggio personalizzato per l'installazione corrente
2020-09-22 20:28:37 +02:00
$extra_file = App :: filepath ( 'include/custom/extra' , 'login.php' );
if ( $extra_file ) {
include_once $extra_file ;
}
2018-09-04 12:30:22 +02:00
2024-01-18 20:40:52 +01:00
if ( ! empty ( $messages [ 'warning' ]) || ! empty ( $messages [ 'error' ])) {
2018-09-04 12:30:22 +02:00
echo '
2024-05-16 18:02:50 +02:00
< div class = " card card-warning card-center " >
< div class = " card-header with-border text-center " >
2024-05-21 16:26:19 +02:00
< h3 class = " card-title " > '.tr(' Informazioni ').' </ h3 >
2017-08-04 16:28:16 +02:00
</ div >
2024-05-16 18:02:50 +02:00
< div class = " card-body " > ' ;
2018-09-04 12:30:22 +02:00
}
2017-08-04 16:28:16 +02:00
}
2018-07-19 12:47:28 +02:00
2017-08-04 16:28:16 +02:00
// Infomazioni
2018-07-19 12:47:28 +02:00
if ( ! empty ( $messages [ 'info' ])) {
foreach ( $messages [ 'info' ] as $value ) {
2023-12-01 17:14:54 +01:00
echo '
< script >
$ ( document ) . ready ( function (){
2024-05-21 16:26:19 +02:00
window . parent . toastr . success ( " '. $value .' " , toastr . options );
2023-12-01 17:14:54 +01:00
});
</ script > ' ;
2018-07-19 12:47:28 +02:00
}
2017-08-04 16:28:16 +02:00
}
// Errori
2018-07-19 12:47:28 +02:00
if ( ! empty ( $messages [ 'error' ])) {
foreach ( $messages [ 'error' ] as $value ) {
echo '
2017-08-04 16:28:16 +02:00
< div class = " alert alert-danger push " >
2024-05-21 16:26:19 +02:00
< h4 >< i class = " fa fa fa-ban " ></ i > '.tr(' Errore ').' </ h4 >
'.$value.'
2017-08-04 16:28:16 +02:00
</ div > ' ;
2018-07-19 12:47:28 +02:00
}
2017-08-04 16:28:16 +02:00
}
// Avvisi
2018-07-19 12:47:28 +02:00
if ( ! empty ( $messages [ 'warning' ])) {
foreach ( $messages [ 'warning' ] as $value ) {
echo '
2017-08-04 16:28:16 +02:00
< div class = " alert alert-warning push " >
2024-05-21 16:26:19 +02:00
< h4 >< i class = " fa fa-warning " ></ i > '.tr(' Attenzione ').' </ h4 >
'.$value.'
2017-08-04 16:28:16 +02:00
</ div > ' ;
2018-07-19 12:47:28 +02:00
}
2017-08-04 16:28:16 +02:00
}
2018-07-07 13:56:22 +02:00
if ( ! Auth :: check () && ( ! empty ( $messages [ 'info' ]) || ! empty ( $messages [ 'warning' ]) || ! empty ( $messages [ 'error' ]))) {
2017-08-04 16:28:16 +02:00
echo '
</ div >
</ div > ' ;
}
2020-11-23 18:08:40 +01:00
2020-11-27 15:19:47 +01:00
// Messaggio informativo per l'esaurimento dello spazio totale disponibile nel server
$free_space = disk_free_space ( '.' );
2020-11-27 16:49:10 +01:00
$space_limit = 1 ; // GB
2021-02-25 11:07:23 +01:00
if ( $free_space < ( $space_limit * ( 1024 ** 3 ))) {
2020-11-27 15:19:47 +01:00
echo '
2020-11-24 18:30:52 +01:00
< div class = " callout callout-warning " >
< h4 >
2024-05-21 16:26:19 +02:00
< i class = " fa fa-warning " ></ i > '.tr(' Spazio in esaurimento ').'
2020-11-24 18:30:52 +01:00
</ h4 >
2024-05-21 16:26:19 +02:00
< p > '.tr(' Lo spazio a disposizione del gestionale è in esaurimento : sono al momento disponibili _TOT_ ' , [
2024-03-22 15:52:24 +01:00
'_TOT_' => FileSystem :: formatBytes ( $free_space ),
2024-05-21 16:26:19 +02:00
]) . ' .</ p >
< p > '.tr(' Questo può risultare un serio problema per la continuità di funzionamento del software , poiché le operazioni più espansive che richiedono spazio di archiviazione possono causare malfunzionamenti imprevisti ').' . '.tr(' Ad esempio , le attività di backup , caricamento di allegati o anche l\ 'utilizzo normale del gestionale potrebbero rendere i dati inaffidabili, provocando pertanto una perdita delle informazioni salvate' ) . ' .</ p >
< p > '.tr(' Contatta gli amministratori di sistema per risolvere al più presto il problema ').' .</ p >
2020-11-24 18:30:52 +01:00
</ div > ' ;
2020-11-27 15:10:27 +01:00
}