From b5a955fd65843743b0b8b07100868cbc81b237aa Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 4 Jul 2018 11:01:09 +0200 Subject: [PATCH] =?UTF-8?q?Aggiunta=20possibilit=C3=A0=20di=20specificare?= =?UTF-8?q?=20colore=20e=20note=20anche=20in=20fase=20di=20aggiunta=20dell?= =?UTF-8?q?e=20categorie=20articoli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/categorie/actions.php | 4 +++- modules/categorie/add.php | 32 +++++++++++++------------------- modules/categorie/edit.php | 2 +- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/modules/categorie/actions.php b/modules/categorie/actions.php index e602205ba..852c03108 100644 --- a/modules/categorie/actions.php +++ b/modules/categorie/actions.php @@ -19,9 +19,11 @@ switch (filter('op')) { case 'add': $nome = filter('nome'); + $nota = filter('nota'); + $colore = filter('colore'); if (isset($nome)) { - $dbo->query('INSERT INTO `mg_categorie` (`nome`) VALUES ('.prepare($nome).')'); + $dbo->query('INSERT INTO `mg_categorie` (`nome`, `colore`, `nota`) VALUES ('.prepare($nome).', '.prepare($colore).', '.prepare($nota).')'); $id_record = $dbo->lastInsertedID(); diff --git a/modules/categorie/add.php b/modules/categorie/add.php index 404452285..cab25fd95 100644 --- a/modules/categorie/add.php +++ b/modules/categorie/add.php @@ -19,17 +19,14 @@ if (isset($id_record)) { if (!isset($id_original)) { ?> - -
-
- {[ "type": "text", "label": "", "name": "nome", "required": 1 ]} -
-
+
@@ -47,19 +44,6 @@ if (!isset($id_original)) {
- - -
@@ -77,3 +61,13 @@ if (isset($id_record)) {
+ + diff --git a/modules/categorie/edit.php b/modules/categorie/edit.php index f9b6a3aaa..988c8a8c8 100644 --- a/modules/categorie/edit.php +++ b/modules/categorie/edit.php @@ -79,7 +79,7 @@ $res = $dbo->fetchNum('SELECT * FROM `mg_articoli` WHERE `id_categoria`='.prepar if ($res) { echo '
-

'.tr('Esistono ancora alcuni articoli sotto questa categoria!').'

+

'.tr('Ci sono '.count($res).' articoli collegati questa categoria. Non รจ possibile eliminarla.').'

'; } else { echo '