Merged in bugfix/PMCORE-3066 (pull request #7994)

PMCORE-3066

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Paula Quispe
2021-07-21 20:09:57 +00:00
committed by Julio Cesar Laura Avendaño
3 changed files with 73 additions and 0 deletions

View File

@@ -20687,6 +20687,30 @@ msgstr "Null"
msgid "Number cases"
msgstr "Number cases"
# TRANSLATION
# LABEL/ID_NUMBER_OF_CASES_DRAFT
#: LABEL/ID_NUMBER_OF_CASES_DRAFT
msgid "Number of Tasks in the Draft Folder: "
msgstr "Number of Tasks in the Draft Folder: "
# TRANSLATION
# LABEL/ID_NUMBER_OF_CASES_INBOX
#: LABEL/ID_NUMBER_OF_CASES_INBOX
msgid "Number of Tasks in the Inbox Folder: "
msgstr "Number of Tasks in the Inbox Folder: "
# TRANSLATION
# LABEL/ID_NUMBER_OF_CASES_PAUSED
#: LABEL/ID_NUMBER_OF_CASES_PAUSED
msgid "Number of Tasks in the Paused Folder: "
msgstr "Number of Tasks in the Paused Folder: "
# TRANSLATION
# LABEL/ID_NUMBER_OF_CASES_UNASSIGNED
#: LABEL/ID_NUMBER_OF_CASES_UNASSIGNED
msgid "Number of Tasks in the Unassigned Folder: "
msgstr "Number of Tasks in the Unassigned Folder: "
# TRANSLATION
# LABEL/ID_OBJECT
#: LABEL/ID_OBJECT

View File

@@ -60341,6 +60341,10 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_NO_VALUE','en','No','2014-01-15') ,
( 'LABEL','ID_NULL','en','Null','2014-01-15') ,
( 'LABEL','ID_NUMBER_CASES','en','Number cases','2015-03-30') ,
( 'LABEL','ID_NUMBER_OF_CASES_DRAFT','en','Number of Tasks in the Draft Folder: ','2021-07-21') ,
( 'LABEL','ID_NUMBER_OF_CASES_INBOX','en','Number of Tasks in the Inbox Folder: ','2021-07-21') ,
( 'LABEL','ID_NUMBER_OF_CASES_PAUSED','en','Number of Tasks in the Paused Folder: ','2021-07-21') ,
( 'LABEL','ID_NUMBER_OF_CASES_UNASSIGNED','en','Number of Tasks in the Unassigned Folder: ','2021-07-21') ,
( 'LABEL','ID_OBJECT','en','Object','2014-01-15') ,
( 'LABEL','ID_OBJECTS_UNAVAILABLE','en','No objects are available. All objects have been already assigned.','2014-01-15') ,
( 'LABEL','ID_OBJECT_ASSIGNED','en','Objects has been successfully assigned','2014-01-15') ,

View File

@@ -683,6 +683,51 @@ class Home extends Api
}
}
/**
* Get the tasks counters for todo, draft, paused and unassigned
*
* @url GET /:task/counter
*
* @return array
*
* @access protected
* @class AccessControl {@permission PM_CASES}
*/
public function getSpecificTaskCounter($task)
{
$result = [];
$usrUid = $this->getUserId();
$usrId = !empty($usrUid) ? User::getId($usrUid) : 0;
switch ($task) {
case 'inbox':
$taskList = new Inbox();
$text = G::LoadTranslation('ID_NUMBER_OF_CASES_INBOX');
break;
case 'draft':
$taskList = new Draft();
$text = G::LoadTranslation('ID_NUMBER_OF_CASES_DRAFT');
break;
case 'paused':
$taskList = new Paused();
$text = G::LoadTranslation('ID_NUMBER_OF_CASES_PAUSED');
break;
case 'unassigned':
$taskList = new Unassigned();
$text = G::LoadTranslation('ID_NUMBER_OF_CASES_UNASSIGNED');
break;
default:
return [];
}
$taskList->setUserUid($usrUid);
$taskList->setUserId($usrId);
$count = $taskList->getCounter();
$result = [];
$result['label'] = $text . $count;
$result['total'] = $count;
return $result;
}
/**
* Get the tasks counters for todo, draft, paused and unassigned
*