Issue 122 - Remove App Cache View

This commit is contained in:
Fernando Ontiveros
2025-07-02 11:59:56 -04:00
parent 615f0ff5a0
commit bc9ad2a59b
32 changed files with 906 additions and 8771 deletions

View File

@@ -2,8 +2,6 @@
namespace ProcessMaker\BusinessModel;
use AppCacheView;
use AppCacheViewPeer;
use AppDelay;
use AppDelayPeer;
use AppDelegation;
@@ -263,23 +261,8 @@ class Cases
*/
public function getListCounters($userUid, array $arrayType)
{
try {
$appCacheView = new AppCacheView();
if ($this->isSolrEnabled()) {
$arrayListCounter = array_merge(
$this->solr->getCasesCount($userUid),
$appCacheView->getAllCounters(['completed', 'cancelled'], $userUid)
);
} else {
$arrayListCounter = $appCacheView->getAllCounters($arrayType, $userUid);
}
//Return
return $arrayListCounter;
} catch (Exception $e) {
throw $e;
}
$arrayListCounter=[]; // this is a placeholder, Appcache view is deprecated.
return $arrayListCounter;
}
/**
@@ -691,7 +674,7 @@ class Cases
*
* @param string $applicationUid Unique Case Id
* @param string $userUid Unique User Id
*
*
* @return array Return an array with information of Cases
* @throws Exception
*/
@@ -2821,7 +2804,7 @@ class Cases
$data = ClassesCases::unserializeData($fields->APP_DATA);
$row = [];
if (!empty($data[$variable])) {
foreach ($data[$variable] as $uid) {
$group = Groupwf::where('GRP_UID', '=', $uid)->first();
@@ -2835,7 +2818,7 @@ class Cases
}
}
}
$users = [];
foreach ($row as $data) {
$obj = User::where('USR_UID', '=', $data)->Active()->first();
@@ -3806,7 +3789,7 @@ class Cases
* @param array $columnsList, the list of columns in the table
* @param string $format, the user display format
* @param string $prefix, the initial name of the columns related to the USR_FIRSTNAME USR_LASTNAME USR_USERNAME
*
*
* @return array $columnSort, columns by apply the sql command ORDER BY
*/
public function buildOrderFieldFormatted($columnsList, $format, $prefix = 'DEL_PREVIOUS_', $validate = true)
@@ -4109,7 +4092,7 @@ class Cases
*/
public function sendMail($appUid, $userUid, $note, $sendMail = false, $toUser = '')
{
$appNumber = ModelApplication::getCaseNumber($appUid);
// Register the note
@@ -4124,12 +4107,12 @@ class Cases
"NOTE_RECIPIENTS" => ""
];
$newNote = Notes::create($attributes);
// Send the email
if ($sendMail) {
// Get the FK
$noteId = $newNote->NOTE_ID;
$note = G::LoadTranslation('ID_ASSIGN_NOTIFICATION', [$appNumber]) . '<br />' . G::LoadTranslation('ID_REASON') . ': ' . stripslashes($note);
// Send the notification
@@ -4513,7 +4496,7 @@ class Cases
// Return results
return $dynaForms;
}
/**
* Get objects that they have send it.
* @param string $appUid

View File

@@ -15,7 +15,7 @@ class Dashboard {
* @param string $usr_uid Unique id of User
*
* return uid
*
*
* @author Jenny Murillo <jennylee@colosa.com>
*/
public function getDashboardsUidByUser($usr_uid)
@@ -82,7 +82,7 @@ class Dashboard {
{
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardDasInd.php");
$oDashboardDasInd = new \DashboardDasInd();
$response = $oDashboardDasInd->loadByDashboards($das_uid);
return $response;
}
@@ -116,12 +116,12 @@ class Dashboard {
{
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardIndicator.php");
$oDashboardIndicator = new \DashboardIndicator();
$response = $oDashboardIndicator->load($dasInd_uid);
return $response;
}
/**
* Get dashboard indicators by das_uid
*
@@ -141,7 +141,7 @@ class Dashboard {
$response = $oDashboardIndicator->loadbyDasUid($das_uid, $dateIni, $dateFin, $usrUid);
return $response;
}
/**
* Get list All dashboards
*
@@ -185,10 +185,6 @@ class Dashboard {
if ($sort != 'DASHBOARD.DAS_TITLE') {
$sort = G::toUpper($sort);
$columnsAppCacheView = DashboardPeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);
if (!(in_array($sort, $columnsAppCacheView))) {
$sort = 'APP_CACHE_VIEW.APP_NUMBER';
}
}
$dir = G::toUpper($dir);
if (!($dir == 'DESC' || $dir == 'ASC')) {
@@ -268,15 +264,15 @@ class Dashboard {
$response['owner'] = $result['data'];
}
return $response;
}
}
/**
* Create Dashboard
* Create Dashboard
*
* @param array $arrayData Data
*
* return id new Dashboard created
*
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
*/
public function createDashboard($arrayData)
@@ -293,7 +289,7 @@ class Dashboard {
* @param string $usr_uid
*
* return void
*
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
*/
public function deletedashboard($das_uid, $usr_uid)
@@ -309,7 +305,7 @@ class Dashboard {
* @param array $arrayData Data
*
* return id new Owner created
*
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
*/
public function createOwner($arrayData)
@@ -322,12 +318,12 @@ class Dashboard {
/**
* Delete Dashboard owner
*
* @param string $das_uid
* @param string $das_uid
* @param string $owner_uid
* * @param string $usr_uid
*
* return void
*
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
*/
public function deleteDashboardOwner($das_uid, $owner_uid, $usr_uid)
@@ -343,7 +339,7 @@ class Dashboard {
* @param array $arrayData Data
*
* return id new Indicator created
*
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
*/
public function createIndicator($arrayData)
@@ -360,7 +356,7 @@ class Dashboard {
* @param string $usr_uid
*
* return void
*
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
*/
public function delete($das_ind_uid, $usr_uid)
@@ -369,7 +365,7 @@ class Dashboard {
$response = $dashboard->remove($das_ind_uid, $usr_uid);
return $response;
}
/**
* Post Dashboards User Configuration
*
@@ -383,7 +379,7 @@ class Dashboard {
public function postConfigByUsr($arrayData, $usrUid)
{
$cnfgData[$arrayData['dashId']] = $arrayData;
$data['CFG_UID'] = 'DASHBOARDS_SETTINGS';
$data['OBJ_UID'] = '';
$data['CFG_VALUE'] = serialize($cnfgData);
@@ -392,11 +388,11 @@ class Dashboard {
$data['APP_UID'] = "";
$oConfig = new \Configuration();
$response = $oConfig->create($data);
return $response;
}
/**
* Get Dashboard configuration by UserUid
*
@@ -409,16 +405,16 @@ class Dashboard {
public function getConfig($usr_uid)
{
$oConfig = new \Configuration();
$response = array();
if($oConfig->exists('DASHBOARDS_SETTINGS', '', '', $usr_uid, '') == true){
$data = $oConfig->load('DASHBOARDS_SETTINGS', '', '', $usr_uid, '');
$response = unserialize($data['CFG_VALUE']);
}
return $response;
}
/**
* Put Dashboard configuration by UserUid
*
@@ -432,7 +428,7 @@ class Dashboard {
public function putConfigByUsr($arrayData, $usrUid)
{
$oConfig = new \Configuration();
$cnfgData = array();
if($oConfig->exists('DASHBOARDS_SETTINGS', '', '', $usrUid, '') == true){
$data = $oConfig->load('DASHBOARDS_SETTINGS', '', '', $usrUid, '');
@@ -461,4 +457,3 @@ class Dashboard {
return $response;
}
}

View File

@@ -2,7 +2,6 @@
namespace ProcessMaker\BusinessModel;
use AppCacheView;
use AppDelegation;
use AppDelayPeer;
use AppDelegationPeer;
@@ -197,7 +196,6 @@ class Light
{
try {
$userUid = (isset($userId) && $userId != '') ? $userId : null;
$oAppCache = new AppCacheView();
$aTypes = array();
$aTypes['to_do'] = 'toDo';
@@ -208,7 +206,7 @@ class Light
$aTypes['completed'] = 'completed';
$aTypes['selfservice'] = 'unassigned';
$aCount = $oAppCache->getAllCounters(array_keys($aTypes), $userUid);
$aCount = []; // this is a placeholder because appcacheview is deprecated
$response = array();
foreach ($aCount as $type => $count) {
@@ -1383,7 +1381,7 @@ class Light
public function getConfiguration($params)
{
$response = [];
$sysConf = Bootstrap::getSystemConfiguration('', '', config("system.workspace"));
$multiTimeZone = (int) ($sysConf['system_utc_time_zone']) == 1;

View File

@@ -2,7 +2,6 @@
namespace ProcessMaker\BusinessModel;
use AppCacheView;
use ApplicationPeer;
use BasePeer;
use Bootstrap;
@@ -1482,7 +1481,7 @@ class User
//Query
$criteria = $this->getUserCriteria();
//Remove the guest user
//Remove the guest user
$criteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
if ($flagCondition && !empty($arrayWhere['condition'])) {
@@ -1886,7 +1885,7 @@ class User
}
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
//Remove the guest user
//Remove the guest user
$oCriteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
if ($authSource != '') {
@@ -1974,7 +1973,6 @@ class User
//Get cases
$oParticipated = new ListParticipatedLast();
$oAppCache = new AppCacheView();
$rows = array();
$uRole = array();
@@ -1994,7 +1992,7 @@ class User
$row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['ROL_CODE']) : $uRole['ROL_CODE'];
$total = $oParticipated->getCountList($row['USR_UID']);
$row['TOTAL_CASES'] = $total;
$row['DUE_DATE_OK'] = (date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE']))) ? 0 : 1;
@@ -2062,17 +2060,17 @@ class User
}
/**
* It changes the password of the user specified by its identifier, optionally
* the value of $userLang can be sent, otherwise the system value is taken.
* It changes the password of the user specified by its identifier, optionally
* the value of $userLang can be sent, otherwise the system value is taken.
* In case of success, the updated user returns.
*
*
* @global object $RBAC
* @param string $usrUid
* @param string $usrPassword
* @param string $userLang
*
*
* @return string
*
*
* @see workflow/engine/methods/login/authentication.php
* @see workflow/engine/methods/login/changePassword.php
* @link https://wiki.processmaker.com/3.0/Managing_Users#Creating_New_Users

View File

@@ -2,9 +2,7 @@
namespace ProcessMaker\Core;
use AppCacheView;
use Archive_Tar;
use Bootstrap;
use Configuration;
use Exception;
use G;
@@ -245,15 +243,6 @@ class Installer
$this->log($qrv, isset($qrv['errors']));
require_once("propel/Propel.php");
require_once('classes/model/AppCacheView.php');
$appCache = new AppCacheView();
$appCache->setPathToAppCacheFiles(PATH_METHODS . 'setup/setupSchemas/');
$triggers = $appCache->getTriggers('en');
$this->log("Create 'cases list cache' triggers");
foreach ($triggers as $triggerName => $trigger) {
$this->runTrigger($trigger, "-> Trigger $triggerName");
}
$path_site = $this->options['path_data'] . '/sites/' . $this->options['name'] . '/';
@@ -270,19 +259,19 @@ class Installer
$password = $this->cc_status === 1 ? $this->options['password'] : $this->options['database']['password'];
$db_file = $path_site . 'db.php';
$db_text = "<?php\n"
. "// Processmaker configuration\n"
. " define ('DB_ADAPTER', 'mysql' );\n"
. " define ('DB_HOST', '" . $hostname . "' );\n"
. " define ('DB_NAME', '" . $wf . "' );\n"
. " define ('DB_USER', '" . $username . "' );\n"
. " define ('DB_PASS', '" . $password . "' );\n"
. " define ('DB_RBAC_HOST', '" . $hostname . "' );\n"
. " define ('DB_RBAC_NAME', '" . $rb . "' );\n"
. " define ('DB_RBAC_USER', '" . $username . "' );\n"
. " define ('DB_RBAC_PASS', '" . $password . "' );\n"
. " define ('DB_REPORT_HOST', '" . $hostname . "' );\n"
. " define ('DB_REPORT_NAME', '" . $rp . "' );\n"
. " define ('DB_REPORT_USER', '" . $username . "' );\n"
. "// Processmaker configuration\n"
. " define ('DB_ADAPTER', 'mysql' );\n"
. " define ('DB_HOST', '" . $hostname . "' );\n"
. " define ('DB_NAME', '" . $wf . "' );\n"
. " define ('DB_USER', '" . $username . "' );\n"
. " define ('DB_PASS', '" . $password . "' );\n"
. " define ('DB_RBAC_HOST', '" . $hostname . "' );\n"
. " define ('DB_RBAC_NAME', '" . $rb . "' );\n"
. " define ('DB_RBAC_USER', '" . $username . "' );\n"
. " define ('DB_RBAC_PASS', '" . $password . "' );\n"
. " define ('DB_REPORT_HOST', '" . $hostname . "' );\n"
. " define ('DB_REPORT_NAME', '" . $rp . "' );\n"
. " define ('DB_REPORT_USER', '" . $username . "' );\n"
. " define ('DB_REPORT_PASS', '" . $password . "' );\n"
. "";