mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-09 07:28:14 +01:00
Handle searching for a single integer as looking for a specific event by ID, similar to infolog
This commit is contained in:
parent
8ac5beda39
commit
a31b413018
@ -734,12 +734,19 @@ class calendar_so
|
|||||||
$where = $params['query'];
|
$where = $params['query'];
|
||||||
}
|
}
|
||||||
elseif ($params['query'])
|
elseif ($params['query'])
|
||||||
|
{
|
||||||
|
if(is_numeric($params['query']))
|
||||||
|
{
|
||||||
|
$where[] = $this->cal_table.'.cal_id = ' . (int)$params['query'];
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
foreach(array('cal_title','cal_description','cal_location') as $col)
|
foreach(array('cal_title','cal_description','cal_location') as $col)
|
||||||
{
|
{
|
||||||
$to_or[] = $col.' '.$this->db->capabilities[Api\Db::CAPABILITY_CASE_INSENSITIV_LIKE].' '.$this->db->quote('%'.$params['query'].'%');
|
$to_or[] = $col.' '.$this->db->capabilities[Api\Db::CAPABILITY_CASE_INSENSITIV_LIKE].' '.$this->db->quote('%'.$params['query'].'%');
|
||||||
}
|
}
|
||||||
$where[] = '('.implode(' OR ',$to_or).')';
|
$where[] = '('.implode(' OR ',$to_or).')';
|
||||||
|
}
|
||||||
|
|
||||||
// Searching - restrict private to own or private grant
|
// Searching - restrict private to own or private grant
|
||||||
if (!isset($params['private_grants']))
|
if (!isset($params['private_grants']))
|
||||||
|
Loading…
Reference in New Issue
Block a user