From 1a9ae025238b33035bdb6b0b3bd0dc639a433cf4 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 3 Apr 2018 15:15:15 +0200 Subject: [PATCH] Conto predefinito banche solo da 'Stato patrimoniale' -> 'Cassa e banche' --- mail.php | 19 +++++++++++++++++++ modules/banche/actions.php | 10 +++++----- modules/banche/edit.php | 2 +- modules/zone/actions.php | 10 ++++++---- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/mail.php b/mail.php index 4f3fb7a78..907514200 100644 --- a/mail.php +++ b/mail.php @@ -21,6 +21,25 @@ foreach ($variables as $key => $value) { $body = str_replace(array_keys($replaces), array_values($replaces), $body); $subject = str_replace(array_keys($replaces), array_values($replaces), $subject); +//Campi mancanti +$rs2 = $dbo->fetchArray('SELECT from_address, server, port FROM zz_smtp WHERE id='.prepare($template['id_smtp'])); +$campi_mancanti = []; + +if ($rs2[0]['from_address'] == '') { + array_push($campi_mancanti, 'Mittente'); +} +if ($rs2[0]['server'] == '') { + array_push($campi_mancanti, 'Server SMTP'); +} +if ($rs2[0]['port'] == '') { + array_push($campi_mancanti, 'Porta'); +} + +if (sizeof($campi_mancanti) > 0) { + echo "
Prima di procedere all'invio completa: ".implode(', ', $campi_mancanti).'
+ '.Modules::link('Gestione email', $template['id_smtp'], tr('Vai alla scheda account email'), null).'
'; +} + // Form echo '
diff --git a/modules/banche/actions.php b/modules/banche/actions.php index 0a1ef892e..311a8fa49 100644 --- a/modules/banche/actions.php +++ b/modules/banche/actions.php @@ -35,7 +35,11 @@ switch (filter('op')) { if (isset($nome)) { $dbo->query('INSERT INTO `co_banche` (`nome`) VALUES ('.prepare($nome).')'); $id_record = $dbo->lastInsertedID(); - + + if (isAjaxRequest()) { + echo json_encode(['id' => $id_record, 'text' => $nome]); + } + $_SESSION['infos'][] = tr('Aggiunta nuova _TYPE_', [ '_TYPE_' => 'banca', ]); @@ -44,10 +48,6 @@ switch (filter('op')) { } - if (isAjaxRequest()) { - echo json_encode(['id' => $id_record, 'text' => $nome]); - } - break; case 'delete': diff --git a/modules/banche/edit.php b/modules/banche/edit.php index 47c6cc53b..4575498f5 100644 --- a/modules/banche/edit.php +++ b/modules/banche/edit.php @@ -24,7 +24,7 @@ include_once __DIR__.'/../../core.php'; {[ "type": "text", "label": "", "name": "filiale", "value": "$filiale$" ]}
- {[ "type": "select", "label": "", "name": "id_pianodeiconti3", "value": "$id_pianodeiconti3$", "ajax-source": "conti" ]} + {[ "type": "select", "label": "", "name": "id_pianodeiconti3", "value": "$id_pianodeiconti3$", "values": "query=SELECT id, descrizione FROM co_pianodeiconti3 WHERE idpianodeiconti2 = 1" ]}
diff --git a/modules/zone/actions.php b/modules/zone/actions.php index 2e3004db1..797f16915 100644 --- a/modules/zone/actions.php +++ b/modules/zone/actions.php @@ -37,13 +37,15 @@ switch (post('op')) { $dbo->query($query); $id_record = $dbo->lastInsertedID(); - + + if (isAjaxRequest()) { + echo json_encode(['id' => $id_record, 'text' => $nome.' - '.$descrizione]); + } + $_SESSION['infos'][] = tr('Aggiunta una nuova zona!'); } - if (isAjaxRequest()) { - echo json_encode(['id' => $id_record, 'text' => $nome.' - '.$descrizione]); - } + break;