PMCORE-965

This commit is contained in:
Paula Quispe
2021-08-04 16:13:22 -04:00
parent ec7b157c00
commit bda8f1d4ec
9 changed files with 23 additions and 159 deletions

View File

@@ -409,11 +409,7 @@ class RBAC
"PER_CODE" => "PM_SETUP_CLEAR_CACHE", "PER_CODE" => "PM_SETUP_CLEAR_CACHE",
"PER_NAME" => "Setup Clear Cache" "PER_NAME" => "Setup Clear Cache"
], ],
[ // The 00000000000000000000000000000025 was deleted related to the heart beat
"PER_UID" => "00000000000000000000000000000025",
"PER_CODE" => "PM_SETUP_HEART_BEAT",
"PER_NAME" => "Setup Heart Beat"
],
[ [
"PER_UID" => "00000000000000000000000000000026", "PER_UID" => "00000000000000000000000000000026",
"PER_CODE" => "PM_SETUP_ENVIRONMENT", "PER_CODE" => "PM_SETUP_ENVIRONMENT",

View File

@@ -23,7 +23,6 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES
('00000000000000000000000000000022','PM_SETUP_CALENDAR','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000022','PM_SETUP_CALENDAR','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000023','PM_SETUP_PROCESS_CATEGORIES','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000023','PM_SETUP_PROCESS_CATEGORIES','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000024','PM_SETUP_CLEAR_CACHE','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000024','PM_SETUP_CLEAR_CACHE','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000025','PM_SETUP_HEART_BEAT','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000026','PM_SETUP_ENVIRONMENT','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000026','PM_SETUP_ENVIRONMENT','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000027','PM_SETUP_PM_TABLES','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000027','PM_SETUP_PM_TABLES','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000028','PM_SETUP_LOGIN','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000028','PM_SETUP_LOGIN','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
@@ -105,7 +104,6 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
('00000000000000000000000000000002','00000000000000000000000000000022'), ('00000000000000000000000000000002','00000000000000000000000000000022'),
('00000000000000000000000000000002','00000000000000000000000000000023'), ('00000000000000000000000000000002','00000000000000000000000000000023'),
('00000000000000000000000000000002','00000000000000000000000000000024'), ('00000000000000000000000000000002','00000000000000000000000000000024'),
('00000000000000000000000000000002','00000000000000000000000000000025'),
('00000000000000000000000000000002','00000000000000000000000000000026'), ('00000000000000000000000000000002','00000000000000000000000000000026'),
('00000000000000000000000000000002','00000000000000000000000000000027'), ('00000000000000000000000000000002','00000000000000000000000000000027'),
('00000000000000000000000000000002','00000000000000000000000000000028'), ('00000000000000000000000000000002','00000000000000000000000000000028'),
@@ -187,7 +185,6 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
('00000000000000000000000000000004','00000000000000000000000000000022'), ('00000000000000000000000000000004','00000000000000000000000000000022'),
('00000000000000000000000000000004','00000000000000000000000000000023'), ('00000000000000000000000000000004','00000000000000000000000000000023'),
('00000000000000000000000000000004','00000000000000000000000000000024'), ('00000000000000000000000000000004','00000000000000000000000000000024'),
('00000000000000000000000000000004','00000000000000000000000000000025'),
('00000000000000000000000000000004','00000000000000000000000000000026'), ('00000000000000000000000000000004','00000000000000000000000000000026'),
('00000000000000000000000000000004','00000000000000000000000000000027'), ('00000000000000000000000000000004','00000000000000000000000000000027'),
('00000000000000000000000000000004','00000000000000000000000000000028'), ('00000000000000000000000000000004','00000000000000000000000000000028'),

View File

@@ -3325,6 +3325,8 @@ class WorkspaceTools
*/ */
public function checkRbacPermissions() public function checkRbacPermissions()
{ {
CLI::logging("-> Remove the permissions depreacated in RBAC \n");
$this->removePermission();
CLI::logging("-> Verifying roles permissions in RBAC \n"); CLI::logging("-> Verifying roles permissions in RBAC \n");
//Update table RBAC permissions //Update table RBAC permissions
$RBAC = RBAC::getSingleton(); $RBAC = RBAC::getSingleton();
@@ -4079,6 +4081,26 @@ class WorkspaceTools
CLI::logging(" Migrating Self-Service by Value Cases Done \n"); CLI::logging(" Migrating Self-Service by Value Cases Done \n");
} }
/**
* Remove the permissions deprecated
*/
public function removePermission()
{
// Initializing
$this->initPropel(true);
$con = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
// Remove the permission PM_SETUP_HEART_BEAT
CLI::logging("-> Remove permission PM_SETUP_HEART_BEAT \n");
$con->begin();
$stmt = $con->createStatement();
$rs = $stmt->executeQuery("DELETE FROM RBAC_ROLES_PERMISSIONS WHERE PER_UID = '00000000000000000000000000000025'");
$con->commit();
$con->begin();
$stmt = $con->createStatement();
$rs = $stmt->executeQuery("DELETE FROM RBAC_PERMISSIONS WHERE PER_UID = '00000000000000000000000000000025'");
$con->commit();
}
/** /**
* Populate new fields used for avoiding the use of the "APP_CACHE_VIEW" table * Populate new fields used for avoiding the use of the "APP_CACHE_VIEW" table
*/ */

View File

@@ -43785,42 +43785,6 @@ msgstr ""
msgid "[setup/plugin_ListOptions.xml?MNU_IMPORT] Import" msgid "[setup/plugin_ListOptions.xml?MNU_IMPORT] Import"
msgstr "Import" msgstr "Import"
# setup/processHeartBeatConfig.xml?HB_TITLE
# setup/processHeartBeatConfig.xml
#: title - HB_TITLE
msgid "Processmaker Heartbeat"
msgstr "Processmaker Heartbeat"
# setup/processHeartBeatConfig.xml?HB_OPTION
# setup/processHeartBeatConfig.xml
#: dropdown - HB_OPTION
msgid "Enable Heartbeat"
msgstr "Enable Heartbeat"
# setup/processHeartBeatConfig.xml?HB_OPTION-0
# setup/processHeartBeatConfig.xml
#: dropdown - HB_OPTION - 0
msgid "[setup/processHeartBeatConfig.xml?HB_OPTION-0]"
msgstr "No"
# setup/processHeartBeatConfig.xml?HB_OPTION-1
# setup/processHeartBeatConfig.xml
#: dropdown - HB_OPTION - 1
msgid "[setup/processHeartBeatConfig.xml?HB_OPTION-1]"
msgstr "Yes"
# setup/processHeartBeatConfig.xml?HB_SAVE
# setup/processHeartBeatConfig.xml
#: button - HB_SAVE
msgid "[setup/processHeartBeatConfig.xml?HB_SAVE] save"
msgstr "save"
# setup/processHeartBeatConfig.xml?HB_LINKINFO
# setup/processHeartBeatConfig.xml
#: link - HB_LINKINFO
msgid "[setup/processHeartBeatConfig.xml?HB_LINKINFO] Read Online Documentation"
msgstr "Read Online Documentation"
# setup/showMessage.xml?TITLE # setup/showMessage.xml?TITLE
# setup/showMessage.xml # setup/showMessage.xml
#: title - TITLE #: title - TITLE

View File

@@ -30,7 +30,6 @@ INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES
('PER_NAME','','00000000000000000000000000000022','en','Setup Calendar'), ('PER_NAME','','00000000000000000000000000000022','en','Setup Calendar'),
('PER_NAME','','00000000000000000000000000000023','en','Setup Process Categories'), ('PER_NAME','','00000000000000000000000000000023','en','Setup Process Categories'),
('PER_NAME','','00000000000000000000000000000024','en','Setup Clear Cache'), ('PER_NAME','','00000000000000000000000000000024','en','Setup Clear Cache'),
('PER_NAME','','00000000000000000000000000000025','en','Setup Heart Beat'),
('PER_NAME','','00000000000000000000000000000026','en','Setup Environment'), ('PER_NAME','','00000000000000000000000000000026','en','Setup Environment'),
('PER_NAME','','00000000000000000000000000000027','en','Setup PM Tables'), ('PER_NAME','','00000000000000000000000000000027','en','Setup PM Tables'),
('PER_NAME','','00000000000000000000000000000028','en','Setup Login'), ('PER_NAME','','00000000000000000000000000000028','en','Setup Login'),

View File

@@ -71,16 +71,6 @@ if ($RBAC->userCanAccess('PM_SETUP') === 1) {
* Remove heartbeat config from core, it will probably be used again * Remove heartbeat config from core, it will probably be used again
* when the functionality will be redesigned. * when the functionality will be redesigned.
*/ */
if ($RBAC->userCanAccess('PM_SETUP_HEART_BEAT') === 1 && false) {
$G_TMP_MENU->AddIdRawOption(
'HEARTBEAT',
'processHeartBeatConfig',
G::LoadTranslation('ID_HEARTBEAT_CONFIG'),
'heartBeat.jpg',
'',
'settings'
);
}
} }
if ($RBAC->userCanAccess('PM_SETUP_ENVIRONMENT') === 1) { if ($RBAC->userCanAccess('PM_SETUP_ENVIRONMENT') === 1) {
$G_TMP_MENU->AddIdRawOption( $G_TMP_MENU->AddIdRawOption(

View File

@@ -1,38 +0,0 @@
<?php
/**
* main.php Cases List main processor
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 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.
*/
global $RBAC;
$RBAC->requirePermissions('PM_SETUP', 'PM_SETUP_HEART_BEAT');
$oHeadPublisher = headPublisher::getSingleton();
$oServerConf = ServerConf::getSingleton();
//you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
$heartBeatChecked = $sflag == 1 ? true : false;
$oHeadPublisher->addExtJsScript('setup/processHeartBeatConfig', true); //adding a javascript file .js
$oHeadPublisher->assign('heartBeatChecked', $heartBeatChecked);
G::RenderPage('publish', 'extJs');

View File

@@ -1,44 +0,0 @@
<form id="{$form_id}" name="{$form_name}" action="{$form_action}" class="{$form_className}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit="return validateForm('{$form_objectRequiredFields}');"> <div class="borderForm" style="width:{$form_width}; padding-left:0; padding-right:0; border-width:{$form_border};">
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="content" style="height:{$form_height};" >
<table width="99%">
<tr>
<td valign='top'>
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class='FormTitle' colspan="2" align="">
<table width="100%"><tr><td width="50%" class='FormTitle'>{$form.HB_TITLE} </td><td align="right" >{$form.HB_LINKINFO}</td></tr></table>
</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$HB_OPTION}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.HB_OPTION} </td> //-->
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.HB_OPTION}</td>
</tr>
<tr>
<td class='FormButton' colspan="2" align="center">{$form.HB_SAVE}</td>
</tr>
<tr>
<!-- <td class='FormLabel' width="{$form_labelWidth}">{$HB_LINKINFO}</td> //-->
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.HB_LINKINFO} </td> //-->
<!-- <td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.HB_LINKINFO}</td> -->
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</div>
<script type="text/javascript">
{$form.HB_JS}
</script>
</form>
<script type="text/javascript">
try {literal}{{/literal} dynaformSetFocus();}catch(e){literal}{{/literal}}
</script>

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="ProcessHeartBeatConfig" width="55%" enableTemplate="1">
<HB_TITLE type="title" enablehtml="0" btn_cancel="Cancel" enableHTML="1">
<en><![CDATA[Processmaker Heartbeat]]></en>
</HB_TITLE>
<HB_OPTION type="dropdown" required="0" readonly="0" savelabel="0" mode="edit" options="Array">
<en><![CDATA[Enable Heartbeat]]><option name="0"><![CDATA[No]]></option><option name="1"><![CDATA[Yes]]></option></en>
</HB_OPTION>
<HB_SAVE type="button" onclick="sendValues(this.form);">
<en><![CDATA[save]]></en>
</HB_SAVE>
<HB_LINKINFO type="link" colWidth="60" titleAlign="left" align="left" link="#" onclick="var k=window.open('http://wiki.processmaker.com/index.php/Heartbeat ','_blank');return false;">
<en><![CDATA[Read Online Documentation]]></en>
</HB_LINKINFO>
<HB_JS type="javascript">
var sendValues=function(form){
var hbOption = getField('HB_OPTION').value;
ajax_function('processHeartBeatSave','','HB_OPTION='+hbOption,'POST') ;
window.location = 'processHeartBeatConfig';
};
</HB_JS>
</dynaForm>