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.95 class.uic


From: skwashd
Subject: [Phpgroupware-cvs] calendar/inc class.bocalendar.inc.php, 1.95 class.uicalendar.inc.php, 1.112
Date: Fri, 28 Oct 2005 04:41:00 +0200

Update of calendar/inc

Modified Files:
     Branch: MAIN
            class.bocalendar.inc.php lines: +44 -9
            class.uicalendar.inc.php lines: +19 -3

Log Message:
readded groups support, fixed onwer name in overlap/conflict ui

====================================================
Index: calendar/inc/class.bocalendar.inc.php
diff -u calendar/inc/class.bocalendar.inc.php:1.94 
calendar/inc/class.bocalendar.inc.php:1.95
--- calendar/inc/class.bocalendar.inc.php:1.94  Sun Oct 23 12:57:16 2005
+++ calendar/inc/class.bocalendar.inc.php       Fri Oct 28 02:41:34 2005
@@ -804,14 +804,18 @@
                                        {
                                                if ( substr($participant, 0, 2) 
== 'g_' )
                                                {
-                                                       //do group handling 
here when groups are added back in
-                                                       /*
-                                                               get all members 
from group
-                                                               loop it
-                                                                       get 
contact id
-                                                                       add to 
db
-                                                               done
-                                                       */
+                                                       $members = 
$GLOBALS['phpgw']->accounts->member(substr($participant, 2) );
+                                                       if ( is_array($members) 
&& count($members) )
+                                                       {
+                                                               foreach ( 
$members as $member )
+                                                               {
+                                                                       
$participant = intval($this->contacts->is_contact($member['account_id']) );
+                                                                       if ( 
$participant )
+                                                                       {
+                                                                               
$this->so->add_attribute('participants', $accept_type, $participant);
+                                                                       }
+                                                               }
+                                                       }
                                                }
                                                else
                                                {
@@ -2983,6 +2987,37 @@

                        $criteria_token = sql_criteria::_append_and($criteria);
                        return $this->contacts->get_persons($fields, 0, 0, 
'per_first_name, per_last_name', 'ASC', '', $criteria_token);
+               }
+
+               /**
+               * Get a list of phpgw groups
+               */
+               function get_groups($search)
+               {
+                       if ( $search == '%' )
+                       {
+                               $groups = 
$GLOBALS['phpgw']->accounts->get_list('groups', -1, 'ASC', 'account_firstname');
+                       }
+                       else
+                       {
+                               $groups = 
$GLOBALS['phpgw']->accounts->get_list('groups', -1, 'account_firstname', 'ASC', 
$search);
+                       }
+
+                       $group_list = array();
+
+                       if ( is_array($groups) && count($groups) )
+                       {
+                               foreach ( $groups as $group )
+                               {
+                                       $group_list[] = array
+                                                       (
+                                                               'contact_id'    
=> "g_{$group['account_id']}",
+                                                               
'per_first_name'=> $group['account_firstname'],
+                                                               'per_last_name' 
=> $group['account_lastname']
+                                                       );
+                               }
+                       }
+                       return $group_list;
                }
        }
 ?>

====================================================
Index: calendar/inc/class.uicalendar.inc.php
diff -u calendar/inc/class.uicalendar.inc.php:1.111 
calendar/inc/class.uicalendar.inc.php:1.112
--- calendar/inc/class.uicalendar.inc.php:1.111 Fri Oct 28 01:43:59 2005
+++ calendar/inc/class.uicalendar.inc.php       Fri Oct 28 02:41:35 2005
@@ -2746,7 +2746,7 @@
                        for($i=0;$i<count($overlapping_events);$i++)
                        {
                                $overlapped_event = 
$this->bo->read_entry($overlapping_events[$i]);
-                               $overlap .= '<li> 
['.$GLOBALS['phpgw']->common->grab_owner_name($overlapped_event['owner']).'] 
'.$this->link_to_entry($overlapped_event,$month,$mday,$year);
+                               $overlap .= '<li> 
['.$this->bo->contacts->get_name_of_person_id($overlapped_event['owner']).'] 
'.$this->link_to_entry($overlapped_event,$month,$mday,$year);
                        }

                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
@@ -3554,7 +3554,15 @@

                                $cat_id = isset($_GET['cat_id']) ? 
intval($_GET['cat_id']) : 0;

-                               $contacts = 
$this->bo->get_contacts($_GET['lookup'], $cat_id);
+                               if ( $cat_id == -1 ) //groups
+                               {
+                                       $contacts = 
$this->bo->get_groups($_GET['lookup']);
+                               }
+                               else
+                               {
+                                       $contacts = 
$this->bo->get_contacts($_GET['lookup'], $cat_id);
+                               }
+

                                foreach ( $contacts as $contact )
                                {
@@ -3579,6 +3587,14 @@
                                        ));
                                $t->parse('cat_options', 'cat_option', true);
                        }
+
+                       $t->set_var(
+                               array
+                               (
+                                       'cat_id'        => -1,
+                                       'cat_name'      => lang('phpgroupware 
groups')
+                               ));
+                       $t->parse('cat_options', 'cat_option', true);

                        $t->set_var(
                                array






reply via email to

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