-
-
@return array with additional config to merge and “sel_options” values
- */
- public static function config(array $config)
- {
-
$bocontacts = new Api\Contacts();
-
-
// get the list of account fields
-
$own_account_acl = array();
-
foreach($bocontacts->contact_fields as $field => $label)
-
{
-
// some fields the user should never be allowed to edit or are covert by an other attribute (n_fn for all n_*)
-
if (!in_array($field,array('id','tid','owner','created','creator','modified','modifier','private','n_prefix','n_given','n_middle','n_family','n_suffix')))
-
{
-
$own_account_acl[$field] = $label;
-
}
-
}
-
$own_account_acl['link_to'] = 'Links';
-
if ($config['account_repository'] != 'ldap') // no custom-fields in ldap
-
{
-
foreach(Api\Storage\Customfields::get('addressbook') as $name => $data)
-
{
-
$own_account_acl['#'.$name] = $data['label'];
-
}
-
}
-
-
$org_fields = $own_account_acl;
-
unset($org_fields['n_fn'], $org_fields['account_id']);
-
// Remove country codes as an option, it will be added by BO constructor
-
unset($org_fields['adr_one_countrycode'], $org_fields['adr_two_countrycode']);
-
-
$supported_fields = $bocontacts->get_fields('supported',null,0); // fields supported by the backend (ldap schemas!)
-
// get the list of account fields
-
$copy_fields = array();
-
foreach($bocontacts->contact_fields as $field => $label)
-
{
-
// some fields the user should never be allowed to copy or are coverted by an other attribute (n_fn for all n_*)
-
if (!in_array($field,array('id','tid','created','creator','modified','modifier','account_id','uid','etag','n_fn')))
-
{
-
$copy_fields[$field] = $label;
-
}
-
}
-
if ($config['contact_repository'] != 'ldap') // no custom-fields in ldap
-
{
-
foreach(Api\Storage\Customfields::get('addressbook') as $name => $data)
-
{
-
$copy_fields['#'.$name] = $data['label'];
-
}
-
}
-
// Remove country codes as an option, it will be added by UI constructor
-
if(in_array('adr_one_countrycode', $supported_fields))
-
{
-
unset($copy_fields['adr_one_countrycode'], $copy_fields['adr_two_countrycode']);
-
}
-
-
$repositories = array('sql' => 'SQL');
-
// check account-repository, contact-repository LDAP is only availible for account-repository == ldap
-
if ($config['account_repository'] == 'ldap' || !$config['account_repository'] && $config['auth_type'] == 'ldap')
-
{
-
$repositories['ldap'] = 'LDAP';
-
$repositories['sql-ldap'] = 'SQL --> LDAP ('.lang('read only').')';
-
}
-
-
$ret = array(
-
'sel_options' => array(
-
'own_account_acl' => $own_account_acl,
-
'org_fileds_to_update' => $org_fields, // typo has to stay, as it was there allways and we would loose existing config :(
-
'copy_fields' => $copy_fields,
-
'fileas' => $bocontacts->fileas_options(),
-
'contact_repository' => $repositories,
-
),
-
);
-
return $ret;
}
}
-
-
<grid width="100%" class="admin-config egwGridView_grid">
-
<columns>
-
<column width="60%"/>
-
<column/>
-
</columns>
-
<rows>
-
<row>
-
<description value="Telephony integration" span="all" class="subHeader"/>
-
</row>
-
<row>
-
<description value="URL to link telephone numbers to (use %1 = number to call, %u = account name, %t = account phone)" label="%s:"/>
-
<textbox id="newsettings[call_link]" size="40"/>
-
</row>
-
<row>
-
<description value="Size of popup (WxH, eg.400x300, if a popup should be used)" label="%s:"/>
-
<textbox id="newsettings[call_popup]" size="10"/>
-
</row>
-
<row>
-
<description value="Allow users to maintain their own account-data" span="all" class="subHeader"/>
-
</row>
-
<row>
-
<description value="Fields the user is allowed to edit himself"/>
-
<select id="newsettings[own_account_acl]" multiple="true" tags="true"/>
-
</row>
-
<row>
-
<description value="General" span="all" class="subHeader"/>
-
</row>
-
<row>
-
<description value="Use a category tree?"/>
-
<select id="newsettings[cat_tab]">
-
<option value="True">No</option>
-
<option value="Tree">Yes</option>
-
</select>
-
</row>
-
<row>
-
<description value="Update Fields by edited organisations?"/>
-
<hbox>
-
<select id="newsettings[org_fileds_to_update]" multiple="true" rows="4"/>
-
<button onclick="widget.getParent().getWidgetById('newsettings[org_fileds_to_update]').select_all_toggle();" label="Select all" image="check"/>
-
</hbox>
-
</row>
-
<row>
-
<description value="Fields to copy when copying an address?"/>
-
<hbox>
-
<select id="newsettings[copy_fields]" multiple="true" rows="4"/>
-
<button onclick="widget.getParent().getWidgetById('newsettings[copy_fields]').select_all_toggle();" label="Select all" image="check"/>
-
</hbox>
-
</row>
-
<row>
-
<description value="Use an extra tab for private custom fields?"/>
-
<select id="newsettings[private_cf_tab]">
-
<option value="">No</option>
-
<option value="True">Yes</option>
-
</select>
-
</row>
-
<row>
-
<description value="Security" span="all" class="subHeader"/>
-
</row>
-
<row>
-
<vbox>
-
<description value="How many contacts should non-admins be able to export"/>
-
<description value="(empty = use global limit, no = no export at all)"/>
-
</vbox>
-
<textbox id="newsettings[contact_export_limit]" size="5"/>
-
</row>
-
<row>
-
<description value="Allow members of following groups to edit contact-data of accounts" label="%s:"/>
-
<select-account id="newsettings[allow_account_edit]" account_type="groups" multiple="true" tags="true" width="100%"/>
-
</row>
-
<row>
-
<description value="History logging" span="all" class="subHeader"/>
-
</row>
-
<row>
-
<description value="Prevent deleting of contacts"/>
-
<select id="newsettings[history]">
-
<option value="">No</option>
-
<option value="history">Yes, only admins can purge deleted items</option>
-
<option value="userpurge">Yes, users can purge their deleted items</option>
-
</select>
-
</row>
-
<row>
-
<description value="Contact maintenance" span="all" class="subHeader"/>
-
</row>
-
<row>
-
<description value="Set full name and file as field in contacts of all users (either all or only empty values)" label="%s:"/>
-
<hbox>
-
<select id="fileas" empty_label="Set only full name" width="70%"/>
-
<button onclick="document.location.href='index.php?menuaction=addressbook.addressbook_ui.admin_set_fileas&all=1&type='+this.form.fileas.value;" label="All"/>
-
<button onclick="document.location.href='index.php?menuaction=addressbook.addressbook_ui.admin_set_fileas&type='+this.form.fileas.value;" label="Empty"/>
-
</hbox>
-
</row>
-
<row>
-
<description value="Cleanup addressbook fields (apply if synchronization creates duplicates)" label="%s:"/>
-
<button onclick="document.location.href='index.php?menuaction=addressbook.addressbook_ui.admin_set_all_cleanup'" label="Start"/>
-
</row>
-
<row>
-
<description value="Contact repository" span="all" class="subHeader"/>
-
</row>
-
<row>
-
<description value="Select where you want to store / retrieve contacts" label="%s:"/>
-
<select id="newsettings[contact_repository]"/>
-
</row>
-
<row>
-
<description value="You can only use LDAP as contact repository if the accounts are stored in LDAP too!" span="all"/>
-
</row>
-
<row>
-
<description value="Account repository" label="%s:"/>
-
<hbox>
-
<description id="newsettings[account_repository]" class="subHeader"/>
-
<description value="Can be changed via Setup >> Configuration"/>
-
</hbox>
-
</row>
-
<row>
-
<description value="LDAP settings for contacts" span="all" class="subHeader"/>
-
</row>
-
<row>
-
<description value="LDAP host for contacts" label="%s:"/>
-
<textbox id="newsettings[ldap_contact_host]"/>
-
</row>
-
<row>
-
<description value="LDAP context for contacts" label="%s:"/>
-
<textbox id="newsettings[ldap_contact_context]" size="40"/>
-
</row>
-
<row>
-
<description value="Additional information about using LDAP as contact repository" class="subHeader"/>
-
<description value="README" href="/doc/ldap/README.contacts" extra_link_target="_blank"/>
-
</row>
-
<row>
-
<description value="Migration to LDAP"/>
-
<hbox>
-
<select id="migrate">
-
<option value="">Select migration type</option>
-
<option value="contacts" title="if accounts are already in LDAP">contacts to LDAP</option>
-
<option value="contacts,accounts" title="use setup for a full account-migration">contacts and account contact-data to LDAP</option>
-
<option value="contacts,accounts-back" title="for read only LDAP">contacts to LDAP, account contact-data to SQL</option>
-
<option value="sql" title="for read only LDAP">contacts and account contact-data to SQL</option>
-
</select>
-
<button onclick="if (this.form.migrate.value) document.location.href='index.php?menuaction=addressbook.addressbook_ui.migrate2ldap&type='+this.form.migrate.value;" label="Start"/>
-
</hbox>
-
</row>
-
</rows>
-
</grid>
-