phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.71.2.33.


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.71.2.33.2.4,1.71.2.33.2.5 class.uicalendar.inc.php,1.66.2.55.2.8,1.66.2.55.2.9 hook_settings.inc.php,1.1.2.4,1.1.2.5
Date: Sun, 04 May 2003 13:05:09 -0400

Update of /cvsroot/phpgroupware/calendar/inc
In directory subversions:/tmp/cvs-serv19952/inc

Modified Files:
      Tag: Version-0_9_16-branch
        class.bocalendar.inc.php class.uicalendar.inc.php 
        hook_settings.inc.php 
Log Message:
timematrix:
- no longer shows rejected invitations 
- lot of cosmetical improvments
general cal:
- header.inc.php only in default anymore
- all user-selectboxes use and sort after the new account-display pref


Index: class.bocalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.bocalendar.inc.php,v
retrieving revision 1.71.2.33.2.4
retrieving revision 1.71.2.33.2.5
diff -C2 -r1.71.2.33.2.4 -r1.71.2.33.2.5
*** class.bocalendar.inc.php    4 May 2003 01:16:23 -0000       1.71.2.33.2.4
--- class.bocalendar.inc.php    4 May 2003 17:05:07 -0000       1.71.2.33.2.5
***************
*** 1246,1265 ****
  
  
-               function get_fullname($accountid)
-               {
-                       $account_id = get_account_id($accountid);
-                       if($GLOBALS['phpgw']->accounts->exists($account_id) == 
False)
-                       {
-                               return False;
-                       }
-                       
$GLOBALS['phpgw']->accounts->get_account_name($account_id,$lid,$fname,$lname);
-                       $fullname = $lid;
-                       if($lname && $fname)
-                       {
-                               $fullname = $lname.', '.$fname;
-                       }
-                       return $fullname;
-               }
- 
                function display_status($user_status)
                {
--- 1246,1249 ----
***************
*** 1977,1981 ****
                /* End of SO functions */
  
!               function 
prepare_matrix($interval,$increment,$part,$status,$fulldate)
                {
                        for($h=0;$h<24;$h++)
--- 1961,1965 ----
                /* End of SO functions */
  
!               function prepare_matrix($interval,$increment,$part,$fulldate)
                {
                        for($h=0;$h<24;$h++)
***************
*** 1988,1994 ****
                                }
                        }
!                       for($k=0;$k<count($this->cached_events[$fulldate]);$k++)
                        {
!                               $event = $this->cached_events[$fulldate][$k];
                                $eventstart = 
$GLOBALS['phpgw']->datetime->localdates($this->maketime($event['start']) - 
$GLOBALS['phpgw']->datetime->tz_offset);
                                $eventend = 
$GLOBALS['phpgw']->datetime->localdates($this->maketime($event['end']) - 
$GLOBALS['phpgw']->datetime->tz_offset);
--- 1972,1981 ----
                                }
                        }
