* Calendar: fixed planner by category view was showing all categories under "None"

This commit is contained in:
Ralf Becker 2014-10-20 09:14:48 +00:00
parent c1cea7ce73
commit 5bb2ac645e

View File

@ -2296,9 +2296,11 @@ class calendar_uiviews extends calendar_ui
if (!is_array($cat2sort)) if (!is_array($cat2sort))
{ {
$cat2sort = array(); $cat2sort = array();
$cat_filter = $this->cat_id ? (array)$this->cat_id : array();
foreach((array)$this->categories->return_sorted_array(0,false,'','','',true) as $data) foreach((array)$this->categories->return_sorted_array(0,false,'','','',true) as $data)
{ {
if (in_array($data['parent'], (array)$this->cat_id) || in_array($data['id'], (array)$this->cat_id)) // cat is a direct sub of $this->cat_id if (in_array($data['parent'], $cat_filter) || in_array($data['id'], $cat_filter) ||
!$data['parent'] && !$cat_filter) // cat is a direct sub of $this->cat_id
{ {
$cat2sort[$data['id']] = $data['id']; $cat2sort[$data['id']] = $data['id'];
$sort2label[$data['id']] = stripslashes($data['name']); $sort2label[$data['id']] = stripslashes($data['name']);