This commit is contained in:
MatteoPistorello 2022-11-30 11:34:49 +01:00
commit 144cc81c1a
7 changed files with 129 additions and 30 deletions

View File

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-gb" viewBox="0 0 640 480">
<path fill="#012169" d="M0 0h640v480H0z"/>
<path fill="#FFF" d="m75 0 244 181L562 0h78v62L400 241l240 178v61h-80L320 301 81 480H0v-60l239-178L0 64V0h75z"/>
<path fill="#C8102E" d="m424 281 216 159v40L369 281h55zm-184 20 6 35L54 480H0l240-179zM640 0v3L391 191l2-44L590 0h50zM0 0l239 176h-60L0 42V0z"/>
<path fill="#FFF" d="M241 0v480h160V0H241zM0 160v160h640V160H0z"/>
<path fill="#C8102E" d="M0 193v96h640v-96H0zM273 0v480h96V0h-96z"/>
</svg>

After

Width:  |  Height:  |  Size: 534 B

View File

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-it" viewBox="0 0 640 480">
<g fill-rule="evenodd" stroke-width="1pt">
<path fill="#fff" d="M0 0h640v480H0z"/>
<path fill="#009246" d="M0 0h213.3v480H0z"/>
<path fill="#ce2b37" d="M426.7 0H640v480H426.7z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 288 B

View File

