[dev] Nag: tasks with no names?

John Morrissey jwm at horde.net
Thu Jan 2 19:49:30 PST 2003


On Thu, Jan 02, 2003 at 12:42:14AM +0100, Jan Schneider wrote:
% Zitat von John Morrissey <jwm at horde.net>:
% >  displaying a dummy name ("(no name)") on the List Tasks page?
% 
% I'd prefer the latter.

Attached. Kronolith suffered the same malaise, so I fixed it, too.

Also attached is an instance of <?= that I noticed in docs/CODING_STANDARDS.

john
-- 
John Morrissey          _o            /\         ----  __o
jwm at horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__
-------------- next part --------------
Index: nag/lib/api.php
===================================================================
RCS file: /repository/nag/lib/api.php,v
retrieving revision 1.33
diff -u -u -r1.33 api.php
--- nag/lib/api.php	27 Dec 2002 18:11:06 -0000	1.33
+++ nag/lib/api.php	2 Jan 2003 18:24:00 -0000
@@ -113,7 +114,9 @@
             }
         }
 
-        $row .= htmlspecialchars($task['name']) . '</a>';
+        $row .= $task['name'] ? htmlspecialchars($task['name']) :
+                                _('(no task name)');
+        $row .= '</a>';
 
         if (!empty($task['completed'])) {
             $closed_begin = '<strike>';
Index: nag/templates/list/task_summaries.inc
===================================================================
RCS file: /repository/nag/templates/list/task_summaries.inc,v
retrieving revision 1.25
diff -u -u -r1.25 task_summaries.inc
--- nag/templates/list/task_summaries.inc	7 Dec 2002 13:03:11 -0000	1.25
+++ nag/templates/list/task_summaries.inc	2 Jan 2003 18:24:00 -0000
@@ -16,7 +16,7 @@
     <td align="center" nowrap="nowrap"><?php echo htmlspecialchars(Nag::formatCompletion($task['completed'])) ?></a></td>
     <td align="center" nowrap="nowrap"><?php echo $owner ?></td>
     <td align="center"><?php echo $task['priority'] ?></td>
-    <td nowrap="nowrap"><?php echo Horde::link(Horde::applicationUrl($viewurl), _("View Task Details"), '', '', '', $task['desc']) ?><?php echo htmlspecialchars($task['name']) ?></a></td>
+    <td nowrap="nowrap"><?php echo Horde::link(Horde::applicationUrl($viewurl), _("View Task Details"), '', '', '', $task['desc']) ?><?php echo $task['name'] ? htmlspecialchars($task['name']) : _('(no task name)') ?></a></td>
     <td nowrap="nowrap">
 <?php if ($task['due'] > 0): ?>
        <?php if (empty($task['completed']) && $task['due'] < time()) { echo '<span class="overdue">' . strftime($conf['list']['date_format'], $task['due']) . '</span>';
-------------- next part --------------
Index: kronolith/lib/Event.php
===================================================================
RCS file: /repository/kronolith/lib/Event.php,v
retrieving revision 1.66
diff -u -u -r1.66 Event.php
--- kronolith/lib/Event.php	30 Dec 2002 10:45:18 -0000	1.66
+++ kronolith/lib/Event.php	2 Jan 2003 19:06:16 -0000
@@ -783,7 +783,9 @@
             }
         }
 
-        $link .= htmlspecialchars($this->getTitle(), ENT_QUOTES, NLS::getCharset());
+        $title = $this->getTitle();
+        $link .= htmlspecialchars($title ? $title : _('(no event title)'),
+                                  ENT_QUOTES, NLS::getCharset());
 
         if ($share->hasPermission(Auth::getAuth(), _PERMS_READ) &&
             (isset($this->eventID) || isset($this->taskID) || isset($this->remoteCal))) {
Index: kronolith/lib/api.php
===================================================================
RCS file: /repository/kronolith/lib/api.php,v
retrieving revision 1.52
diff -u -u -r1.52 api.php
--- kronolith/lib/api.php	16 Dec 2002 00:04:21 -0000	1.52
+++ kronolith/lib/api.php	2 Jan 2003 19:10:06 -0000
@@ -154,6 +154,10 @@
             if (!empty($event->location)) {
                 $text .= ' (' . $event->location . ')';
             }
+            if (!$text) {
+                $text = _('(no event title)');
+            }
+
             if (isset($event->eventID)) {
                 $htmlday .= $time;
             } elseif (isset($event->taskID)) {
-------------- next part --------------
Index: docs/CODING_STANDARDS
===================================================================
RCS file: /repository/horde/docs/CODING_STANDARDS,v
retrieving revision 1.55
diff -u -u -r1.55 CODING_STANDARDS
--- docs/CODING_STANDARDS	14 Oct 2002 20:23:27 -0000	1.55
+++ docs/CODING_STANDARDS	2 Jan 2003 18:25:03 -0000
@@ -300,8 +300,8 @@
 All images must have an alt attribute:
 
     <img src="example.gif" alt="<?= _("Example") ?>" />
-    <?= Horde::img('example.gif', _("Example")) ?>                  (On the HEAD branch)
-    <?= Horde::img('example.gif', 'alt="' . _("Example") . '"') ?>  (On the RELENG_2 branch)
+    <?php Horde::img('example.gif', _("Example")) ?>                  (On the HEAD branch)
+    <?php Horde::img('example.gif', 'alt="' . _("Example") . '"') ?>  (On the RELENG_2 branch)
 
 Input fields of type "image" do not allow the border attribute and may render
 with a border on some browsers. Use the following instead:


More information about the dev mailing list