From d6c1960dd97424a479fced957ef3b24b75f187d9 Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 22 Feb 2018 00:00:35 +0100 Subject: [PATCH] =?UTF-8?q?Migliorato=20sistema=20ordinamento=20men=C3=B9?= =?UTF-8?q?=20e=20rivista=20disposizione=20campi=20scheda=20anagrafica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/aggiornamenti/actions.php | 34 ++++---- modules/anagrafiche/edit.php | 134 +++++++++++++++--------------- 2 files changed, 86 insertions(+), 82 deletions(-) diff --git a/modules/aggiornamenti/actions.php b/modules/aggiornamenti/actions.php index 51c7358d6..699abed1c 100644 --- a/modules/aggiornamenti/actions.php +++ b/modules/aggiornamenti/actions.php @@ -107,22 +107,26 @@ switch (post('op')) { // Ordinamento moduli di primo livello case 'sortmodules': - $ids = explode(',', $_POST['ids']); - - for ($i = 0; $i < count($ids); ++$i) { - $dbo->query('UPDATE zz_modules SET `order`='.prepare($i).' WHERE id='.prepare($ids[$i])); - - /*$rs = $dbo->fetchArray('SELECT id, name FROM zz_modules WHERE id='.prepare($ids[$i])); - $voce = $rs[0]['name']; - - $_SESSION['infos'][] = tr('Posizione della voce _VOCE_ aggiornata!', [ - '_VOCE_' => '"'.$voce.'"', - ]);*/ - + + $rs = $dbo->fetchArray('SELECT id FROM zz_modules WHERE enabled = 1 AND parent IS NULL ORDER BY `order` ASC'); + + if ($_POST['ids'] != implode(',', array_column($rs, 'id'))) { + $ids = explode(',', $_POST['ids']); + + for ($i = 0; $i < count($ids); ++$i) { + $dbo->query('UPDATE zz_modules SET `order`='.prepare($i).' WHERE id='.prepare($ids[$i])); + + /*$rs = $dbo->fetchArray('SELECT id, name FROM zz_modules WHERE id='.prepare($ids[$i])); + $voce = $rs[0]['name']; + + $_SESSION['infos'][] = tr('Posizione della voce _VOCE_ aggiornata!', [ + '_VOCE_' => '"'.$voce.'"', + ]);*/ + } + + $_SESSION['infos'][] = tr('Posizione voci di menù aggiornate!'); } - - $_SESSION['infos'][] = tr('Posizione voci di menù aggiornate!'); - + break; case 'sortwidget': diff --git a/modules/anagrafiche/edit.php b/modules/anagrafiche/edit.php index f4ff2a700..6736435ba 100644 --- a/modules/anagrafiche/edit.php +++ b/modules/anagrafiche/edit.php @@ -145,7 +145,7 @@ if (!$cliente) {
- {[ "type": "text", "label": "", "name": "sitoweb", "value": "$sitoweb$", "icon-before": "" ]} + {[ "type": "text", "label": "", "name": "sitoweb", "placeholder":"www.dominio.ext", "value": "$sitoweb$", "icon-before": "" ]}
@@ -175,11 +175,11 @@ if ($fornitore) { {[ "type": "select", "label": "", "name": "idpagamento_acquisti", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento_acquisti$" ]}
-
+
{[ "type": "select", "label": "", "name": "idlistino_acquisti", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_acquisti$" ]}
-
+
{[ "type": "select", "label": "", "name": "idiva_acquisti", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva_acquisti$" ]}
@@ -193,29 +193,28 @@ if ($fornitore) { {[ "type": "select", "label": "", "name": "idpagamento_vendite", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento_vendite$" ]}
-
+
{[ "type": "select", "label": "", "name": "idlistino_vendite", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_vendite$" ]}
-
+
{[ "type": "select", "label": "", "name": "idiva_vendite", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva_vendite$" ]}
-
-
+
{[ "type": "select", "label": "", "name": "idsede_fatturazione", "values": "query=SELECT id, IF(citta = '', nomesede, CONCAT_WS(', ', nomesede, citta)) AS descrizione FROM an_sedi WHERE idanagrafica='' UNION SELECT '0' AS id, 'Sede legale' AS descrizione ORDER BY descrizione", "value": "$idsede_fatturazione$" ]}
-
+
{[ "type": "select", "label": "", "name": "idtipointervento_default", "values": "query=SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC", "value": "$idtipointervento_default$" ]}
-
+
{[ "type": "select", "label": "Agente principale", "name": "idagente", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, IF(deleted=1, CONCAT(ragione_sociale, ' (Eliminato)'), ragione_sociale ) AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE (descrizione='Agente' AND deleted=0)ORDER BY ragione_sociale", "value": "$idagente$" ]} -
+
@@ -252,52 +251,7 @@ if ($fornitore) { {[ "type": "text", "label": "", "name": "cciaa_citta", "value": "$cciaa_citta$" ]}
-
-
- {[ "type": "text", "label": "", "name": "appoggiobancario", "value": "$appoggiobancario$" ]} -
- -
- {[ "type": "text", "label": "", "name": "filiale", "value": "$filiale$" ]} -
- -
- {[ "type": "text", "label": "", "name": "codiceiban", "value": "$codiceiban$" ]} -
- -
- {[ "type": "text", "label": "", "name": "bic", "value": "$bic$" ]} -
- -
- {[ "type": "text", "label": "", "name": "diciturafissafattura", "value": "$diciturafissafattura$" ]} -
-
- -
-
- {[ "type": "text", "label": "", "name": "foro_competenza", "value": "$foro_competenza$" ]} -
- -
- {[ "type": "text", "label": "", "name": "settore", "value": "$settore$" ]} -
- -
- {[ "type": "text", "label": "", "name": "marche", "value": "$marche$" ]} -
-
- -
-
- {[ "type": "text", "label": "", "name": "dipendenti", "value": "$dipendenti$" ]} -
- -
- {[ "type": "text", "label": "", "name": "macchine", "value": "$macchine$" ]} -
-
{[ "type": "text", "label": "", "name": "iscrizione_tribunale", "value": "$iscrizione_tribunale$" ]}
@@ -305,19 +259,69 @@ if ($fornitore) {
{[ "type": "text", "label": "", "name": "n_alboartigiani", "value": "$n_alboartigiani$" ]}
+ +
+ {[ "type": "text", "label": "", "name": "foro_competenza", "value": "$foro_competenza$" ]} +
+ +
+ {[ "type": "number", "label": "", "name": "capitale_sociale", "decimals": 0, "value": "$capitale_sociale$", "icon-after":"€" ]} +
+
+
+
+ {[ "type": "text", "label": "", "name": "appoggiobancario", "value": "$appoggiobancario$" ]} +
+ +
+ {[ "type": "text", "label": "", "name": "filiale", "value": "$filiale$" ]} +
+ +
+ {[ "type": "text", "label": "", "name": "codiceiban", "value": "$codiceiban$" ]} +
+ +
+ {[ "type": "text", "label": "", "name": "bic", "value": "$bic$" ]} +
+
+
+
+ {[ "type": "text", "label": "", "name": "diciturafissafattura", "value": "$diciturafissafattura$" ]} +
+
+ +
+
+ {[ "type": "text", "label": "", "name": "settore", "value": "$settore$" ]} +
+ +
+ {[ "type": "text", "label": "", "name": "marche", "value": "$marche$" ]} +
+ +
+ {[ "type": "number", "label": "", "name": "dipendenti", "decimals": 0, "value": "$dipendenti$" ]} +
+ +
+ {[ "type": "number", "label": "", "name": "macchine", "decimals": 0, "value": "$macchine$" ]} +
-
+
{[ "type": "select", "multiple": "1", "label": "", "name": "idtipoanagrafica[]", "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica NOT IN (SELECT DISTINCT(x.idtipoanagrafica) FROM an_tipianagrafiche_anagrafiche x INNER JOIN an_tipianagrafiche t ON x.idtipoanagrafica = t.idtipoanagrafica INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = x.idanagrafica WHERE t.descrizione = 'Azienda' AND deleted = 0) ORDER BY descrizione", "value": "$idtipianagrafica$" ]} -'.tr('Questa anagrafica appartiene alla tipologia "Azienda"').'.

'; -} -?> + '.tr('Questa anagrafica appartiene alla tipologia "Azienda"').'.

'; + } + ?>
+
+
@@ -329,7 +333,7 @@ if (str_contains($records[0]['idtipianagrafica'], $id_azienda)) { -
+
{[ "type": "select", "label": "Agenti secondari", "multiple": "1", "name": "idagenti[]", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, IF(deleted=1, CONCAT(ragione_sociale, ' (Eliminato)'), ragione_sociale ) AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE (descrizione='Agente' AND deleted=0 AND an_anagrafiche.idanagrafica NOT IN (SELECT idagente FROM an_anagrafiche WHERE idanagrafica = )) OR (an_anagrafiche.idanagrafica IN (SELECT idagente FROM an_anagrafiche_agenti WHERE idanagrafica = ) ) ORDER BY ragione_sociale", "value": "$idagenti$" ]}
@@ -338,10 +342,6 @@ if (str_contains($records[0]['idtipianagrafica'], $id_azienda)) {
- -
- {[ "type": "text", "label": "", "name": "capitale_sociale", "value": "$capitale_sociale$" ]} -