task complion

Paul Cooper pgc@ucecom.com
Thu, 6 Dec 2001 11:40:00 -0500


---------------------- multipart/mixed attachment
I've been playing with nag, and I decided to add an extra field - 

task_completed  smallint default 0

which I use to indicate whether a task is completed or not (you were 
guessing right :) See the attached diff(s) - which style is preferred 
round here -u or -c?

As it stands it's not great - I haven't yet got round to adding the 
compeletion status to the task list, so there's no way to see open / 
closed tasks yet in the list (yet). Also now that I think about it could 
be more useful to be a percentage rather than a boolean, e.g. Open, 20%, 
40%, 60%, 80%, Closed.

Anyway I'll get round to that in a couple of days - just wanted to see 
what people think of the initial idea,

Paul


-- 
-----------------------------------------------------------------
Paul Cooper                             |  Tel: 0121 331 7858
Senior Programmer and Database Engineer |  Fax: 0121 331 7859
UCEcom                                  |  mailto:pgc@ucecom.com
University of Central England           |  http://www.ucecom.com
Birmingham, B4 7DX                      |
-----------------------------------------------------------------

---------------------- multipart/mixed attachment
? diff
? diff.u
Index: task.php
===================================================================
RCS file: /repository/nag/task.php,v
retrieving revision 1.16
diff -u -r1.16 task.php
--- task.php	7 Nov 2001 09:21:35 -0000	1.16
+++ task.php	6 Dec 2001 11:13:53 -0000
@@ -36,6 +36,7 @@
     $task_due = 0;
     $task_desc = '';
     $task_priority = PRIORITY_MED;
+ $task_completed = 0; 
     $task_depends = -1;
 
     /* Set the initial due date to one week from now. */
@@ -65,6 +66,7 @@
         $task_due = $tasks[$task_id]['due'];
         $task_desc = $tasks[$task_id]['desc'];
         $task_priority = $tasks[$task_id]['priority'];
+	$task_completed = $tasks[$task_id]['completed'];
         $task_depends = $tasks[$task_id]['depends'];
 
         /* If the due date isn't set, set the widgets to the default. */
@@ -96,6 +98,7 @@
     $task_name = Horde::getFormData('task_name');
     $task_desc = Horde::getFormData('task_desc');
     $task_priority = Horde::getFormData('task_priority');
+    $task_completed =  Horde::getFormData('task_completed');
     $task_depends = Horde::getFormData('task_depends');
     $due_type = Horde::getFormData('due_type');
     $due_day = Horde::getFormData('due_day');
@@ -119,10 +122,12 @@
         $storage->modifyTask($task_id, 'desc', $task_desc);
         $storage->modifyTask($task_id, 'due', $task_due);
         $storage->modifyTask($task_id, 'priority', $task_priority);
+        $storage->modifyTask($task_id, 'completed', $task_completed);
         $storage->modifyTask($task_id, 'depends', $task_depends);
     } else {
         $task_id = $storage->addTask($task_name, $task_desc, $task_due,
-                                     $task_priority, $task_depends);
+                                     $task_priority, $task_depends,
+	                             $task_completed);
     }
 
     /* Store the changes. */
Index: docs/nag_tasks.sql
===================================================================
RCS file: /repository/nag/docs/nag_tasks.sql,v
retrieving revision 1.6
diff -u -r1.6 nag_tasks.sql
--- docs/nag_tasks.sql	18 Sep 2001 17:10:22 -0000	1.6
+++ docs/nag_tasks.sql	6 Dec 2001 11:13:53 -0000
@@ -9,5 +9,6 @@
 	task_due	int null,
 	task_priority	int null default 0,
 	task_depends	int null default -1,
-	primary key (task_owner(100), task_id)
+	task_completed  small int default 0,
+	primary key (task_owner, task_id)
 );
Index: lib/Nag.php
===================================================================
RCS file: /repository/nag/lib/Nag.php,v
retrieving revision 1.31
diff -u -r1.31 Nag.php
--- lib/Nag.php	9 Nov 2001 23:47:55 -0000	1.31
+++ lib/Nag.php	6 Dec 2001 11:13:54 -0000
@@ -16,6 +16,15 @@
     PRIORITY_LOW    => _("Low")
 );
 
