mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
* Calendar: Added category filter for events without a category set
This commit is contained in:
parent
23f0b6faaf
commit
e9038d2f34
@ -623,7 +623,12 @@ class calendar_so
|
||||
function cat_filter($cat_id)
|
||||
{
|
||||
$sql = '';
|
||||
if ($cat_id)
|
||||
// No category
|
||||
if($cat_id === false || $cat_id && ($cat_id == ["0"] || !(int)$cat_id))
|
||||
{
|
||||
$sql = 'cal_category=""';
|
||||
}
|
||||
elseif($cat_id)
|
||||
{
|
||||
$cats = $GLOBALS['egw']->categories->return_all_children($cat_id);
|
||||
array_walk($cats, function (&$val, $key)
|
||||
@ -631,7 +636,10 @@ class calendar_so
|
||||
unset($key); // not used, but required by function signature
|
||||
$val = (int)$val;
|
||||
});
|
||||
if (is_array($cat_id) && count($cat_id)==1) $cat_id = $cat_id[0];
|
||||
if(is_array($cat_id) && count($cat_id) == 1)
|
||||
{
|
||||
$cat_id = $cat_id[0];
|
||||
}
|
||||
$sql = '(cal_category' . (count($cats) > 1 ? " IN ('" . implode("','", $cats) . "')" : '=' . $this->db->quote((int)$cat_id));
|
||||
foreach($cats as $cat)
|
||||
{
|
||||
|
@ -18,7 +18,9 @@ Egroupware
|
||||
<et2-textbox type="hidden" id="first"></et2-textbox>
|
||||
<et2-textbox type="hidden" id="last"></et2-textbox>
|
||||
<hrule/>
|
||||
<et2-select-cat id="cat_id" placeholder="All categories" onchange="app.calendar.update_state({cat_id: widget.getValue()});" emptyLabel="All categories" multiple="true"></et2-select-cat>
|
||||
<et2-select-cat id="cat_id" placeholder="All categories" onchange="app.calendar.update_state({cat_id: widget.getValue()});" emptyLabel="All categories" multiple="true">
|
||||
<option value="0">None</option>
|
||||
</et2-select-cat>
|
||||
<et2-select id="status_filter" onchange="app.calendar.update_state({status_filter: widget.getValue()});" noLang="true"></et2-select>
|
||||
<hrule/>
|
||||
<et2-calendar-owner id="owner" onchange="app.calendar.update_state({owner: widget.getValue()}); return false;" multiple="true" allowFreeEntries="false" autocompleteParams="{"checkgrants": true}"/>
|
||||
|
Loading…
Reference in New Issue
Block a user