Merged in release/3.7.3 (pull request #8351)

release/3.7.3
This commit is contained in:
Paula Quispe
2022-01-17 20:52:18 +00:00
142 changed files with 5095 additions and 1774 deletions

View File

@@ -3401,8 +3401,11 @@ class Cases
$lastFields = $this->executeTriggerFromList($triggersList, $fieldsCase, $stepType, $stepUidObj, $triggerType);
/*----------------------------------********---------------------------------*/
$usrUid = empty($_SESSION['USER_LOGGED']) ? '' : $_SESSION['USER_LOGGED'];
ChangeLog::getChangeLog()
->setObjectUid($stepUidObj)
->getUsrIdByUsrUid($usrUid, true)
->getTasIdByTasUid($tasUid, true)
->getExecutedAtIdByTriggerType($triggerType);
/*----------------------------------********---------------------------------*/
@@ -7223,7 +7226,14 @@ class Cases
}
}
public function unserializeData($data)
/**
* Unserialize the case data
*
* @param string $data
*
* @return array
*/
public static function unserializeData($data)
{
$unserializedData = @unserialize($data);

View File

@@ -374,7 +374,8 @@ class WorkspaceTools
$start = microtime(true);
Bootstrap::setConstantsRelatedWs($workspace);
Propel::init(PATH_CONFIG . 'databases.php');
WebEntry::convertFromV1ToV2();
$statement = Propel::getConnection('workflow')->createStatement();
$statement->executeQuery(WebEntry::UPDATE_QUERY_V1_TO_V2);
CLI::logging("* End converting Web Entries v1.0 to v2.0 for BPMN processes...(" . (microtime(true) - $start) . " seconds)\n");
CLI::logging("* Start migrating case title...\n");

View File

@@ -4,6 +4,8 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use ProcessMaker\BusinessModel\Cases as BusinessModelCases;
use ProcessMaker\Core\System;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\GroupUser;
use ProcessMaker\Model\Groupwf;
use ProcessMaker\Model\RbacRoles;
@@ -2491,9 +2493,6 @@ function PMFgetLabelOption ($PROCESS, $DYNAFORM_UID, $FIELD_NAME, $FIELD_SELECTE
}
/**
*
* @method
*
* Redirects a case to any step in the current task. In order for the step to
* be executed, the specified step much exist and if it contains a condition,
* it must evaluate to true.
@@ -2502,79 +2501,76 @@ function PMFgetLabelOption ($PROCESS, $DYNAFORM_UID, $FIELD_NAME, $FIELD_SELECTE
* @label PMF Redirect To Step
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFRedirectToStep.28.29
*
* @param string(32) | $sApplicationUID | Case ID | The unique ID for a case,
* @param int | $iDelegation | Delegation index | The delegation index of a case.
* @param string(32) | $sStepType | Type of Step | The type of step, which can be "DYNAFORM", "INPUT_DOCUMENT" or "OUTPUT_DOCUMENT".
* @param string(32) | $sStepUid | Step ID | The unique ID for the step.
* @param string(32) | $appUid | Case ID | The unique ID for a case,
* @param int | $index | Delegation index | The delegation index of a case.
* @param string(32) | $stepType | Type of Step | The type of step, which can be "DYNAFORM", "INPUT_DOCUMENT" or "OUTPUT_DOCUMENT".
* @param string(32) | $stepUid | Step ID | The unique ID for the step.
* @return none | $none | None | None
*
*/
function PMFRedirectToStep($sApplicationUID, $iDelegation, $sStepType, $sStepUid)
function PMFRedirectToStep($appUid, $index, $stepType, $stepUid)
{
// Set initial values
$index = intval($index);
$sessionCase = $_SESSION["APPLICATION"];
// Save the session variables
$g = new G();
$g->sessionVarSave();
$iDelegation = intval($iDelegation);
$_SESSION["APPLICATION"] = $sApplicationUID;
$_SESSION["INDEX"] = $iDelegation;
require_once 'classes/model/AppDelegation.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
$oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID);
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $iDelegation);
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
global $oPMScript;
$aRow = $oDataset->getRow();
if ($aRow) {
require_once 'classes/model/Step.php';
$oStep = new Step();
$oTheStep = $oStep->loadByType($aRow['TAS_UID'], $sStepType, $sStepUid);
$bContinue = true;
$oCase = new Cases();
$aFields = $oCase->loadCase($sApplicationUID);
if ($oTheStep->getStepCondition() != '') {
$pmScript = new PMScript();
$pmScript->setFields($aFields['APP_DATA']);
$pmScript->setScript($oTheStep->getStepCondition());
$pmScript->setExecutedOn(PMScript::CONDITION);
$bContinue = $pmScript->evaluate();
$_SESSION["APPLICATION"] = $appUid;
$_SESSION["INDEX"] = $index;
// Get the caseNumber
$appNumber = Application::getCaseNumber($appUid);
// Get thread information
$thread = Delegation::getThreadInfo($appNumber, $index);
// Review if exist a thread
if (!empty($thread)) {
global $oPMScript;
// Load the data
$case = new Cases();
// Get the step information
$step = new Step();
$theStep = $step->loadByType($thread['TAS_UID'], $stepType, $stepUid);
// Save data if the case fields loaded in the $oPMScript is related to the same case in execution
if ($sessionCase === $appUid && !is_null($oPMScript)) {
$fields = [];
$fields['APP_DATA'] = $oPMScript->aFields;
unset($fields['APP_STATUS']);
unset($fields['APP_PROC_STATUS']);
unset($fields['APP_PROC_CODE']);
unset($fields['APP_PIN']);
$case->updateCase($appUid, $fields);
}
if ($bContinue) {
switch ($oTheStep->getStepTypeObj()) {
$fields = $case->loadCase($appUid);
// Review the step condition
$continue = true;
if (!empty($theStep->getStepCondition())) {
$pmScript = new PMScript();
$pmScript->setFields($fields['APP_DATA']);
$pmScript->setScript($theStep->getStepCondition());
$pmScript->setExecutedOn(PMScript::CONDITION);
$continue = $pmScript->evaluate();
}
if ($continue) {
switch ($theStep->getStepTypeObj()) {
case 'DYNAFORM':
$sAction = 'EDIT';
$action = 'EDIT';
break;
case 'OUTPUT_DOCUMENT':
$sAction = 'GENERATE';
$action = 'GENERATE';
break;
case 'INPUT_DOCUMENT':
$sAction = 'ATTACH';
$action = 'ATTACH';
break;
case 'EXTERNAL':
$sAction = 'EDIT';
$action = 'EDIT';
break;
case 'MESSAGE':
$sAction = '';
$action = '';
break;
}
// save data
if (!is_null($oPMScript)) {
$aFields['APP_DATA'] = $oPMScript->aFields;
unset($aFields['APP_STATUS']);
unset($aFields['APP_PROC_STATUS']);
unset($aFields['APP_PROC_CODE']);
unset($aFields['APP_PIN']);
$oCase->updateCase($sApplicationUID, $aFields);
}
$g->sessionVarRestore();
G::header('Location: ' . 'cases_Step?TYPE=' . $sStepType . '&UID=' . $sStepUid . '&POSITION=' . $oTheStep->getStepPosition() . '&ACTION=' . $sAction);
G::header('Location: ' . 'cases_Step?TYPE=' . $stepType . '&UID=' . $stepUid . '&POSITION=' . $theStep->getStepPosition() . '&ACTION=' . $action);
die();
}
}
@@ -4214,6 +4210,53 @@ function PMFNewUser(
return $response;
}
/**
*
* @method
*
* Load the case information
*
* @name PMFCaseInformation
* @label PMF Case Information
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCaseInformation.28.29
*
* @param string(32) | $caseUid | Case ID | The case unique identifier, that is string of 32 hexadecimal characters.
* @param int | $delIndex = 0 | Delegation index of the case | The delegation index of the case thread task to get information (optional).
* @param int | $returnAppData = 0 | Include Application Data | Set as TRUE to get all the case data (optional).
*
* @return array | $response | Response
* @throws Exception
*/
function PMFCaseInformation($caseUid, $delIndex = 0, $returnAppData = false)
{
if (empty($caseUid)) {
throw new Exception(G::LoadTranslation("ID_REQUIRED_FIELD") . " caseUid");
}
$case = new Cases();
$result = $case->loadCase($caseUid, $delIndex);
// Clean the APPLICATION's columns deprecated or without functionallity
unset($result['APP_TITLE']);
unset($result['APP_PARENT']);
unset($result['APP_PROC_STATUS']);
unset($result['APP_PROC_CODE']);
unset($result['APP_PARALLEL']);
unset($result['APP_PIN']);
unset($result['APP_DURATION']);
unset($result['APP_DELAY_DURATION']);
unset($result['APP_DRIVE_FOLDER_UID']);
unset($result['APP_ROUTING_DATA']);
// Only if this parameter is true we will to return this value
if (!$returnAppData) {
unset($result['APP_DATA']);
}
// Clean the additional columns deprecated or without functionallity
unset($result['TITLE']);
unset($result['DESCRIPTION']);
unset($result['DESCRIPTION']);
return $result;
}
//Start - Private functions

View File

@@ -198,6 +198,9 @@ class Users extends BaseUsers
if (empty($aFields['USR_DEFAULT_LANG'])) {
$aFields['USR_DEFAULT_LANG'] = 'en';
}
//sometimes the USR_DEFAULT_LANG value is made up, it is formatted in order to find the value.
$explode = explode('-', $aFields['USR_DEFAULT_LANG']);
$aFields['USR_DEFAULT_LANG'] = strtolower($explode[0]);
$translations = new Language();
$translation = $translations->loadByCode($aFields['USR_DEFAULT_LANG']);
$aFields['USR_DEFAULT_LANG_NAME'] = $translation['LANGUAGE_NAME'];

View File

@@ -90,7 +90,7 @@ class Zimbra
{
if ($this->_username) {
if (PHP_VERSION < 5.2) {
setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu");
setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu", "; HttpOnly");
} else {
setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu", false, true);
}

File diff suppressed because one or more lines are too long

View File

@@ -4403,6 +4403,12 @@ msgstr "The category name with {0}: \"{1}\" already exists."
msgid "The category with {0}: '{1}' does not exist."
msgstr "The category with {0}: '{1}' does not exist."
# TRANSLATION
# LABEL/ID_CATEGORY_PROCESS
#: LABEL/ID_CATEGORY_PROCESS
msgid "Process Category"
msgstr "Process Category"
# TRANSLATION
# LABEL/ID_CATEGORY_SUCCESS_DELETE
#: LABEL/ID_CATEGORY_SUCCESS_DELETE
@@ -6095,6 +6101,12 @@ msgstr "Delay Field"
msgid "Delayed"
msgstr "Delayed"
# TRANSLATION
# LABEL/ID_DELEGATED
#: LABEL/ID_DELEGATED
msgid "Delegated"
msgstr "Delegated"
# TRANSLATION
# LABEL/ID_DELEGATE_DATE_FROM
#: LABEL/ID_DELEGATE_DATE_FROM
@@ -7013,6 +7025,18 @@ msgstr "Down"
msgid "Download"
msgstr "Download"
# TRANSLATION
# LABEL/ID_DOWNLOAD_SVG
#: LABEL/ID_DOWNLOAD_SVG
msgid "Download SVG"
msgstr "Download SVG"
# TRANSLATION
# LABEL/ID_DOWNLOAD_PNG
#: LABEL/ID_DOWNLOAD_PNG
msgid "Download PNG"
msgstr "Download PNG"
# TRANSLATION
# LABEL/ID_DOWNLOADING_FILE
#: LABEL/ID_DOWNLOADING_FILE
@@ -19169,12 +19193,6 @@ msgstr "Cookie Lifetime (Seconds)"
msgid "The maximun limit of columns for a database table is 255, you already have them defined!"
msgstr "The maximun limit of columns for a database table is 255, you already have them defined!"
# TRANSLATION
# LABEL/ID_MCRYPT_SUPPORT
#: LABEL/ID_MCRYPT_SUPPORT
msgid "Mcrypt Support"
msgstr "Mcrypt Support"
# TRANSLATION
# LABEL/ID_MEDIA
#: LABEL/ID_MEDIA
@@ -19211,6 +19229,12 @@ msgstr "Memory Limit (MB)"
msgid "Memory Limit value has to be either a positive integer or -1"
msgstr "Memory Limit value has to be either a positive integer or -1"
# TRANSLATION
# LABEL/ID_MENU
#: LABEL/ID_MENU
msgid "Menu"
msgstr "Menu"
# TRANSLATION
# LABEL/ID_MENU_COLOR
#: LABEL/ID_MENU_COLOR
@@ -21299,6 +21323,12 @@ msgstr "Page"
msgid "Page Size"
msgstr "Page Size"
# TRANSLATION
# LABEL/ID_PANNING
#: LABEL/ID_PANNING
msgid "Panning"
msgstr "Panning"
# TRANSLATION
# LABEL/ID_PARALLEL_TASK
#: LABEL/ID_PARALLEL_TASK
@@ -24383,6 +24413,12 @@ msgstr "Screen Color Icon"
msgid "Script Task"
msgstr "Script Task"
# TRANSLATION
# LABEL/ID_SCRIPT_TASK_UNTITLED
#: LABEL/ID_SCRIPT_TASK_UNTITLED
msgid "Untitled - Script Task"
msgstr "Untitled - Script Task"
# TRANSLATION
# LABEL/ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED
#: LABEL/ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED
@@ -24581,6 +24617,12 @@ msgstr "See complete list"
msgid "Select"
msgstr "Select"
# TRANSLATION
# LABEL/ID_SELECTION_ZOOM
#: LABEL/ID_SELECTION_ZOOM
msgid "Selection zoom"
msgstr "Selection zoom"
# TRANSLATION
# LABEL/ID_SELECTED
#: LABEL/ID_SELECTED
@@ -24965,6 +25007,18 @@ msgstr "Server reported"
msgid "Service"
msgstr "Service"
# TRANSLATION
# LABEL/ID_SERVICE_TASK
#: LABEL/ID_SERVICE_TASK
msgid "Service Task"
msgstr "Service Task"
# TRANSLATION
# LABEL/ID_SERVICE_TASK_UNTITLED
#: LABEL/ID_SERVICE_TASKUNTITLED
msgid "Untitled - Service Task"
msgstr "Untitled - Service Task"
# TRANSLATION
# LABEL/ID_SESSION
#: LABEL/ID_SESSION
@@ -26183,6 +26237,12 @@ msgstr "Task in Progress"
msgid "Task Name"
msgstr "Task Name"
# TRANSLATION
# LABEL/ID_TASK_METRICS
#: LABEL/ID_TASK_METRICS
msgid "Task metrics"
msgstr "Task metrics"
# TRANSLATION
# LABEL/ID_TASK_NOT_EXIST
#: LABEL/ID_TASK_NOT_EXIST
@@ -26213,6 +26273,30 @@ msgstr "The task doesn't have any steps"
msgid "Overdue"
msgstr "Overdue"
# TRANSLATION
# LABEL/ID_TASK_OVERDUE_DAYS
#: LABEL/ID_TASK_OVERDUE_DAYS
msgid "Overdue days"
msgstr "Overdue days"
# TRANSLATION
# LABEL/ID_TASK_DAYS_BEFORE_AT_RISK
#: LABEL/ID_TASK_DAYS_BEFORE_AT_RISK
msgid "Days before being At-Risk"
msgstr "Days before being At-Risk"
# TRANSLATION
# LABEL/ID_TASK_DAYS_BEFORE_OVERDUE
#: LABEL/ID_TASK_DAYS_BEFORE_OVERDUE
msgid "Days before being Overdue"
msgstr "Days before being Overdue"
# TRANSLATION
# LABEL/ID_TASK_ON_TIME
#: LABEL/ID_TASK_ON_TIME
msgid "On time"
msgstr "On time"
# TRANSLATION
# LABEL/ID_TASK_PROPERTIES_SAVE
#: LABEL/ID_TASK_PROPERTIES_SAVE
@@ -29033,6 +29117,18 @@ msgstr "You uploaded an unsupported file extension, please review the permitted
msgid "Zip Code"
msgstr "Zip Code"
# TRANSLATION
# LABEL/ID_ZOOM_IN
#: LABEL/ID_ZOOM_IN
msgid "Zoom in"
msgstr "Zoom in"
# TRANSLATION
# LABEL/ID_ZOOM_OUT
#: LABEL/ID_ZOOM_OUT
msgid "Zoom out"
msgstr "Zoom out"
# TRANSLATION
# LABEL/IMAGE_DETAIL
#: LABEL/IMAGE_DETAIL
@@ -53317,4 +53413,10 @@ msgstr "Sorry, No Solid icons found!"
# LABEL/ID_SELECT_PROCESS_DRILL
#: LABEL/ID_SELECT_PROCESS_DRILL
msgid "Select a process to have the Drilling Down Options"
msgstr "Select a process to have the Drilling Down Options"
msgstr "Select a process to have the Drilling Down Options"
# TRANSLATION
# LABEL/ID_TASK_METRICS
#: LABEL/ID_TASK_METRICS
msgid "Task metrics"
msgstr "Task metrics"

View File

@@ -203,7 +203,6 @@ class InstallerModule extends Controller
$info->multibyte = new stdclass();
$info->soap = new stdclass();
$info->ldap = new stdclass();
$info->mcrypt = new stdclass();
$info->memory = new stdclass();
$info->php->version = $phpVer;
@@ -272,10 +271,6 @@ class InstallerModule extends Controller
$info->soap->version = G::LoadTranslation('ID_ENABLED');
}
//mcrypt info
$info->mcrypt->result = extension_loaded('mcrypt');
$info->mcrypt->version = $info->mcrypt->result ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_NOT_ENABLED');
// ldap info
$info->ldap->result = false;
$info->ldap->version = G::LoadTranslation('ID_NOT_ENABLED');

View File

@@ -393,6 +393,11 @@ class AppProxy extends HttpProxyController
'label' => G::LoadTranslation('ID_PROCESS_NAME') . ': ',
'value' => $processInfo['PRO_TITLE'],
],
$i++ => [ // Process Category
'id' => 'CATEGORY',
'label' => G::LoadTranslation('ID_CATEGORY_PROCESS') . ': ',
'value' => $processInfo['PRO_CATEGORY_LABEL'],
],
$i++ => [ // Process description
'id' => 'PRO_DESCRIPTION',
'label' => G::LoadTranslation('ID_PRO_DESCRIPTION') . ': ',

View File

@@ -57548,6 +57548,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_CATEGORY_NAME','en','Category Name','2014-01-15') ,
( 'LABEL','ID_CATEGORY_NAME_ALREADY_EXISTS','en','The category name with {0}: "{1}" already exists.','2014-06-12') ,
( 'LABEL','ID_CATEGORY_NOT_EXIST','en','The category with {0}: ''{1}'' does not exist.','2014-05-29') ,
( 'LABEL','ID_CATEGORY_PROCESS','en','Process Category','2021-11-25') ,
( 'LABEL','ID_CATEGORY_SUCCESS_DELETE','en','Process category has been deleted correctly.','2014-01-15') ,
( 'LABEL','ID_CATEGORY_SUCCESS_NEW','en','Process category has been created correctly.','2014-01-15') ,
( 'LABEL','ID_CATEGORY_SUCCESS_UPDATE','en','Process category has been updated correctly.','2014-01-15') ,
@@ -57843,6 +57844,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_DEFINITION','en','Definition','2014-01-15') ,
( 'LABEL','ID_DELAY_FIELD','en','Delay Field','2014-01-15') ,
( 'LABEL','ID_DELAYED','en','Delayed','2021-01-20') ,
( 'LABEL','ID_DELEGATED','en','Delegated','2022-01-12') ,
( 'LABEL','ID_DELEGATE_DATE_FROM','en','Date from','2017-10-18') ,
( 'LABEL','ID_DELEGATE_DATE_TO','en','to','2014-01-15') ,
( 'LABEL','ID_DELEGATE_USER','en','Delegated User','2014-01-15') ,
@@ -58000,6 +58002,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_DONT_MODIFY_PK_VALUE','en','You can not modify the primary key value for "{0}" field.','2014-01-15') ,
( 'LABEL','ID_DOWN','en','Down','2014-01-15') ,
( 'LABEL','ID_DOWNLOAD','en','Download','2014-01-15') ,
( 'LABEL','ID_DOWNLOAD_SVG','en','Download SVG','2022-01-07') ,
( 'LABEL','ID_DOWNLOAD_PNG','en','Download PNG','2022-01-07') ,
( 'LABEL','ID_DOWNLOADING_FILE','en','Downloading file','2014-01-15') ,
( 'LABEL','ID_DOWNLOADING_UPGRADE','en','Downloading upgrade:','2014-09-18') ,
( 'LABEL','ID_DOWNLOAD_MANUALLY','en','You can download it manually here','2014-09-18') ,
@@ -60090,13 +60094,13 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_MAX_INDICATOR_DASHBOARD','en','Maximum number of Indicators','2015-03-31') ,
( 'LABEL','ID_MAX_LIFETIME','en','Cookie Lifetime (Seconds)','2017-02-21') ,
( 'LABEL','ID_MAX_LIMIT_COLUMNS_FOR_DATABASE','en','The maximun limit of columns for a database table is 255, you already have them defined!','2014-01-15') ,
( 'LABEL','ID_MCRYPT_SUPPORT','en','Mcrypt Support','2014-10-17') ,
( 'LABEL','ID_MEDIA','en','Media','2014-01-15') ,
( 'LABEL','ID_MEMBER','en','Member','2014-01-15') ,
( 'LABEL','ID_MEMBERS','en','Members','2014-01-15') ,
( 'LABEL','ID_MEMBER_OF','en','MEMBER OF','2014-01-15') ,
( 'LABEL','ID_MEMORY_LIMIT','en','Memory Limit (MB)','2014-01-15') ,
( 'LABEL','ID_MEMORY_LIMIT_VALIDATE','en','Memory Limit value has to be either a positive integer or -1','2017-04-05') ,
( 'LABEL','ID_MENU','en','Menu','2022-01-07') ,
( 'LABEL','ID_MENU_COLOR','en','Menu Color','2021-08-10') ,
( 'LABEL','ID_MENU_NAME','en','Enterprise Manager','2014-10-17') ,
( 'LABEL','ID_MESSAGE','en','Message','2014-01-15') ,
@@ -60457,6 +60461,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_OWNER_TYPE','en','Owner type','2015-05-08') ,
( 'LABEL','ID_PAGE','en','Page','2014-01-15') ,
( 'LABEL','ID_PAGE_SIZE','en','Page Size','2014-01-15') ,
( 'LABEL','ID_PANNING','en','Panning','2022-01-07') ,
( 'LABEL','ID_PARALLEL_TASK','en','Parallel Task','2014-01-15') ,
( 'LABEL','ID_PARAMETERS','en','Parameters','2014-01-15') ,
( 'LABEL','ID_PARENT_DEPARTMENT_NOT_EXIST','en','Parent department doesn''t exist','2014-01-15') ,
@@ -60988,6 +60993,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_SCHEMA','en','Schema','2014-01-15') ,
( 'LABEL','ID_SCREEN_COLOR_ICON','en','Screen Color Icon','2021-08-10') ,
( 'LABEL','ID_SCRIPT_TASK','en','Script Task','2015-10-19') ,
( 'LABEL','ID_SCRIPT_TASK_UNTITLED','en','Untitled - Script Task','2021-11-23') ,
( 'LABEL','ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED','en','The Script-Task with {0}: "{1}" already registered','2016-08-01') ,
( 'LABEL','ID_SEARCH','en','Search','2014-01-15') ,
( 'LABEL','ID_SEARCHING','en','Searching...','2019-05-03') ,
@@ -61022,6 +61028,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_SEE','en','See','2014-01-15') ,
( 'LABEL','ID_SEE_FULL_LIST','en','See complete list','2016-02-29') ,
( 'LABEL','ID_SELECT','en','Select','2014-01-15') ,
( 'LABEL','ID_SELECTION_ZOOM','en','Selection zoom','2022-01-07') ,
( 'LABEL','ID_SELECTED','en','selected','2014-01-15') ,
( 'LABEL','ID_SELECTED_FIELD','en','selected field','2014-01-15') ,
( 'LABEL','ID_SELECTED_IMAGE_DELETED','en','The selected image has been deleted.','2014-01-15') ,
@@ -61090,6 +61097,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_SERVER_PROTOCOL','en','Server Protocol','2014-01-15') ,
( 'LABEL','ID_SERVER_REPORTED','en','Server reported','2014-01-15') ,
( 'LABEL','ID_SERVICE','en','Service','2014-01-15') ,
( 'LABEL','ID_SERVICE_TASK','en','Service','2021-11-23') ,
( 'LABEL','ID_SERVICE_TASK_UNTITLED','en','Service','2021-11-23') ,
( 'LABEL','ID_SESSION','en','Session','2014-01-15') ,
( 'LABEL','ID_SESSION_ACTIVE','en','Session active','2014-01-15') ,
( 'LABEL','ID_SESSION_DIRECTORY','en','Session directory','2015-11-05') ,
@@ -61303,11 +61312,16 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_TASK_IN_PROGRESS','en','Task in Progress','2014-01-15') ,
( 'LABEL','ID_TASK_NAME','en','Task Name','2020-12-16') ,
( 'LABEL','ID_TASK_METRICS','en','Task metrics','2022-01-05') ,
( 'LABEL','ID_TASK_NOT_EXIST','en','The task with {0}: ''{1}'' does not exist.','2014-05-29') ,
( 'LABEL','ID_TASK_NOT_FOUND','en','Task not found for id: {0}','2014-05-21') ,
( 'LABEL','ID_TASK_NOT_RELATED','en','[Not related to a task]','2014-01-15') ,
( 'LABEL','ID_TASK_NO_STEPS','en','The task doesn''t have any steps','2014-01-15') ,
( 'LABEL','ID_TASK_OVERDUE','en','Overdue','2015-06-09') ,
( 'LABEL','ID_TASK_OVERDUE_DAYS','en','Overdue days','2022-01-07') ,
( 'LABEL','ID_TASK_DAYS_BEFORE_AT_RISK','en','Days before being At-Risk','2022-01-07') ,
( 'LABEL','ID_TASK_DAYS_BEFORE_OVERDUE','en','Days before being Overdue','2022-01-07') ,
( 'LABEL','ID_TASK_ON_TIME','en','On time','2022-01-07') ,
( 'LABEL','ID_TASK_PROPERTIES_SAVE','en','Task properties has been saved successfully','2014-01-15') ,
( 'LABEL','ID_TASK_REASSIGNMENTS','en','Task Reassignments','2020-12-07') ,
( 'LABEL','ID_TASK_TITLE','en','Task Title','2020-12-17') ,
@@ -61831,6 +61845,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_YOU_HAVE_ERROR','en','you have an error','2014-01-15') ,
( 'LABEL','ID_YOU_UPLOADED_AN_UNSUPPORTED_FILE_EXTENSION','en','You uploaded an unsupported file extension, please review the permitted files uploaded in the wiki of ProcessMaker for the cases notes.','2020-06-12') ,
( 'LABEL','ID_ZIP_CODE','en','Zip Code','2014-01-15') ,
( 'LABEL','ID_ZOOM_IN','en','Zoom in','2022-01-07') ,
( 'LABEL','ID_ZOOM_OUT','en','Zoom out','2022-01-07') ,
( 'LABEL','IMAGE_DETAIL','en','Image detail','2014-01-15') ,
( 'LABEL','IMPORT_LANGUAGE_ERR_NO_WRITABLE','en','The XML forms directory is not writable','2014-01-15') ,
( 'LABEL','IMPORT_LANGUAGE_ERR_NO_WRITABLE2','en','Some files within XMLFORM directory are not writable, to install or update the translations the system requires that all files are writable. Contact your system administrator please.','2014-01-15') ,

View File

@@ -26,7 +26,7 @@ $oHeadPublisher->assignNumber("availableFields", G::json_encode($availableFields
$userCanAccess = 1;
$pmDynaform = new PmDynaform();
ScriptVariables::add('SYS_CREDENTIALS', $pmDynaform->getCredentials());
ScriptVariables::add('SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));

View File

@@ -78,8 +78,7 @@ if (
// Get the label of previous task
if (!empty($fieldsDelegation['TAS_ID'])) {
$taskInstance = new ModelTask();
$fieldsCase['PREVIOUS_TASK'] = $taskInstance->title($fieldsDelegation['TAS_ID']);
$fieldsCase['PREVIOUS_TASK'] = ModelTask::title($fieldsDelegation['TAS_ID'])['title'];
}
// To enable information (dynaforms, steps) before claim a case

View File

@@ -10,8 +10,6 @@ use ProcessMaker\Model\User;
$conf = new Configurations();
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript("cases/main", false); //Adding a javascript file .js
$oHeadPublisher->addContent("cases/main"); //Adding a html file .html.
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = PMmemcached::getSingleton(config("system.workspace"));
@@ -151,7 +149,7 @@ global $translation;
$pmDynaform = new PmDynaform();
ScriptVariables::add('defaultOption', $defaultOption);
ScriptVariables::add('_nodeId', isset($confDefaultOption) ? $confDefaultOption : "PM_USERS");
ScriptVariables::add('SYS_CREDENTIALS', $pmDynaform->getCredentials());
ScriptVariables::add('SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));
@@ -163,4 +161,4 @@ ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED']));
ScriptVariables::add('userConfig', array(
"usr_uid" => $_SESSION['USER_LOGGED']
));
echo View::make('Views::home.home', compact("userCanAccess"))->render();
G::RenderPage("publish", "viena");

View File

@@ -15,8 +15,9 @@ try {
$urlLogin = (substr(SYS_SKIN, 0, 2) !== 'ux')? 'login' : '../main/login';
}
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60)]);
if (!$RBAC->singleSignOn) {
setcookie("singleSignOn", '0', time() + (24 * 60 * 60), '/');
setcookie('singleSignOn', '0', $cookieOptions);
if (!isset($_POST['form']) ) {
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error');
G::header('Location: login');
@@ -181,7 +182,7 @@ try {
EnterpriseClass::enterpriseSystemUpdate($loginInfo);
initUserSession($uid, $usr);
} else {
setcookie("singleSignOn", '1', time() + (24 * 60 * 60), '/');
setcookie('singleSignOn', '1', $cookieOptions);
$uid = $RBAC->userObj->fields['USR_UID'];
$usr = $RBAC->userObj->fields['USR_USERNAME'];
initUserSession($uid, $usr);
@@ -416,7 +417,7 @@ try {
$configS = System::getSystemConfiguration('', '', config("system.workspace"));
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block']:true;
if ($activeSession){
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
setcookie('PM-TabPrimary', 101010010, $cookieOptions);
}
// Update the User's last login date

View File

@@ -81,8 +81,8 @@ try {
}
}
/*----------------------------------********---------------------------------*/
setcookie('singleSignOn', '1', time() + (24 * 60 * 60), '/');
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60)]);
setcookie('singleSignOn', '1', $cookieOptions);
initUserSession(
$_SESSION['__USER_LOGGED_SSO__'],

View File

@@ -1,27 +1,4 @@
<?php
/**
* login.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.
*
*/
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
@@ -182,11 +159,11 @@ if (isset($_SESSION['USER_LOGGED'])) {
session_start();
session_regenerate_id();
if (PHP_VERSION < 5.2) {
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), "; HttpOnly");
} else {
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), null, false, true);
}
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60), 'httponly' => true]);
setcookie(session_name(), session_id(), $cookieOptions);
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60), 'path' => '/sys' . config('system.workspace'), 'httponly' => true]);
setcookie('workspaceSkin', SYS_SKIN, $cookieOptions);
if (strlen($msg) > 0) {
$_SESSION['G_MESSAGE'] = $msg;
@@ -323,14 +300,16 @@ $flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])
? $oConf->aConfig['login_enableForgotPassword']
: 'off';
setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), time() + (24 * 60 * 60), SYS_URI);
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60), 'path' => SYS_URI]);
setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), $cookieOptions);
$configS = System::getSystemConfiguration('', '', config("system.workspace"));
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block'] : true;
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60)]);
if ($activeSession) {
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
setcookie('PM-TabPrimary', 101010010, $cookieOptions);
} else {
setcookie("PM-TabPrimary", uniqid(), time() + (24 * 60 * 60), '/');
setcookie('PM-TabPrimary', uniqid(), $cookieOptions);
}
$oHeadPublisher->addScriptCode("var flagForgotPassword = '$flagForgotPassword';");

