fix: allineamento tabella marchi

This commit is contained in:
valentina 2024-10-16 08:48:22 +02:00
parent f85d1c188f
commit 47509e4b1b
5 changed files with 10 additions and 10 deletions

View File

@ -24,7 +24,7 @@ switch (post('op')) {
case 'update': case 'update':
$dbo->update('mg_marchi',[ $dbo->update('mg_marchi',[
'nome' => post('nome'), 'name' => post('name'),
],['id' => $id_record]); ],['id' => $id_record]);
flash()->info(tr('Informazioni salvate correttamente!')); flash()->info(tr('Informazioni salvate correttamente!'));
@ -35,7 +35,7 @@ switch (post('op')) {
case 'add': case 'add':
$dbo->insert('mg_marchi',[ $dbo->insert('mg_marchi',[
'nome' => post('nome'), 'name' => post('name'),
]); ]);
$id_record = $dbo->lastInsertedID(); $id_record = $dbo->lastInsertedID();

View File

@ -27,7 +27,7 @@ $id_anagrafica = filter('id_anagrafica');
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "required": 1, "validation": "nome" ]} {[ "type": "text", "label": "<?php echo tr('name'); ?>", "name": "name", "required": 1, "validation": "name" ]}
</div> </div>
</div> </div>

View File

@ -34,7 +34,7 @@ include_once __DIR__.'/../../core.php';
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "value":"$nome$", "required": 1, "validation": "nome" ]} {[ "type": "text", "label": "<?php echo tr('name'); ?>", "name": "name", "value":"$name$", "required": 1, "validation": "name" ]}
</div> </div>
</div> </div>

View File

@ -23,13 +23,13 @@ $name = filter('name');
$value = filter('value'); $value = filter('value');
switch ($name) { switch ($name) {
case 'nome': case 'name':
$disponibile = $dbo->table('mg_marchi')->where([ $disponibile = $dbo->table('mg_marchi')->where([
['nome', $value], ['name', $value],
['id', '<>', $id_record], ['id', '<>', $id_record],
])->count() == 0; ])->count() == 0;
$message = $disponibile ? tr('Il nome è disponbile') : tr('Il nome è già utilizzato in un altro marchio'); $message = $disponibile ? tr('Il name è disponbile') : tr('Il name è già utilizzato in un altro marchio');
$response = [ $response = [
'result' => $disponibile, 'result' => $disponibile,

View File

@ -3,17 +3,17 @@ ALTER TABLE `mg_articoli` ADD `id_marchio` INT NULL DEFAULT NULL;
CREATE TABLE `mg_marchi` ( CREATE TABLE `mg_marchi` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`nome` varchar(255) NOT NULL, `name` varchar(255) NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)) ENGINE = InnoDB; PRIMARY KEY (`id`)) ENGINE = InnoDB;
INSERT INTO `zz_modules` (`name`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`, `use_notes`, `use_checklists`) VALUES ('Marchi', 'marchi', 'SELECT |select| FROM `mg_marchi` WHERE 1=1 HAVING 2=2 ORDER BY `mg_marchi`.`nome`', '', 'fa fa-angle-right', '2.5.6', '2.5.6', '7', (SELECT `id` FROM `zz_modules` AS `t` WHERE `name` = 'Articoli'), '1', '1', '1', '1'); INSERT INTO `zz_modules` (`name`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`, `use_notes`, `use_checklists`) VALUES ('Marchi', 'marchi', 'SELECT |select| FROM `mg_marchi` WHERE 1=1 HAVING 2=2 ORDER BY `mg_marchi`.`name`', '', 'fa fa-angle-right', '2.5.6', '2.5.6', '7', (SELECT `id` FROM `zz_modules` AS `t` WHERE `name` = 'Articoli'), '1', '1', '1', '1');
INSERT INTO `zz_modules_lang` (`id_lang`, `id_record`, `title`) VALUES ('1', (SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'Marchi'); INSERT INTO `zz_modules_lang` (`id_lang`, `id_record`, `title`) VALUES ('1', (SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'Marchi');
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `html_format`, `search_inside`, `order_by`, `visible`, `summable`, `default`) VALUES INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `html_format`, `search_inside`, `order_by`, `visible`, `summable`, `default`) VALUES
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'id', 'mg_marchi.id', '0', '0', '0', '0', '0', '', '', '0', '0', '0'), ((SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'id', 'mg_marchi.id', '0', '0', '0', '0', '0', '', '', '0', '0', '0'),
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'Nome', 'mg_marchi.nome', '1', '0', '0', '0', '0', '', '', '1', '0', '0'); ((SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'Nome', 'mg_marchi.name', '1', '0', '0', '0', '0', '', '', '1', '0', '0');
INSERT INTO `zz_views_lang` (`id_lang`, `id_record`, `title`) VALUES INSERT INTO `zz_views_lang` (`id_lang`, `id_record`, `title`) VALUES
(1, (SELECT `id` FROM `zz_views` WHERE `name` = 'id' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi')), 'id'), (1, (SELECT `id` FROM `zz_views` WHERE `name` = 'id' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi')), 'id'),