+/**
+ * Array for mapping completed boolean to their string representations.
+ * @var array $completed_map
+ */
+$completed_map = array(
+		      0 => _("Open"),
+		      1 => _("Closed")
+);
+
 /* Set the umask. */
 if (isset($conf['umask'])) {
     umask($conf['umask']);
@@ -281,6 +290,33 @@
     }
 
     /**
+     * Builds the task completed widget
+     *
+     * @param string  $name         The name of the widget.
+     * @param integer $selected     (optional) The default selected priority.
+     *
+     * @return string       The HTML <select> widget.
+     */
+    function buildCompletedWidget($name, $selected = 0)
+    {
+        global $completed_map;
+
+        $html = "<select name=\"$name\">";
+
+        foreach ($completed_map as $completed => $name) {
+            $html .= "<option value=\"$completed\"";
+            $html .= ($completed == $selected) ? ' selected="selected">' : '>';
+            $html .= $name . '</option>';
+        }
+        $html .= "</select>\n";
+
+        return $html;
+    }
+
+
+
+
+    /**
      * Formats the given Unix-style date string.
      *
      * @param string $unixdate     The Unix-style date value to format.
@@ -321,6 +357,28 @@
             } else {
                 return $priority_map[$priority];
             }
+        }
+
+        return _("Unknown");
+    }
+
+    /**
+     * Returns the string representation of the given completion status.
+     *
+     * @param int $completed     The priority value.
+     *
+     * @return string       The string representation of $priority.
+     */
+    function formatCompleted($completed)
+    {
+        global $completed_map;
+
+        if (in_array($completed, array_keys($completed_map))) {
+	  if (1 == $completed) {
+	    return _("Closed");
+	  } else {
+	    return _("Open");
+	  }
         }
 
         return _("Unknown");
Index: lib/Storage.php
===================================================================
RCS file: /repository/nag/lib/Storage.php,v
retrieving revision 1.18
diff -u -r1.18 Storage.php
--- lib/Storage.php	7 Nov 2001 09:21:35 -0000	1.18
+++ lib/Storage.php	6 Dec 2001 11:13:54 -0000
@@ -33,6 +33,7 @@
 /** @constant TASK_DELETED Task has been deleted. */
 define('TASK_DELETED', 4);
 
+
 /**
  * Nag_Storage:: defines an API for implementing storage backends for Nag.
  *
@@ -161,7 +162,7 @@
      *
      * @return integer  The numeric ID of the new task.
      */
-    function addTask($name, $desc, $due = 0, $priority = 0, $depends = -1)
+    function addTask($name, $desc, $due = 0, $priority = 0, $depends = -1, $completed = 0)
     {
         /* Create a new task task. */
         $task = array();
@@ -171,6 +172,7 @@
         $task['due'] = $due;
         $task['priority'] = $priority;
         $task['depends'] = $depends;
+	$task['completed'] = $completed;
         $task['flags'] = TASK_ADDED;
 
         /* Add it to the $tasks list. */
Index: lib/Storage/sql.php
===================================================================
RCS file: /repository/nag/lib/Storage/sql.php,v
retrieving revision 1.16
diff -u -r1.16 sql.php
--- lib/Storage/sql.php	15 Nov 2001 18:50:10 -0000	1.16
+++ lib/Storage/sql.php	6 Dec 2001 11:13:54 -0000
@@ -29,6 +29,7 @@
  *      task_due        int null,
  *      task_priority   int null default 0,
  *      task_depends    int null default -1,
+ *      task_completed  smallint default 0,
  *      primary key (task_owner, task_id)
  *  );</pre>
  *
@@ -156,6 +157,7 @@
                 $task['due'] = $row['task_due'];
                 $task['priority'] = $row['task_priority'];
                 $task['depends'] = $row['task_depends'];
+		$task['completed'] = $row['task_completed'];
                 $task['flags'] = 0;
 
                 /* Add this new task to the $tasks list. */
@@ -201,8 +203,8 @@
                 $query = sprintf(
                     'insert into %s (task_owner, task_id, task_name, ' .
                     'task_desc, task_added, task_due, task_priority, ' .
-                    'task_depends) ' .
-                    'values(%s, %d, %s, %s, %d, %d, %d, %d)',
+                    'task_depends, task_completed) ' .
+                    'values(%s, %d, %s, %s, %d, %d, %d, %d, %d)',
                     $this->params['table'],
                     $this->db->quote($this->user),
                     $task_id,
@@ -211,7 +213,8 @@
                     $task['added'],
                     $task['due'],
                     $task['priority'],
-                    $task['depends']);
+                    $task['depends'],
+		    $task['completed']);
 
                 /* Attempt the insertion query. */
                 $result = $this->db->query($query);
