[kronolith] Re: Contacts, Locations and shared calendars

j.huinink at wanadoo.nl j.huinink at wanadoo.nl
Mon Dec 9 07:49:41 2002


"Chuck Hagenbuch" <chuck@horde.org> wrote:
> Quoting Jeroen Huinink <j.huinink@wanadoo.nl>:
> 
> > The files are attached to this message. I am new to this game and I tried
> > to stick to the rules that are mentioned in horde\docs\HACKING and
> > horde\docs\CODING_STANDARDS, but I might have missed some. FYI: I am
> > running this myself on WinXP with apache 2.0 and use wincvs and gvim to 
> > get to the sources and make the changes.
> 
> I'd be happy to give you some feedback on this, but can you send it with IMP
> or another mail client that actually supports MIME attachments, instead of a
> uuencoded chunk in the body of the message?
 
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. 

This should go through IMP.

Can anybody confirm which one it is, because I really like the newsgroup 
interface to the mailinglist. Is the problem in gname or in outlook express?

Regards,
Jeroen


__________________________________________________________


Snel en makkelijk e-mailen met Wanadoo Webmail!


http://www.wanadoo.nl/webmail-------------- next part --------------
<?php
// $Horde: kronolith/config/prefs.php.dist,v 1.35 2002/12/01 02:34:47 chuck Exp $

$prefGroups['language'] = array(
    'column' => _("Your Information"),
    'label' => _("Language"),
    'desc' => _("Set your preferred display language."),
    'members' => array('language'));

$prefGroups['timezone'] = array(
    'column' => _("Your Information"),
    'label' => _("Time Zone"),
    'desc' => _("Set the current time zone."),
    'members' => array('timezone'));

$prefGroups['display'] = array(
    'column' => _("Display Options"),
    'label' => _("Date and Time Options"),
    'desc' => _("Change the way dates and times are formatted."),
    'members' => array('date_format', 'twentyFour'));

$prefGroups['view'] = array(
    'column' => _("Display Options"),
    'label' => _("User Interface"),
    'desc' => _("Select confirmation options, how to display the different views and choose default view."),
    'members' => array('confirm_delete', 'defaultview', 'half', 'week_start_monday', 'day_hour_start', 'day_hour_end', 'show_icons', 'show_shared_side_by_side'));

$prefGroups['summary'] = array(
    'column' => _("Display Options"),
    'label' => _("Summary"),
    'desc' => _("Select which events to show in the Horde summary."),
    'members' => array('summary_days', 'summary_alarms'));

$prefGroups['share'] = array(
    'column' => _("Other Options"),
    'label' => _("Calendars"),
    'desc' => _("Manage multiple calendars."),
    'members' => array('shareselect')
);
if (Auth::getAuth()) {
    $prefGroups['share']['members'][] = 'share_link';
}

$prefGroups['remote'] = array(
    'column' => _("Other Options"),
    'label' => _("Remote Calendars"),
    'desc' => _("Manage remote calendars."),
    'members' => array('remote_cal_management')
);

$prefGroups['category_management'] = array(
    'column'  => _("Other Options"),
    'label'   => _("Category Management"),
    'desc'    => _("Add, remove, and edit categories."),
    'members' => array('category_management'));

if (isset($registry) && $registry->hasMethod('tasks/list')) {
    $prefGroups['tasks'] = array(
        'column' => _("Display Options"),
        'label' => _("Tasks"),
        'desc' => _("Select if to show due tasks in the calendar."),
        'members' => array('show_tasks'));
}


// user language
$_prefs['language'] = array(
    'value' => '',
    'locked' => false,
    'shared' => true,
    'type' => 'select',
    'desc' => _("Set the language that menu items, explanations, and help are in."));

// user time zone
$_prefs['timezone'] = array(
    'value' => '',
    'locked' => false,
    'shared' => true,
    'type' => 'select',
    'desc' => _("Your current time zone:"));

// date format
$_prefs['date_format'] = array(
    'value' => '%A %B %d, %Y',
    'locked' => false,
    'shared' => false,
    'type' => 'enum',
    'enum' => array('%A %B %d, %Y' => strftime('%A %B %d, %Y'),
                    '%A, %d. %B %Y' => strftime('%A, %d. %B %Y'),
                    '%A, %d %B %Y' => strftime('%A, %d %B %Y'),
                    '%x' => strftime('%x')),
    'desc' => _("Select how to display Dates:"));

