PMCORE-2333 Web entry can still be used/create cases when process is inactive

This commit is contained in:
Roly Rudy Gutierrez Pinto
2021-03-05 17:41:42 -04:00
parent 620674bb65
commit 8a8a4865b8
5 changed files with 39 additions and 22 deletions

View File

@@ -4037,6 +4037,12 @@ msgstr "Loading Notes..."
msgid "Show more notes"
msgstr "Show more notes"
# TRANSLATION
# LABEL/ID_CASE_NOT_ALLOW_TO_BE_CREATED_DUE_TO_THE_PROCESS_IS_INACTIVE
#: LABEL/ID_CASE_NOT_ALLOW_TO_BE_CREATED_DUE_TO_THE_PROCESS_IS_INACTIVE
msgid "Case not allow to be created due to the process is inactive"
msgstr "Case not allow to be created due to the process is inactive"
# TRANSLATION
# LABEL/ID_CASE_NOT_EXISTS
#: LABEL/ID_CASE_NOT_EXISTS

View File

@@ -57484,6 +57484,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ) VALUES
( 'LABEL','ID_CASE_NOTES_MORE','en','Show more notes','2014-01-15') ,
( 'LABEL','ID_CASE_NOT_ALLOW_TO_BE_CREATED_DUE_TO_THE_PROCESS_IS_INACTIVE','en','Case not allow to be created due to the process is inactive','2021-03-05') ,
( 'LABEL','ID_CASE_NOT_EXISTS','en','The case does not exist','2014-01-15') ,
( 'LABEL','ID_CASE_NOT_OPEN','en','This case is not open','2014-01-15') ,
( 'LABEL','ID_CASE_NOT_PAUSED','en','Case with "{0}" not paused.','2015-08-14') ,

View File

@@ -1,5 +1,7 @@
<?php
use ProcessMaker\Model\Process;
/**
* cases_Open.php
*
@@ -78,6 +80,15 @@ try {
//loading application data
$fieldCase = $caseInstance->loadCase($appUid, $delIndex);
if (!Process::isActive($fieldCase['PRO_UID'], 'PRO_UID')) {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', [
'MESSAGE' => G::LoadTranslation('ID_THE_WEBSITE_CAN_NOT_BE_REACHED')
]);
G::RenderPage('publish', 'blank');
exit();
}
if (!isset($_SESSION['CURRENT_TASK'])) {
$_SESSION['CURRENT_TASK'] = $fieldCase['TAS_UID'];
} elseif ($_SESSION['CURRENT_TASK'] == '') {

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Model\Process as ProcessModel;
use ProcessMaker\Validation\ValidationUploadedFiles;
//validate the data post
@@ -104,6 +105,15 @@ try {
$oCase = new Cases();
$oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs" );
$Fields = $oCase->loadCase( $_SESSION["APPLICATION"] );
if (!ProcessModel::isActive($Fields['PRO_UID'], 'PRO_UID')) {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', [
'MESSAGE' => G::LoadTranslation('ID_CASE_NOT_ALLOW_TO_BE_CREATED_DUE_TO_THE_PROCESS_IS_INACTIVE')
]);
G::RenderPage('publish', 'blank');
exit();
}
if ($swpmdynaform) {
$dataFields = $Fields["APP_DATA"];

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Model\Process as ProcessModel;
use ProcessMaker\Plugins\PluginRegistry;
use ProcessMaker\Util\DateTime;
@@ -73,28 +74,6 @@ if ($delegation->alreadyRouted($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
. '</script>');
}
}
/**
* cases_Step.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 */
switch ($RBAC->userCanAccess('PM_CASES')) {
@@ -163,6 +142,16 @@ $oStep = new Step();
$bmWebEntry = new \ProcessMaker\BusinessModel\WebEntry;
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
if (!ProcessModel::isActive($Fields['PRO_UID'], 'PRO_UID')) {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', [
'MESSAGE' => G::LoadTranslation('ID_CASE_NOT_ALLOW_TO_BE_CREATED_DUE_TO_THE_PROCESS_IS_INACTIVE')
]);
G::RenderPage('publish', 'blank');
exit();
}
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants());
$sStatus = $Fields['APP_STATUS'];