. */ use Models\Clause; echo '
'; $num = 0; $additionals = Clause::where('idmodule', $record['id'])->get(); if (!empty($additionals)) { foreach ($additionals as $num => $additional) { $editable = !($additional['default'] && $enable_readonly); echo '

'. tr('Filtro: _NAME_', [ '_NAME_' => $additional['name'], ]).'

'; if ($editable) { echo ' '.tr('Elimina').' '; } echo ' '.($additional['enabled'] ? tr('Disabilita') : tr('Abilita')).' '; echo '
{[ "type": "textarea", "label": "'.tr('Query').'", "name": "query['.$num.']", "value": "'.prepareToField($additional['clause']).'"'; if (!$editable) { echo ', "readonly": '.intval(!$editable).''; } echo ' ]}
{[ "type": "text", "label": "'.tr('Name').'", "name": "name['.$num.']", "value": "'.$additional['name'].'" ]}
{[ "type": "select", "label": "'.tr('Gruppo').'", "name": "gruppo['.$num.']", "values": "query=SELECT `zz_groups`.`id`, `title` AS descrizione FROM `zz_groups` LEFT JOIN `zz_groups_lang` ON (`zz_groups`.`id` = `zz_groups_lang`.`id_record` AND `zz_groups_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') ORDER BY `zz_groups`.`id` ASC", "value": "'.$additional['idgruppo'].'", "readonly": '.intval(!$editable).' ]}
{[ "type": "select", "label": "'.tr('Posizione').'", "name": "position['.$num.']", "values": "list=\"0\":\"'.tr('WHERE').'\",\"1\": \"'.tr('HAVING').'\"", "value": "'.$additional['position'].'", "readonly": '.intval(!$editable).' ]}
'; } } else { echo '
'.tr('Informazione:').' '.tr('Nessun filtro per questo modulo').'.
'; } echo '
'; echo '

'.tr('Nuovo filtro').'

{[ "type": "textarea", "label": "'.tr('Query').'", "name": "query[-id-]" ]}
{[ "type": "text", "label": "'.tr('Nome').'", "name": "name[-id-]" ]}
{[ "type": "select", "label": "'.tr('Gruppo').'", "name": "gruppo[-id-]", "values": "query=SELECT `zz_groups`.`id`, `title` AS descrizione FROM `zz_groups` LEFT JOIN `zz_groups_lang` ON (`zz_groups`.`id` = `zz_groups_lang`.`id_record` AND `zz_groups_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') ORDER BY `zz_groups`.`id` ASC" ]}
{[ "type": "select", "label": "'.tr('Posizione').'", "name": "position[-id-]", "values": "list=\"0\":\"'.tr('WHERE').'\",\"1\": \"'.tr('HAVING').'\"" ]}
'; echo ' ';