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

View File

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