@@ -56,7 +56,7 @@ class Derivation
|
||||
*
|
||||
* return array Return array
|
||||
*/
|
||||
public function prepareInformationTask(array $arrayTaskData)
|
||||
private function prepareInformationTask(array $arrayTaskData)
|
||||
{
|
||||
try {
|
||||
$task = new Task();
|
||||
@@ -112,7 +112,9 @@ class Derivation
|
||||
$arrayTaskData["NEXT_TASK"]["TAS_PARENT"] = "";
|
||||
}
|
||||
|
||||
$arrayTaskData["NEXT_TASK"]["USER_ASSIGNED"] = (!in_array($arrayTaskData["NEXT_TASK"]["TAS_TYPE"], array("GATEWAYTOGATEWAY", "END-MESSAGE-EVENT", "SCRIPT-TASK", "INTERMEDIATE-CATCH-TIMER-EVENT", "END-EMAIL-EVENT")))? $this->getNextAssignedUser($arrayTaskData) : array("USR_UID" => "", "USR_FULLNAME" => "");
|
||||
$regexpTaskTypeToExclude = "GATEWAYTOGATEWAY|END-MESSAGE-EVENT|SCRIPT-TASK|INTERMEDIATE-CATCH-TIMER-EVENT|END-EMAIL-EVENT";
|
||||
|
||||
$arrayTaskData["NEXT_TASK"]["USER_ASSIGNED"] = (!preg_match("/^(?:" . $regexpTaskTypeToExclude . ")$/", $arrayTaskData["NEXT_TASK"]["TAS_TYPE"]))? $this->getNextAssignedUser($arrayTaskData) : array("USR_UID" => "", "USR_FULLNAME" => "");
|
||||
}
|
||||
|
||||
//Return
|
||||
@@ -226,7 +228,7 @@ class Derivation
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($arrayNextTask) && !empty($arrayNextTaskDefault)) {
|
||||
if (count($arrayNextTask) == 0 && count($arrayNextTaskDefault) > 0) {
|
||||
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayNextTaskDefault);
|
||||
}
|
||||
|
||||
@@ -480,10 +482,26 @@ class Derivation
|
||||
//}
|
||||
///* End - Verify if the next Task is set with the option "TAS_ASSIGN_LOCATION == TRUE" */
|
||||
|
||||
$uidUser = '';
|
||||
switch ($nextAssignedTask['TAS_ASSIGN_TYPE']) {
|
||||
$taskNext = TaskPeer::retrieveByPK($nextAssignedTask["TAS_UID"]);
|
||||
$bpmnActivityNext = BpmnActivityPeer::retrieveByPK($nextAssignedTask["TAS_UID"]);
|
||||
|
||||
$flagTaskNextIsMultipleInstance = false;
|
||||
$flagTaskNextAssignTypeIsMultipleInstance = false;
|
||||
|
||||
if (!is_null($taskNext) && !is_null($bpmnActivityNext)) {
|
||||
$flagTaskNextIsMultipleInstance = $bpmnActivityNext->getActType() == "TASK" && preg_match("/^(?:EMPTY|USERTASK|MANUALTASK)$/", $bpmnActivityNext->getActTaskType()) && $bpmnActivityNext->getActLoopType() == "PARALLEL";
|
||||
$flagTaskNextAssignTypeIsMultipleInstance = preg_match("/^(?:MULTIPLE_INSTANCE|MULTIPLE_INSTANCE_VALUE_BASED)$/", $taskNext->getTasAssignType());
|
||||
}
|
||||
|
||||
$taskNextAssignType = $taskNext->getTasAssignType();
|
||||
$taskNextAssignType = ($flagTaskNextIsMultipleInstance && !$flagTaskNextAssignTypeIsMultipleInstance)? "" : $taskNextAssignType;
|
||||
$taskNextAssignType = (!$flagTaskNextIsMultipleInstance && $flagTaskNextAssignTypeIsMultipleInstance)? "" : $taskNextAssignType;
|
||||
|
||||
switch ($taskNextAssignType) {
|
||||
case 'BALANCED':
|
||||
$users = $this->getAllUsersFromAnyTask( $sTasUid );
|
||||
$uidUser = "";
|
||||
|
||||
if (is_array( $users ) && count( $users ) > 0) {
|
||||
//to do apply any filter like LOCATION assignment
|
||||
$uidUser = $users[0];
|
||||
@@ -553,8 +571,25 @@ class Derivation
|
||||
$userFields['USR_LASTNAME'] = '';
|
||||
$userFields['USR_EMAIL'] = '';
|
||||
break;
|
||||
case "MULTIPLE_INSTANCE":
|
||||
$userFields = $this->getUsersFullNameFromArray($this->getAllUsersFromAnyTask($nextAssignedTask["TAS_UID"]));
|
||||
break;
|
||||
case "MULTIPLE_INSTANCE_VALUE_BASED":
|
||||
$arrayApplicationData = $this->case->loadCase($tasInfo["APP_UID"]);
|
||||
|
||||
$nextTaskAssignVariable = trim($nextAssignedTask["TAS_ASSIGN_VARIABLE"], " @#");
|
||||
|
||||
if ($nextTaskAssignVariable != "" &&
|
||||
isset($arrayApplicationData["APP_DATA"][$nextTaskAssignVariable]) && !empty($arrayApplicationData["APP_DATA"][$nextTaskAssignVariable]) && is_array($arrayApplicationData["APP_DATA"][$nextTaskAssignVariable])
|
||||
) {
|
||||
$userFields = $this->getUsersFullNameFromArray($arrayApplicationData["APP_DATA"][$nextTaskAssignVariable]);
|
||||
} else {
|
||||
throw new Exception(G::LoadTranslation("ID_ACTIVITY_INVALID_USER_DATA_VARIABLE_FOR_MULTIPLE_INSTANCE_ACTIVITY", array(strtolower("ACT_UID"), $nextAssignedTask["TAS_UID"], $nextTaskAssignVariable)));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw (new Exception( 'Invalid Task Assignment method for Next Task ' ));
|
||||
break;
|
||||
}
|
||||
return $userFields;
|
||||
}
|
||||
@@ -595,6 +630,86 @@ class Derivation
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update counters
|
||||
*
|
||||
* @param array $arrayCurrentDelegationData
|
||||
* @param array $arrayNextDelegationData
|
||||
* @param mixed $taskNextDelegation
|
||||
* @param array $arrayApplicationData
|
||||
* @param int $delIndexNew
|
||||
* @param mixed $aSp
|
||||
* @param bool $removeList
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
private function derivateUpdateCounters(array $arrayCurrentDelegationData, array $arrayNextDelegationData, $taskNextDelegation, array $arrayApplicationData, $delIndexNew, $aSp, $removeList)
|
||||
{
|
||||
/*----------------------------------********---------------------------------*/
|
||||
try {
|
||||
$user = new Users();
|
||||
|
||||
if ($arrayNextDelegationData["TAS_UID"] == "-2") {
|
||||
$application = ApplicationPeer::retrieveByPK($arrayApplicationData["APP_UID"]);
|
||||
|
||||
if ($application->getAppStatus() == "DRAFT") {
|
||||
$user->refreshTotal($arrayApplicationData["CURRENT_USER_UID"], "remove", "draft");
|
||||
} else {
|
||||
$user->refreshTotal($arrayApplicationData["CURRENT_USER_UID"], "remove", "inbox");
|
||||
}
|
||||
} else {
|
||||
if ($arrayNextDelegationData["TAS_UID"] != "-1") {
|
||||
$regexpTaskTypeToExclude = "WEBENTRYEVENT|END-MESSAGE-EVENT|START-MESSAGE-EVENT|INTERMEDIATE-THROW-MESSAGE-EVENT|INTERMEDIATE-CATCH-MESSAGE-EVENT|SCRIPT-TASK|INTERMEDIATE-CATCH-TIMER-EVENT";
|
||||
|
||||
if (!preg_match("/^(?:" . $regexpTaskTypeToExclude . ")$/", $taskNextDelegation->getTasType())) {
|
||||
if (!empty($delIndexNew) && empty($aSp)) {
|
||||
$appDelegation = AppDelegationPeer::retrieveByPK($arrayApplicationData["APP_UID"], $delIndexNew);
|
||||
$arrayApplicationData2 = $appDelegation->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$arrayApplicationData2["APP_STATUS"] = $arrayCurrentDelegationData["APP_STATUS"];
|
||||
|
||||
$taskCurrent = TaskPeer::retrieveByPK($arrayCurrentDelegationData["TAS_UID"]);
|
||||
|
||||
if ($taskCurrent->getTasType() == "INTERMEDIATE-CATCH-MESSAGE-EVENT") {
|
||||
$removeList = false;
|
||||
}
|
||||
|
||||
$arrayApplicationData2["REMOVED_LIST"] = $removeList;
|
||||
|
||||
$inbox = new ListInbox();
|
||||
$inbox->newRow($arrayApplicationData2, $arrayApplicationData["CURRENT_USER_UID"], false, array(), (($arrayNextDelegationData["TAS_ASSIGN_TYPE"] == "SELF_SERVICE")? true : false));
|
||||
} else {
|
||||
if (empty($aSp)) {
|
||||
$application = ApplicationPeer::retrieveByPK($arrayApplicationData["APP_UID"]);
|
||||
|
||||
if ($application->getAppStatus() == "DRAFT") {
|
||||
$user->refreshTotal($arrayApplicationData["CURRENT_USER_UID"], "remove", "draft");
|
||||
} else {
|
||||
$user->refreshTotal($arrayApplicationData["CURRENT_USER_UID"], "remove", "inbox");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$regexpTaskTypeToExclude = "SCRIPT-TASK";
|
||||
|
||||
if (!preg_match("/^(?:" . $regexpTaskTypeToExclude . ")$/", $taskNextDelegation->getTasType()) && $removeList) {
|
||||
$application = ApplicationPeer::retrieveByPK($arrayApplicationData["APP_UID"]);
|
||||
|
||||
if ($application->getAppStatus() == "DRAFT") {
|
||||
$user->refreshTotal($arrayApplicationData["CURRENT_USER_UID"], "remove", "draft");
|
||||
} else {
|
||||
$user->refreshTotal($arrayApplicationData["CURRENT_USER_UID"], "remove", "inbox");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
/* derivate
|
||||
*
|
||||
* @param array $currentDelegation
|
||||
@@ -621,6 +736,15 @@ class Derivation
|
||||
|
||||
//Get data for current delegation (current Task)
|
||||
$task = TaskPeer::retrieveByPK($currentDelegation["TAS_UID"]);
|
||||
$bpmnActivity = BpmnActivityPeer::retrieveByPK($currentDelegation["TAS_UID"]);
|
||||
|
||||
$flagTaskIsMultipleInstance = false;
|
||||
$flagTaskAssignTypeIsMultipleInstance = false;
|
||||
|
||||
if (!is_null($task) && !is_null($bpmnActivity)) {
|
||||
$flagTaskIsMultipleInstance = $bpmnActivity->getActType() == "TASK" && preg_match("/^(?:EMPTY|USERTASK|MANUALTASK)$/", $bpmnActivity->getActTaskType()) && $bpmnActivity->getActLoopType() == "PARALLEL";
|
||||
$flagTaskAssignTypeIsMultipleInstance = preg_match("/^(?:MULTIPLE_INSTANCE|MULTIPLE_INSTANCE_VALUE_BASED)$/", $task->getTasAssignType());
|
||||
}
|
||||
|
||||
$currentDelegation["TAS_ASSIGN_TYPE"] = $task->getTasAssignType();
|
||||
$currentDelegation["TAS_MI_COMPLETE_VARIABLE"] = $task->getTasMiCompleteVariable();
|
||||
@@ -666,6 +790,17 @@ class Derivation
|
||||
}
|
||||
|
||||
$taskNextDel = TaskPeer::retrieveByPK($nextDel["TAS_UID"]); //Get data for next delegation (next Task)
|
||||
$bpmnActivityNextDel = BpmnActivityPeer::retrieveByPK($nextDel["TAS_UID"]);
|
||||
|
||||
$flagTaskNextDelIsMultipleInstance = false;
|
||||
$flagTaskNextDelAssignTypeIsMultipleInstance = false;
|
||||
|
||||
if (!is_null($taskNextDel) && !is_null($bpmnActivityNextDel)) {
|
||||
$flagTaskNextDelIsMultipleInstance = $bpmnActivityNextDel->getActType() == "TASK" && preg_match("/^(?:EMPTY|USERTASK|MANUALTASK)$/", $bpmnActivityNextDel->getActTaskType()) && $bpmnActivityNextDel->getActLoopType() == "PARALLEL";
|
||||
$flagTaskNextDelAssignTypeIsMultipleInstance = preg_match("/^(?:MULTIPLE_INSTANCE|MULTIPLE_INSTANCE_VALUE_BASED)$/", $taskNextDel->getTasAssignType());
|
||||
}
|
||||
|
||||
$flagUpdateCounters = true;
|
||||
|
||||
switch ($nextDel['TAS_UID']) {
|
||||
case TASK_FINISH_PROCESS:
|
||||
@@ -699,12 +834,13 @@ class Derivation
|
||||
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
||||
break;
|
||||
default:
|
||||
// get all siblingThreads
|
||||
//if($currentDelegation['TAS_ASSIGN_TYPE'] == 'STATIC_MI')
|
||||
//Get all siblingThreads
|
||||
$canDerivate = false;
|
||||
|
||||
switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
|
||||
case 'CANCEL_MI':
|
||||
case 'STATIC_MI':
|
||||
$siblingThreads = $this->case->GetAllOpenDelegation( $currentDelegation );
|
||||
$arrayOpenThread = $this->case->GetAllOpenDelegation($currentDelegation);
|
||||
$aData = $this->case->loadCase( $currentDelegation['APP_UID'] );
|
||||
|
||||
if (isset( $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'] )] )) {
|
||||
@@ -722,21 +858,29 @@ class Derivation
|
||||
$discriminateThread = $sMIinstanceVar - $sMIcompleteVar;
|
||||
|
||||
// -1 because One App Delegation is closed by above Code
|
||||
if ($discriminateThread == count( $siblingThreads )) {
|
||||
if ($discriminateThread == count($arrayOpenThread)) {
|
||||
$canDerivate = true;
|
||||
} else {
|
||||
$canDerivate = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ($currentDelegation["ROU_TYPE"] == "SEC-JOIN") {
|
||||
$siblingThreads = $this->case->getOpenSiblingThreads($nextDel["TAS_UID"], $currentDelegation["APP_UID"], $currentDelegation["DEL_INDEX"], $currentDelegation["TAS_UID"]);
|
||||
$routeType = $currentDelegation["ROU_TYPE"];
|
||||
$routeType = ($flagTaskIsMultipleInstance && $flagTaskAssignTypeIsMultipleInstance)? "SEC-JOIN" : $routeType;
|
||||
|
||||
$canDerivate = empty($siblingThreads);
|
||||
} else {
|
||||
$canDerivate = true;
|
||||
switch ($routeType) {
|
||||
case "SEC-JOIN":
|
||||
$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"]));
|
||||
|
||||
$canDerivate = empty($arrayOpenThread);
|
||||
break;
|
||||
default:
|
||||
$canDerivate = true;
|
||||
break;
|
||||
}
|
||||
} //end switch
|
||||
break;
|
||||
}
|
||||
|
||||
if ($canDerivate) {
|
||||
//Throw Message-Events
|
||||
@@ -750,9 +894,35 @@ class Derivation
|
||||
$emailEvent->emailEventBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID"], $appFields);
|
||||
|
||||
//Derivate
|
||||
$aSP = isset( $aSP ) ? $aSP : null;
|
||||
$aSP = (isset($aSP))? $aSP : null;
|
||||
|
||||
$iNewDelIndex = $this->doDerivation( $currentDelegation, $nextDel, $appFields, $aSP );
|
||||
$taskNextDelAssignType = ($flagTaskNextDelIsMultipleInstance && $flagTaskNextDelAssignTypeIsMultipleInstance)? $taskNextDel->getTasAssignType() : "";
|
||||
|
||||
switch ($taskNextDelAssignType) {
|
||||
case "MULTIPLE_INSTANCE":
|
||||
case "MULTIPLE_INSTANCE_VALUE_BASED":
|
||||
$arrayUser = $this->getNextAssignedUser(array("APP_UID" => $currentDelegation["APP_UID"], "NEXT_TASK" => $taskNextDel->toArray(BasePeer::TYPE_FIELDNAME)));
|
||||
|
||||
if (empty($arrayUser)) {
|
||||
throw new Exception(G::LoadTranslation("ID_NO_USERS"));
|
||||
}
|
||||
|
||||
foreach ($arrayUser as $value2) {
|
||||
$currentDelegationAux = array_merge($currentDelegation, array("ROU_TYPE" => "PARALLEL"));
|
||||
$nextDelAux = array_merge($nextDel, array("USR_UID" => $value2["USR_UID"]));
|
||||
|
||||
$iNewDelIndex = $this->doDerivation($currentDelegationAux, $nextDelAux, $appFields, $aSP);
|
||||
|
||||
$this->derivateUpdateCounters($currentDelegationAux, $nextDelAux, $taskNextDel, $appFields, $iNewDelIndex, $aSP, $removeList);
|
||||
|
||||
$flagUpdateCounters = false;
|
||||
$removeList = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$iNewDelIndex = $this->doDerivation($currentDelegation, $nextDel, $appFields, $aSP);
|
||||
break;
|
||||
}
|
||||
|
||||
//Execute Script-Task
|
||||
$scriptTask = new \ProcessMaker\BusinessModel\ScriptTask();
|
||||
@@ -760,9 +930,9 @@ class Derivation
|
||||
$appFields["APP_DATA"] = $scriptTask->execScriptByActivityUid($nextDel["TAS_UID"], $appFields);
|
||||
|
||||
//Create record in table APP_ASSIGN_SELF_SERVICE_VALUE
|
||||
$arrayTaskTypeToExclude = array("SCRIPT-TASK");
|
||||
$regexpTaskTypeToExclude = "SCRIPT-TASK";
|
||||
|
||||
if (!in_array($taskNextDel->getTasType(), $arrayTaskTypeToExclude)) {
|
||||
if (!is_null($taskNextDel) && !preg_match("/^(?:" . $regexpTaskTypeToExclude . ")$/", $taskNextDel->getTasType())) {
|
||||
if ($taskNextDel->getTasAssignType() == "SELF_SERVICE" && trim($taskNextDel->getTasGroupVariable()) != "") {
|
||||
$nextTaskGroupVariable = trim($taskNextDel->getTasGroupVariable(), " @#");
|
||||
|
||||
@@ -780,7 +950,7 @@ class Derivation
|
||||
}
|
||||
|
||||
//Check if $taskNextDel is Script-Task
|
||||
if ($taskNextDel->getTasType() == "SCRIPT-TASK") {
|
||||
if (!is_null($taskNextDel) && $taskNextDel->getTasType() == "SCRIPT-TASK") {
|
||||
$this->case->CloseCurrentDelegation($currentDelegation["APP_UID"], $iNewDelIndex);
|
||||
|
||||
//Get for $nextDel["TAS_UID"] your next Task
|
||||
@@ -807,7 +977,11 @@ class Derivation
|
||||
} else {
|
||||
//when the task doesnt generate a new AppDelegation
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
switch ($currentDelegation['ROU_TYPE']) {
|
||||
|
||||
$routeType = $currentDelegation["ROU_TYPE"];
|
||||
$routeType = ($flagTaskIsMultipleInstance && $flagTaskAssignTypeIsMultipleInstance)? "SEC-JOIN" : $routeType;
|
||||
|
||||
switch ($routeType) {
|
||||
case 'SEC-JOIN':
|
||||
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
||||
break;
|
||||
@@ -816,74 +990,19 @@ class Derivation
|
||||
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
||||
}
|
||||
break;
|
||||
} //switch
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//SETS THE APP_PROC_CODE
|
||||
//if (isset($nextDel['TAS_DEF_PROC_CODE']))
|
||||
//$appFields['APP_PROC_CODE'] = $nextDel['TAS_DEF_PROC_CODE'];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($nextDel['TAS_UID'] == '-2') {
|
||||
$oRow = ApplicationPeer::retrieveByPK($appFields['APP_UID']);
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$users = new Users();
|
||||
if ($aFields['APP_STATUS'] == 'DRAFT') {
|
||||
$users->refreshTotal($appFields['CURRENT_USER_UID'], 'remove', 'draft');
|
||||
} else {
|
||||
$users->refreshTotal($appFields['CURRENT_USER_UID'], 'remove', 'inbox');
|
||||
}
|
||||
} elseif ($nextDel['TAS_UID'] != '-1') {
|
||||
$arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT", "SCRIPT-TASK", "INTERMEDIATE-CATCH-TIMER-EVENT");
|
||||
|
||||
if (!in_array($taskNextDel->getTasType(), $arrayTaskTypeToExclude)) {
|
||||
if (!empty($iNewDelIndex) && empty($aSP)) {
|
||||
$oAppDel = AppDelegationPeer::retrieveByPK( $appFields['APP_UID'], $iNewDelIndex );
|
||||
$aFields = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$aFields['APP_STATUS'] = $currentDelegation['APP_STATUS'];
|
||||
$taskCur = TaskPeer::retrieveByPK($currentDelegation['TAS_UID']);
|
||||
$aTaskCur = $taskCur->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
if ($aTaskCur['TAS_TYPE'] == "INTERMEDIATE-CATCH-MESSAGE-EVENT") {
|
||||
$removeList = false;
|
||||
}
|
||||
$aFields['REMOVED_LIST'] = $removeList;
|
||||
$inbox = new ListInbox();
|
||||
$inbox->newRow($aFields, $appFields['CURRENT_USER_UID'], false, array(), ($nextDel['TAS_ASSIGN_TYPE'] == 'SELF_SERVICE' ? true : false));
|
||||
} else {
|
||||
if (empty($aSP)) {
|
||||
$oRow = ApplicationPeer::retrieveByPK($appFields['APP_UID']);
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$users = new Users();
|
||||
if ($aFields['APP_STATUS'] == 'DRAFT') {
|
||||
$users->refreshTotal($appFields['CURRENT_USER_UID'], 'remove', 'draft');
|
||||
} else {
|
||||
$users->refreshTotal($appFields['CURRENT_USER_UID'], 'remove', 'inbox');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$arrayTaskTypeToExclude = array("SCRIPT-TASK");
|
||||
|
||||
if ($removeList && !in_array($taskNextDel->getTasType(), $arrayTaskTypeToExclude)) {
|
||||
$oRow = ApplicationPeer::retrieveByPK($appFields["APP_UID"]);
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
|
||||
$users = new Users();
|
||||
|
||||
if ($aFields["APP_STATUS"] == "DRAFT") {
|
||||
$users->refreshTotal($appFields["CURRENT_USER_UID"], "remove", "draft");
|
||||
} else {
|
||||
$users->refreshTotal($appFields["CURRENT_USER_UID"], "remove", "inbox");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($flagUpdateCounters) {
|
||||
$this->derivateUpdateCounters($currentDelegation, $nextDel, $taskNextDel, $appFields, (isset($iNewDelIndex))? $iNewDelIndex : 0, (isset($aSP))? $aSP : null, $removeList);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
unset( $aSP );
|
||||
|
||||
$removeList = false;
|
||||
} //end foreach
|
||||
|
||||
unset($aSP);
|
||||
}
|
||||
|
||||
/* Start Block : UPDATES APPLICATION */
|
||||
|
||||
@@ -893,7 +1012,7 @@ class Derivation
|
||||
$openThreads = $this->case->GetOpenThreads( $currentDelegation['APP_UID'] );
|
||||
|
||||
///////
|
||||
$sw = 0;
|
||||
$flag = false;
|
||||
|
||||
if ($openThreads == 0) {
|
||||
//Close case
|
||||
@@ -901,17 +1020,17 @@ class Derivation
|
||||
$appFields["APP_FINISH_DATE"] = "now";
|
||||
$this->verifyIsCaseChild($currentDelegation["APP_UID"], $currentDelegation["DEL_INDEX"]);
|
||||
|
||||
$sw = 1;
|
||||
$flag = true;
|
||||
}
|
||||
|
||||
if (isset( $iNewDelIndex )) {
|
||||
$appFields["DEL_INDEX"] = $iNewDelIndex;
|
||||
$appFields["TAS_UID"] = $nextDel["TAS_UID"];
|
||||
|
||||
$sw = 1;
|
||||
$flag = true;
|
||||
}
|
||||
|
||||
if ($sw == 1) {
|
||||
if ($flag) {
|
||||
//Start Block : UPDATES APPLICATION
|
||||
$this->case->updateCase( $currentDelegation["APP_UID"], $appFields );
|
||||
//End Block : UPDATES APPLICATION
|
||||
|
||||
@@ -379,6 +379,17 @@ class PMPlugin
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->enableRestService($this->sNamespace, $enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* With this function we can register new options to designer menu
|
||||
* param string $menuOptionsFile
|
||||
* @return void
|
||||
*/
|
||||
public function registerDesignerNewOption($menuOptionsFile)
|
||||
{
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->registerDesignerNewOption($this->sNamespace, $menuOptionsFile);
|
||||
}
|
||||
}
|
||||
|
||||
class menuDetail
|
||||
@@ -718,3 +729,21 @@ class cronFile
|
||||
$this->cronFile = $cronFile;
|
||||
}
|
||||
}
|
||||
|
||||
class menuOptionFile
|
||||
{
|
||||
public $namespace;
|
||||
public $menuOptionFile;
|
||||
|
||||
/**
|
||||
* This function is the constructor of the cronFile class
|
||||
* param string $namespace
|
||||
* param string $menuOptionFile
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($namespace, $menuOptionFile)
|
||||
{
|
||||
$this->namespace = $namespace;
|
||||
$this->menuOptionFile = $menuOptionFile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ class PMPluginRegistry
|
||||
private $_aTaskExtendedProperties = array ();
|
||||
private $_aDashboardPages = array ();
|
||||
private $_aCronFiles = array ();
|
||||
private $_aDesignerMenuFiles = array ();
|
||||
|
||||
/**
|
||||
* Registry a plugin javascript to include with js core at same runtime
|
||||
@@ -391,6 +392,11 @@ class PMPluginRegistry
|
||||
unset( $this->_aDashboardPages[$key] );
|
||||
}
|
||||
}
|
||||
foreach ($this->_aDesignerMenuFiles as $key => $detail) {
|
||||
if ($detail->namespace == $sNamespace) {
|
||||
unset( $this->_aDesignerMenuFiles[$key] );
|
||||
}
|
||||
}
|
||||
|
||||
//unregistering javascripts from this plugin
|
||||
$this->unregisterJavascripts( $sNamespace );
|
||||
@@ -1601,4 +1607,35 @@ class PMPluginRegistry
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register new options to designer menu
|
||||
*
|
||||
* @param unknown_type $namespace
|
||||
* @param unknown_type $cronFile
|
||||
*/
|
||||
public function registerDesignerNewOption ($namespace, $menuOptionFile)
|
||||
{
|
||||
$found = false;
|
||||
foreach ($this->_aDesignerMenuFiles as $row => $detail) {
|
||||
if ($menuOptionFile == $detail->menuOptionFile && $namespace == $detail->namespace) {
|
||||
$detail->menuOptionFile = $menuOptionFile;
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$menuOptionFile = new menuOptionFile( $namespace, $menuOptionFile );
|
||||
$this->_aDesignerMenuFiles[] = $menuOptionFile;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all designer menu Option files registered
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDesignerNewOption()
|
||||
{
|
||||
return $this->_aDesignerMenuFiles;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ class pmDynaform
|
||||
array_push($json->optionsSql, $option);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (isset($json->options[0])) {
|
||||
@@ -475,6 +475,55 @@ class pmDynaform
|
||||
exit();
|
||||
}
|
||||
|
||||
public function printEditSupervisor()
|
||||
{
|
||||
ob_clean();
|
||||
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
|
||||
$msg = "";
|
||||
|
||||
if (isset($_SESSION["G_MESSAGE_TYPE"]) && isset($_SESSION["G_MESSAGE"])) {
|
||||
$msg = "<div style=\"margin: 1.2em; border: 1px solid #3C763D; padding: 0.5em; background: #B2D3B3;\"><strong>" . G::LoadTranslation("ID_INFO") . "</strong>: " . $_SESSION["G_MESSAGE"] . "</div>";
|
||||
|
||||
unset($_SESSION["G_MESSAGE_TYPE"]);
|
||||
unset($_SESSION["G_MESSAGE"]);
|
||||
}
|
||||
|
||||
$javascrip = "
|
||||
<script type=\"text/javascript\">
|
||||
var jsondata = " . G::json_encode($json) . ";
|
||||
var pm_run_outside_main_app = null;
|
||||
var dyn_uid = \"" . $this->fields["CURRENT_DYNAFORM"] . "\";
|
||||
var __DynaformName__ = \"" . $this->fields["PRO_UID"] . "_" . $this->fields["CURRENT_DYNAFORM"] . "\";
|
||||
var app_uid = \"" . $this->fields["APP_UID"] . "\";
|
||||
var prj_uid = \"" . $this->fields["PRO_UID"] . "\";
|
||||
var step_mode = null;
|
||||
var workspace = \"" . SYS_SYS . "\";
|
||||
var credentials = " . G::json_encode($this->credentials) . ";
|
||||
var filePost = \"cases_SaveDataSupervisor?UID=" . $this->fields["CURRENT_DYNAFORM"] . "\";
|
||||
var fieldsRequired = null;
|
||||
var triggerDebug = null;
|
||||
</script>
|
||||
|
||||
<script type=\"text/javascript\" src=\"/jscore/cases/core/pmDynaform.js\"></script>
|
||||
|
||||
<div>
|
||||
$msg
|
||||
<div style=\"display: none;\">
|
||||
<a id=\"dyn_forward\" href=\"javascript:;\"></a>
|
||||
</div>
|
||||
</div>
|
||||
";
|
||||
|
||||
$file = file_get_contents(PATH_HOME . "public_html" . PATH_SEP . "lib" . PATH_SEP . "pmdynaform" . PATH_SEP . "build" . PATH_SEP . "pmdynaform.html");
|
||||
$file = str_replace("{javascript}", $javascrip, $file);
|
||||
|
||||
echo $file;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
public function printWebEntry($filename)
|
||||
{
|
||||
ob_clean();
|
||||
@@ -967,3 +1016,4 @@ class pmDynaform
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1409,7 +1409,7 @@ function WSUnpauseCase ($caseUid, $delIndex, $userUid)
|
||||
*
|
||||
* Add a case note.
|
||||
*
|
||||
* @name WSAddACaseNote
|
||||
* @name WSAddCaseNote
|
||||
* @label WS Add a case note
|
||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#WSAddCaseNote.28.29
|
||||
*
|
||||
@@ -1546,7 +1546,7 @@ function PMFUserList () //its test was successfull
|
||||
*
|
||||
* Add an Input Document.
|
||||
*
|
||||
* @name PMFAddAnInputDocument
|
||||
* @name PMFAddInputDocument
|
||||
* @label PMF Add an input document
|
||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddInputDocument.28.29
|
||||
*
|
||||
@@ -2780,7 +2780,7 @@ function PMFUnpauseCase ($caseUid, $delIndex, $userUid)
|
||||
*
|
||||
* Add a case note.
|
||||
*
|
||||
* @name PMFAddACaseNote
|
||||
* @name PMFAddCaseNote
|
||||
* @label PMF Add a case note
|
||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddCaseNote.28.29
|
||||
*
|
||||
|
||||
@@ -240,7 +240,7 @@ class ReportTables
|
||||
if (! isset( $aData[$aField['sFieldName']] )) {
|
||||
$aData[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aData[$aField['sFieldName']] ) ? mysql_real_escape_string( $aData[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset( $aData[$aField['sFieldName']] ) ? @mysql_real_escape_string( $aData[$aField['sFieldName']] ) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$value = (isset( $aData[$aField['sFieldName']] ) && trim( $aData[$aField['sFieldName']] )) != '' ? "'" . $aData[$aField['sFieldName']] . "'" : 'NULL';
|
||||
@@ -599,12 +599,15 @@ class ReportTables
|
||||
case 'text':
|
||||
if (! isset( $aFields[$aField['sFieldName']] )) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
|
||||
}
|
||||
if(is_array($aFields[$aField['sFieldName']])){
|
||||
$sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']][0] : '') . "',";
|
||||
}else{
|
||||
$sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? @mysql_real_escape_string( $aFields[$aField['sFieldName']] ) : '') . "',";
|
||||
if($aFields[$aField['sFieldName']] == $aFields[$aField['sFieldName'].'_label']){
|
||||
$sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? @mysql_real_escape_string( $aFields[$aField['sFieldName']] ) : '') . "',";
|
||||
}else{
|
||||
$sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? @mysql_real_escape_string( $aFields[$aField['sFieldName'].'_label'] ) : '') . "',";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'date':
|
||||
|
||||
@@ -129,6 +129,21 @@ class Language extends BaseLanguage
|
||||
public function import ($sLanguageFile, $updateXml = true, $updateDB = true, $generateMafe = true)
|
||||
{
|
||||
try {
|
||||
|
||||
//get labels MichelangeloFE
|
||||
try {
|
||||
$oTranslation = new Translation();
|
||||
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
|
||||
if (file_exists($MichelangeloFE)) {
|
||||
$labels = self::readLabelsDirectory($MichelangeloFE, true);
|
||||
foreach ($labels as $label) {
|
||||
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
G::LoadSystem( 'i18n_po' );
|
||||
$POFile = new i18n_PO( $sLanguageFile );
|
||||
$POFile->readInit();
|
||||
@@ -297,8 +312,8 @@ class Language extends BaseLanguage
|
||||
try {
|
||||
$oTranslation = new Translation();
|
||||
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
|
||||
if ($_GET['LOCALE'] === "en" & file_exists($MichelangeloFE)) {
|
||||
$labels = $this->readLabelsDirectory($MichelangeloFE, true);
|
||||
if (file_exists($MichelangeloFE)) {
|
||||
$labels = self::readLabelsDirectory($MichelangeloFE, true);
|
||||
foreach ($labels as $label) {
|
||||
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
||||
}
|
||||
@@ -824,23 +839,23 @@ class Language extends BaseLanguage
|
||||
}
|
||||
}
|
||||
|
||||
public function readLabelsDirectory($path, $unique = false)
|
||||
public static function readLabelsDirectory($path, $unique = false)
|
||||
{
|
||||
$labels = array();
|
||||
$items = opendir($path);
|
||||
while (false !== ($item = readdir($items))) {
|
||||
$a = $path . "/" . $item;
|
||||
if ($item !== "." && $item !== ".." && is_dir($a)) {
|
||||
$labels = array_merge($labels, $this->readLabelsDirectory($a, false));
|
||||
$labels = array_merge($labels, self::readLabelsDirectory($a, false));
|
||||
}
|
||||
if (is_file($a)) {
|
||||
$info = pathinfo($a);
|
||||
if ($info["extension"] === "js" || $info["extension"] === "JS") {
|
||||
$file = file_get_contents($a);
|
||||
//search string 'xx\'xx\'xx'.translate()
|
||||
$labels = array_merge($labels, $this->readLabelsFile($file, "'"));
|
||||
$labels = array_merge($labels, self::readLabelsFile($file, "'"));
|
||||
//search string "xx\"xx\"xx".translate()
|
||||
$labels = array_merge($labels, $this->readLabelsFile($file, "\""));
|
||||
$labels = array_merge($labels, self::readLabelsFile($file, "\""));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -851,7 +866,7 @@ class Language extends BaseLanguage
|
||||
return $labels;
|
||||
}
|
||||
|
||||
public function readLabelsFile($file, $sep)
|
||||
public static function readLabelsFile($file, $sep)
|
||||
{
|
||||
$labels = array();
|
||||
$k = 0;
|
||||
|
||||
@@ -121,7 +121,9 @@ class ListInbox extends BaseListInbox
|
||||
$users->refreshTotal($data['USR_UID'], 'add', 'participated');
|
||||
}
|
||||
|
||||
$data['DEL_PRIORITY'] = $this->getTaskPriority($data['TAS_UID'], $data['PRO_UID'], $data["APP_UID"]);
|
||||
if((array_key_exists('TAS_UID', $data) && isset($data['TAS_UID'])) && (array_key_exists('TAS_UID', $data) && isset($data['PRO_UID'])) && isset($data['APP_UID'])) {
|
||||
$data['DEL_PRIORITY'] = $this->getTaskPriority($data['TAS_UID'], $data['PRO_UID'], $data["APP_UID"]);
|
||||
}
|
||||
|
||||
$con = Propel::getConnection( ListInboxPeer::DATABASE_NAME );
|
||||
try {
|
||||
|
||||
@@ -103,6 +103,31 @@ class Users extends BaseUsers
|
||||
}
|
||||
}
|
||||
|
||||
public function loadByEmail ($sUsrEmail)
|
||||
{
|
||||
$c = new Criteria( 'workflow' );
|
||||
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( UsersPeer::USR_UID );
|
||||
$c->addSelectColumn( UsersPeer::USR_USERNAME );
|
||||
$c->addSelectColumn( UsersPeer::USR_STATUS );
|
||||
$c->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$c->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
|
||||
$c->add( UsersPeer::USR_EMAIL, $sUsrEmail );
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function loadByUserEmailInArray ($sUsrEmail)
|
||||
{
|
||||
$c = $this->loadByEmail( $sUsrEmail );
|
||||
$rs = UsersPeer::doSelectRS( $c, Propel::getDbConnection('workflow_ro') );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function loadDetails ($UsrUid)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -165,7 +165,7 @@ class TaskMapBuilder
|
||||
|
||||
$tMap->addValidator('TAS_ALERT', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_ALERT.');
|
||||
|
||||
$tMap->addValidator('TAS_ASSIGN_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'BALANCED|MANUAL|EVALUATE|REPORT_TO|SELF_SERVICE|STATIC_MI|CANCEL_MI', 'Please select a valid value for TAS_ASSIGN_TYPE.');
|
||||
$tMap->addValidator('TAS_ASSIGN_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'BALANCED|MANUAL|EVALUATE|REPORT_TO|SELF_SERVICE|STATIC_MI|CANCEL_MI|MULTIPLE_INSTANCE|MULTIPLE_INSTANCE_VALUE_BASED', 'Please set a valid value for TAS_ASSIGN_TYPE');
|
||||
|
||||
$tMap->addValidator('TAS_ASSIGN_LOCATION', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_ASSIGN_LOCATION.');
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -47,9 +47,11 @@ if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') ) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD+', 'strategicDashboard/main', G::LoadTranslation('ID_STRATEGIC_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') ) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD+', 'strategicDashboard/main', G::LoadTranslation('ID_STRATEGIC_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
|
||||
@@ -70,14 +70,75 @@ $_SESSION['TASK'] = $aFields['TAS_UID'];
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
/* Redirect to next step */
|
||||
$aNextStep = $oCase->getNextSupervisorStep( $_SESSION['PROCESS'], 0 );
|
||||
if($aNextStep['UID'] != ''){
|
||||
$sPage = "cases_StepToRevise?type=DYNAFORM&PRO_UID=" . $aFields['PRO_UID'] . "&DYN_UID=" . $aNextStep['UID'] . "&APP_UID=$sAppUid&DEL_INDEX=$iDelIndex&position=1"; //$aNextStep['PAGE'];
|
||||
G::header( 'location: ' . $sPage );
|
||||
}else{
|
||||
|
||||
$cases = new Cases();
|
||||
|
||||
$arrayDynaFormUid = array();
|
||||
$arrayInputUid = array();
|
||||
|
||||
$resultDynaForm = $cases->getAllDynaformsStepsToRevise($aFields["APP_UID"]);
|
||||
|
||||
while ($resultDynaForm->next()) {
|
||||
$row = $resultDynaForm->getRow();
|
||||
|
||||
$arrayDynaFormUid[$row["STEP_UID_OBJ"]] = $row["STEP_UID_OBJ"];
|
||||
}
|
||||
|
||||
$resultInput = $cases->getAllInputsStepsToRevise($aFields["APP_UID"]);
|
||||
|
||||
while ($resultInput->next()) {
|
||||
$row = $resultInput->getRow();
|
||||
|
||||
$arrayInputUid[$row["STEP_UID_OBJ"]] = $row["STEP_UID_OBJ"];
|
||||
}
|
||||
|
||||
$criteria = new Criteria();
|
||||
|
||||
$criteria->addSelectColumn(StepPeer::STEP_TYPE_OBJ);
|
||||
$criteria->addSelectColumn(StepPeer::STEP_UID_OBJ);
|
||||
|
||||
$criteria->add(StepPeer::PRO_UID, $aFields["PRO_UID"], Criteria::EQUAL);
|
||||
$criteria->add(StepPeer::TAS_UID, $aFields["APP_DATA"]["TASK"], Criteria::EQUAL);
|
||||
$criteria->addAscendingOrderByColumn(StepPeer::STEP_POSITION);
|
||||
|
||||
$rsCriteria = StepPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$url = "";
|
||||
$flag = false;
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$stepTypeObj = $row["STEP_TYPE_OBJ"];
|
||||
$stepUidObj = $row["STEP_UID_OBJ"];
|
||||
|
||||
switch ($stepTypeObj) {
|
||||
case "DYNAFORM":
|
||||
if (isset($arrayDynaFormUid[$stepUidObj])) {
|
||||
$url = "cases_StepToRevise?type=DYNAFORM&PRO_UID=" . $aFields["PRO_UID"] . "&DYN_UID=" . $stepUidObj . "&APP_UID=" . $sAppUid . "&DEL_INDEX=" . $iDelIndex . "&position=1";
|
||||
$flag = true;
|
||||
}
|
||||
break;
|
||||
case "INPUT_DOCUMENT":
|
||||
if (isset($arrayInputUid[$stepUidObj])) {
|
||||
$url = "cases_StepToReviseInputs?type=INPUT_DOCUMENT&PRO_UID=" . $aFields["PRO_UID"] . "&INP_DOC_UID=" . $stepUidObj . "&APP_UID=" . $sAppUid . "&position=" . $step["STEP_POSITION"] . "&DEL_INDEX=" . $iDelIndex;
|
||||
$flag = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($flag) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($flag) {
|
||||
G::header("Location: " . $url);
|
||||
} else {
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = G::LoadTranslation( 'ID_SUPERVISOR_DOES_NOT_HAVE_DYNAFORMS' );
|
||||
$aMessage["MESSAGE"] = G::LoadTranslation("ID_SUPERVISOR_DOES_NOT_HAVE_DYNAFORMS");
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
}
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", "login/showMessage", "", $aMessage);
|
||||
G::RenderPage("publishBlank", "blank");
|
||||
}
|
||||
|
||||
@@ -46,14 +46,10 @@ try {
|
||||
* DYN_VERSION is 1: classic Dynaform,
|
||||
* DYN_VERSION is 2: responsive form, Pmdynaform.
|
||||
*/
|
||||
$a = new Criteria("workflow");
|
||||
$a->addSelectColumn(DynaformPeer::DYN_VERSION);
|
||||
$a->add(DynaformPeer::DYN_UID, $_GET['UID'], Criteria::EQUAL);
|
||||
$a = ProcessPeer::doSelectRS($a);
|
||||
$a->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$a->next();
|
||||
$row = $a->getRow();
|
||||
$swpmdynaform = isset($row) && $row["DYN_VERSION"] == 2;
|
||||
$dynaForm = DynaformPeer::retrieveByPK($_GET["UID"]);
|
||||
|
||||
$swpmdynaform = !is_null($dynaForm) && $dynaForm->getDynVersion() == 2;
|
||||
|
||||
if ($swpmdynaform) {
|
||||
$pmdynaform = $_POST["form"];
|
||||
}
|
||||
@@ -149,7 +145,7 @@ try {
|
||||
$aRow = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($aRow) {
|
||||
foreach ($aValues as $sKey => $sValue) {
|
||||
if ($sKey != $oForm->fields[$sField]->pmfield) {
|
||||
|
||||
@@ -22,6 +22,15 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
//validate the data post
|
||||
|
||||
$dynaForm = DynaformPeer::retrieveByPK($_GET["UID"]);
|
||||
|
||||
$flagDynaFormNewVersion = !is_null($dynaForm) && $dynaForm->getDynVersion() == 2;
|
||||
|
||||
if ($flagDynaFormNewVersion) {
|
||||
$dataForm = $_POST["form"];
|
||||
}
|
||||
|
||||
$oForm = new Form( $_SESSION['PROCESS'] . '/' . $_GET['UID'], PATH_DYNAFORM );
|
||||
$oForm->validatePost();
|
||||
|
||||
@@ -31,6 +40,11 @@ G::LoadClass( 'case' );
|
||||
//load the variables
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
|
||||
if ($flagDynaFormNewVersion) {
|
||||
$Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], $dataForm);
|
||||
}
|
||||
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], $_POST['form'] );
|
||||
|
||||
//save data
|
||||
|
||||
@@ -163,7 +163,7 @@ if ($flagExecuteBeforeTriggers) {
|
||||
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], $_GET['TYPE'], $_GET['UID'], 'BEFORE', $Fields['APP_DATA'] );
|
||||
} else {
|
||||
unset($_SESSION['beforeTriggersExecuted']);
|
||||
}
|
||||
}
|
||||
//Execute before triggers - End
|
||||
} else {
|
||||
unset( $_SESSION['_NO_EXECUTE_TRIGGERS_'] );
|
||||
@@ -763,7 +763,6 @@ try {
|
||||
}
|
||||
} //set priority value
|
||||
|
||||
|
||||
//$sTask = $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_UID'];
|
||||
//TAS_UID has a hidden field to store the TAS_UID
|
||||
$hiddenName = "form[TASKS][" . $sKey . "][TAS_UID]";
|
||||
@@ -891,6 +890,18 @@ try {
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['ROU_FINISH_FLAG'] = true;
|
||||
$aFields['PROCESS']['ROU_FINISH_FLAG'] = true;
|
||||
break;
|
||||
case "MULTIPLE_INSTANCE":
|
||||
case "MULTIPLE_INSTANCE_VALUE_BASED":
|
||||
$arrayAux = array();
|
||||
|
||||
foreach ($aValues["NEXT_TASK"]["USER_ASSIGNED"] as $value) {
|
||||
$arrayAux[$value["USR_UID"]] = $value["USR_FULLNAME"];
|
||||
}
|
||||
|
||||
asort($arrayAux);
|
||||
|
||||
$aFields["TASK"][$sKey]["NEXT_TASK"]["USR_UID"] = "<div style=\"overflow: auto; max-height: 200px;\">" . implode("<br />", $arrayAux) . "</div>";
|
||||
break;
|
||||
}
|
||||
|
||||
$optionTaskType = (isset($aFields["TASK"][$sKey]["NEXT_TASK"]["TAS_TYPE"]))? $aFields["TASK"][$sKey]["NEXT_TASK"]["TAS_TYPE"] : "";
|
||||
|
||||
@@ -129,7 +129,7 @@ if ($_GET['DYN_UID'] != '') {
|
||||
$FieldsPmDynaform["CURRENT_DYNAFORM"] = $_GET['DYN_UID'];
|
||||
$a = new pmDynaform($FieldsPmDynaform);
|
||||
if ($a->isResponsive()) {
|
||||
$a->printView();
|
||||
$a->printEditSupervisor();
|
||||
}else{
|
||||
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['DYN_UID'], '', $Fields['APP_DATA'], 'cases_SaveDataSupervisor?UID=' . $_GET['DYN_UID'] );
|
||||
}
|
||||
|
||||
@@ -101,5 +101,13 @@ $oHeadPublisher->assign( '_APP_UID', $_GET['APP_UID']);
|
||||
$oHeadPublisher->assign( '_ENV_CURRENT_DATE', $conf->getSystemDate( date( 'Y-m-d' ) ) );
|
||||
$oHeadPublisher->assign( '_ENV_CURRENT_DATE_NO_FORMAT', date( 'Y-m-d-h-i-A' ) );
|
||||
$oHeadPublisher->assign( 'idfirstform', is_null( $oStep ) ? '' : $oStep->getStepUidObj() );
|
||||
$oHeadPublisher->assign( 'appStatus', $case['APP_STATUS'] );
|
||||
|
||||
if(!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) {
|
||||
$_SESSION['APPLICATION'] = $case['APP_UID'];
|
||||
$_SESSION['TASK'] = $case['TAS_UID'];
|
||||
$_SESSION['INDEX'] = $case['DEL_INDEX'];
|
||||
}
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -38,6 +38,90 @@ if (preg_match("/^([\d\.]+).*$/", System::getVersion(), $arrayMatch)) {
|
||||
$arrayImportFileExtension = array("pm", "pmx", "bpmn");
|
||||
$arrayMenuNewOption = array("pm" => true, "bpmn" => true);
|
||||
|
||||
/*options menu*/
|
||||
$arrayMenuNew = array();
|
||||
|
||||
$mnuNewBpmnProject = new stdClass();
|
||||
$mnuNewBpmnProject->text = G::LoadTranslation("ID_NEW_BPMN_PROJECT");
|
||||
$mnuNewBpmnProject->iconCls = "silk-add";
|
||||
$mnuNewBpmnProject->icon = "";
|
||||
$mnuNewBpmnProject->newProcessType = 'newProcess({type:"bpmnProject",title:"'.$mnuNewBpmnProject->text.'"})';
|
||||
|
||||
$mnuNewProject = new stdClass();
|
||||
$mnuNewProject->text = G::LoadTranslation("ID_NEW_PROJECT");
|
||||
$mnuNewProject->iconCls = "silk-add";
|
||||
$mnuNewProject->icon = "";
|
||||
$mnuNewProject->newProcessType = 'newProcess({type:"classicProject",title:"'.$mnuNewProject->text.'"})';
|
||||
|
||||
$menuOption = array("pm" => $mnuNewProject, "bpmn" => $mnuNewBpmnProject);
|
||||
|
||||
foreach($arrayMenuNewOption as $type => $val) {
|
||||
if($val) {
|
||||
array_push($arrayMenuNew, $menuOption[$type]);
|
||||
}
|
||||
}
|
||||
/*right click menu*/
|
||||
$contexMenuRightClick = array(
|
||||
(object)array(
|
||||
"text" => G::LoadTranslation("ID_EDIT"),
|
||||
"iconCls" => "button_menu_ext ss_sprite ss_pencil",
|
||||
"handler" => "editProcess()"
|
||||
),
|
||||
(object)array(
|
||||
"id" => "activator2",
|
||||
"text" => "",
|
||||
"icon" => "",
|
||||
"handler" => "activeDeactive()"
|
||||
),
|
||||
(object)array(
|
||||
"id" => "debug",
|
||||
"text" => "",
|
||||
"handler" => "enableDisableDebug()"
|
||||
),
|
||||
(object)array(
|
||||
"text" => G::LoadTranslation("ID_DELETE"),
|
||||
"iconCls" => "button_menu_ext ss_sprite ss_cross",
|
||||
"handler" => "deleteProcess()"
|
||||
),
|
||||
(object)array(
|
||||
"text" => G::LoadTranslation("ID_EXPORT"),
|
||||
"icon" => "/images/export.png",
|
||||
"handler" => "exportProcess()"
|
||||
),
|
||||
(object)array(
|
||||
"id" => "mnuGenerateBpmn",
|
||||
"text" => G::LoadTranslation("ID_GENERATE_BPMN_PROJECT"),
|
||||
"iconCls" => "button_menu_ext ss_sprite ss_page_white_go",
|
||||
"hidden" => true,
|
||||
"handler" => "generateBpmn()"
|
||||
)
|
||||
);
|
||||
/*end right click menu*/
|
||||
/*get registered options from plugin*/
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$fromPlugin = $oPluginRegistry->getDesignerNewOption();
|
||||
|
||||
$jsFromPlugin = false;
|
||||
foreach($fromPlugin as $menuOptionFile) {
|
||||
$menuOptionsFromPlugin = include_once($menuOptionFile->menuOptionFile);
|
||||
if(isset($menuOptionsFromPlugin)) {
|
||||
if(is_array($menuOptionsFromPlugin) && sizeof($menuOptionsFromPlugin)) {
|
||||
if(is_array($menuOptionsFromPlugin[0]) && sizeof($menuOptionsFromPlugin[0])) {
|
||||
$arrayMenuNew = array_merge($arrayMenuNew,$menuOptionsFromPlugin[0]);
|
||||
}
|
||||
if(is_array($menuOptionsFromPlugin[1]) && sizeof($menuOptionsFromPlugin[1])) {
|
||||
$contexMenuRightClick = array_merge($contexMenuRightClick,$menuOptionsFromPlugin[1]);
|
||||
}
|
||||
if(isset($menuOptionsFromPlugin[2])) {
|
||||
if(file_exists(PATH_PLUGINS.implode("/",array_slice(explode("/",$menuOptionsFromPlugin[2]),2)))) {
|
||||
$jsFromPlugin = $menuOptionsFromPlugin[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*end get registered options from plugin*/
|
||||
/*end options menu*/
|
||||
if ($pmVersion != "") {
|
||||
$arrayImportFileExtension = (version_compare($pmVersion . "", "3", ">="))? $arrayImportFileExtension : array("pm");
|
||||
$arrayMenuNewOption = (version_compare($pmVersion . "", "3", ">="))? array("bpmn" => true) : array("pm" => true);
|
||||
@@ -52,4 +136,8 @@ $oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber'
|
||||
$oHeadPublisher->assign("arrayImportFileExtension", $arrayImportFileExtension);
|
||||
$oHeadPublisher->assign("arrayMenuNewOption", $arrayMenuNewOption);
|
||||
|
||||
$oHeadPublisher->assign("arrayMenuNew", $arrayMenuNew);
|
||||
$oHeadPublisher->assign("contexMenu", $contexMenuRightClick);
|
||||
$oHeadPublisher->assign("jsFromPlugin", $jsFromPlugin);
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
@@ -463,7 +463,6 @@ class Consolidated
|
||||
$json = G::json_decode($dataTask["DYN_CONTENT"]);
|
||||
$pmDyna->jsonr($json);
|
||||
$fieldsDyna = $json->items[0]->items;
|
||||
|
||||
$xmlfrm = new \stdclass();
|
||||
$xmlfrm->fields = array();
|
||||
foreach ($fieldsDyna as $key => $value) {
|
||||
@@ -478,7 +477,7 @@ class Consolidated
|
||||
$temp->required = (isset($val->required)) ? $val->required : 0;
|
||||
$temp->mode = (isset($val->mode)) ? $val->mode : 'edit';
|
||||
|
||||
if (!empty($val->options)) {
|
||||
if (!empty($val->options) || !empty($val->optionsSql)) {
|
||||
$temp->storeData = '[';
|
||||
foreach ($val->options as $valueOption) {
|
||||
if(isset($valueOption->value)){
|
||||
@@ -487,6 +486,14 @@ class Consolidated
|
||||
$temp->storeData .= '["' . $valueOption['value'] . '", "' . $valueOption['label'] . '"],';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($val->optionsSql as $valueOption) {
|
||||
if(isset($valueOption->value)){
|
||||
$temp->storeData .= '["' . $valueOption->value . '", "' . $valueOption->label . '"],';
|
||||
}else{
|
||||
$temp->storeData .= '["' . $valueOption['value'] . '", "' . $valueOption['label'] . '"],';
|
||||
}
|
||||
}
|
||||
$temp->storeData = substr($temp->storeData,0,-1);
|
||||
$temp->storeData .= ']';
|
||||
}
|
||||
|
||||
@@ -473,12 +473,43 @@ class EmailEvent
|
||||
throw new \Exception(\G::LoadTranslation("ID_EMAIL_EVENT_DEFINITION_DOES_NOT_EXIST"));
|
||||
}
|
||||
$arrayData = $this->existsEvent($prj_uid, $eventUid);
|
||||
|
||||
if(sizeof($arrayData)) {
|
||||
$prfUid = $arrayData[6];
|
||||
$filesManager = new \ProcessMaker\BusinessModel\FilesManager();
|
||||
$contentFile = $filesManager->getProcessFileManager($prj_uid, $prfUid);
|
||||
\PMFSendMessage($appUID, $arrayData[3], $arrayData[4], '', '', $arrayData[5], $contentFile['prf_filename'], array());
|
||||
$emailGroupTo = array();
|
||||
$emailTo = "";
|
||||
$prfUid = $arrayData[6];
|
||||
$filesManager = new \ProcessMaker\BusinessModel\FilesManager();
|
||||
$contentFile = $filesManager->getProcessFileManager($prj_uid, $prfUid);
|
||||
if(strpos($arrayData[4],",")) {
|
||||
$emailsArray = explode(",",$arrayData[4]);
|
||||
foreach($emailsArray as $email) {
|
||||
if(substr($email,0,1) == "@") {
|
||||
$email = substr($email, 2,strlen($email));
|
||||
if(isset($arrayApplicationData['APP_DATA'])) {
|
||||
if(is_array($arrayApplicationData['APP_DATA']) && isset( $arrayApplicationData['APP_DATA'][$email])) {
|
||||
$emailGroupTo[] = $arrayApplicationData['APP_DATA'][$email];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$emailGroupTo[] = $email;
|
||||
}
|
||||
}
|
||||
$emailTo = implode(",",array_unique(array_filter($emailGroupTo)));
|
||||
} else {
|
||||
$email = $arrayData[4];
|
||||
if(substr($email,0,1) == "@") {
|
||||
$email = substr($email, 2,strlen($email));
|
||||
if(isset($arrayApplicationData['APP_DATA'])) {
|
||||
if(is_array($arrayApplicationData['APP_DATA']) && isset( $arrayApplicationData['APP_DATA'][$email])) {
|
||||
$emailTo = $arrayApplicationData['APP_DATA'][$email];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$emailTo = $email;
|
||||
}
|
||||
}
|
||||
if(!empty($emailTo)) {
|
||||
\PMFSendMessage($appUID, $arrayData[3], $emailTo, '', '', $arrayData[5], $contentFile['prf_filename'], array());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,9 @@ class Light
|
||||
$newForm[$c]['title'] = $form['obj_title'];
|
||||
$newForm[$c]['description'] = $form['obj_description'];
|
||||
$newForm[$c]['stepId'] = $form["step_uid"];
|
||||
$newForm[$c]['stepUidObj'] = $form["step_uid_obj"];
|
||||
$newForm[$c]['stepMode'] = $form['step_mode'];
|
||||
$newForm[$c]['stepPosition'] = $form['step_position'];
|
||||
$trigger = $this->statusTriggers($step->doGetActivityStepTriggers($form["step_uid"], $tempTreeChild['taskId'], $tempTreeChild['processId']));
|
||||
$newForm[$c]["triggers"] = $trigger;
|
||||
$c++;
|
||||
@@ -336,6 +338,48 @@ class Light
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute Trigger case
|
||||
*
|
||||
*/
|
||||
public function doExecuteTriggerCase($usr_uid, $prj_uid, $act_uid, $cas_uid, $step_uid, $type)
|
||||
{
|
||||
$userData = $this->getUserData($usr_uid);
|
||||
$c = new \Criteria();
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(\StepPeer::STEP_UID);
|
||||
$c->addSelectColumn(\StepPeer::STEP_UID_OBJ);
|
||||
$c->add(\StepPeer::TAS_UID, $act_uid);
|
||||
$c->add(\StepPeer::STEP_TYPE_OBJ, 'DYNAFORM');
|
||||
$c->add(\StepPeer::STEP_UID, $step_uid);
|
||||
$rs = \StepPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$step_uid_obj = $row['STEP_UID_OBJ'];
|
||||
|
||||
$oCase = new \Cases();
|
||||
$Fields = $oCase->loadCase( $cas_uid );
|
||||
$_SESSION["APPLICATION"] = $cas_uid;
|
||||
$_SESSION["PROCESS"] = $prj_uid;
|
||||
$_SESSION["TASK"] = $act_uid;
|
||||
$_SESSION["USER_LOGGED"] = $usr_uid;
|
||||
$_SESSION["USR_USERNAME"] = $userData['firstName'];
|
||||
$_SESSION["INDEX"] = $Fields["DEL_INDEX"] = \AppDelegation::getCurrentIndex($cas_uid);
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
||||
$triggers = $oCase->loadTriggers( $act_uid, 'DYNAFORM', $step_uid_obj, strtoupper($type) );
|
||||
if($triggers){
|
||||
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $act_uid, 'DYNAFORM', $step_uid_obj, strtoupper($type), $Fields['APP_DATA'] );
|
||||
}
|
||||
$Fields['TAS_UID'] = $act_uid;
|
||||
$Fields['CURRENT_DYNAFORM'] = $step_uid_obj;
|
||||
$Fields['USER_UID'] = $usr_uid;
|
||||
$Fields['PRO_UID'] = $prj_uid;
|
||||
$oCase->updateCase( $cas_uid, $Fields );
|
||||
$response = array('status' => 'ok');
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Informaction User for derivate
|
||||
* assignment Users
|
||||
@@ -370,6 +414,17 @@ class Light
|
||||
}
|
||||
} //set priority value
|
||||
|
||||
$taskType = (isset($aValues["NEXT_TASK"]["TAS_TYPE"]))? $aValues["NEXT_TASK"]["TAS_TYPE"] : false;
|
||||
$taskMessage = "";
|
||||
switch ($taskType) {
|
||||
case "SCRIPT-TASK":
|
||||
$taskMessage = G::LoadTranslation("ID_ROUTE_TO_TASK_SCRIPT_TASK");
|
||||
break;
|
||||
case "INTERMEDIATE-CATCH-TIMER-EVENT":
|
||||
$taskMessage = G::LoadTranslation("ID_ROUTE_TO_TASK_INTERMEDIATE_CATCH_TIMER_EVENT");
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($aValues['NEXT_TASK']['TAS_ASSIGN_TYPE']) {
|
||||
case 'EVALUATE':
|
||||
case 'REPORT_TO':
|
||||
@@ -382,6 +437,7 @@ class Light
|
||||
$taskAss['taskDefProcCode'] = $aValues['NEXT_TASK']['TAS_DEF_PROC_CODE'];
|
||||
$taskAss['delPriority'] = isset($aValues['NEXT_TASK']['DEL_PRIORITY'])?$aValues['NEXT_TASK']['DEL_PRIORITY']:"";
|
||||
$taskAss['taskParent'] = $aValues['NEXT_TASK']['TAS_PARENT'];
|
||||
$taskAss['taskMessage'] = $taskType?$taskMessage:"";
|
||||
$users = array();
|
||||
$users['userId'] = $derive[$sKey]['NEXT_TASK']['USER_ASSIGNED']['USR_UID'];
|
||||
$users['userFullName'] = strip_tags($derive[$sKey]['NEXT_TASK']['USER_ASSIGNED']['USR_FULLNAME']);
|
||||
@@ -396,6 +452,7 @@ class Light
|
||||
$manual['taskDefProcCode'] = $aValues['NEXT_TASK']['TAS_DEF_PROC_CODE'];
|
||||
$manual['delPriority'] = isset($aValues['NEXT_TASK']['DEL_PRIORITY'])?$aValues['NEXT_TASK']['DEL_PRIORITY']:"";
|
||||
$manual['taskParent'] = $aValues['NEXT_TASK']['TAS_PARENT'];
|
||||
$manual['taskMessage'] = $taskType?$taskMessage:"";
|
||||
$Aux = array ();
|
||||
foreach ($aValues['NEXT_TASK']['USER_ASSIGNED'] as $aUser) {
|
||||
$Aux[$aUser['USR_UID']] = $aUser['USR_FULLNAME'];
|
||||
|
||||
@@ -239,6 +239,7 @@ class Task
|
||||
|
||||
$task = new \Task();
|
||||
$aTaskInfo = $task->load($arrayProperty["TAS_UID"]);
|
||||
$bpmnActivity = \BpmnActivityPeer::retrieveByPK($act_uid);
|
||||
|
||||
$arrayResult = array();
|
||||
if ($arrayProperty["TAS_SELFSERVICE_TIMEOUT"] == "1") {
|
||||
@@ -272,6 +273,17 @@ class Task
|
||||
}
|
||||
}
|
||||
|
||||
$flagTaskIsMultipleInstance = $bpmnActivity->getActType() == "TASK" && preg_match("/^(?:EMPTY|USERTASK|MANUALTASK)$/", $bpmnActivity->getActTaskType()) && $bpmnActivity->getActLoopType() == "PARALLEL";
|
||||
$flagTaskAssignTypeIsMultipleInstance = preg_match("/^(?:MULTIPLE_INSTANCE|MULTIPLE_INSTANCE_VALUE_BASED)$/", $arrayProperty["TAS_ASSIGN_TYPE"]);
|
||||
|
||||
if ($flagTaskIsMultipleInstance && !$flagTaskAssignTypeIsMultipleInstance) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ACTIVITY_INVALID_ASSIGNMENT_METHOD_FOR_MULTIPLE_INSTANCE_ACTIVITY", array(strtolower("ACT_UID"), $act_uid)));
|
||||
}
|
||||
|
||||
if (!$flagTaskIsMultipleInstance && $flagTaskAssignTypeIsMultipleInstance) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ACTIVITY_INVALID_ASSIGNMENT_METHOD_FOR_ACTIVITY", array(strtolower("ACT_UID"), $act_uid)));
|
||||
}
|
||||
|
||||
switch ($arrayProperty["TAS_ASSIGN_TYPE"]) {
|
||||
case 'BALANCED':
|
||||
case 'MANUAL':
|
||||
@@ -329,6 +341,11 @@ class Task
|
||||
$this->unsetVar($arrayProperty, "TAS_SELFSERVICE_EXECUTION");
|
||||
}
|
||||
break;
|
||||
case "MULTIPLE_INSTANCE_VALUE_BASED":
|
||||
if (trim($arrayProperty["TAS_ASSIGN_VARIABLE"]) == "") {
|
||||
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_CAN_NOT_BE_EMPTY", array(strtolower("TAS_ASSIGN_VARIABLE"))));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//Validating TAS_TRANSFER_FLY value
|
||||
@@ -1693,6 +1710,10 @@ class Task
|
||||
'TU_TYPE' => $iType,
|
||||
'TU_RELATION' => 2));
|
||||
}
|
||||
|
||||
$task = new \Task();
|
||||
|
||||
$result = $task->update(array("TAS_UID" => $sTaskUID, "TAS_TYPE" => "ADHOC"));
|
||||
}
|
||||
} catch ( \Exception $e ) {
|
||||
throw $e;
|
||||
@@ -1729,6 +1750,14 @@ class Task
|
||||
$oTaskUser = \TaskUserPeer::retrieveByPK($sTaskUID, $sAssigneeUID, $iType, $iRelation);
|
||||
if (! is_null( $oTaskUser )) {
|
||||
\TaskUserPeer::doDelete($oCriteria);
|
||||
|
||||
$arrayTaskAdhocAssignees = $this->getTaskAdhocAssignees($sProcessUID, $sTaskUID, "", null, null, "");
|
||||
|
||||
if (empty($arrayTaskAdhocAssignees)) {
|
||||
$task = new \Task();
|
||||
|
||||
$result = $task->update(array("TAS_UID" => $sTaskUID, "TAS_TYPE" => "NORMAL"));
|
||||
}
|
||||
} else {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ROW_DOES_NOT_EXIST"));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Services\Api\Google;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
class Authentication extends Api
|
||||
{
|
||||
|
||||
/**
|
||||
* Get token for user gmail
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @url POST /gmail
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function doAuthenticationAccountGmail ($request_data) {
|
||||
try{
|
||||
$oGoogle = new \ProcessMaker\Services\Google\Authentication();
|
||||
$response = $oGoogle->postTokenAccountGmail($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e){
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -614,6 +614,7 @@ class Light extends Api
|
||||
$pmDynaForm->jsonr($result['formContent']);
|
||||
$result['index'] = $i;
|
||||
$result['stepId'] = $activitySteps[$i]["step_uid"];
|
||||
$result['stepUidObj'] = $activitySteps[$i]["step_uid_obj"];
|
||||
$result['stepMode'] = $activitySteps[$i]['step_mode'];
|
||||
$result['stepPosition'] = $activitySteps[$i]['step_position'];
|
||||
$trigger = $oMobile->statusTriggers($step->doGetActivityStepTriggers($activitySteps[$i]["step_uid"], $act_uid, $prj_uid));
|
||||
@@ -644,24 +645,8 @@ class Light extends Api
|
||||
{
|
||||
try {
|
||||
$userUid = $this->getUserId();
|
||||
$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
|
||||
$triggers= $step->doGetActivityStepTriggers($step_uid, $act_uid, $prj_uid);
|
||||
|
||||
$step = new \ProcessMaker\BusinessModel\Step();
|
||||
$step->setFormatFieldNameInUppercase(false);
|
||||
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
|
||||
$oMobile = new \ProcessMaker\BusinessModel\Light();
|
||||
$response = $oMobile->getUserData($userUid);
|
||||
$_SESSION["PROCESS"] = $prj_uid;
|
||||
$_SESSION["TASK"] = $act_uid;
|
||||
$_SESSION["USR_USERNAME"] = $response['firstName'];
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
foreach($triggers as $trigger){
|
||||
if (strtolower($trigger['st_type']) == $type) {
|
||||
$cases->putExecuteTriggerCase($cas_uid, $trigger['tri_uid'], $userUid);
|
||||
}
|
||||
}
|
||||
$response = array('status' => 'ok');
|
||||
$response = $oMobile->doExecuteTriggerCase($userUid, $prj_uid, $act_uid, $cas_uid, $step_uid, $type);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
@@ -1319,6 +1304,7 @@ class Light extends Api
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @url GET /config
|
||||
*/
|
||||
public function getConfiguration()
|
||||
|
||||
@@ -59,7 +59,7 @@ class Activity extends Api
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pro_uid {@min 32} {@max 32}
|
||||
@@ -98,7 +98,7 @@ class Activity extends Api
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param string $act_uid {@min 32} {@max 32}
|
||||
@@ -233,7 +233,7 @@ class ActivityPropertiesStructure
|
||||
public $tas_start;
|
||||
|
||||
/**
|
||||
* @var string {@from body} {@choice BALANCED,MANUAL,EVALUATE,REPORT_TO,SELF_SERVICE,SELF_SERVICE_EVALUATE}
|
||||
* @var string {@from body} {@choice BALANCED,MANUAL,EVALUATE,REPORT_TO,SELF_SERVICE,SELF_SERVICE_EVALUATE,MULTIPLE_INSTANCE,MULTIPLE_INSTANCE_VALUE_BASED}
|
||||
*/
|
||||
public $tas_assign_type;
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Google;
|
||||
|
||||
class Authentication
|
||||
{
|
||||
/**
|
||||
* Post Token by user Gmail
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
*/
|
||||
public function postTokenAccountGmail($request_data)
|
||||
{
|
||||
$responseToken = array('msg' => \G::LoadTranslation( 'ID_UPGRADE_ENTERPRISE' ));
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//Lets verify the gmail token
|
||||
$url = 'https://www.googleapis.com/oauth2/v1/tokeninfo?access_token='.$request_data['token'];
|
||||
|
||||
// init curl object
|
||||
$ch = curl_init();
|
||||
// define options
|
||||
$optArray = array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true
|
||||
);
|
||||
// apply those options
|
||||
curl_setopt_array($ch, $optArray);
|
||||
// execute request and get response
|
||||
$result = curl_exec($ch);
|
||||
$response = (json_decode($result));
|
||||
// Check if any error occurred
|
||||
if(curl_errno($ch))
|
||||
{
|
||||
throw (new \Exception(\G::LoadTranslation( 'ID_TO_URL' )));
|
||||
}
|
||||
$info = curl_getinfo($ch);
|
||||
curl_close($ch);
|
||||
|
||||
//If there is response
|
||||
if($info['http_code'] == 200 && isset($response->email)){
|
||||
//If the usermail that was send in the end point es the same of the one in the response
|
||||
if($request_data['mail'] == $response->email){
|
||||
$oUsers = new \Users();
|
||||
$userExist = $oUsers->loadByUserEmailInArray($request_data['mail']);
|
||||
|
||||
if($userExist['USR_STATUS'] == "ACTIVE"){
|
||||
//User Active! lets create the token and register it in the DB for this user
|
||||
$oauthServer = new \ProcessMaker\Services\OAuth2\Server;
|
||||
$server = $oauthServer->getServer();
|
||||
$config = array(
|
||||
'allow_implicit' => $server->getConfig('allow_implicit'),
|
||||
'access_lifetime' => $server->getConfig('access_lifetime')
|
||||
);
|
||||
$storage = $server->getStorages();
|
||||
$accessToken = new \OAuth2\ResponseType\AccessToken($storage['access_token'],$storage['refresh_token'],$config);
|
||||
$responseToken = $accessToken->createAccessToken($request_data['clientid'], $userExist['USR_UID'],$request_data['scope']);
|
||||
}else {
|
||||
throw (new \Exception(\G::LoadTranslation( 'ID_ACTIVE_USERS' )));
|
||||
}
|
||||
} else {
|
||||
throw (new \Exception(\G::LoadTranslation( 'ID_EMAIL_ENTER_VALID' )));
|
||||
}
|
||||
}else {
|
||||
throw (new \Exception(\G::LoadTranslation( 'ID_PMGMAIL_VALID' )));
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
return $responseToken;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -114,3 +114,5 @@ debug = 1
|
||||
[alias: catalog]
|
||||
dashboard = "ProcessMaker\Services\Api\Catalog"
|
||||
|
||||
[alias: google]
|
||||
authentication = "ProcessMaker\Services\Api\Google\Authentication"
|
||||
|
||||
@@ -458,6 +458,9 @@ Ext.onReady(function(){
|
||||
Ext.getCmp('actionMenu').hide();
|
||||
|
||||
hideCaseNavigatorPanel();
|
||||
if(typeof appStatus !== "undefined") {
|
||||
showCaseNavigatorPanel(appStatus);
|
||||
}
|
||||
|
||||
// Actions methods
|
||||
|
||||
@@ -1598,6 +1601,20 @@ Ext.onReady(function(){
|
||||
]
|
||||
});
|
||||
|
||||
var smodel = new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true,
|
||||
listeners: {
|
||||
rowselect: function (sm)
|
||||
{
|
||||
Ext.getCmp("btnAssignAdHocUser").setDisabled(false);
|
||||
},
|
||||
rowdeselect: function (sm)
|
||||
{
|
||||
Ext.getCmp("btnAssignAdHocUser").setDisabled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
pbark = new Ext.PagingToolbar({
|
||||
pageSize: 8,
|
||||
store: store,
|
||||
@@ -1624,13 +1641,17 @@ Ext.onReady(function(){
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
cm: cmk,
|
||||
store: store,
|
||||
colModel: cmk,
|
||||
selModel: smodel,
|
||||
tbar:[
|
||||
{
|
||||
id: "btnAssignAdHocUser",
|
||||
|
||||
text:_('ID_ASSIGN'),
|
||||
iconCls: 'silk-add',
|
||||
icon: '/images/cases-selfservice.png',
|
||||
disabled: true,
|
||||
handler: assignAdHocUser
|
||||
}
|
||||
],
|
||||
@@ -1653,32 +1674,44 @@ Ext.onReady(function(){
|
||||
|
||||
function assignAdHocUser()
|
||||
{
|
||||
rowSelected = adHocUserGrid.getSelectionModel().getSelected();
|
||||
PMExt.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_ADHOCUSER_CASE'), function(){
|
||||
var loadMask = new Ext.LoadMask(document.body, {msg:_('ID_ASSIGNMENT_CASE')});
|
||||
loadMask.show();
|
||||
Ext.Ajax.request({
|
||||
url : '../adhocUserProxy/reassignCase' ,
|
||||
method: 'POST',
|
||||
params : {USR_UID: rowSelected.data.USR_UID, THETYPE: 'ADHOC'},
|
||||
success: function ( result, request ) {
|
||||
loadMask.hide();
|
||||
var data = Ext.util.JSON.decode(result.responseText);
|
||||
if( data.success ) {
|
||||
CloseWindow();
|
||||
location.href = 'casesListExtJs';
|
||||
}
|
||||
else {
|
||||
PMExt.error(_('ID_ERROR'), data.msg);
|
||||
}
|
||||
},
|
||||
failure: function ( result, request) {
|
||||
Ext.MessageBox.alert(_('ID_FAILED'), result.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
var rowSelected = adHocUserGrid.getSelectionModel().getSelected();
|
||||
|
||||
if (typeof(rowSelected) != "undefined") {
|
||||
PMExt.confirm(
|
||||
_("ID_CONFIRM"),
|
||||
_("ID_CONFIRM_ADHOCUSER_CASE"),
|
||||
function ()
|
||||
{
|
||||
var loadMask = new Ext.LoadMask(document.body, {msg: _("ID_ASSIGNMENT_CASE")});
|
||||
|
||||
loadMask.show();
|
||||
|
||||
Ext.Ajax.request({
|
||||
url: "../adhocUserProxy/reassignCase",
|
||||
method: "POST",
|
||||
params: {USR_UID: rowSelected.data.USR_UID, THETYPE: "ADHOC"},
|
||||
success: function (result, request)
|
||||
{
|
||||
loadMask.hide();
|
||||
var data = Ext.util.JSON.decode(result.responseText);
|
||||
|
||||
if (data.success) {
|
||||
CloseWindow();
|
||||
location.href = "casesListExtJs";
|
||||
} else {
|
||||
PMExt.error(_("ID_ERROR"), data.msg);
|
||||
}
|
||||
},
|
||||
failure: function (result, request)
|
||||
{
|
||||
Ext.MessageBox.alert(_("ID_FAILED"), result.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CloseWindow = function(){
|
||||
Ext.getCmp('w').hide();
|
||||
@@ -1699,3 +1732,4 @@ Ext.onReady(function(){
|
||||
|
||||
node.select();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ var ldapFormAutoRegister = new Ext.form.ComboBox({
|
||||
displayField: 'VALUE',
|
||||
value: '0',
|
||||
|
||||
fieldLabel: '<span style="color: red">*</span>' + "Enable automatic register",
|
||||
fieldLabel: '<span style="color: red">*</span>' + _("ID_ENABLE_AUTOMATIC_REGISTER"),
|
||||
typeAhead: true,
|
||||
forceSelection: true,
|
||||
triggerAction: 'all',
|
||||
@@ -68,7 +68,7 @@ var ldapFormAutoRegister = new Ext.form.ComboBox({
|
||||
});
|
||||
|
||||
var ldapFormServerName = new Ext.form.TextField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + "Server Address",
|
||||
fieldLabel: '<span style="color: red">*</span>' + _("ID_SERVER_ADDRESS"),
|
||||
name: 'AUTH_SOURCE_SERVER_NAME',
|
||||
id: 'AUTH_SOURCE_SERVER_NAME',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '50'},
|
||||
@@ -158,7 +158,7 @@ var ldapFormPassword = new Ext.form.TextField({
|
||||
});
|
||||
|
||||
var ldapFormIdentifier = new Ext.form.TextField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + "User Identifier",
|
||||
fieldLabel: '<span style="color: red">*</span>' + _("ID_USER_IDENTIFIER"),
|
||||
name: 'AUTH_SOURCE_IDENTIFIER_FOR_USER',
|
||||
id: 'AUTH_SOURCE_IDENTIFIER_FOR_USER',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '20'},
|
||||
@@ -168,7 +168,7 @@ var ldapFormIdentifier = new Ext.form.TextField({
|
||||
});
|
||||
|
||||
var ldapFormUsersFilter = new Ext.form.TextField({
|
||||
fieldLabel: "Filter to search users",
|
||||
fieldLabel: _("ID_FILTER_TO_SEARCH_USERS"),
|
||||
name: 'AUTH_SOURCE_USERS_FILTER',
|
||||
id: 'AUTH_SOURCE_USERS_FILTER',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '200'},
|
||||
@@ -177,7 +177,7 @@ var ldapFormUsersFilter = new Ext.form.TextField({
|
||||
});
|
||||
|
||||
var ldapFormRetiredEmployees = new Ext.form.TextField({
|
||||
fieldLabel: "OU for Retired Employees OU",
|
||||
fieldLabel: _("ID_OU_FOR_RETIRED_EMPLOYEES_OU"),
|
||||
name: 'AUTH_SOURCE_RETIRED_OU',
|
||||
id: 'AUTH_SOURCE_RETIRED_OU',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '128'},
|
||||
@@ -219,7 +219,7 @@ var ldapFormData = new Ext.form.FieldSet({
|
||||
id:'passwordReview',
|
||||
width: 300,
|
||||
style: 'font: 9px tahoma,arial,helvetica,sans-serif;',
|
||||
text: "(Default set to (&(!(objectClass=organizationalUnit))))",
|
||||
text: _("ID_DEFAULT_SET_TO"),
|
||||
labelSeparator: ''
|
||||
}, ldapFormAttrinuteIds, ldapFormShowGrid, ldapFormGridText
|
||||
]
|
||||
|
||||
@@ -140,7 +140,7 @@ Ext.onReady(function() {
|
||||
hideable:false
|
||||
},{
|
||||
id: 'ATTRIBUTE_LDAP',
|
||||
header: "LDAP Field",
|
||||
header: _("ID_LDAP_FIELD"),
|
||||
dataIndex: 'ATTRIBUTE_LDAP',
|
||||
width: 10,
|
||||
sortable: true,
|
||||
@@ -148,7 +148,7 @@ Ext.onReady(function() {
|
||||
},
|
||||
{
|
||||
id: 'ATTRIBUTE_USER',
|
||||
header: "User Field",
|
||||
header: _("ID_USER_FIELD"),
|
||||
dataIndex: 'ATTRIBUTE_USER',
|
||||
width: 10,
|
||||
sortable: true,
|
||||
@@ -158,6 +158,7 @@ Ext.onReady(function() {
|
||||
|
||||
var ldapGridEditor = new Ext.ux.grid.RowEditor({
|
||||
saveText: _('ID_SAVE'),
|
||||
cancelText: _('ID_CANCEL'),
|
||||
listeners: {
|
||||
canceledit: function(grid,obj){
|
||||
//
|
||||
@@ -238,7 +239,7 @@ Ext.onReady(function() {
|
||||
var chk = new Ext.form.Checkbox({
|
||||
id: "AUTH_SOURCE_SHOWGRID-checkbox",
|
||||
name: "AUTH_SOURCE_SHOWGRID-checkbox",
|
||||
boxLabel: "Match attributes to sync",
|
||||
boxLabel: _("ID_MATCH_ATTRIBUTES_TO_SYNC"),
|
||||
renderTo: "containerChkAttribute",
|
||||
|
||||
listeners: {
|
||||
@@ -277,7 +278,7 @@ Ext.onReady(function() {
|
||||
|
||||
ldapForm.getForm().submit({
|
||||
method: "POST",
|
||||
waitTitle: "Connecting...",
|
||||
waitTitle: _('ID_CONNECTING'),
|
||||
waitMsg: _("ID_SAVING"),
|
||||
success: function (form, action)
|
||||
{
|
||||
@@ -293,7 +294,7 @@ Ext.onReady(function() {
|
||||
var ldapForm = new Ext.FormPanel({
|
||||
url : 'ldapAdvancedProxy.php?functionAccion=ldapSave',
|
||||
frame : true,
|
||||
title : "Authentication Source Information",
|
||||
title : _("ID_AUTHENTICATION_SOURCE_INFORMATION"),
|
||||
border : false,
|
||||
autoScroll: true,
|
||||
monitorValid : true,
|
||||
@@ -325,7 +326,7 @@ Ext.onReady(function() {
|
||||
{
|
||||
columnWidth: 1,
|
||||
bodyStyle: "border: 0px;",
|
||||
html: "Minimum data required to run the \"Test Connection\": \"Server Address, " + _("ID_PORT") + ", " + _("ID_ENABLED_TLS") + ", " + _("ID_ANONYMOUS") + ", " + _("ID_USERNAME") + ", " + _("ID_PASSWORD") + "\""
|
||||
html: _("ID_MINIMUM_DATA_REQUIRED_TO_RUN_THE")
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -379,11 +380,11 @@ Ext.onReady(function() {
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Test connection",
|
||||
text: _('ID_TEST_CONNECTION'),
|
||||
formBind: true,
|
||||
handler: function ()
|
||||
{
|
||||
var loadMaskAux = new Ext.LoadMask(Ext.getBody(), {msg: "Testing connection..."});
|
||||
var loadMaskAux = new Ext.LoadMask(Ext.getBody(), {msg: _('ID_TESTING_CONNECTION')});
|
||||
loadMaskAux.show();
|
||||
|
||||
Ext.Ajax.request({
|
||||
@@ -406,8 +407,8 @@ Ext.onReady(function() {
|
||||
|
||||
if (dataResponse.status) {
|
||||
Ext.MessageBox.show({
|
||||
title: "Test connection",
|
||||
msg: (dataResponse.status == "OK")? "Successfully connected" : dataResponse.message,
|
||||
title: _('ID_TEST_CONNECTION'),
|
||||
msg: (dataResponse.status == "OK")? _('ID_SUCCESSFULLY_CONNECTED') : dataResponse.message,
|
||||
|
||||
icon: (dataResponse.status == "OK")? "ext-mb-ok" : Ext.MessageBox.ERROR,
|
||||
buttons: {ok: _("ID_ACCEPT")}
|
||||
|
||||
@@ -30,7 +30,7 @@ Ext.onReady(function() {
|
||||
{
|
||||
xtype: 'button',
|
||||
iconCls: 'button_menu_ext ss_sprite ss_magnifier',
|
||||
text: 'Search',
|
||||
text: _('ID_SEARCH'),
|
||||
width : 40,
|
||||
handler: function(){
|
||||
storeGridSearch.load({ params: {sKeyword: searchUsersText.getValue()} });
|
||||
@@ -47,7 +47,7 @@ Ext.onReady(function() {
|
||||
labelAlign: 'left',
|
||||
align: 'center',
|
||||
labelStyle: 'font-weight:bold; padding: 3px 3px 3px 15px;',
|
||||
title: "<div><div style=\"float: left;\">" + "Search for user" + "</div><div id=\"divBack\" style=\"float: right;\"></div><div style=\"clear: both; height: 0; line-height:0; font-size: 0;\"></div></div>",
|
||||
title: "<div><div style=\"float: left;\">" + _('ID_SEARCH_FOR_USER') + "</div><div id=\"divBack\" style=\"float: right;\"></div><div style=\"clear: both; height: 0; line-height:0; font-size: 0;\"></div></div>",
|
||||
items: [
|
||||
new Ext.FormPanel({
|
||||
labelWidth : 120,
|
||||
@@ -129,7 +129,7 @@ Ext.onReady(function() {
|
||||
var tbarSearch = [
|
||||
{
|
||||
id: 'BUTTON_IMPORT',
|
||||
text: 'Import',
|
||||
text: _('ID_IMPORT'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_group_go ',
|
||||
disabled: true,
|
||||
handler: function () {
|
||||
@@ -163,8 +163,8 @@ Ext.onReady(function() {
|
||||
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to import the selected users?', function (val) {
|
||||
if (val == 'yes') {
|
||||
Ext.MessageBox.show({
|
||||
msg: 'Importing Users...',
|
||||
progressText: 'Saving...',
|
||||
msg: _('ID_IMPORTING_USERS'),
|
||||
progressText: _('ID_SAVING'),
|
||||
width:300,
|
||||
wait:true,
|
||||
waitConfig: {interval:200},
|
||||
@@ -183,8 +183,8 @@ Ext.onReady(function() {
|
||||
Ext.MessageBox.hide();
|
||||
if (resp.success) {
|
||||
Ext.MessageBox.show({
|
||||
title: 'Import Users',
|
||||
msg: 'Imported Successfully',
|
||||
title: _('ID_IMPORT_USERS'),
|
||||
msg: _('ID_IMPORTED_SUCCESSFULLY'),
|
||||
buttons: Ext.MessageBox.OK,
|
||||
animEl: 'mb9',
|
||||
icon: Ext.MessageBox.INFO
|
||||
@@ -193,16 +193,16 @@ Ext.onReady(function() {
|
||||
}
|
||||
},
|
||||
failure: function () {
|
||||
Ext.MessageBox.alert('ERROR', 'Error in server');
|
||||
Ext.MessageBox.alert('ERROR', _('ID_ERROR_IN_SERVER'));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
PMExt.notify('WARNING', 'You do not select any user to import');
|
||||
PMExt.notify('WARNING', _('ID_YOU_DO_NOT_SELECT_ANY_USER_TO_IMPORT'));
|
||||
}
|
||||
} else {
|
||||
PMExt.notify('WARNING', 'You do not select any user to import');
|
||||
PMExt.notify('WARNING', _('ID_YOU_DO_NOT_SELECT_ANY_USER_TO_IMPORT'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -251,8 +251,8 @@ Ext.onReady(function() {
|
||||
pageSize: pageSize,
|
||||
store: storeGridSearch,
|
||||
displayInfo: true,
|
||||
displayMsg: "LDAP Users" + " {0} - {1} " + "of" + " {2}",
|
||||
emptyMsg: "There are no LDAP Users"
|
||||
displayMsg: _('ID_LDAP_USERS') + " {0} - {1} " + "of" + " {2}",
|
||||
emptyMsg: _('ID_THERE_ARE_NO_LDAP_USERS')
|
||||
});
|
||||
|
||||
var selectModelList = new Ext.grid.CheckboxSelectionModel({
|
||||
@@ -282,11 +282,11 @@ Ext.onReady(function() {
|
||||
},
|
||||
columns: [
|
||||
selectModelList,
|
||||
{header: 'Username', width: 15, dataIndex: 'sUsername', sortable: true},
|
||||
{header: 'First Name', width: 15, dataIndex: 'sFirstname', sortable: true},
|
||||
{header: 'Last Name', width: 15, dataIndex: 'sLastname', sortable: true},
|
||||
{header: 'Email', width: 15, dataIndex: 'sEmail', sortable: true},
|
||||
{header: 'Distinguished Name', width: 35, dataIndex: 'sDN'},
|
||||
{header: _('ID_USER_ID'), width: 15, dataIndex: 'sUsername', sortable: true},
|
||||
{header: _('ID_FIRST_NAME'), width: 15, dataIndex: 'sFirstname', sortable: true},
|
||||
{header: _('ID_LAST_NAME'), width: 15, dataIndex: 'sLastname', sortable: true},
|
||||
{header: _('ID_EMAIL'), width: 15, dataIndex: 'sEmail', sortable: true},
|
||||
{header: _('ID_DISTINGUISHED_NAME'), width: 35, dataIndex: 'sDN'},
|
||||
{dataIndex: "STATUS", header: _("ID_STATUS"), width: 10, css: "background: #D4D4D4; font-weight: bold;", align: "center", renderer: renderStatus}
|
||||
]
|
||||
}),
|
||||
@@ -304,7 +304,7 @@ Ext.onReady(function() {
|
||||
|
||||
viewConfig: {
|
||||
forceFit:true,
|
||||
emptyText: '<div align="center"><b> ' + ' There are no LDAP Users ' + ' </b></div>'
|
||||
emptyText: '<div align="center"><b> ' + _('ID_THERE_ARE_NO_LDAP_USERS') + ' </b></div>'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
var caseData = '';
|
||||
var appTitle = new Ext.form.Label({
|
||||
fieldLabel: "Case Title",
|
||||
fieldLabel: _('ID_CASE_TITLE'),
|
||||
labelStyle: 'font-weight:bold;padding-right:30px;'
|
||||
});
|
||||
|
||||
var process = new Ext.form.Label({
|
||||
fieldLabel: "Process Uid",
|
||||
fieldLabel: _('ID_PROCESS_UID'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var processTitle = new Ext.form.Label({
|
||||
fieldLabel: "Process",
|
||||
fieldLabel: _('ID_PROCESS'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var appUid = new Ext.form.Label({
|
||||
fieldLabel: "App Uid",
|
||||
fieldLabel: _('ID_APP_UID'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var caseNumber = new Ext.form.Label({
|
||||
fieldLabel: "Case number",
|
||||
fieldLabel: _('ID_CASE_NUMBER'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var initUser = new Ext.form.Label({
|
||||
fieldLabel: "Init user",
|
||||
fieldLabel: _('ID_INIT_USER'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var finishUser = new Ext.form.Label({
|
||||
fieldLabel: "Finish user",
|
||||
fieldLabel: _('ID_FINISH_USER'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var createDate = new Ext.form.Label({
|
||||
fieldLabel: "Create date",
|
||||
fieldLabel: _('ID_CREATE_DATE'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var finishDate = new Ext.form.Label({
|
||||
fieldLabel: "Finish date",
|
||||
fieldLabel: _('ID_FINISH_DATE'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var fileName = new Ext.form.Label({
|
||||
fieldLabel: "File Name",
|
||||
fieldLabel: _('ID_FILE_NAME'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var statusCaseWin = new Ext.form.Label({
|
||||
fieldLabel: "Status",
|
||||
fieldLabel: _('ID_CASESLIST_APP_STATUS'),
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
@@ -82,8 +82,8 @@ var formCase = new Ext.FormPanel({
|
||||
if (val == 'yes') {
|
||||
dataCase = caseData;
|
||||
Ext.MessageBox.show({
|
||||
msg: "Restoring case" + ' ' + dataCase.CASE_NUMBER + ' ...',
|
||||
progressText: 'Saving...',
|
||||
msg: _('ID_RESTORING_CASE') + ' ' + dataCase.CASE_NUMBER + ' ...',
|
||||
progressText: _('ID_SAVING'),
|
||||
width:300,
|
||||
wait:true,
|
||||
waitConfig: {interval:200},
|
||||
@@ -102,15 +102,15 @@ var formCase = new Ext.FormPanel({
|
||||
var resp = Ext.decode(returnData.responseText);
|
||||
if (resp.success) {
|
||||
Ext.MessageBox.show({
|
||||
title: 'Case Unarhive',
|
||||
msg: "Case" + ' ' + dataCase.CASE_NUMBER + ' ' + "Restored sucessfully",
|
||||
title: _('ID_CASE_UNARHIVE'),
|
||||
msg: _('ID_CASE') + ' ' + dataCase.CASE_NUMBER + ' ' + _('ID_RESTORED_SUCESSFULLY'),
|
||||
buttons: Ext.MessageBox.OK,
|
||||
animEl: 'mb9',
|
||||
icon: Ext.MessageBox.INFO
|
||||
});
|
||||
} else {
|
||||
Ext.MessageBox.show({
|
||||
title: "Error",
|
||||
title: _('ID_ERROR'),
|
||||
msg: resp.message,
|
||||
buttons: Ext.MessageBox.OK,
|
||||
animEl: 'mb9',
|
||||
@@ -121,7 +121,7 @@ var formCase = new Ext.FormPanel({
|
||||
storeGridSearch.load();
|
||||
},
|
||||
failure: function () {
|
||||
Ext.MessageBox.alert("Error", "Error in server");
|
||||
Ext.MessageBox.alert("Error", _('ID_ERROR_IN_SERVER'));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -140,7 +140,7 @@ var formCase = new Ext.FormPanel({
|
||||
});
|
||||
|
||||
var summaryWindow = new Ext.Window({
|
||||
title: "Detail Case",
|
||||
title: _('ID_DETAIL_CASE'),
|
||||
layout: 'fit',
|
||||
width: 500,
|
||||
height: 320,
|
||||
|
||||
@@ -178,38 +178,19 @@ Ext.onReady(function(){
|
||||
items:[_('ID_PAGE_SIZE')+':',comboPageSize]
|
||||
}) */
|
||||
|
||||
var mnuNewBpmnProject = {
|
||||
text: "New BPMN Project",
|
||||
iconCls: "silk-add",
|
||||
icon: "",
|
||||
handler: function ()
|
||||
{
|
||||
newProcess({type:"bpmnProject"});
|
||||
}
|
||||
};
|
||||
|
||||
var mnuNewProject = {
|
||||
text: "New Project",
|
||||
iconCls: "silk-add",
|
||||
icon: "",
|
||||
handler: function ()
|
||||
{
|
||||
newProcess({type: "classicProject"});
|
||||
}
|
||||
};
|
||||
|
||||
var arrayMenuNew = [];
|
||||
|
||||
if (typeof(arrayMenuNewOption["bpmn"]) != "undefined") {
|
||||
arrayMenuNew.push(mnuNewBpmnProject);
|
||||
typeMnuNew = "bpmnProject";
|
||||
for(var k=0;k<arrayMenuNew.length;k++) {
|
||||
var handlerMenu = arrayMenuNew[k].handler;
|
||||
arrayMenuNew[k].handler = new Function(handlerMenu)
|
||||
}
|
||||
|
||||
if (typeof(arrayMenuNewOption["pm"]) != "undefined") {
|
||||
arrayMenuNew.push(mnuNewProject);
|
||||
typeMnuNew = "classicProject";
|
||||
for(var j=0;j<contexMenu.length;j++) {
|
||||
var handlerMenu = contexMenu[j].handler;
|
||||
contexMenu[j].handler = new Function(handlerMenu)
|
||||
}
|
||||
|
||||
|
||||
if(jsFromPlugin) {
|
||||
injectScriptElement(jsFromPlugin);
|
||||
}
|
||||
|
||||
if(typeof(arrayMenuNewOption["bpmn"]) != "undefined" && typeof(arrayMenuNewOption["pm"]) != "undefined"){
|
||||
newTypeProcess = {
|
||||
xtype: 'tbsplit',
|
||||
@@ -460,41 +441,7 @@ Ext.onReady(function(){
|
||||
|
||||
var messageContextMenu = new Ext.menu.Menu({
|
||||
id: 'messageContextMenu',
|
||||
items: [{
|
||||
text: _('ID_EDIT'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
||||
handler: editProcess
|
||||
}, {
|
||||
id: 'activator2',
|
||||
text: '',
|
||||
icon: '',
|
||||
handler: activeDeactive
|
||||
}, {
|
||||
id: 'debug',
|
||||
text: '',
|
||||
handler: enableDisableDebug
|
||||
}, {
|
||||
text: _('ID_DELETE'),
|
||||
iconCls: "button_menu_ext ss_sprite ss_cross",
|
||||
handler: deleteProcess
|
||||
}, {
|
||||
text: _("ID_EXPORT"),
|
||||
icon: "/images/export.png",
|
||||
handler: function () {
|
||||
exportProcess();
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "mnuGenerateBpmn",
|
||||
text: _("ID_GENERATE_BPMN_PROJECT"),
|
||||
iconCls: "button_menu_ext ss_sprite ss_page_white_go",
|
||||
hidden: true,
|
||||
handler: function ()
|
||||
{
|
||||
generateBpmn();
|
||||
}
|
||||
}
|
||||
]
|
||||
items: contexMenu
|
||||
});
|
||||
|
||||
var viewport = new Ext.Viewport({
|
||||
@@ -512,7 +459,10 @@ function newProcess(params)
|
||||
params = typeof params == 'undefined' ? {type:'classicProject'} : params;
|
||||
|
||||
// TODO this variable have hardcoded labels, it must be changed on the future
|
||||
var formTitle = params.type == "classicProject" ? "New Project" : "New BPMN Project"
|
||||
var formTitle = params.title;
|
||||
if(typeof formTitle === "undefined") {
|
||||
formTitle = params.type == "classicProject" ? _('ID_NEW_PROJECT') : _('ID_NEW_BPMN_PROJECT');
|
||||
}
|
||||
|
||||
// window.location = 'processes_New';
|
||||
var ProcessCategories = new Ext.form.ComboBox({
|
||||
@@ -647,6 +597,10 @@ function doSearch(){
|
||||
|
||||
editProcess = function(typeParam)
|
||||
{
|
||||
if(jsFromPlugin) {
|
||||
pluginFunctions.onRowdblclick();
|
||||
}
|
||||
|
||||
var rowSelected = processesGrid.getSelectionModel().getSelected();
|
||||
if (!rowSelected) {
|
||||
Ext.Msg.show({
|
||||
@@ -1538,3 +1492,11 @@ function openWindowIfIE(pathDesigner) {
|
||||
}
|
||||
location.href = pathDesigner;
|
||||
}
|
||||
|
||||
function injectScriptElement(url, onLoad, onError, scope) {
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = url;
|
||||
document.getElementsByTagName('head')[0].appendChild(script);
|
||||
return script;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user