1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-17 03:51:06 +01:00

Compare commits

...

2 Commits

Author SHA1 Message Date
valentina
e4c88f166b fix: azioni di gruppo in attività 2024-10-07 09:02:10 +02:00
valentina
72fa49dc54 Fix gestione template email 2024-10-07 08:54:37 +02:00
3 changed files with 4 additions and 9 deletions

View File

@ -28,10 +28,7 @@ switch (post('op')) {
$name = post('name');
$subject = post('subject');
$template = Template::build($module, $id_account);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$template->name = $descrizione;
}
$template = Template::build($module, $id_account, $name);
$id_record = $dbo->lastInsertedID();
$template->setTranslation('title', $name);
$template->setTranslation('subject', $subject);
@ -43,9 +40,6 @@ switch (post('op')) {
case 'update':
$template->setTranslation('title', post('name'));
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$template->name = $descrizione;
}
$template->id_account = post('smtp');
$template->icon = post('icon');
$template->tipo_reply_to = post('tipo_reply_to');

View File

@ -52,11 +52,12 @@ class Template extends Model
return (array) $variables;
}
public static function build($id_module = null, $id_account = null)
public static function build($id_module = null, $id_account = null, $name = null)
{
$model = new static();
$model->id_module = $id_module;
$model->id_account = $id_account;
$model->name = $name;
$model->save();
return $model;

View File

@ -157,7 +157,7 @@ switch (post('op')) {
if (empty($id_documento)) {
if (!empty($accodare)) {
$where = $raggruppamento == 'sede' ? ' AND `idsede_destinazione` = '.prepare($intervento['idsede_destinazione']) : '';
$documento = $dbo->fetchOne('SELECT `co_documenti`.`id` FROM `co_documenti` INNER JOIN `co_statidocumento` ON `co_documenti`.`idstatodocumento` = `co_statidocumento`.`id` LEFT JOIN `co_statidocumenti_lang` ON (`co_statidocumenti`.`id` = `co_statidocumenti_lang`.`id_record` AND `co_statidocumenti_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') INNER JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` INNER JOIN `zz_segments` ON `zz_segments`.`id` = `co_documenti`.`id_segment` WHERE `co_statidocumento_lang`.`title` = "Bozza" AND `co_documenti`.`idanagrafica` = '.prepare($id_anagrafica).' AND `co_tipidocumento`.`id`='.prepare($tipo_documento['id']).' AND `co_documenti`.`id_segment` = '.prepare($id_segment).$where);
$documento = $dbo->fetchOne('SELECT `co_documenti`.`id` FROM `co_documenti` INNER JOIN `co_statidocumento` ON `co_documenti`.`idstatodocumento` = `co_statidocumento`.`id` LEFT JOIN `co_statidocumento_lang` ON (`co_statidocumento`.`id` = `co_statidocumento_lang`.`id_record` AND `co_statidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') INNER JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` INNER JOIN `zz_segments` ON `zz_segments`.`id` = `co_documenti`.`id_segment` WHERE `co_statidocumento_lang`.`title` = "Bozza" AND `co_documenti`.`idanagrafica` = '.prepare($id_anagrafica).' AND `co_tipidocumento`.`id`='.prepare($tipo_documento['id']).' AND `co_documenti`.`id_segment` = '.prepare($id_segment).$where);
$id_documento = $documento['id'];
$id_documento_cliente[$id_anagrafica] = $id_documento;