Merge remote-tracking branch 'origin/feature/HOR-3560' into bugfix/HOR-3465
This commit is contained in:
@@ -113,11 +113,11 @@ class RBAC
|
|||||||
'downloadFileHash' => array('PM_FACTORY')
|
'downloadFileHash' => array('PM_FACTORY')
|
||||||
),
|
),
|
||||||
'processProxy.php' => array(
|
'processProxy.php' => array(
|
||||||
'categoriesList' => array(),
|
'categoriesList' => array('PM_SETUP_PROCESS_CATEGORIES'),
|
||||||
'getCategoriesList' => array(),
|
'getCategoriesList' => array('PM_FACTORY'),
|
||||||
'saveProcess' => array('PM_FACTORY'),
|
'saveProcess' => array('PM_FACTORY'),
|
||||||
'changeStatus' => array(),
|
'changeStatus' => array('PM_FACTORY'),
|
||||||
'changeDebugMode' => array(),
|
'changeDebugMode' => array('PM_FACTORY'),
|
||||||
'getUsers' => array(),
|
'getUsers' => array(),
|
||||||
'getGroups' => array(),
|
'getGroups' => array(),
|
||||||
'assignActorsTask' => array(),
|
'assignActorsTask' => array(),
|
||||||
@@ -128,7 +128,7 @@ class RBAC
|
|||||||
'saveProperties' => array(),
|
'saveProperties' => array(),
|
||||||
'getCaledarList' => array(),
|
'getCaledarList' => array(),
|
||||||
'getPMVariables' => array(),
|
'getPMVariables' => array(),
|
||||||
'generateBpmn' => array()
|
'generateBpmn' => array('PM_FACTORY')
|
||||||
),
|
),
|
||||||
'home.php' => array(
|
'home.php' => array(
|
||||||
'login' => array('PM_LOGIN'),
|
'login' => array('PM_LOGIN'),
|
||||||
@@ -148,6 +148,9 @@ class RBAC
|
|||||||
'getProcesses' => array('PM_ALLCASES'),
|
'getProcesses' => array('PM_ALLCASES'),
|
||||||
'getUsers' => array('PM_ALLCASES')
|
'getUsers' => array('PM_ALLCASES')
|
||||||
),
|
),
|
||||||
|
'newSite.php' => array(
|
||||||
|
'newSite.php' => array('PM_SETUP_ADVANCE')
|
||||||
|
),
|
||||||
'emailsAjax.php' => array(
|
'emailsAjax.php' => array(
|
||||||
'MessageList' => array('PM_SETUP', 'PM_SETUP_LOGS'),
|
'MessageList' => array('PM_SETUP', 'PM_SETUP_LOGS'),
|
||||||
'updateStatusMessage' => array(),
|
'updateStatusMessage' => array(),
|
||||||
|
|||||||
@@ -1386,35 +1386,44 @@ class Cases
|
|||||||
*
|
*
|
||||||
* @name searchOpenPreviousTasks,
|
* @name searchOpenPreviousTasks,
|
||||||
* @param string $taskUid
|
* @param string $taskUid
|
||||||
* @param string $sAppUid
|
* @param string $appUid
|
||||||
* @param array $aPreviousTasks optional array that serves to trace the task routes and avoid infinite loops.
|
* @param array $previousTasks, optional array that serves to trace the task routes and avoid infinite loops.
|
||||||
* @return $aThreads
|
* @return array, information about the threads in the case
|
||||||
*/
|
*/
|
||||||
public function searchOpenPreviousTasks($taskUid, $sAppUid, $aPreviousTasks = array())
|
public function searchOpenPreviousTasks($taskUid, $appUid, $previousTasks = array())
|
||||||
{
|
{
|
||||||
//in this array we are storing all open delegation rows.
|
//In this array we are storing all open delegation rows.
|
||||||
$aTaskReviewed = array();
|
$threads = array();
|
||||||
|
|
||||||
//check if this task ( $taskUid ) has open delegations
|
//Check if this $taskUid has open delegations, this is a single review
|
||||||
$delegations = $this->getReviewedTasks($taskUid, $sAppUid);
|
$threads = $this->getReviewedTasks($taskUid, $appUid);
|
||||||
|
|
||||||
if ($delegations !== false) {
|
if ($threads !== false) {
|
||||||
if (count($delegations['open']) > 0) {
|
if (count($threads['open']) > 0) {
|
||||||
//there is an open delegation, so we need to return the delegation row
|
//There is an open delegation, so we need to return the delegation row
|
||||||
return $delegations['open'];
|
return $threads['open'];
|
||||||
} else {
|
} else {
|
||||||
if(count($delegations['paused']) > 0){
|
if (count($threads['paused']) > 0) {
|
||||||
//there is an paused delegation, so we need to return the delegation row
|
//there is an paused delegation, so we need to return the delegation row
|
||||||
return $delegations['paused'];
|
return $threads['paused'];
|
||||||
}else{
|
|
||||||
return array(); //returning empty array
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if not we check previous tasks
|
//Search the open delegations in the previous task, this is a recursive review
|
||||||
// until here this task has not appdelegations records.
|
$threads = $this->getReviewedTasksRecursive($taskUid, $appUid, $previousTasks);
|
||||||
// get all previous task from $taskUid, and return open delegations rows, if there are
|
return $threads;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function get the last open task
|
||||||
|
* Usually is used when we have a SEC-JOIN and need to review if we need to route the case
|
||||||
|
* @param string $taskUid
|
||||||
|
* @param string $appUid
|
||||||
|
* @param array $previousTasks
|
||||||
|
* @return array $taskReviewed
|
||||||
|
*/
|
||||||
|
public function getReviewedTasksRecursive($taskUid, $appUid, $previousTasks) {
|
||||||
|
$taskReviewed = array();
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
$oCriteria->add(RoutePeer::ROU_NEXT_TASK, $taskUid);
|
$oCriteria->add(RoutePeer::ROU_NEXT_TASK, $taskUid);
|
||||||
$oDataset = RoutePeer::doSelectRs($oCriteria);
|
$oDataset = RoutePeer::doSelectRs($oCriteria);
|
||||||
@@ -1422,33 +1431,27 @@ class Cases
|
|||||||
|
|
||||||
while ($oDataset->next()) {
|
while ($oDataset->next()) {
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
|
$delegations = $this->getReviewedTasks($aRow['TAS_UID'], $appUid);
|
||||||
$delegations = $this->getReviewedTasks($aRow['TAS_UID'], $sAppUid);
|
|
||||||
|
|
||||||
if ($delegations !== false) {
|
if ($delegations !== false) {
|
||||||
if (count($delegations['open']) > 0) {
|
if (count($delegations['open']) > 0) {
|
||||||
//there is an open delegation, so we need to return the delegation row
|
//there is an open delegation, so we need to return the delegation row
|
||||||
$aTaskReviewed = array_merge($aTaskReviewed, $delegations['open']);
|
$taskReviewed = array_merge($taskReviewed, $delegations['open']);
|
||||||
} else {
|
} elseif ($aRow['ROU_TYPE'] == 'PARALLEL-BY-EVALUATION') {
|
||||||
if ($aRow['ROU_TYPE'] == 'PARALLEL-BY-EVALUATION') {
|
$taskReviewed = array();
|
||||||
$aTaskReviewed = array();
|
|
||||||
} else {
|
|
||||||
//$aTaskReviewed = array_merge($aTaskReviewed, $delegations['closed']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} elseif (!in_array($aRow['TAS_UID'], $previousTasks)) {
|
||||||
if (!in_array($aRow['TAS_UID'], $aPreviousTasks)) {
|
//Storing the current task uid of the task currently checked
|
||||||
// storing the current task uid of the task currently checked
|
$previousTasks[] = $aRow['TAS_UID'];
|
||||||
$aPreviousTasks[] = $aRow['TAS_UID'];
|
//Passing the array of previous tasks in order to avoid an infinite loop that prevents
|
||||||
// passing the array of previous tasks in oprder to avoid an infinite loop that prevents
|
$openPreviousTask = $this->searchOpenPreviousTasks($aRow['TAS_UID'], $appUid, $previousTasks);
|
||||||
$openPreviousTask = $this->searchOpenPreviousTasks($aRow['TAS_UID'], $sAppUid, $aPreviousTasks);
|
if (count($previousTasks) > 0) {
|
||||||
if (count($aPreviousTasks) > 0) {
|
$taskReviewed = array_merge($taskReviewed, $openPreviousTask);
|
||||||
$aTaskReviewed = array_merge($aTaskReviewed, $openPreviousTask);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $aTaskReviewed;
|
|
||||||
|
return $taskReviewed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5788,8 +5791,8 @@ class Cases
|
|||||||
* @param string $tasUid
|
* @param string $tasUid
|
||||||
* @param string $usrUid
|
* @param string $usrUid
|
||||||
* @param string $action some action [VIEW, BLOCK, RESEND]
|
* @param string $action some action [VIEW, BLOCK, RESEND]
|
||||||
* @param string $delIndex
|
* @param integer $delIndex
|
||||||
* @return Array within all user permitions all objects' types
|
* @return array within all user permissions all objects' types
|
||||||
*/
|
*/
|
||||||
public function getAllObjectsFrom($proUid, $appUid, $tasUid = '', $usrUid = '', $action = '', $delIndex = 0)
|
public function getAllObjectsFrom($proUid, $appUid, $tasUid = '', $usrUid = '', $action = '', $delIndex = 0)
|
||||||
{
|
{
|
||||||
@@ -5808,6 +5811,7 @@ class Cases
|
|||||||
$result = array(
|
$result = array(
|
||||||
"DYNAFORM" => array(),
|
"DYNAFORM" => array(),
|
||||||
"INPUT" => array(),
|
"INPUT" => array(),
|
||||||
|
"ATTACHMENT" => array(),
|
||||||
"OUTPUT" => array(),
|
"OUTPUT" => array(),
|
||||||
"CASES_NOTES" => 0,
|
"CASES_NOTES" => 0,
|
||||||
"MSGS_HISTORY" => array()
|
"MSGS_HISTORY" => array()
|
||||||
@@ -5878,6 +5882,15 @@ class Cases
|
|||||||
$opObjUid,
|
$opObjUid,
|
||||||
$aCase['APP_STATUS']
|
$aCase['APP_STATUS']
|
||||||
);
|
);
|
||||||
|
//For Attachment
|
||||||
|
$result['ATTACHMENT'] = $oObjectPermission->objectPermissionByOutputInput(
|
||||||
|
$appUid,
|
||||||
|
$proUid,
|
||||||
|
$opTaskSource,
|
||||||
|
'ATTACHED',
|
||||||
|
$opObjUid,
|
||||||
|
$aCase['APP_STATUS']
|
||||||
|
);
|
||||||
|
|
||||||
$result['CASES_NOTES'] = 1;
|
$result['CASES_NOTES'] = 1;
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
@@ -5914,6 +5927,16 @@ class Cases
|
|||||||
$aCase['APP_STATUS']
|
$aCase['APP_STATUS']
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case 'ATTACHMENT':
|
||||||
|
$result['ATTACHMENT'] = $oObjectPermission->objectPermissionByOutputInput(
|
||||||
|
$appUid,
|
||||||
|
$proUid,
|
||||||
|
$opTaskSource,
|
||||||
|
'ATTACHED',
|
||||||
|
$opObjUid,
|
||||||
|
$aCase['APP_STATUS']
|
||||||
|
);
|
||||||
|
break;
|
||||||
case 'OUTPUT':
|
case 'OUTPUT':
|
||||||
$result['OUTPUT'] = $oObjectPermission->objectPermissionByOutputInput(
|
$result['OUTPUT'] = $oObjectPermission->objectPermissionByOutputInput(
|
||||||
$appUid,
|
$appUid,
|
||||||
@@ -5948,9 +5971,10 @@ class Cases
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Array(
|
return array(
|
||||||
"DYNAFORMS" => $result['DYNAFORM'],
|
"DYNAFORMS" => $result['DYNAFORM'],
|
||||||
"INPUT_DOCUMENTS" => $result['INPUT'],
|
"INPUT_DOCUMENTS" => $result['INPUT'],
|
||||||
|
"ATTACHMENTS" => $result['ATTACHMENT'],
|
||||||
"OUTPUT_DOCUMENTS" => $result['OUTPUT'],
|
"OUTPUT_DOCUMENTS" => $result['OUTPUT'],
|
||||||
"CASES_NOTES" => $result['CASES_NOTES'],
|
"CASES_NOTES" => $result['CASES_NOTES'],
|
||||||
"MSGS_HISTORY" => $result['MSGS_HISTORY']
|
"MSGS_HISTORY" => $result['MSGS_HISTORY']
|
||||||
|
|||||||
@@ -1,40 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* class.derivation.php
|
|
||||||
*
|
|
||||||
* @package workflow.engine.ProcessMaker
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
require_once ("classes/model/Task.php");
|
|
||||||
require_once ("classes/model/Process.php");
|
|
||||||
require_once ("classes/model/Step.php");
|
|
||||||
require_once ("classes/model/Application.php");
|
|
||||||
require_once ('classes/model/Groupwf.php');
|
|
||||||
require_once ("classes/model/GroupUser.php");
|
|
||||||
require_once ("classes/model/AppDelegation.php");
|
|
||||||
require_once ("classes/model/Route.php");
|
|
||||||
require_once ('classes/model/SubApplication.php');
|
|
||||||
require_once ('classes/model/SubProcess.php');
|
|
||||||
require_once ("classes/model/Users.php");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* derivation - derivation class
|
* derivation - derivation class
|
||||||
@@ -87,6 +51,7 @@ class Derivation
|
|||||||
* @param array $arrayTaskData Task data (derivation)
|
* @param array $arrayTaskData Task data (derivation)
|
||||||
*
|
*
|
||||||
* @return array Return array
|
* @return array Return array
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected function prepareInformationTask(array $arrayTaskData)
|
protected function prepareInformationTask(array $arrayTaskData)
|
||||||
{
|
{
|
||||||
@@ -161,7 +126,8 @@ class Derivation
|
|||||||
* @param array $arrayData Data
|
* @param array $arrayData Data
|
||||||
* @param string $taskUid Unique id of Task
|
* @param string $taskUid Unique id of Task
|
||||||
*
|
*
|
||||||
* @return array Return array
|
* @return array
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function prepareInformation(array $arrayData, $taskUid = "")
|
public function prepareInformation(array $arrayData, $taskUid = "")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -530,10 +530,16 @@ class AppDocument extends BaseAppDocument
|
|||||||
return $documents;
|
return $documents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exists ($sAppDocUid, $iVersion)
|
/**
|
||||||
|
* This function check if exist a document
|
||||||
|
* @param string $appDocUid, Uid of the document
|
||||||
|
* @param integer $version,
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
public function exists ($appDocUid, $version = 1)
|
||||||
{
|
{
|
||||||
$oAppDocument = AppDocumentPeer::retrieveByPK( $sAppDocUid, $iVersion );
|
$oAppDocument = AppDocumentPeer::retrieveByPK($appDocUid, $version);
|
||||||
return (is_object( $oAppDocument ) && get_class( $oAppDocument ) == 'AppDocument');
|
return (is_object($oAppDocument) && get_class($oAppDocument) == 'AppDocument');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -547,6 +553,7 @@ class AppDocument extends BaseAppDocument
|
|||||||
*/
|
*/
|
||||||
public function canDownloadInput($user, $appDocUid, $version)
|
public function canDownloadInput($user, $appDocUid, $version)
|
||||||
{
|
{
|
||||||
|
//Check if the the requester is the owner in the file
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn(AppDocumentPeer::APP_UID);
|
$oCriteria->addSelectColumn(AppDocumentPeer::APP_UID);
|
||||||
$oCriteria->addJoin(AppDocumentPeer::DOC_UID, InputDocumentPeer::INP_DOC_UID, Criteria::LEFT_JOIN);
|
$oCriteria->addJoin(AppDocumentPeer::DOC_UID, InputDocumentPeer::INP_DOC_UID, Criteria::LEFT_JOIN);
|
||||||
@@ -560,11 +567,11 @@ class AppDocument extends BaseAppDocument
|
|||||||
if ($dataset->getRow()) {
|
if ($dataset->getRow()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
//Review if is a INPUT or ATTACHED
|
||||||
$oCriteria = new Criteria("workflow");
|
$oCriteria = new Criteria("workflow");
|
||||||
$oCriteria->addSelectColumn(AppDocumentPeer::APP_UID);
|
$oCriteria->addSelectColumn(AppDocumentPeer::APP_UID);
|
||||||
$oCriteria->addSelectColumn(AppDocumentPeer::DOC_UID);
|
$oCriteria->addSelectColumn(AppDocumentPeer::DOC_UID);
|
||||||
$oCriteria->addSelectColumn(InputDocumentPeer::PRO_UID);
|
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_TYPE);
|
||||||
$oCriteria->addJoin(AppDocumentPeer::DOC_UID, InputDocumentPeer::INP_DOC_UID, Criteria::LEFT_JOIN);
|
|
||||||
$oCriteria->add(AppDocumentPeer::APP_DOC_UID, $appDocUid);
|
$oCriteria->add(AppDocumentPeer::APP_DOC_UID, $appDocUid);
|
||||||
$oCriteria->add(AppDocumentPeer::DOC_VERSION, $version);
|
$oCriteria->add(AppDocumentPeer::DOC_VERSION, $version);
|
||||||
$oCriteria->setLimit(1);
|
$oCriteria->setLimit(1);
|
||||||
@@ -572,28 +579,56 @@ class AppDocument extends BaseAppDocument
|
|||||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
$row = $dataset->getRow();
|
$row = $dataset->getRow();
|
||||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
if ($row['DOC_UID'] == '-1') {
|
||||||
$userAuthorization = $cases->userAuthorization(
|
//If is an attached we only verify if is a supervisor in the process
|
||||||
$user,
|
$appUid = $row['APP_UID'];
|
||||||
$row['PRO_UID'],
|
$oApplication = new Application();
|
||||||
$row['APP_UID'],
|
$aColumns = $oApplication->Load($appUid);
|
||||||
array(),
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||||
array('INPUT_DOCUMENTS' => 'VIEW')
|
$userAuthorization = $cases->userAuthorization(
|
||||||
);
|
$user,
|
||||||
|
$aColumns['PRO_UID'],
|
||||||
if (in_array($appDocUid, $userAuthorization['objectPermissions']['INPUT_DOCUMENTS'])) {
|
$appUid,
|
||||||
return true;
|
array(),
|
||||||
}
|
array('ATTACHMENTS' => 'VIEW')
|
||||||
|
);
|
||||||
if ($userAuthorization['supervisor']) {
|
//Has permissions?
|
||||||
$criteria = new Criteria("workflow");
|
if (in_array($appDocUid, $userAuthorization['objectPermissions']['ATTACHMENTS'])) {
|
||||||
$criteria->addSelectColumn(StepSupervisorPeer::STEP_UID);
|
|
||||||
$criteria->add(StepSupervisorPeer::STEP_TYPE_OBJ, "INPUT_DOCUMENT", \Criteria::EQUAL);
|
|
||||||
$criteria->add(StepSupervisorPeer::STEP_UID_OBJ, $row['DOC_UID'], \Criteria::EQUAL);
|
|
||||||
$rsCriteria = StepSupervisorPeer::doSelectRS($criteria);
|
|
||||||
if ($rsCriteria->next()) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
//Is supervisor?
|
||||||
|
if ($userAuthorization['supervisor']) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//If is an file related an input document, we will check if the user is a supervisor or has permissions
|
||||||
|
$appUid = $row['APP_UID'];
|
||||||
|
$oInputDoc = new InputDocument();
|
||||||
|
$aColumns = $oInputDoc->Load($row['DOC_UID']);
|
||||||
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||||
|
$userAuthorization = $cases->userAuthorization(
|
||||||
|
$user,
|
||||||
|
$aColumns['PRO_UID'],
|
||||||
|
$appUid,
|
||||||
|
array(),
|
||||||
|
array('INPUT_DOCUMENTS' => 'VIEW')
|
||||||
|
);
|
||||||
|
//Has permissions?
|
||||||
|
if (in_array($appDocUid, $userAuthorization['objectPermissions']['INPUT_DOCUMENTS'])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//Is supervisor?
|
||||||
|
if ($userAuthorization['supervisor']) {
|
||||||
|
//Review if the supervisor has assigned the object input document
|
||||||
|
$criteria = new Criteria("workflow");
|
||||||
|
$criteria->addSelectColumn(StepSupervisorPeer::STEP_UID);
|
||||||
|
$criteria->add(StepSupervisorPeer::STEP_TYPE_OBJ, "INPUT_DOCUMENT", \Criteria::EQUAL);
|
||||||
|
$criteria->add(StepSupervisorPeer::STEP_UID_OBJ, $row['DOC_UID'], \Criteria::EQUAL);
|
||||||
|
$rsCriteria = StepSupervisorPeer::doSelectRS($criteria);
|
||||||
|
if ($rsCriteria->next()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -383,10 +383,10 @@ class ObjectPermission extends BaseObjectPermission
|
|||||||
}
|
}
|
||||||
switch ($obType) {
|
switch ($obType) {
|
||||||
case 'INPUT':
|
case 'INPUT':
|
||||||
$oCriteria->add(
|
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'INPUT');
|
||||||
$oCriteria->getNewCriterion(AppDocumentPeer::APP_DOC_TYPE, 'INPUT')->
|
break;
|
||||||
addOr($oCriteria->getNewCriterion(AppDocumentPeer::APP_DOC_TYPE, 'ATTACHED'))
|
case 'ATTACHED':
|
||||||
);
|
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'ATTACHED');
|
||||||
break;
|
break;
|
||||||
case 'OUTPUT':
|
case 'OUTPUT':
|
||||||
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
|
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
|
||||||
@@ -399,9 +399,6 @@ class ObjectPermission extends BaseObjectPermission
|
|||||||
$result = array();
|
$result = array();
|
||||||
while ($oDataset->next()) {
|
while ($oDataset->next()) {
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
if ($aRow['APP_DOC_TYPE'] == "ATTACHED") {
|
|
||||||
$aRow['APP_DOC_TYPE'] = "INPUT";
|
|
||||||
}
|
|
||||||
if (!in_array($aRow['APP_DOC_UID'], $result)) {
|
if (!in_array($aRow['APP_DOC_UID'], $result)) {
|
||||||
array_push($result, $aRow['APP_DOC_UID']);
|
array_push($result, $aRow['APP_DOC_UID']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class EmailEventMapBuilder
|
|||||||
|
|
||||||
$tMap->addColumn('EMAIL_EVENT_TO', 'EmailEventTo', 'string', CreoleTypes::LONGVARCHAR, true, null);
|
$tMap->addColumn('EMAIL_EVENT_TO', 'EmailEventTo', 'string', CreoleTypes::LONGVARCHAR, true, null);
|
||||||
|
|
||||||
$tMap->addColumn('EMAIL_EVENT_SUBJECT', 'EmailEventSubject', 'string', CreoleTypes::VARCHAR, false, 150);
|
$tMap->addColumn('EMAIL_EVENT_SUBJECT', 'EmailEventSubject', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||||
|
|
||||||
$tMap->addColumn('PRF_UID', 'PrfUid', 'string', CreoleTypes::VARCHAR, false, 32);
|
$tMap->addColumn('PRF_UID', 'PrfUid', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||||
|
|
||||||
|
|||||||
@@ -5537,7 +5537,7 @@
|
|||||||
<column name="EVN_UID" type="VARCHAR" size="32" required="true" />
|
<column name="EVN_UID" type="VARCHAR" size="32" required="true" />
|
||||||
<column name="EMAIL_EVENT_FROM" type="VARCHAR" size="100" required="true" default="" />
|
<column name="EMAIL_EVENT_FROM" type="VARCHAR" size="100" required="true" default="" />
|
||||||
<column name="EMAIL_EVENT_TO" type="LONGVARCHAR" required="true" />
|
<column name="EMAIL_EVENT_TO" type="LONGVARCHAR" required="true" />
|
||||||
<column name="EMAIL_EVENT_SUBJECT" type="VARCHAR" size="150" required="false" default=""/>
|
<column name="EMAIL_EVENT_SUBJECT" type="VARCHAR" size="255" required="false" default=""/>
|
||||||
<column name="PRF_UID" type="VARCHAR" size="32" required="false" default="" />
|
<column name="PRF_UID" type="VARCHAR" size="32" required="false" default="" />
|
||||||
<column name="EMAIL_SERVER_UID" type="VARCHAR" size="32" required="false" default="" />
|
<column name="EMAIL_SERVER_UID" type="VARCHAR" size="32" required="false" default="" />
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -9326,6 +9326,12 @@ msgstr "Web Entry deleted correctly"
|
|||||||
msgid "[LABEL/ID_PASSWORD] Password"
|
msgid "[LABEL/ID_PASSWORD] Password"
|
||||||
msgstr "Password"
|
msgstr "Password"
|
||||||
|
|
||||||
|
# TRANSLATION
|
||||||
|
# LABEL/ID_PASSWORD_CONFIRM
|
||||||
|
#: LABEL/ID_PASSWORD_CONFIRM
|
||||||
|
msgid "[LABEL/ID_PASSWORD_CONFIRM] Confirm Password"
|
||||||
|
msgstr "Confirm Password"
|
||||||
|
|
||||||
# TRANSLATION
|
# TRANSLATION
|
||||||
# LABEL/ID_NOT_DEFINED
|
# LABEL/ID_NOT_DEFINED
|
||||||
#: LABEL/ID_NOT_DEFINED
|
#: LABEL/ID_NOT_DEFINED
|
||||||
|
|||||||
@@ -7,11 +7,16 @@
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Maveriks\Util\ClassLoader;
|
||||||
|
use \OAuth2\Request;
|
||||||
|
use \ProcessMaker\BusinessModel\Light\Tracker;
|
||||||
|
use \ProcessMaker\Services\OAuth2\Server;
|
||||||
|
|
||||||
class Designer extends Controller
|
class Designer extends Controller
|
||||||
{
|
{
|
||||||
protected $clientId = 'x-pm-local-client';
|
protected $clientId = 'x-pm-local-client';
|
||||||
|
|
||||||
public function __construct ()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -26,57 +31,16 @@ class Designer extends Controller
|
|||||||
$proUid = isset($httpData->prj_uid) ? $httpData->prj_uid : '';
|
$proUid = isset($httpData->prj_uid) ? $httpData->prj_uid : '';
|
||||||
$appUid = isset($httpData->app_uid) ? $httpData->app_uid : '';
|
$appUid = isset($httpData->app_uid) ? $httpData->app_uid : '';
|
||||||
$proReadOnly = isset($httpData->prj_readonly) ? $httpData->prj_readonly : 'false';
|
$proReadOnly = isset($httpData->prj_readonly) ? $httpData->prj_readonly : 'false';
|
||||||
$client = $this->getClientCredentials();
|
|
||||||
|
|
||||||
if (isset($httpData->tracker_designer) && $httpData->tracker_designer == 1) {
|
$clientToken = $this->getCredentials($httpData);
|
||||||
try {
|
|
||||||
if (!isset($_SESSION['CASE']) && !isset($_SESSION['PIN'])) {
|
|
||||||
throw (new \Exception(
|
|
||||||
\G::LoadTranslation('ID_CASE_NOT_EXISTS') . "\n" . \G::LoadTranslation('ID_PIN_INVALID')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
\ProcessMaker\BusinessModel\Light\Tracker::authentication($_SESSION['CASE'], $_SESSION['PIN']);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
Bootstrap::registerMonolog('CaseTracker', 400, $e->getMessage(), [], SYS_SYS, 'processmaker.log');
|
|
||||||
\G::header('Location: /errors/error403.php');
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
$client["tracker_designer"] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$authCode = $this->getAuthorizationCode($client);
|
|
||||||
$debug = false; //System::isDebugMode();
|
$debug = false; //System::isDebugMode();
|
||||||
|
|
||||||
$loader = Maveriks\Util\ClassLoader::getInstance();
|
|
||||||
$loader->add(PATH_TRUNK . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2");
|
|
||||||
|
|
||||||
$request = array(
|
|
||||||
'grant_type' => 'authorization_code',
|
|
||||||
'code' => $authCode
|
|
||||||
);
|
|
||||||
$server = array(
|
|
||||||
'REQUEST_METHOD' => 'POST'
|
|
||||||
);
|
|
||||||
$headers = array(
|
|
||||||
"PHP_AUTH_USER" => $client['CLIENT_ID'],
|
|
||||||
"PHP_AUTH_PW" => $client['CLIENT_SECRET'],
|
|
||||||
"Content-Type" => "multipart/form-data;",
|
|
||||||
"Authorization" => "Basic " . base64_encode($client['CLIENT_ID'] . ":" . $client['CLIENT_SECRET'])
|
|
||||||
);
|
|
||||||
|
|
||||||
$request = new \OAuth2\Request(array(), $request, array(), array(), array(), $server, null, $headers);
|
|
||||||
$oauthServer = new \ProcessMaker\Services\OAuth2\Server();
|
|
||||||
$response = $oauthServer->postToken($request, true);
|
|
||||||
$clientToken = $response->getParameters();
|
|
||||||
$clientToken["client_id"] = $client['CLIENT_ID'];
|
|
||||||
$clientToken["client_secret"] = $client['CLIENT_SECRET'];
|
|
||||||
|
|
||||||
$consolidated = 0;
|
$consolidated = 0;
|
||||||
$enterprise = 0;
|
$enterprise = 0;
|
||||||
$distribution = 0;
|
$distribution = 0;
|
||||||
|
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||||
if ($licensedFeatures->verifyfeature('7TTeDBQeWRoZTZKYjh4eFpYUlRDUUEyVERPU3FxellWank=')) {
|
if ($licensedFeatures->verifyfeature('7TTeDBQeWRoZTZKYjh4eFpYUlRDUUEyVERPU3FxellWank=')) {
|
||||||
$consolidated = 1;
|
$consolidated = 1;
|
||||||
}
|
}
|
||||||
@@ -101,10 +65,10 @@ class Designer extends Controller
|
|||||||
$this->setVar('HTTP_SERVER_HOSTNAME', PmSystem::getHttpServerHostnameRequestsFrontEnd());
|
$this->setVar('HTTP_SERVER_HOSTNAME', PmSystem::getHttpServerHostnameRequestsFrontEnd());
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
if (! file_exists(PATH_HTML . "lib-dev/pmUI/build.cache")) {
|
if (!file_exists(PATH_HTML . "lib-dev/pmUI/build.cache")) {
|
||||||
throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in pmUI project");
|
throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in pmUI project");
|
||||||
}
|
}
|
||||||
if (! file_exists(PATH_HTML . "lib-dev/mafe/build.cache")) {
|
if (!file_exists(PATH_HTML . "lib-dev/mafe/build.cache")) {
|
||||||
throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in MichelangeloFE project");
|
throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in MichelangeloFE project");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +92,7 @@ class Designer extends Controller
|
|||||||
$this->setVar('mafeCssFiles', $mafeCssFiles);
|
$this->setVar('mafeCssFiles', $mafeCssFiles);
|
||||||
} else {
|
} else {
|
||||||
$buildhashFile = PATH_HTML . "lib/buildhash";
|
$buildhashFile = PATH_HTML . "lib/buildhash";
|
||||||
if (! file_exists($buildhashFile)) {
|
if (!file_exists($buildhashFile)) {
|
||||||
throw new RuntimeException("CSS and JS Files were are not generated!.\nPlease review install process");
|
throw new RuntimeException("CSS and JS Files were are not generated!.\nPlease review install process");
|
||||||
}
|
}
|
||||||
$buildhash = file_get_contents($buildhashFile);
|
$buildhash = file_get_contents($buildhashFile);
|
||||||
@@ -137,7 +101,7 @@ class Designer extends Controller
|
|||||||
|
|
||||||
$translationMafe = "/translations/translationsMafe.js";
|
$translationMafe = "/translations/translationsMafe.js";
|
||||||
$this->setVar('translationMafe', $translationMafe);
|
$this->setVar('translationMafe', $translationMafe);
|
||||||
if (!file_exists(PATH_HTML . "translations" . PATH_SEP. 'translationsMafe' . ".js")) {
|
if (!file_exists(PATH_HTML . "translations" . PATH_SEP . 'translationsMafe' . ".js")) {
|
||||||
$translation = new Translation();
|
$translation = new Translation();
|
||||||
$translation->generateFileTranslationMafe();
|
$translation->generateFileTranslationMafe();
|
||||||
}
|
}
|
||||||
@@ -197,10 +161,10 @@ class Designer extends Controller
|
|||||||
|
|
||||||
protected function getAuthorizationCode($client)
|
protected function getAuthorizationCode($client)
|
||||||
{
|
{
|
||||||
\ProcessMaker\Services\OAuth2\Server::setDatabaseSource($this->getDsn());
|
Server::setDatabaseSource($this->getDsn());
|
||||||
\ProcessMaker\Services\OAuth2\Server::setPmClientId($client['CLIENT_ID']);
|
Server::setPmClientId($client['CLIENT_ID']);
|
||||||
|
|
||||||
$oauthServer = new \ProcessMaker\Services\OAuth2\Server();
|
$oauthServer = new Server();
|
||||||
|
|
||||||
if (isset($client["tracker_designer"]) && $client["tracker_designer"] == 1) {
|
if (isset($client["tracker_designer"]) && $client["tracker_designer"] == 1) {
|
||||||
$_SESSION["USER_LOGGED"] = "00000000000000000000000000000001";
|
$_SESSION["USER_LOGGED"] = "00000000000000000000000000000001";
|
||||||
@@ -215,7 +179,7 @@ class Designer extends Controller
|
|||||||
));
|
));
|
||||||
|
|
||||||
$response = $oauthServer->postAuthorize($authorize, $userId, true);
|
$response = $oauthServer->postAuthorize($authorize, $userId, true);
|
||||||
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
|
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=') + 5, 40);
|
||||||
|
|
||||||
if (isset($client["tracker_designer"]) && $client["tracker_designer"] == 1) {
|
if (isset($client["tracker_designer"]) && $client["tracker_designer"] == 1) {
|
||||||
unset($_SESSION["USER_LOGGED"]);
|
unset($_SESSION["USER_LOGGED"]);
|
||||||
@@ -228,8 +192,63 @@ class Designer extends Controller
|
|||||||
{
|
{
|
||||||
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
|
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
|
||||||
$port = empty($port) ? '' : ";port=$port";
|
$port = empty($port) ? '' : ";port=$port";
|
||||||
$dsn = DB_ADAPTER.':host='.$host.';dbname='.DB_NAME.$port;
|
$dsn = DB_ADAPTER . ':host=' . $host . ';dbname=' . DB_NAME . $port;
|
||||||
|
|
||||||
return array('dsn' => $dsn, 'username' => DB_USER, 'password' => DB_PASS);
|
return array('dsn' => $dsn, 'username' => DB_USER, 'password' => DB_PASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return credentials oauth2
|
||||||
|
*
|
||||||
|
* @param object $httpData
|
||||||
|
* @return array credentials
|
||||||
|
*/
|
||||||
|
public function getCredentials($httpData = null)
|
||||||
|
{
|
||||||
|
$client = $this->getClientCredentials();
|
||||||
|
|
||||||
|
if (!empty($httpData->tracker_designer) && $httpData->tracker_designer == 1) {
|
||||||
|
try {
|
||||||
|
if (!isset($_SESSION['CASE']) && !isset($_SESSION['PIN'])) {
|
||||||
|
throw (new \Exception(
|
||||||
|
\G::LoadTranslation('ID_CASE_NOT_EXISTS') . "\n" . \G::LoadTranslation('ID_PIN_INVALID')
|
||||||
|
));
|
||||||
|
}
|
||||||
|
Tracker::authentication($_SESSION['CASE'], $_SESSION['PIN']);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Bootstrap::registerMonolog('CaseTracker', 400, $e->getMessage(), [], SYS_SYS, 'processmaker.log');
|
||||||
|
\G::header('Location: /errors/error403.php');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
$client["tracker_designer"] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$authCode = $this->getAuthorizationCode($client);
|
||||||
|
|
||||||
|
$loader = ClassLoader::getInstance();
|
||||||
|
$loader->add(PATH_TRUNK . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2");
|
||||||
|
|
||||||
|
$request = array(
|
||||||
|
'grant_type' => 'authorization_code',
|
||||||
|
'code' => $authCode
|
||||||
|
);
|
||||||
|
$server = array(
|
||||||
|
'REQUEST_METHOD' => 'POST'
|
||||||
|
);
|
||||||
|
$headers = array(
|
||||||
|
"PHP_AUTH_USER" => $client['CLIENT_ID'],
|
||||||
|
"PHP_AUTH_PW" => $client['CLIENT_SECRET'],
|
||||||
|
"Content-Type" => "multipart/form-data;",
|
||||||
|
"Authorization" => "Basic " . base64_encode($client['CLIENT_ID'] . ":" . $client['CLIENT_SECRET'])
|
||||||
|
);
|
||||||
|
|
||||||
|
$request = new Request(array(), $request, array(), array(), array(), $server, null, $headers);
|
||||||
|
$oauthServer = new Server();
|
||||||
|
$response = $oauthServer->postToken($request, true);
|
||||||
|
$clientToken = $response->getParameters();
|
||||||
|
$clientToken["client_id"] = $client['CLIENT_ID'];
|
||||||
|
$clientToken["client_secret"] = $client['CLIENT_SECRET'];
|
||||||
|
|
||||||
|
return $clientToken;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,36 +80,42 @@ class Installer extends Controller
|
|||||||
G::RenderPage( 'publish', 'extJs' );
|
G::RenderPage( 'publish', 'extJs' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function can be create a new workspace
|
||||||
|
* The user need permission PM_SETUP_ADVANCE for this action
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function newSite ()
|
public function newSite ()
|
||||||
{
|
{
|
||||||
$textStep1 = G::LoadTranslation('ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION_STEP4_1');
|
if (!$this->pmIsInstalled()) {
|
||||||
$textStep2 = G::LoadTranslation('ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION_STEP5');
|
$textStep1 = G::LoadTranslation('ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION_STEP4_1');
|
||||||
|
$textStep2 = G::LoadTranslation('ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION_STEP5');
|
||||||
|
|
||||||
$this->includeExtJS( 'installer/CardLayout', false );
|
$this->includeExtJS('installer/CardLayout', false);
|
||||||
$this->includeExtJS( 'installer/Wizard', false );
|
$this->includeExtJS('installer/Wizard', false);
|
||||||
$this->includeExtJS( 'installer/Header', false );
|
$this->includeExtJS('installer/Header', false);
|
||||||
$this->includeExtJS( 'installer/Card', false );
|
$this->includeExtJS('installer/Card', false);
|
||||||
$this->includeExtJS( 'installer/newSite', false );
|
$this->includeExtJS('installer/newSite', false);
|
||||||
|
$this->setJSVar('textStep1', $textStep1);
|
||||||
|
$this->setJSVar('textStep2', $textStep2);
|
||||||
|
$this->setJSVar('DB_ADAPTER', DB_ADAPTER);
|
||||||
|
$aux = explode(':', DB_HOST);
|
||||||
|
$this->setJSVar('DB_HOST', $aux[0]);
|
||||||
|
$this->setJSVar('DB_PORT', isset( $aux[1] ) ? $aux[1] : (DB_ADAPTER == 'mssql' ? '1433' : '3306'));
|
||||||
|
$this->setJSVar('DB_NAME', 'workflow');
|
||||||
|
$this->setJSVar('DB_USER', '');
|
||||||
|
$this->setJSVar('DB_PASS', '');
|
||||||
|
$this->setJSVar('pathConfig', PATH_CORE . 'config' . PATH_SEP);
|
||||||
|
$this->setJSVar('pathLanguages', PATH_LANGUAGECONT);
|
||||||
|
$this->setJSVar('pathPlugins', PATH_PLUGINS);
|
||||||
|
$this->setJSVar('pathXmlforms', PATH_XMLFORM);
|
||||||
|
$this->setJSVar('pathShared', PATH_DATA);
|
||||||
|
$this->setView('installer/newSite');
|
||||||
|
|
||||||
$this->setJSVar( 'textStep1', $textStep1 );
|
G::RenderPage('publish', 'extJs');
|
||||||
$this->setJSVar( 'textStep2', $textStep2 );
|
} else {
|
||||||
|
$this->displayError();
|
||||||
$this->setJSVar( 'DB_ADAPTER', DB_ADAPTER );
|
}
|
||||||
$aux = explode( ':', DB_HOST );
|
|
||||||
$this->setJSVar( 'DB_HOST', $aux[0] );
|
|
||||||
$this->setJSVar( 'DB_PORT', isset( $aux[1] ) ? $aux[1] : (DB_ADAPTER == 'mssql' ? '1433' : '3306') );
|
|
||||||
$this->setJSVar( 'DB_NAME', 'workflow' );
|
|
||||||
$this->setJSVar( 'DB_USER', '' );
|
|
||||||
$this->setJSVar( 'DB_PASS', '' );
|
|
||||||
$this->setJSVar( 'pathConfig', PATH_CORE . 'config' . PATH_SEP );
|
|
||||||
$this->setJSVar( 'pathLanguages', PATH_LANGUAGECONT );
|
|
||||||
$this->setJSVar( 'pathPlugins', PATH_PLUGINS );
|
|
||||||
$this->setJSVar( 'pathXmlforms', PATH_XMLFORM );
|
|
||||||
$this->setJSVar( 'pathShared', PATH_DATA );
|
|
||||||
|
|
||||||
$this->setView( 'installer/newSite' );
|
|
||||||
|
|
||||||
G::RenderPage( 'publish', 'extJs' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSystemInfo ()
|
public function getSystemInfo ()
|
||||||
@@ -414,22 +420,49 @@ class Installer extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to create a workspace
|
* function to create a workspace
|
||||||
* in fact this function is calling appropiate functions for mysql and mssql
|
* in fact this function is calling appropiate functions for mysql and mssql
|
||||||
|
* need permission PM_SETUP_ADVANCE for this action
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function createWorkspace ()
|
public function createWorkspace ()
|
||||||
{
|
{
|
||||||
$pathSharedPartner = trim( $_REQUEST['pathShared'] );
|
if (!$this->pmIsInstalled()) {
|
||||||
if (file_exists(trim($pathSharedPartner,PATH_SEP). PATH_SEP .'partner.info')) {
|
$pathSharedPartner = trim($_REQUEST['pathShared']);
|
||||||
$this->systemName = $this->getSystemName($pathSharedPartner);
|
if (file_exists(trim($pathSharedPartner, PATH_SEP) . PATH_SEP . 'partner.info')) {
|
||||||
$_REQUEST["PARTNER_FLAG"] = true;
|
$this->systemName = $this->getSystemName($pathSharedPartner);
|
||||||
}
|
$_REQUEST["PARTNER_FLAG"] = true;
|
||||||
$this->setResponseType( 'json' );
|
}
|
||||||
if ($_REQUEST['db_engine'] == 'mysql') {
|
$this->setResponseType('json');
|
||||||
$info = $this->createMySQLWorkspace();
|
if ($_REQUEST['db_engine'] == 'mysql') {
|
||||||
} else {
|
$info = $this->createMySQLWorkspace();
|
||||||
$info = $this->createMSSQLWorkspace();
|
} else {
|
||||||
}
|
$info = $this->createMSSQLWorkspace();
|
||||||
|
}
|
||||||
|
|
||||||
return $info;
|
return $info;
|
||||||
|
} else {
|
||||||
|
$this->displayError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We check if processMaker is not installed
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private function pmIsInstalled(){
|
||||||
|
return file_exists(FILE_PATHS_INSTALLED);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display an error when processMaker is already installed
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function displayError(){
|
||||||
|
$this->setJSVar('messageError', G::LoadTranslation('ID_PROCESSMAKER_ALREADY_INSTALLED'));
|
||||||
|
$this->includeExtJS('installer/stopInstall');
|
||||||
|
$this->setView('installer/mainStopInstall');
|
||||||
|
G::RenderPage('publish', 'extJs');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forceTogenerateTranslationsFiles ($url)
|
public function forceTogenerateTranslationsFiles ($url)
|
||||||
|
|||||||
@@ -3025,6 +3025,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
|||||||
( 'LABEL','ID_CONFIRM_DELETE_WEB_ENTRY','en','Do you want to delete current web entry?','2014-01-15') ,
|
( 'LABEL','ID_CONFIRM_DELETE_WEB_ENTRY','en','Do you want to delete current web entry?','2014-01-15') ,
|
||||||
( 'LABEL','ID_WEB_ENTRY_SUCCESS_DELETE','en','Web Entry deleted correctly','2014-01-15') ,
|
( 'LABEL','ID_WEB_ENTRY_SUCCESS_DELETE','en','Web Entry deleted correctly','2014-01-15') ,
|
||||||
( 'LABEL','ID_PASSWORD','en','Password','2014-01-15') ,
|
( 'LABEL','ID_PASSWORD','en','Password','2014-01-15') ,
|
||||||
|
( 'LABEL','ID_PASSWORD_CONFIRM','en','Confirm Password','2017-07-25') ,
|
||||||
( 'LABEL','ID_NOT_DEFINED','en','Not defined','2014-01-15') ,
|
( 'LABEL','ID_NOT_DEFINED','en','Not defined','2014-01-15') ,
|
||||||
( 'LABEL','ID_WEB_ENTRY_SUCCESS_NEW','en','Web Entry has been created correctly.','2014-01-15') ,
|
( 'LABEL','ID_WEB_ENTRY_SUCCESS_NEW','en','Web Entry has been created correctly.','2014-01-15') ,
|
||||||
( 'LABEL','ID_REMOVE_ALL_BUTTON_FACE','en','<<','2014-01-15') ,
|
( 'LABEL','ID_REMOVE_ALL_BUTTON_FACE','en','<<','2014-01-15') ,
|
||||||
|
|||||||
@@ -3068,7 +3068,7 @@ CREATE TABLE `EMAIL_EVENT`
|
|||||||
`EVN_UID` VARCHAR(32) NOT NULL,
|
`EVN_UID` VARCHAR(32) NOT NULL,
|
||||||
`EMAIL_EVENT_FROM` VARCHAR(100) default '' NOT NULL,
|
`EMAIL_EVENT_FROM` VARCHAR(100) default '' NOT NULL,
|
||||||
`EMAIL_EVENT_TO` MEDIUMTEXT NOT NULL,
|
`EMAIL_EVENT_TO` MEDIUMTEXT NOT NULL,
|
||||||
`EMAIL_EVENT_SUBJECT` VARCHAR(150) default '',
|
`EMAIL_EVENT_SUBJECT` VARCHAR(255) default '',
|
||||||
`PRF_UID` VARCHAR(32) default '',
|
`PRF_UID` VARCHAR(32) default '',
|
||||||
`EMAIL_SERVER_UID` VARCHAR(32) default '',
|
`EMAIL_SERVER_UID` VARCHAR(32) default '',
|
||||||
PRIMARY KEY (`EMAIL_EVENT_UID`)
|
PRIMARY KEY (`EMAIL_EVENT_UID`)
|
||||||
|
|||||||
@@ -1,26 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* installServer.php
|
global $RBAC;
|
||||||
*
|
$RBAC->allows(basename(__FILE__), basename(__FILE__));
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (isset( $_POST['form']['NW_TITLE'] )) {
|
if (isset( $_POST['form']['NW_TITLE'] )) {
|
||||||
$action = (isset( $_POST['form']['ACTION'] )) ? trim( $_POST['form']['ACTION'] ) : 'test';
|
$action = (isset( $_POST['form']['ACTION'] )) ? trim( $_POST['form']['ACTION'] ) : 'test';
|
||||||
|
|||||||
@@ -88,6 +88,13 @@ $oHeadPublisher->assign("arrayMenuNewOptionPlugin", $arrayMenuNewOptionPlugin);
|
|||||||
$oHeadPublisher->assign("arrayContextMenuOptionPlugin", $arrayContextMenuOptionPlugin);
|
$oHeadPublisher->assign("arrayContextMenuOptionPlugin", $arrayContextMenuOptionPlugin);
|
||||||
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
||||||
|
|
||||||
|
$designer = new Designer();
|
||||||
|
$oHeadPublisher->assign('SYS_SYS', SYS_SYS);
|
||||||
|
$oHeadPublisher->assign('SYS_LANG', SYS_LANG);
|
||||||
|
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
|
||||||
|
$oHeadPublisher->assign('HTTP_SERVER_HOSTNAME', PmSystem::getHttpServerHostnameRequestsFrontEnd());
|
||||||
|
$oHeadPublisher->assign('credentials', base64_encode(G::json_encode($designer->getCredentials())));
|
||||||
|
|
||||||
$deleteCasesFlag = false;
|
$deleteCasesFlag = false;
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
if($RBAC->userCanAccess('PM_DELETE_PROCESS_CASES') === 1) {
|
if($RBAC->userCanAccess('PM_DELETE_PROCESS_CASES') === 1) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProcessMaker\BusinessModel;
|
namespace ProcessMaker\BusinessModel;
|
||||||
|
|
||||||
|
use Behat\Behat\Exception\Exception;
|
||||||
use \G;
|
use \G;
|
||||||
use \Cases;
|
use \Cases;
|
||||||
use \Criteria;
|
use \Criteria;
|
||||||
@@ -207,24 +208,22 @@ class ProcessPermissions
|
|||||||
/**
|
/**
|
||||||
* Save Process Permission
|
* Save Process Permission
|
||||||
*
|
*
|
||||||
* @var array $data. Data for Process Permission
|
* @var array $data, Data for Process Permission
|
||||||
* @var string $op_uid. Uid for Process Permission
|
* @var string $opUid, Uid for Process Permission
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
||||||
* @copyright Colosa - Bolivia
|
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
public function saveProcessPermission($data, $opUid = '')
|
||||||
public function saveProcessPermission($data, $op_uid = '')
|
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$data = array_change_key_case($data, CASE_UPPER);
|
$data = array_change_key_case($data, CASE_UPPER);
|
||||||
|
|
||||||
$this->validateProUid($data['PRO_UID']);
|
$this->validateProUid($data['PRO_UID']);
|
||||||
if ($op_uid != '') {
|
if ($opUid != '') {
|
||||||
$op_uid = $this->validateOpUid($op_uid);
|
$opUid = $this->validateOpUid($opUid);
|
||||||
}
|
}
|
||||||
if ($data['OP_USER_RELATION'] == "1") {
|
if ($data['OP_USER_RELATION'] == "1") {
|
||||||
$this->validateUsrUid($data['USR_UID']);
|
$this->validateUsrUid($data['USR_UID']);
|
||||||
@@ -257,6 +256,9 @@ class ProcessPermissions
|
|||||||
}
|
}
|
||||||
$sObjectUID = $data['DYNAFORMS'];
|
$sObjectUID = $data['DYNAFORMS'];
|
||||||
break;
|
break;
|
||||||
|
case 'ATTACHED':
|
||||||
|
$sObjectUID = '';
|
||||||
|
break;
|
||||||
case 'INPUT':
|
case 'INPUT':
|
||||||
$data['INPUTS'] = $data['INPUTS'] == 0 ? '': $data['INPUTS'];
|
$data['INPUTS'] = $data['INPUTS'] == 0 ? '': $data['INPUTS'];
|
||||||
if ($data['INPUTS'] != '') {
|
if ($data['INPUTS'] != '') {
|
||||||
@@ -273,11 +275,11 @@ class ProcessPermissions
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$oOP = new \ObjectPermission();
|
$oOP = new \ObjectPermission();
|
||||||
$permissionUid = ($op_uid != '') ? $op_uid : G::generateUniqueID();
|
$permissionUid = ($opUid != '') ? $opUid : G::generateUniqueID();
|
||||||
$data['OP_UID'] = $permissionUid;
|
$data['OP_UID'] = $permissionUid;
|
||||||
$data['OP_OBJ_UID'] = $sObjectUID;
|
$data['OP_OBJ_UID'] = $sObjectUID;
|
||||||
|
|
||||||
if ($op_uid == '') {
|
if ($opUid == '') {
|
||||||
$oOP->fromArray( $data, \BasePeer::TYPE_FIELDNAME );
|
$oOP->fromArray( $data, \BasePeer::TYPE_FIELDNAME );
|
||||||
$oOP->save();
|
$oOP->save();
|
||||||
$daraRes = $oOP->load($permissionUid);
|
$daraRes = $oOP->load($permissionUid);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class ProcessPermissions extends Api
|
|||||||
* @param string $op_user_relation {@from body} {@choice 1,2}
|
* @param string $op_user_relation {@from body} {@choice 1,2}
|
||||||
* @param string $op_case_status {@from body} {@choice ALL,DRAFT,TO_DO,PAUSED,COMPLETED}
|
* @param string $op_case_status {@from body} {@choice ALL,DRAFT,TO_DO,PAUSED,COMPLETED}
|
||||||
* @param string $op_participate {@from body} {@choice 0,1}
|
* @param string $op_participate {@from body} {@choice 0,1}
|
||||||
* @param string $op_obj_type {@from body} {@choice ANY,DYNAFORM,INPUT,OUTPUT,CASES_NOTES,MSGS_HISTORY,SUMMARY_FORM}
|
* @param string $op_obj_type {@from body} {@choice ANY,DYNAFORM,ATTACHMENT,INPUT,OUTPUT,CASES_NOTES,MSGS_HISTORY,SUMMARY_FORM}
|
||||||
* @param string $op_action {@from body} {@choice VIEW,BLOCK,DELETE,RESEND}
|
* @param string $op_action {@from body} {@choice VIEW,BLOCK,DELETE,RESEND}
|
||||||
* @param string $tas_uid {@from body}
|
* @param string $tas_uid {@from body}
|
||||||
* @param string $op_task_source {@from body}
|
* @param string $op_task_source {@from body}
|
||||||
@@ -123,7 +123,7 @@ class ProcessPermissions extends Api
|
|||||||
* @param string $op_user_relation {@from body} {@choice 1,2}
|
* @param string $op_user_relation {@from body} {@choice 1,2}
|
||||||
* @param string $op_case_status {@from body} {@choice ALL,DRAFT,TO_DO,PAUSED,COMPLETED}
|
* @param string $op_case_status {@from body} {@choice ALL,DRAFT,TO_DO,PAUSED,COMPLETED}
|
||||||
* @param string $op_participate {@from body} {@choice 0,1}
|
* @param string $op_participate {@from body} {@choice 0,1}
|
||||||
* @param string $op_obj_type {@from body} {@choice ANY,DYNAFORM,INPUT,OUTPUT,CASES_NOTES,MSGS_HISTORY,SUMMARY_FORM}
|
* @param string $op_obj_type {@from body} {@choice ANY,DYNAFORM,ATTACHMENT,INPUT,OUTPUT,CASES_NOTES,MSGS_HISTORY,SUMMARY_FORM}
|
||||||
* @param string $op_action {@from body} {@choice VIEW,BLOCK,DELETE,RESEND}
|
* @param string $op_action {@from body} {@choice VIEW,BLOCK,DELETE,RESEND}
|
||||||
* @param string $tas_uid {@from body}
|
* @param string $tas_uid {@from body}
|
||||||
* @param string $op_task_source {@from body}
|
* @param string $op_task_source {@from body}
|
||||||
|
|||||||
Reference in New Issue
Block a user