Skip to content
Snippets Groups Projects
Commit 080ea576 authored by Jared Hancock's avatar Jared Hancock
Browse files

forms: Fix corruption of company name on new ticket

New ticket by staff would cause the %{company.name} variable to be
incorrectly replaced as the user's name in email templates.
parent cb026cbf
Branches
Tags
No related merge requests found
...@@ -48,7 +48,7 @@ class Company { ...@@ -48,7 +48,7 @@ class Company {
} }
function getInfo() { function getInfo() {
return $this->getForm()->getClean(); return $this->getForm()->getSaved();
} }
function getName() { function getName() {
......
...@@ -546,6 +546,16 @@ class DynamicFormEntry extends VerySimpleModel { ...@@ -546,6 +546,16 @@ class DynamicFormEntry extends VerySimpleModel {
return $this->_clean; return $this->_clean;
} }
function getSaved() {
$info = array();
foreach ($this->getAnswers() as $a) {
$field = $a->getField();
$info[$field->get('id')]
= $info[$field->get('name')] = $a->getValue();
}
return $info;
}
function forTicket($ticket_id, $force=false) { function forTicket($ticket_id, $force=false) {
static $entries = array(); static $entries = array();
if (!isset($entries[$ticket_id]) || $force) if (!isset($entries[$ticket_id]) || $force)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment