phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] calendar/inc class.uicalendar.inc.php,1.111


From: skwashd
Subject: [Phpgroupware-cvs] calendar/inc class.uicalendar.inc.php,1.111
Date: Fri, 28 Oct 2005 03:43:00 +0200

Update of calendar/inc

Modified Files:
     Branch: MAIN
            class.uicalendar.inc.php lines: +54 -46

Log Message:
add * search and cleaned up popup if statement

====================================================
Index: calendar/inc/class.uicalendar.inc.php
diff -u calendar/inc/class.uicalendar.inc.php:1.110 
calendar/inc/class.uicalendar.inc.php:1.111
--- calendar/inc/class.uicalendar.inc.php:1.110 Sun Oct 23 12:57:16 2005
+++ calendar/inc/class.uicalendar.inc.php       Fri Oct 28 01:43:59 2005
@@ -2057,7 +2057,8 @@
                        {
                                
if(($GLOBALS['phpgw']->accounts->exists($user[0]) && 
$this->bo->check_perms(PHPGW_ACL_READ,0,$user[0])) || 
$GLOBALS['phpgw']->accounts->get_type($user[0]) == 'g')
                                {
-                                       $str .= '    <option 
value="'.$user[0].'">('.$GLOBALS['phpgw']->accounts->get_type($user[0]).') 
'.$user[1].'</option>'."\n";
+                                       $prefix = 
$GLOBALS['phpgw']->accounts->get_type($user[0]) == 'g' ? 'g_' : '';
+                                       $str .= '    <option 
value="'.$prefix.$user[0].'">('.$GLOBALS['phpgw']->accounts->get_type($user[0]).')
 '.$user[1].'</option>'."\n";
                                }
                        }
                        $var[] = Array(
@@ -2097,24 +2098,25 @@
                        {
                                foreach($participants as $participant)
                                {
-                                       switch 
($GLOBALS['phpgw']->accounts->get_type($participant))
+                                       switch (substr($participant, 0, 2))
                                        {
-                                               case 'g':
-                                                       if ($members = 
$acct->member(intval($participant)))
+                                               case 'g_':
+                                                       if ($members = 
$acct->member(intval(substr($participant, 2))))
                                                        {
                                                                
foreach($members as $member)
                                                                {
-                                                                       
if($this->bo->check_perms(PHPGW_ACL_READ,0,$member['account_id']))
+                                                                       
if($this->bo->check_perms(PHPGW_ACL_READ, 0, 
$this->bo->contacts->is_contact($member['account_id'])))
                                                                        {
-                                                                               
$parts[$member['account_id']] = True;
+                                                                               
$parts[$this->bo->contacts->is_contact($member['account_id'])] = True;
                                                                        }
                                                                }
                                                        }
+
                                                        break;
-                                               case 'u':
-                                                       
if($this->bo->check_perms(PHPGW_ACL_READ,0,$participant))
+                                               default:
+                                                       
if($this->bo->check_perms(PHPGW_ACL_READ, 0, 
$this->bo->contacts->is_contact($participant)))
                                                        {
-                                                               
$parts[$participant] = 1;
+                                                               
$parts[$this->bo->contacts->is_contact($participant)] = 1;
                                                        }
                                                        break;
                                        }
@@ -2916,7 +2918,7 @@
                        $p->set_var('col_width','14');
                        if($display_name)
                        {
-                               
$p->set_var('column_data',$GLOBALS['phpgw']->common->grab_owner_name($owner));
+                               $p->set_var('column_data', 
$this->bo->contacts->get_name_of_person_id($owner));
                                $p->parse('column_header','month_column',True);
                                $p->set_var('col_width','12');
                        }
@@ -3390,7 +3392,7 @@
                        $participants = $param['participants'];
                        foreach($participants as $part => $nul)
                        {
-                               $participants[$part] = 
$GLOBALS['phpgw']->common->grab_owner_name($part);
+                               $participants[$part] = 
$this->bo->contacts->get_name_of_person_id($part);
                        }
                        uasort($participants,'strnatcasecmp');  // sort them 
after their fullname

@@ -3543,53 +3545,59 @@
                        $t =& $GLOBALS['phpgw']->template;
                        $t->set_unknowns('remove');

-                       if ( isset($_GET['lookup']) )
+                       if ( isset($_GET['lookup']) && ( 
strlen($_GET['lookup']) > 2 || $_GET['lookup'] == '*' ) )
                        {
-                               $contacts = 
$this->bo->get_contacts($_GET['lookup'], @intval($_GET['cat_id']));
+                               if ( $_GET['lookup'] == '*' )
+                               {
+                                       $_GET['lookup'] = '%';
+                               }
+
+                               $cat_id = isset($_GET['cat_id']) ? 
intval($_GET['cat_id']) : 0;
+
+                               $contacts = 
$this->bo->get_contacts($_GET['lookup'], $cat_id);

                                foreach ( $contacts as $contact )
                                {
                                        echo "<option 
value=\"{$contact['contact_id']}\">{$contact['per_first_name']} 
{$contact['per_last_name']}</option>\n";
                                }
+                               $GLOBALS['phpgw']->common->phpgw_exit();
                        }
-                       else
-                       {
-                               $t->set_file( array('popup' => 
'contacts_popup.tpl') );
-                               $t->set_block('popup', 'cat_option', 
'cat_options');
+
+                       $t->set_file( array('popup' => 'contacts_popup.tpl') );
+                       $t->set_block('popup', 'cat_option', 'cat_options');

-                               $cats = createObject('phpgwapi.categories');
-                               $cats->app_name = 'addressbook';
-                               $cat_list = $cats->return_array('all', 0, 
false);
-                               foreach ( $cat_list as $cat )
-                               {
-                                       $t->set_var(
-                                               array
-                                               (
-                                                       'cat_id'        => 
$cat['id'],
-                                                       'cat_name'      => 
stripslashes($cat['name'])
-                                               ));
-                                       $t->parse('cat_options', 'cat_option', 
true);
-                               }
-
+                       $cats = createObject('phpgwapi.categories');
+                       $cats->app_name = 'addressbook';
+                       $cat_list = $cats->return_array('all', 0, false);
+                       foreach ( $cat_list as $cat )
+                       {
                                $t->set_var(
                                        array
                                        (
-                                               'base_url'              => 
$GLOBALS['phpgw']->link('/'),
-                                               'lang_all'              => 
lang('all'),
-                                               'lang_title'            => 
lang('calendar event participants selector'),
-                                               'lang_show_contacts'    => 
lang('show contacts'),
-                                               'lang_category'         => 
lang('category'),
-                                               'lang_search'           => 
lang('search'),
-                                               'lang_contacts'         => 
lang('contacts'),
-                                               'lang_add'              => 
lang('add'),
-                                               'lang_remove'           => 
lang('remove'),
-                                               'lang_close'            => 
lang('close'),
-                                               'img_add'               => 
$GLOBALS['phpgw']->common->image('calendar', 'right-24x24'),
-                                               'img_remove'            => 
$GLOBALS['phpgw']->common->image('calendar', 'left-24x24'),
-                                               'img_close'             => 
$GLOBALS['phpgw']->common->image('calendar', 'close-24x24')
+                                               'cat_id'        => $cat['id'],
+                                               'cat_name'      => 
stripslashes($cat['name'])
                                        ));
-                               $t->pparse('out', 'popup');
+                               $t->parse('cat_options', 'cat_option', true);
                        }
+
+                       $t->set_var(
+                               array
+                               (
+                                       'base_url'              => 
$GLOBALS['phpgw']->link('/'),
+                                       'lang_all'              => lang('all'),
+                                       'lang_title'            => 
lang('calendar event participants selector'),
+                                       'lang_show_contacts'    => lang('show 
contacts'),
+                                       'lang_category'         => 
lang('category'),
+                                       'lang_search'           => 
lang('search'),
+                                       'lang_contacts'         => 
lang('contacts'),
+                                       'lang_add'              => lang('add'),
+                                       'lang_remove'           => 
lang('remove'),
+                                       'lang_close'            => 
lang('close'),
+                                       'img_add'               => 
$GLOBALS['phpgw']->common->image('calendar', 'right-24x24'),
+                                       'img_remove'            => 
$GLOBALS['phpgw']->common->image('calendar', 'left-24x24'),
+                                       'img_close'             => 
$GLOBALS['phpgw']->common->image('calendar', 'close-24x24')
+                               ));
+                       $t->pparse('out', 'popup');
                        $GLOBALS['phpgw']->common->phpgw_exit();
                }







reply via email to

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