diff --git a/modules/emails/src/Template.php b/modules/emails/src/Template.php index 5371bfbf5..2a1642c02 100755 --- a/modules/emails/src/Template.php +++ b/modules/emails/src/Template.php @@ -86,7 +86,7 @@ class Template extends Model public function getModuleAttribute() { - return 'Template email'; + return $this->belongsTo(Module::class, 'id_module')->first(); } public static function getTranslatedFields() diff --git a/modules/stampe/init.php b/modules/stampe/init.php index a6bc5dfba..cda8a5dd5 100755 --- a/modules/stampe/init.php +++ b/modules/stampe/init.php @@ -26,5 +26,5 @@ if (isset($id_record)) { $record = $print->toArray(); $record['title'] = $print->getTranslation('title'); - $record['filename'] = $print->filename; + $record['filename'] = $print->getTranslation('filename'); } diff --git a/src/Models/PrintTemplate.php b/src/Models/PrintTemplate.php index 74cb37091..4965c7357 100755 --- a/src/Models/PrintTemplate.php +++ b/src/Models/PrintTemplate.php @@ -44,14 +44,9 @@ class PrintTemplate extends Model /* Relazioni Eloquent */ - public function module() - { - return $this->belongsTo(Module::class, 'id_module'); - } - public function getModuleAttribute() { - return ''; + return $this->belongsTo(Module::class, 'id_module')->first(); } public static function getTranslatedFields() diff --git a/src/Prints.php b/src/Prints.php index 71add8316..32b564bb9 100755 --- a/src/Prints.php +++ b/src/Prints.php @@ -447,7 +447,7 @@ class Prints { $module = Module::find($record['id_module']); - $name = $record['filename'].'.pdf'; + $name = $record->getTranslation('filename').'.pdf'; $name = $module->replacePlaceholders($id_record, $name); $replaces = [];