Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -2840,8 +2840,8 @@ class Bootstrap
|
||||
public static function displayMaveriksNotLoadedError()
|
||||
{
|
||||
if (! class_exists('\Maveriks\Util\ClassLoader')) {
|
||||
require PATH_TRUNK . "framework/src/Maveriks/pattern/Mvc/View.php";
|
||||
require PATH_TRUNK . "framework/src/Maveriks/pattern/Mvc/PhtmlView.php";
|
||||
require PATH_TRUNK . "framework/src/Maveriks/Pattern/Mvc/View.php";
|
||||
require PATH_TRUNK . "framework/src/Maveriks/Pattern/Mvc/PhtmlView.php";
|
||||
|
||||
$message = "Please review your apache virtual host configuration file, and be sure you have the following rules:
|
||||
|
||||
|
||||
@@ -110,12 +110,29 @@ if (! defined ('PATH_HOME')) {
|
||||
define ('PATH_HOME', $pathhome);
|
||||
define ('PATH_TRUNK', $pathTrunk);
|
||||
define ('PATH_OUTTRUNK', $pathOutTrunk);
|
||||
|
||||
define( 'PATH_CLASSES', PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP );
|
||||
|
||||
require_once PATH_TRUNK . "framework/src/Maveriks/Util/ClassLoader.php";
|
||||
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
||||
require_once (PATH_GULLIVER . "class.bootstrap.php");
|
||||
Bootstrap::registerSystemClasses();
|
||||
spl_autoload_register(array('Bootstrap', 'autoloadClass'));
|
||||
|
||||
|
||||
Bootstrap::registerClass('BaseAppDelegation', PATH_HOME . "engine/classes/model/om/BaseAppDelegation.php");
|
||||
Bootstrap::registerClass('BaseAppDelegationPeer',PATH_HOME . "engine/classes/model/om/BaseAppDelegationPeer.php");
|
||||
Bootstrap::registerClass('BaseEvent', PATH_HOME . "engine/classes/model/om/BaseEvent.php");
|
||||
Bootstrap::registerClass('BaseEventPeer', PATH_HOME . "engine/classes/model/om/BaseEventPeer.php");
|
||||
Bootstrap::registerClass('BaseAppEvent', PATH_HOME . "engine/classes/model/om/BaseAppEvent.php");
|
||||
Bootstrap::registerClass('AppEventPeer', PATH_HOME . "engine/classes/model/AppEventPeer.php");
|
||||
Bootstrap::registerClass('BaseCaseScheduler', PATH_HOME . "engine/classes/model/om/BaseCaseScheduler.php");
|
||||
Bootstrap::registerClass('BaseCaseSchedulerPeer',PATH_HOME . "engine/classes/model/om/BaseCaseSchedulerPeer.php");
|
||||
Bootstrap::registerClass('CaseSchedulerPeer', PATH_HOME . "engine/classes/model/CaseSchedulerPeer.php");
|
||||
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Event.php';
|
||||
require_once 'classes/model/AppEvent.php';
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
|
||||
G::LoadThirdParty ('pear/json', 'class.json');
|
||||
G::LoadThirdParty ('smarty/libs', 'Smarty.class');
|
||||
G::LoadSystem ('error');
|
||||
@@ -140,10 +157,6 @@ if (! defined ('PATH_HOME')) {
|
||||
require_once ("creole/Creole.php");
|
||||
}
|
||||
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Event.php';
|
||||
require_once 'classes/model/AppEvent.php';
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
// G::loadClass('pmScript');
|
||||
|
||||
// //default values
|
||||
|
||||
@@ -188,6 +188,7 @@ class TaskUser extends BaseTaskUser
|
||||
while ($dataset->next()) {
|
||||
$usersTask[] = $dataset->getRow();
|
||||
}
|
||||
$result = new stdClass();
|
||||
$result->data = $usersTask;
|
||||
$result->totalCount = sizeof( $usersTask );
|
||||
|
||||
|
||||
@@ -363,6 +363,7 @@ class Users extends BaseUsers
|
||||
$rows[] = $rs->getRow();
|
||||
}
|
||||
|
||||
$result = new stdClass();
|
||||
$result->data = $rows;
|
||||
$result->totalCount = $totalCount;
|
||||
|
||||
|
||||
@@ -23,16 +23,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
if (defined('PATH_DB') && defined('SYS_SYS')) {
|
||||
if (defined('PATH_DB') && defined('SYS_SYS')) {
|
||||
|
||||
if (!file_exists(PATH_DB . SYS_SYS . '/db.php'))
|
||||
throw new Exception("Could not find db.php in current workspace " . SYS_SYS);
|
||||
throw new Exception("Could not find db.php in current workspace " . SYS_SYS);
|
||||
|
||||
require_once(PATH_DB . SYS_SYS . '/db.php');
|
||||
|
||||
//to do: enable for other databases
|
||||
$dbType = DB_ADAPTER;
|
||||
|
||||
$dsn = DB_ADAPTER . '://' . DB_USER . ':' . DB_PASS . '@' . DB_HOST . '/' . DB_NAME;
|
||||
|
||||
//to do: enable a mechanism to select RBAC Database
|
||||
@@ -42,18 +40,19 @@
|
||||
$dsnReport = DB_ADAPTER . '://' . DB_REPORT_USER . ':' . DB_REPORT_PASS . '@' . DB_REPORT_HOST . '/' . DB_REPORT_NAME;
|
||||
|
||||
switch (DB_ADAPTER) {
|
||||
case 'mysql':
|
||||
$dsn .= '?encoding=utf8';
|
||||
$dsnRbac .= '?encoding=utf8';
|
||||
$dsnReport .= '?encoding=utf8';
|
||||
break;
|
||||
case 'mssql':
|
||||
//$dsn .= '?sendStringAsUnicode=false';
|
||||
//$dsnRbac .= '?sendStringAsUnicode=false';
|
||||
//$dsnReport .= '?sendStringAsUnicode=false';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case 'mysql':
|
||||
$dsn .= '?encoding=utf8';
|
||||
$dsnRbac .= '?encoding=utf8';
|
||||
$dsnReport .= '?encoding=utf8';
|
||||
break;
|
||||
case 'mssql':
|
||||
case 'sqlsrv':
|
||||
//$dsn .= '?sendStringAsUnicode=false';
|
||||
//$dsnRbac .= '?sendStringAsUnicode=false';
|
||||
//$dsnReport .= '?sendStringAsUnicode=false';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$pro ['datasources']['workflow']['connection'] = $dsn;
|
||||
@@ -65,9 +64,9 @@
|
||||
$pro ['datasources']['rp']['connection'] = $dsnReport;
|
||||
$pro ['datasources']['rp']['adapter'] = DB_ADAPTER;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$pro ['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
|
||||
$pro ['datasources']['dbarray']['adapter'] = 'dbarray';
|
||||
$pro ['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
|
||||
$pro ['datasources']['dbarray']['adapter'] = 'dbarray';
|
||||
|
||||
return $pro;
|
||||
return $pro;
|
||||
|
||||
@@ -145,6 +145,7 @@ class Dashboard extends Controller
|
||||
$oConfiguration->aConfig = $dataDashboard;
|
||||
$oConfiguration->saveConfig('Dashboard', '', '', $_SESSION['USER_LOGGED']);
|
||||
|
||||
$result = new stdClass();
|
||||
$result->success = '1';
|
||||
return $result;
|
||||
} catch (Exception $error) {
|
||||
|
||||
@@ -48,7 +48,7 @@ try {
|
||||
} else {
|
||||
$sfunction = $_POST['functions'];
|
||||
}
|
||||
|
||||
$result = new stdclass();
|
||||
switch ($sfunction) {
|
||||
case 'getRelationInfDoc':
|
||||
try {
|
||||
|
||||
@@ -348,6 +348,10 @@ class Variable
|
||||
if (isset($aData["VAR_FIELD_TYPE"])) {
|
||||
Validator::isString($aData['VAR_FIELD_TYPE'], '$var_field_type');
|
||||
Validator::isNotEmpty($aData['VAR_FIELD_TYPE'], '$var_field_type');
|
||||
if ($aData["VAR_FIELD_TYPE"] != 'string' && $aData["VAR_FIELD_TYPE"] != 'integer' && $aData["VAR_FIELD_TYPE"] != 'boolean' && $aData["VAR_FIELD_TYPE"] != 'float' &&
|
||||
$aData["VAR_FIELD_TYPE"] != 'datetime' && $aData["VAR_FIELD_TYPE"] != 'date_of_birth') {
|
||||
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('$var_field_type')));
|
||||
}
|
||||
}
|
||||
if (isset($aData["VAR_FIELD_SIZE"])) {
|
||||
Validator::isInteger($aData["VAR_FIELD_SIZE"], '$var_field_size');
|
||||
|
||||
@@ -242,17 +242,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$this->wp->setStartTask($data["FLO_ELEMENT_DEST"]);
|
||||
}
|
||||
|
||||
// update case scheduler
|
||||
if ($event && $event->getEvnType() == "START" && $event->getEvnMarker() == "TIMER") {
|
||||
$caseSchedulerData = array('TAS_UID'=>$data["FLO_ELEMENT_DEST"]);
|
||||
$this->wp->updateCaseScheduler($data["FLO_ELEMENT_ORIGIN"], $caseSchedulerData);
|
||||
}
|
||||
|
||||
// update web entry
|
||||
if ($event && $event->getEvnType() == "START" && $event->getEvnMarker() == "MESSAGE") {
|
||||
$webEntryData = array('TAS_UID'=>$data["FLO_ELEMENT_DEST"]);
|
||||
$this->wp->updateWebEntry($data["FLO_ELEMENT_ORIGIN"], $webEntryData);
|
||||
}
|
||||
$this->updateEventStartObjects($data["FLO_ELEMENT_ORIGIN"], $data["FLO_ELEMENT_DEST"]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -275,10 +265,72 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
return $floUid;
|
||||
}
|
||||
|
||||
// public function updateFlow($floUid, $data, $flows)
|
||||
// {
|
||||
// parent::updateFlow($floUid, $data);
|
||||
// }
|
||||
public function updateFlow($floUid, $data, $flows)
|
||||
{
|
||||
$flowBefore = \BpmnFlowPeer::retrieveByPK($floUid);
|
||||
|
||||
parent::updateFlow($floUid, $data);
|
||||
|
||||
$flowCurrent = \BpmnFlowPeer::retrieveByPK($floUid);
|
||||
|
||||
//Verify case: Event1(start) -> Activity1 -----Update-to----> Event1(start) -> Activity2
|
||||
if ($flowBefore->getFloElementOriginType() == "bpmnEvent" && $flowBefore->getFloElementDestType() == "bpmnActivity" &&
|
||||
$flowCurrent->getFloElementOriginType() == "bpmnEvent" && $flowCurrent->getFloElementDestType() == "bpmnActivity" &&
|
||||
$flowBefore->getFloElementOrigin() == $flowCurrent->getFloElementOrigin() &&
|
||||
$flowBefore->getFloElementDest() != $flowCurrent->getFloElementDest()
|
||||
) {
|
||||
$event = \BpmnEventPeer::retrieveByPK($flowBefore->getFloElementOrigin());
|
||||
|
||||
if (!is_null($event) && $event->getEvnType() == "START") {
|
||||
//Remove as start task
|
||||
$this->wp->setStartTask($flowBefore->getFloElementDest(), false);
|
||||
|
||||
//Setting as start task
|
||||
$this->wp->setStartTask($flowCurrent->getFloElementDest());
|
||||
|
||||
$this->updateEventStartObjects($flowCurrent->getFloElementOrigin(), $flowCurrent->getFloElementDest());
|
||||
}
|
||||
}
|
||||
|
||||
//Verify case: Activity1 -> Event1(end) -----Update-to----> Activity2 -> Event1(end)
|
||||
if ($flowBefore->getFloElementOriginType() == "bpmnActivity" && $flowBefore->getFloElementDestType() == "bpmnEvent" &&
|
||||
$flowCurrent->getFloElementOriginType() == "bpmnActivity" && $flowCurrent->getFloElementDestType() == "bpmnEvent" &&
|
||||
$flowBefore->getFloElementOrigin() != $flowCurrent->getFloElementOrigin() &&
|
||||
$flowBefore->getFloElementDest() == $flowCurrent->getFloElementDest()
|
||||
) {
|
||||
$event = \BpmnEventPeer::retrieveByPK($flowBefore->getFloElementDest());
|
||||
|
||||
if (!is_null($event) && $event->getEvnType() == "END") {
|
||||
//Remove as end task
|
||||
$this->wp->setEndTask($flowBefore->getFloElementOrigin(), false);
|
||||
|
||||
//Setting as end task
|
||||
$this->wp->setEndTask($flowCurrent->getFloElementOrigin());
|
||||
}
|
||||
}
|
||||
|
||||
//Verify case: Activity1 -> Event1(end) -----Update-to----> Activity1 -> Activity2
|
||||
if ($flowBefore->getFloElementOriginType() == "bpmnActivity" && $flowBefore->getFloElementDestType() == "bpmnEvent" &&
|
||||
$flowCurrent->getFloElementOriginType() == "bpmnActivity" && $flowCurrent->getFloElementDestType() == "bpmnActivity" &&
|
||||
$flowBefore->getFloElementOrigin() == $flowCurrent->getFloElementOrigin()
|
||||
) {
|
||||
$event = \BpmnEventPeer::retrieveByPK($flowBefore->getFloElementDest());
|
||||
|
||||
if (!is_null($event) && $event->getEvnType() == "END") {
|
||||
//Remove as end task
|
||||
$this->wp->setEndTask($flowBefore->getFloElementOrigin(), false);
|
||||
}
|
||||
}
|
||||
|
||||
//Verify case: Activity1 -> Activity2 -----Update-to----> Activity1 -> Activity3
|
||||
if ($flowBefore->getFloElementOriginType() == "bpmnActivity" && $flowBefore->getFloElementDestType() == "bpmnActivity" &&
|
||||
$flowCurrent->getFloElementOriginType() == "bpmnActivity" && $flowCurrent->getFloElementDestType() == "bpmnActivity" &&
|
||||
$flowBefore->getFloElementOrigin() == $flowCurrent->getFloElementOrigin() &&
|
||||
$flowBefore->getFloElementDest() != $flowCurrent->getFloElementDest()
|
||||
) {
|
||||
$this->wp->removeRouteFromTo($flowBefore->getFloElementOrigin(), $flowBefore->getFloElementDest());
|
||||
}
|
||||
}
|
||||
|
||||
public function removeFlow($floUid)
|
||||
{
|
||||
@@ -299,18 +351,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
}
|
||||
|
||||
// update case scheduler
|
||||
if (! is_null($event) && $event->getEvnType() == "START" && $event->getEvnMarker() == "TIMER") {
|
||||
$caseSchedulerData = array( 'TAS_UID'=>'' );
|
||||
$this->wp->updateCaseScheduler($flow->getFloElementOrigin(), $caseSchedulerData);
|
||||
}
|
||||
|
||||
// update web entry
|
||||
if (! is_null($event) && $event->getEvnType() == "START" && $event->getEvnMarker() == "MESSAGE") {
|
||||
$webEntryData = array( 'TAS_UID'=>'' );
|
||||
$this->wp->updateWebEntry($flow->getFloElementOrigin(), $webEntryData);
|
||||
}
|
||||
|
||||
$this->updateEventStartObjects($flow->getFloElementOrigin(), "");
|
||||
} elseif ($flow->getFloElementOriginType() == "bpmnActivity" &&
|
||||
$flow->getFloElementDestType() == "bpmnEvent") {
|
||||
// verify case: activity -> event(end)
|
||||
@@ -380,6 +421,21 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
parent::removeEvent($data);
|
||||
}
|
||||
|
||||
public function updateEventStartObjects($eventUid, $taskUid)
|
||||
{
|
||||
$event = \BpmnEventPeer::retrieveByPK($eventUid);
|
||||
|
||||
//Update case scheduler
|
||||
if (!is_null($event) && $event->getEvnType() == "START" && $event->getEvnMarker() == "TIMER") {
|
||||
$this->wp->updateCaseScheduler($eventUid, array("TAS_UID" => $taskUid));
|
||||
}
|
||||
|
||||
//Update web entry
|
||||
if (!is_null($event) && $event->getEvnType() == "START" && $event->getEvnMarker() == "MESSAGE") {
|
||||
$this->wp->updateWebEntry($eventUid, array("TAS_UID" => $taskUid));
|
||||
}
|
||||
}
|
||||
|
||||
public function mapBpmnFlowsToWorkflowRoutes()
|
||||
{
|
||||
$activities = $this->getActivities();
|
||||
@@ -455,7 +511,6 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \LogicException(sprintf("Unsupported Gateway type: %s", $gateway['GAT_TYPE']));
|
||||
}
|
||||
@@ -501,7 +556,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
throw new \Exception("Project with name: {$projectData["prj_name"]}, already exists.");
|
||||
}
|
||||
$activities = $projectData['diagrams']['0']['activities'];
|
||||
foreach($activities as $value) {
|
||||
foreach ($activities as $value) {
|
||||
if (empty($value['act_name'])) {
|
||||
throw new \Exception("For activity: {$value['act_uid']} `act_name` is required but missing.");
|
||||
}
|
||||
@@ -510,7 +565,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
}
|
||||
$events = $projectData['diagrams']['0']['events'];
|
||||
foreach($events as $value) {
|
||||
foreach ($events as $value) {
|
||||
if (empty($value['evn_name'])) {
|
||||
throw new \Exception("For event: {$value['evn_uid']} `evn_name` is required but missing.");
|
||||
}
|
||||
@@ -885,6 +940,17 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
}
|
||||
|
||||
//Update UIDs
|
||||
foreach ($result as $value) {
|
||||
if ($flowData["FLO_ELEMENT_ORIGIN"] == $value["old_uid"]) {
|
||||
$flowData["FLO_ELEMENT_ORIGIN"] = $value["new_uid"];
|
||||
}
|
||||
|
||||
if ($flowData["FLO_ELEMENT_DEST"] == $value["old_uid"]) {
|
||||
$flowData["FLO_ELEMENT_DEST"] = $value["new_uid"];
|
||||
}
|
||||
}
|
||||
|
||||
$diagram["flows"][$i] = $flowData;
|
||||
$whiteList[] = $flowData["FLO_UID"];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user