@ -179,32 +179,13 @@ if (post('db_host') !== null) {
}
// Continua con l'esecuzione delle operazioni previste
else {
// Creazione manifest.json
$manifest = '{
"dir" : "ltr",
"lang" : "'.((empty($lang) || $lang == '|lang|') ? 'it-IT' : str_replace('_','-',$lang)).'",
"name" : "'.tr('OpenSTAManager').'",
"scope" : "'.((empty(base_path()) || base_path()=='/') ? '' : '.').'",
"display" : "fullscreen",
"start_url" : "'.((empty(base_path()) || base_path()=='/') ? '/' : './').'",
"short_name" : "OSM",
"theme_color" : "transparent",
"description" : "'.tr('OpenSTAManager').'",
"orientation" : "any",
"background_color" : "transparent",
"generated" : "true",
"icons" : [
{
"src": "assets/dist/img/logo_completo.png",
"type": "image/png",
"sizes": "489x91"
}
]
}';
file_put_contents('manifest.json', $manifest);
// Creazione manifest.json
include_once App::filepath('include/init', 'manifest.php');
redirect(base_path().'/index.php');
exit();
}
}
}
@ -359,7 +340,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
</select>
<script>
var flag_link = "https://lipis.github.io/flag-icon-css/flags/4x3/|flag|.svg";
var flag_link = "'.$img.'/flags/|flag|.svg";
$(document).ready(function() {
$.ajax({

65
include/init/manifest.php Normal file
View File

@ -0,0 +1,65 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
*
* 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/>.
*/
$creation = file_put_contents('manifest.json', '');
if (!$creation) {
$manifest = '{
"dir" : "ltr",
"lang" : "'.((empty($lang) || $lang == '|lang|') ? 'it-IT' : str_replace('_','-',$lang)).'",
"name" : "'.tr('OpenSTAManager').'",
"scope" : "'.((empty(base_path()) || base_path()=='/') ? '' : '.').'",
"display" : "fullscreen",
"start_url" : "'.((empty(base_path()) || base_path()=='/') ? '/' : './').'",
"short_name" : "OSM",
"theme_color" : "transparent",
"description" : "'.tr('OpenSTAManager').'",
"orientation" : "any",
"background_color" : "transparent",
"generated" : "true",
"icons" : [
{
"src": "'.App::getPaths()['img'].'/logo_completo.png",
"type": "image/png",
"sizes": "489x91"
}
]
}';
file_put_contents('manifest.json', $manifest);
}else{
echo '
<div class="box box-center box-danger box-solid text-center">
<div class="box-header with-border">
<h3 class="box-title">'.tr('Permessi di scrittura mancanti').'</h3>
</div>
<div class="box-body">
<p>'.tr('Sembra che non ci siano i permessi di scrittura sul file _FILE_', [
'_FILE_' => '<b>manifest.json</b>',
]).'</p>
</div>
</div>';
}

View File

@ -210,7 +210,7 @@ foreach ($db as $name => $values) {
// Percorsi di servizio
$dirs = [
$dirs_to_check = [
'backup' => tr('Necessario per il salvataggio dei backup'),
'files' => tr('Necessario per il salvataggio di file inseriti dagli utenti'),
'files/temp' => tr('Necessario per la generazione delle stampe'),
@ -218,7 +218,7 @@ $dirs = [
];
$directories = [];
foreach ($dirs as $name => $description) {
foreach ($dirs_to_check as $name => $description) {
$status = is_writable(base_dir().DIRECTORY_SEPARATOR.$name);
$directories[] = [
@ -230,6 +230,28 @@ foreach ($dirs as $name => $description) {
}
// File di servizio
$files_to_check = [
'manifest.json' => tr('Necessario per aggiunta a schermata home da terminale'),
'database_5_7.json' => tr('Necessario per il controllo integrità con database MySQL 5.7.x'),
'database.json' => tr('Necessario per il controllo integrità con database MySQL 8.0.x'),
'checksum.json' => tr('Necessario per il controllo integrità dei files del gestionale'),
];
$files = [];
foreach ($files_to_check as $name => $description) {
$status = is_writable(base_dir().DIRECTORY_SEPARATOR.$name);
$files[] = [
'name' => $name,
'description' => $description,
'status' => $status,
'type' => tr('File'),
];
}
$requirements = [
tr('Apache') => $apache,
tr('PHP (_VERSION_ _SUPPORTED_)', [
@ -238,6 +260,7 @@ $requirements = [
]) => $php,
tr('MySQL') => $mysql,
tr('Percorsi di servizio') => $directories,
tr('File di servizio') => $files,
];
if (!$database->isInstalled() || empty($mysql)){
@ -276,8 +299,8 @@ foreach ($requirements as $key => $values) {
echo '
<tr class="'.($value['status'] ? 'success' : 'danger').'">
<td style="width: 10px"><i class="fa fa-'.($value['status'] ? 'check' : 'times').'"></i></td>
<td>'.$value['type'].'</td>
<td>'.$value['name'].'</td>
<td style="width: 120px" >'.$value['type'].'</td>
<td style="width: 200px" >'.$value['name'].'</td>
<td>'.$value['description'].'</td>
</tr>';
}

View File

@ -46,7 +46,7 @@ echo '<!DOCTYPE html>
if (file_exists(base_dir().'/manifest.json')) {
echo '
<link rel="manifest" href="'.base_path().'/manifest.json">';
<link rel="manifest" href="'.base_path().'/manifest.json?r='.rand().'">';
}
// CSS

View File

@ -50,6 +50,18 @@ foreach ($mansioni as $mansione) {
}
}
// Aggiungo email tecnici assegnati quando sono sul template Notifica intervento
if ($template->name == 'Notifica intervento'){
$tecnici = $dbo->select('in_interventi_tecnici_assegnati', 'id_tecnico', ['id_intervento' => $id_record]);
foreach ($tecnici as $tecnico) {
$anagrafica = $dbo->table('an_anagrafiche')->where('idanagrafica', $tecnico['id_tecnico'])->where('email', '!=', '')->first();
if (!in_array($anagrafica->email, $emails)) {
$emails[] = $anagrafica->email;
}
}
}
// Campi mancanti
$campi_mancanti = [];
@ -187,10 +199,14 @@ echo '
var id_anagrafica = "'.$id_anagrafica.'";
var pec = "'.$smtp['pec'].'";
var id_record = "'.$id_record.'";
var id_module = "'.$id_module.'";
var id_template = "'.$template->id.'";
$(document).ready(function() {
// Auto-completamento destinatario
if (id_anagrafica) {
$(document).load(globals.rootdir + "/ajax_complete.php?module=Anagrafiche&op=get_email&id_anagrafica=" + id_anagrafica + (pec ? "&type=pec" : ""), function(response) {
$(document).load(globals.rootdir + "/ajax_complete.php?module=Anagrafiche&op=get_email&id_anagrafica=" + id_anagrafica + "&id_record=" + id_record + "&id_module=" + id_module + "&id_template=" + id_template + (pec ? "&type=pec" : ""), function(response) {
emails = JSON.parse(response);
let num = 0;
$(".destinatari").each(function(){