* Organisations can now expand to show their contacts

This commit is contained in:
Nathan Gray 2015-03-02 21:50:25 +00:00
parent 157cfd84f8
commit 34cc9d3a64
2 changed files with 44 additions and 4 deletions

View File

@ -234,6 +234,8 @@ class addressbook_ui extends addressbook_bo
//'actions' => $this->get_actions(), // set on each request, as it depends on some filters
'row_id' => 'id',
'row_modified' => 'modified',
'is_parent' => 'org_count',
'parent_id' => 'parent_id',
'favorites' => true,
'placeholder_actions' => array('add')
);
@ -1397,8 +1399,11 @@ window.egw_LAB.wait(function() {
// enable/disable distribution lists depending on backend
$query['no_filter2'] = !$this->lists_available($query['filter']);
if (isset($this->org_views[(string) $query['org_view']])) // we have an org view
if (isset($this->org_views[(string) $query['org_view']]) && !$query['col_filter']['parent_id']) // we have an org view
{
// Query doesn't like empties
unset($query['col_filter']['parent_id']);
if($query['actions'] && $query['actions']['open'])
{
// Just switched from contact view, update actions
@ -1443,6 +1448,13 @@ window.egw_LAB.wait(function() {
{
$query['template'] = $do_email ? 'addressbook.email.rows' : 'addressbook.index.rows';
}
if($query['col_filter']['parent_id'])
{
$query['org_view'] = $query['col_filter']['parent_id'];
$query['template'] = 'addressbook.index.org_rows';
}
// Query doesn't like parent_id
unset($query['col_filter']['parent_id']);
if ($query['org_view']) // view the contacts of one organisation only
{
if (strpos($query['org_view'],'*AND*') !== false) $query['org_view'] = str_replace('*AND*','&',$query['org_view']);

View File

@ -10,6 +10,8 @@
<column width="40%"/>
<column width="30%"/>
<column width="30%"/>
<column width="180"/>
<column width="180"/>
</columns>
<rows>
<row class="th">
@ -18,21 +20,47 @@
<nextmatch-sortheader id="org_name" label="Organisation"/>
<nextmatch-header label="Department" id="org_unit"/>
<nextmatch-header label="Business address" id="business"/>
<vbox>
<nextmatch-header label="Business phone" id="tel_work"/>
<nextmatch-header label="Mobile phone" id="tel_cell"/>
<nextmatch-header label="Home phone" id="tel_home"/>
<description value="Fax"/>
</vbox>
<vbox>
<nextmatch-header label="Url" id="url"/>
<nextmatch-header label="Business email" id="email"/>
<nextmatch-header label="Home email" id="email_home"/>
</vbox>
</row>
<row class="row" valign="top">
<image label="$row_cont[type_label]" src="${row}[type]" align="center" no_lang="1"/>
<int id="${row}[org_count]" readonly="true" align="center"/>
<vbox>
<description id="${row}[org_name]" no_lang="1"/>
<description id="${row}[line2]" no_lang="1"/>
</vbox>
<description id="${row}[org_unit]" no_lang="1"/>
<vbox options="0,0">
<vbox>
<description id="${row}[adr_one_countryname]" no_lang="1"/>
<hbox options="0,0" orient="0">
<hbox>
<description no_lang="1" id="${row}[adr_one_locality]"/>
<description id="${row}[adr_one_postalcode]" class="leftPad5" value=" " no_lang="1"/>
</hbox>
<description no_lang="1" id="${row}[adr_one_street]"/>
<description id="${row}[adr_one_street2]" no_lang="1"/>
</vbox>
<vbox>
<url-phone id="${row}[tel_work]" readonly="true" class="telNumbers"/>
<url-phone id="${row}[tel_cell]" readonly="true" class="telNumbers"/>
<url-phone id="${row}[tel_home]" readonly="true" class="telNumbers"/>
<url-phone id="${row}[tel_fax]" readonly="true"/>
<description id="${row}[tel_prefered]" no_lang="1" href="$row_cont[tel_prefered_link]" extra_link_target="calling" extra_link_popup="$cont[call_popup]"/>
</vbox>
<vbox>
<url id="${row}[url]" readonly="true" class="fixedHeight"/>
<url-email id="${row}[email]" readonly="true" class="fixedHeight"/>
<url-email id="${row}[email_home]" readonly="true" class="fixedHeight"/>
</vbox>
</row>
</rows>
</grid>