Merged 3.0.1.8 into MT-10

This commit is contained in:
Gustavo Cruz
2016-04-01 13:37:42 -04:00
16 changed files with 164 additions and 29 deletions

View File

@@ -71,8 +71,11 @@ try {
$classLoader->add(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'src' . PATH_SEP, 'ProcessMaker'); $classLoader->add(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'src' . PATH_SEP, 'ProcessMaker');
$classLoader->add(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'src' . PATH_SEP); $classLoader->add(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'src' . PATH_SEP);
$classLoader->addModelClassPath(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP);
//Load classes //Load classes
G::LoadThirdParty('propel', 'Propel');
G::LoadClass('system'); G::LoadClass('system');
G::LoadClass('tasks');
$arraySystemConfiguration = System::getSystemConfiguration(); $arraySystemConfiguration = System::getSystemConfiguration();

View File

@@ -67,6 +67,7 @@ try {
//Load classes //Load classes
G::LoadThirdParty('pear/json', 'class.json'); G::LoadThirdParty('pear/json', 'class.json');
G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadThirdParty('smarty/libs', 'Smarty.class');
G::LoadThirdParty('propel', 'Propel');
G::LoadSystem('error'); G::LoadSystem('error');
G::LoadSystem('dbconnection'); G::LoadSystem('dbconnection');
G::LoadSystem('dbsession'); G::LoadSystem('dbsession');
@@ -86,6 +87,7 @@ try {
G::LoadSystem('pagedTable'); G::LoadSystem('pagedTable');
G::LoadSystem('httpProxyController'); G::LoadSystem('httpProxyController');
G::LoadClass('system'); G::LoadClass('system');
G::LoadClass('tasks');
require_once('propel/Propel.php'); require_once('propel/Propel.php');
require_once('creole/Creole.php'); require_once('creole/Creole.php');

View File

@@ -1560,8 +1560,8 @@ class Cases
$pausedTask[] = $row; $pausedTask[] = $row;
} }
if (count($pausedTask) == 0) { if (count($pausedTask) === 0) {
return false; // return false because there is not any delegation for this task. return array(); // return false because there is not any delegation for this task.
} else { } else {
return array('pause' => $pausedTask); return array('pause' => $pausedTask);
} }

View File

@@ -1129,8 +1129,12 @@ class Derivation
switch ($routeType) { switch ($routeType) {
case "SEC-JOIN": case "SEC-JOIN":
$arrayOpenThread = ($flagTaskIsMultipleInstance && $flagTaskAssignTypeIsMultipleInstance)? $this->case->searchOpenPreviousTasks($currentDelegation["TAS_UID"], $currentDelegation["APP_UID"]) : array(); $arrayOpenThread = ($flagTaskIsMultipleInstance && $flagTaskAssignTypeIsMultipleInstance)? $this->case->searchOpenPreviousTasks($currentDelegation["TAS_UID"], $currentDelegation["APP_UID"]) : array();
$arrayOpenThread = array_merge($arrayOpenThread, $this->case->getOpenSiblingThreads($nextDel["TAS_UID"], $currentDelegation["APP_UID"], $currentDelegation["DEL_INDEX"], $currentDelegation["TAS_UID"])); $arraySiblings = $this->case->getOpenSiblingThreads($nextDel["TAS_UID"], $currentDelegation["APP_UID"], $currentDelegation["DEL_INDEX"], $currentDelegation["TAS_UID"]);
if(is_array($arrayOpenThread) && is_array($arraySiblings)){
$arrayOpenThread = array_merge($arrayOpenThread, $arraySiblings);
}
$canDerivate = empty($arrayOpenThread); $canDerivate = empty($arrayOpenThread);
break; break;
default: default:
$canDerivate = true; $canDerivate = true;

View File

@@ -364,6 +364,60 @@ class Triggers extends BaseTriggers
$oResult->code = 1; $oResult->code = 1;
} }
} }
/**
* Process elements:
*
* PRO_TRI_DELETED
* PRO_TRI_CANCELED
* PRO_TRI_PAUSED
* PRO_TRI_REASSIGNED
* PRO_TRI_OPEN
*/
$criteria = new Criteria();
$crit0 = $criteria->getNewCriterion(ProcessPeer::PRO_TRI_DELETED, $TRI_UID);
$crit1 = $criteria->getNewCriterion(ProcessPeer::PRO_TRI_CANCELED, $TRI_UID);
$crit2 = $criteria->getNewCriterion(ProcessPeer::PRO_TRI_PAUSED, $TRI_UID);
$crit3 = $criteria->getNewCriterion(ProcessPeer::PRO_TRI_REASSIGNED, $TRI_UID);
$crit4 = $criteria->getNewCriterion(ProcessPeer::PRO_TRI_OPEN, $TRI_UID);
$crit0->addOr($crit1);
$crit0->addOr($crit2);
$crit0->addOr($crit3);
$crit0->addOr($crit4);
$criteria->addSelectColumn(ProcessPeer::PRO_UID);
$criteria->addSelectColumn(ProcessPeer::PRO_TRI_DELETED);
$criteria->addSelectColumn(ProcessPeer::PRO_TRI_CANCELED);
$criteria->addSelectColumn(ProcessPeer::PRO_TRI_PAUSED);
$criteria->addSelectColumn(ProcessPeer::PRO_TRI_REASSIGNED);
$criteria->addSelectColumn(ProcessPeer::PRO_TRI_OPEN);
$criteria->add($crit0);
$rsCriteria = ProcessPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$arrayRow = array();
while ($rsCriteria->next()) {
array_push($arrayRow, $rsCriteria->getRow());
}
$oResult->dependencies["Process"] = array();
if ($oResult->code == 0 && count($arrayRow) == 0) {
$oResult->code = 0;
} else {
if (count($arrayRow) > 0) {
foreach ($arrayRow as $row) {
$process = ProcessPeer::retrieveByPK($row["PRO_UID"]);
array_push($oResult->dependencies["Process"], array("UID" => $process->getProUid(), "DESCRIPTION" => $process->getProTitle()));
}
$oResult->code = 1;
}
}
return $oResult; return $oResult;
} }

