Merged in bugfix/PMCORE-3069 (pull request #7975)
PMCORE-3069 Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -5,6 +5,7 @@ namespace ProcessMaker\BusinessModel\Cases;
|
||||
use G;
|
||||
use ProcessMaker\Model\Application;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
class Draft extends AbstractCases
|
||||
{
|
||||
@@ -14,10 +15,11 @@ class Draft extends AbstractCases
|
||||
'APP_DELEGATION.APP_NUMBER', // Case #
|
||||
'APP_DELEGATION.DEL_TITLE', // Case Title
|
||||
'PROCESS.PRO_TITLE', // Process
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
|
||||
'APP_DELEGATION.DEL_DELEGATE_DATE', // Delegate Date
|
||||
'APP_DELEGATION.DEL_PRIORITY', // Priority
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
|
||||
'APP_DELEGATION.DEL_DELEGATE_DATE', // Delegate Date
|
||||
'APP_DELEGATION.DEL_PRIORITY', // Priority
|
||||
'APP_DELEGATION.DEL_PREVIOUS', // Previous
|
||||
// Additional column for other functionalities
|
||||
'APP_DELEGATION.APP_UID', // Case Uid for Open case
|
||||
'APP_DELEGATION.DEL_INDEX', // Del Index for Open case
|
||||
@@ -119,6 +121,13 @@ class Draft extends AbstractCases
|
||||
// Apply the date format defined in environment
|
||||
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
|
||||
$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']) : [];
|
||||
$result = [];
|
||||
$result['del_previous'] = $item['DEL_PREVIOUS'];
|
||||
$result['user_tooltip'] = $userInfo;
|
||||
$item['SEND_BY_INFO'] = $result;
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace ProcessMaker\BusinessModel\Cases;
|
||||
use G;
|
||||
use ProcessMaker\Model\Application;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
class Inbox extends AbstractCases
|
||||
{
|
||||
@@ -14,13 +15,14 @@ class Inbox extends AbstractCases
|
||||
'APP_DELEGATION.APP_NUMBER', // Case #
|
||||
'APP_DELEGATION.DEL_TITLE', // Case Title
|
||||
'PROCESS.PRO_TITLE', // Process
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'USERS.USR_USERNAME', // Current UserName
|
||||
'USERS.USR_FIRSTNAME', // Current User FirstName
|
||||
'USERS.USR_LASTNAME', // Current User LastName
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
|
||||
'APP_DELEGATION.DEL_DELEGATE_DATE', // Delegate Date
|
||||
'APP_DELEGATION.DEL_PRIORITY', // Priority
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'USERS.USR_USERNAME', // Current UserName
|
||||
'USERS.USR_FIRSTNAME', // Current User FirstName
|
||||
'USERS.USR_LASTNAME', // Current User LastName
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
|
||||
'APP_DELEGATION.DEL_DELEGATE_DATE', // Delegate Date
|
||||
'APP_DELEGATION.DEL_PRIORITY', // Priority
|
||||
'APP_DELEGATION.DEL_PREVIOUS', // Previous
|
||||
// Additional column for other functionalities
|
||||
'APP_DELEGATION.APP_UID', // Case Uid for Open case
|
||||
'APP_DELEGATION.DEL_INDEX', // Del Index for Open case
|
||||
@@ -134,6 +136,13 @@ class Inbox extends AbstractCases
|
||||
// Apply the date format defined in environment
|
||||
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
|
||||
$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']) : [];
|
||||
$result = [];
|
||||
$result['del_previous'] = $item['DEL_PREVIOUS'];
|
||||
$result['user_tooltip'] = $userInfo;
|
||||
$item['SEND_BY_INFO'] = $result;
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
@@ -16,13 +16,14 @@ class Participated extends AbstractCases
|
||||
'APP_DELEGATION.APP_NUMBER', // Case #
|
||||
'APP_DELEGATION.DEL_TITLE', // Case Title
|
||||
'PROCESS.PRO_TITLE', // Process Name
|
||||
'TASK.TAS_TITLE', // Pending Task
|
||||
'TASK.TAS_TITLE', // Pending Task
|
||||
'TASK.TAS_ASSIGN_TYPE', // Task assign rule
|
||||
'APPLICATION.APP_STATUS', // Status
|
||||
'APPLICATION.APP_CREATE_DATE', // Start Date
|
||||
'APPLICATION.APP_FINISH_DATE', // Finish Date
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date related to the colors
|
||||
'USERS.USR_ID', // Current UserId
|
||||
'APPLICATION.APP_STATUS', // Status
|
||||
'APPLICATION.APP_CREATE_DATE', // Start Date
|
||||
'APPLICATION.APP_FINISH_DATE', // Finish Date
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date related to the colors
|
||||
'APP_DELEGATION.DEL_PREVIOUS', // Previous
|
||||
'USERS.USR_ID', // Current UserId
|
||||
// Additional column for other functionalities
|
||||
'APP_DELEGATION.APP_UID', // Case Uid for Open case
|
||||
'APP_DELEGATION.DEL_INDEX', // Del Index for Open case
|
||||
@@ -213,6 +214,13 @@ class Participated extends AbstractCases
|
||||
$item['PENDING'] = $result;
|
||||
break;
|
||||
}
|
||||
// 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']) : [];
|
||||
$result = [];
|
||||
$result['del_previous'] = $item['DEL_PREVIOUS'];
|
||||
$result['user_tooltip'] = $userInfo;
|
||||
$item['SEND_BY_INFO'] = $result;
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace ProcessMaker\BusinessModel\Cases;
|
||||
|
||||
use G;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
class Paused extends AbstractCases
|
||||
{
|
||||
@@ -13,13 +14,14 @@ class Paused extends AbstractCases
|
||||
'APP_DELEGATION.APP_NUMBER', // Case #
|
||||
'APP_DELEGATION.DEL_TITLE', // Case Title
|
||||
'PROCESS.PRO_TITLE', // Process
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'USERS.USR_USERNAME', // Current UserName
|
||||
'USERS.USR_FIRSTNAME', // Current User FirstName
|
||||
'USERS.USR_LASTNAME', // Current User LastName
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
|
||||
'APP_DELEGATION.DEL_DELEGATE_DATE', // Delegate Date
|
||||
'APP_DELEGATION.DEL_PRIORITY', // Priority
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'USERS.USR_USERNAME', // Current UserName
|
||||
'USERS.USR_FIRSTNAME', // Current User FirstName
|
||||
'USERS.USR_LASTNAME', // Current User LastName
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
|
||||
'APP_DELEGATION.DEL_DELEGATE_DATE', // Delegate Date
|
||||
'APP_DELEGATION.DEL_PRIORITY', // Priority
|
||||
'APP_DELEGATION.DEL_PREVIOUS', // Previous
|
||||
// Additional column for other functionalities
|
||||
'APP_DELEGATION.APP_UID', // Case Uid for Open case
|
||||
'APP_DELEGATION.DEL_INDEX', // Del Index for Open case
|
||||
@@ -128,6 +130,13 @@ class Paused extends AbstractCases
|
||||
// Apply the date format defined in environment
|
||||
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
|
||||
$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']) : [];
|
||||
$result = [];
|
||||
$result['del_previous'] = $item['DEL_PREVIOUS'];
|
||||
$result['user_tooltip'] = $userInfo;
|
||||
$item['SEND_BY_INFO'] = $result;
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace ProcessMaker\BusinessModel\Cases;
|
||||
use ProcessMaker\Model\AppNotes;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use ProcessMaker\Model\ProcessUser;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
class Supervising extends AbstractCases
|
||||
{
|
||||
@@ -14,11 +15,12 @@ class Supervising extends AbstractCases
|
||||
'APP_DELEGATION.APP_NUMBER', // Case #
|
||||
'APP_DELEGATION.DEL_TITLE', // Case Title
|
||||
'PROCESS.PRO_TITLE', // Process Name
|
||||
'TASK.TAS_TITLE', // Pending Task
|
||||
'APPLICATION.APP_STATUS', // Status
|
||||
'APPLICATION.APP_CREATE_DATE', // Start Date
|
||||
'APPLICATION.APP_FINISH_DATE', // Finish Date
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date related to the colors
|
||||
'TASK.TAS_TITLE', // Pending Task
|
||||
'APPLICATION.APP_STATUS', // Status
|
||||
'APPLICATION.APP_CREATE_DATE', // Start Date
|
||||
'APPLICATION.APP_FINISH_DATE', // Finish Date
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date related to the colors
|
||||
'APP_DELEGATION.DEL_PREVIOUS', // Previous
|
||||
'USERS.USR_ID', // Current UserId
|
||||
// Additional column for other functionalities
|
||||
'APP_DELEGATION.APP_UID', // Case Uid for Open case
|
||||
@@ -159,6 +161,13 @@ class Supervising extends AbstractCases
|
||||
$information[] = $this->threadInformation($thread);
|
||||
}
|
||||
$item['PENDING'] = $information;
|
||||
// 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']) : [];
|
||||
$result = [];
|
||||
$result['del_previous'] = $item['DEL_PREVIOUS'];
|
||||
$result['user_tooltip'] = $userInfo;
|
||||
$item['SEND_BY_INFO'] = $result;
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace ProcessMaker\BusinessModel\Cases;
|
||||
use G;
|
||||
use ProcessMaker\Model\Application;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
class Unassigned extends AbstractCases
|
||||
{
|
||||
@@ -14,13 +15,14 @@ class Unassigned extends AbstractCases
|
||||
'APP_DELEGATION.APP_NUMBER', // Case #
|
||||
'APP_DELEGATION.DEL_TITLE', // Case Title
|
||||
'PROCESS.PRO_TITLE', // Process
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'USERS.USR_USERNAME', // Current UserName
|
||||
'USERS.USR_FIRSTNAME', // Current User FirstName
|
||||
'USERS.USR_LASTNAME', // Current User LastName
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
|
||||
'APP_DELEGATION.DEL_DELEGATE_DATE', // Delegate Date
|
||||
'APP_DELEGATION.DEL_PRIORITY', // Priority
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'USERS.USR_USERNAME', // Current UserName
|
||||
'USERS.USR_FIRSTNAME', // Current User FirstName
|
||||
'USERS.USR_LASTNAME', // Current User LastName
|
||||
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
|
||||
'APP_DELEGATION.DEL_DELEGATE_DATE', // Delegate Date
|
||||
'APP_DELEGATION.DEL_PRIORITY', // Priority
|
||||
'APP_DELEGATION.DEL_PREVIOUS', // Previous
|
||||
// Additional column for other functionalities
|
||||
'APP_DELEGATION.APP_UID', // Case Uid for Open case
|
||||
'APP_DELEGATION.DEL_INDEX', // Del Index for Open case
|
||||
@@ -136,6 +138,13 @@ class Unassigned extends AbstractCases
|
||||
// Apply the date format defined in environment
|
||||
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
|
||||
$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']) : [];
|
||||
$result = [];
|
||||
$result['del_previous'] = $item['DEL_PREVIOUS'];
|
||||
$result['user_tooltip'] = $userInfo;
|
||||
$item['SEND_BY_INFO'] = $result;
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ class Application extends Model
|
||||
* @param int $user
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeUserId($query, $user)
|
||||
public function scopeUserId($query, int $user)
|
||||
{
|
||||
return $query->where('APP_DELEGATION.USR_ID', '=', $user);
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ class Delegation extends Model
|
||||
* @param int $user
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeUserId($query, $user)
|
||||
public function scopeUserId($query, int $user)
|
||||
{
|
||||
return $query->where('APP_DELEGATION.USR_ID', '=', $user);
|
||||
}
|
||||
@@ -1751,7 +1751,7 @@ class Delegation extends Model
|
||||
*/
|
||||
public static function getThreadInfo(int $appNumber, int $index)
|
||||
{
|
||||
$query = Delegation::query()->select(['APP_NUMBER', 'TAS_UID', 'TAS_ID', 'DEL_PREVIOUS', 'DEL_TITLE']);
|
||||
$query = Delegation::query()->select(['APP_NUMBER', 'TAS_UID', 'TAS_ID', 'DEL_PREVIOUS', 'DEL_TITLE', 'USR_ID']);
|
||||
$query->where('APP_NUMBER', $appNumber);
|
||||
$query->where('DEL_INDEX', $index);
|
||||
$query->limit(1);
|
||||
|
||||
@@ -52,7 +52,7 @@ class User extends Model
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeUserId($query, string $usrId)
|
||||
public function scopeUserId($query, int $usrId)
|
||||
{
|
||||
return $query->where('USR_ID', '=', $usrId);
|
||||
}
|
||||
@@ -212,7 +212,7 @@ class User extends Model
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getInformation($usrId)
|
||||
public static function getInformation(int $usrId)
|
||||
{
|
||||
$query = User::query()->select([
|
||||
'USR_USERNAME',
|
||||
|
||||
Reference in New Issue
Block a user