// time format
$_prefs['twentyFour'] = array(
    'value' => 0,
    'locked' => false,
    'shared' => false,
    'type' => 'checkbox',
    'desc' => _("Display 24-hour times?"));

// default view
$_prefs['defaultview'] = array(
    'value' => 'month',
    'locked' => false,
    'shared' => false,
    'type' => 'enum',
    'enum' => array('day' => _("Day"),
                    'week' => _("Week"),
                    'workweek' => _("Work Week"),
                    'month' => _("Month")),
    'desc' => _("Select the view to display after login:"));

// half hour slots
$_prefs['half'] = array(
    'value' => 0,
    'locked' => false,
    'shared' => false,
    'type' => 'checkbox',
    'desc' => _("Show half hour slots in day and week views?"));

// what day does the week start with
$_prefs['week_start_monday'] = array(
    'value' => '0',
    'locked' => false,
    'shared' => false,
    'type' => 'enum',
    'desc' => _("Select the first weekday:"),
    'enum' => array('0' => _("Sunday"),
                    '1' => _("Monday")));

// days to show in summary
$_prefs['summary_days'] = array(
    'value' => 7,
    'locked' => false,
    'shared' => false,
    'type' => 'enum',
    'desc' => _("Select the time span to show:"),
    'enum' => array(1 => '1 ' . _("day"),
                    2 => '2 ' . _("days"),
                    3 => '3 ' . _("days"),
                    4 => '4 ' . _("days"),
                    5 => '5 ' . _("days"),
                    6 => '6 ' . _("days"),
                    7 => '1 ' . _("week"),
                    14 => '2 ' . _("weeks"),
                    21 => '3 ' . _("weeks"),
                    28 => '4 ' . _("weeks")));

// show alarms in summary?
$_prefs['summary_alarms'] = array(
    'value' => 0,
    'locked' => false,
    'shared' => false,
    'type' => 'checkbox',
    'desc' => _("Show only events that have an alarm set?"));

// show due tasks in the calendar views?
$_prefs['show_tasks'] = array(
    'value' => 0,
    'locked' => false,
    'shared' => false,
    'type' => 'checkbox',
    'desc' => _("Show due tasks in the calendar?"));

// confirm deletion of events which don't recur?
$_prefs['confirm_delete'] = array(
    'value' => 1,
    'locked' => false,
    'shared' => false,
    'type' => 'checkbox',
    'desc' => _("Confirm deletion of events?"));

// start of the time range in day/week views:
$_prefs['day_hour_start'] = array(
    'value' => 16,
    'locked' => false,
    'shared' => false,
    'type' => 'select',
    'desc' => _("What time should day and week views start, when there are no earlier events?"));

// end of the time range in day/week views:
$_prefs['day_hour_end'] = array(
    'value' => 48,
    'locked' => false,
    'shared' => false,
    'type' => 'select',
    'desc' => _("What time should day and week views end, when there are no later events?"));

// default calendar selection widget
$_prefs['shareselect'] = array('type' => 'special');

// default calendar
// Set locked to true if you don't want users to have multiple calendars.
$_prefs['default_share'] = array(
    'value' => 0,
    'locked' => false,
    'shared' => true,
    'type' => 'implicit');

if (Auth::getAuth()) {
    $_prefs['share_link'] = array(
        'type' => 'link',
        'url' => 'calendars.php',
        'img' => 'kronolith.gif',
        'desc' => _("Edit your calendars.")
    );
}

// user calendar categories
$_prefs['event_categories'] = array(
    'value' => '1:Personal|2:Business',
    'locked' => false,
    'shared' => false,
    'type' => 'implicit');

// category highlight colors
$_prefs['event_colors'] = array(
    'value' => '1:#ffffff|2:#ffffff',
    'locked' => false,
    'shared' => false,
    'type' => 'implicit',
    'desc' => _("Choose Color"));

// allow removal of categories
$_prefs['category_management'] = array(
    'value' => '',
    'locked' => false,
    'shared' => false,
    'type' => 'special',
    'desc' => _("Category Management"));

// number of days to generate free/busy information for:
$_prefs['freebusy_days'] = array(
    'value' => 30,
    'locked' => false,
    'shared' => false,
    'type' => 'number',
    'desc' => _("How many days into the future should we generate free/busy information for?"));

