phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.74.2.14,


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.74.2.14,1.74.2.15
Date: Mon, 14 Oct 2002 20:14:23 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv4390

Modified Files:
      Tag: Version-0_9_14-branch
        class.categories.inc.php 
Log Message:
fix for bug 1308

Index: class.categories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.categories.inc.php,v
retrieving revision 1.74.2.14
retrieving revision 1.74.2.15
diff -C2 -r1.74.2.14 -r1.74.2.15
*** class.categories.inc.php    12 Oct 2002 00:49:19 -0000      1.74.2.14
--- class.categories.inc.php    15 Oct 2002 00:14:20 -0000      1.74.2.15
***************
*** 54,61 ****
                        }
  
!                       $this->account_id = $account_id;
!                       $this->app_name   = $app_name;
!                       $this->db         = $GLOBALS['phpgw']->db;
!                       $this->grants     = 
$GLOBALS['phpgw']->acl->get_grants($app_name);
                }
  
--- 54,62 ----
                        }
  
!                       $this->account_id       = $account_id;
!                       $this->app_name         = $app_name;
!                       $this->db                       = $GLOBALS['phpgw']->db;
!                       $this->db2                      = $this->db;
!                       $this->grants           = 
$GLOBALS['phpgw']->acl->get_grants($app_name);
                }
  
***************
*** 70,80 ****
                        switch ($type)
                        {
!                               case 'subs':        $s = " AND cat_parent != 
'0'"; break;
!                               case 'mains':       $s = " AND cat_parent = 
'0'"; break;
!                               case 'appandmains': $s = " AND cat_appname='" . 
$this->app_name . "' AND cat_parent ='0'"; break;
!                               case 'appandsubs':  $s = " AND cat_appname='" . 
$this->app_name . "' AND cat_parent !='0'"; break;
                                case 'noglobal':        $s = " AND cat_appname 
!= '" . $this->app_name . "'"; break;
                                case 'noglobalapp':     $s = " AND cat_appname 
= '" . $this->app_name . "' AND cat_owner != '" . $this->account_id . "'"; 
break;
!                               default:            return False;
                        }
                        return $s;
--- 71,81 ----
                        switch ($type)
                        {
!                               case 'subs':            $s = " AND cat_parent 
!= '0'"; break;
!                               case 'mains':           $s = " AND cat_parent = 
'0'"; break;
!                               case 'appandmains':     $s = " AND 
cat_appname='" . $this->app_name . "' AND cat_parent ='0'"; break;
!                               case 'appandsubs':      $s = " AND 
cat_appname='" . $this->app_name . "' AND cat_parent !='0'"; break;
                                case 'noglobal':        $s = " AND cat_appname 
!= '" . $this->app_name . "'"; break;
                                case 'noglobalapp':     $s = " AND cat_appname 
= '" . $this->app_name . "' AND cat_owner != '" . $this->account_id . "'"; 
break;
!                               default:                        return False;
                        }
                        return $s;
***************
*** 91,100 ****
                        switch($for)
                        {
!                               case 'app':         $w = " WHERE cat_appname='" 
. $this->app_name . "'"; break;
!                               case 'appandmains': $w = " WHERE cat_appname='" 
. $this->app_name . "' AND cat_parent ='0'"; break;
!                               case 'appandsubs':  $w = " WHERE cat_appname='" 
. $this->app_name . "' AND cat_parent !='0'"; break;
!                               case 'subs':        $w = " WHERE cat_parent != 
'0'"; break;
!                               case 'mains':       $w = " WHERE cat_parent = 
'0'"; break;
!                               default:            return False;
                        }
  
--- 92,101 ----
                        switch($for)
                        {
!                               case 'app':                     $w = " WHERE 
cat_appname='" . $this->app_name . "'"; break;
!                               case 'appandmains':     $w = " WHERE 
cat_appname='" . $this->app_name . "' AND cat_parent ='0'"; break;
!                               case 'appandsubs':      $w = " WHERE 
cat_appname='" . $this->app_name . "' AND cat_parent !='0'"; break;
!                               case 'subs':            $w = " WHERE cat_parent 
!= '0'"; break;
!                               case 'mains':           $w = " WHERE cat_parent 
= '0'"; break;
!                               default:                        return False;
                        }
  
***************
*** 175,178 ****
--- 176,182 ----
                                . $parent_filter . $querymethod . $filter;
  
+                       $this->db2->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db2->num_rows();
+ 
                        if ($limit)
                        {
***************
*** 184,189 ****
                        }
  
-                       $this->total_records = $this->db->num_rows();
- 
                        $i = 0;
                        while ($this->db->next_record())
--- 188,191 ----
***************
*** 264,267 ****
--- 266,272 ----
                                        . $querymethod;
  
+                       $this->db2->query($sql . 
$parent_select,__LINE__,__FILE__);
+                       $total_mains = $this->db2->num_rows();
+ 
                        if ($limit)
                        {
***************
*** 294,297 ****
--- 299,305 ----
                                $sub_select = " AND cat_parent='" . 
$cats[$i]['id'] . "' AND cat_level='" . ($cats[$i]['level']+1) . "'";
  
+                               $this->db2->query($sql . 
$sub_select,__LINE__,__FILE__);
+                               $total_subs += $this->db2->num_rows();
+ 
                                if ($limit)
                                {
***************
*** 340,344 ****
                                }
                        }
!                       $this->total_records = count($cats);
                        return $cats;
                }
--- 348,352 ----
                                }
                        }
!                       $this->total_records = $total_mains + $total_subs;
                        return $cats;
                }





reply via email to

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