Correzione del funzionamento della stampa di riepilogo interventi
This commit is contained in:
parent
2b3bd9344b
commit
083dc25b8e
|
@ -89,10 +89,9 @@ class Widgets
|
|||
$dato = '';
|
||||
if ($query != '') {
|
||||
$dato = $dbo->fetchArray($query);
|
||||
}
|
||||
|
||||
if (!empty($dato)) {
|
||||
$dato = $dato[0]['dato'];
|
||||
}
|
||||
|
||||
// inserisco il widget
|
||||
$result .= '
|
||||
|
@ -131,11 +130,10 @@ class Widgets
|
|||
if (!empty($results[0]['more_link'])) {
|
||||
$result .= '
|
||||
</a>';
|
||||
}
|
||||
|
||||
$result .= '
|
||||
$result .= '
|
||||
</li>';
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
|
|
@ -2,31 +2,16 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$module_name = 'Interventi';
|
||||
$module = Modules::getModule('Interventi');
|
||||
$id_module = $module['id'];
|
||||
|
||||
$id_module = $_GET['id_module'];
|
||||
$total = Modules::getQuery($id_module);
|
||||
|
||||
$fields = [];
|
||||
$select = '*';
|
||||
$datas = $dbo->fetchArray('SELECT * FROM zz_views WHERE id_module='.$id_module.' AND id IN (SELECT id_vista FROM zz_group_view WHERE id_gruppo=(SELECT idgruppo FROM zz_users WHERE id='.$_SESSION['id_utente'].')) ORDER BY `order` ASC');
|
||||
if ($datas != null) {
|
||||
$select = '';
|
||||
foreach ($datas as $data) {
|
||||
$select .= $data['query']." AS '".$data['name']."',";
|
||||
if ($data['enabled']) {
|
||||
array_push($fields, trim($data['name']));
|
||||
}
|
||||
}
|
||||
$select = substr($select, 0, strlen($select) - 1);
|
||||
}
|
||||
|
||||
$module = $dbo->fetchArray('SELECT * FROM zz_modules WHERE id="'.$id_module.'"')[0];
|
||||
$module_query = ($module['options2'] != '') ? $module['options2'] : $module['options'];
|
||||
|
||||
$module_query = str_replace('|select|', $select, $module_query);
|
||||
// Lettura parametri modulo
|
||||
$module_query = $total['query'];
|
||||
$module_query = str_replace('|period_start|', $_SESSION['period_start'], $module_query);
|
||||
$module_query = str_replace('|period_end|', $_SESSION['period_end'], $module_query);
|
||||
$module_dir = $module['directory'];
|
||||
$module_query = str_replace('|select|', $total['select'], $module_query);
|
||||
|
||||
$search_filters = [];
|
||||
|
||||
|
@ -40,14 +25,12 @@ if (is_array($_SESSION['module_'.$id_module])) {
|
|||
}
|
||||
}
|
||||
|
||||
if (sizeof($search_filters) > 0) {
|
||||
$module_query = str_replace('1=1', '1=1 AND ('.implode(' AND ', $search_filters).') ', $module_query);
|
||||
if (!empty($search_filters)) {
|
||||
$module_query = str_replace('2=2', '2=2 AND ('.implode(' AND ', $search_filters).') ', $module_query);
|
||||
}
|
||||
|
||||
// Aggiungo eventuali filtri dei permessi
|
||||
if ($additional_where[$rs[0]['name']] != '') {
|
||||
$module_query = str_replace('1=1', '1=1 '.$additional_where[$rs[0]['name']], $module_query);
|
||||
}
|
||||
// Filtri derivanti dai permessi (eventuali)
|
||||
$module_query = Modules::replaceAdditionals($id_module, $module_query);
|
||||
|
||||
$rsi = $dbo->fetchArray($module_query);
|
||||
|
||||
|
|
Loading…
Reference in New Issue