Merged in develop (pull request #5810)
Develop Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
@@ -2970,11 +2970,10 @@ class G
|
|||||||
*/
|
*/
|
||||||
public function is_utf8 ($string)
|
public function is_utf8 ($string)
|
||||||
{
|
{
|
||||||
if (is_array( $string )) {
|
if (preg_match('//u', $string)) {
|
||||||
$enc = implode( '', $string );
|
return true;
|
||||||
return @! ((ord( $enc[0] ) != 239) && (ord( $enc[1] ) != 187) && (ord( $enc[2] ) != 191));
|
|
||||||
} else {
|
} else {
|
||||||
return (utf8_encode( utf8_decode( $string ) ) == $string);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class pmLicenseManager
|
|||||||
$this->id = $results ['ID'];
|
$this->id = $results ['ID'];
|
||||||
$this->expireIn = $this->getExpireIn ();
|
$this->expireIn = $this->getExpireIn ();
|
||||||
$this->features = $this->result!='TMINUS'?isset($results ['DATA']['CUSTOMER_PLUGIN'])? $results ['DATA']['CUSTOMER_PLUGIN'] : $this->getActiveFeatures() : array();
|
$this->features = $this->result!='TMINUS'?isset($results ['DATA']['CUSTOMER_PLUGIN'])? $results ['DATA']['CUSTOMER_PLUGIN'] : $this->getActiveFeatures() : array();
|
||||||
$this->licensedfeatures = $this->result!='TMINUS'?isset($results ['DATA']['CUSTOMER_LICENSED_FEATURES'])? $results ['DATA']['CUSTOMER_LICENSED_FEATURES'] : array() : array();
|
$this->licensedfeatures = $this->result != 'TMINUS' ? (isset($results ['DATA']['CUSTOMER_LICENSED_FEATURES']) && is_array($results ['DATA']['CUSTOMER_LICENSED_FEATURES'])) ? $results ['DATA']['CUSTOMER_LICENSED_FEATURES'] : array() : array();
|
||||||
$this->licensedfeaturesList = isset($results ['DATA']['LICENSED_FEATURES_LIST'])? $results ['DATA']['LICENSED_FEATURES_LIST'] : null;
|
$this->licensedfeaturesList = isset($results ['DATA']['LICENSED_FEATURES_LIST'])? $results ['DATA']['LICENSED_FEATURES_LIST'] : null;
|
||||||
$this->status = $this->getCurrentLicenseStatus ();
|
$this->status = $this->getCurrentLicenseStatus ();
|
||||||
|
|
||||||
|
|||||||
@@ -1986,7 +1986,7 @@ class wsBase
|
|||||||
|
|
||||||
$task = TaskPeer::retrieveByPK($taskId);
|
$task = TaskPeer::retrieveByPK($taskId);
|
||||||
|
|
||||||
$arrayTaskTypeToExclude = array("START-TIMER-EVENT");
|
$arrayTaskTypeToExclude = array("START-TIMER-EVENT", "START-MESSAGE-EVENT");
|
||||||
|
|
||||||
if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $founded == "") {
|
if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $founded == "") {
|
||||||
$result = new wsResponse( 14, G::LoadTranslation( 'ID_TASK_INVALID_USER_NOT_ASSIGNED_TASK' ) );
|
$result = new wsResponse( 14, G::LoadTranslation( 'ID_TASK_INVALID_USER_NOT_ASSIGNED_TASK' ) );
|
||||||
|
|||||||
@@ -506,7 +506,12 @@ class pmTablesProxy extends HttpProxyController
|
|||||||
$j = 0;
|
$j = 0;
|
||||||
foreach ($aAdditionalTables['FIELDS'] as $aField) {
|
foreach ($aAdditionalTables['FIELDS'] as $aField) {
|
||||||
$conData++;
|
$conData++;
|
||||||
$temp = (array_key_exists($j, $aAux))? '"' . addslashes(stripslashes(utf8_encode($aAux[$j]))) . '"' : '""';
|
|
||||||
|
if (array_key_exists($j, $aAux)) {
|
||||||
|
$temp = '"' . addslashes(stripslashes(G::is_utf8($aAux[$j]) ? $aAux[$j] : utf8_encode($aAux[$j]))) . '"';
|
||||||
|
} else {
|
||||||
|
$temp = '""';
|
||||||
|
}
|
||||||
|
|
||||||
if ($temp == '') {
|
if ($temp == '') {
|
||||||
switch ($aField['FLD_TYPE']) {
|
switch ($aField['FLD_TYPE']) {
|
||||||
|
|||||||
@@ -109,12 +109,14 @@ if( isset($_GET['action']) && ($_GET['action'] == 'jump') ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise') ){
|
if(isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise') ){
|
||||||
$oApp = new Application;
|
$oSupervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
|
||||||
$oApp->Load($appUid);
|
$caseCanBeReview = $oSupervisor->reviewCaseStatusForSupervisor($appUid, $delIndex);
|
||||||
//If the case is completed can not update the information from supervisor/review
|
//Check if the case has the correct status for update the information from supervisor/review
|
||||||
if($oApp->getAppStatus() === 'COMPLETED') {
|
if (!$caseCanBeReview) {
|
||||||
|
//The supervisor can not edit the information
|
||||||
$script = 'cases_Open?';
|
$script = 'cases_Open?';
|
||||||
} else {
|
} else {
|
||||||
|
//The supervisor can edit the information, the case are in TO_DO
|
||||||
$script = 'cases_OpenToRevise?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex . '&TAS_UID=' . $tasUid;
|
$script = 'cases_OpenToRevise?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex . '&TAS_UID=' . $tasUid;
|
||||||
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
|
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
|
||||||
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
|
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
|
||||||
|
|||||||
@@ -1494,4 +1494,36 @@ class ProcessSupervisor
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function define if the supervisor can be review and edit
|
||||||
|
* The appStatus can be:TO_DO, DRAFT, COMPLETED, CANCELLED
|
||||||
|
* The thread status can be: PAUSED
|
||||||
|
* @param string $appUid
|
||||||
|
* @param integer $delIndex
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function reviewCaseStatusForSupervisor($appUid, $delIndex = 0)
|
||||||
|
{
|
||||||
|
$oApp = new \Application();
|
||||||
|
$oApp->Load($appUid);
|
||||||
|
$canEdit = false;
|
||||||
|
switch ($oApp->getAppStatus()) {
|
||||||
|
case 'TO_DO':
|
||||||
|
//Verify if the case is paused because the supervisor can not edit the PAUSED case
|
||||||
|
$oDelay = new \AppDelay();
|
||||||
|
if ($oDelay->isPaused($appUid, $delIndex)) {
|
||||||
|
$canEdit = false;
|
||||||
|
} else {
|
||||||
|
$canEdit = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'COMPLETED':
|
||||||
|
case 'CANCELLED':
|
||||||
|
default:
|
||||||
|
$canEdit = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $canEdit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -844,18 +844,6 @@ class BpmnWorkflow extends Project\Bpmn
|
|||||||
"TAS_POSY" => $taskPosY
|
"TAS_POSY" => $taskPosY
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($elementType == "bpmnEvent" &&
|
|
||||||
in_array($key, array("end-message-event", "start-message-event", "intermediate-catch-message-event"))
|
|
||||||
) {
|
|
||||||
if (in_array($key, array("start-message-event", "intermediate-catch-message-event"))) {
|
|
||||||
//Task - User
|
|
||||||
//Assign to admin
|
|
||||||
$task = new \Tasks();
|
|
||||||
|
|
||||||
$result = $task->assignUser($taskUid, "00000000000000000000000000000001", 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Element-Task-Relation - Create
|
//Element-Task-Relation - Create
|
||||||
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();
|
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user