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 19:36:43 +0000

CVSROOT:        /sources/phpgroupware
Module name:    calendar
Changes by:     Sigurd Nes <sigurdne>   06/12/11 19:36:43

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

Log message:
        dates for matrixview

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

Patches:
Index: class.uicalendar.inc.php
===================================================================
RCS file: /sources/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -b -r1.142 -r1.143
--- class.uicalendar.inc.php    11 Dec 2006 15:06:43 -0000      1.142
+++ class.uicalendar.inc.php    11 Dec 2006 19:36:42 -0000      1.143
@@ -12,7 +12,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-       /* $Id: class.uicalendar.inc.php,v 1.142 2006/12/11 15:06:43 sigurdne 
Exp $ */
+       /* $Id: class.uicalendar.inc.php,v 1.143 2006/12/11 19:36:42 sigurdne 
Exp $ */
 
        class uicalendar
        {
@@ -2012,8 +2012,14 @@
 
                        $participants = array_keys($parts);     // get id's as 
values and a numeric index
 
+                       if(isset($_POST['date_select']) && 
$_POST['date_select'])
+                       {
                        $jscal = CreateObject('phpgwapi.jscalendar', false);
                        $date_selected = 
$jscal->input2date($_POST['date_select']);
+                               $this->bo->year = $date_selected['year'];
+                               $this->bo->month = $date_selected['month'];
+                               $this->bo->day = $date_selected['day'];
+                       }
 
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
@@ -2031,7 +2037,8 @@
                                        echo '<br />'.$this->timematrix(
                                                array
                                                (
-                                                       'date'          => 
$GLOBALS['phpgw']->datetime->gmtdate($date_selected['raw']),
+                                       //              'date'          => 
$GLOBALS['phpgw']->datetime->gmtdate($date_selected['raw']),
+                                                       'date'          => 
$GLOBALS['phpgw']->datetime->gmtdate(mktime(0,0,0,$this->bo->month,$this->bo->day,$this->bo->year)),
                                                        'starttime'     => 
$this->bo->splittime('000000',False),
                                                        'endtime'       => 0,
                                                        'participants'  => 
$parts
@@ -2040,15 +2047,11 @@
                                        $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'          
=> 
sprintf("%04d%02d%02d",$date_selected['year'],$date_selected['month'],$date_selected['day']),
+                                                               'date'          
=> sprintf("%04d%02d%02d",$this->bo->year,$this->bo->month,$this->bo->day),
                                                                'showyear'      
=> true,
                                                                'owners'        
=> $participants
                                                        )
@@ -2058,8 +2061,8 @@
                                        break;
                        }
 //_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']);
+                       $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);
 
                        #echo '<br>prev: '.var_dump($prev_day);
                        #echo '<br>next: '.var_dump($next_day);
@@ -2068,10 +2071,10 @@
                        
                        // Prev
                        echo "\n<br />\n".'<form 
action="'.$this->page('viewmatrix').'" method="post" name="matrixform">'."\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="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($_POST['participants'] as $part)
                        {
@@ -2090,10 +2093,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="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="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";
@@ -2103,10 +2106,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="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="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";
@@ -2120,10 +2123,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="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="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";




reply via email to

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