@@ -237,7 +240,8 @@
                 $query .= sprintf('task_added = %d, ', $task['added']);
                 $query .= sprintf('task_due = %d, ', $task['due']);
                 $query .= sprintf('task_priority = %d, ', $task['priority']);
-                $query .= sprintf('task_depends = %d ', $task['depends']);
+                $query .= sprintf('task_depends = %d, ', $task['depends']);
+                $query .= sprintf('task_completed = %d ', $task['completed']);
                 $query .= sprintf('where task_owner = %s and task_id = %d',
                                   $this->db->quote($this->user), $task_id);
 
Index: templates/task/task.inc
===================================================================
RCS file: /repository/nag/templates/task/task.inc,v
retrieving revision 1.6
diff -u -r1.6 task.inc
--- templates/task/task.inc	14 Aug 2001 20:32:35 -0000	1.6
+++ templates/task/task.inc	6 Dec 2001 11:14:02 -0000
@@ -31,6 +31,12 @@
     </td>
 </tr>
 <tr>
+    <td class="item" align="right" valign="top"><b><?= _("Completion Status") ?>:</b>&nbsp;</td>
+    <td class="item" width="100%">
+        <?= Nag::buildCompletedWidget('task_completed', $task_completed) ?>
+    </td>
+</tr>
+<tr>
     <td class="item" align="right" valign="top" nowrap="nowrap"><b><?= _("Depends On") ?>:</b>&nbsp;</td>
     <td class="item" width="100%">
         <?= Nag::buildTaskListWidget('task_depends', $tasks, $task_depends, true) ?>
Index: templates/view/headers.inc
===================================================================
RCS file: /repository/nag/templates/view/headers.inc,v
retrieving revision 1.9
diff -u -r1.9 headers.inc
--- templates/view/headers.inc	4 Jul 2001 02:01:14 -0000	1.9
+++ templates/view/headers.inc	6 Dec 2001 11:14:02 -0000
@@ -24,6 +24,10 @@
     <td class="item1" width="100%"><?= Nag::formatPriority($tasks[$task_id]['priority']) ?></td>
 </tr>
 <tr>
+    <td class="item1" align="right" valign="top" nowrap="nowrap"><b><?= _("Completion Status") ?>:</b>&nbsp;</td>
+    <td class="item1" width="100%"><?= Nag::formatCompleted($tasks[$task_id]['completed']) ?></td>
+</tr>
+<tr>
     <td class="item0" align="right" valign="top" nowrap="nowrap"><b><?= _("Depends On") ?>:</b>&nbsp;</td>
 <?php if ($tasks[$task_id]['depends'] >= 0): ?>
     <td class="item0" width="100%">

---------------------- multipart/mixed attachment
? diff.c
? diff.u
Index: task.php
===================================================================
RCS file: /repository/nag/task.php,v
retrieving revision 1.16
diff -c -r1.16 task.php
*** task.php	7 Nov 2001 09:21:35 -0000	1.16
--- task.php	6 Dec 2001 11:14:33 -0000
***************
*** 36,41 ****
--- 36,42 ----
      $task_due = 0;
      $task_desc = '';
      $task_priority = PRIORITY_MED;
+  $task_completed = 0; 
      $task_depends = -1;
  
      /* Set the initial due date to one week from now. */
***************
*** 65,70 ****
--- 66,72 ----
          $task_due = $tasks[$task_id]['due'];
          $task_desc = $tasks[$task_id]['desc'];
          $task_priority = $tasks[$task_id]['priority'];
