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.99,1.100


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

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

Modified Files:
        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.99
retrieving revision 1.100
diff -C2 -r1.99 -r1.100
*** class.categories.inc.php    13 Oct 2002 22:04:30 -0000      1.99
--- class.categories.inc.php    15 Oct 2002 00:12:39 -0000      1.100
***************
*** 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);
                }
  
***************
*** 76,80 ****
                                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;
--- 77,81 ----
                                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;
                        }
  
***************
*** 196,199 ****
--- 197,203 ----
                                . $parent_filter . $querymethod . $filter;
                        
+                       $this->db2->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db2->num_rows();
+ 
                        if ($limit)
                        {
***************
*** 205,210 ****
                        }
  
-                       $this->total_records = $this->db->num_rows();
- 
                        return $this->db2cats();
                }
--- 209,212 ----
***************
*** 270,273 ****
--- 272,278 ----
                                        . $querymethod;
  
+                       $this->db2->query($sql . 
$parent_select,__LINE__,__FILE__);
+                       $total_mains = $this->db2->num_rows();
+ 
                        if ($limit)
                        {
***************
*** 286,289 ****
--- 291,297 ----
                                $sub_select = " AND cat_parent='" . 
$cats[$i]['cat_id'] . "' AND cat_level='" . ($cats[$i]['level']+1) . "'";
  
+                               $this->db2->query($sql . 
$sub_select,__LINE__,__FILE__);
+                               $total_subs += $this->db2->num_rows();
+ 
                                if ($limit)
                                {
***************
*** 317,321 ****
                                }
                        }
!                       $this->total_records = count($cats);
                        return $cats;
                }
--- 325,330 ----
                                }
                        }
!                       //$this->total_records = count($cats);
!                       $this->total_records = $total_mains + $total_subs;
                        return $cats;
                }





reply via email to

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