PMCORE-3245
This commit is contained in:
@@ -3545,6 +3545,12 @@ msgstr "The Case was deleted successfully."
|
|||||||
msgid "Case Uid"
|
msgid "Case Uid"
|
||||||
msgstr "Case Uid"
|
msgstr "Case Uid"
|
||||||
|
|
||||||
|
# TRANSLATION
|
||||||
|
# LABEL/ID_CASE_THREAD_TITLE
|
||||||
|
#: LABEL/ID_CASE_THREAD_TITLE
|
||||||
|
msgid "Case thread title"
|
||||||
|
msgstr "Case thread title"
|
||||||
|
|
||||||
# TRANSLATION
|
# TRANSLATION
|
||||||
# LABEL/ID_CASES
|
# LABEL/ID_CASES
|
||||||
#: LABEL/ID_CASES
|
#: LABEL/ID_CASES
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ class AppProxy extends HttpProxyController
|
|||||||
],
|
],
|
||||||
$j++ => [ // Case Title per thread
|
$j++ => [ // Case Title per thread
|
||||||
'id' => 'CASE_TITLE',
|
'id' => 'CASE_TITLE',
|
||||||
'label' => G::LoadTranslation('ID_TASK_TITLE') . ': ',
|
'label' => G::LoadTranslation('ID_CASE_THREAD_TITLE') . ': ',
|
||||||
'value' => $row['DEL_TITLE'],
|
'value' => $row['DEL_TITLE'],
|
||||||
],
|
],
|
||||||
$j++ => [ // Current User
|
$j++ => [ // Current User
|
||||||
|
|||||||
@@ -57397,6 +57397,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
|||||||
( 'LABEL','ID_CASELIST_CAN_NOT_BE_IMPORTED_THE_PMTABLE_NOT_EXIST','en','Custom Case List {0} can not be imported because the PM Table does not exist in this Workspace.','2021-08-20') ,
|
( 'LABEL','ID_CASELIST_CAN_NOT_BE_IMPORTED_THE_PMTABLE_NOT_EXIST','en','Custom Case List {0} can not be imported because the PM Table does not exist in this Workspace.','2021-08-20') ,
|
||||||
( 'LABEL','ID_CASE_DELETE_SUCCESFULLY','en','The Case was deleted successfully.','2020-01-08') ,
|
( 'LABEL','ID_CASE_DELETE_SUCCESFULLY','en','The Case was deleted successfully.','2020-01-08') ,
|
||||||
( 'LABEL','ID_CASE_UID','en','Case Uid','2021-04-04') ,
|
( 'LABEL','ID_CASE_UID','en','Case Uid','2021-04-04') ,
|
||||||
|
( 'LABEL','ID_CASE_THREAD_TITLE','en','Case thread title','2021-08-27') ,
|
||||||
( 'LABEL','ID_CASES','en','HOME','2014-01-15') ,
|
( 'LABEL','ID_CASES','en','HOME','2014-01-15') ,
|
||||||
( 'LABEL','ID_CASES1','en','Cases','2015-12-15') ,
|
( 'LABEL','ID_CASES1','en','Cases','2015-12-15') ,
|
||||||
( 'LABEL','ID_CASES_DELETE_SUCCESFULLY','en','All Cases were deleted successfully.','2020-01-08') ,
|
( 'LABEL','ID_CASES_DELETE_SUCCESFULLY','en','All Cases were deleted successfully.','2020-01-08') ,
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ class Search extends AbstractCases
|
|||||||
}
|
}
|
||||||
// Specific case title
|
// Specific case title
|
||||||
if (!empty($this->getCaseTitle())) {
|
if (!empty($this->getCaseTitle())) {
|
||||||
// Join with delegation
|
// Get the result
|
||||||
$query->joinDelegation();
|
$result = Delegation::casesThreadTitle($this->getCaseTitle(), $this->getOffset(), $this->getLimit());
|
||||||
// Add the filter
|
// Add the filter
|
||||||
// $query->title($this->getCaseTitle());
|
$query->specificCases($result);
|
||||||
}
|
}
|
||||||
// Filter by category
|
// Filter by category
|
||||||
if ($this->getCategoryId()) {
|
if ($this->getCategoryId()) {
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ class Delegation extends Model
|
|||||||
$query->whereRaw("MATCH(APP_DELEGATION.DEL_TITLE) AGAINST('{$search}' IN BOOLEAN MODE)");
|
$query->whereRaw("MATCH(APP_DELEGATION.DEL_TITLE) AGAINST('{$search}' IN BOOLEAN MODE)");
|
||||||
} else {
|
} else {
|
||||||
// Searching using "like" operator
|
// Searching using "like" operator
|
||||||
$query->where('APP_DELEGATION.DEL_TITLE', 'LIKE', "%${$search}%");
|
$query->where('APP_DELEGATION.DEL_TITLE', 'LIKE', "%{$search}%");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
@@ -2081,4 +2081,29 @@ class Delegation extends Model
|
|||||||
|
|
||||||
return $results->values()->toArray();
|
return $results->values()->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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)
|
||||||
|
{
|
||||||
|
// Get the case numbers related to this filter
|
||||||
|
$query = Delegation::query()->select(['APP_NUMBER']);
|
||||||
|
// Filter the title
|
||||||
|
$query->title($search);
|
||||||
|
// Group by
|
||||||
|
$query->groupBy('APP_NUMBER');
|
||||||
|
// Apply the limit
|
||||||
|
$query->offset($offset)->limit($limit);
|
||||||
|
// Get the result
|
||||||
|
$results = $query->get();
|
||||||
|
|
||||||
|
return $results->values()->toArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user