Merged develop into bugfix/HOR-3295
This commit is contained in:
@@ -828,28 +828,50 @@ function run_migrate_itee_to_dummytask($args, $opts){
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
function run_check_workspace_disabled_code($args, $opts)
|
||||
/**
|
||||
* Check if we need to execute an external program for each workspace
|
||||
* If we apply the command for all workspaces we will need to execute one by one by redefining the constants
|
||||
* @param string $args, workspaceName that we need to apply the database-upgrade
|
||||
* @param string $opts
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function run_check_workspace_disabled_code($args, $opts) {
|
||||
//Check if the command is executed by a specific workspace
|
||||
if (count($args) === 1) {
|
||||
check_workspace_disabled_code($args, $opts);
|
||||
} else {
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
foreach ($workspaces as $workspace) {
|
||||
passthru('./processmaker check-workspace-disabled-code ' . $workspace->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This function is executed only by one workspace
|
||||
* Code Security Scanner related to the custom blacklist
|
||||
* @param array $args, the specific actions must be: upgrade|check
|
||||
* @param array $opts, workspaceName for to apply the database-upgrade
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function check_workspace_disabled_code($args, $opts)
|
||||
{
|
||||
try {
|
||||
//Load the attributes for the workspace
|
||||
$arrayWorkspace = get_workspaces_from_args($args);
|
||||
//Loop, read all the attributes related to the one workspace
|
||||
$wsName = $arrayWorkspace[key($arrayWorkspace)]->name;
|
||||
Bootstrap::setConstantsRelatedWs($wsName);
|
||||
|
||||
foreach ($arrayWorkspace as $value) {
|
||||
$workspace = $value;
|
||||
|
||||
if (!defined("SYS_SYS")) {
|
||||
define("SYS_SYS", $workspace->name);
|
||||
}
|
||||
|
||||
if (!defined("PATH_DATA_SITE")) {
|
||||
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP);
|
||||
}
|
||||
|
||||
if (!$workspace->pmLicensedFeaturesVerifyFeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
|
||||
throw new Exception("Error: This command cannot be used because your license does not include it.");
|
||||
}
|
||||
|
||||
echo "> Workspace: " . $workspace->name . "\n";
|
||||
|
||||
try {
|
||||
$arrayFoundDisabledCode = $workspace->getDisabledCode();
|
||||
|
||||
@@ -858,24 +880,20 @@ function run_check_workspace_disabled_code($args, $opts)
|
||||
|
||||
foreach ($arrayFoundDisabledCode as $value2) {
|
||||
$arrayProcessData = $value2;
|
||||
|
||||
$strFoundDisabledCode .= ($strFoundDisabledCode != "")? "\n" : "";
|
||||
$strFoundDisabledCode .= " Process: " . $arrayProcessData["processTitle"] . "\n";
|
||||
$strFoundDisabledCode .= " Triggers:\n";
|
||||
|
||||
foreach ($arrayProcessData["triggers"] as $value3) {
|
||||
$arrayTriggerData = $value3;
|
||||
|
||||
$strCodeAndLine = "";
|
||||
|
||||
foreach ($arrayTriggerData["disabledCode"] as $key4 => $value4) {
|
||||
$strCodeAndLine .= (($strCodeAndLine != "")? ", " : "") . $key4 . " (Lines " . implode(", ", $value4) . ")";
|
||||
}
|
||||
|
||||
$strFoundDisabledCode .= " - " . $arrayTriggerData["triggerTitle"] . ": " . $strCodeAndLine . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo $strFoundDisabledCode . "\n";
|
||||
} else {
|
||||
echo "The workspace it's OK\n\n";
|
||||
@@ -883,11 +901,9 @@ function run_check_workspace_disabled_code($args, $opts)
|
||||
} catch (Exception $e) {
|
||||
G::outRes( "Errors to check disabled code: " . CLI::error($e->getMessage()) . "\n\n" );
|
||||
}
|
||||
|
||||
$workspace->close();
|
||||
}
|
||||
|
||||
echo "Done!\n";
|
||||
echo "Done!\n\n";
|
||||
} catch (Exception $e) {
|
||||
G::outRes( CLI::error($e->getMessage()) . "\n" );
|
||||
}
|
||||
|
||||
@@ -1980,6 +1980,12 @@ class AppSolr
|
||||
}
|
||||
else {
|
||||
foreach ($UnSerializedCaseData as $k => $value) {
|
||||
//This validation is only for the 'checkbox' control for the BPMN forms,
|
||||
//the request is not made to the database to obtain the control
|
||||
//associated with the variable so as not to decrease the performance.
|
||||
if (is_array($value) && count($value) === 1 && isset($value[0]) && !is_object($value[0]) && !is_array($value[0])) {
|
||||
$value = $value[0];
|
||||
}
|
||||
if (! is_array ($value) && ! is_object ($value) && $value != '' && $k != 'SYS_LANG' && $k != 'SYS_SKIN' && $k != 'SYS_SYS') {
|
||||
// search the field type in array of dynaform fields
|
||||
if (! empty ($dynaformFieldTypes) && array_key_exists (trim ($k), $dynaformFieldTypes)) {
|
||||
@@ -2912,19 +2918,20 @@ class AppSolr
|
||||
$oAppSolrQueue->createUpdate ($AppUid, $traceData, $updated);
|
||||
}
|
||||
|
||||
private function getCurrentTraceInfo()
|
||||
{
|
||||
$resultTraceString = "";
|
||||
|
||||
//
|
||||
$traceData = debug_backtrace();
|
||||
foreach ($traceData as $key => $value) {
|
||||
if($value['function'] != 'getCurrentTraceInfo' && $value['function'] != 'require_once')
|
||||
$resultTraceString .= $value['file'] . " (" . $value['line'] . ") " . $value['function'] . "\n";
|
||||
private function getCurrentTraceInfo()
|
||||
{
|
||||
$resultTraceString = "";
|
||||
$traceData = debug_backtrace();
|
||||
foreach ($traceData as $key => $value) {
|
||||
if ($value['function'] != 'getCurrentTraceInfo' && $value['function'] != 'require_once') {
|
||||
if (isset($value['file']) && isset($value['line']) && isset($value['function'])) {
|
||||
$resultTraceString .= $value['file'] . " (" . $value['line'] . ") " . $value['function'] . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return $resultTraceString;
|
||||
}
|
||||
return $resultTraceString;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update application records in Solr that are stored in APP_SOLR_QUEUE table
|
||||
*/
|
||||
|
||||
@@ -1152,7 +1152,9 @@ class Cases
|
||||
//Logger deleteCase
|
||||
$nameFiles = '';
|
||||
foreach (debug_backtrace() as $node) {
|
||||
$nameFiles .= $node['file'] . ":" . $node['function'] . "(" . $node['line'] . ")\n";
|
||||
if (isset($node['file']) && isset($node['function']) && isset($node['line'])) {
|
||||
$nameFiles .= $node['file'] . ":" . $node['function'] . "(" . $node['line'] . ")\n";
|
||||
}
|
||||
}
|
||||
$dataLog = \Bootstrap::getDefaultContextLog();
|
||||
$dataLog['usrUid'] = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : G::LoadTranslation('UID_UNDEFINED_USER');
|
||||
|
||||
@@ -1033,38 +1033,7 @@ class Derivation
|
||||
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||
break;
|
||||
case TASK_FINISH_TASK:
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
$this->case->closeAppThread($currentDelegation['APP_UID'], $iAppThreadIndex);
|
||||
if (isset($nextDel["TAS_UID_DUMMY"])) {
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->addSelectColumn(RoutePeer::TAS_UID);
|
||||
$criteria->addJoin(RoutePeer::TAS_UID, AppDelegationPeer::TAS_UID);
|
||||
$criteria->add(RoutePeer::PRO_UID, $appFields['PRO_UID']);
|
||||
$criteria->add(RoutePeer::ROU_NEXT_TASK, isset($nextDel['ROU_PREVIOUS_TASK']) ? $nextDel['ROU_PREVIOUS_TASK'] : '');
|
||||
$criteria->add(RoutePeer::ROU_TYPE, isset($nextDel['ROU_PREVIOUS_TYPE']) ? $nextDel['ROU_PREVIOUS_TYPE'] : '');
|
||||
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
|
||||
$rsCriteria = RoutePeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$executeEvent = ($rsCriteria->next()) ? false : true;
|
||||
|
||||
$multiInstanceCompleted = true;
|
||||
if ($flagTaskAssignTypeIsMultipleInstance) {
|
||||
$multiInstanceCompleted = $this->case->multiInstanceIsCompleted(
|
||||
$appFields['APP_UID'],
|
||||
$appFields['TAS_UID'],
|
||||
$appFields['DEL_PREVIOUS']);
|
||||
}
|
||||
|
||||
$taskDummy = TaskPeer::retrieveByPK($nextDel["TAS_UID_DUMMY"]);
|
||||
if (preg_match("/^(?:END-MESSAGE-EVENT|END-EMAIL-EVENT)$/", $taskDummy->getTasType())
|
||||
&& $multiInstanceCompleted && $executeEvent
|
||||
) {
|
||||
$this->executeEvent($nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true);
|
||||
}
|
||||
}
|
||||
$aContext['action'] = 'finish-task';
|
||||
//Logger
|
||||
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||
$this->finishTask($currentDelegation, $nextDel, $appFields, $flagFirstIteration, $flagTaskAssignTypeIsMultipleInstance, $aContext);
|
||||
break;
|
||||
default:
|
||||
//Get all siblingThreads
|
||||
@@ -1348,7 +1317,7 @@ class Derivation
|
||||
/* Start Block : Count the open threads of $currentDelegation['APP_UID'] */
|
||||
$openThreads = $this->case->GetOpenThreads( $currentDelegation['APP_UID'] );
|
||||
|
||||
$flag = false;
|
||||
$flagUpdateCase = false;
|
||||
|
||||
//check if there is any paused thread
|
||||
|
||||
@@ -1364,18 +1333,24 @@ class Derivation
|
||||
$appFields["APP_STATUS"] = "COMPLETED";
|
||||
$appFields["APP_FINISH_DATE"] = "now";
|
||||
$this->verifyIsCaseChild($currentDelegation["APP_UID"], $currentDelegation["DEL_INDEX"]);
|
||||
$flag = true;
|
||||
$flagUpdateCase = true;
|
||||
|
||||
}
|
||||
|
||||
if (isset( $iNewDelIndex )) {
|
||||
//The variable $iNewDelIndex will be true if we created a new index the variable
|
||||
if (isset($iNewDelIndex)) {
|
||||
$appFields["DEL_INDEX"] = $iNewDelIndex;
|
||||
$appFields["TAS_UID"] = $nextDel["TAS_UID"];
|
||||
|
||||
$flag = true;
|
||||
$excludeTasUid = array(TASK_FINISH_PROCESS, TASK_FINISH_TASK);
|
||||
//If the last TAS_UID value is not valid we will check for the valid TAS_UID value
|
||||
if (in_array($nextDel["TAS_UID"], $excludeTasUid) && is_array($arrayDerivationResult) && isset(current($arrayDerivationResult)["TAS_UID"])) {
|
||||
$appFields["TAS_UID"] = current($arrayDerivationResult)["TAS_UID"];
|
||||
} else {
|
||||
$appFields["TAS_UID"] = $nextDel["TAS_UID"];
|
||||
}
|
||||
$flagUpdateCase = true;
|
||||
}
|
||||
|
||||
if ($flag) {
|
||||
if ($flagUpdateCase) {
|
||||
//Start Block : UPDATES APPLICATION
|
||||
$this->case->updateCase( $currentDelegation["APP_UID"], $appFields );
|
||||
//End Block : UPDATES APPLICATION
|
||||
@@ -2009,4 +1984,47 @@ class Derivation
|
||||
\G::log(G::loadTranslation('ID_NOTIFICATION_ERROR') . '|' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param array $currentDelegation
|
||||
* @param array $nextDel
|
||||
* @param array $appFields
|
||||
* @param boolean $flagFirstIteration
|
||||
* @param boolean $flagTaskAssignTypeIsMultipleInstance
|
||||
* @param array $aContext
|
||||
* @return void
|
||||
*/
|
||||
public function finishTask($currentDelegation, $nextDel, $appFields, $flagFirstIteration = true, $flagTaskAssignTypeIsMultipleInstance = false, $aContext = array()) {
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
$this->case->closeAppThread($currentDelegation['APP_UID'], $iAppThreadIndex);
|
||||
if (isset($nextDel["TAS_UID_DUMMY"])) {
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->addSelectColumn(RoutePeer::TAS_UID);
|
||||
$criteria->addJoin(RoutePeer::TAS_UID, AppDelegationPeer::TAS_UID);
|
||||
$criteria->add(RoutePeer::PRO_UID, $appFields['PRO_UID']);
|
||||
$criteria->add(RoutePeer::ROU_NEXT_TASK, isset($nextDel['ROU_PREVIOUS_TASK']) ? $nextDel['ROU_PREVIOUS_TASK'] : '');
|
||||
$criteria->add(RoutePeer::ROU_TYPE, isset($nextDel['ROU_PREVIOUS_TYPE']) ? $nextDel['ROU_PREVIOUS_TYPE'] : '');
|
||||
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
|
||||
$rsCriteria = RoutePeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$executeEvent = ($rsCriteria->next()) ? false : true;
|
||||
|
||||
$multiInstanceCompleted = true;
|
||||
if ($flagTaskAssignTypeIsMultipleInstance) {
|
||||
$multiInstanceCompleted = $this->case->multiInstanceIsCompleted(
|
||||
$appFields['APP_UID'],
|
||||
$appFields['TAS_UID'],
|
||||
$appFields['DEL_PREVIOUS']);
|
||||
}
|
||||
|
||||
$taskDummy = TaskPeer::retrieveByPK($nextDel["TAS_UID_DUMMY"]);
|
||||
if (preg_match("/^(?:END-MESSAGE-EVENT|END-EMAIL-EVENT)$/", $taskDummy->getTasType())
|
||||
&& $multiInstanceCompleted && $executeEvent
|
||||
) {
|
||||
$this->executeEvent($nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true);
|
||||
}
|
||||
}
|
||||
$aContext['action'] = 'finish-task';
|
||||
//Logger
|
||||
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2227,6 +2227,11 @@ function PMFCreateUser ($userId, $password, $firstname, $lastname, $email, $role
|
||||
$ws = new wsBase();
|
||||
$result = $ws->createUser( $userId, $firstname, $lastname, $email, $role, $password, $dueDate, $status );
|
||||
|
||||
//When the user is created the $result parameter is an array, in other case is a object exception
|
||||
if (!is_object($result)) {
|
||||
$result = (object)$result;
|
||||
}
|
||||
|
||||
if ($result->status_code == 0) {
|
||||
return 1;
|
||||
} else {
|
||||
|
||||
@@ -67,7 +67,7 @@ class pmLicenseManager
|
||||
$this->id = $results ['ID'];
|
||||
$this->expireIn = $this->getExpireIn ();
|
||||
$this->features = $this->result!='TMINUS'?isset($results ['DATA']['CUSTOMER_PLUGIN'])? $results ['DATA']['CUSTOMER_PLUGIN'] : $this->getActiveFeatures() : array();
|
||||
$this->licensedfeatures = $this->result!='TMINUS'?isset($results ['DATA']['CUSTOMER_LICENSED_FEATURES'])? $results ['DATA']['CUSTOMER_LICENSED_FEATURES'] : array() : array();
|
||||
$this->licensedfeatures = $this->result != 'TMINUS' ? (isset($results ['DATA']['CUSTOMER_LICENSED_FEATURES']) && is_array($results ['DATA']['CUSTOMER_LICENSED_FEATURES'])) ? $results ['DATA']['CUSTOMER_LICENSED_FEATURES'] : array() : array();
|
||||
$this->licensedfeaturesList = isset($results ['DATA']['LICENSED_FEATURES_LIST'])? $results ['DATA']['LICENSED_FEATURES_LIST'] : null;
|
||||
$this->status = $this->getCurrentLicenseStatus ();
|
||||
|
||||
|
||||
@@ -25,23 +25,14 @@ G::LoadClass ('pmFunctions');
|
||||
$RBAC = RBAC::getSingleton();
|
||||
$RBAC->initRBAC();
|
||||
$res = false;
|
||||
$server = $_SERVER['SERVER_SOFTWARE'];
|
||||
$webserver = explode("/", $server);
|
||||
if(isset($_SERVER['REMOTE_USER']) && $_SERVER['REMOTE_USER'] !=''){
|
||||
// IIS Verification
|
||||
if (!is_array($webserver) || (is_array($webserver) && ($webserver[0] == 'Microsoft-IIS'))){
|
||||
$userFull = $_SERVER['REMOTE_USER'];
|
||||
$userPN = explode("\\", $userFull);
|
||||
if (is_array($userPN)){
|
||||
$user = $userPN[1];
|
||||
} else {
|
||||
$user = $userFull;
|
||||
}
|
||||
$userFull = $_SERVER['REMOTE_USER'];
|
||||
$userPN = explode("\\", $userFull);
|
||||
if (is_array($userPN)){
|
||||
$user = $userPN[1];
|
||||
} else {
|
||||
$userFull = $_SERVER['REMOTE_USER'];
|
||||
$user = $_SERVER['REMOTE_USER'];
|
||||
$user = $userFull;
|
||||
}
|
||||
// End IIS Verification
|
||||
|
||||
$resVerifyUser = $RBAC->verifyUser($user);
|
||||
if ($resVerifyUser == 0) {
|
||||
|
||||
@@ -1986,7 +1986,7 @@ class wsBase
|
||||
|
||||
$task = TaskPeer::retrieveByPK($taskId);
|
||||
|
||||
$arrayTaskTypeToExclude = array("START-TIMER-EVENT");
|
||||
$arrayTaskTypeToExclude = array("START-TIMER-EVENT", "START-MESSAGE-EVENT");
|
||||
|
||||
if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $founded == "") {
|
||||
$result = new wsResponse( 14, G::LoadTranslation( 'ID_TASK_INVALID_USER_NOT_ASSIGNED_TASK' ) );
|
||||
|
||||
@@ -2600,34 +2600,91 @@ class workspaceTools
|
||||
CLI::logging("> Completed table LIST_PARTICIPATED_LAST\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* This function overwrite the table LIST_PAUSED
|
||||
* Get the principal information in the tables appDelay, appDelegation
|
||||
* For the labels we use the tables user, process, task and application
|
||||
* @return void
|
||||
*/
|
||||
public function regenerateListPaused(){
|
||||
$delaycriteria = new Criteria("workflow");
|
||||
$delaycriteria->addSelectColumn(AppDelayPeer::APP_UID);
|
||||
$delaycriteria->addSelectColumn(AppDelayPeer::PRO_UID);
|
||||
$delaycriteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
|
||||
$delaycriteria->addSelectColumn(AppDelayPeer::APP_DISABLE_ACTION_DATE);
|
||||
$delaycriteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER);
|
||||
$delaycriteria->addSelectColumn(AppCacheViewPeer::USR_UID);
|
||||
$delaycriteria->addSelectColumn(AppCacheViewPeer::APP_STATUS);
|
||||
$delaycriteria->addSelectColumn(AppCacheViewPeer::TAS_UID);
|
||||
$delaycriteria->addSelectColumn(AppCacheViewPeer::DEL_DELEGATE_DATE);
|
||||
|
||||
$delaycriteria->addJoin( AppCacheViewPeer::APP_UID, AppDelayPeer::APP_UID . ' AND ' . AppCacheViewPeer::DEL_INDEX . ' = ' . AppDelayPeer::APP_DEL_INDEX, Criteria::INNER_JOIN );
|
||||
$delaycriteria->add(AppDelayPeer::APP_DISABLE_ACTION_USER, "0", CRITERIA::EQUAL);
|
||||
$delaycriteria->add(AppDelayPeer::APP_TYPE, "PAUSE", CRITERIA::EQUAL);
|
||||
$rsCriteria = AppDelayPeer::doSelectRS($delaycriteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$data = $row;
|
||||
$data["DEL_INDEX"] = $row["APP_DEL_INDEX"];
|
||||
$data["APP_RESTART_DATE"] = $row["APP_DISABLE_ACTION_DATE"];
|
||||
$listPaused = new ListPaused();
|
||||
$listPaused ->remove($row["APP_UID"],$row["APP_DEL_INDEX"],$data);
|
||||
$listPaused->setDeleted(false);
|
||||
$listPaused->create($data);
|
||||
}
|
||||
$this->initPropel(true);
|
||||
$query = 'INSERT INTO '.$this->dbName.'.LIST_PAUSED
|
||||
(
|
||||
APP_UID,
|
||||
DEL_INDEX,
|
||||
USR_UID,
|
||||
TAS_UID,
|
||||
PRO_UID,
|
||||
APP_NUMBER,
|
||||
APP_TITLE,
|
||||
APP_PRO_TITLE,
|
||||
APP_TAS_TITLE,
|
||||
APP_PAUSED_DATE,
|
||||
APP_RESTART_DATE,
|
||||
DEL_PREVIOUS_USR_UID,
|
||||
DEL_PREVIOUS_USR_USERNAME,
|
||||
DEL_PREVIOUS_USR_FIRSTNAME,
|
||||
DEL_PREVIOUS_USR_LASTNAME,
|
||||
DEL_CURRENT_USR_USERNAME,
|
||||
DEL_CURRENT_USR_FIRSTNAME,
|
||||
DEL_CURRENT_USR_LASTNAME,
|
||||
DEL_DELEGATE_DATE,
|
||||
DEL_INIT_DATE,
|
||||
DEL_DUE_DATE,
|
||||
DEL_PRIORITY,
|
||||
PRO_ID,
|
||||
USR_ID,
|
||||
TAS_ID
|
||||
)
|
||||
SELECT
|
||||
AD1.APP_UID,
|
||||
AD1.DEL_INDEX,
|
||||
AD1.USR_UID,
|
||||
AD1.TAS_UID,
|
||||
AD1.PRO_UID,
|
||||
AD1.APP_NUMBER,
|
||||
APPLICATION.APP_TITLE,
|
||||
PROCESS.PRO_TITLE,
|
||||
TASK.TAS_TITLE,
|
||||
APP_DELAY.APP_ENABLE_ACTION_DATE AS APP_PAUSED_DATE ,
|
||||
APP_DELAY.APP_DISABLE_ACTION_DATE AS APP_RESTART_DATE,
|
||||
AD2.USR_UID AS DEL_PREVIOUS_USR_UID,
|
||||
PREVIOUS.USR_USERNAME AS DEL_PREVIOUS_USR_USERNAME,
|
||||
PREVIOUS.USR_FIRSTNAME AS DEL_CURRENT_USR_FIRSTNAME,
|
||||
PREVIOUS.USR_LASTNAME AS DEL_PREVIOUS_USR_LASTNAME,
|
||||
USERS.USR_USERNAME AS DEL_CURRENT_USR_USERNAME,
|
||||
USERS.USR_FIRSTNAME AS DEL_CURRENT_USR_FIRSTNAME,
|
||||
USERS.USR_LASTNAME AS DEL_CURRENT_USR_LASTNAME,
|
||||
AD1.DEL_DELEGATE_DATE AS DEL_DELEGATE_DATE,
|
||||
AD1.DEL_INIT_DATE AS DEL_INIT_DATE,
|
||||
AD1.DEL_TASK_DUE_DATE AS DEL_DUE_DATE,
|
||||
AD1.DEL_PRIORITY AS DEL_PRIORITY,
|
||||
PROCESS.PRO_ID,
|
||||
USERS.USR_ID,
|
||||
TASK.TAS_ID
|
||||
FROM
|
||||
'.$this->dbName.'.APP_DELAY
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.APP_DELEGATION AS AD1 ON (APP_DELAY.APP_NUMBER = AD1.APP_NUMBER AND AD1.DEL_INDEX = APP_DELAY.APP_DEL_INDEX)
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.APP_DELEGATION AS AD2 ON (AD1.APP_NUMBER = AD2.APP_NUMBER AND AD1.DEL_PREVIOUS = AD2.DEL_INDEX)
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.USERS ON (APP_DELAY.APP_DELEGATION_USER_ID = USERS.USR_ID)
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.USERS PREVIOUS ON (AD2.USR_ID = PREVIOUS.USR_ID)
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.APPLICATION ON (AD1.APP_NUMBER = APPLICATION.APP_NUMBER)
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.PROCESS ON (AD1.PRO_ID = PROCESS.PRO_ID)
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.TASK ON (AD1.TAS_ID = TASK.TAS_ID)
|
||||
WHERE
|
||||
APP_DELAY.APP_DISABLE_ACTION_USER = "0" AND
|
||||
APP_DELAY.APP_TYPE = "PAUSE"
|
||||
';
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
$stmt->executeQuery($query);
|
||||
CLI::logging("> Completed table LIST_PAUSED\n");
|
||||
}
|
||||
|
||||
@@ -3559,7 +3616,7 @@ class workspaceTools
|
||||
CLI::logging("-> Migrating Self-Service by Value Cases \n");
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$temp = unserialize($row['GRP_UID']);
|
||||
$temp = @unserialize($row['GRP_UID']);
|
||||
if (is_array($temp)) {
|
||||
foreach($temp as $groupUid) {
|
||||
if ($groupUid != '') {
|
||||
@@ -3668,6 +3725,48 @@ class workspaceTools
|
||||
APP_STATUS_ID = 0");
|
||||
$con->commit();
|
||||
|
||||
// Populating APP_DELAY.USR_ID
|
||||
CLI::logging("-> Populating APP_DELAY.USR_ID \n");
|
||||
$con->begin();
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery("UPDATE APP_DELAY AS AD
|
||||
INNER JOIN (
|
||||
SELECT USERS.USR_UID, USERS.USR_ID
|
||||
FROM USERS
|
||||
) AS USR
|
||||
ON (AD.APP_DELEGATION_USER = USR.USR_UID)
|
||||
SET AD.APP_DELEGATION_USER_ID = USR.USR_ID
|
||||
WHERE AD.APP_DELEGATION_USER_ID = 0");
|
||||
$con->commit();
|
||||
|
||||
// Populating APP_DELAY.PRO_ID
|
||||
CLI::logging("-> Populating APP_DELAY.PRO_ID \n");
|
||||
$con->begin();
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery("UPDATE APP_DELAY AS AD
|
||||
INNER JOIN (
|
||||
SELECT PROCESS.PRO_UID, PROCESS.PRO_ID
|
||||
FROM PROCESS
|
||||
) AS PRO
|
||||
ON (AD.PRO_UID = PRO.PRO_UID)
|
||||
SET AD.PRO_ID = PRO.PRO_ID
|
||||
WHERE AD.PRO_ID = 0");
|
||||
$con->commit();
|
||||
|
||||
// Populating APP_DELAY.APP_NUMBER
|
||||
CLI::logging("-> Populating APP_DELAY.APP_NUMBER \n");
|
||||
$con->begin();
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery("UPDATE APP_DELAY AS AD
|
||||
INNER JOIN (
|
||||
SELECT APPLICATION.APP_UID, APPLICATION.APP_NUMBER
|
||||
FROM APPLICATION
|
||||
) AS APP
|
||||
ON (AD.APP_UID = APP.APP_UID)
|
||||
SET AD.APP_NUMBER = APP.APP_NUMBER
|
||||
WHERE AD.APP_NUMBER = 0");
|
||||
$con->commit();
|
||||
|
||||
CLI::logging("-> Migrating And Populating Indexing for avoiding the use of table APP_CACHE_VIEW Done \n");
|
||||
|
||||
// Populating PRO_ID, USR_ID
|
||||
|
||||
@@ -382,8 +382,11 @@ function getDynaformsVars ($sProcessUID, $typeVars = 'all', $bIncMulSelFields =
|
||||
foreach ($aAux as $sName => $sValue) {
|
||||
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
|
||||
}
|
||||
//we're adding the ping variable to the system list
|
||||
//we're adding the pin variable to the system list
|
||||
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
|
||||
|
||||
//we're adding the app_number variable to the system list
|
||||
$aFields[] = array('sName' => 'APP_NUMBER', 'sType' => 'system', 'sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
|
||||
}
|
||||
|
||||
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript", "pmconnection");
|
||||
|
||||
@@ -167,12 +167,14 @@ class AppNotes extends BaseAppNotes
|
||||
$oCase = new Cases();
|
||||
$aFields = $oCase->loadCase( $appUid );
|
||||
$configNoteNotification['subject'] = G::LoadTranslation( 'ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION' ) . " @#APP_TITLE ";
|
||||
$configNoteNotification['body'] = G::LoadTranslation( 'ID_CASE' ) . ": @#APP_TITLE<br />" . G::LoadTranslation( 'ID_AUTHOR' ) . ": $authorName<br /><br />$noteContent";
|
||||
//Define the body for the notification
|
||||
$body = G::LoadTranslation('ID_CASE_TITLE') . ": @#APP_TITLE<br />";
|
||||
$body .= G::LoadTranslation('ID_CASE_NUMBER') . ": @#APP_NUMBER<br />";
|
||||
$body .= G::LoadTranslation('ID_AUTHOR') . ": $authorName<br /><br />$noteContent";
|
||||
$configNoteNotification['body'] = $body;
|
||||
|
||||
$sFrom = G::buildFrom($aConfiguration, $sFrom);
|
||||
|
||||
$sSubject = G::replaceDataField( $configNoteNotification['subject'], $aFields );
|
||||
|
||||
$sBody = nl2br( G::replaceDataField( $configNoteNotification['body'], $aFields ) );
|
||||
|
||||
G::LoadClass( 'spool' );
|
||||
|
||||
@@ -549,9 +549,17 @@ class ListInbox extends BaseListInbox
|
||||
$criteria->addJoin(ListInboxPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ?
|
||||
ListInboxPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||
"LIST_INBOX.APP_UPDATE_DATE";
|
||||
//We will be defined the sort
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$sort = $casesList->getSortColumn(
|
||||
__CLASS__ . 'Peer',
|
||||
BasePeer::TYPE_FIELDNAME,
|
||||
empty($filters['sort']) ? "APP_UPDATE_DATE" : $filters['sort'],
|
||||
"APP_UPDATE_DATE",
|
||||
$this->additionalClassName,
|
||||
$additionalColumns
|
||||
);
|
||||
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||
$start = isset($filters['start']) ? $filters['start'] : "0";
|
||||
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
|
||||
@@ -624,7 +632,6 @@ class ListInbox extends BaseListInbox
|
||||
* Returns the number of cases of a user
|
||||
* @param string $usrUid
|
||||
* @param array $filters
|
||||
* @param string $status
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
|
||||
@@ -364,9 +364,17 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ?
|
||||
ListParticipatedLastPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||
'DEL_DELEGATE_DATE';
|
||||
//We will be defined the sort
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$sort = $casesList->getSortColumn(
|
||||
__CLASS__ . 'Peer',
|
||||
BasePeer::TYPE_FIELDNAME,
|
||||
empty($filters['sort']) ? "DEL_DELEGATE_DATE" : $filters['sort'],
|
||||
"DEL_DELEGATE_DATE",
|
||||
$this->additionalClassName,
|
||||
$additionalColumns
|
||||
);
|
||||
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : 'ASC';
|
||||
$start = isset($filters['start']) ? $filters['start'] : '0';
|
||||
$limit = isset($filters['limit']) ? $filters['limit'] : '25';
|
||||
|
||||
@@ -307,7 +307,17 @@ class ListPaused extends BaseListPaused
|
||||
$criteria->add(ListPausedPeer::USR_UID, $usr_uid, Criteria::EQUAL);
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ? ListPausedPeer::TABLE_NAME.'.'.$filters['sort'] : "APP_PAUSED_DATE";
|
||||
//We will be defined the sort
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$sort = $casesList->getSortColumn(
|
||||
__CLASS__ . 'Peer',
|
||||
BasePeer::TYPE_FIELDNAME,
|
||||
empty($filters['sort']) ? "APP_PAUSED_DATE" : $filters['sort'],
|
||||
"APP_PAUSED_DATE",
|
||||
$this->additionalClassName,
|
||||
$additionalColumns
|
||||
);
|
||||
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||
$start = isset($filters['start']) ? $filters['start'] : "0";
|
||||
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
|
||||
|
||||
@@ -301,9 +301,18 @@ class ListUnassigned extends BaseListUnassigned
|
||||
|
||||
//Apply some filters
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
$sort = (!empty($filters['sort'])) ?
|
||||
ListUnassignedPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||
"LIST_UNASSIGNED.DEL_DELEGATE_DATE";
|
||||
|
||||
//We will be defined the sort
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$sort = $casesList->getSortColumn(
|
||||
__CLASS__ . 'Peer',
|
||||
BasePeer::TYPE_FIELDNAME,
|
||||
empty($filters['sort']) ? "DEL_DELEGATE_DATE" : $filters['sort'],
|
||||
"DEL_DELEGATE_DATE",
|
||||
$this->additionalClassName,
|
||||
$additionalColumns
|
||||
);
|
||||
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||
$start = isset($filters['start']) ? $filters['start'] : "0";
|
||||
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
|
||||
|
||||
@@ -322,6 +322,7 @@ class ObjectPermission extends BaseObjectPermission
|
||||
public function objectPermissionByDynaform ($appUid, $opTaskSource = 0, $opObjUid = '', $statusCase = '')
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn("*");
|
||||
$oCriteria->addJoin(ApplicationPeer::PRO_UID, StepPeer::PRO_UID);
|
||||
$oCriteria->addJoin(StepPeer::STEP_UID_OBJ, DynaformPeer::DYN_UID);
|
||||
$oCriteria->add(ApplicationPeer::APP_UID, $appUid);
|
||||
@@ -334,7 +335,6 @@ class ObjectPermission extends BaseObjectPermission
|
||||
if ($opObjUid != '' && $opObjUid != '0') {
|
||||
$oCriteria->add(DynaformPeer::DYN_UID, $opObjUid);
|
||||
}
|
||||
|
||||
$oCriteria->addAscendingOrderByColumn(StepPeer::STEP_POSITION);
|
||||
$oCriteria->setDistinct();
|
||||
|
||||
|
||||
@@ -71,6 +71,8 @@ class AppDelayMapBuilder
|
||||
|
||||
$tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('APP_THREAD_INDEX', 'AppThreadIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('APP_DEL_INDEX', 'AppDelIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||
@@ -93,6 +95,10 @@ class AppDelayMapBuilder
|
||||
|
||||
$tMap->addColumn('APP_AUTOMATIC_DISABLED_DATE', 'AppAutomaticDisabledDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('APP_DELEGATION_USER_ID', 'AppDelegationUserId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // AppDelayMapBuilder
|
||||
|
||||
@@ -45,6 +45,12 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $app_uid = '0';
|
||||
|
||||
/**
|
||||
* The value for the app_number field.
|
||||
* @var int
|
||||
*/
|
||||
protected $app_number = 0;
|
||||
|
||||
/**
|
||||
* The value for the app_thread_index field.
|
||||
* @var int
|
||||
@@ -111,6 +117,18 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $app_automatic_disabled_date;
|
||||
|
||||
/**
|
||||
* The value for the app_delegation_user_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $app_delegation_user_id = 0;
|
||||
|
||||
/**
|
||||
* The value for the pro_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $pro_id = 0;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -158,6 +176,17 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
return $this->app_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [app_number] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAppNumber()
|
||||
{
|
||||
|
||||
return $this->app_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [app_thread_index] column value.
|
||||
*
|
||||
@@ -342,6 +371,28 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [app_delegation_user_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAppDelegationUserId()
|
||||
{
|
||||
|
||||
return $this->app_delegation_user_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [pro_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getProId()
|
||||
{
|
||||
|
||||
return $this->pro_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [app_delay_uid] column.
|
||||
*
|
||||
@@ -408,6 +459,28 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
|
||||
} // setAppUid()
|
||||
|
||||
/**
|
||||
* Set the value of [app_number] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setAppNumber($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
// we will cast the input value to an int (if it is not).
|
||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->app_number !== $v || $v === 0) {
|
||||
$this->app_number = $v;
|
||||
$this->modifiedColumns[] = AppDelayPeer::APP_NUMBER;
|
||||
}
|
||||
|
||||
} // setAppNumber()
|
||||
|
||||
/**
|
||||
* Set the value of [app_thread_index] column.
|
||||
*
|
||||
@@ -671,6 +744,50 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
|
||||
} // setAppAutomaticDisabledDate()
|
||||
|
||||
/**
|
||||
* Set the value of [app_delegation_user_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setAppDelegationUserId($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
// we will cast the input value to an int (if it is not).
|
||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->app_delegation_user_id !== $v || $v === 0) {
|
||||
$this->app_delegation_user_id = $v;
|
||||
$this->modifiedColumns[] = AppDelayPeer::APP_DELEGATION_USER_ID;
|
||||
}
|
||||
|
||||
} // setAppDelegationUserId()
|
||||
|
||||
/**
|
||||
* Set the value of [pro_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setProId($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
// we will cast the input value to an int (if it is not).
|
||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->pro_id !== $v || $v === 0) {
|
||||
$this->pro_id = $v;
|
||||
$this->modifiedColumns[] = AppDelayPeer::PRO_ID;
|
||||
}
|
||||
|
||||
} // setProId()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
@@ -694,34 +811,40 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
|
||||
$this->app_uid = $rs->getString($startcol + 2);
|
||||
|
||||
$this->app_thread_index = $rs->getInt($startcol + 3);
|
||||
$this->app_number = $rs->getInt($startcol + 3);
|
||||
|
||||
$this->app_del_index = $rs->getInt($startcol + 4);
|
||||
$this->app_thread_index = $rs->getInt($startcol + 4);
|
||||
|
||||
$this->app_type = $rs->getString($startcol + 5);
|
||||
$this->app_del_index = $rs->getInt($startcol + 5);
|
||||
|
||||
$this->app_status = $rs->getString($startcol + 6);
|
||||
$this->app_type = $rs->getString($startcol + 6);
|
||||
|
||||
$this->app_next_task = $rs->getString($startcol + 7);
|
||||
$this->app_status = $rs->getString($startcol + 7);
|
||||
|
||||
$this->app_delegation_user = $rs->getString($startcol + 8);
|
||||
$this->app_next_task = $rs->getString($startcol + 8);
|
||||
|
||||
$this->app_enable_action_user = $rs->getString($startcol + 9);
|
||||
$this->app_delegation_user = $rs->getString($startcol + 9);
|
||||
|
||||
$this->app_enable_action_date = $rs->getTimestamp($startcol + 10, null);
|
||||
$this->app_enable_action_user = $rs->getString($startcol + 10);
|
||||
|
||||
$this->app_disable_action_user = $rs->getString($startcol + 11);
|
||||
$this->app_enable_action_date = $rs->getTimestamp($startcol + 11, null);
|
||||
|
||||
$this->app_disable_action_date = $rs->getTimestamp($startcol + 12, null);
|
||||
$this->app_disable_action_user = $rs->getString($startcol + 12);
|
||||
|
||||
$this->app_automatic_disabled_date = $rs->getTimestamp($startcol + 13, null);
|
||||
$this->app_disable_action_date = $rs->getTimestamp($startcol + 13, null);
|
||||
|
||||
$this->app_automatic_disabled_date = $rs->getTimestamp($startcol + 14, null);
|
||||
|
||||
$this->app_delegation_user_id = $rs->getInt($startcol + 15);
|
||||
|
||||
$this->pro_id = $rs->getInt($startcol + 16);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 14; // 14 = AppDelayPeer::NUM_COLUMNS - AppDelayPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 17; // 17 = AppDelayPeer::NUM_COLUMNS - AppDelayPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating AppDelay object", $e);
|
||||
@@ -935,38 +1058,47 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
return $this->getAppUid();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getAppThreadIndex();
|
||||
return $this->getAppNumber();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getAppDelIndex();
|
||||
return $this->getAppThreadIndex();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getAppType();
|
||||
return $this->getAppDelIndex();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getAppStatus();
|
||||
return $this->getAppType();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getAppNextTask();
|
||||
return $this->getAppStatus();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getAppDelegationUser();
|
||||
return $this->getAppNextTask();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getAppEnableActionUser();
|
||||
return $this->getAppDelegationUser();
|
||||
break;
|
||||
case 10:
|
||||
return $this->getAppEnableActionDate();
|
||||
return $this->getAppEnableActionUser();
|
||||
break;
|
||||
case 11:
|
||||
return $this->getAppDisableActionUser();
|
||||
return $this->getAppEnableActionDate();
|
||||
break;
|
||||
case 12:
|
||||
return $this->getAppDisableActionDate();
|
||||
return $this->getAppDisableActionUser();
|
||||
break;
|
||||
case 13:
|
||||
return $this->getAppDisableActionDate();
|
||||
break;
|
||||
case 14:
|
||||
return $this->getAppAutomaticDisabledDate();
|
||||
break;
|
||||
case 15:
|
||||
return $this->getAppDelegationUserId();
|
||||
break;
|
||||
case 16:
|
||||
return $this->getProId();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -990,17 +1122,20 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
$keys[0] => $this->getAppDelayUid(),
|
||||
$keys[1] => $this->getProUid(),
|
||||
$keys[2] => $this->getAppUid(),
|
||||
$keys[3] => $this->getAppThreadIndex(),
|
||||
$keys[4] => $this->getAppDelIndex(),
|
||||
$keys[5] => $this->getAppType(),
|
||||
$keys[6] => $this->getAppStatus(),
|
||||
$keys[7] => $this->getAppNextTask(),
|
||||
$keys[8] => $this->getAppDelegationUser(),
|
||||
$keys[9] => $this->getAppEnableActionUser(),
|
||||
$keys[10] => $this->getAppEnableActionDate(),
|
||||
$keys[11] => $this->getAppDisableActionUser(),
|
||||
$keys[12] => $this->getAppDisableActionDate(),
|
||||
$keys[13] => $this->getAppAutomaticDisabledDate(),
|
||||
$keys[3] => $this->getAppNumber(),
|
||||
$keys[4] => $this->getAppThreadIndex(),
|
||||
$keys[5] => $this->getAppDelIndex(),
|
||||
$keys[6] => $this->getAppType(),
|
||||
$keys[7] => $this->getAppStatus(),
|
||||
$keys[8] => $this->getAppNextTask(),
|
||||
$keys[9] => $this->getAppDelegationUser(),
|
||||
$keys[10] => $this->getAppEnableActionUser(),
|
||||
$keys[11] => $this->getAppEnableActionDate(),
|
||||
$keys[12] => $this->getAppDisableActionUser(),
|
||||
$keys[13] => $this->getAppDisableActionDate(),
|
||||
$keys[14] => $this->getAppAutomaticDisabledDate(),
|
||||
$keys[15] => $this->getAppDelegationUserId(),
|
||||
$keys[16] => $this->getProId(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -1042,38 +1177,47 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
$this->setAppUid($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setAppThreadIndex($value);
|
||||
$this->setAppNumber($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setAppDelIndex($value);
|
||||
$this->setAppThreadIndex($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setAppType($value);
|
||||
$this->setAppDelIndex($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setAppStatus($value);
|
||||
$this->setAppType($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setAppNextTask($value);
|
||||
$this->setAppStatus($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setAppDelegationUser($value);
|
||||
$this->setAppNextTask($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setAppEnableActionUser($value);
|
||||
$this->setAppDelegationUser($value);
|
||||
break;
|
||||
case 10:
|
||||
$this->setAppEnableActionDate($value);
|
||||
$this->setAppEnableActionUser($value);
|
||||
break;
|
||||
case 11:
|
||||
$this->setAppDisableActionUser($value);
|
||||
$this->setAppEnableActionDate($value);
|
||||
break;
|
||||
case 12:
|
||||
$this->setAppDisableActionDate($value);
|
||||
$this->setAppDisableActionUser($value);
|
||||
break;
|
||||
case 13:
|
||||
$this->setAppDisableActionDate($value);
|
||||
break;
|
||||
case 14:
|
||||
$this->setAppAutomaticDisabledDate($value);
|
||||
break;
|
||||
case 15:
|
||||
$this->setAppDelegationUserId($value);
|
||||
break;
|
||||
case 16:
|
||||
$this->setProId($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -1110,47 +1254,59 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[3], $arr)) {
|
||||
$this->setAppThreadIndex($arr[$keys[3]]);
|
||||
$this->setAppNumber($arr[$keys[3]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[4], $arr)) {
|
||||
$this->setAppDelIndex($arr[$keys[4]]);
|
||||
$this->setAppThreadIndex($arr[$keys[4]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[5], $arr)) {
|
||||
$this->setAppType($arr[$keys[5]]);
|
||||
$this->setAppDelIndex($arr[$keys[5]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[6], $arr)) {
|
||||
$this->setAppStatus($arr[$keys[6]]);
|
||||
$this->setAppType($arr[$keys[6]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[7], $arr)) {
|
||||
$this->setAppNextTask($arr[$keys[7]]);
|
||||
$this->setAppStatus($arr[$keys[7]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[8], $arr)) {
|
||||
$this->setAppDelegationUser($arr[$keys[8]]);
|
||||
$this->setAppNextTask($arr[$keys[8]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[9], $arr)) {
|
||||
$this->setAppEnableActionUser($arr[$keys[9]]);
|
||||
$this->setAppDelegationUser($arr[$keys[9]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[10], $arr)) {
|
||||
$this->setAppEnableActionDate($arr[$keys[10]]);
|
||||
$this->setAppEnableActionUser($arr[$keys[10]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[11], $arr)) {
|
||||
$this->setAppDisableActionUser($arr[$keys[11]]);
|
||||
$this->setAppEnableActionDate($arr[$keys[11]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[12], $arr)) {
|
||||
$this->setAppDisableActionDate($arr[$keys[12]]);
|
||||
$this->setAppDisableActionUser($arr[$keys[12]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[13], $arr)) {
|
||||
$this->setAppAutomaticDisabledDate($arr[$keys[13]]);
|
||||
$this->setAppDisableActionDate($arr[$keys[13]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[14], $arr)) {
|
||||
$this->setAppAutomaticDisabledDate($arr[$keys[14]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[15], $arr)) {
|
||||
$this->setAppDelegationUserId($arr[$keys[15]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[16], $arr)) {
|
||||
$this->setProId($arr[$keys[16]]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1176,6 +1332,10 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
$criteria->add(AppDelayPeer::APP_UID, $this->app_uid);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(AppDelayPeer::APP_NUMBER)) {
|
||||
$criteria->add(AppDelayPeer::APP_NUMBER, $this->app_number);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(AppDelayPeer::APP_THREAD_INDEX)) {
|
||||
$criteria->add(AppDelayPeer::APP_THREAD_INDEX, $this->app_thread_index);
|
||||
}
|
||||
@@ -1220,6 +1380,14 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
$criteria->add(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, $this->app_automatic_disabled_date);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(AppDelayPeer::APP_DELEGATION_USER_ID)) {
|
||||
$criteria->add(AppDelayPeer::APP_DELEGATION_USER_ID, $this->app_delegation_user_id);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(AppDelayPeer::PRO_ID)) {
|
||||
$criteria->add(AppDelayPeer::PRO_ID, $this->pro_id);
|
||||
}
|
||||
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1278,6 +1446,8 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setAppUid($this->app_uid);
|
||||
|
||||
$copyObj->setAppNumber($this->app_number);
|
||||
|
||||
$copyObj->setAppThreadIndex($this->app_thread_index);
|
||||
|
||||
$copyObj->setAppDelIndex($this->app_del_index);
|
||||
@@ -1300,6 +1470,10 @@ abstract class BaseAppDelay extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setAppAutomaticDisabledDate($this->app_automatic_disabled_date);
|
||||
|
||||
$copyObj->setAppDelegationUserId($this->app_delegation_user_id);
|
||||
|
||||
$copyObj->setProId($this->pro_id);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ abstract class BaseAppDelayPeer
|
||||
const CLASS_DEFAULT = 'classes.model.AppDelay';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 14;
|
||||
const NUM_COLUMNS = 17;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
@@ -40,6 +40,9 @@ abstract class BaseAppDelayPeer
|
||||
/** the column name for the APP_UID field */
|
||||
const APP_UID = 'APP_DELAY.APP_UID';
|
||||
|
||||
/** the column name for the APP_NUMBER field */
|
||||
const APP_NUMBER = 'APP_DELAY.APP_NUMBER';
|
||||
|
||||
/** the column name for the APP_THREAD_INDEX field */
|
||||
const APP_THREAD_INDEX = 'APP_DELAY.APP_THREAD_INDEX';
|
||||
|
||||
@@ -73,6 +76,12 @@ abstract class BaseAppDelayPeer
|
||||
/** the column name for the APP_AUTOMATIC_DISABLED_DATE field */
|
||||
const APP_AUTOMATIC_DISABLED_DATE = 'APP_DELAY.APP_AUTOMATIC_DISABLED_DATE';
|
||||
|
||||
/** the column name for the APP_DELEGATION_USER_ID field */
|
||||
const APP_DELEGATION_USER_ID = 'APP_DELAY.APP_DELEGATION_USER_ID';
|
||||
|
||||
/** the column name for the PRO_ID field */
|
||||
const PRO_ID = 'APP_DELAY.PRO_ID';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -84,10 +93,10 @@ abstract class BaseAppDelayPeer
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AppDelayUid', 'ProUid', 'AppUid', 'AppThreadIndex', 'AppDelIndex', 'AppType', 'AppStatus', 'AppNextTask', 'AppDelegationUser', 'AppEnableActionUser', 'AppEnableActionDate', 'AppDisableActionUser', 'AppDisableActionDate', 'AppAutomaticDisabledDate', ),
|
||||
BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID, AppDelayPeer::PRO_UID, AppDelayPeer::APP_UID, AppDelayPeer::APP_THREAD_INDEX, AppDelayPeer::APP_DEL_INDEX, AppDelayPeer::APP_TYPE, AppDelayPeer::APP_STATUS, AppDelayPeer::APP_NEXT_TASK, AppDelayPeer::APP_DELEGATION_USER, AppDelayPeer::APP_ENABLE_ACTION_USER, AppDelayPeer::APP_ENABLE_ACTION_DATE, AppDelayPeer::APP_DISABLE_ACTION_USER, AppDelayPeer::APP_DISABLE_ACTION_DATE, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID', 'PRO_UID', 'APP_UID', 'APP_THREAD_INDEX', 'APP_DEL_INDEX', 'APP_TYPE', 'APP_STATUS', 'APP_NEXT_TASK', 'APP_DELEGATION_USER', 'APP_ENABLE_ACTION_USER', 'APP_ENABLE_ACTION_DATE', 'APP_DISABLE_ACTION_USER', 'APP_DISABLE_ACTION_DATE', 'APP_AUTOMATIC_DISABLED_DATE', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
|
||||
BasePeer::TYPE_PHPNAME => array ('AppDelayUid', 'ProUid', 'AppUid', 'AppNumber', 'AppThreadIndex', 'AppDelIndex', 'AppType', 'AppStatus', 'AppNextTask', 'AppDelegationUser', 'AppEnableActionUser', 'AppEnableActionDate', 'AppDisableActionUser', 'AppDisableActionDate', 'AppAutomaticDisabledDate', 'AppDelegationUserId', 'ProId', ),
|
||||
BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID, AppDelayPeer::PRO_UID, AppDelayPeer::APP_UID, AppDelayPeer::APP_NUMBER, AppDelayPeer::APP_THREAD_INDEX, AppDelayPeer::APP_DEL_INDEX, AppDelayPeer::APP_TYPE, AppDelayPeer::APP_STATUS, AppDelayPeer::APP_NEXT_TASK, AppDelayPeer::APP_DELEGATION_USER, AppDelayPeer::APP_ENABLE_ACTION_USER, AppDelayPeer::APP_ENABLE_ACTION_DATE, AppDelayPeer::APP_DISABLE_ACTION_USER, AppDelayPeer::APP_DISABLE_ACTION_DATE, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, AppDelayPeer::APP_DELEGATION_USER_ID, AppDelayPeer::PRO_ID, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID', 'PRO_UID', 'APP_UID', 'APP_NUMBER', 'APP_THREAD_INDEX', 'APP_DEL_INDEX', 'APP_TYPE', 'APP_STATUS', 'APP_NEXT_TASK', 'APP_DELEGATION_USER', 'APP_ENABLE_ACTION_USER', 'APP_ENABLE_ACTION_DATE', 'APP_DISABLE_ACTION_USER', 'APP_DISABLE_ACTION_DATE', 'APP_AUTOMATIC_DISABLED_DATE', 'APP_DELEGATION_USER_ID', 'PRO_ID', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -97,10 +106,10 @@ abstract class BaseAppDelayPeer
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AppDelayUid' => 0, 'ProUid' => 1, 'AppUid' => 2, 'AppThreadIndex' => 3, 'AppDelIndex' => 4, 'AppType' => 5, 'AppStatus' => 6, 'AppNextTask' => 7, 'AppDelegationUser' => 8, 'AppEnableActionUser' => 9, 'AppEnableActionDate' => 10, 'AppDisableActionUser' => 11, 'AppDisableActionDate' => 12, 'AppAutomaticDisabledDate' => 13, ),
|
||||
BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID => 0, AppDelayPeer::PRO_UID => 1, AppDelayPeer::APP_UID => 2, AppDelayPeer::APP_THREAD_INDEX => 3, AppDelayPeer::APP_DEL_INDEX => 4, AppDelayPeer::APP_TYPE => 5, AppDelayPeer::APP_STATUS => 6, AppDelayPeer::APP_NEXT_TASK => 7, AppDelayPeer::APP_DELEGATION_USER => 8, AppDelayPeer::APP_ENABLE_ACTION_USER => 9, AppDelayPeer::APP_ENABLE_ACTION_DATE => 10, AppDelayPeer::APP_DISABLE_ACTION_USER => 11, AppDelayPeer::APP_DISABLE_ACTION_DATE => 12, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE => 13, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID' => 0, 'PRO_UID' => 1, 'APP_UID' => 2, 'APP_THREAD_INDEX' => 3, 'APP_DEL_INDEX' => 4, 'APP_TYPE' => 5, 'APP_STATUS' => 6, 'APP_NEXT_TASK' => 7, 'APP_DELEGATION_USER' => 8, 'APP_ENABLE_ACTION_USER' => 9, 'APP_ENABLE_ACTION_DATE' => 10, 'APP_DISABLE_ACTION_USER' => 11, 'APP_DISABLE_ACTION_DATE' => 12, 'APP_AUTOMATIC_DISABLED_DATE' => 13, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
|
||||
BasePeer::TYPE_PHPNAME => array ('AppDelayUid' => 0, 'ProUid' => 1, 'AppUid' => 2, 'AppNumber' => 3, 'AppThreadIndex' => 4, 'AppDelIndex' => 5, 'AppType' => 6, 'AppStatus' => 7, 'AppNextTask' => 8, 'AppDelegationUser' => 9, 'AppEnableActionUser' => 10, 'AppEnableActionDate' => 11, 'AppDisableActionUser' => 12, 'AppDisableActionDate' => 13, 'AppAutomaticDisabledDate' => 14, 'AppDelegationUserId' => 15, 'ProId' => 16, ),
|
||||
BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID => 0, AppDelayPeer::PRO_UID => 1, AppDelayPeer::APP_UID => 2, AppDelayPeer::APP_NUMBER => 3, AppDelayPeer::APP_THREAD_INDEX => 4, AppDelayPeer::APP_DEL_INDEX => 5, AppDelayPeer::APP_TYPE => 6, AppDelayPeer::APP_STATUS => 7, AppDelayPeer::APP_NEXT_TASK => 8, AppDelayPeer::APP_DELEGATION_USER => 9, AppDelayPeer::APP_ENABLE_ACTION_USER => 10, AppDelayPeer::APP_ENABLE_ACTION_DATE => 11, AppDelayPeer::APP_DISABLE_ACTION_USER => 12, AppDelayPeer::APP_DISABLE_ACTION_DATE => 13, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE => 14, AppDelayPeer::APP_DELEGATION_USER_ID => 15, AppDelayPeer::PRO_ID => 16, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID' => 0, 'PRO_UID' => 1, 'APP_UID' => 2, 'APP_NUMBER' => 3, 'APP_THREAD_INDEX' => 4, 'APP_DEL_INDEX' => 5, 'APP_TYPE' => 6, 'APP_STATUS' => 7, 'APP_NEXT_TASK' => 8, 'APP_DELEGATION_USER' => 9, 'APP_ENABLE_ACTION_USER' => 10, 'APP_ENABLE_ACTION_DATE' => 11, 'APP_DISABLE_ACTION_USER' => 12, 'APP_DISABLE_ACTION_DATE' => 13, 'APP_AUTOMATIC_DISABLED_DATE' => 14, 'APP_DELEGATION_USER_ID' => 15, 'PRO_ID' => 16, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -207,6 +216,8 @@ abstract class BaseAppDelayPeer
|
||||
|
||||
$criteria->addSelectColumn(AppDelayPeer::APP_UID);
|
||||
|
||||
$criteria->addSelectColumn(AppDelayPeer::APP_NUMBER);
|
||||
|
||||
$criteria->addSelectColumn(AppDelayPeer::APP_THREAD_INDEX);
|
||||
|
||||
$criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
|
||||
@@ -229,6 +240,10 @@ abstract class BaseAppDelayPeer
|
||||
|
||||
$criteria->addSelectColumn(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE);
|
||||
|
||||
$criteria->addSelectColumn(AppDelayPeer::APP_DELEGATION_USER_ID);
|
||||
|
||||
$criteria->addSelectColumn(AppDelayPeer::PRO_ID);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(APP_DELAY.APP_DELAY_UID)';
|
||||
|
||||
@@ -1689,6 +1689,7 @@
|
||||
<column name="APP_DELAY_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
||||
<column name="PRO_UID" type="VARCHAR" size="32" required="true" default="0"/>
|
||||
<column name="APP_UID" type="VARCHAR" size="32" required="true" default="0"/>
|
||||
<column name="APP_NUMBER" type="INTEGER" required="false" default="0"/>
|
||||
<column name="APP_THREAD_INDEX" type="INTEGER" required="true" default="0"/>
|
||||
<column name="APP_DEL_INDEX" type="INTEGER" required="true" default="0"/>
|
||||
<column name="APP_TYPE" type="VARCHAR" size="20" required="true" default="0"/>
|
||||
@@ -1700,6 +1701,17 @@
|
||||
<column name="APP_DISABLE_ACTION_USER" type="VARCHAR" size="32" default="0"/>
|
||||
<column name="APP_DISABLE_ACTION_DATE" type="TIMESTAMP"/>
|
||||
<column name="APP_AUTOMATIC_DISABLED_DATE" type="TIMESTAMP"/>
|
||||
<column name="APP_DELEGATION_USER_ID" type="INTEGER" required="false" default="0"/>
|
||||
<column name="PRO_ID" type="INTEGER" required="false" default="0"/>
|
||||
<index name="INDEX_APP_NUMBER">
|
||||
<index-column name="APP_NUMBER"/>
|
||||
</index>
|
||||
<index name="INDEX_USR_ID">
|
||||
<index-column name="APP_DELEGATION_USER_ID"/>
|
||||
</index>
|
||||
<index name="INDEX_PRO_ID">
|
||||
<index-column name="PRO_ID"/>
|
||||
</index>
|
||||
<index name="indexAppDelay">
|
||||
<index-column name="PRO_UID"/>
|
||||
<index-column name="APP_UID"/>
|
||||
|
||||
@@ -4585,6 +4585,31 @@ msgstr "The cache directory is empty"
|
||||
msgid "Case Id"
|
||||
msgstr "Case Id"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_ABE_FORM_ALREADY_FILLED
|
||||
#: LABEL/ID_ABE_FORM_ALREADY_FILLED
|
||||
msgid "The form has already been filled and sent."
|
||||
msgstr "The form has already been filled and sent."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_ABE_INFORMATION_SUBMITTED
|
||||
#: LABEL/ID_ABE_INFORMATION_SUBMITTED
|
||||
msgid "The information was submitted. Thank you."
|
||||
msgstr "The information was submitted. Thank you."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_ABE_ANSWER_SUBMITTED
|
||||
#: LABEL/ID_ABE_ANSWER_SUBMITTED
|
||||
msgid "The answer has been submitted. Thank you."
|
||||
msgstr "The answer has been submitted. Thank you."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_ABE_RESPONSE_SENT
|
||||
#: LABEL/ID_ABE_RESPONSE_SENT
|
||||
msgid "The response has already been sent."
|
||||
msgstr "The response has already been sent."
|
||||
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_CASESLIST_DEL_INDEX
|
||||
#: LABEL/ID_CASESLIST_DEL_INDEX
|
||||
|
||||
@@ -3,14 +3,13 @@
|
||||
/**
|
||||
* Home controller
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
* @inherits Controller
|
||||
* @access public
|
||||
*/
|
||||
|
||||
class Home extends Controller
|
||||
{
|
||||
private $userID;
|
||||
private $userUid;
|
||||
private $userName;
|
||||
private $userFullName;
|
||||
private $userRolName;
|
||||
@@ -24,9 +23,18 @@ class Home extends Controller
|
||||
private $lastSkin;
|
||||
private $usrId;
|
||||
|
||||
/**
|
||||
* Check the if the user has permissions over functions
|
||||
*/
|
||||
public function call ($name)
|
||||
{
|
||||
global $RBAC;
|
||||
$RBAC->allows(basename(__FILE__), $name);
|
||||
parent::call($name);
|
||||
}
|
||||
|
||||
public function __construct ()
|
||||
{
|
||||
//die($_SESSION['user_experience']);
|
||||
// setting client browser information
|
||||
$this->clientBrowser = G::getBrowser();
|
||||
|
||||
@@ -36,13 +44,13 @@ class Home extends Controller
|
||||
$this->userUxBaseTemplate = (is_dir( PATH_CUSTOM_SKINS . 'uxs' )) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'templates' : 'home';
|
||||
|
||||
if (isset( $_SESSION['USER_LOGGED'] ) && ! empty( $_SESSION['USER_LOGGED'] )) {
|
||||
$this->userID = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : null;
|
||||
$this->userUid = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : null;
|
||||
$this->userName = isset( $_SESSION['USR_USERNAME'] ) ? $_SESSION['USR_USERNAME'] : '';
|
||||
$this->userFullName = isset( $_SESSION['USR_FULLNAME'] ) ? $_SESSION['USR_FULLNAME'] : '';
|
||||
$this->userRolName = isset( $_SESSION['USR_ROLENAME'] ) ? $_SESSION['USR_ROLENAME'] : '';
|
||||
|
||||
|
||||
$users = new Users();
|
||||
$users = $users->load($this->userID);
|
||||
$users = $users->load($this->userUid);
|
||||
$this->usrId = $users["USR_ID"];
|
||||
}
|
||||
}
|
||||
@@ -59,7 +67,10 @@ class Home extends Controller
|
||||
$skin = $this->clientBrowser['name'] == 'msie' ? $this->lastSkin : 'simplified';
|
||||
|
||||
if (! is_array( $data )) {
|
||||
$data = array ('u' => '','p' => '','m' => ''
|
||||
$data = array (
|
||||
'u' => '',
|
||||
'p' => '',
|
||||
'm' => ''
|
||||
);
|
||||
}
|
||||
|
||||
@@ -158,7 +169,7 @@ class Home extends Controller
|
||||
|
||||
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'index' );
|
||||
|
||||
$this->setVar( 'usrUid', $this->userID );
|
||||
$this->setVar( 'usrUid', $this->userUid );
|
||||
$this->setVar( 'userName', $this->userName );
|
||||
$this->setVar( 'processList', $processesList );
|
||||
$this->setVar( 'canStartCase', $case->canStartCase( $_SESSION['USER_LOGGED'] ) );
|
||||
@@ -199,13 +210,13 @@ class Home extends Controller
|
||||
}
|
||||
|
||||
if ($solrEnabled) {
|
||||
$cases = $ApplicationSolrIndex->getAppGridData($this->userID, 0, 1, 'todo');
|
||||
$cases = $ApplicationSolrIndex->getAppGridData($this->userUid, 0, 1, 'todo');
|
||||
} else {
|
||||
G::LoadClass( 'applications' );
|
||||
|
||||
$apps = new Applications();
|
||||
|
||||
$cases = $apps->getAll( $this->userID, 0, 1, 'todo' );
|
||||
$cases = $apps->getAll( $this->userUid, 0, 1, 'todo' );
|
||||
}
|
||||
|
||||
if (! isset( $cases['data'][0] )) {
|
||||
@@ -229,7 +240,7 @@ class Home extends Controller
|
||||
|
||||
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'indexSingle' );
|
||||
|
||||
$this->setVar( 'usrUid', $this->userID );
|
||||
$this->setVar( 'usrUid', $this->userUid );
|
||||
$this->setVar( 'userName', $this->userName );
|
||||
$this->setVar( 'steps', $steps );
|
||||
$this->setVar( 'default_url', "cases/cases_Open?APP_UID={$lastApp['APP_UID']}&DEL_INDEX={$lastApp['DEL_INDEX']}&action=todo" );
|
||||
@@ -300,14 +311,27 @@ class Home extends Controller
|
||||
$userObject = Users::loadById($user);
|
||||
$userName = $userObject->getUsrLastname() . " " . $userObject->getUsrFirstname();
|
||||
}
|
||||
|
||||
$cases = $this->getAppsData( $httpData->t, null, null, $user, null, $search, $process, $status, $dateFrom, $dateTo, null, null, 'APP_CACHE_VIEW.APP_NUMBER', $category);
|
||||
|
||||
$cases = $this->getAppsData(
|
||||
$httpData->t,
|
||||
null,
|
||||
null,
|
||||
$user,
|
||||
null,
|
||||
$search,
|
||||
$process,
|
||||
$status,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
null,
|
||||
null,
|
||||
'APP_CACHE_VIEW.APP_NUMBER',
|
||||
$category
|
||||
);
|
||||
$arraySearch = array($process, $status, $search, $category, $user, $dateFrom, $dateTo );
|
||||
|
||||
// settings vars and rendering
|
||||
$processes = array();
|
||||
$processes = $this->getProcessArray($httpData->t, $this->userID );
|
||||
$this->setVar( 'statusValues', $this->getStatusArray( $httpData->t, $this->userID ) );
|
||||
$this->setVar( 'statusValues', $this->getStatusArray( $httpData->t, $this->userUid) );
|
||||
$this->setVar( 'categoryValues', $this->getCategoryArray() );
|
||||
$this->setVar( 'allUsersValues', $this->getAllUsersArray( 'search' ) );
|
||||
$this->setVar( 'categoryTitle', G::LoadTranslation("ID_CATEGORY") );
|
||||
@@ -377,10 +401,14 @@ class Home extends Controller
|
||||
$user = null;
|
||||
break;
|
||||
case null:
|
||||
$user = $this->usrId;
|
||||
if ($type === 'search') {
|
||||
$user = null;
|
||||
} else {
|
||||
$user = $this->usrId;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//$user = $this->userID;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -429,6 +457,7 @@ class Home extends Controller
|
||||
);
|
||||
} else {
|
||||
$dataList['userId'] = $user;
|
||||
$dataList['userUid'] = $this->userUid;
|
||||
$dataList['start'] = $start;
|
||||
$dataList['limit'] = $limit;
|
||||
$dataList['filter'] = $filter;
|
||||
@@ -442,17 +471,34 @@ class Home extends Controller
|
||||
$dataList['sort'] = $sort;
|
||||
$dataList['category'] = $category;
|
||||
$dataList['action'] = $type;
|
||||
$dataList['dir'] = 'DESC';
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (true) {
|
||||
//In enterprise version this block of code should always be executed
|
||||
//In community version this block of code is deleted and is executed the other
|
||||
$swType = $type === "todo" || $type === "draft";
|
||||
if ($swType || $type === "unassigned") {
|
||||
//The change is made because the method 'getList()' does not
|
||||
$listType = '';
|
||||
if (!empty($type)) {
|
||||
switch ($type) {
|
||||
case 'todo':
|
||||
$listType = 'inbox';
|
||||
break;
|
||||
case 'draft':
|
||||
$listType = 'inbox';
|
||||
break;
|
||||
case 'unassigned':
|
||||
$listType = 'unassigned';
|
||||
break;
|
||||
case 'search':
|
||||
$dataList['filterStatus'] = $status;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($listType)) {
|
||||
//The change is made because the method 'getList()' does not
|
||||
//support 'USR_UID', this method uses the numeric field 'USR_ID'.
|
||||
$userObject = Users::loadById($dataList['userId']);
|
||||
$dataList['userId'] = $userObject->getUsrUid();
|
||||
$listType = $swType ? "inbox" : $type;
|
||||
$list = new \ProcessMaker\BusinessModel\Lists();
|
||||
$cases = $list->getList($listType, $dataList);
|
||||
}
|
||||
@@ -471,7 +517,7 @@ class Home extends Controller
|
||||
|
||||
if(empty($cases) && $type == 'search') {
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
$cases = $case->getList($dataList);
|
||||
$cases = $case->getCasesSearch($dataList);
|
||||
foreach ($cases['data'] as &$value) {
|
||||
$value = array_change_key_case($value, CASE_UPPER);
|
||||
}
|
||||
@@ -532,7 +578,6 @@ class Home extends Controller
|
||||
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
//../cases/cases_Open?APP_UID={$APP.APP_UID}&DEL_INDEX={$APP.DEL_INDEX}&action=todo
|
||||
$aNextStep['PAGE'] = '../cases/cases_Open?APP_UID=' . $aData['APPLICATION'] . '&DEL_INDEX=' . $aData['INDEX'] . '&action=draft';
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
|
||||
|
||||
@@ -557,8 +602,10 @@ class Home extends Controller
|
||||
|
||||
function getUserArray($action, $userUid, $search = null)
|
||||
{
|
||||
global $oAppCache;
|
||||
$status = array();
|
||||
G::LoadClass("configuration");
|
||||
$conf = new Configurations();
|
||||
$confEnvSetting = $conf->getFormats();
|
||||
$users = array();
|
||||
$users[] = array("CURRENT_USER", G::LoadTranslation("ID_CURRENT_USER"));
|
||||
$users[] = array("ALL", G::LoadTranslation("ID_ALL_USERS"));
|
||||
|
||||
@@ -571,16 +618,25 @@ class Home extends Controller
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_UID);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_ID);
|
||||
if (!empty($search)) {
|
||||
$cUsers->addOr(UsersPeer::USR_FIRSTNAME, "%$search%", Criteria::LIKE);
|
||||
$cUsers->addOr(UsersPeer::USR_LASTNAME, "%$search%", Criteria::LIKE);
|
||||
$cUsers->add(
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $search . '%', Criteria::LIKE))
|
||||
);
|
||||
}
|
||||
$oDataset = UsersPeer::doSelectRS($cUsers);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$users[] = array($aRow['USR_ID'], htmlentities($aRow['USR_LASTNAME'] . ' ' . $aRow['USR_FIRSTNAME'], ENT_QUOTES, "UTF-8"));
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters(
|
||||
$confEnvSetting["format"],
|
||||
$aRow["USR_USERNAME"],
|
||||
$aRow["USR_FIRSTNAME"],
|
||||
$aRow["USR_LASTNAME"]
|
||||
);
|
||||
$users[] = array($aRow['USR_ID'], htmlentities($usrFullName, ENT_QUOTES, "UTF-8"));
|
||||
$oDataset->next();
|
||||
}
|
||||
break;
|
||||
@@ -593,10 +649,9 @@ class Home extends Controller
|
||||
|
||||
function getCategoryArray ()
|
||||
{
|
||||
global $oAppCache;
|
||||
require_once 'classes/model/ProcessCategory.php';
|
||||
$category[] = array ("",G::LoadTranslation( "ID_ALL_CATEGORIES" )
|
||||
);
|
||||
$category = array();
|
||||
$category[] = array ("",G::LoadTranslation( "ID_ALL_CATEGORIES" ));
|
||||
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_UID );
|
||||
@@ -615,11 +670,9 @@ class Home extends Controller
|
||||
function getAllUsersArray ($action)
|
||||
{
|
||||
global $oAppCache;
|
||||
$status = array ();
|
||||
$users[] = array ("CURRENT_USER",G::LoadTranslation( "ID_CURRENT_USER" )
|
||||
);
|
||||
$users[] = array ("",G::LoadTranslation( "ID_ALL_USERS" )
|
||||
);
|
||||
$users = array ();
|
||||
$users[] = array ("CURRENT_USER",G::LoadTranslation( "ID_CURRENT_USER" ));
|
||||
$users[] = array ("",G::LoadTranslation( "ID_ALL_USERS" ));
|
||||
|
||||
if ($action == 'to_reassign') {
|
||||
//now get users, just for the Search action
|
||||
@@ -644,66 +697,14 @@ class Home extends Controller
|
||||
|
||||
function getStatusArray ($action, $userUid)
|
||||
{
|
||||
global $oAppCache;
|
||||
$status = array ();
|
||||
$status[] = array ('',G::LoadTranslation( 'ID_ALL_STATUS' ));
|
||||
//get the list based in the action provided
|
||||
switch ($action) {
|
||||
case 'sent':
|
||||
$cStatus = $oAppCache->getSentListProcessCriteria( $userUid ); // a little slow
|
||||
break;
|
||||
case 'simple_search':
|
||||
case 'search':
|
||||
$cStatus = new Criteria( 'workflow' );
|
||||
$cStatus->clearSelectColumns();
|
||||
$cStatus->setDistinct();
|
||||
$cStatus->addSelectColumn( ApplicationPeer::APP_STATUS );
|
||||
$oDataset = ApplicationPeer::doSelectRS( $cStatus );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$status[] = array ($aRow['APP_STATUS'],G::LoadTranslation( 'ID_CASES_STATUS_' . $aRow['APP_STATUS'] )
|
||||
); //here we can have a translation for the status ( the second param)
|
||||
$oDataset->next();
|
||||
}
|
||||
return $status;
|
||||
break;
|
||||
case 'selfservice':
|
||||
$cStatus = $oAppCache->getUnassignedListCriteria( $userUid );
|
||||
break;
|
||||
case 'paused':
|
||||
$cStatus = $oAppCache->getPausedListCriteria( $userUid );
|
||||
break;
|
||||
case 'to_revise':
|
||||
$cStatus = $oAppCache->getToReviseListCriteria( $userUid );
|
||||
// $cStatus = $oAppCache->getPausedListCriteria($userUid);
|
||||
break;
|
||||
case 'to_reassign':
|
||||
$cStatus = $oAppCache->getToReassignListCriteria($userUid);
|
||||
break;
|
||||
case 'todo':
|
||||
case 'draft':
|
||||
case 'gral':
|
||||
// case 'to_revise' :
|
||||
default:
|
||||
return $status;
|
||||
break;
|
||||
}
|
||||
|
||||
//get the status for this user in this action only for participated, unassigned, paused
|
||||
// if ( $action != 'todo' && $action != 'draft' && $action != 'to_revise') {
|
||||
if ($action != 'todo' && $action != 'draft') {
|
||||
//$cStatus = new Criteria('workflow');
|
||||
$cStatus->clearSelectColumns();
|
||||
$cStatus->setDistinct();
|
||||
$cStatus->addSelectColumn( AppCacheViewPeer::APP_STATUS );
|
||||
$oDataset = AppCacheViewPeer::doSelectRS( $cStatus );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$status[] = array ($aRow['APP_STATUS'],G::LoadTranslation( 'ID_CASES_STATUS_' . $aRow['APP_STATUS'] ));
|
||||
//here we can have a translation for the status ( the second param)
|
||||
$oDataset->next();
|
||||
$status = array();
|
||||
$aStatus = Application::$app_status_values;
|
||||
$status[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
|
||||
foreach ($aStatus as $key => $value) {
|
||||
if ($action == 'search') {
|
||||
$status[] = array ($value, G::LoadTranslation( 'ID_CASES_STATUS_' . $key ));
|
||||
} else {
|
||||
$status[] = array ($key, G::LoadTranslation( 'ID_CASES_STATUS_' . $key ));
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
@@ -711,7 +712,7 @@ class Home extends Controller
|
||||
|
||||
/**
|
||||
* Get the list of active processes
|
||||
*
|
||||
*
|
||||
* @global type $oAppCache
|
||||
* @param type $action
|
||||
* @param type $userUid
|
||||
@@ -719,8 +720,6 @@ class Home extends Controller
|
||||
*/
|
||||
private function getProcessArray($action, $userUid, $search=null)
|
||||
{
|
||||
global $oAppCache;
|
||||
|
||||
$processes = array();
|
||||
$processes[] = array("", G::LoadTranslation("ID_ALL_PROCESS"));
|
||||
|
||||
@@ -733,9 +732,7 @@ class Home extends Controller
|
||||
$cProcess->add(ProcessPeer::PRO_TITLE, "%$search%", Criteria::LIKE);
|
||||
}
|
||||
$oDataset = ProcessPeer::doSelectRS($cProcess);
|
||||
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$processes[] = array($aRow["PRO_ID"], $aRow["PRO_TITLE"]);
|
||||
|
||||
@@ -506,7 +506,12 @@ class pmTablesProxy extends HttpProxyController
|
||||
$j = 0;
|
||||
foreach ($aAdditionalTables['FIELDS'] as $aField) {
|
||||
$conData++;
|
||||
$temp = (array_key_exists($j, $aAux))? '"' . addslashes(stripslashes(utf8_encode($aAux[$j]))) . '"' : '""';
|
||||
|
||||
if (array_key_exists($j, $aAux)) {
|
||||
$temp = '"' . addslashes(stripslashes(G::is_utf8($aAux[$j]) ? $aAux[$j] : utf8_encode($aAux[$j]))) . '"';
|
||||
} else {
|
||||
$temp = '""';
|
||||
}
|
||||
|
||||
if ($temp == '') {
|
||||
switch ($aField['FLD_TYPE']) {
|
||||
|
||||
@@ -2215,6 +2215,10 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_CLEAR_CACHE_MSG1','en','All cache data was deleted','2014-01-15') ,
|
||||
( 'LABEL','ID_CLEAR_CACHE_MSG2','en','The cache directory is empty','2014-01-15') ,
|
||||
( 'LABEL','ID_CASESLIST_APP_UID','en','Case Id','2014-01-15') ,
|
||||
( 'LABEL','ID_ABE_FORM_ALREADY_FILLED','en','The form has already been filled and sent.','2017-06-09') ,
|
||||
( 'LABEL','ID_ABE_INFORMATION_SUBMITTED','en','The information was submitted. Thank you.','2017-06-19') ,
|
||||
( 'LABEL','ID_ABE_ANSWER_SUBMITTED','en','The answer has been submitted. Thank you.','2017-06-19') ,
|
||||
( 'LABEL','ID_ABE_RESPONSE_SENT','en','The response has already been sent.','2017-06-19') ,
|
||||
( 'LABEL','ID_CASESLIST_DEL_INDEX','en','Case Index','2014-01-15') ,
|
||||
( 'LABEL','ID_CASESLIST_APP_NUMBER','en','#','2014-01-15') ,
|
||||
( 'LABEL','ID_CASESLIST_APP_STATUS','en','Status','2014-01-15') ,
|
||||
|
||||
@@ -828,6 +828,7 @@ CREATE TABLE `APP_DELAY`
|
||||
`APP_DELAY_UID` VARCHAR(32) default '' NOT NULL,
|
||||
`PRO_UID` VARCHAR(32) default '0' NOT NULL,
|
||||
`APP_UID` VARCHAR(32) default '0' NOT NULL,
|
||||
`APP_NUMBER` INTEGER default 0,
|
||||
`APP_THREAD_INDEX` INTEGER default 0 NOT NULL,
|
||||
`APP_DEL_INDEX` INTEGER default 0 NOT NULL,
|
||||
`APP_TYPE` VARCHAR(20) default '0' NOT NULL,
|
||||
@@ -839,7 +840,12 @@ CREATE TABLE `APP_DELAY`
|
||||
`APP_DISABLE_ACTION_USER` VARCHAR(32) default '0',
|
||||
`APP_DISABLE_ACTION_DATE` DATETIME,
|
||||
`APP_AUTOMATIC_DISABLED_DATE` DATETIME,
|
||||
`APP_DELEGATION_USER_ID` INTEGER default 0,
|
||||
`PRO_ID` INTEGER default 0,
|
||||
PRIMARY KEY (`APP_DELAY_UID`),
|
||||
KEY `INDEX_APP_NUMBER`(`APP_NUMBER`),
|
||||
KEY `INDEX_USR_ID`(`APP_DELEGATION_USER_ID`),
|
||||
KEY `INDEX_PRO_ID`(`PRO_ID`),
|
||||
KEY `indexAppDelay`(`PRO_UID`, `APP_UID`, `APP_THREAD_INDEX`, `APP_DEL_INDEX`, `APP_NEXT_TASK`, `APP_DELEGATION_USER`, `APP_DISABLE_ACTION_USER`),
|
||||
KEY `indexAppUid`(`APP_UID`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='APP_DELAY';
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* casesDemo.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 {
|
||||
|
||||
$rows[] = array ('uid' => 'char','name' => 'char','age' => 'integer','balance' => 'float');
|
||||
$rows[] = array ('uid' => 11,'name' => 'john','age' => 44,'balance' => 123423);
|
||||
$rows[] = array ('uid' => 22,'name' => 'bobby','age' => 33,'balance' => 23456);
|
||||
$rows[] = array ('uid' => 33,'name' => 'Dan','age' => 22,'balance' => 34567);
|
||||
$rows[] = array ('uid' => 33,'name' => 'Mike','age' => 21,'balance' => 4567);
|
||||
$rows[] = array ('uid' => 44,'name' => 'Paul','age' => 22,'balance' => 567);
|
||||
$rows[] = array ('uid' => 55,'name' => 'Will','age' => 23,'balance' => 67);
|
||||
$rows[] = array ('uid' => 66,'name' => 'Ernest','age' => 24,'balance' => 7);
|
||||
$rows[] = array ('uid' => 77,'name' => 'Albert','age' => 25,'balance' => 84567);
|
||||
$rows[] = array ('uid' => 88,'name' => 'Sue','age' => 26,'balance' => 94567);
|
||||
$rows[] = array ('uid' => 99,'name' => 'Freddy','age' => 22,'balance' => 04567);
|
||||
|
||||
$_DBArray['user'] = $rows;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
//krumo ( $_DBArray );
|
||||
G::LoadClass( 'ArrayPeer' );
|
||||
$c = new Criteria( 'dbarray' );
|
||||
$c->setDBArrayTable( 'user' );
|
||||
// $c->add ( 'user.age', 22 , Criteria::GREATER_EQUAL );
|
||||
// $c->add ( 'user.age', 22 , Criteria::EQUAL );
|
||||
$c->add( 'user.name', '%au%', Criteria::LIKE );
|
||||
// $c->add ( 'user.balance', 3456 , Criteria::GREATER_EQUAL );
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_PUBLISH = new Publisher();
|
||||
// $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/casesDemo', $c );
|
||||
//$G_PUBLISH->AddContent('smarty', 'cases/casesDemo', '', '', $Fields);
|
||||
// G::RenderPage( "publish" );
|
||||
//die;
|
||||
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'pmScript' );
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass( 'derivation' );
|
||||
$oCase = new Cases();
|
||||
$appUid = isset( $_SESSION['APPLICATION'] ) ? $_SESSION['APPLICATION'] : '';
|
||||
$appFields = $oCase->loadCase( $appUid );
|
||||
|
||||
$Fields['APP_UID'] = $appFields['APP_UID'];
|
||||
$Fields['APP_NUMBER'] = $appFields['APP_NUMBER'];
|
||||
$Fields['APP_STATUS'] = $appFields['APP_STATUS'];
|
||||
$Fields['STATUS'] = $appFields['STATUS'];
|
||||
$Fields['APP_TITLE'] = $appFields['TITLE'];
|
||||
$Fields['PRO_UID'] = $appFields['PRO_UID'];
|
||||
$Fields['APP_PARALLEL'] = $appFields['APP_PARALLEL'];
|
||||
$Fields['APP_INIT_USER'] = $appFields['APP_INIT_USER'];
|
||||
$Fields['APP_CUR_USER'] = $appFields['APP_CUR_USER'];
|
||||
$Fields['APP_DATA'] = $appFields['APP_DATA'];
|
||||
$Fields['CREATOR'] = $appFields['CREATOR'];
|
||||
$Fields['APP_PIN'] = $appFields['APP_PIN'];
|
||||
$Fields['APP_PROC_CODE'] = $appFields['APP_PROC_CODE'];
|
||||
|
||||
$objProc = new Process();
|
||||
$aProc = $objProc->load($appFields['PRO_UID']);
|
||||
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
|
||||
$oUser = new Users();
|
||||
$oUser->load( $appFields['APP_CUR_USER'] );
|
||||
$Fields['CUR_USER'] = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname();
|
||||
|
||||
$threads = $oCase->GetAllThreads( $appFields['APP_UID'] );
|
||||
$Fields['THREADS'] = $threads;
|
||||
$Fields['CANT_THREADS'] = count( $threads );
|
||||
|
||||
$Fields['CANT_APP_DATA'] = count( $Fields['APP_DATA'] );
|
||||
$delegations = $oCase->GetAllDelegations( $appFields['APP_UID'] );
|
||||
foreach ($delegations as $key => $val) {
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load($val['TAS_UID']);
|
||||
$delegations[$key]['TAS_TITLE'] = $aTask['TAS_TITLE'];
|
||||
if ($val['USR_UID'] != - 1 && $val['USR_UID'] != '') {
|
||||
$oUser->load( $val['USR_UID'] );
|
||||
$delegations[$key]['USR_NAME'] = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname();
|
||||
} else {
|
||||
$delegations[$key]['USR_NAME'] = G::LoadTranslation('ID_UNKNOW_USER') . G::LoadTranslation('ID_SUBPROCESS_USER');
|
||||
}
|
||||
}
|
||||
$Fields['CANT_DELEGATIONS'] = count( $delegations );
|
||||
$Fields['DELEGATIONS'] = $delegations;
|
||||
|
||||
require_once 'classes/model/AppDelay.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_THREAD_INDEX );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_DEL_INDEX );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_TYPE );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_STATUS );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_ENABLE_ACTION_USER );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_ENABLE_ACTION_DATE );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_DISABLE_ACTION_USER );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_DISABLE_ACTION_DATE );
|
||||
$oCriteria->add( AppDelayPeer::APP_UID, $appUid );
|
||||
$oCriteria->addAscendingOrderByColumn( AppDelayPeer::APP_TYPE );
|
||||
$oCriteria->addAscendingOrderByColumn( AppDelayPeer::APP_ENABLE_ACTION_DATE );
|
||||
$oDataset = AppDelayPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aDelays = array ();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aDelays[] = $aRow;
|
||||
$oDataset->next();
|
||||
}
|
||||
$Fields['DELAYS'] = $aDelays;
|
||||
$Fields['CANT_DELAYS'] = count( $aDelays );
|
||||
|
||||
require_once 'classes/model/SubApplication.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( SubApplicationPeer::APP_UID );
|
||||
$oCriteria->addSelectColumn( SubApplicationPeer::APP_PARENT );
|
||||
$oCriteria->addSelectColumn( SubApplicationPeer::DEL_INDEX_PARENT );
|
||||
$oCriteria->addSelectColumn( SubApplicationPeer::DEL_THREAD_PARENT );
|
||||
$oCriteria->addSelectColumn( SubApplicationPeer::SA_STATUS );
|
||||
$oCriteria->addSelectColumn( SubApplicationPeer::SA_INIT_DATE );
|
||||
$oCriteria->addSelectColumn( SubApplicationPeer::SA_FINISH_DATE );
|
||||
$oCriteria->addSelectColumn( ApplicationPeer::APP_NUMBER );
|
||||
$oCriteria->add( SubApplicationPeer::APP_UID, $appUid );
|
||||
$oCriteria->addJoin( ApplicationPeer::APP_UID, SubApplicationPeer::APP_PARENT, Criteria::LEFT_JOIN );
|
||||
$oCriteria->addAscendingOrderByColumn( SubApplicationPeer::APP_UID );
|
||||
$oDataset = SubApplicationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aSubprocess = array ();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aSubprocess[] = $aRow;
|
||||
$oDataset->next();
|
||||
}
|
||||
$Fields['SUBAPPLICATIONS'] = $aSubprocess;
|
||||
$Fields['CANT_SUBAPPLICATIONS'] = count( $aSubprocess );
|
||||
|
||||
/* Render page */
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_PUBLISH = new Publisher();
|
||||
//$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/casesDemo', $c );
|
||||
$G_PUBLISH->AddContent( 'smarty', 'cases/casesDemo', '', '', $Fields );
|
||||
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' );
|
||||
}
|
||||
|
||||
@@ -116,6 +116,9 @@ function getLoadTreeMenuData ()
|
||||
}
|
||||
}
|
||||
|
||||
//This function generates an xml, so it prevents the output of a badly formed xml
|
||||
//by cleaning any content prior to this function with ob_clean
|
||||
ob_clean();
|
||||
echo $xml->asXML();
|
||||
die;
|
||||
}
|
||||
@@ -177,42 +180,11 @@ function getLoadTreeMenuData ()
|
||||
}
|
||||
}
|
||||
|
||||
//This function generates an xml, so it prevents the output of a badly formed xml
|
||||
//by cleaning any content prior to this function with ob_clean
|
||||
ob_clean();
|
||||
echo $xml->asXML();
|
||||
die;
|
||||
|
||||
// Build xml document for all tree nodes
|
||||
/*$xml = '<menu_cases>';
|
||||
$i = 0;
|
||||
foreach ($menuCases as $menu => $aMenuBlock) {
|
||||
if (isset( $aMenuBlock['blockItems'] ) && sizeof( $aMenuBlock['blockItems'] ) > 0) {
|
||||
$urlProperty = "";
|
||||
if ((isset( $aMenuBlock['link'] )) && ($aMenuBlock['link'] != "")) {
|
||||
$urlProperty = "url='" . $aMenuBlock['link'] . "'";
|
||||
}
|
||||
$xml .= '<menu_block blockTitle="' . $aMenuBlock['blockTitle'] . '" id="' . $menu . '" ' . $urlProperty . '>';
|
||||
foreach ($aMenuBlock['blockItems'] as $id => $aMenu) {
|
||||
$i ++;
|
||||
if (isset( $aMenu['cases_count'] ) && $aMenu['cases_count'] !== '') {
|
||||
$nofifier = "cases_count=\"{$aMenu['cases_count']}\" ";
|
||||
} else {
|
||||
$nofifier = '';
|
||||
}
|
||||
$xml .= '<option title="' . $aMenu['label'] . '" id="' . $id . '" ' . $nofifier . ' url="' . $aMenu['link'] . '">';
|
||||
$xml .= '</option>';
|
||||
}
|
||||
$xml .= '</menu_block>';
|
||||
} elseif (isset( $aMenuBlock['blockType'] ) && $aMenuBlock['blockType'] == "blockNestedTree") {
|
||||
$xml .= '<menu_block blockTitle="' . $aMenuBlock['blockTitle'] . '" blockNestedTree = "' . $aMenuBlock['loaderurl'] . '" id="' . $menu . '" folderId="0">';
|
||||
$xml .= '</menu_block>';
|
||||
} elseif (isset( $aMenuBlock['blockType'] ) && $aMenuBlock['blockType'] == "blockHeaderNoChild") {
|
||||
$xml .= '<menu_block blockTitle="' . $aMenuBlock['blockTitle'] . '" blockHeaderNoChild="blockHeaderNoChild" url = "' . $aMenuBlock['link'] . '" id="' . $menu . '">';
|
||||
//$xml .= '<option title="" id="" ></option>';
|
||||
$xml .= '</menu_block>';
|
||||
}
|
||||
}
|
||||
$xml .= '</menu_cases>';
|
||||
|
||||
print $xml;*/
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
@@ -109,12 +109,14 @@ if( isset($_GET['action']) && ($_GET['action'] == 'jump') ) {
|
||||
}
|
||||
|
||||
if(isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise') ){
|
||||
$oApp = new Application;
|
||||
$oApp->Load($appUid);
|
||||
//If the case is completed can not update the information from supervisor/review
|
||||
if($oApp->getAppStatus() === 'COMPLETED') {
|
||||
$oSupervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
|
||||
$caseCanBeReview = $oSupervisor->reviewCaseStatusForSupervisor($appUid, $delIndex);
|
||||
//Check if the case has the correct status for update the information from supervisor/review
|
||||
if (!$caseCanBeReview) {
|
||||
//The supervisor can not edit the information
|
||||
$script = 'cases_Open?';
|
||||
} else {
|
||||
//The supervisor can edit the information, the case are in TO_DO
|
||||
$script = 'cases_OpenToRevise?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex . '&TAS_UID=' . $tasUid;
|
||||
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
|
||||
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
|
||||
|
||||
@@ -8,27 +8,26 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
die();
|
||||
}
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
|
||||
try {
|
||||
$userUid = $_SESSION['USER_LOGGED'];
|
||||
$filters['paged'] = isset($_REQUEST["paged"]) ? $filter->sanitizeInputValue($_REQUEST["paged"], 'nosql') : true;
|
||||
$filters['count'] = isset($_REQUEST['count']) ? $filter->sanitizeInputValue($_REQUEST["count"], 'nosql') : true;
|
||||
$filters['category'] = isset($_REQUEST["category"]) ? $filter->sanitizeInputValue($_REQUEST["category"], 'nosql') : "";
|
||||
$filters['process'] = isset($_REQUEST["process"]) ? $filter->sanitizeInputValue($_REQUEST["process"], 'nosql') : "";
|
||||
$filters['search'] = isset($_REQUEST["search"]) ? $filter->sanitizeInputValue($_REQUEST["search"], 'nosql') : "";
|
||||
$filters['filter'] = isset($_REQUEST["filter"]) ? $filter->sanitizeInputValue($_REQUEST["filter"], 'nosql') : "";
|
||||
$filters['dateFrom'] = (!empty($_REQUEST["dateFrom"])) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : "";
|
||||
$filters['dateTo'] = (!empty($_REQUEST["dateTo"])) ? substr( $_REQUEST["dateTo"], 0, 10 ) : "";
|
||||
$filters['start'] = isset($_REQUEST["start"]) ? $filter->sanitizeInputValue($_REQUEST["start"], 'nosql') : "0";
|
||||
$filters['limit'] = isset($_REQUEST["limit"]) ? $filter->sanitizeInputValue($_REQUEST["limit"], 'nosql') : "25";
|
||||
$filters['sort'] = (isset($_REQUEST['sort']))? (($_REQUEST['sort'] == 'APP_STATUS_LABEL')? 'APP_STATUS' : $filter->sanitizeInputValue($_REQUEST["sort"], 'nosql')) : '';
|
||||
$filters['dir'] = isset($_REQUEST["dir"]) ? $filter->sanitizeInputValue($_REQUEST["dir"], 'nosql') : "DESC";
|
||||
$filters['action'] = isset($_REQUEST["action"]) ? $filter->sanitizeInputValue($_REQUEST["action"], 'nosql') : "";
|
||||
$filters['user'] = isset($_REQUEST["user"]) ? $filter->sanitizeInputValue($_REQUEST["user"], 'nosql') : "";
|
||||
$listName = isset($_REQUEST["list"]) ? $filter->sanitizeInputValue($_REQUEST["list"], 'nosql') : "inbox";
|
||||
$filters['filterStatus'] = isset($_REQUEST["filterStatus"]) ? $filter->sanitizeInputValue($_REQUEST["filterStatus"], 'nosql') : "";
|
||||
|
||||
$filters['paged'] = isset($_REQUEST["paged"]) ? $_REQUEST["paged"] : true;
|
||||
$filters['count'] = isset($_REQUEST['count']) ? $_REQUEST["count"] : true;
|
||||
$filters['category'] = isset($_REQUEST["category"]) ? $_REQUEST["category"] : "";
|
||||
$filters['process'] = isset($_REQUEST["process"]) ? $_REQUEST["process"] : "";
|
||||
$filters['search'] = isset($_REQUEST["search"]) ? $_REQUEST["search"] : "";
|
||||
$filters['filter'] = isset($_REQUEST["filter"]) ? $_REQUEST["filter"] : "";
|
||||
$filters['dateFrom'] = (!empty($_REQUEST["dateFrom"])) ? substr($_REQUEST["dateFrom"], 0, 10) : "";
|
||||
$filters['dateTo'] = (!empty($_REQUEST["dateTo"])) ? substr($_REQUEST["dateTo"], 0, 10) : "";
|
||||
$filters['start'] = isset($_REQUEST["start"]) ? $_REQUEST["start"] : "0";
|
||||
$filters['limit'] = isset($_REQUEST["limit"]) ? $_REQUEST["limit"] : "25";
|
||||
$filters['sort'] = (isset($_REQUEST['sort'])) ? (($_REQUEST['sort'] == 'APP_STATUS_LABEL') ? 'APP_STATUS' : $_REQUEST["sort"]) : '';
|
||||
$filters['dir'] = isset($_REQUEST["dir"]) ? $_REQUEST["dir"] : "DESC";
|
||||
$filters['action'] = isset($_REQUEST["action"]) ? $_REQUEST["action"] : "";
|
||||
$filters['user'] = isset($_REQUEST["user"]) ? $_REQUEST["user"] : "";
|
||||
$listName = isset($_REQUEST["list"]) ? $_REQUEST["list"] : "inbox";
|
||||
$filters['filterStatus'] = isset($_REQUEST["filterStatus"]) ? $_REQUEST["filterStatus"] : "";
|
||||
$filters['sort'] = G::toUpper($filters['sort']);
|
||||
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '') ? $_REQUEST['openApplicationUid'] : null;
|
||||
|
||||
//Define user when is reassign
|
||||
@@ -78,9 +77,10 @@ try {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Validate filters
|
||||
$filters['search'] = (!is_null($openApplicationUid))? $openApplicationUid : $filters['search'];
|
||||
//Set a flag for review in the list by APP_UID when is used the case Link with parallel task
|
||||
$filters['caseLink'] = (!is_null($openApplicationUid))? $openApplicationUid : '';
|
||||
|
||||
$filters['start'] = (int)$filters['start'];
|
||||
$filters['start'] = abs($filters['start']);
|
||||
@@ -102,16 +102,26 @@ try {
|
||||
} else {
|
||||
$filters['limit'] = (int)$filters['limit'];
|
||||
}
|
||||
|
||||
$filters['sort'] = G::toUpper($filters['sort']);
|
||||
$columnsList = $listpeer::getFieldNames(BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
if (!(in_array($filters['sort'], $columnsList))) {
|
||||
if ($filters['sort'] == 'APP_CURRENT_USER' && ($listName == 'participated' || $listName == 'participated_last')) {
|
||||
|
||||
switch ($filters['sort']) {
|
||||
case 'APP_CURRENT_USER':
|
||||
$filters['sort'] = 'DEL_CURRENT_USR_LASTNAME';
|
||||
} else {
|
||||
$filters['sort'] = '';
|
||||
}
|
||||
break;
|
||||
case 'DEL_TASK_DUE_DATE':
|
||||
$filters['sort'] = 'DEL_DUE_DATE';
|
||||
break;
|
||||
case 'APP_UPDATE_DATE':
|
||||
$filters['sort'] = 'DEL_DELEGATE_DATE';
|
||||
break;
|
||||
case 'APP_DEL_PREVIOUS_USER':
|
||||
$filters['sort'] = 'DEL_DUE_DATE';
|
||||
break;
|
||||
case 'DEL_CURRENT_TAS_TITLE':
|
||||
$filters['sort'] = 'APP_TAS_TITLE';
|
||||
break;
|
||||
case 'APP_STATUS_LABEL':
|
||||
$filters['sort'] = 'APP_STATUS';
|
||||
break;
|
||||
}
|
||||
|
||||
$filters['dir'] = G::toUpper($filters['dir']);
|
||||
@@ -184,10 +194,8 @@ try {
|
||||
);
|
||||
|
||||
$response = array();
|
||||
|
||||
$response['filters'] = $filters;
|
||||
$response['totalCount'] = $list->getCountList($userUid, $filters);
|
||||
$response = $filter->xssFilterHard($response);
|
||||
$response['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($result);
|
||||
echo G::json_encode($response);
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -427,19 +427,12 @@ try {
|
||||
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
|
||||
}
|
||||
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher->extJsInit = true;
|
||||
|
||||
$oHeadPublisher->addExtJsScript('login/init', false); //adding a javascript file .js
|
||||
$oHeadPublisher->assign('uriReq', $sLocation);
|
||||
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
if ($oPluginRegistry->existsTrigger ( PM_AFTER_LOGIN )) {
|
||||
$oPluginRegistry->executeTriggers ( PM_AFTER_LOGIN , $_SESSION['USER_LOGGED'] );
|
||||
}
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
//G::header('Location: ' . $sLocation);
|
||||
G::header('Location: ' . $sLocation);
|
||||
die;
|
||||
} catch ( Exception $e ) {
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
|
||||
@@ -94,7 +94,7 @@ if (isset($_GET['BROWSER_TIME_ZONE_OFFSET'])) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$message = '<strong>The answer has been submited. Thank you</strong>';
|
||||
$message = '<strong>' . G::loadTranslation('ID_ABE_ANSWER_SUBMITTED') . '</strong>';
|
||||
|
||||
//Save Cases Notes
|
||||
G::LoadClass('actionsByEmailUtils');
|
||||
@@ -115,7 +115,7 @@ if (isset($_GET['BROWSER_TIME_ZONE_OFFSET'])) {
|
||||
$dataAbeRequests['ABE_REQ_ANSWERED'] = 1;
|
||||
$code == 0 ? uploadAbeRequest($dataAbeRequests) : '';
|
||||
} else {
|
||||
$message = '<strong>The response has already been sent.</strong>';
|
||||
$message = '<strong>' . G::loadTranslation('ID_ABE_RESPONSE_SENT') . '</strong>';
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showInfo', '', array('MESSAGE' => $message));
|
||||
|
||||
@@ -67,7 +67,7 @@ if (isset($_GET['BROWSER_TIME_ZONE_OFFSET'])) {
|
||||
'xmlform',
|
||||
'login/showInfo',
|
||||
'',
|
||||
['MESSAGE' => '<strong>The form has already been filled and sent.</strong>']
|
||||
['MESSAGE' => '<strong>' . G::loadTranslation('ID_ABE_FORM_ALREADY_FILLED') . '</strong>']
|
||||
);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -152,7 +152,7 @@ if (PMLicensedFeatures
|
||||
}
|
||||
|
||||
$assign = $result['message'];
|
||||
$aMessage['MESSAGE'] = '<strong>The information was submitted. Thank you.</strong>';
|
||||
$aMessage['MESSAGE'] = '<strong>' . G::loadTranslation('ID_ABE_INFORMATION_SUBMITTED') . '</strong>';
|
||||
} else {
|
||||
throw new Exception('An error occurred while the application was being processed.<br /><br />
|
||||
Error code: ' . $result->status_code . '<br />
|
||||
|
||||
@@ -34,6 +34,11 @@ if (isset( $_FILES ) && $_FILES["ATTACH_FILE"]["error"] == 0) {
|
||||
try {
|
||||
G::LoadClass( "case" );
|
||||
|
||||
$application = new Application();
|
||||
if (!$application->exists($_POST["APPLICATION"])) {
|
||||
throw new Exception(G::LoadTranslation("ID_CASE_NOT_EXISTS") . ": {$_POST['APPLICATION']}");
|
||||
}
|
||||
|
||||
$folderId = "";
|
||||
$fileTags = "";
|
||||
|
||||
@@ -122,7 +127,6 @@ if (isset( $_FILES ) && $_FILES["ATTACH_FILE"]["error"] == 0) {
|
||||
print ("* The file " . $_FILES["ATTACH_FILE"]["name"] . " was uploaded successfully in case " . $sAppUid . " as input document..\n") ;
|
||||
|
||||
//Get current Application Fields
|
||||
$application = new Application();
|
||||
$appFields = $application->Load( $_POST["APPLICATION"] );
|
||||
$appFields = unserialize( $appFields["APP_DATA"] );
|
||||
|
||||
|
||||
@@ -109,9 +109,10 @@ try {
|
||||
echo $response;
|
||||
break;
|
||||
case 'deleteUser':
|
||||
$usrUid = $_POST['USR_UID'];
|
||||
//Check if the user was defined in a process permissions
|
||||
$oObjectPermission = new ObjectPermission();
|
||||
$aProcess = $oObjectPermission->objectPermissionPerUser($_POST['USR_UID'], 1);
|
||||
$aProcess = $oObjectPermission->objectPermissionPerUser($usrUid, 1);
|
||||
if (count($aProcess) > 0) {
|
||||
echo G::json_encode(array(
|
||||
"status" => 'ERROR',
|
||||
@@ -123,19 +124,19 @@ try {
|
||||
//Remove from tasks
|
||||
G::LoadClass('tasks');
|
||||
$oTasks = new Tasks();
|
||||
$oTasks->ofToAssignUserOfAllTasks($UID);
|
||||
$oTasks->ofToAssignUserOfAllTasks($usrUid);
|
||||
|
||||
//Remove from groups
|
||||
G::LoadClass('groups');
|
||||
$oGroups = new Groups();
|
||||
$oGroups->removeUserOfAllGroups($UID);
|
||||
$oGroups->removeUserOfAllGroups($usrUid);
|
||||
|
||||
//Update the table Users
|
||||
require_once 'classes/model/Users.php';
|
||||
$RBAC->changeUserStatus($UID, 'CLOSED');
|
||||
$RBAC->updateUser(array('USR_UID' => $UID,'USR_USERNAME' => ''), '');
|
||||
$RBAC->changeUserStatus($usrUid, 'CLOSED');
|
||||
$RBAC->updateUser(array('USR_UID' => $usrUid,'USR_USERNAME' => ''), '');
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($UID);
|
||||
$aFields = $oUser->load($usrUid);
|
||||
$aFields['USR_STATUS'] = 'CLOSED';
|
||||
$userName = $aFields['USR_USERNAME'];
|
||||
$aFields['USR_USERNAME'] = '';
|
||||
@@ -144,16 +145,16 @@ try {
|
||||
//Delete Dashboard
|
||||
require_once 'classes/model/DashletInstance.php';
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->add( DashletInstancePeer::DAS_INS_OWNER_UID, $UID );
|
||||
$criteria->add( DashletInstancePeer::DAS_INS_OWNER_UID, $usrUid );
|
||||
$criteria->add( DashletInstancePeer::DAS_INS_OWNER_TYPE , 'USER');
|
||||
DashletInstancePeer::doDelete( $criteria );
|
||||
|
||||
//Delete users as supervisor
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->add(ProcessUserPeer::USR_UID, $UID, Criteria::EQUAL);
|
||||
$criteria->add(ProcessUserPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$criteria->add(ProcessUserPeer::PU_TYPE, "SUPERVISOR", Criteria::EQUAL);
|
||||
ProcessUserPeer::doDelete($criteria);
|
||||
G::auditLog("DeleteUser", "User Name: ". $userName." User ID: (".$UID.") ");
|
||||
G::auditLog("DeleteUser", "User Name: ". $userName." User ID: (".$usrUid.") ");
|
||||
break;
|
||||
case 'changeUserStatus':
|
||||
//When the user change the status: ACTIVE, INACTIVE, VACATION
|
||||
@@ -317,8 +318,8 @@ try {
|
||||
//Get all list of users with the additional information related to department, role, authentication, cases
|
||||
$oUser = new \ProcessMaker\BusinessModel\User();
|
||||
$oDatasetUsers = $oUser->getAllUsersWithAuthSource($authSource, $filter, $sort, $start, $limit, $dir);
|
||||
$rows = $oUser->getAdditionalInfoFromUsers($oDatasetUsers);
|
||||
echo '{users: ' . G::json_encode($rows['data']) . ', total_users: ' . $rows['totalCount'] . '}';
|
||||
$rows = $oUser->getAdditionalInfoFromUsers($oDatasetUsers["data"]);
|
||||
echo '{users: ' . G::json_encode($rows['data']) . ', total_users: ' . $oDatasetUsers["totalRows"] . '}';
|
||||
break;
|
||||
case 'updatePageSize':
|
||||
G::LoadClass('configuration');
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
{header}
|
||||
<style>
|
||||
.x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body {dirBody}>
|
||||
{bodyTemplate}
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
{header}
|
||||
<style>
|
||||
.x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body {dirBody}>
|
||||
{bodyTemplate}
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
{header}
|
||||
<style>
|
||||
.x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body {dirBody}>
|
||||
{bodyTemplate}
|
||||
|
||||
@@ -214,14 +214,17 @@ class Cases
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list for Cases
|
||||
* Get list of cases from: todo, draft, unassigned
|
||||
* Get list of cases for the following REST endpoints:
|
||||
* /light/todo
|
||||
* /light/draft
|
||||
* /light/participated
|
||||
* /light/paused
|
||||
* /light/unassigned
|
||||
*
|
||||
* @access public
|
||||
* @param array $dataList, Data for list
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @return array $response
|
||||
*/
|
||||
public function getList($dataList = array())
|
||||
{
|
||||
@@ -230,8 +233,8 @@ class Cases
|
||||
$dataList["userId"] = null;
|
||||
}
|
||||
|
||||
$solrEnabled = false;
|
||||
$userUid = $dataList["userId"];
|
||||
//We need to use the USR_UID for the cases in the list
|
||||
$userUid = isset($dataList["userUid"]) ? $dataList["userUid"] : $dataList["userId"];
|
||||
$callback = isset( $dataList["callback"] ) ? $dataList["callback"] : "stcCallback1001";
|
||||
$dir = isset( $dataList["dir"] ) ? $dataList["dir"] : "DESC";
|
||||
$sort = isset( $dataList["sort"] ) ? $dataList["sort"] : "APPLICATION.APP_NUMBER";
|
||||
@@ -244,7 +247,6 @@ class Cases
|
||||
$process = isset( $dataList["process"] ) ? $dataList["process"] : "";
|
||||
$category = isset( $dataList["category"] ) ? $dataList["category"] : "";
|
||||
$status = isset( $dataList["status"] ) ? strtoupper( $dataList["status"] ) : "";
|
||||
$user = isset( $dataList["user"] ) ? $dataList["user"] : "";
|
||||
$search = isset( $dataList["search"] ) ? $dataList["search"] : "";
|
||||
$action = isset( $dataList["action"] ) ? $dataList["action"] : "todo";
|
||||
$paged = isset( $dataList["paged"] ) ? $dataList["paged"] : true;
|
||||
@@ -253,12 +255,84 @@ class Cases
|
||||
$dateTo = (!empty( $dataList["dateTo"] )) ? substr( $dataList["dateTo"], 0, 10 ) : "";
|
||||
$newerThan = (!empty($dataList['newerThan']))? $dataList['newerThan'] : '';
|
||||
$oldestThan = (!empty($dataList['oldestthan']))? $dataList['oldestthan'] : '';
|
||||
$first = isset( $dataList["first"] ) ? true :false;
|
||||
|
||||
$apps = new \Applications();
|
||||
$response = $apps->getAll(
|
||||
$userUid,
|
||||
$start,
|
||||
$limit,
|
||||
$action,
|
||||
$filter,
|
||||
$search,
|
||||
$process,
|
||||
$status,
|
||||
$type,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$callback,
|
||||
$dir,
|
||||
(strpos($sort, ".") !== false)? $sort : "APP_CACHE_VIEW." . $sort,
|
||||
$category,
|
||||
true,
|
||||
$paged,
|
||||
$newerThan,
|
||||
$oldestThan
|
||||
);
|
||||
if (!empty($response['data'])) {
|
||||
foreach ($response['data'] as &$value) {
|
||||
$value = array_change_key_case($value, CASE_LOWER);
|
||||
}
|
||||
}
|
||||
|
||||
if ($paged) {
|
||||
$response['total'] = $response['totalCount'];
|
||||
$response['start'] = $start+1;
|
||||
$response['limit'] = $limit;
|
||||
$response['sort'] = G::toLower($sort);
|
||||
$response['dir'] = G::toLower($dir);
|
||||
$response['cat_uid'] = $category;
|
||||
$response['pro_uid'] = $process;
|
||||
$response['search'] = $search;
|
||||
} else {
|
||||
$response = $response['data'];
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
/**
|
||||
* Search cases and get list of cases
|
||||
*
|
||||
* @access public
|
||||
* @param array $dataList, Data for list
|
||||
* @return array $response
|
||||
*/
|
||||
public function getCasesSearch($dataList = array())
|
||||
{
|
||||
Validator::isArray($dataList, '$dataList');
|
||||
if (!isset($dataList["userId"])) {
|
||||
$dataList["userId"] = null;
|
||||
}
|
||||
|
||||
//We need to user the USR_ID for performance
|
||||
$userId = $dataList["userId"];
|
||||
$dir = isset( $dataList["dir"] ) ? $dataList["dir"] : "DESC";
|
||||
$sort = isset( $dataList["sort"] ) ? $dataList["sort"] : "APPLICATION.APP_NUMBER";
|
||||
if ($sort === 'APP_CACHE_VIEW.APP_NUMBER') {
|
||||
$sort = "APPLICATION.APP_NUMBER";
|
||||
}
|
||||
$start = isset( $dataList["start"] ) ? $dataList["start"] : "0";
|
||||
$limit = isset( $dataList["limit"] ) ? $dataList["limit"] : "";
|
||||
$process = isset( $dataList["process"] ) ? $dataList["process"] : "";
|
||||
$category = isset( $dataList["category"] ) ? $dataList["category"] : "";
|
||||
$status = isset( $dataList["status"] ) ? strtoupper( $dataList["status"] ) : "";
|
||||
$user = isset( $dataList["user"] ) ? $dataList["user"] : "";
|
||||
$search = isset( $dataList["search"] ) ? $dataList["search"] : "";
|
||||
$dateFrom = (!empty( $dataList["dateFrom"] )) ? substr( $dataList["dateFrom"], 0, 10 ) : "";
|
||||
$dateTo = (!empty( $dataList["dateTo"] )) ? substr( $dataList["dateTo"], 0, 10 ) : "";
|
||||
$filterStatus = isset( $dataList["filterStatus"] ) ? strtoupper( $dataList["filterStatus"] ) : "";
|
||||
|
||||
$apps = new \Applications();
|
||||
$response = $apps->searchAll(
|
||||
$userUid,
|
||||
$userId,
|
||||
$start,
|
||||
$limit,
|
||||
$search,
|
||||
@@ -272,19 +346,18 @@ class Cases
|
||||
);
|
||||
|
||||
$response['total'] = 0;
|
||||
$response['start'] = $start + 1;
|
||||
$response['start'] = $start+1;
|
||||
$response['limit'] = $limit;
|
||||
$response['sort'] = G::toLower($sort);
|
||||
$response['dir'] = G::toLower($dir);
|
||||
$response['cat_uid'] = $category;
|
||||
$response['pro_uid'] = $process;
|
||||
$response['search'] = $search;
|
||||
if ($action == 'search') {
|
||||
$response['app_status'] = G::toLower($status);
|
||||
$response['usr_uid'] = $user;
|
||||
$response['date_from'] = $dateFrom;
|
||||
$response['date_to'] = $dateTo;
|
||||
}
|
||||
$response['app_status'] = G::toLower($status);
|
||||
$response['usr_uid'] = $user;
|
||||
$response['date_from'] = $dateFrom;
|
||||
$response['date_to'] = $dateTo;
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -459,25 +532,7 @@ class Cases
|
||||
}
|
||||
} else {
|
||||
\G::LoadClass("wsBase");
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNotExistsCase($applicationUid, 0, $this->getFieldNameByFormatFieldName("APP_UID"));
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
|
||||
$criteria->add(\AppDelegationPeer::APP_UID, $applicationUid);
|
||||
$criteria->add(\AppDelegationPeer::USR_UID, $userUid);
|
||||
|
||||
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
||||
|
||||
if (!$rsCriteria->next()) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED"));
|
||||
}
|
||||
|
||||
//Get data
|
||||
$ws = new \wsBase();
|
||||
|
||||
$fields = $ws->getCaseInfo($applicationUid, 0);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
|
||||
@@ -3329,4 +3384,42 @@ class Cases
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the table.column by order by the result
|
||||
* We can include the additional table related to the custom cases list
|
||||
*
|
||||
* @param string $listPeer, name of the list class
|
||||
* @param string $field, name of the fieldName
|
||||
* @param string $sort, name of column by sort
|
||||
* @param string $defaultSort, name of column by sort default
|
||||
* @param string $additionalClassName, name of the className of pmTable
|
||||
* @param array $additionalColumns, columns related to the custom cases list with the format TABLE_NAME.COLUMN_NAME
|
||||
* @return string $tableName
|
||||
*/
|
||||
public function getSortColumn($listPeer, $field, $sort, $defaultSort, $additionalClassName = '', $additionalColumns = array())
|
||||
{
|
||||
$columnSort = $defaultSort;
|
||||
$tableName = '';
|
||||
|
||||
//We will check if the column by sort is a LIST table
|
||||
$columnsList = $listPeer::getFieldNames($field);
|
||||
if (in_array($sort, $columnsList)) {
|
||||
$columnSort = $listPeer::TABLE_NAME . '.' . $sort;
|
||||
} else {
|
||||
//We will sort by CUSTOM CASE LIST table
|
||||
if (count($additionalColumns) > 0) {
|
||||
require_once(PATH_DATA_SITE . 'classes' . PATH_SEP . $additionalClassName . '.php');
|
||||
$aTable = explode('.', current($additionalColumns));
|
||||
if (count($aTable) > 0) {
|
||||
$tableName = $aTable[0];
|
||||
}
|
||||
}
|
||||
if (in_array($tableName . '.' . $sort, $additionalColumns)) {
|
||||
$columnSort = $tableName . '.' . $sort;
|
||||
}
|
||||
}
|
||||
|
||||
return $columnSort;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1667,8 +1667,11 @@ class Process
|
||||
foreach ($aAux as $sName => $sValue) {
|
||||
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
|
||||
}
|
||||
//we're adding the ping variable to the system list
|
||||
//we're adding the pin variable to the system list
|
||||
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
|
||||
|
||||
//we're adding the app_number variable to the system list
|
||||
$aFields[] = array('sName' => 'APP_NUMBER', 'sType' => 'system', 'sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
|
||||
}
|
||||
|
||||
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript");
|
||||
|
||||
@@ -1494,4 +1494,36 @@ class ProcessSupervisor
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function define if the supervisor can be review and edit
|
||||
* The appStatus can be:TO_DO, DRAFT, COMPLETED, CANCELLED
|
||||
* The thread status can be: PAUSED
|
||||
* @param string $appUid
|
||||
* @param integer $delIndex
|
||||
* @return array
|
||||
*/
|
||||
public function reviewCaseStatusForSupervisor($appUid, $delIndex = 0)
|
||||
{
|
||||
$oApp = new \Application();
|
||||
$oApp->Load($appUid);
|
||||
$canEdit = false;
|
||||
switch ($oApp->getAppStatus()) {
|
||||
case 'TO_DO':
|
||||
//Verify if the case is paused because the supervisor can not edit the PAUSED case
|
||||
$oDelay = new \AppDelay();
|
||||
if ($oDelay->isPaused($appUid, $delIndex)) {
|
||||
$canEdit = false;
|
||||
} else {
|
||||
$canEdit = true;
|
||||
}
|
||||
break;
|
||||
case 'COMPLETED':
|
||||
case 'CANCELLED':
|
||||
default:
|
||||
$canEdit = false;
|
||||
}
|
||||
|
||||
return $canEdit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,9 +765,19 @@ class TimerEvent
|
||||
if (isset($arrayData["TMREVN_CONFIGURATION_DATA"])) {
|
||||
$arrayData["TMREVN_CONFIGURATION_DATA"] = serialize($arrayData["TMREVN_CONFIGURATION_DATA"]);
|
||||
}
|
||||
|
||||
$oldValues = $timerEvent->toArray();
|
||||
|
||||
$timerEvent->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$nowValues = $timerEvent->toArray();
|
||||
//If the timer event undergoes any editing, the value of the 'TMREVN_STATUS'
|
||||
//field must be changed to 'ACTIVE', otherwise the 'ONE-DATE-TIME'
|
||||
//option will prevent execution.
|
||||
if (!($oldValues == $nowValues)) {
|
||||
$timerEvent->setTmrevnStatus("ACTIVE");
|
||||
}
|
||||
|
||||
if ($bpmnEvent->getEvnType() == "START") {
|
||||
switch ($arrayFinalData["TMREVN_OPTION"]) {
|
||||
case "HOURLY":
|
||||
@@ -1471,11 +1481,11 @@ class TimerEvent
|
||||
$flagRecord = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$flagRecord) {
|
||||
$common->frontEndShow("TEXT", "Not exists any record to start a new case, on date \"$datetime (UTC +00:00)\"");
|
||||
|
||||
$this->log("NO-RECORDS", "Not exists any record to start a new case");
|
||||
$action = "NO-RECORDS";
|
||||
$this->log($action, "Not exists any record to start a new case");
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
,'action' => $action
|
||||
@@ -1493,7 +1503,8 @@ class TimerEvent
|
||||
$common->frontEndShow("END");
|
||||
|
||||
//Intermediate Catch Timer-Event (continue the case) ///////////////////////////////////////////////////////
|
||||
$this->log("START-CONTINUE-CASES", "Date \"$datetime (UTC +00:00)\": Start continue the cases");
|
||||
$action = "START-CONTINUE-CASES";
|
||||
$this->log($action, "Date \"$datetime (UTC +00:00)\": Start continue the cases");
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
,'action' => $action
|
||||
|
||||
@@ -1631,8 +1631,7 @@ class User
|
||||
$oCriteria->setLimit($limit);
|
||||
$oDataset = \UsersPeer::DoSelectRs($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
return $oDataset;
|
||||
return array("data" => $oDataset, "totalRows" => $totalRows);
|
||||
}
|
||||
/**
|
||||
* This function get additional information related to the user
|
||||
|
||||
@@ -16,7 +16,7 @@ class RoutingScreen extends \Derivation
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->setRegexpTaskTypeToInclude("GATEWAYTOGATEWAY|END-MESSAGE-EVENT|END-EMAIL-EVENT|INTERMEDIATE-CATCH-TIMER-EVENT|INTERMEDIATE-THROW-MESSAGE-EVENT|INTERMEDIATE-THROW-EMAIL-EVENT");
|
||||
$this->setRegexpTaskTypeToInclude("GATEWAYTOGATEWAY|END-MESSAGE-EVENT|END-EMAIL-EVENT|INTERMEDIATE-THROW-MESSAGE-EVENT|INTERMEDIATE-THROW-EMAIL-EVENT");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -700,7 +700,7 @@ abstract class Importer
|
||||
"KEEP" => self::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW
|
||||
);
|
||||
|
||||
$option = $arrayAux[$option];
|
||||
$opt = $arrayAux[$option];
|
||||
|
||||
$arrayAux = array(
|
||||
(($optionGroup != "")? "CREATE" : "") => self::GROUP_IMPORT_OPTION_CREATE_NEW,
|
||||
@@ -724,7 +724,8 @@ abstract class Importer
|
||||
|
||||
//Import
|
||||
try {
|
||||
$projectUid = $this->import($option, $optionGroup);
|
||||
$generateUID = (isset($option) && $option == "CREATE") ? true : false;
|
||||
$projectUid = $this->import($opt, $optionGroup, $generateUID);
|
||||
|
||||
$arrayData = array_merge(array("PRJ_UID" => $projectUid), $arrayData);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -844,18 +844,6 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
"TAS_POSY" => $taskPosY
|
||||
));
|
||||
|
||||
if ($elementType == "bpmnEvent" &&
|
||||
in_array($key, array("end-message-event", "start-message-event", "intermediate-catch-message-event"))
|
||||
) {
|
||||
if (in_array($key, array("start-message-event", "intermediate-catch-message-event"))) {
|
||||
//Task - User
|
||||
//Assign to admin
|
||||
$task = new \Tasks();
|
||||
|
||||
$result = $task->assignUser($taskUid, "00000000000000000000000000000001", 1);
|
||||
}
|
||||
}
|
||||
|
||||
//Element-Task-Relation - Create
|
||||
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();
|
||||
|
||||
|
||||
@@ -85,7 +85,30 @@ class Cases extends Api
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "doGetCaseInfo" :
|
||||
$appUid = $this->parameters[$arrayArgs['app_uid']];
|
||||
$usrUid = $this->getUserId();
|
||||
//Check if the user is supervisor process
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
$user = new \ProcessMaker\BusinessModel\User();
|
||||
$arrayApplicationData = $case->getApplicationRecordByPk($appUid, [], false);
|
||||
if (!empty($arrayApplicationData)) {
|
||||
$criteria = new \Criteria("workflow");
|
||||
$criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
|
||||
$criteria->add(\AppDelegationPeer::APP_UID, $appUid);
|
||||
$criteria->add(\AppDelegationPeer::USR_UID, $usrUid);
|
||||
$criteria->setLimit(1);
|
||||
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
||||
if ($rsCriteria->next()) {
|
||||
return true;
|
||||
} else {
|
||||
$supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
|
||||
$flagps = $supervisor->isUserProcessSupervisor($arrayApplicationData['PRO_UID'], $usrUid);
|
||||
return $flagps;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
@@ -670,6 +693,8 @@ class Cases extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
* @class AccessControl {@className \ProcessMaker\Services\Api\Cases}
|
||||
* @url GET /:app_uid
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
@@ -952,6 +977,7 @@ class Cases extends Api
|
||||
/**
|
||||
* Get Case Notes
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param int $start {@from path}
|
||||
* @param int $limit {@from path}
|
||||
* @param string $sort {@from path}
|
||||
|
||||
@@ -1,403 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class CalendarTest
|
||||
*
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class CalendarTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $calendar;
|
||||
protected static $numCalendar = 2;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$calendar = new \ProcessMaker\BusinessModel\Calendar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create calendars
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//Create
|
||||
for ($i = 0; $i <= self::$numCalendar - 1; $i++) {
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar$i",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5),
|
||||
"CAL_WORK_HOUR" => array(
|
||||
array("DAY" => 0, "HOUR_START" => "00:00", "HOUR_END" => "00:00"),
|
||||
array("DAY" => 1, "HOUR_START" => "09:00", "HOUR_END" => "17:00")
|
||||
),
|
||||
"CAL_HOLIDAY" => array(
|
||||
array("NAME" => "holiday1", "DATE_START" => "2014-03-01", "DATE_END" => "2014-03-31"),
|
||||
array("NAME" => "holiday2", "DATE_START" => "2014-03-01", "DATE_END" => "2014-03-31")
|
||||
)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertTrue(isset($arrayCalendar["CAL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayCalendar;
|
||||
}
|
||||
|
||||
//Create - Japanese characters
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "私の名前(PHPUnitの)",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertTrue(isset($arrayCalendar["CAL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayCalendar;
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update calendars
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*/
|
||||
public function testUpdate($arrayRecord)
|
||||
{
|
||||
$arrayData = array("CAL_DESCRIPTION" => "Description...");
|
||||
|
||||
$arrayCalendar = self::$calendar->update($arrayRecord[1]["CAL_UID"], $arrayData);
|
||||
|
||||
$arrayCalendar = self::$calendar->getCalendar($arrayRecord[1]["CAL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertEquals($arrayCalendar["CAL_DESCRIPTION"], $arrayData["CAL_DESCRIPTION"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get calendars
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::getCalendars
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*/
|
||||
public function testGetCalendars($arrayRecord)
|
||||
{
|
||||
$arrayCalendar = self::$calendar->getCalendars();
|
||||
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$arrayCalendar = self::$calendar->getCalendars(null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayCalendar);
|
||||
|
||||
$arrayCalendar = self::$calendar->getCalendars(array("filter" => "PHPUnit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertEquals($arrayCalendar[0]["CAL_UID"], $arrayRecord[0]["CAL_UID"]);
|
||||
$this->assertEquals($arrayCalendar[0]["CAL_NAME"], $arrayRecord[0]["CAL_NAME"]);
|
||||
$this->assertEquals($arrayCalendar[0]["CAL_DESCRIPTION"], $arrayRecord[0]["CAL_DESCRIPTION"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get calendar
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::getCalendar
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*/
|
||||
public function testGetCalendar($arrayRecord)
|
||||
{
|
||||
//Get
|
||||
$arrayCalendar = self::$calendar->getCalendar($arrayRecord[0]["CAL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertEquals($arrayCalendar["CAL_UID"], $arrayRecord[0]["CAL_UID"]);
|
||||
$this->assertEquals($arrayCalendar["CAL_NAME"], $arrayRecord[0]["CAL_NAME"]);
|
||||
$this->assertEquals($arrayCalendar["CAL_DESCRIPTION"], $arrayRecord[0]["CAL_DESCRIPTION"]);
|
||||
|
||||
//Get - Japanese characters
|
||||
$arrayCalendar = self::$calendar->getCalendar($arrayRecord[self::$numCalendar]["CAL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertEquals($arrayCalendar["CAL_UID"], $arrayRecord[self::$numCalendar]["CAL_UID"]);
|
||||
$this->assertEquals($arrayCalendar["CAL_NAME"], "私の名前(PHPUnitの)");
|
||||
$this->assertEquals($arrayCalendar["CAL_DESCRIPTION"], "Description");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception when data not is array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", this value must be an array.
|
||||
*/
|
||||
public function testCreateExceptionNoIsArrayData()
|
||||
{
|
||||
$arrayData = 0;
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for required data (CAL_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Undefined value for "CAL_NAME", it is required.
|
||||
*/
|
||||
public function testCreateExceptionRequiredDataCalName()
|
||||
{
|
||||
$arrayData = array(
|
||||
//"CAL_NAME" => "PHPUnit Calendar",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAL_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAL_NAME", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataCalName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAL_WORK_DAYS)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAL_WORK_DAYS", it only accepts values: "1|2|3|4|5|6|7".
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataCalWorkDays()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(10, 2, 3, 4, 5)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for calendar name existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The calendar name with CAL_NAME: "PHPUnit Calendar0" already exists.
|
||||
*/
|
||||
public function testCreateExceptionExistsCalName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar0",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5),
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception when data not is array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", this value must be an array.
|
||||
*/
|
||||
public function testUpdateExceptionNoIsArrayData()
|
||||
{
|
||||
$arrayData = 0;
|
||||
|
||||
$arrayCalendar = self::$calendar->update("", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayCalendar = self::$calendar->update("", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid calendar UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The calendar with CAL_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidCalUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5),
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->update("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAL_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAL_NAME", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidDataCalName($arrayRecord)
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5),
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->update($arrayRecord[0]["CAL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAL_WORK_DAYS)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAL_WORK_DAYS", it only accepts values: "1|2|3|4|5|6|7".
|
||||
*/
|
||||
public function testUpdateExceptionInvalidDataCalWorkDays($arrayRecord)
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(10, 2, 3, 4, 5),
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->update($arrayRecord[0]["CAL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for calendar name existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The calendar name with CAL_NAME: "PHPUnit Calendar1" already exists.
|
||||
*/
|
||||
public function testUpdateExceptionExistsCalName($arrayRecord)
|
||||
{
|
||||
$arrayData = $arrayRecord[1];
|
||||
|
||||
$arrayCalendar = self::$calendar->update($arrayRecord[0]["CAL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete calendars
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*/
|
||||
public function testDelete($arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
self::$calendar->delete($value["CAL_UID"]);
|
||||
}
|
||||
|
||||
$arrayCalendar = self::$calendar->getCalendars(array("filter" => "PHPUnit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertEmpty($arrayCalendar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Cases Test
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oCases;
|
||||
protected $nowCountTodo = 0;
|
||||
protected $nowCountDraft = 0;
|
||||
protected $nowCountPaused = 0;
|
||||
protected $idCaseToDo = '';
|
||||
protected $idCaseDraft = '';
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
\G::loadClass('pmFunctions');
|
||||
|
||||
$usrUid = '00000000000000000000000000000001';
|
||||
$proUid = '2317283235320c1a36972b2028131767';
|
||||
$tasUid = '7983935495320c1a75e1df6068322280';
|
||||
$idCaseToDo = PMFNewCase($proUid, $usrUid, $tasUid, array());
|
||||
PMFDerivateCase($idCaseToDo, 1);
|
||||
$this->idCaseToDo = $idCaseToDo;
|
||||
|
||||
$idCaseDraft = PMFNewCase($proUid, $usrUid, $tasUid, array());
|
||||
$this->idCaseDraft = $idCaseDraft;
|
||||
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001'));
|
||||
$this->nowCountTodo = $listToDo['total'];
|
||||
|
||||
$listDraft = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft'));
|
||||
$this->nowCountDraft = $listDraft['total'];
|
||||
|
||||
$listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused'));
|
||||
$this->nowCountPaused = $listPaused['total'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorAppUidArray()
|
||||
{
|
||||
$this->oCases->putCancelCase(array(), '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorAppUidIncorrect()
|
||||
{
|
||||
$this->oCases->putCancelCase('IdDoesNotExists', '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorUsrUidArray()
|
||||
{
|
||||
$this->oCases->putCancelCase($this->idCaseDraft, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorUsrUidIncorrect()
|
||||
{
|
||||
$this->oCases->putCancelCase($this->idCaseDraft, 'IdDoesNotExists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in third field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorDelIndexIncorrect()
|
||||
{
|
||||
$this->oCases->putCancelCase($this->idCaseDraft, '00000000000000000000000000000001', 'string');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for cancel case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCase()
|
||||
{
|
||||
$this->oCases->putCancelCase($this->idCaseDraft, '00000000000000000000000000000001');
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listDraft = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft'));
|
||||
$this->assertNotEquals($this->nowCountDraft, $listDraft['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorAppUidArray()
|
||||
{
|
||||
$this->oCases->putPauseCase(array(), '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorAppUidIncorrect()
|
||||
{
|
||||
$this->oCases->putPauseCase('IdDoesNotExists', '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorUsrUidArray()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseDraft, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorUsrUidIncorrect()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseDraft, 'IdDoesNotExists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in third field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorDelIndexIncorrect()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseDraft, '00000000000000000000000000000001', 'string');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in fourth field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorDateIncorrect()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseDraft, '00000000000000000000000000000001', false, '2014-44-44');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for cancel case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCase()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseToDo, '00000000000000000000000000000001');
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused'));
|
||||
$this->assertNotEquals($this->nowCountPaused, $listPaused['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorAppUidArray()
|
||||
{
|
||||
$this->oCases->putUnpauseCase(array(), '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorAppUidIncorrect()
|
||||
{
|
||||
$this->oCases->putUnpauseCase('IdDoesNotExists', '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorUsrUidArray()
|
||||
{
|
||||
$this->oCases->putUnpauseCase($this->idCaseDraft, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorUsrUidIncorrect()
|
||||
{
|
||||
$this->oCases->putUnpauseCase($this->idCaseDraft, 'IdDoesNotExists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in third field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorDelIndexIncorrect()
|
||||
{
|
||||
$this->oCases->putUnpauseCase($this->idCaseDraft, '00000000000000000000000000000001', 'string');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for cancel case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCase()
|
||||
{
|
||||
$this->oCases->putUnpauseCase($this->idCaseToDo, '00000000000000000000000000000001');
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused'));
|
||||
$this->assertEquals($this->nowCountPaused, $listPaused['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::deleteCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteCaseErrorAppUidArray()
|
||||
{
|
||||
$this->oCases->deleteCase(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::deleteCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteCaseErrorAppUidIncorrect()
|
||||
{
|
||||
$this->oCases->deleteCase('IdDoesNotExists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for cancel case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::deleteCase
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteCase()
|
||||
{
|
||||
$this->oCases->deleteCase($this->idCaseToDo);
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001'));
|
||||
$this->assertNotEquals($this->nowCountTodo, $listToDo['total']);
|
||||
}
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Cases Test
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class CasesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oCases;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$dataList' it must be an array.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesErrorArray()
|
||||
{
|
||||
$this->oCases->getList(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for empty userId in array
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with userId: '' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesErrorUserIdArray()
|
||||
{
|
||||
$this->oCases->getList(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for not exists userId in array
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with userId: 'UidInexistente' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesErrorNotExistsUserIdArray()
|
||||
{
|
||||
$this->oCases->getList(array('userId' => 'UidInexistente'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value $action in array
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The value for $action is incorrect.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesErrorIncorrectValueArray()
|
||||
{
|
||||
$this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'incorrect'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list to do
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesToDo()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list draft
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesDraft()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list participated
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesParticipated()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'sent'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list unassigned
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesUnassigned()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'unassigned'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list search
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesSearch()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'search'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,356 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Cases Test
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class CasesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oCases;
|
||||
protected $idCase = '';
|
||||
|
||||
protected static $usrUid = "00000000000000000000000000000001";
|
||||
protected static $usrUid2 = "00000000000000000000000000000012";
|
||||
protected static $proUid = "00000000000000000000000000000003";
|
||||
protected static $tasUid = "00000000000000000000000000000004";
|
||||
protected static $tasUid2 = "00000000000000000000000000000005";
|
||||
protected static $tasUid3 = "00000000000000000000000000000006";
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$process = new \Process();
|
||||
$process->create(array("type"=>"classicProject", "PRO_TITLE"=> "NEW TEST PHP UNIT", "PRO_DESCRIPTION"=> "465",
|
||||
"PRO_CATEGORY"=> "", "PRO_CREATE_USER"=> "00000000000000000000000000000001",
|
||||
"PRO_UID"=> self::$proUid, "USR_UID"=> "00000000000000000000000000000001"), false);
|
||||
|
||||
$task = new \Task();
|
||||
$task->create(array("TAS_START"=>"TRUE", "TAS_UID"=> self::$tasUid, "PRO_UID"=> self::$proUid, "TAS_TITLE" => "NEW TASK TEST PHP UNIT",
|
||||
"TAS_POSX"=> 581, "TAS_POSY"=> 47, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
$task = new \Task();
|
||||
$task->create(array( "TAS_UID"=> self::$tasUid2, "PRO_UID"=> self::$proUid, "TAS_TITLE" => "NEW TASK ONE",
|
||||
"TAS_POSX"=> 481, "TAS_POSY"=> 127, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
$task = new \Task();
|
||||
$task->create(array( "TAS_UID"=> self::$tasUid3, "PRO_UID"=> self::$proUid, "TAS_TITLE" => "NEW TASK TWO",
|
||||
"TAS_POSX"=> 681, "TAS_POSY"=> 127, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
|
||||
$nw = new \processMap();
|
||||
$nw->saveNewPattern(self::$proUid, self::$tasUid, self::$tasUid2, 'PARALLEL', true);
|
||||
$nw = new \processMap();
|
||||
$nw->saveNewPattern(self::$proUid, self::$tasUid, self::$tasUid3, 'PARALLEL', true);
|
||||
|
||||
$user = new \Users();
|
||||
$user->create(array("USR_ROLE"=> "PROCESSMAKER_ADMIN","USR_UID"=> self::$usrUid2, "USR_USERNAME"=> "dummy",
|
||||
"USR_PASSWORD"=>"21232f297a57a5a743894a0e4a801fc3", "USR_FIRSTNAME"=>"dummy_firstname", "USR_LASTNAME"=>"dummy_lastname",
|
||||
"USR_EMAIL"=>"dummy@dummy.com", "USR_DUE_DATE"=>'2020-01-01', "USR_CREATE_DATE"=>"2014-01-01 12:00:00", "USR_UPDATE_DATE"=>"2014-01-01 12:00:00",
|
||||
"USR_STATUS"=>"ACTIVE", "USR_UX"=>"NORMAL"));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid, "USR_UID"=> self::$usrUid2, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid2, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid2, "USR_UID"=> self::$usrUid2, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid3, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid3, "USR_UID"=> self::$usrUid2, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of process in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid process 12345678912345678912345678912345678
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseErrorIncorrectProcessValueArray()
|
||||
{
|
||||
$this->oCases->addCase('12345678912345678912345678912345678', self::$tasUid, self::$usrUid, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of task in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Task invalid or the user is not assigned to the task
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseErrorIncorrectTaskValueArray()
|
||||
{
|
||||
$this->oCases->addCase(self::$proUid, '12345678912345678912345678912345678', self::$usrUid, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add Case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCase()
|
||||
{
|
||||
$response = $this->oCases->addCase(self::$proUid, self::$tasUid, self::$usrUid, array());
|
||||
$this->assertTrue(is_object($response));
|
||||
$aResponse = json_decode(json_encode($response), true);
|
||||
return $aResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::getTaskCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Incorrect or unavailable information about this case: 12345678912345678912345678912345678
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetTaskCaseErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oCases->getTaskCase('12345678912345678912345678912345678', self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get Task Case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::getTaskCase
|
||||
* @depends testAddCase
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetTaskCase(array $aResponse)
|
||||
{
|
||||
$response = $this->oCases->getTaskCase($aResponse['app_uid'], self::$usrUid);
|
||||
$this->assertTrue(is_array($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::getCaseInfo
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCaseInfoErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oCases->getCaseInfo('12345678912345678912345678912345678', self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get Case Info
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::getCaseInfo
|
||||
* @depends testAddCase
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCaseInfo(array $aResponse)
|
||||
{
|
||||
$response = $this->oCases->getCaseInfo($aResponse['app_uid'], self::$usrUid);
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of user delegation in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateReassignCase
|
||||
* @depends testAddCase
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid Case Delegation index for this user
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateReassignCaseErrorIncorrectUserValueArray(array $aResponse)
|
||||
{
|
||||
$this->oCases->updateReassignCase($aResponse['app_uid'], self::$usrUid, null, self::$usrUid, self::$usrUid2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateReassignCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application with app_uid: 12345678912345678912345678912345678 doesn't exist
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateReassignCaseErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oCases->updateReassignCase('12345678912345678912345678912345678', self::$usrUid, null, self::$usrUid2, self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test put reassign case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateReassignCase
|
||||
* @depends testAddCase
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateReassignCase(array $aResponse)
|
||||
{
|
||||
$response = $this->oCases->updateReassignCase($aResponse['app_uid'], self::$usrUid, null, self::$usrUid2, self::$usrUid);
|
||||
$this->assertTrue(empty($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add Case to test route case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseRouteCase()
|
||||
{
|
||||
$response = $this->oCases->addCase(self::$proUid, self::$tasUid, self::$usrUid, array());
|
||||
$this->assertTrue(is_object($response));
|
||||
$aResponseRouteCase = json_decode(json_encode($response), true);
|
||||
return $aResponseRouteCase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateRouteCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The row '12345678912345678912345678912345678, ' in table AppDelegation doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateRouteCaseErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oCases->updateRouteCase('12345678912345678912345678912345678', self::$usrUid, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test put route case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateRouteCase
|
||||
* @depends testAddCaseRouteCase
|
||||
* @param array $aResponseRouteCase
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateRouteCase(array $aResponseRouteCase)
|
||||
{
|
||||
$response = $this->oCases->updateRouteCase($aResponseRouteCase['app_uid'], self::$usrUid, null);
|
||||
$this->assertTrue(empty($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of process in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid process 12345678912345678912345678912345678
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseImpersonateErrorIncorrectProcessValueArray()
|
||||
{
|
||||
$this->oCases->addCaseImpersonate('12345678912345678912345678912345678', self::$usrUid2, self::$tasUid, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of task in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage User not registered! 12345678912345678912345678912345678!!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseImpersonateErrorIncorrectTaskValueArray()
|
||||
{
|
||||
$this->oCases->addCaseImpersonate(self::$proUid, '12345678912345678912345678912345678', self::$tasUid, array());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test add Case impersonate
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCaseImpersonate
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseImpersonate()
|
||||
{
|
||||
$response = $this->oCases->addCaseImpersonate(self::$proUid, self::$usrUid2, self::$tasUid, array());
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$assign = new \TaskUser();
|
||||
$assign->remove(self::$tasUid, self::$usrUid, 1,1);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid2);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid3);
|
||||
|
||||
$process = new \Process();
|
||||
$process->remove(self::$proUid);
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
$criteria->addSelectColumn(\RoutePeer::PRO_UID);
|
||||
$criteria->add(\RoutePeer::PRO_UID, self::$proUid, \Criteria::EQUAL);
|
||||
\ProcessFilesPeer::doDelete($criteria);
|
||||
|
||||
$user = new \Users();
|
||||
$user->remove(self::$usrUid2);
|
||||
|
||||
$oConnection = \Propel::getConnection( \UsersPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oUser = \UsersPeer::retrieveByPK( self::$usrUid2 );
|
||||
if (! is_null( $oUser )) {
|
||||
$oConnection->begin();
|
||||
$oUser->delete();
|
||||
$oConnection->commit();
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,354 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Department Test
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class DepartmentTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oDepartment;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oDepartment = new \ProcessMaker\BusinessModel\Department();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$dep_data' it must be an array.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArray()
|
||||
{
|
||||
$this->oDepartment->saveDepartment(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$create' it must be a boolean.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorBoolean()
|
||||
{
|
||||
$this->oDepartment->saveDepartment(array('1'),array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for empty array in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The field '$dep_data' is empty.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayEmpty()
|
||||
{
|
||||
$this->oDepartment->saveDepartment(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department with nonexistent dep_parent
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_parent: 'testUidDepartment' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepParentExist()
|
||||
{
|
||||
$data = array('dep_parent' => 'testUidDepartment');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department with nonexistent dep_manager
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with dep_manager: 'testUidUser' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepManagerExist()
|
||||
{
|
||||
$data = array('dep_manager' => 'testUidUser');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department with incorrect dep_status
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_status: 'SUPER ACTIVO' is incorrect.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepStatus()
|
||||
{
|
||||
$data = array('dep_status' => 'SUPER ACTIVO');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department untitled
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The field dep_title is required.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepTitleEmpty()
|
||||
{
|
||||
$data = array('dep_status' => 'ACTIVE');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save department parent
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentParent()
|
||||
{
|
||||
$data = array('dep_title' => 'Departamento Padre');
|
||||
$dep_data = $this->oDepartment->saveDepartment($data);
|
||||
$this->assertTrue(is_array($dep_data));
|
||||
$this->assertTrue(isset($dep_data['dep_uid']));
|
||||
$this->assertEquals($dep_data['dep_parent'], '');
|
||||
$this->assertEquals($dep_data['dep_title'], 'Departamento Padre');
|
||||
$this->assertEquals($dep_data['dep_status'], 'ACTIVE');
|
||||
$this->assertEquals($dep_data['dep_manager'], '');
|
||||
$this->assertEquals($dep_data['has_children'], 0);
|
||||
return $dep_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department with title exist
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepTitleRepeated(array $dep_data)
|
||||
{
|
||||
$data = array('dep_title' => 'Departamento Padre');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department untitled
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_uid: 'testUidDepartment' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateDepartmentErrorArrayDepUidExist()
|
||||
{
|
||||
$data = array('dep_uid' => 'testUidDepartment');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save department child
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentChild(array $dep_data)
|
||||
{
|
||||
$data = array(
|
||||
'dep_title' => 'Departamento Child',
|
||||
'dep_parent' => $dep_data['dep_uid'],
|
||||
'dep_status' => 'INACTIVE',
|
||||
'dep_manager' => '00000000000000000000000000000001'
|
||||
);
|
||||
$child_data = $this->oDepartment->saveDepartment($data);
|
||||
$this->assertTrue(is_array($child_data));
|
||||
$this->assertTrue(isset($child_data['dep_uid']));
|
||||
$this->assertEquals($child_data['dep_parent'], $dep_data['dep_uid']);
|
||||
$this->assertEquals($child_data['dep_title'], 'Departamento Child');
|
||||
$this->assertEquals($child_data['dep_status'], 'INACTIVE');
|
||||
$this->assertEquals($child_data['dep_manager'], '00000000000000000000000000000001');
|
||||
$this->assertEquals($child_data['has_children'], 0);
|
||||
return $child_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for update department with title exist
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @depends testCreateDepartmentChild
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @param array $child_data, Data for child department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists.
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateDepartmentErrorArrayDepTitleRepeated(array $dep_data, array $child_data)
|
||||
{
|
||||
$dataUpdate = array (
|
||||
'dep_uid' => $child_data['dep_uid'],
|
||||
'dep_title' => 'Departamento Padre'
|
||||
);
|
||||
$this->oDepartment->saveDepartment($dataUpdate, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get departments array
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @depends testCreateDepartmentChild
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @param array $child_data, Data for child department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::getDepartments
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetDepartments(array $dep_data, array $child_data)
|
||||
{
|
||||
$arrayDepartments = $this->oDepartment->getDepartments();
|
||||
$this->assertTrue(is_array($arrayDepartments));
|
||||
$this->assertEquals(count($arrayDepartments), 1);
|
||||
$this->assertTrue(is_array($arrayDepartments[0]['dep_children']));
|
||||
$this->assertEquals(count($arrayDepartments[0]['dep_children']), 1);
|
||||
|
||||
$dataParent = $arrayDepartments[0];
|
||||
$this->assertEquals($dep_data['dep_parent'], $dataParent['dep_parent']);
|
||||
$this->assertEquals($dep_data['dep_title'], $dataParent['dep_title']);
|
||||
$this->assertEquals($dep_data['dep_status'], $dataParent['dep_status']);
|
||||
$this->assertEquals($dep_data['dep_manager'], $dataParent['dep_manager']);
|
||||
|
||||
$dataChild = $arrayDepartments[0]['dep_children'][0];
|
||||
$this->assertEquals($child_data['dep_parent'], $dataChild['dep_parent']);
|
||||
$this->assertEquals($child_data['dep_title'], $dataChild['dep_title']);
|
||||
$this->assertEquals($child_data['dep_status'], $dataChild['dep_status']);
|
||||
$this->assertEquals($child_data['dep_manager'], $dataChild['dep_manager']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get department array
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::getDepartment
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetDepartment(array $dep_data)
|
||||
{
|
||||
$dataParent = $this->oDepartment->getDepartment($dep_data['dep_uid']);
|
||||
$this->assertTrue(is_array($dataParent));
|
||||
|
||||
$this->assertEquals($dep_data['dep_parent'], $dataParent['dep_parent']);
|
||||
$this->assertEquals($dep_data['dep_title'], $dataParent['dep_title']);
|
||||
$this->assertEquals($dep_data['dep_status'], $dataParent['dep_status']);
|
||||
$this->assertEquals($dep_data['dep_manager'], $dataParent['dep_manager']);
|
||||
}
|
||||
|
||||
// TODO: Assigned Users to department
|
||||
public function testDeleteDepartmentErrorUsersSelections()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for delete department with children
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @depends testCreateDepartmentChild
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @param array $child_data, Data for child department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::deleteDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Can not delete the department, it has a children department.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteDepartmentErrorDepartmentParent(array $dep_data, array $child_data)
|
||||
{
|
||||
$this->oDepartment->deleteDepartment($dep_data['dep_uid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get departments array
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @depends testCreateDepartmentChild
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @param array $child_data, Data for child department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::deleteDepartment
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteDepartments(array $dep_data, array $child_data)
|
||||
{
|
||||
$this->oDepartment->deleteDepartment($child_data['dep_uid']);
|
||||
$this->oDepartment->deleteDepartment($dep_data['dep_uid']);
|
||||
$dataParent = $this->oDepartment->getDepartments();
|
||||
$this->assertTrue(empty($dataParent));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,204 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Documents Cases Test
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oInputDocument;
|
||||
protected $idCase = '';
|
||||
|
||||
protected static $usrUid = "00000000000000000000000000000001";
|
||||
protected static $proUid = "00000000000000000000000000000002";
|
||||
protected static $tasUid = "00000000000000000000000000000003";
|
||||
protected static $inpUid = "00000000000000000000000000000004";
|
||||
protected static $steUid = "00000000000000000000000000000005";
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$process = new \Process();
|
||||
$process->create(array("type"=>"classicProject", "PRO_TITLE"=> "NEW TEST PHP UNIT", "PRO_DESCRIPTION"=> "465",
|
||||
"PRO_CATEGORY"=> "", "PRO_CREATE_USER"=> "00000000000000000000000000000001",
|
||||
"PRO_UID"=> self::$proUid, "USR_UID"=> "00000000000000000000000000000001"), false);
|
||||
|
||||
$task = new \Task();
|
||||
$task->create(array("TAS_START"=>"TRUE", "TAS_UID"=> self::$tasUid, "PRO_UID"=> self::$proUid, "TAS_TITLE" => "NEW TASK TEST PHP UNIT",
|
||||
"TAS_POSX"=> 581, "TAS_POSY"=> 17, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
|
||||
$inputDocument = new \InputDocument();
|
||||
$inputDocument->create(array("INP_DOC_UID"=> self::$inpUid, "PRO_UID"=> self::$proUid, "INP_DOC_TITLE"=> "INPUTDOCUMENT TEST UNIT", "INP_DOC_FORM_NEEDED"=> "VIRTUAL",
|
||||
"INP_DOC_ORIGINAL"=> "ORIGINAL", "INP_DOC_DESCRIPTION"=> "", "INP_DOC_VERSIONING"=> "",
|
||||
"INP_DOC_DESTINATION_PATH"=> "", "INP_DOC_TAGS"=> "INPUT", "ACCEPT"=> "Save", "BTN_CANCEL"=>"Cancel"));
|
||||
|
||||
$step = new \Step();
|
||||
$step->create(array( "PRO_UID"=> self::$proUid, "TAS_UID"=> self::$tasUid, "STEP_UID"=> self::$steUid, "STEP_TYPE_OBJ" => "INPUT_DOCUMENT", "STEP_UID_OBJ" =>self::$inpUid));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$assign = new \TaskUser();
|
||||
$assign->remove(self::$tasUid, self::$usrUid, 1,1);
|
||||
|
||||
$step = new \Step();
|
||||
$step->remove(self::$steUid);
|
||||
|
||||
$inputDocument = new \InputDocument();
|
||||
$inputDocument->remove(self::$inpUid);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid);
|
||||
|
||||
$process = new \Process();
|
||||
$process->remove(self::$proUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oInputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add a test InputDocument
|
||||
*
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddInputDocument()
|
||||
{
|
||||
\G::loadClass('pmFunctions');
|
||||
$idCase = PMFNewCase(self::$proUid, self::$usrUid, self::$tasUid, array());
|
||||
$case = new \Cases();
|
||||
$appDocUid = $case->addInputDocument(self::$inpUid, $appDocUid = \G::generateUniqueID(), '', 'INPUT',
|
||||
'PHPUNIT TEST', '', $idCase, \AppDelegation::getCurrentIndex($idCase),
|
||||
self::$tasUid, self::$usrUid, "xmlform", PATH_DATA_SITE.'db.php',
|
||||
0, PATH_DATA_SITE.'db.php');
|
||||
$aResponse = array();
|
||||
$aResponse = array_merge(array("idCase" => $idCase, "appDocUid" => $appDocUid, "inpDocUid" => self::$inpUid), $aResponse);
|
||||
return $aResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocuments
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocumentsErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oInputDocument->getCasesInputDocuments('12345678912345678912345678912345678', self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get InputDocuments
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocuments
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocuments(array $aResponse)
|
||||
{
|
||||
$response = $this->oInputDocument->getCasesInputDocuments($aResponse["idCase"], self::$usrUid);
|
||||
$this->assertTrue(is_array($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of task in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocument
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocumentErrorIncorrectCaseValueArray(array $aResponse)
|
||||
{
|
||||
$this->oInputDocument->getCasesInputDocument('12345678912345678912345678912345678', self::$usrUid, $aResponse["appDocUid"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of input document in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocument
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This input document with id: 12345678912345678912345678912345678 doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocumentErrorIncorrectInputDocumentValueArray(array $aResponse)
|
||||
{
|
||||
$this->oInputDocument->getCasesInputDocument($aResponse["idCase"], self::$usrUid, '12345678912345678912345678912345678');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get InputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocument
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oInputDocument->getCasesInputDocument($aResponse["idCase"], self::$usrUid, $aResponse["appDocUid"]);
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of input document in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::removeInputDocument
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This input document with id: 12345678912345678912345678912345678 doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testRemoveInputDocumentErrorIncorrectApplicationValueArray()
|
||||
{
|
||||
$this->oInputDocument->removeInputDocument('12345678912345678912345678912345678');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test remove InputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::removeInputDocument
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testRemoveInputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oInputDocument->removeInputDocument($aResponse["appDocUid"]);
|
||||
$this->assertTrue(empty($response));
|
||||
}
|
||||
}
|
||||
@@ -1,212 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Documents Cases Test
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oOutputDocument;
|
||||
protected $idCase = '';
|
||||
|
||||
protected static $usrUid = "00000000000000000000000000000001";
|
||||
protected static $proUid = "00000000000000000000000000000002";
|
||||
protected static $tasUid = "00000000000000000000000000000003";
|
||||
protected static $outUid = "00000000000000000000000000000004";
|
||||
protected static $steUid = "00000000000000000000000000000005";
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$process = new \Process();
|
||||
$process->create(array("type"=>"classicProject", "PRO_TITLE"=> "NEW TEST PHP UNIT", "PRO_DESCRIPTION"=> "465",
|
||||
"PRO_CATEGORY"=> "", "PRO_CREATE_USER"=> "00000000000000000000000000000001",
|
||||
"PRO_UID"=> self::$proUid, "USR_UID"=> "00000000000000000000000000000001"), false);
|
||||
|
||||
$task = new \Task();
|
||||
$task->create(array("TAS_START"=>"TRUE", "TAS_UID"=> self::$tasUid, "PRO_UID"=> self::$proUid, "TAS_TITLE" => "NEW TASK TEST PHP UNIT",
|
||||
"TAS_POSX"=> 581, "TAS_POSY"=> 17, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
|
||||
$outputDocument = new \OutputDocument();
|
||||
$outputDocument->create(array("OUT_DOC_UID"=> self::$outUid, "PRO_UID"=> self::$proUid, "OUT_DOC_TITLE"=> "NEW OUPUT TEST", "OUT_DOC_FILENAME"=> "NEW_OUPUT_TEST",
|
||||
"OUT_DOC_DESCRIPTION"=> "", "OUT_DOC_REPORT_GENERATOR"=> "HTML2PDF", "OUT_DOC_REPORT_GENERATOR_label"=> "HTML2PDF (Old Version)",
|
||||
"OUT_DOC_LANDSCAPE"=> "", "OUT_DOC_LANDSCAPE_label"=> "Portrait", "OUT_DOC_GENERATE"=> "BOTH", "OUT_DOC_GENERATE_label"=> "BOTH",
|
||||
"OUT_DOC_VERSIONING"=> "", "OUT_DOC_VERSIONING_label"=> "NO", "OUT_DOC_MEDIA"=> "Letter", "OUT_DOC_MEDIA_label"=> "Letter",
|
||||
"OUT_DOC_LEFT_MARGIN"=> "", "OUT_DOC_RIGHT_MARGIN"=> "", "OUT_DOC_TOP_MARGIN"=> "", "OUT_DOC_BOTTOM_MARGIN"=> "",
|
||||
"OUT_DOC_DESTINATION_PATH"=> "", "OUT_DOC_TAGS"=> "", "OUT_DOC_PDF_SECURITY_ENABLED"=> "0", "OUT_DOC_PDF_SECURITY_ENABLED_label"=> "Disabled",
|
||||
"OUT_DOC_PDF_SECURITY_OPEN_PASSWORD"=>"", "OUT_DOC_PDF_SECURITY_OWNER_PASSWORD"=> "", "OUT_DOC_PDF_SECURITY_PERMISSIONS"=> "",
|
||||
"OUT_DOC_OPEN_TYPE"=> "0", "OUT_DOC_OPEN_TYPE_label"=> "Download the file", "BTN_CANCEL"=> "Cancel", "ACCEPT"=> "Save"));
|
||||
|
||||
$step = new \Step();
|
||||
$step->create(array( "PRO_UID"=> self::$proUid, "TAS_UID"=> self::$tasUid, "STEP_UID"=> self::$steUid, "STEP_TYPE_OBJ" => "OUTPUT_DOCUMENT", "STEP_UID_OBJ" =>self::$outUid));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$assign = new \TaskUser();
|
||||
$assign->remove(self::$tasUid, self::$usrUid, 1,1);
|
||||
|
||||
$step = new \Step();
|
||||
$step->remove(self::$steUid);
|
||||
|
||||
$outputDocument = new \OutputDocument();
|
||||
$outputDocument->remove(self::$outUid);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid);
|
||||
|
||||
$process = new \Process();
|
||||
$process->remove(self::$proUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oOutputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add OutputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::addCasesOutputDocument
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCasesOutputDocument()
|
||||
{
|
||||
\G::loadClass('pmFunctions');
|
||||
$idCase = PMFNewCase(self::$proUid, self::$usrUid, self::$tasUid, array());
|
||||
$response = $this->oOutputDocument->addCasesOutputDocument($idCase, self::$outUid, self::$usrUid);
|
||||
$this->assertTrue(is_object($response));
|
||||
$aResponse = json_decode(json_encode($response), true);
|
||||
$aResponse = array_merge(array("idCase" => $idCase), $aResponse);
|
||||
return $aResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of application in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocuments
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocumentsErrorIncorrectApplicationValueArray()
|
||||
{
|
||||
$this->oOutputDocument->getCasesOutputDocuments('12345678912345678912345678912345678', self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get OutputDocuments
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocuments
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocuments(array $aResponse)
|
||||
{
|
||||
$response = $this->oOutputDocument->getCasesOutputDocuments($aResponse["idCase"], self::$usrUid);
|
||||
$this->assertTrue(is_array($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of application in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocument
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocumentErrorIncorrectApplicationValueArray(array $aResponse)
|
||||
{
|
||||
$this->oOutputDocument->getCasesOutputDocument('12345678912345678912345678912345678', self::$usrUid, $aResponse["app_doc_uid"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of output document in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocument
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This output document with id: 12345678912345678912345678912345678 doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocumentErrorIncorrectOutputDocumentValueArray(array $aResponse)
|
||||
{
|
||||
$this->oOutputDocument->getCasesOutputDocument($aResponse["idCase"], self::$usrUid, '12345678912345678912345678912345678');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get OutputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocument
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oOutputDocument->getCasesOutputDocument($aResponse["idCase"], self::$usrUid, $aResponse["app_doc_uid"]);
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of output document in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::removeOutputDocument
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This output document with id: 12345678912345678912345678912345678 doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testRemoveOutputDocumentErrorIncorrectOutputDocumentValueArray()
|
||||
{
|
||||
$this->oOutputDocument->removeOutputDocument('12345678912345678912345678912345678');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test remove OutputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::removeOutputDocument
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testRemoveOutputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oOutputDocument->removeOutputDocument($aResponse["app_doc_uid"]);
|
||||
$this->assertTrue(empty($response));
|
||||
|
||||
//remove Case
|
||||
$case = new \Cases();
|
||||
$case->removeCase( $aResponse["idCase"] );
|
||||
}
|
||||
}
|
||||
@@ -1,320 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
require_once(__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class ProcessCategoryTest
|
||||
*
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class ProcessCategoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $category;
|
||||
protected static $numCategory = 2;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$category = new \ProcessMaker\BusinessModel\ProcessCategory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create categories
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//Create
|
||||
for ($i = 0; $i <= self::$numCategory - 1; $i++) {
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => "PHPUnit My Category " . $i
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertTrue(isset($arrayCategory["CAT_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayCategory;
|
||||
}
|
||||
|
||||
//Create - Japanese characters
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => "テスト(PHPUnitの)",
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertTrue(isset($arrayCategory["CAT_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayCategory;
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update categories
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*/
|
||||
public function testUpdate(array $arrayRecord)
|
||||
{
|
||||
$arrayData = array("CAT_NAME" => "PHPUnit My Category 1...");
|
||||
|
||||
$arrayCategory = self::$category->update($arrayRecord[1]["CAT_UID"], $arrayData);
|
||||
|
||||
$arrayCategory = self::$category->getCategory($arrayRecord[1]["CAT_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertEquals($arrayCategory["CAT_NAME"], $arrayData["CAT_NAME"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get categories
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::getCategories
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*/
|
||||
public function testGetCategories(array $arrayRecord)
|
||||
{
|
||||
$arrayCategory = self::$category->getCategories();
|
||||
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$arrayCategory = self::$category->getCategories(null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayCategory);
|
||||
|
||||
$arrayCategory = self::$category->getCategories(array("filter" => "PHPUnit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertEquals($arrayCategory[0]["CAT_UID"], $arrayRecord[0]["CAT_UID"]);
|
||||
$this->assertEquals($arrayCategory[0]["CAT_NAME"], $arrayRecord[0]["CAT_NAME"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get category
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::getCategory
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*/
|
||||
public function testGetCategory(array $arrayRecord)
|
||||
{
|
||||
//Get
|
||||
$arrayCategory = self::$category->getCategory($arrayRecord[0]["CAT_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertEquals($arrayCategory["CAT_UID"], $arrayRecord[0]["CAT_UID"]);
|
||||
$this->assertEquals($arrayCategory["CAT_NAME"], $arrayRecord[0]["CAT_NAME"]);
|
||||
|
||||
//Get - Japanese characters
|
||||
$arrayCategory = self::$category->getCategory($arrayRecord[self::$numCategory]["CAT_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertEquals($arrayCategory["CAT_UID"], $arrayRecord[self::$numCategory]["CAT_UID"]);
|
||||
$this->assertEquals($arrayCategory["CAT_NAME"], "テスト(PHPUnitの)");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for required data (CAT_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Undefined value for "CAT_NAME", it is required.
|
||||
*/
|
||||
public function testCreateExceptionRequiredDataCatName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAMEX" => "PHPUnit My Category N"
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAT_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAT_NAME", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataCatName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => ""
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for category name existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The category name with CAT_NAME: "PHPUnit My Category 0" already exists.
|
||||
*/
|
||||
public function testCreateExceptionExistsCatName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => "PHPUnit My Category 0"
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayCategory = self::$category->update("", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid category UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The category with CAT_UID: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' does not exist.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidCatUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => "PHPUnit My Category N"
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->update("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAT_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAT_NAME", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidDataCatName(array $arrayRecord)
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => ""
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->update($arrayRecord[0]["CAT_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for category name existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The category name with CAT_NAME: "PHPUnit My Category 0" already exists.
|
||||
*/
|
||||
public function testUpdateExceptionExistsCatName(array $arrayRecord)
|
||||
{
|
||||
$arrayData = $arrayRecord[0];
|
||||
|
||||
$arrayCategory = self::$category->update($arrayRecord[1]["CAT_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete categories
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*/
|
||||
public function testDelete(array $arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
self::$category->delete($value["CAT_UID"]);
|
||||
}
|
||||
|
||||
$arrayCategory = self::$category->getCategories(array("filter" => "PHPUnit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertEmpty($arrayCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid category UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::delete
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The category with CAT_UID: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' does not exist.
|
||||
*/
|
||||
public function testDeleteExceptionInvalidCatUid()
|
||||
{
|
||||
self::$category->delete("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel\Role;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
require_once(__DIR__ . "/../../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class PermissionTest
|
||||
*
|
||||
* @package Tests\BusinessModel\Role
|
||||
*/
|
||||
class PermissionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $role;
|
||||
protected static $roleUid = "";
|
||||
|
||||
protected static $rolePermission;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
//Role
|
||||
self::$role = new \ProcessMaker\BusinessModel\Role();
|
||||
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_0",
|
||||
"ROL_NAME" => "PHPUnit My Role 0"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
|
||||
self::$roleUid = $arrayRole["ROL_UID"];
|
||||
|
||||
//Role and Permission
|
||||
self::$rolePermission = new \ProcessMaker\BusinessModel\Role\Permission();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
self::$role->delete(self::$roleUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test assign permissions to role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//Permission
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "AVAILABLE-PERMISSIONS", array("filter" => "V"));
|
||||
|
||||
$this->assertNotEmpty($arrayPermission);
|
||||
|
||||
//Role and Permission - Create
|
||||
foreach ($arrayPermission as $value) {
|
||||
$perUid = $value["PER_UID"];
|
||||
|
||||
$arrayRolePermission = self::$rolePermission->create(self::$roleUid, array("PER_UID" => $perUid));
|
||||
|
||||
$this->assertTrue(is_array($arrayRolePermission));
|
||||
$this->assertNotEmpty($arrayRolePermission);
|
||||
|
||||
$this->assertTrue(isset($arrayRolePermission["ROL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayRolePermission;
|
||||
}
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get assigned permissions to role
|
||||
* Test get available permissions to assign to role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::getPermissions
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the role-permission
|
||||
*/
|
||||
public function testGetPermissions(array $arrayRecord)
|
||||
{
|
||||
//PERMISSIONS
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "PERMISSIONS");
|
||||
|
||||
$this->assertNotEmpty($arrayPermission);
|
||||
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "PERMISSIONS", null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayPermission);
|
||||
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "PERMISSIONS", array("filter" => "V"));
|
||||
|
||||
$this->assertTrue(is_array($arrayPermission));
|
||||
$this->assertNotEmpty($arrayPermission);
|
||||
|
||||
$this->assertEquals($arrayPermission[0]["PER_UID"], $arrayRecord[0]["PER_UID"]);
|
||||
|
||||
//AVAILABLE-PERMISSIONS
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "AVAILABLE-PERMISSIONS", null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayPermission);
|
||||
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "AVAILABLE-PERMISSIONS", array("filter" => "V"));
|
||||
|
||||
$this->assertEmpty($arrayPermission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayRolePermission = self::$rolePermission->create(self::$roleUid, $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid role UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role with ROL_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testCreateExceptionInvalidRolUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"USR_UID" => "",
|
||||
);
|
||||
|
||||
$arrayRolePermission = self::$rolePermission->create("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (PER_UID)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "PER_UID", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataPerUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"PER_UID" => "",
|
||||
);
|
||||
|
||||
$arrayRolePermission = self::$rolePermission->create(self::$roleUid, $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test unassign permissions of the role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the role-permission
|
||||
*/
|
||||
public function testDelete(array $arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
$perUid = $value["PER_UID"];
|
||||
|
||||
self::$rolePermission->delete(self::$roleUid, $perUid);
|
||||
}
|
||||
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "PERMISSIONS", array("filter" => "V"));
|
||||
|
||||
$this->assertTrue(is_array($arrayPermission));
|
||||
$this->assertEmpty($arrayPermission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid permission UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::delete
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The permission with PER_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testDeleteExceptionInvalidPerUid()
|
||||
{
|
||||
self::$rolePermission->delete(self::$roleUid, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,225 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel\Role;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
require_once(__DIR__ . "/../../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class UserTest
|
||||
*
|
||||
* @package Tests\BusinessModel\Role
|
||||
*/
|
||||
class UserTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $user;
|
||||
protected static $roleUser;
|
||||
protected static $numUser = 2;
|
||||
protected static $roleUid = "00000000000000000000000000000002"; //PROCESSMAKER_ADMIN
|
||||
|
||||
protected static $arrayUsrUid = array();
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$user = new \ProcessMaker\BusinessModel\User();
|
||||
self::$roleUser = new \ProcessMaker\BusinessModel\Role\User();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
foreach (self::$arrayUsrUid as $value) {
|
||||
$usrUid = $value;
|
||||
|
||||
self::$user->delete($usrUid);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test assign users to role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//User
|
||||
$arrayAux = explode("-", date("Y-m-d"));
|
||||
$dueDate = date("Y-m-d", mktime(0, 0, 0, $arrayAux[1], $arrayAux[2] + 5, $arrayAux[0]));
|
||||
|
||||
for ($i = 0; $i <= self::$numUser - 1; $i++) {
|
||||
$arrayData = array(
|
||||
"USR_USERNAME" => "userphpunit" . $i,
|
||||
"USR_FIRSTNAME" => "userphpunit" . $i,
|
||||
"USR_LASTNAME" => "userphpunit" . $i,
|
||||
"USR_EMAIL" => "userphpunit@email.com" . $i,
|
||||
"USR_COUNTRY" => "",
|
||||
"USR_ADDRESS" => "",
|
||||
"USR_PHONE" => "",
|
||||
"USR_ZIP_CODE" => "",
|
||||
"USR_POSITION" => "",
|
||||
"USR_REPLACED_BY" => "",
|
||||
"USR_DUE_DATE" => $dueDate,
|
||||
"USR_ROLE" => "PROCESSMAKER_OPERATOR",
|
||||
"USR_STATUS" => "ACTIVE",
|
||||
"USR_NEW_PASS" => "userphpunit" . $i,
|
||||
"USR_CNF_PASS" => "userphpunit" . $i
|
||||
);
|
||||
|
||||
$arrayUser = array_change_key_case(self::$user->create($arrayData), CASE_UPPER);
|
||||
|
||||
self::$arrayUsrUid[] = $arrayUser["USR_UID"];
|
||||
$arrayRecord[] = $arrayUser;
|
||||
}
|
||||
|
||||
//Role and User - Create
|
||||
foreach ($arrayRecord as $value) {
|
||||
$usrUid = $value["USR_UID"];
|
||||
|
||||
$arrayRoleUser = self::$roleUser->create(self::$roleUid, array("USR_UID" => $usrUid));
|
||||
|
||||
$this->assertTrue(is_array($arrayRoleUser));
|
||||
$this->assertNotEmpty($arrayRoleUser);
|
||||
|
||||
$this->assertTrue(isset($arrayRoleUser["ROL_UID"]));
|
||||
}
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get assigned users to role
|
||||
* Test get available users to assign to role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::getUsers
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the users
|
||||
*/
|
||||
public function testGetUsers(array $arrayRecord)
|
||||
{
|
||||
//USERS
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "USERS");
|
||||
|
||||
$this->assertNotEmpty($arrayUser);
|
||||
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "USERS", null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayUser);
|
||||
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "USERS", array("filter" => "userphpunit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayUser));
|
||||
$this->assertNotEmpty($arrayUser);
|
||||
|
||||
$this->assertEquals($arrayUser[0]["USR_UID"], $arrayRecord[0]["USR_UID"]);
|
||||
$this->assertEquals($arrayUser[0]["USR_USERNAME"], $arrayRecord[0]["USR_USERNAME"]);
|
||||
|
||||
//AVAILABLE-USERS
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "AVAILABLE-USERS", null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayUser);
|
||||
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "AVAILABLE-USERS", array("filter" => "userphpunit"));
|
||||
|
||||
$this->assertEmpty($arrayUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayRoleUser = self::$roleUser->create(self::$roleUid, $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid role UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role with ROL_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testCreateExceptionInvalidRolUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"USR_UID" => "",
|
||||
);
|
||||
|
||||
$arrayRoleUser = self::$roleUser->create("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (USR_UID)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "USR_UID", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataUsrUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"USR_UID" => "",
|
||||
);
|
||||
|
||||
$arrayRoleUser = self::$roleUser->create(self::$roleUid, $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test unassign users of the role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the users
|
||||
*/
|
||||
public function testDelete(array $arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
$usrUid = $value["USR_UID"];
|
||||
|
||||
self::$roleUser->delete(self::$roleUid, $usrUid);
|
||||
}
|
||||
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "USERS", array("filter" => "userphpunit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayUser));
|
||||
$this->assertEmpty($arrayUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for administrator's role can't be changed
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::delete
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The administrator's role can't be changed!
|
||||
*/
|
||||
public function testDeleteExceptionAdminRoleCantChanged()
|
||||
{
|
||||
self::$roleUser->delete(self::$roleUid, "00000000000000000000000000000001");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,330 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
require_once(__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class RoleTest
|
||||
*
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class RoleTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $role;
|
||||
protected static $numRole = 2;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$role = new \ProcessMaker\BusinessModel\Role();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create roles
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//Create
|
||||
for ($i = 0; $i <= self::$numRole - 1; $i++) {
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_" . $i,
|
||||
"ROL_NAME" => "PHPUnit My Role " . $i
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertTrue(isset($arrayRole["ROL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayRole;
|
||||
}
|
||||
|
||||
//Create - Japanese characters
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_" . self::$numRole,
|
||||
"ROL_NAME" => "テスト(PHPUnitの)",
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertTrue(isset($arrayRole["ROL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayRole;
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update roles
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*/
|
||||
public function testUpdate(array $arrayRecord)
|
||||
{
|
||||
$arrayData = array("ROL_NAME" => "PHPUnit My Role ...");
|
||||
|
||||
$arrayRole = self::$role->update($arrayRecord[1]["ROL_UID"], $arrayData);
|
||||
|
||||
$arrayRole = self::$role->getRole($arrayRecord[1]["ROL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertEquals($arrayRole["ROL_NAME"], $arrayData["ROL_NAME"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get roles
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::getRoles
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*/
|
||||
public function testGetRoles(array $arrayRecord)
|
||||
{
|
||||
$arrayRole = self::$role->getRoles();
|
||||
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$arrayRole = self::$role->getRoles(null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayRole);
|
||||
|
||||
$arrayRole = self::$role->getRoles(array("filter" => "PHPUNIT"));
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertEquals($arrayRole[0]["ROL_UID"], $arrayRecord[0]["ROL_UID"]);
|
||||
$this->assertEquals($arrayRole[0]["ROL_CODE"], $arrayRecord[0]["ROL_CODE"]);
|
||||
$this->assertEquals($arrayRole[0]["ROL_NAME"], $arrayRecord[0]["ROL_NAME"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::getRole
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*/
|
||||
public function testGetRole(array $arrayRecord)
|
||||
{
|
||||
//Get
|
||||
$arrayRole = self::$role->getRole($arrayRecord[0]["ROL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertEquals($arrayRole["ROL_UID"], $arrayRecord[0]["ROL_UID"]);
|
||||
$this->assertEquals($arrayRole["ROL_CODE"], $arrayRecord[0]["ROL_CODE"]);
|
||||
$this->assertEquals($arrayRole["ROL_NAME"], $arrayRecord[0]["ROL_NAME"]);
|
||||
|
||||
//Get - Japanese characters
|
||||
$arrayRole = self::$role->getRole($arrayRecord[self::$numRole]["ROL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertEquals($arrayRole["ROL_UID"], $arrayRecord[self::$numRole]["ROL_UID"]);
|
||||
$this->assertEquals($arrayRole["ROL_CODE"], "PHPUNIT_MY_ROLE_" . self::$numRole);
|
||||
$this->assertEquals($arrayRole["ROL_NAME"], "テスト(PHPUnitの)");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for required data (ROL_CODE)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Undefined value for "ROL_CODE", it is required.
|
||||
*/
|
||||
public function testCreateExceptionRequiredDataRolCode()
|
||||
{
|
||||
$arrayData = array(
|
||||
//"ROL_CODE" => "PHPUNIT_MY_ROLE_N",
|
||||
"ROL_NAME" => "PHPUnit My Role N"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (ROL_CODE)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "ROL_CODE", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataRolCode()
|
||||
{
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "",
|
||||
"ROL_NAME" => "PHPUnit My Role N"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for role code existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role code with ROL_CODE: "PHPUNIT_MY_ROLE_0" already exists.
|
||||
*/
|
||||
public function testCreateExceptionExistsRolCode()
|
||||
{
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_0",
|
||||
"ROL_NAME" => "PHPUnit My Role 0"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayRole = self::$role->update("", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid role UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role with ROL_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidRolUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_N",
|
||||
"ROL_NAME" => "PHPUnit My Role N"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->update("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (ROL_CODE)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "ROL_CODE", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidDataRolCode(array $arrayRecord)
|
||||
{
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "",
|
||||
"ROL_NAME" => "PHPUnit My Role 0"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->update($arrayRecord[0]["ROL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for role code existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role code with ROL_CODE: "PHPUNIT_MY_ROLE_1" already exists.
|
||||
*/
|
||||
public function testUpdateExceptionExistsRolCode(array $arrayRecord)
|
||||
{
|
||||
$arrayData = $arrayRecord[1];
|
||||
|
||||
$arrayRole = self::$role->update($arrayRecord[0]["ROL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete roles
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*/
|
||||
public function testDelete(array $arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
self::$role->delete($value["ROL_UID"]);
|
||||
}
|
||||
|
||||
$arrayRole = self::$role->getRoles(array("filter" => "PHPUNIT"));
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertEmpty($arrayRole);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for role UID that cannot be deleted
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::delete
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This role cannot be deleted while it still has some assigned users.
|
||||
*/
|
||||
public function testDeleteExceptionCannotDeleted()
|
||||
{
|
||||
self::$role->delete("00000000000000000000000000000002");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,315 +0,0 @@
|
||||
<?php
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../bootstrap.php";
|
||||
}
|
||||
|
||||
use \BpmnActivity;
|
||||
|
||||
/**
|
||||
* Class BpmnActivityTest
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnActivityTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $prjUid = "00000000000000000000000000000001";
|
||||
protected static $diaUid = "18171550f1198ddc8642045664020352";
|
||||
protected static $proUid = "155064020352f1198ddc864204561817";
|
||||
|
||||
protected static $data1;
|
||||
protected static $data2;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$project = new \BpmnProject();
|
||||
$project->setPrjUid(self::$prjUid);
|
||||
$project->setPrjName("Dummy Project");
|
||||
$project->save();
|
||||
|
||||
$process = new \BpmnDiagram();
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->save();
|
||||
|
||||
$process = new \BpmnProcess();
|
||||
$process->setProUid(self::$proUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->save();
|
||||
|
||||
self::$data1 = array(
|
||||
"ACT_UID" => "864215906402045618170352f1198ddc",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => "51",
|
||||
"BOU_Y" => "52"
|
||||
);
|
||||
|
||||
self::$data2 = array(
|
||||
"ACT_UID" => "70352f1198ddc8642159064020456181",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => "53",
|
||||
"BOU_Y" => "54"
|
||||
);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$activities = BpmnActivity::findAllBy(BpmnActivityPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($activities as $activity) {
|
||||
$activity->delete();
|
||||
}
|
||||
|
||||
$bounds = BpmnBound::findAllBy(BpmnBoundPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($bounds as $bound) {
|
||||
$bound->delete();
|
||||
}
|
||||
|
||||
$process = BpmnProcessPeer::retrieveByPK(self::$proUid);
|
||||
$process->delete();
|
||||
|
||||
$diagram = BpmnDiagramPeer::retrieveByPK(self::$diaUid);
|
||||
$diagram->delete();
|
||||
|
||||
$project = BpmnProjectPeer::retrieveByPK(self::$prjUid);
|
||||
$project->delete();
|
||||
}
|
||||
|
||||
public function testNew()
|
||||
{
|
||||
$activity = new BpmnActivity();
|
||||
$activity->setActUid(self::$data1["ACT_UID"]);
|
||||
$activity->setPrjUid(self::$data1["PRJ_UID"]);
|
||||
$activity->setProUid(self::$data1["PRO_UID"]);
|
||||
$activity->setActName(self::$data1["ACT_NAME"]);
|
||||
$activity->getBound()->setBouX(self::$data1["BOU_X"]);
|
||||
$activity->getBound()->setBouY(self::$data1["BOU_Y"]);
|
||||
$activity->save();
|
||||
|
||||
$activity2 = BpmnActivityPeer::retrieveByPK($activity->getActUid());
|
||||
|
||||
$this->assertNotNull($activity2);
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
public function testNewUsingFromArray()
|
||||
{
|
||||
$activity = new BpmnActivity();
|
||||
$activity->fromArray(self::$data2);
|
||||
|
||||
$activity->save();
|
||||
|
||||
$activity2 = BpmnActivityPeer::retrieveByPK($activity->getActUid());
|
||||
|
||||
$this->assertNotNull($activity2);
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param $activity \BpmnActivity
|
||||
*/
|
||||
public function testToArrayFromTestNew($activity)
|
||||
{
|
||||
$expected = array(
|
||||
"ACT_UID" => self::$data1["ACT_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"ACT_NAME" => self::$data1["ACT_NAME"],
|
||||
"ACT_TYPE" => "TASK",
|
||||
"ACT_IS_FOR_COMPENSATION" => "0",
|
||||
"ACT_START_QUANTITY" => "1",
|
||||
"ACT_COMPLETION_QUANTITY" => "1",
|
||||
"ACT_TASK_TYPE" => "EMPTY",
|
||||
"ACT_IMPLEMENTATION" => "",
|
||||
"ACT_INSTANTIATE" => "0",
|
||||
"ACT_SCRIPT_TYPE" => "",
|
||||
"ACT_SCRIPT" => "",
|
||||
"ACT_LOOP_TYPE" => "NONE",
|
||||
"ACT_TEST_BEFORE" => "0",
|
||||
"ACT_LOOP_MAXIMUM" => "0",
|
||||
"ACT_LOOP_CONDITION" => "",
|
||||
"ACT_LOOP_CARDINALITY" => "0",
|
||||
"ACT_LOOP_BEHAVIOR" => "NONE",
|
||||
"ACT_IS_ADHOC" => "0",
|
||||
"ACT_IS_COLLAPSED" => "1",
|
||||
"ACT_COMPLETION_CONDITION" => "",
|
||||
"ACT_ORDERING" => "PARALLEL",
|
||||
"ACT_CANCEL_REMAINING_INSTANCES" => "1",
|
||||
"ACT_PROTOCOL" => "",
|
||||
"ACT_METHOD" => "",
|
||||
"ACT_IS_GLOBAL" => "0",
|
||||
"ACT_REFERER" => "",
|
||||
"ACT_DEFAULT_FLOW" => "",
|
||||
"ACT_MASTER_DIAGRAM" => "",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["ACT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnActivity",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => "0",
|
||||
"BOU_HEIGHT" => "0",
|
||||
"BOU_REL_POSITION" => "0",
|
||||
"BOU_SIZE_IDENTICAL" => "0",
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $activity->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNewUsingFromArray
|
||||
*/
|
||||
public function testToArrayFromTestNewUsingFromArray($activity)
|
||||
{
|
||||
$expected = array(
|
||||
"ACT_UID" => self::$data2["ACT_UID"],
|
||||
"PRJ_UID" => self::$data2["PRJ_UID"],
|
||||
"PRO_UID" => self::$data2["PRO_UID"],
|
||||
"ACT_NAME" => self::$data2["ACT_NAME"],
|
||||
"ACT_TYPE" => "TASK",
|
||||
"ACT_IS_FOR_COMPENSATION" => "0",
|
||||
"ACT_START_QUANTITY" => "1",
|
||||
"ACT_COMPLETION_QUANTITY" => "1",
|
||||
"ACT_TASK_TYPE" => "EMPTY",
|
||||
"ACT_IMPLEMENTATION" => "",
|
||||
"ACT_INSTANTIATE" => "0",
|
||||
"ACT_SCRIPT_TYPE" => "",
|
||||
"ACT_SCRIPT" => "",
|
||||
"ACT_LOOP_TYPE" => "NONE",
|
||||
"ACT_TEST_BEFORE" => "0",
|
||||
"ACT_LOOP_MAXIMUM" => "0",
|
||||
"ACT_LOOP_CONDITION" => "",
|
||||
"ACT_LOOP_CARDINALITY" => "0",
|
||||
"ACT_LOOP_BEHAVIOR" => "NONE",
|
||||
"ACT_IS_ADHOC" => "0",
|
||||
"ACT_IS_COLLAPSED" => "1",
|
||||
"ACT_COMPLETION_CONDITION" => "",
|
||||
"ACT_ORDERING" => "PARALLEL",
|
||||
"ACT_CANCEL_REMAINING_INSTANCES" => "1",
|
||||
"ACT_PROTOCOL" => "",
|
||||
"ACT_METHOD" => "",
|
||||
"ACT_IS_GLOBAL" => "0",
|
||||
"ACT_REFERER" => "",
|
||||
"ACT_DEFAULT_FLOW" => "",
|
||||
"ACT_MASTER_DIAGRAM" => "",
|
||||
"DIA_UID" => "18171550f1198ddc8642045664020352",
|
||||
"ELEMENT_UID" => self::$data2["ACT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnActivity",
|
||||
"BOU_X" => self::$data2["BOU_X"],
|
||||
"BOU_Y" => self::$data2["BOU_Y"],
|
||||
"BOU_WIDTH" => "0",
|
||||
"BOU_HEIGHT" => "0",
|
||||
"BOU_REL_POSITION" => "0",
|
||||
"BOU_SIZE_IDENTICAL" => "0",
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $activity->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
{
|
||||
$activity = BpmnActivityPeer::retrieveByPK(self::$data1["ACT_UID"]);
|
||||
|
||||
$expected = array(
|
||||
"ACT_UID" => self::$data1["ACT_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"ACT_NAME" => self::$data1["ACT_NAME"],
|
||||
"ACT_TYPE" => "TASK",
|
||||
"ACT_IS_FOR_COMPENSATION" => "0",
|
||||
"ACT_START_QUANTITY" => "1",
|
||||
"ACT_COMPLETION_QUANTITY" => "1",
|
||||
"ACT_TASK_TYPE" => "EMPTY",
|
||||
"ACT_IMPLEMENTATION" => "",
|
||||
"ACT_INSTANTIATE" => "0",
|
||||
"ACT_SCRIPT_TYPE" => "",
|
||||
"ACT_SCRIPT" => "",
|
||||
"ACT_LOOP_TYPE" => "NONE",
|
||||
"ACT_TEST_BEFORE" => "0",
|
||||
"ACT_LOOP_MAXIMUM" => "0",
|
||||
"ACT_LOOP_CONDITION" => "",
|
||||
"ACT_LOOP_CARDINALITY" => "0",
|
||||
"ACT_LOOP_BEHAVIOR" => "NONE",
|
||||
"ACT_IS_ADHOC" => "0",
|
||||
"ACT_IS_COLLAPSED" => "1",
|
||||
"ACT_COMPLETION_CONDITION" => "",
|
||||
"ACT_ORDERING" => "PARALLEL",
|
||||
"ACT_CANCEL_REMAINING_INSTANCES" => "1",
|
||||
"ACT_PROTOCOL" => "",
|
||||
"ACT_METHOD" => "",
|
||||
"ACT_IS_GLOBAL" => "0",
|
||||
"ACT_REFERER" => "",
|
||||
"ACT_DEFAULT_FLOW" => "",
|
||||
"ACT_MASTER_DIAGRAM" => "",
|
||||
"DIA_UID" => "18171550f1198ddc8642045664020352",
|
||||
"ELEMENT_UID" => self::$data1["ACT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnActivity",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => "0",
|
||||
"BOU_HEIGHT" => "0",
|
||||
"BOU_REL_POSITION" => "0",
|
||||
"BOU_SIZE_IDENTICAL" => "0",
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $activity->toArray();
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $activity1 \BpmnActivity
|
||||
* @param $activity2 \BpmnActivity
|
||||
*/
|
||||
public function testDelete($activity1, $activity2)
|
||||
{
|
||||
$actUid = $activity1->getActUid();
|
||||
$activity = BpmnActivityPeer::retrieveByPK($actUid);
|
||||
$activity->delete();
|
||||
|
||||
$this->assertNull(BpmnActivityPeer::retrieveByPK($actUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Activity", $actUid));
|
||||
|
||||
|
||||
$actUid = $activity2->getActUid();
|
||||
$activity = BpmnActivityPeer::retrieveByPK($actUid);
|
||||
$activity->delete();
|
||||
|
||||
$this->assertNull(BpmnActivityPeer::retrieveByPK($actUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Activity", $actUid));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,297 +0,0 @@
|
||||
<?php
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../bootstrap.php";
|
||||
}
|
||||
|
||||
use \BpmnEvent;
|
||||
|
||||
/**
|
||||
* Class BpmnEventTest
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnEventTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $prjUid = "00000000000000000000000000000001";
|
||||
protected static $diaUid = "18171550f1198ddc8642045664020352";
|
||||
protected static $proUid = "155064020352f1198ddc864204561817";
|
||||
|
||||
protected static $data1;
|
||||
protected static $data2;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$project = new \BpmnProject();
|
||||
$project->setPrjUid(self::$prjUid);
|
||||
$project->setPrjName("Dummy Project");
|
||||
$project->save();
|
||||
|
||||
$process = new \BpmnDiagram();
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->save();
|
||||
|
||||
$process = new \BpmnProcess();
|
||||
$process->setProUid(self::$proUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->save();
|
||||
|
||||
self::$data1 = array(
|
||||
"EVN_UID" => "864215906402045618170352f1198ddc",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"EVN_NAME" => "Event #1",
|
||||
"EVN_TYPE" => "START",
|
||||
"BOU_X" => 51,
|
||||
"BOU_Y" => 52
|
||||
);
|
||||
|
||||
self::$data2 = array(
|
||||
"EVN_UID" => "70352f1198ddc8642159064020456181",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"EVN_NAME" => "Event #2",
|
||||
"EVN_TYPE" => "END",
|
||||
"BOU_X" => 53,
|
||||
"BOU_Y" => 54
|
||||
);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$events = BpmnEvent::findAllBy(BpmnEventPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($events as $event) {
|
||||
$event->delete();
|
||||
}
|
||||
|
||||
$bounds = BpmnBound::findAllBy(BpmnBoundPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($bounds as $bound) {
|
||||
$bound->delete();
|
||||
}
|
||||
|
||||
$process = BpmnProcessPeer::retrieveByPK(self::$proUid);
|
||||
$process->delete();
|
||||
|
||||
$diagram = BpmnDiagramPeer::retrieveByPK(self::$diaUid);
|
||||
$diagram->delete();
|
||||
|
||||
$project = BpmnProjectPeer::retrieveByPK(self::$prjUid);
|
||||
$project->delete();
|
||||
}
|
||||
|
||||
public function testNew()
|
||||
{
|
||||
$event = new BpmnEvent();
|
||||
$event->setEvnUid(self::$data1["EVN_UID"]);
|
||||
$event->setPrjUid(self::$data1["PRJ_UID"]);
|
||||
$event->setProUid(self::$data1["PRO_UID"]);
|
||||
$event->setEvnName(self::$data1["EVN_NAME"]);
|
||||
$event->setEvnType(self::$data1["EVN_TYPE"]);
|
||||
$event->getBound()->setBouX(self::$data1["BOU_X"]);
|
||||
$event->getBound()->setBouY(self::$data1["BOU_Y"]);
|
||||
$event->save();
|
||||
|
||||
$event2 = BpmnEventPeer::retrieveByPK($event->getEvnUid());
|
||||
|
||||
$this->assertNotNull($event2);
|
||||
|
||||
return $event;
|
||||
}
|
||||
|
||||
public function testNewUsingFromArray()
|
||||
{
|
||||
$event = new BpmnEvent();
|
||||
$event->fromArray(self::$data2);
|
||||
$event->save();
|
||||
|
||||
$event2 = BpmnEventPeer::retrieveByPK($event->getEvnUid());
|
||||
|
||||
$this->assertNotNull($event2);
|
||||
|
||||
return $event;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param $event \BpmnEvent
|
||||
*/
|
||||
public function testToArrayFromTestNew($event)
|
||||
{
|
||||
$expected = array(
|
||||
"EVN_UID" => self::$data1["EVN_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"EVN_NAME" => self::$data1["EVN_NAME"],
|
||||
"EVN_TYPE" => self::$data1["EVN_TYPE"],
|
||||
"EVN_MARKER" => "EMPTY",
|
||||
"EVN_IS_INTERRUPTING" => 1,
|
||||
"EVN_ATTACHED_TO" => "",
|
||||
"EVN_CANCEL_ACTIVITY" => 0,
|
||||
"EVN_ACTIVITY_REF" => "",
|
||||
"EVN_WAIT_FOR_COMPLETION" => 1,
|
||||
"EVN_ERROR_NAME" => null,
|
||||
"EVN_ERROR_CODE" => null,
|
||||
"EVN_ESCALATION_NAME" => null,
|
||||
"EVN_ESCALATION_CODE" => null,
|
||||
"EVN_CONDITION" => null,
|
||||
"EVN_MESSAGE" => null,
|
||||
"EVN_OPERATION_NAME" => null,
|
||||
"EVN_OPERATION_IMPLEMENTATION_REF" => null,
|
||||
"EVN_TIME_DATE" => null,
|
||||
"EVN_TIME_CYCLE" => null,
|
||||
"EVN_TIME_DURATION" => null,
|
||||
"EVN_BEHAVIOR" => "CATCH",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["EVN_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnEvent",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $event->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $event \BpmnEvent
|
||||
*/
|
||||
public function testToArrayFromTestNewUsingFromArray($event)
|
||||
{
|
||||
$expected = array(
|
||||
"EVN_UID" => self::$data2["EVN_UID"],
|
||||
"PRJ_UID" => self::$data2["PRJ_UID"],
|
||||
"PRO_UID" => self::$data2["PRO_UID"],
|
||||
"EVN_NAME" => self::$data2["EVN_NAME"],
|
||||
"EVN_TYPE" => self::$data2["EVN_TYPE"],
|
||||
"EVN_MARKER" => "EMPTY",
|
||||
"EVN_IS_INTERRUPTING" => 1,
|
||||
"EVN_ATTACHED_TO" => "",
|
||||
"EVN_CANCEL_ACTIVITY" => 0,
|
||||
"EVN_ACTIVITY_REF" => "",
|
||||
"EVN_WAIT_FOR_COMPLETION" => 1,
|
||||
"EVN_ERROR_NAME" => null,
|
||||
"EVN_ERROR_CODE" => null,
|
||||
"EVN_ESCALATION_NAME" => null,
|
||||
"EVN_ESCALATION_CODE" => null,
|
||||
"EVN_CONDITION" => null,
|
||||
"EVN_MESSAGE" => null,
|
||||
"EVN_OPERATION_NAME" => null,
|
||||
"EVN_OPERATION_IMPLEMENTATION_REF" => null,
|
||||
"EVN_TIME_DATE" => null,
|
||||
"EVN_TIME_CYCLE" => null,
|
||||
"EVN_TIME_DURATION" => null,
|
||||
"EVN_BEHAVIOR" => "CATCH",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data2["EVN_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnEvent",
|
||||
"BOU_X" => self::$data2["BOU_X"],
|
||||
"BOU_Y" => self::$data2["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $event->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
{
|
||||
$event = BpmnEventPeer::retrieveByPK(self::$data1["EVN_UID"]);
|
||||
|
||||
$expected = array(
|
||||
"EVN_UID" => self::$data1["EVN_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"EVN_NAME" => self::$data1["EVN_NAME"],
|
||||
"EVN_TYPE" => self::$data1["EVN_TYPE"],
|
||||
"EVN_MARKER" => "EMPTY",
|
||||
"EVN_IS_INTERRUPTING" => 1,
|
||||
"EVN_ATTACHED_TO" => "",
|
||||
"EVN_CANCEL_ACTIVITY" => 0,
|
||||
"EVN_ACTIVITY_REF" => "",
|
||||
"EVN_WAIT_FOR_COMPLETION" => 1,
|
||||
"EVN_ERROR_NAME" => null,
|
||||
"EVN_ERROR_CODE" => null,
|
||||
"EVN_ESCALATION_NAME" => null,
|
||||
"EVN_ESCALATION_CODE" => null,
|
||||
"EVN_CONDITION" => null,
|
||||
"EVN_MESSAGE" => null,
|
||||
"EVN_OPERATION_NAME" => null,
|
||||
"EVN_OPERATION_IMPLEMENTATION_REF" => null,
|
||||
"EVN_TIME_DATE" => null,
|
||||
"EVN_TIME_CYCLE" => null,
|
||||
"EVN_TIME_DURATION" => null,
|
||||
"EVN_BEHAVIOR" => "CATCH",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["EVN_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnEvent",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $event->toArray();
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $event1 \BpmnEvent
|
||||
* @param $event2 \BpmnEvent
|
||||
*/
|
||||
public function testDelete($event1, $event2)
|
||||
{
|
||||
$gatUid = $event1->getEvnUid();
|
||||
$event = BpmnEventPeer::retrieveByPK($gatUid);
|
||||
$event->delete();
|
||||
|
||||
$this->assertNull(BpmnEventPeer::retrieveByPK($gatUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Event", $gatUid));
|
||||
|
||||
|
||||
$gatUid = $event2->getEvnUid();
|
||||
$event = BpmnEventPeer::retrieveByPK($gatUid);
|
||||
$event->delete();
|
||||
|
||||
$this->assertNull(BpmnEventPeer::retrieveByPK($gatUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Event", $gatUid));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,262 +0,0 @@
|
||||
<?php
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../bootstrap.php";
|
||||
}
|
||||
|
||||
use \BpmnGateway;
|
||||
|
||||
|
||||
/**
|
||||
* Class BpmnGatewayTest
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnGatewayTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $prjUid = "00000000000000000000000000000001";
|
||||
protected static $diaUid = "18171550f1198ddc8642045664020352";
|
||||
protected static $proUid = "155064020352f1198ddc864204561817";
|
||||
|
||||
protected static $data1;
|
||||
protected static $data2;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$project = new \BpmnProject();
|
||||
$project->setPrjUid(self::$prjUid);
|
||||
$project->setPrjName("Dummy Project");
|
||||
$project->save();
|
||||
|
||||
$process = new \BpmnDiagram();
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->save();
|
||||
|
||||
$process = new \BpmnProcess();
|
||||
$process->setProUid(self::$proUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->save();
|
||||
|
||||
self::$data1 = array(
|
||||
"GAT_UID" => "864215906402045618170352f1198ddc",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"GAT_NAME" => "Gateway #1",
|
||||
"GAT_TYPE" => "SELECTION",
|
||||
"BOU_X" => 51,
|
||||
"BOU_Y" => 52
|
||||
);
|
||||
|
||||
self::$data2 = array(
|
||||
"GAT_UID" => "70352f1198ddc8642159064020456181",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"GAT_NAME" => "Gateway #2",
|
||||
"GAT_TYPE" => "EVALUATION",
|
||||
"BOU_X" => 53,
|
||||
"BOU_Y" => 54
|
||||
);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$gateways = BpmnGateway::findAllBy(BpmnGatewayPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($gateways as $gateway) {
|
||||
$gateway->delete();
|
||||
}
|
||||
|
||||
$bounds = BpmnBound::findAllBy(BpmnBoundPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($bounds as $bound) {
|
||||
$bound->delete();
|
||||
}
|
||||
|
||||
$process = BpmnProcessPeer::retrieveByPK(self::$proUid);
|
||||
$process->delete();
|
||||
|
||||
$diagram = BpmnDiagramPeer::retrieveByPK(self::$diaUid);
|
||||
$diagram->delete();
|
||||
|
||||
$project = BpmnProjectPeer::retrieveByPK(self::$prjUid);
|
||||
$project->delete();
|
||||
}
|
||||
|
||||
public function testNew()
|
||||
{
|
||||
$gateway = new BpmnGateway();
|
||||
$gateway->setGatUid(self::$data1["GAT_UID"]);
|
||||
$gateway->setPrjUid(self::$data1["PRJ_UID"]);
|
||||
$gateway->setProUid(self::$data1["PRO_UID"]);
|
||||
$gateway->setGatName(self::$data1["GAT_NAME"]);
|
||||
$gateway->setGatType(self::$data1["GAT_TYPE"]);
|
||||
$gateway->getBound()->setBouX(self::$data1["BOU_X"]);
|
||||
$gateway->getBound()->setBouY(self::$data1["BOU_Y"]);
|
||||
$gateway->save();
|
||||
|
||||
$gateway2 = BpmnGatewayPeer::retrieveByPK($gateway->getGatUid());
|
||||
|
||||
$this->assertNotNull($gateway2);
|
||||
|
||||
return $gateway;
|
||||
}
|
||||
|
||||
public function testNewUsingFromArray()
|
||||
{
|
||||
$gateway = new BpmnGateway();
|
||||
$gateway->fromArray(self::$data2);
|
||||
$gateway->save();
|
||||
|
||||
$gateway2 = BpmnGatewayPeer::retrieveByPK($gateway->getGatUid());
|
||||
|
||||
$this->assertNotNull($gateway2);
|
||||
|
||||
return $gateway;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param $gateway \BpmnGateway
|
||||
*/
|
||||
public function testToArrayFromTestNew($gateway)
|
||||
{
|
||||
$expected = array(
|
||||
"GAT_UID" => self::$data1["GAT_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"GAT_NAME" => self::$data1["GAT_NAME"],
|
||||
"GAT_TYPE" => self::$data1["GAT_TYPE"],
|
||||
"GAT_DIRECTION" => "UNSPECIFIED",
|
||||
"GAT_INSTANTIATE" => 0,
|
||||
"GAT_EVENT_GATEWAY_TYPE" => 'NONE',
|
||||
"GAT_ACTIVATION_COUNT" => 0,
|
||||
"GAT_WAITING_FOR_START" => 1,
|
||||
"GAT_DEFAULT_FLOW" => "",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["GAT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnGateway",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $gateway->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $gateway \BpmnGateway
|
||||
*/
|
||||
public function testToArrayFromTestNewUsingFromArray($gateway)
|
||||
{
|
||||
$expected = array(
|
||||
"GAT_UID" => self::$data2["GAT_UID"],
|
||||
"PRJ_UID" => self::$data2["PRJ_UID"],
|
||||
"PRO_UID" => self::$data2["PRO_UID"],
|
||||
"GAT_NAME" => self::$data2["GAT_NAME"],
|
||||
"GAT_TYPE" => self::$data2["GAT_TYPE"],
|
||||
"GAT_DIRECTION" => "UNSPECIFIED",
|
||||
"GAT_INSTANTIATE" => 0,
|
||||
"GAT_EVENT_GATEWAY_TYPE" => 'NONE',
|
||||
"GAT_ACTIVATION_COUNT" => 0,
|
||||
"GAT_WAITING_FOR_START" => 1,
|
||||
"GAT_DEFAULT_FLOW" => "",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data2["GAT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnGateway",
|
||||
"BOU_X" => self::$data2["BOU_X"],
|
||||
"BOU_Y" => self::$data2["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $gateway->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
{
|
||||
$gateway = BpmnGatewayPeer::retrieveByPK(self::$data1["GAT_UID"]);
|
||||
|
||||
$expected = array(
|
||||
"GAT_UID" => self::$data1["GAT_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"GAT_NAME" => self::$data1["GAT_NAME"],
|
||||
"GAT_TYPE" => self::$data1["GAT_TYPE"],
|
||||
"GAT_DIRECTION" => "UNSPECIFIED",
|
||||
"GAT_INSTANTIATE" => 0,
|
||||
"GAT_EVENT_GATEWAY_TYPE" => 'NONE',
|
||||
"GAT_ACTIVATION_COUNT" => 0,
|
||||
"GAT_WAITING_FOR_START" => 1,
|
||||
"GAT_DEFAULT_FLOW" => "",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["GAT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnGateway",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $gateway->toArray();
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $gateway1 \BpmnGateway
|
||||
* @param $gateway2 \BpmnGateway
|
||||
*/
|
||||
public function testDelete($gateway1, $gateway2)
|
||||
{
|
||||
$gatUid = $gateway1->getGatUid();
|
||||
$gateway = BpmnGatewayPeer::retrieveByPK($gatUid);
|
||||
$gateway->delete();
|
||||
|
||||
$this->assertNull(BpmnGatewayPeer::retrieveByPK($gatUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Gateway", $gatUid));
|
||||
|
||||
|
||||
$gatUid = $gateway2->getGatUid();
|
||||
$gateway = BpmnGatewayPeer::retrieveByPK($gatUid);
|
||||
$gateway->delete();
|
||||
|
||||
$this->assertNull(BpmnGatewayPeer::retrieveByPK($gatUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Gateway", $gatUid));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Exporter;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once(__DIR__ . "/../../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class XmlExporterTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class XmlExporterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $exporter;
|
||||
protected static $projectUid = "";
|
||||
protected static $filePmx = "";
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$json = "
|
||||
{
|
||||
\"prj_name\": \"" . \ProcessMaker\Util\Common::generateUID() . "\",
|
||||
\"prj_author\": \"00000000000000000000000000000001\",
|
||||
\"diagrams\": [
|
||||
{
|
||||
\"dia_uid\": \"\",
|
||||
\"activities\": [],
|
||||
\"events\": [],
|
||||
\"gateways\": [],
|
||||
\"flows\": [],
|
||||
\"artifacts\": [],
|
||||
\"laneset\": [],
|
||||
\"lanes\": []
|
||||
}
|
||||
]
|
||||
}
|
||||
";
|
||||
|
||||
$arrayResult = \ProcessMaker\Project\Adapter\BpmnWorkflow::createFromStruct(json_decode($json, true));
|
||||
|
||||
self::$projectUid = $arrayResult[0]["new_uid"];
|
||||
self::$filePmx = PATH_DOCUMENT . "output" . PATH_SEP . self::$projectUid . ".pmx";
|
||||
|
||||
self::$exporter = new \ProcessMaker\Exporter\XmlExporter(self::$projectUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete project
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$bpmnWf = \ProcessMaker\Project\Adapter\BpmnWorkflow::load(self::$projectUid);
|
||||
$bpmnWf->remove();
|
||||
|
||||
unlink(self::$filePmx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test export
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::export
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function testExport()
|
||||
{
|
||||
$strXml = self::$exporter->export();
|
||||
|
||||
$this->assertTrue(is_string($strXml));
|
||||
$this->assertNotEmpty($strXml);
|
||||
|
||||
return $strXml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test build
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::build
|
||||
*
|
||||
* @depends testExport
|
||||
* @param string $strXml Data xml
|
||||
*/
|
||||
public function testBuild($strXml)
|
||||
{
|
||||
//DOMDocument
|
||||
$doc = new \DOMDocument();
|
||||
$doc->loadXML($strXml);
|
||||
|
||||
$nodeRoot = $doc->getElementsByTagName("ProcessMaker-Project")->item(0);
|
||||
$uid = "";
|
||||
|
||||
//Node meta
|
||||
$nodeMeta = $nodeRoot->getElementsByTagName("metadata")->item(0)->getElementsByTagName("meta");
|
||||
|
||||
$this->assertNotEmpty($nodeMeta);
|
||||
|
||||
foreach ($nodeMeta as $value) {
|
||||
$node = $value;
|
||||
|
||||
if ($node->hasAttribute("key") && $node->getAttribute("key") == "uid") {
|
||||
$uid = $node->nodeValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->assertEquals(self::$projectUid, $uid);
|
||||
|
||||
//Node definition
|
||||
$nodeDefinition = $nodeRoot->getElementsByTagName("definition");
|
||||
|
||||
$this->assertNotEmpty($nodeDefinition);
|
||||
|
||||
foreach ($nodeDefinition as $value) {
|
||||
$node = $value;
|
||||
|
||||
if ($node->hasAttribute("class")) {
|
||||
$this->assertContains($node->getAttribute("class"), array("BPMN", "workflow"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test saveExport
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::saveExport
|
||||
*/
|
||||
public function testSaveExport()
|
||||
{
|
||||
self::$exporter->saveExport(self::$filePmx);
|
||||
|
||||
$this->assertTrue(file_exists(self::$filePmx));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getTextNode
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::getTextNode
|
||||
*/
|
||||
public function testGetTextNode()
|
||||
{
|
||||
//Is not implemented. Method getTextNode() is private
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid project uid
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::__construct
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Project "ProcessMaker\Project\Bpmn" with UID: 0, does not exist.
|
||||
*/
|
||||
public function test__constructExceptionInvalidProjectUid()
|
||||
{
|
||||
$exporter = new \ProcessMaker\Exporter\XmlExporter("0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Importer;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once(__DIR__ . "/../../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class XmlImporterTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
*/
|
||||
class XmlImporterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $importer;
|
||||
protected static $projectUid = "";
|
||||
protected static $filePmx = "";
|
||||
|
||||
protected static $arrayPrjUid = array();
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$json = "
|
||||
{
|
||||
\"prj_name\": \"" . \ProcessMaker\Util\Common::generateUID() . "\",
|
||||
\"prj_author\": \"00000000000000000000000000000001\",
|
||||
\"diagrams\": [
|
||||
{
|
||||
\"dia_uid\": \"\",
|
||||
\"activities\": [],
|
||||
\"events\": [],
|
||||
\"gateways\": [],
|
||||
\"flows\": [],
|
||||
\"artifacts\": [],
|
||||
\"laneset\": [],
|
||||
\"lanes\": []
|
||||
}
|
||||
]
|
||||
}
|
||||
";
|
||||
|
||||
$arrayResult = \ProcessMaker\Project\Adapter\BpmnWorkflow::createFromStruct(json_decode($json, true));
|
||||
|
||||
self::$projectUid = $arrayResult[0]["new_uid"];
|
||||
self::$filePmx = PATH_DOCUMENT . "input" . PATH_SEP . self::$projectUid . ".pmx";
|
||||
|
||||
$exporter = new \ProcessMaker\Exporter\XmlExporter(self::$projectUid);
|
||||
$exporter->saveExport(self::$filePmx);
|
||||
|
||||
$bpmnWf = \ProcessMaker\Project\Adapter\BpmnWorkflow::load(self::$projectUid);
|
||||
$bpmnWf->remove();
|
||||
|
||||
self::$importer = new \ProcessMaker\Importer\XmlImporter();
|
||||
self::$importer->setSourceFile(self::$filePmx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete projects
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
foreach (self::$arrayPrjUid as $value) {
|
||||
$prjUid = $value;
|
||||
|
||||
$bpmnWf = \ProcessMaker\Project\Adapter\BpmnWorkflow::load($prjUid);
|
||||
$bpmnWf->remove();
|
||||
}
|
||||
|
||||
unlink(self::$filePmx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test load
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::load
|
||||
*/
|
||||
public function testLoad()
|
||||
{
|
||||
$arrayData = self::$importer->load();
|
||||
|
||||
$this->assertTrue(is_array($arrayData));
|
||||
$this->assertNotEmpty($arrayData);
|
||||
|
||||
$this->assertArrayHasKey("tables", $arrayData);
|
||||
$this->assertArrayHasKey("files", $arrayData);
|
||||
|
||||
$this->assertEquals($arrayData["tables"]["bpmn"]["project"][0]["prj_uid"], self::$projectUid);
|
||||
$this->assertEquals($arrayData["tables"]["workflow"]["process"][0]["PRO_UID"], self::$projectUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getTextNode
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::getTextNode
|
||||
*/
|
||||
public function testGetTextNode()
|
||||
{
|
||||
//Is not implemented. Method getTextNode() is private
|
||||
}
|
||||
|
||||
/**
|
||||
* Test import
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::import
|
||||
*/
|
||||
public function testImport()
|
||||
{
|
||||
$prjUid = self::$importer->import();
|
||||
self::$arrayPrjUid[] = $prjUid;
|
||||
|
||||
$this->assertNotNull(\BpmnProjectPeer::retrieveByPK($prjUid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test importPostFile
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*/
|
||||
public function testImportPostFile()
|
||||
{
|
||||
self::$importer->setSaveDir(PATH_DOCUMENT . "input");
|
||||
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => self::$projectUid . ".pmx"), "KEEP");
|
||||
self::$arrayPrjUid[] = $arrayData["PRJ_UID"];
|
||||
|
||||
$this->assertNotNull(\BpmnProjectPeer::retrieveByPK($arrayData["PRJ_UID"]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception when the project exists
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::import
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Project already exists, you need set an action to continue. Available actions: [project.import.create_new|project.import.override|project.import.disable_and_create_new|project.import.keep_without_changing_and_create_new].
|
||||
*/
|
||||
public function testImportExceptionProjectExists()
|
||||
{
|
||||
$prjUid = self::$importer->import();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testImportPostFileExceptionEmptyData()
|
||||
{
|
||||
$arrayData = self::$importer->importPostFile(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid extension
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The file extension not is "pmx"
|
||||
*/
|
||||
public function testImportPostFileExceptionInvalidExtension()
|
||||
{
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => "file.pm"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for file does not exist
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The file with PROJECT_FILE: "file.pmx" does not exist.
|
||||
*/
|
||||
public function testImportPostFileExceptionFileNotExists()
|
||||
{
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => "file.pmx"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid option
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "OPTION", it only accepts values: "CREATE|OVERWRITE|DISABLE|KEEP".
|
||||
*/
|
||||
public function testImportPostFileExceptionInvalidOption()
|
||||
{
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => "file.pmx"), "CREATED");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception when the project exists
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Project already exists, you need set an action to continue. Available actions: [CREATE|OVERWRITE|DISABLE|KEEP].
|
||||
*/
|
||||
public function testImportPostFileExceptionProjectExists()
|
||||
{
|
||||
self::$importer->setSaveDir(PATH_DOCUMENT . "input");
|
||||
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => self::$projectUid . ".pmx"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,713 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Project\Adapter;
|
||||
|
||||
use \ProcessMaker\Project;
|
||||
use \ProcessMaker\Exception;
|
||||
|
||||
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../../../bootstrap.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Class BpmnWorkflowTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project\Adapter
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnWorkflowTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $uids = array();
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//return false;
|
||||
//cleaning DB
|
||||
foreach (self::$uids as $prjUid) {
|
||||
$bwap = Project\Adapter\BpmnWorkflow::load($prjUid);
|
||||
$bwap->remove();
|
||||
}
|
||||
}
|
||||
|
||||
function testNew()
|
||||
{
|
||||
$data = array(
|
||||
"PRJ_NAME" => "Test Bpmn/Workflow Project #1.". rand(1, 100),
|
||||
"PRJ_DESCRIPTION" => "Description for - Test BPMN Project #1." . rand(1, 100),
|
||||
"PRJ_AUTHOR" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
$bwap = new Project\Adapter\BpmnWorkflow($data);
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($bwap->getUid());
|
||||
} catch (\Exception $e){
|
||||
$bp = null;
|
||||
}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
} catch (\Exception $e){
|
||||
$wp = null;
|
||||
}
|
||||
|
||||
self::$uids[] = $bwap->getUid();
|
||||
|
||||
$this->assertNotNull($bp);
|
||||
$this->assertNotNull($wp);
|
||||
$this->assertEquals($bp->getUid(), $wp->getUid());
|
||||
|
||||
$project = $bp->getProject();
|
||||
$process = $wp->getProcess();
|
||||
|
||||
$this->assertEquals($project["PRJ_NAME"], $process["PRO_TITLE"]);
|
||||
$this->assertEquals($project["PRJ_DESCRIPTION"], $process["PRO_DESCRIPTION"]);
|
||||
$this->assertEquals($project["PRJ_AUTHOR"], $process["PRO_CREATE_USER"]);
|
||||
|
||||
return $bwap;
|
||||
}
|
||||
|
||||
function testCreate()
|
||||
{
|
||||
$data = array(
|
||||
"PRJ_NAME" => "Test Bpmn/Workflow Project #2",
|
||||
"PRJ_DESCRIPTION" => "Description for - Test BPMN Project #2",
|
||||
"PRJ_AUTHOR" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
$bwap = new Project\Adapter\BpmnWorkflow();
|
||||
$bwap->create($data);
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($bwap->getUid());
|
||||
} catch (\Exception $e){
|
||||
$bp = null;
|
||||
}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
} catch (\Exception $e){
|
||||
$wp = null;
|
||||
}
|
||||
|
||||
$this->assertNotEmpty($bp);
|
||||
$this->assertNotEmpty($wp);
|
||||
$this->assertEquals($bp->getUid(), $wp->getUid());
|
||||
|
||||
$project = $bp->getProject();
|
||||
$process = $wp->getProcess();
|
||||
|
||||
$this->assertEquals($project["PRJ_NAME"], $process["PRO_TITLE"]);
|
||||
$this->assertEquals($project["PRJ_DESCRIPTION"], $process["PRO_DESCRIPTION"]);
|
||||
$this->assertEquals($project["PRJ_AUTHOR"], $process["PRO_CREATE_USER"]);
|
||||
|
||||
return $bwap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
function testRemove(Project\Adapter\BpmnWorkflow $bwap)
|
||||
{
|
||||
$prjUid = $bwap->getUid();
|
||||
$bwap->remove();
|
||||
$bp = $wp = null;
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($prjUid);
|
||||
} catch (Exception\ProjectNotFound $e) {}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($prjUid);
|
||||
} catch (Exception\ProjectNotFound $e) {}
|
||||
|
||||
$this->assertNull($bp);
|
||||
$this->assertNull($wp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Testing Project's Activity
|
||||
*/
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @return string
|
||||
*/
|
||||
function testAddActivity($bwap)
|
||||
{
|
||||
// before add activity, we need to add a diagram and process to the project
|
||||
$bwap->addDiagram();
|
||||
$bwap->addProcess();
|
||||
|
||||
// add the new activity
|
||||
$actUid = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
));
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$activity = $bwap->getActivity($actUid);
|
||||
$task = $wp->getTask($actUid);
|
||||
|
||||
$this->assertEquals($activity["ACT_NAME"], $task["TAS_TITLE"]);
|
||||
$this->assertEquals($activity["BOU_X"], $task["TAS_POSX"]);
|
||||
$this->assertEquals($activity["BOU_Y"], $task["TAS_POSY"]);
|
||||
|
||||
return $actUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testAddActivity
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param string $actUid
|
||||
*/
|
||||
function testUpdateActivity($bwap, $actUid)
|
||||
{
|
||||
$updatedData = array(
|
||||
"ACT_NAME" => "Activity #1 - (Modified)",
|
||||
"BOU_X" => 122,
|
||||
"BOU_Y" => 250
|
||||
);
|
||||
|
||||
$bwap->updateActivity($actUid, $updatedData);
|
||||
$activity = $bwap->getActivity($actUid);
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
$task = $wp->getTask($actUid);
|
||||
|
||||
$this->assertEquals($activity["ACT_NAME"], $task["TAS_TITLE"]);
|
||||
$this->assertEquals($activity["BOU_X"], $task["TAS_POSX"]);
|
||||
$this->assertEquals($activity["BOU_Y"], $task["TAS_POSY"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testAddActivity
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param string $actUid
|
||||
*/
|
||||
function testRemoveActivity($bwap, $actUid)
|
||||
{
|
||||
$bwap->removeActivity($actUid);
|
||||
$activity = $bwap->getActivity($actUid);
|
||||
|
||||
$this->assertNull($activity);
|
||||
}
|
||||
|
||||
/*
|
||||
* Testing Project's Flows
|
||||
*/
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @return string
|
||||
*/
|
||||
function testAddActivityToActivityFlow($bwap)
|
||||
{
|
||||
$actUid1 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 122,
|
||||
"BOU_Y" => 222
|
||||
));
|
||||
$actUid2 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => 322,
|
||||
"BOU_Y" => 422
|
||||
));
|
||||
|
||||
$flowData = array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid1,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $actUid2,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 326,
|
||||
'FLO_Y1' => 146,
|
||||
'FLO_X2' => 461,
|
||||
'FLO_Y2' => 146,
|
||||
);
|
||||
|
||||
$flowUid = $bwap->addFlow($flowData);
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$route = \Route::findOneBy(array(
|
||||
\RoutePeer::TAS_UID => $actUid1,
|
||||
\RoutePeer::ROU_NEXT_TASK => $actUid2
|
||||
));
|
||||
|
||||
$this->assertNotNull($route);
|
||||
$this->assertTrue(is_string($flowUid));
|
||||
$this->assertEquals(32, strlen($flowUid));
|
||||
$this->assertEquals($route->getRouNextTask(), $actUid2);
|
||||
$this->assertEquals($route->getRouType(), "SEQUENTIAL");
|
||||
|
||||
return array("flow_uid" => $flowUid, "activitiesUid" => array($actUid1, $actUid2));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testAddActivityToActivityFlow
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param array $input
|
||||
*/
|
||||
function testRemoveActivityToActivityFlow($bwap, $input)
|
||||
{
|
||||
$bwap->removeFlow($input["flow_uid"]);
|
||||
$this->assertNull($bwap->getFlow($input["flow_uid"]));
|
||||
|
||||
$route = \Route::findOneBy(array(
|
||||
\RoutePeer::TAS_UID => $input["activitiesUid"][0],
|
||||
\RoutePeer::ROU_NEXT_TASK => $input["activitiesUid"][1]
|
||||
));
|
||||
|
||||
$this->assertNull($route);
|
||||
|
||||
// cleaning
|
||||
$bwap->removeActivity($input["activitiesUid"][0]);
|
||||
$bwap->removeActivity($input["activitiesUid"][1]);
|
||||
|
||||
$this->assertCount(0, $bwap->getActivities());
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
function testActivityToInclusiveGatewayToActivityFlowsSingle($bwap)
|
||||
{
|
||||
$actUid1 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 198,
|
||||
"BOU_Y" => 56
|
||||
));
|
||||
$actUid2 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => 198,
|
||||
"BOU_Y" => 250
|
||||
));
|
||||
$gatUid = $bwap->addGateway(array(
|
||||
"GAT_NAME" => "Gateway #1",
|
||||
"GAT_TYPE" => "INCLUSIVE",
|
||||
"GAT_DIRECTION" => "DIVERGING",
|
||||
"BOU_X" => 256,
|
||||
"BOU_Y" => 163
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid1,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 273,
|
||||
'FLO_Y1' => 273,
|
||||
'FLO_X2' => 163,
|
||||
'FLO_Y2' => 163,
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid2,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 273,
|
||||
'FLO_Y1' => 273,
|
||||
'FLO_X2' => 249,
|
||||
'FLO_Y2' => 249,
|
||||
));
|
||||
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$this->assertCount(2, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getGateways());
|
||||
$this->assertCount(2, $bwap->getFlows());
|
||||
|
||||
$flows1 = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid);
|
||||
$flows2 = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid);
|
||||
|
||||
$this->assertCount(1, $flows1);
|
||||
$this->assertCount(1, $flows2);
|
||||
$this->assertEquals($flows1[0]->getFloElementOrigin(), $actUid1);
|
||||
$this->assertEquals($flows2[0]->getFloElementDest(), $actUid2);
|
||||
|
||||
// cleaning
|
||||
$this->resetProject($bwap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
function testActivityToInclusiveGatewayToActivityFlowsMultiple($bwap)
|
||||
{
|
||||
$actUid1 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 311,
|
||||
"BOU_Y" => 26
|
||||
));
|
||||
$actUid2 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => 99,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$actUid3 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #3",
|
||||
"BOU_X" => 310,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$actUid4 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #4",
|
||||
"BOU_X" => 542,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$gatUid = $bwap->addGateway(array(
|
||||
"GAT_NAME" => "Gateway #1",
|
||||
"GAT_TYPE" => "INCLUSIVE",
|
||||
"GAT_DIRECTION" => "DIVERGING",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 123
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid1,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 174,
|
||||
'FLO_X2' => 206,
|
||||
'FLO_Y2' => 206,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid2,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 273,
|
||||
'FLO_Y1' => 273,
|
||||
'FLO_X2' => 249,
|
||||
'FLO_Y2' => 249,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid3,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 174,
|
||||
'FLO_X2' => 206,
|
||||
'FLO_Y2' => 206,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid4,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 617,
|
||||
'FLO_X2' => 207,
|
||||
'FLO_Y2' => 207,
|
||||
));
|
||||
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$this->assertCount(4, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getGateways());
|
||||
$this->assertCount(4, $bwap->getFlows());
|
||||
$this->assertCount(1, \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid));
|
||||
$this->assertCount(3, \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid));
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(4, $wp->getTasks());
|
||||
$this->assertCount(3, $wp->getRoutes());
|
||||
$this->assertCount(3, \Route::findAllBy(\RoutePeer::TAS_UID, $actUid1));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::ROU_NEXT_TASK, $actUid2));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::ROU_NEXT_TASK, $actUid3));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::ROU_NEXT_TASK, $actUid4));
|
||||
|
||||
return array($actUid2, $actUid3, $actUid4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testActivityToInclusiveGatewayToActivityFlowsMultiple
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param array $activitiesUid
|
||||
*/
|
||||
function testActivityToInclusiveGatewayToActivityFlowsMultipleJoin($bwap, $activitiesUid)
|
||||
{
|
||||
$gatUid = $bwap->addGateway(array(
|
||||
"GAT_NAME" => "Gateway #2",
|
||||
"GAT_TYPE" => "INCLUSIVE",
|
||||
"GAT_DIRECTION" => "CONVERGING",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 338
|
||||
));
|
||||
$actUid5 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #5",
|
||||
"BOU_X" => 312,
|
||||
"BOU_Y" => 464
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[0],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 174,
|
||||
'FLO_Y1' => 365,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[1],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 385,
|
||||
'FLO_Y1' => 382,
|
||||
'FLO_X2' => 338,
|
||||
'FLO_Y2' => 338,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[2],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 617,
|
||||
'FLO_Y1' => 398,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid5,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 382,
|
||||
'FLO_Y1' => 387,
|
||||
'FLO_X2' => 463,
|
||||
'FLO_Y2' => 463,
|
||||
));
|
||||
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$this->assertCount(8, $bwap->getFlows());
|
||||
$this->assertCount(5, $bwap->getActivities());
|
||||
$this->assertCount(2, $bwap->getGateways());
|
||||
$this->assertCount(3, \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid));
|
||||
$this->assertCount(1, \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid));
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(5, $wp->getTasks());
|
||||
$this->assertCount(6, $wp->getRoutes());
|
||||
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::TAS_UID, $activitiesUid[0]));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::TAS_UID, $activitiesUid[1]));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::TAS_UID, $activitiesUid[2]));
|
||||
$this->assertCount(3, \Route::findAllBy(\RoutePeer::ROU_NEXT_TASK, $actUid5));
|
||||
|
||||
// cleaning
|
||||
$this->resetProject($bwap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @return string
|
||||
*/
|
||||
function testSetStartEvent($bwap)
|
||||
{
|
||||
$actUid = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 312,
|
||||
"BOU_Y" => 464
|
||||
));
|
||||
$evnUid = $bwap->addEvent(array(
|
||||
"EVN_NAME" => "Event #1",
|
||||
"EVN_TYPE" => "START",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 338,
|
||||
"EVN_MARKER" => "MESSAGE",
|
||||
"EVN_MESSAGE" => "LEAD"
|
||||
));
|
||||
$floUid = $bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $evnUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnEvent',
|
||||
'FLO_ELEMENT_DEST' => $actUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 174,
|
||||
'FLO_Y1' => 365,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
|
||||
$this->assertCount(1, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getEvents());
|
||||
$this->assertCount(1, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
$task = $wp->getTask($actUid);
|
||||
|
||||
$this->assertCount(1, $wp->getTasks());
|
||||
$this->assertCount(0, $wp->getRoutes());
|
||||
$this->assertNotNull($task);
|
||||
|
||||
$this->assertEquals($task["TAS_START"], "TRUE");
|
||||
|
||||
return $floUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testSetStartEvent
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param string $floUid
|
||||
*/
|
||||
function testUnsetStartEvent($bwap, $floUid)
|
||||
{
|
||||
$bwap->removeFlow($floUid);
|
||||
|
||||
$this->assertCount(1, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getEvents());
|
||||
$this->assertCount(0, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertCount(1, $tasks);
|
||||
$this->assertCount(0, $wp->getRoutes());
|
||||
$this->assertEquals($tasks[0]["TAS_START"], "FALSE");
|
||||
|
||||
// cleaning
|
||||
$this->resetProject($bwap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
function testSetEndEvent($bwap)
|
||||
{
|
||||
$actUid = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 312,
|
||||
"BOU_Y" => 464
|
||||
));
|
||||
$evnUid = $bwap->addEvent(array(
|
||||
"EVN_NAME" => "Event #1",
|
||||
"EVN_TYPE" => "END",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 338,
|
||||
"EVN_MARKER" => "MESSAGE",
|
||||
"EVN_MESSAGE" => "LEAD"
|
||||
));
|
||||
$floUid = $bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $evnUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnEvent',
|
||||
'FLO_X1' => 174,
|
||||
'FLO_Y1' => 365,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
|
||||
$this->assertCount(1, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getEvents());
|
||||
$this->assertCount(1, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
$task = $wp->getTask($actUid);
|
||||
|
||||
$this->assertCount(1, $wp->getTasks());
|
||||
$this->assertCount(1, $wp->getRoutes());
|
||||
$this->assertNotNull($task);
|
||||
|
||||
$routes = \Route::findAllBy(\RoutePeer::TAS_UID, $task["TAS_UID"]);
|
||||
|
||||
$this->assertCount(1, $routes);
|
||||
$this->assertEquals($routes[0]->getRouNextTask(), "-1");
|
||||
|
||||
return $floUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testSetEndEvent
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param $floUid
|
||||
*/
|
||||
function testUnsetEndEvent($bwap, $floUid)
|
||||
{
|
||||
$bwap->removeFlow($floUid);
|
||||
|
||||
$this->assertCount(1, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getEvents());
|
||||
$this->assertCount(0, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(1, $wp->getTasks());
|
||||
$this->assertCount(0, $wp->getRoutes());
|
||||
|
||||
// cleaning
|
||||
$this->resetProject($bwap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
protected function resetProject(\ProcessMaker\Project\Adapter\BpmnWorkflow $bwap)
|
||||
{
|
||||
// cleaning
|
||||
$activities = $bwap->getActivities();
|
||||
foreach ($activities as $activity) {
|
||||
$bwap->removeActivity($activity["ACT_UID"]);
|
||||
}
|
||||
$events = $bwap->getEvents();
|
||||
foreach ($events as $event) {
|
||||
$bwap->removeEvent($event["EVN_UID"]);
|
||||
}
|
||||
$gateways = $bwap->getGateways();
|
||||
foreach ($gateways as $gateway) {
|
||||
$bwap->removeGateway($gateway["GAT_UID"]);
|
||||
}
|
||||
$flows = $bwap->getFlows();
|
||||
foreach ($flows as $flow) {
|
||||
$bwap->removeFlow($flow["FLO_UID"]);
|
||||
}
|
||||
|
||||
// verifying that project is cleaned
|
||||
$this->assertCount(0, $bwap->getActivities());
|
||||
$this->assertCount(0, $bwap->getEvents());
|
||||
$this->assertCount(0, $bwap->getGateways());
|
||||
$this->assertCount(0, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(0, $wp->getTasks());
|
||||
$this->assertCount(0, $wp->getRoutes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Project\Adapter;
|
||||
|
||||
use \ProcessMaker\Project;
|
||||
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../../../bootstrap.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Class WorkflowBpmnTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project\Adapter
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class WorkflowBpmnTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $uids = array();
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//cleaning DB
|
||||
foreach (self::$uids as $prjUid) {
|
||||
$wbpa = Project\Adapter\WorkflowBpmn::load($prjUid);
|
||||
$wbpa->remove();
|
||||
}
|
||||
}
|
||||
|
||||
function testNew()
|
||||
{
|
||||
$data = array(
|
||||
"PRO_TITLE" => "Test Workflow/Bpmn Project #1",
|
||||
"PRO_DESCRIPTION" => "Description for - Test Project #1",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
$wbap = new Project\Adapter\WorkflowBpmn($data);
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($wbap->getUid());
|
||||
} catch (\Exception $e){die($e->getMessage());}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($wbap->getUid());
|
||||
} catch (\Exception $e){}
|
||||
|
||||
self::$uids[] = $wbap->getUid();
|
||||
|
||||
$this->assertNotNull($bp);
|
||||
$this->assertNotNull($wp);
|
||||
$this->assertEquals($bp->getUid(), $wp->getUid());
|
||||
|
||||
$project = $bp->getProject();
|
||||
$process = $wp->getProcess();
|
||||
|
||||
$this->assertEquals($project["PRJ_NAME"], $process["PRO_TITLE"]);
|
||||
$this->assertEquals($project["PRJ_DESCRIPTION"], $process["PRO_DESCRIPTION"]);
|
||||
$this->assertEquals($project["PRJ_AUTHOR"], $process["PRO_CREATE_USER"]);
|
||||
}
|
||||
|
||||
function testCreate()
|
||||
{
|
||||
$data = array(
|
||||
"PRO_TITLE" => "Test Workflow/Bpmn Project #2",
|
||||
"PRO_DESCRIPTION" => "Description for - Test Project #2",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
);
|
||||
$wbap = new Project\Adapter\WorkflowBpmn();
|
||||
$wbap->create($data);
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($wbap->getUid());
|
||||
} catch (\Exception $e){}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($wbap->getUid());
|
||||
} catch (\Exception $e){}
|
||||
|
||||
self::$uids[] = $wbap->getUid();
|
||||
|
||||
$this->assertNotEmpty($bp);
|
||||
$this->assertNotEmpty($wp);
|
||||
$this->assertEquals($bp->getUid(), $wp->getUid());
|
||||
|
||||
$project = $bp->getProject();
|
||||
$process = $wp->getProcess();
|
||||
|
||||
$this->assertEquals($project["PRJ_NAME"], $process["PRO_TITLE"]);
|
||||
$this->assertEquals($project["PRJ_DESCRIPTION"], $process["PRO_DESCRIPTION"]);
|
||||
$this->assertEquals($project["PRJ_AUTHOR"], $process["PRO_CREATE_USER"]);
|
||||
}
|
||||
}
|
||||
@@ -1,278 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Project;
|
||||
|
||||
use \ProcessMaker\Project;
|
||||
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../../bootstrap.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Class BpmnTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $prjUids = array();
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//return;
|
||||
|
||||
//cleaning DB
|
||||
foreach (self::$prjUids as $prjUid) {
|
||||
$bp = Project\Bpmn::load($prjUid);
|
||||
$bp->remove();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function testCreate()
|
||||
{
|
||||
$data = array(
|
||||
"PRJ_NAME" => "Test BPMN Project #1",
|
||||
"PRJ_DESCRIPTION" => "Description for - Test BPMN Project #1",
|
||||
"PRJ_AUTHOR" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
// Create a new Project\Bpmn and save to DB
|
||||
$bp = new Project\Bpmn($data);
|
||||
$projectData = $bp->getProject();
|
||||
self::$prjUids[] = $bp->getUid();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($value, $projectData[$key]);
|
||||
}
|
||||
|
||||
return $bp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @var $bp \ProcessMaker\Project\Bpmn
|
||||
*/
|
||||
public function testAddDiagram($bp)
|
||||
{
|
||||
$data = array(
|
||||
"DIA_NAME" => "Sample Diagram #1"
|
||||
);
|
||||
|
||||
// Save to DB
|
||||
$bp->addDiagram($data);
|
||||
|
||||
// Load from DB
|
||||
$diagramData = $bp->getDiagram();
|
||||
|
||||
$this->assertEquals($data["DIA_NAME"], $diagramData["DIA_NAME"]);
|
||||
$this->assertEquals($bp->getUid(), $diagramData["PRJ_UID"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @var $bp \ProcessMaker\Project\Bpmn
|
||||
*/
|
||||
public function testAddProcess($bp)
|
||||
{
|
||||
$data = array(
|
||||
"PRO_NAME" => "Sample Process #1"
|
||||
);
|
||||
|
||||
$diagramData = $bp->getDiagram();
|
||||
|
||||
// Save to DB
|
||||
$bp->addProcess($data);
|
||||
|
||||
// Load from DB
|
||||
$processData = $bp->getProcess();
|
||||
|
||||
$this->assertEquals($data["PRO_NAME"], $processData["PRO_NAME"]);
|
||||
$this->assertEquals($bp->getUid(), $processData["PRJ_UID"]);
|
||||
$this->assertEquals($diagramData['DIA_UID'], $processData["DIA_UID"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @var $bp \ProcessMaker\Project\Bpmn
|
||||
*/
|
||||
public function testAddActivity($bp)
|
||||
{
|
||||
$data = array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
);
|
||||
|
||||
// Save to DB
|
||||
$bp->addActivity($data);
|
||||
|
||||
// Load from DB
|
||||
$activities = $bp->getActivities();
|
||||
|
||||
$this->assertCount(1, $activities);
|
||||
|
||||
$activityData = $activities[0];
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($value, $activityData[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @return array
|
||||
*/
|
||||
public function testAddActivityWithUid($bp)
|
||||
{
|
||||
$actUid = "f1198ddc864204561817155064020352";
|
||||
|
||||
$data = array(
|
||||
"ACT_UID" => $actUid,
|
||||
"ACT_NAME" => "Activity #X",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
);
|
||||
|
||||
// Save to DB
|
||||
$bp->addActivity($data);
|
||||
|
||||
// Load from DB
|
||||
$activities = $bp->getActivities();
|
||||
|
||||
$uids = array();
|
||||
|
||||
foreach ($activities as $activity) {
|
||||
array_push($uids, $activity["ACT_UID"]);
|
||||
}
|
||||
|
||||
$this->assertTrue(in_array($actUid, $uids));
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @depends testAddActivityWithUid
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @param $data
|
||||
*/
|
||||
public function testGetActivity($bp, $data)
|
||||
{
|
||||
// Load from DB
|
||||
$activityData = $bp->getActivity($data["ACT_UID"]);
|
||||
|
||||
// in data is set a determined UID for activity created in previous step
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($value, $activityData[$key]);
|
||||
}
|
||||
|
||||
// Testing with an invalid uid
|
||||
$this->assertNull($bp->getActivity("INVALID-UID"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @depends testAddActivityWithUid
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @param $data
|
||||
*/
|
||||
public function testUpdateActivity($bp, $data)
|
||||
{
|
||||
$updateData = array(
|
||||
"ACT_NAME" => "Activity #X (Updated)",
|
||||
"BOU_X" => "251",
|
||||
"BOU_Y" => "252"
|
||||
);
|
||||
|
||||
// Save to DB
|
||||
$bp->updateActivity($data["ACT_UID"], $updateData);
|
||||
|
||||
// Load from DB
|
||||
$activityData = $bp->getActivity($data["ACT_UID"]);
|
||||
|
||||
foreach ($updateData as $key => $value) {
|
||||
$this->assertEquals($value, $activityData[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @depends testAddActivityWithUid
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @param $data
|
||||
*/
|
||||
public function testRemoveActivity($bp, $data)
|
||||
{
|
||||
$this->assertCount(2, $bp->getActivities());
|
||||
|
||||
$bp->removeActivity($data["ACT_UID"]);
|
||||
|
||||
$this->assertCount(1, $bp->getActivities());
|
||||
}
|
||||
|
||||
public function testGetActivities()
|
||||
{
|
||||
// Create a new Project\Bpmn and save to DB
|
||||
$bp = new Project\Bpmn(array(
|
||||
"PRJ_NAME" => "Test BPMN Project #2",
|
||||
"PRJ_DESCRIPTION" => "Description for - Test BPMN Project #1",
|
||||
"PRJ_AUTHOR" => "00000000000000000000000000000001"
|
||||
));
|
||||
$bp->addDiagram();
|
||||
$bp->addProcess();
|
||||
|
||||
$this->assertCount(0, $bp->getActivities());
|
||||
|
||||
// Save to DB
|
||||
$bp->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
));
|
||||
|
||||
$bp->addActivity(array(
|
||||
"ACT_NAME" => "Activity #3",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
));
|
||||
|
||||
$this->assertCount(2, $bp->getActivities());
|
||||
|
||||
return $bp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetActivities
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @return null|\ProcessMaker\Project\Bpmn
|
||||
*/
|
||||
public function testLoad($bp)
|
||||
{
|
||||
$prjUid = $bp->getUid();
|
||||
$bp2 = Project\Bpmn::load($prjUid);
|
||||
|
||||
$this->assertNotNull($bp2);
|
||||
$this->assertEquals($bp->getActivities(), $bp2->getActivities());
|
||||
$this->assertEquals($bp->getDiagram(), $bp2->getDiagram());
|
||||
$this->assertEquals($bp->getProcess(), $bp2->getProcess());
|
||||
|
||||
return $bp2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testLoad
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @expectedException \ProcessMaker\Exception\ProjectNotFound
|
||||
* @expectedExceptionCode 20
|
||||
*/
|
||||
public function testRemove($bp)
|
||||
{
|
||||
$prjUid = $bp->getUid();
|
||||
$bp->remove();
|
||||
|
||||
Project\Bpmn::load($prjUid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,287 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Project;
|
||||
|
||||
use \ProcessMaker\Project;
|
||||
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../../bootstrap.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Class WorkflowTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class WorkflowTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $proUids = array();
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//cleaning DB
|
||||
foreach (self::$proUids as $proUid) {
|
||||
$wp = Project\Workflow::load($proUid);
|
||||
$wp->remove();
|
||||
}
|
||||
}
|
||||
|
||||
public function testCreate()
|
||||
{
|
||||
$data = array(
|
||||
"PRO_TITLE" => "Test Project #1",
|
||||
"PRO_DESCRIPTION" => "Description for - Test Project #1",
|
||||
"PRO_CATEGORY" => "",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
$wp = new Project\Workflow($data);
|
||||
self::$proUids[] = $wp->getUid();
|
||||
|
||||
$processData = $wp->getProcess();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($data[$key], $processData[$key]);
|
||||
}
|
||||
|
||||
return $wp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
*/
|
||||
public function testAddTask($wp)
|
||||
{
|
||||
$data = array(
|
||||
"TAS_TITLE" => "task #1",
|
||||
"TAS_DESCRIPTION" => "Description for task #1",
|
||||
"TAS_POSX" => "50",
|
||||
"TAS_POSY" => "50",
|
||||
"TAS_WIDTH" => "100",
|
||||
"TAS_HEIGHT" => "25"
|
||||
);
|
||||
|
||||
$tasUid = $wp->addTask($data);
|
||||
|
||||
$taskData = $wp->getTask($tasUid);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($data[$key], $taskData[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
*/
|
||||
public function testUpdateTask($wp)
|
||||
{
|
||||
$data = array(
|
||||
"TAS_TITLE" => "task #1 (updated)",
|
||||
"TAS_POSX" => "150",
|
||||
"TAS_POSY" => "250"
|
||||
);
|
||||
|
||||
// at this time, there is only one task
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(1, $tasks);
|
||||
|
||||
$wp->updateTask($tasks[0]['TAS_UID'], $data);
|
||||
$taskData = $wp->getTask($tasks[0]['TAS_UID']);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($data[$key], $taskData[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
*/
|
||||
public function testRemoveTask($wp)
|
||||
{
|
||||
$tasUid = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "150",
|
||||
"TAS_POSY" => "250"
|
||||
));
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(2, $tasks);
|
||||
|
||||
$wp->removeTask($tasUid);
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(1, $tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
*/
|
||||
public function testGetTasks($wp)
|
||||
{
|
||||
$tasUid1 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "250",
|
||||
"TAS_POSY" => "250"
|
||||
));
|
||||
$tasUid2 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #3",
|
||||
"TAS_POSX" => "350",
|
||||
"TAS_POSY" => "350"
|
||||
));
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(3, $tasks);
|
||||
|
||||
$wp->removeTask($tasUid1);
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(2, $tasks);
|
||||
|
||||
$wp->removeTask($tasUid2);
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(1, $tasks);
|
||||
|
||||
$wp->removeTask($tasks[0]['TAS_UID']);
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(0, $tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testAddRoute()
|
||||
{
|
||||
$wp = new Project\Workflow(array(
|
||||
"PRO_TITLE" => "Test Project #2 (Sequential)",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
));
|
||||
|
||||
self::$proUids[] = $wp->getUid();
|
||||
|
||||
$tasUid1 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #1",
|
||||
"TAS_POSX" => "410",
|
||||
"TAS_POSY" => "61"
|
||||
));
|
||||
$tasUid2 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "159",
|
||||
"TAS_POSY" => "370"
|
||||
));
|
||||
|
||||
$rouUid = $wp->addRoute($tasUid1, $tasUid2, "SEQUENTIAL");
|
||||
|
||||
$routeSaved = $wp->getRoute($rouUid);
|
||||
|
||||
$this->assertEquals($tasUid1, $routeSaved['TAS_UID']);
|
||||
$this->assertEquals($tasUid2, $routeSaved['ROU_NEXT_TASK']);
|
||||
$this->assertEquals("SEQUENTIAL", $routeSaved['ROU_TYPE']);
|
||||
}
|
||||
|
||||
public function testAddSelectRoute()
|
||||
{
|
||||
$wp = new Project\Workflow(array(
|
||||
"PRO_TITLE" => "Test Project #3 (Select)",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
));
|
||||
self::$proUids[] = $wp->getUid();
|
||||
|
||||
$tasUid1 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #1",
|
||||
"TAS_POSX" => "410",
|
||||
"TAS_POSY" => "61"
|
||||
));
|
||||
$tasUid2 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "159",
|
||||
"TAS_POSY" => "370"
|
||||
));
|
||||
$tasUid3 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #3",
|
||||
"TAS_POSX" => "670",
|
||||
"TAS_POSY" => "372"
|
||||
));
|
||||
|
||||
$wp->addSelectRoute($tasUid1, array($tasUid2, $tasUid3));
|
||||
}
|
||||
|
||||
public function testCompleteWorkflowProject()
|
||||
{
|
||||
$wp = new Project\Workflow(array(
|
||||
"PRO_TITLE" => "Test Complete Project #4",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
));
|
||||
|
||||
$tasUid1 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #1",
|
||||
"TAS_POSX" => "406",
|
||||
"TAS_POSY" => "71"
|
||||
));
|
||||
$tasUid2 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "188",
|
||||
"TAS_POSY" => "240"
|
||||
));
|
||||
$tasUid3 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #3",
|
||||
"TAS_POSX" => "406",
|
||||
"TAS_POSY" => "239"
|
||||
));
|
||||
$tasUid4 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #4",
|
||||
"TAS_POSX" => "294",
|
||||
"TAS_POSY" => "366"
|
||||
));
|
||||
$tasUid5 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #5",
|
||||
"TAS_POSX" => "640",
|
||||
"TAS_POSY" => "240"
|
||||
));
|
||||
$tasUid6 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #6",
|
||||
"TAS_POSX" => "640",
|
||||
"TAS_POSY" => "359"
|
||||
));
|
||||
|
||||
|
||||
$wp->addRoute($tasUid1, $tasUid2, "PARALLEL");
|
||||
$wp->addRoute($tasUid1, $tasUid3, "PARALLEL");
|
||||
$wp->addRoute($tasUid1, $tasUid5, "PARALLEL");
|
||||
|
||||
$wp->addRoute($tasUid2, $tasUid4, "SEC-JOIN");
|
||||
$wp->addRoute($tasUid3, $tasUid4, "SEC-JOIN");
|
||||
|
||||
$wp->addRoute($tasUid5, $tasUid6, "EVALUATE");
|
||||
$wp->addRoute($tasUid5, "-1", "EVALUATE");
|
||||
|
||||
$wp->setStartTask($tasUid1);
|
||||
|
||||
$wp->setEndTask($tasUid4);
|
||||
$wp->setEndTask($tasUid6);
|
||||
|
||||
return $wp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCompleteWorkflowProject
|
||||
* @param $wp \ProcessMaker\Project\Workflow
|
||||
* @expectedException \ProcessMaker\Exception\ProjectNotFound
|
||||
* @expectedExceptionCode 20
|
||||
*/
|
||||
public function testRemove($wp)
|
||||
{
|
||||
$proUid = $wp->getUid();
|
||||
$wp->remove();
|
||||
|
||||
Project\Workflow::load($proUid);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Util;
|
||||
|
||||
|
||||
use ProcessMaker\Util;
|
||||
|
||||
/**
|
||||
* Class XmlExporterTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class XmlExporterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testGetLastVersion()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(__DIR__."/../../fixtures/files_struct/first/sample-*.txt");
|
||||
$this->assertEquals(3, $lastVer);
|
||||
}
|
||||
|
||||
function testGetLastVersionSec()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(__DIR__."/../../fixtures/files_struct/second/sample-*.txt");
|
||||
|
||||
$this->assertEquals(5, $lastVer);
|
||||
}
|
||||
|
||||
function testGetLastVersionThr()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(__DIR__."/../../fixtures/files_struct/third/sample-*.txt");
|
||||
|
||||
$this->assertEquals("3.1.9", $lastVer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Negative test, no matched files found
|
||||
*/
|
||||
function testGetLastVersionOther()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(sys_get_temp_dir()."/sample-*.txt");
|
||||
|
||||
$this->assertEquals(0, $lastVer);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
include "pm-bootstrap.php";
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
pm_home_dir = "/Users/erik/devel/colosa/processmaker"
|
||||
workspace = workflow
|
||||
lang = en
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// pm-bootstrap.php
|
||||
//
|
||||
|
||||
/*
|
||||
* PmBootstrap for Test Unit Suite
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
|
||||
$config = parse_ini_file(__DIR__ . DIRECTORY_SEPARATOR . "config.ini");
|
||||
|
||||
$workspace = $config['workspace'];
|
||||
$lang = $config['lang'];
|
||||
$processMakerHome = $config['pm_home_dir'];
|
||||
$rootDir = realpath($processMakerHome) . DIRECTORY_SEPARATOR;
|
||||
|
||||
require $rootDir . "framework/src/Maveriks/Util/ClassLoader.php";
|
||||
|
||||
$loader = Maveriks\Util\ClassLoader::getInstance();
|
||||
$loader->add($rootDir . 'framework/src/', "Maveriks");
|
||||
$loader->add($rootDir . 'workflow/engine/src/', "ProcessMaker");
|
||||
$loader->add($rootDir . 'workflow/engine/src/');
|
||||
|
||||
// add vendors to autoloader
|
||||
$loader->add($rootDir . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2");
|
||||
$loader->addClass("Bootstrap", $rootDir . 'gulliver/system/class.bootstrap.php');
|
||||
|
||||
$loader->addModelClassPath($rootDir . "workflow/engine/classes/model/");
|
||||
|
||||
$app = new Maveriks\WebApplication();
|
||||
$app->setRootDir($rootDir);
|
||||
$app->loadEnvironment($workspace);
|
||||
@@ -1,562 +0,0 @@
|
||||
{literal}
|
||||
<style>
|
||||
ul.debug-node {
|
||||
background-color:white;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
ul.debug-node ul {
|
||||
margin-left:20px;
|
||||
}
|
||||
* html ul.debug-node ul {
|
||||
margin-left:24px;
|
||||
}
|
||||
div.debug-root {
|
||||
border:1px solid black;
|
||||
margin:1em 0em;
|
||||
text-align:left;
|
||||
}
|
||||
ul.debug-first {
|
||||
border:1px solid white;
|
||||
font-family:tahoma,verdana;
|
||||
font-size:11px;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:normal;
|
||||
line-height:normal;
|
||||
}
|
||||
li.debug-child {
|
||||
display:block;
|
||||
list-style-image:none;
|
||||
list-style-position:outside;
|
||||
list-style-type:none;
|
||||
margin:0px;
|
||||
overflow:hidden;
|
||||
padding:0px;
|
||||
}
|
||||
div.debug-element {
|
||||
background-color:white;
|
||||
background-image:url(/Krumo/skins/schablon.com/empty.gif);
|
||||
background-position:6px 5px;
|
||||
background-repeat:no-repeat;
|
||||
clear:both;
|
||||
cursor:default;
|
||||
display:block;
|
||||
padding:2px 0px 3px 20px;
|
||||
white-space:nowrap;
|
||||
}
|
||||
* html div.debug-element {
|
||||
line-height:13px;
|
||||
padding-bottom:3px;
|
||||
}
|
||||
div.debug-expand {
|
||||
background-image:url(/Krumo/skins/schablon.com/collapsed.gif);
|
||||
cursor:pointer;
|
||||
}
|
||||
div.debug-hover {
|
||||
background-color:#BFDFFF;
|
||||
}
|
||||
div.debug-opened {
|
||||
background-image:url(/Krumo/skins/schablon.com/expanded.gif);
|
||||
}
|
||||
a.debug-name {
|
||||
color:navy;
|
||||
font-family:courier new;
|
||||
font-size:13px;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:bold;
|
||||
line-height:12px;
|
||||
}
|
||||
a.debug-name big {
|
||||
font-family:Georgia;
|
||||
font-size:16pt;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:bold;
|
||||
left:-2px;
|
||||
line-height:10px;
|
||||
position:relative;
|
||||
top:2px;
|
||||
}
|
||||
* html a.debug-name big {
|
||||
float:left;
|
||||
font-family:Georgia;
|
||||
font-size:15pt;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:bold;
|
||||
left:0px;
|
||||
line-height:normal;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
top:-5px;
|
||||
}
|
||||
em.debug-type {
|
||||
font-style:normal;
|
||||
margin:0px 2px;
|
||||
}
|
||||
div.debug-preview {
|
||||
background:lightyellow none repeat scroll 0%;
|
||||
border:1px solid #808000;
|
||||
font-family:courier new;
|
||||
font-size:13px;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:normal;
|
||||
line-height:normal;
|
||||
margin:5px 1em 1em 0px;
|
||||
overflow:auto;
|
||||
padding:5px;
|
||||
}
|
||||
* html div.debug-preview {
|
||||
padding-top:2px;
|
||||
}
|
||||
li.debug-footnote {
|
||||
background:white url(/Krumo/skins/schablon.com/dotted.gif) repeat-x scroll 0%;
|
||||
cursor:default;
|
||||
list-style-image:none;
|
||||
list-style-position:outside;
|
||||
list-style-type:none;
|
||||
padding:4px 5px 3px;
|
||||
}
|
||||
* html li.debug-footnote {
|
||||
line-height:13px;
|
||||
}
|
||||
div.debug-version {
|
||||
float:right;
|
||||
}
|
||||
li.debug-footnote h6 {
|
||||
color:navy;
|
||||
display:inline;
|
||||
font-family:verdana;
|
||||
font-size:11px;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:bold;
|
||||
line-height:normal;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
* html li.debug-footnote h6 {
|
||||
margin-right:3px;
|
||||
}
|
||||
li.debug-footnote a {
|
||||
color:#434343;
|
||||
font-family:arial;
|
||||
font-size:10px;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:bold;
|
||||
line-height:normal;
|
||||
text-decoration:none;
|
||||
}
|
||||
li.debug-footnote a:hover {
|
||||
color:black;
|
||||
}
|
||||
li.debug-footnote span.debug-call {
|
||||
font-family:tahoma,verdana;
|
||||
font-size:11px;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:normal;
|
||||
line-height:normal;
|
||||
position:relative;
|
||||
top:1px;
|
||||
}
|
||||
li.debug-footnote span.debug-call code {
|
||||
font-weight:bold;
|
||||
}
|
||||
div.debug-title {
|
||||
cursor:default;
|
||||
font-family:tahoma,verdana;
|
||||
font-size:11px;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:normal;
|
||||
line-height:2px;
|
||||
position:relative;
|
||||
top:9px;
|
||||
}
|
||||
strong.debug-array-length, strong.debug-string-length {
|
||||
color:#000099;
|
||||
font-weight:normal;
|
||||
}
|
||||
</style>
|
||||
{/literal}
|
||||
|
||||
<div class="debug-root">
|
||||
<ul class="debug-node debug-first">
|
||||
<li class="debug-child">
|
||||
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-expand debug-opened">
|
||||
<a class="debug-name">Application</a>
|
||||
(<em class="debug-type"><strong class="debug-array-length">{$APP_UID}</strong></em>)
|
||||
<strong class="debug-string">{$APP_STATUS} </strong>
|
||||
<strong class="debug-array-length">{$APP_NUMBER}</strong></em>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="display: block;" class="debug-nest">
|
||||
<ul class="debug-node">
|
||||
<li class="debug-child">
|
||||
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-expand debug-opened">
|
||||
<a class="debug-name">properties</a>
|
||||
(<em class="debug-type">Array, <strong class="debug-array-length">7 elements</strong></em>)
|
||||
</div>
|
||||
<div style="display: none;" class="debug-nest">
|
||||
<ul class="debug-node">
|
||||
<li class="debug-child">
|
||||
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">APP_TITLE</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">{$APP_NUMBER}</strong></em>)
|
||||
<strong class="debug-string">{$APP_TITLE}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">APP_STATUS</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">{$APP_STATUS}</strong></em>)
|
||||
<strong class="debug-string">{$STATUS}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">PRO_TITLE</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">{$PRO_UID}</strong></em>)
|
||||
<strong class="debug-string">{$PRO_TITLE}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">APP_INIT_USER</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">{$APP_INIT_USER}</strong></em>)
|
||||
<strong class="debug-string">{$CREATOR}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">APP_CUR_USER</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">{$APP_CUR_USER}</strong></em>)
|
||||
<strong class="debug-string">{$CUR_USER}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">APP_PARALLEL</a> (<em class="debug-type">Integer</em>)
|
||||
<strong class="debug-string">{$APP_PARALLEL}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">APP_PIN</a> (<em class="debug-type">Integer</em>)
|
||||
<strong class="debug-string">{$APP_PIN}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">APP_PROC_CODE</a> (<em class="debug-type">Integer</em>)
|
||||
<strong class="debug-string">{$APP_PROC_CODE}</strong>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-expand debug-opened">
|
||||
<a class="debug-name">delegations</a>
|
||||
(<em class="debug-type">Array, <strong class="debug-array-length">{$CANT_DELEGATIONS} elements</strong></em>)
|
||||
</div>
|
||||
<div style="display: block;" class="debug-nest">
|
||||
<ul class="debug-node">
|
||||
{foreach key=id item=data from=$DELEGATIONS}
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-expand debug-opened">
|
||||
<a class="debug-name">{$data.DEL_INDEX}</a>
|
||||
[<em class="debug-type">thread:</em>
|
||||
<strong class="debug-string">{$data.DEL_THREAD}</strong>]
|
||||
[<em class="debug-type">thread status:</em>
|
||||
<strong class="debug-array-length">{$data.DEL_THREAD_STATUS}</strong>]
|
||||
[<em class="debug-type">type:</em>
|
||||
<strong class="debug-string">{$data.DEL_TYPE}</strong>]
|
||||
[<em class="debug-type">user:</em>
|
||||
<strong class="debug-string">{$data.USR_NAME}</strong>]
|
||||
[<em class="debug-type">task:</em>
|
||||
<strong class="debug-string">{$data.TAS_TITLE}</strong>]
|
||||
</div>
|
||||
<div style="display: none;" class="debug-nest">
|
||||
<ul class="debug-node">
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_PREVIOUS</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">integer</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_PREVIOUS}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">TAS_UID</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">{$data.TAS_UID}</strong></em>)
|
||||
<strong class="debug-string">{$data.TAS_TITLE}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">USR_UID</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">{$data.USR_UID}</strong></em>)
|
||||
<strong class="debug-string">{$data.USR_NAME}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_TYPE</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">string</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_TYPE}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_THREAD</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">integer</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_THREAD}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_THREAD_STATUS</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">string</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_THREAD_STATUS}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_PRIORITY</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">string</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_PRIORITY}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_DELEGATE_DATE</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">date</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_DELEGATE_DATE}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_INIT_DATE</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">date</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_INIT_DATE}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_TASK_DUE_DATE</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">date</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_TASK_DUE_DATE}</strong>
|
||||
</div>
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" class="debug-element">
|
||||
<a class="debug-name">DEL_FINISH_DATE</a> (<em class="debug-type">
|
||||
<strong class="debug-array-length">date</strong></em>)
|
||||
<strong class="debug-string">{$data.DEL_FINISH_DATE}</strong>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-expand debug-opened">
|
||||
<a class="debug-name">threads</a>
|
||||
(<em class="debug-type">Array, <strong class="debug-array-length">{$CANT_THREADS} elements</strong></em>)
|
||||
</div>
|
||||
<div style="display: block;" class="debug-nest">
|
||||
<ul class="debug-node">
|
||||
{foreach key=id item=data from=$THREADS}
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-opened">
|
||||
<a class="debug-name">{$data.APP_THREAD_INDEX}</a>
|
||||
[<em class="debug-type">thread status:</em>
|
||||
<strong class="debug-string">{$data.APP_THREAD_STATUS}</strong>]
|
||||
[<em class="debug-type">thread parent:</em>
|
||||
<strong class="debug-array-length">{$data.APP_THREAD_PARENT}</strong>]
|
||||
[<em class="debug-type">del_index:</em>
|
||||
<strong class="debug-string">{$data.DEL_INDEX}</strong>]
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-expand debug-opened">
|
||||
<a class="debug-name">actions (APP_DELAY)</a>
|
||||
(<em class="debug-type">Array, <strong class="debug-array-length">{$CANT_DELAYS} elements</strong></em>)
|
||||
</div>
|
||||
<div style="display: block;" class="debug-nest">
|
||||
<ul class="debug-node">
|
||||
{foreach key=id item=data from=$DELAYS}
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="return false;krumo.toggle(this);" class="debug-element debug-opened">
|
||||
<!--<a class="debug-name">{$data.APP_TYPE}</a>-->{$data.APP_TYPE}
|
||||
[<em class="debug-type">thread index:</em><strong class="debug-string">{$data.APP_THREAD_INDEX}</strong>]
|
||||
[<em class="debug-type">delegation index:</em><strong class="debug-string">{$data.APP_DEL_INDEX}</strong>]
|
||||
[<em class="debug-type">application status:</em><strong class="debug-string">{$data.APP_STATUS}</strong>]<br />
|
||||
[<em class="debug-type">enable action user:</em><strong class="debug-string">{$data.APP_ENABLE_ACTION_USER}</strong>]
|
||||
[<em class="debug-type">enable action date:</em><strong class="debug-string">{$data.APP_ENABLE_ACTION_DATE}</strong>]<br />
|
||||
[<em class="debug-type">disable action user:</em><strong class="debug-string">{$data.APP_DISABLE_ACTION_USER}</strong>]
|
||||
[<em class="debug-type">disable action date:</em><strong class="debug-string">{$data.APP_DISABLE_ACTION_DATE}</strong>]
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-expand debug-opened">
|
||||
<a class="debug-name">Sub Cases(SUB_APPLICATION)</a>
|
||||
(<em class="debug-type">Array, <strong class="debug-array-length">{$CANT_SUBAPPLICATIONS} elements</strong></em>)
|
||||
</div>
|
||||
<div style="display: block;" class="debug-nest">
|
||||
<ul class="debug-node">
|
||||
{foreach key=id item=data from=$SUBAPPLICATIONS}
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="return false;krumo.toggle(this);" class="debug-element debug-opened">
|
||||
<!--<a class="debug-name">{$data.APP_TYPE}</a>-->{$data.APP_TYPE}
|
||||
[<em class="debug-type">case parent:</em><strong class="debug-string">{$data.APP_PARENT}</strong> Case Number: <strong class="debug-array-length">{$data.APP_NUMBER}</strong>] <br>
|
||||
[<em class="debug-type">del index parent:</em><strong class="debug-string">{$data.DEL_INDEX_PARENT}</strong>]<br />
|
||||
[<em class="debug-type">del thread parent:</em><strong class="debug-string">{$data.DEL_THREAD_PARENT}</strong>]<br />
|
||||
[<em class="debug-type">SubCase Status:</em><strong class="debug-string">{$data.SA_STATUS}</strong>]<br />
|
||||
[<em class="debug-type">Starting Date:</em><strong class="debug-string">{$data.SA_INIT_DATE}</strong>]
|
||||
[<em class="debug-type">Finish Date:</em><strong class="debug-string">{$data.SA_FINISH_DATE}</strong>]
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-expand debug-opened">
|
||||
<a class="debug-name">APP_DATA</a>
|
||||
(<em class="debug-type">Array, <strong class="debug-array-length">{$CANT_APP_DATA} elements</strong></em>)
|
||||
</div>
|
||||
<div style="display: block;" class="debug-nest">
|
||||
<ul class="debug-node">
|
||||
{foreach key=id item=data from=$APP_DATA}
|
||||
<li class="debug-child">
|
||||
<div onmouseout="krumo.out(this);" onmouseover="krumo.over(this);" onclick="krumo.toggle(this);" class="debug-element debug-opened">
|
||||
<a class="debug-name">{$id}</a>
|
||||
<strong class="debug-string">{if $data|is_array}{$data|@debug_print_var}{else}{$data}{/if}</strong>
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{literal}
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--//
|
||||
/**
|
||||
* JavaScript routines for Krumo
|
||||
*
|
||||
* @version $Id: krumo.js 22 2007-12-02 07:38:18Z Mrasnika $
|
||||
* @link http://sourceforge.net/projects/krumo
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Krumo JS Class
|
||||
*/
|
||||
function krumo() {
|
||||
}
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
/**
|
||||
* Add a CSS class to an HTML element
|
||||
*
|
||||
* @param HtmlElement el
|
||||
* @param string className
|
||||
* @return void
|
||||
*/
|
||||
krumo.reclass = function(el, className) {
|
||||
if (el.className.indexOf(className) < 0) {
|
||||
el.className += (' ' + className);
|
||||
}
|
||||
}
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
/**
|
||||
* Remove a CSS class to an HTML element
|
||||
*
|
||||
* @param HtmlElement el
|
||||
* @param string className
|
||||
* @return void
|
||||
*/
|
||||
krumo.unclass = function(el, className) {
|
||||
if (el.className.indexOf(className) > -1) {
|
||||
el.className = el.className.replace(className, '');
|
||||
}
|
||||
}
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
/**
|
||||
* Toggle the nodes connected to an HTML element
|
||||
*
|
||||
* @param HtmlElement el
|
||||
* @return void
|
||||
*/
|
||||
krumo.toggle = function(el) {
|
||||
var ul = el.parentNode.getElementsByTagName('ul');
|
||||
for (var i=0; i<ul.length; i++) {
|
||||
if (ul[i].parentNode.parentNode == el.parentNode) {
|
||||
ul[i].parentNode.style.display = (ul[i].parentNode.style.display == 'none')
|
||||
? 'block'
|
||||
: 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// toggle class
|
||||
//
|
||||
if (ul[0].parentNode.style.display == 'block') {
|
||||
krumo.reclass(el, 'krumo-opened');
|
||||
} else {
|
||||
krumo.unclass(el, 'krumo-opened');
|
||||
}
|
||||
}
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
/**
|
||||
* Hover over an HTML element
|
||||
*
|
||||
* @param HtmlElement el
|
||||
* @return void
|
||||
*/
|
||||
krumo.over = function(el) {
|
||||
krumo.reclass(el, 'krumo-hover');
|
||||
}
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
/**
|
||||
* Hover out an HTML element
|
||||
*
|
||||
* @param HtmlElement el
|
||||
* @return void
|
||||
*/
|
||||
|
||||
krumo.out = function(el) {
|
||||
krumo.unclass(el, 'krumo-hover');
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//-->
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -1,14 +0,0 @@
|
||||
Ext.onReady(function(){
|
||||
location.href = uriReq;
|
||||
|
||||
var hideMask = function () {
|
||||
Ext.get('loading').remove();
|
||||
Ext.fly('loading-mask').fadeOut({
|
||||
remove:true,
|
||||
callback : ''
|
||||
});
|
||||
}
|
||||
|
||||
hideMask.defer(250);
|
||||
|
||||
});
|
||||
@@ -409,8 +409,7 @@ Ext.onReady(function(){
|
||||
region: 'center',
|
||||
layout: 'fit',
|
||||
id: 'processesGrid',
|
||||
height:500,
|
||||
//autoWidth : true,
|
||||
height: 500,
|
||||
width:'',
|
||||
title : '',
|
||||
stateful : true,
|
||||
@@ -421,13 +420,6 @@ Ext.onReady(function(){
|
||||
plugins: expander,
|
||||
cls : 'grid_with_checkbox',
|
||||
columnLines: true,
|
||||
|
||||
|
||||
/*view: new Ext.grid.GroupingView({
|
||||
//forceFit:true,
|
||||
//groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
|
||||
groupTextTpl: '{text}'
|
||||
}),*/
|
||||
viewConfig: {
|
||||
forceFit:true,
|
||||
cls:"x-grid-empty",
|
||||
@@ -1215,7 +1207,7 @@ function exportImportProcessObjects(typeAction)
|
||||
gridProcessObjects = new Ext.grid.EditorGridPanel( {
|
||||
region: 'center',
|
||||
layout: 'fit',
|
||||
id: 'processesGrid',
|
||||
id: 'gridProcessObjects',
|
||||
height:365,
|
||||
width:355,
|
||||
title : '',
|
||||
|
||||
@@ -331,7 +331,8 @@ Ext.onReady(function () {
|
||||
editable : false,
|
||||
allowBlank : false,
|
||||
triggerAction : 'all',
|
||||
mode : 'local'
|
||||
mode : 'local',
|
||||
tpl: '<tpl for="."><div class="x-combo-list-item">{CALENDAR_NAME:htmlEncode}</div></tpl>'
|
||||
});
|
||||
|
||||
var status = new Ext.data.SimpleStore({
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* functional.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.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is part of the symfony package.
|
||||
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
// guess current application
|
||||
if (!isset($app))
|
||||
{
|
||||
$traces = debug_backtrace();
|
||||
$caller = $traces[0];
|
||||
$app = array_pop(explode(DIRECTORY_SEPARATOR, dirname($caller['file'])));
|
||||
}
|
||||
|
||||
// define symfony constant
|
||||
define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/../..'));
|
||||
define('SF_APP', $app);
|
||||
define('SF_ENVIRONMENT', 'test');
|
||||
define('SF_DEBUG', true);
|
||||
|
||||
// initialize symfony
|
||||
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
|
||||
|
||||
// remove all cache
|
||||
sfToolkit::clearDirectory(sfConfig::get('sf_cache_dir'));
|
||||
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* gulliverConstants.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.
|
||||
*
|
||||
*/
|
||||
|
||||
//***************** URL KEY *********************************************
|
||||
define("URL_KEY", 'c0l0s40pt1mu59r1m3' );
|
||||
|
||||
//***************** System Directories & Paths **************************
|
||||
define('PATH_SEP', '/');
|
||||
|
||||
define( 'PATH_HOME', '/opt/processmaker/trunk/workflow/' );
|
||||
define( 'PATH_GULLIVER_HOME', '/opt/processmaker/trunk/gulliver' . PATH_SEP );
|
||||
//define( 'PATH_GULLIVER_HOME', $pathTrunk . 'gulliver' . PATH_SEP );
|
||||
define( 'PATH_RBAC_HOME', $pathTrunk . 'rbac' . PATH_SEP );
|
||||
define( 'PATH_DATA', '/shared/workflow_data/');
|
||||
|
||||
// the other directories
|
||||
define( 'PATH_GULLIVER', PATH_GULLIVER_HOME . 'system' . PATH_SEP ); //gulliver system classes
|
||||
define( 'PATH_TEMPLATE', PATH_GULLIVER_HOME . 'templates' . PATH_SEP );
|
||||
define( 'PATH_THIRDPARTY', PATH_GULLIVER_HOME . 'thirdparty' . PATH_SEP );
|
||||
define( 'PATH_RBAC', PATH_RBAC_HOME . 'engine/classes' . PATH_SEP ); //to enable rbac version 2
|
||||
define( 'PATH_HTML', PATH_HOME . 'public_html' . PATH_SEP );
|
||||
|
||||
// Application's General Directories
|
||||
define( 'PATH_CORE', PATH_HOME . 'engine' . PATH_SEP );
|
||||
define( 'PATH_SKINS', PATH_CORE . 'skins' . PATH_SEP );
|
||||
define( 'PATH_METHODS', PATH_CORE . 'methods' . PATH_SEP );
|
||||
define( 'PATH_XMLFORM', PATH_CORE . 'xmlform' . PATH_SEP );
|
||||
|
||||
//************ include Gulliver Class **************
|
||||
require_once( PATH_GULLIVER . PATH_SEP . 'class.g.php');
|
||||
|
||||
// the Compiled Directories
|
||||
define( 'PATH_C', $pathOutTrunk . 'compiled/');
|
||||
|
||||
// the Smarty Directories
|
||||
if ( strstr ( getenv ( 'OS' ), 'Windows' ) ) {
|
||||
define( 'PATH_SMARTY_C', 'c:/tmp/smarty/c' );
|
||||
define( 'PATH_SMARTY_CACHE', 'c:/tmp/smarty/cache' );
|
||||
}
|
||||
else {
|
||||
define( 'PATH_SMARTY_C', PATH_C . 'smarty/c' );
|
||||
define( 'PATH_SMARTY_CACHE', PATH_C . 'smarty/cache' );
|
||||
}
|
||||
|
||||
if (!is_dir(PATH_SMARTY_C)) G::mk_dir(PATH_SMARTY_C);
|
||||
if (!is_dir(PATH_SMARTY_CACHE)) G::mk_dir(PATH_SMARTY_CACHE);
|
||||
|
||||
|
||||
// Other Paths
|
||||
//define( 'PATH_DB' , PATH_HOME . 'engine' . PATH_SEP . 'db' . PATH_SEP);
|
||||
define( 'PATH_DB' , PATH_DATA . 'sites' . PATH_SEP );
|
||||
define( 'PATH_RTFDOCS' , PATH_CORE . 'rtf_templates' . PATH_SEP );
|
||||
define( 'PATH_HTMLMAIL', PATH_CORE . 'html_templates' . PATH_SEP );
|
||||
define( 'PATH_TPL' , PATH_CORE . 'templates' . PATH_SEP );
|
||||
define( 'PATH_DYNACONT', PATH_CORE . 'content' . PATH_SEP . 'dynaform' . PATH_SEP );
|
||||
define( 'PATH_LANGUAGECONT', PATH_CORE . 'content' . PATH_SEP . 'languages' . PATH_SEP );
|
||||
define( 'SYS_UPLOAD_PATH', PATH_HOME . "public_html/files/" );
|
||||
define( 'PATH_UPLOAD', PATH_HTML . 'files/');
|
||||
|
||||
|
||||
define ('DB_HOST', '192.168.0.10' );
|
||||
define ('DB_NAME', 'wf_opensource' );
|
||||
define ('DB_USER', 'fluid' );
|
||||
define ('DB_PASS', 'fluid2000' );
|
||||
define ('DB_RBAC_NAME', 'rbac_os' );
|
||||
define ('DB_RBAC_USER', 'rbac_os' );
|
||||
define ('DB_RBAC_PASS', '873821w3n2u719tx' );
|
||||
define ('DB_WIZARD_REPORT_SYS', 'report_os' );
|
||||
define ('DB_WIZARD_REPORT_USER', 'rep_os' );
|
||||
define ('DB_WIZARD_REPORT_PASS', '3r357ichy6b95s88' );
|
||||
|
||||
define ( 'SF_ROOT_DIR', PATH_CORE );
|
||||
define ( 'SF_APP', 'app' );
|
||||
define ( 'SF_ENVIRONMENT', 'env' );
|
||||
|
||||
set_include_path(
|
||||
PATH_THIRDPARTY . PATH_SEPARATOR .
|
||||
PATH_THIRDPARTY . 'pear' . PATH_SEPARATOR .
|
||||
get_include_path()
|
||||
);
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* unit.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.
|
||||
*
|
||||
*/
|
||||
ini_set('short_open_tag', 'on');
|
||||
ini_set('asp_tags', 'on');
|
||||
ini_set('memory_limit', '80M');
|
||||
|
||||
if ( PHP_OS == 'WINNT' )
|
||||
define('PATH_SEP', '\\');
|
||||
else
|
||||
define('PATH_SEP', '/');
|
||||
|
||||
|
||||
//***************** Defining the Home Directory *********************************
|
||||
$docuroot = explode ( PATH_SEP , $_SERVER['PWD'] );
|
||||
array_pop($docuroot);
|
||||
$pathhome = implode( PATH_SEP, $docuroot );
|
||||
define('PATH_HOME', $pathhome . PATH_SEP );
|
||||
$gulliverConfig = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php';
|
||||
$definesConfig = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'defines.php';
|
||||
|
||||
//try to find automatically the trunk directory where are placed the RBAC and Gulliver directories
|
||||
//in a normal installation you don't need to change it.
|
||||
array_pop($docuroot);
|
||||
$pathTrunk = implode( PATH_SEP, $docuroot ) . PATH_SEP ;
|
||||
array_pop($docuroot);
|
||||
$pathOutTrunk = implode( PATH_SEP, $docuroot ) . PATH_SEP ;
|
||||
// to do: check previous algorith for Windows $pathTrunk = "c:/home/";
|
||||
|
||||
define('PATH_TRUNK', $pathTrunk );
|
||||
define('PATH_OUTTRUNK', $pathOutTrunk );
|
||||
|
||||
if (file_exists( $gulliverConfig )) {
|
||||
include ( $gulliverConfig );
|
||||
}
|
||||
|
||||
if (file_exists( $definesConfig )) {
|
||||
include ( $definesConfig );
|
||||
}
|
||||
|
||||
//$_test_dir = realpath(dirname(__FILE__).'/..');
|
||||
//require_once( 'lime/lime.php');
|
||||
if(file_exists(PATH_GULLIVER . "class.bootstrap.php")) {
|
||||
require_once (PATH_GULLIVER . "class.bootstrap.php");
|
||||
}
|
||||
spl_autoload_register(array('Bootstrap', 'autoloadClass'));
|
||||
Bootstrap::registerClass('G', PATH_GULLIVER . "class.g.php");
|
||||
Bootstrap::registerClass('System', PATH_HOME . "engine/classes/class.system.php");
|
||||
// Call more Classes
|
||||
Bootstrap::registerClass('headPublisher', PATH_GULLIVER . "class.headPublisher.php");
|
||||
Bootstrap::registerClass('publisher', PATH_GULLIVER . "class.publisher.php");
|
||||
Bootstrap::registerClass('xmlform', PATH_GULLIVER . "class.xmlform.php");
|
||||
Bootstrap::registerClass('XmlForm_Field', PATH_GULLIVER . "class.xmlform.php");
|
||||
Bootstrap::registerClass('xmlformExtension', PATH_GULLIVER . "class.xmlformExtension.php");
|
||||
Bootstrap::registerClass('form', PATH_GULLIVER . "class.form.php");
|
||||
Bootstrap::registerClass('menu', PATH_GULLIVER . "class.menu.php");
|
||||
Bootstrap::registerClass('Xml_Document', PATH_GULLIVER . "class.xmlDocument.php");
|
||||
Bootstrap::registerClass('DBSession', PATH_GULLIVER . "class.dbsession.php");
|
||||
Bootstrap::registerClass('DBConnection', PATH_GULLIVER . "class.dbconnection.php");
|
||||
Bootstrap::registerClass('DBRecordset', PATH_GULLIVER . "class.dbrecordset.php");
|
||||
Bootstrap::registerClass('DBTable', PATH_GULLIVER . "class.dbtable.php");
|
||||
Bootstrap::registerClass('xmlMenu', PATH_GULLIVER . "class.xmlMenu.php");
|
||||
Bootstrap::registerClass('XmlForm_Field_FastSearch', PATH_GULLIVER . "class.xmlformExtension.php");
|
||||
Bootstrap::registerClass('XmlForm_Field_XmlMenu', PATH_GULLIVER . "class.xmlMenu.php");
|
||||
Bootstrap::registerClass('XmlForm_Field_WYSIWYG_EDITOR', PATH_GULLIVER . "class.wysiwygEditor.php");
|
||||
Bootstrap::registerClass('Controller', PATH_GULLIVER . "class.controller.php");
|
||||
Bootstrap::registerClass('HttpProxyController', PATH_GULLIVER . "class.httpProxyController.php");
|
||||
Bootstrap::registerClass('templatePower', PATH_GULLIVER . "class.templatePower.php");
|
||||
Bootstrap::registerClass('XmlForm_Field_SimpleText', PATH_GULLIVER . "class.xmlformExtension.php");
|
||||
Bootstrap::registerClass('Propel', PATH_THIRDPARTY . "propel/Propel.php");
|
||||
Bootstrap::registerClass('Creole', PATH_THIRDPARTY . "creole/Creole.php");
|
||||
Bootstrap::registerClass('Criteria', PATH_THIRDPARTY . "propel/util/Criteria.php");
|
||||
Bootstrap::registerClass('Groups', PATH_HOME . "engine/classes/class.groups.php");
|
||||
Bootstrap::registerClass('Tasks', PATH_HOME . "engine/classes/class.tasks.php");
|
||||
Bootstrap::registerClass('Calendar', PATH_HOME . "engine/classes/class.calendar.php");
|
||||
Bootstrap::registerClass('processMap', PATH_HOME . "engine/classes/class.processMap.php");
|
||||
|
||||
Bootstrap::registerSystemClasses();
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'pake' . PATH_SEP . 'pakeFunction.php');
|
||||
require_once( PATH_THIRDPARTY . 'pake' . PATH_SEP . 'pakeGetopt.class.php');
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
if ( !defined ( 'G_ENVIRONMENT') )
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV );
|
||||
|
||||
40
workflow/engine/test/fixtures/appDelegation.yml
vendored
40
workflow/engine/test/fixtures/appDelegation.yml
vendored
@@ -1,40 +0,0 @@
|
||||
CreateAppDelegations:
|
||||
-
|
||||
Title: "Create AppDelegation with Empty $Fields"
|
||||
Function: "CreateEmptyAppDelegation"
|
||||
Input:
|
||||
Output:
|
||||
Type: "G_Error"
|
||||
-
|
||||
Title: "Create Duplicated AppDelegation"
|
||||
Function: "CreateDuplicated"
|
||||
Input:
|
||||
APP_UID: "1DUPLICATED1"
|
||||
DEL_INDEX: 2
|
||||
PRO_UID[]: "guid.pm"
|
||||
TAS_UID[]: "guid.pm"
|
||||
Output:
|
||||
Type: "G_Error"
|
||||
-
|
||||
TODO: "Review: Error catch in CreateAppDelegation capture Propel Errors but return the same G_Error information."
|
||||
-
|
||||
Title: "Create random new AppDelegation"
|
||||
Function: "CreateNewAppDelegation"
|
||||
Input:
|
||||
APP_UID[]: "guid.pm"
|
||||
DEL_INDEX[]: "rand.number"
|
||||
PRO_UID[]: "guid.pm"
|
||||
TAS_UID[]: "guid.pm"
|
||||
DEL_TYPE[]: "*.DEL_TYPE.pm"
|
||||
DEL_THREAD_STATUS[]: "*.DEL_THREAD_STATUS.pm"
|
||||
Output:
|
||||
Type: "string"
|
||||
-
|
||||
TODO: "Review: There isn't a 'function delete'. Is it required?"
|
||||
DeleteCretedAppDelegations:
|
||||
-
|
||||
Title: "Deleting created AppDelegations"
|
||||
Input:
|
||||
Fields[]:"*.createdAppDel"
|
||||
Output:
|
||||
Value: "true"
|
||||
100
workflow/engine/test/fixtures/appDocument.yml
vendored
100
workflow/engine/test/fixtures/appDocument.yml
vendored
@@ -1,100 +0,0 @@
|
||||
load1:
|
||||
-
|
||||
Title: "Obtain the application document data"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
APP_DOC_UID: "1"
|
||||
Output:
|
||||
Type: "array"
|
||||
load2:
|
||||
-
|
||||
Title: "Obtain the application document data (not existent)"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
APP_DOC_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
create1:
|
||||
-
|
||||
Title: "Create the application document data"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
APP_DOC_UID: "2"
|
||||
APP_UID: "2"
|
||||
DEL_INDEX: "2"
|
||||
DOC_UID: "2"
|
||||
USR_UID: "2"
|
||||
APP_DOC_TYPE: "INPUT"
|
||||
APP_DOC_CREATE_DATE: "2007-12-31 23:59:59"
|
||||
APP_DOC_TITLE: "APP_DOC_TITLE"
|
||||
APP_DOC_COMMENT: "APP_DOC_COMMENT"
|
||||
APP_DOC_FILENAME: "APP_DOC_FILENAME"
|
||||
Output:
|
||||
Type: "integer"
|
||||
create2:
|
||||
-
|
||||
Title: "Create the application document data (whit incomplete data)"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
APP_DOC_UID: ""
|
||||
APP_UID: "2"
|
||||
DEL_INDEX: "2"
|
||||
DOC_UID: "2"
|
||||
USR_UID: "2"
|
||||
APP_DOC_TYPE: "INPUT"
|
||||
APP_DOC_CREATE_DATE: "2007-12-31 23:59:59"
|
||||
APP_DOC_TITLE: "APP_DOC_TITLE"
|
||||
APP_DOC_COMMENT: "APP_DOC_COMMENT"
|
||||
APP_DOC_FILENAME: "APP_DOC_FILENAME"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
update1:
|
||||
-
|
||||
Title: "Update the application document data"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
APP_DOC_UID: "1"
|
||||
APP_UID: "2"
|
||||
DEL_INDEX: "2"
|
||||
DOC_UID: "2"
|
||||
USR_UID: "2"
|
||||
APP_DOC_TYPE: "OUTPUT"
|
||||
APP_DOC_CREATE_DATE: "2008-01-01 00:00:00"
|
||||
APP_DOC_TITLE: "APP_DOC_TITLE1"
|
||||
APP_DOC_COMMENT: "APP_DOC_COMMENT1"
|
||||
APP_DOC_FILENAME: "APP_DOC_FILENAME1"
|
||||
Output:
|
||||
Type: "integer"
|
||||
update2:
|
||||
-
|
||||
Title: "Update the application document data (not existent)"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
APP_DOC_UID: "111111111111"
|
||||
APP_UID: "2"
|
||||
DEL_INDEX: "2"
|
||||
DOC_UID: "2"
|
||||
USR_UID: "2"
|
||||
APP_DOC_TYPE: "OUTPUT"
|
||||
APP_DOC_CREATE_DATE: "2008-01-01 00:00:00"
|
||||
APP_DOC_TITLE: "APP_DOC_TITLE1"
|
||||
APP_DOC_COMMENT: "APP_DOC_COMMENT1"
|
||||
APP_DOC_FILENAME: "APP_DOC_FILENAME1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
remove1:
|
||||
-
|
||||
Title: "Remove the application document data"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
APP_DOC_UID: "2"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
remove2:
|
||||
-
|
||||
Title: "Remove the application document data (not existent)"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
APP_DOC_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
10
workflow/engine/test/fixtures/application.yml
vendored
10
workflow/engine/test/fixtures/application.yml
vendored
@@ -1,10 +0,0 @@
|
||||
fields:
|
||||
PRO_UID: '346FAE3953CC69'
|
||||
APP_PARENT: ''
|
||||
APP_STATUS: 'DRAFT'
|
||||
APP_PROC_STATUS: 'STATUS'
|
||||
APP_PROC_CODE: '12345678'
|
||||
APP_PARALLEL: 'N'
|
||||
APP_INIT_USER: 'ABC123'
|
||||
APP_CUR_USER: 'ABC123'
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
FirstStepTestCases:
|
||||
-
|
||||
Title: "@#Function(): Create some non Parallel Cases"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "SaveTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_PARALLEL: "N"
|
||||
APP_INIT_USER: "@G::generateUniqueID()"
|
||||
APP_CUR_USER: "@G::generateUniqueID()"
|
||||
APP_CREATE_DATE: "@date(Y-m-d)"
|
||||
APP_INIT_DATE: "0000-00-00"
|
||||
APP_FINISH_DATE: "0000-00-00"
|
||||
APP_UPDATE_DATE: "@date(Y-m-d)"
|
||||
APP_STATUS[]:"*.nonParallelStatus.applicationInput"
|
||||
APP_PARENT: "0"
|
||||
APP_PROC_STATUS: ""
|
||||
APP_PROC_CODE: ""
|
||||
Output:
|
||||
Type: "string"
|
||||
-
|
||||
Title: "@#Function(): Create one parallel Case (Force to be parallel)"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "SaveTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_PARALLEL: "Y"
|
||||
APP_STATUS: "PARALLEL"
|
||||
APP_PARENT: "0"
|
||||
APP_PROC_STATUS: ""
|
||||
APP_PROC_CODE: ""
|
||||
APP_INIT_USER: "@G::generateUniqueID()"
|
||||
APP_CUR_USER: "@G::generateUniqueID()"
|
||||
APP_CREATE_DATE: "@date(Y-m-d)"
|
||||
APP_INIT_DATE: "0000-00-00"
|
||||
APP_FINISH_DATE: "0000-00-00"
|
||||
Output:
|
||||
Type: "string"
|
||||
SecondStepTestCases:
|
||||
-
|
||||
Title: "@#Function(): Update one of LastCreatedCases with all diferent types of status"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "UpdateTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_UID[]: "LAST_CREATED_CASE"
|
||||
APP_STATUS[]: "*.APP_STATUS.pm"
|
||||
Output:
|
||||
Type: "string"
|
||||
-
|
||||
Title: "@#Function(): Loads all LastCreatedCases"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "LoadTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_UID[]: "*.LAST_CREATED_CASE"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
-
|
||||
Title: "@#Function(): Delete all LastCreatedCases"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "DeleteTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_UID[]: "*.LAST_CREATED_CASE"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
nonParallelStatus:
|
||||
- "DRAFT"
|
||||
- "CANCEL"
|
||||
47
workflow/engine/test/fixtures/configuration.yml
vendored
47
workflow/engine/test/fixtures/configuration.yml
vendored
@@ -1,47 +0,0 @@
|
||||
CreateTestConfigurations:
|
||||
-
|
||||
Title:"Creating new Configurations"
|
||||
Function:"CreateConfiguration"
|
||||
Input:
|
||||
CFG_UID[]:"guid.pm"
|
||||
OBJ_UID[]:"guid.pm"
|
||||
PRO_UID[]:"guid.pm"
|
||||
USR_UID[]:"guid.pm"
|
||||
APP_UID:""
|
||||
Output:
|
||||
Value: 1
|
||||
ConfigurationUnitTest:
|
||||
-
|
||||
Title:"Updating Configurations"
|
||||
Function:"UpdateConfiguration"
|
||||
Input:
|
||||
CFG_UID[]:"CREATED_UID"
|
||||
OBJ_UID[]:"CREATED_OBJ"
|
||||
PRO_UID[]:"CREATED_PRO"
|
||||
USR_UID[]:"CREATED_USR"
|
||||
APP_UID:""
|
||||
CFG_VALUE[]:"*.text.es"
|
||||
Output:
|
||||
Value: 1
|
||||
-
|
||||
Title:"Loading Configurations"
|
||||
Function:"LoadConfiguration"
|
||||
Input:
|
||||
CFG_UID[]:"CREATED_UID"
|
||||
OBJ_UID[]:"CREATED_OBJ"
|
||||
PRO_UID[]:"CREATED_PRO"
|
||||
USR_UID[]:"CREATED_USR"
|
||||
APP_UID:""
|
||||
Output:
|
||||
Type: "array"
|
||||
-
|
||||
Title:"Removing Configurations"
|
||||
Function:"RemoveConfiguration"
|
||||
Input:
|
||||
CFG_UID[]:"CREATED_UID"
|
||||
OBJ_UID[]:"CREATED_OBJ"
|
||||
PRO_UID[]:"CREATED_PRO"
|
||||
USR_UID[]:"CREATED_USR"
|
||||
APP_UID:""
|
||||
Output:
|
||||
Type: "NULL"
|
||||
71
workflow/engine/test/fixtures/content.yml
vendored
71
workflow/engine/test/fixtures/content.yml
vendored
@@ -1,71 +0,0 @@
|
||||
loadContent:
|
||||
-
|
||||
Title: "LoadContent method"
|
||||
Function: "loadContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '6475576C725EA4'
|
||||
CON_LANG: 'it'
|
||||
CON_VALUE: 'Content Example'
|
||||
Output:
|
||||
Type: "string"
|
||||
deleteContent:
|
||||
-
|
||||
Title: "delete a row "
|
||||
Function: "deleteContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '6475576C725EA4'
|
||||
CON_LANG: 'it'
|
||||
Output:
|
||||
Type: "NULL"
|
||||
-
|
||||
Title: "delete a row "
|
||||
Function: "deleteContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '9876543210'
|
||||
CON_LANG: 'it'
|
||||
Output:
|
||||
Type: "NULL"
|
||||
addContent1:
|
||||
-
|
||||
Title: "addContent method, calling the first time"
|
||||
Function: "addContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '9876543210'
|
||||
CON_LANG: 'it'
|
||||
CON_VALUE: 'addContent method, calling the first time'
|
||||
Output:
|
||||
Type: integer
|
||||
addContentTwice:
|
||||
-
|
||||
Title: "validate duplicate row, with the addContent method"
|
||||
Function: "addContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '9876543210'
|
||||
CON_LANG: 'it'
|
||||
CON_VALUE: 'validate duplicate row, now update the row'
|
||||
Output:
|
||||
Type: "integer"
|
||||
addContentAcentos:
|
||||
-
|
||||
Title: "add content with acentos"
|
||||
Function: "addContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '6475576C725EA4'
|
||||
CON_LANG: 'it'
|
||||
CON_VALUE: '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
Output:
|
||||
Type: "integer"
|
||||
|
||||
|
||||
34
workflow/engine/test/fixtures/departments.txt
vendored
34
workflow/engine/test/fixtures/departments.txt
vendored
@@ -1,34 +0,0 @@
|
||||
ExecutivePresident|
|
||||
Marketing|ExecutivePresident
|
||||
SalesDivision|ExecutivePresident
|
||||
RiskManager|Sales
|
||||
NationalSales|Sales
|
||||
InternationalSales|Sales
|
||||
EuropeSales|InternationalSales
|
||||
USASales|InternationalSales
|
||||
JapanSales|InternationalSales
|
||||
InternetSales|Sales
|
||||
AdministrativeDivision|ExecutivePresident
|
||||
Accounting|AdministrativeDivision
|
||||
HumanResources|AdministrativeDivision
|
||||
InfraestructureManagement|AdministrativeDivision
|
||||
Facilities|InfraestructureManagement
|
||||
VehicleMaintenance|InfraestructureManagement
|
||||
InvestigativeDivision|ExecutivePresident
|
||||
Legal|InvestigativeDivision
|
||||
DetectiveSection|InvestigativeDivision
|
||||
Records|InvestigativeDivision
|
||||
EuropeRegional|
|
||||
SupportServiceDivision|ExecutivePresident
|
||||
InformationDesk|SupportServiceDivision
|
||||
TechnologicalResearch|SupportServiceDivision
|
||||
Landlinetelephony|SupportServiceDivision
|
||||
MobileServices|SupportServiceDivision
|
||||
FinanceDivision|ExecutivePresident
|
||||
PlanningandResearch|FinanceDivision
|
||||
DeputyDirector|FinanceDivision
|
||||
OperacionDivision|ExecutivePresident
|
||||
SystemAdministration|OperacionDivision
|
||||
SecurityOfficer|OperacionDivision
|
||||
OperationandBusiness|OperacionDivision
|
||||
SpecialOperations|OperationandBusiness
|
||||
28
workflow/engine/test/fixtures/derivation.yml
vendored
28
workflow/engine/test/fixtures/derivation.yml
vendored
@@ -1,28 +0,0 @@
|
||||
StartCase1:
|
||||
-
|
||||
Title: "Start a new application @#Function()"
|
||||
Function: "StartCaseTest"
|
||||
Input:
|
||||
TAS_UID: "4475E6C8E10346"
|
||||
USR_UID: "4475E6E07C261E"
|
||||
firstname[]: "@@SYS_LANG"
|
||||
lastname[]: "last.name.es"
|
||||
Output:
|
||||
Type: "array"
|
||||
StartCase2:
|
||||
-
|
||||
Title: "Start a new application (pseudo derivate)"
|
||||
Function: "StartCaseTest"
|
||||
Input:
|
||||
TAS_UID: "4475E6C8E10346"
|
||||
USR_UID: "4475E6E07C261E"
|
||||
Output:
|
||||
Type: "array"
|
||||
DeleteCreatedApplications:
|
||||
-
|
||||
Title: "Delete created applications"
|
||||
Function: "DeleteCase"
|
||||
Input:
|
||||
APP_UID[]: "*.CREATED_APPLICATIONS"
|
||||
Output:
|
||||
Type: "array"
|
||||
34
workflow/engine/test/fixtures/domain.yml
vendored
34
workflow/engine/test/fixtures/domain.yml
vendored
@@ -1,34 +0,0 @@
|
||||
pm:
|
||||
APP_STATUS:
|
||||
- "DRAFT"
|
||||
- "CANCEL"
|
||||
- "PARALLEL"
|
||||
DEL_TYPE:
|
||||
- "NORMAL"
|
||||
DEL_THREAD_STATUS:
|
||||
- "OPEN"
|
||||
- "CLOSED"
|
||||
yesno:
|
||||
- "Y"
|
||||
- "N"
|
||||
guid:
|
||||
- "@G::generateUniqueID()"
|
||||
stepUidObj:
|
||||
- "DYNAFORM"
|
||||
- "INPUT_DOCUMENT"
|
||||
- "MESSAGE"
|
||||
- "OUTPUT_DOCUMENT"
|
||||
date:
|
||||
today:
|
||||
- "@date(Y-m-d)"
|
||||
time:
|
||||
today:
|
||||
- "@date(H:i:s)"
|
||||
datetime:
|
||||
today:
|
||||
- "@date(Y-m-d H:i:s)"
|
||||
number:
|
||||
percentage:
|
||||
- "@eval(return rand(0,100\))"
|
||||
rand:
|
||||
-"@rand()"
|
||||
59
workflow/engine/test/fixtures/es.yml
vendored
59
workflow/engine/test/fixtures/es.yml
vendored
@@ -1,59 +0,0 @@
|
||||
name:
|
||||
first:
|
||||
- David
|
||||
- Julio
|
||||
- Mauricio
|
||||
- Wilmer
|
||||
- Fernando
|
||||
- Hugo
|
||||
- Ramiro
|
||||
last:
|
||||
- Callizaya
|
||||
- Avendaño
|
||||
- Veliz
|
||||
- Maborak
|
||||
- Ontiveros
|
||||
- Loza
|
||||
- Cuentas
|
||||
group:
|
||||
- Administración
|
||||
- Consultores
|
||||
- Desarrollo
|
||||
- Gerencia
|
||||
- Ventas
|
||||
- Business Development
|
||||
- Redes y Servidores
|
||||
- Soporte y Entrenamiento
|
||||
- Otros
|
||||
text:
|
||||
- ¿Por qué la ciencia se empeña en comprender el universo si todavia no comprende al ser humano?
|
||||
- Tengo una demostración maravillosa...
|
||||
- La ciencia es la verdadera sabiduría.
|
||||
- El verdadero amante de la vida es el cientifico, pues es el único que se ocupa de descubrir sus misterios.
|
||||
- El conocimiento es patrimonio de la humanidad, no es solo tuyo, trasmítelo para beneficio de toda la humanidad.
|
||||
- La ciencia es la necesidad de demostrar lo que nos acontece.
|
||||
- Cada uno de nosotros es un modelo totalmente nuevo, parecido a otros modelos pero totalmente diferente.
|
||||
- ¿Por qué las moras negras están rojas cuando están verdes?
|
||||
- La ciencia es la manera estadísticamente correcta de contar novelas.
|
||||
- La ciencia de vivir es el arte de amar.
|
||||
- La ciencia es la explicación de lo inexplicable.
|
||||
- Un ser humano es algo más que la suma de sus genes.
|
||||
- La ciencia es el idioma del hombre.
|
||||
- La ciencia me dió lo que soy, un buen hombre. La ciencia me ayudará a ayudar a las personas.
|
||||
- Para ser científico debo afirmar lo que veo y negar lo que creo.
|
||||
- La ciencia es el arte de bosquejar para los demás los fenómenos de la naturaleza...
|
||||
- La ciencia es el instrumento más poderoso de la humanidad.
|
||||
html:
|
||||
- "<p> <b>Hola Mundo!!</b></p>"
|
||||
- "<p> <u>áéíóú</u></p>"
|
||||
- "<p>'hola Mundo!!' <script>alert('Hola Bug!!')</script></p>"
|
||||
email:
|
||||
- "davidsantos@colosa.com"
|
||||
- "juliocesar@colosa.com"
|
||||
- "mauricio@colosa.com"
|
||||
- "wilmer@colosa.com"
|
||||
address:
|
||||
- "Dom - 2453416 Dom. Padres"
|
||||
zip:
|
||||
- "00000"
|
||||
- "52412"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user