This commit is contained in:
FabioL 2024-03-19 15:50:44 +01:00
commit 1ba9f45549
3 changed files with 18 additions and 8 deletions

View File

@ -30,7 +30,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-5">
{[ "type": "select", "label": "<?php echo tr('Tipo archiviazione'); ?>", "name": "class", "value": "<?=explode('\\', $record["class"])[4]?>", "values": "list=\"LocalAdapter\":\"Archiviazione locale\",\"FTPAdapter\":\"Archiviazione FTP\"", "required": 1 ]}
{[ "type": "select", "label": "<?php echo tr('Tipo archiviazione'); ?>", "name": "class", "value": "<?=explode('\\', $record["class"])[4]?>", "values": "list=\"LocalAdapter\":\"Archiviazione locale\",\"FTPAdapter\":\"Archiviazione FTP\"", "required": 1, "disabled": "1" ]}
</div>
<div class="col-md-2">
@ -46,18 +46,29 @@ include_once __DIR__.'/../../core.php';
<!-- PULSANTI -->
<?php
if(!$adapter->is_default && $adapter->can_delete) {
$rs_files = Models\Upload::where('id_adapter', $record['id'])->get();
if(sizeof($rs_files)>0) {
echo '
<a class="btn btn-danger ask" data-backto="record-list">
<i id ="elimina" class="fa fa-trash"></i> <?php echo tr(\'Elimina\'); ?>
</a>';
}else{
<div class="row">
<div class="col-md-12">
<div class="alert alert-warning">L\'adattatore non può essere eliminato perchè uno o più file sono collegati.</div>
</div>
</div>';
}else if($adapter->is_default && $adapter->can_delete){
echo '
<div class="row">
<div class="col-md-12">
<div class="alert alert-warning">L\'adattatore non può essere eliminato.</div>
</div>
</div>';
}else{
echo '
<a class="btn btn-danger ask" data-backto="record-list">
<i id ="elimina" class="fa fa-trash"></i> <?php echo tr(\'Elimina\'); ?>
</a>';
}
?>

View File

@ -58,7 +58,7 @@ class Login extends Resource implements CreateInterface
LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche_lang`.`id_record` = `an_tipianagrafiche`.`id` AND `an_tipianagrafiche_lang`.`id_lang` = '.prepare(\App::getLang()).")
INNER JOIN `zz_groups` ON `zz_users`.`idgruppo`=`zz_groups`.`id`
LEFT JOIN `zz_groups_lang` ON (`zz_groups_lang`.`id_record` = `zz_groups`.`id` AND `zz_groups_lang`.`id_lang` = ".prepare(\App::getLang()).")
WHERE `an_tipianagrafiche_lang`.`name` = 'Tecnico' AND `an_anagrafiche`.`deleted_at` IS NULL AND `id` = :id", [
WHERE `an_tipianagrafiche_lang`.`name` = 'Tecnico' AND `an_anagrafiche`.`deleted_at` IS NULL AND `zz_users`.`id` = :id", [
':id' => $user['id'],
]);
}

View File

@ -2354,4 +2354,3 @@ ALTER TABLE `zz_files` ADD `id_adapter` INT NOT NULL AFTER `id_record`;
UPDATE zz_files SET id_adapter=1;
DELETE FROM `zz_settings` WHERE `nome` = 'Iva da applicare su marca da bollo';
DELETE FROM `zz_settings_lang` WHERE `name` = 'Iva da applicare su marca da bollo';