CODE STYLE

workflow/engine/methods/processes/process_Delete.php
workflow/engine/methods/processes/processes_DeleteObjectPermission.php
workflow/engine/methods/processes/processes_doUpload.php
workflow/engine/methods/processes/processes_DownloadFile.php
workflow/engine/methods/processes/processes_DownloadFileXpdl.php
workflow/engine/methods/processes/processes_checkProperties.php
workflow/engine/methods/processes/processes_Export.php
workflow/engine/methods/processes/processes_GetFile.php
workflow/engine/methods/processes/processes_Import.php
workflow/engine/methods/processes/processes_Import_Ajax.php
This commit is contained in:
jennylee
2012-10-17 12:03:40 -04:00
parent 7deb103424
commit 27ac82a803
10 changed files with 624 additions and 658 deletions

View File

@@ -20,7 +20,6 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
global $RBAC; global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' ); $access = $RBAC->userCanAccess( 'PM_FACTORY' );
@@ -29,13 +28,13 @@ if( $access != 1 ){
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 2: case - 2:
default: default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
} }
@@ -59,4 +58,3 @@ try{
} }

View File

@@ -20,27 +20,25 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
global $RBAC; global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' ); $access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) { if ($access != 1) {
switch ($access) switch ($access) {
{
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
default: default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
} }
@@ -55,8 +53,7 @@ $result->msg = G::LoadTranslation('ID_REPORTTABLE_REMOVED');
G::LoadClass( 'processMap' ); G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap(); $oProcessMap = new ProcessMap();
$oProcessMap->getObjectsPermissionsCriteria( $sProcessUID ); $oProcessMap->getObjectsPermissionsCriteria( $sProcessUID );
} } catch (Exception $e) {
catch (Exception $e) {
$result->success = false; $result->success = false;
$result->msg = $e->getMessage(); $result->msg = $e->getMessage();
} }

View File

@@ -20,16 +20,15 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
//add more security, and catch any error or exception //add more security, and catch any error or exception
$sFileName = $_GET['p'] . '.pm'; $sFileName = $_GET['p'] . '.pm';
$file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm'; $file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm';
$filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName; $filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
if(file_exists($file)) if (file_exists( $file )) {
{
rename( $file, $filex ); rename( $file, $filex );
} }

View File

@@ -20,16 +20,15 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
//add more security, and catch any error or exception //add more security, and catch any error or exception
$sFileName = $_GET['p'] . '.xpdl'; $sFileName = $_GET['p'] . '.xpdl';
$file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm'; $file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm';
$filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName; $filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
if(file_exists($file)) if (file_exists( $file )) {
{
rename( $file, $filex ); rename( $file, $filex );
} }

View File

