[dev] patch for Nag portal block

Karsten Fourmont fourmont at gmx.de
Wed Jun 30 14:22:12 PDT 2004


Hi,

attached is a patch for the nag portal block:
it shows the categories in the portal summary. Feature can be turned on 
and off in portal block configuration.

Karsten

-------------- next part --------------
Index: summary.php
===================================================================
RCS file: /repository/nag/lib/Block/summary.php,v
retrieving revision 1.40
diff -u -r1.40 summary.php
--- summary.php	28 Jun 2004 14:41:59 -0000	1.40
+++ summary.php	30 Jun 2004 20:25:05 -0000
@@ -45,6 +45,9 @@
                      'show_alarms' => array('type' => 'checkbox',
                                             'name' => _("Show task alarms?"),
                                             'default' => 1),
+		     'show_category' => array('type' => 'checkbox',
+					      'name' => _("Show category of task?"),
+					      'default' => 1),
                      'show_overdue' => array('type' => 'checkbox',
                                              'name' => _("Always show overdue tasks?"),
                                              'default' => 1),
@@ -169,9 +172,16 @@
                 $html .= ' (' . strftime($prefs->getValue('date_format'), $task['due']) . ')';
             }
 
-            $html .= "</td></tr>\n";
-        }
+	    $html .= "</td>";
 
+	    if (!empty($this->_params['show_category'])) {
+	      $html .= '<td width="1%" nowrap="nowrap" class="' . $tstyle . '">&nbsp;'
+		. htmlspecialchars($task['category'] ? $task['category'] : _("Unfiled"))
+		. '&nbsp;</td>';
+	    }
+	    $html .= "</tr>\n";
+        }
+	
         if (empty($html)) {
             $html = '<table border="0" cellpadding="0" cellspacing="1" width="100%%"><tr><td><i>' . _("No tasks to display") . '</i></td></tr></table>';
         } else {


More information about the dev mailing list