[eGroupWare-svn] r56043 - in /trunk/tracker: inc/ setup/ sitemgr/

[email protected] Thu, 05 May 2016 18:34:45 -0000
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: nathangray
Date: Thu May  5 20:34:45 2016
New Revision: 56043

URL: http://svn.stylite.de/viewvc/egroupware?rev=56043&view=rev
Log:
Move tracker to new API

Modified:
    trunk/tracker/inc/class.tracker_admin.inc.php
    trunk/tracker/inc/class.tracker_bo.inc.php
    trunk/tracker/inc/class.tracker_escalations.inc.php
    trunk/tracker/inc/class.tracker_export_csv.inc.php
    trunk/tracker/inc/class.tracker_hooks.inc.php
    trunk/tracker/inc/class.tracker_import_csv.inc.php
    trunk/tracker/inc/class.tracker_mailhandler.inc.php
    trunk/tracker/inc/class.tracker_merge.inc.php
    trunk/tracker/inc/class.tracker_so.inc.php
    trunk/tracker/inc/class.tracker_tracking.inc.php
    trunk/tracker/inc/class.tracker_ui.inc.php
    trunk/tracker/inc/class.tracker_widget.inc.php
    trunk/tracker/inc/class.tracker_wizard_export_csv.inc.php
    trunk/tracker/inc/class.tracker_wizard_import_csv.inc.php
    trunk/tracker/setup/default_records.inc.php
    trunk/tracker/setup/tables_update.inc.php
    trunk/tracker/sitemgr/class.module_tracker_add.inc.php

Modified: trunk/tracker/inc/class.tracker_admin.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_admin.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_admin.inc.php (original)
+++ trunk/tracker/inc/class.tracker_admin.inc.php Thu May  5 20:34:45 2016
@@ -9,6 +9,12 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Etemplate;
 
 /**
  * Admin User Interface of the tracker
@@ -224,7 +230,7 @@
 								{
 									$mailhandler->check_mail($queue_id,true);
 								}
-								catch (egw_exception_assertion_failed $e)
+								catch (Api\Exception\AssertionFailed $e)
 								{	// not sure that this is needed to pass on exeptions
 									$msg .= ($msg?' ':'').$e->getMessage();
 									if (is_array($this->mailhandling[$queue_id])) $this->mailhandling[$queue_id]['interval']=0;
@@ -347,7 +353,7 @@
 								//echo "update to"; _debug_array($old_cat);
 								if (!isset($cats))
 								{
-									$cats = new categories(categories::GLOBAL_ACCOUNT,'tracker');
+									$cats = new Api\Categories(categories::GLOBAL_ACCOUNT,'tracker');
 								}
 								if (($id = $cats->add($old_cat)))
 								{
@@ -362,10 +368,10 @@
 						$this->reload_labels();
 					}
 					// Reload tracker app
-					if(egw_json_response::isJSONResponse())
-					{
-						// egw_framework::redirect_link() will exit, we need to keep going
-						egw_json_response::get()->redirect(egw_framework::link('/index.php', array(
+					if(Api\Json\Response::isJSONResponse())
+					{
+						// Framework::redirect_link() will exit, we need to keep going
+						Api\Json\Response::get()->redirect(Framework::link('/index.php', array(
 							'menuaction' => 'tracker.tracker_ui.index',
 							// reload is not a special flag, it just makes a different
 							// url to avoid smart refresh of just nextmatch
@@ -376,7 +382,7 @@
 					if ($button == 'apply') break;
 					// fall-through for save
 				case 'cancel':
-					egw::redirect_link('/index.php', array(
+					Egw::redirect_link('/index.php', array(
 						'menuaction' => 'admin.admin_ui.index',
 						'ajax' => 'true'
 					), 'admin');
@@ -538,7 +544,7 @@
 			'allow_voting' => array('No','Yes'),
 			'allow_bounties' => array('No','Yes'),
 			'autoassign' => $this->get_staff($tracker),
-			'lang' => $GLOBALS['egw']->translation->get_installed_langs(),
+			'lang' => Api\Translation::get_installed_langs(),
 			'cat_id' => $this->get_tracker_labels('cat',$tracker),
 			// Mail handling
 			'interval' => array(
@@ -568,7 +574,7 @@
 				0 => 'Creator',
 				1 => 'Nobody',
 			),
-			'exclude_app_on_timesheetcreation' => egw_link::app_list('add'),
+			'exclude_app_on_timesheetcreation' => Link::app_list('add'),
 		);
 		foreach($this->mailservertypes as $ind => $typ)
 		{
@@ -579,7 +585,7 @@
 			$sel_options['mailheaderhandling'][] = $typ[1];
 		}
 		$GLOBALS['egw_info']['flags']['app_header'] = lang('Tracker configuration').($tracker ? ': '.$this->trackers[$tracker] : '');
-		$tpl = new etemplate_new('tracker.admin');
+		$tpl = new Etemplate('tracker.admin');
 		return $tpl->exec('tracker.tracker_admin.admin',$content,$sel_options,$readonlys,$content);
 	}
 
@@ -786,7 +792,7 @@
 		{
 			$content['set']['tr_assigned'] = explode(',',$content['set']['tr_assigned']);
 		}
-		$tpl = new etemplate_new('tracker.escalations');
+		$tpl = new Etemplate('tracker.escalations');
 		if (count($content['set']['tr_assigned']) > 1)
 		{
 			$widget =& $tpl->get_widget_by_name('tr_assigned');	//$tpl->set_cell_attribute() sets all widgets with this name, so the action too!

Modified: trunk/tracker/inc/class.tracker_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_bo.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_bo.inc.php (original)
+++ trunk/tracker/inc/class.tracker_bo.inc.php Thu May  5 20:34:45 2016
@@ -11,6 +11,9 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Vfs;
 
 /**
  * Some constants for the check_rights function
@@ -138,7 +141,7 @@
 	 */
 	var $restrictions;
 	/**
-	 * Enabled the acl queue access?
+	 * Enabled the Acl queue access?
 	 *
 	 * @var boolean
 	 */
@@ -394,7 +397,7 @@
 	{
 		parent::init();
 		if (isset($keys['tr_tracker'])&&!empty($keys['tr_tracker'])) $this->data['tr_tracker']=$keys['tr_tracker'];
-		if (is_array($this->trackers)&&(!isset($this->data['tr_tracker'])||empty($this->data['tr_tracker'])))	// init is called from so_sql::__construct(), where $this->trackers is NOT set
+		if (is_array($this->trackers)&&(!isset($this->data['tr_tracker'])||empty($this->data['tr_tracker'])))	// init is called from Api\Storage\Base::__construct(), where $this->trackers is NOT set
 		{
 			$this->data['tr_tracker'] = key($this->trackers);	// Need some tracker so creator rights are correct
 		}
@@ -426,7 +429,7 @@
 			foreach($data['replies'] as &$reply)
 			{
 				$reply['reply_servertime'] = $reply['reply_created'];
-				$reply['reply_created'] = egw_time::server2user($reply['reply_created'],$this->timestamp_type);
+				$reply['reply_created'] = Api\DateTime::server2user($reply['reply_created'],$this->timestamp_type);
 			}
 		}
 		// check if item is overdue
@@ -448,7 +451,7 @@
 			$data[$field . '_servertime'] = $data[$field];
 		}
 
-		// will run all regular timestamps ($this->timestamps) trough egw_time::server2user()
+		// will run all regular timestamps ($this->timestamps) trough Api\DateTime::server2user()
 		return parent::db2data($intern ? null : $data);	// important to use null, if $intern!
 	}
 
@@ -466,7 +469,7 @@
 		}
 		if (substr($data['tr_completion'],-1) == '%') $data['tr_completion'] = (int) round(substr($data['tr_completion'],0,-1));
 
-		// will run all regular timestamps ($this->timestamps) trough egw_time::user2server()
+		// will run all regular timestamps ($this->timestamps) through Api\DateTime::user2server()
 		return parent::data2db($intern ? null : $data);	// important to use null, if $intern!
 	}
 