@@ -20,14 +20,14 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
G::LoadThirdParty( 'pear/json', 'class.json' ); G::LoadThirdParty( 'pear/json', 'class.json' );
try { try {
function myTruncate($chain, $limit, $break='.', $pad='...') {
function myTruncate ($chain, $limit, $break = '.', $pad = '...')
{
if (strlen( $chain ) <= $limit) { if (strlen( $chain ) <= $limit) {
return $chain; return $chain;
} }
@@ -40,7 +40,9 @@ try {
} }
return $chain; return $chain;
} }
function addTitlle($Category, $Id, $Lang) {
function addTitlle ($Category, $Id, $Lang)
{
require_once 'classes/model/Content.php'; require_once 'classes/model/Content.php';
$content = new Content(); $content = new Content();
$value = $content->load( $Category, '', $Id, $Lang ); $value = $content->load( $Category, '', $Id, $Lang );
@@ -62,8 +64,7 @@ try {
$pathLength = strlen( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP ); $pathLength = strlen( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP );
$length = strlen( $Fields['PRO_TITLE'] ) + $pathLength; $length = strlen( $Fields['PRO_TITLE'] ) + $pathLength;
foreach($Fields as $key => $value) foreach ($Fields as $key => $value) {
{
if ($key == 'PRO_TITLE') { if ($key == 'PRO_TITLE') {
$Fields[$key] = myTruncate( $value, 65, ' ', '...' ); $Fields[$key] = myTruncate( $value, 65, ' ', '...' );
} }
@@ -86,25 +87,18 @@ try {
$G_PUBLISH->AddContent( "xmlform", "xmlform", "processes/processes_Export", "", $Fields ); $G_PUBLISH->AddContent( "xmlform", "xmlform", "processes/processes_Export", "", $Fields );
G::RenderPage( "publish", "raw" ); G::RenderPage( "publish", "raw" );
} } else {
else {
$xmlFrm = new XmlForm(); $xmlFrm = new XmlForm();
$xmlFrm->home = PATH_XMLFORM . "processes" . PATH_SEP; $xmlFrm->home = PATH_XMLFORM . "processes" . PATH_SEP;
$xmlFrm->parseFile( "processes_Export.xml", SYS_LANG, true ); $xmlFrm->parseFile( "processes_Export.xml", SYS_LANG, true );
$Fields["xmlFrmFieldLabel"] = array( $Fields["xmlFrmFieldLabel"] = array ("title" => $xmlFrm->fields["TITLE"]->label,"proTitle" => $xmlFrm->fields["PRO_TITLE"]->label,"proDescription" => $xmlFrm->fields["PRO_DESCRIPTION"]->label,"size" => $xmlFrm->fields["SIZE"]->label,"fileName" => $xmlFrm->fields["FILENAME_LABEL"]->label
"title" => $xmlFrm->fields["TITLE"]->label,
"proTitle" => $xmlFrm->fields["PRO_TITLE"]->label,
"proDescription" => $xmlFrm->fields["PRO_DESCRIPTION"]->label,
"size" => $xmlFrm->fields["SIZE"]->label,
"fileName" => $xmlFrm->fields["FILENAME_LABEL"]->label
); );
echo G::json_encode( $Fields ); echo G::json_encode( $Fields );
} }
} } catch (Exception $e) {
catch ( Exception $e ){ $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage(); $aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );

View File

@@ -7,7 +7,7 @@ switch ($_GET['MAIN_DIRECTORY']) {
$sDirectory = PATH_DATA_PUBLIC . $_GET['PRO_UID'] . PATH_SEP . ($_GET['CURRENT_DIRECTORY'] != '' ? $_GET['CURRENT_DIRECTORY'] . PATH_SEP : ''); $sDirectory = PATH_DATA_PUBLIC . $_GET['PRO_UID'] . PATH_SEP . ($_GET['CURRENT_DIRECTORY'] != '' ? $_GET['CURRENT_DIRECTORY'] . PATH_SEP : '');
break; break;
default: default:
die; die();
break; break;
} }
//fixed: added a file extension when is a javascript file by krlos //fixed: added a file extension when is a javascript file by krlos

View File

@@ -20,26 +20,24 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
$access = $RBAC->userCanAccess( 'PM_FACTORY' ); $access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) { if ($access != 1) {
switch ($access) switch ($access) {
{
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
default: default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
} }
@@ -52,13 +50,12 @@ G::LoadClass('processes');
/* Render page */ /* Render page */
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES'; $G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_Import', '', NULL, 'processes_ImportFile' ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_Import', '', NULL, 'processes_ImportFile' );
G::RenderPage( "publish", "blank" ); G::RenderPage( "publish", "blank" );
} } catch (Exception $e) {
catch ( Exception $e ){ $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage(); $aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', "blank" ); G::RenderPage( 'publish', "blank" );

View File

@@ -20,14 +20,9 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
ini_set( 'max_execution_time', '0' ); ini_set( 'max_execution_time', '0' );
function reservedWordsSqlValidate ($data) function reservedWordsSqlValidate ($data)
{ {
$arrayAux = array (); $arrayAux = array ();
@@ -40,7 +35,8 @@ function reservedWordsSqlValidate($data)
} }
if (count( $arrayAux ) > 0) { if (count( $arrayAux ) > 0) {
throw (new Exception(G::LoadTranslation("ID_PMTABLE_INVALID_NAME", array(implode(", ", $arrayAux))))); throw (new Exception( G::LoadTranslation( "ID_PMTABLE_INVALID_NAME", array (implode( ", ", $arrayAux )
) ) ));
} }
$arrayAux = array (); $arrayAux = array ();
@@ -52,14 +48,11 @@ function reservedWordsSqlValidate($data)
} }
if (count( $arrayAux ) > 0) { if (count( $arrayAux ) > 0) {
throw (new Exception(G::LoadTranslation("ID_PMTABLE_INVALID_FIELD_NAME", array(implode(", ", $arrayAux))))); throw (new Exception( G::LoadTranslation( "ID_PMTABLE_INVALID_FIELD_NAME", array (implode( ", ", $arrayAux )
) ) ));
} }
} }
$action = isset( $_REQUEST['ajaxAction'] ) ? $_REQUEST['ajaxAction'] : null; $action = isset( $_REQUEST['ajaxAction'] ) ? $_REQUEST['ajaxAction'] : null;
$result = new stdClass(); $result = new stdClass();
@@ -76,8 +69,10 @@ function reservedWordsSqlValidate($data)
$isCorrectTypeFile = 1; $isCorrectTypeFile = 1;
if (isset( $_FILES['form']['type']['PROCESS_FILENAME'] )) { if (isset( $_FILES['form']['type']['PROCESS_FILENAME'] )) {
$allowedExtensions = array($processFileType); $allowedExtensions = array ($processFileType
$allowedExtensions = array( 'xpdl', 'bpmn', 'pm'); );
$allowedExtensions = array ('xpdl','bpmn','pm'
);
if (! in_array( end( explode( ".", $_FILES['form']['name']['PROCESS_FILENAME'] ) ), $allowedExtensions )) { if (! in_array( end( explode( ".", $_FILES['form']['name']['PROCESS_FILENAME'] ) ), $allowedExtensions )) {
throw new Exception( G::LoadTranslation( "ID_FILE_UPLOAD_INCORRECT_EXTENSION" ) ); throw new Exception( G::LoadTranslation( "ID_FILE_UPLOAD_INCORRECT_EXTENSION" ) );
} }
@@ -109,8 +104,7 @@ function reservedWordsSqlValidate($data)
if (! is_null( $optionGroupExistInDatabase )) { if (! is_null( $optionGroupExistInDatabase )) {
$filename = $_REQUEST["PRO_FILENAME"]; $filename = $_REQUEST["PRO_FILENAME"];
$path = PATH_DOCUMENT . 'input' . PATH_SEP; $path = PATH_DOCUMENT . 'input' . PATH_SEP;
} } else {
else {
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) { if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
$filename = $_FILES['form']['name']['PROCESS_FILENAME']; $filename = $_FILES['form']['name']['PROCESS_FILENAME'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP; $path = PATH_DOCUMENT . 'input' . PATH_SEP;
@@ -125,14 +119,13 @@ function reservedWordsSqlValidate($data)
G::LoadClass( 'bpmnExport' ); G::LoadClass( 'bpmnExport' );
$bpmn = new bpmnExport(); $bpmn = new bpmnExport();
$bpmn->importBpmn( $path . $filename ); $bpmn->importBpmn( $path . $filename );
die; die();
} }
//if file is a .pm or .xpdl file continues normally the importing //if file is a .pm or .xpdl file continues normally the importing
if ($processFileType == "pm") { if ($processFileType == "pm") {
$oData = $oProcess->getProcessData( $path . $filename ); $oData = $oProcess->getProcessData( $path . $filename );
} } else {
else {
$oData = $oProcess->getProcessDataXpdl( $path . $filename ); $oData = $oProcess->getProcessDataXpdl( $path . $filename );
} }
@@ -148,8 +141,7 @@ function reservedWordsSqlValidate($data)
if ($oProcess->processExists( $sProUid )) { if ($oProcess->processExists( $sProUid )) {
$result->ExistProcessInDatabase = 1; $result->ExistProcessInDatabase = 1;
} } else {
else {
$result->ExistProcessInDatabase = 0; $result->ExistProcessInDatabase = 0;
} }
@@ -159,28 +151,27 @@ function reservedWordsSqlValidate($data)
if (! is_null( $optionGroupExistInDatabase )) { if (! is_null( $optionGroupExistInDatabase )) {
if ($optionGroupExistInDatabase == 1) { if ($optionGroupExistInDatabase == 1) {
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs ); $oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
} } else if ($optionGroupExistInDatabase == 2) {
else if ($optionGroupExistInDatabase == 2) {
$oBaseGroup = $oData->groupwfs; $oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs ); $oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
$oData->groupwfs = $oNewGroup; $oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers ); $oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
} }
$result->ExistGroupsInDatabase = 0; $result->ExistGroupsInDatabase = 0;
} } else {
else {
if (! ($oProcess->checkExistingGroups( $oData->groupwfs ) > 0)) { if (! ($oProcess->checkExistingGroups( $oData->groupwfs ) > 0)) {
$result->ExistGroupsInDatabase = 0; $result->ExistGroupsInDatabase = 0;
} }
} }
//!respect of the groups //!respect of the groups
if ($result->ExistProcessInDatabase == 0 && $result->ExistGroupsInDatabase == 0) { if ($result->ExistProcessInDatabase == 0 && $result->ExistGroupsInDatabase == 0) {
if ($processFileType == "pm") { if ($processFileType == "pm") {
$oProcess->createProcessFromData( $oData, $path . $filename ); $oProcess->createProcessFromData( $oData, $path . $filename );
} } else {
else { if (! isset( $oData->tasks ))
if ( !isset( $oData->tasks) ) $oData->tasks = array(); $oData->tasks = array ();
$tasks = $oData->tasks; $tasks = $oData->tasks;
$oProcess->createProcessFromDataXpdl( $oData, $tasks ); $oProcess->createProcessFromDataXpdl( $oData, $tasks );
} }
@@ -189,8 +180,7 @@ function reservedWordsSqlValidate($data)
//!data ouput //!data ouput
$result->sNewProUid = $sProUid; $result->sNewProUid = $sProUid;
$result->proFileName = $Fields['PRO_FILENAME']; $result->proFileName = $Fields['PRO_FILENAME'];
} } catch (Exception $e) {
catch (Exception $e ) {
$result->response = $e->getMessage(); $result->response = $e->getMessage();
$result->catchMessage = $e->getMessage(); $result->catchMessage = $e->getMessage();
$result->success = true; $result->success = true;
@@ -207,6 +197,7 @@ function reservedWordsSqlValidate($data)
//0 -Dont exist process //0 -Dont exist process
//1 -exist process //1 -exist process
$optionGroupExistInDatabase = isset( $_REQUEST["optionGroupExistInDatabase"] ) ? $_REQUEST["optionGroupExistInDatabase"] : null; $optionGroupExistInDatabase = isset( $_REQUEST["optionGroupExistInDatabase"] ) ? $_REQUEST["optionGroupExistInDatabase"] : null;
$sNewProUid = ""; $sNewProUid = "";
@@ -219,8 +210,7 @@ function reservedWordsSqlValidate($data)
if ($processFileType == "pm") { if ($processFileType == "pm") {
G::LoadClass( 'processes' ); G::LoadClass( 'processes' );
$oProcess = new Processes(); $oProcess = new Processes();
} } else {
else {
G::LoadClass( 'xpdl' ); G::LoadClass( 'xpdl' );
$oProcess = new Xpdl(); $oProcess = new Xpdl();
} }
@@ -229,8 +219,7 @@ function reservedWordsSqlValidate($data)
if ($processFileType == "pm") { if ($processFileType == "pm") {
$oData = $oProcess->getProcessData( $path . $filename ); $oData = $oProcess->getProcessData( $path . $filename );
} } else {
else {
$oData = $oProcess->getProcessDataXpdl( $path . $filename ); $oData = $oProcess->getProcessDataXpdl( $path . $filename );
} }
@@ -245,16 +234,14 @@ function reservedWordsSqlValidate($data)
if (! is_null( $optionGroupExistInDatabase )) { if (! is_null( $optionGroupExistInDatabase )) {
if ($optionGroupExistInDatabase == 1) { if ($optionGroupExistInDatabase == 1) {
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs ); $oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
} } else if ($optionGroupExistInDatabase == 2) {
else if ($optionGroupExistInDatabase == 2) {
$oBaseGroup = $oData->groupwfs; $oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs ); $oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
$oData->groupwfs = $oNewGroup; $oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers ); $oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
} }
$result->ExistGroupsInDatabase = 0; $result->ExistGroupsInDatabase = 0;
} } else {
else {
if (! ($oProcess->checkExistingGroups( $oData->groupwfs ) > 0)) { if (! ($oProcess->checkExistingGroups( $oData->groupwfs ) > 0)) {
$result->ExistGroupsInDatabase = 0; $result->ExistGroupsInDatabase = 0;
} }
@@ -287,8 +274,7 @@ function reservedWordsSqlValidate($data)
if ($processFileType == "pm") { if ($processFileType == "pm") {
$oProcess->createProcessFromData( $oData, $path . $filename ); $oProcess->createProcessFromData( $oData, $path . $filename );
} } else {
else {
if (! isset( $oData->tasks )) { if (! isset( $oData->tasks )) {
$oData->tasks = array (); $oData->tasks = array ();
} }
@@ -307,8 +293,7 @@ function reservedWordsSqlValidate($data)
if ($processFileType == "pm") { if ($processFileType == "pm") {
$oProcess->createProcessFromData( $oData, $path . $filename ); $oProcess->createProcessFromData( $oData, $path . $filename );
} } else {
else {
if (! isset( $oData->tasks )) { if (! isset( $oData->tasks )) {
$oData->tasks = array (); $oData->tasks = array ();
} }
@@ -326,8 +311,7 @@ function reservedWordsSqlValidate($data)
$result->ExistGroupsInDatabase = $result->ExistGroupsInDatabase; $result->ExistGroupsInDatabase = $result->ExistGroupsInDatabase;
$result->groupBeforeAccion = $action; $result->groupBeforeAccion = $action;
//!data ouput //!data ouput
} } catch (Exception $e) {
catch (Exception $e ) {
$result->response = $e->getMessage(); $result->response = $e->getMessage();
$result->success = true; $result->success = true;
} }

View File

@@ -20,29 +20,27 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
global $RBAC; global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' ); $access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) { if ($access != 1) {
switch ($access) switch ($access) {
{
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
default: default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
} }

View File

@@ -11,7 +11,7 @@ if(isset($_SESSION['processes_upload'])){
$sDirectory = PATH_DATA_PUBLIC . $form['PRO_UID'] . PATH_SEP . ($form['CURRENT_DIRECTORY'] != '' ? $form['CURRENT_DIRECTORY'] . PATH_SEP : ''); $sDirectory = PATH_DATA_PUBLIC . $form['PRO_UID'] . PATH_SEP . ($form['CURRENT_DIRECTORY'] != '' ? $form['CURRENT_DIRECTORY'] . PATH_SEP : '');
break; break;
default: default:
die; die();
break; break;
} }
} }