From 44d59931a24ab95abbd17f321a78aa9bf53fe6e7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 2 Dec 2010 13:00:01 +0000 Subject: [PATCH] moved private_addressbook attribute from addresbook_ui to addressbook_bo --- addressbook/inc/class.addressbook_bo.inc.php | 9 ++++++++- addressbook/inc/class.addressbook_ui.inc.php | 10 +--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index 45f0ccb0bf..a4a1824835 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -124,6 +124,12 @@ class addressbook_bo extends addressbook_so * @var boolean */ var $default_private; + /** + * Use a separate private addressbook (former private flag), for contacts not shareable via regular read acl + * + * @var boolean + */ + var $private_addressbook = false; /** * Categories object * @@ -176,6 +182,7 @@ class addressbook_bo extends addressbook_so { $this->default_addressbook = $this->user; // admin set a default or forced pref for personal addressbook } + $this->private_addressbook = $this->contact_repository == 'sql' && $this->prefs['private_addressbook']; $this->contact_fields = array( 'id' => lang('Contact ID'), @@ -818,7 +825,7 @@ class addressbook_bo extends addressbook_so // Update country codes foreach(array('adr_one_', 'adr_two_') as $c_prefix) { - if($contact[$c_prefix.'countryname'] && !$contact[$c_prefix.'countrycode'] && + if($contact[$c_prefix.'countryname'] && !$contact[$c_prefix.'countrycode'] && $code = $GLOBALS['egw']->country->country_code($contact[$c_prefix.'countryname'])) { if(strlen($code) == 2) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 3e3cc4b6c2..5d84454977 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -29,12 +29,6 @@ class addressbook_ui extends addressbook_bo 'admin_set_all_cleanup' => True, 'cat_add' => True, ); - /** - * use a separate private addressbook (former private flag), for contacts not shareable via regular read acl - * - * @var boolean - */ - protected $private_addressbook = false; protected $org_views; /** @@ -75,8 +69,6 @@ class addressbook_ui extends addressbook_bo $this->tmpl = new etemplate(); - $this->private_addressbook = $this->contact_repository == 'sql' && $this->prefs['private_addressbook']; - $this->org_views = array( 'org_name' => lang('Organisations'), 'org_name,adr_one_locality' => lang('Organisations by location'), @@ -284,7 +276,7 @@ class addressbook_ui extends addressbook_bo ); if($content['nm']['col_filter']['tid'] == 'D' && !$GLOBALS['egw_info']['user']['apps']['admin'] && $this->config['history'] != 'userpurge') { - // User not allowed to purge + // User not allowed to purge unset($sel_options['action']['delete']); }