Fix conflicts merging to develop
This commit is contained in:
@@ -77,7 +77,8 @@ class System
|
||||
'mobile_offline_tables_download_interval' => 24,
|
||||
'highlight_home_folder_enable' => 0,
|
||||
'highlight_home_folder_refresh_time' => 10,
|
||||
'highlight_home_folder_scope' => 'unassigned' // For now only this list is supported
|
||||
'highlight_home_folder_scope' => 'unassigned', // For now only this list is supported
|
||||
'disable_advanced_search_case_title_fulltext' => 0
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace ProcessMaker\Model;
|
||||
use G;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
class Delegation extends Model
|
||||
{
|
||||
@@ -229,14 +230,21 @@ class Delegation extends Model
|
||||
$query->join('APPLICATION', function ($join) use ($filterBy, $search, $status, $query) {
|
||||
$join->on('APP_DELEGATION.APP_NUMBER', '=', 'APPLICATION.APP_NUMBER');
|
||||
if ($filterBy == 'APP_TITLE' && $search) {
|
||||
// Cleaning "fulltext" operators in order to avoid unexpected results
|
||||
$search = str_replace(['-', '+', '<', '>', '(', ')', '~', '*', '"'], ['', '', '', '', '', '', '', '', ''], $search);
|
||||
$config = System::getSystemConfiguration();
|
||||
if ((int)$config['disable_advanced_search_case_title_fulltext'] === 0) {
|
||||
// Cleaning "fulltext" operators in order to avoid unexpected results
|
||||
$search = str_replace(['-', '+', '<', '>', '(', ')', '~', '*', '"'],
|
||||
['', '', '', '', '', '', '', '', ''], $search);
|
||||
|
||||
// Build the "fulltext" expression
|
||||
$search = '+"' . preg_replace('/\s+/', '" +"', addslashes($search)) . '"';
|
||||
// Build the "fulltext" expression
|
||||
$search = '+"' . preg_replace('/\s+/', '" +"', addslashes($search)) . '"';
|
||||
|
||||
// Searching using "fulltext" index
|
||||
$join->whereRaw("MATCH(APPLICATION.APP_TITLE) AGAINST('{$search}' IN BOOLEAN MODE)");
|
||||
// Searching using "fulltext" index
|
||||
$join->whereRaw("MATCH(APPLICATION.APP_TITLE) AGAINST('{$search}' IN BOOLEAN MODE)");
|
||||
} else {
|
||||
// Searching using "like" operator
|
||||
$join->where('APPLICATION.APP_TITLE', 'LIKE', "%${search}%");
|
||||
}
|
||||
}
|
||||
// Based on the below, we can further limit the join so that we have a smaller data set based on join criteria
|
||||
switch ($status) {
|
||||
|
||||
Reference in New Issue
Block a user