First commit on ProcessMaker CORE Engine and Jeaqueline's changes
This commit is contained in:
@@ -5160,4 +5160,46 @@ class Cases {
|
||||
}
|
||||
}
|
||||
|
||||
function discriminateCases($aData){
|
||||
$siblingThreadData = $this->GetAllOpenDelegation($aData);
|
||||
foreach($siblingThreadData as $thread => $threadData)
|
||||
{
|
||||
$this->closeAppThread ( $aData['APP_UID'], $threadData['DEL_INDEX']); //Close Sibling AppThreads
|
||||
$this->CloseCurrentDelegation ($aData['APP_UID'], $threadData['DEL_INDEX']); //Close Sibling AppDelegations
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We're getting all threads in a task
|
||||
*
|
||||
* @name GetAllThreads of Particular Parent Thread
|
||||
* @param string $sAppUid
|
||||
* @param string $sAppParent
|
||||
* @return $aThreads
|
||||
*/
|
||||
function GetAllOpenDelegation($aData)
|
||||
{
|
||||
//('SELECT * FROM APP_THREAD WHERE APP_UID='".$aData['APP_UID']."' AND APP_THREAD_PARENT = '".$aData['APP_THREAD_PARENT']."'");
|
||||
try {
|
||||
$aThreads = array();
|
||||
$c = new Criteria();
|
||||
$c->add(AppDelegationPeer::APP_UID, $aData['APP_UID']);
|
||||
$c->add(AppDelegationPeer::DEL_PREVIOUS, $aData['APP_THREAD_PARENT']);
|
||||
$c->add(AppDelegationPeer::DEL_THREAD_STATUS,'OPEN');
|
||||
$rs = AppDelegationPeer::doSelectRs($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
while (is_array($row)) {
|
||||
$aThreads[] = $row;
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
return $aThreads;
|
||||
}
|
||||
catch (exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,7 +52,7 @@ class Derivation
|
||||
*
|
||||
* @param array $aData
|
||||
* @return $taskInfo
|
||||
*/
|
||||
*/
|
||||
function prepareInformation($aData)
|
||||
{
|
||||
$oTask = new Task();
|
||||
@@ -134,7 +134,7 @@ class Derivation
|
||||
else {
|
||||
//3. load the task information of normal NEXT_TASK
|
||||
$aDerivation['NEXT_TASK'] = $oTask->load( $aDerivation['ROU_NEXT_TASK'] );//print $aDerivation['ROU_NEXT_TASK']." **** ".$aDerivation['NEXT_TASK']['TAS_TYPE']."<hr>";
|
||||
|
||||
|
||||
if ($aDerivation['NEXT_TASK']['TAS_TYPE'] === 'SUBPROCESS') {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(SubProcessPeer::PRO_PARENT, $aDerivation['PRO_UID']);
|
||||
@@ -340,8 +340,8 @@ class Derivation
|
||||
|
||||
/* get next assigned user
|
||||
*
|
||||
* @param Array $tasInfo
|
||||
* @return Array $userFields
|
||||
* @param Array $tasInfo
|
||||
* @return Array $userFields
|
||||
*/
|
||||
function getNextAssignedUser( $tasInfo ){
|
||||
$oUser = new Users();
|
||||
@@ -401,9 +401,9 @@ class Derivation
|
||||
}
|
||||
}
|
||||
else
|
||||
throw ( new Exception("Task doesn't have a valid user in variable $variable or this variable doesn't exist.") ) ;
|
||||
throw ( new Exception("Task doesn't have a valid user in variable $variable or this variable doesn't exists.") ) ;
|
||||
break;
|
||||
|
||||
|
||||
case 'REPORT_TO' :
|
||||
//default error user when the reportsTo is not assigned to that user
|
||||
//look for USR_REPORTS_TO to this user
|
||||
@@ -413,7 +413,7 @@ class Derivation
|
||||
$userFields['USR_FIRSTNAME'] = '';
|
||||
$userFields['USR_LASTNAME'] = '';
|
||||
$userFields['USR_EMAIL'] = '';
|
||||
|
||||
|
||||
//look for USR_REPORTS_TO to this user
|
||||
$useruid = $this->getDenpendentUser($tasInfo['USER_UID']);
|
||||
if ( isset ( $useruid ) ) {
|
||||
@@ -432,7 +432,7 @@ class Derivation
|
||||
$userFields = "ERROR";
|
||||
//throw ( new Exception("The current user does not have a valid Reports To user. Please contact administrator.") ) ;
|
||||
break;
|
||||
|
||||
|
||||
case 'SELF_SERVICE' :
|
||||
//look for USR_REPORTS_TO to this user
|
||||
$userFields['USR_UID'] = '';
|
||||
@@ -452,30 +452,30 @@ class Derivation
|
||||
/* getDenpendentUser
|
||||
*
|
||||
* @param string $USR_UID
|
||||
* @return string $aRow['USR_REPORTS_TO']
|
||||
* @return string $aRow['USR_REPORTS_TO']
|
||||
*/
|
||||
function getDenpendentUser($USR_UID)
|
||||
{
|
||||
//require_once 'classes/model/Users.php';
|
||||
//here the uid to next Users
|
||||
$oC=new Criteria();
|
||||
$oC->addSelectColumn(UsersPeer::USR_REPORTS_TO);
|
||||
$oC->addSelectColumn(UsersPeer::USR_REPORTS_TO);
|
||||
$oC->add(UsersPeer::USR_UID,$USR_UID);
|
||||
$oDataset=UsersPeer::doSelectRS($oC);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
return $aRow['USR_REPORTS_TO'];
|
||||
}
|
||||
|
||||
/* setTasLastAssigned
|
||||
/* setTasLastAssigned
|
||||
*
|
||||
* @param string $tasUid
|
||||
* @param string $usrUid
|
||||
* @throws Exception $e
|
||||
* @return void
|
||||
*/
|
||||
function setTasLastAssigned ( $tasUid, $usrUid )
|
||||
function setTasLastAssigned ( $tasUid, $usrUid )
|
||||
{
|
||||
try {
|
||||
$oTask = TaskPeer::retrieveByPk( $tasUid );
|
||||
@@ -486,7 +486,7 @@ class Derivation
|
||||
throw ( $e );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* derivate
|
||||
*
|
||||
* @param array $currentDelegation
|
||||
@@ -495,6 +495,7 @@ class Derivation
|
||||
*/
|
||||
function derivate($currentDelegation=array(), $nextDelegations =array())
|
||||
{
|
||||
//define this...
|
||||
if ( !defined('TASK_FINISH_PROCESS')) define('TASK_FINISH_PROCESS',-1);
|
||||
if ( !defined('TASK_FINISH_TASK')) define('TASK_FINISH_TASK', -2);
|
||||
|
||||
@@ -507,7 +508,7 @@ class Derivation
|
||||
//Count how many tasks should be derivated.
|
||||
//$countNextTask = count($nextDelegations);
|
||||
foreach($nextDelegations as $nextDel) {
|
||||
//subprocesses??
|
||||
//subprocesses??
|
||||
if ($nextDel['TAS_PARENT'] != '') {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(SubProcessPeer::PRO_PARENT, $appFields['PRO_UID']);
|
||||
@@ -531,14 +532,13 @@ class Derivation
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//get TAS_ASSIGN_TYPE for current Delegation
|
||||
$oTask = TaskPeer::retrieveByPk( $currentDelegation['TAS_UID'] );
|
||||
$aTask = $oTask->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$oTask = new Task();
|
||||
$aTask = $oTask->load($currentDelegation['TAS_UID']);
|
||||
$currentDelegation['TAS_ASSIGN_TYPE'] = $aTask['TAS_ASSIGN_TYPE'];
|
||||
$currentDelegation['TAS_MI_COMPLETE_VARIABLE'] = isset($aTask['TAS_MI_COMPLETE_VARIABLE']) ? $aTask['TAS_MI_COMPLETE_VARIABLE'] : '';
|
||||
$currentDelegation['TAS_MI_INSTANCE_VARIABLE'] = isset($aTask['TAS_MI_INSTANCE_VARIABLE']) ? $aTask['TAS_MI_INSTANCE_VARIABLE'] : '';
|
||||
|
||||
$currentDelegation['TAS_MI_COMPLETE_VARIABLE'] = $aTask['TAS_MI_COMPLETE_VARIABLE'];
|
||||
$currentDelegation['TAS_MI_INSTANCE_VARIABLE'] = $aTask['TAS_MI_INSTANCE_VARIABLE'];
|
||||
|
||||
//get open threads
|
||||
$openThreads = $this->case->GetOpenThreads( $currentDelegation['APP_UID'] );
|
||||
//if we are derivating to finish process but there are no more open thread then we are finishing only the task, we are not finishing the whole process
|
||||
@@ -559,92 +559,91 @@ class Derivation
|
||||
default:
|
||||
// get all siblingThreads
|
||||
//if($currentDelegation['TAS_ASSIGN_TYPE'] == 'STATIC_MI')
|
||||
switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
|
||||
switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
|
||||
case 'CANCEL_MI':
|
||||
case 'STATIC_MI':
|
||||
$siblingThreads = $this->case->GetAllOpenDelegation($currentDelegation);
|
||||
$aData = $this->case->loadCase($currentDelegation['APP_UID']);
|
||||
|
||||
if (isset($aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'])]))
|
||||
$sMIinstanceVar = $aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'])];
|
||||
else
|
||||
$sMIinstanceVar = $aData['APP_DATA']['TAS_MI_INSTANCE_VARIABLE'];
|
||||
|
||||
if (isset($aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'])]))
|
||||
$sMIcompleteVar = $aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'])];
|
||||
else
|
||||
$sMIcompleteVar = $aData['APP_DATA']['TAS_MI_COMPLETE_VARIABLE'];
|
||||
$discriminateThread = $sMIinstanceVar - $sMIcompleteVar;
|
||||
// -1 because One App Delegation is closed by above Code
|
||||
if($discriminateThread == count($siblingThreads))
|
||||
$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'],$currentDelegation['ROU_TYPE']);
|
||||
$canDerivate = count($siblingThreads) == 0;
|
||||
}
|
||||
else if($currentDelegation['ROU_TYPE'] == 'DISCRIMINATOR')
|
||||
{
|
||||
//First get the total threads of Next Task where route type='Discriminator'
|
||||
$siblingThreads = $this->case->getOpenSiblingThreads($nextDel['TAS_UID'], $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'], $currentDelegation['TAS_UID'],$currentDelegation['ROU_TYPE']);
|
||||
$siblingThreadsCount = count($siblingThreads);
|
||||
$discriminateThread = $currentDelegation['ROU_CONDITION'];
|
||||
//$checkThread = count($totalThreads) - $cond;
|
||||
if($discriminateThread == $siblingThreadsCount)
|
||||
$canDerivate = true;
|
||||
else
|
||||
$canDerivate = false;
|
||||
}
|
||||
else {
|
||||
$canDerivate = true;
|
||||
}
|
||||
$siblingThreads = $this->case->GetAllOpenDelegation($currentDelegation);
|
||||
$aData = $this->case->loadCase($currentDelegation['APP_UID']);
|
||||
|
||||
if (isset($aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'])]))
|
||||
$sMIinstanceVar = $aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'])];
|
||||
else
|
||||
$sMIinstanceVar = $aData['APP_DATA']['TAS_MI_INSTANCE_VARIABLE'];
|
||||
|
||||
if (isset($aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'])]))
|
||||
$sMIcompleteVar = $aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'])];
|
||||
else
|
||||
$sMIcompleteVar = $aData['APP_DATA']['TAS_MI_COMPLETE_VARIABLE'];
|
||||
$discriminateThread = $sMIinstanceVar - $sMIcompleteVar;
|
||||
// -1 because One App Delegation is closed by above Code
|
||||
if($discriminateThread == count($siblingThreads))
|
||||
$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'],$currentDelegation['ROU_TYPE']);
|
||||
$canDerivate = count($siblingThreads) == 0;
|
||||
}
|
||||
else if($currentDelegation['ROU_TYPE'] == 'DISCRIMINATOR')
|
||||
{
|
||||
//First get the total threads of Next Task where route type='Discriminator'
|
||||
$siblingThreads = $this->case->getOpenSiblingThreads($nextDel['TAS_UID'], $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'], $currentDelegation['TAS_UID'],$currentDelegation['ROU_TYPE']);
|
||||
$siblingThreadsCount = count($siblingThreads);
|
||||
$discriminateThread = $currentDelegation['ROU_CONDITION'];
|
||||
//$checkThread = count($totalThreads) - $cond;
|
||||
if($discriminateThread == $siblingThreadsCount)
|
||||
$canDerivate = true;
|
||||
else
|
||||
$canDerivate = false;
|
||||
}
|
||||
else {
|
||||
$canDerivate = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( $canDerivate ) {
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
$delType = 'NORMAL';
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
$delType = 'NORMAL';
|
||||
switch ( $nextDel['TAS_ASSIGN_TYPE'] ) {
|
||||
case 'CANCEL_MI':
|
||||
case 'STATIC_MI':
|
||||
// Create new delegation depending on the no of users in the group
|
||||
$iNewAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
$this->case->closeAppThread ( $currentDelegation['APP_UID'], $iAppThreadIndex);
|
||||
foreach($nextDel['NEXT_TASK']['USER_ASSIGNED'] as $key=>$aValue){
|
||||
//Incrementing the Del_thread First so that new delegation has new del_thread
|
||||
$iNewAppThreadIndex += 1;
|
||||
//Creating new delegation according to users in group
|
||||
$iMIDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'],
|
||||
(isset($aValue['USR_UID']) ? $aValue['USR_UID'] : ''),
|
||||
$currentDelegation['DEL_INDEX'],
|
||||
$nextDel['DEL_PRIORITY'],
|
||||
$delType,
|
||||
$iNewAppThreadIndex);
|
||||
case 'CANCEL_MI':
|
||||
case 'STATIC_MI':
|
||||
// Create new delegation depending on the no of users in the group
|
||||
$iNewAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
$this->case->closeAppThread ( $currentDelegation['APP_UID'], $iAppThreadIndex);
|
||||
foreach($nextDel['NEXT_TASK']['USER_ASSIGNED'] as $key=>$aValue){
|
||||
//Incrementing the Del_thread First so that new delegation has new del_thread
|
||||
$iNewAppThreadIndex += 1;
|
||||
//Creating new delegation according to users in group
|
||||
$iMIDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'],
|
||||
(isset($aValue['USR_UID']) ? $aValue['USR_UID'] : ''),
|
||||
$currentDelegation['DEL_INDEX'],
|
||||
$nextDel,
|
||||
$delType,
|
||||
$iNewAppThreadIndex);
|
||||
|
||||
$iNewThreadIndex = $this->case->newAppThread ( $currentDelegation['APP_UID'], $iMIDelIndex, $iAppThreadIndex );
|
||||
|
||||
//Setting the del Index for Updating the AppThread delIndex
|
||||
if($key == 0)
|
||||
$iNewDelIndex = $iMIDelIndex -1;
|
||||
}
|
||||
break;
|
||||
case 'BALANCED' :
|
||||
$this->setTasLastAssigned ($nextDel['TAS_UID'], $nextDel['USR_UID']);
|
||||
//No Break, need no execute the default ones....
|
||||
default:
|
||||
// Create new delegation
|
||||
$iNewDelIndex = $this->case->newAppDelegation(
|
||||
$appFields['PRO_UID'], $currentDelegation['APP_UID'], $nextDel['TAS_UID'],
|
||||
(isset($nextDel['USR_UID']) ? $nextDel['USR_UID'] : ''),
|
||||
$currentDelegation['DEL_INDEX'],
|
||||
$nextDel['DEL_PRIORITY'],
|
||||
$delType,
|
||||
$iAppThreadIndex);
|
||||
break;
|
||||
}
|
||||
$iNewThreadIndex = $this->case->newAppThread ( $currentDelegation['APP_UID'], $iMIDelIndex, $iAppThreadIndex );
|
||||
|
||||
//Setting the del Index for Updating the AppThread delIndex
|
||||
if($key == 0)
|
||||
$iNewDelIndex = $iMIDelIndex -1;
|
||||
}
|
||||
break;
|
||||
case 'BALANCED' :
|
||||
$this->setTasLastAssigned ($nextDel['TAS_UID'], $nextDel['USR_UID']);
|
||||
//No Break, need no execute the default ones....
|
||||
default:
|
||||
// Create new delegation
|
||||
$iNewDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'],
|
||||
(isset($nextDel['USR_UID']) ? $nextDel['USR_UID'] : ''),
|
||||
$currentDelegation['DEL_INDEX'],
|
||||
$nextDel,
|
||||
$delType,
|
||||
$iAppThreadIndex);
|
||||
break;
|
||||
}
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
switch ( $currentDelegation['ROU_TYPE'] ) {
|
||||
case 'PARALLEL' :
|
||||
@@ -652,20 +651,21 @@ class Derivation
|
||||
$this->case->closeAppThread ( $currentDelegation['APP_UID'], $iAppThreadIndex);
|
||||
$iNewThreadIndex = $this->case->newAppThread ( $currentDelegation['APP_UID'], $iNewDelIndex, $iAppThreadIndex );
|
||||
$this->case->updateAppDelegation ( $currentDelegation['APP_UID'], $iNewDelIndex, $iNewThreadIndex );
|
||||
//print " this->case->updateAppDelegation ( " . $currentDelegation['APP_UID'] .", " . $iNewDelIndex ." , " . $iNewThreadIndex . " )<br>";
|
||||
break;
|
||||
case 'DISCRIMINATOR':
|
||||
case 'DISCRIMINATOR':
|
||||
if($currentDelegation['ROU_OPTIONAL'] == 'TRUE')
|
||||
{
|
||||
$this->case->discriminateCases($currentDelegation);
|
||||
} //No Break, executing Default Condition
|
||||
default :
|
||||
switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
|
||||
case 'CANCEL_MI':
|
||||
case 'CANCEL_MI':
|
||||
$this->case->discriminateCases($currentDelegation);
|
||||
} //No Break, executing updateAppThread
|
||||
} //No Break, executing updateAppThread
|
||||
$this->case->updateAppThread ( $currentDelegation['APP_UID'], $iAppThreadIndex, $iNewDelIndex );
|
||||
}//switch
|
||||
|
||||
|
||||
//if there are subprocess to create
|
||||
if (isset($aSP)) {
|
||||
//Create the new case in the sub-process
|
||||
@@ -732,7 +732,7 @@ class Derivation
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else { //when the task doesnt generate a new AppDelegation
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
@@ -777,7 +777,7 @@ class Derivation
|
||||
* @param string $sApplicationUID
|
||||
* @return void
|
||||
*/
|
||||
function verifyIsCaseChild($sApplicationUID)
|
||||
function verifyIsCaseChild($sApplicationUID)
|
||||
{
|
||||
//Obtain the related row in the table SUB_APPLICATION
|
||||
$oCriteria = new Criteria('workflow');
|
||||
@@ -836,7 +836,7 @@ class Derivation
|
||||
$aDeriveTask['NEXT_TASK']['USER_ASSIGNED'] = $selectedUser;
|
||||
$myLabels = array ( $aDeriveTask['NEXT_TASK']['TAS_TITLE'], $aParentCase['APP_NUMBER'], $selectedUser['USR_USERNAME'], $selectedUser['USR_FIRSTNAME'], $selectedUser['USR_LASTNAME'] );
|
||||
G::SendTemporalMessage( 'ID_TASK_WAS_ASSIGNED_TO_USER', 'warning', 'labels', 10, null, $myLabels);
|
||||
|
||||
|
||||
}
|
||||
$nextDelegations2[] = array(
|
||||
'TAS_UID' => $aDeriveTask['NEXT_TASK']['TAS_UID'],
|
||||
@@ -861,16 +861,16 @@ class Derivation
|
||||
}
|
||||
}
|
||||
|
||||
/* getDerivatedCases
|
||||
/* getDerivatedCases
|
||||
* get all derivated cases and subcases from any task,
|
||||
* this function is useful to know who users have been assigned and what task they do.
|
||||
*
|
||||
* @param string $sParentUid
|
||||
* @param string $sDelIndexParent
|
||||
* @return array $derivation
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getDerivatedCases ( $sParentUid, $sDelIndexParent )
|
||||
function getDerivatedCases ( $sParentUid, $sDelIndexParent )
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$cases = array();
|
||||
|
||||
@@ -170,6 +170,9 @@ class processMap {
|
||||
case 'SEC-JOIN' :
|
||||
$aRow2 ['ROU_TYPE'] = 5;
|
||||
break;
|
||||
case 'DISCRIMINATOR' :
|
||||
$aRow2 ['ROU_TYPE'] = 8;
|
||||
break;
|
||||
}
|
||||
$oTo = null;
|
||||
$oTo->task = $aRow2 ['ROU_NEXT_TASK'];
|
||||
@@ -2247,6 +2250,18 @@ class processMap {
|
||||
}
|
||||
$sXmlform = 'patterns_ParallelByEvaluation';
|
||||
break;
|
||||
case 'DISCRIMINATOR' :
|
||||
G::LoadClass ( 'xmlfield_InputPM' );
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] [$aRow ['ROU_CASE']] = $aRow ['ROU_UID'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_NEXT_TASK'] [$aRow ['ROU_CASE']] = $aRow ['ROU_NEXT_TASK'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_CONDITION'] [$aRow ['ROU_CASE']] = $aRow ['ROU_CONDITION'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_OPTIONAL'] [$aRow ['ROU_CASE']] = $aRow ['ROU_OPTIONAL'];
|
||||
G::LoadClass('tasks');
|
||||
$oTasks = new Tasks();
|
||||
$routeData = $oTasks->getRouteByType($sProcessUID, $aRow['ROU_NEXT_TASK'], $aRow['ROU_TYPE']);
|
||||
$aFields['ROUTE_COUNT'] = count($routeData);
|
||||
$sXmlform = 'patterns_Discriminator';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$aFields ['action'] = 'savePattern';
|
||||
@@ -2337,6 +2352,19 @@ class processMap {
|
||||
$oDataset->next();
|
||||
}
|
||||
break;
|
||||
case 'DISCRIMINATOR' :
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] [$aRow ['ROU_CASE']] = $aRow ['ROU_UID'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_NEXT_TASK'] [$aRow ['ROU_CASE']] = $aRow ['ROU_NEXT_TASK'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_CONDITION'] [$aRow ['ROU_CASE']] = $aRow ['ROU_CONDITION'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_OPTIONAL'] [$aRow ['ROU_CASE']] = $aRow ['ROU_OPTIONAL'];
|
||||
while ( $aRow = $oDataset->getRow () ) {
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] [$aRow ['ROU_CASE']] = $aRow ['ROU_UID'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_NEXT_TASK'] [$aRow ['ROU_CASE']] = $aRow ['ROU_NEXT_TASK'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_CONDITION'] [$aRow ['ROU_CASE']] = $aRow ['ROU_CONDITION'];
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_OPTIONAL'] [$aRow ['ROU_CASE']] = $aRow ['ROU_OPTIONAL'];
|
||||
$oDataset->next ();
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -2375,6 +2403,13 @@ class processMap {
|
||||
$aFields ['GRID_PARALLEL_EVALUATION_TYPE'] ['ROU_CONDITION'] [$iRow] = '';
|
||||
$aFields ['GRID_PARALLEL_EVALUATION_TYPE'] ['ROU_TO_LAST_USER'] [$iRow] = '';
|
||||
break;
|
||||
case 'DISCRIMINATOR' :
|
||||
$iRow = (isset ( $aFields ['GRID_DISCRIMINATOR_TYPE'] ) ? count ( $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] ) + 1 : 0);
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] [$iRow] = '';
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_NEXT_TASK'] [$iRow] = $sNextTask;
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_CONDITION'] [$iRow] = '';
|
||||
$aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_TO_LAST_USER'] [$iRow] = '';
|
||||
break;
|
||||
}
|
||||
$aFields ['action'] = 'savePattern';
|
||||
$aFields ['LANG'] = SYS_LANG;
|
||||
|
||||
@@ -36,7 +36,7 @@ require_once 'classes/model/Users.php';
|
||||
/**
|
||||
* Tasks - Tasks class
|
||||
* @package ProcessMaker
|
||||
* @author Julio Cesar Laura Avenda<64>o
|
||||
* @author Julio Cesar Laura Avenda<64>o
|
||||
* @copyright 2007 COLOSA
|
||||
*/
|
||||
|
||||
@@ -648,5 +648,35 @@ class Tasks
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Routes for any Process,route type,route next task
|
||||
* @param string $sProUid, $sTaskUid
|
||||
* @return array
|
||||
* by Girish
|
||||
*/
|
||||
public function getRouteByType($sProUid, $sRouteNextTaskUid,$sRouteType)
|
||||
{
|
||||
try {
|
||||
$aRoutes = array();
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(RoutePeer::PRO_UID, $sProUid);
|
||||
$oCriteria->add(RoutePeer::ROU_NEXT_TASK, $sRouteNextTaskUid);
|
||||
$oCriteria->add(RoutePeer::ROU_TYPE, $sRouteType);
|
||||
$oDataset = RoutePeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aRoutes[] = $aRow;
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
return $aRoutes;
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -26,6 +26,7 @@
|
||||
require_once 'classes/model/om/BaseAppDelegation.php';
|
||||
require_once ( "classes/model/HolidayPeer.php" );
|
||||
require_once ( "classes/model/TaskPeer.php" );
|
||||
require_once ( "classes/model/Task.php" );
|
||||
G::LoadClass("dates");
|
||||
|
||||
/**
|
||||
@@ -51,7 +52,7 @@ class AppDelegation extends BaseAppDelegation {
|
||||
* @param $isSubprocess is a subprocess inside a process?
|
||||
* @return delegation index of the application delegation.
|
||||
*/
|
||||
function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess=false, $sPrevious=-1 ) {
|
||||
function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $sNextTasParam,$iPriority = 3, $isSubprocess=false ) {
|
||||
|
||||
if (!isset($sProUid) || strlen($sProUid) == 0 ) {
|
||||
throw ( new Exception ( 'Column "PRO_UID" cannot be null.' ) );
|
||||
@@ -75,17 +76,19 @@ class AppDelegation extends BaseAppDelegation {
|
||||
$c = new Criteria ();
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn ( 'MAX(' . AppDelegationPeer::DEL_INDEX . ') ' );
|
||||
$c->addSelectColumn ( AppDelegationPeer::DEL_STARTED );
|
||||
$c->add ( AppDelegationPeer::APP_UID, $sAppUid );
|
||||
$rs = AppDelegationPeer::doSelectRS ( $c );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$delIndex = $row[0] + 1;
|
||||
//$delStarted = $row[1]; ???? blame -> gustavo,..$row[1] doesn't exist
|
||||
|
||||
$this->setAppUid ( $sAppUid );
|
||||
$this->setProUid ( $sProUid );
|
||||
$this->setTasUid ( $sTasUid );
|
||||
$this->setDelIndex ( $delIndex );
|
||||
$this->setDelPrevious ( $sPrevious == -1 ? 0 : $sPrevious );
|
||||
$this->setDelPrevious ( 0 );
|
||||
$this->setUsrUid ( $sUsrUid );
|
||||
$this->setDelType ( 'NORMAL' );
|
||||
$this->setDelPriority ( ($iPriority != '' ? $iPriority : '3') );
|
||||
@@ -93,14 +96,15 @@ class AppDelegation extends BaseAppDelegation {
|
||||
$this->setDelThreadStatus ( 'OPEN' );
|
||||
$this->setDelDelegateDate ( 'now' );
|
||||
//The function return an array now. By JHL
|
||||
$delTaskDueDate=$this->calculateDueDate();
|
||||
$delTaskDueDate=$this->calculateDueDate($sNextTasParam);
|
||||
$this->setDelTaskDueDate ( $delTaskDueDate['DUE_DATE'] ); // Due date formatted
|
||||
$this->setDelData ( '' ); //$delTaskDueDate['DUE_DATE_LOG'] ); // Log of actions made by Calendar Engine
|
||||
$this->setDelData ( $delTaskDueDate['DUE_DATE_LOG'] ); // Log of actions made by Calendar Engine
|
||||
|
||||
// this condition assures that an internal delegation like a subprocess dont have an initial date setted
|
||||
if ( $delIndex == 1 && !$isSubprocess ) //the first delegation, init date this should be now for draft applications, in other cases, should be null.
|
||||
$this->setDelInitDate ('now' );
|
||||
|
||||
|
||||
if ($this->validate() ) {
|
||||
try {
|
||||
$res = $this->save();
|
||||
@@ -116,7 +120,7 @@ class AppDelegation extends BaseAppDelegation {
|
||||
foreach($validationFailuresArray as $objValidationFailure) {
|
||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||
}
|
||||
throw ( new Exception ( 'Failed Data validation saving APP_DELEGATION row: ' . $msg ) );
|
||||
throw ( new Exception ( 'Failed Data validation. ' . $msg ) );
|
||||
}
|
||||
|
||||
return $this->getDelIndex();
|
||||
@@ -139,7 +143,7 @@ class AppDelegation extends BaseAppDelegation {
|
||||
return $aFields;
|
||||
}
|
||||
else {
|
||||
throw( new Exception( "The row '$AppUid, $sDelIndex' in table AppDelegation doesn't exist!" ));
|
||||
throw( new Exception( "The row '$AppUid, $sDelIndex' in table AppDelegation doesn't exists!" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
@@ -176,7 +180,7 @@ class AppDelegation extends BaseAppDelegation {
|
||||
}
|
||||
else {
|
||||
$con->rollback();
|
||||
throw(new Exception( "This AppDelegation row doesn't exist!" ));
|
||||
throw(new Exception( "This AppDelegation row doesn't exists!" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
@@ -203,20 +207,44 @@ class AppDelegation extends BaseAppDelegation {
|
||||
|
||||
// TasTypeDay = 1 => working days
|
||||
// TasTypeDay = 2 => calendar days
|
||||
function calculateDueDate()
|
||||
function calculateDueDate($sNextTasParam)
|
||||
{
|
||||
//Get Task properties
|
||||
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
|
||||
|
||||
$aData['TAS_UID'] = $this->getTasUid();
|
||||
//Added to allow User defined Timing Control at Run time from Derivation screen
|
||||
if(isset($sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true')
|
||||
{
|
||||
$aData['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
|
||||
$aData['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
|
||||
$aData['TAS_TYPE_DAY'] = $sNextTasParam['NEXT_TASK']['TAS_TYPE_DAY'];
|
||||
if(isset($sNextTasParam['NEXT_TASK']['TAS_CALENDAR']) && $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'] != '')
|
||||
$aCalendarUID = $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'];
|
||||
else
|
||||
$aCalendarUID = '';
|
||||
//Updating the task Table , so that user will see updated values in the assign screen in consequent cases
|
||||
$oTask = new Task();
|
||||
$oTask->update($aData);
|
||||
}
|
||||
else
|
||||
{
|
||||
$aData['TAS_DURATION'] = $task->getTasDuration();
|
||||
$aData['TAS_TIMEUNIT'] = $task->getTasTimeUnit();
|
||||
$aData['TAS_TYPE_DAY'] = $task->getTasTypeDay();
|
||||
$aCalendarUID = '';
|
||||
}
|
||||
|
||||
//use the dates class to calculate dates
|
||||
$dates = new dates();
|
||||
$iDueDate = $dates->calculateDate( $this->getDelDelegateDate(),
|
||||
$task->getTasDuration(),
|
||||
$task->getTasTimeUnit(), //hours or days, ( we only accept this two types or maybe weeks
|
||||
$task->getTasTypeDay(), //working or calendar days
|
||||
$aData['TAS_DURATION'],
|
||||
$aData['TAS_TIMEUNIT'], //hours or days, ( we only accept this two types or maybe weeks
|
||||
$aData['TAS_TYPE_DAY'], //working or calendar days
|
||||
$this->getUsrUid(),
|
||||
$task->getProUid(),
|
||||
$this->getTasUid() );
|
||||
$aData['TAS_UID'],
|
||||
$aCalendarUID);
|
||||
return $iDueDate;
|
||||
}
|
||||
|
||||
@@ -226,7 +254,7 @@ function getDiffDate ( $date1, $date2 ) {
|
||||
}
|
||||
function calculateDuration() {
|
||||
try {
|
||||
//patch rows with initdate = null and finish_date
|
||||
//patch rows with initdate = null and finish_date
|
||||
$c = new Criteria();
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(AppDelegationPeer::APP_UID );
|
||||
@@ -272,7 +300,7 @@ function getDiffDate ( $date1, $date2 ) {
|
||||
$c->addSelectColumn(TaskPeer::TAS_DURATION);
|
||||
$c->addSelectColumn(TaskPeer::TAS_TIMEUNIT);
|
||||
$c->addSelectColumn(TaskPeer::TAS_TYPE_DAY);
|
||||
|
||||
|
||||
$c->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN );
|
||||
//$c->add(AppDelegationPeer::DEL_INIT_DATE, NULL, Criteria::ISNULL);
|
||||
//$c->add(AppDelegationPeer::APP_UID, '7694483844a37bfeb0931b1063501289');
|
||||
@@ -289,7 +317,7 @@ function getDiffDate ( $date1, $date2 ) {
|
||||
$row = $rs->getRow();
|
||||
$i =0;
|
||||
//print "<table colspacing='2' border='1'>";
|
||||
//print "<tr><td>iDelegateDate </td><td>iInitDate </td><td>iDueDate </td><td>iFinishDate </td><td>isStarted </td><td>isFinished </td><td>isDelayed </td><td>queueDuration </td><td>delDuration </td><td>delayDuration</td></tr>";
|
||||
//print "<tr><td>iDelegateDate </td><td>iInitDate </td><td>iDueDate </td><td>iFinishDate </td><td>isStarted </td><td>isFinished </td><td>isDelayed </td><td>queueDuration </td><td>delDuration </td><td>delayDuration</td></tr>";
|
||||
$now = strtotime ( 'now' );
|
||||
while ( is_array($row) ) {
|
||||
$fTaskDuration = $row['TAS_DURATION'];
|
||||
@@ -304,9 +332,9 @@ $i =0;
|
||||
$delDuration = 0;
|
||||
$delayDuration = 0;
|
||||
$overduePercentage = 0.0;
|
||||
//get the object,
|
||||
//get the object,
|
||||
$oAppDel = AppDelegationPeer::retrieveByPk($row['APP_UID'], $row['DEL_INDEX'] );
|
||||
//if the task is not started
|
||||
//if the task is not started
|
||||
if ( $isStarted == 0 ) {
|
||||
if ( $row['DEL_INIT_DATE'] != NULL && $row['DEL_INIT_DATE'] != '' ) {
|
||||
$oAppDel->setDelStarted(1);
|
||||
@@ -322,7 +350,7 @@ $i =0;
|
||||
$oAppDel->setDelDelayDuration( $delayDuration);
|
||||
if ( $fTaskDuration != 0) {
|
||||
$overduePercentage = $delayDuration / $fTaskDuration;
|
||||
$oAppDel->setAppOverduePercentage( $overduePercentage);
|
||||
$oAppDel->setAppOverduePercentage( $overduePercentage);
|
||||
if ( $iDueDate < $now ) {
|
||||
$oAppDel->setDelDelayed(1);
|
||||
}
|
||||
@@ -352,7 +380,7 @@ $i =0;
|
||||
if ( $row['DEL_INIT_DATE'] != NULL && $row['DEL_INIT_DATE'] != '' ) {
|
||||
$delDuration = $this->getDiffDate ($now, $iInitDate );
|
||||
}
|
||||
else
|
||||
else
|
||||
$delDuration = $this->getDiffDate ($now, $iDelegateDate);
|
||||
$oAppDel->setDelDuration( $delDuration);
|
||||
|
||||
@@ -361,7 +389,7 @@ $i =0;
|
||||
$oAppDel->setDelDelayDuration( $delayDuration);
|
||||
if ( $fTaskDuration != 0) {
|
||||
$overduePercentage = $delayDuration / $fTaskDuration;
|
||||
$oAppDel->setAppOverduePercentage($overduePercentage );
|
||||
$oAppDel->setAppOverduePercentage($overduePercentage );
|
||||
if ( $iDueDate < $now ) {
|
||||
$oAppDel->setDelDelayed(1);
|
||||
}
|
||||
@@ -369,26 +397,26 @@ $i =0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//and finally save the record
|
||||
$RES = $oAppDel->save();
|
||||
//print "<tr><td>$iDelegateDate </td><td>$iInitDate </td><td>$iDueDate </td><td>$iFinishDate </td><td>$isStarted </td><td>$isFinished </td><td>$isDelayed</td><td>$queueDuration </td><td>$delDuration </td>" .
|
||||
// "<td>$delayDuration</td><td>$overduePercentage</td><td>" . $row['DEL_INDEX'] . " $RES </td></tr>";
|
||||
// "<td>$delayDuration</td><td>$overduePercentage</td><td>" . $row['DEL_INDEX'] . " $RES </td></tr>";
|
||||
|
||||
//UPDATE APP_DELEGATION SET DEL_DELAYED = 0
|
||||
//where
|
||||
//where
|
||||
// APP_OVERDUE_PERCENTAGE < 0
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch ( Exception $oError) {
|
||||
//krumo ( $oError->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getLastDeleration($APP_UID){
|
||||
$c = new Criteria('workflow');
|
||||
$c->addSelectColumn(AppDelegationPeer::APP_UID );
|
||||
@@ -404,7 +432,7 @@ $i =0;
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
|
||||
$c->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
|
||||
|
||||
$c->add(AppDelegationPeer::APP_UID, $APP_UID);
|
||||
$c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$rs = AppDelegationPeer::doSelectRS($c);
|
||||
|
||||
@@ -144,7 +144,7 @@ class TaskMapBuilder {
|
||||
|
||||
$tMap->addColumn('TAS_BOUNDARY', 'TasBoundary', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS', 'Please select a valid value for TAS_TYPE.');
|
||||
$tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS|HIDDEN', 'Please select a valid value for TAS_TYPE.');
|
||||
|
||||
$tMap->addValidator('TAS_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'MINUTES|HOURS|DAYS|WEEKS|MONTHS', 'Please select a valid value for TAS_TIMEUNIT.');
|
||||
|
||||
|
||||
@@ -3489,7 +3489,7 @@
|
||||
</vendor>
|
||||
</column>
|
||||
<validator column="TAS_TYPE">
|
||||
<rule name="validValues" value="NORMAL|ADHOC|SUBPROCESS" message="Please select a valid value for TAS_TYPE." />
|
||||
<rule name="validValues" value="NORMAL|ADHOC|SUBPROCESS|HIDDEN" message="Please select a valid value for TAS_TYPE." />
|
||||
</validator>
|
||||
<validator column="TAS_TIMEUNIT">
|
||||
<rule name="validValues" value="MINUTES|HOURS|DAYS|WEEKS|MONTHS" message="Please select a valid value for TAS_TIMEUNIT." />
|
||||
|
||||
BIN
workflow/engine/js/processmap/core/images/8.gif
Executable file
BIN
workflow/engine/js/processmap/core/images/8.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 732 B |
BIN
workflow/engine/js/processmap/core/images/8t.gif
Executable file
BIN
workflow/engine/js/processmap/core/images/8t.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 796 B |
@@ -43,7 +43,17 @@ var saveDataTaskTemporal = function(iForm)
|
||||
{
|
||||
oTaskData.TAS_ASSIGN_TYPE = 'EVALUATE';
|
||||
}
|
||||
if (getField('TAS_ASSIGN_TYPE][STATIC_MI').checked)
|
||||
{
|
||||
oTaskData.TAS_ASSIGN_TYPE = 'STATIC_MI';
|
||||
}
|
||||
if (getField('TAS_ASSIGN_TYPE][CANCEL_MI').checked)
|
||||
{
|
||||
oTaskData.TAS_ASSIGN_TYPE = 'CANCEL_MI';
|
||||
}
|
||||
oTaskData.TAS_ASSIGN_VARIABLE = getField('TAS_ASSIGN_VARIABLE').value;
|
||||
oTaskData.TAS_MI_INSTANCE_VARIABLE = getField('TAS_MI_INSTANCE_VARIABLE').value;
|
||||
oTaskData.TAS_MI_COMPLETE_VARIABLE = getField('TAS_MI_COMPLETE_VARIABLE').value;
|
||||
break;
|
||||
case 3:
|
||||
case '3':
|
||||
@@ -51,7 +61,7 @@ var saveDataTaskTemporal = function(iForm)
|
||||
oTaskData.TAS_TIMEUNIT = getField('TAS_TIMEUNIT').value;
|
||||
oTaskData.TAS_TYPE_DAY = getField('TAS_TYPE_DAY').value;
|
||||
oTaskData.TAS_CALENDAR = getField('TAS_CALENDAR').value;
|
||||
//oTaskData.TAS_TRANSFER_FLY = (getField('TAS_TRANSFER_FLY').checked ? 'TRUE' : 'FALSE');
|
||||
oTaskData.TAS_TRANSFER_FLY = (getField('TAS_TRANSFER_FLY').checked ? 'TRUE' : 'FALSE');
|
||||
break;
|
||||
case 4:
|
||||
case '4':
|
||||
|
||||
@@ -171,132 +171,136 @@ var processmap=function(){
|
||||
bbk[lanzado]();
|
||||
},
|
||||
panel:function()
|
||||
{
|
||||
/* Toolbar Begin */
|
||||
var panel;
|
||||
panel = this.panels.toolbar=new leimnud.module.panel();
|
||||
this.panels.toolbar.options={
|
||||
limit :true,
|
||||
size :{w:230,h:31},
|
||||
position:{x:this.options.target.clientWidth-242,y:4},
|
||||
title :"",
|
||||
theme :"processmaker",
|
||||
target :this.options.target,
|
||||
//limit :true,
|
||||
titleBar:false,
|
||||
statusBar:false,
|
||||
elementToDrag:"content",
|
||||
cursorToDrag:"default",
|
||||
control :{drag:true,resize:false},
|
||||
fx :{opacity:true,shadow:false}
|
||||
};
|
||||
panel.setStyle={
|
||||
containerWindow:{border:"1px solid buttonshadow"},
|
||||
frontend:{backgroundColor:"buttonface"},
|
||||
content:{border:"1px solid transparent",backgroundColor:"transparent",margin:0,overflow:"hidden",padding:1}
|
||||
};
|
||||
this.panels.toolbar.make();
|
||||
var div = document.createElement("div");
|
||||
this.parent.dom.setStyle(div,{
|
||||
textAlign:"center"
|
||||
});
|
||||
var dr1 = document.createElement("img");
|
||||
dr1.src = this.options.images_dir+"0.gif";
|
||||
dr1.title = G_STRINGS.ID_PROCESSMAP_SEQUENTIAL;
|
||||
div.appendChild(dr1);
|
||||
//dr1.style.marginTop=7;
|
||||
//div.appendChild(document.createElement("p"));
|
||||
var dr2 = document.createElement("img");
|
||||
//dr2.style.marginTop=7;
|
||||
dr2.src = this.options.images_dir+"1.gif";
|
||||
dr2.title = G_STRINGS.ID_PROCESSMAP_SELECTION;
|
||||
{
|
||||
/* Toolbar Begin */
|
||||
var panel;
|
||||
panel = this.panels.toolbar=new leimnud.module.panel();
|
||||
this.panels.toolbar.options={
|
||||
limit :true,
|
||||
size :{w:260,h:31},
|
||||
position:{x:this.options.target.clientWidth-278,y:4},
|
||||
title :"",
|
||||
theme :"processmaker",
|
||||
target :this.options.target,
|
||||
//limit :true,
|
||||
titleBar:false,
|
||||
statusBar:false,
|
||||
elementToDrag:"content",
|
||||
cursorToDrag:"default",
|
||||
control :{drag:true,resize:false},
|
||||
fx :{opacity:true,shadow:false}
|
||||
};
|
||||
panel.setStyle={
|
||||
containerWindow:{border:"1px solid buttonshadow"},
|
||||
frontend:{backgroundColor:"buttonface"},
|
||||
content:{border:"1px solid transparent",backgroundColor:"transparent",margin:0,overflow:"hidden",padding:1}
|
||||
};
|
||||
this.panels.toolbar.make();
|
||||
var div = document.createElement("div");
|
||||
this.parent.dom.setStyle(div,{
|
||||
textAlign:"center"
|
||||
});
|
||||
var dr1 = document.createElement("img");
|
||||
dr1.src = this.options.images_dir+"0.gif";
|
||||
dr1.title = G_STRINGS.ID_PROCESSMAP_SEQUENTIAL;
|
||||
div.appendChild(dr1);
|
||||
//dr1.style.marginTop=7;
|
||||
//div.appendChild(document.createElement("p"));
|
||||
var dr2 = document.createElement("img");
|
||||
//dr2.style.marginTop=7;
|
||||
dr2.src = this.options.images_dir+"1.gif";
|
||||
dr2.title = G_STRINGS.ID_PROCESSMAP_SELECTION;
|
||||
|
||||
div.appendChild(dr2);
|
||||
//div.appendChild(document.createElement("p"));
|
||||
var dr3 = document.createElement("img");
|
||||
dr3.src = this.options.images_dir+"2.gif";
|
||||
dr3.title = G_STRINGS.ID_PROCESSMAP_EVALUATION;
|
||||
//dr3.style.marginTop=7;
|
||||
div.appendChild(dr3);
|
||||
//div.appendChild(document.createElement("p"));
|
||||
var dr4 = document.createElement("img");
|
||||
dr4.src = this.options.images_dir+"3.gif";
|
||||
dr4.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_FORK;
|
||||
//dr4.style.marginTop=7;
|
||||
div.appendChild(dr4);
|
||||
//div.appendChild(document.createElement("p"));
|
||||
var dr5 = document.createElement("img");
|
||||
dr5.src = this.options.images_dir+"4.gif";
|
||||
dr5.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_EVALUATION_FORK;
|
||||
//dr5.style.marginTop=7;
|
||||
div.appendChild(dr5);
|
||||
div.appendChild(dr2);
|
||||
//div.appendChild(document.createElement("p"));
|
||||
var dr3 = document.createElement("img");
|
||||
dr3.src = this.options.images_dir+"2.gif";
|
||||
dr3.title = G_STRINGS.ID_PROCESSMAP_EVALUATION;
|
||||
//dr3.style.marginTop=7;
|
||||
div.appendChild(dr3);
|
||||
//div.appendChild(document.createElement("p"));
|
||||
var dr4 = document.createElement("img");
|
||||
dr4.src = this.options.images_dir+"3.gif";
|
||||
dr4.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_FORK;
|
||||
//dr4.style.marginTop=7;
|
||||
div.appendChild(dr4);
|
||||
//div.appendChild(document.createElement("p"));
|
||||
var dr5 = document.createElement("img");
|
||||
dr5.src = this.options.images_dir+"4.gif";
|
||||
dr5.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_EVALUATION_FORK;
|
||||
//dr5.style.marginTop=7;
|
||||
div.appendChild(dr5);
|
||||
|
||||
var dr6 = document.createElement("img");
|
||||
dr6.src = this.options.images_dir+"5.gif";
|
||||
dr6.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_JOIN;
|
||||
div.appendChild(dr6);
|
||||
var dr6 = document.createElement("img");
|
||||
dr6.src = this.options.images_dir+"5.gif";
|
||||
dr6.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_JOIN;
|
||||
div.appendChild(dr6);
|
||||
|
||||
var fin = document.createElement("img");
|
||||
fin.src = this.options.images_dir+"6.gif";
|
||||
fin.title = G_STRINGS.ID_END_OF_PROCESS;
|
||||
div.appendChild(fin);
|
||||
var fin = document.createElement("img");
|
||||
fin.src = this.options.images_dir+"6.gif";
|
||||
fin.title = G_STRINGS.ID_END_OF_PROCESS;
|
||||
div.appendChild(fin);
|
||||
|
||||
var ini = document.createElement("img");
|
||||
ini.src = this.options.images_dir+"7.gif";
|
||||
ini.title = "Starting task";
|
||||
div.appendChild(ini);
|
||||
var ini = document.createElement("img");
|
||||
ini.src = this.options.images_dir+"7.gif";
|
||||
ini.title = "Starting task";
|
||||
div.appendChild(ini);
|
||||
|
||||
var dis = document.createElement("img");
|
||||
dis.src = this.options.images_dir+"8.gif";
|
||||
dis.title = "Discriminator";
|
||||
div.appendChild(dis);
|
||||
|
||||
[dr1,dr2,dr3,dr4,dr5,dr6,fin,ini].map(function(el){
|
||||
el.className ="processmap_toolbarItem___"+this.options.theme
|
||||
}.extend(this));
|
||||
this.dragables.derivation = new this.parent.module.drag({
|
||||
elements:[dr1,dr2,dr3,dr4,dr5,dr6,fin,ini],
|
||||
fx:{
|
||||
type : "clone",
|
||||
target : this.panels.editor.elements.content,
|
||||
zIndex : 11
|
||||
}
|
||||
});
|
||||
this.dragables.derivation.typesDerivation=["simple","double","conditional","conditional1","conditional2","conditional3","final","initial"];
|
||||
this.dragables.derivation.events={
|
||||
init :[function(){
|
||||
this.dragables.derivation.noDrag=true;
|
||||
}.extend(this)],
|
||||
move:this.dropables.derivation.capture.args(this.dragables.derivation),
|
||||
finish : this.parent.closure({instance:this,method:function(){
|
||||
//clearInterval(this.timeToOutControl);
|
||||
[dr1,dr2,dr3,dr4,dr5,dr6,fin,ini,dis].map(function(el){
|
||||
el.className ="processmap_toolbarItem___"+this.options.theme
|
||||
}.extend(this));
|
||||
this.dragables.derivation = new this.parent.module.drag({ //Add to enable dragging of image from panel
|
||||
elements:[dr1,dr2,dr3,dr4,dr5,dr6,fin,ini,dis],
|
||||
fx:{
|
||||
type : "clone",
|
||||
target : this.panels.editor.elements.content,
|
||||
zIndex : 11
|
||||
}
|
||||
});
|
||||
this.dragables.derivation.typesDerivation=["simple","double","conditional","conditional1","conditional2","conditional3","final","initial","discriminator"];
|
||||
this.dragables.derivation.events={
|
||||
init :[function(){
|
||||
this.dragables.derivation.noDrag=true;
|
||||
}.extend(this)],
|
||||
move:this.dropables.derivation.capture.args(this.dragables.derivation),
|
||||
finish : this.parent.closure({instance:this,method:function(){
|
||||
//clearInterval(this.timeToOutControl);
|
||||
|
||||
this.parent.dom.remove(this.dropables.derivation.drag || this.dragables.derivation.currentElementDrag);
|
||||
this.parent.dom.remove(this.dragables.derivation.currentElementDrag);
|
||||
if(this.dropables.derivation.selected!==false)
|
||||
{
|
||||
this.dropables.derivation.launchEvents(this.dropables.derivation.elements[this.dropables.derivation.selected].events.out);
|
||||
vAux = this.dropables.derivation.launchEvents(this.dropables.derivation.elements[this.dropables.derivation.selected].events.click);
|
||||
this.dropables.derivation.selected = false;
|
||||
return vAux;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dragables.derivation.noDrag=false;
|
||||
}
|
||||
}})
|
||||
};
|
||||
this.dragables.derivation.make();
|
||||
//drg.options.elements=[];
|
||||
this.parent.dom.setStyle([dr1,dr2,dr3,dr4,dr5,dr6,fin,ini],{
|
||||
cursor:"move"
|
||||
});
|
||||
panel.loader.hide();
|
||||
panel.addContent(div);
|
||||
this.parent.dom.remove(this.dropables.derivation.drag || this.dragables.derivation.currentElementDrag);
|
||||
this.parent.dom.remove(this.dragables.derivation.currentElementDrag);
|
||||
if(this.dropables.derivation.selected!==false)
|
||||
{
|
||||
this.dropables.derivation.launchEvents(this.dropables.derivation.elements[this.dropables.derivation.selected].events.out);
|
||||
vAux = this.dropables.derivation.launchEvents(this.dropables.derivation.elements[this.dropables.derivation.selected].events.click);
|
||||
this.dropables.derivation.selected = false;
|
||||
return vAux;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dragables.derivation.noDrag=false;
|
||||
}
|
||||
}})
|
||||
};
|
||||
this.dragables.derivation.make();
|
||||
//drg.options.elements=[];
|
||||
this.parent.dom.setStyle([dr1,dr2,dr3,dr4,dr5,dr6,fin,ini,dis],{
|
||||
cursor:"move"
|
||||
});
|
||||
panel.loader.hide();
|
||||
panel.addContent(div);
|
||||
|
||||
leimnud._panel=['O'],leimnud.ipanel=0;
|
||||
/* Toolbar End */
|
||||
},
|
||||
components:{
|
||||
leimnud._panel=['O'],leimnud.ipanel=0;
|
||||
/* Toolbar End */
|
||||
},
|
||||
components:{
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
base:function(xml)
|
||||
{
|
||||
this.panels.editor.loader.hide();
|
||||
@@ -376,6 +380,7 @@ var processmap=function(){
|
||||
{separator:true},
|
||||
{image:"/images/add.png",text:G_STRINGS.ID_PROCESSMAP_ADD_TASK,launch:this.addTask.extend(this,{tp:'task'})},
|
||||
{image:"/images/subProcess.png",text:G_STRINGS.ID_PROCESSMAP_ADD_SUBPROCESS,launch:this.addTask.extend(this,{tp:'subprocess'})}, //add subprocess whith blabla
|
||||
{image:"/images/add.png",text:"Add Task Hidden",launch:this.addTask.extend(this,{tp:'hidden'})}, //add subprocess whith blabla
|
||||
{image:"/images/addtext.png",text:G_STRINGS.ID_PROCESSMAP_ADD_TEXT,launch:this.addText.extend(this)},
|
||||
{image:"/images/linhori.png",text:G_STRINGS.ID_PROCESSMAP_HORIZONTAL_LINE,launch:this.addGuide.extend(this,"horizontal")},
|
||||
{image:"/images/linver.png",text:G_STRINGS.ID_PROCESSMAP_VERTICAL_LINE,launch:this.addGuide.extend(this,"vertical")},
|
||||
@@ -647,103 +652,161 @@ var processmap=function(){
|
||||
r.make();
|
||||
}.extend(this)} ,
|
||||
{image:"/images/events.gif",text:G_STRINGS.ID_EVENTS,submenu:[
|
||||
{image:"/images/event_message.png",text:"Message",launch:function(event){
|
||||
this.tmp.eventsPanel = panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
limit :true,
|
||||
size :{w:700,h:380},
|
||||
position:{x:50,y:50,center:true},
|
||||
title :G_STRINGS.ID_EVENT_MESSAGE,
|
||||
theme :this.options.theme,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=events&data="+{
|
||||
pro_uid :this.options.uid,
|
||||
{image:"/images/event_message.png",text:"start message event",launch:function(event){
|
||||
this.tmp.editProcessPanel = panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
limit :true,
|
||||
size :{w:500,h:380},
|
||||
position:{x:50,y:50,center:true},
|
||||
title :G_STRINGS.ID_WEB_ENTRY,
|
||||
theme :this.options.theme,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=webEntry&data="+{
|
||||
pro_uid :this.options.uid
|
||||
}.toJSONString()
|
||||
});
|
||||
r.callback=function(rpc,panel)
|
||||
{
|
||||
panel.loader.hide();
|
||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
scs.evalScript();
|
||||
//Pm.objeto.innerHTML="asdasd";
|
||||
}.extend(this,panel);
|
||||
r.make();
|
||||
}.extend(this)},
|
||||
|
||||
{image:"/images/event_timer.png",text:"Start timer event",launch:function(event){
|
||||
this.tmp.eventsPanel = panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
limit :true,
|
||||
size :{w:830,h:800},
|
||||
position:{x:50,y:50,center:true},
|
||||
title :"CASES SCHEDULER",
|
||||
theme :this.options.theme,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=case_scheduler&PRO_UID="+this.options.uid
|
||||
});
|
||||
r.callback=function(rpc,panel)
|
||||
{
|
||||
panel.loader.hide();
|
||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
scs.evalScript();
|
||||
//Pm.objeto.innerHTML="asdasd";
|
||||
}.extend(this,panel);
|
||||
r.make();
|
||||
}.extend(this)},
|
||||
{image:"/images/event_messageThrow.png",text:"intermediate message event",launch:function(event){
|
||||
this.tmp.eventsPanel = panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
limit :true,
|
||||
size :{w:700,h:380},
|
||||
position:{x:50,y:50,center:true},
|
||||
title :G_STRINGS.ID_EVENT_MESSAGE,
|
||||
theme :this.options.theme,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=events&data="+{
|
||||
pro_uid :this.options.uid,
|
||||
type:"message"
|
||||
}.toJSONString()
|
||||
});
|
||||
r.callback=function(rpc,panel)
|
||||
{
|
||||
panel.loader.hide();
|
||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
scs.evalScript();
|
||||
//Pm.objeto.innerHTML="asdasd";
|
||||
}.extend(this,panel);
|
||||
r.make();
|
||||
}.extend(this)},
|
||||
{image:"/images/event_timer.png",text:"intermediate timer event ",launch:function(event){
|
||||
|
||||
this.tmp.eventsPanel = panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
limit :true,
|
||||
size :{w:700,h:380},
|
||||
position:{x:50,y:50,center:true},
|
||||
title :G_STRINGS.ID_EVENT_MULTIPLE,
|
||||
theme :this.options.theme,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=events&data="+{
|
||||
pro_uid :this.options.uid,
|
||||
type:"multiple"
|
||||
}.toJSONString()
|
||||
});
|
||||
r.callback=function(rpc,panel)
|
||||
{
|
||||
panel.loader.hide();
|
||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
scs.evalScript();
|
||||
//Pm.objeto.innerHTML="asdasd";
|
||||
}.extend(this,panel);
|
||||
r.make();
|
||||
}.extend(this)},
|
||||
{image:"/images/event_timer.png",text:" intermediate Boundary timer event",launch:function(event){}},
|
||||
/* {image:"/images/event_messageThrow.png",text:"end message event",launch:function(event){
|
||||
this.tmp.eventsPanel = panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
limit :true,
|
||||
size :{w:700,h:380},
|
||||
position:{x:50,y:50,center:true},
|
||||
title :G_STRINGS.ID_EVENT_MESSAGE,
|
||||
theme :this.options.theme,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=events&data="+{
|
||||
pro_uid :this.options.uid,
|
||||
type:"message"
|
||||
}.toJSONString()
|
||||
});
|
||||
r.callback=function(rpc,panel)
|
||||
{
|
||||
panel.loader.hide();
|
||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
scs.evalScript();
|
||||
//Pm.objeto.innerHTML="asdasd";
|
||||
}.extend(this,panel);
|
||||
r.make();
|
||||
}.extend(this)},
|
||||
|
||||
{image:"/images/event_conditional.png",text:"Conditional",launch:function(event){
|
||||
this.tmp.eventsPanel = panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
limit :true,
|
||||
size :{w:700,h:380},
|
||||
position:{x:50,y:50,center:true},
|
||||
title :G_STRINGS.ID_EVENT_CONDITIONAL,
|
||||
theme :this.options.theme,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=events&data="+{
|
||||
pro_uid :this.options.uid,
|
||||
type:"conditional"
|
||||
}.toJSONString()
|
||||
});
|
||||
r.callback=function(rpc,panel)
|
||||
{
|
||||
panel.loader.hide();
|
||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
scs.evalScript();
|
||||
//Pm.objeto.innerHTML="asdasd";
|
||||
}.extend(this,panel);
|
||||
r.make();
|
||||
}.extend(this)},
|
||||
{image:"/images/event_multiple.png",text:"Multiple",launch:function(event){
|
||||
this.tmp.eventsPanel = panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
limit :true,
|
||||
size :{w:700,h:380},
|
||||
position:{x:50,y:50,center:true},
|
||||
title :G_STRINGS.ID_EVENT_MULTIPLE,
|
||||
theme :this.options.theme,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=events&data="+{
|
||||
pro_uid :this.options.uid,
|
||||
type:"multiple"
|
||||
}.toJSONString()
|
||||
});
|
||||
r.callback=function(rpc,panel)
|
||||
{
|
||||
panel.loader.hide();
|
||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
scs.evalScript();
|
||||
//Pm.objeto.innerHTML="asdasd";
|
||||
}.extend(this,panel);
|
||||
r.make();
|
||||
}.extend(this)}
|
||||
|
||||
|
||||
]}
|
||||
}.toJSONString()
|
||||
});
|
||||
r.callback=function(rpc,panel)
|
||||
{
|
||||
panel.loader.hide();
|
||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
scs.evalScript();
|
||||
//Pm.objeto.innerHTML="asdasd";
|
||||
}.extend(this,panel);
|
||||
r.make();
|
||||
}.extend(this)},*/
|
||||
]}
|
||||
|
||||
]
|
||||
});
|
||||
@@ -752,19 +815,24 @@ var processmap=function(){
|
||||
this.data.render.task();
|
||||
},
|
||||
task:function()
|
||||
{
|
||||
var lngt = this.data.db.task.length;
|
||||
for(var i =0;i<lngt;i++)
|
||||
{
|
||||
//console.log(this.data.db.task[i]);
|
||||
var tt = ((this.data.db.task[i].task_type==='NORMAL') || (this.data.db.task[i].task_type==='ADHOC'))?'task':'subprocess';
|
||||
//this.parent.exec(this.data.build.task,[this.data.db.task[i],i],false,this);
|
||||
this.data.build.task(i,{tp:tt});
|
||||
}
|
||||
this.data.render.taskINI();
|
||||
this.data.render.guide();
|
||||
//this.parent.exec(this.data.build.derivation,false,false,this);
|
||||
},
|
||||
{
|
||||
var lngt = this.data.db.task.length;
|
||||
for(var i =0;i<lngt;i++)
|
||||
{
|
||||
//console.log(this.data.db.task[i]);
|
||||
|
||||
var tt = ((this.data.db.task[i].task_type==='NORMAL') || (this.data.db.task[i].task_type==='ADHOC'))?'task':'subprocess';
|
||||
if(this.data.db.task[i].task_type==='HIDDEN'){
|
||||
tt = 'hidden';
|
||||
}
|
||||
//this.parent.exec(this.data.build.task,[this.data.db.task[i],i],false,this);
|
||||
this.data.build.task(i,{tp:tt});
|
||||
|
||||
}
|
||||
this.data.render.taskINI();
|
||||
this.data.render.guide();
|
||||
//this.parent.exec(this.data.build.derivation,false,false,this);
|
||||
},
|
||||
taskINI:function()
|
||||
{
|
||||
var lngt = this.data.db.task.length;
|
||||
@@ -825,7 +893,7 @@ var processmap=function(){
|
||||
deri.to[i].object.line.remove();
|
||||
this.observers.lineas.unregister(deri.to[i].object.indexObserver);
|
||||
}
|
||||
if(deri.type===5)
|
||||
if(deri.type===5 || deri.type===8)
|
||||
{
|
||||
var toTask = this.data.db.task[this.tools.getIndexOfUid(deri.to[i].task)];
|
||||
toTask.object.inJoin = toTask.object.inJoin-1;
|
||||
@@ -1014,16 +1082,9 @@ var processmap=function(){
|
||||
var toTask=this.data.db.task[uid];
|
||||
var to = toTask.object.elements.task;
|
||||
|
||||
if(task.derivation.type!==5)
|
||||
if(task.derivation.type === 8 || task.derivation.type ===5)
|
||||
{
|
||||
this.parent.dom.setStyle(task.object.elements.derivation,{
|
||||
//background:((task.derivation.type===0)?"":"url("+this.options.images_dir+task.derivation.type+"t.gif?aa="+Math.random()+")")
|
||||
background:"url("+this.options.images_dir+task.derivation.type+"t.gif?aa="+Math.random()+")"
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
var ij = toTask.object.inJoin;
|
||||
var ij = toTask.object.inJoin;
|
||||
ij = (ij)?ij+1:1;
|
||||
toTask.object.inJoin = ij;
|
||||
this.parent.dom.setStyle(toTask.object.elements.init,{
|
||||
@@ -1032,6 +1093,14 @@ var processmap=function(){
|
||||
backgroundPosition:"2 0",
|
||||
backgroundRepeat:"no-repeat"
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.parent.dom.setStyle(task.object.elements.derivation,{
|
||||
//background:((task.derivation.type===0)?"":"url("+this.options.images_dir+task.derivation.type+"t.gif?aa="+Math.random()+")")
|
||||
background:"url("+this.options.images_dir+task.derivation.type+"t.gif?aa="+Math.random()+")"
|
||||
});
|
||||
}
|
||||
|
||||
var line = new this.parent.module.app.line({
|
||||
@@ -1086,6 +1155,9 @@ var processmap=function(){
|
||||
|
||||
if (this.options.rw) {
|
||||
options.color = ((options_task.tp==='task')?"auto":"#9B88CA");
|
||||
if(options_task.tp==='hidden'){
|
||||
options.color = "transparent";
|
||||
}
|
||||
}
|
||||
|
||||
var db = this.data.db, task=db.task[index];
|
||||
@@ -1099,7 +1171,15 @@ var processmap=function(){
|
||||
backgroundColor:(options.color ? options.color : 'auto')
|
||||
});
|
||||
|
||||
var subp = ((options_task.tp==='task')?"":"url(/images/subp.png)");
|
||||
if(options.color == '#9B88CA'){
|
||||
var subp = ((options_task.tp==='task')?"":"url(/images/subp.png)");
|
||||
}
|
||||
if(options.color == 'transparent'){
|
||||
var subp = ((options_task.tp==='task')?"":"url(/images/0t.gif)");
|
||||
}
|
||||
if(options_task.tp==='hidden'){
|
||||
options_task.tp = 'task';
|
||||
}
|
||||
var b = document.createElement("div");
|
||||
b.className="processmap_task_label___"+this.options.theme;
|
||||
this.parent.dom.setStyle(b,{
|
||||
@@ -1111,14 +1191,29 @@ var processmap=function(){
|
||||
});
|
||||
b.innerHTML = options.label;
|
||||
|
||||
if(options.color == 'transparent'){
|
||||
var b = document.createElement("div");
|
||||
b.className="processmap_task_label___"+this.options.theme;
|
||||
this.parent.dom.setStyle(b,{
|
||||
cursor:((this.options.rw===true)?"move":"default"),
|
||||
background:subp,
|
||||
backgroundRepeat:"repeat-y",
|
||||
backgroundPosition:"top",
|
||||
height:100
|
||||
});
|
||||
b.innerHTML = options.label;
|
||||
}
|
||||
|
||||
var b1 = document.createElement("div");
|
||||
this.parent.dom.setStyle(b1,{
|
||||
if(options.color != 'transparent'){
|
||||
this.parent.dom.setStyle(b1,{
|
||||
top:'2',
|
||||
left:'5',
|
||||
border:"0px solid red",
|
||||
height:13,
|
||||
position:"absolute"
|
||||
});
|
||||
});
|
||||
}
|
||||
if(task.statusIcons){
|
||||
|
||||
for(var i=0;i<task.statusIcons.length;i++){
|
||||
@@ -2105,6 +2200,10 @@ var processmap=function(){
|
||||
iWidth = 450;
|
||||
iHeight = 205;
|
||||
break;
|
||||
case 8:
|
||||
iWidth = 550;
|
||||
iHeight = 300;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -2151,7 +2250,7 @@ var processmap=function(){
|
||||
vars['delete'] = true;
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=saveNewPattern&data="+vars.toJSONString()
|
||||
args:"action=saveNewPattern&data="+vars.toJSONString() //Save into the db
|
||||
});
|
||||
r.make();
|
||||
}.extend(this)
|
||||
@@ -2403,20 +2502,35 @@ processmap.prototype={
|
||||
r.make();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.data.build.task(index,{tp:'subprocess'});
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=addSubProcess&data="+{uid:this.options.uid,position:pos}.toJSONString()
|
||||
});
|
||||
r.callback=this.parent.closure({instance:this,method:function(index,rpc){
|
||||
var rs = rpc.xmlhttp.responseText.parseJSON();
|
||||
var data = this.data.db.task[index];
|
||||
data.label=data.object.elements.label.innerHTML=rs.label || "";
|
||||
data.uid=rs.uid || false;
|
||||
},args:[index,r]});
|
||||
r.make();
|
||||
}
|
||||
{ if(options.tp=='subprocess'){
|
||||
this.data.build.task(index,{tp:'subprocess'});
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=addSubProcess&data="+{uid:this.options.uid,position:pos}.toJSONString()
|
||||
});
|
||||
r.callback=this.parent.closure({instance:this,method:function(index,rpc){
|
||||
var rs = rpc.xmlhttp.responseText.parseJSON();
|
||||
var data = this.data.db.task[index];
|
||||
data.label=data.object.elements.label.innerHTML=rs.label || "";
|
||||
data.uid=rs.uid || false;
|
||||
},args:[index,r]});
|
||||
r.make();
|
||||
}
|
||||
else{
|
||||
this.data.build.task(index,{tp:'hidden'});
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=addTaskHidden&data="+{uid:this.options.uid,position:pos}.toJSONString()
|
||||
});
|
||||
r.callback=this.parent.closure({instance:this,method:function(index,rpc){
|
||||
var rs = rpc.xmlhttp.responseText.parseJSON();
|
||||
var data = this.data.db.task[index];
|
||||
data.label=data.object.elements.label.innerHTML=rs.label || "";
|
||||
data.uid=rs.uid || false;
|
||||
},args:[index,r]});
|
||||
r.make();
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
addText:function(evt)
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
G::LoadClass('case');
|
||||
G::LoadClass('derivation');
|
||||
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
if(isset($_GET['POSITION'])) {
|
||||
$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
|
||||
@@ -87,7 +88,7 @@
|
||||
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
|
||||
|
||||
$oCase = new Cases();
|
||||
|
||||
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants());
|
||||
$sStatus = $Fields['APP_STATUS'];
|
||||
@@ -95,15 +96,12 @@
|
||||
$APP_NUMBER = $Fields['APP_NUMBER'];
|
||||
$APP_TITLE = $Fields['TITLE'];
|
||||
|
||||
//optimize for speed, we are reading process info once
|
||||
//$oProcess = new Process();
|
||||
//$oProcessFields = $oProcess->Load($_SESSION['PROCESS']);
|
||||
$oProcess = ProcessPeer::retrieveByPk( $_SESSION['PROCESS'] );
|
||||
$oProcessFields = $oProcess->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$oProcess = new Process();
|
||||
$oProcessFieds = $oProcess->Load($_SESSION['PROCESS']);
|
||||
|
||||
#trigger debug routines...
|
||||
|
||||
if( isset($oProcessFields['PRO_DEBUG']) && $oProcessFields['PRO_DEBUG'] ) { #here we must verify if is a debugg session
|
||||
if( isset($oProcessFieds['PRO_DEBUG']) && $oProcessFieds['PRO_DEBUG'] ) { #here we must verify if is a debugg session
|
||||
$_SESSION['TRIGGER_DEBUG']['ISSET'] = 1;
|
||||
$_SESSION['PMDEBUGGER']= true;
|
||||
}
|
||||
@@ -115,7 +113,7 @@
|
||||
//cleaning debug variables
|
||||
if( !isset($_GET['breakpoint']) ) {
|
||||
if( isset($_SESSION['TRIGGER_DEBUG']['info']) ) unset($_SESSION['TRIGGER_DEBUG']['info']);
|
||||
|
||||
|
||||
if (!isset($_SESSION['_NO_EXECUTE_TRIGGERS_'])) {
|
||||
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array();
|
||||
}
|
||||
@@ -154,7 +152,7 @@
|
||||
* Here we throw the debug view
|
||||
*/
|
||||
if ( isset($_GET['breakpoint']) ) {
|
||||
|
||||
|
||||
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameLoader');
|
||||
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameBreaker');
|
||||
G::RenderPage('publish', 'blank');
|
||||
@@ -204,7 +202,7 @@
|
||||
/** Added By erik 16-05-08
|
||||
* Description: this was added for the additional database connections */
|
||||
G::LoadClass ('dbConnections');
|
||||
$oDbConnections = new dbConnections(NULL);
|
||||
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
|
||||
$oDbConnections->loadAdditionalConnections();
|
||||
$_SESSION['CURRENT_DYN_UID'] = $_GET['UID'];
|
||||
|
||||
@@ -213,7 +211,7 @@
|
||||
|
||||
case 'INPUT_DOCUMENT':
|
||||
$oInputDocument = new InputDocument();
|
||||
$Fields = $oInputDocument->load($_GET['UID']);
|
||||
$Fields = $oInputDocument->load($_GET['UID']);
|
||||
if (!$aPreviousStep) {
|
||||
$Fields['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
|
||||
$Fields['PREVIOUS_STEP_LABEL'] = '';
|
||||
@@ -221,7 +219,7 @@
|
||||
else {
|
||||
$Fields['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = $aPreviousStep['PAGE'];
|
||||
$Fields['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = G::loadTranslation("ID_PREVIOUS_STEP");
|
||||
|
||||
|
||||
$Fields['PREVIOUS_STEP'] = $aPreviousStep['PAGE'];
|
||||
$Fields['PREVIOUS_STEP_LABEL'] = G::loadTranslation("ID_PREVIOUS_STEP");
|
||||
}
|
||||
@@ -248,14 +246,14 @@
|
||||
$Fields['MESSAGE2'] = G::LoadTranslation('ID_PLEASE_SELECT_FILE');
|
||||
//START: If there is a Break Step registered from Plugin Similar as a Trigger debug
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT_BEFORE ) ) {//If a Plugin has registered a Break Page Evaluator
|
||||
$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED']) );
|
||||
}
|
||||
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT_BEFORE ) ) {//If a Plugin has registered a Break Page Evaluator
|
||||
$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED']) );
|
||||
}
|
||||
//END: If there is a Break Step registered from Plugin
|
||||
|
||||
|
||||
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['UID']), array_merge(array('DOC_UID'=>$_GET['UID']),$Fields));//$aFields
|
||||
|
||||
//call plugin
|
||||
|
||||
//call plugin
|
||||
//if ( $oPluginRegistry->existsTrigger ( PM_CASE_DOCUMENT_LIST ) ) {
|
||||
// $folderData = new folderData (null, null, $_SESSION['APPLICATION'], null, $_SESSION['USER_LOGGED'] );
|
||||
// $oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
@@ -264,15 +262,15 @@
|
||||
//}
|
||||
//else
|
||||
// $G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['UID']), array_merge(array('DOC_UID'=>$_GET['UID']),$Fields));//$aFields
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$titleDocument="<h3>".$Fields['INP_DOC_TITLE']."<br><small>".G::LoadTranslation('ID_INPUT_DOCUMENT')."</small></h3>";
|
||||
if($Fields['INP_DOC_DESCRIPTION']) $titleDocument.= " ".str_replace("\n","",str_replace("'","\'",nl2br(htmlentities(utf8_decode($Fields['INP_DOC_DESCRIPTION'])))))."";
|
||||
|
||||
|
||||
$oHeadPublisher->addScriptCode("documentName='{$titleDocument}';");
|
||||
break;
|
||||
|
||||
case 'VIEW':
|
||||
case 'VIEW':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
@@ -304,7 +302,6 @@
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$aOD = $oOutputDocument->load( $_GET['UID'] );
|
||||
|
||||
if (!$aPreviousStep) {
|
||||
$aOD['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
|
||||
}
|
||||
@@ -319,43 +316,19 @@
|
||||
case 'GENERATE':
|
||||
//START: If there is a Break Step registered from Plugin Similar as a Trigger debug
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT_BEFORE ) ) {//If a Plugin has registered a Break Page Evaluator
|
||||
$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED'],'DOC_UID'=>$_GET['UID'],'PRO_UID'=>$_SESSION['PROCESS']) );
|
||||
}
|
||||
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT_BEFORE ) ) {//If a Plugin has registered a Break Page Evaluator
|
||||
$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED']) );
|
||||
}
|
||||
//END: If there is a Break Step registered from Plugin
|
||||
|
||||
|
||||
$sFilename = ereg_replace('[^A-Za-z0-9_]', '_', G::replaceDataField($aOD['OUT_DOC_FILENAME'], $Fields['APP_DATA']));
|
||||
if ( $sFilename == '' ) $sFilename='_';
|
||||
$pathOutput = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP . 'outdocs'. PATH_SEP ;
|
||||
G::mk_dir ( $pathOutput );
|
||||
switch ( $aOD['OUT_DOC_TYPE'] ) {
|
||||
case 'HTML' :
|
||||
$aProperties = array(); //maui
|
||||
|
||||
if(!isset($aOD['OUT_DOC_MEDIA']))
|
||||
$aOD['OUT_DOC_MEDIA'] = 'Letter';
|
||||
if(!isset($aOD['OUT_DOC_LEFT_MARGIN']))
|
||||
$aOD['OUT_DOC_LEFT_MARGIN'] = '15';
|
||||
if(!isset($aOD['OUT_DOC_RIGHT_MARGIN']))
|
||||
$aOD['OUT_DOC_RIGHT_MARGIN'] = '15';
|
||||
if(!isset($aOD['OUT_DOC_TOP_MARGIN']))
|
||||
$aOD['OUT_DOC_TOP_MARGIN'] = '15';
|
||||
if(!isset($aOD['OUT_DOC_BOTTOM_MARGIN']))
|
||||
$aOD['OUT_DOC_BOTTOM_MARGIN'] = '15';
|
||||
|
||||
if(isset($aOD['OUT_DOC_VERSIONING']) && $aOD['OUT_DOC_VERSIONING']!=0){
|
||||
$oAppDocument= new AppDocument();
|
||||
$lastDocVersion=$oAppDocument->getLastDocVersion($_GET['UID'],$_SESSION['APPLICATION']);
|
||||
$lastDocVersion = $lastDocVersion +1;
|
||||
$lastDocVersion = '_'.$lastDocVersion;
|
||||
}else {
|
||||
$lastDocVersion='';
|
||||
}
|
||||
|
||||
$aProperties['media']=$aOD['OUT_DOC_MEDIA'];
|
||||
$aProperties['margins']=array('left' => $aOD['OUT_DOC_LEFT_MARGIN'], 'right' => $aOD['OUT_DOC_RIGHT_MARGIN'], 'top' => $aOD['OUT_DOC_TOP_MARGIN'], 'bottom' => $aOD['OUT_DOC_BOTTOM_MARGIN'],);
|
||||
case 'HTML' :
|
||||
$oOutputDocument->generate( $_GET['UID'], $Fields['APP_DATA'], $pathOutput,
|
||||
$sFilename.$lastDocVersion, $aOD['OUT_DOC_TEMPLATE'], (boolean)$aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'],$aProperties );
|
||||
$sFilename, $aOD['OUT_DOC_TEMPLATE'], (boolean)$aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'] );
|
||||
break;
|
||||
case 'JRXML' :
|
||||
//creating the xml with the application data;
|
||||
@@ -365,22 +338,22 @@
|
||||
}
|
||||
$xmlData .= "</dynaform>\n";
|
||||
$iSize = file_put_contents ( $javaOutput . 'addressBook.xml' , $xmlData );
|
||||
|
||||
|
||||
G::LoadClass ('javaBridgePM');
|
||||
$JBPM = new JavaBridgePM();
|
||||
$JBPM->checkJavaExtension();
|
||||
|
||||
|
||||
$util = new Java("com.processmaker.util.pmutils");
|
||||
$util->setInputPath( $javaInput );
|
||||
$util->setOutputPath( $javaOutput );
|
||||
|
||||
|
||||
//$content = file_get_contents ( PATH_DYNAFORM . $aOD['PRO_UID'] . PATH_SEP . $aOD['OUT_DOC_UID'] . '.jrxml' );
|
||||
//$iSize = file_put_contents ( $javaInput . $aOD['OUT_DOC_UID'] . '.jrxml', $content );
|
||||
copy ( PATH_DYNAFORM . $aOD['PRO_UID'] . PATH_SEP . $aOD['OUT_DOC_UID'] . '.jrxml', $javaInput . $aOD['OUT_DOC_UID'] . '.jrxml' );
|
||||
|
||||
|
||||
$outputFile = $javaOutput . $sFilename . '.pdf' ;
|
||||
print $util->jrxml2pdf( $aOD['OUT_DOC_UID'] . '.jrxml' , basename($outputFile) );
|
||||
|
||||
|
||||
//$content = file_get_contents ( $outputFile );
|
||||
//$iSize = file_put_contents ( $pathOutput . $sFilename . '.pdf' , $content );
|
||||
copy ( $outputFile, $pathOutput . $sFilename . '.pdf' );
|
||||
@@ -394,46 +367,46 @@
|
||||
}
|
||||
$xmlData .= "</dynaform>\n";
|
||||
//$iSize = file_put_contents ( $javaOutput . 'addressBook.xml' , $xmlData );
|
||||
|
||||
|
||||
G::LoadClass ('javaBridgePM');
|
||||
$JBPM = new JavaBridgePM();
|
||||
$JBPM->checkJavaExtension();
|
||||
|
||||
|
||||
$util = new Java("com.processmaker.util.pmutils");
|
||||
$util->setInputPath( $javaInput );
|
||||
$util->setOutputPath( $javaOutput );
|
||||
|
||||
|
||||
copy ( PATH_DYNAFORM . $aOD['PRO_UID'] . PATH_SEP . $aOD['OUT_DOC_UID'] . '.pdf', $javaInput . $aOD['OUT_DOC_UID'] . '.pdf' );
|
||||
|
||||
|
||||
$outputFile = $javaOutput . $sFilename . '.pdf' ;
|
||||
print $util->writeVarsToAcroFields( $aOD['OUT_DOC_UID'] . '.pdf' , $xmlData );
|
||||
|
||||
|
||||
copy ( $javaOutput. $aOD['OUT_DOC_UID'] . '.pdf', $pathOutput . $sFilename . '.pdf' );
|
||||
|
||||
|
||||
break;
|
||||
default :
|
||||
throw ( new Exception ('invalid output document' ));
|
||||
}
|
||||
|
||||
|
||||
require_once 'classes/model/AppFolder.php';
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder=new AppFolder();
|
||||
$folderId=$oFolder->createFromPath($aOD['OUT_DOC_DESTINATION_PATH']);
|
||||
|
||||
|
||||
//Tags
|
||||
$fileTags=$oFolder->parseTags($aOD['OUT_DOC_TAGS']);
|
||||
|
||||
|
||||
//Get last Document Version and apply versioning if is enabled
|
||||
|
||||
$oAppDocument= new AppDocument();
|
||||
|
||||
$oAppDocument= new AppDocument();
|
||||
$lastDocVersion=$oAppDocument->getLastDocVersion($_GET['UID'],$_SESSION['APPLICATION']);
|
||||
|
||||
|
||||
//if(($aOD['OUT_DOC_VERSIONING'])||($lastDocVersion==0)){
|
||||
// $lastDocVersion++;
|
||||
//}
|
||||
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(AppDocumentPeer::APP_UID, $_SESSION['APPLICATION']);
|
||||
//$oCriteria->add(AppDocumentPeer::DEL_INDEX, $_SESSION['INDEX']);
|
||||
@@ -442,9 +415,9 @@
|
||||
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
|
||||
$oDataset = AppDocumentPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
if(($aOD['OUT_DOC_VERSIONING'])&&($lastDocVersion!=0)){//Create new Version of current output
|
||||
if ($aRow = $oDataset->getRow()) {
|
||||
$oDataset->next();
|
||||
if(($aOD['OUT_DOC_VERSIONING'])&&($lastDocVersion!=0)){//Create new Version of current output
|
||||
if ($aRow = $oDataset->getRow()) {
|
||||
$aFields = array('APP_DOC_UID' => $aRow['APP_DOC_UID'],
|
||||
'APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||
@@ -456,12 +429,12 @@
|
||||
'APP_DOC_FILENAME' => $sFilename,
|
||||
'FOLDER_UID' => $folderId,
|
||||
'APP_DOC_TAGS' => $fileTags);
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->create($aFields);
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->create($aFields);
|
||||
$sDocUID = $aRow['APP_DOC_UID'];
|
||||
}
|
||||
}else{//No versioning so Update a current Output or Create new if no exist
|
||||
if ($aRow = $oDataset->getRow()) { //Update
|
||||
if ($aRow = $oDataset->getRow()) { //Update
|
||||
$aFields = array('APP_DOC_UID' => $aRow['APP_DOC_UID'],
|
||||
'APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||
@@ -476,7 +449,7 @@
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->update($aFields);
|
||||
$sDocUID = $aRow['APP_DOC_UID'];
|
||||
}else{ //create
|
||||
}else{ //create
|
||||
if($lastDocVersion==0) $lastDocVersion++;
|
||||
$aFields = array('APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||
@@ -490,7 +463,7 @@
|
||||
'APP_DOC_TAGS' => $fileTags);
|
||||
$oAppDocument = new AppDocument();
|
||||
$aFields['APP_DOC_UID']=$sDocUID = $oAppDocument->create($aFields);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,17 +479,17 @@
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT ) && class_exists ('uploadDocumentData' ) ) {
|
||||
$triggerDetail=$oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
$aFields['APP_DOC_PLUGIN']=$triggerDetail->sNamespace;
|
||||
|
||||
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT ) && class_exists ('uploadDocumentData' ) ) {
|
||||
$triggerDetail=$oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
$aFields['APP_DOC_PLUGIN']=$triggerDetail->sNamespace;
|
||||
|
||||
$oAppDocument1 = new AppDocument();
|
||||
$oAppDocument1->update($aFields);
|
||||
|
||||
|
||||
$sPathName = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP;
|
||||
|
||||
$oData['APP_UID'] = $_SESSION['APPLICATION'];
|
||||
$oData['ATTACHMENT_FOLDER'] = true;
|
||||
$oData['ATTACHMENT_FOLDER'] = true;
|
||||
switch($aOD['OUT_DOC_GENERATE']){
|
||||
case "BOTH":
|
||||
$documentData = new uploadDocumentData (
|
||||
@@ -534,7 +507,7 @@
|
||||
if($uploadReturn){//Only delete if the file was saved correctly
|
||||
unlink ( $pathOutput . $sFilename. '.pdf' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$documentData = new uploadDocumentData (
|
||||
@@ -597,55 +570,50 @@
|
||||
G::header('location: '.$outputNextStep);
|
||||
die;
|
||||
break;
|
||||
case 'VIEW':
|
||||
case 'VIEW':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$lastVersion=$oAppDocument->getLastAppDocVersion($_GET['DOC'],$_SESSION['APPLICATION']);
|
||||
$aFields = $oAppDocument->load($_GET['DOC'],$lastVersion);
|
||||
|
||||
$listing=false;
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
if($oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST)) {
|
||||
$folderData = new folderData(null, null, $_SESSION['APPLICATION'], null, $_SESSION['USER_LOGGED']);
|
||||
$folderData->PMType = "OUTPUT";
|
||||
$folderData->returnList = true;
|
||||
$listing=$oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST, $folderData);
|
||||
$folderData->returnList = true;
|
||||
$listing=$oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST, $folderData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$aGields = $oOutputDocument->load($aFields['DOC_UID']);
|
||||
|
||||
if(isset($aGields['OUT_DOC_VERSIONING']) && $aGields['OUT_DOC_VERSIONING']!=0){
|
||||
$oAppDocument= new AppDocument();
|
||||
$lastDocVersion=$oAppDocument->getLastDocVersion($_GET['UID'],$_SESSION['APPLICATION']);
|
||||
}else {
|
||||
$lastDocVersion='';
|
||||
}
|
||||
|
||||
$aFields['VIEW1'] = G::LoadTranslation('ID_OPEN');
|
||||
|
||||
|
||||
$aFields['VIEW2'] = G::LoadTranslation('ID_OPEN');
|
||||
|
||||
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&v='.$lastDocVersion . '&ext=doc&random=' . rand();
|
||||
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&v='.$aFields['DOC_VERSION'] . '&ext=doc&random=' . rand();
|
||||
|
||||
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&v='.$aFields['DOC_VERSION'] . '&ext=pdf&random=' . rand();
|
||||
|
||||
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&v='.$lastDocVersion . '&ext=pdf&random=' . rand();
|
||||
|
||||
|
||||
if ( is_array ($listing) ){//If exist in Plugin Document List
|
||||
foreach($listing as $folderitem) {
|
||||
if(($folderitem->filename==$aFields['APP_DOC_UID'])&&($folderitem->type=='DOC')){
|
||||
if(($folderitem->filename==$aFields['APP_DOC_UID'])&&($folderitem->type=='DOC')){
|
||||
$aFields['VIEW1'] = G::LoadTranslation('ID_GET_EXTERNAL_FILE');
|
||||
$aFields['FILE1'] = $folderitem->downloadScript;
|
||||
continue;
|
||||
}
|
||||
if(($folderitem->filename==$aFields['APP_DOC_UID'])&&($folderitem->type=='PDF')){
|
||||
if(($folderitem->filename==$aFields['APP_DOC_UID'])&&($folderitem->type=='PDF')){
|
||||
$aFields['VIEW2'] = G::LoadTranslation('ID_GET_EXTERNAL_FILE');
|
||||
$aFields['FILE2'] = $folderitem->downloadScript;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(($aGields['OUT_DOC_GENERATE']=='BOTH')||($aGields['OUT_DOC_GENERATE']==''))
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocument1', '', G::array_merges($aOD, $aFields), '');
|
||||
|
||||
@@ -655,17 +623,16 @@
|
||||
if($aGields['OUT_DOC_GENERATE']=='PDF')
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocument3', '', G::array_merges($aOD, $aFields), '');
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'ASSIGN_TASK':
|
||||
$oDerivation = new Derivation();
|
||||
//$oProcess = new Process(); //optimized for speed, we already load process row
|
||||
$oProcess = new Process();
|
||||
$aData = $oCase->loadCase($_SESSION['APPLICATION']);
|
||||
//$aFields['PROCESS'] = $oProcess->load($_SESSION['PROCESS']);
|
||||
$aFields['PROCESS'] = $oProcessFields;
|
||||
$aFields['PROCESS'] = $oProcess->load($_SESSION['PROCESS']);
|
||||
$aFields['PREVIOUS_PAGE'] = $aPreviousStep['PAGE'];
|
||||
$aFields['PREVIOUS_PAGE_LABEL'] = G::LoadTranslation('ID_PREVIOUS_STEP');
|
||||
$aFields['ASSIGN_TASK'] = G::LoadTranslation('ID_ASSIGN_TASK');
|
||||
@@ -677,18 +644,23 @@
|
||||
$aFields['CONTINUE'] = G::LoadTranslation('ID_CONTINUE');
|
||||
$aFields['CONTINUE_WITH_OPTION'] = G::LoadTranslation('ID_CONTINUE_WITH_OPTION');
|
||||
$aFields['FINISH_WITH_OPTION'] = G::LoadTranslation('ID_FINISH_WITH_OPTION');
|
||||
$aFields['TAS_TIMING_TITLE'] = 'Timing Control';
|
||||
$aFields['TAS_DURATION'] = 'Task Duration';
|
||||
$aFields['TAS_TIMEUNIT'] = 'Task Unit';
|
||||
$aFields['TAS_TYPE_DAY'] = 'Count Days By';
|
||||
$aFields['TAS_CALENDAR'] = 'Calendar';
|
||||
$aFields['TASK'] = $oDerivation->prepareInformation(
|
||||
array( 'USER_UID' => $_SESSION['USER_LOGGED'],
|
||||
'APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DEL_INDEX' => $_SESSION['INDEX'])
|
||||
);
|
||||
if ( empty($aFields['TASK']) ) {
|
||||
throw ( new Exception ( G::LoadTranslation ( 'ID_NO_DERIVATION_RULE') ) );
|
||||
throw ( new Exception ( G::LoadTranslation( 'ID_NO_DERIVATION_RULE') ) );
|
||||
}
|
||||
//take the first derivation rule as the task derivation rule type.
|
||||
$aFields['PROCESS']['ROU_TYPE'] = $aFields['TASK'][1]['ROU_TYPE'];
|
||||
$aFields['PROCESS']['ROU_FINISH_FLAG'] = false;
|
||||
|
||||
|
||||
foreach ( $aFields['TASK'] as $sKey => &$aValues)
|
||||
{
|
||||
$sPriority = '';//set priority value
|
||||
@@ -715,7 +687,7 @@
|
||||
$hiddenName = "form[TASKS][" . $sKey . "][USR_UID]";
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['USR_UID'] = $aFields['TASK'][$sKey]['NEXT_TASK']['USER_ASSIGNED']['USR_FULLNAME'];
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['USR_HIDDEN_FIELD'] = '<input type="hidden" name="' . $hiddenName . '" id="' . $hiddenName . '" value="' . $aValues['NEXT_TASK']['USER_ASSIGNED']['USR_UID'] . '">';
|
||||
|
||||
//var_dump($aFields);
|
||||
//there is a error with reportsTo, when the USR_UID is empty means there are no manager for this user, so we are disabling buttons
|
||||
//but this validation is not for SELF_SERVICE
|
||||
if ( $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'] != 'SELF_SERVICE' )
|
||||
@@ -739,6 +711,96 @@
|
||||
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['USR_UID'] = $sAux;
|
||||
break;
|
||||
case 'CANCEL_MI':
|
||||
case 'STATIC_MI':
|
||||
//count the Users in the group
|
||||
$cntInstanceUsers = count($aValues['NEXT_TASK']['USER_ASSIGNED']);
|
||||
|
||||
//set TAS_MI_INSTANCE_VARIABLE value
|
||||
$sMIinstanceVar = '';
|
||||
if ($aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE'] != '') {
|
||||
if (isset($aData['APP_DATA'][str_replace('@@', '', $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE'])]))
|
||||
{
|
||||
$sMIinstanceVar = $aData['APP_DATA'][str_replace('@@', '', $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE'])];
|
||||
if($sMIinstanceVar > $cntInstanceUsers)
|
||||
throw (new Exception("Total Multiple Instance Task cannot be greater than number of users in the group."));
|
||||
else if($sMIinstanceVar == 0)
|
||||
throw (new Exception("Total Multiple Instance Task cannot be zero."));
|
||||
}
|
||||
else if(is_int((int)$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE']))
|
||||
{
|
||||
$sMIinstanceVar = $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE'];
|
||||
if($sMIinstanceVar > $cntInstanceUsers)
|
||||
throw (new Exception("Total Multiple Instance Task cannot be greater than number of users in the group."));
|
||||
}
|
||||
else
|
||||
throw (new Exception("Total Multiple Instance Task variable doesn't have valid value."));
|
||||
}
|
||||
else
|
||||
throw (new Exception("Total Multiple Instance Task variable doesn't have valid value."));
|
||||
////set TAS_MI_INSTANCE_VARIABLE value
|
||||
|
||||
//set TAS_MI_COMPLETE_VARIABLE value
|
||||
$sMIcompleteVar = '';
|
||||
if ($aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE'] != '') {
|
||||
if (isset($aData['APP_DATA'][str_replace('@@', '', $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE'])]))
|
||||
{
|
||||
$sMIcompleteVar = $aData['APP_DATA'][str_replace('@@', '', $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE'])];
|
||||
//
|
||||
if($sMIcompleteVar > $sMIinstanceVar)
|
||||
throw (new Exception("Total Multiple Instance Task to complete cannot be greater than Total number of Instances."));
|
||||
}
|
||||
else if(is_int((int)$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE']))
|
||||
{
|
||||
$sMIcompleteVar = $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE'];
|
||||
if($sMIcompleteVar > $sMIinstanceVar)
|
||||
throw (new Exception("Total Multiple Instance Task to complete cannot be greater than Total number of Instances."));
|
||||
}
|
||||
else
|
||||
throw ( new Exception("Total Multiple Instance Task to complete variable doesn't have valid value.") ) ;
|
||||
|
||||
}
|
||||
else
|
||||
throw ( new Exception("Total Multiple Instance Task to complete variable doesn't have valid value.") ) ;
|
||||
//set TAS_MI_COMPLETE_VARIABLE value
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_NEXT'] = $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'];
|
||||
|
||||
//If the Users in the group is equal to the MI Instance variable then Show all the users without Dropdown
|
||||
if($sMIinstanceVar == $cntInstanceUsers)
|
||||
{
|
||||
foreach ($aValues['NEXT_TASK']['USER_ASSIGNED'] as $key=>$aUser)
|
||||
{
|
||||
$hiddenName = "form[TASKS][" . $sKey . "][NEXT_TASK][USER_ASSIGNED][".$key."][USR_UID]";
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['USER_ASSIGNED'][$key]['USR_UID'] = $aUser['USR_FULLNAME'];
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['USER_ASSIGNED'][$key]['USR_HIDDEN_FIELD'] = '<input type="hidden" name="' . $hiddenName . '" id="' . $hiddenName . '" value="' . $aUser['USR_UID'] . '">';
|
||||
}
|
||||
}
|
||||
//If the Users in the group is not equal to the MI Instance variable then Show Only count users in dropdown
|
||||
else
|
||||
{
|
||||
$Aux = array();
|
||||
foreach ($aValues['NEXT_TASK']['USER_ASSIGNED'] as $aUser)
|
||||
{
|
||||
$Aux[$aUser['USR_UID']] = $aUser['USR_FULLNAME'];
|
||||
}
|
||||
asort($Aux);
|
||||
$aAux = '<option value="" enabled>'.G::LoadTranslation('ID_SELECT').'</option>';
|
||||
foreach ($Aux as $akey => $value)
|
||||
{
|
||||
$aAux .= '<option value="' . $akey . '">' . $value . '</option>';
|
||||
}
|
||||
|
||||
for($key=0; $key < $sMIinstanceVar; $key++)
|
||||
{
|
||||
$hiddenName = "form[TASKS][" . $sKey . "][NEXT_TASK][USER_ASSIGNED][".$key."][USR_UID]";
|
||||
$sAux = "<select name=$hiddenName id=$hiddenName";
|
||||
$sAux .= $aAux;
|
||||
$sAux .= '</select>';
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['USER_ASSIGNED'][$key]['USR_HIDDEN_FIELD'] = "<input type='hidden' name='hidden' id='hidden' value=''>";
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['USER_ASSIGNED'][$key]['USR_UID'] = $sAux;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '': //when this task is the Finish process
|
||||
$userFields = $oDerivation->getUsersFullNameFromArray ( $aFields['TASK'][$sKey]['USER_UID'] );
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['USR_UID'] = $userFields['USR_FULLNAME'];
|
||||
@@ -747,18 +809,75 @@
|
||||
break;
|
||||
}
|
||||
$hiddenName = 'form[TASKS][' . $sKey . ']';
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_ASSIGN_TYPE'] = '<input type="hidden" name="' . $hiddenName . '[TAS_ASSIGN_TYPE]" id="' . $hiddenName . '[TAS_ASSIGN_TYPE]" value="' . $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'] . '">';
|
||||
if (isset ($aValues['NEXT_TASK']['TAS_DEF_PROC_CODE'])){
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_DEF_PROC_CODE'] = '<input type="hidden" name="' . $hiddenName . '[TAS_DEF_PROC_CODE]" id="' . $hiddenName . '[TAS_DEF_PROC_CODE]" value="' . $aValues['NEXT_TASK']['TAS_DEF_PROC_CODE'] . '">';
|
||||
} else {
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_DEF_PROC_CODE'] = '<input type="hidden" name="' . $hiddenName . '[TAS_DEF_PROC_CODE]" id="' . $hiddenName . '[TAS_DEF_PROC_CODE]" value="">';
|
||||
}
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['DEL_PRIORITY'] = '<input type="hidden" name="' . $hiddenName . '[DEL_PRIORITY]" id="' . $hiddenName . '[DEL_PRIORITY]" value="' . $sPriority . '">';
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_PARENT'] = '<input type="hidden" name="' . $hiddenName . '[TAS_PARENT]" id="' . $hiddenName . '[TAS_PARENT]" value="' . $aValues['NEXT_TASK']['TAS_PARENT'] . '">';
|
||||
}
|
||||
|
||||
/* Allow user defined Timing Control
|
||||
* Values in the dropdown will be populated from the Table TASK.
|
||||
*/
|
||||
if($aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'] != '') //Check for End of Process
|
||||
{
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_TRANSFER_FLY'] = strtolower($aValues['NEXT_TASK']['TAS_TRANSFER_FLY']);
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] = "<input type=hidden name='".$hiddenName."[NEXT_TASK][TAS_TRANSFER_HIDDEN_FLY]' id='".$hiddenName."[NEXT_TASK][TAS_TRANSFER_HIDDEN_FLY]' value=".$aValues['NEXT_TASK']['TAS_TRANSFER_FLY'].">";
|
||||
if($aValues['NEXT_TASK']['TAS_TRANSFER_FLY'] == 'true')
|
||||
{
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_DURATION'] = '<input type="text" size="5" name="' . $hiddenName . '[NEXT_TASK][TAS_DURATION]" id="' . $hiddenName . '[NEXT_TASK][TAS_DURATION]" value="' . $aValues['NEXT_TASK']['TAS_DURATION'] . '">';
|
||||
$hoursSelected = $daysSelected = '';
|
||||
if($aFields['TASK'][$sKey]['NEXT_TASK']['TAS_TIMEUNIT'] == 'HOURS')
|
||||
$hoursSelected = "selected = 'selected'";
|
||||
else
|
||||
$daysSelected = "selected = 'selected'";
|
||||
|
||||
$sAux = '<select name='.$hiddenName.'[NEXT_TASK][TAS_TIMEUNIT] id= '.$hiddenName.'[NEXT_TASK][TAS_TIMEUNIT] ';
|
||||
$sAux .= "<option ".$hoursSelected." value='HOURS'>Hours</option> ";
|
||||
$sAux .= "<option ".$daysSelected." value='DAYS'>Days</option> ";
|
||||
$sAux .= '</select>';
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_TIMEUNIT'] = $sAux;
|
||||
|
||||
$workSelected = $calendarSelected = '';
|
||||
if($aFields['TASK'][$sKey]['NEXT_TASK']['TAS_TYPE_DAY'] == '1')
|
||||
$workSelected = "selected = 'selected'";
|
||||
else
|
||||
$calendarSelected = "selected = 'selected'";
|
||||
|
||||
$sAux = '<select name='.$hiddenName.'[NEXT_TASK][TAS_TYPE_DAY] id= '.$hiddenName.'[NEXT_TASK][TAS_TYPE_DAY] ';
|
||||
$sAux .= "<option ".$workSelected." value='1'>Work Days</option> ";
|
||||
$sAux .= "<option ".$calendarSelected." value='2'>Calendar Days</option> ";
|
||||
$sAux .= '</select>';
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_TYPE_DAY'] = $sAux;
|
||||
|
||||
//Check for
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendar = new Calendar ( );
|
||||
$calendarObj = $calendar->getCalendarList ( true, true );
|
||||
$availableCalendar = $calendarObj ['array'];
|
||||
$aCalendar['CALENDAR_UID'] = '00000000000000000000000000000001';
|
||||
$aCalendar['CALENDAR_NAME'] = 'DEFAULT';
|
||||
$sAux = '<select name='.$hiddenName.'[NEXT_TASK][TAS_CALENDAR] id= '.$hiddenName.'[NEXT_TASK][TAS_CALENDAR] ';
|
||||
$sAux .= "<option value='none'>-None-</option> ";
|
||||
foreach($availableCalendar as $aCalendar)
|
||||
{
|
||||
if(is_array($aCalendar))
|
||||
{
|
||||
$sAux .= "<option value='".$aCalendar['CALENDAR_UID']."'>".$aCalendar['CALENDAR_NAME']."</option> ";
|
||||
}
|
||||
}
|
||||
$sAux .= '</select>';
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_CALENDAR'] = $sAux;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_ASSIGN_TYPE'] = '<input type="hidden" name="' . $hiddenName . '[TAS_ASSIGN_TYPE]" id="' . $hiddenName . '[TAS_ASSIGN_TYPE]" value="' . $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'] . '">';
|
||||
if (isset ($aValues['NEXT_TASK']['TAS_DEF_PROC_CODE'])){
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_DEF_PROC_CODE'] = '<input type="hidden" name="' . $hiddenName . '[TAS_DEF_PROC_CODE]" id="' . $hiddenName . '[TAS_DEF_PROC_CODE]" value="' . $aValues['NEXT_TASK']['TAS_DEF_PROC_CODE'] . '">';
|
||||
} else {
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_DEF_PROC_CODE'] = '<input type="hidden" name="' . $hiddenName . '[TAS_DEF_PROC_CODE]" id="' . $hiddenName . '[TAS_DEF_PROC_CODE]" value="">';
|
||||
}
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['DEL_PRIORITY'] = '<input type="hidden" name="' . $hiddenName . '[DEL_PRIORITY]" id="' . $hiddenName . '[DEL_PRIORITY]" value="' . $sPriority . '">';
|
||||
$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_PARENT'] = '<input type="hidden" name="' . $hiddenName . '[TAS_PARENT]" id="' . $hiddenName . '[TAS_PARENT]" value="' . $aValues['NEXT_TASK']['TAS_PARENT'] . '">';
|
||||
}
|
||||
}
|
||||
$aFields['PROCESSING_MESSAGE'] = G::loadTranslation('ID_PROCESSING');
|
||||
|
||||
|
||||
$G_PUBLISH->AddContent('smarty', 'cases/cases_ScreenDerivation', '', '', $aFields);
|
||||
/*
|
||||
if (isset( $aFields['TASK'][1]['NEXT_TASK']['USER_ASSIGNED'])){
|
||||
@@ -776,7 +895,7 @@
|
||||
}else{
|
||||
$G_PUBLISH->AddContent('smarty', 'cases/cases_ScreenDerivation', '', '', $aFields);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
break;
|
||||
case 'EXTERNAL':
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
@@ -803,7 +922,7 @@
|
||||
/** Added By erik date: 16-05-08
|
||||
* Description: this was added for the additional database connections */
|
||||
G::LoadClass ('dbConnections');
|
||||
$oDbConnections = new dbConnections(NULL);
|
||||
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
|
||||
$oDbConnections->loadAdditionalConnections();
|
||||
$stepFilename = "$sNamespace/$sStepName";
|
||||
$G_PUBLISH->AddContent('content', $stepFilename );
|
||||
@@ -812,7 +931,7 @@
|
||||
}
|
||||
//Add content content step - End
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
catch ( Exception $e ) {
|
||||
G::SendTemporalMessage($e->getMessage(), 'error', 'string', 3, 100);
|
||||
$aMessage = array();
|
||||
$aMessage['MESSAGE'] = G::LoadTranslation('ID_PROCESS_DEF_PROBLEM').'<br/>'.G::LoadTranslation('ID_CONTACT_ADMIN');
|
||||
@@ -862,10 +981,10 @@
|
||||
');
|
||||
|
||||
if( defined('SYS_SKIN') )
|
||||
$skin = SYS_SKIN;
|
||||
else
|
||||
$skin = "green";
|
||||
|
||||
$skin = SYS_SKIN;
|
||||
else
|
||||
$skin = "green";
|
||||
|
||||
G::RenderPage('publish', $skin . '-submenu');
|
||||
|
||||
if( $_SESSION['TRIGGER_DEBUG']['ISSET'] ){
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* patterns_Ajax.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -14,20 +14,26 @@
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*
|
||||
*/
|
||||
G::LoadInclude('ajax');
|
||||
$aData = urldecode_values($_POST['form']);
|
||||
$oJSON = new Services_JSON();
|
||||
if(isset($_POST['mode']) && $_POST['mode'] != '')
|
||||
$aData = $_POST;
|
||||
else
|
||||
$aData = urldecode_values($_POST['form']);
|
||||
|
||||
G::LoadClass('tasks');
|
||||
$oTasks = new Tasks();
|
||||
$rou_id = 0;
|
||||
switch ($aData['action']) {
|
||||
case 'savePattern':
|
||||
G::LoadClass('tasks');
|
||||
$oTasks = new Tasks();
|
||||
//if ($aData['ROU_TYPE'] != $aData['ROU_TYPE_OLD'])
|
||||
//{
|
||||
$oTasks->deleteAllRoutesOfTask($aData['PROCESS'], $aData['TASK']);
|
||||
@@ -36,7 +42,7 @@ switch ($aData['action']) {
|
||||
$oRoute = new Route();
|
||||
switch ($aData['ROU_TYPE']) {
|
||||
case 'SEQUENTIAL':
|
||||
case 'SEC-JOIN':
|
||||
case 'SEC-JOIN':
|
||||
/*if ($aData['ROU_UID'] != '')
|
||||
{
|
||||
$aFields['ROU_UID'] = $aData['ROU_UID'];
|
||||
@@ -46,7 +52,7 @@ switch ($aData['action']) {
|
||||
$aFields['ROU_NEXT_TASK'] = $aData['ROU_NEXT_TASK'];
|
||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||
//$aFields['ROU_TO_LAST_USER'] = $aData['ROU_TO_LAST_USER'];
|
||||
$oRoute->create($aFields);
|
||||
$rou_id = $oRoute->create($aFields);
|
||||
break;
|
||||
case 'SELECT':
|
||||
foreach ($aData['GRID_SELECT_TYPE'] as $iKey => $aRow)
|
||||
@@ -62,7 +68,7 @@ switch ($aData['action']) {
|
||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
|
||||
$oRoute->create($aFields);
|
||||
$rou_id = $oRoute->create($aFields);
|
||||
unset($aFields);
|
||||
}
|
||||
break;
|
||||
@@ -80,7 +86,7 @@ switch ($aData['action']) {
|
||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
|
||||
$oRoute->create($aFields);
|
||||
$rou_id = $oRoute->create($aFields);
|
||||
unset($aFields);
|
||||
}
|
||||
break;
|
||||
@@ -96,7 +102,7 @@ switch ($aData['action']) {
|
||||
$aFields['ROU_NEXT_TASK'] = $aRow['ROU_NEXT_TASK'];
|
||||
$aFields['ROU_CASE'] = $iKey;
|
||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||
$oRoute->create($aFields);
|
||||
$rou_id = $oRoute->create($aFields);
|
||||
unset($aFields);
|
||||
}
|
||||
break;
|
||||
@@ -107,17 +113,41 @@ switch ($aData['action']) {
|
||||
{
|
||||
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
||||
}*/
|
||||
|
||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
||||
$aFields['TAS_UID'] = $aData['TASK'];
|
||||
$aFields['ROU_NEXT_TASK'] = $aRow['ROU_NEXT_TASK'];
|
||||
$aFields['ROU_CASE'] = $iKey;
|
||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||
$oRoute->create($aFields);
|
||||
$aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
||||
$rou_id = $oRoute->create($aFields);
|
||||
unset($aFields);
|
||||
}
|
||||
break;
|
||||
case 'DISCRIMINATOR': //Girish ->Added to save changes, while editing the route
|
||||
foreach ($aData['GRID_DISCRIMINATOR_TYPE'] as $iKey => $aRow)
|
||||
{
|
||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
||||
$aFields['TAS_UID'] = $aData['TASK'];
|
||||
$aFields['ROU_NEXT_TASK'] = $aRow['ROU_NEXT_TASK'];
|
||||
$aFields['ROU_CASE'] = $iKey;
|
||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||
$aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
||||
$routeData = $oTasks->getRouteByType($aData['PROCESS'], $aRow['ROU_NEXT_TASK'], $aData['ROU_TYPE']);
|
||||
foreach($routeData as $route)
|
||||
{
|
||||
$sFields['ROU_UID'] = $route['ROU_UID'];
|
||||
$sFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||
$sFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
||||
$rou_id = $oRoute->update($sFields);
|
||||
}
|
||||
$rou_id =$oRoute->create($aFields);
|
||||
unset($aFields);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
echo $rou_id;
|
||||
}
|
||||
?>
|
||||
@@ -142,7 +142,12 @@ try {
|
||||
case 'addSubProcess':
|
||||
$sOutput = $oProcessMap->addSubProcess($oData->uid, $oData->position->x, $oData->position->y);
|
||||
break;
|
||||
|
||||
case 'taskColor':
|
||||
$oTask->taskColor($oData->pro_uid, $oData->tas_uid);
|
||||
break;
|
||||
case 'addTaskHidden':
|
||||
$sOutput = $oProcessMap->addTaskHidden($oData->uid, $oData->position->x, $oData->position->y);
|
||||
break;
|
||||
case 'editTaskProperties':
|
||||
$oProcessMap->editTaskProperties($oData->uid, (isset($oData->iForm) ? $oData->iForm : 1), $oData->index);
|
||||
break;
|
||||
@@ -228,6 +233,9 @@ try {
|
||||
case 5:
|
||||
$oData->type = 'SEC-JOIN';
|
||||
break;
|
||||
case 8:
|
||||
$oData->type = 'DISCRIMINATOR';
|
||||
break;
|
||||
}
|
||||
$oProcessMap->newPattern($oData->pro_uid, $oData->tas_uid, $oData->next_task, $oData->type);
|
||||
}
|
||||
@@ -253,14 +261,17 @@ try {
|
||||
case 5:
|
||||
$sType = 'SEC-JOIN';
|
||||
break;
|
||||
case 8:
|
||||
$sType = 'DISCRIMINATOR';
|
||||
break;
|
||||
}
|
||||
if (($oData->type != 0) && ($oData->type != 5)) {
|
||||
if (($oData->type != 0) && ($oData->type != 5) && ($oData->type != 8)) {
|
||||
if ($oProcessMap->getNumberOfRoutes($oData->pro_uid, $oData->tas_uid, $oData->next_task, $sType) > 0) {
|
||||
die;
|
||||
}
|
||||
unset($aRow);
|
||||
}
|
||||
if (($oData->delete) || ($oData->type == 0) || ($oData->type == 5)) {
|
||||
if (($oData->delete) || ($oData->type == 0) || ($oData->type == 5) || ($oData->type == 8)) {
|
||||
G::LoadClass('tasks');
|
||||
$oTasks = new Tasks();
|
||||
$oTasks->deleteAllRoutesOfTask($oData->pro_uid, $oData->tas_uid);
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* processes_DownloadFile.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
//add more security, and catch any error or exception
|
||||
|
||||
$sFileName = $_GET['p'] . '.xpdl';
|
||||
$file=PATH_DOCUMENT . 'output'. PATH_SEP. $sFileName.'tpm';
|
||||
$filex=PATH_DOCUMENT . 'output'. PATH_SEP. $sFileName;
|
||||
|
||||
if(file_exists($file))
|
||||
{
|
||||
rename($file, $filex);
|
||||
}
|
||||
|
||||
$realPath = PATH_DOCUMENT . 'output'. PATH_SEP. $sFileName;
|
||||
G::streamFile ( $realPath, true );
|
||||
@@ -0,0 +1,131 @@
|
||||
<?
|
||||
/**
|
||||
* processes_ImportFileExisting.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
try {
|
||||
//load the variables
|
||||
G::LoadClass('xpdl');
|
||||
$oProcess = new Xpdl();
|
||||
|
||||
if ( !isset ($_POST['form']['IMPORT_OPTION'] ) ) {
|
||||
throw ( new Exception ('Please select an option before to continue')) ;
|
||||
}
|
||||
|
||||
if ( !isset ($_POST['form']['GROUP_IMPORT_OPTION']) ) {
|
||||
$action = "none" ;
|
||||
} else {
|
||||
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
|
||||
}
|
||||
|
||||
$option = $_POST['form']['IMPORT_OPTION'];
|
||||
$filename = $_POST['form']['PRO_FILENAME'];
|
||||
$ObjUid = $_POST['form']['OBJ_UID'];
|
||||
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP ;
|
||||
$oData = $oProcess->getProcessDataXpdl ( $path . $filename );
|
||||
$Fields['PRO_FILENAME'] = $filename;
|
||||
$sProUid = $oData->process['PRO_UID'];
|
||||
|
||||
$oData->process['PRO_UID_OLD']=$sProUid;
|
||||
$tasks = $oData->tasks;
|
||||
// code added by gustavo cruz gustavo-at-colosa-dot-com
|
||||
// evaluate actions or import options
|
||||
switch($action){
|
||||
case "none":
|
||||
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
|
||||
break;
|
||||
case "rename":
|
||||
$oData->groupwfs = $oProcess->renameExistingGroups($oData->groupwfs);
|
||||
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
|
||||
break;
|
||||
case "merge":
|
||||
$oBaseGroup = $oData->groupwfs;
|
||||
$oNewGroup = $oProcess->mergeExistingGroups($oData->groupwfs);
|
||||
$oData->groupwfs = $oNewGroup;
|
||||
$oData->taskusers = $oProcess->mergeExistingUsers($oBaseGroup, $oNewGroup, $oData->taskusers);
|
||||
|
||||
break;
|
||||
default:
|
||||
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
|
||||
break;
|
||||
}
|
||||
|
||||
// if there are duplicated groups render the group importing options
|
||||
if($groupsDuplicated>0){
|
||||
$Fields['PRO_FILENAME'] = $filename;
|
||||
$Fields['PRO_PATH'] = $path;
|
||||
$Fields['IMPORT_OPTION'] = $option;
|
||||
$Fields['OBJ_UID'] = $ObjUid;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportExisting' );
|
||||
G::RenderPage('publish');
|
||||
die;
|
||||
}
|
||||
//end added code
|
||||
|
||||
//Update the current Process, overwriting all tasks and steps
|
||||
if ( $option == 1 ) {
|
||||
$oProcess->updateProcessFromData ($oData, $path . $filename );
|
||||
if (file_exists(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid)) {
|
||||
$oDirectory = dir(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid);
|
||||
while($sObjectName = $oDirectory->read()) {
|
||||
if (($sObjectName != '.') && ($sObjectName != '..')) {
|
||||
unlink(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid . PATH_SEP . $sObjectName);
|
||||
}
|
||||
}
|
||||
$oDirectory->close();
|
||||
}
|
||||
$sNewProUid = $sProUid;
|
||||
}
|
||||
|
||||
//Disable current Process and create a new version of the Process
|
||||
if ( $option == 2 ) {
|
||||
$oProcess->disablePreviousProcesses( $sProUid );
|
||||
$sNewProUid = $oProcess->getUnusedProcessGUID() ;
|
||||
$oProcess->setProcessGuid ( $oData, $sNewProUid );
|
||||
$oProcess->setProcessParent( $oData, $sProUid );
|
||||
$oData->process['PRO_TITLE'] = "New - " . $oData->process['PRO_TITLE'] . ' - ' . date ( 'M d, H:i' );
|
||||
$oProcess->renewAll ( $oData );
|
||||
$oProcess->createProcessFromDataXpdl ($oData,$tasks);
|
||||
}
|
||||
|
||||
//Create a completely new Process without change the current Process
|
||||
if ( $option == 3 ) {
|
||||
//krumo ($oData); die;
|
||||
$sNewProUid = $oProcess->getUnusedProcessGUID() ;
|
||||
$oProcess->setProcessGuid ( $oData, $sNewProUid );
|
||||
$oData->process['PRO_TITLE'] = "Copy of - " . $oData->process['PRO_TITLE'] . ' - ' . date ( 'M d, H:i' );
|
||||
$oProcess->renewAll ( $oData );
|
||||
$oProcess->createProcessFromDataXpdl ($oData,$tasks);
|
||||
}
|
||||
G::header('Location: processes_Map?PRO_UID=' . $sNewProUid);
|
||||
}
|
||||
catch ( Exception $e ){
|
||||
$G_PUBLISH = new Publisher;
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage('publish');
|
||||
}
|
||||
105
workflow/engine/methods/processes/processes_ImportFileXpdl.php
Normal file
105
workflow/engine/methods/processes/processes_ImportFileXpdl.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?
|
||||
/**
|
||||
* processes_ImportFile.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
try {
|
||||
//load the variables
|
||||
G::LoadClass('xpdl');
|
||||
$oProcess = new Xpdl();
|
||||
if (isset($_POST['form']['PRO_FILENAME'])){
|
||||
$path = $_POST['form']['PRO_PATH'];
|
||||
$filename = $_POST['form']['PRO_FILENAME'];
|
||||
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
|
||||
} else {
|
||||
//save the file, if it's not saved
|
||||
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
|
||||
$filename = $_FILES['form']['name']['PROCESS_FILENAME'];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP ;
|
||||
$tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
|
||||
$action = "none";
|
||||
G::uploadFile($tempName, $path, $filename );
|
||||
}
|
||||
}
|
||||
$oData = $oProcess->getProcessDataXpdl ( $path . $filename );
|
||||
$Fields['PRO_FILENAME'] = $filename;
|
||||
$Fields['IMPORT_OPTION'] = 2;
|
||||
$sProUid = $oData->process['PRO_UID'];
|
||||
|
||||
$oData->process['PRO_UID_OLD']=$sProUid;
|
||||
|
||||
if ( $oProcess->processExists ( $sProUid ) ) {
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ImportExistingXpdl', '', $Fields, 'processes_ImportExistingXpdl' );
|
||||
G::RenderPage('publish');
|
||||
die;
|
||||
}
|
||||
// code added by gustavo cruz gustavo-at-colosa-dot-com
|
||||
// evaluate actions or import options
|
||||
switch($action){
|
||||
case "none":
|
||||
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
|
||||
break;
|
||||
case "rename":
|
||||
$oData->groupwfs = $oProcess->renameExistingGroups($oData->groupwfs);
|
||||
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
|
||||
break;
|
||||
case "merge":
|
||||
|
||||
$oBaseGroup = $oData->groupwfs;
|
||||
$oNewGroup = $oProcess->mergeExistingGroups($oData->groupwfs);
|
||||
$oData->groupwfs = $oNewGroup;
|
||||
$oData->taskusers = $oProcess->mergeExistingUsers($oBaseGroup, $oNewGroup, $oData->taskusers);
|
||||
|
||||
break;
|
||||
default:
|
||||
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
|
||||
break;
|
||||
}
|
||||
|
||||
// if there are duplicated groups render the group importing options
|
||||
if($groupsDuplicated>0){
|
||||
$Fields['PRO_FILENAME'] = $filename;
|
||||
$Fields['PRO_PATH'] = $path;
|
||||
$Fields['IMPORT_OPTION'] = 2;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportFile' );
|
||||
G::RenderPage('publish');
|
||||
die;
|
||||
}
|
||||
// end added code
|
||||
$tasks = $oData->tasks;
|
||||
$oProcess->createProcessFromDataXpdl ($oData,$tasks);
|
||||
G::header('Location: processes_Map?PRO_UID=' . $sProUid);
|
||||
|
||||
}
|
||||
catch ( Exception $e ){
|
||||
$G_PUBLISH = new Publisher;
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage('publish');
|
||||
}
|
||||
65
workflow/engine/methods/processes/processes_ImportXpdl.php
Normal file
65
workflow/engine/methods/processes/processes_ImportXpdl.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* processes_Import.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$access = $RBAC->userCanAccess('PM_FACTORY');
|
||||
if( $access != 1 ){
|
||||
switch ($access)
|
||||
{
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
default:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass('processes');
|
||||
|
||||
/* Render page */
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ImportXpdl', '', NULL, 'processes_ImportFileXpdl' );
|
||||
G::RenderPage( "publish" );
|
||||
|
||||
}
|
||||
catch ( Exception $e ){
|
||||
$G_PUBLISH = new Publisher;
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage('publish');
|
||||
}
|
||||
@@ -26,322 +26,339 @@
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
$request = (isset($_POST['action']))?$_POST['action']:$_POST['request'];
|
||||
|
||||
switch ($request) {
|
||||
case 'testEmailConfiguration':
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aFields['FROM_EMAIL'] = $_POST['usermail'];
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/emails_TestForm','', $aFields);
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
case 'sendTestMail':
|
||||
$sFrom = ($_POST['FROM_NAME'] != '' ? $_POST['FROM_NAME'] . ' ' : '') . '<' . $_POST['FROM_EMAIL'] . '>';
|
||||
$sSubject = G::LoadTranslation('ID_MESS_TEST_SUBJECT');
|
||||
$msg = G::LoadTranslation('ID_MESS_TEST_BODY');
|
||||
switch ($_POST['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
||||
break;
|
||||
case 'PHPMAILER':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_2');
|
||||
break;
|
||||
case 'OPENMAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_3');
|
||||
break;
|
||||
}
|
||||
$colosa_msg = "This Business Process is powered by <b>ProcessMaker</b>.";
|
||||
$sBody = "
|
||||
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
||||
<tbody><tr><td><img id='logo' src='http://".$_SERVER['SERVER_NAME']."/images/processmaker.logo.jpg' /></td></tr>
|
||||
<tr><td style='font-size: 14px;'>$msg $engine [".date('H:i:s')."]</td></tr>
|
||||
<tr><td style='vertical-align:middel;'>
|
||||
<br /><hr><b>This Business Process is powered by ProcessMaker.<b><br />
|
||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||
</tr></tbody></table>";
|
||||
case 'testEmailConfiguration':
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aFields['FROM_EMAIL'] = $_POST['usermail'];
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/emails_TestForm','', $aFields);
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
case 'sendTestMail':
|
||||
$sFrom = ($_POST['FROM_NAME'] != '' ? $_POST['FROM_NAME'] . ' ' : '') . '<' . $_POST['FROM_EMAIL'] . '>';
|
||||
$sSubject = G::LoadTranslation('ID_MESS_TEST_SUBJECT');
|
||||
$msg = G::LoadTranslation('ID_MESS_TEST_BODY');
|
||||
|
||||
G::LoadClass('spool');
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool->setConfig( array(
|
||||
'MESS_ENGINE' => $_POST['MESS_ENGINE'],
|
||||
'MESS_SERVER' => $_POST['MESS_SERVER'],
|
||||
'MESS_PORT' => $_POST['MESS_PORT'],
|
||||
'MESS_ACCOUNT' => $_POST['MESS_ACCOUNT'],
|
||||
'MESS_PASSWORD' => $_POST['MESS_PASSWORD']
|
||||
));
|
||||
$oSpool->create(array(
|
||||
'msg_uid' => '',
|
||||
'app_uid' => '',
|
||||
'del_index' => 0,
|
||||
'app_msg_type' => 'TEST',
|
||||
'app_msg_subject' => $sSubject,
|
||||
'app_msg_from' => $sFrom,
|
||||
'app_msg_to' => $_POST['TO'],
|
||||
'app_msg_body' => $sBody,
|
||||
'app_msg_cc' => '',
|
||||
'app_msg_bcc' => '',
|
||||
'app_msg_attach' => '',
|
||||
'app_msg_template' => '',
|
||||
'app_msg_status' => 'pending'
|
||||
));
|
||||
$oSpool->sendMail();
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
if ($oSpool->status == 'sent') {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/emails_Sended', '', array('MESSAGE_VALUE' => G::LoadTranslation('ID_MESS_TEST_MESSAGE_SENDED')));
|
||||
switch ($_POST['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
||||
break;
|
||||
case 'PHPMAILER':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_2');
|
||||
break;
|
||||
case 'OPENMAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_3');
|
||||
break;
|
||||
}
|
||||
|
||||
$colosa_msg = "This Business Process is powered by <b>ProcessMaker</b>.";
|
||||
$sBody = "
|
||||
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
||||
<tbody><tr><td><img id='logo' src='http://".$_SERVER['SERVER_NAME']."/images/processmaker.logo.jpg' /></td></tr>
|
||||
<tr><td style='font-size: 14px;'>$msg $engine [".date('H:i:s')."]</td></tr>
|
||||
<tr><td style='vertical-align:middel;'>
|
||||
<br /><hr><b>This Business Process is powered by ProcessMaker.<b><br />
|
||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||
</tr></tbody></table>";
|
||||
|
||||
G::LoadClass('spool');
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool->setConfig( array(
|
||||
'MESS_ENGINE' => $_POST['MESS_ENGINE'],
|
||||
'MESS_SERVER' => $_POST['MESS_SERVER'],
|
||||
'MESS_PORT' => $_POST['MESS_PORT'],
|
||||
'MESS_ACCOUNT' => $_POST['MESS_ACCOUNT'],
|
||||
'MESS_PASSWORD' => $_POST['MESS_PASSWORD']
|
||||
));
|
||||
$oSpool->create(array(
|
||||
'msg_uid' => '',
|
||||
'app_uid' => '',
|
||||
'del_index' => 0,
|
||||
'app_msg_type' => 'TEST',
|
||||
'app_msg_subject' => $sSubject,
|
||||
'app_msg_from' => $sFrom,
|
||||
'app_msg_to' => $_POST['TO'],
|
||||
'app_msg_body' => $sBody,
|
||||
'app_msg_cc' => '',
|
||||
'app_msg_bcc' => '',
|
||||
'app_msg_attach' => '',
|
||||
'app_msg_template' => '',
|
||||
'app_msg_status' => 'pending'
|
||||
));
|
||||
$oSpool->sendMail();
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
if ($oSpool->status == 'sent') {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/emails_Sended', '', array('MESSAGE_VALUE' => G::LoadTranslation('ID_MESS_TEST_MESSAGE_SENDED')));
|
||||
}
|
||||
else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/emails_Sended', '', array('MESSAGE_VALUE' => G::LoadTranslation('ID_MESS_TEST_MESSAGE_ERROR_PHP_MAIL') . $oSpool->error));
|
||||
}
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
case 'mailTest_Show':
|
||||
$srv = $_POST['srv'];
|
||||
$port = $_POST['port'];
|
||||
$account = $_POST['account'];
|
||||
$passwd = $_POST['passwd'];
|
||||
$auth_required = $_POST['auth_required'];
|
||||
$send_test_mail = $_POST['send_test_mail'];
|
||||
$mail_to = $_POST['mail_to'];
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'setup/mailConnectiontest');
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'mailTestMail_Show':
|
||||
define("SUCCESSFUL", 'SUCCESSFUL');
|
||||
define("FAILED", 'FAILED');
|
||||
$mail_to = $_POST['mail_to'];
|
||||
$send_test_mail = $_POST['send_test_mail'];
|
||||
$_POST['FROM_NAME'] = $mail_to;
|
||||
$_POST['FROM_EMAIL'] = $mail_to;
|
||||
$_POST['MESS_ENGINE'] = 'MAIL';
|
||||
$_POST['MESS_SERVER'] = 'localhost';
|
||||
$_POST['MESS_PORT'] = 25;
|
||||
$_POST['MESS_ACCOUNT'] = $mail_to;
|
||||
$_POST['MESS_PASSWORD'] = '';
|
||||
$_POST['TO'] = $mail_to;
|
||||
$_POST['SMTPAuth'] = true;
|
||||
$resp = sendTestMail();
|
||||
if($resp->status){
|
||||
print(SUCCESSFUL.','.$resp->msg);
|
||||
} else {
|
||||
print(FAILED.','.$resp->msg);
|
||||
}
|
||||
else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/emails_Sended', '', array('MESSAGE_VALUE' => G::LoadTranslation('ID_MESS_TEST_MESSAGE_ERROR_PHP_MAIL') . $oSpool->error));
|
||||
}
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
case 'mailTest_Show':
|
||||
$srv = $_POST['srv'];
|
||||
$port = $_POST['port'];
|
||||
$account = $_POST['account'];
|
||||
$passwd = $_POST['passwd'];
|
||||
$auth_required = $_POST['auth_required'];
|
||||
$send_test_mail = $_POST['send_test_mail'];
|
||||
$mail_to = $_POST['mail_to'];
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'setup/mailConnectiontest');
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'mailTestMail_Show':
|
||||
define("SUCCESSFUL", 'SUCCESSFUL');
|
||||
define("FAILED", 'FAILED');
|
||||
$mail_to = $_POST['mail_to'];
|
||||
$send_test_mail = $_POST['send_test_mail'];
|
||||
$_POST['FROM_NAME'] = $mail_to;
|
||||
$_POST['FROM_EMAIL'] = $mail_to;
|
||||
$_POST['MESS_ENGINE'] = 'MAIL';
|
||||
$_POST['MESS_SERVER'] = 'localhost';
|
||||
$_POST['MESS_PORT'] = 25;
|
||||
$_POST['MESS_ACCOUNT'] = $mail_to;
|
||||
$_POST['MESS_PASSWORD'] = '';
|
||||
$_POST['TO'] = $mail_to;
|
||||
$_POST['SMTPAuth'] = true;
|
||||
$resp = sendTestMail();
|
||||
if($resp->status){
|
||||
print(SUCCESSFUL.','.$resp->msg);
|
||||
}
|
||||
else {
|
||||
print(FAILED.','.$resp->msg);
|
||||
}
|
||||
break;
|
||||
case 'testConnection':
|
||||
G::LoadClass('net');
|
||||
require_once('classes/class.smtp.rfc-821.php');
|
||||
define("SUCCESSFUL", 'SUCCESSFUL');
|
||||
define("FAILED", 'FAILED');
|
||||
//$host = 'smtp.bizmail.yahoo.com';
|
||||
$tld = ereg("([^//]*$)", $_POST['srv'], $regs);
|
||||
|
||||
case 'testConnection':
|
||||
|
||||
G::LoadClass('net');
|
||||
require_once('classes/class.smtp.rfc-821.php');
|
||||
|
||||
define("SUCCESSFUL", 'SUCCESSFUL');
|
||||
define("FAILED", 'FAILED');
|
||||
|
||||
//$host = 'smtp.bizmail.yahoo.com';
|
||||
$tld = ereg("([^//]*$)", $_POST['srv'], $regs);
|
||||
$srv1 = $regs[1];
|
||||
$srv = $_POST['srv'];
|
||||
$port = ($_POST['port'] == 'default')? 25: $_POST['port'];
|
||||
$user = $_POST['account'];
|
||||
$passwd = $_POST['passwd'];
|
||||
$step = $_POST['step'];
|
||||
$auth_required = $_POST['auth_required'];
|
||||
$send_test_mail = $_POST['send_test_mail'];
|
||||
$mail_to = $_POST['mail_to'];
|
||||
$Server = new NET($srv1);
|
||||
$oSMTP = new ESMTP;
|
||||
switch ($step) {
|
||||
case 1:
|
||||
if ($Server->getErrno() == 0) {
|
||||
print(SUCCESSFUL.',');
|
||||
} else {
|
||||
print(FAILED.','.$Server->error);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if($port == 0){
|
||||
$port = $oSMTP->SMTP_PORT;
|
||||
}
|
||||
$Server->scannPort($port);
|
||||
if ($Server->getErrno() == 0) {
|
||||
print(SUCCESSFUL.',');
|
||||
} else {
|
||||
print(FAILED.','.$Server->error);
|
||||
}
|
||||
break;
|
||||
#try to connect to host
|
||||
case 3:
|
||||
if($port == 0){
|
||||
$resp = $oSMTP->Connect($srv);
|
||||
} else {
|
||||
$resp = $oSMTP->Connect($srv, $port);
|
||||
}
|
||||
if( !$resp) {
|
||||
print(FAILED.','.$oSMTP->error['error']);
|
||||
} else {
|
||||
print(SUCCESSFUL.','.$oSMTP->status);
|
||||
}
|
||||
break;
|
||||
#try login to host
|
||||
case 4:
|
||||
if($auth_required == 'yes'){
|
||||
if($port == 0){
|
||||
$resp = $oSMTP->Connect($srv);
|
||||
} else {
|
||||
$resp = $oSMTP->Connect($srv, $port);
|
||||
}
|
||||
if($resp) {
|
||||
$oSMTP->do_debug = false;
|
||||
$oSMTP->Hello($srv);
|
||||
if( !$oSMTP->Authenticate($user, $passwd) ) {
|
||||
print(FAILED.','.$oSMTP->error['error']);
|
||||
} else {
|
||||
print(SUCCESSFUL.','.$oSMTP->status);
|
||||
}
|
||||
} else {
|
||||
print(FAILED.','.$oSMTP->error['error']);
|
||||
}
|
||||
} else {
|
||||
print(SUCCESSFUL.', No authentication required!');
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if($send_test_mail == 'yes'){
|
||||
//print(SUCCESSFUL.',ok');
|
||||
$_POST['FROM_NAME'] = 'Process Maker O.S. [Test mail]';
|
||||
$_POST['FROM_EMAIL'] = $user;
|
||||
$_POST['MESS_ENGINE'] = 'PHPMAILER';
|
||||
$_POST['MESS_SERVER'] = $srv;
|
||||
$_POST['MESS_PORT'] = $port;
|
||||
$_POST['MESS_ACCOUNT'] = $user;
|
||||
$_POST['MESS_PASSWORD'] = $passwd;
|
||||
$_POST['TO'] = $mail_to;
|
||||
if($auth_required == 'yes'){
|
||||
$_POST['SMTPAuth'] = true;
|
||||
} else {
|
||||
$_POST['SMTPAuth'] = false;
|
||||
}
|
||||
$resp = sendTestMail();
|
||||
if($resp->status){
|
||||
print(SUCCESSFUL.','.$resp->msg);
|
||||
} else {
|
||||
print(FAILED.','.$resp->msg);
|
||||
}
|
||||
} else {
|
||||
print('jump this step');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
print('test finished!');
|
||||
}
|
||||
break;
|
||||
|
||||
$srv = $_POST['srv'];
|
||||
|
||||
$port = ($_POST['port'] == 'default')? 25: $_POST['port'];
|
||||
$user = $_POST['account'];
|
||||
$passwd = $_POST['passwd'];
|
||||
$step = $_POST['step'];
|
||||
$auth_required = $_POST['auth_required'];
|
||||
$send_test_mail = $_POST['send_test_mail'];
|
||||
$mail_to = $_POST['mail_to'];
|
||||
|
||||
$Server = new NET($srv1);
|
||||
$oSMTP = new ESMTP;
|
||||
|
||||
switch ($step) {
|
||||
case 1:
|
||||
if ($Server->getErrno() == 0) {
|
||||
print(SUCCESSFUL.',');
|
||||
} else {
|
||||
print(FAILED.','.$Server->error);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if($port == 0){
|
||||
$port = $oSMTP->SMTP_PORT;
|
||||
}
|
||||
$Server->scannPort($port);
|
||||
if ($Server->getErrno() == 0) {
|
||||
print(SUCCESSFUL.',');
|
||||
} else {
|
||||
print(FAILED.','.$Server->error);
|
||||
}
|
||||
break;
|
||||
|
||||
#try to connect to host
|
||||
case 3:
|
||||
if($port == 0){
|
||||
$resp = $oSMTP->Connect($srv);
|
||||
} else {
|
||||
$resp = $oSMTP->Connect($srv, $port);
|
||||
}
|
||||
if( !$resp) {
|
||||
print(FAILED.','.$oSMTP->error['error']);
|
||||
} else {
|
||||
print(SUCCESSFUL.','.$oSMTP->status);
|
||||
}
|
||||
break;
|
||||
|
||||
#try login to host
|
||||
|
||||
case 4:
|
||||
if($auth_required == 'yes'){
|
||||
if($port == 0){
|
||||
$resp = $oSMTP->Connect($srv);
|
||||
} else {
|
||||
$resp = $oSMTP->Connect($srv, $port);
|
||||
}
|
||||
if($resp) {
|
||||
$oSMTP->do_debug = false;
|
||||
$oSMTP->Hello($srv);
|
||||
if( !$oSMTP->Authenticate($user, $passwd) ) {
|
||||
print(FAILED.','.$oSMTP->error['error']);
|
||||
} else {
|
||||
print(SUCCESSFUL.','.$oSMTP->status);
|
||||
}
|
||||
} else {
|
||||
print(FAILED.','.$oSMTP->error['error']);
|
||||
}
|
||||
} else {
|
||||
print(SUCCESSFUL.', No authentication required!');
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if($send_test_mail == 'yes'){
|
||||
//print(SUCCESSFUL.',ok');
|
||||
$_POST['FROM_NAME'] = 'Process Maker O.S. [Test mail]';
|
||||
$_POST['FROM_EMAIL'] = $user;
|
||||
|
||||
$_POST['MESS_ENGINE'] = 'PHPMAILER';
|
||||
$_POST['MESS_SERVER'] = $srv;
|
||||
$_POST['MESS_PORT'] = $port;
|
||||
$_POST['MESS_ACCOUNT'] = $user;
|
||||
$_POST['MESS_PASSWORD'] = $passwd;
|
||||
$_POST['TO'] = $mail_to;
|
||||
if($auth_required == 'yes'){
|
||||
$_POST['SMTPAuth'] = true;
|
||||
} else {
|
||||
$_POST['SMTPAuth'] = false;
|
||||
}
|
||||
$resp = sendTestMail();
|
||||
|
||||
if($resp->status){
|
||||
print(SUCCESSFUL.','.$resp->msg);
|
||||
} else {
|
||||
print(FAILED.','.$resp->msg);
|
||||
}
|
||||
} else {
|
||||
print('jump this step');
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
print('test finished!');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
function sendTestMail() {
|
||||
|
||||
$sFrom = ($_POST['FROM_NAME'] != '' ? $_POST['FROM_NAME'] . ' ' : '') . '<' . $_POST['FROM_EMAIL'] . '>';
|
||||
$sSubject = G::LoadTranslation('ID_MESS_TEST_SUBJECT');
|
||||
$msg = G::LoadTranslation('ID_MESS_TEST_BODY');
|
||||
$sFrom = ($_POST['FROM_NAME'] != '' ? $_POST['FROM_NAME'] . ' ' : '') . '<' . $_POST['FROM_EMAIL'] . '>';
|
||||
$sSubject = G::LoadTranslation('ID_MESS_TEST_SUBJECT');
|
||||
$msg = G::LoadTranslation('ID_MESS_TEST_BODY');
|
||||
|
||||
switch ($_POST['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
||||
break;
|
||||
case 'PHPMAILER':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_2');
|
||||
break;
|
||||
case 'OPENMAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_3');
|
||||
break;
|
||||
}
|
||||
switch ($_POST['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
||||
break;
|
||||
case 'PHPMAILER':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_2');
|
||||
break;
|
||||
case 'OPENMAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_3');
|
||||
break;
|
||||
}
|
||||
|
||||
$colosa_msg = "This Business Process is powered by <b>ProcessMaker</b>.";
|
||||
$sBody = "
|
||||
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
||||
<tbody><tr><td><img id='logo' src='http://".$_SERVER['SERVER_NAME']."/images/processmaker.logo.jpg' /></td></tr>
|
||||
<tr><td style='font-size: 14px;'>$msg [".date('H:i:s')."] - $engine</td></tr>
|
||||
<tr><td style='vertical-align:middel;'>
|
||||
<br /><hr><b>This Business Process is powered by ProcessMaker.<b><br />
|
||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||
</tr></tbody></table>";
|
||||
$colosa_msg = "This Business Process is powered by <b>ProcessMaker</b>.";
|
||||
$sBody = "
|
||||
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
||||
<tbody><tr><td><img id='logo' src='http://".$_SERVER['SERVER_NAME']."/images/processmaker.logo.jpg' /></td></tr>
|
||||
<tr><td style='font-size: 14px;'>$msg [".date('H:i:s')."] - $engine</td></tr>
|
||||
<tr><td style='vertical-align:middel;'>
|
||||
<br /><hr><b>This Business Process is powered by ProcessMaker.<b><br />
|
||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||
</tr></tbody></table>";
|
||||
|
||||
G::LoadClass('spool');
|
||||
$oSpool = new spoolRun();
|
||||
G::LoadClass('spool');
|
||||
$oSpool = new spoolRun();
|
||||
|
||||
|
||||
$oSpool->setConfig( array(
|
||||
'MESS_ENGINE' => $_POST['MESS_ENGINE'],
|
||||
'MESS_SERVER' => $_POST['MESS_SERVER'],
|
||||
'MESS_PORT' => $_POST['MESS_PORT'],
|
||||
'MESS_ACCOUNT' => $_POST['MESS_ACCOUNT'],
|
||||
'MESS_PASSWORD' => $_POST['MESS_PASSWORD'],
|
||||
'SMTPAuth' => $_POST['SMTPAuth']
|
||||
));
|
||||
$oSpool->setConfig( array(
|
||||
'MESS_ENGINE' => $_POST['MESS_ENGINE'],
|
||||
'MESS_SERVER' => $_POST['MESS_SERVER'],
|
||||
'MESS_PORT' => $_POST['MESS_PORT'],
|
||||
'MESS_ACCOUNT' => $_POST['MESS_ACCOUNT'],
|
||||
'MESS_PASSWORD' => $_POST['MESS_PASSWORD'],
|
||||
'SMTPAuth' => $_POST['SMTPAuth']
|
||||
));
|
||||
|
||||
$oSpool->create(array(
|
||||
'msg_uid' => '',
|
||||
'app_uid' => '',
|
||||
'del_index' => 0,
|
||||
'app_msg_type' => 'TEST',
|
||||
'app_msg_subject' => $sSubject,
|
||||
'app_msg_from' => $sFrom,
|
||||
'app_msg_to' => $_POST['TO'],
|
||||
'app_msg_body' => $sBody,
|
||||
'app_msg_cc' => '',
|
||||
'app_msg_bcc' => '',
|
||||
'app_msg_attach' => '',
|
||||
'app_msg_template' => '',
|
||||
'app_msg_status' => 'pending'
|
||||
));
|
||||
$oSpool->create(array(
|
||||
'msg_uid' => '',
|
||||
'app_uid' => '',
|
||||
'del_index' => 0,
|
||||
'app_msg_type' => 'TEST',
|
||||
'app_msg_subject' => $sSubject,
|
||||
'app_msg_from' => $sFrom,
|
||||
'app_msg_to' => $_POST['TO'],
|
||||
'app_msg_body' => $sBody,
|
||||
'app_msg_cc' => '',
|
||||
'app_msg_bcc' => '',
|
||||
'app_msg_attach' => '',
|
||||
'app_msg_template' => '',
|
||||
'app_msg_status' => 'pending'
|
||||
));
|
||||
|
||||
$oSpool->sendMail();
|
||||
$oSpool->sendMail();
|
||||
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
if ($oSpool->status == 'sent') {
|
||||
$o->status = true;
|
||||
$o->msg = G::LoadTranslation('ID_MESS_TEST_MESSAGE_SENDED');
|
||||
}
|
||||
else {
|
||||
$o->status = false;
|
||||
$o->msg = $oSpool->error;
|
||||
}
|
||||
return $o;
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
if ($oSpool->status == 'sent') {
|
||||
$o->status = true;
|
||||
$o->msg = G::LoadTranslation('ID_MESS_TEST_MESSAGE_SENDED');
|
||||
}
|
||||
else {
|
||||
$o->status = false;
|
||||
$o->msg = $oSpool->error;
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
||||
function e_utf8_encode($input) {
|
||||
$utftext = null;
|
||||
$utftext = null;
|
||||
|
||||
for ($n = 0; $n < strlen($input); $n++) {
|
||||
for ($n = 0; $n < strlen($input); $n++) {
|
||||
|
||||
$c = ord($input[$n]);
|
||||
$c = ord($input[$n]);
|
||||
|
||||
if ($c < 128) {
|
||||
$utftext .= chr($c);
|
||||
} else if (($c > 128) && ($c < 2048)) {
|
||||
$utftext .= chr(($c >> 6) | 192);
|
||||
$utftext .= chr(($c & 63) | 128);
|
||||
} else {
|
||||
$utftext .= chr(($c >> 12) | 224);
|
||||
$utftext .= chr((($c & 6) & 63) | 128);
|
||||
$utftext .= chr(($c & 63) | 128);
|
||||
}
|
||||
}
|
||||
if ($c < 128) {
|
||||
$utftext .= chr($c);
|
||||
} else if (($c > 128) && ($c < 2048)) {
|
||||
$utftext .= chr(($c >> 6) | 192);
|
||||
$utftext .= chr(($c & 63) | 128);
|
||||
} else {
|
||||
$utftext .= chr(($c >> 12) | 224);
|
||||
$utftext .= chr((($c & 6) & 63) | 128);
|
||||
$utftext .= chr(($c & 63) | 128);
|
||||
}
|
||||
}
|
||||
|
||||
return $utftext;
|
||||
return $utftext;
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
{if $PROCESS.ERROR eq '' && $PROCESS.ROU_TYPE neq 'SELECT' && $PROCESS.ROU_FINISH_FLAG }
|
||||
<td class='FormTitle' colspan="2" align="">{$END_OF_PROCESS}</td>
|
||||
@@ -44,66 +44,107 @@
|
||||
<td class='FormTitle' colspan="2" align="">{$ASSIGN_TASK}</td>
|
||||
{/if}
|
||||
</tr>
|
||||
|
||||
|
||||
{foreach key=id item=data from=$TASK}
|
||||
<tr height="5">
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
|
||||
{if $PROCESS.ROU_TYPE eq 'SELECT'}
|
||||
<form name="frmDerivation{$id}" id="frmDerivation{$id}" action="cases_Derivate" method="POST" class="formDefault" method="post" style="margin: 0px;"><input type="hidden" name="form[ROU_TYPE]" id="form[ROU_TYPE]" value="{$PROCESS.ROU_TYPE}">
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$OPTION_LABEL} {$id}:</td>
|
||||
<td class="FormFieldContent">{$data.ROU_CONDITION }</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{if $PROCESS.ERROR eq '' }
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$NEXT_TASK_LABEL}:</td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.TAS_TITLE}{$data.NEXT_TASK.TAS_HIDDEN_FIELD}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{if not $data.NEXT_TASK.ROU_FINISH_FLAG }
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$EMPLOYEE}:</td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.USR_UID}{$data.NEXT_TASK.USR_HIDDEN_FIELD}</td>
|
||||
</tr>
|
||||
|
||||
{if $data.NEXT_TASK.TAS_NEXT eq 'STATIC_MI' || $data.NEXT_TASK.TAS_NEXT eq 'CANCEL_MI'}
|
||||
{foreach key=id item=dataUser from=$data.NEXT_TASK.USER_ASSIGNED}
|
||||
{if $dataUser.USR_HIDDEN_FIELD neq ''}
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$EMPLOYEE}:</td>
|
||||
<td class="FormFieldContent">{$dataUser.USR_UID}{$dataUser.USR_HIDDEN_FIELD}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if $data.NEXT_TASK.TAS_NEXT eq ''}
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$EMPLOYEE}:</td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.USR_UID}{$data.NEXT_TASK.USR_HIDDEN_FIELD}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $data.NEXT_TASK.TAS_TRANSFER_FLY eq 'true'}
|
||||
<tr>
|
||||
<td class='FormSubTitle' colspan="2" align="">{$TAS_TIMING_TITLE} For {$data.NEXT_TASK.TAS_TITLE} Task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$TAS_DURATION}:</td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.TAS_DURATION}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$TAS_TIMEUNIT}:</td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.TAS_TIMEUNIT}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$TAS_TYPE_DAY}:</td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.TAS_TYPE_DAY}</td>
|
||||
</tr>
|
||||
{if $data.NEXT_TASK.TAS_CALENDAR neq ''}
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$TAS_CALENDAR}:</td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.TAS_CALENDAR}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr height="0">
|
||||
<td colspan="2">
|
||||
{$data.NEXT_TASK.TAS_TRANSFER_HIDDEN_FLY}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{else}
|
||||
<tr>
|
||||
<td class="FormLabel" width="100">{$LAST_EMPLOYEE}:</td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.USR_UID}{$data.NEXT_TASK.USR_HIDDEN_FIELD}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
|
||||
<tr height="0">
|
||||
<td colspan="2">
|
||||
{$data.NEXT_TASK.TAS_ASSIGN_TYPE}{$data.NEXT_TASK.TAS_DEF_PROC_CODE}{$data.NEXT_TASK.DEL_PRIORITY}{$data.NEXT_TASK.TAS_PARENT}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
{if $PROCESS.ROU_TYPE eq 'SELECT'}
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
{if $data.NEXT_TASK.TAS_ASSIGN_TYPE neq '' && not $data.NEXT_TASK.ROU_FINISH_FLAG }
|
||||
<input type="submit" class='module_app_button___gray' name="btnContinue" id="btnContinue" value="{$CONTINUE_WITH_OPTION} {$id} ">
|
||||
{/if} {if $data.NEXT_TASK.TAS_ASSIGN_TYPE neq '' && $data.NEXT_TASK.ROU_FINISH_FLAG }
|
||||
<input type="submit" class='module_app_button___gray' name="btnContinue" id="btnContinue" value="{$FINISH_WITH_OPTION} {$id} ">
|
||||
{$data.NEXT_TASK.TAS_ASSIGN_TYPE}
|
||||
{if $data.NEXT_TASK.TAS_ASSIGN_TYPE neq '' && not $data.NEXT_TASK.ROU_FINISH_FLAG }
|
||||
<input type="submit" class='module_app_button___gray' name="btnContinue" id="btnContinue" value="{$CONTINUE_WITH_OPTION} {$id} ">
|
||||
{/if} {if $data.NEXT_TASK.TAS_ASSIGN_TYPE neq '' && $data.NEXT_TASK.ROU_FINISH_FLAG }
|
||||
<input type="submit" class='module_app_button___gray' name="btnContinue" id="btnContinue" value="{$FINISH_WITH_OPTION} {$id} ">
|
||||
{$data.NEXT_TASK.TAS_ASSIGN_TYPE}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</form>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $PROCESS.ERROR eq '' && $PROCESS.ROU_TYPE neq 'SELECT' && ! $PROCESS.ROU_FINISH_FLAG }
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<input type="button" class='module_app_button___gray' name="btnContinue" id="btnContinue" value="{$CONTINUE}" {$PROCESS.DISABLED} />
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{if $PROCESS.ERROR eq '' && $PROCESS.ROU_TYPE neq 'SELECT' && $PROCESS.ROU_FINISH_FLAG }
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
@@ -112,12 +153,12 @@
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="boxBottom">
|
||||
<div class="a"></div>
|
||||
<div class="b"></div>
|
||||
@@ -155,7 +196,7 @@ if(!sw){
|
||||
{literal} if (client.browser == "msie" || client.browser == "safari" || client.browser == "firefox"){ {/literal}
|
||||
document.frmDerivation.submit();
|
||||
{literal} } {/literal}
|
||||
{literal}
|
||||
{literal}
|
||||
|
||||
|
||||
}.extend(document.getElementById('btnContinue'))); {/literal}
|
||||
|
||||
54
workflow/engine/xmlform/patterns/patterns_Discriminator.html
Executable file
54
workflow/engine/xmlform/patterns/patterns_Discriminator.html
Executable file
@@ -0,0 +1,54 @@
|
||||
<form id="{$form_id}" name="{$form_name}" action="{$form_action}" class="{$form_className}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit='return validateForm("{$form_objectRequiredFields}".parseJSON());'>
|
||||
<div class="borderForm" style="padding-left: 0pt; padding-right: 0pt;">
|
||||
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
<div class="content" style="">
|
||||
<table width="99%">
|
||||
<tbody><tr>
|
||||
<td valign="top">
|
||||
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
|
||||
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tbody><tr style="display: none;">
|
||||
<td colspan="2">{$form.action}</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.ROU_UID}</td>
|
||||
</tr>
|
||||
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.ROUTE_COUNT}</td>
|
||||
</tr>
|
||||
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.PROCESS}</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.TASK}</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.ROU_TYPE_OLD}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormTitle" colspan="2" align="">{$form.TITLE}</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.ROU_TYPE}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{$form.GRID_DISCRIMINATOR_TYPE}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormButton" colspan="2" align="center"> <br/> {$form.SAVE} {$form.BTN_CANCEL} </td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</div>
|
||||
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
{$form.JS}
|
||||
</script>
|
||||
|
||||
</form>
|
||||
83
workflow/engine/xmlform/patterns/patterns_Discriminator.xml
Executable file
83
workflow/engine/xmlform/patterns/patterns_Discriminator.xml
Executable file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="patterns_Sequential" type="xmlform" width="100%" enableTemplate="1">
|
||||
|
||||
<action type="hidden"/>
|
||||
|
||||
<LANG type="private"/>
|
||||
|
||||
<ROU_UID type="hidden"/>
|
||||
|
||||
<ROUTE_COUNT type="hidden"/>
|
||||
|
||||
<PROCESS type="hidden"/>
|
||||
|
||||
<TASK type="hidden"/>
|
||||
|
||||
<ROU_TYPE_OLD type="hidden"/>
|
||||
|
||||
<TITLE type="title" showInTable="0">
|
||||
<en>Discriminator</en>
|
||||
</TITLE>
|
||||
|
||||
<ROU_TYPE type="hidden"/>
|
||||
|
||||
<GRID_DISCRIMINATOR_TYPE type="grid" xmlgrid="patterns/patterns_GridDiscriminator" addRow="0" deleteRow="0" editRow="" />
|
||||
|
||||
<BTN_CANCEL type="button" onclick="cancel();">
|
||||
<en>Cancel</en>
|
||||
</BTN_CANCEL>
|
||||
|
||||
<SAVE type="button" onclick="savePattern(this.form);">
|
||||
<en>Save</en>
|
||||
</SAVE>
|
||||
|
||||
<JS type="javascript"><![CDATA[
|
||||
|
||||
var savePattern = function(oForm)
|
||||
{
|
||||
var oAux;
|
||||
var oType = getField('ROU_TYPE');
|
||||
var routeCount = getField('ROUTE_COUNT').value;
|
||||
var oOldType = getField('ROU_TYPE_OLD');
|
||||
var i = 1;
|
||||
var aData = {};
|
||||
var bContinue = true;
|
||||
if (oType.value != oOldType.value)
|
||||
{
|
||||
if (!confirm('You are changing the pattern, are you sure?'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
i = 1;
|
||||
aData.tas_uid = getField('TASK').value;
|
||||
aData.data = [];
|
||||
aData.type = 8;
|
||||
while (oAux = document.getElementById('form[GRID_DISCRIMINATOR_TYPE][' + i + '][ROU_NEXT_TASK]'))
|
||||
{
|
||||
oCond = document.getElementById('form[GRID_DISCRIMINATOR_TYPE][' + i + '][ROU_CONDITION]');
|
||||
if(oCond.value >= routeCount)
|
||||
{
|
||||
new leimnud.module.app.alert().make({label: 'No of Discriminators cannot be Greater than equal to Parallel Tasks'});
|
||||
return false;
|
||||
}
|
||||
else if(oCond.value == 0)
|
||||
{
|
||||
new leimnud.module.app.alert().make({label: 'Zero Task cannot be Discriminated'});
|
||||
return false;
|
||||
}
|
||||
aData.data.push(oAux.value);
|
||||
i++;
|
||||
}
|
||||
Pm.data.build.derivation(aData);
|
||||
ajax_post(oForm.action, oForm, 'POST');
|
||||
bModified = false;
|
||||
Pm.tmp.derivationsPanel.remove();
|
||||
};
|
||||
|
||||
function cancel(){
|
||||
Pm.tmp.derivationsPanel.remove();
|
||||
}
|
||||
]]></JS>
|
||||
|
||||
</dynaForm>
|
||||
20
workflow/engine/xmlform/patterns/patterns_GridDiscriminator.xml
Executable file
20
workflow/engine/xmlform/patterns/patterns_GridDiscriminator.xml
Executable file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="patterns_GridDiscriminator" type="grid" width="100%">
|
||||
|
||||
<ROU_NEXT_TASK type="dropdown"><![CDATA[
|
||||
SELECT TAS_UID, CON_VALUE FROM TASK LEFT JOIN CONTENT ON (TAS_UID = CON_ID AND CON_CATEGORY = 'TAS_TITLE' AND CON_LANG = '@#LANG') WHERE PRO_UID = '@#PROCESS'
|
||||
]]><en>Next Task</en>
|
||||
</ROU_NEXT_TASK>
|
||||
|
||||
<ROU_CONDITION type="text" size="20" maxlength="2" showVars="1" validate="Int" process="@#PROCESS">
|
||||
<en>No of Task to be Discriminated</en>
|
||||
</ROU_CONDITION>
|
||||
|
||||
<ROU_OPTIONAL type="dropdown" required="1" readonly="0" savelabel="0" mode="edit" options="Array" btn_cancel="Cancel">
|
||||
<en>Type of Discriminator
|
||||
<option name="FALSE">Structured</option>
|
||||
<option name="TRUE">Cancelling</option>
|
||||
</en>
|
||||
</ROU_OPTIONAL>
|
||||
|
||||
</dynaForm>
|
||||
@@ -9,6 +9,10 @@
|
||||
<en>Process Title</en>
|
||||
</PRO_TITLE>
|
||||
|
||||
<PRO_UID type="hidden">
|
||||
<en>Process Uid</en>
|
||||
</PRO_UID>
|
||||
|
||||
<PRO_DESCRIPTION type="caption">
|
||||
<en>Description</en>
|
||||
</PRO_DESCRIPTION>
|
||||
@@ -18,12 +22,18 @@
|
||||
</SIZE>
|
||||
|
||||
<FILENAME type="phpVariable"/>
|
||||
<FILENAMEXPDL type="phpVariable"/>
|
||||
<FILENAME_LINK type="phpVariable"/>
|
||||
<FILENAME_LINKXPDL type="phpVariable"/>
|
||||
|
||||
<FILENAME_LABEL type="link" value="@#FILENAME" link="@#FILENAME_LINK" target="_blank">
|
||||
<en>File</en>
|
||||
</FILENAME_LABEL>
|
||||
|
||||
<FILENAME_LABEL1 type="link" value="@#FILENAMEXPDL" link="@#FILENAME_LINKXPDL" target="_blank">
|
||||
<en>File xpdl</en>
|
||||
</FILENAME_LABEL1>
|
||||
|
||||
<JS type="javascript"><![CDATA[
|
||||
var nextStep = function(oForm)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<form id="{$form_id}" name="{$form_name}" action="{$form_action}" class="{$form_className}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit='return validateForm("{$form_objectRequiredFields}".parseJSON());'>
|
||||
<div class="borderForm" style="padding-left: 0pt; padding-right: 0pt; width:400">
|
||||
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
<div class="content" style="">
|
||||
<table width="99%">
|
||||
<tbody><tr>
|
||||
<td valign="top">
|
||||
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
|
||||
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tbody><tr>
|
||||
<td class="FormTitle" colspan="2" align="">{$form.title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormFieldContent" align = "">{$form.TITLE1}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.IMPORT_OPTION }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormFieldContent" width="{$form_fieldContentWidth}" >{$form.PRO_FILENAME}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel" >{$form.OBJ_UID }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormButton" colspan="2" align=""> <br/> {$form.SUBMIT} {$form.BTN_CANCEL} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormButton" colspan="2" align="center"></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</div>
|
||||
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
{$form.JS}
|
||||
</script>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="processes_New" width="50%" labelWidth="55px" mode="edit" enableTemplate="1">
|
||||
|
||||
|
||||
<title type="title" enableHTML="1">
|
||||
<en><![CDATA[<div align="center">Importing Existing Process</div>]]></en>
|
||||
</title>
|
||||
|
||||
<TITLE1 type="subtitle">
|
||||
<en>The process you are trying to import already exists. Please select one of the following options to continue:</en>
|
||||
</TITLE1>
|
||||
|
||||
|
||||
<IMPORT_OPTION type="radiogroup">
|
||||
<en>
|
||||
<option name="1">Update the current process, overwriting all tasks and steps</option>
|
||||
<option name="2">Disable the current process and create a new version of the process</option>
|
||||
<option name="3">Create a completely new process without changing the current process</option>
|
||||
</en>
|
||||
</IMPORT_OPTION>
|
||||
|
||||
<PRO_FILENAME type="hidden">
|
||||
</PRO_FILENAME>
|
||||
|
||||
<OBJ_UID type="hidden">
|
||||
</OBJ_UID>
|
||||
|
||||
<SUBMIT type="submit">
|
||||
<en>Save</en>
|
||||
</SUBMIT>
|
||||
<BTN_CANCEL type="button" onclick="cancel();">
|
||||
<en>Cancel</en>
|
||||
</BTN_CANCEL>
|
||||
|
||||
<JS type="javascript" replacetags="1"><![CDATA[
|
||||
function cancel(){
|
||||
window.location = 'processes_List';
|
||||
}
|
||||
|
||||
]]></JS>
|
||||
|
||||
</dynaForm>
|
||||
37
workflow/engine/xmlform/processes/processes_ImportXpdl.html
Normal file
37
workflow/engine/xmlform/processes/processes_ImportXpdl.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<form id="{$form_id}" name="{$form_name}" action="{$form_action}" class="{$form_className}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit="return validateForm('{$form_objectRequiredFields}');"> <div class="borderForm" style="width:{$form_width}; padding-left:0; padding-right:0; border-width:{$form_border};">
|
||||
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
<div class="content" style="height:{$form_height};" >
|
||||
<table width="99%">
|
||||
<tr>
|
||||
<td valign='top'>
|
||||
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
|
||||
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
|
||||
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class='FormTitle' colspan="2" align="">{$form.TITLE1}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='FormLabel' width="{$form_labelWidth}">{$PROCESS_FILENAME}</td>
|
||||
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PROCESS_FILENAME} </td> //-->
|
||||
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.PROCESS_FILENAME}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='FormButton' colspan="2" align="center">{$form.SAVE} {$form.BTN_CANCEL}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
{$form.JS}
|
||||
</script>
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
try {literal}{{/literal} dynaformSetFocus();}catch(e){literal}{{/literal}}
|
||||
</script>
|
||||
|
||||
38
workflow/engine/xmlform/processes/processes_ImportXpdl.xml
Normal file
38
workflow/engine/xmlform/processes/processes_ImportXpdl.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="cases_AttachInputDocument3" type="xmlform" width="400px" labelWidth="100px" enableTemplate="1">
|
||||
|
||||
<TITLE1 type="title">
|
||||
<en>Import Process</en>
|
||||
</TITLE1>
|
||||
|
||||
|
||||
<PROCESS_FILENAME type="file">
|
||||
<en>File</en>
|
||||
</PROCESS_FILENAME>
|
||||
|
||||
<SAVE type="button" onclick="verifyFile(this.form);">
|
||||
<en>Import</en>
|
||||
</SAVE>
|
||||
|
||||
<BTN_CANCEL type="button" onclick="cancel();">
|
||||
<en>Cancel</en>
|
||||
</BTN_CANCEL>
|
||||
<JS type="javascript" replacetags="1"><![CDATA[
|
||||
|
||||
var verifyFile = function(oForm) {
|
||||
if (document.getElementById('form[PROCESS_FILENAME]').value != '') {
|
||||
oForm.submit();
|
||||
}
|
||||
else {
|
||||
alert('@G::LoadTranslation(ID_SELECT_FILE_PM_IMPORT)');
|
||||
}
|
||||
};
|
||||
|
||||
function cancel(){
|
||||
window.location = 'processes_List';
|
||||
}
|
||||
|
||||
]]></JS>
|
||||
|
||||
|
||||
</dynaForm>
|
||||
@@ -86,12 +86,12 @@ var send_test_mail;
|
||||
var mail_to;
|
||||
|
||||
function verifyFields(oForm)
|
||||
{
|
||||
{
|
||||
switch (getField('MESS_ENGINE').value) {
|
||||
case 'PHPMAILER':
|
||||
case 'PHPMAILER':
|
||||
verifyPassword = 0;
|
||||
oAuxS = $('form[MESS_SERVER]').value;
|
||||
if (oAuxS == ''){
|
||||
if (oAuxS == ''){
|
||||
new leimnud.module.app.alert().make({
|
||||
label:G_STRINGS.ID_SERVER_REQUIRED
|
||||
});
|
||||
@@ -99,7 +99,7 @@ function verifyFields(oForm)
|
||||
}
|
||||
else{
|
||||
oAuxA = $('form[MESS_ACCOUNT]').value;
|
||||
if(oAuxA == ''){
|
||||
if(oAuxA == ''){
|
||||
new leimnud.module.app.alert().make({
|
||||
label:G_STRINGS.ID_MESS_ACCOUNT_REQUIRED
|
||||
});
|
||||
@@ -108,22 +108,22 @@ function verifyFields(oForm)
|
||||
else{
|
||||
if ($('form[MESS_RAUTH]').checked) {
|
||||
oAuxP = $('form[MESS_PASSWORD]').value;
|
||||
if (oAuxP == ''){
|
||||
if (oAuxP == ''){
|
||||
new leimnud.module.app.alert().make({
|
||||
label:G_STRINGS.ID_PASSWORD_REQUIRED
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
else{
|
||||
verifyPassword = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
verifyPassword = 1;
|
||||
}
|
||||
}
|
||||
if(verifyPassword == 1){
|
||||
if ($('form[MESS_TEST_MAIL]').checked) {
|
||||
oAuxE = $('form[MESS_TEST_MAIL_TO]').value;
|
||||
if (oAuxE == ''){
|
||||
if (oAuxE == ''){
|
||||
new leimnud.module.app.alert().make({
|
||||
label:G_STRINGS.ID_EMAIL_REQUIRED
|
||||
});
|
||||
@@ -131,7 +131,7 @@ function verifyFields(oForm)
|
||||
}
|
||||
else{
|
||||
testConnection();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
testConnection();
|
||||
}
|
||||
@@ -142,7 +142,7 @@ function verifyFields(oForm)
|
||||
case 'MAIL':
|
||||
if ($('form[MESS_TEST_MAIL]').checked) {
|
||||
oAuxE = $('form[MESS_TEST_MAIL_TO]').value;
|
||||
if (oAuxE == ''){
|
||||
if (oAuxE == ''){
|
||||
new leimnud.module.app.alert().make({
|
||||
label:G_STRINGS.ID_EMAIL_REQUIRED
|
||||
});
|
||||
@@ -150,13 +150,13 @@ function verifyFields(oForm)
|
||||
}
|
||||
else{
|
||||
testConnectionMail();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
testConnectionMail();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
function testConnection() {
|
||||
@@ -216,7 +216,7 @@ function testConnection() {
|
||||
|
||||
|
||||
|
||||
function testConnectionMail()
|
||||
function testConnectionMail()
|
||||
{
|
||||
resultset = true;
|
||||
if ($('form[MESS_TEST_MAIL]').checked) {
|
||||
@@ -245,14 +245,14 @@ function testConnectionMail()
|
||||
else {
|
||||
if( result == 'FAILED' ) {
|
||||
alert(G_STRINGS.ID_MAIL_FAILED);
|
||||
}
|
||||
}
|
||||
if( result == 'INVALID' ) {
|
||||
alert(G_STRINGS.ID_INVALID_EMAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert(G_STRINGS.ID_CHECK_REQUIRED);
|
||||
}
|
||||
@@ -354,7 +354,7 @@ function AJAX()
|
||||
|
||||
|
||||
function initSet(){
|
||||
//$('form[MESS_RAUTH]').checked = true;
|
||||
//$('form[MESS_RAUTH]').checked = true;
|
||||
hideRowById('MESS_TEST_MAIL_TO');
|
||||
if(!($('form[MESS_ENABLED]').checked)) {
|
||||
hideRowById('MESS_ENGINE');
|
||||
@@ -394,7 +394,7 @@ leimnud.event.add(getField('MESS_RAUTH'), 'click', function() {
|
||||
leimnud.event.add(getField('MESS_TEST_MAIL'), 'click', function() {
|
||||
if (this.checked) {
|
||||
showRowById('MESS_TEST_MAIL_TO');
|
||||
|
||||
|
||||
} else {
|
||||
hideRowById('MESS_TEST_MAIL_TO');
|
||||
}
|
||||
@@ -422,7 +422,7 @@ leimnud.event.add(getField('MESS_ENABLED'), 'click', function() {
|
||||
hideRowById('MESS_TEST_MAIL_TO');
|
||||
}
|
||||
$('form[SAVE_CHANGES]').disabled = true;
|
||||
|
||||
|
||||
break;
|
||||
case 'PHPMAILER':
|
||||
hideRowById('SAVE_CHANGES2');
|
||||
|
||||
@@ -12,16 +12,46 @@
|
||||
<LANG type="private"/>
|
||||
|
||||
<TAS_ASSIGN_TYPE type="radiogroup" defaultvalue="BALANCED" group="1">
|
||||
<en>Case to be assigned by<option name="BALANCED">Cyclical Assignment</option><option name="MANUAL">Manual Assignment</option><option name="EVALUATE">Value Based Assignment</option><option name="REPORT_TO">Reports to</option><option name="SELF_SERVICE">Self Service</option></en>
|
||||
<en>Case to be assigned by<option name="BALANCED">Cyclical Assignment</option><option name="MANUAL">Manual Assignment</option><option name="EVALUATE">Value Based Assignment</option><option name="REPORT_TO">Reports to</option><option name="SELF_SERVICE">Self Service</option><option name="STATIC_MI">Static Partial Join for Multiple Instances</option><option name="CANCEL_MI">Cancelling Partial Join for Multiple Instances</option></en>
|
||||
</TAS_ASSIGN_TYPE>
|
||||
|
||||
<TAS_ASSIGN_VARIABLE type="textpm" size="40" maxlength="155" defaultvalue="@@SYS_NEXT_USER_TO_BE_ASSIGNED" showVars="1" process="@#PRO_UID">
|
||||
<en>Variable for Value Based Assignment</en>
|
||||
</TAS_ASSIGN_VARIABLE>
|
||||
|
||||
<TAS_MI_INSTANCE_VARIABLE type="textpm" size="40" maxlength="155" defaultvalue="@@SYS_VAR_TOTAL_INSTANCE" showVars="1" process="@#PRO_UID">
|
||||
<en>Variable for No of Instances</en>
|
||||
</TAS_MI_INSTANCE_VARIABLE>
|
||||
|
||||
<TAS_MI_COMPLETE_VARIABLE type="textpm" size="40" maxlength="155" defaultvalue="@@SYS_VAR_TOTAL_INSTANCES_COMPLETE" showVars="1" process="@#PRO_UID">
|
||||
<en>Variable for No of Instances to complete</en>
|
||||
</TAS_MI_COMPLETE_VARIABLE>
|
||||
|
||||
|
||||
<JS type="javascript"><![CDATA[
|
||||
|
||||
var showTextpm = function()
|
||||
{
|
||||
if(getField('TAS_ASSIGN_TYPE][STATIC_MI').checked == true || getField('TAS_ASSIGN_TYPE][CANCEL_MI').checked == true)
|
||||
{
|
||||
showRowById('TAS_MI_INSTANCE_VARIABLE');
|
||||
showRowById('TAS_MI_COMPLETE_VARIABLE');
|
||||
hideRowById('TAS_ASSIGN_VARIABLE');
|
||||
}
|
||||
else if(getField('TAS_ASSIGN_TYPE][EVALUATE').checked == true)
|
||||
{
|
||||
showRowById('TAS_ASSIGN_VARIABLE');
|
||||
hideRowById('TAS_MI_INSTANCE_VARIABLE');
|
||||
hideRowById('TAS_MI_COMPLETE_VARIABLE');
|
||||
}
|
||||
else
|
||||
{
|
||||
hideRowById('TAS_ASSIGN_VARIABLE');
|
||||
hideRowById('TAS_MI_INSTANCE_VARIABLE');
|
||||
hideRowById('TAS_MI_COMPLETE_VARIABLE');
|
||||
}
|
||||
};
|
||||
|
||||
/* Recovery data */
|
||||
if (aTaskFlag[1])
|
||||
{
|
||||
@@ -29,25 +59,41 @@ if (aTaskFlag[1])
|
||||
{
|
||||
case 'SELF_SERVICE':
|
||||
getField('TAS_ASSIGN_TYPE][SELF_SERVICE').checked = true;
|
||||
showTextpm();
|
||||
break;
|
||||
case 'REPORT_TO':
|
||||
getField('TAS_ASSIGN_TYPE][REPORT_TO').checked = true;
|
||||
showTextpm();
|
||||
break;
|
||||
case 'BALANCED':
|
||||
getField('TAS_ASSIGN_TYPE][BALANCED').checked = true;
|
||||
showTextpm();
|
||||
break;
|
||||
case 'MANUAL':
|
||||
getField('TAS_ASSIGN_TYPE][MANUAL').checked = true;
|
||||
showTextpm();
|
||||
break;
|
||||
case 'EVALUATE':
|
||||
getField('TAS_ASSIGN_TYPE][EVALUATE').checked = true;
|
||||
showTextpm();
|
||||
break;
|
||||
case 'SELFSERVICE':
|
||||
getField('TAS_ASSIGN_TYPE][SELFSERVICE').checked = true;
|
||||
showTextpm();
|
||||
break;
|
||||
case 'STATIC_MI':
|
||||
getField('TAS_ASSIGN_TYPE][STATIC_MI').checked = true;
|
||||
showTextpm();
|
||||
break;
|
||||
case 'CANCEL_MI':
|
||||
getField('TAS_ASSIGN_TYPE][CANCEL_MI').checked = true;
|
||||
showTextpm();
|
||||
break;
|
||||
}
|
||||
getField('TAS_ASSIGN_VARIABLE').value = oTaskData.TAS_ASSIGN_VARIABLE;
|
||||
/*getField('TAS_DERIVATION').checked = (oTaskData.TAS_DERIVATION == 'TRUE' ? true : false);
|
||||
getField('TAS_MI_INSTANCE_VARIABLE').value = oTaskData.TAS_MI_INSTANCE_VARIABLE;
|
||||
getField('TAS_MI_COMPLETE_VARIABLE').value = oTaskData.TAS_MI_COMPLETE_VARIABLE;
|
||||
/*getField('TAS_DERIVATION').checked = (oTaskData.TAS_DERIVATION == 'TRUE' ? true : false);
|
||||
getField('TAS_PRIORITY_VARIABLE').checked = (oTaskData.TAS_PRIORITY_VARIABLE == 'TRUE' ? true : false);
|
||||
getField('TAS_ASSIGN_LOCATION').checked = (oTaskData.TAS_ASSIGN_LOCATION == 'TRUE' ? true : false);
|
||||
getField('TAS_ASSIGN_LOCATION_ADHOC').checked = (oTaskData.TAS_ASSIGN_LOCATION_ADHOC == 'TRUE' ? true : false);
|
||||
@@ -56,31 +102,42 @@ if (aTaskFlag[1])
|
||||
else
|
||||
{
|
||||
saveDataTaskTemporal(2);
|
||||
aTaskFlag[1] = true;
|
||||
aTaskFlag[1] = true;
|
||||
showTextpm();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
leimnud.event.add(getField('TAS_ASSIGN_TYPE][SELF_SERVICE'), 'click', function() {
|
||||
hideRowById('TAS_ASSIGN_VARIABLE');
|
||||
showTextpm();
|
||||
});
|
||||
|
||||
leimnud.event.add(getField('TAS_ASSIGN_TYPE][REPORT_TO'), 'click', function() {
|
||||
hideRowById('TAS_ASSIGN_VARIABLE');
|
||||
showTextpm();
|
||||
});
|
||||
|
||||
leimnud.event.add(getField('TAS_ASSIGN_TYPE][BALANCED'), 'click', function() {
|
||||
hideRowById('TAS_ASSIGN_VARIABLE');
|
||||
showTextpm();
|
||||
});
|
||||
leimnud.event.add(getField('TAS_ASSIGN_TYPE][MANUAL'), 'click', function() {
|
||||
hideRowById('TAS_ASSIGN_VARIABLE');
|
||||
showTextpm();
|
||||
});
|
||||
leimnud.event.add(getField('TAS_ASSIGN_TYPE][EVALUATE'), 'click', function() {
|
||||
showRowById('TAS_ASSIGN_VARIABLE');
|
||||
showTextpm();
|
||||
});
|
||||
leimnud.event.add(getField('TAS_ASSIGN_TYPE][STATIC_MI'), 'click', function() {
|
||||
showTextpm();
|
||||
});
|
||||
leimnud.event.add(getField('TAS_ASSIGN_TYPE][CANCEL_MI'), 'click', function() {
|
||||
showTextpm();
|
||||
});
|
||||
|
||||
if (!getField('TAS_ASSIGN_TYPE][EVALUATE').checked) {
|
||||
hideRowById('TAS_ASSIGN_VARIABLE');
|
||||
showTextpm();
|
||||
}
|
||||
|
||||
|
||||
var _oVarsPanel_;
|
||||
var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol) {
|
||||
_oVarsPanel_ = new leimnud.module.panel();
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
<IFORM type="hidden"/>
|
||||
|
||||
<TAS_TRANSFER_FLY type="checkbox" value="TRUE" falsevalue="FALSE" defaultvalue="TRUE" group="1">
|
||||
<en>Allow user defined timing control</en>
|
||||
</TAS_TRANSFER_FLY>
|
||||
|
||||
<TAS_DURATION type="text" size="3" maxlength="3" defaultvalue="1" required="1" validate="Int" group="1" dependentfields="" linkfield="" strto="UPPER" readonly="0" noshowingrid="0" readonlyingrid="0" totalizeable="0" sqlconnection="">
|
||||
<en>Task duration</en>
|
||||
</TAS_DURATION>
|
||||
@@ -18,27 +22,53 @@
|
||||
<TAS_TYPE_DAY type="dropdown" defaultvalue="1" group="1">
|
||||
<en>Count days by<option name="1">Work Days</option><option name="2">Calendar Days</option></en>
|
||||
</TAS_TYPE_DAY>
|
||||
|
||||
<TAS_CALENDAR type="dropdown" sqlconnection="dbarray">
|
||||
SELECT CALENDAR_UID, CALENDAR_NAME FROM availableCalendars
|
||||
<en>Calendar<option name="">- None -</option></en>
|
||||
</TAS_CALENDAR>
|
||||
|
||||
|
||||
<JS type="javascript"><![CDATA[
|
||||
|
||||
var toggleFields = function()
|
||||
{
|
||||
if(getField('TAS_TRANSFER_FLY').checked == false)
|
||||
{
|
||||
showRowById('TAS_DURATION');
|
||||
showRowById('TAS_TIMEUNIT');
|
||||
showRowById('TAS_TYPE_DAY');
|
||||
showRowById('TAS_CALENDAR');
|
||||
}
|
||||
else
|
||||
{
|
||||
hideRowById('TAS_DURATION');
|
||||
hideRowById('TAS_TIMEUNIT');
|
||||
hideRowById('TAS_TYPE_DAY');
|
||||
hideRowById('TAS_CALENDAR');
|
||||
}
|
||||
}
|
||||
|
||||
/* Recovery data */
|
||||
|
||||
if (aTaskFlag[2])
|
||||
{
|
||||
getField('TAS_DURATION').value = oTaskData.TAS_DURATION;
|
||||
getField('TAS_TIMEUNIT').value = oTaskData.TAS_TIMEUNIT;
|
||||
getField('TAS_TYPE_DAY').value = oTaskData.TAS_TYPE_DAY;
|
||||
getField('TAS_CALENDAR').value = oTaskData.TAS_CALENDAR;
|
||||
//getField('TAS_TRANSFER_FLY').checked = (oTaskData.TAS_TRANSFER_FLY == 'TRUE' ? true : false);
|
||||
getField('TAS_TRANSFER_FLY').checked = (oTaskData.TAS_TRANSFER_FLY == 'TRUE' ? true : false);
|
||||
toggleFields();
|
||||
}
|
||||
else
|
||||
{
|
||||
saveDataTaskTemporal(3);
|
||||
aTaskFlag[2] = true;
|
||||
toggleFields();
|
||||
}
|
||||
|
||||
leimnud.event.add(getField('TAS_TRANSFER_FLY'), 'click', function() {
|
||||
toggleFields();
|
||||
});
|
||||
]]></JS>
|
||||
|
||||
</dynaForm>
|
||||
Reference in New Issue
Block a user