PMCORE-4117

This commit is contained in:
Luciana Nuñez
2023-01-12 15:57:18 -04:00
parent 0d1c120090
commit 0bfb285940
4 changed files with 23 additions and 103 deletions

View File

@@ -2569,6 +2569,12 @@ msgstr "Assign Supervisor Dynaform"
msgid "Assign Supervisor Input"
msgstr "Assign Supervisor Input"
# TRANSLATION
# LABEL/ID_NO_ASSOCIATED_INPUT_DOCUMENT_DYN
#: LABEL/ID_NO_ASSOCIATED_INPUT_DOCUMENT_DYN
msgid "There are no associated Input Documents or Dynaforms"
msgstr "There are no associated Input Documents or Dynaforms"
# TRANSLATION
# LABEL/ID_ASSIGN_TASK
#: LABEL/ID_ASSIGN_TASK

View File

@@ -61691,6 +61691,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_USER_INEFFICIENCE','en','Inefficience Cost By User','2015-03-09') ,
( 'LABEL','ID_USER_INFORMATION','en','User Information','2014-01-15') ,
( 'LABEL','ID_USER_IS_SUPERVISOR_DOES_NOT_ASSOCIATED_INPUT_DOCUMENT','en','The user is supervisor, but it does not have an associated input document','2016-07-06') ,
( 'LABEL','ID_NO_ASSOCIATED_INPUT_DOCUMENT_DYN','en','There are no associated Input Documents or Dynaforms','2023-01-12') ,
( 'LABEL','ID_USER_LIST','en','User List','2014-01-15') ,
( 'LABEL','ID_USER_MUST_CHANGE_PASSWORD_AT_NEXT_LOGON','en','User must change password at next logon','2014-05-16') ,
( 'LABEL','ID_USER_NAME','en','User Name','2014-01-15') ,

View File

