Index: sandbox/workflow/branches/993/lib/settings/Settings.php
===================================================================
--- sandbox/workflow/branches/993/lib/settings/Settings.php	(revision 2552)
+++ sandbox/workflow/branches/993/lib/settings/Settings.php	(revision 3172)
@@ -254,4 +254,5 @@
 		self::$_configs['workflow']['preferences']['ui_items_per_page'] = $GLOBALS['phpgw_info']['user']['preferences']['workflow']['ui_items_per_page'];
 		self::$_configs['workflow']['preferences']['show_activity_complete_page'] = $GLOBALS['phpgw_info']['user']['preferences']['workflow']['show_activity_complete_page'];
+		self::$_configs['workflow']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['server']['template_set'];
 
 		self::$_configs['workflow']['app']['title'] = $GLOBALS['phpgw_info']['apps']['workflow']['title'];
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_redir_menu.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_redir_menu.php	(revision 2552)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_redir_menu.php	(revision 3172)
@@ -30,5 +30,5 @@
 		$$extract = $params[$extract];
 
-    $base_url = EGW_BASAE_URL;
+    $base_url = EGW_BASE_URL;
 	$user_activities = $GLOBALS['workflow']['wf_user_activities']['data'];
 	$pid = $GLOBALS['workflow']['wf_process_id'];
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_calendar_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_calendar_init.php	(revision 2552)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_calendar_init.php	(revision 3172)
@@ -21,5 +21,5 @@
 		$path = $params['path'] . "/";
 	else
-		$path = WF_SERVER_URL . SEP . 'js' . SEP . 'jscalendar' . SEP;
+		$path = WF_BASE_URL . SEP . 'js' . SEP . 'jscalendar' . SEP;
 	$defaults = array(
 		'css' => $path . 'calendar-blue.css',
Index: sandbox/workflow/branches/993/inc/class.bo_userinterface.inc.php
===================================================================
--- sandbox/workflow/branches/993/inc/class.bo_userinterface.inc.php	(revision 2372)
+++ sandbox/workflow/branches/993/inc/class.bo_userinterface.inc.php	(revision 3172)
@@ -51,5 +51,5 @@
 	function processes()
 	{
-		$account_id = $_SESSION['phpgw_info']['workflow']['account_id'];
+		$account_id = Settings::get('expresso', 'user', 'account_id');
 		$result = $GLOBALS['ajax']->gui->gui_list_user_activities($account_id, '0', '-1', "wf_menu_path__ASC, ga.wf_name__ASC", '', '', '', true, true, true, '');
 
@@ -139,5 +139,5 @@
 	function inbox($params)
 	{
-		$preferences = $_SESSION['phpgw_info']['workflow']['user']['preferences'];
+		$preferences = Settings::get('workflow', 'preferences');
 
 		/* initialize Paging Class */
@@ -170,5 +170,5 @@
 		$pid = (int) $params['pid'];
 		$search_term = $params['search_term'];
-		$account_id = $_SESSION['phpgw_info']['workflow']['account_id'];
+		$account_id = Settings::get('expresso', 'user', 'account_id');
 		$result = $GLOBALS['ajax']->gui->gui_list_user_instances($account_id, 0, -1, $sort, $search_term, "ga.wf_is_interactive = 'y'", false, $pid, true, false, true, false, false, false);
 
@@ -328,5 +328,5 @@
 	function inbox_group()
 	{
-		$account_id = $_SESSION['phpgw_info']['workflow']['account_id'];
+		$account_id = Settings::get('expresso', 'user', 'account_id');
 		$result = $GLOBALS['ajax']->gui->gui_list_user_instances($account_id, 0, -1, 'wf_procname__ASC,wf_name__ASC', '', "ga.wf_is_interactive = 'y'", false, 0, true, false, true, false, false, false);
 
@@ -545,5 +545,5 @@
     	$show_properties = false;
 
-		$current_user_id = $_SESSION['phpgw_info']['workflow']['account_id'];
+		$current_user_id = Settings::get('expresso', 'user', 'account_id');
 
 		/* check if the current user is a process admin */
@@ -609,10 +609,10 @@
 	function instances($params)
 	{
-		$preferences = $_SESSION['phpgw_info']['workflow']['user']['preferences'];
+		$preferences = Settings::get('workflow', 'preferences');
 
 		$lightVersion = ((isset($preferences['use_light_interface']) ? $preferences['use_light_interface'] : 0) == 1);
 
 		/* get some parameters */
-		$userID = $_SESSION['phpgw_info']['workflow']['account_id'];
+		$userID = Settings::get('expresso', 'user', 'account_id');
 		$pid = (int) $params['pid'];
 		$active = ($params['active'] == 1);
@@ -721,5 +721,5 @@
 		{
 			/* paginate the result */
-			$itemsPerPage = isset($_SESSION['phpgw_info']['workflow']['user']['preferences']['ui_items_per_page']) ? $_SESSION['phpgw_info']['workflow']['user']['preferences']['ui_items_per_page'] : 15;
+			$itemsPerPage = isset($preferences['ui_items_per_page']) ? $preferences['ui_items_per_page'] : 15;
 			$paging = Factory::newInstance('Paging', $itemsPerPage, $_POST);
 			$output['instances'] = $paging->restrictItems($output['instances']);
@@ -774,5 +774,5 @@
 	private function checkOrgchartAccess()
 	{
-		$this->organizationInfo = $this->so->getUserOrganization($_SESSION['phpgw_info']['workflow']['account_id']);
+		$this->organizationInfo = $this->so->getUserOrganization(Settings::get('expresso', 'user', 'account_id'));
 		if ($this->organizationInfo === false)
 			return array('warning' => 'Você não está cadastrado em nenhuma organização');
@@ -1069,5 +1069,5 @@
 		$cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP);
 
-		$entry = $cachedLDAP->getEntryByID( $_SESSION['phpgw_info']['workflow']['account_id'] );
+		$entry = $cachedLDAP->getEntryByID(Settings::get('expresso', 'user', 'account_id'));
 		if ( $entry && ! is_null($entry['telephonenumber']) )
 			$fromNumber = $entry['telephonenumber'];
