[kronolith] Re: Re: Contacts, Locations and shared calendars

j.huinink at wanadoo.nl j.huinink at wanadoo.nl
Mon Dec 9 21:45:32 PST 2002


"Chuck Hagenbuch" <chuck@horde.org> wrote:
> Quoting j.huinink@wanadoo.nl:
> 
> > Hmmmm.... I was using the gname newsgroup interface to the mailing list
> > through MS Outlook Express. I suspect that either one could be the 
> > problem.
> 
> Definitely Outlook.
> 
> Can you send a diff against latest CVS HEAD, though? I can't get diff to
> give me anything useful from these files. cvs diff -urN.
> 
> Sorry to be a pain, but I just don't have the time to pick through your
> files line by line to see what's different between them and CVS.

I assume your diff failed because I probably used Windows file format instead 
of Unix. I used gvim now to explicitly save everything to Unix before running 
the diffs. I did a lot more work in the mean time, so a complete diff will load 
you with stuff that's incomplete. I hope this works: diffs for 
* kronolith\month.php (month.diff);  
* kronolith\config\prefs.php.dist (prefs.diff);
and a new file
* kronolith\template\month\head_side_by_side.inc

Regards,
Jeroen





__________________________________________________________


Snel en makkelijk e-mailen met Wanadoo Webmail!


