- Allow app attribute to be specified in the template file, not just at run-time

- Use app attribute to fix infolog customfields in addressbook CRM view
This commit is contained in:
Nathan Gray 2015-02-10 00:13:31 +00:00
parent fce10a2337
commit dd30ac28f4
2 changed files with 16 additions and 8 deletions

View File

@ -90,14 +90,22 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
$form_name = self::form_name($cname, $this->id, $expand);
// Store properties at top level, so all customfield widgets can share
$app =& $this->getElementAttribute(self::GLOBAL_VALS, 'app');
if($this->getElementAttribute($form_name, 'app'))
if($this->attrs['app'])
{
$app =& $this->getElementAttribute($form_name, 'app');
} else
$app = $this->attrs['app'];
}
else
{
// Checking creates it even if it wasn't there
unset(self::$request->modifications[$form_name]['app']);
$app =& $this->getElementAttribute(self::GLOBAL_VALS, 'app');
if($this->getElementAttribute($form_name, 'app'))
{
$app =& $this->getElementAttribute($form_name, 'app');
}
else
{
// Checking creates it even if it wasn't there
unset(self::$request->modifications[$form_name]['app']);
}
}
if($this->getElementAttribute($form_name, 'customfields'))

View File

@ -55,7 +55,7 @@
</row>
</rows>
</grid>
<nextmatch-customfields id="customfields"/>
<nextmatch-customfields id="customfields" app="infolog"/>
<nextmatch-header label="Category" id="cat_id"/>
<vbox>
<nextmatch-sortheader label="Startdate" id="info_startdate" sortmode="DESC"/>
@ -95,7 +95,7 @@
</box>
<link-string id="${row}[filelinks]"/>
</vbox>
<customfields-list id="$row" class="customfields"/>
<customfields-list id="$row" class="customfields" app="infolog"/>
<menulist>
<menupopup type="select-cat" id="${row}[info_cat]" readonly="true"/>
</menulist>