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


From: Sigurd Nes
Subject: [Phpgroupware-cvs] calendar/inc class.uicalendar.inc.php
Date: Mon, 11 Dec 2006 15:06:44 +0000

CVSROOT:        /sources/phpgroupware
Module name:    calendar
Changes by:     Sigurd Nes <sigurdne>   06/12/11 15:06:44

Modified files:
        inc            : class.uicalendar.inc.php 

Log message:
        matrix view - nearly fixed

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/class.uicalendar.inc.php?cvsroot=phpgroupware&r1=1.141&r2=1.142

Patches:
Index: class.uicalendar.inc.php
===================================================================
RCS file: /sources/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -b -r1.141 -r1.142
--- class.uicalendar.inc.php    11 Dec 2006 09:03:31 -0000      1.141
+++ class.uicalendar.inc.php    11 Dec 2006 15:06:43 -0000      1.142
@@ -12,7 +12,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-       /* $Id: class.uicalendar.inc.php,v 1.141 2006/12/11 09:03:31 sigurdne 
Exp $ */
+       /* $Id: class.uicalendar.inc.php,v 1.142 2006/12/11 15:06:43 sigurdne 
Exp $ */
 
        class uicalendar
        {
@@ -1970,11 +1970,12 @@
 
                function viewmatrix()
                {
-                       if ($_POST['cancel'])
+                       if (isset($_POST['cancel']) && $_POST['cancel'])
                        {
                                $this->index();
                        }
                        $participants = $_POST['participants'];
+
                        $parts = array();
                        $acct = 
CreateObject('phpgwapi.accounts',$this->bo->owner);
                        
@@ -2023,6 +2024,7 @@
                        //$GLOBALS['phpgw']->common->phpgw_header();
                        $this->header();
 
+//_debug_array($_POST);
                        switch($_POST['matrixtype'])
                        {
                                case 'free/busy':
@@ -2035,25 +2037,29 @@
                                                        'participants'  => 
$parts
                                                )
                                        );
+                                       $prev_next_shift = 1;
                                        break;
                                case 'weekly':
+                                       $this->bo->year = 
$date_selected['year'];
+                                       $this->bo->month = 
$date_selected['month'];
+                                       $this->bo->day = $date_selected['day'];
+                                       
                                        echo "<br />\n<span style=\"font-size: 
larger; 
color:#000000;\"><strong>".$this->bo->get_week_label()."</strong></span><br 
/>\n"
                                                . $this->display_weekly(
                                                        array
                                                        (
-                                                               'date'          
=> date('Ymd', $GLOBALS['phpgw']->datetime->gmtdate($date_selected['raw'])),
+                                                               'date'          
=> 
sprintf("%04d%02d%02d",$date_selected['year'],$date_selected['month'],$date_selected['day']),
                                                                'showyear'      
=> true,
                                                                'owners'        
=> $participants
                                                        )
                                        );
 
                                        $prev_next_shift = 7;
-
                                        break;
                        }
-
-                       $next_day = 
$GLOBALS['phpgw']->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day 
+ $prev_next_shift,$this->bo->year);
-                       $prev_day = 
$GLOBALS['phpgw']->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day 
- $prev_next_shift,$this->bo->year);
+//_debug_array($date_selected);
+                       $next_day = 
$GLOBALS['phpgw']->datetime->makegmttime(0,0,0,$date_selected['month'],$date_selected['day']
 + $prev_next_shift,$date_selected['year']);
+                       $prev_day = 
$GLOBALS['phpgw']->datetime->makegmttime(0,0,0,$date_selected['month'],$date_selected['day']
 - $prev_next_shift,$date_selected['year']);
  
                        #echo '<br>prev: '.var_dump($prev_day);
                        #echo '<br>next: '.var_dump($next_day);
@@ -2062,11 +2068,12 @@
                        
                        // Prev
                        echo "\n<br />\n".'<form 