http://www.wanadoo.nl/webmail-------------- next part --------------
Index: month.php
==================================================================RCS file: /repository/kronolith/month.php,v
retrieving revision 1.108
diff -r1.108 month.php
57c57,61
< require KRONOLITH_TEMPLATES . '/month/head.inc';
---
> if ($prefs->getValue('show_shared_side_by_side') and sizeof($GLOBALS['display_calendars']) > 1) {
>     include KRONOLITH_TEMPLATES . '/month/head_side_by_side.inc';
> } else {
>     include KRONOLITH_TEMPLATES . '/month/head.inc';
> }
66c70,72
<     echo '<td></td>';
---
>     if (!$prefs->getValue('show_shared_side_by_side') and sizeof($GLOBALS['display_calendars']) > 1) {
>         echo '<td></td>';
>     }
74,81c80,83
< 
< $dayofweek = $startday;
< for ($day = 1; $day <= $daysInMonth; $day++) {
<     $dayStamp = mktime(0, 0, 0, $month, $day, $year);
<     $week = Kronolith::weekOfYear($day, $month, $year);
< 
<     if (($dayofweek % 7 == 0) && ($dayofweek != 0)) {
<         echo "</tr>\n<tr>";
---
> if ($prefs->getValue('show_shared_side_by_side') and sizeof($GLOBALS['display_calendars']) > 1) {
>     $allCalendars = Kronolith::listCalendars();
>     foreach($GLOBALS['display_calendars'] as $id) {
>        $currentCalendars[$id] = &$allCalendars[$id];
83,101c85,108
<     if (mktime(0, 0, 0) == $dayStamp) {
<         $style = 'selected';
<     } elseif (isset($date_array[$i]) && is_array($date_array[$i])) {
<         $style = 'text';
<     } else {
<         $style = 'item';
<     }
< 
<     echo '<td class="' . $style . '" height="100" width="14%" valign="top">';
<     echo '<table cellspacing="0" cellpadding="1" width="100%"><tr><td>';
< 
<     $url = Horde::addParameter(Horde::applicationUrl('day.php'),
<                                'timestamp=' . $dayStamp);
<     echo '<b><a class="day" href="' . $url . "\">&nbsp;$day&nbsp;</a></b>";
< 
<     if (($dayofweek % 7 == 0) && (($dayofweek != 0 || $startday == 0))) {
<         $url = Horde::addParameter('week.php', 'week=' . $week);
<         if ($month == 12 && $week == 1) {
<             $url = Horde::addParameter($url, 'year=' . ($year + 1));
---
>     $sharedCalendars = $GLOBALS['display_calendars'];
> } else {
>    $currentCalendars = array(''); 
> }
> foreach ($currentCalendars as $id => $cal) {
>     if ($prefs->getValue('show_shared_side_by_side') and sizeof($GLOBALS['display_calendars']) > 1) {
>         echo "<tr><th>" . $cal->getShareName() . "</th>";
>     } 
>     $dayofweek = $startday;
>     for ($day = 1; $day <= $daysInMonth; $day++) {
>         $dayStamp = mktime(0, 0, 0, $month, $day, $year);
>         $week = Kronolith::weekOfYear($day, $month, $year);
>     
>         if (($dayofweek % 7 == 0) && ($dayofweek != 0)) {
>             if ($prefs->getValue('show_shared_side_by_side') and sizeof($GLOBALS['display_calendars']) > 1) {
> 	        echo "<th>" . $cal->getShareName() . "</th>";
> 	    } else { 
>                 echo "</tr>\n<tr>";
> 	    }
>         }
>         if (mktime(0, 0, 0) == $dayStamp) {
>             $style = 'selected';
>         } elseif (isset($date_array[$i]) && is_array($date_array[$i])) {
>             $style = 'text';
103c110
<             $url = Horde::addParameter($url, 'year=' . $year);
---
>             $style = 'item';
105,110c112,116
<         echo ' (' . Horde::link(Horde::applicationUrl($url), sprintf(_("Week %d"), $week)) . sprintf(_("Week&nbsp;%d"), $week) . '</a>)';
<     }
<     echo '</td>';
< 
<     if (Auth::getAuth() && !$print_view) {
<         $url = Horde::addParameter(Horde::applicationUrl('addevent.php'),
---
>     
>         echo '<td class="' . $style . '" height="100" width="14%" valign="top">';
>         echo '<table cellspacing="0" cellpadding="1" width="100%"><tr><td>';
>     
>         $url = Horde::addParameter(Horde::applicationUrl('day.php'),
112,114c118,136
<         $url = Horde::addParameter($url, 'url=' . urlencode($_SERVER['REQUEST_URI']));
<         echo '<td width="14%">' . Horde::link($url, _("Create a New Event")) . Horde::img('new.gif', _("Create a New Event"), 'align="right"') . '</a></td>';
<     }
---
>         echo '<b><a class="day" href="' . $url . "\">&nbsp;$day&nbsp;</a></b>";
>     
>         if (($dayofweek % 7 == 0) && (($dayofweek != 0 || $startday == 0))) {
>             $url = Horde::addParameter('week.php', 'week=' . $week);
>             if ($month == 12 && $week == 1) {
>                 $url = Horde::addParameter($url, 'year=' . ($year + 1));
>             } else {
>                 $url = Horde::addParameter($url, 'year=' . $year);
>             }
>             echo ' (' . Horde::link(Horde::applicationUrl($url), sprintf(_("Week %d"), $week)) . sprintf(_("Week&nbsp;%d"), $week) . '</a>)';
>         }
>         echo '</td>';
>     
>         if (Auth::getAuth() && !$print_view) {
>             $url = Horde::addParameter(Horde::applicationUrl('addevent.php'),
>                                        'timestamp=' . $dayStamp);
>             $url = Horde::addParameter($url, 'url=' . urlencode($_SERVER['REQUEST_URI']));
>             echo '<td width="14%">' . Horde::link($url, _("Create a New Event")) . Horde::img('new.gif', _("Create a New Event"), 'align="right"') . '</a></td>';
>         }
116c138
<     echo '</tr></table>';
---
>         echo '</tr></table>';
118,130c140,158
<     if (!empty($allevents[$dayStamp]) &&
<         count($allevents[$dayStamp])) {
<         $cell = '<table cellspacing="0" cellpadding="1" width="100%">';
<         foreach ($allevents[$dayStamp] as $event) {
<             $categoryColor = isset($colors[$event->getCalendar()][$event->getCategory()]) ? $colors[$event->getCalendar()][$event->getCategory()] : '#ccccff' ;
< 
<             $cell .= '<tr><td class="month-eventbox" style="background-color: ' . $categoryColor . '; ' ;
<             $cell .= 'border-color: ' . Kronolith::borderColor($categoryColor) . '" ' ;
<             $cell .= 'onmouseover="javascript:style.backgroundColor=\'' . Horde_Image::modifyColor($categoryColor) . '\'" ' ;
<             $cell .= 'onmouseout="javascript:style.backgroundColor=\'' . $categoryColor . '\'" ' ;
<             $cell .= 'valign="top">';
<             $cell .= $event->getLink($dayStamp);
<             $cell .= '</td></tr>';
---
>         if (!empty($allevents[$dayStamp]) &&
>             count($allevents[$dayStamp])) {
>             $cell = '<table cellspacing="0" cellpadding="1" width="100%">';
>             foreach ($allevents[$dayStamp] as $event) {
> 	        if (!$prefs->getValue('show_shared_side_by_side') or $event->getCalendar() == $id) {
>                     $categoryColor = isset($colors[$event->getCalendar()][$event->getCategory()]) ? $colors[$event->getCalendar()][$event->getCategory()] : '#ccccff' ;
>     
>                     $cell .= '<tr><td class="month-eventbox" style="background-color: ' . $categoryColor . '; ' ;
>                     $cell .= 'border-color: ' . Kronolith::borderColor($categoryColor) . '" ' ;
>                     $cell .= 'onmouseover="javascript:style.backgroundColor=\'' . Horde_Image::modifyColor($categoryColor) . '\'" ' ;
>                     $cell .= 'onmouseout="javascript:style.backgroundColor=\'' . $categoryColor . '\'" ' ;
>                     $cell .= 'valign="top">';
>                     $cell .= $event->getLink($dayStamp);
>                     $cell .= '</td></tr>';
> 		}
>             }
>             
>             $cell .= '</table>';
>             echo $cell;
132,134c160,162
<         
<         $cell .= '</table>';
<         echo $cell;
---
>     
>         echo '</td>';
>         $dayofweek++;
136,138d163
< 
<     echo '</td>';
<     $dayofweek++;
-------------- next part --------------
<?php
    $prevurl = Horde::addParameter('month_shares.php', 'month=' . date('n', $prevstamp));
    $prevurl = Horde::addParameter($prevurl, 'year=' . date('Y', $prevstamp));
    $prevurl = Horde::applicationURL($prevurl);
    
    $nexturl = Horde::addParameter('month_shares.php', 'month=' . date('n', $nextstamp));
    $nexturl = Horde::addParameter($nexturl, 'year=' . date('Y', $nextstamp));
    $nexturl = Horde::applicationURL($nexturl);

    $daysInMonth = Kronolith::daysInMonth($month, $year);
    $startday = Kronolith::dayOfWeek($year, $month, 1);
?>    
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
  <th class="header">
  <?php echo (!$print_view) ? Horde::link($prevurl, _("Last Month"), 'menuitem') . Horde::img('prev.gif', '&lt;'). '</a>' : '' ?>
  <?php echo $title ?>
  <?php echo (!$print_view) ? Horde::link($nexturl, _("Next Month"), 'menuitem') . Horde::img('next.gif', '&gt;') .'</a>' : '' ?>
  </th>
</tr>

<tr><td class="control"><table border="0" cellpadding="2" cellspacing="1" width="100%">

<tr><td>&nbsp;</td>
<?php
$dayofweek = ($startday) % 7;
for ($day = 1; $day <= $daysInMonth; $day++) {
   switch($dayofweek % 7) {
   case 0:
?>
<th class="item"><?php echo _("Monday") ?></th>
<?php break;
case 1: ?>
<th class="item"><?php echo _("Tuesday") ?></th>
<?php break;
case 2: ?>
<th class="item"><?php echo _("Wednesday") ?></th>
<?php break;
case 3: ?>
<th class="item"><?php echo _("Thursday") ?></th>
<?php break;
case 4: ?>
<th class="item"><?php echo _("Friday") ?></th>
<?php break;
case 5: ?>
<th class="item"><?php echo _("Saturday") ?></th>
<?php break;
case 6: ?>
<th class="item"><?php echo _("Sunday") ?></th>
<?php 
    } 
    if ($prefs->getValue('week_start_monday') == (($dayofweek + 2) % 7)) { ?>
    <td></td>
<?php
    }

    $dayofweek++;
}
?>
</tr>
<tr>
-------------- next part --------------
Index: prefs.php.dist
==================================================================RCS file: /repository/kronolith/config/prefs.php.dist,v
retrieving revision 1.35
diff -r1.35 prefs.php.dist
26c26
<     'members' => array('confirm_delete', 'defaultview', 'half', 'week_start_monday', 'day_hour_start', 'day_hour_end', 'show_icons'));
---
>     'members' => array('confirm_delete', 'defaultview', 'half', 'week_start_monday', 'day_hour_start', 'day_hour_end', 'show_icons', 'show_shared_side_by_side'));
277a278,284
> //collapsed or side by side view
> $_prefs['show_shared_side_by_side'] = array(
>     'value' => false,
>     'locked' => false,
>     'shared' => false,
>     'type' => 'checkbox',
>     'desc' => _("Show shared calendars side-by-side"));


More information about the kronolith mailing list