!                       foreach($this->cached_events[$fulldate] as $event)
                        {
!                               if ($event['participants'][$part] == 'R')
!                               {
!                                       continue;       // dont show rejected 
invitations, as they are free time
!                               }
                                $eventstart = 
$GLOBALS['phpgw']->datetime->localdates($this->maketime($event['start']) - 
$GLOBALS['phpgw']->datetime->tz_offset);
                                $eventend = 
$GLOBALS['phpgw']->datetime->localdates($this->maketime($event['end']) - 
$GLOBALS['phpgw']->datetime->tz_offset);
***************
*** 2019,2050 ****
                                $starttemp = $this->splittime("$start",False);
                                $endtemp = $this->splittime("$end",False);
! // Do not display All-Day events in this free/busy time
!                               if((($starttemp['hour'] == 0) && 
($starttemp['minute'] == 0)) && (($endtemp['hour'] == 23) && 
($endtemp['minute'] == 59)))
!                               {
!                               }
!                               else
                                {
!                                       
for($h=$starttemp['hour'];$h<=$endtemp['hour'];$h++)
                                        {
!                                               $startminute = 0;
!                                               $endminute = $interval;
!                                               $hour = $h * 10000;
!                                               if($h == 
intval($starttemp['hour']))
!                                               {
!                                                       $startminute = 
($starttemp['minute'] / $increment);
!                                               }
!                                               if($h == 
intval($endtemp['hour']))
!                                               {
!                                                       $endminute = 
($endtemp['minute'] / $increment);
!                                               }
!                                               $private = 
$this->is_private($event,$part);
!                                               $time_display = 
$GLOBALS['phpgw']->common->show_date($eventstart['raw'],$this->users_timeformat).'-'.$GLOBALS['phpgw']->common->show_date($eventend['raw'],$this->users_timeformat);
!                                               $time_description = 
'('.$time_display.') 
'.$this->get_short_field($event,$private,'title').$this->display_status($event['participants'][$part]);
!                                               
for($m=$startminute;$m<=$endminute;$m++)
!                                               {
!                                                       $index = ($hour + (($m 
* $increment) * 100));
!                                                       
$time_slice[$index]['marker'] = '-';
!                                                       
$time_slice[$index]['description'] = $time_description;
!                                               }
                                        }
                                }
--- 2006,2032 ----
                                $starttemp = $this->splittime("$start",False);
                                $endtemp = $this->splittime("$end",False);
!                                       
!                               
for($h=$starttemp['hour'];$h<=$endtemp['hour'];$h++)
                                {
!                                       $startminute = 0;
!                                       $endminute = $interval;
!                                       $hour = $h * 10000;
!                                       if($h == intval($starttemp['hour']))
                                        {
!                                               $startminute = 
($starttemp['minute'] / $increment);
!                                       }
!                                       if($h == intval($endtemp['hour']))
!                                       {
!                                               $endminute = 
($endtemp['minute'] / $increment);
!                                       }
!                                       $private = 
$this->is_private($event,$part);
!                                       $time_display = 
$GLOBALS['phpgw']->common->show_date($eventstart['raw'],$this->users_timeformat).'-'.$GLOBALS['phpgw']->common->show_date($eventend['raw'],$this->users_timeformat);
!                                       $time_description = 
'('.$time_display.') 
'.$this->get_short_field($event,$private,'title').$this->display_status($event['participants'][$part]);
!                                       for($m=$startminute;$m<$endminute;$m++)
!                                       {
!                                               $index = ($hour + (($m * 
$increment) * 100));
!                                               $time_slice[$index]['marker'] = 
'-';
!                                               
$time_slice[$index]['description'] = $time_description;
!                                               $time_slice[$index]['id'] = 
$event['id'];
                                        }
                                }
***************
*** 2445,2448 ****
--- 2427,2480 ----
                        //echo "<p>rejected_no_show($event[title])='$ret': 
user=$this->owner, event-owner=$event[owner], 
status='".$event['participants'][$this->owner]."', 
show_rejected='".$this->prefs['calendar']['show_rejected']."'</p>\n";
                        return $ret;
+               }
+               
+               /*!
+               @function list_cals
+               @abstract generate list of user- / group-calendars for the 
selectbox in the header
+               @returns alphabeticaly sorted array with groups first and then 
users
+               */
+               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);
+                       }
+                       if ($memberships = 
$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']))
+                       {
+                               foreach($memberships as $group_info)
+                               {
+                                       
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);
+                                               }
+                                       }
+                               }
+                       }
+                       uksort($users,'strnatcasecmp');
+                       uksort($groups,'strnatcasecmp');
+ 
+                       return $users + $groups;        // users first and then 
groups, both alphabeticaly
                }
        }

Index: class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.66.2.55.2.8
retrieving revision 1.66.2.55.2.9
diff -C2 -r1.66.2.55.2.8 -r1.66.2.55.2.9
*** class.uicalendar.inc.php    4 May 2003 01:16:23 -0000       1.66.2.55.2.8
--- class.uicalendar.inc.php    4 May 2003 17:05:07 -0000       1.66.2.55.2.9
***************
*** 130,133 ****
--- 130,135 ----
                                $this->bo->save_sessiondata();
                        }
+                       $this->always_app_header = 
$this->bo->prefs['common']['template_set'] == 'idots';
+ 
                        print_debug('UI',$this->_debug_sqsof());
                }
***************
*** 305,310 ****
                function index($params='')
                {
!                       Header('Location: '. $this->page('',$params));
!                       $GLOBALS['phpgw']->common->phpgw_exit();
                }
  
--- 307,311 ----
                function index($params='')
                {
!                       $GLOBALS['phpgw']->redirect($this->page('',$params));
                }
  
***************
*** 333,337 ****
                                
unset($GLOBALS['phpgw_info']['flags']['noappheader']);
                                
unset($GLOBALS['phpgw_info']['flags']['noappfooter']);
!                               if ($app_header && 
$GLOBALS['phpgw_info']['user']['template'] == 'idots')
                                {
                                        
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.$app_header;
--- 334,338 ----
                                
unset($GLOBALS['phpgw_info']['flags']['noappheader']);
                                
unset($GLOBALS['phpgw_info']['flags']['noappfooter']);
!                               if ($app_header && $this->always_app_header)
                                {
                                        
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.$app_header;
***************
*** 1400,1404 ****
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
                                
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
! //                            $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Group Planner');
                                $GLOBALS['phpgw']->common->phpgw_header();
                        }
--- 1401,1405 ----
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
                                
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
!                               if ($this->always_app_header) 
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Group Planner');
                                $GLOBALS['phpgw']->common->phpgw_header();
                        }
***************
*** 1690,1694 ****
                        if (!$is_private)
                        {
!                               $opt .= "\" onClick=\"location='".$view."'\"";
                                $cel = '<a href="'.$view.'">';
                        }
--- 1691,1695 ----
                        if (!$is_private)
                        {
!                               $opt .= '" onClick="location=\''.$view.'\'" 
style="cursor:pointer; cursor:hand;"';
                                $cel = '<a href="'.$view.'">';
                        }
***************
*** 1929,1933 ****
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
! //                    $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview');
                        $GLOBALS['phpgw']->common->phpgw_header();
  
--- 1930,1934 ----
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
!                       if ($this->always_app_header) 
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview');
                        $GLOBALS['phpgw']->common->phpgw_header();
  
***************
*** 2042,2067 ****
                function viewmatrix()
                {
                        $participants = 
$GLOBALS['HTTP_POST_VARS']['participants'];
                        $parts = Array();
                        $acct = 
CreateObject('phpgwapi.accounts',$this->bo->owner);
                        $c_participants = count($participants);
!                       for($i=0;$i<$c_participants;$i++)
                        {
!                               switch 
($GLOBALS['phpgw']->accounts->get_type($participants[$i]))
                                {
                                        case 'g':
!                                               $members = 
$acct->member(intval($participants[$i]));
!                                               while($members != False && 
list($index,$member) = each($members))
                                                {
!                                                       
if($this->bo->check_perms(PHPGW_ACL_READ,0,$member['account_id']) && 
!isset($parts[$member['account_id']]))
                                                        {
!                                                               
$parts[$member['account_id']] = 1;
                                                        }
                                                }
                                                break;
                                        case 'u':
!                                               
if($this->bo->check_perms(PHPGW_ACL_READ,0,$participants[$i]) && 
!isset($parts[$participants[$i]]))
                                                {
!                                                       
$parts[$participants[$i]] = 1;
                                                }
                                                break;
--- 2043,2074 ----
                function viewmatrix()
                {
+                       if ($_POST['cancel'])
+                       {
+                               $this->index();
+                       }
                        $participants = 
$GLOBALS['HTTP_POST_VARS']['participants'];
                        $parts = Array();
                        $acct = 
CreateObject('phpgwapi.accounts',$this->bo->owner);
                        $c_participants = count($participants);
!                       foreach($participants as $participant)
                        {
!                               switch 
($GLOBALS['phpgw']->accounts->get_type($participant))
                                {
                                        case 'g':
!                                               if ($members = 
$acct->member(intval($participant)))
                                                {
!                                                       foreach($members as 
$member)
                                                        {
!                                                               
if($this->bo->check_perms(PHPGW_ACL_READ,0,$member['account_id']))
!                                                               {
!                                                                       
$parts[$member['account_id']] = True;
!                                                               }
                                                        }
                                                }
                                                break;
                                        case 'u':
!                                               
if($this->bo->check_perms(PHPGW_ACL_READ,0,$participant))
                                                {
!                                                       $parts[$participant] = 
1;
                                                }
                                                break;
***************
*** 2069,2085 ****
                        }
                        unset($acct);
! 
!                       $participants = Array();
!                       reset($parts);
!                       while(list($key,$value) = each($parts))
!                       {
!                               $participants[] = $key;
!                       }
! 
!                       reset($participants);
  
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
! //                    $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview');
                        $GLOBALS['phpgw']->common->phpgw_header();
  
--- 2076,2084 ----
                        }
                        unset($acct);
!                       $participants = array_keys($parts);     // get id's as 
values and a numeric index
  
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
!                       if ($this->always_app_header) 
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview');
                        $GLOBALS['phpgw']->common->phpgw_header();
  
***************
*** 2107,2123 ****
                                        break;
                        }
!                       echo "\n".'<br><center>'."\n";
!                       echo ' <form action="'.$this->page('viewmatrix').'" 
method="post" name="matrixform" target="viewmatrix">'."\n";
                        echo '  <input type="hidden" name="year" 
value="'.$this->bo->year.'">'."\n";
                        echo '  <input type="hidden" name="month" 
value="'.$this->bo->month.'">'."\n";
                        echo '  <input type="hidden" name="day" 
value="'.$this->bo->day.'">'."\n";
                        echo '  <input type="hidden" name="matrixtype" 
value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
!                       foreach($parts as $key => $value)
                        {
!                               echo '  <input type="hidden" 
name="participants[]" value="'.$key.'">'."\n";
                        }
!                       echo '  <input type="submit" 
value="'.lang('refresh').'">'."\n";
!                       echo ' </form>'."\n";
!                       echo '</center>'."\n";
                }
  
--- 2106,2124 ----
                                        break;
                        }
!                       echo "\n<br>\n".'<form 
action="'.$this->page('viewmatrix').'" method="post" name="matrixform">'."\n";
!                       echo ' <table cellpadding="5"><tr><td>'."\n";
                        echo '  <input type="hidden" name="year" 
value="'.$this->bo->year.'">'."\n";
                        echo '  <input type="hidden" name="month" 
value="'.$this->bo->month.'">'."\n";
                        echo '  <input type="hidden" name="day" 
value="'.$this->bo->day.'">'."\n";
                        echo '  <input type="hidden" name="matrixtype" 
value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
!                       foreach($participants as $part)
                        {
!                               echo '  <input type="hidden" 
name="participants[]" value="'.$part.'">'."\n";
                        }
!                       echo '  <input type="submit" name="refresh" 
value="'.lang('Refresh').'">'."\n";
!                       echo ' </td><td>'."\n";
!                       echo '  <input type="submit" name="cancel" 
value="'.lang('Cancel').'">'."\n";
!                       echo ' </td></tr></table>'."\n";
!                       echo '</form>'."\n";
                }
  
***************
*** 2301,2305 ****
                        $tpl->set_unknowns('remove');
  
!                       include($this->template_dir.'/header.inc.php');
                        $header = $tpl->fp('out','head');
                        unset($tpl);
--- 2302,2310 ----
                        $tpl->set_unknowns('remove');
  
!                       if (!file_exists($file = 
$this->template_dir.'/header.inc.php'))
!                       {
!                               $file = PHPGW_SERVER_ROOT . 
'/calendar/templates/default/header.inc.php';
!                       }
!                       include($file);
                        $header = $tpl->fp('out','head');
                        unset($tpl);
***************
*** 3636,3639 ****
--- 3641,3649 ----
                        $endtime = $param['endtime'];
                        $participants = $param['participants'];
+                       foreach($participants as $part => $nul)
+                       {
+                               $participants[$part] = 
$GLOBALS['phpgw']->common->grab_owner_name($part);
+                       }
+                       uasort($participants,'strnatcasecmp');  // sort them 
after their fullname
  
                        if(!isset($this->bo->prefs['calendar']['interval']))
***************
*** 3644,3648 ****
                        }
                        $increment = $this->bo->prefs['calendar']['interval'];
- //                    $increment = 15;
                        $interval = (int)(60 / $increment);
  
--- 3654,3657 ----
***************
*** 3658,3690 ****
                                for($j=0;$j<$interval;$j++)
                                {
!                                       switch($j)
!                                       {
!                                               case 0:
!                                               case 1:
!                                                       switch($j)
!                                                       {
!                                                               case 0:
!                                                                       $pre = 
'0';
!                                                                       break;
!                                                               case 1:
!                                                                       $pre = 
substr(strval($i),0,1);
!                                                                       break;
!                                                       }
!                                               
!                                                       $k = 
($i<=9?$pre:substr($i,$j,$j+1));
!                                                       if($increment == 60)
!                                                       {
!                                                               $k .= 
substr(strval($i),strlen(strval($i)) - 1,1);
!                                                       }
!                                                       $str .= '<td 
align="left" bgcolor="'.$this->theme['bg_color'].'"><font 
color="'.$phpgw_info['theme']['bg_text'].'" face="'.$this->theme['font'].'" 
size="-2">'
!                                                               . '<a 
href="'.$this->page('add','&date='.$date['full'].'&hour='.$i.'&minute='.(interval
 * $j))."\" onMouseOver=\"window.status='".$i.':'.(($increment * 
$j)<=9?'0':'').($increment * $j)."'; return true;\">"
!                                                               . 
$k.'</a></font></td>';
!                                                       break;
!                                               default:
!                                                       $str .= '<td 
align="left" bgcolor="'.$this->theme['bg_color'].'"><font 
color="'.$phpgw_info['theme']['bg_text'].'" face="'.$this->theme['font'].'" 
size="-2">'
!                                                               . '<a 
href="'.$this->page('add','&date='.$date['full'].'&hour='.$i.'&minute='.(interval
 * $j))."\" onMouseOver=\"window.status='".$i.':'.($increment * $j)."'; return 