@@ -1,27 +1,6 @@
<?php
/**
* cases_Open.php
*
* 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.
*/
/* Permissions */
use ProcessMaker\BusinessModel\Cases as BusinessModelCases;
if ($RBAC->userCanAccess( 'PM_SUPERVISOR' ) != 1) {
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
@@ -38,7 +17,6 @@ if ($RBAC->userCanAccess( 'PM_SUPERVISOR' ) != 1) {
}
}
/* GET , POST & $_SESSION Vars */
if (isset( $_SESSION['APPLICATION'] )) {
unset( $_SESSION['APPLICATION'] );
@@ -70,89 +48,24 @@ $_SESSION['TASK'] = $aFields['TAS_UID'];
$_SESSION['STEP_POSITION'] = 0;
$_SESSION['CURRENT_TASK'] = $aFields['TAS_UID'];
$currentTask = (empty($tasUid)) ? $aFields["APP_DATA"]["TASK"]: $tasUid;
$flag = true;
/* Redirect to next step */
$cases = new BusinessModelCases();
$urls = $cases->getAllUrlStepsToRevise($_SESSION['APPLICATION'] , $_SESSION['INDEX']);
$cases = new Cases();
$arrayDynaFormUid = array();
$arrayInputUid = array();
$resultDynaForm = $cases->getAllDynaformsStepsToRevise($aFields["APP_UID"]);
while ($resultDynaForm->next()) {
$row = $resultDynaForm->getRow();
$arrayDynaFormUid[$row["STEP_UID_OBJ"]] = $row["STEP_UID_OBJ"];
$arrayDynaFormUid['DYN_UID'] = $row["STEP_UID_OBJ"];
if (!empty($url)) {
$url = $urls[0]['url'];
} else {
$aMessage = array ();
$aMessage["MESSAGE"] = G::LoadTranslation("ID_NO_ASSOCIATED_INPUT_DOCUMENT_DYN");
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent("xmlform", "xmlform", "login/showMessage", "", $aMessage);
G::RenderPage("publishBlank", "blank");
}
$resultInput = $cases->getAllInputsStepsToRevise($aFields["APP_UID"]);
while ($resultInput->next()) {
$row = $resultInput->getRow();
$arrayInputUid[$row["STEP_UID_OBJ"]] = $row["STEP_UID_OBJ"];
$arrayInputUid['INP_DOC_UID'] = $row["STEP_UID_OBJ"];
}
$criteria = new Criteria();
$criteria->addSelectColumn(StepPeer::STEP_TYPE_OBJ);
$criteria->addSelectColumn(StepPeer::STEP_UID_OBJ);
$criteria->addSelectColumn(StepPeer::STEP_POSITION);
$criteria->add(StepPeer::PRO_UID, $aFields["PRO_UID"], Criteria::EQUAL);
$criteria->add(StepPeer::TAS_UID, $currentTask, Criteria::EQUAL);
$criteria->addAscendingOrderByColumn(StepPeer::STEP_POSITION);
$rsCriteria = StepPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$url = "";
$flag = false;
//Review the object in the current task
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$stepTypeObj = $row["STEP_TYPE_OBJ"];
$stepUidObj = $row["STEP_UID_OBJ"];
switch ($stepTypeObj) {
case "DYNAFORM":
if (isset($arrayDynaFormUid[$stepUidObj])) {
$url = "cases_StepToRevise?type=DYNAFORM&PRO_UID=" . $aFields["PRO_UID"] . "&DYN_UID=" . $stepUidObj . "&APP_UID=" . $sAppUid . "&DEL_INDEX=" . $iDelIndex . "&position=1";
$flag = true;
}
break;
case "INPUT_DOCUMENT":
if (isset($arrayInputUid[$stepUidObj])) {
$url = "cases_StepToReviseInputs?type=INPUT_DOCUMENT&PRO_UID=" . $aFields["PRO_UID"] . "&INP_DOC_UID=" . $stepUidObj . "&APP_UID=" . $sAppUid . "&position=" . $row["STEP_POSITION"] . "&DEL_INDEX=" . $iDelIndex;
$flag = true;
}
break;
}
if ($flag) {
break;
}
}
//Review the list in Assigned objects
if(!$flag && isset($arrayDynaFormUid['DYN_UID'])){
$url = 'cases_StepToRevise?type=DYNAFORM&ex=0&PRO_UID='.$aFields["PRO_UID"].'&DYN_UID='.$arrayDynaFormUid['DYN_UID'].'&APP_UID='.$sAppUid.'&position=1&DEL_INDEX='.$iDelIndex;
$flag = true;
}
if(!$flag && isset($arrayInputUid['INP_DOC_UID'])){
$url = 'cases_StepToReviseInputs?type=INPUT_DOCUMENT&ex=0&PRO_UID='.$aFields["PRO_UID"].'&INP_DOC_UID='.$arrayInputUid['INP_DOC_UID'].'&APP_UID='.$sAppUid.'&position=1&DEL_INDEX='.$iDelIndex;
$flag = true;
}
$processUser = new ProcessUser();
$userAccess = $processUser->validateUserAccess($aFields['PRO_UID'], $_SESSION['USER_LOGGED']);
if(!$userAccess) {
$userAccess = $processUser->validateUserAccess($_SESSION['PROCESS'], $_SESSION['USER_LOGGED']);
if (!$userAccess) {
$flag = false;
}

View File

@@ -179,7 +179,7 @@ $headPublisher->assign('_WORKSPACE', config("system.workspace"));
$headPublisher->assign('_DEL_INDEX_DELEGATE', $delIndex);
$headPublisher->assign('_USR_DELEGATE', $case['CURRENT_USER_UID']);
if (!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) {
if (!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX']) || !isset($_SESSION['PROCESS'])) {
$_SESSION['PROCESS'] = $case['PRO_UID'];
$_SESSION['APPLICATION'] = $case['APP_UID'];
$_SESSION['TASK'] = $case['TAS_UID'];