phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] calendar/inc/class.bocalendar.inc.php, 1.71.2.33.2.27


From: nomail
Subject: [Phpgroupware-cvs] calendar/inc/class.bocalendar.inc.php, 1.71.2.33.2.27
Date: Sat, 4 Sep 2004 07:25:29 +0200

Update of /calendar/inc
Modified Files:
        Branch: Version-0_9_16-branch
          class.bocalendar.inc.php

date: 2004/09/04 05:25:29;  author: skwashd;  state: Exp;  lines: +31 -21

Log Message:
php5 fix - reported and tested on irc
=====================================================================
Index: calendar/inc/class.bocalendar.inc.php
diff -u calendar/inc/class.bocalendar.inc.php:1.71.2.33.2.26 
calendar/inc/class.bocalendar.inc.php:1.71.2.33.2.27
--- calendar/inc/class.bocalendar.inc.php:1.71.2.33.2.26        Wed Jun 30 
03:47:23 2004
+++ calendar/inc/class.bocalendar.inc.php       Sat Sep  4 05:25:29 2004
@@ -2663,39 +2663,22 @@
                */
                function list_cals()
                {
-                       function add($id,&$users,&$groups)
-                       {
-                               $name = 
$GLOBALS['phpgw']->common->grab_owner_name($id);
-                               if (($type = 
$GLOBALS['phpgw']->accounts->get_type($id)) == 'g')
-                               {
-                                       $arr = &$groups;
-                               }
-                               else
-                               {
-                                       $arr = &$users;
-                               }
-                               $arr[$name] = Array(
-                                       'grantor'       => $id,
-                                       'value'         => ($type == 'g' ? 'g_' 
: '') . $id,
-                                       'name'          => $name
-                               );
-                       }
                        $users = $groups = array();
                        foreach($this->grants as $id => $rights)
                        {
-                               add($id,$users,$groups);
+                               $this->list_cals_add($id,$users,$groups);
                        }
                        if ($memberships = 
$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']))
                        {
                                foreach($memberships as $group_info)
                                {
-                                       
add($group_info['account_id'],$users,$groups);
+                                       
$this->list_cals_add($group_info['account_id'],$users,$groups);
 
                                        if ($account_perms = 
$GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar'))
                                        {
                                                foreach($account_perms as $id)
                                                {
-                                                       add($id,$users,$groups);
+                                                       
$this->list_cals_add($id,$users,$groups);
                                                }
                                        }
                                }
@@ -2705,6 +2688,33 @@
 
                        return $users + $groups;        // users first and then 
groups, both alphabeticaly
                }
+
+               /**
+               * Add user or group to the list of available groups/users in 
calendar
+               *
+               * @internal moved to seperate method to fix php5 problems - 
skwashd
+               * @access private
+               * @param int $id user uid
+               * @param array ref to array of users
+               * @param array ref to array of groups
+               */
+               function list_cals_add($id,&$users,&$groups)
+               {
+                       $name = $GLOBALS['phpgw']->common->grab_owner_name($id);
+                       if (($type = 
$GLOBALS['phpgw']->accounts->get_type($id)) == 'g')
+                       {
+                               $arr = &$groups;
+                       }
+                       else
+                       {
+                               $arr = &$users;
+                       }
+                       $arr[$name] = Array(
+                               'grantor'       => $id,
+                               'value'         => ($type == 'g' ? 'g_' : '') . 
$id,
+                               'name'          => $name
+                       );
+               }
                
                /*!
                @function event2array




reply via email to

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