Index: sandbox/workflow/branches/609/inc/class.bo_utils.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.bo_utils.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.bo_utils.inc.php	(revision 2323)
@@ -11,6 +11,4 @@
 
 require_once 'class.bo_ajaxinterface.inc.php';
-require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php';
-require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php';
 
 /**
Index: sandbox/workflow/branches/609/inc/class.powergraphic.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.powergraphic.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.powergraphic.inc.php	(revision 2323)
@@ -139,5 +139,5 @@
 
 
-
+require_once 'common.inc.php';
 
 $PowerGraphic = &Factory::newInstance('powergraphic');
Index: sandbox/workflow/branches/609/inc/class.workflow_processmanager.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.workflow_processmanager.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.workflow_processmanager.inc.php	(revision 2323)
@@ -5,7 +5,5 @@
 
 	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'RoleManager.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Process.php');
+
 	/**
 	 * @package Workflow
Index: sandbox/workflow/branches/609/inc/class.workflow_activitymanager.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.workflow_activitymanager.inc.php	(revision 2233)
+++ sandbox/workflow/branches/609/inc/class.workflow_activitymanager.inc.php	(revision 2323)
@@ -5,7 +5,4 @@
 
 	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'GraphViz.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'common' . SEP . 'WfSecurity.php');
 	/**
 	 * @package Workflow
Index: sandbox/workflow/branches/609/inc/class.bo_ajaxinterface.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.bo_ajaxinterface.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.bo_ajaxinterface.inc.php	(revision 2323)
@@ -36,5 +36,4 @@
 
 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'common.inc.php');
-require_once(PHPGW_API_INC . SEP . 'class.db.inc.php');
 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'class.ajax_config.inc.php');
 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'config.ajax.inc.php');
Index: sandbox/workflow/branches/609/inc/engine/src/common/WfSecurity.php
===================================================================
--- sandbox/workflow/branches/609/inc/engine/src/common/WfSecurity.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/engine/src/common/WfSecurity.php	(revision 2323)
@@ -27,10 +27,4 @@
     $this->child_name = 'WfSecurity';
     parent::Base();
-
-	/* I'm not really sure if we can strip it out. */
-
-    //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Instance.php');
-    //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Process.php');
-    //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'BaseActivity.php');
   }
 
Index: sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ProcessManager.php
===================================================================
--- sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ProcessManager.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ProcessManager.php	(revision 2323)
@@ -70,6 +70,4 @@
 		parent::BaseManager();
 		$this->child_name = 'ProcessManager';
-		require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ActivityManager.php');
-		require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'JobManager.php');
 		// $this->activity_manager is not set here to avoid objects loading object A loading object B loading object A, etc
 		//$this->role_manager will only be loaded when needed as well
Index: sandbox/workflow/branches/609/inc/class.so_orgchart.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.so_orgchart.inc.php	(revision 2233)
+++ sandbox/workflow/branches/609/inc/class.so_orgchart.inc.php	(revision 2323)
@@ -1091,4 +1091,9 @@
 		$this->_checkAccess($organizationID, false, true);
 
+		/**
+		 * This is so wrong.. We should always use the factory to
+		 * instantiate stuff. Besides, module class should not
+		 * use process classes; the correct is to do the inverse.
+		 */
 		require_once dirname(__FILE__) . '/local/classes/class.wf_orgchart.php';
 		$orgchart = new wf_orgchart();
@@ -1512,7 +1517,5 @@
 
 		/* we must query ldap to get full user names. In workflow db we just store uids */
-		$cachedLDAP = Factory::newInstance('CachedLDAP');
-
-		$cachedLDAP->getEntryByID();
+		$cachedLDAP = Factory::getInstance('CachedLDAP');
 
 		$output = $result->GetArray(-1);
Index: sandbox/workflow/branches/609/inc/class.workflow_instance.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.workflow_instance.inc.php	(revision 2233)
+++ sandbox/workflow/branches/609/inc/class.workflow_instance.inc.php	(revision 2323)
@@ -6,6 +6,4 @@
 
 	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Instance.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'common' . SEP . 'WfSecurity.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php');
 	/**
 	 * @package Workflow
Index: sandbox/workflow/branches/609/inc/class.so_userinterface.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.so_userinterface.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.so_userinterface.inc.php	(revision 2323)
@@ -593,6 +593,4 @@
 	function getEmployeeInfo($employeeID, $organizationID)
 	{
-		require_once dirname(__FILE__) . '/class.so_orgchart.inc.php';
-
 		$SOOrgchart = &Factory::getInstance('so_orgchart');
 		$SOOrgchart->setExternalCalls(true);
@@ -613,6 +611,4 @@
 	function getAreaInfo($areaID, $organizationID)
 	{
-		require_once dirname(__FILE__) . '/class.so_orgchart.inc.php';
-
 		$SOOrgchart = &Factory::getInstance('so_orgchart');
 		$SOOrgchart->setExternalCalls(true);
Index: sandbox/workflow/branches/609/inc/class.so_adminjobs.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.so_adminjobs.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.so_adminjobs.inc.php	(revision 2323)
@@ -10,6 +10,4 @@
 \**************************************************************************/
 