true;\">"
!                                                               . 
'&nbsp</a></font></td>';
!                                                       break;
!                                       }
                                }
                        }
--- 3667,3675 ----
                                for($j=0;$j<$interval;$j++)
                                {
!                                       $k = ($j == 0 ? 
sprintf('%02d',$i).'<br>':'').sprintf('%02d',$j*$increment);
!                                       
!                                       $str .= '<td align="left" 
bgcolor="'.$this->theme['bg_color'].'"><font 
color="'.$phpgw_info['theme']['bg_text'].'" face="'.$this->theme['font'].'" 
size="-2">'
!                                               . '<a 
href="'.$this->page('add','&date='.$date['full'].'&hour='.$i.'&minute='.(interval
 * $j))."\" onMouseOver=\"window.status='".$i.':'.(($increment * 
$j)<=9?'0':'').($increment * $j)."'; return true;\">"
!                                               . $k."</a>&nbsp;</font></td>\n";
                                }
                        }
***************
*** 3696,3706 ****
                        }
                        $owner = $this->bo->owner;
!                       while(list($part,$status) = each($participants))
                        {
!                               $str .= '<tr>'
!                                       . '<td width="15%"><font 
color="'.$this->theme['bg_text'].'" face="'.$this->theme['font'].'" 
size="-2">'.$this->bo->get_fullname($part).'</font></td>';
  
                                $this->bo->cached_events = Array();
- //                            $this->bo->owner = $part;
                                $this->bo->so->owner = $part;
                                $this->bo->so->open_box($part);
--- 3681,3690 ----
                        }
                        $owner = $this->bo->owner;
!                       foreach($participants as $part => $fullname)
                        {
!                               $str .= '<tr align="center">'
!                                       . '<td width="15%" align="left"><font 
color="'.$this->theme['bg_text'].'" face="'.$this->theme['font'].'" 
size="-2">'.$fullname.'</font></td>';
  
                                $this->bo->cached_events = Array();
                                $this->bo->so->owner = $part;
                                $this->bo->so->open_box($part);
***************
*** 3724,3732 ****
                                                        $str .= '<td height="1" 
align="left" bgcolor="'.$this->theme['bg_color'].'" 
color="#999999">&nbsp;</td>';
                                                }
                                        }
                                }
                                else
                                {
!                                       $time_slice = 
$this->bo->prepare_matrix($interval,$increment,$part,$status,$date['full']);
                                        for($h=0;$h<24;$h++)
                                        {
--- 3708,3717 ----
                                                        $str .= '<td height="1" 
align="left" bgcolor="'.$this->theme['bg_color'].'" 
color="#999999">&nbsp;</td>';
                                                }
+                                               $str .= "\n";
                                        }
                                }
                                else
                                {
!                                       $time_slice = 
$this->bo->prepare_matrix($interval,$increment,$part,$date['full']);
                                        for($h=0;$h<24;$h++)
                                        {
***************
*** 3739,3749 ****
                                                                case '&nbsp':
                                                                        
$time_slice[$index]['color'] = $this->theme['bg_color'];
                                                                        break;
                                                                case '-':
                                                                        
$time_slice[$index]['color'] = $this->theme['bg01'];
                                                                        break;
                                                        }
!                                                       $str .= '<td height="1" 
align="left" bgcolor="'.$time_slice[$index]['color']."\" color=\"#999999\"  
onMouseOver=\"window.status='".$time_slice[$index]['description']."'; return 
true;\">".'<font color="'.$this->theme['bg_text'].'" 
face="'.$this->theme['font'].'" 
size="-2">'.$time_slice[$index]['marker'].'</font></td>';
                                                }
                                        }
                                }