View File

@@ -1,28 +1,5 @@
<?php
/**
* sysLogin.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.
*
*/
/*----------------------------------********---------------------------------*/
//Browser Compatibility
$browserSupported = G::checkBrowserCompatibility();
if ($browserSupported==false) {
@@ -50,11 +27,14 @@ if (!empty($_SESSION['G_MESSAGE_TYPE'])) {
}
//Initialize session
@session_destroy();
session_start();
session_regenerate_id();
//Set options for PHP session cookie
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60), 'httponly' => true]);
setcookie(session_name(), session_id(), $cookieOptions);
//Restore session variables
$_SESSION = array_merge($_SESSION, $arraySession);
@@ -169,8 +149,12 @@ switch (WS_IN_LOGIN) {
$fileLogin = 'login/sysLogin';
break;
}
setcookie("PM-Warning", trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), time() + (24 * 60 * 60), SYS_CURRENT_URI);
setcookie("PM-TabPrimary", uniqid(), time() + (24 * 60 * 60), '/');
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60), 'path' => SYS_CURRENT_URI]);
setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), $cookieOptions);
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60)]);
setcookie('PM-TabPrimary', uniqid(), $cookieOptions);
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/src/PM.js');
$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js');

View File

@@ -34,6 +34,9 @@ if (isset($_GET['BROWSER_TIME_ZONE_OFFSET'])) {
$caseFields = $case->loadCase($applicationUid, $delIndex);
//this value is only important for Propel::getConnection()
$_SESSION['PROCESS'] = $caseFields['PRO_UID'];
// Updating case variables with system constants
$systemConstants = G::getSystemConstants();
$caseFields['APP_DATA']['USER_LOGGED'] = $systemConstants['USER_LOGGED'];

View File

@@ -42,7 +42,6 @@ switch ($option) {
$oHeadPublisher->assign("SYSINFO_GD", "\"" . $systemInfo->gd->version . "\", " . (($systemInfo->gd->result)? 1 : 0));
$oHeadPublisher->assign("SYSINFO_MULTIBYTESTRING", "\"" . $systemInfo->multibyte->version . "\", " . (($systemInfo->multibyte->result)? 1 : 0));
$oHeadPublisher->assign("SYSINFO_SOAP", "\"" . $systemInfo->soap->version . "\", " . (($systemInfo->soap->result)? 1 : 0));
$oHeadPublisher->assign("SYSINFO_MCRYPT", "\"" . $systemInfo->mcrypt->version . "\", " . (($systemInfo->mcrypt->result)? 1 : 0));
$oHeadPublisher->assign("SYSINFO_LDAP", "\"" . $systemInfo->ldap->version . "\", " . (($systemInfo->ldap->result)? 1 : 0));
$oHeadPublisher->assign("SYSINFO_MEMORYLIMIT", "\"" . $systemInfo->memory->version . "\", " . (($systemInfo->memory->result)? 1 : 0));

View File

@@ -132,7 +132,7 @@ try {
$data = [['LAN_ID' => '', 'LAN_NAME' => '- ' . G::LoadTranslation('ID_NONE') . ' -']];
foreach ($languages as $lang) {
$data[] = [
'LAN_ID' => $lang['LOCALE'],
'LAN_ID' => strtolower($lang['LAN_ID']),
'LAN_NAME' => $lang['LANGUAGE']
];
}

View File

@@ -48,5 +48,8 @@
<cssFile file="sprite.css" enabledBrowsers="ALL" disabledBrowsers="ie7"></cssFile>
<cssFile file="rtl.css" enabledBrowsers="ALL" disabledBrowsers=""></cssFile>
</extjs>
<viena>
<cssFile file="app.css" enabledBrowsers="ALL" disabledBrowsers=""></cssFile>
</viena>
</cssFiles>
</skinConfiguration>

View File

@@ -0,0 +1,595 @@
.v-sidebar-menu {
position: fixed;
top: 0;
left: 0;
height: 100vh;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
z-index: 999;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
-webkit-transition: 0.3s max-width;
transition: 0.3s max-width;
}
.v-sidebar-menu * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.v-sidebar-menu > .vsm--list {
width: 100%;
height: 100%;
overflow-y: auto;
overflow-x: hidden;
}
.v-sidebar-menu .vsm--dropdown > .vsm--list {
padding: 5px;
background-color: #0099dd;
}
.v-sidebar-menu .vsm--item {
position: relative;
display: block;
}
.vsm_collapsed .vsm--item {
margin-left: 0px;
}
.v-sidebar-menu .vsm--link {
cursor: pointer;
position: relative;
display: block;
font-size: 14px;
font-weight: 400;
padding: 8px 8px 8px 0px;
line-height: 30px;
text-decoration: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
z-index: 20;
-webkit-transition: 0.3s all;
transition: 0.3s all;
}
.v-sidebar-menu .vsm--link_exact-active,
.v-sidebar-menu .vsm--link_active {
font-weight: 600;
}
.v-sidebar-menu .vsm--link_disabled {
opacity: 0.4;
pointer-events: none;
}
.v-sidebar-menu .vsm--link_level-1 .vsm--icon {
line-height: 30px;
width: 30px;
text-align: center;
border-radius: 3px;
margin-right: 0px;
margin-left: 10px;
}
.v-sidebar-menu .vsm--link:after {
content: "";
display: block;
clear: both;
}
.v-sidebar-menu .vsm--link_mobile-item {
background-color: #0099dd;
}
.v-sidebar-menu .vsm--link_mobile-item.vsm--link_hover,
.v-sidebar-menu .vsm--link_mobile-item:hover {
background-color: #5aa4c4 !important;
}
.v-sidebar-menu .vsm--title {
display: block;
white-space: nowrap;
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.v-sidebar-menu .vsm--icon {
float: left;
line-height: 30px;
margin-right: 10px;
}
.vsm--link_level-2 > .vsm--icon {
margin-top: 0px;
padding-left: 20px;
}
.v-sidebar-menu .vsm--arrow {
width: 30px;
text-align: center;
font-style: normal;
font-weight: 900;
position: absolute;
right: 10px;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
-webkit-transition: 0.3s -webkit-transform;
transition: 0.3s -webkit-transform;
transition: 0.3s transform;
transition: 0.3s transform, 0.3s -webkit-transform;
}
.v-sidebar-menu .vsm--arrow:after {
content: "\F0A9";
font-family: "Font Awesome 5 Free";
}
.v-sidebar-menu .vsm--arrow_open {
-webkit-transform: translateY(-50%) rotate(90deg);
transform: translateY(-50%) rotate(90deg);
}
.v-sidebar-menu .vsm--arrow_slot:after {
display: none;
}
.v-sidebar-menu .vsm--header {
font-size: 14px;
font-weight: 600;
padding: 10px;
white-space: nowrap;
text-transform: uppercase;
}
.v-sidebar-menu .vsm--badge {
position: absolute;
right: 10px;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
border-radius: 11px;
}
.v-sidebar-menu .vsm--badge_default {
padding: 0px 6px;
font-size: 12px;
border-radius: 3px;
height: 20px;
line-height: 20px;
font-weight: 600;
text-transform: uppercase;
}
.v-sidebar-menu .vsm--toggle-btn {
display: block;
text-align: center;
font-style: normal;
font-weight: 900;
height: 50px;
cursor: pointer;
border: none;
width: 100%;
}
.v-sidebar-menu .vsm--toggle-btn:after {
content: "\F337";
font-family: "Font Awesome 5 Free";
}
.v-sidebar-menu .vsm--toggle-btn_slot:after {
display: none;
}
.v-sidebar-menu.vsm_collapsed .vsm--link_level-1.vsm--link_hover,
.v-sidebar-menu.vsm_collapsed .vsm--link_level-1:hover {
background-color: transparent !important;
}
.v-sidebar-menu.vsm_collapsed .vsm--link_level-1 .vsm--icon,
.v-sidebar-menu.vsm_collapsed .vsm--link_level-2 > .vsm--icon {
margin-right: 0px;
padding-left: 0px;
}
.v-sidebar-menu.vsm_rtl {
right: 0;
left: inherit;
text-align: right;
}
.v-sidebar-menu.vsm_rtl > .vsm--list {
direction: rtl;
}
.v-sidebar-menu.vsm_rtl.vsm_collapsed
> .vsm--list
.vsm--link_level-1
.vsm--icon {
margin-left: 0px;
}
.v-sidebar-menu.vsm_rtl .vsm--icon {
float: right;
margin-left: 10px;
margin-right: 0px;
}
.v-sidebar-menu.vsm_rtl .vsm--arrow {
left: 10px;
right: inherit;
}
.v-sidebar-menu.vsm_rtl .vsm--badge {
left: 10px;
right: inherit;
}
.v-sidebar-menu .expand-enter-active,
.v-sidebar-menu .expand-leave-active {
-webkit-transition: height 0.35s ease;
transition: height 0.35s ease;
overflow: hidden;
}
.v-sidebar-menu .expand-enter,
.v-sidebar-menu .expand-leave-to {
height: 0 !important;
}
.v-sidebar-menu .slide-animation-enter-active {
-webkit-animation: slide-animation 0.2s;
animation: slide-animation 0.2s;
}
.v-sidebar-menu .slide-animation-leave-active {
animation: slide-animation 0.2s reverse;
}
@-webkit-keyframes slide-animation {
0% {
width: 0%;
}
100% {
width: 100%;
}
}
@keyframes slide-animation {
0% {
width: 0%;
}
100% {
width: 100%;
}
}
.v-sidebar-menu .vsm--mobile-item > .vsm--item {
padding-top: 0 !important;
margin-top: 0 !important;
}
.v-sidebar-menu {
background-color: #0099dd;
}
.v-sidebar-menu .vsm--scroll-wrapper {
height: 100%;
overflow-y: auto;
overflow-x: hidden;
}
.v-sidebar-menu .vsm--link {
color: #fff;
}
.v-sidebar-menu .vsm--link_exact-active,
.v-sidebar-menu .vsm--link_active {
color: #fff;
background: #5aa4c4;
}
.v-sidebar-menu .vsm--link_level-1 .vsm--link_exact-active,
.v-sidebar-menu .vsm--link_level-1 .vsm--link_active {
-webkit-box-shadow: 3px 0px 0px 0px #3397e1 inset;
box-shadow: 3px 0px 0px 0px #3397e1 inset;
}
.v-sidebar-menu .vsm--link_level-1.vsm--link_exact-active .vsm--icon,
.v-sidebar-menu .vsm--link_level-1.vsm--link_active .vsm--icon {
color: #fff;
}
a.router-link-exact-active.router-link-active.vsm--link.vsm--link_level-2.vsm--link_active.vsm--link_exact-active {
background: #5aa4c4;
}
.v-sidebar-menu .vsm--link_hover,
.v-sidebar-menu .vsm--link:hover {
color: #fff;
background-color: #5aa4c4;
}
.v-sidebar-menu .vsm--dropdown .vsm--link:hover {
color: #fff;
background-color: #5aa4c4;
}
.v-sidebar-menu .vsm--link_mobile-item {
color: #fff;
}
.v-sidebar-menu .vsm--link_mobile-item.vsm--link_hover,
.v-sidebar-menu .vsm--link_mobile-item:hover {
color: #fff;
}
.v-sidebar-menu.vsm_collapsed .vsm--link_level-1.vsm--link_hover .vsm--icon,
.v-sidebar-menu.vsm_collapsed .vsm--link_level-1:hover .vsm--icon {
color: #fff;
background-color: #0099dd;
}
.v-sidebar-menu .vsm--dropdown .vsm--link {
color: #fff;
background-color: #0099dd;
}
.vsm--link_level-2:hover .vsm--title,
.vsm--link_level-2:hover .vsm--icon {
color: #fff;
}
.v-sidebar-menu .vsm--mobile-bg {
background-color: #5aa4c4;
}
.v-sidebar-menu.vsm_expanded .vsm--item_open .vsm--link_level-1 {
color: #fff;
background-color: #5aa4c4;
}
.v-sidebar-menu.vsm_expanded .vsm--item_open .vsm--link_level-1 .vsm--icon {
color: #fff;
background-color: #5aa4c4;
}
.v-sidebar-menu.vsm_rtl .vsm--link_level-1.vsm--link_active,
.v-sidebar-menu.vsm_rtl .vsm--link_level-1.vsm--link_exact-active {
-webkit-box-shadow: -3px 0px 0px 0px #3397e1 inset;
box-shadow: -3px 0px 0px 0px #9ac5c7 inset;
}
.v-sidebar-menu .vsm--header {
color: rgba(255, 255, 255, 0.7);
}
.v-sidebar-menu .vsm--badge_default {
color: #fff;
background-color: #1e1e21;
}
.v-sidebar-menu .vsm--toggle-btn {
color: #222222;
background-color: #fff;
}
.vsm--item > .vsm--item_open {
color: #fff;
background-color: #9ac5c7;
}
.vsm--item > .vsm--item_open .vsm--icon {
color: #9ac5c7;
}
.v-sidebar-menu
.vsm--dropdown
> .vsm--list
.vsm--link.vsm--link_level-2.vsm--item_open {
color: #9ac5c7;
background-color: #5aa4c4;
}
.bs-frame-ltr {
height: calc(100vh - 0.1em);
overflow-y: hidden;
float: right;
}
.bs-frame-rtl {
height: calc(100vh - 0.1em);
overflow-y: hidden;
float: left;
}
.v-sidebar-menu .vsm--arrow-rtl:after {
content: "\F0A9" !important;
font-family: "Font Awesome 5 Free";
}
.v-sidebar-menu .vsm--arrow.vsm--arrow_open-rtl {
-webkit-transform: translateY(-50%) rotate(90deg);
transform: translateY(-50%) rotate(270deg) !important;
}
.vsm--mobile-item {
max-width: 210px !important;
}
/* Styles */
a {
color: #0099dd;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #5aa4c4;
/* text-decoration: none; */
background-color: transparent;
}
#home {
padding-left: 260px;
-webkit-transition: 0.3s;
transition: 0.3s;
}
#home.collapsed {
padding-left: 50px;
}
#home.onmobile {
padding-left: 50px;
}
.container {
max-width: 1500px;
}
.bg-primary-pm {
background-color: #0099dd;
}
/** table section **/
.table thead th {
vertical-align: bottom;
border-bottom: 2px solid #dee2e6;
}
.card-body {
background-color: #5aa4c4;
color: #fff;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-height: 1px;
padding: 1.25rem;
}
.text-muted {
color: #fff !important;
}
.filter-field {
display: flex;
}
.page-item.active .page-link {
z-index: 3;
color: #fff;
background-color: #4b246d;
border-color: #4b246d;
}
.page-link {
position: relative;
display: block;
padding: 0.5rem 0.75rem;
margin-left: -1px;
line-height: 1.25;
color: #4b246d;
background-color: #fff;
border: 1px solid #dee2e6;
}
.comment > button {
color: #fff;
background-color: #0099dd;
border-color: #0099dd;
}
.comment > button:hover {
color: #fff;
background-color: #5aa4c4;
border-color: #5aa4c4;
}
.vp-btn-secondary {
color: #2f3133;
background-color: #b5b6b6;
}
.vp-btn-secondary:hover {
color: #fff;
background-color: #6c757d;
border-color: #6c757d;
}
.vp-btn-primary-inactive {
color: #6c757d;
background-color: #0099dd;
border-color: #0099dd;
}
.vp-btn-primary-inactive:hover {
color: #6c757d;
background-color: #5aa4c4;
border-color: #5aa4c4;
}
.v-pm-drill-down-number.btn-primary {
color: #fff;
background-color: #0099dd;
border-color: #0099dd;
}
.v-pm-drill-down-number.btn-primary.focus,
.v-pm-drill-down-number.btn-primary:focus,
.v-pm-drill-down-number.btn-primary:hover {
color: #fff;
background-color: #5aa4c4;
border-color: #5aa4c4;
}
.v-pm-drill-down-number.btn-primary.focus,
.v-pm-drill-down-number.btn-primary:focus {
box-shadow: 0 0 0 0.2rem rgba(108, 72, 180, 0.5);
}
.v-pm-drill-down-number.btn-primary.disabled,
.v-pm-drill-down-number.btn-primary:disabled {
color: #fff;
background-color: #0099dd;
border-color: #0099dd;
}
.v-pm-drill-down-number.btn-primary:not(:disabled):not(.disabled).active,
.v-pm-drill-down-number.btn-primary:not(:disabled):not(.disabled):active,
.show > .v-pm-drill-down-number.btn-primary.dropdown-toggle {
color: #fff;
background-color: #4b246d;
border-color: #4b246d;
}
.v-pm-drill-down-number.btn-primary:not(:disabled):not(.disabled).active:focus,
.v-pm-drill-down-number.btn-primary:not(:disabled):not(.disabled):active:focus,
.show > .v-pm-drill-down-number.btn-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(108, 72, 180, 0.5);
}
.btn-link {
font-weight: 400;
color: #4b246d;
text-decoration: none;
}
.btn-link:hover {
font-weight: 400;
color: #5aa4c4;
text-decoration: none;
}
.custom-control-input:checked ~ .custom-control-label::before {
color: #fff;
border-color: #4b246d;
background-color: #4b246d;
}

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="/webapp/css/app.css">
</head>
<body>
{bodyTemplate}
<div id="app">
</div>
</body>
<script type="text/javascript" src="/webapp/js/home/main.js"></script>
{header}
</html>