-require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php';
-require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php';
 
 /**
Index: sandbox/workflow/branches/609/inc/class.workflow_smarty.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.workflow_smarty.inc.php	(revision 1227)
+++ sandbox/workflow/branches/609/inc/class.workflow_smarty.inc.php	(revision 2323)
@@ -11,5 +11,4 @@
 
 require_once 'smarty/Smarty.class.php';
-//require_once 'class.ui_ajaxinterface.inc.php';
 
 /**
Index: sandbox/workflow/branches/609/inc/class.workflow_gui.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.workflow_gui.inc.php	(revision 2233)
+++ sandbox/workflow/branches/609/inc/class.workflow_gui.inc.php	(revision 2323)
@@ -5,7 +5,5 @@
 
 	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Process.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Instance.php');
-	require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'common' . SEP . 'WfSecurity.php');
+
 	/**
 	 * @package Workflow
Index: sandbox/workflow/branches/609/inc/class.bo_adminjobs.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.bo_adminjobs.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.bo_adminjobs.inc.php	(revision 2323)
@@ -11,5 +11,4 @@
 
 require_once 'class.bo_ajaxinterface.inc.php';
-require_once 'nano/JSON.php';
 
 /**
Index: sandbox/workflow/branches/609/inc/class.bo_adminsource.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.bo_adminsource.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.bo_adminsource.inc.php	(revision 2323)
@@ -11,6 +11,4 @@
 
 require_once('class.bo_ajaxinterface.inc.php');
-
-require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Process.php');
 
 /**
Index: sandbox/workflow/branches/609/inc/class.bo_orgchart.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.bo_orgchart.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.bo_orgchart.inc.php	(revision 2323)
@@ -46,5 +46,5 @@
 	{
 		parent::bo_ajaxinterface();
-		$this->so = &Factory:::getInstance('so_orgchart');
+		$this->so = &Factory::getInstance('so_orgchart');
 	}
 
Index: sandbox/workflow/branches/609/inc/class.bo_monitors.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.bo_monitors.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.bo_monitors.inc.php	(revision 2323)
@@ -11,8 +11,4 @@
 
 require_once('class.bo_ajaxinterface.inc.php');
-
-require_once('class.workflow_acl.inc.php'); /* can we remove this? */
-require_once('class.bo_adminaccess.inc.php');
-require_once('class.powergraphic.inc.php');
 
 /**
@@ -1394,7 +1390,17 @@
 
 		/* get the required configuration */
-		$BOEmailAdmin = Factory::getInstance('bo')
+		$BOEmailAdmin = Factory::getInstance('bo');
 		$profileList = $BOEmailAdmin->getProfileList();
 		$profile = $BOEmailAdmin->getProfile($profileList[0]['profileID']);
+
+		/**
+		 * XXX - XXX
+		 * It's weird.. There are two almost identical PHPMailer classes.
+		 * The class registered in our factory is under 'EGW_INC_ROOT'.
+		 * The class used here has the same name and it's under another
+		 * directory. For now, let's just include it in the old-fashion
+		 * way, but if someone, someday try to use both classes in the
+		 * same access, it could cause us troubles.
+		 */
 
 		/* configure the PHPMailer class to send the e-mails */
Index: sandbox/workflow/branches/609/inc/hook_sidebox_menu.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/hook_sidebox_menu.inc.php	(revision 2253)
+++ sandbox/workflow/branches/609/inc/hook_sidebox_menu.inc.php	(revision 2323)
@@ -14,4 +14,5 @@
  */
 
+require_once 'common.inc.php';
 require_once 'engine/config.egw.inc.php';
 
Index: sandbox/workflow/branches/609/inc/class.ui_orgchart.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.ui_orgchart.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.ui_orgchart.inc.php	(revision 2323)
@@ -1,5 +1,5 @@
 <?php
 
-	/**************************************************************************\
+/**************************************************************************\
 * eGroupWare                                                 *
 * http://www.egroupware.org                                                *
@@ -12,5 +12,5 @@
 
 require_once(dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php');
-require_once(dirname(__FILE__) . SEP . 'class.workflow_acl.inc.php');
+
 /**
  * @package Workflow
Index: sandbox/workflow/branches/609/inc/class.bo_editor.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.bo_editor.inc.php	(revision 2311)
+++ sandbox/workflow/branches/609/inc/class.bo_editor.inc.php	(revision 2323)
@@ -11,5 +11,4 @@
 
 require_once('class.bo_ajaxinterface.inc.php');
-require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php');
 /**
  * @package Workflow
