Index: trunk/workflow/inc/local/classes/class.wf_instance.php
===================================================================
--- trunk/workflow/inc/local/classes/class.wf_instance.php	(revision 3167)
+++ trunk/workflow/inc/local/classes/class.wf_instance.php	(revision 4740)
@@ -77,5 +77,5 @@
 	{
 		$instanceID = (int) $instanceID;
-		$instance = Factory::getInstance('workflow_instance');
+		$instance = Factory::newInstance('workflow_instance');
 		if (!$instance->getInstance($instanceID))
 			return false;
@@ -243,8 +243,46 @@
 	* @return array As instâncias que satisfazem o critério de seleção.
 	* @access public
+	* @deprecated 2.2.000
 	*/
 	public function getAll($activities = null)
 	{
+		wf_warn_deprecated_method('wf_instances', 'getAllActive');
 		return $this->getIdle(0, $activities);
+	}
+
+	/**
+	* Search and return all active instances.
+	* @param array $activities A list of activities codes to restrict instances from (may also be a single integer code).
+	* @return array The instaces which match the search criteria.
+	* @access public
+	*/
+	public function getAllActive($activities = null)
+	{
+		return $this->getIdle(0, $activities);
+	}
+
+	/**
+	* Retrieve all completed instances.
+	* @return array All completed instances from current process. Be careful this may be a long array.
+	* @access public
+	*/
+	public function getAllCompleted()
+	{
+		$output = array();
+
+		// Build the SQL query
+		// Select all instances from the process that has a final date
+		$query = 'SELECT i.wf_instance_id, i.wf_started, i.wf_ended, i.wf_name, i.wf_status, i.wf_priority ';
+		$query .= 'FROM egw_wf_instances i ';
+		$query .= 'WHERE (i.wf_p_id = ?) AND (i.wf_ended > 0)';
+		$resultSet = $this->db->query($query, array($this->processID));
+
+		/* fetch the results */
+		while ($row = $resultSet->fetchRow())
+		{
+			$output[] = $row;
+		}
+
+		return $output;
 	}
 
Index: trunk/workflow/inc/local/classes/class.wf_engine.php
===================================================================
--- trunk/workflow/inc/local/classes/class.wf_engine.php	(revision 3167)
+++ trunk/workflow/inc/local/classes/class.wf_engine.php	(revision 4740)
@@ -81,4 +81,27 @@
 
 	/**
+	* Busca informações de um (ou mais) processo(s) pelo seu nome (ou apenas parte do nome).
+	* @param string $name String contendo o nome de um processo.
+	* @return array Informações sobre o(s) processo(s).
+	* @access public
+	*/
+	function getProcessesByName($name)
+	{
+		$output = array();
+		if (is_string($name)){
+			$flagObject[0] = is_null($this->processManager);
+			if ($flagObject[0])
+				$this->processManager = Factory::getInstance('workflow_processmanager');
+
+			// assinatura do método: list_processes($offset,$maxRecords,$sort_mode,$find='',$where='')
+			$output = $this->processManager->list_processes(-1, -1, '', $name, null);
+
+			if ($flagObject[0])
+				$this->processManager = null;
+		}
+		return $output;
+	}
+
+	/**
 	* Dá seqüência no fluxo de uma instância (simula ação do usuário).
 	* @param int $activityID O ID da atividade da instância.
Index: trunk/workflow/inc/engine/src/ProcessManager/ProcessManager.php
===================================================================
--- trunk/workflow/inc/engine/src/ProcessManager/ProcessManager.php	(revision 3167)
+++ trunk/workflow/inc/engine/src/ProcessManager/ProcessManager.php	(revision 4740)
@@ -799,5 +799,6 @@
 	function list_processes($offset,$maxRecords,$sort_mode,$find='',$where='')
 	{
-		$sort_mode = $this->convert_sortmode($sort_mode);
+		if(!empty($sort_mode))
+			$sort_mode = $this->convert_sortmode($sort_mode);
 		if($find) {
 			$findesc = '%'.$find.'%';
Index: trunk/workflow/inc/smarty/wf_plugins/function.wf_select_user.php
===================================================================
--- trunk/workflow/inc/smarty/wf_plugins/function.wf_select_user.php	(revision 3729)
+++ trunk/workflow/inc/smarty/wf_plugins/function.wf_select_user.php	(revision 4740)
@@ -39,4 +39,5 @@
 		'useGlobalSearch' => false,
 		'useCCParams' => false,
+		'size' => 27,
 		'rows'=> 2);
 	$extractParams = array(
@@ -47,4 +48,5 @@
 		'cols',
 		'rows',
+		'size',
 		'onlyVisibleAccounts',
 		'useGlobalSearch');
@@ -76,5 +78,5 @@
 		} else {
 			$output = <<<EOF
-				<input type="text" name="$name" id="$name" value="$id_value" size="27"/>
+				<input type="text" name="$name" id="$name" value="$id_value" size="$size"/>
 EOF;
 		}
@@ -85,5 +87,5 @@
 		$output = <<<EOF
 			<input type="hidden" name="$name" id="$name" value="$id_value"/>
-			<input type="text" name="$name_desc" id="$name_desc" value="$desc_value" readonly="true" size="27"/>
+			<input type="text" name="$name_desc" id="$name_desc" value="$desc_value" readonly="true" size="$size"/>
 EOF;
 	}