View File

@@ -36,6 +36,7 @@ class SkinEngine
private $layoutFileRaw = array();
private $layoutFileTracker = array();
private $layoutFileSubmenu = array();
private $layoutFileViena = array();
private $cssFileName = '';
@@ -93,7 +94,7 @@ class SkinEngine
$layoutFileRaw = $this->skinsBasePath . 'base' . PATH_SEP . 'layout-raw.html';
$layoutFileTracker = $this->skinsBasePath . 'base' . PATH_SEP . 'layout-tracker.html';
$layoutFileSubmenu = $this->skinsBasePath . 'base' . PATH_SEP . 'layout-submenu.html';
$layoutFileViena = $this->skinsBasePath . 'base' . PATH_SEP . 'layout-viena.html';
//Based on requested Skin look if there is any registered with that name
if (strtolower($this->mainSkin) != "classic") {
@@ -137,6 +138,9 @@ class SkinEngine
if (file_exists($skinObject . PATH_SEP . 'layout-submenu.html')) {
$layoutFileSubmenu = $skinObject . PATH_SEP . 'layout-submenu.html';
}
if (file_exists($skinObject . PATH_SEP . 'layout-viena.html')) {
$layoutFileViena = $skinObject . PATH_SEP . 'layout-viena.html';
}
}
$this->layoutFile = pathInfo($layoutFile);
@@ -145,6 +149,7 @@ class SkinEngine
$this->layoutFileTracker = pathInfo($layoutFileTracker);
$this->layoutFileRaw = pathInfo($layoutFileRaw);
$this->layoutFileSubmenu = pathInfo($layoutFileSubmenu);
$this->layoutFileViena = pathInfo($layoutFileViena);
$this->cssFileName = $this->mainSkin;
@@ -329,6 +334,26 @@ class SkinEngine
echo $template->getOutputContent();
}
private function _viena()
{
$oHeadPublisher = headPublisher::getSingleton();
$styles = "";
$header = $oHeadPublisher->getExtJsVariablesScript();
$header = $oHeadPublisher->getExtJsStylesheets($this->cssFileName . "-viena");
$templateFile = $this->layoutFile['dirname'] . PATH_SEP . $this->layoutFileViena['basename'];
if (file_exists($templateFile)) {
$body = ScriptVariables::render();
$template = new TemplatePower($templateFile);
$template->prepare();
$template->assign('header', $header);
$template->assign('bodyTemplate', $body);
echo $template->getOutputContent();
} else {
$userCanAccess = 1;
echo View::make('Views::home.home', compact("userCanAccess"))->render();
}
}
private function _blank()
{

View File

@@ -1343,6 +1343,10 @@ class AbstractCases implements CasesInterface
*/
public function setProperties(array $properties)
{
// Filter by category
if (!empty($properties['category'])) {
$this->setCategoryId($properties['category']);
}
// Filter by process
if (!empty($properties['process'])) {
$this->setProcessId($properties['process']);
@@ -1552,16 +1556,16 @@ class AbstractCases implements CasesInterface
$list = end($listArray);
switch ($list) {
case 'Inbox':
$query->inbox($this->getUserId());
$query->inboxMetrics();
break;
case 'Draft':
$query->draft($this->getUserId());
$query->draftMetrics();
break;
case 'Paused':
$query->paused($this->getUserId());
$query->pausedMetrics();
break;
case 'Unassigned':
$query->selfService($this->getUserUid());
$query->selfServiceMetrics();
break;
}
$query->joinProcess();
@@ -1604,16 +1608,16 @@ class AbstractCases implements CasesInterface
$list = end($listArray);
switch ($list) {
case 'Inbox':
$query->inbox($this->getUserId());
$query->inboxMetrics();
break;
case 'Draft':
$query->draft($this->getUserId());
$query->draftMetrics();
break;
case 'Paused':
$query->paused($this->getUserId());
$query->pausedMetrics();
break;
case 'Unassigned':
$query->selfService($this->getUserUid());
$query->selfServiceMetrics();
break;
}
$query->joinProcess();
@@ -1657,16 +1661,16 @@ class AbstractCases implements CasesInterface
$list = end($listArray);
switch ($list) {
case 'Inbox':
$query->inbox($this->getUserId());
$query->inboxMetrics();
break;
case 'Draft':
$query->draft($this->getUserId());
$query->draftMetrics();
break;
case 'Paused':
$query->paused($this->getUserId());
$query->pausedMetrics();
break;
case 'Unassigned':
$query->selfService($this->getUserUid());
$query->selfServiceMetrics();
break;
}
$query->joinProcess();

View File

@@ -6,6 +6,8 @@ use G;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User;
class Draft extends AbstractCases
@@ -15,6 +17,7 @@ class Draft extends AbstractCases
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process
'TASK.TAS_TITLE', // Task
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
@@ -66,6 +69,10 @@ class Draft extends AbstractCases
if (!empty($this->getCaseTitle())) {
$query->title($this->getCaseTitle());
}
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Specific process
if ($this->getProcessId()) {
$query->processId($this->getProcessId());
@@ -112,6 +119,9 @@ class Draft extends AbstractCases
$results = $query->get();
// Prepare the result
$results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get priority label
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
@@ -127,10 +137,25 @@ class Draft extends AbstractCases
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);
// Get the send by related to the previous index
$previousThread = Delegation::getThreadInfo($item['APP_NUMBER'], $item['DEL_PREVIOUS']);
$userInfo = !empty($previousThread) ? User::getInformation($previousThread['USR_ID']) : [];
$userInfo = [];
$dummyInfo = [];
if (!empty($previousThread)) {
// When the task has an user
$userInfo = ($previousThread['USR_ID'] !== 0) ? User::getInformation($previousThread['USR_ID']) : [];
// When the task does not have users refers to dummy task
$taskInfo = ($previousThread['USR_ID'] === 0) ? Task::title($previousThread['TAS_ID']) : [];
if (!empty($taskInfo)) {
$dummyInfo = [
'task_id' => $previousThread['TAS_ID'],
'name' => $taskInfo['title'],
'type' => $taskInfo['type']
];
}
}
$result = [];
$result['del_previous'] = $item['DEL_PREVIOUS'];
$result['user_tooltip'] = $userInfo;
$result['dummy_task'] = $dummyInfo;
$item['SEND_BY_INFO'] = $result;
return $item;
@@ -183,6 +208,11 @@ class Draft extends AbstractCases
$query = Delegation::query()->select();
// Add the initial scope for draft cases
$query->draft($this->getUserId());
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters
$this->filters($query);
// Return the number of rows
@@ -228,4 +258,16 @@ class Draft extends AbstractCases
'total' => $count
];
}
/**
* Count how many cases there are in DRAFT
*
* @return int
*/
public function getCounterMetrics()
{
$query = Delegation::query()->select();
$query->draftMetrics();
return $query->count(['APPLICATION.APP_NUMBER']);
}
}

