Miglioramenti di compatibilità
This commit is contained in:
parent
949a98cf22
commit
857e584a6e
18
actions.php
18
actions.php
|
@ -147,17 +147,26 @@ if (!empty($element['script'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Caricamento helper modulo (verifico se ci sono helper personalizzati)
|
// Caricamento funzioni del modulo
|
||||||
include_once App::filepath($directory.'|custom|', 'modutil.php');
|
$modutil = App::filepath($directory.'|custom|', 'modutil.php');
|
||||||
|
if (!empty($modutil)) {
|
||||||
|
include_once $modutil;
|
||||||
|
}
|
||||||
|
|
||||||
// Lettura risultato query del modulo
|
// Lettura risultato query del modulo
|
||||||
include App::filepath($directory.'|custom|', 'init.php');
|
$init = App::filepath($directory.'|custom|', 'init.php');
|
||||||
|
if (!empty($init)) {
|
||||||
|
include_once $init;
|
||||||
|
}
|
||||||
|
|
||||||
// Retrocompatibilità
|
// Retrocompatibilità
|
||||||
if (!isset($record) && isset($records[0])) {
|
if (!isset($record) && isset($records[0])) {
|
||||||
$record = $records[0];
|
$record = $records[0];
|
||||||
} elseif (!isset($records[0]) && isset($record)) {
|
} elseif (!isset($records[0]) && isset($record)) {
|
||||||
$records = [$record];
|
$records = [$record];
|
||||||
|
} elseif (!isset($record)) {
|
||||||
|
$record = [];
|
||||||
|
$records = [$record];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Registrazione del record
|
// Registrazione del record
|
||||||
|
@ -170,7 +179,8 @@ if (Modules::getPermission($id_module) == 'rw') {
|
||||||
$id_records = array_filter($id_records, function ($var) {return !empty($var); });
|
$id_records = array_filter($id_records, function ($var) {return !empty($var); });
|
||||||
$id_records = array_unique($id_records);
|
$id_records = array_unique($id_records);
|
||||||
|
|
||||||
$bulk = include App::filepath($directory.'|custom|', 'bulk.php');
|
$bulk = App::filepath($directory.'|custom|', 'bulk.php');
|
||||||
|
$bulk = empty($bulk) ? [] : include $bulk;
|
||||||
$bulk = empty($bulk) ? [] : $bulk;
|
$bulk = empty($bulk) ? [] : $bulk;
|
||||||
|
|
||||||
if (in_array(post('op'), array_keys($bulk))) {
|
if (in_array(post('op'), array_keys($bulk))) {
|
||||||
|
|
|
@ -16,4 +16,6 @@ return [
|
||||||
'secure' => isHTTPS(true),
|
'secure' => isHTTPS(true),
|
||||||
],
|
],
|
||||||
'verifyGetFor' => [],
|
'verifyGetFor' => [],
|
||||||
|
'CSRFP_TOKEN' => '',
|
||||||
|
'disabledJavascriptMessage' => '',
|
||||||
];
|
];
|
||||||
|
|
2
core.php
2
core.php
|
@ -178,7 +178,7 @@ if (!API::isAPIRequest()) {
|
||||||
register_shutdown_function('translateTemplate');
|
register_shutdown_function('translateTemplate');
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
// Compatibilità con le versioni precedenti
|
// Retrocompatibilità
|
||||||
$_SESSION['infos'] = isset($_SESSION['infos']) ? array_unique($_SESSION['infos']) : [];
|
$_SESSION['infos'] = isset($_SESSION['infos']) ? array_unique($_SESSION['infos']) : [];
|
||||||
$_SESSION['warnings'] = isset($_SESSION['warnings']) ? array_unique($_SESSION['warnings']) : [];
|
$_SESSION['warnings'] = isset($_SESSION['warnings']) ? array_unique($_SESSION['warnings']) : [];
|
||||||
$_SESSION['errors'] = isset($_SESSION['errors']) ? array_unique($_SESSION['errors']) : [];
|
$_SESSION['errors'] = isset($_SESSION['errors']) ? array_unique($_SESSION['errors']) : [];
|
||||||
|
|
|
@ -140,11 +140,12 @@ if (empty($record)) {
|
||||||
<br>';
|
<br>';
|
||||||
|
|
||||||
// Pulsanti personalizzati
|
// Pulsanti personalizzati
|
||||||
ob_start();
|
$buttons = Modules::filepath($id_module, 'buttons.php');
|
||||||
include Modules::filepath($id_module, 'buttons.php');
|
|
||||||
$buttons = ob_get_clean();
|
|
||||||
|
|
||||||
if (!empty($buttons)) {
|
if (!empty($buttons)) {
|
||||||
|
ob_start();
|
||||||
|
include $buttons;
|
||||||
|
$buttons = ob_get_clean();
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<div class="pull-right" id="pulsanti-modulo">
|
<div class="pull-right" id="pulsanti-modulo">
|
||||||
'.$buttons.'
|
'.$buttons.'
|
||||||
|
|
|
@ -55,7 +55,7 @@ echo '
|
||||||
</body>
|
</body>
|
||||||
</html>';
|
</html>';
|
||||||
|
|
||||||
// Compatibilità con le versioni precedenti
|
// Retrocompatibilità
|
||||||
if (!empty($id_record) || basename($_SERVER['PHP_SELF']) == 'controller.php' || basename($_SERVER['PHP_SELF']) == 'index.php') {
|
if (!empty($id_record) || basename($_SERVER['PHP_SELF']) == 'controller.php' || basename($_SERVER['PHP_SELF']) == 'index.php') {
|
||||||
unset($_SESSION['infos']);
|
unset($_SESSION['infos']);
|
||||||
unset($_SESSION['errors']);
|
unset($_SESSION['errors']);
|
||||||
|
|
|
@ -41,14 +41,20 @@ if (!empty($id_plugin)) {
|
||||||
|
|
||||||
$type = $element['option'];
|
$type = $element['option'];
|
||||||
|
|
||||||
// Caricamento helper modulo (verifico se ci sono helper personalizzati)
|
// Caricamento funzioni del modulo
|
||||||
include_once App::filepath($directory.'|custom|', 'modutil.php');
|
$modutil = App::filepath($directory.'|custom|', 'modutil.php');
|
||||||
|
if (!empty($modutil)) {
|
||||||
|
include_once $modutil;
|
||||||
|
}
|
||||||
|
|
||||||
// Lettura risultato query del modulo
|
// Lettura risultato query del modulo
|
||||||
// include App::filepath($directory.'|custom|', 'init.php');
|
// include App::filepath($directory.'|custom|', 'init.php');
|
||||||
|
|
||||||
// Caricamento file aggiuntivo su elenco record
|
// Caricamento file aggiuntivo su elenco record
|
||||||
include App::filepath($directory.'|custom|', 'controller_before.php');
|
$controller_before = App::filepath($directory.'|custom|', 'controller_before.php');
|
||||||
|
if (!empty($controller_before)) {
|
||||||
|
include $controller_before;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Datatables con record
|
* Datatables con record
|
||||||
|
@ -222,4 +228,7 @@ elseif ($type == 'custom') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Caricamento file aggiuntivo su elenco record
|
// Caricamento file aggiuntivo su elenco record
|
||||||
include App::filepath($directory.'|custom|', 'controller_after.php');
|
$controller_after = App::filepath($directory.'|custom|', 'controller_after.php');
|
||||||
|
if (!empty($controller_after)) {
|
||||||
|
include $controller_after;
|
||||||
|
}
|
||||||
|
|
|
@ -310,29 +310,36 @@ if (Auth::check()) {
|
||||||
|
|
||||||
<div class="box-body">';
|
<div class="box-body">';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Infomazioni
|
// Infomazioni
|
||||||
foreach ($messages['info'] as $value) {
|
if (!empty($messages['info'])) {
|
||||||
echo '
|
foreach ($messages['info'] as $value) {
|
||||||
|
echo '
|
||||||
<div class="alert alert-success push">
|
<div class="alert alert-success push">
|
||||||
<i class="fa fa-check"></i> '.$value.'
|
<i class="fa fa-check"></i> '.$value.'
|
||||||
</div>';
|
</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Errori
|
// Errori
|
||||||
foreach ($messages['error'] as $value) {
|
if (!empty($messages['error'])) {
|
||||||
echo '
|
foreach ($messages['error'] as $value) {
|
||||||
|
echo '
|
||||||
<div class="alert alert-danger push">
|
<div class="alert alert-danger push">
|
||||||
<i class="fa fa-times"></i> '.$value.'
|
<i class="fa fa-times"></i> '.$value.'
|
||||||
</div>';
|
</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Avvisi
|
// Avvisi
|
||||||
foreach ($messages['warning'] as $value) {
|
if (!empty($messages['warning'])) {
|
||||||
echo '
|
foreach ($messages['warning'] as $value) {
|
||||||
|
echo '
|
||||||
<div class="alert alert-warning push">
|
<div class="alert alert-warning push">
|
||||||
<i class="fa fa-warning"></i>
|
<i class="fa fa-warning"></i>
|
||||||
'.$value.'
|
'.$value.'
|
||||||
</div>';
|
</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Auth::check() && (!empty($messages['info']) || !empty($messages['warning']) || !empty($messages['error']))) {
|
if (!Auth::check() && (!empty($messages['info']) || !empty($messages['warning']) || !empty($messages['error']))) {
|
||||||
|
|
|
@ -321,15 +321,21 @@ function translateTemplate()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compatibilità con le versioni precedenti
|
// Retrocompatibilità
|
||||||
foreach ($_SESSION['infos'] as $message) {
|
if (!empty($_SESSION['infos'])) {
|
||||||
App::flash()->info($message);
|
foreach ($_SESSION['infos'] as $message) {
|
||||||
|
App::flash()->info($message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ($_SESSION['warnings'] as $message) {
|
if (!empty($_SESSION['warnings'])) {
|
||||||
App::flash()->warning($message);
|
foreach ($_SESSION['warnings'] as $message) {
|
||||||
|
App::flash()->warning($message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ($_SESSION['errors'] as $message) {
|
if (!empty($_SESSION['errors'])) {
|
||||||
App::flash()->error($message);
|
foreach ($_SESSION['errors'] as $message) {
|
||||||
|
App::flash()->error($message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Annullo le notifiche (AJAX)
|
// Annullo le notifiche (AJAX)
|
||||||
|
|
|
@ -6,6 +6,8 @@ function submodules($list, $depth = 1)
|
||||||
|
|
||||||
$id_module = App::getCurrentModule()['id'];
|
$id_module = App::getCurrentModule()['id'];
|
||||||
|
|
||||||
|
$result = '';
|
||||||
|
|
||||||
foreach ($list as $sub) {
|
foreach ($list as $sub) {
|
||||||
// STATO
|
// STATO
|
||||||
if (!empty($sub['enabled'])) {
|
if (!empty($sub['enabled'])) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ if (!$cliente) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="" method="post" id="edit-form" >
|
<form action="" method="post" id="edit-form" >
|
||||||
<fieldset <?php echo (!$record['deleted']) ? '' : 'disabled'; ?> >
|
<fieldset <?php echo (empty($record['deleted_at'])) ? '' : 'disabled'; ?> >
|
||||||
<input type="hidden" name="backto" value="record-edit">
|
<input type="hidden" name="backto" value="record-edit">
|
||||||
<input type="hidden" name="op" value="update">
|
<input type="hidden" name="op" value="update">
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ if (setting('Azienda predefinita') == $id_record) {
|
||||||
<div class="alert alert-info text-center">'.tr('Per impostare il logo delle stampe, caricare un file con nome "Logo stampe"').'.</div>';
|
<div class="alert alert-info text-center">'.tr('Per impostare il logo delle stampe, caricare un file con nome "Logo stampe"').'.</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$record['deleted']) {
|
if (empty($record['deleted_at'])) {
|
||||||
//fatture, ddt, preventivi, contratti, ordini, interventi, utenti collegati a questa anagrafica
|
//fatture, ddt, preventivi, contratti, ordini, interventi, utenti collegati a questa anagrafica
|
||||||
$elementi = $dbo->fetchArray('SELECT `co_documenti`.`id`, `co_documenti`.`data`, `co_documenti`.`numero`, `co_documenti`.`numero_esterno`, `co_tipidocumento`.`descrizione` AS tipo_documento, `co_tipidocumento`.`dir` FROM `co_documenti` JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` WHERE `co_documenti`.`idanagrafica` = '.prepare($id_record).'
|
$elementi = $dbo->fetchArray('SELECT `co_documenti`.`id`, `co_documenti`.`data`, `co_documenti`.`numero`, `co_documenti`.`numero_esterno`, `co_tipidocumento`.`descrizione` AS tipo_documento, `co_tipidocumento`.`dir` FROM `co_documenti` JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` WHERE `co_documenti`.`idanagrafica` = '.prepare($id_record).'
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ switch (filter('op')) {
|
||||||
App::flash()->error(tr('Errore durante esecuzione query di pianificazione. #'.$idcontratto_riga));
|
App::flash()->error(tr('Errore durante esecuzione query di pianificazione. #'.$idcontratto_riga));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
App::flash()->warning(tr('Esiste già un promemoria pianificato per il '.readDate($data_richiesta).'.'));
|
App::flash()->warning(tr('Esiste già un promemoria pianificato per il '.Translator::dateToLocale($data_richiesta).'.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//fine controllo nuova data richiesta
|
//fine controllo nuova data richiesta
|
||||||
|
|
|
@ -362,7 +362,7 @@ if ($vista == 'mese') {
|
||||||
|
|
||||||
$('#select-intreventi-pianificare').change(function(){
|
$('#select-intreventi-pianificare').change(function(){
|
||||||
var mese = $(this).val();
|
var mese = $(this).val();
|
||||||
$.get( '<?php echo $rootdir; ?>/modules/dashboard/ajaxreq.php', { op: 'load_intreventi', mese: mese }, function(data){
|
$.get( '<?php echo $rootdir; ?>/modules/dashboard/actions.php', { op: 'load_intreventi', mese: mese }, function(data){
|
||||||
$('#interventi-pianificare').html(data);
|
$('#interventi-pianificare').html(data);
|
||||||
$('#external-events .fc-event').each(function() {
|
$('#external-events .fc-event').each(function() {
|
||||||
$(this).draggable({
|
$(this).draggable({
|
||||||
|
@ -385,7 +385,7 @@ if ($vista == 'mese') {
|
||||||
|
|
||||||
$('#select-intreventi-pianificare option[value='+mese+']').attr('selected','selected').trigger('change');
|
$('#select-intreventi-pianificare option[value='+mese+']').attr('selected','selected').trigger('change');
|
||||||
|
|
||||||
$.get( '<?php echo $rootdir; ?>/modules/dashboard/ajaxreq.php', { op: 'load_intreventi', mese: mese }, function(data){
|
$.get( '<?php echo $rootdir; ?>/modules/dashboard/actions.php', { op: 'load_intreventi', mese: mese }, function(data){
|
||||||
$('#interventi-pianificare').html(data);
|
$('#interventi-pianificare').html(data);
|
||||||
$('#external-events .fc-event').each(function() {
|
$('#external-events .fc-event').each(function() {
|
||||||
$(this).draggable({
|
$(this).draggable({
|
||||||
|
@ -625,7 +625,7 @@ if (Modules::getPermission('Interventi') == 'rw') {
|
||||||
|
|
||||||
editable: true,
|
editable: true,
|
||||||
eventDrop: function(event,dayDelta,minuteDelta,revertFunc) {
|
eventDrop: function(event,dayDelta,minuteDelta,revertFunc) {
|
||||||
$.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=update_intervento&id="+event.id+"&idintervento="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){
|
$.get(globals.rootdir + "/modules/dashboard/actions.php?op=update_intervento&id="+event.id+"&idintervento="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){
|
||||||
if( response=="success" ){
|
if( response=="success" ){
|
||||||
data = $.trim(data);
|
data = $.trim(data);
|
||||||
if( data!="ok" ){
|
if( data!="ok" ){
|
||||||
|
@ -640,7 +640,7 @@ if (Modules::getPermission('Interventi') == 'rw') {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
eventResize: function(event,dayDelta,minuteDelta,revertFunc) {
|
eventResize: function(event,dayDelta,minuteDelta,revertFunc) {
|
||||||
$.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=update_intervento&id="+event.id+"&idintervento="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){
|
$.get(globals.rootdir + "/modules/dashboard/actions.php?op=update_intervento&id="+event.id+"&idintervento="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){
|
||||||
if( response=="success" ){
|
if( response=="success" ){
|
||||||
data = $.trim(data);
|
data = $.trim(data);
|
||||||
if(data != "ok"){
|
if(data != "ok"){
|
||||||
|
@ -663,7 +663,7 @@ if (Modules::getPermission('Interventi') == 'rw') {
|
||||||
|
|
||||||
if (setting('Utilizzare i tooltip sul calendario') == '1') {
|
if (setting('Utilizzare i tooltip sul calendario') == '1') {
|
||||||
?>
|
?>
|
||||||
$.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=get_more_info&id="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){
|
$.get(globals.rootdir + "/modules/dashboard/actions.php?op=get_more_info&id="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){
|
||||||
if( response=="success" ){
|
if( response=="success" ){
|
||||||
data = $.trim(data);
|
data = $.trim(data);
|
||||||
if( data!="ok" ){
|
if( data!="ok" ){
|
||||||
|
@ -695,7 +695,7 @@ if (setting('Utilizzare i tooltip sul calendario') == '1') {
|
||||||
?>
|
?>
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
url: globals.rootdir + "/modules/dashboard/ajaxreq.php?op=get_current_month",
|
url: globals.rootdir + "/modules/dashboard/actions.php?op=get_current_month",
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
error: function() {
|
error: function() {
|
||||||
alert('<?php echo tr('Errore durante la creazione degli eventi'); ?>');
|
alert('<?php echo tr('Errore durante la creazione degli eventi'); ?>');
|
||||||
|
|
|
@ -23,6 +23,8 @@ class FileManager implements ManagerInterface
|
||||||
$options['showpanel'] = isset($options['showpanel']) ? $options['showpanel'] : true;
|
$options['showpanel'] = isset($options['showpanel']) ? $options['showpanel'] : true;
|
||||||
$options['label'] = isset($options['label']) ? $options['label'] : tr('Nuovo allegato').':';
|
$options['label'] = isset($options['label']) ? $options['label'] : tr('Nuovo allegato').':';
|
||||||
|
|
||||||
|
$options['id_plugin'] = !empty($options['id_plugin']) ? $options['id_plugin'] : null;
|
||||||
|
|
||||||
// ID del form
|
// ID del form
|
||||||
$attachment_id = 'attachments_'.$options['id_module'].'-'.$options['id_plugin'];
|
$attachment_id = 'attachments_'.$options['id_module'].'-'.$options['id_plugin'];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue