Index: sandbox/workflow/trunk/setup/default_records.inc.php
===================================================================
--- sandbox/workflow/trunk/setup/default_records.inc.php	(revision 2042)
+++ sandbox/workflow/trunk/setup/default_records.inc.php	(revision 2858)
@@ -59,5 +59,5 @@
 $GLOBALS['phpgw']->ADOdb->query("INSERT INTO phpgw_config (config_app, config_name, config_value) VALUES(?, ?, ?)", array('workflow', 'log_type_file', 'True'));
 $GLOBALS['phpgw']->ADOdb->query("INSERT INTO phpgw_config (config_app, config_name, config_value) VALUES(?, ?, ?)", array('workflow', 'log_type_firebug', 'True'));
-$GLOBALS['phpgw']->ADOdb->query("INSERT INTO phpgw_config (config_app, config_name, config_value) VALUES(?, ?, ?)", array('workflow', 'log_level', '7'));
+$GLOBALS['phpgw']->ADOdb->query("INSERT INTO phpgw_config (config_app, config_name, config_value) VALUES(?, ?, ?)", array('workflow', 'log_level', '0'));
 
 /* connect to the new database */
Index: sandbox/workflow/trunk/setup/tables_update.inc.php
===================================================================
--- sandbox/workflow/trunk/setup/tables_update.inc.php	(revision 2590)
+++ sandbox/workflow/trunk/setup/tables_update.inc.php	(revision 2858)
@@ -1238,4 +1238,8 @@
 		if (!$GLOBALS['phpgw_setup']->oProc->m_bDeltaOnly)
 		{
+			/* updating log level */
+			$values = array('0', 'workflow', 'log_level');
+			$GLOBALS['phpgw']->ADOdb->query('UPDATE phpgw_config SET config_value=? WHERE config_app=? AND config_name=?', $values);
+
 			$workflowHostInfo = extractDatabaseParameters();
 
Index: sandbox/workflow/trunk/doc/change_log.txt
===================================================================
--- sandbox/workflow/trunk/doc/change_log.txt	(revision 2590)
+++ sandbox/workflow/trunk/doc/change_log.txt	(revision 2858)
@@ -30,4 +30,5 @@
 	#869 - Indentificação do titular e substituro de áreas do organograma. (pedroerp)
 	#868 - Correção da altura das janelas de edição do organograma. (pedroerp)
+	#609 - Reconstrução da classe factory (pedroerp/rufino)
 	#441 - Inclusão do período de substituição de chefia no organograma. (pedroerp)
 
Index: sandbox/workflow/trunk/lib/factory/WorkflowFactory.php
===================================================================
--- sandbox/workflow/trunk/lib/factory/WorkflowFactory.php	(revision 2466)
+++ sandbox/workflow/trunk/lib/factory/WorkflowFactory.php	(revision 2858)
@@ -63,4 +63,5 @@
 		$this->registerFileInfo('Thread', 'class.Thread.inc.php', 'inc');
 		$this->registerFileInfo('Paging', 'class.Paging.inc.php', 'inc');
+		$this->registerFileInfo('Logger', 'class.Logger.inc.php', 'inc');
 		$this->registerFileInfo('FsUtils', 'class.fsutils.inc.php', 'inc');
 		$this->registerFileInfo('UserPictureProvider', 'class.UserPictureProvider.inc.php', 'inc');
@@ -168,4 +169,15 @@
 
 
+		/**
+		 * TODO - This is another ATR - Alternative Technical Resource (common known
+		 * as workaround) to allow instantiation of "wf" classes. Although these classes
+		 * should have not been instanciated by the workflow module, some of them are
+		 * instantiated by run_activity during every execution. =(
+		 * In a new version of MVC these objects must be created by the Processes.
+		 */
+		$this->registerFileInfo('wf_natural', 'class.wf_natural.php', 'inc/local/classes');
+		$this->registerFileInfo('wf_db', 'class.wf_db.php', 'inc/local/classes');
+
+
 		/* ok. no more instances of this class.. */
 		self::$_instantiated = true;
Index: sandbox/workflow/trunk/inc/class.run_activity.inc.php
===================================================================
--- sandbox/workflow/trunk/inc/class.run_activity.inc.php	(revision 2466)
+++ sandbox/workflow/trunk/inc/class.run_activity.inc.php	(revision 2858)
@@ -24,5 +24,5 @@
      */
 	class run_activity extends WorkflowUtils
-	{  	
+	{
 		/**
 		 * @var array  $public_functions func
@@ -50,5 +50,5 @@
 		 * @access public
 		 */
-		var $process;	
+		var $process;
 		/**
 		 * @var object $GUI  GUI engine object. Act carefully with it.
@@ -62,13 +62,13 @@
 		var $message = Array();
 		/**
-		 * @var object $categories categorie object for categories 
+		 * @var object $categories categorie object for categories
 		 * @access public
 		 */
 		var $categories;
 		/**
-		 * @var array $conf 
-		 * @access public
-		 */
-		var $conf = array();	
+		 * @var array $conf
+		 * @access public
+		 */
+		var $conf = array();
 		/**
 		 * @var $wf_template local activity template
@@ -76,10 +76,10 @@
 		 */
 		var $wf_template;
-		/** 
+		/**
 		 * @var object $instance
 		 * @access public
 		 */
 		var $instance;
-		/** 
+		/**
 		 * @var object $activity_type The type of activity
 		 * @access public
@@ -88,61 +88,61 @@
 		// then we retain all usefull vars as members, to make them avaible in user's source code
 		// theses are data which can be set before the user code and which are not likely to change because of the user code
-		/** 
-		 * @var int $process_id The process id 
+		/**
+		 * @var int $process_id The process id
 		 * @access public
 		 */
 		var $process_id;
-		/** 
-		 * @var int $activity_id The activity id 
+		/**
+		 * @var int $activity_id The activity id
 		 * @access public
 		 */
 		var $activity_id;
-		/** 
+		/**
 		 * @var int $process_name The process name
 		 * @access public
 		 */
 		var $process_name;
-		/** 
-		 * @var int $process_version The process_version 
+		/**
+		 * @var int $process_version The process_version
 		 * @access public
 		 */
 		var $process_version;
-		/** 
-		 * @var int $activity_name The process id 
+		/**
+		 * @var int $activity_name The process id
 		 * @access public
 		 */
 		var $activity_name;
-		/** 
-		 * @var int $user_name The user name 
+		/**
+		 * @var int $user_name The user name
 		 * @access public
 		 */
 		var $user_name;
-		/** 
-		 * @var int $view_activity activity id of the view activity avaible for this process 
+		/**
+		 * @var int $view_activity activity id of the view activity avaible for this process
 		 * @access public
 		 */
 		var $view_activity;
-		// theses 4 vars aren't avaible for the user code, they're set only after this user code was executed		
-		/** 
-		 * @var int $instance_id Instance id 
+		// theses 4 vars aren't avaible for the user code, they're set only after this user code was executed
+		/**
+		 * @var int $instance_id Instance id
 		 * @access public
 		 */
 		var $instance_id=0;
-		/** 
-		 * @var string $instance_name Instance name 
+		/**
+		 * @var string $instance_name Instance name
 		 * @access public
 		 */
 		var $instance_name='';
-		/** 
-		 * @var int $instance_owner Instance owner id 
+		/**
+		 * @var int $instance_owner Instance owner id
 		 * @access public
 		 */
 		var $instance_owner=0;
-		/** 
-		 * @var string $owner_name Owner name 
+		/**
+		 * @var string $owner_name Owner name
 		 * @access public
 		 */
 		var $owner_name='';
-		
+
 		/**
 		 * @var bool $print_mode print mode
@@ -155,11 +155,11 @@
 		 */
 		var $enable_print_mode = false;
-		
+
 		/**
 		 * @var array $act_role_names of roles associated with the activity, usefull for lists of users associated with theses roles
-		 * @access public	
+		 * @access public
 		 */
 		var $act_role_names= Array();
-		
+
 		/**
 		 * @var array $agents Array of ui_agent objects
@@ -172,20 +172,20 @@
 		 * @access public
 		 */
-		var $smarty;                
+		var $smarty;
 		/**
 		 * @var array $wf holds a global environment vector
 		 * @access public
 		 */
-		var $wf;                    
+		var $wf;
 		/**
 		 * @var $download_mode activates download mode
 		 * @access public
 		 */
-		var $download_mode;        
+		var $download_mode;
 		/**
 		 * @var string $_template_name holds the template's file name
 		 * @access public
 		 */
-		var $_template_name = null; 
+		var $_template_name = null;
 		/**
 		 * @var bool Indicates wether the current instance is a child instance or not
@@ -193,4 +193,5 @@
          */
 		var $isChildInstance = false;
+
 		/**
 		 * @var object Stores a 'workflow_smarty' object
@@ -200,7 +201,13 @@
 
 		/**
+		 * @var object Log Object
+         * @access private
+         */
+		private $logger = null;
+
+		/**
 		 * Constructor
-		 * 
-		 * @access public 
+		 *
+		 * @access public
 		 */
 		function run_activity()
@@ -218,4 +225,7 @@
 
 			$this->workflowSmarty 	= &Factory::getInstance('workflow_smarty', false);
+
+			// never configure a log of type "firebug" here. This will make goAjax stop running well =(
+			$this->logger 			= &Factory::getInstance('Logger', array('file'));
 
 			// TODO: open a new connection to the database under a different username to allow privilege handling on tables
@@ -236,4 +246,6 @@
 		function go($activity_id=0, $iid=0, $auto=0)
 		{
+			$totalTime = microtime(true);
+
 			$result=Array();
 
@@ -431,8 +443,8 @@
 
 			/* BEGIN WORKFLOW MVC SETTINGS */
-			$env = array( );                                           //create settings vector
+			$env = array();                                            //create settings vector
 			$env['view']          =& $smarty;                          //view layer instance
 			$env['template_file'] =& $_template_name;                  //template file to be shown
-			$env['dao']           =& wf_create_object('wf_db');        //data access object instance
+			$env['dao']			  =& Factory::newInstance('wf_db');    //data access object instance
 			$env['workflow']      =& $GLOBALS['workflow'];             //workflow environment information
 			$env['instance']      =& $instance;                        //process manager instance
@@ -441,5 +453,5 @@
 			$env['request']       =& $security->process($_REQUEST);    //sanitizes input data from client
 			$env['factory']       =& Factory::getInstance('ProcessWrapperFactory');  //instantiation controller class
-			$env['natural']		  =& wf_create_object('wf_natural');   //data access object instance for mainframe
+			$env['natural']		  =& Factory::newInstance('wf_natural');   //data access object instance for mainframe
 			/* END WORKFLOW MVC SETTINGS */
 
@@ -485,6 +497,10 @@
 
 			/* include the files */
+			$processTime = microtime(true);
+
 			foreach ($_engineFiles as $_engineFile)
 				require $_engineFile;
+
+			$processTime = (microtime(true) - $processTime);
 
 			unset($GLOBALS['workflow_env']);
@@ -528,6 +544,17 @@
 			}
 
+			$totalTime = (microtime(true) - $totalTime);
+
+			$logTime = sprintf("GO [pid=%s,iid=%s,uid=%s,aid=%s] [eng=%ss,proc=%ss]",
+								$this->process_id,
+								$this->instance_id,
+								$GLOBALS['user'],
+								$this->activity_id,
+								number_format(($totalTime - $processTime),3),
+								number_format($processTime,3) );
+
+			$this->logger->debug($logTime);
+
 			// TODO: process instance comments
-
 			$instructions = $this->runtime->handle_postUserCode(_DEBUG);
 			switch($instructions['action'])
@@ -593,4 +620,6 @@
 		function goAjax($activity_id=0, $iid=0, $auto=0)
 		{
+			$totalTime = microtime(true);
+
 			$result=Array();
 
@@ -702,6 +731,6 @@
 
 			/* BEGIN WORKFLOW MVC SETTINGS */
-			$env = array( );                                           //create settings vector
-			$env['dao']           =& wf_create_object('wf_db');        //data access object instance
+			$env = array();                                            //create settings vector
+			$env['dao']			  =& Factory::newInstance('wf_db');    //data access object instance
 			$env['workflow']      =& $GLOBALS['workflow'];             //workflow environment information
 			$env['instance']      =& $instance;                        //process manager instance
@@ -710,5 +739,5 @@
 			$env['request']       =& $security->process($_REQUEST); //sanitizes input data from client
 			$env['factory']       =& Factory::newInstance('ProcessWrapperFactory');  //instantiation controller class
-			$env['natural']		  =& wf_create_object('wf_natural');   //data access object instance for mainframe
+			$env['natural']		  =& Factory::newInstance('wf_natural');   //data access object instance for mainframe
 			/* END WORKFLOW MVC SETTINGS */
 
@@ -727,5 +756,5 @@
 			 * the messages for the process factory instead of Workflow
 			 * factory. Note that this is the same comment as the previous
-			 * function... boooring.. =}
+			 * function... boooring..
 			 */
 			Security::enable();
@@ -734,5 +763,9 @@
 			$nc = &Factory::newInstance('NanoController');
 			$nc->setClassPath(GALAXIA_PROCESSES . SEP . $this->process->getNormalizedName(). SEP . 'code');
+
+			$processTime = microtime(true);
 			$nc->iterateOverVirtualRequests();
+			$processTime = microtime(true) - $processTime;
+
 			$nc->outputResultData();
 			unset($GLOBALS['workflow_env']);
@@ -740,4 +773,16 @@
 			if (!is_null($iid))
 				$instance->instance->sync();
+
+			$totalTime = microtime(true) - $totalTime;
+
+			$logTime = sprintf("GOAJAX [pid=%s,iid=%s,uid=%s,aid=%s] [eng=%ss,proc=%ss]",
+								$this->process_id,
+								$this->instance_id,
+								$GLOBALS['user'],
+								$this->activity_id,
+								number_format(($totalTime - $processTime),3),
+								number_format($processTime,3) );
+
+			$this->logger->debug($logTime);
 		}
 
Index: sandbox/workflow/trunk/inc/local/classes/class.wf_instance.php
===================================================================
--- sandbox/workflow/trunk/inc/local/classes/class.wf_instance.php	(revision 2466)
+++ sandbox/workflow/trunk/inc/local/classes/class.wf_instance.php	(revision 2858)
@@ -250,29 +250,35 @@
 
 	/**
-	* Busca as instâncias filhas de uma instância
-	* Se os parâmetros não forem informados, retorna instâncias filhas das instância atual.
-	* @param int $instanceID O ID da instância pai (não obrigatório).
-	* @param int $activityID O ID da atividade corrente da instância pai
-	* @return array As instâncias filhas do par instância/atividade atual
-	* @access public
-	*/
-	public function getChildren($instanceID = null, $activityID = null)
+	* This method gets all children instances of the given instance.
+	* If there is no parameter, it gets the children instances of the current instance
+	* @param int $instanceID Dad instance's identification.
+	* @return array Array with the children instances, or false
+	* @access public
+	*/
+	public function getChildren($instanceID = null)
 	{
 		$output = array();
 		if (is_null($instanceID))
 			$instanceID = $GLOBALS['workflow']['wf_runtime']->instance_id;
-		if (is_null($activityID))
-			$activityID = $GLOBALS['workflow']['wf_runtime']->activity_id;
-
-		/* check instanceID */
-		if (!$this->checkInstanceAccess($instanceID, $activityID))
+
+		/* check instanceID */
+		if (!$this->checkInstanceAccess($instanceID))
 			return $output;
 
 		/* build the SQL query */
-		$query = 'SELECT i.wf_instance_id AS wf_instance_id, ia.wf_activity_id AS wf_activity_id, ia.wf_started AS wf_started, i.wf_name AS wf_name, i.wf_status AS wf_status, ia.wf_user AS wf_user, ir.wf_parent_lock AS wf_parent_lock ';
-		$query .= 'FROM egw_wf_interinstance_relations ir, egw_wf_instances i LEFT JOIN egw_wf_instance_activities ia ON (ia.wf_instance_id = i.wf_instance_id)';
-		$query .= 'WHERE (ir.wf_child_instance_id = i.wf_instance_id) AND (ir.wf_parent_instance_id = ?) AND (ir.wf_parent_activity_id = ?)';
-
-		$result = $this->db->query($query, array($instanceID, $activityID));
+		$query = 'SELECT i.wf_instance_id AS wf_instance_id, ' .
+				 '       ia.wf_activity_id AS wf_activity_id, ' .
+				 '       i.wf_started AS wf_started, ' .
+				 '       i.wf_name AS wf_name, ' .
+				 '       i.wf_status AS wf_status, ' .
+				 '       ia.wf_user AS wf_user, ' .
+				 '       ir.wf_parent_lock AS wf_parent_lock ' .
+				 ' FROM egw_wf_interinstance_relations ir, egw_wf_instances i ' .
+				 '  LEFT JOIN egw_wf_instance_activities ia ' .
+				 '  ON (ia.wf_instance_id = i.wf_instance_id) ' .
+				 ' WHERE ' .
+				 '  (ir.wf_child_instance_id = i.wf_instance_id) AND (ir.wf_parent_instance_id = ?) ';
+
+		$result = $this->db->query($query, array($instanceID));
 		$output = $result->GetArray(-1);
 
Index: sandbox/workflow/trunk/inc/local/classes/class.wf_engine.php
===================================================================
--- sandbox/workflow/trunk/inc/local/classes/class.wf_engine.php	(revision 2466)
+++ sandbox/workflow/trunk/inc/local/classes/class.wf_engine.php	(revision 2858)
@@ -192,5 +192,5 @@
 	{
 		$WFInstance = &Factory::getInstance('wf_instance');
-		$preOutput = $WFInstance->getChildren($instanceID, $activityID);
+		$preOutput = $WFInstance->getChildren($instanceID);
 		$output = array();
 		foreach ($preOutput as $childInstance)
Index: sandbox/workflow/trunk/inc/local/classes/class.wf_natural.php
===================================================================
--- sandbox/workflow/trunk/inc/local/classes/class.wf_natural.php	(revision 795)
+++ sandbox/workflow/trunk/inc/local/classes/class.wf_natural.php	(revision 2858)
@@ -1,130 +1,114 @@
 <?php
-	require_once(PHPGW_SERVER_ROOT.SEP.'workflow'.SEP.'inc'.SEP.'natural'.SEP.'class.natural.php');
+/**************************************************************************\
+* eGroupWare                                                               *
+* http://www.egroupware.org                                                *
+* --------------------------------------------                             *
+*  This program is free software; you can redistribute it and/or modify it *
+*  under the terms of the GNU General Public License as published by the   *
+*  Free Software Foundation; either version 2 of the License, or (at your  *
+*  option) any later version.                                              *
+\**************************************************************************/
+
+require_once(PHPGW_SERVER_ROOT.SEP.'workflow'.SEP.'inc'.SEP.'natural'.SEP.'class.natural.php');
+
+/**
+ * Mainframe connection to workflow
+ *
+ * TODO - This class should be removed from here. Its based on a not
+ * public protocol, thus cannot be used for everybody.
+ *
+ * @package Workflow
+ * @subpackage local
+ * @license http://www.gnu.org/copyleft/gpl.html GPL
+ * @author Everton Flávio Rufino Seára
+ */
+class wf_natural extends Natural
+{
 
 	/**
-	* Mainframe connection to workflow
-	* @author Everton Flávio Rufino Seára
-	* @package Workflow
-	* @subpackage local
-	* @license http://www.gnu.org/copyleft/gpl.html GPL
-	**/
+	 * @var object Log Object
+	 * @access private
+	 */
+	private $logger = null;
 
-	class wf_natural extends Natural
+	function __construct()
 	{
+		parent::Natural();
 
-		function __construct()
-		{
-			parent::Natural();
+		$natconf = array(
+					'mainframe_ip'			=> '',
+					'mainframe_port'		=> '',
+					'mainframe_key'			=> '',
+					'mainframe_password'	=> '',
+					'mainframe_environment'	=> ''
+		);
 
-			$natconf = array(
-						'mainframe_ip'			=> '',
-						'mainframe_port'		=> '',
-						'mainframe_key'			=> '',
-						'mainframe_password'	=> '',
-						'mainframe_environment'	=> ''
-			);
+		$nat_conf_values = &Factory::getInstance('workflow_wfruntime')->getConfigValues($natconf);
 
-			$nat_conf_values = $GLOBALS['workflow']['wf_runtime']->getConfigValues($natconf);
+		$this->setIPAddress($nat_conf_values['mainframe_ip']);
+		$this->setServerPort($nat_conf_values['mainframe_port']);
+		$this->setKey($nat_conf_values['mainframe_key']);
+		$this->setPassword($nat_conf_values['mainframe_password']);
+		$this->setApplication($nat_conf_values['mainframe_environment']);
 
-			$this->setIPAddress($nat_conf_values['mainframe_ip']);
-			$this->setServerPort($nat_conf_values['mainframe_port']);
-			$this->setKey($nat_conf_values['mainframe_key']);
-			$this->setPassword($nat_conf_values['mainframe_password']);
-			$this->setApplication($nat_conf_values['mainframe_environment']);
+		$this->logger = &Factory::getInstance('Logger', array('file'));
+	}
+
+	/**
+	 * This method MUST be called before using execute method
+	 * It specifies the natural sub-program to be accessed.
+	 *
+	 * @param Object $obj Object that specifies natural sub-program properties
+	 * @return void
+	 */
+	public function configure($obj)
+	{
+		$this->obj = $obj;
+
+		$this->initialize($obj->name);
+
+		if ($obj->server != NULL){
+			$this->setIPAddress($obj->server);
 		}
-
-		/**
-		 * Method to configure the access to mainframe
-		 * This method MUST be called before using execute method, else 'false' will be returned
-		 *
-		 * Only the first and second param are mandatory.
-		 *
-		 * @param String $subProgram - Name of sub-program
-		 * @param String $inputParameter - Input parameters to sub-program
-		 *
-		 * @param String $ip - IP Address of Mainfram
-		 * @param int $port - ServerPort to access the mainframe
-		 * @param String $key - Access key (user)
-		 * @param String $password - Key (user) password
-		 * @param char $environment - Application environment access 'D' (development) or 'P' (production)
-
-		 */
-
-		public function configure($obj)
-		{
-			$this->obj = $obj;
-
-			$this->initialize($obj->name);
-
-			if ($obj->server != NULL){
-				$this->setIPAddress($obj->server);
-			}
-			if ($obj->port != NULL){
-				$this->setServerPort($obj->port);
-			}
-			if ($obj->key != NULL){
-				$this->setKey($obj->key);
-			}
-			if ($obj->password != NULL){
-				$this->setPassword($obj->password);
-			}
-			if ($obj->environment != NULL){
-				$this->setApplication($obj->environment);
-			}
-			if ($obj->logon != NULL){
-				$this->setLogon($obj->logon);
-			}
-			if ($obj->system != NULL){
-				$this->setSystem($obj->system);
-			}
-			if ($obj->rc != NULL){
-				$this->setRC($obj->rc);
-			}
+		if ($obj->port != NULL){
+			$this->setServerPort($obj->port);
 		}
-
-		/*
-
-		public function configure($subProgram, $inputParameter, $ip = NULL, $port = NULL,
-										$key = NULL, $password = NULL, $environment = NULL, $logon = NULL, $system = NULL, $rc = NULL)
-		{
-			$this->initialize($subProgram, $inputParameter);
-
-			if ($ip != NULL){
-				$this->setIPAddress($ip);
-			}
-			if ($port != NULL){
-				$this->setServerPort($port);
-			}
-			if ($key != NULL){
-				$this->setKey($key);
-			}
-			if ($password != NULL){
-				$this->setPassword($password);
-			}
-			if ($environment != NULL){
-				$this->setApplication($environment);
-			}
-			if ($logon != NULL){
-				$this->setLogon($logon);
-			}
-			if ($system != NULL){
-				$this->setSystem($system);
-			}
-			if ($rc != NULL){
-				$this->setRC($rc);
-			}
-
+		if ($obj->key != NULL){
+			$this->setKey($obj->key);
 		}
-
-		 */
-
-		/**
-		 * Access and retrieve data from mainframe
-		 * @return bool
-		 */
-		public function execute($inputParams = "")
-		{
-			return parent::execute($inputParams);
+		if ($obj->password != NULL){
+			$this->setPassword($obj->password);
+		}
+		if ($obj->environment != NULL){
+			$this->setApplication($obj->environment);
+		}
+		if ($obj->logon != NULL){
+			$this->setLogon($obj->logon);
+		}
+		if ($obj->system != NULL){
+			$this->setSystem($obj->system);
+		}
+		if ($obj->rc != NULL){
+			$this->setRC($obj->rc);
 		}
 	}
+
+	/**
+	 * Method for accessing and retrieving data from mainframe
+	 * @return bool
+	 */
+	public function execute($inputParams = "")
+	{
+		// execute action and log wasted time
+		$totalTime = microtime(true);
+		$result = parent::execute($inputParams);
+		$totalTime = microtime(time) - $totalTime;
+		$log = sprintf("WF_NATURAL [subprogram=%s] [time=%ss]",
+					$this->obj->name,
+					number_format($totalTime,3)
+					);
+		$this->logger->debug($log);
+		return $result;
+	}
+}
 ?>
Index: sandbox/workflow/trunk/inc/engine/src/common/WfRuntime.php
===================================================================
--- sandbox/workflow/trunk/inc/engine/src/common/WfRuntime.php	(revision 2372)
+++ sandbox/workflow/trunk/inc/engine/src/common/WfRuntime.php	(revision 2858)
@@ -6,69 +6,69 @@
  * as it handle concurrency and part of the core execution of the instance while avoiding
  * bad manipulation of the instance
- * 
+ *
  * @package Galaxia
- * @license http://www.gnu.org/copyleft/gpl.html GPL 
+ * @license http://www.gnu.org/copyleft/gpl.html GPL
  */
-class WfRuntime extends Base 
-{  
+class WfRuntime extends Base
+{
   /**
    * @var array processes config values cached for this object life duration, init is done at first use for the only process associated with this runtime object
    * @access public
    */
-  var $conf= Array();  
+  var $conf= Array();
   /**
    * @var object $activity
-   * @access public 
+   * @access public
    */
   var $activity = null;
   /**
    * @var object $instance
-   * @access public 
+   * @access public
    */
   var $instance = null;
   /**
    * @var int $instance_id
-   * @access public 
-   */
-  var $instance_id = 0;  
+   * @access public
+   */
+  var $instance_id = 0;
   /**
    * @var int $activity_id
-   * @access public 
+   * @access public
    */
   var $activity_id = 0;
   /**
    * @var object $process Retrieve process information
-   * @access public 
+   * @access public
    */
   var $process = null;
   /**
    * @var object $workitems  Reference to $instance->workitems
-   * @access public 
+   * @access public
    */
   var $workitems = null;
   /**
    * @var object $activities Reference to $instance->activities
-   * @access public 
-   */  
+   * @access public
+   */
   var $activities = null;
   /**
    * @var object $security Security object
-   * @access public 
-   */  
+   * @access public
+   */
   var $security = null;
   /**
    * @var bool $transaction_in_progress Transaction state
-   * @access public 
-   */  
-  var $transaction_in_progress = false; 
+   * @access public
+   */
+  var $transaction_in_progress = false;
   /**
    * @var bool $debug Debug state
-   * @access public 
-   */   
+   * @access public
+   */
   var $debug=false;
   /**
    * @var bool $auto_mode Automatic mode state, non-interactive for instance, big impact on error handling
-   * @access public 
-   */  
+   * @access public
+   */
   var $auto_mode=false;
 
@@ -81,10 +81,10 @@
   /**
    * Constructor
-   * 
+   *
    * @param object &$db ADOdb
    * @return object WfRuntime instance
    * @access public
    */
-  function WfRuntime() 
+  function WfRuntime()
   {
     $this->child_name = 'WfRuntime';
@@ -101,8 +101,8 @@
    * Collect errors from all linked objects which could have been used by this object
    * Each child class should instantiate this function with her linked objetcs, calling get_error(true)
-   * 
+   *
    * @param bool $debug false by default, if true debug messages can be added to 'normal' messages
    * @param string $prefix appended to the debug message
-   * @return void 
+   * @return void
    * @access private
    */
@@ -118,5 +118,5 @@
   /**
    * Ends-up dying and giving a last message
-   * 
+   *
    * @param string $last_message last sentence
    * @param bool $include_errors false by default, if true we'll include error messages
@@ -134,5 +134,5 @@
     if ($this->debug) $debug = true;
     if ($this->auto_mode) $dying = false;
-    
+
     if ($include_errors)
     {
@@ -161,7 +161,7 @@
    * Loads the config values for the process associated with the runtime
    * config values are cached while this WfRuntime object stays alive
-   * 
+   *
    * @param array $arrayconf Config array with default value, where key is config option name and value is default value
-   * @access private 
+   * @access private
    * @return array Values associated with the current process for the asked config options and as well for som WfRuntime internal config options
    */
@@ -172,5 +172,5 @@
       $this->loadProcess();
     }
-    $arrayconf['auto-release_on_leaving_activity'] = 1;  
+    $arrayconf['auto-release_on_leaving_activity'] = 1;
     $this->conf =  $this->process->getConfigValues($arrayconf);
     return $this->conf;
@@ -179,8 +179,8 @@
   /**
    * Loads instance, the activity and the process, needed by the runtime engine to 'execute' the activity
-   * 
+   *
    * @param int $activityId activity id, the activity we will run
    * @param int $instanceId instance Id, can be empty for a start or standalone activity
-   * @return bool 
+   * @return bool
    * @access public
    */
@@ -204,9 +204,9 @@
       return false;
     }
-    
+
     //ensure the activity is not completed
     $this->instance->setActivityCompleted(false);
 	$this->instance->activityID = $activityId;
-    
+
     //set the workitems and activities links
     $this->workitems =& $this->instance->workitems;
@@ -214,8 +214,8 @@
     return true;
   }
-  
+
   /**
    * Retrieves the process object associated with the activity
-   * 
+   *
    * @param int $pId Process id of the process you want, if you do not give it we will try to take it from the activity
    * @return mixed Process object of the right type or false
@@ -242,8 +242,8 @@
     return true;
   }
-  
+
   /**
    * Gets current process instance
-   * 
+   *
    * @return object Process instance
    * @access public
@@ -256,5 +256,5 @@
   /**
    * Retrieves the activity of the right type from a baseActivity Object
-   * 
+   *
    * @param int $activity_id activity_id you want
    * @param bool $with_roles will load the roles links on the object
@@ -285,19 +285,19 @@
     return true;
   }
-  
+
   /**
    * Gets current activity instance
-   * 
+   *
    * @return object Activity instance
    * @access public
-   */  
+   */
   function &getActivity()
   {
     return $this->activity;
   }
-  
+
   /**
    * Gets the instance which could be an empty object
-   * 
+   *
    * @param int $instanceId is the instance id
    * @return mixed Instance object which can be empty or string if something was turning bad
@@ -308,5 +308,5 @@
     $this->instance_id = $instanceId;
     $this->instance->getInstance($instanceId);
-    if ( ($this->instance->getInstanceId()==0) 
+    if ( ($this->instance->getInstanceId()==0)
       && (! (($this->activity->getType()=='standalone') || ($this->activity->getType()=='start') )) )
     {
@@ -319,10 +319,10 @@
     return true;
   }
-  
+
   /**
    * Perform necessary security checks at runtime before running an activity
    * This will as well lock the tables via the security object
    * It should be launched in a transaction
-   * 
+   *
    * @return bool true if ok, false if the user has no runtime access
    * @access public
@@ -356,5 +356,5 @@
    * This will as well lock the tables via the security object
    * It should be launched in a transaction
-   * 
+   *
    * @return bool true if ok, false if the user has no runtime access instance and activity are unsetted in case of false check
    * @access public
@@ -372,9 +372,9 @@
         //we are granted an access to release but there is a special bad case where
         //we are a user authorized at releasing instances owned by others and where
-        //this instance is owned by another (for some quite complex reasons). 
+        //this instance is owned by another (for some quite complex reasons).
         //we should not release this new user!!
-        //Then this is auto-release, not a conscious act and so we will release only 
+        //Then this is auto-release, not a conscious act and so we will release only
         //if we can still grab this instance (avoiding the bad case)
-        
+
         //test grab before release
         if ($this->checkUserRun())
@@ -386,11 +386,11 @@
     return false;
   }
-  
+
   /**
    * Sets/unsets the WfRuntime in debug mode
-   * 
+   *
    * @param bool $debug_mode true by default, set it to false to disable debug mode
    * @access public
-   * @return void 
+   * @return void
    */
   function setDebug($debug_mode=true)
@@ -398,13 +398,13 @@
     $this->debug = $debug_mode;
   }
-  
+
   /**
    * Sets/unsets the WfRuntime in automatic mode. i.e : executing
    * non-interactive or interactive activities. Automatic mode have big impacts
    * on error handling and on the way activities are executed
-   * 
+   *
    * @param bool $auto_mode true by default, set it to false to disable automatic mode
    * @access public
-   * @return void 
+   * @return void
    */
   function setAuto($auto_mode=true)
@@ -412,10 +412,10 @@
     $this->auto_mode = $auto_mode;
   }
-  
+
   /**
    * This function will start a transaction, call it before setActivityUser()
-   * 
-   * @access public
-   * @return void 
+   *
+   * @access public
+   * @return void
    */
   function StartRun()
@@ -424,8 +424,8 @@
     $this->db->StartTrans();
   }
-  
+
   /**
    * This function ends the transactions started in StartRun()
-   * 
+   *
    * @access public
    * @return void
@@ -433,5 +433,5 @@
   function EndStartRun()
   {
-    if ($this->transaction_in_progress) 
+    if ($this->transaction_in_progress)
     {
       $this->db->CompleteTrans();
@@ -439,19 +439,19 @@
     }
   }
-  
-  /**
-   * For interactive activities this function will set the current user on the instance-activities table. 
+
+  /**
+   * For interactive activities this function will set the current user on the instance-activities table.
    * This will prevent having several user using the same activity on the same intsance at the same time
    * But if you want this function to behave well you should call it after a checkUserRun or a checkUserRelease
    * and inside a transaction. Theses others function will ensure the table will be locked and the user
    * is really granted the action
-   * 
+   *
    * @param bool $grab true by default, if false the user will be set to '*', releasing the instance-activity record
    * @access public
-   * @return bool 
+   * @return bool
    */
   function setActivityUser($grab=true)
   {
-    if(isset($GLOBALS['user']) && !empty($this->instance->instanceId) && !empty($this->activity_id)) 
+    if(isset($GLOBALS['user']) && !empty($this->instance->instanceId) && !empty($this->activity_id))
     {
       if ($this->activity->isInteractive())
@@ -480,10 +480,10 @@
       $this->error[] = $errors;
       return false;
-    }    
-  }
-  
+    }
+  }
+
   /**
    * Tries to give some usefull info about the current runtime
-   * 
+   *
    * @return array associative arrays with keys/values which could be usefull
    * @access public
@@ -510,5 +510,5 @@
    * This part of the runtime will be runned just after the activity code inclusion.
    * We are in fact after all the "user code" part. We should decide what to do next
-   * 
+   *
    * @param bool $debug false by default
    * @return array an array which must be analysed by the application run class. It contains 2 keys
@@ -525,8 +525,8 @@
   {
     $result = Array();
-    
+
      // re-retrieve instance id which could have been modified by a complete
      $this->instance_id	= $this->instance->getInstanceId();
-     
+
      //synchronised instance object with the database
      $this->instance->sync();
@@ -537,5 +537,5 @@
       if ($this->instance->getActivityCompleted())
       {
-        // activity is interactive and completed, 
+        // activity is interactive and completed,
         // we have to continue the workflow
         // and send any autorouted activity which could be after this one
@@ -554,5 +554,5 @@
         if ($GLOBALS['workflow']['__leave_activity'])
         {
-          // activity is interactive and the activity source set the 
+          // activity is interactive and the activity source set the
           // $GLOBALS[workflow][__leave_activity] it's a 'cancel' mode.
           // we redirect the user to the leave activity page
@@ -561,5 +561,5 @@
         }
         else
-        { 
+        {
           //the activity is not completed and the user doesn't want to leave
           // we loop on the form
@@ -570,5 +570,5 @@
     }
     else
-    { 
+    {
       // in auto mode or with non interactive activities we return engine info
       // and we collect our errors, we do not let them for other objects
@@ -583,7 +583,7 @@
   /**
    * Gets the the 'Activity Completed' status
-   * 
-   * @access public
-   * @return string 
+   *
+   * @access public
+   * @return string
    */
   function getActivityCompleted()
@@ -592,19 +592,19 @@
   }
 
-  
+
   //----------- Instance public function mapping -------------------------------------------
-  
+
   /**
    * Sets the next activity to be executed, if the current activity is
    * a switch activity the complete() method will use the activity setted
-   * in this method as the next activity for the instance. 
+   * in this method as the next activity for the instance.
    * Note that this method receives an activity name as argument (Not an Id)
    * and that it does not need the activityId like the instance method
-   * 
+   *
    * @param string $actname name of the next activity
    * @return bool
    * @access public
    */
-  function setNextActivity($actname) 
+  function setNextActivity($actname)
   {
     return $this->instance->setNextActivity($this->activity_id,$actname);
@@ -612,11 +612,11 @@
 
   /**
-   * Sets the user that must perform the next 
+   * Sets the user that must perform the next
    * activity of the process. this effectively "assigns" the instance to
    * some user
-   * 
+   *
    * @param int $user the next user id
    * @param string $activityName The name of the activity that the user will be able to executed. '*' means the next activity.
-   * @return bool 
+   * @return bool
    * @access public
    */
@@ -631,8 +631,8 @@
 
   /**
-   * Sets the user role that must perform the next 
+   * Sets the user role that must perform the next
    * activity of the process. this effectively "assigns" the instance to
    * some user
-   * 
+   *
    * @param string $roleName the next activity role
    * @param string $activityName The name of the activity that the role will be able to executed. '*' means the next activity.
@@ -655,24 +655,24 @@
 
   /**
-   * Gets the user that must perform the next activity of the process. 
+   * Gets the user that must perform the next activity of the process.
    * This can be empty if no setNextUser() was done before.
    * It wont return the default user but only the user which was assigned by a setNextUser
-   * 
-   * @return int 
-   * @access public
-   */
-  function getNextUser() 
+   *
+   * @return int
+   * @access public
+   */
+  function getNextUser()
   {
     return $this->instance->getNextUser();
   }
- 
+
   /**
    * Sets the name of this instance.
-   * 
+   *
    * @param string $value new name of the instance
-   * @return bool 
-   * @access public
-   */
-  function setName($value) 
+   * @return bool
+   * @access public
+   */
+  function setName($value)
   {
     return $this->instance->setName($value);
@@ -681,6 +681,6 @@
   /**
    * Gets the name of this instance
-   * 
-   * @return string 
+   *
+   * @return string
    * @access public
    */
@@ -691,10 +691,10 @@
   /**
    * Sets the category of this instance
-   * 
+   *
    * @param string $value
    * @return bool
    * @access public
    */
-  function setCategory($value) 
+  function setCategory($value)
   {
     return $this->instance->setcategory($value);
@@ -703,13 +703,13 @@
   /**
    * Gets category of this instance
-   * 
-   * @return string 
-   * @access public
-   */
-  function getCategory() 
+   *
+   * @return string
+   * @access public
+   */
+  function getCategory()
   {
     return $this->instance->getCategory();
   }
-  
+
   /**
    * Sets a property in this instance. This method is used in activities to
@@ -718,15 +718,15 @@
    * problems (A->z, digits and _ for spaces). If you have several set to call look
    * at the setProperties function. Each call to this function has an impact on database
-   * 
+   *
    * @param string $name property name (it will be normalized)
    * @param mixed $value value for this property
-   * @return bool 
-   * @access public
-   */
-  function set($name,$value) 
+   * @return bool
+   * @access public
+   */
+  function set($name,$value)
   {
     return $this->instance->set($name,$value);
   }
-  
+
   /**
    * Unsets a property in this instance. This method is used in activities to
@@ -734,10 +734,10 @@
    * All property names are normalized for security reasons and to avoid localisation
    * problems (A->z, digits and _ for spaces). Each call to this function has an impact on database
-   * 
+   *
    * @param string $name property name (it will be normalized)
    * @return bool true if it was ok
    * @access public
    */
-  function clear($name) 
+  function clear($name)
   {
     return $this->instance->clear($name);
@@ -749,5 +749,5 @@
    * All property names are normalized for security reasons and to avoid localisation
    * problems (A->z, digits and _ for spaces)
-   * 
+   *
    * @param string $name property name (it will be normalized)
    * @return bool true if it exists and false otherwise
@@ -766,5 +766,5 @@
    * problems (A->z, digits and _ for spaces). If you have several set to call look
    * at the setProperties function. Each call to this function has an impact on database
-   * 
+   *
    * @param array $properties_array associative array containing for each record the
    * property name as the key and the property value as the value. You do not need the complete
@@ -780,5 +780,5 @@
   /**
    * Gets the value of an instance property
-   * 
+   *
    * @param string $name name of the instance
    * @param string $defaultValue
@@ -793,53 +793,53 @@
   /**
    * Describes the activities where the instance is present, can be more than one activity if the instance was "splitted"
-   * 
+   *
    * @access public
    * @return array Vector of assocs
    */
-  function getActivities() 
+  function getActivities()
   {
     return $this->instance->getActivities();
   }
-  
+
   /**
    * Gets the instance status can be 'completed', 'active', 'aborted' or 'exception'
-   * 
+   *
    * @access public
    * @return string Instance status
    */
-  function getStatus() 
+  function getStatus()
   {
     return $this->instance->getStatus();
   }
-  
+
   /**
    * Sets the instance status
-   * 
+   *
    * @param $status Desired status, it can be: 'completed', 'active', 'aborted' or 'exception'
    * @return bool
    * @access public
    */
-  function setStatus($status) 
+  function setStatus($status)
   {
     return $this->instance->setStatus($status);
   }
-  
+
   /**
    * Gets the instance priority
-   * 
-   * @access public
-   * @return int 
+   *
+   * @access public
+   * @return int
    */
   function getPriority()
   {
     return $this->instance->getPriority();
-  } 
+  }
 
   /**
    * Sets the instance priority
-   * 
+   *
    * @param int $priority
    * @access public
-   * @return bool 
+   * @return bool
    */
   function setPriority($priority)
@@ -847,134 +847,134 @@
     return $this->instance->setPriority($priority);
   }
-   
+
   /**
    * Returns the instance id
-   * 
-   * @return int 
-   * @access public
-   */
-  function getInstanceId() 
+   *
+   * @return int
+   * @access public
+   */
+  function getInstanceId()
   {
     return $this->instance->getInstanceId();
   }
-  
+
   /**
    * Returns the process id for this instance
-   * 
-   * @return int 
-   * @access public 
+   *
+   * @return int
+   * @access public
    */
   function getProcessId() {
     return $this->instance->getProcessId();
   }
-  
+
   /**
    * Returns the owner of the instance
-   * 
-   * @return string 
-   * @access public
-   */
-  function getOwner() 
+   *
+   * @return string
+   * @access public
+   */
+  function getOwner()
   {
     return $this->instance->getOwner();
   }
-  
+
   /**
    * Sets the instance owner
-   * 
-   * @param string $user 
-   * @access public
-   * @return bool  
-   */
-  function setOwner($user) 
+   *
+   * @param string $user
+   * @access public
+   * @return bool
+   */
+  function setOwner($user)
   {
     return $this->instance->setOwner($user);
   }
-  
+
   /**
    * Returns the user that must execute or is already executing an activity where the instance is present
-   * 
+   *
    * @param int $activityId
    * @return bool False if the activity was not found for the instance, else return the user id or '*' if no user is defined yet
    * @access public
-   */  
-  function getActivityUser($activityId) 
+   */
+  function getActivityUser($activityId)
   {
     return $this->instance->getActivityUser($activityId);
   }
-  
+
   /**
    * Sets the status of the instance in some activity
-   * 
+   *
    * @param int $activityId Activity id
    * @param string $status New status, it can be 'running' or 'completed'
    * @return bool False if no activity was found for the instance
    * @access public
-   */  
-  function setActivityStatus($activityId,$status) 
+   */
+  function setActivityStatus($activityId,$status)
   {
     return $this->instance->setActivityStatus($activityId,$status);
   }
-  
-  
-  /**
-   * Gets the status of the instance in some activity 
-   * 
-   * @param int $activityId 
+
+
+  /**
+   * Gets the status of the instance in some activity
+   *
+   * @param int $activityId
    * @return string 'running' or 'completed'
    * @access public
    */
-  function getActivityStatus($activityId) 
+  function getActivityStatus($activityId)
   {
     return $this->instance->getActivityStatus($activityId);
   }
-  
+
   /**
    * Resets the start time of the activity indicated to the current time
-   * 
+   *
    * @param int $activityId
-   * @return bool 
-   * @access public
-   */
-  function setActivityStarted($activityId) 
+   * @return bool
+   * @access public
+   */
+  function setActivityStarted($activityId)
   {
     return $this->instance->setActivityStarted($activityId);
   }
-  
+
   /**
    * Gets the Unix timstamp of the starting time for the given activity
-   * 
+   *
    * @param int $activityId
-   * @return int 
-   * @access public
-   */
-  function getActivityStarted($activityId) 
+   * @return int
+   * @access public
+   */
+  function getActivityStarted($activityId)
   {
     return $this->instance->getActivityStarted($activityId);
   }
-  
+
   /**
    * Gets the time where the instance was started
-   * 
-   * @return int 
-   * @access public
-   */
-  function getStarted() 
+   *
+   * @return int
+   * @access public
+   */
+  function getStarted()
   {
     return $this->instance->getStarted();
   }
-  
+
   /**
    * Gets the end time of the instance (when the process was completed)
-   * 
-   * @return int 
-   * @access public 
-   */
-  function getEnded() 
+   *
+   * @return int
+   * @access public
+   */
+  function getEnded()
   {
     return $this->instance->getEnded();
   }
-  
-  
+
+
   /**
    * Completes an activity.
@@ -982,10 +982,10 @@
    * the engine does automatically complete automatic activities after
    * executing them
-   * 
+   *
    * @return bool True or false, if false it means the complete was not done for some internal reason
    * consult get_error() for more informations
    * @access public
    */
-  function complete() 
+  function complete()
   {
     if (!($this->activity->isInteractive()))
@@ -994,5 +994,5 @@
       return false;
     }
-    
+
     return $this->instance->complete($this->activity_id);
   }
@@ -1001,61 +1001,61 @@
    * Aborts an activity and terminates the whole instance. We still create a workitem to keep track
    * of where in the process the instance was aborted
-   * 
-   * @return bool 
-   * @access public
-   */
-  function abort() 
+   *
+   * @return bool
+   * @access public
+   */
+  function abort()
   {
     return $this->instance->abort();
   }
-  
+
   /**
    * Gets a comment for this instance
-   * 
+   *
    * @param int $cId Comment id
-   * @return string 
-   * @access public
-   */
-  function get_instance_comment($cId) 
+   * @return string
+   * @access public
+   */
+  function get_instance_comment($cId)
   {
     return $this->instance->get_instance_comment($cId);
   }
-  
+
   /**
    * Inserts or updates an instance comment
-   * 
+   *
    * @param int $cId Commend id
-   * @param int $activityId 
-   * @param object $activity 
+   * @param int $activityId
+   * @param object $activity
    * @param int	$user User id
    * @param string $title Comment's title
    * @param string $comment Comment's contents
-   * @return bool 
-   * @access public
-   */
-  function replace_instance_comment($cId, $activityId, $activity, $user, $title, $comment) 
+   * @return bool
+   * @access public
+   */
+  function replace_instance_comment($cId, $activityId, $activity, $user, $title, $comment)
   {
     return $this->instance->replace_instance_comment($cId, $activityId, $activity, $user, $title, $comment);
   }
-  
+
   /**
    * Removes an instance comment
-   * 
+   *
    * @param int $cId Comment id
-   * @return bool 
-   * @access public
-   */
-  function remove_instance_comment($cId) 
+   * @return bool
+   * @access public
+   */
+  function remove_instance_comment($cId)
   {
     return $this->instance->remove_instance_comment($cId);
   }
- 
+
   /**
    * Lists instance comments
-   * 
-   * @return array 
-   * @access public
-   */
-  function get_instance_comments() 
+   *
+   * @return array
+   * @access public
+   */
+  function get_instance_comments()
   {
     return $this->instance->get_instance_comments();
@@ -1087,5 +1087,5 @@
     $workflow = $GLOBALS['workflow'];
     unset($_REQUEST['iid']);
-    $run_activity = Factory::getInstance('run_activity');
+    $run_activity = Factory::newInstance('run_activity');
     $run_activity->runtime->instance->parentInstanceId = $this->instance_id;
     $run_activity->runtime->instance->parentActivityId = $this->activity_id;
Index: sandbox/workflow/trunk/inc/class.ui_adminroles.inc.php
===================================================================
--- sandbox/workflow/trunk/inc/class.ui_adminroles.inc.php	(revision 2372)
+++ sandbox/workflow/trunk/inc/class.ui_adminroles.inc.php	(revision 2858)
@@ -278,5 +278,5 @@
 					$glabel = "";
 					if (is_null($entry['last_update']))
-						$glabel = '<font color="red">(excluído)</font>';
+						$glabel = '<font color="red">(inativo)</font>';
 				}
 
Index: sandbox/workflow/trunk/inc/class.so_userinterface.inc.php
===================================================================
--- sandbox/workflow/trunk/inc/class.so_userinterface.inc.php	(revision 2466)
+++ sandbox/workflow/trunk/inc/class.so_userinterface.inc.php	(revision 2858)
@@ -333,5 +333,5 @@
 			{
 				$employees[$i]['telephoneNumber'] = is_null($entry['telephonenumber']) ? '' : $entry['telephonenumber'];
-				$employees[$i]['cn'] = is_null($entry['cn']) ? '' : $entry['cn'] . (is_null($entry['last_update']) ? ' <font color="red">(excluído)</font>' : '');
+				$employees[$i]['cn'] = is_null($entry['cn']) ? '' : $entry['cn'] . (is_null($entry['last_update']) ? ' <font color="red">(inativo)</font>' : '');
 			}
 		}
Index: sandbox/workflow/trunk/js/userinterface/orgchart.js
===================================================================
--- sandbox/workflow/trunk/js/userinterface/orgchart.js	(revision 2371)
+++ sandbox/workflow/trunk/js/userinterface/orgchart.js	(revision 2858)
@@ -348,5 +348,5 @@
 				complement = '';
 			if (employees[i]['removed'])
-				complement += ' <font color="red">(excluído)</font>';
+				complement += ' <font color="red">(inativo)</font>';
 			content += '<tr class="linha'+ i%2 + (useCategories ? ' categoria_' + employees[i]['funcionario_categoria_id'] : '') + '" onmouseover="this.className=\'highlight0\'" onmouseout="this.className=\'linha'+ i%2 + (useCategories ? ' categoria_' + employees[i]['funcionario_categoria_id'] : '') + '\'">';
 			content += '<td><a href="javascript:void(0);" onmouseover="getEmployeeInfoTimer(event, ' + employees[i]['funcionario_id'] + '); return false;" onmouseout="hideEmployeeInfo(); return false;">' + employees[i]['cn'] + complement + '</a></td>';
Index: sandbox/workflow/trunk/js/orgchart/organization.js
===================================================================
--- sandbox/workflow/trunk/js/orgchart/organization.js	(revision 2063)
+++ sandbox/workflow/trunk/js/orgchart/organization.js	(revision 2858)
@@ -483,5 +483,5 @@
 			data[i]['tr_attributes']['class'] = "linha" + i%2;
 			data[i]['tr_attributes']['className'] = "linha" + i%2;
-			data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + '</a>' + (data[i]['removed'] ? ' <font color="red">(excluído)</font>' : '');
+			data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + '</a>' + (data[i]['removed'] ? ' <font color="red">(inativo)</font>' : '');
 			data[i]['actions'] = '<a href="#" onclick="objEmployee.remove({\'funcionario_id\': ' + data[i]['funcionario_id'] + ', \'organizacao_id\': ' + organizationID + '} , this.parentNode.parentNode); return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/button_cancel.png" /></a>';
 		}
@@ -537,5 +537,5 @@
 			data[i]['tr_attributes']['class'] = "linha" + i%2;
 			data[i]['tr_attributes']['className'] = "linha" + i%2;
-			data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + ' ' + complement + '</a>' + (data[i]['removed'] ? ' <font color="red">(excluído)</font>' : '');
+			data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + ' ' + complement + '</a>' + (data[i]['removed'] ? ' <font color="red">(inativo)</font>' : '');
 			data[i]['actions'] = '<a href="#" onclick="objEmployee.remove({\'funcionario_id\': ' + data[i]['funcionario_id'] + ', \'organizacao_id\': ' + organizationID + '} , this.parentNode.parentNode); return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/button_cancel.png" /></a>';
 			window.scrollTo(0,0);
