phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] todo/inc class.so.inc.php [Version-0_9_16-branch]


From: Dave Hall
Subject: [Phpgroupware-cvs] todo/inc class.so.inc.php [Version-0_9_16-branch]
Date: Wed, 14 Dec 2005 12:37:46 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    todo
Branch:         Version-0_9_16-branch
Changes by:     Dave Hall <address@hidden>      05/12/14 12:37:46

Modified files:
        inc            : class.so.inc.php 

Log message:
        applying patch #1641 - fixes bug #12583

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/todo/inc/class.so.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.1.2.8.2.4&tr2=1.1.2.8.2.5&r1=text&r2=text

Patches:
Index: todo/inc/class.so.inc.php
diff -u todo/inc/class.so.inc.php:1.1.2.8.2.4 
todo/inc/class.so.inc.php:1.1.2.8.2.5
--- todo/inc/class.so.inc.php:1.1.2.8.2.4       Tue May 24 00:18:57 2005
+++ todo/inc/class.so.inc.php   Wed Dec 14 12:37:46 2005
@@ -14,7 +14,7 @@
        * Free Software Foundation; either version 2 of the License, or (at 
your  *
        * option) any later version.                                            
  *
        
\*************************************************************************/
-       /* $Id: class.so.inc.php,v 1.1.2.8.2.4 2005/05/24 00:18:57 ceb Exp $ */
+       /* $Id: class.so.inc.php,v 1.1.2.8.2.5 2005/12/14 12:37:46 skwashd Exp 
$ */
 
        class so
        {
@@ -159,7 +159,14 @@
                                        'entry_date'    => 
(int)$this->db->f('entry_date')
                                );
                        }
-                       return $todos;
+
+                       if (is_array($todos))
+                       {
+                               return $this->keephierarchy($todos);
+                       }
+                       else {
+                               return $todos;
+                       }
                }
 
                function read_single_todo($todo_id)
@@ -450,5 +457,41 @@
                                return False;
                        }
                }
+               
+               function keephierarchy($todolist)
+               {
+                       for ($i = 0; $i < count($todolist); $i++)
+                       {
+                               //echo 
$i.':'.$this->get_hierarchy_index($todolist, 
$todolist[$i]['parent']).'.'.$todolist[$i]['id'].'<br>';
+                               
$todolist_hierarchy[$this->get_hierarchy_index($todolist, 
$todolist[$i]['parent']).'.'.$todolist[$i]['id']] = $todolist[$i];
+                       }
+                       //echo '<br><br>';
+                       ksort($todolist_hierarchy, SORT_STRING);
+                       
+                       //foreach($todolist_hierarchy as $val)
+                       //{
+               //      echo $val['title'].'<br>';
+                       //}
+                       return $todolist_hierarchy;
+               }
+               
+               function get_hierarchy_index($todo, $index)
+               {
+                       for ($i = 0; $i < count($todo); $i++)
+                       {
+                               if ($todo[$i]['id'] == $index)
+                               {
+                                       if ($todo[$i]['parent'] != 0)
+                                       {
+                                               $return = 
$this->get_hierarchy_index($todo,$todo[$i]['parent']).'.'.$todo[$i]['id'];
+                                       } else
+                                       {
+                                               $return = '.'.$todo[$i]['id'];
+                                               break;
+                                       }
+                               }
+                       }
+                       return $return;
+               }
        }
 ?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]