+ 	$task_completed = $tasks[$task_id]['completed'];
          $task_depends = $tasks[$task_id]['depends'];
  
          /* If the due date isn't set, set the widgets to the default. */
***************
*** 96,101 ****
--- 98,104 ----
      $task_name = Horde::getFormData('task_name');
      $task_desc = Horde::getFormData('task_desc');
      $task_priority = Horde::getFormData('task_priority');
+     $task_completed =  Horde::getFormData('task_completed');
      $task_depends = Horde::getFormData('task_depends');
      $due_type = Horde::getFormData('due_type');
      $due_day = Horde::getFormData('due_day');
***************
*** 119,128 ****
          $storage->modifyTask($task_id, 'desc', $task_desc);
          $storage->modifyTask($task_id, 'due', $task_due);
          $storage->modifyTask($task_id, 'priority', $task_priority);
          $storage->modifyTask($task_id, 'depends', $task_depends);
      } else {
          $task_id = $storage->addTask($task_name, $task_desc, $task_due,
!                                      $task_priority, $task_depends);
      }
  
      /* Store the changes. */
--- 122,133 ----
          $storage->modifyTask($task_id, 'desc', $task_desc);
          $storage->modifyTask($task_id, 'due', $task_due);
          $storage->modifyTask($task_id, 'priority', $task_priority);
+         $storage->modifyTask($task_id, 'completed', $task_completed);
          $storage->modifyTask($task_id, 'depends', $task_depends);
      } else {
          $task_id = $storage->addTask($task_name, $task_desc, $task_due,
!                                      $task_priority, $task_depends,
! 	                             $task_completed);
      }
  
      /* Store the changes. */
Index: docs/nag_tasks.sql
===================================================================
RCS file: /repository/nag/docs/nag_tasks.sql,v
retrieving revision 1.6
diff -c -r1.6 nag_tasks.sql
*** docs/nag_tasks.sql	18 Sep 2001 17:10:22 -0000	1.6
--- docs/nag_tasks.sql	6 Dec 2001 11:14:33 -0000
***************
*** 9,13 ****
  	task_due	int null,
  	task_priority	int null default 0,
  	task_depends	int null default -1,
! 	primary key (task_owner(100), task_id)
  );
--- 9,14 ----
  	task_due	int null,
  	task_priority	int null default 0,
  	task_depends	int null default -1,
! 	task_completed  small int default 0,
! 	primary key (task_owner, task_id)
  );
Index: lib/Nag.php
===================================================================
RCS file: /repository/nag/lib/Nag.php,v
retrieving revision 1.31
diff -c -r1.31 Nag.php
*** lib/Nag.php	9 Nov 2001 23:47:55 -0000	1.31
--- lib/Nag.php	6 Dec 2001 11:14:34 -0000
***************
*** 16,21 ****
--- 16,30 ----
      PRIORITY_LOW    => _("Low")
  );
  