View File

@@ -426,12 +426,27 @@ class Home extends Controller
$dataList['dir'] = $dir; $dataList['dir'] = $dir;
$dataList['sort'] = $sort; $dataList['sort'] = $sort;
$dataList['category'] = $category; $dataList['category'] = $category;
$dataList['action'] = $type;
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
if (true) { if (true) {
//In enterprise version this block of code should always be executed //In enterprise version this block of code should always be executed
//In community version this block of code is deleted and is executed the other //In community version this block of code is deleted and is executed the other
$list = new \ProcessMaker\BusinessModel\Lists(); $list = new \ProcessMaker\BusinessModel\Lists();
$cases = $list->getList('inbox', $dataList); $listName = 'inbox';
switch ($type) {
case 'draft':
case 'todo':
$listName = 'inbox';
$cases = $list->getList($listName, $dataList);
break;
case 'unassigned':
$case = new \ProcessMaker\BusinessModel\Cases();
$cases = $case->getList($dataList);
foreach ($cases['data'] as &$value) {
$value = array_change_key_case($value, CASE_UPPER);
}
break;
}
} else { } else {
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$case = new \ProcessMaker\BusinessModel\Cases(); $case = new \ProcessMaker\BusinessModel\Cases();
@@ -439,14 +454,14 @@ class Home extends Controller
foreach ($cases['data'] as &$value) { foreach ($cases['data'] as &$value) {
$value = array_change_key_case($value, CASE_UPPER); $value = array_change_key_case($value, CASE_UPPER);
} }
if(!isset($cases['totalCount'])){
$cases['totalCount'] = $cases['total'];
}
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
} }
if(!isset($cases['totalCount'])){
$cases['totalCount'] = $cases['total'];
}
// formating & complitting apps data with 'Notes' // formating & complitting apps data with 'Notes'
foreach ($cases['data'] as $i => $row) { foreach ($cases['data'] as $i => $row) {

View File

@@ -37,7 +37,6 @@ switch ($_SESSION['actionCaseOptions']) {
break; break;
case 'sent': case 'sent':
case 'unassigned': case 'unassigned':
$_SESSION['TASK'] = -1;
$statusSendAndUnassigned = true; $statusSendAndUnassigned = true;
break; break;
case 'paused': case 'paused':
@@ -46,8 +45,6 @@ switch ($_SESSION['actionCaseOptions']) {
if (isset($_SESSION['bNoShowSteps'])) { if (isset($_SESSION['bNoShowSteps'])) {
unset($_SESSION['bNoShowSteps']); unset($_SESSION['bNoShowSteps']);
} }
} else {
$_SESSION['TASK'] = -1;
} }
break; break;
case 'to_revise': case 'to_revise':
@@ -57,8 +54,6 @@ switch ($_SESSION['actionCaseOptions']) {
if (isset($_SESSION['bNoShowSteps'])) { if (isset($_SESSION['bNoShowSteps'])) {
unset($_SESSION['bNoShowSteps']); unset($_SESSION['bNoShowSteps']);
} }
} else {
$_SESSION['TASK'] = -1;
} }
break; break;
default: default:

View File

@@ -560,7 +560,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
$oCase = new Cases(); $oCase = new Cases();
$aProcesses = Array (); $aProcesses = Array ();
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$c = $oCase->getAllUploadedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] ); $c = $oCase->getAllUploadedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['CURRENT_TASK'], $_SESSION['USER_LOGGED'] );
if ($c->getDbName() == 'dbarray') { if ($c->getDbName() == 'dbarray') {
$rs = ArrayBasePeer::doSelectRs( $c ); $rs = ArrayBasePeer::doSelectRs( $c );
@@ -597,7 +597,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
$oCase = new Cases(); $oCase = new Cases();
$aProcesses = Array (); $aProcesses = Array ();
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$c = $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] ); $c = $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['CURRENT_TASK'], $_SESSION['USER_LOGGED'] );
if ($c->getDbName() == 'dbarray') { if ($c->getDbName() == 'dbarray') {
$rs = ArrayBasePeer::doSelectRs( $c ); $rs = ArrayBasePeer::doSelectRs( $c );

View File

@@ -193,6 +193,19 @@ class InputDocument
$flagAssigned = true; $flagAssigned = true;
$arrayData[] = \G::LoadTranslation("ID_PROCESS_PERMISSIONS"); $arrayData[] = \G::LoadTranslation("ID_PROCESS_PERMISSIONS");
} }
//Variables
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
$criteria->add(\ProcessVariablesPeer::INP_DOC_UID, $inputDocumentUid);
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$flagAssigned = true;
$arrayData[] = \G::LoadTranslation("ID_VARIABLES");
}
//Return //Return
return array($flagAssigned, $arrayData); return array($flagAssigned, $arrayData);