@@ -548,7 +551,7 @@
 			$testReply = $this->data['reply_message'];
 			if ($this->htmledit && isset($this->data['reply_message']) && !empty($this->data['reply_message']))
 			{
-				$testReply = trim(translation::convertHTMLToText(html::purify($this->data['reply_message']), false, true, true));
+				$testReply = trim(Api\Mail\Html::convertHTMLToText(Api\Html::purify($this->data['reply_message']), false, true, true));
 			}
 			//error_log(__METHOD__.__LINE__.' TestReplyMessage:'.$testReply);
 			if (!$changed && !((isset($this->data['reply_message']) && !empty($this->data['reply_message']) && !empty($testReply)) ||
@@ -634,10 +637,10 @@
 		if (!($err = parent::save()))
 		{
 			// create (and remove) links in custom fields
-			customfields_widget::update_customfield_links('tracker',$this->data,$old,'tr_id');
+			Api\Storage\Customfields::update_links('tracker',$this->data,$old,'tr_id');
 
 			// so other apps can update eg. their titles and the cached title gets unset
-			egw_link::notify_update('tracker',$this->data['tr_id'],$this->data);
+			Link::notify_update('tracker',$this->data['tr_id'],$this->data);
 
 			if (!is_object($this->tracking))
 			{
@@ -768,15 +771,15 @@
 		{
 			if ($GLOBALS['egw']->accounts->get_type($uid) == 'g')
 			{
-				if ($return_groups) $groups[(string)$uid] = $GLOBALS['egw']->common->grab_owner_name($uid);
+				if ($return_groups) $groups[(string)$uid] = Api\Accounts::username($uid);
 				foreach((array)$GLOBALS['egw']->accounts->members($uid,true) as $u)
 				{
-					if (!isset($users[$u])) $users[$u] = $GLOBALS['egw']->common->grab_owner_name($u);
+					if (!isset($users[$u])) $users[$u] = Api\Accounts::username($u);
 				}
 			}
 			else // users
 			{
-				if (!isset($users[$uid])) $users[$uid] = $GLOBALS['egw']->common->grab_owner_name($uid);
+				if (!isset($users[$uid])) $users[$uid] = Api\Accounts::username($uid);
 			}
 		}
 		// sort alphabetic
@@ -877,7 +880,7 @@
 	 */
 	function is_anonymous($user=null)
 	{
-		static $cache = array();	// some caching to not read acl multiple times from the database ($user != $this->user)
+		static $cache = array();	// some caching to not read Acl multiple times from the database ($user != $this->user)
 
 		if (!$user) $user = $this->user;
 
@@ -906,7 +909,7 @@
 	 */
 	function is_tracker_user($user=null)
 	{
-		static $cache = array();	// some caching to not read acl multiple times from the database ($user != $this->user)
+		static $cache = array();	// some caching to not read Acl multiple times from the database ($user != $this->user)
 
 		if (is_null($user)) $user = $this->user;
 
@@ -1087,7 +1090,7 @@
 	 * - write access: user is allowed to upload files or link with other entries
 	 *
 	 * @param int|array $id id of entry or entry array
-	 * @param int $check EGW_ACL_READ for read and EGW_ACL_EDIT for write or delete access
+	 * @param int $check Acl::READ for read and Acl::EDIT for write or delete access
 	 * @param string $rel_path = null currently not used in Tracker
 	 * @param int $user = null for which user to check, default current user
 	 * @return boolean true if access is granted or false otherwise
@@ -1105,8 +1108,8 @@
 		}
 		if (!isset($access))
 		{
-			$needed = $check == EGW_ACL_READ ? TRACKER_USER : $this->field_acl['link_to'];
-			$name = 'file_access '.($check == EGW_ACL_READ ? 'read' : 'write');
+			$needed = $check == Acl::READ ? TRACKER_USER : $this->field_acl['link_to'];
+			$name = 'file_access '.($check == Acl::READ ? 'read' : 'write');
 
 			$access = $this->check_rights($needed,null,$id,$user,$name);
 		}
@@ -1171,7 +1174,7 @@
 		{
 			if (!isset($GLOBALS['egw']->categories))
 			{
-				$GLOBALS['egw']->categories = new categories($this->user,'tracker');
+				$GLOBALS['egw']->categories = new Api\Categories($this->user,'tracker');
 			}
 			if (isset($GLOBALS['egw']->categories) && $GLOBALS['egw']->categories->app_name == 'tracker')
 			{
@@ -1179,7 +1182,7 @@
 			}
 			else
 			{
-				$cats = new categories($this->user,'tracker');
+				$cats = new Api\Categories($this->user,'tracker');
 			}
 			$this->all_cats = $cats->return_array('all',0,false);
 			if (!is_array($this->all_cats)) $this->all_cats = array();
@@ -1410,7 +1413,7 @@
 				$titles[$ticket['tr_id']] = $this->link_title($ticket);
 			}
 		}
-		// we assume all not returned tickets are not readable by the user, as we notify egw_link about each deleted ticket
+		// we assume all not returned tickets are not readable by the user, as we notify Link about each deleted ticket
 		foreach($ids as $id)
 		{
 			if (!isset($titles[$id])) $titles[$id] = false;
@@ -1450,7 +1453,7 @@
 	 * @param array $query with keys 'start', 'search', 'order', 'sort', 'col_filter'
 	 *	For other keys like 'filter', 'cat_id' you have to reimplement this method in a derived class.
 	 * @param array &$rows returned rows/competitions
-	 * @param array &$readonlys eg. to disable buttons based on acl, not use here, maybe in a derived class
+	 * @param array &$readonlys eg. to disable buttons based on Acl, not use here, maybe in a derived class
 	 * @param string $join = '' sql to do a join, added as is after the table-name, eg. ", table2 WHERE x=y" or
 	 *	"LEFT JOIN table2 ON (x=y)", Note: there's no quoting done on $join!
 	 * @param boolean $need_full_no_count = false If true an unlimited query is run to determine the total number of rows, default false
@@ -1473,7 +1476,7 @@
 	 */
 	function add_tracker($name)
 	{
-		$cats = new categories(categories::GLOBAL_ACCOUNT,'tracker');	// global cat!
+		$cats = new Api\Categories(categories::GLOBAL_ACCOUNT,'tracker');	// global cat!
 		if ($name && ($id = $cats->add(array(
 			'name'   => $name,
 			'descr'  => 'tracker',
@@ -1484,9 +1487,9 @@
 			$this->trackers[$id] = $name;
 
 			// Update cf type list
-			$types = config::get_content_types('tracker');
+			$types = Api\Config::get_content_types('tracker');
 			$types[$id] = array('name' => $name, 'non_deletable' => true);
-			config::save_value('types',$types, 'tracker');
+			Api\Config::save_value('types',$types, 'tracker');
 
 			return $id;
 		}
@@ -1502,7 +1505,7 @@
 	 */
 	function rename_tracker($tracker,$name)
 	{
-		$cats = new categories(categories::GLOBAL_ACCOUNT,'tracker');
+		$cats = new Api\Categories(categories::GLOBAL_ACCOUNT,'tracker');
 		if ($tracker > 0 && !empty($name) && ($data = $cats->read($tracker)))
 		{
 			if ($data['name'] != $name)
@@ -1511,9 +1514,9 @@
 				$cats->edit($data);
 
 				// Update cf type list
-				$types = config::get_content_types('tracker');
+				$types = Api\Config::get_content_types('tracker');
 				$types[$tracker]['name'] = $name;
-				config::save_value('types',$types, 'tracker');
+				Api\Config::save_value('types',$types, 'tracker');
 			}
 			return true;
 		}
@@ -1540,9 +1543,9 @@
 		$GLOBALS['egw']->categories->delete($tracker,true);
 
 		// Update cf type list
-		$types = config::get_content_types('tracker');
+		$types = Api\Config::get_content_types('tracker');
 		unset($types[$tracker]);
-		config::save_value('types',$types, 'tracker');
+		Api\Config::save_value('types',$types, 'tracker');
 
 		$this->reload_labels();
 		unset($this->admins[$tracker]);
@@ -1562,8 +1565,8 @@
 	{
 		foreach($this->config_names as $name)
 		{
-			#echo "<p>calling config::save_value('$name','{$this->$name}','tracker')</p>\n";
-			config::save_value($name,$this->$name,'tracker');
+			#echo "<p>calling Api\Config::save_value('$name','{$this->$name}','tracker')</p>\n";
+			Api\Config::save_value($name,$this->$name,'tracker');
 		}
 		self::set_async_job($this->pending_close_days > 0);
 
@@ -1580,12 +1583,12 @@
 	function load_config()
 	{
 		$migrate_config = false;	// update old config-values, can be removed soon
-		foreach((array)config::read('tracker') as $name => $value)
+		foreach((array)Api\Config::read('tracker') as $name => $value)
 		{
 			if (substr($name,0,13) == 'notification_')	// update old config-values, can be removed soon
 			{
 				$this->notification[0][substr($name,13)] = $value;
-				config::save_value($name,null,'tracker');
+				Api\Config::save_value($name,null,'tracker');
 				$migrate_config = true;
 				continue;
 			}
@@ -1595,7 +1598,7 @@
 		{
 			foreach($this->notification as $name => $value)
 			{
-				config::save_value($name,$value,'tracker');
+				Api\Config::save_value($name,$value,'tracker');
 			}
 		}
 
@@ -1660,7 +1663,7 @@
 	{
 		//echo '<p>'.__METHOD__.'('.($start?'true':'false').")</p>\n";
 
-		$async = new asyncservice();
+		$async = new Api\Asyncservice();
 
 		if ($start === !$async->read('tracker-close-pending'))
 		{
@@ -1688,13 +1691,13 @@
 		))))
 		{
 			if (($default_lang = $GLOBALS['egw']->preferences->default_prefs('common','lang')) &&	// load the system default language
-				translation::$userlang != $default_lang)
+				Api\Translation::$userlang != $default_lang)
 			{
 				$save_lang = $GLOBALS['egw_info']['user']['preferences']['common']['lang'];
 				$GLOBALS['egw_info']['user']['preferences']['common']['lang'] = $default_lang;
-				translation::init();
-			}
-			translation::add_app('tracker');
+				Api\Translation::init();
+			}
+			Api\Translation::add_app('tracker');
 
 			foreach($ids as $tr_id)
 			{
@@ -1708,7 +1711,7 @@
 			if ($save_lang)
 			{
 				$GLOBALS['egw_info']['user']['preferences']['common']['lang'] = $save_lang;
-				translation::init();
+				Api\Translation::init();
 			}
 		}
 	}
@@ -1859,7 +1862,7 @@
 	 */
 	function ajax_getTicketId($_subject)
 	{
-		$response  = egw_json_response::get();
+		$response  = Api\Json\Response::get();
 		$response->data($this->get_ticketId($_subject));
 	}
 
@@ -1962,7 +1965,7 @@
 				),
 			);
 			// find the addressbookentry to link with
-			$addressbook = new addressbook_bo();
+			$addressbook = new Api\Contacts();
 			$contacts = array();
 			$filter['owner'] = 0;
 			foreach ($emails as $mailadr)
@@ -1983,7 +1986,7 @@
 				// create as "ordinary" links and try to find/set the creator according to the sender (if it is a valid user to the all queues (tracker=0))
 				foreach ($contacts as $contact)
 				{
-					egw_link::link('tracker',$trackerentry['link_to']['to_id'],'addressbook',(isset($contact['contact_id'])?$contact['contact_id']:$contact['id']));
+					Link::link('tracker',$trackerentry['link_to']['to_id'],'addressbook',(isset($contact['contact_id'])?$contact['contact_id']:$contact['id']));
 					//error_log(__METHOD__.__LINE__.'linking ->'.array2string($trackerentry['link_to']['to_id']).' Status:'.$gg.': for'.(isset($contact['contact_id'])?$contact['contact_id']:$contact['id']));
 					$staff = $this->get_staff($tracker=0,0,'usersANDtechnicians');
 					if (empty($trackerentry['tr_creator'])&& $contact['account_id']>0)
@@ -2024,7 +2027,7 @@
 		else
 		{
 			// find the addressbookentry to idetify the reply creator
-			$addressbook = new addressbook_bo();
+			$addressbook = new Api\Contacts();
 			$contacts = array();
 			$filter['owner'] = 0;
 			foreach ($emails as $mailadr)
@@ -2079,7 +2082,7 @@
 				{
 					if (!$this->htmledit || stripos($reply['reply_message'], '<br') === false && stripos($reply['reply_message'], '<p>') === false)
 					{
-						$reply['reply_message'] = nl2br(html::htmlspecialchars($reply['reply_message']));
+						$reply['reply_message'] = nl2br(Api\Html::htmlspecialchars($reply['reply_message']));
 					}
 				}
 			}
@@ -2099,12 +2102,12 @@
 			{
 				if($attachment['egw_data'])
 				{
-					egw_link::link('tracker',$trackerentry['link_to']['to_id'],egw_link::DATA_APPNAME,$attachment);
+					Link::link('tracker',$trackerentry['link_to']['to_id'],Link::DATA_APPNAME,$attachment);
 				}
 				else if(is_readable($attachment['tmp_name']) ||
-					(egw_vfs::is_readable($attachment['tmp_name']) && parse_url($attachment['tmp_name'], PHP_URL_SCHEME) === 'vfs'))
+					(Vfs::is_readable($attachment['tmp_name']) && parse_url($attachment['tmp_name'], PHP_URL_SCHEME) === 'vfs'))
 				{
-					egw_link::link('tracker',$trackerentry['link_to']['to_id'],'file',$attachment);
+					Link::link('tracker',$trackerentry['link_to']['to_id'],'file',$attachment);
 				}
 			}
 		}
@@ -2156,7 +2159,7 @@
 			case 'upcoming':
 				return "(tr_startdate IS NOT NULL and tr_startdate > {$this->now} )";
 		}
-		return egw_time::sql_filter($name, $start, $end, $column, $this->date_filters);
+		return Api\DateTime::sql_filter($name, $start, $end, $column, $this->date_filters);
 	}
 
 	/**

Modified: trunk/tracker/inc/class.tracker_escalations.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_escalations.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_escalations.inc.php (original)
+++ trunk/tracker/inc/class.tracker_escalations.inc.php Thu May  5 20:34:45 2016
@@ -12,10 +12,12 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+
 /**
  * Escalation of tickets
  */
-class tracker_escalations extends so_sql2
+class tracker_escalations extends Api\Storage\Base2
 {
 	/**
 	 * Name of escalations table
@@ -76,7 +78,7 @@
 
 		if (!is_null($id) && !$this->read($id))
 		{
-			throw new egw_exception_not_found();
+			throw new Api\Exception\NotFound();
 		}
 	}
 
@@ -153,7 +155,7 @@
 							$users = array();
 							foreach((array)$value as $uid)
 							{
-								$users[] = $GLOBALS['egw']->common->grab_owner_name($uid);
+								$users[] = Api\Accounts::username($uid);
 							}
 							$action .= implode(', ',$users);
 							break;
@@ -524,7 +526,7 @@
 	{
 		//echo '<p>'.__METHOD__.'('.($start?'true':'false').")</p>\n";
 
-		$async = new asyncservice();
+		$async = new Api\Asyncservice();
 
 		if ($start === !$async->read(self::ASYNC_JOB_NAME))
 		{
@@ -635,15 +637,15 @@
 			$GLOBALS['egw']->acl->read_repository();
 
 			// load the right language if needed
-			if ($GLOBALS['egw_info']['user']['preferences']['common']['lang'] != translation::$userlang)
-			{
-				translation::init();
+			if ($GLOBALS['egw_info']['user']['preferences']['common']['lang'] != Api\Translation::$userlang)
+			{
+				Api\Translation::init();
 				// Make sure translations are loaded
-				translation::add_app('tracker');
-			}
-
-			// Load date/time preferences into egw_time
-			egw_time::init();
+				Api\Translation::add_app('tracker');
+			}
+
+			// Load date/time preferences into Api\DateTime
+			Api\DateTime::init();
 
 			// Keep a list of tickets so we only send the user one notification / ticket
 			$notified = array();
@@ -688,14 +690,14 @@
 							$ticket['prefix'] = lang('Starting').' ';
 							$ticket['message'] = lang('%1 is starting %2',
 								self::$tracker->link_title($ticket['tr_id']),
-								$ticket['tr_startdate'] ? egw_time::to($ticket['tr_startdate']) : ''
+								$ticket['tr_startdate'] ? Api\DateTime::to($ticket['tr_startdate']) : ''
 							);
 							break;
 						case 'notify_due':
 							$ticket['prefix'] = lang('Due') . ' ';
 							$ticket['message'] = lang('%1 is due %2',
 								self::$tracker->link_title($ticket['tr_id']),
-								$ticket['tr_duedate'] ? egw_time::to($ticket['tr_duedate']) : ''
+								$ticket['tr_duedate'] ? Api\DateTime::to($ticket['tr_duedate']) : ''
 							);
 							break;
 					}

Modified: trunk/tracker/inc/class.tracker_export_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_export_csv.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_export_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_export_csv.inc.php Thu May  5 20:34:45 2016
@@ -11,6 +11,8 @@
  * @version $Id
  */
 
+use EGroupware\Api;
+
 /**
  * export tickets to CSV
  */
@@ -18,7 +20,7 @@
 
 	public function __construct()
 	{
-		translation::add_app('tracker');
+		Api\Translation::add_app('tracker');
 		$this->ui = new tracker_ui();
 		$this->get_selects();
 	}
@@ -32,8 +34,8 @@
 
 
 		$selection = array();
-		$query_key = 'tracker'.($options['tracker'] ? '-'.$options['tracker'] : '');
-		$query = $old_query = egw_session::appsession('index',$query_key);
+		$query_key = 'index'.($options['tracker'] ? '-'.$options['tracker'] : '');
+		$query = $old_query = Api\Cache::getSession('tracker',$query_key);
 		switch($options['selection'])
 		{
 			case 'search':
@@ -43,12 +45,13 @@
 				$this->ui->get_rows($query,$selection,$readonlys);
 
 				// Reset nm params
-				egw_session::appsession('index',$query_key, $old_query);
+				Api\Cache::setSession('tracker',$query_key, $old_query);
 				break;
 			case 'filter':
 			case 'all':
 				$query = array(
 					'num_rows' => -1,		// all
+					'order' => 'tr_id',
 					'csv_export' => true,	// so get_rows method _can_ produce different content or not store state in the session
 				);
 				if($options['selection'] == 'filter')
@@ -77,7 +80,7 @@
 				$this->ui->get_rows($query,$selection,$readonlys);
 
 				// Reset nm params
-				egw_session::appsession('index',$query_key, $old_query);
+				Api\Cache::setSession('tracker',$query_key, $old_query);
 			break;
 			default:
 				$selection = explode(',',$options['selection']);
@@ -187,7 +190,7 @@
 				// User date format
 				$date = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'] . ', '.
 					($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '24' ? 'H' : 'h').':i:s',$reply['reply_created']);
-				$name = common::grab_owner_name($reply['reply_creator']);
+				$name = Api\Accounts::username($reply['reply_creator']);
 				$message = str_replace("\r\n", "\n", htmlspecialchars_decode(strip_tags($reply['reply_message'])));
 
 				$replies[$id] = "$date \t$name \t$message";
@@ -202,7 +205,7 @@
 				foreach($record->bounties as $key => $bounty) {
 					$date = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'] . ', '.
 						($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '24' ? 'H' : 'h').':i:s',$bounty['bounty_created']);
-					$name = common::grab_owner_name($bounty['bounty_creator']);
+					$name = Api\Accounts::username($bounty['bounty_creator']);
 					$total += $bounty['bounty_amount'];
 					$bounties[] = "$date\t$name\t".$bounty['bounty_amount'];
 				}

Modified: trunk/tracker/inc/class.tracker_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_hooks.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_hooks.inc.php (original)
+++ trunk/tracker/inc/class.tracker_hooks.inc.php Thu May  5 20:34:45 2016
@@ -10,6 +10,11 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+
 /**
  * diverse tracker hooks, all static
  */
@@ -70,30 +75,30 @@
 		if ($location == 'sidebox_menu')
 		{
 			// Magic etemplate2 favorites menu (from nextmatch widget)
-			display_sidebox($appname, lang('Favorites'), egw_framework::favorite_list($appname));
+			display_sidebox($appname, lang('Favorites'), Framework\Favorites::list_favorites($appname));
 
 			$file = array(
-				'Tracker list' => egw::link('/index.php',array(
+				'Tracker list' => Egw::link('/index.php',array(
 					'menuaction' => 'tracker.tracker_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')"
 				),
 			);
 
-			$file['Placeholders'] = egw::link('/index.php','menuaction=tracker.tracker_merge.show_replacements');
+			$file['Placeholders'] = Egw::link('/index.php','menuaction=tracker.tracker_merge.show_replacements');
 			display_sidebox($appname,$GLOBALS['egw_info']['apps'][$appname]['title'].' '.lang('Menu'),$file);
 		}
 
 		if ($GLOBALS['egw_info']['user']['apps']['admin'])
 		{
 			$file = Array(
-				'Site configuration' => egw::link('/index.php','menuaction=tracker.tracker_admin.admin'),
-				'Define escalations' => egw::link('/index.php','menuaction=tracker.tracker_admin.escalations'),
-				'Custom fields' => egw::link('/index.php','menuaction=tracker.tracker_customfields.index&use_private=1&ajax=true'),
+				'Site configuration' => Egw::link('/index.php','menuaction=tracker.tracker_admin.admin'),
+				'Define escalations' => Egw::link('/index.php','menuaction=tracker.tracker_admin.escalations'),
+				'Custom fields' => Egw::link('/index.php','menuaction=tracker.tracker_customfields.index&use_private=1&ajax=true'),
 			);
 			if ($location == 'admin')
 			{
@@ -241,7 +246,7 @@
 		// Merge print
 		if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
 		{
-			$link = egw::link('/index.php','menuaction=tracker.tracker_merge.show_replacements');
+			$link = Egw::link('/index.php','menuaction=tracker.tracker_merge.show_replacements');
 
 			$settings['default_document'] = array(
 				'type'   => 'vfs_file',
@@ -250,7 +255,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('tracker')).' '.
 					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','tr_summary').' '.
-					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,
@@ -262,7 +267,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('tracker')).' '.
 					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','tr_summary').' '.
-					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,
@@ -324,7 +329,7 @@
 	{
 		if ($data['prefs']['notify_due'] || $data['prefs']['notify_start'])
 		{
-			$async = new asyncservice();
+			$async = new Api\Asyncservice();
 
 			if (!$async->read(tracker_escalations::ASYNC_NOTIFICATION))
 			{
@@ -343,7 +348,7 @@
 	{
 		return array(
 			'menuaction' => 'tracker.tracker_ui.mail_import',
-			'popup' => egw_link::get_registry('tracker', 'add_popup'),
+			'popup' => Link::get_registry('tracker', 'add_popup'),
 			'app_entry_method' => 'tracker.tracker_bo.ajax_getTicketId'
 		);
 	}

Modified: trunk/tracker/inc/class.tracker_import_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_import_csv.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_import_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_import_csv.inc.php Thu May  5 20:34:45 2016
@@ -11,6 +11,8 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Link;
 
 /**
  * class import_csv for tracker
@@ -146,7 +148,7 @@
 			$_definition->plugin_options['record_owner'] : $this->user;
 
 		// Used to try to automatically match names to account IDs
-		$addressbook = new addressbook_so();
+		$addressbook = new Api\Contacts\Storage();
 
 		// Process cat_id as a normal select
 		$types = tracker_egw_record::$types;
@@ -184,7 +186,7 @@
 							$this->errors[$import_csv->get_current_position()] = lang(
 								'Unable to convert "%1" to account ID.  Using plugin setting (%2) for %3.',
 								$record['tr_'.$field],
-								common::grab_owner_name($_definition->plugin_options['record_'.$option]),
+								Api\Accounts::username($_definition->plugin_options['record_'.$option]),
 								lang($this->bo->field2label['tr_'.$field])
 							);
 							$record['tr_'.$field] = $_definition->plugin_options['record_'.$option];
@@ -313,7 +315,7 @@
 						// User date format
 						$date = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'] . ', '.
 							($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '24' ? 'H' : 'h').':i:s',$reply['reply_created']);
-						$name = common::grab_owner_name($reply['reply_creator']);
+						$name = Api\Accounts::username($reply['reply_creator']);
 						$message = str_replace("\r\n", "\n", $reply['reply_message']);
 
 						$replies[$id] = "$date\t$name\t$message";
@@ -436,7 +438,7 @@
 					break;
 				}
 			default:
-				throw new egw_exception('Unsupported action');
+				throw new Api\Exception('Unsupported action');
 		}
 
 		// Process some additional fields
@@ -452,7 +454,7 @@
 				$id = $_data[$field];
 			}
 			if ($app && $app_id) {
-				$link_id = egw_link::link('tracker',$id,$app,$app_id);
+				$link_id = Link::link('tracker',$id,$app,$app_id);
 			}
 		}
 		return true;

Modified: trunk/tracker/inc/class.tracker_mailhandler.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_mailhandler.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_mailhandler.inc.php (original)
+++ trunk/tracker/inc/class.tracker_mailhandler.inc.php Thu May  5 20:34:45 2016
@@ -12,6 +12,9 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Link;
 
 use EGroupware\Api\Mail;
 
@@ -213,7 +216,7 @@
 			catch (Exception $e)
 			{
 				error_log(__METHOD__.__LINE__.' Failed loading mail profile:'.$e->getMessage());
-				//throw new egw_exception(__METHOD__.' Failed loading mail profile:'.$e->getMessage());
+				//throw new Api\Exception(__METHOD__.' Failed loading mail profile:'.$e->getMessage());
 				return false;
 			}
 		}
@@ -273,7 +276,7 @@
 
 		if ($this->mailBox === false)
 		{
-			if ($TestConnection) throw new egw_exception_wrong_userinput(lang("incomplete server profile for mailhandling provided; Disabling mailhandling for Queue %1", $queue));
+			if ($TestConnection) throw new Api\Exception\WrongUserinput(lang("incomplete server profile for mailhandling provided; Disabling mailhandling for Queue %1", $queue));
 			// this line should prevent adding garbage to mailhandlerconfig
 			if (!isset($this->mailhandling[$queue]) || empty($this->mailhandling[$queue]) || $this->mailhandling[$queue]['interval']==0) return false;
 			error_log(__METHOD__.','.__LINE__.lang("incomplete server profile for mailhandling provided; Disabling mailhandling for Queue %1", $queue.' # Instance='.$GLOBALS['egw_info']['user']['domain']));
@@ -291,7 +294,7 @@
 				}
 				try
 				{
-					$this->smtpMail = new egw_mailer();
+					$this->smtpMail = new Api\Mailer();
 					if (self::LOG_LEVEL>2) error_log(__METHOD__.__LINE__.array2string($this->smtpMail));
 				} catch(Exception $e) {
 					// ignore exception, but log it, to block the account and give a correct error-message to user
@@ -300,7 +303,7 @@
 				}
 
 			}
-			$rFP=egw_cache::getCache(egw_cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId));
+			$rFP=Api\Cache::getCache(Api\Cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId));
 			if ($rFP && !empty($rFP))
 			{
 				$d = self::compareMailboxSettings($this->mailBox,$rFP);
@@ -313,7 +316,7 @@
 						$previousInterval = $this->mailhandling[$queue]['interval'];
 						$this->mailhandling[$queue]['interval']=$this->mailhandling[$queue]['interval']*2;
 						$this->save_config();
-						egw_cache::setCache(egw_cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),array(),$expiration=60*10);
+						Api\Cache::setCache(Api\Cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),array(),$expiration=60*10);
 						if ($GLOBALS['egw_info']['server']['admin_mails'] && $this->smtpMail)
 						{
 							// notify admin(s) via email
@@ -358,21 +361,21 @@
 			if ($TestConnection===true)
 			{
 				if (self::LOG_LEVEL>0) error_log(__METHOD__.','.__LINE__." failed to open mailbox:".array2string($mailobject->icServer));
-				if ($connectionFailed) throw new egw_exception_wrong_userinput(lang("failed to open mailbox: %1 -> disabled for automatic mailprocessing!",($mailobjecterrorMessage?$mailobjecterrorMessage:lang('could not connect'))));
+				if ($connectionFailed) throw new Api\Exception\WrongUserinput(lang("failed to open mailbox: %1 -> disabled for automatic mailprocessing!",($mailobjecterrorMessage?$mailobjecterrorMessage:lang('could not connect'))));
 				return true;//everythig all right
 			}
 			if ($connectionFailed)
 			{
-				egw_cache::setCache(egw_cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),$this->mailBox,$expiration=60*60*5);
+				Api\Cache::setCache(Api\Cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),$this->mailBox,$expiration=60*60*5);
 				if (self::LOG_LEVEL>0) error_log(__METHOD__.','.__LINE__." failed to open mailbox:".array2string($this->mailBox));
 				return false;
 			}
 			else
 			{
-				egw_cache::setCache(egw_cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),array(),$expiration=60*10);
+				Api\Cache::setCache(Api\Cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),array(),$expiration=60*10);
 			}
 			// load lang stuff for mailheaderInfoSection creation
-			translation::add_app('mail');
+			Api\Translation::add_app('mail');
 			// retrieve list
 			if (self::LOG_LEVEL>0 &&  $tretval===false) error_log(__METHOD__.__LINE__.'#'.array2string($tretval).$mailobjecterrorMessage);
 			if (self::LOG_LEVEL>1) error_log(__METHOD__.__LINE__." Processing mailbox {$_folderName} with ServerID:".$mailobject->icServer->ImapServerId." for queue $queue\n".array2string($mailobject->icServer));
@@ -600,7 +603,7 @@
 			'[\030]','[\031]','[\032]','[\033]','[\034]','[\035]','[\036]','[\037]');
 
 		//error_log(__METHOD__." Fetching body for ID $mid, Section $section with Structure: ".print_r($structure,true));
-		$charset = $GLOBALS['egw']->translation->charset(); // set some default charset, for translation to use
+		$charset = Api\Translation::charset(); // set some default charset, for Api\Translation to use
 		$mailbodyasAttachment = false;
 		if(function_exists(mb_decode_mimeheader)) {
 			mb_internal_encoding($charset);
@@ -670,7 +673,7 @@
 				default:
 					break;
 			}
-			$GLOBALS['egw']->translation->convert($body,$charset);
+			Api\Translation::convert($body,$charset);
 			if ($mimeType=='TEXT/PLAIN')
 			{
 				$newBody    = @htmlentities($body,ENT_QUOTES, strtoupper($charset));
@@ -795,7 +798,7 @@
 			//error_log(__METHOD__." Attachments retrieved with attachments:".print_r($additionalAttachments,true));
 			for ($a=0; $a<sizeof($additionalAttachments);$a++) $attachments[] = $additionalAttachments[$a];
 		}
-		return array('body' => $GLOBALS['egw']->translation->convertHTMLToText(nl2br(html::purify($body))),
+		return array('body' => Api\Translation::convertHTMLToText(nl2br(Api\Html::purify($body))),
 					 'struct' => $struct,
 					 'attachments' =>  $attachments
 					);
@@ -981,7 +984,7 @@
 	 */
 	function decode_header (&$header)
 	{
-		$header = translation::decodeMailHeader($header);
+		$header = Api\Mail\Html::decodeMailHeader($header);
 	}
 
 	/**
@@ -1268,7 +1271,7 @@
 			{
 				if(is_readable($attachment['tmp_name']))
 				{
-					egw_link::attach_file('tracker',$this->data['tr_id'],$attachment);
+					Link::attach_file('tracker',$this->data['tr_id'],$attachment);
 				}
 			}
 		}
@@ -1528,7 +1531,7 @@
 				if(is_readable($attachment['tmp_name']))
 				{
 					//error_log(__METHOD__.__LINE__.'# trying to link '.$attachment['tmp_name'].'# to:'.$this->data['tr_id']);
-					egw_link::attach_file('tracker',$this->data['tr_id'],$attachment);
+					Link::attach_file('tracker',$this->data['tr_id'],$attachment);
 				}
 			}
 		}
@@ -1649,7 +1652,7 @@
 	 */
 	static function set_async_job($queue=0, $interval=0)
 	{
-		$async = new asyncservice();
+		$async = new Api\Asyncservice();
 		$job_id = 'tracker-check-mail' . ($queue ? '-'.$queue : '');
 
 		// Make sure an existing timer is cancelled

Modified: trunk/tracker/inc/class.tracker_merge.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_merge.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_merge.inc.php (original)
+++ trunk/tracker/inc/class.tracker_merge.inc.php Thu May  5 20:34:45 2016
@@ -12,10 +12,13 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Link;
+
 /**
  * Tracker - document merge object
  */
-class tracker_merge extends bo_merge
+class tracker_merge extends Api\Storage\Merge
 {
 	/**
 	 * Functions that can be called via menuaction
@@ -55,7 +58,7 @@
 		$this->bo = new tracker_bo();
 
 		// switch of handling of html formated content, if html is not used
-		$this->parse_html_styles = $this->bo->htmledit || egw_customfields::use_html('tracker');
+		$this->parse_html_styles = $this->bo->htmledit || Api\Storage\Customfields::use_html('tracker');
 
 	}
 
@@ -78,8 +81,8 @@
 			$replies = array();
 			foreach($tracker['replies'] as $id => $reply) {
 				// User date format
-				$date = egw_time::to($reply['reply_created']);
-				$name = common::grab_owner_name($reply['reply_creator']);
+				$date = Api\DateTime::to($reply['reply_created']);
+				$name = Api\Accounts::username($reply['reply_creator']);
 				$message = str_replace("\r\n", "\n", $reply['reply_message']);
 				if($reply['reply_visible'] > 0) {
 					$message = '['.$message.']';
@@ -150,7 +153,7 @@
 
 		// HTML link to ticket
 		$tracker = new tracker_tracking($this->bo);
-		$array['tr_link'] = html::a_href($array['tr_summary'], $tracker->get_link($array, array()));
+		$array['tr_link'] = Api\Html::a_href($array['tr_summary'], $tracker->get_link($array, array()));
 
 		// Set any missing custom fields, or the marker will stay
 		foreach(array_keys($this->bo->customfields) as $name)
@@ -164,7 +167,7 @@
 		// Timesheet time
 		if(strpos($content, 'tr_sum_timesheets'))
 		{
-			$links = egw_link::get_links('tracker',$id,'timesheet');
+			$links = Link::get_links('tracker',$id,'timesheet');
 			$sum = ExecMethod('timesheet.timesheet_bo.sum',$links);
 			$info['$$tr_sum_timesheets$$'] = $sum['duration'];
 		}
@@ -229,10 +232,10 @@
 				$reply['reply_message'] = '['.$reply['reply_message'].']';
 			}
 			$this->comment_cache[$tr_id][] = array(
-				'$$comment/date$$' => egw_time::to($reply['reply_created']),
+				'$$comment/date$$' => Api\DateTime::to($reply['reply_created']),
 				'$$comment/message$$' => $reply['reply_message'],
 				'$$comment/restricted$$' => $reply['reply_visible'] ? ('[' .lang('restricted comment').']') : '',
-				'$$comment/user$$' => common::grab_owner_name($reply['reply_creator'])
+				'$$comment/user$$' => Api\Accounts::username($reply['reply_creator'])
 			);
 			if($reply['reply_creator'] == $tracker['tr_creator'] && !$last_creator_comment) $last_creator_comment = $reply;
 			if(is_array($tracker['tr_assigned']) && in_array($reply['reply_creator'], $tracker['tr_assigned']) && !$last_assigned_comment) $last_assigned_comment = $reply;
@@ -241,10 +244,10 @@
 		// Special comments
 		foreach(array('' => $replies[0], '/creator' => $last_creator_comment, '/assigned_to' => $last_assigned_comment) as $key => $comment) {
 			$this->comment_cache[$tr_id][-1][$key] = array(
-				'$$comment/-1'.$key.'/date$$' => $comment ? egw_time::to($comment['reply_created']) : '',
+				'$$comment/-1'.$key.'/date$$' => $comment ? Api\DateTime::to($comment['reply_created']) : '',
 				'$$comment/-1'.$key.'/message$$' => $comment['reply_message'],
 				'$$comment/-1'.$key.'/restricted$$' => $comment['reply_visible'] ? ('[' .lang('restricted comment').']') : '',
-				'$$comment/-1'.$key.'/user$$' => $comment ? common::grab_owner_name($comment['reply_creator']) : ''
+				'$$comment/-1'.$key.'/user$$' => $comment ? Api\Accounts::username($comment['reply_creator']) : ''
 			);
 		}
 
@@ -273,7 +276,7 @@
 	{
 		$GLOBALS['egw_info']['flags']['app_header'] = lang('tracker').' - '.lang('Replacements for inserting entries into documents');
 		$GLOBALS['egw_info']['flags']['nonavbar'] = false;
-		common::egw_header();
+		$GLOBALS['egw']->framework->header();
 
 		echo "<table width='90%' align='center'>\n";
 		echo '<tr><td colspan="4"><h3>'.lang('Tracker fields:')."</h3></td></tr>";
@@ -351,6 +354,6 @@
 
 		echo "</table>\n";
 
-		common::egw_footer();
+		$GLOBALS['egw']->framework->footer();
 	}
 }

Modified: trunk/tracker/inc/class.tracker_so.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_so.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_so.inc.php (original)
+++ trunk/tracker/inc/class.tracker_so.inc.php Thu May  5 20:34:45 2016
@@ -10,10 +10,12 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+
 /**
  * Storage Object of the tracker
  */
-class tracker_so extends so_sql_cf
+class tracker_so extends Api\Storage
 {
 	/**
 	 * Table-name of the main tracker table
@@ -393,7 +395,7 @@
 		$stati = ExecMethod('tracker.tracker_bo.get_tracker_stati', $tracker);
 		foreach($stati as $stati_id => $stati_label)
 		{
-			$data = categories::id2name($stati_id, 'data');
+			$data = Api\Categories::id2name($stati_id, 'data');
 			if($data['closed']) $custom_closed[] = $stati_id;
 		}
 		$not_closed = substr(self::SQL_NOT_CLOSED,0,-1) . ' AND tr_status != \'' . implode('\' AND tr_status != \'', $custom_closed) . '\')';

Modified: trunk/tracker/inc/class.tracker_tracking.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_tracking.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_tracking.inc.php (original)
+++ trunk/tracker/inc/class.tracker_tracking.inc.php Thu May  5 20:34:45 2016
@@ -10,10 +10,12 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+
 /**
  * Tracker - tracking object for the tracker
  */
-class tracker_tracking extends bo_tracking
+class tracker_tracking extends Api\Storage\Tracking
 {
 	/**
 	 * Application we are tracking (required!)
@@ -260,7 +262,7 @@
 	}
 
 	/**
-	 * Get the subject for a given entry, reimplementation for get_subject in bo_tracking
+	 * Get the subject for a given entry, reimplementation for get_subject in Api\Storage\Tracking
 	 *
 	 * Default implementation uses the link-title
 	 *
@@ -330,7 +332,7 @@
 			error_log($error);
 			return parent::get_body($html_email,$data,$old,$integrate_link,$receiver)."\n".$notification['signature'];
 		}
-		return $html_email ? $message : translation::convertHTMLToText(html::purify($message), false, true, true);
+		return $html_email ? $message : Api\Mail\Html::convertHTMLToText(Api\Html::purify($message), false, true, true);
 	}
 
 	/**
@@ -361,12 +363,12 @@
 		if (!$data['tr_modified'] || !$old)
 		{
 			$r[] = lang('New ticket submitted by %1 at %2',
-				common::grab_owner_name($data['tr_creator']),
+				Api\Accounts::username($data['tr_creator']),
 				$this->datetime($data['tr_created_servertime']));
 			return $r;
 		}
 		$r[] = lang('Ticket modified by %1 at %2',
-			$data['tr_modifier'] ? common::grab_owner_name($data['tr_modifier']) : lang('Tracker'),
+			$data['tr_modifier'] ? Api\Accounts::username($data['tr_modifier']) : lang('Tracker'),
 			$this->datetime($data['tr_modified_servertime']));
 		return $r;
 	}
@@ -394,7 +396,7 @@
 		{
 			foreach($data['tr_assigned'] as $uid)
 			{
-				$assigned[] = common::grab_owner_name($uid);
+				$assigned[] = Api\Accounts::username($uid);
 			}
 			$assigned = implode(', ',$assigned);
 		}
@@ -417,7 +419,7 @@
 			'tr_resolution'  => lang($resolutions[$data['tr_resolution']]),
 			'tr_completion'  => (int)$data['tr_completion'].'%',
 			'tr_priority'    => lang($priorities[$data['tr_priority']]),
-			'tr_creator'     => common::grab_owner_name($data['tr_creator']),
+			'tr_creator'     => Api\Accounts::username($data['tr_creator']),
 			'tr_created'     => $this->datetime($data['tr_created']),
 			'tr_assigned'	 => !$data['tr_assigned'] ? lang('Not assigned') : $assigned,
 			'tr_cc'			 => $data['tr_cc'],
@@ -427,7 +429,7 @@
 		);
 
 		// Don't show start date / due date if disabled or not set
-		$config = config::read('tracker');
+		$config = Api\Config::read('tracker');
 		if(!$config['show_dates'])
 		{
 			unset($detail_fields['tr_startdate']);
@@ -456,7 +458,7 @@
 			foreach($data['replies'] as $n => $reply)
 			{
 				$details[$n ? 2*$n : 'replies'] = array(	// first reply need to be checked against old to marked modified for new
-					'value' => lang('Comment by %1 at %2:',$reply['reply_creator'] ? common::grab_owner_name($reply['reply_creator']) : lang('Tracker'),
+					'value' => lang('Comment by %1 at %2:',$reply['reply_creator'] ? Api\Accounts::username($reply['reply_creator']) : lang('Tracker'),
 						$this->datetime($reply['reply_servertime'])),
 					'type'  => 'reply',
 				);

Modified: trunk/tracker/inc/class.tracker_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_ui.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_ui.inc.php (original)
+++ trunk/tracker/inc/class.tracker_ui.inc.php Thu May  5 20:34:45 2016
@@ -9,6 +9,13 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
 
 /**
  * User Interface of the tracker
@@ -59,7 +66,7 @@
 		// read the duration format from project-manager
 		if ($GLOBALS['egw_info']['apps']['projectmanager'])
 		{
-			$pm_config = config::read('projectmanager');
+			$pm_config = Api\Config::read('projectmanager');
 			$this->duration_format = str_replace(',','',implode('', (array)$pm_config['duration_units'])).','.$pm_config['hours_per_workday'];
 			unset($pm_config);
 		}
@@ -132,10 +139,10 @@
 			// edit or new?
 			if ((int)$_GET['tr_id'])
 			{
-				$own_referer = common::get_referer();
+				$own_referer = Api\Header\Referer::get();
 				if (!$this->read($_GET['tr_id']))
 				{
-					egw_framework::window_close(lang('Tracker item not found !!!'));
+					Framework::window_close(lang('Tracker item not found !!!'));
 				}
 				else
 				{
@@ -160,7 +167,7 @@
 					{
 						if (!($this->htmledit || $this->data['tr_edit_mode'] == 'html')|| (strlen($reply['reply_message'])==strlen(strip_tags($reply['reply_message'])))) //(stripos($reply['reply_message'], '<br') === false && stripos($reply['reply_message'], '<p>') === false))
 						{
-							$reply['reply_message'] = html::htmlspecialchars($reply['reply_message']);
+							$reply['reply_message'] = Api\Html::htmlspecialchars($reply['reply_message']);
 						}
 					}
 				}
@@ -175,7 +182,7 @@
 			if (!$this->data['tr_id'])
 			{
 				$regardInInit = array();
-				if (($state = egw_session::appsession('index','tracker'.
+				if (($state = Api\Cache::getSession('tracker','index'.
 					(isset($this->trackers[(int)$_GET['only_tracker']]) ? '-'.$_GET['only_tracker'] : ''))))
 				{
 					$this->data['tr_tracker'] = $regardInInit['tr_tracker'] = $state['col_filter']['tr_tracker'] ? $state['col_filter']['tr_tracker'] : $this->data['tr_tracker'];
@@ -202,7 +209,7 @@
 				if ($popup)
 				{
 					$GLOBALS['egw']->framework->render('<h1 style="color: red;">'.$msg."</h1>\n",null,true);
-					common::egw_exit();
+					exit();
 				}
 				else
 				{
@@ -244,7 +251,7 @@
 				if ($popup)
 				{
 					$GLOBALS['egw']->framework->render('<h1 style="color: red;">'.$msg."</h1>\n",null,false);
-					common::egw_exit();
+					exit();
 				}
 				else
 				{
@@ -303,8 +310,8 @@
 					if ($ret === false)
 					{
 						$msg = lang('Nothing to save.');
-						$state = egw_session::appsession('index','tracker');
-						egw_framework::refresh_opener($msg,'tracker',$this->data['tr_id'],'edit');
+						$state = Api\Cache::getSession('tracker', 'index');
+						Framework::refresh_opener($msg,'tracker',$this->data['tr_id'],'edit');
 
 						// only change to current tracker, if not all trackers displayed
 						($state['col_filter']['tr_tracker'] ? '&tracker='.$this->data['tr_tracker'] : '')."';";
@@ -313,7 +320,7 @@
 					{
 						$msg .= ($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' => 'tracker.tracker_ui.edit',
 									'tr_id'    => $this->data['tr_id'],
 									//'referer'    => $referer,
@@ -335,18 +342,18 @@
 
 							if ($cat['parent'] == $this->data['tr_tracker'] && $data['type'] != 'tracker' && $data['type']=='project')
 							{
-								if (!egw_link::get_link('tracker',$this->data['tr_id'],'projectmanager',$data['projectlist']))
+								if (!Link::get_link('tracker',$this->data['tr_id'],'projectmanager',$data['projectlist']))
 								{
-									egw_link::link('tracker',$this->data['tr_id'],'projectmanager',$data['projectlist']);
+									Link::link('tracker',$this->data['tr_id'],'projectmanager',$data['projectlist']);
 								}
 							}
 						}
 						if (is_array($content['link_to']['to_id']) && count($content['link_to']['to_id']))
 						{
-							egw_link::link('tracker',$this->data['tr_id'],$content['link_to']['to_id']);
+							Link::link('tracker',$this->data['tr_id'],$content['link_to']['to_id']);
 
 							// check if we have dragged in images and fix their image urls
-							if (etemplate_widget_vfs::fix_html_dragins('tracker', $this->data['tr_id'],
+							if (Etemplate\Widget\Vfs::fix_html_dragins('tracker', $this->data['tr_id'],
 								$content['link_to']['to_id'], $content['tr_description']))
 							{
 								$this->update(array(
@@ -354,8 +361,8 @@
 								));
 							}
 						}
-						$state = egw_session::appsession('index','tracker');
-						egw_framework::refresh_opener($msg, 'tracker',$this->data['tr_id'],'edit');
+						$state = Api\Cache::getSession('tracker', 'index');
+						Framework::refresh_opener($msg, 'tracker',$this->data['tr_id'],'edit');
 					}
 					else
 					{
@@ -371,14 +378,14 @@
 				case 'cancel':
 					if ($popup)
 					{
-						egw_framework::window_close();
-						common::egw_exit();
+						Framework::window_close();
+						exit();
 					}
 					unset($_GET['tr_id']);	// in case it's still set
 					if($own_referer && strpos($own_referer,'cd=yes') === false)
 					{
 						// Go back to where you came from
-						egw::redirect_link($own_referer);
+						Egw::redirect_link($own_referer);
 					}
 					return $this->index(null,$this->data['tr_tracker'],$msg);
 
@@ -388,7 +395,7 @@
 						$msg = lang('Thank you for voting.');
 						if ($popup)
 						{
-							egw_framework::refresh_opener($msg, 'tracker',$this->data['tr_id'], 'edit');
+							Framework::refresh_opener($msg, 'tracker',$this->data['tr_id'], 'edit');
 						}
 					}
 					break;
@@ -452,7 +459,7 @@
 									if ($this->save_bounty($this->data['bounties'][$n]))
 									{
 										$msg = lang('Bounty confirmed');
-										egw_framework::refresh_opener($msg, 'tracker',$this->data['tr_id'], 'edit');
+										Framework::refresh_opener($msg, 'tracker',$this->data['tr_id'], 'edit');
 									}
 									else
 									{
@@ -574,7 +581,7 @@
 									'field'	=> 'tr_tracker',
 									'source'=> $this->trackers
 								),
-								categories::id2name($infolog['info_cat']) => array(
+								Api\Categories::id2name($infolog['info_cat']) => array(
 									'field'	=> 'cat_id',
 									'source'=> $this->get_tracker_labels('cat',$tracker)
 								)
@@ -600,22 +607,22 @@
 							}
 
 							// Copy infolog's links
-							foreach(egw_link::get_links('infolog',$link_id) as $copy_link)
+							foreach(Link::get_links('infolog',$link_id) as $copy_link)
 							{
-								egw_link::link('tracker', $content['link_to']['to_id'], $copy_link['app'], $copy_link['id'],$copy_link['remark']);
+								Link::link('tracker', $content['link_to']['to_id'], $copy_link['app'], $copy_link['id'],$copy_link['remark']);
 							}
 							break;
 
 					}
 					// Copy same custom fields
-					$_cfs = config::get_customfields('tracker');
-					$link_app_cfs = config::get_customfields($link_app);
+					$_cfs = Api\Storage\Customfields::get('tracker');
+					$link_app_cfs = Api\Storage\Customfields::get($link_app);
 					foreach($_cfs as $name => $settings)
 					{
 						unset($settings);
 						if($link_app_cfs[$name]) $content['#'.$name] = $app_entry['#'.$name];
 					}
-					egw_link::link('tracker',$content['link_to']['to_id'],$link_app,$link_id);
+					Link::link('tracker',$content['link_to']['to_id'],$link_app,$link_id);
 				}
 			}
 		}
@@ -630,7 +637,7 @@
 		}
 		if ($content['tr_creator'] && !isset($creators[$content['tr_creator']]))
 		{
-			$creators[$content['tr_creator']] = common::grab_owner_name($content['tr_creator']);
+			$creators[$content['tr_creator']] = Api\Accounts::username($content['tr_creator']);
 		}
 
 		// Comment visibility
@@ -674,10 +681,10 @@
 			'add_comment' => !$tr_id || $readonlys['reply_message'],
 			'history'  => !$tr_id,
 			'bounties' => !$this->allow_bounties,
-			'custom'   => !config::get_customfields('tracker', false, $content['tr_tracker']),
+			'custom'   => !Api\Storage\Customfields::get('tracker', false, $content['tr_tracker']),
 		);
 		// Make link_to readonly if the user has no EDIT access
-		$readonlys['link_to'] = !$this->file_access($tr_id, EGW_ACL_EDIT);
+		$readonlys['link_to'] = !$this->file_access($tr_id, Acl::EDIT);
 
 		if ($tr_id && $readonlys['reply_message'])
 		{
@@ -716,7 +723,7 @@
 		$what = ($tracker && isset($this->trackers[(is_array($tracker)?$tracker[0]:$tracker)]) ? $this->trackers[(is_array($tracker)?$tracker[0]:$tracker)] : lang('Tracker'));
 		$GLOBALS['egw_info']['flags']['app_header'] = $tr_id ? lang('Edit %1',$what) : lang('New %1',$what);
 
-		$tpl = new etemplate_new('tracker.edit');
+		$tpl = new Etemplate('tracker.edit');
 		// use a type-specific template (tracker.edit.xyz), if one exists, otherwise fall back to the generic one
 		if (!$tpl->read('tracker.edit'.(isset($this->trackers[(is_array($tracker)?$tracker[0]:$tracker)])?'.'.trim($this->trackers[(is_array($tracker)?$tracker[0]:$tracker)]):'')))
 		{
@@ -751,7 +758,7 @@
 	 * @param array $query with keys 'start', 'search', 'order', 'sort', 'col_filter'
 	 *	For other keys like 'filter', 'cat_id' you have to reimplement this method in a derived class.
 	 * @param array &$rows returned rows/competitions
-	 * @param array &$readonlys eg. to disable buttons based on acl
+	 * @param array &$readonlys eg. to disable buttons based on Acl
 	 * @return int total number of rows
 	 */
 	function get_rows(&$query_in,&$rows,&$readonlys)
@@ -762,7 +769,7 @@
 		$query = $query_in;
 		if (!$query['csv_export'])	// do not store query for csv-export in session
 		{
-			egw_session::appsession($query['session_for'] ? $query['session_for'] : 'index','tracker'.($query_in['only_tracker'] ? '-'.$query_in['only_tracker'] : ''),$query);
+			Api\Cache::setSession('tracker',$query['session_for'] ? $query['session_for'] : 'index'.($query_in['only_tracker'] ? '-'.$query_in['only_tracker'] : ''),$query);
 		}
 		// save the state of the index page (filters) in the user prefs
 		// need to save state, before resolving diverse col-filters, eg. to all group-members or sub-cats
@@ -819,7 +826,7 @@
 				$id = $link['id'];
 			}
 			if(!is_array($id)) $id = explode(',',$id);
-			if (!($linked = egw_link::get_links_multiple($app,$id,true,'tracker')))
+			if (!($linked = Link::get_links_multiple($app,$id,true,'tracker')))
 			{
 				$rows = array();	// no entries linked to selected link --> no rows to return
 				$this->get_rows_options($rows, $tracker);
@@ -834,7 +841,7 @@
 			$links[$key] = array_unique($links[$key]);
 			if($key == 'linked')
 			{
-				$linked = array('app' => $app, 'id' => $id, 'title' => (count($id) == 1 ? egw_link::title($app, $id) : lang('multiple')));
+				$linked = array('app' => $app, 'id' => $id, 'title' => (count($id) == 1 ? Link::title($app, $id) : lang('multiple')));
 			}
 		}
 		if(count($links))
@@ -918,7 +925,7 @@
 			if (isset($GLOBALS['egw_info']['user']['apps']['timesheet']))
 			{
 				unset($links);
-				if (($links = egw_link::get_links('tracker',$row['tr_id'])) &&
+				if (($links = Link::get_links('tracker',$row['tr_id'])) &&
 					isset($GLOBALS['egw_info']['user']['apps']['timesheet']))
 				{
 					// loop through all links of the entries
@@ -1045,10 +1052,10 @@
 		if ((int)$data['id'] && ($ticket = $this->read($data['id'])))
 		{
 			//error_log(__METHOD__.__LINE__.$this->exclude_app_on_timesheetcreation);
-			foreach(egw_link::get_links('tracker',$ticket['tr_id'],'','link_lastmod DESC',true) as $link)
-			{
-				//if ($link['app'] != 'timesheet' && $link['app'] != egw_link::VFS_APPNAME)
-				if (stripos($this->exclude_app_on_timesheetcreation.','.'timesheet'.','.egw_link::VFS_APPNAME,$link['app'])===false)
+			foreach(Link::get_links('tracker',$ticket['tr_id'],'','link_lastmod DESC',true) as $link)
+			{
+				//if ($link['app'] != 'timesheet' && $link['app'] != Link::VFS_APPNAME)
+				if (stripos($this->exclude_app_on_timesheetcreation.','.'timesheet'.','.Link::VFS_APPNAME,$link['app'])===false)
 				{
 					$set['link_app'][] = $link['app'];
 					$set['link_id'][]  = $link['id'];
@@ -1077,7 +1084,7 @@
 			'info_contact' => 'tracker:'.$tracker['tr_id'],
 		);
 		// copy links
-		foreach(egw_link::get_links('tracker',$tracker['tr_id'],'','link_lastmod DESC',true) as $link)
+		foreach(Link::get_links('tracker',$tracker['tr_id'],'','link_lastmod DESC',true) as $link)
 		{
 			$set['link_app'][] = $link['app'];
 			$set['link_id'][]  = $link['id'];
@@ -1090,7 +1097,7 @@
 			}
 		}
 		// copy same named customfields
-		foreach(config::get_customfields('infolog') as $name => $nul)
+		foreach(Api\Storage\Customfields::get('infolog') as $name => $nul)
 		{
 			unset($nul);
 			if(array_key_exists('#'.$name, $tracker))
@@ -1171,7 +1178,7 @@
 			// if there is no tracker specified, try the tracker submitted
 			if (!$tracker && (int)$_GET['tracker']) $tracker = $_GET['tracker'];
 			// if there is still no tracker, use the last tracker that was applied and saved to/with the view with the appsession
-			if (!$tracker && ($state=egw_session::appsession('index','tracker'.($only_tracker ? '-'.$only_tracker : ''))))
+			if (!$tracker && ($state=  Api\Cache::getSession('tracker','index'.($only_tracker ? '-'.$only_tracker : ''))))
 			{
 			      $tracker=$state['col_filter']['tr_tracker'];
 			}
@@ -1272,7 +1279,7 @@
 		}
 
 		if (!is_array($content)) $content = array();
-		$content['nm'] = egw_session::appsession($this->called_by ? $this->called_by : 'index', 'tracker'.($only_tracker ? '-'.$only_tracker : ''));
+		$content['nm'] = Api\Cache::getSession('tracker', $this->called_by ? $this->called_by : 'index'.($only_tracker ? '-'.$only_tracker : ''));
 		$content['msg'] = $msg;
 		$content['status_help'] = !$this->pending_close_days ? lang('Pending items never get close automatic.') :
 				lang('Pending items will be closed automatic after %1 days without response.',$this->pending_close_days);
@@ -1369,7 +1376,7 @@
 		$content['is_admin'] = $this->is_admin($tracker);
 		//_debug_array($content);
 		$readonlys['add'] = $readonlys['nm']['add'] = !$this->check_rights($this->field_acl['add'],$tracker,null,null,'add');
-		$tpl = new etemplate_new();
+		$tpl = new Etemplate();
 		if (!$tpl->sitemgr || !$tpl->read('tracker.index.sitemgr'))
 		{
 			$tpl->read('tracker.index');
@@ -1378,7 +1385,7 @@
 		// Apply link / avoid DOM conflicts
 		if($this->called_by)
 		{
-			$content['nm'] = array_merge($content['nm'], egw_session::appsession($this->called_by,'tracker'));
+			$content['nm'] = array_merge($content['nm'], Api\Cache::getSession('tracker', $this->called_by));
 			$tpl->set_dom_id("{$tpl->name}-{$this->called_by}");
 		}
 
@@ -1394,14 +1401,14 @@
 			$tpl->disable_cells('use_all', true);
 		}
 
-		// Show only own groups in group popup if queue acl
+		// Show only own groups in group popup if queue Acl
 		if($this->enabled_queue_acl_access)
 		{
 			$group = explode(',',$tpl->get_cell_attribute('group', 'size'));
 			$group[1] = 'owngroups';
 			$tpl->set_cell_attribute('group', 'size', implode(',',$group));
 		}
-		egw_framework::validate_file('.','app','tracker');
+		Framework::includeJS('.','app','tracker');
 		// add scrollbar to long description, if user choose so in his prefs
 		/* @kl: why is an if used, if it is effectily commented by a semicolon?
 		if ($this->prefs['limit_des_lines'] > 0 || (string)$this->prefs['limit_des_lines'] == '');
@@ -1443,9 +1450,9 @@
 				'default' => true,
 				'allowOnMultiple' => false,
 				'url' => 'menuaction=tracker.tracker_ui.edit&tr_id=$id',
-				'popup' => egw_link::get_registry('tracker', 'add_popup'),
+				'popup' => Link::get_registry('tracker', 'add_popup'),
 				'group' => $group=1,
-				'onExecute' => html::$ua_mobile?'javaScript:app.tracker.viewEntry':''
+				'onExecute' => Api\Header\UserAgent::mobile()?'javaScript:app.tracker.viewEntry':''
 			),
 			'print' => array(
 				'caption' => 'Print',
@@ -1458,7 +1465,7 @@
 				'caption' => 'Add',
 				'group' => $group,
 				'url' => 'menuaction=tracker.tracker_ui.edit',
-				'popup' => egw_link::get_registry('tracker', 'add_popup'),
+				'popup' => Link::get_registry('tracker', 'add_popup'),
 				'hideOnMobile' => true
 			),
 			'no_notifications' => array(
@@ -1583,7 +1590,7 @@
 				'url' => 'menuaction=timesheet.timesheet_ui.edit&link_app[]=tracker&link_id[]=$id',
 				'group' => $group,
 				'allowOnMultiple' => false,
-				'popup' => egw_link::get_registry('timesheet', 'add_popup'),
+				'popup' => Link::get_registry('timesheet', 'add_popup'),
 			);
 		}
 		if ($GLOBALS['egw_info']['user']['apps']['infolog'] && $this->allow_infolog)
@@ -1594,7 +1601,7 @@
 				'url' => 'menuaction=infolog.infolog_ui.edit&action=tracker&action_id=$id',
 				'group' => $group,
 				'allowOnMultiple' => false,
-				'popup' => egw_link::get_registry('infolog', 'add_popup'),
+				'popup' => Link::get_registry('infolog', 'add_popup'),
 			);
 		}
 
@@ -1619,7 +1626,7 @@
 		if (!is_array($mailContent) && ($_GET['egw_data']))
 		{
 			// get the mail raw data
-			egw_link::get_data ($_GET['egw_data']);
+			Link::get_data ($_GET['egw_data']);
 			return false;
 		}
 		// Wrap a pre tag if we are using html editor
@@ -1653,7 +1660,7 @@
 		if ($use_all)
 		{
 			// get the whole selection
-			$query = is_array($session_name) ? $session_name : $GLOBALS['egw']->session->appsession($session_name,'tracker');
+			$query = is_array($session_name) ? $session_name : Api\Cache::getSession('tracker', $session_name);
 
 			if ($use_all)
 			{
@@ -1802,7 +1809,7 @@
 						break;
 					}
 					error_log("APp: $app ID: $link_id");
-					$title = egw_link::title($app, $link_id);
+					$title = Link::title($app, $link_id);
 					foreach($checked as $id)
 					{
 						if (!$this->read($id))
@@ -1813,7 +1820,7 @@
 						if($add_remove == 'add')
 						{
 							$action_msg = lang('linked to %1', $title);
-							if(egw_link::link('tracker', $id, $app, $link_id))
+							if(Link::link('tracker', $id, $app, $link_id))
 							{
 								$success++;
 							}
@@ -1825,7 +1832,7 @@
 						else
 						{
 							$action_msg = lang('unlinked from %1', $title);
-							$count = egw_link::unlink(0, 'tracker', $id, '', $app, $link_id);
+							$count = Link::unlink(0, 'tracker', $id, '', $app, $link_id);
 							$success += $count;
 						}
 					}
@@ -1849,7 +1856,7 @@
 	 */
 	public function ajax_canned_comment($id, $ckeditor=true)
 	{
-		$response = egw_json_response::get();
+		$response = Api\Json\Response::get();
 
 		if($ckeditor)
 		{
@@ -1870,7 +1877,7 @@
 	 * @param $args['view_id']  name of the id-var for location == 'infolog'
 	 * @param $args[$args['view_id']] id of the entry
 	 * this function can be called for any app, which should include infolog: \
-	 * 	$GLOBALS['egw']->hooks->process(array( \
+	 * 	Api\Hooks::process(array( \
 	 * 		 * 'location' => 'infolog', \
 	 * 		 * 'app'      => <your app>, \
 	 * 		 * 'view_id'  => <id name>, \
@@ -1881,7 +1888,7 @@
 	public function hook_view($args)
 	{
 		// Load JS for tracker actions
-		egw_framework::validate_file('.','app','tracker');
+		Framework::includeJS('.','app','tracker');
 
 		switch ($args['location'])
 		{
@@ -1891,7 +1898,7 @@
 				// Just set the filter
 				$state['action'] = $app;
 				$state['action_id'] = $args[$view_id];
-				egw_session::appsession($app,'tracker',$state);
+				Api\Cache::setSession('tracker', $app, $state);
 				break;
 		}
 		if (!isset($app) || !isset($args[$view_id]))
@@ -1903,7 +1910,7 @@
 		// Set to calling app, so actions wind up in the correct place client side
 		$GLOBALS['egw_info']['flags']['currentapp'] = $app;
 
-		translation::add_app('tracker');
+		Api\Translation::add_app('tracker');
 
 		$this->index(null);
 	}

Modified: trunk/tracker/inc/class.tracker_widget.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_widget.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_widget.inc.php (original)
+++ trunk/tracker/inc/class.tracker_widget.inc.php Thu May  5 20:34:45 2016
@@ -10,6 +10,9 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Etemplate;
+
 /**
  * eTemplate extension: Tracker widget
  *
@@ -21,7 +24,7 @@
  * 3) colon (:) separted list of alternative fields: the first non-empty one is used if the selected value is empty
  * There's a special field "sum" in 1), which sums up all fields given in alternatives.
  */
-class tracker_widget extends etemplate_widget_entry
+class tracker_widget extends Etemplate\Widget\Entry
 {
 
 	/**
@@ -153,7 +156,7 @@
 		switch($cell['type'])
 		{
 			case 'tracker-fields':
-				translation::add_app('addressbook');
+				Api\Translation::add_app('addressbook');
 				$cell['sel_options'] = $this->_get_fields();
 				$cell['type'] = 'select';
 				$cell['no_lang'] = 1;
@@ -298,7 +301,7 @@
 		$fileds['tr_modified'] = 'Modified';
 		$fileds['tr_modifier'] = 'Modifier';
 
-		foreach(config::get_customfields('tracker') as $name => $data)
+		foreach(Api\Storage\Customfields::get('tracker') as $name => $data)
 		{
 			$fields['#'.$name] = lang($data['label']);
 		}

Modified: trunk/tracker/inc/class.tracker_wizard_export_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_wizard_export_csv.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_wizard_export_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_wizard_export_csv.inc.php Thu May  5 20:34:45 2016
@@ -9,6 +9,8 @@
  * @author Nathan Gray
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 class tracker_wizard_export_csv extends importexport_wizard_basic_export_csv
 {
@@ -46,7 +48,7 @@
 		);
 
 		// Custom fields
-		$custom = config::get_customfields('tracker', true);
+		$custom = Api\Storage\Customfields::get('tracker', true);
 		foreach($custom as $name => $data) {
 			$this->export_fields['#'.$name] = $data['label'];
 		}

Modified: trunk/tracker/inc/class.tracker_wizard_import_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_wizard_import_csv.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_wizard_import_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_wizard_import_csv.inc.php Thu May  5 20:34:45 2016
@@ -9,6 +9,8 @@
  * @author Nathan Gray
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 class tracker_wizard_import_csv extends importexport_wizard_basic_import_csv
 {
@@ -58,7 +60,7 @@
 		);
 
 		// List each custom field
-		$custom = config::get_customfields('tracker');
+		$custom = Api\Storage\Customfields::get('tracker');
 		foreach($custom as $name => $data) {
 			$this->mapping_fields['#'.$name] = $data['label'];
 		}

Modified: trunk/tracker/setup/default_records.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/setup/default_records.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/setup/default_records.inc.php (original)
+++ trunk/tracker/setup/default_records.inc.php Thu May  5 20:34:45 2016
@@ -10,6 +10,8 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 // create some example trackers and global versions and cats
 foreach(array(
@@ -42,7 +44,7 @@
 		$data = serialize(array('type' => $type,'isdefault'=>true));
 	}
 	$GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table,array(
-		'cat_owner'  => categories::GLOBAL_ACCOUNT,
+		'cat_owner'  => Api\Categories::GLOBAL_ACCOUNT,
 		'cat_access' => 'public',
 		'cat_appname'=> 'tracker',
 		'cat_name'   => $name,

Modified: trunk/tracker/setup/tables_update.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/setup/tables_update.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/setup/tables_update.inc.php (original)
+++ trunk/tracker/setup/tables_update.inc.php Thu May  5 20:34:45 2016
@@ -10,6 +10,8 @@
  * @subpackage setup
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 function tracker_upgrade0_1_005()
 {
@@ -475,7 +477,7 @@
 	//echo "Updating resolutions...<br />"; flush();
 	foreach($resolutions as $code => $name) {
 		$GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table,array(
-			'cat_owner'  => categories::GLOBAL_ACCOUNT,
+			'cat_owner'  => Api\Categories::GLOBAL_ACCOUNT,
 			'cat_access' => 'public',
 			'cat_appname'=> 'tracker',
 			'cat_name'   => $name,
@@ -522,23 +524,23 @@
 		'uc' => array()
 	));
 
-	return $GLOBALS['setup_info']['tracker']['currentver'] = '1.9.003';	// we already use categories::GLOBAL_ACCOUNT
-}
-
-
-/**
- * Fix tracker global categories / resolutions created by 1.9.001 update, with wrong cat_onwer=-1
+	return $GLOBALS['setup_info']['tracker']['currentver'] = '1.9.003';	// we already use Api\Categories::GLOBAL_ACCOUNT
+}
+
+
+/**
+ * Fix tracker global Api\Categories / resolutions created by 1.9.001 update, with wrong cat_onwer=-1
  */
 function tracker_upgrade1_9_002()
 {
 	$GLOBALS['egw_setup']->db->update($GLOBALS['egw_setup']->cats_table,array(
-		'cat_owner'  => categories::GLOBAL_ACCOUNT,
+		'cat_owner'  => Api\Categories::GLOBAL_ACCOUNT,
 	),array(
 		'cat_owner'  => -1,
 		'cat_appname'=> 'tracker',
 	),__LINE__,__FILE__);
 
-	return $GLOBALS['setup_info']['tracker']['currentver'] = '1.9.003';	// we already use categories::GLOBAL_ACCOUNT
+	return $GLOBALS['setup_info']['tracker']['currentver'] = '1.9.003';	// we already use Api\Categories::GLOBAL_ACCOUNT
 }
 
 function tracker_upgrade1_9_003()

Modified: trunk/tracker/sitemgr/class.module_tracker_add.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/sitemgr/class.module_tracker_add.inc.php?rev=56043&r1=56042&r2=56043&view=diff
==============================================================================
--- trunk/tracker/sitemgr/class.module_tracker_add.inc.php (original)
+++ trunk/tracker/sitemgr/class.module_tracker_add.inc.php Thu May  5 20:34:45 2016
@@ -9,6 +9,8 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 require_once(EGW_INCLUDE_ROOT.'/etemplate/inc/class.sitemgr_module.inc.php');
 


------------------------------------------------------------------------------
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