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:
@@ -20,7 +20,6 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
global $RBAC;
|
||||
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
|
||||
@@ -29,13 +28,13 @@ if( $access != 1 ){
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
case - 2:
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -59,4 +58,3 @@ try{
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,27 +20,25 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
global $RBAC;
|
||||
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
|
||||
if ($access != 1) {
|
||||
switch ($access)
|
||||
{
|
||||
switch ($access) {
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -55,8 +53,7 @@ $result->msg = G::LoadTranslation('ID_REPORTTABLE_REMOVED');
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->getObjectsPermissionsCriteria( $sProcessUID );
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
@@ -20,16 +20,15 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
//add more security, and catch any error or exception
|
||||
|
||||
|
||||
$sFileName = $_GET['p'] . '.pm';
|
||||
$file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm';
|
||||
$filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
|
||||
|
||||
if(file_exists($file))
|
||||
{
|
||||
if (file_exists( $file )) {
|
||||
rename( $file, $filex );
|
||||
}
|
||||
|
||||
|
||||
@@ -20,16 +20,15 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
//add more security, and catch any error or exception
|
||||
|
||||
|
||||
$sFileName = $_GET['p'] . '.xpdl';
|
||||
$file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm';
|
||||
$filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
|
||||
|
||||
if(file_exists($file))
|
||||
{
|
||||
if (file_exists( $file )) {
|
||||
rename( $file, $filex );
|
||||
}
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
G::LoadThirdParty( 'pear/json', 'class.json' );
|
||||
|
||||
try {
|
||||
function myTruncate($chain, $limit, $break='.', $pad='...') {
|
||||
|
||||
function myTruncate ($chain, $limit, $break = '.', $pad = '...')
|
||||
{
|
||||
if (strlen( $chain ) <= $limit) {
|
||||
return $chain;
|
||||
}
|
||||
@@ -40,7 +40,9 @@ try {
|
||||
}
|
||||
return $chain;
|
||||
}
|
||||
function addTitlle($Category, $Id, $Lang) {
|
||||
|
||||
function addTitlle ($Category, $Id, $Lang)
|
||||
{
|
||||
require_once 'classes/model/Content.php';
|
||||
$content = new Content();
|
||||
$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 );
|
||||
$length = strlen( $Fields['PRO_TITLE'] ) + $pathLength;
|
||||
|
||||
foreach($Fields as $key => $value)
|
||||
{
|
||||
foreach ($Fields as $key => $value) {
|
||||
if ($key == 'PRO_TITLE') {
|
||||
$Fields[$key] = myTruncate( $value, 65, ' ', '...' );
|
||||
}
|
||||
@@ -86,25 +87,18 @@ try {
|
||||
$G_PUBLISH->AddContent( "xmlform", "xmlform", "processes/processes_Export", "", $Fields );
|
||||
|
||||
G::RenderPage( "publish", "raw" );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$xmlFrm = new XmlForm();
|
||||
$xmlFrm->home = PATH_XMLFORM . "processes" . PATH_SEP;
|
||||
$xmlFrm->parseFile( "processes_Export.xml", SYS_LANG, true );
|
||||
|
||||
$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
|
||||
$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
|
||||
);
|
||||
|
||||
echo G::json_encode( $Fields );
|
||||
}
|
||||
}
|
||||
catch ( Exception $e ){
|
||||
$G_PUBLISH = new Publisher;
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
|
||||
@@ -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 : '');
|
||||
break;
|
||||
default:
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
}
|
||||
//fixed: added a file extension when is a javascript file by krlos
|
||||
|
||||
@@ -20,26 +20,24 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
|
||||
if ($access != 1) {
|
||||
switch ($access)
|
||||
{
|
||||
switch ($access) {
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -52,13 +50,12 @@ G::LoadClass('processes');
|
||||
/* Render page */
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$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::RenderPage( "publish", "blank" );
|
||||
|
||||
}
|
||||
catch ( Exception $e ){
|
||||
$G_PUBLISH = new Publisher;
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', "blank" );
|
||||
|
||||
@@ -20,14 +20,9 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
ini_set( 'max_execution_time', '0' );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function reservedWordsSqlValidate ($data)
|
||||
{
|
||||
$arrayAux = array ();
|
||||
@@ -40,7 +35,8 @@ function reservedWordsSqlValidate($data)
|
||||
}
|
||||
|
||||
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 ();
|
||||
@@ -52,14 +48,11 @@ function reservedWordsSqlValidate($data)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
$result = new stdClass();
|
||||
@@ -76,8 +69,10 @@ function reservedWordsSqlValidate($data)
|
||||
$isCorrectTypeFile = 1;
|
||||
|
||||
if (isset( $_FILES['form']['type']['PROCESS_FILENAME'] )) {
|
||||
$allowedExtensions = array($processFileType);
|
||||
$allowedExtensions = array( 'xpdl', 'bpmn', 'pm');
|
||||
$allowedExtensions = array ($processFileType
|
||||
);
|
||||
$allowedExtensions = array ('xpdl','bpmn','pm'
|
||||
);
|
||||
if (! in_array( end( explode( ".", $_FILES['form']['name']['PROCESS_FILENAME'] ) ), $allowedExtensions )) {
|
||||
throw new Exception( G::LoadTranslation( "ID_FILE_UPLOAD_INCORRECT_EXTENSION" ) );
|
||||
}
|
||||
@@ -109,8 +104,7 @@ function reservedWordsSqlValidate($data)
|
||||
if (! is_null( $optionGroupExistInDatabase )) {
|
||||
$filename = $_REQUEST["PRO_FILENAME"];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
|
||||
$filename = $_FILES['form']['name']['PROCESS_FILENAME'];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||
@@ -125,14 +119,13 @@ function reservedWordsSqlValidate($data)
|
||||
G::LoadClass( 'bpmnExport' );
|
||||
$bpmn = new bpmnExport();
|
||||
$bpmn->importBpmn( $path . $filename );
|
||||
die;
|
||||
die();
|
||||
}
|
||||
|
||||
//if file is a .pm or .xpdl file continues normally the importing
|
||||
if ($processFileType == "pm") {
|
||||
$oData = $oProcess->getProcessData( $path . $filename );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
|
||||
}
|
||||
|
||||
@@ -148,8 +141,7 @@ function reservedWordsSqlValidate($data)
|
||||
|
||||
if ($oProcess->processExists( $sProUid )) {
|
||||
$result->ExistProcessInDatabase = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$result->ExistProcessInDatabase = 0;
|
||||
}
|
||||
|
||||
@@ -159,28 +151,27 @@ function reservedWordsSqlValidate($data)
|
||||
if (! is_null( $optionGroupExistInDatabase )) {
|
||||
if ($optionGroupExistInDatabase == 1) {
|
||||
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
|
||||
}
|
||||
else if ($optionGroupExistInDatabase == 2) {
|
||||
} else if ($optionGroupExistInDatabase == 2) {
|
||||
$oBaseGroup = $oData->groupwfs;
|
||||
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
|
||||
$oData->groupwfs = $oNewGroup;
|
||||
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
|
||||
}
|
||||
$result->ExistGroupsInDatabase = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (! ($oProcess->checkExistingGroups( $oData->groupwfs ) > 0)) {
|
||||
$result->ExistGroupsInDatabase = 0;
|
||||
}
|
||||
}
|
||||
//!respect of the groups
|
||||
|
||||
|
||||
if ($result->ExistProcessInDatabase == 0 && $result->ExistGroupsInDatabase == 0) {
|
||||
if ($processFileType == "pm") {
|
||||
$oProcess->createProcessFromData( $oData, $path . $filename );
|
||||
}
|
||||
else {
|
||||
if ( !isset( $oData->tasks) ) $oData->tasks = array();
|
||||
} else {
|
||||
if (! isset( $oData->tasks ))
|
||||
$oData->tasks = array ();
|
||||
$tasks = $oData->tasks;
|
||||
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
|
||||
}
|
||||
@@ -189,8 +180,7 @@ function reservedWordsSqlValidate($data)
|
||||
//!data ouput
|
||||
$result->sNewProUid = $sProUid;
|
||||
$result->proFileName = $Fields['PRO_FILENAME'];
|
||||
}
|
||||
catch (Exception $e ) {
|
||||
} catch (Exception $e) {
|
||||
$result->response = $e->getMessage();
|
||||
$result->catchMessage = $e->getMessage();
|
||||
$result->success = true;
|
||||
@@ -207,6 +197,7 @@ function reservedWordsSqlValidate($data)
|
||||
//0 -Dont exist process
|
||||
//1 -exist process
|
||||
|
||||
|
||||
$optionGroupExistInDatabase = isset( $_REQUEST["optionGroupExistInDatabase"] ) ? $_REQUEST["optionGroupExistInDatabase"] : null;
|
||||
$sNewProUid = "";
|
||||
|
||||
@@ -219,8 +210,7 @@ function reservedWordsSqlValidate($data)
|
||||
if ($processFileType == "pm") {
|
||||
G::LoadClass( 'processes' );
|
||||
$oProcess = new Processes();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
G::LoadClass( 'xpdl' );
|
||||
$oProcess = new Xpdl();
|
||||
}
|
||||
@@ -229,8 +219,7 @@ function reservedWordsSqlValidate($data)
|
||||
|
||||
if ($processFileType == "pm") {
|
||||
$oData = $oProcess->getProcessData( $path . $filename );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
|
||||
}
|
||||
|
||||
@@ -245,16 +234,14 @@ function reservedWordsSqlValidate($data)
|
||||
if (! is_null( $optionGroupExistInDatabase )) {
|
||||
if ($optionGroupExistInDatabase == 1) {
|
||||
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
|
||||
}
|
||||
else if ($optionGroupExistInDatabase == 2) {
|
||||
} else if ($optionGroupExistInDatabase == 2) {
|
||||
$oBaseGroup = $oData->groupwfs;
|
||||
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
|
||||
$oData->groupwfs = $oNewGroup;
|
||||
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
|
||||
}
|
||||
$result->ExistGroupsInDatabase = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (! ($oProcess->checkExistingGroups( $oData->groupwfs ) > 0)) {
|
||||
$result->ExistGroupsInDatabase = 0;
|
||||
}
|
||||
@@ -287,8 +274,7 @@ function reservedWordsSqlValidate($data)
|
||||
|
||||
if ($processFileType == "pm") {
|
||||
$oProcess->createProcessFromData( $oData, $path . $filename );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (! isset( $oData->tasks )) {
|
||||
$oData->tasks = array ();
|
||||
}
|
||||
@@ -307,8 +293,7 @@ function reservedWordsSqlValidate($data)
|
||||
|
||||
if ($processFileType == "pm") {
|
||||
$oProcess->createProcessFromData( $oData, $path . $filename );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (! isset( $oData->tasks )) {
|
||||
$oData->tasks = array ();
|
||||
}
|
||||
@@ -326,8 +311,7 @@ function reservedWordsSqlValidate($data)
|
||||
$result->ExistGroupsInDatabase = $result->ExistGroupsInDatabase;
|
||||
$result->groupBeforeAccion = $action;
|
||||
//!data ouput
|
||||
}
|
||||
catch (Exception $e ) {
|
||||
} catch (Exception $e) {
|
||||
$result->response = $e->getMessage();
|
||||
$result->success = true;
|
||||
}
|
||||
|
||||
@@ -20,29 +20,27 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
|
||||
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
|
||||
if ($access != 1) {
|
||||
switch ($access)
|
||||
{
|
||||
switch ($access) {
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 : '');
|
||||
break;
|
||||
default:
|
||||
die;
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user