Fix modifica colonne

This commit is contained in:
pek5892 2024-05-21 12:22:55 +02:00
parent c4872f39ee
commit 9ee3b098b6
2 changed files with 13 additions and 6 deletions

View File

@ -104,17 +104,22 @@ echo '
$record = $module_record; $record = $module_record;
echo ' echo '
</div> </div>';
</div>';
redirectOperation($id_module, !empty($id_parent) ? $id_parent : $id_record); redirectOperation($id_module, !empty($id_parent) ? $id_parent : $id_record);
// Interfaccia per la modifica dell'ordine e della visibilità delle colonne (Amministratore) // Interfaccia per la modifica dell'ordine e della visibilità delle colonne (Amministratore)
if ($user->is_admin && string_contains($module['option'], '|select|')) { if ($user->is_admin && string_contains($module['option'], '|select|')) {
echo ' echo '
<a class="btn btn-xs btn-default justify-content-end" style="margin-top: -1.25rem;" onclick="modificaColonne(this)"> <br>
<div class="row">
<div class="col-md-12 text-right">
<a class="btn btn-xs btn-default " style="margin-top: -1.25rem;" onclick="modificaColonne(this)">
<i class="fa fa-th-list"></i> '.tr('Modifica colonne').' <i class="fa fa-th-list"></i> '.tr('Modifica colonne').'
</a><div class="clearfix" >&nbsp;</div> </a>
</div>
</div>
<div class="clearfix" >&nbsp;</div>
<script> <script>
function modificaColonne(button) { function modificaColonne(button) {
@ -123,6 +128,8 @@ function modificaColonne(button) {
</script>'; </script>';
} }
echo'</div>';
// Widget in basso // Widget in basso
echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "right", "place": "controller" )}'; echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "right", "place": "controller" )}';

View File

@ -25,7 +25,7 @@ $structure = Module::find($id_module);
echo ' echo '
<p>'.tr('Trascina le colonne per ordinare la struttura della tabella principale, seleziona e deseleziona le colonne per renderle visibili o meno').'.</p> <p>'.tr('Trascina le colonne per ordinare la struttura della tabella principale, seleziona e deseleziona le colonne per renderle visibili o meno').'.</p>
<div class="sortable">'; <div class="sortable row">';
$fields = $dbo->fetchArray('SELECT `zz_views`.*, (SELECT GROUP_CONCAT(`zz_groups_lang`.`title`) FROM `zz_group_view` INNER JOIN `zz_groups` ON `zz_group_view`.`id_gruppo` = `zz_groups`.`id` 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).') WHERE `zz_group_view`.`id_vista` = `zz_views`.`id`) AS gruppi_con_accesso FROM `zz_views` LEFT JOIN `zz_views_lang` ON (`zz_views`.`id` = `zz_views_lang`.`id_record` AND `zz_views_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `id_module`='.prepare($id_module).' ORDER BY `order` ASC'); $fields = $dbo->fetchArray('SELECT `zz_views`.*, (SELECT GROUP_CONCAT(`zz_groups_lang`.`title`) FROM `zz_group_view` INNER JOIN `zz_groups` ON `zz_group_view`.`id_gruppo` = `zz_groups`.`id` 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).') WHERE `zz_group_view`.`id_vista` = `zz_views`.`id`) AS gruppi_con_accesso FROM `zz_views` LEFT JOIN `zz_views_lang` ON (`zz_views`.`id` = `zz_views_lang`.`id_record` AND `zz_views_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `id_module`='.prepare($id_module).' ORDER BY `order` ASC');
foreach ($fields as $field) { foreach ($fields as $field) {