View File

@@ -538,20 +538,42 @@ class Process
$trigger = new \ProcessMaker\BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
/**
* Try catch block is added to escape the exception and continue editing
* the properties of the process, otherwise there is no way to edit
* the properties that the exception is thrown: trigger nonexistent.
* The same goes for the similar blocks.
*/
if (isset($arrayData["PRO_TRI_DELETED"]) && $arrayData["PRO_TRI_DELETED"] . "" != "") { if (isset($arrayData["PRO_TRI_DELETED"]) && $arrayData["PRO_TRI_DELETED"] . "" != "") {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_DELETED"], $processUid, $this->arrayFieldNameForException["processTriDeleted"]); try {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_DELETED"], $processUid, $this->arrayFieldNameForException["processTriDeleted"]);
} catch (\Exception $e) {
}
} }
if (isset($arrayData["PRO_TRI_CANCELED"]) && $arrayData["PRO_TRI_CANCELED"] . "" != "") { if (isset($arrayData["PRO_TRI_CANCELED"]) && $arrayData["PRO_TRI_CANCELED"] . "" != "") {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_CANCELED"], $processUid, $this->arrayFieldNameForException["processTriCanceled"]); try {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_CANCELED"], $processUid, $this->arrayFieldNameForException["processTriCanceled"]);
} catch (\Exception $e) {
}
} }
if (isset($arrayData["PRO_TRI_PAUSED"]) && $arrayData["PRO_TRI_PAUSED"] . "" != "") { if (isset($arrayData["PRO_TRI_PAUSED"]) && $arrayData["PRO_TRI_PAUSED"] . "" != "") {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_PAUSED"], $processUid, $this->arrayFieldNameForException["processTriPaused"]); try {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_PAUSED"], $processUid, $this->arrayFieldNameForException["processTriPaused"]);
} catch (\Exception $e) {
}
} }
if (isset($arrayData["PRO_TRI_REASSIGNED"]) && $arrayData["PRO_TRI_REASSIGNED"] . "" != "") { if (isset($arrayData["PRO_TRI_REASSIGNED"]) && $arrayData["PRO_TRI_REASSIGNED"] . "" != "") {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_REASSIGNED"], $processUid, $this->arrayFieldNameForException["processTriReassigned"]); try {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_REASSIGNED"], $processUid, $this->arrayFieldNameForException["processTriReassigned"]);
} catch (\Exception $e) {
}
} }
if (isset($arrayData["PRO_PARENT"])) { if (isset($arrayData["PRO_PARENT"])) {

View File

@@ -715,6 +715,28 @@ class Light extends Api
return $response; return $response;
} }
/**
* Get Already Route
*
* @param string $app_uid {@min 1}{@max 32}
* @param int $cas_index
*
* @status 204
* @url GET /case/:app_uid/:cas_index
*/
public function doIfAlreadyRoute($app_uid, $cas_index)
{
try {
$oAppDelegate = new \AppDelegation();
$alreadyRouted = $oAppDelegate->alreadyRouted($app_uid, $cas_index);
if ($alreadyRouted) {
throw (new RestException(Api::STAT_APP_EXCEPTION, G::LoadTranslation('ID_CASE_DELEGATION_ALREADY_CLOSED')));
}
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/** /**
* *
* @url GET /project/:prj_uid/dynaforms * @url GET /project/:prj_uid/dynaforms

View File

@@ -543,6 +543,8 @@ Ext.onReady( function() {
iconCls: 'icon-user-add', iconCls: 'icon-user-add',
text: _('ID_ADD'), text: _('ID_ADD'),
handler: function(){ handler: function(){
Ext.getCmp('startdt').setMaxValue(0);
Ext.getCmp('enddt').setMinValue(0);
var e = new EmployeeHoliday({ var e = new EmployeeHoliday({
name: '', name: '',
startdt: (new Date()).clearTime(), startdt: (new Date()).clearTime(),

View File

@@ -35,6 +35,7 @@ itemSelected = "";
lastDir = ""; lastDir = "";
var conn = new Ext.data.Connection(); var conn = new Ext.data.Connection();
var showDirs = 'noFolders'; var showDirs = 'noFolders';
var pageSize = 25;
streamFilefromPM=function(fileStream) { streamFilefromPM=function(fileStream) {
Ext.Ajax.request({ Ext.Ajax.request({
@@ -106,7 +107,7 @@ function chDir( directory, loadGridOnly ) {
datastore.load({ datastore.load({
params:{ params:{
start: 0, start: 0,
limit: 100, limit: pageSize,
dir: directory, dir: directory,
node: directory, node: directory,
option:'gridDocuments', option:'gridDocuments',
@@ -284,6 +285,8 @@ function openActionDialog(caller, action, dataAux)
return false; return false;
} }
Ext.Ajax.timeout = 300000;
switch( action ) { switch( action ) {
case 'copyAction': case 'copyAction':
case 'edit': case 'edit':
@@ -788,7 +791,7 @@ var datastore = new Ext.data.Store({
directory : "/", directory : "/",
params : { params : {
start: 0, start: 0,
limit: 100, limit: pageSize,
dir : this.directory, dir : this.directory,
node : this.directory, node : this.directory,
option : "gridDocuments", option : "gridDocuments",
@@ -1158,7 +1161,7 @@ var gridtb = new Ext.Toolbar(
datastore.clearFilter(); datastore.clearFilter();
Ext.getCmp("filterField").setValue(""); Ext.getCmp("filterField").setValue("");
datastore.setBaseParam( 'search', ''); datastore.setBaseParam( 'search', '');
datastore.load({params:{ start : 0 , limit : 100 }}); datastore.load({params:{ start : 0 , limit : pageSize }});
} }
}) })
@@ -1166,12 +1169,12 @@ var gridtb = new Ext.Toolbar(
function filterDataStore(btn, e) { function filterDataStore(btn, e) {
var filterVal = Ext.getCmp("filterField").getValue(); var filterVal = Ext.getCmp("filterField").getValue();
datastore.setBaseParam( 'search', filterVal); datastore.setBaseParam( 'search', filterVal);
datastore.load({params:{ start : 0 , limit : 100 }}); datastore.load({params:{ start : 0 , limit : pageSize }});
} }
// add a paging toolbar to the grid's footer // add a paging toolbar to the grid's footer
var gridbb = new Ext.PagingToolbar({ var gridbb = new Ext.PagingToolbar({
store: datastore, store: datastore,
pageSize: 100, pageSize: pageSize,
displayInfo: true, displayInfo: true,
displayMsg: _("ID_DISPLAY_TOTAL"), displayMsg: _("ID_DISPLAY_TOTAL"),
emptyMsg: _("ID_DISPLAY_EMPTY"), emptyMsg: _("ID_DISPLAY_EMPTY"),
@@ -1412,7 +1415,7 @@ function loadDir() {
datastore.load({ datastore.load({
params : { params : {
start: 0, start: 0,
limit: 100, limit: pageSize,
dir : datastore.directory, dir : datastore.directory,
node : datastore.directory, node : datastore.directory,
option : 'gridDocuments', option : 'gridDocuments',

View File

@@ -1315,7 +1315,7 @@ importProcessExistGroup = function()
shortGroupList = affectedGroups; shortGroupList = affectedGroups;
} }
var processFileTypeTitle = (processFileType == "pm") ? "" : " " + processFileType; var processFileTypeTitle = (importProcessGlobal.processFileType == "pm") ? "" : " " + importProcessGlobal.processFileType;
proFileName = importProcessGlobal.proFileName; proFileName = importProcessGlobal.proFileName;
groupBeforeAccion = importProcessGlobal.groupBeforeAccion; groupBeforeAccion = importProcessGlobal.groupBeforeAccion;
@@ -1529,7 +1529,7 @@ affectedGroupsList = function()
importProcessExistProcess = function() importProcessExistProcess = function()
{ {
var processFileTypeTitle = (processFileType == "pm") ? "" : " " + processFileType; var processFileTypeTitle = (importProcessGlobal.processFileType == "pm") ? "" : " " + importProcessGlobal.processFileType;
var processFileType = importProcessGlobal.processFileType; var processFileType = importProcessGlobal.processFileType;
var proFileName = importProcessGlobal.proFileName; var proFileName = importProcessGlobal.proFileName;

View File

@@ -3,10 +3,10 @@
<TITLE type="title"> <TITLE type="title">
<en><![CDATA[I forgot my password]]></en> <en><![CDATA[I forgot my password]]></en>
</TITLE> </TITLE>
<USR_USERNAME type="text" size="30" maxlength="50" required="true" validate="Any" autocomplete="0"> <USR_USERNAME type="text" size="30" maxlength="100" required="true" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en> <en><![CDATA[User]]></en>
</USR_USERNAME> </USR_USERNAME>
<USR_EMAIL type="text" size="30" required="true" maxlength="32" autocomplete="0"> <USR_EMAIL type="text" size="30" required="true" maxlength="100" autocomplete="0">
<en><![CDATA[Email]]></en> <en><![CDATA[Email]]></en>
</USR_EMAIL> </USR_EMAIL>
<URL type="hidden"/> <URL type="hidden"/>

View File

@@ -3,7 +3,7 @@
<TITLE type="title"> <TITLE type="title">
<en><![CDATA[I forgot my password]]></en> <en><![CDATA[I forgot my password]]></en>
</TITLE> </TITLE>
<USR_USERNAME type="text" size="30" maxlength="50" required="true" validate="Any" autocomplete="0"> <USR_USERNAME type="text" size="30" maxlength="100" required="true" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en> <en><![CDATA[User]]></en>
</USR_USERNAME> </USR_USERNAME>
<USR_EMAIL type="text" size="30" required="true" maxlength="100" autocomplete="0"> <USR_EMAIL type="text" size="30" required="true" maxlength="100" autocomplete="0">