mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +01:00
Compare commits
2 Commits
945df50d35
...
e4c88f166b
Author | SHA1 | Date | |
---|---|---|---|
|
e4c88f166b | ||
|
72fa49dc54 |
@ -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');
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user