summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules-available/dozmod/inc/pagemailtemplates.inc.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules-available/dozmod/inc/pagemailtemplates.inc.php b/modules-available/dozmod/inc/pagemailtemplates.inc.php
index 8136e1dc..dc41d8c6 100644
--- a/modules-available/dozmod/inc/pagemailtemplates.inc.php
+++ b/modules-available/dozmod/inc/pagemailtemplates.inc.php
@@ -74,9 +74,16 @@ class Page_mail_templates extends Page
foreach ($this->templates as &$template) {
if (isset($data[$template['name']])) {
if ($this->forcmp($template['template']) !== $this->forcmp($data[$template['name']]['template'])) {
+ if (empty($template['original_template'])) {
+ $template['original_template'] = $template['template'];
+ }
$template['edit_version'] = $template['version'];
}
- $template['original'] = $this->forcmp($template['original_template']) === $this->forcmp($data[$template['name']]['template']);
+ $template['original'] = (empty($template['original_template']) && $template['original'])
+ || $this->forcmp($template['original_template']) === $this->forcmp($data[$template['name']]['template']);
+ if ($template['original']) {
+ $template['original_template'] = '';
+ }
$template['template'] = $data[$template['name']]['template'];
}
}
@@ -84,7 +91,6 @@ class Page_mail_templates extends Page
$data = json_encode(array('templates' => $this->templates));
Database::exec("UPDATE sat.configuration SET value = :value WHERE parameter = 'templates'", array('value' => $data));
Message::addSuccess('templates-saved');
-
} else {
Message::addError('nothing-submitted');
}