Nuovo controllo "File di servizio"
Ottimizzazione per creazione manifest.json
This commit is contained in:
parent
53fd01e017
commit
1027e1bd6d
|
@ -179,32 +179,13 @@ if (post('db_host') !== null) {
|
||||||
}
|
}
|
||||||
// Continua con l'esecuzione delle operazioni previste
|
// Continua con l'esecuzione delle operazioni previste
|
||||||
else {
|
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');
|
redirect(base_path().'/index.php');
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ foreach ($db as $name => $values) {
|
||||||
|
|
||||||
|
|
||||||
// Percorsi di servizio
|
// Percorsi di servizio
|
||||||
$dirs = [
|
$dirs_to_check = [
|
||||||
'backup' => tr('Necessario per il salvataggio dei backup'),
|
'backup' => tr('Necessario per il salvataggio dei backup'),
|
||||||
'files' => tr('Necessario per il salvataggio di file inseriti dagli utenti'),
|
'files' => tr('Necessario per il salvataggio di file inseriti dagli utenti'),
|
||||||
'files/temp' => tr('Necessario per la generazione delle stampe'),
|
'files/temp' => tr('Necessario per la generazione delle stampe'),
|
||||||
|
@ -218,7 +218,7 @@ $dirs = [
|
||||||
];
|
];
|
||||||
|
|
||||||
$directories = [];
|
$directories = [];
|
||||||
foreach ($dirs as $name => $description) {
|
foreach ($dirs_to_check as $name => $description) {
|
||||||
$status = is_writable(base_dir().DIRECTORY_SEPARATOR.$name);
|
$status = is_writable(base_dir().DIRECTORY_SEPARATOR.$name);
|
||||||
|
|
||||||
$directories[] = [
|
$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 = [
|
$requirements = [
|
||||||
tr('Apache') => $apache,
|
tr('Apache') => $apache,
|
||||||
tr('PHP (_VERSION_ _SUPPORTED_)', [
|
tr('PHP (_VERSION_ _SUPPORTED_)', [
|
||||||
|
@ -238,6 +260,7 @@ $requirements = [
|
||||||
]) => $php,
|
]) => $php,
|
||||||
tr('MySQL') => $mysql,
|
tr('MySQL') => $mysql,
|
||||||
tr('Percorsi di servizio') => $directories,
|
tr('Percorsi di servizio') => $directories,
|
||||||
|
tr('File di servizio') => $files,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!$database->isInstalled() || empty($mysql)){
|
if (!$database->isInstalled() || empty($mysql)){
|
||||||
|
@ -276,8 +299,8 @@ foreach ($requirements as $key => $values) {
|
||||||
echo '
|
echo '
|
||||||
<tr class="'.($value['status'] ? 'success' : 'danger').'">
|
<tr class="'.($value['status'] ? 'success' : 'danger').'">
|
||||||
<td style="width: 10px"><i class="fa fa-'.($value['status'] ? 'check' : 'times').'"></i></td>
|
<td style="width: 10px"><i class="fa fa-'.($value['status'] ? 'check' : 'times').'"></i></td>
|
||||||
<td>'.$value['type'].'</td>
|
<td style="width: 120px" >'.$value['type'].'</td>
|
||||||
<td>'.$value['name'].'</td>
|
<td style="width: 200px" >'.$value['name'].'</td>
|
||||||
<td>'.$value['description'].'</td>
|
<td>'.$value['description'].'</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ echo '<!DOCTYPE html>
|
||||||
|
|
||||||
if (file_exists(base_dir().'/manifest.json')) {
|
if (file_exists(base_dir().'/manifest.json')) {
|
||||||
echo '
|
echo '
|
||||||
<link rel="manifest" href="'.base_path().'/manifest.json">';
|
<link rel="manifest" href="'.base_path().'/manifest.json?r='.rand().'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSS
|
// CSS
|
||||||
|
|
Loading…
Reference in New Issue