[eGroupWare-svn] r55935 - in /trunk/addressbook: ./ inc/ setup/ sitemgr/

[email protected] Fri, 29 Apr 2016 10:41:53 -0000
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: ralfbecker
Date: Fri Apr 29 12:41:53 2016
New Revision: 55935

URL: http://svn.stylite.de/viewvc/egroupware?rev=55935&view=rev
Log:
converted addressbook to use new api

Modified:
    trunk/addressbook/inc/class.addressbook_bo.inc.php
    trunk/addressbook/inc/class.addressbook_contactform.inc.php
    trunk/addressbook/inc/class.addressbook_display.inc.php
    trunk/addressbook/inc/class.addressbook_egw_record.inc.php
    trunk/addressbook/inc/class.addressbook_export_contacts_csv.inc.php
    trunk/addressbook/inc/class.addressbook_export_vcard.inc.php
    trunk/addressbook/inc/class.addressbook_groupdav.inc.php
    trunk/addressbook/inc/class.addressbook_hooks.inc.php
    trunk/addressbook/inc/class.addressbook_import_contacts_csv.inc.php
    trunk/addressbook/inc/class.addressbook_import_vcard.inc.php
    trunk/addressbook/inc/class.addressbook_ui.inc.php
    trunk/addressbook/inc/class.addressbook_vcal.inc.php
    trunk/addressbook/inc/class.addressbook_wizard_export_contacts_csv.inc.php   (contents, props changed)
    trunk/addressbook/inc/class.addressbook_wizard_export_vcard.inc.php
    trunk/addressbook/inc/class.addressbook_wizard_import_contacts_csv.inc.php
    trunk/addressbook/inc/class.addressbook_wizard_import_vcard.inc.php
    trunk/addressbook/inc/class.addressbook_zpush.inc.php
    trunk/addressbook/index.php
    trunk/addressbook/setup/setup.inc.php
    trunk/addressbook/sitemgr/class.module_addressbook_contactform.inc.php
    trunk/addressbook/sitemgr/class.module_addressbook_display.inc.php

Modified: trunk/addressbook/inc/class.addressbook_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_bo.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_bo.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_bo.inc.php Fri Apr 29 12:41:53 2016
@@ -14,6 +14,7 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Acl;
 
 /**
  * Business object for addressbook
@@ -126,7 +127,7 @@
 			$result = self::get_pgp_keyserver($missing, $result);
 		}
 		//error_log(__METHOD__."(".array2string($recipients).") returning ".array2string($result));
-		egw_json_response::get()->data($result);
+		Api\Json\Response::get()->data($result);
 	}
 
 	/**
@@ -191,7 +192,7 @@
 			{
 				$contact['pubkey'] = preg_replace(self::$pgp_key_regexp, $key, $contact['pubkey']);
 			}
-			if ($this->check_perms(EGW_ACL_EDIT, $contact) && $this->save($contact))
+			if ($this->check_perms(Acl::EDIT, $contact) && $this->save($contact))
 			{
 				++$updated;
 			}
@@ -209,7 +210,7 @@
 		$message .= "\n".lang('%1 key(s) added to public keyserver "%2".',
 			self::set_pgp_keyserver($keys), PARSE_URL(self::KEYSERVER_ADD, PHP_URL_HOST));
 
-		egw_json_response::get()->data($message);
+		Api\Json\Response::get()->data($message);
 	}
 
 	/**

Modified: trunk/addressbook/inc/class.addressbook_contactform.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_contactform.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_contactform.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_contactform.inc.php Fri Apr 29 12:41:53 2016
@@ -11,6 +11,8 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Vfs;
 
 /**
  * SiteMgr contact form for the addressbook
@@ -92,9 +94,9 @@
 								// the anonymous user to have run rights for addressbook AND
 								// edit rights for the addressbook used to store the new entry,
 								// which is clearly not wanted securitywise
-								Api\Vfs::$is_root = true;
-								egw_link::link('addressbook',$id,egw_link::VFS_APPNAME,$value,$name);
-								Api\Vfs::$is_root = false;
+								Vfs::$is_root = true;
+								Link::link('addressbook',$id,Link::VFS_APPNAME,$value,$name);
+								Vfs::$is_root = false;
 							}
 						}
 

Modified: trunk/addressbook/inc/class.addressbook_display.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_display.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_display.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_display.inc.php Fri Apr 29 12:41:53 2016
@@ -10,26 +10,15 @@
  * @version $Id: class.addressbook_display.inc.php 24099 2008-02-18 16:29:06Z stefanbecker $
  */
 