View File

@@ -38,7 +38,9 @@ class Home
/**
* Get the draft cases.
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -47,10 +49,12 @@ class Home
* @param string $filterCases
* @param string $sort
* @param callable $callback
*
* @return array
*/
public function getDraft(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -67,6 +71,7 @@ class Home
$properties['caseNumber'] = $caseNumber;
$properties['caseTitle'] = $caseTitle;
$properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process;
$properties['task'] = $task;
// Get the user that access to the API
@@ -87,7 +92,9 @@ class Home
/**
* Get the inbox cases.
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -99,10 +106,12 @@ class Home
* @param string $sort
* @param string $sendBy
* @param callable $callback
*
* @return array
*/
public function getInbox(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -124,6 +133,7 @@ class Home
$properties['delegateFrom'] = $delegateFrom;
$properties['delegateTo'] = $delegateTo;
$properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process;
$properties['task'] = $task;
// Get the user that access to the API
@@ -145,7 +155,9 @@ class Home
/**
* Get the unassigned cases.
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -157,10 +169,12 @@ class Home
* @param string $sort
* @param string $sendBy
* @param callable $callback
*
* @return array
*/
public function getUnassigned(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -182,6 +196,7 @@ class Home
$properties['delegateFrom'] = $delegateFrom;
$properties['delegateTo'] = $delegateTo;
$properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process;
$properties['task'] = $task;
// Get the user that access to the API
@@ -205,7 +220,9 @@ class Home
/**
* Get the paused cases.
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -217,10 +234,12 @@ class Home
* @param string $sort
* @param string $sendBy
* @param callable $callback
*
* @return array
*/
public function getPaused(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -242,6 +261,7 @@ class Home
$properties['delegateFrom'] = $delegateFrom;
$properties['delegateTo'] = $delegateTo;
$properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process;
$properties['task'] = $task;
// Get the user that access to the API
@@ -263,6 +283,7 @@ class Home
/**
* Build the columns and data from the custom list.
*
* @param string $type
* @param int $id
* @param array $arguments
@@ -339,14 +360,16 @@ class Home
}
};
}
$arguments[1] = $proId;
$arguments[2] = $proId;
}
}
/**
* Get the custom draft cases.
*
* @param int $id
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -355,11 +378,13 @@ class Home
* @param string $filterCases
* @param string $sort
* @param array $customFilters
*
* @return array
*/
public function getCustomDraft(
int $id,
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -372,6 +397,7 @@ class Home
{
$arguments = [
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -382,7 +408,7 @@ class Home
];
//clear duplicate indexes
$keys = ['caseNumber', 'process', 'task', 'limit', 'offset', 'caseTitle', 'filterCases', 'sort'];
$keys = ['caseNumber', 'category', 'process', 'task', 'limit', 'offset', 'caseTitle', 'filterCases', 'sort'];
foreach ($keys as $value) {
unset($customFilters[$value]);
}
@@ -398,8 +424,10 @@ class Home
/**
* Get the custom inbox cases.
*
* @param int $id
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -411,11 +439,13 @@ class Home
* @param string $sort
* @param string $sendBy
* @param array $customFilters
*
* @return array
*/
public function getCustomInbox(
int $id,
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -431,6 +461,7 @@ class Home
{
$arguments = [
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -444,7 +475,7 @@ class Home
];
//clear duplicate indexes
$keys = ['caseNumber', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
$keys = ['caseNumber', 'category', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
foreach ($keys as $value) {
unset($customFilters[$value]);
}
@@ -460,8 +491,10 @@ class Home
/**
* Get the custom unassigned cases.
*
* @param int $id
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -473,11 +506,13 @@ class Home
* @param string $sort
* @param string $sendBy
* @param array $customFilters
*
* @return array
*/
public function getCustomUnassigned(
int $id,
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -493,6 +528,7 @@ class Home
{
$arguments = [
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -506,7 +542,7 @@ class Home
];
//clear duplicate indexes
$keys = ['caseNumber', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
$keys = ['caseNumber', 'category', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
foreach ($keys as $value) {
unset($customFilters[$value]);
}
@@ -522,8 +558,10 @@ class Home
/**
* Get the custom paused cases.
*
* @param int $id
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -535,11 +573,13 @@ class Home
* @param string $sort
* @param string $sendBy
* @param array $customFilters
*
* @return array
*/
public function getCustomPaused(
int $id,
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -555,6 +595,7 @@ class Home
{
$arguments = [
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -568,7 +609,7 @@ class Home
];
//clear duplicate indexes
$keys = ['caseNumber', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
$keys = ['caseNumber', 'category', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
foreach ($keys as $value) {
unset($customFilters[$value]);
}

View File

@@ -6,6 +6,8 @@ use G;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User;
class Inbox extends AbstractCases
@@ -15,6 +17,7 @@ class Inbox extends AbstractCases
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process
'TASK.TAS_TITLE', // Task
'USERS.USR_USERNAME', // Current UserName
@@ -69,6 +72,10 @@ class Inbox extends AbstractCases
if (!empty($this->getCaseTitle())) {
$query->title($this->getCaseTitle());
}
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Specific process
if ($this->getProcessId()) {
$query->processId($this->getProcessId());
@@ -81,7 +88,6 @@ class Inbox extends AbstractCases
if (!empty($this->getCaseUid())) {
$query->appUid($this->getCaseUid());
}
// Specific delegate date from
if (!empty($this->getDelegateFrom())) {
$query->delegateDateFrom($this->getDelegateFrom());
@@ -90,8 +96,7 @@ class Inbox extends AbstractCases
if (!empty($this->getDelegateTo())) {
$query->delegateDateTo($this->getDelegateTo());
}
// Specific usrId represented by sendBy.
// Specific usrId represented by sendBy
if (!empty($this->getSendBy())) {
$query->sendBy($this->getSendBy());
}
@@ -113,7 +118,7 @@ class Inbox extends AbstractCases
// Join with users
$query->joinUser();
// Join with task
$query->JoinTask();
$query->joinTask();
// Join with application for add the initial scope for TO_DO cases
$query->inbox($this->getUserId());
/** Apply filters */
@@ -132,6 +137,9 @@ class Inbox extends AbstractCases
$results = $query->get();
// Prepare the result
$results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get priority label
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
@@ -147,10 +155,26 @@ class Inbox extends AbstractCases
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);
// Get the send by related to the previous index
$previousThread = Delegation::getThreadInfo($item['APP_NUMBER'], $item['DEL_PREVIOUS']);
$userInfo = !empty($previousThread) ? User::getInformation($previousThread['USR_ID']) : [];
$userInfo = [];
$dummyInfo = [];
if (!empty($previousThread)) {
// When the task has an user
$userInfo = ($previousThread['USR_ID'] !== 0) ? User::getInformation($previousThread['USR_ID']) : [];
// When the task does not have users refers to dummy task
$taskInfo = ($previousThread['USR_ID'] === 0) ? Task::title($previousThread['TAS_ID']) : [];
if (!empty($taskInfo)) {
$dummyInfo = [
'task_id' => $previousThread['TAS_ID'],
'name' => $taskInfo['title'],
'type' => $taskInfo['type']
];
}
}
$result = [];
$result['del_previous'] = $item['DEL_PREVIOUS'];
$result['key_name'] = !empty($userInfo) ? 'user_tooltip' : 'dummy_task';
$result['user_tooltip'] = $userInfo;
$result['dummy_task'] = $dummyInfo;
$item['SEND_BY_INFO'] = $result;
return $item;
@@ -201,6 +225,11 @@ class Inbox extends AbstractCases
$query = Delegation::query()->select();
// Scope that sets the queries for List Inbox
$query->inbox($this->getUserId());
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters
$this->filters($query);
// Return the number of rows
@@ -246,4 +275,16 @@ class Inbox extends AbstractCases
'total' => $count
];
}
/**
* Count how many cases there are in TO_DO
*
* @return int
*/
public function getCounterMetrics()
{
$query = Delegation::query()->select();
$query->inboxMetrics();
return $query->count(['APP_DELEGATION.APP_NUMBER']);
}
}

View File

@@ -2,10 +2,12 @@
namespace ProcessMaker\BusinessModel\Cases;
use G;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\AppNotes;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User;
class Participated extends AbstractCases
@@ -15,6 +17,7 @@ class Participated extends AbstractCases
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process Name
'TASK.TAS_TITLE', // Pending Task
'TASK.TAS_ASSIGN_TYPE', // Task assign rule
@@ -68,10 +71,14 @@ class Participated extends AbstractCases
// Specific case title
if (!empty($this->getCaseTitle())) {
// Get the result
$result = Delegation::casesThreadTitle($this->getCaseTitle(), $this->getOffset(), $this->getLimit());
$result = Delegation::casesThreadTitle($this->getCaseTitle());
// Add the filter
$query->specificCases($result);
}
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Scope to search for an specific process
if ($this->getProcessId()) {
$query->processId($this->getProcessId());
@@ -168,6 +175,9 @@ class Participated extends AbstractCases
$results = $query->get();
// Prepare the result
$results->transform(function ($item, $key) use ($filter) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Apply the date format defined in environment
$item['APP_CREATE_DATE_LABEL'] = !empty($item['APP_CREATE_DATE']) ? applyMaskDateEnvironment($item['APP_CREATE_DATE']): null;
$item['APP_FINISH_DATE_LABEL'] = !empty($item['APP_FINISH_DATE']) ? applyMaskDateEnvironment($item['APP_FINISH_DATE']): null;
@@ -367,6 +377,11 @@ class Participated extends AbstractCases
$query->lastThread();
break;
}
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters
$this->filters($query);
// Return the number of rows

View File

@@ -5,6 +5,8 @@ namespace ProcessMaker\BusinessModel\Cases;
use G;
use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User;
class Paused extends AbstractCases
@@ -14,6 +16,7 @@ class Paused extends AbstractCases
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process
'TASK.TAS_TITLE', // Task
'USERS.USR_USERNAME', // Current UserName
@@ -68,6 +71,10 @@ class Paused extends AbstractCases
if (!empty($this->getCaseTitle())) {
$query->title($this->getCaseTitle());
}
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Specific process
if ($this->getProcessId()) {
$query->processId($this->getProcessId());
@@ -80,7 +87,6 @@ class Paused extends AbstractCases
if (!empty($this->getCaseUid())) {
$query->appUid($this->getCaseUid());
}
// Specific delegate date from
if (!empty($this->getDelegateFrom())) {
$query->delegateDateFrom($this->getDelegateFrom());
@@ -89,8 +95,7 @@ class Paused extends AbstractCases
if (!empty($this->getDelegateTo())) {
$query->delegateDateTo($this->getDelegateTo());
}
// Specific usrId represented by sendBy.
// Specific usrId represented by sendBy
if (!empty($this->getSendBy())) {
$query->sendBy($this->getSendBy());
}
@@ -109,7 +114,7 @@ class Paused extends AbstractCases
// Join with process
$query->joinProcess();
// Join with task
$query->JoinTask();
$query->joinTask();
// Scope that set the paused cases
$query->paused($this->getUserId());
/** Apply filters */
@@ -126,6 +131,9 @@ class Paused extends AbstractCases
$results = $query->get();
// Prepare the result
$results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get priority label
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
@@ -141,10 +149,26 @@ class Paused extends AbstractCases
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);
// Get the send by related to the previous index
$previousThread = Delegation::getThreadInfo($item['APP_NUMBER'], $item['DEL_PREVIOUS']);
$userInfo = !empty($previousThread) ? User::getInformation($previousThread['USR_ID']) : [];
$userInfo = [];
$dummyInfo = [];
if (!empty($previousThread)) {
// When the task has an user
$userInfo = ($previousThread['USR_ID'] !== 0) ? User::getInformation($previousThread['USR_ID']) : [];
// When the task does not have users refers to dummy task
$taskInfo = ($previousThread['USR_ID'] === 0) ? Task::title($previousThread['TAS_ID']) : [];
if (!empty($taskInfo)) {
$dummyInfo = [
'task_id' => $previousThread['TAS_ID'],
'name' => $taskInfo['title'],
'type' => $taskInfo['type']
];
}
}
$result = [];
$result['del_previous'] = $item['DEL_PREVIOUS'];
$result['key_name'] = !empty($userInfo) ? 'user_tooltip' : 'dummy_task';
$result['user_tooltip'] = $userInfo;
$result['dummy_task'] = $dummyInfo;
$item['SEND_BY_INFO'] = $result;
return $item;
@@ -195,6 +219,11 @@ class Paused extends AbstractCases
$query = Delegation::query()->select();
// Scope that set the paused cases
$query->paused($this->getUserId());
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters
$this->filters($query);
// Return the number of rows
@@ -240,4 +269,16 @@ class Paused extends AbstractCases
'total' => $count
];
}
/**
* Count how many cases there are in PAUSED
*
* @return int
*/
public function getCounterMetrics()
{
$query = Delegation::query()->select();
$query->pausedMetrics();
return $query->count(['APP_DELEGATION.APP_NUMBER']);
}
}

View File

@@ -7,8 +7,7 @@ use ProcessMaker\Model\Application;
use ProcessMaker\Model\AppNotes;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Process;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\User;
use ProcessMaker\Model\ProcessCategory;
class Search extends AbstractCases
{
@@ -17,6 +16,7 @@ class Search extends AbstractCases
// Columns view in the cases list
'APPLICATION.APP_NUMBER', // Case #
'APPLICATION.APP_TITLE AS DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process
'APPLICATION.APP_STATUS', // Status
'APPLICATION.APP_CREATE_DATE', // Case create date
@@ -156,6 +156,9 @@ class Search extends AbstractCases
$results = $query->get();
// Prepare the result
$results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Apply the date format defined in environment
$item['APP_CREATE_DATE_LABEL'] = !empty($item['APP_CREATE_DATE']) ? applyMaskDateEnvironment($item['APP_CREATE_DATE']): null;
$item['APP_FINISH_DATE_LABEL'] = !empty($item['APP_FINISH_DATE']) ? applyMaskDateEnvironment($item['APP_FINISH_DATE']): null;

View File

@@ -2,9 +2,11 @@
namespace ProcessMaker\BusinessModel\Cases;
use G;
use ProcessMaker\Model\AppNotes;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\ProcessUser;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User;
class Supervising extends AbstractCases
@@ -14,6 +16,7 @@ class Supervising extends AbstractCases
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process Name
'TASK.TAS_TITLE', // Pending Task
'APPLICATION.APP_STATUS', // Status
@@ -66,10 +69,14 @@ class Supervising extends AbstractCases
// Specific case title
if (!empty($this->getCaseTitle())) {
// Get the result
$result = Delegation::casesThreadTitle($this->getCaseTitle(), $this->getOffset(), $this->getLimit());
$result = Delegation::casesThreadTitle($this->getCaseTitle());
// Add the filter
$query->specificCases($result);
}
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Scope to search for an specific process
if ($this->getProcessId()) {
$query->processId($this->getProcessId());
@@ -144,6 +151,9 @@ class Supervising extends AbstractCases
$results = $query->get();
// Prepare the result
$results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get task color label
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
@@ -243,6 +253,11 @@ class Supervising extends AbstractCases
$processes = ProcessUser::getProcessesOfSupervisor($this->getUserUid());
// Scope the specific array of processes supervising
$query->processInList($processes);
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters
$this->filters($query);
// Return the number of rows

View File

@@ -6,6 +6,8 @@ use G;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User;
class Unassigned extends AbstractCases
@@ -15,6 +17,7 @@ class Unassigned extends AbstractCases
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process
'TASK.TAS_TITLE', // Task
'USERS.USR_USERNAME', // Current UserName
@@ -69,6 +72,10 @@ class Unassigned extends AbstractCases
if ($this->getCaseTitle()) {
$query->title($this->getCaseTitle());
}
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Specific process
if ($this->getProcessId()) {
$query->processId($this->getProcessId());
@@ -90,8 +97,7 @@ class Unassigned extends AbstractCases
if (!empty($this->getDelegateTo())) {
$query->delegateDateTo($this->getDelegateTo());
}
// Specific usrId represented by sendBy.
// Specific usrId represented by sendBy
if (!empty($this->getSendBy())) {
$query->sendBy($this->getSendBy());
}
@@ -134,6 +140,9 @@ class Unassigned extends AbstractCases
$results = $query->get();
// Prepare the result
$results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get priority label
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
@@ -149,10 +158,26 @@ class Unassigned extends AbstractCases
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);
// Get the send by related to the previous index
$previousThread = Delegation::getThreadInfo($item['APP_NUMBER'], $item['DEL_PREVIOUS']);
$userInfo = !empty($previousThread) ? User::getInformation($previousThread['USR_ID']) : [];
$userInfo = [];
$dummyInfo = [];
if (!empty($previousThread)) {
// When the task has an user
$userInfo = ($previousThread['USR_ID'] !== 0) ? User::getInformation($previousThread['USR_ID']) : [];
// When the task does not have users refers to dummy task
$taskInfo = ($previousThread['USR_ID'] === 0) ? Task::title($previousThread['TAS_ID']) : [];
if (!empty($taskInfo)) {
$dummyInfo = [
'task_id' => $previousThread['TAS_ID'],
'name' => $taskInfo['title'],
'type' => $taskInfo['type']
];
}
}
$result = [];
$result['del_previous'] = $item['DEL_PREVIOUS'];
$result['key_name'] = !empty($userInfo) ? 'user_tooltip' : 'dummy_task';
$result['user_tooltip'] = $userInfo;
$result['dummy_task'] = $dummyInfo;
$item['SEND_BY_INFO'] = $result;
return $item;
@@ -203,6 +228,11 @@ class Unassigned extends AbstractCases
$query = Delegation::query()->select();
// Add the initial scope for self-service cases
$query->selfService($this->getUserUid());
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters
$this->filters($query);
// Return the number of rows
@@ -248,4 +278,16 @@ class Unassigned extends AbstractCases
'total' => $count
];
}
/**
* Count how many cases there are in SELF_SERVICE
*
* @return int
*/
public function getCounterMetrics()
{
$query = Delegation::query()->select();
$query->selfServiceMetrics();
return $query->count(['APP_DELEGATION.APP_NUMBER']);
}
}

View File

@@ -874,8 +874,8 @@ class Light
session_start();
session_regenerate_id();
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), null, false,
true);
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60), 'path' => '/sys' . config('system.workspace'), 'httponly' => true]);
setcookie('workspaceSkin', SYS_SKIN, $cookieOptions);
if (strlen($msg) > 0) {
$_SESSION['G_MESSAGE'] = $msg;

View File

@@ -138,7 +138,7 @@ class ChangeLogResult
$totalCount = 0;
$values = [];
$this->getLogsFromDataBase($this->appUid, function($row) use(&$logs, &$totalCount, &$values) {
$this->getLogsFromDataBase($this->appUid, function ($row) use (&$logs, &$totalCount, &$values) {
$appData = $this->getAppData($row['DATA']);
$this->removeVariables($appData);
@@ -146,22 +146,52 @@ class ChangeLogResult
if ((int) $row['SOURCE_ID'] === ChangeLog::FromABE) {
$hasPermission = true;
}
if (in_array((int) $row['EXECUTED_AT'], [ChangeLog::BEFORE_ASSIGNMENT, ChangeLog::BEFORE_ROUTING, ChangeLog::AFTER_ROUTING])) {
$hasPermission = true;
}
$count = 0;
foreach ($appData as $key => $value) {
if ($hasPermission && (!isset($values[$key]) || $values[$key] !== $value)) {
// Apply mask
$dateLabel = applyMaskDateEnvironment($row['DATE'],'', false);
$dateLabel = applyMaskDateEnvironment($row['DATE'], '', false);
// Apply the timezone
$dateLabel = DateTime::convertUtcToTimeZone($dateLabel);
$previousValue = !isset($values[$key]) ? null : $values[$key];
//get 'title' label
$objectTitle = '';
if ((int) $row['OBJECT_TYPE'] === ChangeLog::DYNAFORM) {
$objectTitle = G::LoadTranslation('ID_DYNAFORM') . ': ' . $row['DYN_TITLE'];
}
if ((int) $row['OBJECT_TYPE'] === ChangeLog::TRIGGER) {
if ((int) $row['EXECUTED_AT'] === ChangeLog::BEFORE_ASSIGNMENT) {
$objectTitle = G::LoadTranslation('ID_BEFORE_ASSIGNMENT');
}
if ((int) $row['EXECUTED_AT'] === ChangeLog::BEFORE_ROUTING) {
$objectTitle = G::LoadTranslation('ID_BEFORE_DERIVATION');
}
if ((int) $row['EXECUTED_AT'] === ChangeLog::AFTER_ROUTING) {
$objectTitle = G::LoadTranslation('ID_AFTER_DERIVATION');
}
}
//get 'from' label
$from = ChangeLog::getChangeLog()->getApplicationNameById($row['SOURCE_ID']);
if ((int) $row['SOURCE_ID'] === ChangeLog::FromUnknow) {
if ((int) $row['EXECUTED_AT'] === ChangeLog::BEFORE_ROUTING ||
(int) $row['EXECUTED_AT'] === ChangeLog::AFTER_ROUTING) {
$from = ChangeLog::getChangeLog()->getApplicationNameById(ChangeLog::FromWeb);
}
}
$record = ''
. G::LoadTranslation('ID_TASK') . ': ' . $row['TAS_TITLE'] . ' / '
. G::LoadTranslation('ID_DYNAFORM') . ': ' . $row['DYN_TITLE'] . ' / '
. $objectTitle . ' / '
. G::LoadTranslation('ID_LAN_UPDATE_DATE') . ': ' . $dateLabel . ' / '
. G::LoadTranslation('ID_USER') . ': ' . $row['USR_USERNAME'] . ' / '
. G::LoadTranslation('ID_FROM') . ': ' . ChangeLog::getChangeLog()->getApplicationNameById($row['SOURCE_ID']);
. G::LoadTranslation('ID_FROM') . ': ' . $from;
$struct = new LogStruct();
$struct->setField($key)
@@ -210,6 +240,7 @@ class ChangeLogResult
. "A.USR_ID, "
. "A.OBJECT_ID, "
. "A.OBJECT_UID, "
. "A.OBJECT_TYPE, "
. "A.EXECUTED_AT, "
. "A.SOURCE_ID, "
. "A.DATA, "
@@ -220,8 +251,8 @@ class ChangeLogResult
. "LEFT JOIN PROCESS AS C ON (C.PRO_ID=A.PRO_ID) "
. "LEFT JOIN TASK AS D ON (D.TAS_ID=A.TAS_ID) "
. "LEFT JOIN USERS AS E ON (E.USR_ID=A.USR_ID) "
. "LEFT JOIN DYNAFORM AS F ON (F.DYN_ID=A.OBJECT_ID AND A.OBJECT_TYPE=" . ChangeLog::DYNAFORM . ") "
. "ORDER BY A.DATE ASC ";
. "LEFT JOIN DYNAFORM AS F ON (F.DYN_ID=A.OBJECT_ID AND A.OBJECT_TYPE IN (" . ChangeLog::DYNAFORM . ", " . ChangeLog::TRIGGER . ")) "
. "ORDER BY A.CHANGE_LOG_ID,A.DATE ASC ";
$stmt = $conn->prepareStatement($sql);
$stmt->set(1, $appUid);

View File

@@ -86,6 +86,21 @@ class System
'disable_task_manager_routing_async' => '0',
'on_one_server_enable' => 0,
'at_risk_delegation_max_time' => '0.2',
'samesite_cookie_setting' => ''
];
public static $cookieDefaultOptions = [
'expires' => 0,
'path' => '/',
'domain' => '',
'secure' => false,
'httponly' => true,
'samesite' => ''
];
public static $cookieSameSiteValues = [
'Lax',
'Strict'
];
/**
@@ -1252,6 +1267,13 @@ class System
$config['at_risk_delegation_max_time'] = self::$defaultConfig['at_risk_delegation_max_time'];
}
$value = ucfirst(strtolower($config['samesite_cookie_setting']));
if (in_array($value, self::$cookieSameSiteValues)) {
$config['samesite_cookie_setting'] = $value;
} else {
$config['samesite_cookie_setting'] = '';
}
return $config;
}
@@ -1778,4 +1800,29 @@ class System
$parseDsn["pass"] = urldecode($parseDsn["pass"]);
return $parseDsn;
}
/**
* Build the options for a cookie, according to the system configuration and values optionally sent to this method
*
* @param array $options
* @return array
*/
public static function buildCookieOptions(array $options = [])
{
// Get system values
$cookieOptions = self::$cookieDefaultOptions;
$systemConfiguration = self::getSystemConfiguration();
// Always set "secure" option according to the server protocol
$cookieOptions['secure'] = G::is_https();
// Set the "samesite" option according to the system configuration
$cookieOptions['samesite'] = $systemConfiguration['samesite_cookie_setting'];
// Overrides the cookie options with the values sent to the method
$cookieOptions = array_merge($cookieOptions, $options);
// Return the cookie options
return $cookieOptions;
}
}

View File

@@ -222,7 +222,7 @@ abstract class Importer
foreach ($objectList as $rowObject) {
if ($rowObject['name'] === 'PROCESSDEFINITION') {
$onlyDiagram = true;
$this->removeProject($onlyDiagram);
$this->removeProject($onlyDiagram, $objectsToImport);
}
}
} catch (\Exception $e) {
@@ -453,7 +453,14 @@ abstract class Importer
$project->setDisabled();
}
public function removeProject($onlyDiagram = false)
/**
* Remove the project
*
* @param bool $onlyDiagram
* @param array $objectsToImport
* @return void
*/
public function removeProject($onlyDiagram = false, $objectsToImport = [])
{
/* @var $process \Process */
$processes = new \Processes();
@@ -464,7 +471,7 @@ abstract class Importer
$process->load($this->metadata["uid"]);
$this->currentProcessTitle = $process->getProTitle();
$project = \ProcessMaker\Project\Adapter\BpmnWorkflow::load($this->metadata["uid"]);
$project->remove(true, false, $onlyDiagram);
$project->remove(true, false, $onlyDiagram, $objectsToImport);
}
/**

View File

@@ -381,6 +381,15 @@ class CaseList extends Model
'typeSearch' => 'search text',
'enableFilter' => false,
'set' => true
], [
'list' => ['inbox', 'draft', 'paused', 'unassigned'],
'field' => 'process_category',
'name' => G::LoadTranslation('ID_PROCESS_CATEGORY'),
'type' => 'string',
'source' => 'APPLICATION',
'typeSearch' => 'search text',
'enableFilter' => false,
'set' => true
], [
'list' => ['inbox', 'draft', 'paused', 'unassigned'],
'field' => 'process_name',

View File

@@ -1069,6 +1069,64 @@ class Delegation extends Model
return $query;
}
/**
* Scope the Inbox cases no matter the user
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeInboxMetrics($query)
{
$query->joinApplication();
$query->status(Application::STATUS_TODO);
$query->threadOpen();
return $query;
}
/**
* Scope a draft cases no matter the user
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeDraftMetrics($query)
{
$query->joinApplication();
$query->status(Application::STATUS_DRAFT);
$query->threadOpen();
return $query;
}
/**
* Scope paused cases list no matter the user
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePausedMetrics($query)
{
$query->joinAppDelay('PAUSE');
$query->joinApplication();
return $query;
}
/**
* Scope a self service cases no matter the user
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeSelfServiceMetrics($query)
{
$query->taskAssignType('SELF_SERVICE');
$query->threadOpen()->withoutUserId();
return $query;
}
/**
* Get specific cases unassigned that the user can view
*
@@ -2123,12 +2181,10 @@ class Delegation extends Model
* Get cases filter by thread title
*
* @param string $search
* @param int $offset
* @param int $limit
*
* @return array
*/
public static function casesThreadTitle(string $search, int $offset = 0, int $limit = 15)
public static function casesThreadTitle(string $search)
{
// Get the case numbers related to this filter
$query = Delegation::query()->select(['APP_NUMBER']);
@@ -2136,8 +2192,6 @@ class Delegation extends Model
$query->title($search);
// Group by
$query->groupBy('APP_NUMBER');
// Apply the limit
$query->offset($offset)->limit($limit);
// Get the result
$results = $query->get();

View File

@@ -5,6 +5,11 @@ namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;
use ListUnassigned as PropelListUnassigned;
/**
* Class ListUnassigned
*
* @deprecated Class deprecated in Release 3.6.0
*/
class ListUnassigned extends Model
{
protected $table = "LIST_UNASSIGNED";

View File

@@ -78,6 +78,7 @@ class Process extends Model
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param string $proUid
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeProcess($query, $proUid)
@@ -90,6 +91,7 @@ class Process extends Model
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param string $title
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeTitle($query, $title)
@@ -102,6 +104,7 @@ class Process extends Model
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param string $status
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeNoStatus($query, $status = 'DISABLED')
@@ -120,6 +123,19 @@ class Process extends Model
return $query->where('PRO_SUBPROCESS', '=', 1);
}
/**
* Scope a query to include a specific process categoryId
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param int $category
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeCategoryId($query, $category)
{
return $query->where('PROCESS.CATEGORY_ID', $category);
}
/**
* Scope a query to include a specific process category
*
@@ -407,14 +423,14 @@ class Process extends Model
* Get all processes, paged optionally, can be sent a string to filter results by "PRO_TITLE"
*
* @param string $text
* @param string $category
* @param int $catId
* @param int $offset
* @param int $limit
* @param bool $paged
*
* @return array
*/
public static function getProcessesForHome($text = null, $category = null, $offset = null, $limit = null, $paged = true)
public static function getProcessesForHome($text = null, $catId = 0, $offset = null, $limit = null, $paged = true)
{
// Get base query
$query = Process::query()->select(['PRO_ID', 'PRO_TITLE']);
@@ -424,9 +440,9 @@ class Process extends Model
$query->title($text);
}
// Set "PRO_CATEGORY" condition if is sent
if (!is_null($category)) {
$query->category($category);
// Set "CATEGORY_ID" condition if is sent
if ($catId) {
$query->categoryId($catId);
}
// Set "PRO_STATUS" condition
@@ -452,6 +468,7 @@ class Process extends Model
* Return true if process is active, false otherwise.
* @param int|string $proId
* @param string $key
*
* @return bool
*/
public static function isActive($proId, string $key = 'PRO_ID'): bool

View File

@@ -17,6 +17,18 @@ class ProcessCategory extends Model
public $timestamps = false;
/**
* Scope a query to specific category id
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param int $category
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeCategory($query, $category)
{
return $query->where('CATEGORY_ID', $category);
}
/**
* Scope a query to specific category name
*
@@ -92,4 +104,22 @@ class ProcessCategory extends Model
return $query->first()->CATEGORY_ID;
}
}
/**
* Get category name
*
* @param int $category
*
* @return string
*/
public static function getCategory(int $category)
{
$query = ProcessCategory::query()->select(['CATEGORY_NAME']);
$query->category($category);
if ($query->first()) {
return $query->first()->CATEGORY_NAME;
} else {
return '';
}
}
}

View File

@@ -120,16 +120,18 @@ class Task extends Model
*
* @param integer $tasId
*
* @return string
* @return array
*/
public function title($tasId)
public static function title($tasId)
{
$query = Task::query()->select('TAS_TITLE');
$query = Task::query()->select('TAS_TITLE', 'TAS_TYPE');
$query->where('TAS_ID', $tasId);
$results = $query->get();
$title = '';
$results->each(function ($item, $key) use (&$title) {
$type = '';
$results->each(function ($item, $key) use (&$title, &$type) {
$title = $item->TAS_TITLE;
$type = $item->TAS_TYPE;
switch ($title) {
case "INTERMEDIATE-THROW-EMAIL-EVENT":
$title = G::LoadTranslation('ID_INTERMEDIATE_THROW_EMAIL_EVENT');
@@ -143,10 +145,41 @@ class Task extends Model
case "INTERMEDIATE-CATCH-TIMER-EVENT":
$title = G::LoadTranslation('ID_INTERMEDIATE_CATCH_TIMER_EVENT');
break;
case "SCRIPT-TASK":
$title = G::LoadTranslation('ID_SCRIPT_TASK_UNTITLED');
break;
case "SERVICE-TASK":
$title = G::LoadTranslation('ID_SERVICE_TASK_UNTITLED');
break;
default:
$title = G::LoadTranslation('ID_ANONYMOUS');
}
switch ($type) {
case "INTERMEDIATE-THROW-EMAIL-EVENT":
$type = G::LoadTranslation('ID_EMAIL_EVENT');
break;
case "INTERMEDIATE-THROW-MESSAGE-EVENT":
case "INTERMEDIATE-CATCH-MESSAGE-EVENT":
$type = G::LoadTranslation('ID_MESSAGE_EVENT');
break;
case "INTERMEDIATE-CATCH-TIMER-EVENT":
$type = G::LoadTranslation('ID_TIMER_EVENT');
break;
case "SCRIPT-TASK":
$type = G::LoadTranslation('ID_SCRIPT_TASK');
break;
case "SERVICE-TASK":
$type = G::LoadTranslation('ID_SERVICE_TASK');
break;
default:
$type = G::LoadTranslation('ID_NONE');
}
});
return $title;
return [
'title' => $title,
'type' => $type,
];
}
/**

View File

@@ -1248,10 +1248,19 @@ class BpmnWorkflow extends Project\Bpmn
}
}
public function remove($flagForceRemoveProject = false, $flagRemoveCases = true, $onlyDiagram = false)
/**
* Remove Project
*
* @param bool $flagForceRemoveProject
* @param bool $flagRemoveCases
* @param bool $onlyDiagram
* @param array $objectsToImport
* @return void
*/
public function remove($flagForceRemoveProject = false, $flagRemoveCases = true, $onlyDiagram = false, $objectsToImport = [])
{
parent::remove($flagForceRemoveProject);
$this->wp->remove($flagRemoveCases, $onlyDiagram);
$this->wp->remove($flagRemoveCases, $onlyDiagram, $objectsToImport);
}
public static function createFromStruct(array $projectData, $generateUid = true, $allData = null)

View File

@@ -87,9 +87,15 @@ class WorkflowBpmn extends Project\Workflow
return parent::getList($start, $limit, $filter, $changeCaseTo);
}
public function remove($flagRemoveCases = true, $onlyDiagram = false)
/**
* Remove project bpmn.
* @param bool $flagRemoveCases
* @param bool $onlyDiagram
* @param array $objectsToImport
*/
public function remove($flagRemoveCases = true, $onlyDiagram = false, $objectsToImport = [])
{
parent::remove($flagRemoveCases, $onlyDiagram);
parent::remove($flagRemoveCases, $onlyDiagram, $objectsToImport);
$this->bp->remove();
}

View File

@@ -2,20 +2,21 @@
namespace ProcessMaker\Project;
use Criteria;
use ProcessMaker\Plugins\PluginRegistry;
use ResultSet;
use ObjectPermissionPeer;
use Process as ClassesProcess;
use Tasks;
use Task as ClassesTask;
use ProcessMaker\Exception;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Plugins\PluginRegistry;
use ProcessMaker\Util;
use ProcessMaker\Util\Common;
use ProcessUserPeer;
use ReportTables;
use ResultSet;
use Route;
use RoutePeer;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Util\Common;
use ProcessMaker\Exception;
use ProcessMaker\Util;
use ReportTables;
use StepSupervisorPeer;
use Tasks;
use Task as ClassesTask;
/**
* Class Workflow
@@ -115,11 +116,20 @@ class Workflow extends Handler
$process->update($data);
}
public function remove($flagRemoveCases = true, $onlyDiagram = false)
/**
* Remove project
*
* @param bool $flagRemoveCases
* @param bool $onlyDiagram
* @param array $objectsToImport
* @return void
* @throws \Exception
*/
public function remove($flagRemoveCases = true, $onlyDiagram = false, $objectsToImport = [])
{
try {
self::log("Remove Process with uid: {$this->proUid}");
$this->deleteProcess($this->proUid, $flagRemoveCases, $onlyDiagram);
$this->deleteProcess($this->proUid, $flagRemoveCases, $onlyDiagram, $objectsToImport);
self::log("Remove Process Success!");
} catch (\Exception $e) {
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
@@ -579,7 +589,17 @@ class Workflow extends Handler
}
}
public function deleteProcess($sProcessUID, $flagRemoveCases = true, $onlyDiagram = false)
/**
* Delete process
*
* @param string $sProcessUID
* @param bool $flagRemoveCases
* @param bool $onlyDiagram
* @param array $objectsToImport
* @return bool
* @throws \Exception
*/
public function deleteProcess($sProcessUID, $flagRemoveCases = true, $onlyDiagram = false, $objectsToImport = [])
{
try {
@@ -761,18 +781,24 @@ class Workflow extends Handler
$oDataset->next();
}
}
//Delete the supervisors
$oCriteria = new Criteria('workflow');
$oCriteria->add(\ProcessUserPeer::PRO_UID, $sProcessUID);
\ProcessUserPeer::doDelete($oCriteria);
//Delete the object permissions
$oCriteria = new Criteria('workflow');
$oCriteria->add(\ObjectPermissionPeer::PRO_UID, $sProcessUID);
\ObjectPermissionPeer::doDelete($oCriteria);
//Delete the step supervisors
$oCriteria = new Criteria('workflow');
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
\StepSupervisorPeer::doDelete($oCriteria);
if (array_search('SUPERVISORS', array_column($objectsToImport, 'id')) !== false || empty($objectsToImport)) {
//Delete the supervisors
$oCriteria = new Criteria('workflow');
$oCriteria->add(ProcessUserPeer::PRO_UID, $sProcessUID);
ProcessUserPeer::doDelete($oCriteria);
}
if (array_search('PERMISSIONS', array_column($objectsToImport, 'id')) !== false || empty($objectsToImport)) {
//Delete the object permissions
$oCriteria = new Criteria('workflow');
$oCriteria->add(ObjectPermissionPeer::PRO_UID, $sProcessUID);
ObjectPermissionPeer::doDelete($oCriteria);
}
if (array_search('SUPERVISORSOBJECTS', array_column($objectsToImport, 'id')) !== false || empty($objectsToImport)) {
//Delete the step supervisors
$oCriteria = new Criteria('workflow');
$oCriteria->add(StepSupervisorPeer::PRO_UID, $sProcessUID);
StepSupervisorPeer::doDelete($oCriteria);
}
//Delete the report tables
$oCriteria = new Criteria('workflow');
$oCriteria->add(\ReportTablePeer::PRO_UID, $sProcessUID);

View File

@@ -51,6 +51,7 @@ class Home extends Api
* @url GET /draft
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -68,6 +69,7 @@ class Home extends Api
*/
public function doGetDraftCases(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -81,6 +83,7 @@ class Home extends Api
$bmHome = new BMHome($this->getUserId());
return $bmHome->getDraft(
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -101,6 +104,7 @@ class Home extends Api
* @url GET /todo [This is kept for compatibility should not be used 'todo', the reason is to only handle the same verb (inbox) for all 'normal case list' and 'custom case list']
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -121,6 +125,7 @@ class Home extends Api
*/
public function doGetTodoCases(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -137,6 +142,7 @@ class Home extends Api
$bmHome = new BMHome($this->getUserId());
return $bmHome->getInbox(
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -159,6 +165,7 @@ class Home extends Api
* @url GET /unassigned
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -179,6 +186,7 @@ class Home extends Api
*/
public function doGetUnassignedCases(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -195,6 +203,7 @@ class Home extends Api
$bmHome = new BMHome($this->getUserId());
return $bmHome->getUnassigned(
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -217,6 +226,7 @@ class Home extends Api
* @url GET /paused
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -237,6 +247,7 @@ class Home extends Api
*/
public function doGetPausedCases(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -253,6 +264,7 @@ class Home extends Api
$bmHome = new BMHome($this->getUserId());
return $bmHome->getPaused(
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -274,6 +286,7 @@ class Home extends Api
* @url POST /draft/:id
* @param int $id
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -290,6 +303,7 @@ class Home extends Api
public function doGetCustomDraftCases(
int $id,
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -305,6 +319,7 @@ class Home extends Api
return $bmHome->getCustomDraft(
$id,
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -324,6 +339,7 @@ class Home extends Api
* @url POST /inbox/:id
* @param int $id
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -343,6 +359,7 @@ class Home extends Api
public function doGetCustomInboxCases(
int $id,
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -361,6 +378,7 @@ class Home extends Api
return $bmHome->getCustomInbox(
$id,
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -383,6 +401,7 @@ class Home extends Api
* @url POST /unassigned/:id
* @param int $id
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -402,6 +421,7 @@ class Home extends Api
public function doGetCustomUnassignedCases(
int $id,
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -420,6 +440,7 @@ class Home extends Api
return $bmHome->getCustomUnassigned(
$id,
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -442,6 +463,7 @@ class Home extends Api
* @url POST /paused/:id
* @param int $id
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -461,6 +483,7 @@ class Home extends Api
public function doGetCustomPausedCases(
int $id,
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -479,6 +502,7 @@ class Home extends Api
return $bmHome->getCustomPaused(
$id,
$caseNumber,
$category,
$process,
$task,
$limit,
@@ -502,6 +526,7 @@ class Home extends Api
* @url GET /mycases
*
* @param int $caseNumber
* @param int $category
* @param int $process
* @param int $task
* @param int $limit
@@ -525,6 +550,7 @@ class Home extends Api
*/
public function doGetMyCases(
int $caseNumber = 0,
int $category = 0,
int $process = 0,
int $task = 0,
int $limit = 15,
@@ -544,6 +570,7 @@ class Home extends Api
$properties['caseNumber'] = $caseNumber;
$properties['caseTitle'] = $caseTitle;
$properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process;
$properties['task'] = $task;
// Get the user that access to the API
@@ -862,7 +889,7 @@ class Home extends Api
* @url GET /processes
*
* @param string $text
* @param string $category
* @param int $category
* @param int $offset
* @param int $limit
* @param bool $paged
@@ -874,7 +901,7 @@ class Home extends Api
* @access protected
* @class AccessControl {@permission PM_CASES}
*/
public function getProcesses($text = null, $category = null, int $offset = 0, int $limit = 15, $paged = true)
public function getProcesses($text = null, $category = 0, int $offset = 0, int $limit = 15, $paged = true)
{
try {
return Process::getProcessesForHome($text, $category, $offset, $limit, $paged);

View File

@@ -3,11 +3,11 @@
namespace ProcessMaker\Services\Api;
use Exception;
use Luracast\Restler\RestException;
use ProcessMaker\BusinessModel\Cases\Draft;
use ProcessMaker\BusinessModel\Cases\Inbox;
use ProcessMaker\BusinessModel\Cases\Paused;
use ProcessMaker\BusinessModel\Cases\Unassigned;
use ProcessMaker\Model\User;
use ProcessMaker\Services\Api;
use RBAC;
@@ -46,8 +46,6 @@ class Metrics extends Api
*/
public function getProcessTotalCases($caseList, $category = null, $topTen = false, $processes = [])
{
$usrUid = $this->getUserId();
$usrId = !empty($usrUid) ? User::getId($usrUid) : 0;
try {
switch ($caseList) {
case 'inbox':
@@ -61,10 +59,8 @@ class Metrics extends Api
break;
case 'unassigned':
$list = new Unassigned();
$list->setUserUid($usrUid);
break;
}
$list->setUserId($usrId);
$result = $list->getCountersByProcesses($category, $topTen, $processes);
return $result;
} catch (Exception $e) {
@@ -91,8 +87,6 @@ class Metrics extends Api
*/
public function getTotalCasesByRange($caseList, $processId = null, $dateFrom = null, $dateTo = null, $groupBy = 'day')
{
$usrUid = $this->getUserId();
$usrId = !empty($usrUid) ? User::getId($usrUid) : 0;
try {
switch ($caseList) {
case 'inbox':
@@ -106,10 +100,8 @@ class Metrics extends Api
break;
case 'unassigned':
$list = new Unassigned();
$list->setUserUid($usrUid);
break;
}
$list->setUserId($usrId);
$result = $list->getCountersByRange($processId, $dateFrom, $dateTo, $groupBy);
return $result;
} catch (Exception $e) {
@@ -125,31 +117,21 @@ class Metrics extends Api
* @return array
*
* @throws RestException
*
* @class AccessControl {@permission TASK_METRICS_VIEW}
*/
public function getCountersList()
{
try {
$usrUid = $this->getUserId();
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
$listInbox = new Inbox();
$listInbox->setProperties($properties);
$listDraft = new Draft();
$listDraft->setUserUid($usrUid);
$listDraft->setProperties($properties);
$listPaused = new Paused();
$listPaused->setProperties($properties);
$listUnassigned = new Unassigned();
$listUnassigned->setUserUid($usrUid);
$listUnassigned->setProperties($properties);
$casesInbox = $listInbox->getCounter();
$casesDraft = $listDraft->getCounter();
$casesPaused = $listPaused->getCounter();
$casesUnassigned = $listUnassigned->getCounter();
$casesInbox = $listInbox->getCounterMetrics();
$casesDraft = $listDraft->getCounterMetrics();
$casesPaused = $listPaused->getCounterMetrics();
$casesUnassigned = $listUnassigned->getCounterMetrics();
$result = [
['List Name' => 'Inbox', 'Total' => $casesInbox, 'Color' => 'green'],
@@ -179,12 +161,12 @@ class Metrics extends Api
* @return array
*
* @throws RestException
*
* @class AccessControl {@permission TASK_METRICS_VIEW}
*/
public function getCasesRiskByProcess($caseList = 'inbox', $process, $dateFrom = null, $dateTo = null, $riskStatus = 'ON_TIME', $topCases = null)
{
try {
$usrUid = $this->getUserId();
$usrId = !empty($usrUid) ? User::getId($usrUid) : 0;
switch ($caseList) {
case 'inbox':
$list = new Inbox();
@@ -197,10 +179,8 @@ class Metrics extends Api
break;
case 'unassigned':
$list = new Unassigned();
$list->setUserUid($usrUid);
break;
}
$list->setUserId($usrId);
$result = $list->getCasesRisk($process, $dateFrom, $dateTo, $riskStatus, $topCases);
return $result;
} catch (Exception $e) {

View File

@@ -1,6 +1,7 @@
<?php
namespace ProcessMaker\Services\OAuth2;
use Bootstrap;
use Luracast\Restler\iAuthenticate;
use Luracast\Restler\RestException;
use OAuth2\Request;
@@ -367,7 +368,8 @@ class Server implements iAuthenticate
$lifetime = 1440;
}
setcookie($session->getSessionName(), $_COOKIE[$session->getSessionName()], time() + $lifetime, "/", null, false, true);
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + $lifetime, 'secure' => false, 'httponly' => true]);
setcookie($session->getSessionName(), $_COOKIE[$session->getSessionName()], $cookieOptions);
}
}

View File

@@ -6,7 +6,7 @@ Ext.onReady(function () {
layout: 'border',
items: [
new Ext.grid.GridPanel({
region: 'center',
"region": 'center',
"width": "100%",
"height": 300,
"stateful": true,
@@ -56,13 +56,18 @@ Ext.onReady(function () {
header: _('ID_FIELD_NAME'),
width: 120,
sortable: false,
dataIndex: 'field'
dataIndex: 'field',
menuDisabled: true,
renderer: function (value, metaData, record, rowIndex, colIndex, store) {
return "<b>"+value+"</b>";
}
},
{
header: _('ID_PREV_VALUES'),
flex: 1,
sortable: false,
dataIndex: 'previousValue',
menuDisabled: true,
renderer: function (value, p, record) {
return value;
}
@@ -72,6 +77,7 @@ Ext.onReady(function () {
flex: 1,
sortable: false,
dataIndex: 'currentValue',
menuDisabled: true,
renderer: function (value, p, record) {
return value;
}

View File

@@ -15,7 +15,7 @@
{/foreach}
<link rel="stylesheet" type="text/css" href="/lib-dev/css/jquery.layout.css" />
<link rel="stylesheet" type="text/css" href="/lib-dev/css/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" type="text/css" href="/lib-dev/css/jquery-ui.min.css" />
<!--<link rel="stylesheet" type="text/css" href="/lib/css/jquery.dataTables.css">-->
<link rel="stylesheet" type="text/css" href="/css/fonts.css" />
<link rel="stylesheet" type="text/css" href="/fonts/styles.php" />
@@ -39,7 +39,7 @@
<script type="text/javascript" src="/lib-dev/js/wz_jsgraphics.js"></script>
<script type="text/javascript" src="/lib-dev/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/lib-dev/js/underscore-min.js"></script>
<script type="text/javascript" src="/lib-dev/js/jquery-ui-1.10.3.custom.min.js"></script>
<script type="text/javascript" src="/lib-dev/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="/lib-dev/js/jquery.layout.min.js"></script>
<script type="text/javascript" src="/lib-dev/js/restclient.min.js"></script>
<script type="text/javascript" src="/lib-dev/js/modernizr.js"></script>

View File

@@ -67,12 +67,11 @@ Ext.onReady(function () {
Ext.getCmp('gd').setValue(getFieldOutput(response.gd.version, response.gd.result));
Ext.getCmp('multibyte').setValue(getFieldOutput(response.multibyte.version, response.multibyte.result));
Ext.getCmp('soap').setValue(getFieldOutput(response.soap.version, response.soap.result));
Ext.getCmp("mcrypt").setValue(getFieldOutput(response.mcrypt.version, response.mcrypt.result));
Ext.getCmp('ldap').setValue(getFieldOutput(response.ldap.version, response.ldap.result));
Ext.getCmp('memory').setValue(getFieldOutput(response.memory.version, response.memory.result));
dbReq = response.mysql.result;
phpReq = response.php.result && response.curl.result && response.dom.result && response.gd.result && response.multibyte.result && response.soap.result && response.memory.result && response.mcrypt.result;
phpReq = response.php.result && response.curl.result && response.dom.result && response.gd.result && response.multibyte.result && response.soap.result && response.memory.result;
wizard.onClientValidation(0, dbReq && phpReq);
wizard.showLoadMask(false);
},
@@ -323,11 +322,6 @@ Ext.onReady(function () {
fieldLabel: _('ID_PROCESSMAKER_REQUIREMENTS_SOAP'),
id: 'soap'
},
{
xtype: "displayfield",
id: "mcrypt",
fieldLabel: _("ID_MCRYPT_SUPPORT")
},
{
xtype: 'displayfield',
fieldLabel: _('ID_PROCESSMAKER_REQUIREMENTS_LDAP'),

View File

@@ -135,12 +135,6 @@ systemInfo.application = {
fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_SOAP"),
value: eval("fieldFormatValue(" + SYSINFO_SOAP + ");")
},
{
xtype: "displayfield",
id: "mcrypt ",
fieldLabel: _("ID_MCRYPT_SUPPORT"),
value: eval("fieldFormatValue(" + SYSINFO_MCRYPT + ");")
},
{
xtype: "displayfield",
id: "ldap",

View File

@@ -1,736 +0,0 @@
<?php
use ProcessMaker\Plugins\PluginRegistry;
/**
* sysGeneric - ProcessMaker Bootstrap
* this file is used initialize main variables, redirect and dispatch all requests
*/
// Defining the PATH_SEP constant, he we are defining if the the path separator symbol will be '\\' or '/'
define('PATH_SEP', '/');
// Defining the Home Directory
$realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
$docuroot = explode(PATH_SEP, $realdocuroot);
array_pop($docuroot);
$pathhome = implode(PATH_SEP, $docuroot) . PATH_SEP;
// try to find automatically the trunk directory where are placed the RBAC and Gulliver directories
// in a normal installation you don't need to change it.
array_pop($docuroot);
$pathTrunk = implode(PATH_SEP, $docuroot) . PATH_SEP;
array_pop($docuroot);
$pathOutTrunk = implode(PATH_SEP, $docuroot) . PATH_SEP;
define('PATH_HOME', $pathhome);
define('PATH_TRUNK', $pathTrunk);
define('PATH_OUTTRUNK', $pathOutTrunk);
// Including these files we get the PM paths and definitions (that should be just one file.
require_once $pathhome . PATH_SEP . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php';
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.system.php';
// starting session
$timelife = ini_get('session.gc_maxlifetime');
if (is_null($timelife)) {
$timelife = 1440;
}
ini_set('session.gc_maxlifetime', $timelife);
ini_set('session.cookie_lifetime', $timelife);
session_start();
$config = PmSystem::getSystemConfiguration();
//$e_all = defined('E_DEPRECATED') ? E_ALL & ~E_DEPRECATED : E_ALL;
//$e_all = defined('E_STRICT') ? $e_all & ~E_STRICT : $e_all;
//$e_all = $config['debug'] ? $e_all : $e_all & ~E_NOTICE;
//$e_all = E_ALL & ~ E_DEPRECATED & ~ E_STRICT & ~ E_NOTICE & ~E_WARNING;
$filter = new InputFilter();
$config['display_errors'] = $filter->validateInput($config['display_errors']);
$config['error_reporting'] = $filter->validateInput($config['error_reporting']);
$config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'], 'int');
$config['time_zone'] = $filter->validateInput($config['time_zone']);
// Do not change any of these settings directly, use env.ini instead
ini_set('display_errors', $filter->validateInput($config['display_errors']));
ini_set('error_reporting', $filter->validateInput($config['error_reporting']));
ini_set('short_open_tag', 'On');
ini_set('default_charset', "UTF-8");
ini_set('soap.wsdl_cache_enabled', $config['wsdl_cache']);
ini_set('date.timezone',
(isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__']) ? 'UTC' : $config['time_zone']); //Set Time Zone
define('DEBUG_SQL_LOG', $config['debug_sql']);
define('DEBUG_TIME_LOG', $config['debug_time']);
define('DEBUG_CALENDAR_LOG', $config['debug_calendar']);
define('MEMCACHED_ENABLED', $config['memcached']);
define('MEMCACHED_SERVER', $config['memcached_server']);
define('TIME_ZONE', ini_get('date.timezone'));
// IIS Compatibility, SERVER_ADDR doesn't exist on that env, so we need to define it.
$_SERVER['SERVER_ADDR'] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['SERVER_NAME'];
//to do: make different environments. sys
define('ERROR_SHOW_SOURCE_CODE',
true); // enable ERROR_SHOW_SOURCE_CODE to display the source code for any WARNING OR NOTICE
//define ( 'ERROR_LOG_NOTICE_ERROR', true ); //enable ERROR_LOG_NOTICE_ERROR to log Notices messages in default apache log
//check if it is a installation instance
if (!defined('PATH_C')) {
// is a intallation instance, so we need to define PATH_C and PATH_LANGUAGECONT constants temporarily
define('PATH_C', (rtrim(G::sys_get_temp_dir(), PATH_SEP) . PATH_SEP));
define('PATH_LANGUAGECONT', PATH_HOME . 'engine/content/languages/');
}
// defining Virtual URLs
$virtualURITable = [];
$virtualURITable['/plugin/(*)'] = 'plugin';
$virtualURITable['/(sys*)/(*.js)'] = 'jsMethod';
$virtualURITable['/js/(*)'] = PATH_GULLIVER_HOME . 'js/';
$virtualURITable['/jscore/(*)'] = PATH_CORE . 'js/';
if (defined('PATH_C')) {
$virtualURITable['/jsform/(*.js)'] = PATH_C . 'xmlform/';
$virtualURITable['/extjs/(*)'] = PATH_C . 'ExtJs/';
}
$virtualURITable['/htmlarea/(*)'] = PATH_THIRDPARTY . 'htmlarea/';
$virtualURITable['/sys[a-zA-Z][a-zA-Z0-9]{0,}()/'] = 'sysNamed';
$virtualURITable['/(sys*)'] = false;
$virtualURITable['/errors/(*)'] = PATH_GULLIVER_HOME . 'methods/errors/';
$virtualURITable['/gulliver/(*)'] = PATH_GULLIVER_HOME . 'methods/';
$virtualURITable['/controls/(*)'] = PATH_GULLIVER_HOME . 'methods/controls/';
$virtualURITable['/html2ps_pdf/(*)'] = PATH_THIRDPARTY . 'html2ps_pdf/';
$virtualURITable['/images/'] = 'errorFile';
$virtualURITable['/skins/'] = 'errorFile';
$virtualURITable['/files/'] = 'errorFile';
$virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}()'] = 'sysUnnamed';
$virtualURITable['/rest/(*)'] = 'rest-service';
$virtualURITable['/update/(*)'] = PATH_GULLIVER_HOME . 'methods/update/';
$virtualURITable['/(*)'] = PATH_HTML;
$isRestRequest = false;
// Verify if we need to redirect or stream the file, if G:VirtualURI returns true means we are going to redirect the page
if (G::virtualURI($_SERVER['REQUEST_URI'], $virtualURITable, $realPath)) {
// review if the file requested belongs to public_html plugin
if (substr($realPath, 0, 6) == 'plugin') {
// Another way to get the path of Plugin public_html and stream the correspondent file, By JHL Jul 14, 08
// TODO: $pathsQuery will be used?
$pathsQuery = '';
// Get the query side
// Did we use this variable $pathsQuery for something??
$forQuery = explode("?", $realPath);
if (isset($forQuery[1])) {
$pathsQuery = $forQuery[1];
}
//Get that path in array
$paths = explode(PATH_SEP, $forQuery[0]);
//remove the "plugin" word from
$paths[0] = substr($paths[0], 6);
//Get the Plugin Folder, always the first element
$pluginFolder = array_shift($paths);
//The other parts are the realpath into public_html (no matter how many elements)
$filePath = implode(PATH_SEP, $paths);
$pluginFilename = PATH_PLUGINS . $pluginFolder . PATH_SEP . 'public_html' . PATH_SEP . $filePath;
if (file_exists($pluginFilename)) {
G::streamFile($pluginFilename);
}
die;
}
$requestUriArray = explode("/", $_SERVER['REQUEST_URI']);
if ((isset($requestUriArray[1])) && ($requestUriArray[1] == 'skin')) {
// This will allow to public images of Custom Skins, By JHL Feb 28, 11
$pathsQuery = "";
// Get the query side
// This way we remove garbage
$forQuery = explode("?", $realPath);
if (isset($forQuery[1])) {
$pathsQuery = $forQuery[1];
}
//Get that path in array
$paths = explode(PATH_SEP, $forQuery[0]);
$fileToBeStreamed = str_replace("/skin/", PATH_CUSTOM_SKINS, $_SERVER['REQUEST_URI']);
if (file_exists($fileToBeStreamed)) {
G::streamFile($fileToBeStreamed);
}
die;
}
switch ($realPath) {
case 'sysUnnamed' :
require_once('sysUnnamed.php');
die;
break;
case 'sysNamed' :
header('location : ' . $_SERVER['REQUEST_URI'] . '/' . SYS_LANG . '/classic/login/login');
die;
break;
case 'jsMethod' :
G::parseURI(getenv("REQUEST_URI"));
$filename = PATH_METHODS . SYS_COLLECTION . '/' . SYS_TARGET . '.js';
G::streamFile($filename);
die;
break;
case 'errorFile':
header("location: /errors/error404.php?url=" . urlencode($_SERVER['REQUEST_URI']));
if (DEBUG_TIME_LOG) {
G::logTimeByPage();
} //log this page
die;
break;
default :
if (substr($realPath, 0, 12) == 'rest-service') {
$isRestRequest = true;
} else {
$realPath = explode('?', $realPath);
$realPath[0] .= strpos(basename($realPath[0]), '.') === false ? '.php' : '';
G::streamFile($realPath[0]);
die;
}
}
}//virtual URI parser
// the request correspond to valid php page, now parse the URI
G::parseURI(getenv("REQUEST_URI"), $isRestRequest);
$arrayUpdating = G::isPMUnderUpdating();
if ($arrayUpdating['action']) {
if ($arrayUpdating['workspace'] == "true" || $arrayUpdating['workspace'] == SYS_TEMP) {
header("location: /update/updating.php");
if (DEBUG_TIME_LOG) {
G::logTimeByPage();
}
die;
}
}
// verify if index.html exists
if (!file_exists(PATH_HTML . 'index.html')) { // if not, create it from template
file_put_contents(
PATH_HTML . 'index.html',
G::parseTemplate(PATH_TPL . "index.html",
array("lang" => ((defined("SYS_LANG") && SYS_LANG != "") ? SYS_LANG : "en"), "skin" => SYS_SKIN))
);
}
define('SYS_URI', '/sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/');
// defining the serverConf singleton
if (defined('PATH_DATA') && file_exists(PATH_DATA)) {
//Instance Server Configuration Singleton
$oServerConf = ServerConf::getSingleton();
}
// Call Gulliver Classes
// Create headPublisher singleton
$oHeadPublisher = headPublisher::getSingleton();
//Load filter class
$filter = new InputFilter();
// Installer, redirect to install if we don't have a valid shared data folder
if (!defined('PATH_DATA') || !file_exists(PATH_DATA)) {
// new installer, extjs based
define('PATH_DATA', PATH_C);
require_once ( PATH_CONTROLLERS . 'InstallerModule.php' );
$controller = InstallerModule::class;
// if the method name is empty set default to index method
if (strpos(SYS_TARGET, '/') !== false) {
list($controller, $controllerAction) = explode('/', SYS_TARGET);
} else {
$controllerAction = SYS_TARGET;
}
$controllerAction = ($controllerAction != '' && $controllerAction != 'login') ? $controllerAction : 'index';
// create the installer controller and call its method
if (is_callable([InstallerModule::class, $controllerAction])) {
$installer = new $controller();
$installer->setHttpRequestData($_REQUEST);
$installer->call($controllerAction);
}
else {
$_SESSION['phpFileNotFound'] = $_SERVER['REQUEST_URI'];
header ("location: /errors/error404.php?url=" . urlencode($_SERVER['REQUEST_URI']));
}
die;
}
// Load Language Translation
G::LoadTranslationObject(defined('SYS_LANG') ? SYS_LANG : "en");
// look for a disabled workspace
if ($oServerConf->isWSDisabled(SYS_TEMP)) {
$aMessage['MESSAGE'] = G::LoadTranslation('ID_DISB_WORKSPACE');
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish');
die;
}
// database and workspace definition
// if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file
if (defined('SYS_TEMP') && SYS_TEMP != '') {
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
if (file_exists(PATH_DB . SYS_TEMP . '/db.php')) {
$pathFile = $filter->validateInput(PATH_DB . SYS_TEMP . '/db.php', 'path');
require_once($pathFile);
define('SYS_SYS', SYS_TEMP);
// defining constant for workspace shared directory
define('PATH_WORKSPACE', PATH_DB . config("system.workspace") . PATH_SEP);
// including workspace shared classes -> particularlly for pmTables
set_include_path(get_include_path() . PATH_SEPARATOR . PATH_WORKSPACE);
} else {
G::SendTemporalMessage('ID_NOT_WORKSPACE', "error");
G::header('location: /sys/' . SYS_LANG . '/' . SYS_SKIN . '/main/sysLogin?errno=2');
die;
}
} else { //when we are in global pages, outside any valid workspace
if (SYS_TARGET === 'newSite') {
$phpFile = G::ExpandPath('methods') . SYS_COLLECTION . "/" . SYS_TARGET . '.php';
$phpFile = $filter->validateInput($phpFile, 'path');
require_once($phpFile);
die();
} else {
if (SYS_TARGET == "dbInfo") { //Show dbInfo when no SYS_SYS
$pathFile = PATH_METHODS . 'login/dbInfo.php';
$pathFile = $filter->validateInput($pathFile, 'path');
require_once($pathFile);
} else {
if (substr(SYS_SKIN, 0,
2) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
$pathFile = $filter->validateInput(PATH_CONTROLLERS . 'main.php', 'path');
require_once $pathFile;
$controllerClass = 'Main';
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
//if the method exists
if (is_callable(Array($controllerClass, $controllerAction))) {
$controller = new $controllerClass();
$controller->setHttpRequestData($_REQUEST);
$controller->call($controllerAction);
}
} else { // classic sysLogin interface
$pathFile = PATH_METHODS . 'login/sysLogin.php';
$pathFile = $filter->validateInput($pathFile, 'path');
require_once($pathFile);
die();
}
}
if (DEBUG_TIME_LOG) {
G::logTimeByPage();
} //log this page
die();
}
}
// PM Paths DATA
define('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
define('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
define('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
define('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
define('PATH_DATA_REPORTS', PATH_DATA_SITE . 'reports/');
define('PATH_DYNAFORM', PATH_DATA_SITE . 'xmlForms/');
define('PATH_IMAGES_ENVIRONMENT_FILES', PATH_DATA_SITE . 'usersFiles' . PATH_SEP);
define('PATH_IMAGES_ENVIRONMENT_USERS', PATH_DATA_SITE . 'usersPhotographies' . PATH_SEP);
define('SERVER_NAME', $_SERVER ['SERVER_NAME']);
define('SERVER_PORT', $_SERVER ['SERVER_PORT']);
// create memcached singleton
$memcache = PMmemcached::getSingleton(config("system.workspace"));
// verify configuration for rest service
if ($isRestRequest) {
// disable until confirm that rest is enabled & configured on rest-config.ini file
$isRestRequest = false;
$confFile = '';
$restApiClassPath = '';
// try load and getting rest configuration
if (file_exists(PATH_DATA_SITE . 'rest-config.ini')) {
$confFile = PATH_DATA_SITE . 'rest-config.ini';
$restApiClassPath = PATH_DATA_SITE;
} elseif (file_exists(PATH_CONFIG . 'rest-config.ini')) {
$confFile = PATH_CONFIG . 'rest-config.ini';
}
if (!empty($confFile) && $restConfig = @parse_ini_file($confFile, true)) {
if (array_key_exists('enable_service', $restConfig)) {
if ($restConfig['enable_service'] == 'true' || $restConfig['enable_service'] == '1') {
$isRestRequest = true; // rest service enabled
}
}
}
}
//here we are loading all plugins registered
//the singleton has a list of enabled plugins
$oPluginRegistry = PluginRegistry::loadSingleton();
// setup propel definitions and logging
require_once("propel/Propel.php");
require_once("creole/Creole.php");
if (defined('DEBUG_SQL_LOG') && DEBUG_SQL_LOG) {
define('PM_PID', mt_rand(1, 999999));
require_once 'Log.php';
// register debug connection decorator driver
Creole::registerDriver('*', 'creole.contrib.DebugConnection');
// initialize Propel with converted config file
Propel::init(PATH_CORE . "config/databases.php");
// unified log file for all databases
$logFile = PATH_DATA . 'log' . PATH_SEP . 'propel.log';
$logger = Log::singleton('file', $logFile, 'wf ' . config("system.workspace"), null, PEAR_LOG_INFO);
Propel::setLogger($logger);
// log file for workflow database
$con = Propel::getConnection('workflow');
if ($con instanceof DebugConnection) {
$con->setLogger($logger);
}
// log file for rbac database
$con = Propel::getConnection('rbac');
if ($con instanceof DebugConnection) {
$con->setLogger($logger);
}
// log file for report database
$con = Propel::getConnection('rp');
if ($con instanceof DebugConnection) {
$con->setLogger($logger);
}
} else {
Propel::init(PATH_CORE . "config/databases.php");
}
Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
// Session Initializations
ini_set('session.auto_start', '1');
// The register_globals feature has been DEPRECATED as of PHP 5.3.0. default value Off.
// ini_set( 'register_globals', 'Off' );
//session_start();
ob_start();
// Rebuild the base Workflow translations if not exists
if (!is_file(PATH_LANGUAGECONT . 'translation.en')) {
require_once("classes/model/Translation.php");
$fields = Translation::generateFileTranslation('en');
}
// TODO: Verify if the language set into url is defined in translations env.
if (SYS_LANG != 'en' && !is_file(PATH_LANGUAGECONT . 'translation.' . SYS_LANG)) {
require_once("classes/model/Translation.php");
$fields = Translation::generateFileTranslation(SYS_LANG);
}
// Setup plugins
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$avoidChangedWorkspaceValidation = false;
// Load custom Classes and Model from Plugins.
G::LoadAllPluginModelClasses();
// jump to php file in methods directory
$collectionPlugin = '';
if ($oPluginRegistry->isRegisteredFolder(SYS_COLLECTION)) {
$phpFile = PATH_PLUGINS . SYS_COLLECTION . PATH_SEP . SYS_TARGET . '.php';
$targetPlugin = explode('/', SYS_TARGET);
$collectionPlugin = $targetPlugin[0];
$avoidChangedWorkspaceValidation = true;
} else {
$phpFile = G::ExpandPath('methods') . SYS_COLLECTION . PATH_SEP . SYS_TARGET . '.php';
}
// services is a special folder,
if (SYS_COLLECTION == 'services') {
$avoidChangedWorkspaceValidation = true;
$targetPlugin = explode('/', SYS_TARGET);
if ($targetPlugin[0] == 'webdav') {
$phpFile = G::ExpandPath('methods') . SYS_COLLECTION . PATH_SEP . 'webdav.php';
}
}
if (SYS_COLLECTION == 'login' && SYS_TARGET == 'login') {
$avoidChangedWorkspaceValidation = true;
}
//the index.php file, this new feature will allow automatically redirects to valid php file inside any methods folder
/* DEPRECATED
if ( SYS_TARGET == '' ) {
$phpFile = str_replace ( '.php', 'index.php', $phpFile );
$phpFile = include ( $phpFile );
}*/
$bWE = false;
$isControllerCall = false;
if (substr(SYS_COLLECTION, 0, 8) === 'gulliver') {
$phpFile = PATH_GULLIVER_HOME . 'methods/' . substr(SYS_COLLECTION, 8) . SYS_TARGET . '.php';
} else {
//when the file is part of the public directory of any PROCESS, this a ProcessMaker feature
if (preg_match('/^[0-9][[:alnum:]]+$/', SYS_COLLECTION) == 1) { //the pattern is /sysSYS/LANG/SKIN/PRO_UID/file
$auxPart = explode('/', $_SERVER['REQUEST_URI']);
$aAux = explode('?', $auxPart[count($auxPart) - 1]);
//$extPart = explode ( '.' , $auxPart[ count($auxPart)-1] );
$extPart = explode('.', $aAux[0]);
$queryPart = isset($aAux[1]) ? $aAux[1] : "";
$extension = $extPart[count($extPart) - 1];
$phpFile = PATH_DATA_SITE . 'public' . PATH_SEP . SYS_COLLECTION . PATH_SEP . urldecode($auxPart[count($auxPart) - 1]);
$aAux = explode('?', $phpFile);
$phpFile = $aAux[0];
if ($extension != 'php') {
G::streamFile($phpFile);
die;
}
$avoidChangedWorkspaceValidation = true;
$bWE = true;
//$phpFile = PATH_DATA_SITE . 'public' . PATH_SEP . SYS_COLLECTION . PATH_SEP . $auxPart[ count($auxPart)-1];
}
//erik: verify if it is a Controller Class or httpProxyController Class
if (is_file(PATH_CONTROLLERS . SYS_COLLECTION . '.php')) {
$pathFile = $filter->validateInput(PATH_CONTROLLERS . SYS_COLLECTION . '.php', 'path');
require_once $pathFile;
$controllerClass = SYS_COLLECTION;
//if the method name is empty set default to index method
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';
//if the method exists
if (is_callable(Array($controllerClass, $controllerAction))) {
$isControllerCall = true;
}
}
if (!$isControllerCall && !file_exists($phpFile) && !$isRestRequest) {
$_SESSION['phpFileNotFound'] = $_SERVER['REQUEST_URI'];
header("location: /errors/error404.php?url=" . urlencode($_SERVER['REQUEST_URI']));
die;
}
}
//redirect to login, if user changed the workspace in the URL
if (!$avoidChangedWorkspaceValidation && isset($_SESSION['WORKSPACE']) && $_SESSION['WORKSPACE'] != config("system.workspace")) {
$_SESSION['WORKSPACE'] = config("system.workspace");
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', "error");
// verify if the current skin is a 'ux' variant
$urlPart = substr(SYS_SKIN, 0, 2) == 'ux' && SYS_SKIN != 'uxs' ? '/main/login' : '/login/login';
header('Location: /sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . $urlPart);
die;
}
// enable rbac
$RBAC = RBAC::getSingleton(PATH_DATA, session_id());
$RBAC->sSystem = 'PROCESSMAKER';
// define and send Headers for all pages
if (!defined('EXECUTE_BY_CRON')) {
header("Expires: " . gmdate("D, d M Y H:i:s", mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'))) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// get the language direction from ServerConf
define('SYS_LANG_DIRECTION', $oServerConf->getLanDirection());
if ((isset($_SESSION['USER_LOGGED'])) && (!(isset($_GET['sid'])))) {
if (PHP_VERSION < 5.2) {
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
} else {
setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true);
}
$RBAC->initRBAC();
//using optimization with memcache, the user data will be in memcache 8 hours, or until session id goes invalid
$memKey = 'rbacSession' . session_id();
if (($RBAC->aUserInfo = $memcache->get($memKey)) === false) {
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);
$memcache->set($memKey, $RBAC->aUserInfo, PMmemcached::EIGHT_HOURS);
}
} else {
// this is the blank list to allow execute scripts with no login (without session started)
$noLoginFiles = $noLoginFolders = [];
$noLoginFiles[] = 'login';
$noLoginFiles[] = 'authentication';
$noLoginFiles[] = 'login_Ajax';
$noLoginFiles[] = 'dbInfo';
$noLoginFiles[] = 'sysLoginVerify';
$noLoginFiles[] = 'processes_Ajax';
$noLoginFiles[] = 'showLogoFile';
$noLoginFiles[] = 'forgotPassword';
$noLoginFiles[] = 'retrivePassword';
$noLoginFiles[] = 'genericAjax';
$noLoginFolders[] = 'services';
$noLoginFolders[] = 'tracker';
$noLoginFolders[] = 'installer';
// This sentence is used when you lost the Session
if (!in_array(SYS_TARGET, $noLoginFiles)
&& !in_array(SYS_COLLECTION, $noLoginFolders)
&& $bWE != true && $collectionPlugin != 'services'
&& !$isRestRequest
) {
$bRedirect = true;
if (isset($_GET['sid'])) {
$oSessions = new Sessions();
if ($aSession = $oSessions->verifySession($_GET['sid'])) {
require_once 'classes/model/Users.php';
$oUser = new Users();
$aUser = $oUser->load($aSession['USR_UID']);
initUserSession($aUser['USR_UID'], $aUser['USR_USERNAME']);
$bRedirect = false;
if (PHP_VERSION < 5.2) {
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
} else {
setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true);
}
$RBAC->initRBAC();
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);
$memKey = 'rbacSession' . session_id();
$memcache->set($memKey, $RBAC->aUserInfo, PMmemcached::EIGHT_HOURS);
}
}
if ((isset($_SESSION['USER_LOGGED'])) && (!(isset($_GET['sid'])))) {
if (PHP_VERSION < 5.2) {
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
} else {
setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true);
}
$RBAC->initRBAC();
//using optimization with memcache, the user data will be in memcache 8 hours, or until session id goes invalid
$memKey = 'rbacSession' . session_id();
if (($RBAC->aUserInfo = $memcache->get($memKey)) === false) {
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);
$memcache->set($memKey, $RBAC->aUserInfo, PMmemcached::EIGHT_HOURS);
}
} else {
// this is the blank list to allow execute scripts with no login (without session started)
$noLoginFiles = $noLoginFolders = [];
$noLoginFiles[] = 'login';
$noLoginFiles[] = 'authentication';
$noLoginFiles[] = 'login_Ajax';
$noLoginFiles[] = 'dbInfo';
$noLoginFiles[] = 'sysLoginVerify';
$noLoginFiles[] = 'processes_Ajax';
$noLoginFiles[] = 'showLogoFile';
$noLoginFiles[] = 'forgotPassword';
$noLoginFiles[] = 'retrivePassword';
$noLoginFiles[] = 'genericAjax';
$noLoginFolders[] = 'services';
$noLoginFolders[] = 'tracker';
$noLoginFolders[] = 'installer';
// This sentence is used when you lost the Session
if (!in_array(SYS_TARGET, $noLoginFiles)
&& !in_array(SYS_COLLECTION, $noLoginFolders)
&& $bWE != true && $collectionPlugin != 'services'
&& !$isRestRequest
) {
$bRedirect = true;
if (isset($_GET['sid'])) {
$oSessions = new Sessions();
if ($aSession = $oSessions->verifySession($_GET['sid'])) {
require_once 'classes/model/Users.php';
$oUser = new Users();
$aUser = $oUser->load($aSession['USR_UID']);
$_SESSION['USER_LOGGED'] = $aUser['USR_UID'];
$_SESSION['USR_USERNAME'] = $aUser['USR_USERNAME'];
$bRedirect = false;
if (PHP_VERSION < 5.2) {
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
} else {
setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true);
}
$RBAC->initRBAC();
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);
$memKey = 'rbacSession' . session_id();
$memcache->set($memKey, $RBAC->aUserInfo, PMmemcached::EIGHT_HOURS);
}
}
if ($bRedirect) {
if (substr(SYS_SKIN, 0,
2) == 'ux' && SYS_SKIN != 'uxs'
) { // verify if the current skin is a 'ux' variant
$loginUrl = 'main/login';
} else {
if (strpos($_SERVER['REQUEST_URI'],
'/home') !== false
) { //verify is it is using the uxs skin for simplified interface
$loginUrl = 'home/login';
} else {
$loginUrl = 'login/login'; // just set up the classic login
}
}
if (empty($_POST)) {
header('location: ' . SYS_URI . $loginUrl . '?u=' . urlencode($_SERVER['REQUEST_URI']));
} else {
if ($isControllerCall) {
header("HTTP/1.0 302 session lost in controller");
} else {
header('location: ' . SYS_URI . $loginUrl);
}
}
die();
}
}
}
$_SESSION['phpLastFileFound'] = $_SERVER['REQUEST_URI'];
/**
* New feature for Gulliver framework to support Controllers & HttpProxyController classes handling
*
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
*/
if ($isControllerCall) { //Instance the Controller object and call the request method
$controller = new $controllerClass();
$controller->setHttpRequestData($_REQUEST);
$controller->call($controllerAction);
} elseif ($isRestRequest) {
G::dispatchRestService(SYS_TARGET, $restConfig, $restApiClassPath);
} else {
require_once $filter->validateInput($phpFile, 'path');
}
if (defined('SKIP_HEADERS')) {
header("Expires: " . gmdate("D, d M Y H:i:s",
mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1)) . " GMT");
header('Cache-Control: public');
header('Pragma: ');
}
ob_end_flush();
if (DEBUG_TIME_LOG) {
G::logTimeByPage(); //log this page
}
}
}
}

View File

@@ -98,11 +98,8 @@ if (!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] != $decodedResp
session_start();
session_regenerate_id();
if (PHP_VERSION < 5.2) {
setcookie("workspaceSkin", $enviroment, time() + (24 * 60 * 60), "/sys" . $enviroment, "; HttpOnly");
} else {
setcookie("workspaceSkin", $enviroment, time() + (24 * 60 * 60), "/sys" . $enviroment, null, false, true);
}
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60), 'path' => '/sys' . $enviroment, 'httponly' => true]);
setcookie('workspaceSkin', $enviroment, $cookieOptions);
$_SESSION = array();
$_SESSION['__EE_INSTALLATION__'] = 2;

View File

@@ -944,11 +944,8 @@ if (!defined('EXECUTE_BY_CRON')) {
(!(preg_match("/safari/i", $_SERVER ['HTTP_USER_AGENT']) == 1 && preg_match("/chrome/i",
$_SERVER ['HTTP_USER_AGENT']) == 0) ||
$config['safari_cookie_lifetime'] == 1)) {
if (PHP_VERSION < 5.2) {
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
} else {
setcookie(session_name(), session_id(), time() + $timelife, '/', null, G::is_https(), true);
}
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + $timelife, 'httponly' => true]);
setcookie(session_name(), session_id(), $cookieOptions);
}
$RBAC->initRBAC();
//using optimization with memcache, the user data will be in memcache 8 hours, or until session id goes invalid
@@ -1024,11 +1021,8 @@ if (!defined('EXECUTE_BY_CRON')) {
(!(preg_match("/safari/i", $_SERVER ['HTTP_USER_AGENT']) == 1 && preg_match("/chrome/i",
$_SERVER ['HTTP_USER_AGENT']) == 0) ||
$config['safari_cookie_lifetime'] == 1)) {
if (PHP_VERSION < 5.2) {
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
} else {
setcookie(session_name(), session_id(), time() + $timelife, '/', null, G::is_https(), true);
}
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + $timelife, 'httponly' => true]);
setcookie(session_name(), session_id(), $cookieOptions);
}
$RBAC->initRBAC();
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);