// store the calendars to diplay
$_prefs['display_cals'] = array(
    'value' => 'a:0:{}',
    'locked' => false,
    'shared' => false,
    'type' => 'implicit');

// show delete/alarm icons in the calendar view?
$_prefs['show_icons'] = array(
    'value' => true,
    'locked' => false,
    'shared' => false,
    'type' => 'checkbox',
    'desc' => _("Show delete, alarm, and recurrence icons in calendar views?"));

// manage remote calendars
$_prefs['remote_cal_management'] = array(
    'value' => '',
    'locked' => false,
    'shared' => false,
    'type' => 'special',
    'desc' => _("Edit Remote Calendars"));
    
// store the remote calendars to display
$_prefs['remote_cals'] = array(
    'value' => 'a:0:{}',
    'locked' => false,
    'shared' => false,
    'type' => 'implicit');
    
// store the remote calendars to display
$_prefs['display_remote_cals'] = array(
    'value' => 'a:0:{}',
    'locked' => false,
    'shared' => false,
    'type' => 'implicit');
    
//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"));
-------------- next part --------------
<?php
/**
 * $Horde: kronolith/month.php,v 1.108 2002/12/01 02:11:31 chuck Exp $
 *
 * Copyright 1999-2002 Chuck Hagenbuch <chuck@horde.org>
 *
 * See the enclosed file COPYING for license information (GPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
 */

function time_compare($x, $y)
{
    $a = mktime(date('G', $x['d']), date('i', $x['d']), date('s', $x['d']));
    $b = mktime(date('G', $y['d']), date('i', $y['d']), date('s', $y['d']));

    if ($a < $b) {
        return -1;
    } elseif ($a == $b) {
        return 0;
    } else {
        return 1;
    }
}

@define('KRONOLITH_BASE', dirname(__FILE__));
require_once KRONOLITH_BASE . '/lib/base.php';

if ($timestamp = Horde::getFormData('timestamp')) {
    $month = date('n', $timestamp);
    $year = date('Y', $timestamp);
} else {
    $month = Horde::getFormData('month', date('n'));
    $year = Horde::getFormData('year', date('Y'));
}
$timestamp = mktime(1, 1, 1, $month, 1, $year);
$prevstamp = mktime(1, 1, 1, $month - 1, 1, $year);
$nextstamp = mktime(1, 1, 1, $month + 1, 1, $year);
$title = strftime('%B %Y', $timestamp);
$js_onLoad = null;

require KRONOLITH_TEMPLATES . '/common-header.inc';

$print_view = (Horde::getFormData('print') == 'true');
if ($print_view) {
    require_once $registry->getParam('templates', 'horde') . '/javascript/print.js';
} else {
    $print_link = Horde::addParameter('month.php', 'timestamp=' . $timestamp);
    $print_link = Horde::addParameter($print_link, 'print=true');
    $print_link = Horde::url($print_link);
    if ($browser->hasFeature('javascript')) {
        require_once $registry->getParam('templates', 'horde') . '/javascript/open_print_win.js';
    }

    require KRONOLITH_BASE . '/menu.php';
}

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';
}

$daysInMonth = Kronolith::daysInMonth($month, $year);
$startday = Kronolith::dayOfWeek($year, $month, $prefs->getValue('week_start_monday') ? 1 : 2);

$colors = Kronolith::categoryColors();

// Days before the month starts.
for ($i = 0; $i < $startday; $i++) {
    if (!$prefs->getValue('show_shared_side_by_side') and sizeof($GLOBALS['display_calendars']) > 1) {
        echo '<td></td>';
    }
}

$startStamp = mktime(0, 0, 0, $month, 1, $year);
$startDate = Kronolith::timestampToObject($startStamp);
$endStamp = mktime(23, 59, 59, $month, $daysInMonth, $year);
$endDate = Kronolith::timestampToObject($endStamp);
$allevents = Kronolith::listEvents($startDate, $endDate, $GLOBALS['display_calendars']);
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];
    }
    $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';
        } 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));
            } 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>';
        }

        echo '</tr></table>';

        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;
        }
    
        echo '</td>';
        $dayofweek++;
    }
}
?>

</tr></table>
</td></tr></table>

<?php

require KRONOLITH_TEMPLATES . '/common-footer.inc';
-------------- 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>


More information about the kronolith mailing list