diff --git a/modules/interventi/plugins/my_impianti.interventi.php b/modules/interventi/plugins/my_impianti.interventi.php
index 4921488f7..8347c15fe 100644
--- a/modules/interventi/plugins/my_impianti.interventi.php
+++ b/modules/interventi/plugins/my_impianti.interventi.php
@@ -53,7 +53,7 @@ if (!empty($results)) {
';
} else {
echo '
-
'.tr('Nessun intervento su questo impianto').'...
';
+ '.tr('Nessun intervento su questo impianto').'.
';
}
echo '
diff --git a/modules/my_impianti/edit.php b/modules/my_impianti/edit.php
index 6c456957b..46194bbac 100644
--- a/modules/my_impianti/edit.php
+++ b/modules/my_impianti/edit.php
@@ -44,6 +44,9 @@ if (!empty($records[0]['immagine'])) {
+
{[ "type": "select", "label": "", "name": "idanagrafica", "required": 1, "values": "query=SELECT an_anagrafiche.idanagrafica AS id, 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='Cliente' AND deleted_at IS NULL ORDER BY ragione_sociale", "value": "$idanagrafica$", "extra": "", "ajax-source": "clienti" ]}
diff --git a/modules/my_impianti/plugins/my_impianti.componenti.php b/modules/my_impianti/plugins/my_impianti.componenti.php
index c4cf39a0b..61ec6a27d 100644
--- a/modules/my_impianti/plugins/my_impianti.componenti.php
+++ b/modules/my_impianti/plugins/my_impianti.componenti.php
@@ -235,7 +235,7 @@ if (!empty($rs2)) {
echo '
-
'.tr('Nessun intervento collegato a questo componente!').'
+
'.tr('Nessun intervento collegato a questo componente!').'
';
}
@@ -254,27 +254,30 @@ if (!empty($rs2)) {
// Pulsante Salva/Elimina
echo '
';
+ ';
- // Sostituisci componente con un altro dello stesso tipo, posso sostituire solo i componenti installati
- echo '
-
-
@@ -285,7 +288,7 @@ if (!empty($rs2)) {
';
} else {
echo '
- '.tr('Nessun componente inserito').'.
';
+ '.tr('Nessun componente inserito').'.
';
}
echo '
diff --git a/modules/utenti/actions.php b/modules/utenti/actions.php
index a2297ceb5..bda4a7ef7 100644
--- a/modules/utenti/actions.php
+++ b/modules/utenti/actions.php
@@ -122,12 +122,17 @@ switch (filter('op')) {
}
break;
- // Disabilita API utente
- case 'token':
- $token = $dbo->fetchOne('SELECT `enabled` FROM `zz_tokens` WHERE `id_utente` = '.prepare($id_record));
-
- if ($dbo->query('UPDATE zz_tokens SET enabled = '.(empty($token['enabled']) ? 1 : 0).' WHERE id_utente = '.prepare($id_utente))) {
- $_SESSION['infos'][] = tr('Utente eliminato!');
+ // Abilita API utente
+ case 'token_enable':
+ if ($dbo->query('UPDATE zz_tokens SET enabled = 1 WHERE id_utente = '.prepare($id_utente))) {
+ $_SESSION['infos'][] = tr('Token abilitato!');
+ }
+ break;
+
+ // Disabilita API utente
+ case 'token_disable':
+ if ($dbo->query('UPDATE zz_tokens SET enabled = 0 WHERE id_utente = '.prepare($id_utente))) {
+ $_SESSION['infos'][] = tr('Token disabilitato!');
}
break;
@@ -148,6 +153,39 @@ switch (filter('op')) {
}
break;
+
+ // Impostazione/reimpostazione dei permessi di accesso di default
+ case 'restore_permission':
+
+ //Gruppo Tecnici
+ if ($dbo->fetchArray('SELECT `nome` FROM `zz_groups` WHERE `id` = '.prepare($id_record))[0]['nome']=='Tecnici'){
+
+ $data = array ();
+ $data['Dashboard'] = 'rw';
+ $data['Anagrafiche'] = 'rw';
+ $data['Interventi'] = 'rw';
+ $data['Magazzino'] = 'rw';
+ $data['Articoli'] = 'rw';
+
+ $dbo->query('DELETE FROM zz_permissions WHERE idgruppo='.prepare($id_record));
+
+ foreach ($data as $module => $permessi) {
+
+ $idmodule = $dbo->fetchArray('SELECT `id` FROM `zz_modules` WHERE `name` = "'.$module.'"')[0]['id'];
+
+ $dbo->insert('zz_permissions', [
+ 'idgruppo' => $id_record,
+ 'idmodule' => $idmodule,
+ 'permessi' => $permessi,
+ ]);
+ }
+
+ $_SESSION['infos'][] = tr('Permessi reimpostati.');
+
+
+ }
+
+ break;
// Aggiornamento dei permessi di accesso
case 'update_permission':
diff --git a/modules/utenti/edit.php b/modules/utenti/edit.php
index 04db96cd8..93bff61f0 100644
--- a/modules/utenti/edit.php
+++ b/modules/utenti/edit.php
@@ -68,13 +68,12 @@ if (!empty($utenti)) {
// Disabilitazione token API, se diverso da id_utente #1 (admin)
if ($utente['id'] != '1') {
$token = $dbo->fetchOne('SELECT `enabled` FROM `zz_tokens` WHERE `id_utente` = '.prepare($utente['id']));
-
if (!empty($token['enabled'])) {
echo '
- ';
+ ';
} else {
echo '
- ';
+ ';
}
} else {
echo '
@@ -99,7 +98,7 @@ if (!empty($utenti)) {
';
} else {
echo '
- '.tr('Non ci sono utenti in questo gruppo').'...
';
+ '.tr('Non ci sono utenti in questo gruppo').'.
';
}
echo '
'.tr('Aggiungi utente').'
@@ -115,7 +114,8 @@ echo '
'.tr('Permessi _GROUP_', [
'_GROUP_' => $records[0]['nome'],
- ]).'
+ ]).((empty($records[0]['editable'])) ? ''.tr('Reimposta permessi').' ' : '').'
+
';
@@ -143,7 +143,7 @@ if ($record['nome'] != 'Amministratori') {
';
} else {
echo '
-
'.tr('Gli amministratori hanno accesso a qualsiasi modulo').'.
';
+
'.tr('Gli amministratori hanno accesso a qualsiasi modulo').'.
';
}
echo '
diff --git a/plugins/sedi/actions.php b/plugins/sedi/actions.php
index 509d91a69..720a71e97 100644
--- a/plugins/sedi/actions.php
+++ b/plugins/sedi/actions.php
@@ -13,6 +13,7 @@ switch ($operazione) {
'indirizzo2' => $post['indirizzo2'],
'citta' => $post['citta'],
'cap' => $post['cap'],
+ 'provincia' => $post['provincia'],
'km' => $post['km'],
'cellulare' => $post['cellulare'],
'telefono' => $post['telefono'],
diff --git a/plugins/sedi/add.php b/plugins/sedi/add.php
index c8a56bd92..317a03702 100644
--- a/plugins/sedi/add.php
+++ b/plugins/sedi/add.php
@@ -17,24 +17,24 @@ echo '
- {[ "type": "text", "label": "'.tr('Secondo indirizzo').'", "name": "indirizzo2" ]}
+ {[ "type": "text", "label": "'.tr('Indirizzo2').'", "name": "indirizzo2" ]}
-
+
{[ "type": "text", "label": "'.tr('Città').'", "name": "citta", "required": 1 ]}
-
+
{[ "type": "text", "label": "'.tr('C.A.P.').'", "name": "cap" ]}
-
- {[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia" ]}
+
+ {[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "maxlength": 2, "class": "text-center" ]}
-
+
{[ "type": "text", "label": "'.tr('Km').'", "name": "km" ]}
diff --git a/plugins/sedi/edit.php b/plugins/sedi/edit.php
index cc21108e5..bc0cf602c 100644
--- a/plugins/sedi/edit.php
+++ b/plugins/sedi/edit.php
@@ -28,7 +28,7 @@ echo '
- {[ "type": "text", "label": "'.tr('Secondo indirizzo').'", "name": "indirizzo2", "value": "$indirizzo2$" ]}
+ {[ "type": "text", "label": "'.tr('Indirizzo2').'", "name": "indirizzo2", "value": "$indirizzo2$" ]}
@@ -43,19 +43,19 @@ echo '
-
+
{[ "type": "text", "label": "'.tr('Città').'", "name": "citta", "id": "citta_", "value": "$citta$" ]}
-
+
{[ "type": "text", "label": "'.tr('C.A.P.').'", "name": "cap", "value": "$cap$" ]}
-
- {[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "value": "$provincia$" ]}
+
+ {[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "value": "$provincia$", "maxlength": 2, "class": "text-center" ]}
-
+
{[ "type": "number", "label": "'.tr('Km').'", "name": "km", "value": "$km$" ]}