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

orgs: Add support for organization variables

Allow usage of something like `%{ticket.user.organization.var}`
parent 9c9bfae1
No related branches found
No related tags found
No related merge requests found
......@@ -243,6 +243,20 @@ class Organization extends OrganizationModel {
return (string) $this->getName();
}
function asVar() {
return (string) $this->getName();
}
function getVar($tag) {
if($tag && is_callable(array($this, 'get'.ucfirst($tag))))
return call_user_func(array($this, 'get'.ucfirst($tag)));
$tag = mb_strtolower($tag);
foreach ($this->getDynamicData() as $e)
if ($a = $e->getAnswer($tag))
return $a;
}
function update($vars, &$errors) {
$valid = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment