Commit 4ae053ce authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5903-ease-template-fields-filling-from-ldap-values' into '1.4-dev'

Resolve "Ease template fields filling from LDAP values"

See merge request fusiondirectory/fd!436
Showing with 18 additions and 0 deletions
+18 -0
...@@ -176,6 +176,15 @@ class template ...@@ -176,6 +176,15 @@ class template
return $this->tabObject->by_object[$tab]->attributesAccess[$attr]; return $this->tabObject->by_object[$tab]->attributesAccess[$attr];
} }
function getAttributeTab($attr)
{
foreach ($this->tabObject->by_object as $tab => $tabObject) {
if (isset($tabObject->attributesAccess[$attr])) {
return $tab;
}
}
}
/*! \brief Serialize this template for webservice /*! \brief Serialize this template for webservice
*/ */
function serialize() function serialize()
......
...@@ -90,6 +90,15 @@ class BooleanAttribute extends Attribute ...@@ -90,6 +90,15 @@ class BooleanAttribute extends Attribute
} }
} }
function displayValue($value)
{
if ($this->isTemplate() && $this->isTemplatable() && ($value === '%askme%')) {
return $value;
} else {
return ($value ? _('yes') : _('no'));
}
}
function renderFormInput () function renderFormInput ()
{ {
$id = $this->getHtmlId(); $id = $this->getHtmlId();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment