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])) { if (check_query($post['query'][$c])) {
$array = [ $array = [
'name' => $post['name'][$c],
'idgruppo' => $post['gruppo'][$c], 'idgruppo' => $post['gruppo'][$c],
'idmodule' => $id_record, 'idmodule' => $id_record,
'clause' => $post['query'][$c], 'clause' => $post['query'][$c],

View File

@ -217,7 +217,7 @@ if (!empty($options) && $options != 'custom') {
</div> </div>
<div class="row"> <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="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> <button type="submit" class="btn btn-success"><i class="fa fa-check"></i> '.tr('Salva').'</button>
</div> </div>
@ -351,8 +351,8 @@ if (!empty($options) && $options != 'custom') {
echo '"> echo '">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"> <h3 class="box-title">
<a data-toggle="collapse" href="#additional-'.$additional['id'].'">'.tr('Filtro _NUM_', [ <a data-toggle="collapse" href="#additional-'.$additional['id'].'">'.tr('Filtro: _NAME_', [
'_NUM_' => $num, '_NAME_' => $additional['name'],
]).'</a> ]).'</a>
</h3>'; </h3>';
if ($editable) { if ($editable) {
@ -368,16 +368,25 @@ if (!empty($options) && $options != 'custom') {
echo ' echo '
</div> </div>
<div id="additional-'.$additional['id'].'" class="box-body collapse"> <div id="additional-'.$additional['id'].'" class="box-body collapse">
<div class="row">
<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.']"> <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-6">
{[ "type": "textarea", "label": "'.tr('Query').'", "name": "query['.$num.']", "value": "'.prepareToField($additional['clause']).'"';
if (!$editable) {
echo ', "readonly": "1"';
}
echo ' ]}
</div>
<div class="col-md-3"> <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'].'"'; {[ "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>
<div class="row"> <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 filtro').'</button> <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> <button type="submit" class="btn btn-success"><i class="fa fa-check"></i> '.tr('Salva').'</button>
</div> </div>
</div> </div>
@ -419,11 +428,18 @@ if (!empty($options) && $options != 'custom') {
<h3 class="box-title">'.tr('Nuovo filtro').'</h3> <h3 class="box-title">'.tr('Nuovo filtro').'</h3>
</div> </div>
<div class="box-body"> <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"> <div class="row">
<input type="hidden" value="" name="id[-id-]"> <input type="hidden" value="" name="id[-id-]">
<div class="col-md-6"> <div class="col-md-6">
{[ "type": "textarea", "label": "'.tr('Query').'", "name": "query[-id-]" ]} {[ "type": "text", "label": "'.tr('Nome').'", "name": "name[-id-]" ]}
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@ -431,7 +447,7 @@ if (!empty($options) && $options != 'custom') {
</div> </div>
<div class="col-md-3"> <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> </div>
</div> </div>

View File

@ -13,4 +13,10 @@ ALTER TABLE `an_anagrafiche` ADD `pec` VARCHAR(255) NOT NULL AFTER `email`;
ALTER TABLE `an_nazioni` ADD `iso2` VARCHAR(2) NOT NULL AFTER `nome`; 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) -- 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'; 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;