action="'.$this->page('viewmatrix').'" method="post" name="matrixform">'."\n";
-                       echo '  <input type="hidden" name="year" 
value="'.$prev_day['year'].'">'."\n";
-                       echo '  <input type="hidden" name="month" 
value="'.$prev_day['month'].'">'."\n";
-                       echo '  <input type="hidden" name="day" 
value="'.$prev_day['day'].'">'."\n";
+                       echo '  <input type="hidden" name="date_select" 
value="'.date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$prev_day['raw']).'">'."\n";
+       //              echo '  <input type="hidden" name="year" 
value="'.$prev_day['year'].'">'."\n";
+       //              echo '  <input type="hidden" name="month" 
value="'.$prev_day['month'].'">'."\n";
+       //              echo '  <input type="hidden" name="day" 
value="'.$prev_day['day'].'">'."\n";
                        echo '  <input type="hidden" name="matrixtype" 
value="'.$_POST['matrixtype'].'">'."\n";
-                       foreach($participants as $part)
+                       foreach($_POST['participants'] as $part)
                        {
                                echo '  <input type="hidden" 
name="participants[]" value="'.$part.'">'."\n";
                        }
@@ -2075,7 +2082,7 @@
                        echo '</form>'."\n";
 
                        $part_inputs = '';
-                       foreach ( $participants as $part )
+                       foreach ( $_POST['participants'] as $part )
                        {
                                $part_inputs = "\t<input type=\"hidden\" 
name=\"participants[]\" value=\"{$part}\" />\n";
                        }
@@ -2083,9 +2090,10 @@
                        // Next
                        echo ' <td align="right">'."\n";
                        echo "\n<br />\n".'<form 
action="'.$this->page('viewmatrix').'" method="post" name="matrixform">'."\n";
-                       echo '  <input type="hidden" name="year" 
value="'.$next_day['year'].'">'."\n";
-                       echo '  <input type="hidden" name="month" 
value="'.$next_day['month'].'">'."\n";
-                       echo '  <input type="hidden" name="day" 
value="'.$next_day['day'].'">'."\n";
+                       echo '  <input type="hidden" name="date_select" 
value="'.date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$next_day['raw']).'">'."\n";
+               //      echo '  <input type="hidden" name="year" 
value="'.$next_day['year'].'">'."\n";
+               //      echo '  <input type="hidden" name="month" 
value="'.$next_day['month'].'">'."\n";
+               //      echo '  <input type="hidden" name="day" 
value="'.$next_day['day'].'">'."\n";
                        echo '  <input type="hidden" name="matrixtype" 
value="'.$_POST['matrixtype'].'">'."\n";
                        echo $part_inputs;
                        echo '  <input type="submit" name="prev" 
value="&gt;&gt;">'."\n";
@@ -2095,9 +2103,10 @@
                        echo ' </td></tr></table>'."\n";
                        echo ' <table cellpadding="5"><tr><td 
valign="bottom">'."\n";
                        echo "\n<br />\n".'<form 
action="'.$this->page('viewmatrix').'" method="post" name="matrixform">'."\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="date_select" 
value="'.date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$date_selected['raw']).'">'."\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="'.$_POST['matrixtype'].'">'."\n";
                        echo $part_inputs;
                        echo '  <input type="submit" name="refresh" 
value="'.lang('Refresh').'">'."\n";
@@ -2111,9 +2120,10 @@
                        echo ' <td> &nbsp; </td>'."\n";
                        echo ' <td align="right" valign="bottom">'."\n";
                        echo "\n<br />\n".'<form 
action="'.$this->page('viewmatrix').'" method="post" name="matrixform">'."\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="date_select" 
value="'.date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$date_selected['raw']).'">'."\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="'.$other_type.'">'."\n";
                        echo $part_inputs;
                        echo lang('change view to').':  <input type="submit" 
name="change_view" value="'.lang($other_type).'">'."\n";
@@ -3573,7 +3583,7 @@
                                        )
                                );
 
-                               if(!$this->bo->cached_events[$date['full']])
+                               
if(!isset($this->bo->cached_events[$date['full']]) || 
!$this->bo->cached_events[$date['full']])
                                {
                                        for($j=0;$j<24;$j++)
                                        {




reply via email to

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