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

This commit is contained in:
Ralf Becker 2014-10-20 09:14:24 +00:00
parent 8a827671b8
commit d0208328bc

View File

@ -2296,9 +2296,11 @@ class calendar_uiviews extends calendar_ui
if (!is_array($cat2sort))
{
$cat2sort = array();
$cat_filter = $this->cat_id ? (array)$this->cat_id : array();
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'];
$sort2label[$data['id']] = stripslashes($data['name']);