--- 3724,3738 ----
                                                                case '&nbsp':
                                                                        
$time_slice[$index]['color'] = $this->theme['bg_color'];
+                                                                       $extra 
= '';
                                                                        break;
                                                                case '-':
                                                                        
$time_slice[$index]['color'] = $this->theme['bg01'];
+                                                                       $link = 
$this->page('view','&cal_id='.$time_slice[$index]['id'].'&date='.$date['full']);
+                                                                       $extra 
=' title="'.$time_slice[$index]['description'].'" 
onClick="location.href=\''.$link.'\';" style="cursor:pointer; cursor:hand;"';
                                                                        break;
                                                        }
!                                                       $str .= '<td 
bgcolor="'.$time_slice[$index]['color'].'" color="#999999"'.$extra.'><font 
color="'.$this->theme['bg_text'].'" face="'.$this->theme['font'].'" 
size="-2">'.$time_slice[$index]['marker'].'</font></td>';
                                                }
+                                               $str .= "\n";
                                        }
                                }
***************
*** 3968,3980 ****
                                {
                                        case 'popup':
!                                               while 
(is_array($event['participants']) && list($bla,) = each($event['participants']))
                                                {
!                                                       if($bla != 
intval($this->bo->owner))
!                                                       //if($id != 
intval($event['owner']))
                                                        {
!                                                               $str .= 
'<option value="' . $bla . '"'.($event['participants'][$bla]?' 
selected':'').'>('.$GLOBALS['phpgw']->accounts->get_type($bla)
!                                                                               
.') ' . $GLOBALS['phpgw']->common->grab_owner_name($bla) . '</option>' . "\n"; 
! 
!                                                               //$str .= '    
<option value="' . $id.$event['participants'][$id] . 
'"'.($event['participants'][$id]?' selected':'').'>('.$user_array['type'].') 
'.$user_array['name'].'</option>'."\n";
                                                        }
                                                }
--- 3957,3966 ----
                                {
                                        case 'popup':
!                                               while 
(is_array($event['participants']) && list($id) = each($event['participants']))
                                                {
!                                                       if($id != 
intval($event['owner']))
                                                        {
!                                                               $str .= 
'<option value="' . $id.$event['participants'][$id] . 
'"'.($event['participants'][$id]?' 
selected':'').'>('.$GLOBALS['phpgw']->accounts->get_type($id)
!                                                                               
.') ' . $GLOBALS['phpgw']->common->grab_owner_name($id) . '</option>' . "\n"; 
                                                        }
                                                }
***************
*** 3983,3991 ****
                                                        'field' => '<input 
type="button" value="' . lang('Participants') . '" 
onClick="accounts_popup();">' . "\n"
                                                                        . 
'<input type="hidden" name="accountid" value="' . $accountid . '">',
!                                                       'data'  => "\n".'   
<select name="participants[]" multiple size="19">' . "\n" . $str . '</select>'
                                                );
                                                break;
                                        default:
!                                               while (list($id,$user_array) = 
each($users))
                                                {
                                                        if($id != 
intval($event['owner']))
--- 3969,3977 ----
                                                        'field' => '<input 
type="button" value="' . lang('Participants') . '" 
onClick="accounts_popup();">' . "\n"
                                                                        . 
'<input type="hidden" name="accountid" value="' . $accountid . '">',
!                                                       'data'  => "\n".'   
<select name="participants[]" multiple size="7">' . "\n" . $str . '</select>'
                                                );
                                                break;
                                        default:
!                                               foreach($users as $id => 
$user_array)
                                                {
                                                        if($id != 
intval($event['owner']))
***************
*** 4028,4039 ****
                        $p->parse('row','hr',True);
                        $rpt_type = Array(
-                               MCAL_RECUR_NONE,
-                               MCAL_RECUR_DAILY,
-                               MCAL_RECUR_WEEKLY,
-                               MCAL_RECUR_MONTHLY_WDAY,
-                               MCAL_RECUR_MONTHLY_MDAY,
-                               MCAL_RECUR_YEARLY
-                       );
-                       $rpt_type_out = Array(
                                MCAL_RECUR_NONE         => 'None',
                                MCAL_RECUR_DAILY        => 'Daily',
--- 4014,4017 ----
***************
*** 4044,4050 ****
                        );
                        $str = '';
!                       for($l=0;$l<count($rpt_type);$l++)
                        {
!                               $str .= '<option 
value="'.$rpt_type[$l].'"'.($event['recur_type']==$rpt_type[$l]?' 
selected':'').'>'.lang($rpt_type_out[$rpt_type[$l]]).'</option>';
                        }
                        $var[] = Array(
--- 4022,4028 ----
                        );
                        $str = '';
!                       foreach($rpt_type as $type => $label)
                        {
!                               $str .= '<option 
value="'.$type.'"'.($event['recur_type']==$type?' 
selected':'').'>'.lang($label).'</option>';
                        }
                        $var[] = Array(
***************
*** 4128,4158 ****
                function build_part_list(&$users,$accounts,$owner)
                {
!                       if($accounts == False)
                        {
                                return;
                        }
!                       @reset($accounts);
!                       while(list($index,$id) = each($accounts))
                        {
!                               $i_id = intval($id);
!                               if($i_id == $owner)
                                {
                                        continue;
                                }
!                               elseif(!isset($users[$i_id]))
                                {
!                                       
if($GLOBALS['phpgw']->accounts->exists($i_id) == True)
                                        {
!                                               $users[$i_id] = Array(
!                                                       'name'  => 
$GLOBALS['phpgw']->common->grab_owner_name($i_id),
!                                                       'type'  => 
$GLOBALS['phpgw']->accounts->get_type($i_id)
                                                );
                                        }
!                                       
if($GLOBALS['phpgw']->accounts->get_type($i_id) == 'g')
                                        {
!                                               
$this->build_part_list($users,$GLOBALS['phpgw']->acl->get_ids_for_location($i_id,1,'phpgw_group'),$owner);
                                        }
                                }
                        }
                }
  
--- 4106,4147 ----
                function build_part_list(&$users,$accounts,$owner)
                {
!                       if(!is_array($accounts))
                        {
                                return;
                        }
!                       foreach($accounts as $id)
                        {
!                               $id = intval($id);
!                               if($id == $owner)
                                {
                                        continue;
                                }
!                               elseif(!isset($users[$id]))
                                {
!                                       
if($GLOBALS['phpgw']->accounts->exists($id) == True)
                                        {
!                                               $users[$id] = Array(
!                                                       'name'  => 
$GLOBALS['phpgw']->common->grab_owner_name($id),
!                                                       'type'  => 
$GLOBALS['phpgw']->accounts->get_type($id)
                                                );
                                        }
!                                       
if($GLOBALS['phpgw']->accounts->get_type($id) == 'g')
!                                       {
!                                               
$this->build_part_list($users,$GLOBALS['phpgw']->acl->get_ids_for_location($id,1,'phpgw_group'),$owner);
!                                       }
!                               }
!                       }
!                       if (!function_exists('strcmp_name'))
!                       {
!                               function strcmp_name($arr1,$arr2)
!                               {
!                                       if ($diff = 
strcmp($arr1['type'],$arr2['type']))
                                        {
!                                               return $diff;   // groups 
before users
                                        }
+                                       return 
strnatcasecmp($arr1['name'],$arr2['name']);
                                }
                        }
+                       uasort($users,'strcmp_name');
                }
  

Index: hook_settings.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/hook_settings.inc.php,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** hook_settings.inc.php       4 May 2003 01:16:41 -0000       1.1.2.4
--- hook_settings.inc.php       4 May 2003 17:05:07 -0000       1.1.2.5
***************
*** 31,37 ****
  
        $summary = array(
!               'no'     => 'Never',
!               'daily'  => 'Daily',
!               'weekly' => 'Weekly'
        );
        create_select_box('Default view of appointments','summary',$summary,
--- 31,37 ----
  
        $summary = array(
!               'no'     => lang('Never'),
!               'daily'  => lang('Daily'),
!               'weekly' => lang('Weekly')
        );
        create_select_box('Default view of appointments','summary',$summary,





reply via email to

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