mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-04 17:57:48 +01:00
Fix gestione template email
This commit is contained in:
parent
945df50d35
commit
72fa49dc54
@ -28,10 +28,7 @@ switch (post('op')) {
|
|||||||
$name = post('name');
|
$name = post('name');
|
||||||
$subject = post('subject');
|
$subject = post('subject');
|
||||||
|
|
||||||
$template = Template::build($module, $id_account);
|
$template = Template::build($module, $id_account, $name);
|
||||||
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
|
|
||||||
$template->name = $descrizione;
|
|
||||||
}
|
|
||||||
$id_record = $dbo->lastInsertedID();
|
$id_record = $dbo->lastInsertedID();
|
||||||
$template->setTranslation('title', $name);
|
$template->setTranslation('title', $name);
|
||||||
$template->setTranslation('subject', $subject);
|
$template->setTranslation('subject', $subject);
|
||||||
@ -43,9 +40,6 @@ switch (post('op')) {
|
|||||||
|
|
||||||
case 'update':
|
case 'update':
|
||||||
$template->setTranslation('title', post('name'));
|
$template->setTranslation('title', post('name'));
|
||||||
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
|
|
||||||
$template->name = $descrizione;
|
|
||||||
}
|
|
||||||
$template->id_account = post('smtp');
|
$template->id_account = post('smtp');
|
||||||
$template->icon = post('icon');
|
$template->icon = post('icon');
|
||||||
$template->tipo_reply_to = post('tipo_reply_to');
|
$template->tipo_reply_to = post('tipo_reply_to');
|
||||||
|
@ -52,11 +52,12 @@ class Template extends Model
|
|||||||
return (array) $variables;
|
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 = new static();
|
||||||
$model->id_module = $id_module;
|
$model->id_module = $id_module;
|
||||||
$model->id_account = $id_account;
|
$model->id_account = $id_account;
|
||||||
|
$model->name = $name;
|
||||||
$model->save();
|
$model->save();
|
||||||
|
|
||||||
return $model;
|
return $model;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user