+ /**
+  * Array for mapping completed boolean to their string representations.
+  * @var array $completed_map
+  */
+ $completed_map = array(
+ 		      0 => _("Open"),
+ 		      1 => _("Closed")
+ );
+ 
  /* Set the umask. */
  if (isset($conf['umask'])) {
      umask($conf['umask']);
***************
*** 281,286 ****
--- 290,322 ----
      }
  
      /**
+      * Builds the task completed widget
+      *
+      * @param string  $name         The name of the widget.
+      * @param integer $selected     (optional) The default selected priority.
+      *
+      * @return string       The HTML <select> widget.
+      */
+     function buildCompletedWidget($name, $selected = 0)
+     {
+         global $completed_map;
+ 
+         $html = "<select name=\"$name\">";
+ 
+         foreach ($completed_map as $completed => $name) {
+             $html .= "<option value=\"$completed\"";
+             $html .= ($completed == $selected) ? ' selected="selected">' : '>';
+             $html .= $name . '</option>';
+         }
+         $html .= "</select>\n";
+ 
+         return $html;
+     }
+ 
+ 
+ 
+ 
+     /**
       * Formats the given Unix-style date string.
       *
       * @param string $unixdate     The Unix-style date value to format.
***************
*** 321,326 ****
--- 357,384 ----
              } else {
                  return $priority_map[$priority];
              }
+         }
+ 
+         return _("Unknown");
+     }
+ 
+     /**
+      * Returns the string representation of the given completion status.
+      *
+      * @param int $completed     The priority value.
+      *
+      * @return string       The string representation of $priority.
+      */
+     function formatCompleted($completed)
+     {
+         global $completed_map;
+ 
+         if (in_array($completed, array_keys($completed_map))) {
+ 	  if (1 == $completed) {
+ 	    return _("Closed");
+ 	  } else {
+ 	    return _("Open");
+ 	  }
          }
  
          return _("Unknown");
Index: lib/Storage.php
===================================================================
RCS file: /repository/nag/lib/Storage.php,v
retrieving revision 1.18
diff -c -r1.18 Storage.php
*** lib/Storage.php	7 Nov 2001 09:21:35 -0000	1.18
--- lib/Storage.php	6 Dec 2001 11:14:34 -0000
***************
*** 33,38 ****
--- 33,39 ----
  /** @constant TASK_DELETED Task has been deleted. */
  define('TASK_DELETED', 4);
  
+ 
  /**
   * Nag_Storage:: defines an API for implementing storage backends for Nag.
   *
***************
*** 161,167 ****
       *
       * @return integer  The numeric ID of the new task.
       */
!     function addTask($name, $desc, $due = 0, $priority = 0, $depends = -1)
      {
          /* Create a new task task. */
          $task = array();
--- 162,168 ----
       *
       * @return integer  The numeric ID of the new task.
       */
!     function addTask($name, $desc, $due = 0, $priority = 0, $depends = -1, $completed = 0)
      {
          /* Create a new task task. */
          $task = array();
***************
*** 171,176 ****
--- 172,178 ----
          $task['due'] = $due;
          $task['priority'] = $priority;
          $task['depends'] = $depends;
+ 	$task['completed'] = $completed;
          $task['flags'] = TASK_ADDED;
  
          /* Add it to the $tasks list. */
Index: lib/Storage/sql.php
===================================================================
RCS file: /repository/nag/lib/Storage/sql.php,v
retrieving revision 1.16
diff -c -r1.16 sql.php
*** lib/Storage/sql.php	15 Nov 2001 18:50:10 -0000	1.16
--- lib/Storage/sql.php	6 Dec 2001 11:14:34 -0000
***************
*** 29,34 ****
--- 29,35 ----
   *      task_due        int null,
   *      task_priority   int null default 0,
   *      task_depends    int null default -1,
+  *      task_completed  smallint default 0,
   *      primary key (task_owner, task_id)
   *  );</pre>
   *
***************
*** 156,161 ****
--- 157,163 ----
                  $task['due'] = $row['task_due'];
                  $task['priority'] = $row['task_priority'];
                  $task['depends'] = $row['task_depends'];
+ 		$task['completed'] = $row['task_completed'];
                  $task['flags'] = 0;
  
                  /* Add this new task to the $tasks list. */
***************
*** 201,208 ****
                  $query = sprintf(
                      'insert into %s (task_owner, task_id, task_name, ' .
                      'task_desc, task_added, task_due, task_priority, ' .
!                     'task_depends) ' .
!                     'values(%s, %d, %s, %s, %d, %d, %d, %d)',
                      $this->params['table'],
                      $this->db->quote($this->user),
                      $task_id,
--- 203,210 ----
                  $query = sprintf(
                      'insert into %s (task_owner, task_id, task_name, ' .
                      'task_desc, task_added, task_due, task_priority, ' .
!                     'task_depends, task_completed) ' .
!                     'values(%s, %d, %s, %s, %d, %d, %d, %d, %d)',
                      $this->params['table'],
                      $this->db->quote($this->user),
                      $task_id,
***************
*** 211,217 ****
                      $task['added'],
                      $task['due'],
                      $task['priority'],
!                     $task['depends']);
  
                  /* Attempt the insertion query. */
                  $result = $this->db->query($query);
--- 213,220 ----
                      $task['added'],
                      $task['due'],
                      $task['priority'],
!                     $task['depends'],
! 		    $task['completed']);
  
                  /* Attempt the insertion query. */
                  $result = $this->db->query($query);
***************
*** 237,243 ****
                  $query .= sprintf('task_added = %d, ', $task['added']);
                  $query .= sprintf('task_due = %d, ', $task['due']);
                  $query .= sprintf('task_priority = %d, ', $task['priority']);
!                 $query .= sprintf('task_depends = %d ', $task['depends']);
                  $query .= sprintf('where task_owner = %s and task_id = %d',
                                    $this->db->quote($this->user), $task_id);
  
--- 240,247 ----
                  $query .= sprintf('task_added = %d, ', $task['added']);
                  $query .= sprintf('task_due = %d, ', $task['due']);
                  $query .= sprintf('task_priority = %d, ', $task['priority']);
!                 $query .= sprintf('task_depends = %d, ', $task['depends']);
!                 $query .= sprintf('task_completed = %d ', $task['completed']);
                  $query .= sprintf('where task_owner = %s and task_id = %d',
                                    $this->db->quote($this->user), $task_id);
  
Index: templates/task/task.inc
===================================================================
RCS file: /repository/nag/templates/task/task.inc,v
retrieving revision 1.6
diff -c -r1.6 task.inc
*** templates/task/task.inc	14 Aug 2001 20:32:35 -0000	1.6
--- templates/task/task.inc	6 Dec 2001 11:14:42 -0000
***************
*** 31,36 ****
--- 31,42 ----
      </td>
  </tr>
  <tr>
+     <td class="item" align="right" valign="top"><b><?= _("Completion Status") ?>:</b>&nbsp;</td>
+     <td class="item" width="100%">
+         <?= Nag::buildCompletedWidget('task_completed', $task_completed) ?>
+     </td>
+ </tr>
+ <tr>
      <td class="item" align="right" valign="top" nowrap="nowrap"><b><?= _("Depends On") ?>:</b>&nbsp;</td>
      <td class="item" width="100%">
          <?= Nag::buildTaskListWidget('task_depends', $tasks, $task_depends, true) ?>
Index: templates/view/headers.inc
===================================================================
RCS file: /repository/nag/templates/view/headers.inc,v
retrieving revision 1.9
diff -c -r1.9 headers.inc
*** templates/view/headers.inc	4 Jul 2001 02:01:14 -0000	1.9
--- templates/view/headers.inc	6 Dec 2001 11:14:42 -0000
***************
*** 24,29 ****
--- 24,33 ----
      <td class="item1" width="100%"><?= Nag::formatPriority($tasks[$task_id]['priority']) ?></td>
  </tr>
  <tr>
+     <td class="item1" align="right" valign="top" nowrap="nowrap"><b><?= _("Completion Status") ?>:</b>&nbsp;</td>
+     <td class="item1" width="100%"><?= Nag::formatCompleted($tasks[$task_id]['completed']) ?></td>
+ </tr>
+ <tr>
      <td class="item0" align="right" valign="top" nowrap="nowrap"><b><?= _("Depends On") ?>:</b>&nbsp;</td>
  <?php if ($tasks[$task_id]['depends'] >= 0): ?>
      <td class="item0" width="100%">

---------------------- multipart/mixed attachment--


>From jan@horde.org Date: Thu,  6 Dec 2001 12:50:07 +0100
Return-Path: <jan@horde.org>
Mailing-List: contact nag-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list nag@lists.horde.org
Received: (qmail 49404 invoked from network); 6 Dec 2001 15:25:49 -0000
Received: from mailout02.sul.t-online.com (HELO mailout02.sul.t-online.de) (194.25.134.17)
  by clark.horde.org with SMTP; 6 Dec 2001 15:25:49 -0000
Received: from fwd00.sul.t-online.de 
	by mailout02.sul.t-online.de with smtp 
	id 16Bx9s-00074S-0H; Thu, 06 Dec 2001 12:57:44 +0100
Received: from linux.wg.de (320034214675-0001@[217.225.46.190]) by fmrl00.sul.t-online.com
	with esmtp id 16Bx9o-1jPFOCC; Thu, 6 Dec 2001 12:57:40 +0100
Received: from localhost (localhost [127.0.0.1])
	by linux.wg.de (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id fB6Bo7k02879
	for <nag@lists.horde.org>; Thu, 6 Dec 2001 12:50:07 +0100
Received: from 192.168.60.1 ( [192.168.60.1])
	as user jan@linux by linux.wg.de with HTTP;
	Thu,  6 Dec 2001 12:50:07 +0100
Message-ID: <1007639407.3c0f5b6f736c9@linux.wg.de>
Date: Thu,  6 Dec 2001 12:50:07 +0100
From: Jan Schneider <jan@horde.org>
To: nag@lists.horde.org
References: <20011206114000.A28372@ucecom.com>
In-Reply-To: <20011206114000.A28372@ucecom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 4.0-cvs
X-Sender: 320034214675-0001@t-dialin.net
Subject: Re: [nag] task complion

Zitat von Paul Cooper <pgc@ucecom.com>:

> I've been playing with nag, and I decided to add an extra field - 
> 
> task_completed  smallint default 0
> 
> which I use to indicate whether a task is completed or not (you were 
> guessing right :) See the attached diff(s) - which style is preferred 
> round here -u or -c?

diff -u is OK.
 
> As it stands it's not great - I haven't yet got round to adding the 
> compeletion status to the task list, so there's no way to see open / 
> closed tasks yet in the list (yet). Also now that I think about it could
> be more useful to be a percentage rather than a boolean, e.g. Open, 20%,
> 
> 40%, 60%, 80%, Closed.
> 
> Anyway I'll get round to that in a couple of days - just wanted to see 
> what people think of the initial idea,

I personally think it's a great idea. I never liked the fact that I had to 
delete tasks that were finished. And, yes, I think it makes more sense to 
have a percentage field here.

Jan.

::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::


>From chuck@horde.org Date: Thu,  6 Dec 2001 16:32:39 -0500
Return-Path: <chuck@horde.org>
Mailing-List: contact nag-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list nag@lists.horde.org
Received: (qmail 25412 invoked from network); 6 Dec 2001 21:33:18 -0000
Received: from h00104bc60b3c.ne.mediaone.net (HELO marina.horde.org) (24.91.196.127)
  by clark.horde.org with SMTP; 6 Dec 2001 21:33:18 -0000
Received: by marina.horde.org (Postfix, from userid 33)
	id CB2FF39B4; Thu,  6 Dec 2001 16:32:39 -0500 (EST)
Received: from 192.168.0.102 ( [192.168.0.102])
	as user chuck@localhost by marina.horde.org with HTTP;
	Thu,  6 Dec 2001 16:32:39 -0500
Message-ID: <1007674359.3c0fe3f7a1857@marina.horde.org>
Date: Thu,  6 Dec 2001 16:32:39 -0500
From: Chuck Hagenbuch <chuck@horde.org>
To: nag@lists.horde.org
References: <20011206114000.A28372@ucecom.com>
In-Reply-To: <20011206114000.A28372@ucecom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 4.0-cvs
Subject: Re: [nag] task complion

Quoting Paul Cooper <pgc@ucecom.com>:

> I've been playing with nag, and I decided to add an extra field - 
> 
> task_completed  smallint default 0

This is actually already in my copy of Nag on my laptop (the field, not the 
implementation, actually), along with some other changes that I haven't 
committed yet (still! ack!).

> As it stands it's not great - I haven't yet got round to adding the 
> compeletion status to the task list, so there's no way to see open / 
> closed tasks yet in the list (yet). Also now that I think about it could 
> be more useful to be a percentage rather than a boolean, e.g. Open, 20%, 
> 40%, 60%, 80%, Closed.

The work I'm doing is mainly to make Nag match Palm todo list items more 
closely, so that I can work on syncing with a fairly simple first example (todo 
items, as opposed to contacts or events). So I'd prefer sticking with completed 
or not completed, to keep this simple. Percentage strikes me as something 
belonging in a project planning/tracking app, which is a rather different beast.

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
"What was and what may be, lie, like children whose faces we cannot see, in the
arms of silence. All we ever have is here, now." - Ursula K. Le Guin