PMCORE-3542

This commit is contained in:
Paula Quispe
2021-11-19 16:15:02 -04:00
parent 90948c3473
commit fe9d26c3fb
13 changed files with 346 additions and 36 deletions

View File

@@ -24383,6 +24383,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
@@ -24965,6 +24971,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

View File

@@ -60988,6 +60988,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') ,
@@ -61090,6 +61091,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') ,

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

@@ -6,6 +6,7 @@ use G;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\User;
class Draft extends AbstractCases
@@ -127,10 +128,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;

View File

@@ -6,6 +6,7 @@ use G;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\User;
class Inbox extends AbstractCases
@@ -81,7 +82,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 +90,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 +112,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 */
@@ -147,10 +146,25 @@ 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['user_tooltip'] = $userInfo;
$result['dummy_task'] = $dummyInfo;
$item['SEND_BY_INFO'] = $result;
return $item;

View File

@@ -5,6 +5,7 @@ namespace ProcessMaker\BusinessModel\Cases;
use G;
use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\User;
class Paused extends AbstractCases
@@ -80,7 +81,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 +89,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 +108,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 */
@@ -141,10 +140,25 @@ 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['user_tooltip'] = $userInfo;
$result['dummy_task'] = $dummyInfo;
$item['SEND_BY_INFO'] = $result;
return $item;

View File

@@ -6,6 +6,7 @@ use G;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\User;
class Unassigned extends AbstractCases
@@ -90,8 +91,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());
}
@@ -149,10 +149,25 @@ 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['user_tooltip'] = $userInfo;
$result['dummy_task'] = $dummyInfo;
$item['SEND_BY_INFO'] = $result;
return $item;

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,37 @@ 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;
}
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;
}
});
return $title;
return [
'title' => $title,
'type' => $type,
];
}
/**