Solving conflicts with branch 3.1-CONTENT

This commit is contained in:
Julio Cesar Laura Avendaño
2016-07-20 16:28:13 -04:00
74 changed files with 2694 additions and 2826 deletions

View File

@@ -1897,20 +1897,20 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
* @label PMF Group List
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFGroupList.28.29
*
* @param string | $regex = null | String to search | Optional parameter.
* @param int | $start = null | Start | Optional parameter.
* @param int | $limit = null | Limit | Optional parameter.
* @return array | $rows | List of groups | An array of groups
*
*/
function PMFGroupList () //its test was successfull
function PMFGroupList ($regex = null, $start = null, $limit = null) //its test was successfull
{
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$result = $ws->groupList();
$rows = Array ();
$i = 1;
$result = $ws->groupList($regex, $start, $limit);
$rows = array();
if (isset( $result )) {
foreach ($result as $item) {
$rows[$i ++] = $item;
}
$rows = array_combine(range(1, count($result)), array_values($result));
}
return $rows;
}
@@ -2984,7 +2984,7 @@ function PMFSaveCurrentData ()
* @name PMFTasksListByProcessId
* @label PMF Tasks List By Process Id
* @param string | $processId | ID Process | To get the current process id, use the system variable @@PROCESS
* @param string | $lang | Language | Is the language of the text, that must be the same to the column: "CON_LANG" of the CONTENT table
* @param string | $lang | Language | This parameter actually is not used, the same is kept by backward compatibility.Is the language of the text, that must be the same to the column: "CON_LANG" of the CONTENT table
* @return array | $result | Array result | Array of associative arrays which contain the unique task ID and title
*/
function PMFTasksListByProcessId($processId, $lang = 'en')
@@ -2992,11 +2992,7 @@ function PMFTasksListByProcessId($processId, $lang = 'en')
$result = array();
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(TaskPeer::TAS_UID);
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->addSelectColumn(ContentPeer::CON_LANG);
$criteria->addJoin(TaskPeer::TAS_UID, ContentPeer::CON_ID, Criteria::INNER_JOIN);
$criteria->add(ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL);
$criteria->add(ContentPeer::CON_LANG, $lang, Criteria::EQUAL);
$criteria->addSelectColumn(TaskPeer::TAS_TITLE);
$criteria->add(TaskPeer::PRO_UID, $processId, Criteria::EQUAL);
$ds = TaskPeer::doSelectRS($criteria);
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
@@ -3033,12 +3029,8 @@ function PMFGetProcessUidByName($processName = '')
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(ProcessPeer::PRO_UID);
$criteria->addJoin(ContentPeer::CON_ID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
$criteria->add(ContentPeer::CON_VALUE, $processName, Criteria::EQUAL);
$criteria->add(ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL);
$rsCriteria = ContentPeer::doSelectRS($criteria);
$criteria->add(ProcessPeer::PRO_TITLE, $processName, Criteria::EQUAL);
$rsCriteria = ProcessPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
@@ -3174,14 +3166,18 @@ function PMFDynaFormFields($dynUid, $appUid = false, $delIndex = 0)
* @name PMFGetTaskName
* @label PMF Get Task Title Text
* @param string | $taskUid | ID Task | Is the identifier of task, that must be the same to the column: "TAS_UID" of the TASK table
* @param string | $lang | Language | Is the language of the text, that must be the same to the column: "CON_LANG" of the CONTENT table
* @param string | $lang | Language | This parameter actually is not used, the same is kept by backward compatibility. Is the language of the text, that must be the same to the column: "CON_LANG"
* of the CONTENT table
* @return string | $text | Translated text | the translated text of a string in Content
*/
function PMFGetTaskName($taskUid, $lang = SYS_LANG) {
if (empty($taskUid)) {
return false;
}
return PMFGeti18nText($taskUid, 'TAS_TITLE', $lang);
$oTask = new \Task();
$aTasks = $oTask->load($taskUid);
$text = isset($aTasks["TAS_TITLE"]) ? $aTasks["TAS_TITLE"] : false;
return $text;
}
/**
@@ -3256,7 +3252,20 @@ function PMFGetGroupUID($groupName)
*/
function PMFGetTaskUID($taskName, $proUid = null)
{
return PMFGetUidFromText($taskName, 'TAS_TITLE', $proUid);
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(TaskPeer::TAS_UID);
$oCriteria->add(TaskPeer::TAS_TITLE, $taskName);
if(!is_null($proUid)){
$oCriteria->add(TaskPeer::PRO_UID, $proUid);
}
$oDataset = TaskPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$uids = array();
while ($row = $oDataset->getRow()) {
$uids[] = $row['TAS_UID'];
$oDataset->next();
}
return $uids;
}
/**