+use EGroupware\Api;
+
 /**
  * SiteMgr Display form for the addressbook
  *
  */
 class addressbook_display extends addressbook_ui
 {
-	/**
-	 * Shows the Addressbook Entry and stores the submitted data
-	 *
-	 * @param array $content=null submitted eTemplate content
-	 * @param int $addressbook=null int owner-id of addressbook to save contacts too
-	 * @param array $fields=null field-names to show
-	 * @param string $msg=null message to show after submitting the form
-	 * @param string $email=null comma-separated email addresses
-	 * @param string $tpl_name=null custom etemplate to use
-	 * @param string $subject=null subject for email
-	 * @return string html content
-	 */
-	//
-function get_rows(&$query,&$rows,&$readonlys,$id_only=false)
+	function get_rows(&$query,&$rows,&$readonlys)
 	{
 		$query['sitemgr_display'] = ($readonlys['sitemgr_display'] ?$readonlys['sitemgr_display']:'addressbook.display');
 		$total = parent::get_rows($query,$rows,$readonlys);
@@ -44,6 +33,18 @@
 
 	}
 
+	/**
+	 * Shows the Addressbook Entry and stores the submitted data
+	 *
+	 * @param array $content =null submitted eTemplate content
+	 * @param int $addressbook =null int owner-id of addressbook to save contacts too
+	 * @param array $fields =null field-names to show
+	 * @param string $msg =null message to show after submitting the form
+	 * @param string $email =null comma-separated email addresses
+	 * @param string $tpl_name =null custom etemplate to use
+	 * @param string $subject =null subject for email
+	 * @return string html content
+	 */
 	function display($content=null,$addressbook=null,$fields=null,$msg=null,$email=null,$tpl_name=null,$subject=null)
 	{
 		$tpl_name=($tpl_name ? $tpl_name : 'addressbook.display');
@@ -52,7 +53,7 @@
 		$content = array(
 			'msg' => $msg ? $msg : $_GET['msg'],
 		);
-		$content['nm1'] = $GLOBALS['egw']->session->appsession(($tpl_name ? $tpl_name : 'index'),'addressbook');
+		$content['nm1'] = Api\Cache::getSession('addressbook', ($tpl_name ? $tpl_name : 'index'));
 		$readonlys['sitemgr_display']=$tpl_name;
 		if (!is_array($content['nm1']))
 		{

Modified: trunk/addressbook/inc/class.addressbook_egw_record.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_egw_record.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_egw_record.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_egw_record.inc.php Fri Apr 29 12:41:53 2016
@@ -10,6 +10,9 @@
  * @copyright Cornelius Weiss <nelius-2ty0w3T/[email protected]>
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Framework;
 
 /**
  * class addressbook_egw_record
@@ -44,7 +47,7 @@
 	 */
 	public function __construct( $_identifier='' ){
 		$this->identifier = $_identifier;
-		$this->bocontacts = new addressbook_bo();
+		$this->bocontacts = new Api\Contacts();
 		if($_identifier) {
 			$this->contact = $this->bocontacts->read($this->identifier);
 		}
@@ -123,7 +126,7 @@
 		$ui->type_icon($this->owner, $this->private, $this->tid, $icon, $label);
 
 		// Specific photo
-		return $this->jpegphoto ? egw_framework::link('/index.php',$ui->photo_src($this->identifier,$this->jpegphoto)):$icon;
+		return $this->jpegphoto ? Framework::link('/index.php',$ui->photo_src($this->identifier,$this->jpegphoto)):$icon;
 	}
 	/**
 	 * saves record into backend
@@ -171,5 +174,4 @@
 	public function __destruct() {
 		unset ($this->bocontacts);
 	}
-
-} // end of egw_addressbook_record
+}

Modified: trunk/addressbook/inc/class.addressbook_export_contacts_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_export_contacts_csv.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_export_contacts_csv.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_export_contacts_csv.inc.php Fri Apr 29 12:41:53 2016
@@ -1,6 +1,6 @@
 <?php
 /**
- * eGroupWare
+ * EGroupware - addressbook
  *
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @package addressbook
@@ -11,12 +11,14 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Acl;
+
 /**
  * export plugin of addressbook
  */
-class addressbook_export_contacts_csv implements importexport_iface_export_plugin {
-
-
+class addressbook_export_contacts_csv implements importexport_iface_export_plugin
+{
 	/**
 	 * Constants used for exploding categories & multi-selectboxes into seperate fields
 	 */
@@ -44,8 +46,8 @@
 		$selection = array();
 
 		// Addressbook defines its own export imits
-		$limit_exception = bo_merge::is_export_limit_excepted();
-		$export_limit = bo_merge::getExportLimit($app='addressbook');
+		$limit_exception = Api\Storage\Merge::is_export_limit_excepted();
+		$export_limit = Api\Storage\Merge::getExportLimit($app='addressbook');
 		if (!$limit_exception) $export_object->export_limit = $export_limit; // we may not need that after all
 		if($export_limit == 'no' && !$limit_exception) {
 			return;
@@ -57,11 +59,12 @@
 
 		if ($options['selection'] == 'search') {
 			// uicontacts selection with checkbox 'use_all'
-			$query = $GLOBALS['egw']->session->appsession('index','addressbook');
+			$query = Api\Cache::getSession('addressbook', 'index');
 			$query['num_rows'] = -1;	// all
 			$query['csv_export'] = true;	// so get_rows method _can_ produce different content or not store state in the session
 			$query['order'] = 'contact_id';
 			if(!array_key_exists('filter',$query)) $query['filter'] = $GLOBALS['egw_info']['user']['account_id'];
+			$readonlys = null;
 			$this->ui->get_rows($query,$selection,$readonlys, true);	// only return the ids
 		}
 		elseif ( $options['selection'] == 'all' ) {
@@ -73,9 +76,7 @@
 		}
 		elseif ($options['selection'] == 'filter')
 		{
-			$fields = importexport_helper_functions::get_filter_fields($_definition->application, $this);
 			$filter = $_definition->filter;
-			$known_fields = $this->ui->get_fields('supported');
 			$query = array();
 
 			// Handle ranges
@@ -125,14 +126,14 @@
 		}
 		$GLOBALS['egw_info']['flags']['currentapp'] = $old_app;
 
-		if(bo_merge::hasExportLimit($export_limit) && !$limit_exception) {
+		if(Api\Storage\Merge::hasExportLimit($export_limit) && !$limit_exception) {
 			$selection = array_slice($selection, 0, $export_limit);
 		}
 
 		if($options['explode_multiselects']) {
-			$customfields = config::get_customfields('addressbook');
+			$customfields = Api\Storage\Customfields::get('addressbook');
 			$additional_fields = array();
-			$cat_obj = new categories('', 'addressbook');
+			$cat_obj = new Api\Categories('', 'addressbook');
 			foreach($options['explode_multiselects'] as $field => $explode) {
 				switch($explode['explode']) {
 					case self::MAIN_CATS:
@@ -241,7 +242,7 @@
 		}
 
 		$export_object->set_mapping($options['mapping']);
-		
+
 		// Add in last/next event, if needed
 		if($options['mapping']['last_date'] || $options['mapping']['next_date'])
 		{
@@ -439,7 +440,7 @@
 			'type'		=> 'select',
 			'rows'		=> 5,
 			'tags'		=> true,
-			'values'	=> $this->ui->get_addressbooks(EGW_ACL_READ)
+			'values'	=> $this->ui->get_addressbooks(Acl::READ)
 		);
 	}
 }

Modified: trunk/addressbook/inc/class.addressbook_export_vcard.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_export_vcard.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_export_vcard.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_export_vcard.inc.php Fri Apr 29 12:41:53 2016
@@ -1,6 +1,6 @@
 <?php
 /**
- * vCard export plugin for importexport framework
+ * EGroupware addressbook: vCard export plugin for importexport framework
  *
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @package addressbook
@@ -10,6 +10,8 @@
  * @copyright 2012 Nathan Gray
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 /**
  * export addressbook contacts as vcard
@@ -29,9 +31,8 @@
 		$this->selection = array();
 
 		// Addressbook defines its own export imits
-		$limit_exception = bo_merge::is_export_limit_excepted();
-		$export_limit = bo_merge::getExportLimit($app='addressbook');
-		if (!$limit_exception) $export_object->export_limit = $export_limit; // we may not need that after all
+		$limit_exception = Api\Storage\Merge::is_export_limit_excepted();
+		$export_limit = Api\Storage\Merge::getExportLimit($app='addressbook');
 		if($export_limit == 'no' && !$limit_exception) {
 			return;
 		}
@@ -42,10 +43,11 @@
 
 		if ($options['selection'] == 'search') {
 			// uicontacts selection with checkbox 'use_all'
-			$query = $GLOBALS['egw']->session->appsession('index','addressbook');
+			$query = Api\Cache::getSession('addressbook', 'index');
 			$query['num_rows'] = -1;	// all
 			$query['csv_export'] = true;	// so get_rows method _can_ produce different content or not store state in the session
 			if(!array_key_exists('filter',$query)) $query['filter'] = $GLOBALS['egw_info']['user']['account_id'];
+			$readonlys = null;
 			$this->uicontacts->get_rows($query,$this->selection,$readonlys, true);	// only return the ids
 		}
 		elseif ( $options['selection'] == 'all' ) {
@@ -59,7 +61,7 @@
 		}
 		$GLOBALS['egw_info']['flags']['currentapp'] = $old_app;
 
-		if(bo_merge::hasExportLimit($export_limit) && !$limit_exception) {
+		if(Api\Storage\Merge::hasExportLimit($export_limit) && !$limit_exception) {
 			$this->selection = array_slice($this->selection, 0, $export_limit);
 		}
 
@@ -69,7 +71,7 @@
 				$_contact = $_contact[$_contact['id'] ? 'id' : 'contact_id'];
 			}
 		}
-		
+
 		// vCard opens & closes the resource itself, but this doesn't seem to matter
 		$meta = stream_get_meta_data($_stream);
 

Modified: trunk/addressbook/inc/class.addressbook_groupdav.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_groupdav.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_groupdav.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_groupdav.inc.php Fri Apr 29 12:41:53 2016
@@ -12,6 +12,7 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Acl;
 
 /**
  * CalDAV/CardDAV/GroupDAV access: Addressbook handler
@@ -237,7 +238,7 @@
 					unset($requested_multiget_ids[$k]);
 				}
 				// sync-collection report: deleted entry need to be reported without properties
-				if ($contact['tid'] == addressbook_bo::DELETED_TYPE)
+				if ($contact['tid'] == Api\Contacts::DELETED_TYPE)
 				{
 					$files[] = array('path' => $path.urldecode($this->get_path($contact)));
 					continue;
@@ -311,7 +312,7 @@
 						}
 						$props = array(
 							'getcontenttype' => Api\CalDAV::mkprop('getcontenttype', 'text/vcard'),
-							'getlastmodified' => egw_time::to($list['list_modified'],'ts'),
+							'getlastmodified' => Api\DateTime::to($list['list_modified'],'ts'),
 							'displayname' => $list['list_name'],
 							'getetag' => '"'.$etag.'"',
 						);
@@ -415,7 +416,7 @@
 							{
 								case 'i;unicode-casemap':
 								default:
-									$comp = ' '.$GLOBALS['egw']->db->capabilities[egw_db::CAPABILITY_CASE_INSENSITIV_LIKE].' ';
+									$comp = ' '.$GLOBALS['egw']->db->capabilities[Api\Db::CAPABILITY_CASE_INSENSITIV_LIKE].' ';
 									break;
 							}
 							$column = $this->filter_prop2cal[strtoupper($prop_filter)];
@@ -618,7 +619,7 @@
 		$is_group = $contact['##X-ADDRESSBOOKSERVER-KIND'] == 'group';
 		if ($oldContact && $is_group !== isset($oldContact['list_id']))
 		{
-			throw new egw_exception_assertion_failed(__METHOD__."(,'$id',$user,'$prefix') can contact into group or visa-versa!");
+			throw new Api\Exception\AssertionFailed(__METHOD__."(,'$id',$user,'$prefix') can contact into group or visa-versa!");
 		}
 
 		if (!$is_group && is_array($contact['cat_id']))
@@ -651,7 +652,7 @@
 			{
 				$contact['owner'] = $user;
 			}
-			// check if default addressbook is synced and not accounts, if not use (always synced) personal addressbook
+			// check if default addressbook is synced and not Api\Accounts, if not use (always synced) personal addressbook
 			elseif(!$this->bo->default_addressbook || !in_array($this->bo->default_addressbook,$this->home_set_pref))
 			{
 				$contact['owner'] = $GLOBALS['egw_info']['user']['account_id'];
@@ -663,7 +664,7 @@
 			}
 			// check if user has add rights for addressbook
 			// done here again, as _common_get_put_delete knows nothing about default addressbooks...
-			if (!($this->bo->grants[$contact['owner']] & EGW_ACL_ADD))
+			if (!($this->bo->grants[$contact['owner']] & Acl::ADD))
 			{
 				if ($this->debug) error_log(__METHOD__."(,'$id', $user, '$prefix') returning '403 Forbidden'");
 				return '403 Forbidden';
@@ -689,7 +690,7 @@
 			{
 				if (($contact = $this->bo->read_list($save_ok)))
 				{
-					$contact = egw_db::strip_array_keys($contact, 'list_');
+					$contact = Api\Db::strip_array_keys($contact, 'list_');
 				}
 			}
 			else
@@ -835,7 +836,7 @@
 	 * </D:supported-report-set>
 	 * @link http://www.mail-archive.com/calendarserver-users-qhrM8SXbD5KlRa4neek8BWD2FQJk+8+b@public.gmane.org/msg01156.html
 	 *
-	 * @param array $props =array() regular props by the groupdav handler
+	 * @param array $props =array() regular props by the Api\CalDAV handler
 	 * @param string $displayname
 	 * @param string $base_uri =null base url of handler
 	 * @param int $user =null account_id of owner of collection
@@ -1021,7 +1022,7 @@
 	/**
 	 * Check if user has the neccessary rights on a contact
 	 *
-	 * @param int $acl EGW_ACL_READ, EGW_ACL_EDIT or EGW_ACL_DELETE
+	 * @param int $acl Acl::READ, Acl::EDIT or Acl::DELETE
 	 * @param array|int $contact contact-array or id
 	 * @return boolean null if entry does not exist, false if no access, true if access permitted
 	 */
@@ -1073,7 +1074,7 @@
 				$this->home_set_pref[$key] = $id;
 			}
 		}
-		foreach(array_keys($this->bo->get_addressbooks(EGW_ACL_READ)) as $id)
+		foreach(array_keys($this->bo->get_addressbooks(Acl::READ)) as $id)
 		{
 			if (($id || !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) &&
 				$GLOBALS['egw_info']['user']['account_id'] != $id &&	// no current user and no accounts, if disabled in ab prefs
@@ -1125,8 +1126,8 @@
 		if (!isset($hook_data['setup']) && in_array($hook_data['type'], array('user', 'group')))
 		{
 			$user = $hook_data['account_id'];
-			$addressbook_bo = new addressbook_bo();
-			$addressbooks += $addressbook_bo->get_addressbooks(EGW_ACL_READ, null, $user);
+			$addressbook_bo = new Api\Contacts();
+			$addressbooks += $addressbook_bo->get_addressbooks(Acl::READ, null, $user);
 			if ($user > 0)  unset($addressbooks[$user]);	// allways synced
 			unset($addressbooks[$user.'p']);// ignore (optional) private addressbook for now
 		}

Modified: trunk/addressbook/inc/class.addressbook_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_hooks.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_hooks.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_hooks.inc.php Fri Apr 29 12:41:53 2016
@@ -1,6 +1,6 @@
 <?php
 /**
- * Addressbook - admin, preferences and sidebox-menus and other hooks
+ * EGroupware Addressbook - admin, preferences and sidebox-menus and other hooks
  *
  * @link http://www.egroupware.org
  * @package addressbook
@@ -11,6 +11,10 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
 
 /**
  * Class containing admin, preferences and sidebox-menus and other hooks
@@ -43,21 +47,21 @@
 				));
 			}
 			// Magic etemplate2 favorites menu (from nextmatch widget)
-			display_sidebox($appname, lang('Favorites'), egw_framework::favorite_list('addressbook'));
+			display_sidebox($appname, lang('Favorites'), Framework\Favorites::list_favorites('addressbook'));
 
 			$file = array(
-				'Addressbook list' => egw::link('/index.php',array(
+				'Addressbook list' => Egw::link('/index.php',array(
 					'menuaction' => 'addressbook.addressbook_ui.index',
 					'ajax' => 'true')),
 				array(
-					'text' => lang('Add %1',lang(egw_link::get_registry($appname, 'entry'))),
+					'text' => lang('Add %1',lang(Link::get_registry($appname, 'entry'))),
 					'no_lang' => true,
 					'link' => "javascript:egw.open('','$appname','add')"
 				),
 				'Advanced search' => "javascript:egw_openWindowCentered2('".
-					egw::link('/index.php',array('menuaction' => 'addressbook.addressbook_ui.search'),false).
+					Egw::link('/index.php',array('menuaction' => 'addressbook.addressbook_ui.search'),false).
 					"','_blank',870,480,'yes')",
-				'Placeholders'    => egw::link('/index.php','menuaction=api.EGroupware\\Api\\Contacts\\Merge.show_replacements')
+				'Placeholders'    => Egw::link('/index.php','menuaction=api.EGroupware\\Api\\Contacts\\Merge.show_replacements')
 			);
 			display_sidebox($appname,lang('Addressbook menu'),$file);
 		}
@@ -65,11 +69,11 @@
 		if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
 		{
 			$file = Array(
-				'Site configuration' => egw::link('/index.php',array(
+				'Site configuration' => Egw::link('/index.php',array(
 					'menuaction' => 'admin.uiconfig.index',
 					'appname'    => $appname,
 				)),
-				'Global Categories'  => egw::link('/index.php',array(
+				'Global Categories'  => Egw::link('/index.php',array(
 					'menuaction' => 'admin.admin_categories.index',
 					'appname'    => $appname,
 					'global_cats'=> True,
@@ -78,7 +82,7 @@
 			// custom fields are not availible in LDAP
 			if ($GLOBALS['egw_info']['server']['contact_repository'] != 'ldap')
 			{
-				$file['Custom fields'] = egw::link('/index.php',array(
+				$file['Custom fields'] = Egw::link('/index.php',array(
 					'menuaction' => 'admin.customfields.index',
 					'appname'    => $appname,
 					'use_private'=> 1,
@@ -97,7 +101,7 @@
 	}
 
 	/**
-	 * populates $settings for the preferences
+	 * populates $settings for the Api\Preferences
 	 *
 	 * @param array|string $hook_data
 	 * @return array
@@ -118,7 +122,7 @@
 			'label'  => 'Default addressbook for adding contacts',
 			'name'   => 'add_default',
 			'help'   => 'Which addressbook should be selected when adding a contact AND you have no add rights to the current addressbook.',
-			'values' => !$hook_data['setup'] ? ExecMethod('addressbook.addressbook_ui.get_addressbooks',EGW_ACL_ADD) : array(),
+			'values' => !$hook_data['setup'] ? ExecMethod('addressbook.addressbook_ui.get_addressbooks',Acl::ADD) : array(),
 			'xmlrpc' => True,
 			'admin'  => False,
 		);
@@ -159,7 +163,7 @@
 			'type'  => 'select',
 			'label' => 'Add a customfield to link title',
 			'name'  => 'link_title_cf',
-			'values' => addressbook_bo::cf_options(),
+			'values' => Api\Contacts::cf_options(),
 			'help'  =>  'Add customfield to links of addressbook, which displays in other applications. The default value is none customfield.',
 			'xmlrpc' => True,
 			'admin'  => false,
@@ -223,7 +227,7 @@
 				'name'   => 'default_document',
 				'help'   => lang('If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.', lang('addressbook')).' '.
 					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','n_fn').' '.
-					lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
+					lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
 				'run_lang' => false,
 				'xmlrpc' => True,
 				'admin'  => False,
@@ -235,7 +239,7 @@
 				'name'   => 'document_dir',
 				'help'   => lang('If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the data inserted.',lang('addressbook')).' '.
 					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','n_fn').' '.
-					lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
+					lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
 				'run_lang' => false,
 				'xmlrpc' => True,
 				'admin'  => False,
@@ -301,7 +305,7 @@
 				'type'   => 'select',
 				'label'  => 'Charset for the vCard import and export',
 				'name'   => 'vcard_charset',
-				'values' => translation::get_installed_charsets(),
+				'values' => Api\Translation::get_installed_charsets(),
 				'help'   => 'Which charset should be used for the vCard import and export.',
 				'xmlrpc' => True,
 				'admin'  => false,
@@ -425,18 +429,18 @@
 	/**
 	 * ACL rights and labels used
 	 *
-	 * @param string|array string with location or array with parameters incl. "location", specially "owner" for selected acl owner
-	 * @return array acl::(READ|ADD|EDIT|DELETE|PRIVAT|CUSTOM(1|2|3)) => $label pairs
+	 * @param string|array string with location or array with parameters incl. "location", specially "owner" for selected Acl owner
+	 * @return array Acl::(READ|ADD|EDIT|DELETE|PRIVAT|CUSTOM(1|2|3)) => $label pairs
 	 */
 	public static function acl_rights($params)
 	{
 		unset($params);	// not used, but required by function signature
 
 		return array(
-			acl::READ    => 'read',
-			acl::EDIT    => 'edit',
-			acl::ADD     => 'add',
-			acl::DELETE  => 'delete',
+			Acl::READ    => 'read',
+			Acl::EDIT    => 'edit',
+			Acl::ADD     => 'add',
+			Acl::DELETE  => 'delete',
 		);
 	}
 

Modified: trunk/addressbook/inc/class.addressbook_import_contacts_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_import_contacts_csv.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_import_contacts_csv.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_import_contacts_csv.inc.php Fri Apr 29 12:41:53 2016
@@ -98,7 +98,7 @@
 					$this->errors[$import_csv->get_current_position()] = lang(
 						'Unable to convert "%1" to account ID.  Using plugin setting (%2) for owner.',
 						$record->owner,
-						common::grab_owner_name($this->user)
+						Api\Accounts::username($this->user)
 					);
 					$record->owner = $this->user;
 				} else {
@@ -113,8 +113,8 @@
 		if(!array_key_exists($record->owner, $this->bocontacts->get_addressbooks()))
 		{
 			$this->errors[$import_csv->get_current_position()] = lang("Unable to import into %1, using %2",
-				common::grab_owner_name($record->owner),
-				common::grab_owner_name($this->user)
+				Api\Accounts::username($record->owner),
+				Api\Accounts::username($this->user)
 			);
 			$record->owner = $this->user;
 		}
@@ -165,7 +165,7 @@
 		// Format birthday as backend requires - converter should give timestamp
 		if($record->bday && is_numeric($record->bday))
 		{
-			$time = new egw_time($record->bday);
+			$time = new Api\DateTime($record->bday);
 			$record->bday = $time->format('Y-m-d');
 		}
 
@@ -323,7 +323,7 @@
 					return $result;
 				}
 			default:
-				throw new egw_exception('Unsupported action: '. $_action);
+				throw new Api\Exception('Unsupported action: '. $_action);
 
 		}
 	}
@@ -415,4 +415,4 @@
         public function get_results() {
                 return $this->results;
         }
-} // end of iface_export_plugin
+}

Modified: trunk/addressbook/inc/class.addressbook_import_vcard.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_import_vcard.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_import_vcard.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_import_vcard.inc.php Fri Apr 29 12:41:53 2016
@@ -157,6 +157,7 @@
 	 */
 	public function _vcard($_vcard, $owner)
 	{
+		// ToDo: Nathan: $_definition is not defined
 		$charset = $_definition->plugin_options['charset'];
 		if($charset == 'user') $charset = $GLOBALS['egw_info']['user']['preferences']['addressbook']['vcard_charset'];
 		$record = $this->bocontacts->vcardtoegw($_vcard,$charset);
@@ -202,8 +203,12 @@
 				// Only update if there are changes
 				$old = $this->bocontacts->read($_data['id']);
 				// if we get countrycodes as countryname, try to translate them -> the rest should be handled by bo classes.
-				foreach(array('adr_one_', 'adr_two_') as $c_prefix) {
-					if (strlen(trim($_data[$c_prefix.'countryname']))==2) $_data[$c_prefix.'countryname'] = $GLOBALS['egw']->country->get_full_name(trim($_data[$c_prefix.'countryname']),$translated=true);
+				foreach(array('adr_one_', 'adr_two_') as $c_prefix)
+				{
+					if (strlen(trim($_data[$c_prefix.'countryname']))==2)
+					{
+						$_data[$c_prefix.'countryname'] = Api\Country::get_full_name(trim($_data[$c_prefix.'countryname']), true);
+					}
 				}
 				// Don't change a user account into a contact
 				if($old['owner'] == 0) {
@@ -270,13 +275,13 @@
 
 		$record_class = get_class($this->preview_records[0]);
 
-		foreach($this->preview_records as $i => $record)
+		foreach($this->preview_records as $record)
 		{
 			// Convert to human-friendly
             importexport_export_csv::convert($record,$record_class::$types,$_definition->application);
 			$record = $record->get_record_array();
 			$row = array();
-			foreach($labels as $field => $label)
+			foreach(array_keys($labels) as $field)
 			{
 				$row[$field] = $record[$field];
 
@@ -380,4 +385,4 @@
         public function get_results() {
                 return $this->results;
         }
-} // end of iface_export_plugin
+}

Modified: trunk/addressbook/inc/class.addressbook_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_ui.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_ui.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_ui.inc.php Fri Apr 29 12:41:53 2016
@@ -13,6 +13,12 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Vfs;
+use EGroupware\Api\Etemplate;
 
 /**
  * General user interface object of the adressbook
@@ -64,7 +70,7 @@
 	/**
 	 * Instance of eTemplate class
 	 *
-	 * @var etemplate_new
+	 * @var Etemplate
 	 */
 	protected $tmpl;
 
@@ -77,7 +83,7 @@
 	{
 		parent::__construct($contact_app);
 
-		$this->tmpl = new etemplate_new();
+		$this->tmpl = new Etemplate();
 
 		$this->org_views = array(
 			'org_name'                  => lang('Organisations'),
@@ -86,12 +92,12 @@
 		);
 
 		// make sure the hook for export_limit is registered
-		if (!$GLOBALS['egw']->hooks->hook_exists('export_limit','addressbook')) $GLOBALS['egw']->hooks->register_single_app_hook('addressbook','export_limit');
+		if (!Api\Hooks::exists('export_limit','addressbook')) Api\Hooks::read(true);
 
 		$this->config =& $GLOBALS['egw_info']['server'];
 
 		// check if a contact specific export limit is set, if yes use it also for etemplate's csv export
-		$this->config['export_limit'] = $this->config['contact_export_limit'] = bo_merge::getExportLimit($app='addressbook');
+		$this->config['export_limit'] = $this->config['contact_export_limit'] = Api\Storage\Merge::getExportLimit($app='addressbook');
 
 		if ($this->config['copy_fields'] && ($fields = is_array($this->config['copy_fields']) ?
 			$this->config['copy_fields'] : unserialize($this->config['copy_fields'])))
@@ -114,69 +120,70 @@
 	/**
 	 * List contacts of an addressbook
 	 *
-	 * @param array $content=null submitted content
-	 * @param string $msg=null	message to show
-	 * @param boolean $do_email=false do an email-selection popup or the regular index-page
+	 * @param array $_content =null submitted content
+	 * @param string $msg =null	message to show
+	 * @param boolean $do_email =false do an email-selection popup or the regular index-page
 	 */
-	function index($content=null,$msg=null,$do_email=false)
+	function index($_content=null,$msg=null,$do_email=false)
 	{
-		//echo "<p>uicontacts::index(".print_r($content,true).",'$msg')</p>\n";
-		if (($re_submit = is_array($content)))
-		{
-			$do_email = $content['do_email'];
-
-			if (isset($content['nm']['rows']['delete']))	// handle a single delete like delete with the checkboxes
-			{
-				list($id) = @each($content['nm']['rows']['delete']);
-				$content['nm']['action'] = 'delete';
-				$content['nm']['selected'] = array($id);
-			}
-			if (isset($content['nm']['rows']['document']))	// handle insert in default document button like an action
-			{
-				list($id) = @each($content['nm']['rows']['document']);
-				$content['nm']['action'] = 'document';
-				$content['nm']['selected'] = array($id);
-			}
-			if ($content['nm']['action'] !== '' && $content['nm']['action'] !== null)
-			{
-				if (!count($content['nm']['selected']) && !$content['nm']['select_all'] && $content['nm']['action'] != 'delete_list')
+		//echo "<p>uicontacts::index(".print_r($_content,true).",'$msg')</p>\n";
+		if (($re_submit = is_array($_content)))
+		{
+			$do_email = $_content['do_email'];
+
+			if (isset($_content['nm']['rows']['delete']))	// handle a single delete like delete with the checkboxes
+			{
+				list($id) = @each($_content['nm']['rows']['delete']);
+				$_content['nm']['action'] = 'delete';
+				$_content['nm']['selected'] = array($id);
+			}
+			if (isset($_content['nm']['rows']['document']))	// handle insert in default document button like an action
+			{
+				list($id) = @each($_content['nm']['rows']['document']);
+				$_content['nm']['action'] = 'document';
+				$_content['nm']['selected'] = array($id);
+			}
+			if ($_content['nm']['action'] !== '' && $_content['nm']['action'] !== null)
+			{
+				if (!count($_content['nm']['selected']) && !$_content['nm']['select_all'] && $_content['nm']['action'] != 'delete_list')
 				{
 					$msg = lang('You need to select some contacts first');
 				}
-				elseif ($content['nm']['action'] == 'view_org')	// org-view via context menu
-				{
-					$content['nm']['org_view'] = array_shift($content['nm']['selected']);
+				elseif ($_content['nm']['action'] == 'view_org')	// org-view via context menu
+				{
+					$_content['nm']['org_view'] = array_shift($_content['nm']['selected']);
 				}
 				else
 				{
-					if ($this->action($content['nm']['action'],$content['nm']['selected'],$content['nm']['select_all'],
-						$success,$failed,$action_msg,$content['do_email'] ? 'email' : 'index',$msg,$content['nm']['checkboxes']))
+					$success = $failed = $action_msg = null;
+					if ($this->action($_content['nm']['action'],$_content['nm']['selected'],$_content['nm']['select_all'],
+						$success,$failed,$action_msg,$_content['do_email'] ? 'email' : 'index',$msg,$_content['nm']['checkboxes']))
 					{
 						$msg .= lang('%1 contact(s) %2',$success,$action_msg);
-						egw_framework::message($msg);
+						Framework::message($msg);
 					}
 					elseif(is_null($msg))
 					{
 						$msg .= lang('%1 contact(s) %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
-						egw_framework::message($msg,'error');
+						Framework::message($msg,'error');
 					}
 					$msg = '';
 				}
 			}
-			if ($content['nm']['rows']['infolog'])
-			{
-				list($org) = each($content['nm']['rows']['infolog']);
+			if ($_content['nm']['rows']['infolog'])
+			{
+				list($org) = each($_content['nm']['rows']['infolog']);
 				return $this->infolog_org_view($org);
 			}
-			if ($content['nm']['rows']['view'])	// show all contacts of an organisation
-			{
-				list($org_view) = each($content['nm']['rows']['view']);
+			if ($_content['nm']['rows']['view'])	// show all contacts of an organisation
+			{
+				list($org_view) = each($_content['nm']['rows']['view']);
 			}
 			else
 			{
-				$org_view = $content['nm']['org_view'];
-			}
-			$typeselection = $content['nm']['col_filter']['tid'];
+				$org_view = $_content['nm']['org_view'];
+			}
+			$typeselection = $_content['nm']['col_filter']['tid'];
 		}
 		elseif($_GET['add_list'])
 		{
@@ -197,14 +204,14 @@
 		$preserv = array(
 			'do_email' => $do_email,
 		);
-		$to = $content['nm']['to'];
+		$to = $_content['nm']['to'];
 		$content = array();
 		if($msg || $_GET['msg'])
 		{
-			egw_framework::message($msg ? $msg : $_GET['msg']);
-		}
-
-		$content['nm'] = egw_session::appsession($do_email ? 'email' : 'index','addressbook');
+			Framework::message($msg ? $msg : $_GET['msg']);
+		}
+
+		$content['nm'] = Api\Cache::getSession('addressbook', $do_email ? 'email' : 'index');
 		if (!is_array($content['nm']))
 		{
 			$content['nm'] = array(
@@ -257,7 +264,7 @@
 		$sel_options['cat_id'] = array('' => lang('All categories'), '0' => lang('None'));
 
 		// Edit and delete list actions depends on permissions
-		if($this->get_lists(EGW_ACL_EDIT))
+		if($this->get_lists(Acl::EDIT))
 		{
 			$content['nm']['placeholder_actions'][] = 'rename_list';
 			$content['nm']['placeholder_actions'][] = 'delete_list';
@@ -270,10 +277,10 @@
 		if (isset($typeselection)) $content['nm']['col_filter']['tid'] = $typeselection;
 		// save the tid for use in creating new addressbook entrys via UI. Current tid is to be used as type of new entrys
 		//error_log(__METHOD__.__LINE__.' '.$content['nm']['col_filter']['tid']);
-		egw_cache::setSession('addressbook','active_tid',$content['nm']['col_filter']['tid']);
+		Api\Cache::setSession('addressbook','active_tid',$content['nm']['col_filter']['tid']);
 		if ($this->lists_available())
 		{
-			$sel_options['filter2'] = $this->get_lists(EGW_ACL_READ,array('' => lang('No distribution list')));
+			$sel_options['filter2'] = $this->get_lists(Acl::READ,array('' => lang('No distribution list')));
 			$sel_options['filter2']['add'] = lang('Add a new list').'...';	// put it at the end
 		}
 		if ($do_email)
@@ -296,13 +303,13 @@
 		{
 			$content['nm']['header_left'] = 'addressbook.index.left';
 		}
-		$sel_options['filter'] = $sel_options['owner'] = $this->get_addressbooks(EGW_ACL_READ, lang('All addressbooks'));
+		$sel_options['filter'] = $sel_options['owner'] = $this->get_addressbooks(Acl::READ, lang('All addressbooks'));
 		$sel_options['to'] = array(
 			'to'  => 'To',
 			'cc'  => 'Cc',
 			'bcc' => 'Bcc',
 		);
-		$sel_options['adr_one_countrycode']['-custom-'] = lang('No country selected');
+		$sel_options['adr_one_countrycode']['-custom-'] = lang('No Api\Country selected');
 
 		// if there is any export limit set, pass it on to the nextmatch, to be evaluated by the export
 		if (isset($this->config['contact_export_limit']) && (int)$this->config['contact_export_limit']) $content['nm']['export_limit']=$this->config['contact_export_limit'];
@@ -351,17 +358,16 @@
 
 		$this->tmpl->read($do_email ? 'addressbook.email' : 'addressbook.index');
 		return $this->tmpl->exec($do_email ? 'addressbook.addressbook_ui.emailpopup' : 'addressbook.addressbook_ui.index',
-			$content,$sel_options,$readonlys,$preserv,$do_email ? 2 : 0);
+			$content,$sel_options,array(),$preserv,$do_email ? 2 : 0);
 	}
 
 	/**
 	 * Get actions / context menu items
 	 *
-	 * @param string $tid_filter=null
-	 * @param string $org_view=null
-	 * @return array see nextmatch_widget::get_actions()
+	 * @param string $tid_filter =null
+	 * @return array see Etemplate\Widget\Nextmatch::get_actions()
 	 */
-	public function get_actions($tid_filter=null, $org_view=null)
+	public function get_actions($tid_filter=null)
 	{
 		// Contact view
 		$actions = array(
@@ -384,7 +390,7 @@
 				'disableClass' => 'contact_organisation',
 				'hideOnDisabled' => true,
 				'url' => 'menuaction=addressbook.addressbook_ui.edit&contact_id=$id',
-				'popup' => egw_link::get_registry('addressbook', 'edit_popup'),
+				'popup' => Link::get_registry('addressbook', 'edit_popup'),
 				'group' => $group,
 			),
 			'add' => array(
@@ -396,13 +402,13 @@
 					'new' => array(
 						'caption' => 'New',
 						'url' => 'menuaction=addressbook.addressbook_ui.edit',
-						'popup' => egw_link::get_registry('addressbook', 'add_popup'),
+						'popup' => Link::get_registry('addressbook', 'add_popup'),
 						'icon' => 'new',
 					),
 					'copy' => array(
 						'caption' => 'Copy',
 						'url' => 'menuaction=addressbook.addressbook_ui.edit&makecp=1&contact_id=$id',
-						'popup' => egw_link::get_registry('addressbook', 'add_popup'),
+						'popup' => Link::get_registry('addressbook', 'add_popup'),
 						'allowOnMultiple' => false,
 						'icon' => 'copy',
 					),
@@ -445,7 +451,7 @@
 				'disableClass' => 'contact_contact',
 				'hideOnDisabled' => true,
 				'url' => 'menuaction=addressbook.addressbook_ui.edit&org=$id',
-				'popup' => egw_link::get_registry('addressbook', 'add_popup'),
+				'popup' => Link::get_registry('addressbook', 'add_popup'),
 			),
 		);
 
@@ -455,16 +461,16 @@
 			'caption' => 'Categories',
 			'group' => $group,
 			'children' => array(
-				'cat_add' => nextmatch_widget::category_action(
+				'cat_add' => Etemplate\Widget\Nextmatch::category_action(
 					'addressbook',$group,'Add category', 'cat_add_',
-					true, 0,nextmatch_widget::DEFAULT_MAX_MENU_LENGTH,false
+					true, 0,Etemplate\Widget\Nextmatch::DEFAULT_MAX_MENU_LENGTH,false
 				)+array(
 					'icon' => 'foldertree_nolines_plus',
 					'disableClass' => 'rowNoEdit',
 				),
-				'cat_del' => nextmatch_widget::category_action(
+				'cat_del' => Etemplate\Widget\Nextmatch::category_action(
 					'addressbook',$group,'Delete category', 'cat_del_',
-					true, 0,nextmatch_widget::DEFAULT_MAX_MENU_LENGTH,false
+					true, 0,Etemplate\Widget\Nextmatch::DEFAULT_MAX_MENU_LENGTH,false
 				)+array(
 					'icon' => 'foldertree_nolines_minus',
 					'disableClass' => 'rowNoEdit',
@@ -484,7 +490,7 @@
 			),
 			'group' => $group,
 		);
-		if (($add_lists = $this->get_lists(EGW_ACL_EDIT)))	// do we have distribution lists?, and are we allowed to edit them
+		if (($add_lists = $this->get_lists(Acl::EDIT)))	// do we have distribution lists?, and are we allowed to edit them
 		{
 			$actions['lists']['children'] += array(
 				'to_list' => array(
@@ -528,11 +534,12 @@
 			}
 		}
 		// move to AB
-		if (($move2addressbooks = $this->get_addressbooks(EGW_ACL_ADD)))	// do we have addressbooks, we should
+		if (($move2addressbooks = $this->get_addressbooks(Acl::ADD)))	// do we have addressbooks, we should
 		{
 			unset($move2addressbooks[0]);	// do not offer action to move contact to an account, as we dont support that currrently
 			foreach($move2addressbooks as $owner => $label)
 			{
+				$icon = $type_label = null;
 				$this->type_icon((int)$owner, substr($owner,-1) == 'p', 'n', $icon, $type_label);
 				$move2addressbooks[$owner] = array(
 					'icon' => $icon,
@@ -583,7 +590,7 @@
 						'caption' => 'Add a new Infolog',
 						'icon' => 'new',
 						'url' => 'menuaction=infolog.infolog_ui.edit&type=task&action=addressbook&action_id=$id',
-						'popup' => egw_link::get_registry('infolog', 'add_popup'),
+						'popup' => Link::get_registry('infolog', 'add_popup'),
 						'onExecute' => 'javaScript:app.addressbook.add_task',	// call server for org-view only
 					),
 				),
@@ -607,7 +614,7 @@
 					'calendar_add' => array(
 						'caption' => 'Add appointment',
 						'icon' => 'new',
-						'popup' => egw_link::get_registry('calendar', 'add_popup'),
+						'popup' => Link::get_registry('calendar', 'add_popup'),
 						'onExecute' => 'javaScript:app.addressbook.add_cal',
 					),
 				),
@@ -676,7 +683,7 @@
 			);
 		}
 		// check if user is an admin or the export is not generally turned off (contact_export_limit is non-numerical, eg. no)
-		$exception = bo_merge::is_export_limit_excepted();
+		$exception = Api\Storage\Merge::is_export_limit_excepted();
 		if ((isset($GLOBALS['egw_info']['user']['apps']['admin']) || $exception)  || !$this->config['contact_export_limit'] || (int)$this->config['contact_export_limit'])
 		{
 			$actions['export'] = array(
@@ -693,7 +700,7 @@
 					'vcard'  => array(
 						'caption' => 'Export as VCard',
 						'postSubmit' => true,	// download needs post submit (not Ajax) to work
-						'icon' => egw_vfs::mime_icon('text/vcard'),
+						'icon' => Vfs::mime_icon('text/vcard'),
 					),
 				),
 				'hideOnMobile' => true
@@ -727,7 +734,7 @@
 				'disableClass' => 'rowNoDelete',
 			);
 		}
-		if ($this->grants[0] & EGW_ACL_DELETE)
+		if ($this->grants[0] & Acl::DELETE)
 		{
 			$actions['delete_account'] = array(
 				'caption' => 'Delete',
@@ -752,7 +759,7 @@
 		if (isset($actions['export']['children']['csv']) && !importexport_helper_functions::has_definitions('addressbook','export')) unset($actions['export']['children']['csv']);
 
 		// Intercept open action in order to open entry into view mode instead of edit
-		if (html::$ua_mobile)
+		if (Api\Header\UserAgent::mobile())
 		{
 			$actions['open']['onExecute'] = 'javaScript:app.addressbook.viewEntry';
 			$actions['open']['mobileViewTemplate'] = 'view';
@@ -786,15 +793,15 @@
 			list(,$name) = explode(':',$part,2);
 			if ($name) $org_name[] = $name;
 		}
-		$org_name = implode(': ',$org_name);
-		return $org_name ? array($org => $org_name) : array();
+		$name = implode(': ',$org_name);
+		return $name ? array($org => $name) : array();
 	}
 
 	/**
 	 * Email address-selection popup
 	 *
-	 * @param array $content=null submitted content
-	 * @param string $msg=null	message to show
+	 * @param array $content =null submitted content
+	 * @param string $msg =null	message to show
 	 */
 	function emailpopup($content=null,$msg=null)
 	{
@@ -838,13 +845,13 @@
 	 * Return the contacts in an organisation via AJAX
 	 *
 	 * @param string|string[] $org Organisation ID
-	 * @param mixed $query Query filters (category, etc) to use, or null to use session
+	 * @param mixed $_query Query filters (category, etc) to use, or null to use session
 	 * @return array
 	 */
-	public function ajax_organisation_contacts($org, $query = null)
+	public function ajax_organisation_contacts($org, $_query = null)
 	{
 		$org_contacts = array();
-		$query = $query == null ? egw_session::appsession('index','addressbook') : $query;
+		$query = !$_query ? Api\Cache::getSession('addressbook', 'index') : $_query;
 		$query['num_rows'] = -1;	// all
 		if(!is_array($query['col_filter'])) $query['col_filter'] = array();
 
@@ -853,13 +860,14 @@
 		{
 			$query['org_view'] = $org_name;
 			$checked = array();
-			$count = $this->get_rows($query,$checked,$readonlys,true);	// true = only return the id's
+			$readonlys = null;
+			$this->get_rows($query,$checked,$readonlys,true);	// true = only return the id's
 			if($checked[0])
 			{
 				$org_contacts = array_merge($org_contacts,$checked);
 			}
 		}
-		egw_json_response::get()->data(array_unique($org_contacts));
+		Api\Json\Response::get()->data(array_unique($org_contacts));
 	}
 
 	/**
@@ -869,10 +877,11 @@
 	 */
 	function infolog_org_view($org)
 	{
-		$query = egw_session::appsession('index','addressbook');
+		$query = Api\Cache::getSession('addressbook', 'index');
 		$query['num_rows'] = -1;	// all
 		$query['org_view'] = $org;
 		$query['searchletter'] = '';
+		$checked = $readonlys = null;
 		$this->get_rows($query,$checked,$readonlys,true);	// true = only return the id's
 
 		if (count($checked) > 1)	// use a nicely formatted org-name as title in infolog
@@ -890,7 +899,7 @@
 		{
 			$org = '';	// use infolog default of link-title
 		}
-		egw::redirect_link('/index.php',array(
+		Egw::redirect_link('/index.php',array(
 			'menuaction' => 'infolog.infolog_ui.index',
 			'action' => 'addressbook',
 			'action_id' => implode(',',$checked),
@@ -900,13 +909,14 @@
 
 	function ajax_add_whole_list($list, $email_type = 'email')
 	{
-		$query = egw_session::appsession('email','addressbook');
+		$query = Api\Cache::getSession('addressbook', 'email');
 		$query['filter2'] = (int)$list;
+		$success = $failed = $action_msg = $msg = null;
 		$this->action($email_type,array(),true,$success,$failed,$action_msg,$query,$msg);
 
-		$response = egw_json_response::get();
-
-		if ($success) $response->addScript(egw_framework::set_onload(''));
+		$response = Api\Json\Response::get();
+
+		if ($success) $response->addScript(Framework::set_onload(''));
 
 		// close window only if no errors AND something added
 		if ($failed || !$success)
@@ -932,23 +942,23 @@
 	 *
 	 * @param int $list_id ID of existing list, or 0 for a new one
 	 * @param string $new_name List name
-	 * @param int $owner List owner, or empty for current user
+	 * @param int $_owner List owner, or empty for current user
 	 * @return boolean|string
 	 */
-	function ajax_set_list($list_id, $new_name, $owner = false)
+	function ajax_set_list($list_id, $new_name, $_owner = false)
 	{
 		// Set owner to current user, if not set
-		$owner = $owner ? $owner : $GLOBALS['egw_info']['user']['account_id'];
+		$owner = $_owner ? $_owner : $GLOBALS['egw_info']['user']['account_id'];
 
 		// Check for valid list & permissions
 		if(!(int)$list_id && !$this->check_list(null,EGW_ACL_ADD|EGW_ACL_EDIT,$owner))
 		{
-			egw_json_response::get()->apply('egw.message', array(  lang('List creation failed, no rights!'),'error'));
+			Api\Json\Response::get()->apply('egw.message', array(  lang('List creation failed, no rights!'),'error'));
 			return;
 		}
-		if ((int)$list_id && !$this->check_list((int)$list_id, EGW_ACL_EDIT, $owner))
-		{
-			egw_json_response::get()->apply('egw.message', array(  lang('Insufficent rights to edit this list!'),'error'));
+		if ((int)$list_id && !$this->check_list((int)$list_id, Acl::EDIT, $owner))
+		{
+			Api\Json\Response::get()->apply('egw.message', array(  lang('Insufficent rights to edit this list!'),'error'));
 			return;
 		}
 
@@ -963,12 +973,12 @@
 
 		$new_id = $this->add_list(array('list_id' => (int)$list_id), $list['list_owner'],array(),$list);
 
-		egw_json_response::get()->apply('egw.message', array(
+		Api\Json\Response::get()->apply('egw.message', array(
 			$new_id == $list_id ? lang('Distribution list renamed') : lang('List created'),
 			'success'
 		));
 		// Success, just update selectbox to new value
-		egw_json_response::get()->data($new_id == $list_id ? "true" : $new_id);
+		Api\Json\Response::get()->data($new_id == $list_id ? "true" : $new_id);
 	}
 
 	/**
@@ -990,12 +1000,13 @@
 		if ($use_all || in_array($action,array('remove_from_list','delete_list')))
 		{
 			// get the whole selection
-			$query = is_array($session_name) ? $session_name : egw_session::appsession($session_name,'addressbook');
+			$query = is_array($session_name) ? $session_name : Api\Cache::getSession('addressbook', $session_name);
 
 			if ($use_all)
 			{
 				@set_time_limit(0);			// switch off the execution time limit, as it's for big selections to small
 				$query['num_rows'] = -1;	// all
+				$readonlys = null;
 				$this->get_rows($query,$checked,$readonlys,true);	// true = only return the id's
 			}
 		}
@@ -1010,10 +1021,11 @@
 					return $this->infolog_org_view($id);	// uses the org-name, instead of 'selected contacts'
 				}
 				unset($checked[$n]);
-				$query = egw_session::appsession($session_name,'addressbook');
+				$query = Api\Cache::getSession('addressbook', $session_name);
 				$query['num_rows'] = -1;	// all
 				$query['org_view'] = $id;
 				unset($query['filter2']);
+				$extra = $readonlys = null;
 				$this->get_rows($query,$extra,$readonlys,true);	// true = only return the id's
 				if ($extra[0]) $org_contacts = array_merge($org_contacts,$extra);
 			}
@@ -1041,7 +1053,7 @@
 			$action = substr($action,0,7);
 		}
 		// Security: stop non-admins to export more then the configured number of contacts
-		if (in_array($action,array('csv','vcard')) && $this->config['contact_export_limit'] && !bo_merge::is_export_limit_excepted() &&
+		if (in_array($action,array('csv','vcard')) && $this->config['contact_export_limit'] && !Api\Storage\Merge::is_export_limit_excepted() &&
 			(!is_numeric($this->config['contact_export_limit']) || count($checked) > $this->config['contact_export_limit']))
 		{
 			$action_msg = lang('exported');
@@ -1059,6 +1071,7 @@
 				break;
 
 			case 'merge':
+				$error_msg = null;
 				$success = $this->merge($checked,$error_msg);
 				$failed = count($checked) - (int)$success;
 				$action_msg = lang('merged');
@@ -1078,7 +1091,7 @@
 				{
 					$msg = lang('Distribution list deleted');
 					unset($query['filter2']);
-					egw_session::appsession($session_name,'addressbook',$query);
+					Api\Cache::setSession('addressbook', $session_name, $query);
 				}
 				return false;
 
@@ -1090,26 +1103,25 @@
 				return false;
 
 			case 'infolog_add':
-				egw_framework::popup(egw::link('/index.php',array(
+				Framework::popup(Egw::link('/index.php',array(
 						'menuaction' => 'infolog.infolog_ui.edit',
 						'type' => 'task',
 						'action' => 'addressbook',
 						'action_id' => implode(',',$checked),
-					)),'_blank',egw_link::get_registry('infolog', 'add_popup'));
+					)),'_blank',Link::get_registry('infolog', 'add_popup'));
 				$msg = '';	// no message, as we send none in javascript too and users sees opening popup
 				return false;
 
 			case 'calendar_add':	// add appointment for org-views, other views are handled directly in javascript
-				egw_framework::popup(egw::link('/index.php',array(
+				Framework::popup(Egw::link('/index.php',array(
 						'menuaction' => 'calendar.calendar_uiforms.edit',
 						'participants' => 'c'.implode(',c',$checked),
-					)),'_blank',egw_link::get_registry('calendar', 'add_popup'));
+					)),'_blank',Link::get_registry('calendar', 'add_popup'));
 				$msg = '';	// no message, as we send none in javascript too and users sees opening popup
 				return false;
 
 			case 'calendar_view':	// show calendar for org-views, although all views are handled directly in javascript
-				list($width,$height) = explode('x',egw_link::get_registry('calendar', 'add_popup'));
-				egw::redirect_link('/index.php',array(
+				Egw::redirect_link('/index.php',array(
 					'menuaction' => 'calendar.calendar_uiviews.index',
 					'owner' => 'c'.implode(',c',$checked),
 				));
@@ -1120,10 +1132,10 @@
 			{
 				case 'cat_add':
 				case 'cat_del':
-					if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(EGW_ACL_EDIT,$contact)))
+					if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(Acl::EDIT,$contact)))
 					{
 						$action_msg = $action == 'cat_add' ? lang('categorie added') : lang('categorie delete');
-						$cat_ids = $contact['cat_id'] ? explode(',', $contact['cat_id']) : array();   //existing categories
+						$cat_ids = $contact['cat_id'] ? explode(',', $contact['cat_id']) : array();   //existing Api\Categories
 						if ($action == 'cat_add')
 						{
 							$cat_ids[] = $cat_id;
@@ -1133,10 +1145,10 @@
 						{
 							unset($cat_ids[$key]);
 						}
-						$cat_ids = $cat_ids ? implode(',',$cat_ids) : null;
-						if ($cat_ids !== $contact['cat_id'])
+						$ids = $cat_ids ? implode(',',$cat_ids) : null;
+						if ($ids !== $contact['cat_id'])
 						{
-							$contact['cat_id'] = $cat_ids;
+							$contact['cat_id'] = $ids;
 							$Ok = $this->save($contact);
 						}
 					}
@@ -1144,7 +1156,7 @@
 
 				case 'delete':
 					$action_msg = lang('deleted');
-					if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(EGW_ACL_DELETE,$contact)))
+					if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(Acl::DELETE,$contact)))
 					{
 						if ($contact['owner'] ||	// regular contact or
 							empty($contact['account_id']) ||	// accounts without account_id
@@ -1156,13 +1168,13 @@
 						// delete single account --> redirect to admin
 						elseif (count($checked) == 1 && $contact['account_id'])
 						{
-							egw::redirect_link('/index.php',array(
+							Egw::redirect_link('/index.php',array(
 								'menuaction' => 'admin.admin_account.delete',
 								'account_id' => $contact['account_id'],
 							));
 							// this does NOT return!
 						}
-						else	// no mass delete of accounts
+						else	// no mass delete of Api\Accounts
 						{
 							$Ok = false;
 						}
@@ -1171,7 +1183,7 @@
 
 				case 'undelete':
 					$action_msg = lang('recovered');
-					if ($contact = $this->read($id))
+					if (($contact = $this->read($id)))
 					{
 						$contact['tid'] = 'n';
 						$Ok = $this->save($contact);
@@ -1180,9 +1192,10 @@
 
 				case 'email':
 				case 'email_home':
-					$action == 'email' ? $action_fallback = 'email_home' : $action_fallback = 'email';
+					/* this cant work anymore, as Framework::set_onload does not longer exist
+					$action_fallback = $action == 'email' ? 'email_home' : 'email';
 					$action_msg = lang('added');
-					if($contact = $this->read($id))
+					if(($contact = $this->read($id)))
 					{
 						if(strpos($contact[$action],'@') !== false)
 						{
@@ -1199,13 +1212,13 @@
 						if($email)
 						{
 							$contact['n_fn'] = str_replace(array(',','@'),' ',$contact['n_fn']);
-							egw_framework::set_onload("addEmail('".addslashes(
+							Framework::set_onload("addEmail('".addslashes(
 								$contact['n_fn'] ? $contact['n_fn'].' <'.trim($email).'>' : trim($email))."');");
 							//error_log(__METHOD__.__LINE__."addEmail('".addslashes(
 							//	$contact['n_fn'] ? $contact['n_fn'].' <'.trim($email).'>' : trim($email))."');");
 							$Ok = true;
 						}
-					}
+					}*/
 					break;
 
 				case 'remove_from_list':
@@ -1235,16 +1248,16 @@
 					break;
 
 				default:	// move to an other addressbook
-					if (!(int)$action || !($this->grants[(string) (int) $action] & EGW_ACL_EDIT))	// might be ADD in the future
+					if (!(int)$action || !($this->grants[(string) (int) $action] & Acl::EDIT))	// might be ADD in the future
 					{
 						return false;
 					}
 					if (!$checkboxes['move_to_copy'])
 					{
 						$action_msg = lang('moved');
-						if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(EGW_ACL_DELETE,$contact)))
+						if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(Acl::DELETE,$contact)))
 						{
-							if (!$contact['owner'])		// no (mass-)move of accounts
+							if (!$contact['owner'])		// no (mass-)move of Api\Accounts
 							{
 								$Ok = false;
 							}
@@ -1259,7 +1272,7 @@
 					else
 					{
 						$action_msg = lang('copied');
-						if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(EGW_ACL_READ,$contact)))
+						if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(Acl::READ,$contact)))
 						{
 							if ($contact['owner'] != (int)$action || $contact['private'] != (int)(substr($action,-1) == 'p'))
 							{
@@ -1270,7 +1283,7 @@
 								$Ok = $this->save($contact);
 								if ($Ok && is_array($links))
 								{
-									egw_link::link('addressbook', $contact['id'], $links);
+									Link::link('addressbook', $contact['id'], $links);
 								}
 							}
 						}
@@ -1301,8 +1314,8 @@
 	function copy_contact(array &$content, $only_copy_fields=true)
 	{
 		$content['link_to']['to_id'] = 0;
-		egw_link::link('addressbook',$content['link_to']['to_id'],'addressbook',$content['id'],
-			lang('Copied by %1, from record #%2.',common::display_fullname('',
+		Link::link('addressbook',$content['link_to']['to_id'],'addressbook',$content['id'],
+			lang('Copied by %1, from record #%2.',Api\Accounts::format_username('',
 			$GLOBALS['egw_info']['user']['account_firstname'],$GLOBALS['egw_info']['user']['account_lastname']),
 			$content['id']));
 		// create a new contact with the content of the old
@@ -1327,8 +1340,8 @@
 	 * @internal
 	 * @param array &$query
 	 * @param array &$rows returned rows/cups
-	 * @param array &$readonlys eg. to disable buttons based on acl
-	 * @param boolean $id_only=false if true only return (via $rows) an array of contact-ids, dont save state to session
+	 * @param array &$readonlys eg. to disable buttons based on Acl
+	 * @param boolean $id_only =false if true only return (via $rows) an array of contact-ids, dont save state to session
 	 * @return int total number of contacts matching the selection
 	 */
 	function get_rows(&$query,&$rows,&$readonlys,$id_only=false)
@@ -1344,11 +1357,11 @@
 			{
 				unset($store_query[$key]);
 			}
-			$old_state = egw_session::appsession($what,'addressbook',$store_query);
+			$old_state = Api\Cache::setSession('addressbook', $what, $store_query);
 		}
 		else
 		{
-			$old_state = egw_session::appsession($what,'addressbook');
+			$old_state = Api\Cache::getSession('addressbook', $what);
 		}
 		if (!isset($this->org_views[(string) $query['org_view']]) || strpos($query['org_view'],':') === false)   // we dont have an org view, unset the according col_filters
 		{
@@ -1369,10 +1382,11 @@
 		{
 			$query['advanced_search'] = $old_state['advanced_search'];
 		}
+		/* this cant work anymore, as Framework::set_onload no longer exists
 		if ($do_email && etemplate::$loop)
 		{	// remove previous addEmail() calls, otherwise they will be run again
-			egw_framework::set_onload(preg_replace('/addEmail\([^)]+\);/','',egw_framework::set_onload()),true);
-		}
+			Framework::set_onload(preg_replace('/addEmail\([^)]+\);/','',Framework::set_onload()),true);
+		}*/
 
 		// Make sure old lettersearch filter doesn't stay - current letter filter will be added later
 		foreach($query['col_filter'] as $key => $col_filter)
@@ -1590,9 +1604,9 @@
 
 			// do we need to read the custom fields, depends on the column is enabled and customfields exist
 			// $query['csv_export'] allways needs to read ALL cf's
-			$columselection = $this->prefs['nextmatch-addressbook.'.($do_email ? 'email' : 'index').'.rows'];
-			$available_distib_lists=$this->get_lists(EGW_ACL_READ);
-			$columselection = $columselection && !$query['csv_export'] ? explode(',',$columselection) : array();
+			$columsel = $this->prefs['nextmatch-addressbook.'.($do_email ? 'email' : 'index').'.rows'];
+			$available_distib_lists=$this->get_lists(Acl::READ);
+			$columselection = $columsel && !$query['csv_export'] ? explode(',',$columsel) : array();
 			if (!$id_only && $rows)
 			{
 				$show_custom_fields = (!$columselection || in_array('customfields',$columselection) || $query['csv_export']) && $this->customfields;
@@ -1614,7 +1628,7 @@
 					}
 					if ($show_calendar && !empty($ids)) $calendar = $this->read_calendar($ids);
 					// distributionlist memership for the entrys
-					//_debug_array($this->get_lists(EGW_ACL_EDIT));
+					//_debug_array($this->get_lists(Acl::EDIT));
 					if ($show_distributionlist && $available_distib_lists)
 					{
 						$distributionlist = $this->read_distributionlist($ids,array_keys($available_distib_lists));
@@ -1664,7 +1678,7 @@
 				$row['type'] = 'home';
 				$row['type_label'] = lang('Organisation');
 
-				if ($query['filter'] && !($this->grants[(int)$query['filter']] & EGW_ACL_DELETE))
+				if ($query['filter'] && !($this->grants[(int)$query['filter']] & Acl::DELETE))
 				{
 					$row['class'] .= 'rowNoDelete ';
 				}
@@ -1676,7 +1690,7 @@
 				$this->type_icon($row['owner'],$row['private'],$row['tid'],$row['type'],$row['type_label']);
 
 				static $tel2show = array('tel_work','tel_cell','tel_home','tel_fax');
-				static $prefer_marker;
+				static $prefer_marker = null;
 				if (is_null($prefer_marker))
 				{
 					// as et2 adds options with .text(), it can't be entities, but php knows no string literals with utf-8
@@ -1695,11 +1709,11 @@
 				{
 					$row['class'] .= 'rowAccount rowNoDelete ';
 				}
-				elseif (!$this->check_perms(EGW_ACL_DELETE,$row) || (!$GLOBALS['egw_info']['user']['apps']['admin'] && $this->config['history'] != 'userpurge' && $query['col_filter']['tid'] == self::DELETED_TYPE))
+				elseif (!$this->check_perms(Acl::DELETE,$row) || (!$GLOBALS['egw_info']['user']['apps']['admin'] && $this->config['history'] != 'userpurge' && $query['col_filter']['tid'] == self::DELETED_TYPE))
 				{
 					$row['class'] .= 'rowNoDelete ';
 				}
-				if (!$this->check_perms(EGW_ACL_EDIT,$row))
+				if (!$this->check_perms(Acl::EDIT,$row))
 				{
 					$row['class'] .= 'rowNoEdit ';
 				}
@@ -1735,7 +1749,7 @@
 			// respect category permissions
 			if(!empty($row['cat_id']))
 			{
-				$row['cat_id'] = $this->categories->check_list(EGW_ACL_READ,$row['cat_id']);
+				$row['cat_id'] = $this->categories->check_list(Acl::READ,$row['cat_id']);
 			}
 		}
 		$rows['no_distribution_list'] = (bool)$query['filter2'];
@@ -1754,7 +1768,7 @@
 			$header[] = ($query['filter'] == '0' ? lang('accounts') :
 				($GLOBALS['egw']->accounts->get_type($query['filter']) == 'g' ?
 					lang('Group %1',$GLOBALS['egw']->accounts->id2name($query['filter'])) :
-					common::grab_owner_name((int)$query['filter']).
+					Api\Accounts::username((int)$query['filter']).
 						(substr($query['filter'],-1) == 'p' ? ' ('.lang('private').')' : '')));
 		}
 		if ($query['org_view'])
@@ -1792,7 +1806,7 @@
 	/**
 	 * Get addressbook type icon from owner, private and tid
 	 *
-	 * @param int $owner user- or group-id or 0 for accounts
+	 * @param int $owner user- or group-id or 0 for Api\Accounts
 	 * @param boolean $private
 	 * @param string $tid 'n' for regular addressbook
 	 * @param string &$icon icon-name
@@ -1818,12 +1832,12 @@
 		else
 		{
 			$icon = 'personal';
-			$label = $owner == $this->user ? lang('personal') : common::grab_owner_name($owner);
+			$label = $owner == $this->user ? lang('personal') : Api\Accounts::username($owner);
 		}
 		// show tid icon for tid!='n' AND only if one is defined
-		if ($tid != 'n' && common::image('addressbook',$this->content_types[$tid]['name']))
-		{
-			$icon = common::image('addressbook',$this->content_types[$tid]['name']);
+		if ($tid != 'n' && Api\Image::find('addressbook',$this->content_types[$tid]['name']))
+		{
+			$icon = Api\Image::find('addressbook',$this->content_types[$tid]['name']);
 		}
 
 		// Legacy - from when icons could be anywhere
@@ -1931,7 +1945,7 @@
 									$content['msg'] .= ', '.$success_msg;
 								}
 							}
-							catch(egw_exception_redirect $r)
+							catch(Api\Exception\Redirect $r)
 							{
 								// catch it to continue execution and rethrow it later
 							}
@@ -1962,7 +1976,7 @@
 					{
 						$content['msg'] = lang('Error: the entry has been updated since you opened it for editing!').'<br />'.
 							lang('Copy your changes to the clipboard, %1reload the entry%2 and merge them.','<a href="'.
-								htmlspecialchars(egw::link('/index.php',array(
+								htmlspecialchars(Egw::link('/index.php',array(
 									'menuaction' => 'addressbook.addressbook_ui.edit',
 									'contact_id' => $content['id'],
 								))).'">','</a>');
@@ -1977,12 +1991,12 @@
 					// writing links for new entry, existing ones are handled by the widget itself
 					if ($links && $content['id'])
 					{
-						egw_link::link('addressbook',$content['id'],$links);
+						Link::link('addressbook',$content['id'],$links);
 					}
 					// Update client side global datastore
-					$response = egw_json_response::get();
+					$response = Api\Json\Response::get();
 					$response->generic('data', array('uid' => 'addressbook::'.$content['id'], 'data' => $content));
-					egw_framework::refresh_opener($content['msg'], 'addressbook', $content['id'],  $content['id'] ? 'edit' : 'add',
+					Framework::refresh_opener($content['msg'], 'addressbook', $content['id'],  $content['id'] ? 'edit' : 'add',
 						null, null, null, $this->error ? 'error' : 'success');
 
 					// re-throw redirect exception, if there's no error
@@ -1992,28 +2006,29 @@
 					}
 					if ($button == 'save')
 					{
-						egw_framework::window_close();
+						Framework::window_close();
 					}
 					else
 					{
-						egw_framework::message($content['msg'], $this->error ? 'error' : 'success');
+						Framework::message($content['msg'], $this->error ? 'error' : 'success');
 						unset($content['msg']);
 					}
 					$content['link_to']['to_id'] = $content['id'];
 					break;
 
 				case 'delete':
+					$success = $failed = $action_msg = null;
 					if($this->action('delete',array($content['id']),false,$success,$failed,$action_msg,'',$content['msg']))
 					{
 						if ($GLOBALS['egw']->currentapp == 'addressbook')
 						{
-							egw_framework::refresh_opener(lang('Contact deleted'), 'addressbook', $content['id'], 'delete' );
-							egw_framework::window_close();
+							Framework::refresh_opener(lang('Contact deleted'), 'addressbook', $content['id'], 'delete' );
+							Framework::window_close();
 						}
 						else
 						{
-							egw_framework::refresh_opener(lang('Contact deleted'), 'addressbook', $content['id'], null, 'addressbook');
-							egw_framework::window_close();
+							Framework::refresh_opener(lang('Contact deleted'), 'addressbook', $content['id'], null, 'addressbook');
+							Framework::window_close();
 						}
 					}
 					else
@@ -2022,7 +2037,7 @@
 					}
 					break;
 			}
-			$view = !$this->check_perms(EGW_ACL_EDIT, $content);
+			$view = !$this->check_perms(Acl::EDIT, $content);
 		}
 		else
 		{
@@ -2033,19 +2048,19 @@
 			if ($contact_id && is_array($content = $this->read($contact_id)))
 			{
 				$contact_id = $content['id'];	// it could have been: "account:$account_id"
-				if (!$this->check_perms(EGW_ACL_EDIT, $content))
+				if (!$this->check_perms(Acl::EDIT, $content))
 				{
 					$view = true;
 				}
 			}
 			else // not found
 			{
-				$state = egw_session::appsession('index','addressbook');
+				$state = Api\Cache::getSession('addressbook', 'index');
 				// check if we create the new contact in an existing org
 				if (($org = $_GET['org']))
 				{
 					// arguments containing a comma get quoted by etemplate/js/nextmatch_action.js
-					// leading to error in egw_db::column_data_implode, if not unquoted
+					// leading to error in Api\Db::column_data_implode, if not unquoted
 					if ($org[0] == '"') $org = substr($org, 1, -1);
 					$content = $this->read_org($org);
 				}
@@ -2077,12 +2092,12 @@
 					$content['owner'] = (string)$state['filter'];
 				}
 				$content['private'] = (int) ($content['owner'] && substr($content['owner'],-1) == 'p');
-				if ($content['owner'] === '' || !($this->grants[$content['owner'] = (string) (int) $content['owner']] & EGW_ACL_ADD))
+				if ($content['owner'] === '' || !($this->grants[$content['owner'] = (string) (int) $content['owner']] & Acl::ADD))
 				{
 					$content['owner'] = $this->default_addressbook;
 					$content['private'] = (int)$this->default_private;
 
-					if (!($this->grants[$content['owner'] = (string) (int) $content['owner']] & EGW_ACL_ADD))
+					if (!($this->grants[$content['owner'] = (string) (int) $content['owner']] & Acl::ADD))
 					{
 						$content['owner'] = (string) $this->user;
 						$content['private'] = 0;
@@ -2090,7 +2105,7 @@
 				}
 				$new_type = array_keys($this->content_types);
 				// fetch active type to preset the type, if param typeid is not passed
-				$active_tid = egw_cache::getSession('addressbook','active_tid');
+				$active_tid = Api\Cache::getSession('addressbook','active_tid');
 				if ($active_tid && strtoupper($active_tid) === 'D') unset($active_tid);
 				$content['tid'] = $_GET['typeid'] ? $_GET['typeid'] : ($active_tid?$active_tid:$new_type[0]);
 				foreach($this->get_contact_columns() as $field)
@@ -2178,7 +2193,7 @@
 					$link_id = $link_ids[$n];
 					if (preg_match('/^[a-z_0-9-]+:[:a-z_0-9-]+$/i',$link_app.':'.$link_id))	// gard against XSS
 					{
-						egw_link::link('addressbook',$content['link_to']['to_id'],$link_app,$link_id);
+						Link::link('addressbook',$content['link_to']['to_id'],$link_app,$link_id);
 					}
 				}
 			}
@@ -2196,7 +2211,7 @@
 		if ($this->config['private_cf_tab'])
 		{
 			$content['private_cfs'] = array();
-			foreach(config::get_customfields('addressbook', true) as $name => $cf)
+			foreach(Api\Storage\Customfields::get('addressbook', true) as $name => $cf)
 			{
 				if ($cf['private'] && isset($content['#'.$name]))
 				{
@@ -2209,7 +2224,7 @@
 		$content['addr_format2'] = $this->addr_format_by_country($content['adr_two_countryname']);
 
 		//_debug_array($content);
-		$readonlys['button[delete]'] = !$content['owner'] || !$this->check_perms(EGW_ACL_DELETE,$content);
+		$readonlys['button[delete]'] = !$content['owner'] || !$this->check_perms(Acl::DELETE,$content);
 		$readonlys['button[copy]'] = $readonlys['button[edit]'] = $readonlys['button[vcard]'] = true;
 		$readonlys['button[save]'] = $readonlys['button[apply]'] = $view;
 		if ($view)
@@ -2220,17 +2235,17 @@
 
 		$sel_options['fileas_type'] = $this->fileas_options($content);
 		$sel_options['adr_one_countrycode']['-custom-'] = lang('Custom');
-		$sel_options['owner'] = $this->get_addressbooks(EGW_ACL_ADD);
+		$sel_options['owner'] = $this->get_addressbooks(Acl::ADD);
 		if ($content['owner']) unset($sel_options['owner'][0]);	// do not offer to switch to accounts, as we do not support moving contacts to accounts
 		if ((string) $content['owner'] !== '')
 		{
 			if (!isset($sel_options['owner'][(int)$content['owner']]))
 			{
 				$sel_options['owner'][(int)$content['owner']] = !$content['owner'] ? lang('Accounts') :
-					common::grab_owner_name($content['owner']);
+					Api\Accounts::username($content['owner']);
 			}
 			$readonlys['owner'] = !$content['owner'] || 		// dont allow to move accounts, as this mean deleting the user incl. all content he owns
-				$content['id'] && !$this->check_perms(EGW_ACL_DELETE,$content);	// you need delete rights to move an existing contact into an other addressbook
+				$content['id'] && !$this->check_perms(Acl::DELETE,$content);	// you need delete rights to move an existing contact into an other addressbook
 		}
 		// set the unsupported fields from the backend to readonly
 		foreach($this->get_fields('unsupported',$content['id'],$content['owner']) as $field)
@@ -2261,11 +2276,14 @@
 		$readonlys['change_org'] = empty($content['org_name']) || $view;
 
 		// for editing the own account (by a non-admin), enable only the fields allowed via the "own_account_acl"
-		if (!$content['owner'] && !$this->check_perms(EGW_ACL_EDIT, $content))
-		{
-			$this->_set_readonlys_for_own_account_acl($readonlys,$id);
-		}
-		for($i = -23; $i<=23; $i++) $tz[$i] = ($i > 0 ? '+' : '').$i;
+		if (!$content['owner'] && !$this->check_perms(Acl::EDIT, $content))
+		{
+			$this->_set_readonlys_for_own_account_acl($readonlys, $content['id']);
+		}
+		for($i = -23; $i<=23; $i++)
+		{
+			$tz[$i] = ($i > 0 ? '+' : '').$i;
+		}
 		$sel_options['tz'] = $tz;
 		$content['tz'] = $content['tz'] ? $content['tz'] : '0';
 		if (count($this->content_types) > 1)
@@ -2274,7 +2292,7 @@
 			{
 				$sel_options['tid'][$type] = $data['name'];
 			}
-			$content['typegfx'] = html::image('addressbook',$this->content_types[$content['tid']]['options']['icon'],'',' width="16px" height="16px"');
+			$content['typegfx'] = Api\Html::image('addressbook',$this->content_types[$content['tid']]['options']['icon'],'',' width="16px" height="16px"');
 		}
 		else
 		{
@@ -2320,7 +2338,7 @@
 			$tabs = array();
 		}
 		//error_log(__LINE__.': '.__METHOD__."() first_call=$first_call");
-		$hook_data = $GLOBALS['egw']->hooks->process(array('location' => 'addressbook_edit')+$content);
+		$hook_data = Api\Hooks::process(array('location' => 'addressbook_edit')+$content);
 		//error_log(__METHOD__."() hook_data=".array2string($hook_data));
 		foreach($hook_data as $extra_tabs)
 		{
@@ -2395,7 +2413,7 @@
 		// custom fields
 		if ($this->customfields)
 		{
-			foreach($this->customfields as $name => $data)
+			foreach(array_keys($this->customfields) as $name)
 			{
 				if (!$this->own_account_acl || !in_array('#'.$name,$this->own_account_acl))
 				{
@@ -2417,13 +2435,14 @@
 	 *
 	 * @param array $values contact values from form
 	 * @param string $name name of changed value, eg. "email"
-	 * @param int $own_id=0 own contact id, to not check against it
+	 * @param int $own_id =0 own contact id, to not check against it
 	 * @return array with keys 'msg' => "EMail address exists, do you want to open contact?" (or null if not existing)
 	 * 	'data' => array of id => "full name (addressbook)" pairs
 	 *  'fileas_options'
 	 */
 	public function ajax_check_values($values, $name, $own_id=0)
 	{
+		$matches = null;
 		if (preg_match('/^exec\[([^\]]+)\]$/', $name, $matches)) $name = $matches[1];	// remove exec[ ]
 
 		$ret = array('doublicates' => array(), 'msg' => null);
@@ -2436,7 +2455,7 @@
 				$contacts = parent::search(array(
 					'email' => $values[$name],
 					'email_home' => $values[$name],
-				),$only_keys=false, $order_by='', $extra_cols='', $wildcard='', $empty=False, $op='OR');
+				), false, '', '', '', false, 'OR');
 			}
 		}
 		else
@@ -2455,8 +2474,7 @@
 				{
 					if (!empty($values[$n])) $filter[$n] = $values[$n];
 				}
-				$contacts = parent::search($criteria='', $only_keys=false, $order_by='', $extra_cols='', $wildcard='',
-					$empty=False, $op='AND', $start=false, $filter);
+				$contacts = parent::search('', false, '', '', '', false, 'AND', false, $filter);
 			}
 		}
 		if ($contacts)
@@ -2467,7 +2485,7 @@
 
 				$ret['doublicates'][$contact['id']] = $this->fileas($contact).' ('.
 					(!$contact['owner'] ? lang('Accounts') : ($contact['owner'] == $this->user ?
-					($contact['private'] ? lang('Private') : lang('Personal')) : common::grab_owner_name($contact['owner']))).')';
+					($contact['private'] ? lang('Private') : lang('Personal')) : Api\Accounts::username($contact['owner']))).')';
 			}
 			if ($ret['doublicates'])
 			{
@@ -2477,7 +2495,7 @@
 			}
 		}
 		//error_log(__METHOD__.'('.array2string($values).", '$name', $own_id) doublicates found ".array2string($ret['doublicates']));
-		egw_json_response::get()->data($ret);
+		Api\Json\Response::get()->data($ret);
 	}
 
 	/**
@@ -2498,13 +2516,13 @@
 			switch ($content['toolbar'] ? $content['toolbar'] : $button)
 			{
 				case 'vcard':
-					egw::redirect_link('/index.php','menuaction=addressbook.uivcard.out&ab_id=' .$content['id']);
+					Egw::redirect_link('/index.php','menuaction=addressbook.uivcard.out&ab_id=' .$content['id']);
 
 				case 'cancel':
-					egw::redirect_link('/index.php','menuaction=addressbook.addressbook_ui.index&ajax=true');
+					Egw::redirect_link('/index.php','menuaction=addressbook.addressbook_ui.index&ajax=true');
 
 				case 'delete':
-					egw::redirect_link('/index.php',array(
+					Egw::redirect_link('/index.php',array(
 						'menuaction' => 'addressbook.addressbook_ui.index',
 						'msg' => $this->delete($content) ? lang('Contact deleted') : lang('Error deleting the contact !!!'),
 					));
@@ -2515,7 +2533,7 @@
 				case 'back':
 					if (!isset($inc)) $inc = -1;
 					// get next/previous contact in selection
-					$query = egw_session::appsession('index', 'addressbook');
+					$query = Api\Cache::getSession('addressbook', 'index');
 					$query['start'] = $content['index'] + $inc;
 					$query['num_rows'] = 1;
 					$rows = $readonlys = array();
@@ -2524,7 +2542,7 @@
 					$contact_id = $rows[0];
 					if(!$contact_id || !is_array($content = $this->read($contact_id)))
 					{
-						egw::redirect_link('/index.php',array(
+						Egw::redirect_link('/index.php',array(
 							'menuaction' => 'addressbook.addressbook_ui.index',
 							'msg' => $content,
 							'ajax' => 'true'
@@ -2533,14 +2551,14 @@
 					$content['index'] = $query['start'];
 
 					// List nextmatch is already there, just update the filter
-					if($contact_id && egw_json_request::isJSONRequest())
+					if($contact_id && Api\Json\Request::isJSONRequest())
 					{
 						switch($crm_list)
 						{
 							case 'infolog':
 							case 'tracker':
 							default:
-								egw_json_response::get()->apply('app.addressbook.view_set_list',Array(Array('action'=>'addressbook', 'action_id' => $contact_id)));
+								Api\Json\Response::get()->apply('app.addressbook.view_set_list',Array(Array('action'=>'addressbook', 'action_id' => $contact_id)));
 								break;
 						}
 
@@ -2555,14 +2573,14 @@
 			// allow to search eg. for a phone number
 			if (isset($_GET['search']))
 			{
-				$query = egw_session::appsession('index', 'addressbook');
+				$query = Api\Cache::getSession('addressbook', 'index');
 				$query['search'] = $_GET['search'];
 				unset($_GET['search']);
 				// reset all filters
 				unset($query['advanced_search']);
 				$query['col_filter'] = array();
 				$query['filter'] = $query['filter2'] = $query['cat_id'] = '';
-				egw_session::appsession('index', 'addressbook', $query);
+				Api\Cache::setSession('addressbook', 'index', $query);
 				$query['start'] = 0;
 				$query['num_rows'] = 1;
 				$rows = $readonlys = array();
@@ -2573,7 +2591,7 @@
 			$contact_id = $_GET['contact_id'] ? $_GET['contact_id'] : ((int)$_GET['account_id'] ? 'account:'.(int)$_GET['account_id'] : 0);
 			if(!$contact_id || !is_array($content = $this->read($contact_id)))
 			{
-				egw::redirect_link('/index.php',array(
+				Egw::redirect_link('/index.php',array(
 					'menuaction' => 'addressbook.addressbook_ui.index',
 					'msg' => $content,
 					'ajax' => 'true'
@@ -2583,7 +2601,7 @@
 			{
 				$content['index'] = (int)$_GET['index'];
 				// get number of rows to determine if we can have a next button
-				$query = egw_session::appsession('index', 'addressbook');
+				$query = Api\Cache::getSession('addressbook', 'index');
 				$query['start'] = $content['index'];
 				$query['num_rows'] = 1;
 				$rows = $readonlys = array();
@@ -2608,7 +2626,7 @@
 		// respect category permissions
 		if(!empty($content['cat_id']))
 		{
-			$content['cat_id'] = $this->categories->check_list(EGW_ACL_READ,$content['cat_id']);
+			$content['cat_id'] = $this->categories->check_list(Acl::READ,$content['cat_id']);
 		}
 		$content['cat_id_tree'] = $content['cat_id'];
 
@@ -2622,8 +2640,8 @@
 		{
 			$content['link_to']['show_deleted'] = true;
 		}
-		$readonlys['button[delete]'] = !$content['owner'] || !$this->check_perms(EGW_ACL_DELETE,$content);
-		$readonlys['button[edit]'] = !$this->check_perms(EGW_ACL_EDIT,$content);
+		$readonlys['button[delete]'] = !$content['owner'] || !$this->check_perms(Acl::DELETE,$content);
+		$readonlys['button[edit]'] = !$this->check_perms(Acl::EDIT,$content);
 
 		// how to display addresses
 		$content['addr_format']  = $this->addr_format_by_country($content['adr_one_countryname']);
@@ -2631,7 +2649,10 @@
 
 		$sel_options['fileas_type'][$content['fileas_type']] = $this->fileas($content);
 		$sel_options['owner'] = $this->get_addressbooks();
-		for($i = -23; $i<=23; $i++) $tz[$i] = ($i > 0 ? '+' : '').$i;
+		for($i = -23; $i<=23; $i++)
+		{
+			$tz[$i] = ($i > 0 ? '+' : '').$i;
+		}
 		$sel_options['tz'] = $tz;
 		$content['tz'] = $content['tz'] ? $content['tz'] : 0;
 		if (count($this->content_types) > 1)
@@ -2640,7 +2661,7 @@
 			{
 				$sel_options['tid'][$type] = $data['name'];
 			}
-			$content['typegfx'] = html::image('addressbook',$this->content_types[$content['tid']]['options']['icon'],'',' width="16px" height="16px"');
+			$content['typegfx'] = Api\Html::image('addressbook',$this->content_types[$content['tid']]['options']['icon'],'',' width="16px" height="16px"');
 		}
 		else
 		{
@@ -2687,7 +2708,7 @@
 		$GLOBALS['egw_info']['flags']['currentid'] = $content['id'];
 
 		// load app.css for addressbook explicit, as addressbook_view hooks changes currentapp!
-		egw_framework::includeCSS('addressbook', 'app');
+		Framework::includeCSS('addressbook', 'app');
 
 		// dont show an app-header
 		$GLOBALS['egw_info']['flags']['app_header'] = '';
@@ -2729,7 +2750,7 @@
 		unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']);
 
 		// need to load list's app.js now, as exec calls header before other app can include it
-		egw_framework::validate_file('/'.$crm_list.'/js/app.js');
+		Framework::includeJS('/'.$crm_list.'/js/app.js');
 
 		$this->tmpl->exec('addressbook.addressbook_ui.view',$content,$sel_options,$readonlys,array(
 			'id' => $content['id'],
@@ -2741,7 +2762,7 @@
 		// Sending it again (via ajax) will break the addressbook.view etemplate2
 		if($contact_id)
 		{
-			$GLOBALS['egw']->hooks->single(array(
+			Api\Hooks::single(array(
 				'location' => 'addressbook_view',
 				'ab_id'    => $content['id']
 			),$crm_list);
@@ -2795,9 +2816,9 @@
 
 			$_content['cat_id'] = $this->config['cat_tab'] === 'Tree' ? $_content['cat_id_tree'] : $_content['cat_id'];
 
-			$response = egw_json_response::get();
-
-			$query = egw_session::appsession('index','addressbook');
+			$response = Api\Json\Response::get();
+
+			$query = Api\Cache::getSession('addressbook', 'index');
 
 			if ($_content['button']['cancelsearch'])
 			{
@@ -2815,16 +2836,16 @@
 			}
 			$query['search'] = '';
 			// store the index state in the session
-			egw_session::appsession('index','addressbook',$query);
+			Api\Cache::setSession('addressbook', 'index', $query);
 
 			// store the advanced search in the session to call it again
-			egw_session::appsession('advanced_search','addressbook',$query['advanced_search']);
+			Api\Cache::setSession('addressbook', 'advanced_search', $query['advanced_search']);
 
 			// Update client / nextmatch with filters, or clear
 			$response->call("app.addressbook.adv_search", array('advanced_search' => $_content['button']['search'] ? $query['advanced_search'] : ''));
 			if ($_content['button']['cancelsearch'])
 			{
-				egw_framework::window_close (); //$response->addScript('this.close();');
+				Framework::window_close ();
 
 				// No need to reload popup
 				return;
@@ -2835,18 +2856,21 @@
 
 		// initialize etemplate arrays
 		$sel_options = $readonlys = array();
-		$content = egw_session::appsession('advanced_search','addressbook');
+		$content = Api\Cache::getSession('addressbook', 'advanced_search');
 		$content['n_fn'] = $this->fullname($content);
 		// Avoid ID conflict with tree & selectboxes
 		$content['cat_id_tree'] = $content['cat_id'];
 
-		for($i = -23; $i<=23; $i++) $tz[$i] = ($i > 0 ? '+' : '').$i;
+		for($i = -23; $i<=23; $i++)
+		{
+			$tz[$i] = ($i > 0 ? '+' : '').$i;
+		}
 		$sel_options['tz'] = $tz + array('' => lang('doesn\'t matter'));
 		$sel_options['tid'][] = lang('all');
 		//foreach($this->content_types as $type => $data) $sel_options['tid'][$type] = $data['name'];
 
 		// configure search options
-		$sel_options['owner'] = $this->get_addressbooks(EGW_ACL_READ,lang('all'));
+		$sel_options['owner'] = $this->get_addressbooks(Acl::READ,lang('all'));
 		$sel_options['operator'] =  array(
 			'AND' => 'AND',
 			'OR' => 'OR',
@@ -2906,7 +2930,7 @@
 		}
 		if (!($contact = $this->read($contact_id)) || !$contact['jpegphoto'])
 		{
-			egw::redirect(common::image('addressbook','photo'));
+			Egw::redirect(Api\Image::find('addressbook','photo'));
 		}
 		// use an etag over the image mapp
 		$etag = '"'.$contact['id'].':'.$contact['etag'].'"';
@@ -2918,7 +2942,7 @@
 			// different url with different etag parameter will force a reload
 			if (isset($_GET['etag']))
 			{
-				egw_session::cache_control(30*86400);	// cache for 30 days
+				Api\Session::cache_control(30*86400);	// cache for 30 days
 			}
 			// if servers send a If-None-Match header, response with 304 Not Modified, if etag matches
 			if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] === $etag)
@@ -2930,7 +2954,7 @@
 				header('Content-length: '.bytes($contact['jpegphoto']));
 				echo $contact['jpegphoto'];
 			}
-			common::egw_exit();
+			exit();
 		}
 	}
 
@@ -2941,7 +2965,7 @@
 	function migrate2ldap()
 	{
 		$GLOBALS['egw_info']['flags']['app_header'] = lang('Addressbook').' - '.lang('Migration to LDAP');
-		common::egw_header();
+		$GLOBALS['egw']->framework->header();
 		parse_navbar();
 
 		if (!$this->is_admin())
@@ -2953,7 +2977,7 @@
 			parent::migrate2ldap($_GET['type']);
 			echo '<p style="margin-top: 20px;"><b>'.lang('Migration finished')."</b></p>\n";
 		}
-		common::egw_footer();
+		$GLOBALS['egw']->framework->footer();
 	}
 
 	/**
@@ -2964,9 +2988,9 @@
 	 */
 	function admin_set_fileas()
 	{
-		translation::add_app('admin');
+		Api\Translation::add_app('admin');
 		$GLOBALS['egw_info']['flags']['app_header'] = lang('Addressbook').' - '.lang('Contact maintenance');
-		common::egw_header();
+		$GLOBALS['egw']->framework->header();
 		parse_navbar();
 
 		// check if user has admin rights AND if a valid fileas type is given (Security)
@@ -2976,10 +3000,11 @@
 		}
 		else
 		{
-			$updated = parent::set_all_fileas($_GET['type'],(boolean)$_GET['all'],$errors,true);	// true = ignore acl
+			$errors = null;
+			$updated = parent::set_all_fileas($_GET['type'],(boolean)$_GET['all'],$errors,true);	// true = ignore Acl
 			echo '<p style="margin-top: 20px;"><b>'.lang('%1 contacts updated (%2 errors).',$updated,$errors)."</b></p>\n";
 		}
-		common::egw_footer();
+		$GLOBALS['egw']->framework->footer();
 	}
 
 	/**
@@ -2988,9 +3013,9 @@
 	 */
 	function admin_set_all_cleanup()
 	{
-		translation::add_app('admin');
+		Api\Translation::add_app('admin');
 		$GLOBALS['egw_info']['flags']['app_header'] = lang('Addressbook').' - '.lang('Contact maintenance');
-		common::egw_header();
+		$GLOBALS['egw']->framework->header();
 		parse_navbar();
 
 		// check if user has admin rights (Security)
@@ -3000,10 +3025,11 @@
 		}
 		else
 		{
-			$updated = parent::set_all_cleanup($errors,true);	// true = ignore acl
+			$errors = null;
+			$updated = parent::set_all_cleanup($errors,true);	// true = ignore Acl
 			echo '<p style="margin-top: 20px;"><b>'.lang('%1 contacts updated (%2 errors).',$updated,$errors)."</b></p>\n";
 		}
-		common::egw_footer();
+		$GLOBALS['egw']->framework->footer();
 	}
 
 	/**

Modified: trunk/addressbook/inc/class.addressbook_vcal.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_vcal.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_vcal.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_vcal.inc.php Fri Apr 29 12:41:53 2016
@@ -13,11 +13,12 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Link;
 
 /**
  * Addressbook - vCard parser
  */
-class addressbook_vcal extends addressbook_bo
+class addressbook_vcal extends Api\Contacts
 {
 	/**
 	 * product manufacturer from setSupportedFields (lowercase!)
@@ -32,11 +33,11 @@
 	 */
 	var $productName;
 	/**
-	 * supported fields for vCard file and groupdav import/export
+	 * supported fields for vCard file and CardDAV import/export
 	 *
 	 * @var array
 	 */
-	var $databaseFields = array( // all entries e.g. for groupdav
+	var $databaseFields = array( // all entries e.g. for CardDAV
 			'ADR;WORK'			=> array('','adr_one_street2','adr_one_street','adr_one_locality','adr_one_region',
 									'adr_one_postalcode','adr_one_countryname'),
 			'ADR;HOME'			=> array('','adr_two_street2','adr_two_street','adr_two_locality','adr_two_region',
@@ -205,7 +206,7 @@
 		$vCard->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware Addressbook '.$GLOBALS['egw_info']['apps']['phpgwapi']['version'].'//'.
 			strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang']));
 
-		$sysCharSet = translation::charset();
+		$sysCharSet = Api\Translation::charset();
 
 		// KAddressbook and Funambol4BlackBerry always requires non-ascii chars to be qprint encoded.
 		if ($this->productName == 'kde' ||
@@ -280,7 +281,7 @@
 				switch ($databaseField)
 				{
 					case 'modified':
-						$value = gmdate("Y-m-d\TH:i:s\Z",egw_time::user2server($value));
+						$value = gmdate("Y-m-d\TH:i:s\Z",Api\DateTime::user2server($value));
 						$hasdata++;
 						break;
 
@@ -332,7 +333,7 @@
 					case 'cat_id':
 						if (!empty($value) && ($values = /*str_replace(',','\\,',*/$this->get_categories($value)))//)
 						{
-							$values = (array) translation::convert($values, $sysCharSet, $_charset);
+							$values = (array) Api\Translation::convert($values, $sysCharSet, $_charset);
 							$value = implode(',', $values); // just for the CHARSET recognition
 							if (($size > 0) && strlen($value) > $size)
 							{
@@ -428,7 +429,7 @@
 							|| in_array($vcardField,array('FN','ORG','N'))
 							|| ($size >= 0 && !$noTruncate))
 						{
-							$value = translation::convert(trim($value), $sysCharSet, $_charset);
+							$value = Api\Translation::convert(trim($value), $sysCharSet, $_charset);
 							$values[] = $value;
 							if (preg_match('/[^\x20-\x7F]/', $value))
 							{
@@ -1030,8 +1031,8 @@
 	{
 		if (!$file)
 		{
-			$filename = count($ids) == 1 ? egw_link::title('addressbook',$ids[0]): 'egw_addressbook_'.date('Y-m-d');
-			html::content_header(($filename ? $filename : 'addressbook').'.vcf','text/x-vcard');
+			$filename = count($ids) == 1 ? Link::title('addressbook',$ids[0]): 'egw_addressbook_'.date('Y-m-d');
+			Api\Header\Content::type(($filename ? $filename : 'addressbook').'.vcf','text/x-vcard');
 		}
 		if (!($fp = fopen($file ? $file : 'php://output','w')))
 		{
@@ -1053,7 +1054,7 @@
 
 		if (!$file)
 		{
-			common::egw_exit();
+			exit();
 		}
 		return true;
 	}
@@ -1079,7 +1080,7 @@
 		{
 			$vCard->setAttribute('X-ADDRESSBOOKSERVER-MEMBER','urn:uuid:'.$uid);
 		}
-		$vCard->setAttribute('REV',egw_time::to($list['list_modified'],'Y-m-d\TH:i:s\Z'));
+		$vCard->setAttribute('REV',Api\DateTime::to($list['list_modified'],'Y-m-d\TH:i:s\Z'));
 		$vCard->setAttribute('UID',$list['list_uid']);
 
 		return $vCard->exportvCalendar();

Modified: trunk/addressbook/inc/class.addressbook_wizard_export_contacts_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_wizard_export_contacts_csv.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_wizard_export_contacts_csv.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_wizard_export_contacts_csv.inc.php Fri Apr 29 12:41:53 2016
@@ -1,13 +1,15 @@
 <?php
 /**
- * eGroupWare - Wizard for Adressbook CSV export
+ * EGroupware - Wizard for Adressbook CSV export
  *
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @package addressbook
  * @link http://www.egroupware.org
  * @author Nathan Gray
- * @version $Id:  $
+ * @version $Id$
  */
+
+use EGroupware\Api;
 
 class addressbook_wizard_export_contacts_csv extends importexport_wizard_basic_export_csv
 {
@@ -18,7 +20,7 @@
 		$this->step_templates['wizard_step50'] = 'addressbook.export_explode_fields';
 
 		// Field mapping
-		$bocontacts = new addressbook_bo();
+		$bocontacts = new Api\Contacts();
 		$this->export_fields = $bocontacts->contact_fields;
 		foreach($bocontacts->customfields as $name => $data) {
 			$this->export_fields['#'.$name] = $data['label'];
@@ -51,7 +53,7 @@
 	}
 
         /**
-        * Choose how to export multi-selects (includes categories)
+        * Choose how to export multi-selects (includes Api\Categories)
         */
         function wizard_step50(&$content, &$sel_options, &$readonlys, &$preserv)
 	{
@@ -87,7 +89,7 @@
 			$content['step'] = 'wizard_step50';
 			unset ($preserv['button']);
 			$field_list = $this->get_field_list($content);
-			
+
 			$settings = $content['explode_multiselects'] ? $content['explode_multiselects'] : $content['plugin_options']['explode_multiselects'];
 
 			// Skip this step if no fields applicable
@@ -97,7 +99,7 @@
 
 			$cat_options = array(
 				addressbook_export_contacts_csv::NO_EXPLODE => lang('All in one field'),
-				addressbook_export_contacts_csv::MAIN_CATS => lang('Main categories in their own field'),
+				addressbook_export_contacts_csv::MAIN_CATS => lang('Main Api\Categories in their own field'),
 				addressbook_export_contacts_csv::EACH_CAT => lang('Each category in its own field'),
 			);
 			$multi_options = array(
@@ -132,16 +134,16 @@
 	*/
 	protected function get_field_list($content) {
 		$field_list = array();
-		
+
 		// Category gets special handling
 		if(in_array('cat_id', array_keys($content['mapping']))) {
 			$field_list['cat_id'] = $this->export_fields['cat_id'];
 		}
 
 		// Add any multi-select custom fields
-		$custom = config::get_customfields('addressbook');
+		$custom = Api\Storage\Customfields::get('addressbook');
 		foreach($custom as $name => $c_field) {
-			if($c_field['type'] = 'select' && $c_field['rows'] > 1 && in_array('#'.$name, array_keys($content['mapping']))) {
+			if($c_field['type'] == 'select' && $c_field['rows'] > 1 && in_array('#'.$name, array_keys($content['mapping']))) {
 				$field_list['#'.$name] = $c_field['label'];
 			}
 		}

Propchange: trunk/addressbook/inc/class.addressbook_wizard_export_contacts_csv.inc.php
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: trunk/addressbook/inc/class.addressbook_wizard_export_vcard.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_wizard_export_vcard.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_wizard_export_vcard.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_wizard_export_vcard.inc.php Fri Apr 29 12:41:53 2016
@@ -8,6 +8,8 @@
  * @link http://www.egroupware.org
  * @author Nathan Gray
  */
+
+use EGroupware\Api;
 
 /**
  * We need to allow choosing of charset, so we'll just use the standard one from CSV
@@ -22,7 +24,6 @@
 		$this->step_templates = array(
 			'wizard_step40' => 'addressbook.importexport_wizard_vcard_charset'
 		);
-
 	}
 
 	/**
@@ -59,14 +60,14 @@
 			if(!$content['charset'] && $content['plugin_options']['charset']) {
                                 $content['charset'] = $content['plugin_options']['charset'] ? $content['plugin_options']['charset'] : 'user';
                         }
-			$sel_options['charset'] = $GLOBALS['egw']->translation->get_installed_charsets()+
+			$sel_options['charset'] = Api\Translation::get_installed_charsets()+
                         array(
                                 'user'  => lang('User preference'),
                         );
 			$preserv = $content;
 
                         // Add in extra allowed charsets
-                        $config = config::read('importexport');
+                        $config = Api\Config::read('importexport');
                         $extra_charsets = array_intersect(explode(',',$config['import_charsets']), mb_list_encodings());
                         if($extra_charsets)
                         {

Modified: trunk/addressbook/inc/class.addressbook_wizard_import_contacts_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_wizard_import_contacts_csv.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_wizard_import_contacts_csv.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_wizard_import_contacts_csv.inc.php Fri Apr 29 12:41:53 2016
@@ -8,6 +8,9 @@
  * @author Cornelius Weiss <nelius-2ty0w3T/[email protected]>
  * @version $Id:  $
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Acl;
 
 class addressbook_wizard_import_contacts_csv extends importexport_wizard_basic_import_csv
 {
@@ -25,16 +28,16 @@
 		);
 
 		// Field mapping
-		$bocontacts = new addressbook_bo();
+		$bocontacts = new Api\Contacts();
 		$this->mapping_fields = $bocontacts->contact_fields;
 
-		$categories = new categories('','addressbook');
+		$categories = new Api\Categories('','addressbook');
 		$cat_list = array();
 		foreach((array)$categories->return_sorted_array(0,False,'','','',true,0,true) as $cat)
 		{
 			$s = str_repeat('&nbsp;',$cat['level']) . stripslashes($cat['name']);
 
-			if (categories::is_global($cat))
+			if (Api\Categories::is_global($cat))
 			{
 				$s .= ' &#9830;';
 			}
@@ -51,7 +54,7 @@
 			$this->mapping_fields['#'.$name] = $data['label'];
 		}
 		unset($this->mapping_fields['jpegphoto']);        // can't cvs import that
-		
+
 		// Add in special handled fields
 		$this->mapping_fields[lang('Special')] = addressbook_import_contacts_csv::$special_fields;
 
@@ -77,10 +80,10 @@
 		}
 		$result = parent::wizard_step50($content, $sel_options, $readonlys, $preserv);
 		$content['msg'] .= "\n*" . lang('Contact ID cannot be changed by import');
-		
+
 		return $result;
 	}
-	
+
 	function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv)
 	{
 		if($this->debug) error_log('addressbook.importexport.addressbook_csv_import::wizard_step60->$content '.print_r($content,true));
@@ -115,8 +118,8 @@
 				$content['change_owner'] = $content['plugin_options']['change_owner'];
 			}
 
-			$bocontacts = new addressbook_bo();
-			$sel_options['contact_owner'] = array('personal' => lang("Importer's personal")) + $bocontacts->get_addressbooks(EGW_ACL_ADD);
+			$bocontacts = new Api\Contacts();
+			$sel_options['contact_owner'] = array('personal' => lang("Importer's personal")) + $bocontacts->get_addressbooks(Acl::ADD);
 			if(!in_array('owner', $content['field_mapping'])) {
 				$content['no_owner_map'] = true;
 			}
@@ -125,6 +128,5 @@
 			unset ($preserv['button']);
 			return 'addressbook.importexport_wizard_chooseowner';
 		}
-		
 	}
 }

Modified: trunk/addressbook/inc/class.addressbook_wizard_import_vcard.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_wizard_import_vcard.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_wizard_import_vcard.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_wizard_import_vcard.inc.php Fri Apr 29 12:41:53 2016
@@ -10,27 +10,27 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Acl;
+
 class addressbook_wizard_import_vcard extends addressbook_import_vcard
 {
-
 	/**
 	 * constructor
 	 */
 	function __construct()
 	{
-
 		$this->steps = array(
 			'wizard_step40' => lang('Choose charset'),
 			'wizard_step60' => lang('Choose owner of imported data'),
 		);
-
 	}
 
 	function wizard_step40(&$content, &$sel_options, &$readonlys, &$preserv)
-        {
-                if($this->debug) error_log(get_class($this) . '::wizard_step40->$content '.print_r($content,true));
-                // return from step40
-                if ($content['step'] == 'wizard_step40')
+	{
+		if($this->debug) error_log(get_class($this) . '::wizard_step40->$content '.print_r($content,true));
+		// return from step40
+		if ($content['step'] == 'wizard_step40')
 		{
 			switch (array_search('pressed', $content['button']))
 			{
@@ -50,20 +50,20 @@
 			$content['msg'] = $this->steps['wizard_step40'];
 			$content['step'] = 'wizard_step40';
 			if(!$content['charset'] && $content['plugin_options']['charset']) {
-                                $content['charset'] = $content['plugin_options']['charset'];
-                        }
-			$sel_options['charset'] = $GLOBALS['egw']->translation->get_installed_charsets()+
-                        array(
-                                'user'  => lang('User preference'),
-                        );
+				$content['charset'] = $content['plugin_options']['charset'];
+			}
+			$sel_options['charset'] = Api\Translation::get_installed_charsets()+
+				array(
+					'user'  => lang('User preference'),
+				);
 
 			// Add in extra allowed charsets
-                        $config = config::read('importexport');
-                        $extra_charsets = array_intersect(explode(',',$config['import_charsets']), mb_list_encodings());
-                        if($extra_charsets)
-                        {
-                                $sel_options['charset'] += array(lang('Extra encodings') => array_combine($extra_charsets,$extra_charsets));
-                        }
+			$config = Api\Config::read('importexport');
+			$extra_charsets = array_intersect(explode(',',$config['import_charsets']), mb_list_encodings());
+			if($extra_charsets)
+			{
+				$sel_options['charset'] += array(lang('Extra encodings') => array_combine($extra_charsets,$extra_charsets));
+			}
 
 			$preserv = $content;
 			unset ($preserv['button']);
@@ -102,13 +102,12 @@
 				$content['change_owner'] = $content['plugin_options']['change_owner'];
 			}
 
-			$bocontacts = new addressbook_bo();
-			$sel_options['contact_owner'] = array('personal' => lang("Importer's personal")) + $bocontacts->get_addressbooks(EGW_ACL_ADD);
+			$bocontacts = new Api\Contacts();
+			$sel_options['contact_owner'] = array('personal' => lang("Importer's personal")) + $bocontacts->get_addressbooks(Acl::ADD);
 
 			$preserv = $content;
 			unset ($preserv['button']);
 			return 'addressbook.importexport_wizard_vcard_chooseowner';
 		}
-		
 	}
 }

Modified: trunk/addressbook/inc/class.addressbook_zpush.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_zpush.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_zpush.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_zpush.inc.php Fri Apr 29 12:41:53 2016
@@ -12,6 +12,9 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Acl;
+
 /**
  * Addressbook activesync plugin
  */
@@ -25,7 +28,7 @@
 	/**
 	 * Instance of addressbook_bo
 	 *
-	 * @var addressbook_bo
+	 * @var Api\Contacts
 	 */
 	private $addressbook;
 
@@ -134,11 +137,11 @@
 			}
 			else
 			{
-				translation::add_app('addressbook');	// we need the addressbook translations
-
-				if (!isset($this->addressbook)) $this->addressbook = new addressbook_bo();
-
-				// error_log(print_r($this->addressbook->get_addressbooks(EGW_ACL_READ),true));
+				Api\Translation::add_app('addressbook');	// we need the addressbook translations
+
+				if (!isset($this->addressbook)) $this->addressbook = new Api\Contacts();
+
+				// error_log(print_r($this->addressbook->get_addressbooks(Acl::READ),true));
 				$pref = $GLOBALS['egw_info']['user']['preferences']['activesync']['addressbook-abs'];
 				$pref_abs = (string)$pref !== '' ? explode(',',$pref) : array();
 
@@ -172,7 +175,7 @@
 	 */
 	public function GetFolderList()
 	{
-		// error_log(print_r($this->addressbook->get_addressbooks(EGW_ACL_READ),true));
+		// error_log(print_r($this->addressbook->get_addressbooks(Acl::READ),true));
 		$folderlist = array();
 		foreach ($this->get_addressbooks() as $account => $label)
 		{
@@ -278,7 +281,7 @@
 	function GetMessageList($id, $cutoffdate=NULL)
 	{
 		unset($cutoffdate);	// not used, but required by function signature
-		if (!isset($this->addressbook)) $this->addressbook = new addressbook_bo();
+		if (!isset($this->addressbook)) $this->addressbook = new Api\Contacts();
 
 		$type = $user = null;
 		$this->backend->splitID($id,$type,$user);
@@ -329,7 +332,7 @@
 	 */
 	public function GetMessage($folderid, $id, $contentparameters)
 	{
-		if (!isset($this->addressbook)) $this->addressbook = new addressbook_bo();
+		if (!isset($this->addressbook)) $this->addressbook = new Api\Contacts();
 
 		//$truncsize = Utils::GetTruncSize($contentparameters->GetTruncation());
 		//$mimesupport = $contentparameters->GetMimeSupport();
@@ -386,7 +389,7 @@
 					$message->$key = array();
 					foreach($contact[$attr] ? explode(',',$contact[$attr]) : array() as $cat_id)
 					{
-						$message->categories[] = categories::id2name($cat_id);
+						$message->categories[] = Api\Categories::id2name($cat_id);
 					}
 					// for all addressbooks in one, add addressbook name itself as category
 					if ($GLOBALS['egw_info']['user']['preferences']['activesync']['addressbook-all-in-one'])
@@ -437,7 +440,7 @@
 	public function StatMessage($folderid, $contact)
 	{
 		unset($folderid);	// not used (contact_id is global), but required by function signaure
-		if (!isset($this->addressbook)) $this->addressbook = new addressbook_bo();
+		if (!isset($this->addressbook)) $this->addressbook = new Api\Contacts();
 
 		if (!is_array($contact)) $contact = $this->addressbook->read($contact);
 
@@ -511,7 +514,7 @@
 	public function ChangeMessage($folderid, $id, $message, $contentParameters)
 	{
 		unset($contentParameters);	// not used, but required by function signature
-		if (!isset($this->addressbook)) $this->addressbook = new addressbook_bo();
+		if (!isset($this->addressbook)) $this->addressbook = new Api\Contacts();
 
 		$type = $account = null;
 		$this->backend->splitID($folderid, $type, $account);
@@ -528,13 +531,13 @@
 			debugLog(__METHOD__." Folder wrong or contact not existing");
 			return false;
 		}
-		if ($account == 0)	// as a precausion, we currently do NOT allow to change accounts
-		{
-			debugLog(__METHOD__." Changing of accounts denied!");
-			return false;			//no changing of accounts
+		if ($account == 0)	// as a precausion, we currently do NOT allow to change Api\Accounts
+		{
+			debugLog(__METHOD__." Changing of Api\Accounts denied!");
+			return false;			//no changing of Api\Accounts
 		}
 		$contact = array();
-		if (empty($id) && ($this->addressbook->grants[$account] & EGW_ACL_EDIT) || ($contact = $this->addressbook->read($id)) && $this->addressbook->check_perms(EGW_ACL_EDIT, $contact))
+		if (empty($id) && ($this->addressbook->grants[$account] & Acl::EDIT) || ($contact = $this->addressbook->read($id)) && $this->addressbook->check_perms(Acl::EDIT, $contact))
 		{
 			// remove all fields supported by AS, leaving all unsupported fields unchanged
 			$contact = array_diff_key($contact, array_flip(self::$mapping));
@@ -601,7 +604,7 @@
 				}
 			}
 			// for all-in-one addressbook, account is meaningless and wrong!
-			// addressbook_bo::save() keeps the owner or sets an appropriate one if none given
+			// Api\Contacts::save() keeps the owner or sets an appropriate one if none given
 			if (!isset($contact['private'])) $contact['private'] = (int)$is_private;
 			if (!$GLOBALS['egw_info']['user']['preferences']['activesync']['addressbook-all-in-one'])
 			{
@@ -670,7 +673,8 @@
 	 */
 	public function DeleteMessage($folderid, $id, $contentParameters)
 	{
-		if (!isset($this->addressbook)) $this->addressbook = new addressbook_bo();
+		unset($contentParameters);	// not used, but required by function signature
+		if (!isset($this->addressbook)) $this->addressbook = new Api\Contacts();
 
 		$ret = $this->addressbook->delete($id);
 		debugLog(__METHOD__."('$folderid', $id) delete($id) returned ".array2string($ret));
@@ -732,7 +736,7 @@
 
 		if ($type != 'addressbook') return false;
 
-		if (!isset($this->addressbook)) $this->addressbook = new addressbook_bo();
+		if (!isset($this->addressbook)) $this->addressbook = new Api\Contacts();
 
 		// handle all-in-one addressbook
 		if ($GLOBALS['egw_info']['user']['preferences']['activesync']['addressbook-all-in-one'] &&
@@ -783,7 +787,7 @@
 	 */
 	function getSearchResultsGAL($searchquery)
 	{
-		if (!isset($this->addressbook)) $this->addressbook = new addressbook_bo();
+		if (!isset($this->addressbook)) $this->addressbook = new Api\Contacts();
 		//error_log(__METHOD__.'('.array2string($searchquery).')');
 
 		// only return items in given range, eg. "0-50"
@@ -841,8 +845,8 @@
 		if (!isset($hook_data['setup']) && in_array($hook_data['type'], array('user', 'group')))
 		{
 			$user = $hook_data['account_id'];
-			$addressbook_bo = new addressbook_bo();
-			$addressbooks = $addressbook_bo->get_addressbooks(EGW_ACL_READ, null, $user);
+			$addressbook_bo = new Api\Contacts();
+			$addressbooks = $addressbook_bo->get_addressbooks(Acl::READ, null, $user);
 			if ($user > 0)
 			{
 				unset($addressbooks[$user]);	// personal addressbook is allways synced

Modified: trunk/addressbook/index.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/index.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/index.php (original)
+++ trunk/addressbook/index.php Fri Apr 29 12:41:53 2016
@@ -8,6 +8,8 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+
 $GLOBALS['egw_info'] = array(
 	'flags' => array(
 		'currentapp' => 'addressbook',
@@ -17,10 +19,10 @@
 include('../header.inc.php');
 
 // check if we have an advanced search and reset it in case
-$old_state = $GLOBALS['egw']->session->appsession('index','addressbook');
+$old_state = Api\Cache::getSession('addressbook', 'index');
 if ($old_state['advanced_search'])
 {
 	unset($old_state['advanced_search']);
-	$GLOBALS['egw']->session->appsession('index','addressbook',$old_state);
+	Api\Cache::setSession('addressbook', 'index', $old_state);
 }
-$GLOBALS['egw']->redirect_link('/index.php','menuaction=addressbook.addressbook_ui.index');
+Api\Egw::redirect_link('/index.php','menuaction=addressbook.addressbook_ui.index');

Modified: trunk/addressbook/setup/setup.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/setup/setup.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/setup/setup.inc.php (original)
+++ trunk/addressbook/setup/setup.inc.php Fri Apr 29 12:41:53 2016
@@ -10,7 +10,7 @@
 /* Basic information about this app */
 $setup_info['addressbook']['name']      = 'addressbook';
 $setup_info['addressbook']['title']     = 'Addressbook';
-$setup_info['addressbook']['version']   = '14.1';
+$setup_info['addressbook']['version']   = '16.1';
 $setup_info['addressbook']['app_order'] = 4;
 $setup_info['addressbook']['enable']    = 1;
 $setup_info['addressbook']['index']    = 'addressbook.addressbook_ui.index&ajax=true';
@@ -51,12 +51,8 @@
 
 /* Dependencies for this app to work */
 $setup_info['addressbook']['depends'][] = array(
-	'appname' => 'phpgwapi',
-	'versions' => Array('14.1')
-);
-$setup_info['addressbook']['depends'][] = array(
-	'appname' => 'etemplate',
-	'versions' => Array('14.1')
+	'appname' => 'api',
+	'versions' => Array('16.1')
 );
 
 // installation checks for addresbook

Modified: trunk/addressbook/sitemgr/class.module_addressbook_contactform.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/sitemgr/class.module_addressbook_contactform.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/sitemgr/class.module_addressbook_contactform.inc.php (original)
+++ trunk/addressbook/sitemgr/class.module_addressbook_contactform.inc.php Fri Apr 29 12:41:53 2016
@@ -9,6 +9,9 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Acl;
 
 /**
  * SiteMgr contact form for the addressbook
@@ -38,7 +41,7 @@
 	 */
 	function get_user_interface()
 	{
-		$GLOBALS['egw']->translation->add_app('addressbook');
+		Api\Translation::add_app('addressbook');
 
 		$uicontacts = new addressbook_ui();
 
@@ -76,7 +79,7 @@
 				'label' => lang('Addressbook the contact should be saved to').' ('.lang('The anonymous user needs add rights for it!').')',
 				'options' => array(
 					'' => lang('None'),
-				)+$uicontacts->get_addressbooks(EGW_ACL_ADD)	// add to not show the accounts!
+				)+$uicontacts->get_addressbooks(Acl::ADD)	// add to not show the accounts!
 			),
 			'arg4' => array(
 				'type' => 'textfield',

Modified: trunk/addressbook/sitemgr/class.module_addressbook_display.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/sitemgr/class.module_addressbook_display.inc.php?rev=55935&r1=55934&r2=55935&view=diff
==============================================================================
--- trunk/addressbook/sitemgr/class.module_addressbook_display.inc.php (original)
+++ trunk/addressbook/sitemgr/class.module_addressbook_display.inc.php Fri Apr 29 12:41:53 2016
@@ -1,5 +1,5 @@
 <?php
-/**
+/***
  * Addressbook - Sitemgr contact form
  *
  * @link http://www.egroupware.org
@@ -9,6 +9,9 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id: class.module_addressbook_display.inc.php 24028 2008-02-18 09:04:36Z stefanbecker $
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Acl;
 
 /**
  * SiteMgr contact form for the addressbook
@@ -36,7 +39,7 @@
 	 */
 	function get_user_interface()
 	{
-		$GLOBALS['egw']->translation->add_app('addressbook');
+		Api\Translation::add_app('addressbook');
 
 		$uicontacts = new addressbook_ui();
 
@@ -68,7 +71,7 @@
 				'label' => lang('Addressbook the contact should be shown').' ('.lang('The anonymous user needs read it!').')',
 				'options' => array(
 					'' => lang('All'),
-				)+$uicontacts->get_addressbooks(EGW_ACL_ADD)	// add to not show the accounts!
+				)+$uicontacts->get_addressbooks(Acl::ADD)	// add to not show the accounts!
 			),
 			'arg2' => array(
 				'type' => 'select',


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z