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

Fixup variables for custom list properties

parent 30e7d721
Branches
Tags
No related merge requests found
......@@ -765,7 +765,13 @@ class DynamicFormEntryAnswer extends VerySimpleModel {
}
function asVar() {
return $this->toString();
return (is_object($this->getValue()))
? $this->getValue() : $this->toString();
}
function getVar($tag) {
if (is_object($this->getValue()) && method_exists($this->getValue(), 'getVar'))
return $this->getValue()->getVar($tag);
}
function __toString() {
......@@ -938,8 +944,9 @@ class DynamicListItem extends VerySimpleModel {
function getVar($name) {
$config = $this->getConfiguration();
$name = mb_strtolower($name);
foreach ($this->getConfigurationForm()->getFields() as $field) {
if (strcasecmp($field->get('name'), $name) === 0)
if (mb_strtolower($field->get('name')) == $name)
return $config[$field->get('id')];
}
}
......@@ -948,6 +955,10 @@ class DynamicListItem extends VerySimpleModel {
return $this->get('value');
}
function __toString() {
return $this->toString();
}
function delete() {
# Don't really delete, just unset the list_id to un-associate it with
# the list
......
......@@ -1278,7 +1278,7 @@ class Ticket {
// The answer object is retrieved here which will
// automatically invoke the toString() method when the
// answer is coerced into text
return (string)$this->_answers[$tag];
return $this->_answers[$tag];
}
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment