Addressbook - add additional config option to only show Last/Next date for contacts

This commit is contained in:
nathangray 2018-12-17 10:04:06 -07:00
parent 8a839372e9
commit 6a6ef64793
4 changed files with 8 additions and 2 deletions

View File

@ -1715,7 +1715,7 @@ class addressbook_ui extends addressbook_bo
if (!$id_only && $rows) if (!$id_only && $rows)
{ {
$show_custom_fields = (in_array('customfields',$columselection)) && $this->customfields; $show_custom_fields = (in_array('customfields',$columselection)) && $this->customfields;
$show_calendar = !$this->config['disable_event_column'] && in_array('calendar_calendar',$columselection); $show_calendar = $this->config['disable_event_column'] != 'True' && in_array('calendar_calendar',$columselection);
$show_distributionlist = in_array('distrib_lists',$columselection) || count($available_distib_lists); $show_distributionlist = in_array('distrib_lists',$columselection) || count($available_distib_lists);
if ($show_calendar || $show_custom_fields || $show_distributionlist) if ($show_calendar || $show_custom_fields || $show_distributionlist)
{ {
@ -1872,7 +1872,7 @@ class addressbook_ui extends addressbook_bo
} }
// Disable next/last date if so configured // Disable next/last date if so configured
if($this->config['disable_event_column']) if($this->config['disable_event_column'] == 'True')
{ {
$rows['no_event_column'] = true; $rows['no_event_column'] = true;
} }

View File

@ -66,6 +66,7 @@ all contacts addressbook en All contacts
all in one field addressbook en All in one field all in one field addressbook en All in one field
all types addressbook en All types all types addressbook en All types
allow addressbook en Allow allow addressbook en Allow
allow for contacts only addressbook en Allow for contacts only
allow members of following groups to edit contact-data of accounts addressbook en Allow members of following groups to edit contact-data of accounts allow members of following groups to edit contact-data of accounts addressbook en Allow members of following groups to edit contact-data of accounts
allow users to maintain their own account-data admin en Allow users to maintain their own account data allow users to maintain their own account-data admin en Allow users to maintain their own account data
alt. csv import addressbook en Alt. CSV Import alt. csv import addressbook en Alt. CSV Import

View File

@ -34,6 +34,7 @@
<description value="Disable Last/Next Event column"/> <description value="Disable Last/Next Event column"/>
<select id="newsettings[disable_event_column]"> <select id="newsettings[disable_event_column]">
<option value="">Allow</option> <option value="">Allow</option>
<option value="contacts">Allow for contacts only</option>
<option value="True">Disabled</option> <option value="True">Disabled</option>
</select> </select>
</row> </row>

View File

@ -1678,6 +1678,10 @@ class Contacts extends Contacts\Storage
foreach($uids as $id => $uid) foreach($uids as $id => $uid)
{ {
$type = is_numeric($uid[0]) ? 'u' : $uid[0]; $type = is_numeric($uid[0]) ? 'u' : $uid[0];
if($GLOBALS['egw_info']['server']['disable_event_column'] == 'contacts' && $type == 'u')
{
continue;
}
$split_uids[$type][$id] = str_replace($type, '', $uid); $split_uids[$type][$id] = str_replace($type, '', $uid);
} }