bugfix aggiunta filtri in viste + aggiunto nome filtro

This commit is contained in:
Luca 2018-04-20 17:17:32 +02:00
parent e34b9ac54d
commit 8d4a758f2a
3 changed files with 39 additions and 16 deletions

View File

@ -93,6 +93,7 @@ switch (filter('op')) {
if (check_query($post['query'][$c])) {
$array = [
'name' => $post['name'][$c],
'idgruppo' => $post['gruppo'][$c],
'idmodule' => $id_record,
'clause' => $post['query'][$c],

View File

@ -217,7 +217,7 @@ if (!empty($options) && $options != 'custom') {
</div>
<div class="row">
<div class="text-right">
<div class="col-md-12 text-right">
<button type="button" class="btn btn-info" id="add"><i class="fa fa-plus"></i> '.tr('Aggiungi nuovo campo').'</button>
<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> '.tr('Salva').'</button>
</div>
@ -351,8 +351,8 @@ if (!empty($options) && $options != 'custom') {
echo '">
<div class="box-header with-border">
<h3 class="box-title">
<a data-toggle="collapse" href="#additional-'.$additional['id'].'">'.tr('Filtro _NUM_', [
'_NUM_' => $num,
<a data-toggle="collapse" href="#additional-'.$additional['id'].'">'.tr('Filtro: _NAME_', [
'_NAME_' => $additional['name'],
]).'</a>
</h3>';
if ($editable) {
@ -368,16 +368,25 @@ if (!empty($options) && $options != 'custom') {
echo '
</div>
<div id="additional-'.$additional['id'].'" class="box-body collapse">
<div class="row">
<input type="hidden" value="'.$additional['id'].'" name="id['.$num.']">
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
{[ "type": "textarea", "label": "'.tr('Query').'", "name": "query['.$num.']", "value": "'.prepareToField($additional['clause']).'"';
if (!$editable) {
echo ', "readonly": "1"';
}
echo ' ]}
</div>
</div>
<div class="row">
<input type="hidden" value="'.$additional['id'].'" name="id['.$num.']">
<div class="col-md-6">
{[ "type": "text", "label": "'.tr('Name').'", "name": "name['.$num.']", "value": "'.$additional['name'].'" ]}
</div>
<div class="col-md-3">
{[ "type": "select", "label": "'.tr('Gruppo').'", "name": "gruppo['.$num.']", "values": "query=SELECT id, nome AS descrizione FROM zz_groups ORDER BY id ASC", "value": "'.$additional['idgruppo'].'"';
@ -402,8 +411,8 @@ if (!empty($options) && $options != 'custom') {
</div>
<div class="row">
<div class="text-right">
<button type="button" class="btn btn-info" id="add"><i class="fa fa-plus"></i> '.tr('Aggiungi nuovo filtro').'</button>
<div class="col-md-12 text-right">
<button type="button" class="btn btn-info" id="add_filter"><i class="fa fa-plus"></i> '.tr('Aggiungi nuovo filtro').'</button>
<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> '.tr('Salva').'</button>
</div>
</div>
@ -419,11 +428,18 @@ if (!empty($options) && $options != 'custom') {
<h3 class="box-title">'.tr('Nuovo filtro').'</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-12">
{[ "type": "textarea", "label": "'.tr('Query').'", "name": "query[-id-]" ]}
</div>
</div>
<div class="row">
<input type="hidden" value="" name="id[-id-]">
<div class="col-md-6">
{[ "type": "textarea", "label": "'.tr('Query').'", "name": "query[-id-]" ]}
{[ "type": "text", "label": "'.tr('Nome').'", "name": "name[-id-]" ]}
</div>
<div class="col-md-3">
@ -431,7 +447,7 @@ if (!empty($options) && $options != 'custom') {
</div>
<div class="col-md-3">
{[ "type": "select", "label": "'.tr('Posizione').'", "name": "position[-id-]", "list=\"0\":\"'.tr('WHERE').'\",\"1\": \"'.tr('HAVING').'\"" ]}
{[ "type": "select", "label": "'.tr('Posizione').'", "name": "position[-id-]", "values": "list=\"0\":\"'.tr('WHERE').'\",\"1\": \"'.tr('HAVING').'\"", "value": "" ]}
</div>
</div>
</div>

View File

@ -14,3 +14,9 @@ ALTER TABLE `an_nazioni` ADD `iso2` VARCHAR(2) NOT NULL AFTER `nome`;
-- ISO 2 per ITALIA (https://it.wikipedia.org/wiki/ISO_3166-1_alpha-2)
UPDATE `an_nazioni` SET `iso2` = 'IT' WHERE `an_nazioni`.`nome` = 'ITALIA';
-- Aggiunto name per i filtri
ALTER TABLE `zz_group_module` ADD `name` VARCHAR(255) NOT NULL AFTER `idmodule`;
UPDATE `zz_group_module` SET `name` = 'Mostra interventi ai tecnici coinvolti' WHERE `zz_group_module`.`id` = 1;
UPDATE `zz_group_module` SET `name` = 'Mostra interventi ai clienti coinvolti' WHERE `zz_group_module`.`id` = 5;