PMC-973
This commit is contained in:
30
workflow/engine/classes/Configurations.php
Normal file → Executable file
30
workflow/engine/classes/Configurations.php
Normal file → Executable file
@@ -612,6 +612,36 @@ class Configurations // extends Configuration
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the values stored in the USER_PREFERENCES
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $userUid
|
||||
* @param string $listName
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getUserPreferences($key = null, $userUid = null, $listName = 'advanced')
|
||||
{
|
||||
$this->loadConfig($obj, 'USER_PREFERENCES', '', '', $userUid, '');
|
||||
|
||||
if (isset($key)) {
|
||||
if (isset($this->aConfig[$key])) {
|
||||
if (isset($data) && is_array($data)) {
|
||||
foreach ($data as $k => $v) {
|
||||
$this->aConfig[$key] = str_replace('@' . $k, $v, $this->aConfig[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->aConfig[$key];
|
||||
} else {
|
||||
return [$listName => []];
|
||||
}
|
||||
} else {
|
||||
return $this->aConfig;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default fields and configuration for the cases list
|
||||
*
|
||||
|
||||
6
workflow/engine/content/translations/english/processmaker.en.po
Normal file → Executable file
6
workflow/engine/content/translations/english/processmaker.en.po
Normal file → Executable file
@@ -22787,6 +22787,12 @@ msgstr "Result"
|
||||
msgid "[LABEL/ID_RESUME] Resume"
|
||||
msgstr "Resume"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_RETURN_ADVANCED_SEARCH
|
||||
#: LABEL/ID_RETURN_ADVANCED_SEARCH
|
||||
msgid "Return"
|
||||
msgstr "Return"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_RIGHT
|
||||
#: LABEL/ID_RIGHT
|
||||
|
||||
1
workflow/engine/data/mysql/insert.sql
Normal file → Executable file
1
workflow/engine/data/mysql/insert.sql
Normal file → Executable file
@@ -60681,6 +60681,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_RESTORING_CASE','en','Restoring case','2015-09-15') ,
|
||||
( 'LABEL','ID_RESULT','en','Result','2014-01-15') ,
|
||||
( 'LABEL','ID_RESUME','en','Resume','2014-01-15') ,
|
||||
( 'LABEL','ID_RETURN_ADVANCED_SEARCH','en','Return','2019-07-17') ,
|
||||
( 'LABEL','ID_RIGHT','en','right','2014-09-18') ,
|
||||
( 'LABEL','ID_RIGHT_MARGIN','en','Right Margin','2014-01-15') ,
|
||||
( 'LABEL','ID_ROLE','en','Role','2014-01-15') ,
|
||||
|
||||
8
workflow/engine/menus/caseOptions.php
Normal file → Executable file
8
workflow/engine/menus/caseOptions.php
Normal file → Executable file
@@ -14,9 +14,9 @@ global $RBAC;
|
||||
|
||||
$viewSteps = true;
|
||||
$statusSendAndUnassigned = false;
|
||||
|
||||
$listName = $_SESSION['actionCaseOptions'];
|
||||
//caseOptions
|
||||
switch ($_SESSION['actionCaseOptions']) {
|
||||
switch ($listName) {
|
||||
case 'todo':
|
||||
case 'draft':
|
||||
if (isset($_SESSION['bNoShowSteps'])) {
|
||||
@@ -73,3 +73,7 @@ if ((($sStatus === 'DRAFT') || ($sStatus === 'TO_DO')) && !$statusSendAndUnassig
|
||||
}
|
||||
//Menu: Cases Notes
|
||||
$G_TMP_MENU->AddIdOption('NOTES', G::LoadTranslation('ID_NOTES'), 'javascript:showNotes();', 'absolute');
|
||||
//Menu: Return to advanced search button
|
||||
if ($listName === 'search'){
|
||||
$G_TMP_MENU->AddIdOption('RETURN_ADVANCED_SEARCH', G::LoadTranslation('ID_RETURN_ADVANCED_SEARCH'), 'javascript:showReturnAdvancedSearch();', 'absolute');
|
||||
}
|
||||
|
||||
376
workflow/engine/methods/cases/casesListExtJs.php
Normal file → Executable file
376
workflow/engine/methods/cases/casesListExtJs.php
Normal file → Executable file
@@ -1,5 +1,11 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* casesListExtJs.php
|
||||
*
|
||||
* Prepare the value of variables required for show the cases list and advanced search
|
||||
*/
|
||||
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
@@ -59,8 +65,8 @@ switch ($action) {
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
// oHeadPublisher->setExtSkin( 'xtheme-blue');
|
||||
$headPublisher = headPublisher::getSingleton();
|
||||
|
||||
//get the configuration for this action
|
||||
$conf = new Configurations();
|
||||
try {
|
||||
@@ -72,12 +78,12 @@ try {
|
||||
$aditionalTable = new AdditionalTables();
|
||||
$table = $aditionalTable->load($confCasesList['PMTable']);
|
||||
}
|
||||
$confCasesList = ($table != null) ? $confCasesList : array();
|
||||
$confCasesList = ($table != null) ? $confCasesList : [];
|
||||
|
||||
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
} catch (Exception $e) {
|
||||
$confCasesList = array();
|
||||
$generalConfCasesList = array();
|
||||
$confCasesList = [];
|
||||
$generalConfCasesList = [];
|
||||
}
|
||||
|
||||
// reassign header configuration
|
||||
@@ -105,15 +111,8 @@ if (isset($generalConfCasesList['casesListDateFormat']) && ! empty($generalConfC
|
||||
$dateFormat = $config['dateformat'];
|
||||
}
|
||||
|
||||
if ($action == 'draft') {
|
||||
//array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'deleteLink' ) );
|
||||
}
|
||||
if ($action == 'selfservice') {
|
||||
array_unshift($columns, array('header' => '','width' => 50,'sortable' => false,'id' => 'viewLink'));
|
||||
}
|
||||
|
||||
if ($action == 'paused') {
|
||||
//array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'unpauseLink' ) );
|
||||
array_unshift($columns, ['header' => '','width' => 50,'sortable' => false,'id' => 'viewLink']);
|
||||
}
|
||||
|
||||
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||
@@ -136,45 +135,44 @@ if ($action == "todo" || $action == "draft" || $action == "sent" || $action == "
|
||||
}
|
||||
|
||||
//get values for the comboBoxes
|
||||
$processes[] = array('', G::LoadTranslation('ID_ALL_PROCESS'));
|
||||
$status = getStatusArray($action, $userUid);
|
||||
$processes[] = ['', G::LoadTranslation('ID_ALL_PROCESS')];
|
||||
$status = getStatusArray($action);
|
||||
$category = getCategoryArray();
|
||||
$columnToSearch = getColumnsSearchArray();
|
||||
$oHeadPublisher->assign('reassignReaderFields', $reassignReaderFields); //sending the fields to get from proxy
|
||||
$oHeadPublisher->addExtJsScript('cases/reassignList', false);
|
||||
$headPublisher->assign('reassignReaderFields', $reassignReaderFields); //sending the fields to get from proxy
|
||||
$headPublisher->addExtJsScript('cases/reassignList', false);
|
||||
$enableEnterprise = false;
|
||||
if (class_exists('enterprisePlugin')) {
|
||||
$enableEnterprise = true;
|
||||
$oHeadPublisher->addExtJsScript(PATH_PLUGINS . "enterprise" . PATH_SEP . "advancedTools" . PATH_SEP, false, true);
|
||||
$headPublisher->addExtJsScript(PATH_PLUGINS . "enterprise" . PATH_SEP . "advancedTools" . PATH_SEP, false, true);
|
||||
}
|
||||
|
||||
$oHeadPublisher->assign('pageSize', $pageSize); //sending the page size
|
||||
$oHeadPublisher->assign('columns', $columns); //sending the columns to display in grid
|
||||
$oHeadPublisher->assign('readerFields', $readerFields); //sending the fields to get from proxy
|
||||
$oHeadPublisher->assign('reassignColumns', $reassignColumns); //sending the columns to display in grid
|
||||
$oHeadPublisher->assign('action', $action); //sending the action to make
|
||||
$oHeadPublisher->assign('urlProxy', $urlProxy); //sending the urlProxy to make
|
||||
$oHeadPublisher->assign('PMDateFormat', $dateFormat); //sending the fields to get from proxy
|
||||
$oHeadPublisher->assign('statusValues', $status); //Sending the listing of status
|
||||
$oHeadPublisher->assign('processValues', $processes); //Sending the listing of processes
|
||||
$oHeadPublisher->assign('categoryValues', $category); //Sending the listing of categories
|
||||
$oHeadPublisher->assign('solrEnabled', $solrEnabled); //Sending the status of solar
|
||||
$oHeadPublisher->assign('enableEnterprise', $enableEnterprise); //sending the page size
|
||||
$oHeadPublisher->assign('columnSearchValues', $columnToSearch); //Sending the list of column for search: caseTitle, caseNumber, tasTitle
|
||||
//Get user preferences
|
||||
$filters = $conf->getUserPreferences('FILTERS', $userUid);
|
||||
|
||||
$headPublisher->assign('pageSize', $pageSize); //sending the page size
|
||||
$headPublisher->assign('columns', $columns); //sending the columns to display in grid
|
||||
$headPublisher->assign('readerFields', $readerFields); //sending the fields to get from proxy
|
||||
$headPublisher->assign('reassignColumns', $reassignColumns); //sending the columns to display in grid
|
||||
$headPublisher->assign('action', $action); //sending the action to make
|
||||
$headPublisher->assign('urlProxy', $urlProxy); //sending the urlProxy to make
|
||||
$headPublisher->assign('PMDateFormat', $dateFormat); //sending the fields to get from proxy
|
||||
$headPublisher->assign('statusValues', $status); //Sending the listing of status
|
||||
$headPublisher->assign('processValues', $processes); //Sending the listing of processes
|
||||
$headPublisher->assign('categoryValues', $category); //Sending the listing of categories
|
||||
$headPublisher->assign('solrEnabled', $solrEnabled); //Sending the status of solar
|
||||
$headPublisher->assign('enableEnterprise', $enableEnterprise); //sending the page size
|
||||
$headPublisher->assign('columnSearchValues', $columnToSearch); //Sending the list of column for search: caseTitle, caseNumber, tasTitle
|
||||
$headPublisher->assign('filtersValues', $filters); //Sending filters defined
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||
$filterStatus[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
|
||||
$filterStatus[] = array('ON_TIME', G::LoadTranslation('ID_ON_TIME'));
|
||||
$filterStatus[] = array('AT_RISK', G::LoadTranslation('ID_AT_RISK'));
|
||||
$filterStatus[] = array('OVERDUE', G::LoadTranslation('ID_TASK_OVERDUE'));
|
||||
|
||||
$oHeadPublisher->assign('filterStatus', $filterStatus);
|
||||
$taskStatus = getTaskStatus();
|
||||
$headPublisher->assign('filterStatus', $taskStatus);
|
||||
|
||||
if (isset($_COOKIE['dashboardListInbox'])) {
|
||||
$oHeadPublisher->assign('valueFilterStatus', $_COOKIE['dashboardListInbox']);
|
||||
$headPublisher->assign('valueFilterStatus', $_COOKIE['dashboardListInbox']);
|
||||
if (PHP_VERSION < 5.2) {
|
||||
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . config("system.workspace"), "; HttpOnly");
|
||||
} else {
|
||||
@@ -185,24 +183,23 @@ if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjB
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
/** Define actions menu in the cases list */
|
||||
$cnt = '';
|
||||
$reassignCase = ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) ? 'true' : 'false';
|
||||
$reassignCaseSup = ($RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) ? 'true' : 'false';
|
||||
$oHeadPublisher->assign('varReassignCase', $reassignCase);
|
||||
$oHeadPublisher->assign('varReassignCaseSupervisor', $reassignCaseSup);
|
||||
$headPublisher->assign('varReassignCase', $reassignCase);
|
||||
$headPublisher->assign('varReassignCaseSupervisor', $reassignCaseSup);
|
||||
|
||||
$c = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('app/main', true);
|
||||
$oHeadPublisher->addExtJsScript('cases/casesList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesListExtJs'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('FORMATS', $c->getFormats());
|
||||
$oHeadPublisher->assign('userUid', $userUid);
|
||||
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState($userUid));
|
||||
$oHeadPublisher->assign('isIE', Bootstrap::isIE());
|
||||
$oHeadPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);
|
||||
$headPublisher->addExtJsScript('app/main', true);
|
||||
$headPublisher->addExtJsScript('cases/casesList', false); //adding a javascript file .js
|
||||
$headPublisher->addContent('cases/casesListExtJs'); //adding a html file .html.
|
||||
$headPublisher->assign('FORMATS', $c->getFormats());
|
||||
$headPublisher->assign('userUid', $userUid);
|
||||
$headPublisher->assign('extJsViewState', $headPublisher->getExtJsViewState($userUid));
|
||||
$headPublisher->assign('isIE', Bootstrap::isIE());
|
||||
$headPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);
|
||||
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$fromPlugin = $oPluginRegistry->getOpenReassignCallback();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$fromPlugin = $pluginRegistry->getOpenReassignCallback();
|
||||
$jsFunction = false;
|
||||
if (sizeof($fromPlugin)) {
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\OpenReassignCallback $jsFile */
|
||||
@@ -216,15 +213,17 @@ if (sizeof($fromPlugin)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$oHeadPublisher->assign('openReassignCallback', $jsFunction);
|
||||
$headPublisher->assign('openReassignCallback', $jsFunction);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
/**
|
||||
* Return the list of categories
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getCategoryArray()
|
||||
{
|
||||
global $oAppCache;
|
||||
require_once 'classes/model/ProcessCategory.php';
|
||||
$category[] = array("",G::LoadTranslation("ID_ALL_CATEGORIES")
|
||||
);
|
||||
$category[] = ["", G::LoadTranslation("ID_ALL_CATEGORIES")];
|
||||
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
|
||||
@@ -236,118 +235,206 @@ function getCategoryArray()
|
||||
$dataset->next();
|
||||
|
||||
while ($row = $dataset->getRow()) {
|
||||
$category[] = array($row['CATEGORY_UID'],$row['CATEGORY_NAME']);
|
||||
$category[] = [$row['CATEGORY_UID'], $row['CATEGORY_NAME']];
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
return $category;
|
||||
}
|
||||
|
||||
function getStatusArray($action, $userUid)
|
||||
/**
|
||||
* Return the list of task status
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getTaskStatus()
|
||||
{
|
||||
$status = array();
|
||||
$aStatus = Application::$app_status_values;
|
||||
$status[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
|
||||
foreach ($aStatus as $key => $value) {
|
||||
$taskStatus = [];
|
||||
$taskStatus[] = ['', G::LoadTranslation('ID_ALL_STATUS')];
|
||||
$taskStatus[] = ['ON_TIME', G::LoadTranslation('ID_ON_TIME')];
|
||||
$taskStatus[] = ['AT_RISK', G::LoadTranslation('ID_AT_RISK')];
|
||||
$taskStatus[] = ['OVERDUE', G::LoadTranslation('ID_TASK_OVERDUE')];
|
||||
|
||||
return $taskStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of status
|
||||
*
|
||||
* @param string $action
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getStatusArray($action)
|
||||
{
|
||||
$status = [];
|
||||
$statusValues = Application::$app_status_values;
|
||||
$status[] = ['', G::LoadTranslation('ID_ALL_STATUS')];
|
||||
foreach ($statusValues as $key => $value) {
|
||||
if ($action == 'search') {
|
||||
$status[] = array($value, G::LoadTranslation('ID_CASES_STATUS_' . $key));
|
||||
$status[] = [$value, G::LoadTranslation('ID_CASES_STATUS_' . $key)];
|
||||
} else {
|
||||
$status[] = array($key, G::LoadTranslation('ID_CASES_STATUS_' . $key));
|
||||
$status[] = [$key, G::LoadTranslation('ID_CASES_STATUS_' . $key)];
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the list configuration headers of the cases checked for reassign, for the
|
||||
* reassign cases list.
|
||||
* Get the list configuration headers of the cases checked for reassign, for the reassign cases list.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getReassignList()
|
||||
{
|
||||
$caseColumns = array();
|
||||
$caseColumns[] = array('header' => '#','dataIndex' => 'APP_NUMBER','width' => 40);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_SUMMARY'),'dataIndex' => 'CASE_SUMMARY','width' => 45,'hidden' => true
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_CASES_NOTES'),'dataIndex' => 'CASE_NOTES_COUNT','width' => 45,'hidden' => true
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_CASE'),'dataIndex' => 'APP_TITLE','width' => 100,'hidden' => true
|
||||
);
|
||||
$caseColumns[] = array('header' => 'CaseId','dataIndex' => 'APP_UID','width' => 200,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array('header' => 'User','dataIndex' => 'USR_UID','width' => 200,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_TASK'),'dataIndex' => 'APP_TAS_TITLE','width' => 120
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_PROCESS'),'dataIndex' => 'APP_PRO_TITLE','width' => 120
|
||||
);
|
||||
$caseColumns[] = array('header' => 'Reassigned Uid','dataIndex' => 'APP_REASSIGN_USER_UID','width' => 120,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array('header' => 'Reassigned Uid','dataIndex' => 'TAS_UID','width' => 120,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_ASSIGNED_TO'),'dataIndex' => 'APP_CURRENT_USER','width' => 170
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_REASSIGNED_TO'),'dataIndex' => 'APP_REASSIGN_USER','width' => 170
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_REASON'),'dataIndex' => 'NOTE_REASON','width' => 170
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_NOTIFY'), 'dataIndex' => 'NOTIFY_REASSIGN', 'width' => 100
|
||||
);
|
||||
$caseColumns = [];
|
||||
$caseColumns[] = ['header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 40];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_SUMMARY'),
|
||||
'dataIndex' => 'CASE_SUMMARY',
|
||||
'width' => 45,
|
||||
'hidden' => true
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_CASES_NOTES'),
|
||||
'dataIndex' => 'CASE_NOTES_COUNT',
|
||||
'width' => 45,
|
||||
'hidden' => true
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_CASE'),
|
||||
'dataIndex' => 'APP_TITLE',
|
||||
'width' => 100,
|
||||
'hidden' => true
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => 'CaseId',
|
||||
'dataIndex' => 'APP_UID',
|
||||
'width' => 200,
|
||||
'hidden' => true,
|
||||
'hideable' => false
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => 'User',
|
||||
'dataIndex' => 'USR_UID',
|
||||
'width' => 200,
|
||||
'hidden' => true,
|
||||
'hideable' => false
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_TASK'),
|
||||
'dataIndex' => 'APP_TAS_TITLE',
|
||||
'width' => 120
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_PROCESS'),
|
||||
'dataIndex' => 'APP_PRO_TITLE',
|
||||
'width' => 120
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => 'Reassigned Uid',
|
||||
'dataIndex' => 'APP_REASSIGN_USER_UID',
|
||||
'width' => 120,
|
||||
'hidden' => true,
|
||||
'hideable' => false
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => 'Reassigned Uid',
|
||||
'dataIndex' => 'TAS_UID',
|
||||
'width' => 120,
|
||||
'hidden' => true,
|
||||
'hideable' => false
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_ASSIGNED_TO'),
|
||||
'dataIndex' => 'APP_CURRENT_USER',
|
||||
'width' => 170
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_REASSIGNED_TO'),
|
||||
'dataIndex' => 'APP_REASSIGN_USER',
|
||||
'width' => 170
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_REASON'),
|
||||
'dataIndex' => 'NOTE_REASON',
|
||||
'width' => 170
|
||||
];
|
||||
$caseColumns[] = [
|
||||
'header' => G::LoadTranslation('ID_NOTIFY'),
|
||||
'dataIndex' => 'NOTIFY_REASSIGN',
|
||||
'width' => 100
|
||||
];
|
||||
|
||||
$caseReaderFields = array();
|
||||
$caseReaderFields[] = array('name' => 'APP_NUMBER');
|
||||
$caseReaderFields[] = array('name' => 'APP_TITLE');
|
||||
$caseReaderFields[] = array('name' => 'APP_UID');
|
||||
$caseReaderFields[] = array('name' => 'USR_UID');
|
||||
$caseReaderFields[] = array('name' => 'APP_TAS_TITLE');
|
||||
$caseReaderFields[] = array('name' => 'APP_PRO_TITLE');
|
||||
$caseReaderFields[] = array('name' => 'APP_REASSIGN_USER_UID');
|
||||
$caseReaderFields[] = array('name' => 'TAS_UID');
|
||||
$caseReaderFields[] = array('name' => 'APP_REASSIGN_USER');
|
||||
$caseReaderFields[] = array('name' => 'CASE_SUMMARY');
|
||||
$caseReaderFields[] = array('name' => 'CASE_NOTES_COUNT');
|
||||
$caseReaderFields[] = array('name' => 'APP_CURRENT_USER');
|
||||
$caseReaderFields = [];
|
||||
$caseReaderFields[] = ['name' => 'APP_NUMBER'];
|
||||
$caseReaderFields[] = ['name' => 'APP_TITLE'];
|
||||
$caseReaderFields[] = ['name' => 'APP_UID'];
|
||||
$caseReaderFields[] = ['name' => 'USR_UID'];
|
||||
$caseReaderFields[] = ['name' => 'APP_TAS_TITLE'];
|
||||
$caseReaderFields[] = ['name' => 'APP_PRO_TITLE'];
|
||||
$caseReaderFields[] = ['name' => 'APP_REASSIGN_USER_UID'];
|
||||
$caseReaderFields[] = ['name' => 'TAS_UID'];
|
||||
$caseReaderFields[] = ['name' => 'APP_REASSIGN_USER'];
|
||||
$caseReaderFields[] = ['name' => 'CASE_SUMMARY'];
|
||||
$caseReaderFields[] = ['name' => 'CASE_NOTES_COUNT'];
|
||||
$caseReaderFields[] = ['name' => 'APP_CURRENT_USER'];
|
||||
|
||||
return array('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
||||
);
|
||||
}
|
||||
|
||||
function getReassignUsersList()
|
||||
{
|
||||
$caseColumns = array();
|
||||
|
||||
$caseReaderFields = array();
|
||||
$caseReaderFields[] = array('name' => 'userUid'
|
||||
);
|
||||
$caseReaderFields[] = array('name' => 'userFullname'
|
||||
);
|
||||
|
||||
return array('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
||||
);
|
||||
return [
|
||||
'caseColumns' => $caseColumns,
|
||||
'caseReaderFields' => $caseReaderFields,
|
||||
'rowsperpage' => 20,
|
||||
'dateformat' => 'M d, Y'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* loads the PM Table field list from the database based in an action parameter
|
||||
* Get the list of users for reassign
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getReassignUsersList()
|
||||
{
|
||||
$caseColumns = [];
|
||||
|
||||
$caseReaderFields = [];
|
||||
$caseReaderFields[] = ['name' => 'userUid'];
|
||||
$caseReaderFields[] = ['name' => 'userFullname'];
|
||||
|
||||
return [
|
||||
'caseColumns' => $caseColumns,
|
||||
'caseReaderFields' => $caseReaderFields,
|
||||
'rowsperpage' => 20,
|
||||
'dateformat' => 'M d, Y'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the PM Table field list from the database based in an action parameter
|
||||
* then assemble the List of fields with these data, for the configuration in cases list.
|
||||
*
|
||||
* @param String $action
|
||||
* @return Array $config
|
||||
* @param string $action
|
||||
* @param array $confCasesList
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function getAdditionalFields($action, $confCasesList = array())
|
||||
function getAdditionalFields($action, $confCasesList = [])
|
||||
{
|
||||
$config = new Configurations();
|
||||
$arrayConfig = $config->casesListDefaultFieldsAndConfig($action);
|
||||
|
||||
if (is_array($confCasesList) && count($confCasesList) > 0 && isset($confCasesList["second"]) && count($confCasesList["second"]["data"]) > 0) {
|
||||
//For the case list builder in the enterprise plugin
|
||||
$caseColumns = array();
|
||||
$caseReaderFields = array();
|
||||
$caseReaderFieldsAux = array();
|
||||
$caseColumns = [];
|
||||
$caseReaderFields = [];
|
||||
$caseReaderFieldsAux = [];
|
||||
|
||||
foreach ($confCasesList["second"]["data"] as $index1 => $value1) {
|
||||
$arrayField = $value1;
|
||||
|
||||
if ($arrayField["fieldType"] != "key" && $arrayField["name"] != "USR_UID" && $arrayField["name"] != "PREVIOUS_USR_UID") {
|
||||
$arrayAux = array();
|
||||
$arrayAux = [];
|
||||
|
||||
foreach ($arrayField as $index2 => $value2) {
|
||||
if ($index2 != "gridIndex" && $index2 != "fieldType") {
|
||||
@@ -371,7 +458,7 @@ function getAdditionalFields($action, $confCasesList = array())
|
||||
}
|
||||
|
||||
$caseColumns[] = $arrayAux;
|
||||
$caseReaderFields[] = array("name" => $arrayField["name"]);
|
||||
$caseReaderFields[] = ["name" => $arrayField["name"]];
|
||||
|
||||
$caseReaderFieldsAux[] = $arrayField["name"];
|
||||
}
|
||||
@@ -382,7 +469,12 @@ function getAdditionalFields($action, $confCasesList = array())
|
||||
}
|
||||
}
|
||||
|
||||
$arrayConfig = array("caseColumns" => $caseColumns, "caseReaderFields" => $caseReaderFields, "rowsperpage" => $confCasesList["rowsperpage"], "dateformat" => $confCasesList["dateformat"]);
|
||||
$arrayConfig = [
|
||||
"caseColumns" => $caseColumns,
|
||||
"caseReaderFields" => $caseReaderFields,
|
||||
"rowsperpage" => $confCasesList["rowsperpage"],
|
||||
"dateformat" => $confCasesList["dateformat"]
|
||||
];
|
||||
}
|
||||
|
||||
return $arrayConfig;
|
||||
@@ -390,6 +482,7 @@ function getAdditionalFields($action, $confCasesList = array())
|
||||
|
||||
/**
|
||||
* This function define the possibles columns for apply the specific search
|
||||
*
|
||||
* @return array $filters values of the dropdown
|
||||
*/
|
||||
function getColumnsSearchArray()
|
||||
@@ -398,6 +491,7 @@ function getColumnsSearchArray()
|
||||
$filters[] = ['APP_TITLE', G::LoadTranslation('ID_CASE_TITLE')];
|
||||
$filters[] = ['APP_NUMBER', G::LoadTranslation('ID_CASE_NUMBER')];
|
||||
$filters[] = ['TAS_TITLE', G::LoadTranslation('ID_TASK')];
|
||||
|
||||
return $filters;
|
||||
}
|
||||
|
||||
@@ -405,6 +499,7 @@ function getColumnsSearchArray()
|
||||
function getClientCredentials($clientId)
|
||||
{
|
||||
$oauthQuery = new ProcessMaker\Services\OAuth2\PmPdo(getDsn());
|
||||
|
||||
return $oauthQuery->getClientDetails($clientId);
|
||||
}
|
||||
|
||||
@@ -414,7 +509,7 @@ function getDsn()
|
||||
$port = empty($port) ? '' : ";port=$port";
|
||||
$dsn = DB_ADAPTER.':host='.$host.';dbname='.DB_NAME.$port;
|
||||
|
||||
return array('dsn' => $dsn, 'username' => DB_USER, 'password' => DB_PASS);
|
||||
return ['dsn' => $dsn, 'username' => DB_USER, 'password' => DB_PASS];
|
||||
}
|
||||
|
||||
|
||||
@@ -426,11 +521,14 @@ function getAuthorizationCode($client)
|
||||
$oauthServer = new \ProcessMaker\Services\OAuth2\Server();
|
||||
$userId = $_SESSION['USER_LOGGED'];
|
||||
$authorize = true;
|
||||
$_GET = array_merge($_GET, array(
|
||||
'response_type' => 'code',
|
||||
'client_id' => $client['CLIENT_ID'],
|
||||
'scope' => implode(' ', $oauthServer->getScope())
|
||||
));
|
||||
$_GET = array_merge(
|
||||
$_GET,
|
||||
[
|
||||
'response_type' => 'code',
|
||||
'client_id' => $client['CLIENT_ID'],
|
||||
'scope' => implode(' ', $oauthServer->getScope())
|
||||
]
|
||||
);
|
||||
|
||||
$response = $oauthServer->postAuthorize($authorize, $userId, true);
|
||||
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
|
||||
|
||||
5
workflow/engine/methods/cases/casesList_Ajax.php
Normal file → Executable file
5
workflow/engine/methods/cases/casesList_Ajax.php
Normal file → Executable file
@@ -8,7 +8,10 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
die();
|
||||
}
|
||||
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : 'verifySession';
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->allows(basename(__FILE__), $actionAjax);
|
||||
|
||||
function filterUserListArray($users = array(), $filter = '')
|
||||
{
|
||||
|
||||
121
workflow/engine/methods/cases/proxyCasesList.php
Normal file → Executable file
121
workflow/engine/methods/cases/proxyCasesList.php
Normal file → Executable file
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Model\Delegation;
|
||||
|
||||
/**
|
||||
@@ -20,38 +21,41 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$filter = new InputFilter();
|
||||
$_GET = $filter->xssFilterHard($_GET);
|
||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
||||
$_SESSION['USER_LOGGED'] = $filter->xssFilterHard($_SESSION['USER_LOGGED']);
|
||||
$userLogged = $filter->xssFilterHard($_SESSION['USER_LOGGED']);
|
||||
|
||||
$filters = [];
|
||||
// Callback in the UI to utilize
|
||||
$callback = isset($_REQUEST["callback"]) ? $_REQUEST["callback"] : "stcCallback1001";
|
||||
|
||||
// Sort column
|
||||
$sort = isset($_REQUEST["sort"]) ? $_REQUEST["sort"] : "APP_NUMBER";
|
||||
$filters['sort'] = $sort = isset($_REQUEST["sort"]) ? $_REQUEST["sort"] : "APP_NUMBER";
|
||||
// Sort direction
|
||||
$dir = isset($_REQUEST["dir"]) ? $_REQUEST["dir"] : "DESC";
|
||||
$filters['dir'] = $dir = isset($_REQUEST["dir"]) ? $_REQUEST["dir"] : "DESC";
|
||||
|
||||
// Pagination control
|
||||
$start = !empty($_REQUEST["start"]) ? $_REQUEST["start"] : 0;
|
||||
$limit = !empty($_REQUEST["limit"]) ? $_REQUEST["limit"] : 25;
|
||||
$filters['start'] = $start = !empty($_REQUEST["start"]) ? $_REQUEST["start"] : 0;
|
||||
$filters['limit'] = $limit = !empty($_REQUEST["limit"]) ? $_REQUEST["limit"] : 25;
|
||||
|
||||
// Our search filter
|
||||
$filter = isset($_REQUEST["filter"]) ? $_REQUEST["filter"] : "";
|
||||
|
||||
// What process
|
||||
$process = isset($_REQUEST["process"]) ? $_REQUEST["process"] : "";
|
||||
$filters['process'] = $process = isset($_REQUEST["process"]) ? $_REQUEST["process"] : "";
|
||||
$filters['process_label'] = $processLabel = isset($_REQUEST["process_label"]) ? $_REQUEST["process_label"] : "";
|
||||
|
||||
// What category
|
||||
$category = isset($_REQUEST["category"]) ? $_REQUEST["category"] : "";
|
||||
$filters['category'] = $category = isset($_REQUEST["category"]) ? $_REQUEST["category"] : "";
|
||||
|
||||
// What status
|
||||
$status = isset($_REQUEST["status"]) ? strtoupper($_REQUEST["status"]) : "";
|
||||
$filterStatus = isset($_REQUEST["filterStatus"]) ? strtoupper($_REQUEST["filterStatus"]) : "";
|
||||
$filters['filterStatus'] = $filterStatus = isset($_REQUEST["filterStatus"]) ? strtoupper($_REQUEST["filterStatus"]) : "";
|
||||
|
||||
// What user
|
||||
$user = isset($_REQUEST["user"]) ? $_REQUEST["user"] : "";
|
||||
$filters['user'] = $user = isset($_REQUEST["user"]) ? $_REQUEST["user"] : "";
|
||||
$filters['user_label'] = $userLabel = isset($_REQUEST["user_label"]) ? $_REQUEST["user_label"] : "";
|
||||
|
||||
// What keywords to search
|
||||
$search = isset($_REQUEST["search"]) ? $_REQUEST["search"] : "";
|
||||
$filters['search'] = $search = isset($_REQUEST["search"]) ? $_REQUEST["search"] : "";
|
||||
|
||||
// What kind of action
|
||||
$action = isset($_GET["action"]) ? $_GET["action"] : (isset($_REQUEST["action"]) ? $_REQUEST["action"] : "todo");
|
||||
@@ -60,17 +64,20 @@ $action = isset($_GET["action"]) ? $_GET["action"] : (isset($_REQUEST["action"])
|
||||
$type = isset($_GET["type"]) ? $_GET["type"] : (isset($_REQUEST["type"]) ? $_REQUEST["type"] : "extjs");
|
||||
|
||||
// Date ranges
|
||||
$dateFrom = isset($_REQUEST["dateFrom"]) ? substr($_REQUEST["dateFrom"], 0, 10) : "";
|
||||
$dateTo = isset($_REQUEST["dateTo"]) ? substr($_REQUEST["dateTo"], 0, 10) : "";
|
||||
$filters['dateFrom'] = $dateFrom = isset($_REQUEST["dateFrom"]) ? substr($_REQUEST["dateFrom"], 0, 10) : "";
|
||||
$filters['dateTo'] = $dateTo = isset($_REQUEST["dateTo"]) ? substr($_REQUEST["dateTo"], 0, 10) : "";
|
||||
|
||||
// First? No idea
|
||||
$first = isset($_REQUEST["first"]) ? true : false;
|
||||
// First define if we need to return empty data the first time
|
||||
$first = isset($_REQUEST["first"]);
|
||||
|
||||
// Do search define if the action was defined from the button search
|
||||
$doSearch = isset($_REQUEST["doSearch"]);
|
||||
|
||||
// Open case from case link
|
||||
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '') ?
|
||||
$_REQUEST['openApplicationUid'] : null;
|
||||
$search = (!is_null($openApplicationUid)) ? $openApplicationUid : $search;
|
||||
$columnSearch = isset($_REQUEST["columnSearch"]) ? strtoupper($_REQUEST["columnSearch"]) : "";
|
||||
$filters['columnSearch'] = $columnSearch = isset($_REQUEST["columnSearch"]) ? strtoupper($_REQUEST["columnSearch"]) : "";
|
||||
|
||||
if ($sort == 'CASE_SUMMARY' || $sort == 'CASE_NOTES_COUNT') {
|
||||
$sort = 'APP_NUMBER';//DEFAULT VALUE
|
||||
@@ -79,43 +86,61 @@ if ($sort == 'APP_STATUS_LABEL') {
|
||||
$sort = 'APP_STATUS';
|
||||
}
|
||||
|
||||
try {
|
||||
$userUid = (isset($_SESSION["USER_LOGGED"]) && $_SESSION["USER_LOGGED"] != "") ? $_SESSION["USER_LOGGED"] : null;
|
||||
$result = [];
|
||||
//Load Configurations
|
||||
$conf = new Configurations();
|
||||
//Load the user preferences
|
||||
$conf->getUserPreferences('FILTERS', $userLogged);
|
||||
//Save the filters used
|
||||
if ($doSearch && (empty($conf->aConfig['FILTERS']['advanced']) || $conf->aConfig['FILTERS']['advanced'] != $filters)) {
|
||||
//The user does not have filters or we need to update the user preferences
|
||||
$conf->aConfig['FILTERS']['advanced'] = $filters;
|
||||
$conf->saveConfig('USER_PREFERENCES', '', '', $userLogged);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case "search":
|
||||
case "to_reassign":
|
||||
if ($first) {
|
||||
$result['totalCount'] = 0;
|
||||
$result['data'] = array();
|
||||
$result = G::json_encode($result);
|
||||
echo $result;
|
||||
return;
|
||||
}
|
||||
$user = ($user == "CURRENT_USER") ? $userUid : $user;
|
||||
$userUid = $user;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
try {
|
||||
$result = [];
|
||||
//Define the user logged into the system
|
||||
$userUid = (isset($userLogged) && $userLogged != "") ? $userLogged : null;
|
||||
|
||||
if ($action == 'search') {
|
||||
$data = Delegation::search(
|
||||
$userUid,
|
||||
$start,
|
||||
$limit,
|
||||
$search,
|
||||
$process,
|
||||
$filterStatus,
|
||||
$dir,
|
||||
$sort,
|
||||
$category,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$columnSearch
|
||||
);
|
||||
//Return empty if does not have filters
|
||||
if (empty($conf->aConfig['FILTERS']['advanced'])) {
|
||||
$result['totalCount'] = 0;
|
||||
$result['data'] = [];
|
||||
$result = G::json_encode($result);
|
||||
echo $result;
|
||||
return;
|
||||
} else {
|
||||
//Define the user
|
||||
$user = ($user == "CURRENT_USER") ? $userUid : $user;
|
||||
$userUid = $user;
|
||||
|
||||
//Get the data from the specific search
|
||||
$data = Delegation::search(
|
||||
$userUid,
|
||||
$start,
|
||||
$limit,
|
||||
$search,
|
||||
$process,
|
||||
$filterStatus,
|
||||
$dir,
|
||||
$sort,
|
||||
$category,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$columnSearch
|
||||
);
|
||||
}
|
||||
} else {
|
||||
//We check if we need to return empty
|
||||
if ($action == "to_reassign" && $first) {
|
||||
$result['totalCount'] = 0;
|
||||
$result['data'] = [];
|
||||
$result = G::json_encode($result);
|
||||
echo $result;
|
||||
return;
|
||||
}
|
||||
|
||||
//This section is used by the community version
|
||||
$apps = new Applications();
|
||||
$data = $apps->getAll(
|
||||
|
||||
Reference in New Issue
Block a user