From 9bd54f6af5ea01b73f3bafc2fe27b00813768b78 Mon Sep 17 00:00:00 2001
From: Thomas Gelf <thomas@gelf.net>
Date: Sun, 20 Mar 2016 15:17:34 +0100
Subject: [PATCH] Houskeeping: allow to filter for pending tasks

---
 library/Director/Db/Housekeeping.php | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/library/Director/Db/Housekeeping.php b/library/Director/Db/Housekeeping.php
index 1b6677b2..2bc7d1d0 100644
--- a/library/Director/Db/Housekeeping.php
+++ b/library/Director/Db/Housekeeping.php
@@ -30,19 +30,25 @@ class Housekeeping
     public function getTaskSummary()
     {
         return array(
-            'oldUndeployedConfigs' => array(
+            'oldUndeployedConfigs' => (object) array(
                 'title' => N_('Undeployed configurations'),
                 'count' => $this->countOldUndeployedConfigs()
             ),
-            'unusedFiles' => array(
+            'unusedFiles' => (object) array(
                 'title' => N_('Unused rendered files'),
                 'count' => $this->countUnusedFiles()
             )
         );
     }
 
-    public function getPendingTasks()
+    public function getPendingTaskSummary()
     {
+        return array_filter(
+            $this->getTaskSummary(),
+            function($task) {
+                return $task->count > 0;
+            }
+        );
     }
 
     public function countOldUndeployedConfigs()