[kronolith] feature request

Chuck Hagenbuch chuck@horde.org
Thu, 31 May 2001 10:28:22 -0400


Quoting Jan Schneider <janmailing@gmx.de>:

> Of course! ;-)
> But you already fixed it in cvs, didn't you.

Now I did. :)

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
Black and white and grey, all the shades of truth.


>From janmailing@gmx.de Date: Fri,  8 Jun 2001 14:18:15 +0200
Return-Path: <janmailing@gmx.de>
Mailing-List: contact kronolith-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list kronolith@lists.horde.org
Received: (qmail 33172 invoked from network); 8 Jun 2001 12:27:41 -0000
Received: from mailout06.sul.t-online.com (HELO mailout06.sul.t-online.de) (194.25.134.19)
  by horde.org with SMTP; 8 Jun 2001 12:27:41 -0000
Received: from fwd04.sul.t-online.de 
	by mailout06.sul.t-online.de with smtp 
	id 158LLu-0006A8-02; Fri, 08 Jun 2001 14:26:58 +0200
Received: from linux.wg.de (320034214675-0001@[217.0.157.37]) by fmrl04.sul.t-online.com
	with esmtp id 158LLf-0C1CXQC; Fri, 8 Jun 2001 14:26:43 +0200
Received: from localhost (localhost [127.0.0.1])
	by linux.wg.de (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id f58CIGR15156
	for <kronolith@lists.horde.org>; Fri, 8 Jun 2001 14:18:16 +0200
Received: from 192.168.60.1 ( [192.168.60.1])
	as user jan@mail.wg.de by linux.wg.de with HTTP;
	Fri,  8 Jun 2001 14:18:15 +0200
Message-ID: <992002695.3b20c287dbe95@linux.wg.de>
Date: Fri,  8 Jun 2001 14:18:15 +0200
From: Jan Schneider <janmailing@gmx.de>
To: kronolith@lists.horde.org
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-MOQ992002695ca79e3a284625e69c465ee58328e2f16"
User-Agent: Internet Messaging Program (IMP) 2.3.7-cvs
X-Sender: 320034214675-0001@t-dialin.net
Subject: Patch

---MOQ992002695ca79e3a284625e69c465ee58328e2f16
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Hi,

attached find a patch that implements the following:
- checkbox to set duration to the whole day
- allow duration to be set up to 23 hours, 60 minutes
- implement occurence: monthly on the same weekday 
(mcal_event_set_recur_monthly_wday)
- enable deleting of events in month view

Jan.

::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::
---MOQ992002695ca79e3a284625e69c465ee58328e2f16
Content-Type: text/plain; name="kronolith.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="kronolith.diff"

Index: month.php
===================================================================
RCS file: /cvs/horde/kronolith/month.php,v
retrieving revision 1.44
diff -u -r1.44 month.php
--- month.php	2001/05/23 16:49:23	1.44
+++ month.php	2001/06/08 12:04:40
@@ -102,7 +102,8 @@
         foreach ($date_array[$i] as $e) {
             echo '<a class="event" href="' . Horde::url('editevent.php?eventID=' . $e['id'] . "&month=$month&year=$year&day=$i") . '">';
             Horde::pimg('bullet.gif', 'align="bottom" alt="*"');
-            echo $e['title'] . '</a><br />';
+            echo $e['title'] . '</a>';
+            echo '<a href="' . Horde::applicationUrl('delevent.php?eventID=' . $e['id'] . "&month=$month&year=$year&day=$i") . '"><img src="graphics/delete.gif" alt="delete" border=0 hspace=2 vspace=0></a><br />' . "\n";
         }
     }
     echo '</td>' . "\n";
Index: lib/Driver/mcal.php
===================================================================
RCS file: /cvs/horde/kronolith/lib/Driver/mcal.php,v
retrieving revision 1.10
diff -u -r1.10 mcal.php
--- lib/Driver/mcal.php	2001/05/31 03:59:04	1.10
+++ lib/Driver/mcal.php	2001/06/08 12:12:00
@@ -183,6 +183,13 @@
                     $eventData['start_hour'] = 0;
                 }
             }
+            if (isset($eventData['whole_day'])
+                && ($eventData['whole_day'] == 1)) {
+                $eventData['start_hour'] = 0;
+                $eventData['start_min'] = 0;
+                $eventData['end_hour'] = 24;
+                $eventData['end_min'] = 0;
+            }
             mcal_event_set_start($this->driver->stream,
                                  $eventData['start_year'],
                                  $eventData['start_month'],
@@ -260,6 +267,19 @@
                                                       $eventData['recur_enddate_month'],
                                                       $eventData['recur_enddate_day'],
                                                       $eventData['recur_day_of_month_interval']);
+                }
+                break;
+
+            case KRONOLITH_RECUR_WEEK_OF_MONTH:
+                if (isset($eventData['recur_enddate_year'])
+                    && isset($eventData['recur_enddate_month'])
+                    && isset($eventData['recur_enddate_day'])) {
+                    if (empty($eventData['recur_week_of_month_interval'])) $eventData['recur_week_of_month_interval'] = 1;
+                    mcal_event_set_recur_monthly_wday($this->driver->stream,
+                                                      $eventData['recur_enddate_year'],
+                                                      $eventData['recur_enddate_month'],
+                                                      $eventData['recur_enddate_day'],
+                                                      $eventData['recur_week_of_month_interval']);
                 }
                 break;

Index: templates/edit/edit.inc
===================================================================
RCS file: /cvs/horde/kronolith/templates/edit/edit.inc,v
retrieving revision 1.20
diff -u -r1.20 edit.inc
--- templates/edit/edit.inc	2001/05/31 14:28:56	1.20
+++ templates/edit/edit.inc	2001/06/08 12:12:00
@@ -12,7 +12,8 @@
     if (field == 'recur_daily_interval') clearFields(1);
     else if (field == 'recur_weekly_interval') clearFields(2);
     else if (field == 'recur_day_of_month_interval') clearFields(3);
-    else if (field == 'recur_yearly_interval') clearFields(4);
+    else if (field == 'recur_week_of_month_interval') clearFields(4);
+    else if (field == 'recur_yearly_interval') clearFields(5);
 }

 function setRecur(index)
@@ -37,8 +38,17 @@
         }
     }
     if (index != 3) document.event.recur_day_of_month_interval.value = '';
-    if (index != 4) document.event.recur_yearly_interval.value = '';
+    if (index != 4) document.event.recur_week_of_month_interval.value = '';
+    if (index != 5) document.event.recur_yearly_interval.value = '';
 }
+
+function setWholeDay()
+{
+    document.event.start_hour.selectedIndex = 0;
+    document.event.start_min.selectedIndex = 0;
+    document.event.end_hour.selectedIndex = 23;
+    document.event.end_min.selectedIndex = 12;
+}
 // -->
 </script>

@@ -192,7 +202,6 @@
 <tr>
 <td align="right" class="light"><b>Duration&nbsp;&nbsp;</b></td>
 <td class="item<?=($_i++ % 2)?>" align="left" valign="top">
-<select name="end_hour">
 <?php
 if ($event->isInitialized()) {
     $end_hour_match = $event->getEndDate('G') - $event->getStartDate('G');
@@ -201,10 +210,21 @@
         $end_min_match += 60;
         $end_hour_match--;
     }
+    if ($end_hour_match == 0 && $end_min_match == 0
+        && ($event->getEndDate('d') - $event->getStartDate('d')) == 1) {
+        $end_hour_match = 23;
+        $end_min_match = 60;
+        $whole_day_match = true;
+    }
 } else {
     $end_hour_match = 1;
     $end_min_match = 0;
 }
+?>
+<input name="whole_day" type="checkbox" value="1" onclick="setWholeDay()"<?php if (isset($whole_day_match) && $whole_day_match) echo ' checked' ?>>
+<?= _("The whole day")?><br>
+<select name="end_hour">
+<?php
 for ($i=0; $i<24; $i++) {
     $sel = '';
     if ($i == $end_hour_match)
@@ -216,7 +236,7 @@
 <?= _("Hour(s)")?>&nbsp;
 <select name="end_min">
 <?php
-for ($i=0; $i<12; $i++) {
+for ($i=0; $i<13; $i++) {
     $sel = '';
     $min = sprintf("%02d", $i * 5);
     if ($min == $end_min_match)
@@ -224,7 +244,7 @@
     echo '<option value="' . $min . '"' . $sel . '>' . $min;
 }
 ?>
-</select>Minutes
+</select><?= _("Minutes") ?>
 </td>
 </tr>

@@ -247,9 +267,9 @@
 <td class="item<?=($_i++ % 2)?>" align="left" valign="top">
 <?php $_j = $_i ?>
 <table cellpadding="0" cellspacing="0" border="0" width="95%">
-<tr><td class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="clearFields(0);" value="<?= KRONOLITH_RECUR_NONE ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_NONE)) echo ' checked="checked"' ?>><?= _("None") ?></td></tr>
-<tr><td class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="setInterval('recur_daily_interval');" value="<?= KRONOLITH_RECUR_DAILY ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_DAILY)) echo ' checked="checked"' ?>><?= _("Daily: Recurs every") ?>&nbsp;<input type="text" name="recur_daily_interval" size="2" onkeypress="setRecur(1);" onchange="setRecur(1);" value="<?= $event->hasRecurType(KRONOLITH_RECUR_DAILY) ? $event->getRecurInterval() : '' ?>" />&nbsp;<?= _("day(s)") ?></td></tr>
-<tr><td class="item<?=($_j++ % 2)?>">
+<tr><td nowrap class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="clearFields(0);" value="<?= KRONOLITH_RECUR_NONE ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_NONE)) echo ' checked="checked"' ?>><?= _("None") ?></td></tr>
+<tr><td nowrap class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="setInterval('recur_daily_interval');" value="<?= KRONOLITH_RECUR_DAILY ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_DAILY)) echo ' checked="checked"' ?>><?= _("Daily: Recurs every") ?>&nbsp;<input type="text" name="recur_daily_interval" size="2" onkeypress="setRecur(1);" onchange="setRecur(1);" value="<?= $event->hasRecurType(KRONOLITH_RECUR_DAILY) ? $event->getRecurInterval() : '' ?>" />&nbsp;<?= _("day(s)") ?></td></tr>
+<tr><td nowrap class="item<?=($_j++ % 2)?>">
 <input type="radio" name="recur" onclick="setInterval('recur_weekly_interval');" value="<?= KRONOLITH_RECUR_WEEKLY ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_WEEKLY)) echo ' checked="checked"' ?>><?= _("Weekly: Recurs every") ?>&nbsp;<input type="text" name="recur_weekly_interval" size="2" onkeypress="setRecur(2);" onchange="setRecur(2);" value="<?= $event->hasRecurType(KRONOLITH_RECUR_WEEKLY) ? $event->getRecurInterval() : '' ?>" />&nbsp;<?= _("week(s) on:") ?><br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 Mo<input type="checkbox" name="weekly[]" onclick="setRecur(2);" value="<?= KRONOLITH_MASK_MONDAY ?>"<?php if ($event->recurOnDay(KRONOLITH_MASK_MONDAY)) echo ' checked="checked"' ?> />&nbsp;
@@ -260,8 +280,9 @@
 Sa<input type="checkbox" name="weekly[]" onclick="setRecur(2);" value="<?= KRONOLITH_MASK_SATURDAY ?>"<?php if ($event->recurOnDay(KRONOLITH_MASK_SATURDAY)) echo ' checked="checked"' ?> />&nbsp;
 Su<input type="checkbox" name="weekly[]" onclick="setRecur(2);" value="<?= KRONOLITH_MASK_SUNDAY ?>"<?php if ($event->recurOnDay(KRONOLITH_MASK_SUNDAY)) echo ' checked="checked"' ?> />&nbsp;
 </td></tr>
-<tr><td class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="setInterval('recur_day_of_month_interval');" value="<?= KRONOLITH_RECUR_DAY_OF_MONTH ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_DAY_OF_MONTH)) echo ' checked="checked"' ?>><?= _("Monthly: Recurs every") ?>&nbsp;<input type="text" name="recur_day_of_month_interval" size="2" onkeypress="setRecur(3);" onchange="setRecur(3);" value="<?= $event->hasRecurType(KRONOLITH_RECUR_DAY_OF_MONTH) ? $event->getRecurInterval() : '' ?>" />&nbsp;<?= _("month(s)") ?></td></tr>
-<tr><td class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="setInterval('recur_yearly_interval');" value="<?= KRONOLITH_RECUR_YEARLY ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_YEARLY)) echo ' checked="checked"' ?>><?= _("Yearly: Recurs every") ?>&nbsp;<input type="text" name="recur_yearly_interval" size="2" onkeypress="setRecur(4);" onchange="setRecur(4);" value="<?= $event->hasRecurType(KRONOLITH_RECUR_YEARLY) ? $event->getRecurInterval() : '' ?>" />&nbsp;<?= _("year(s)") ?></td></tr>
+<tr><td nowrap class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="setInterval('recur_day_of_month_interval');" value="<?= KRONOLITH_RECUR_DAY_OF_MONTH ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_DAY_OF_MONTH)) echo ' checked="checked"' ?>><?= _("Monthly: Recurs every") ?>&nbsp;<input type="text" name="recur_day_of_month_interval" size="2" onkeypress="setRecur(3);" onchange="setRecur(3);" value="<?= $event->hasRecurType(KRONOLITH_RECUR_DAY_OF_MONTH) ? $event->getRecurInterval() : '' ?>" />&nbsp;<?= _("month(s)") ?> <?= _("on the same date") ?></td></tr>
+<tr><td nowrap class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="setInterval('recur_week_of_month_interval');" value="<?= KRONOLITH_RECUR_WEEK_OF_MONTH ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_WEEK_OF_MONTH)) echo ' checked="checked"' ?>><?= _("Monthly: Recurs every") ?>&nbsp;<input type="text" name="recur_week_of_month_interval" size="2" onkeypress="setRecur(4);" onchange="setRecur(4);" value="<?= $event->hasRecurType(KRONOLITH_RECUR_WEEK_OF_MONTH) ? $event->getRecurInterval() : '' ?>" />&nbsp;<?= _("month(s)") ?> <?= _("on the same weekday") ?></td></tr>
+<tr><td nowrap class="item<?=($_j++ % 2)?>"><input type="radio" name="recur" onclick="setInterval('recur_yearly_interval');" value="<?= KRONOLITH_RECUR_YEARLY ?>"<?php if ($event->hasRecurType(KRONOLITH_RECUR_YEARLY)) echo ' checked="checked"' ?>><?= _("Yearly: Recurs every") ?>&nbsp;<input type="text" name="recur_yearly_interval" size="2" onkeypress="setRecur(5);" onchange="setRecur(5);" value="<?= $event->hasRecurType(KRONOLITH_RECUR_YEARLY) ? $event->getRecurInterval() : '' ?>" />&nbsp;<?= _("year(s)") ?></td></tr>
 </table>
 <
---MOQ992002695ca79e3a284625e69c465ee58328e2f16--



>From chuck@horde.org Date: Fri,  8 Jun 2001 16:15:16 -0400
Return-Path: <chuck@horde.org>
Mailing-List: contact kronolith-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list kronolith@lists.horde.org
Received: (qmail 66514 invoked from network); 8 Jun 2001 20:17:02 -0000
Received: from 208-59-250-206.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com (HELO marina.horde.org) (208.59.250.206)
  by horde.org with SMTP; 8 Jun 2001 20:17:02 -0000
Received: by marina.horde.org (Postfix, from userid 33)
	id 31A2B39F4; Fri,  8 Jun 2001 16:15:17 -0400 (EDT)
Received: from 206.243.191.252 ( [206.243.191.252])
	as user chuck@localhost by marina.horde.org with HTTP;
	Fri,  8 Jun 2001 16:15:16 -0400
Message-ID: <992031316.3b213254d07e7@marina.horde.org>
Date: Fri,  8 Jun 2001 16:15:16 -0400
From: Chuck Hagenbuch <chuck@horde.org>
To: kronolith@lists.horde.org
References: <992002695.3b20c287dbe95@linux.wg.de>
In-Reply-To: <992002695.3b20c287dbe95@linux.wg.de>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 2.3.7-cvs
Subject: Re: [kronolith] Patch

Quoting Jan Schneider <janmailing@gmx.de>:

> - checkbox to set duration to the whole day
> - allow duration to be set up to 23 hours, 60 minutes

This mostly looks good, but I don't understand why you need both of these?

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
Some fallen angels have their good reasons.


>From janmailing@gmx.de Date: Fri,  8 Jun 2001 22:24:06 +0200
Return-Path: <janmailing@gmx.de>
Mailing-List: contact kronolith-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list kronolith@lists.horde.org
Received: (qmail 67279 invoked from network); 8 Jun 2001 20:27:20 -0000
Received: from mailout00.sul.t-online.com (HELO mailout00.sul.t-online.de) (194.25.134.16)
  by horde.org with SMTP; 8 Jun 2001 20:27:20 -0000
Received: from fwd01.sul.t-online.de 
	by mailout00.sul.t-online.de with smtp 
	id 158SqZ-00054v-08; Fri, 08 Jun 2001 22:27:07 +0200
Received: from linux.wg.de (320034214675-0001@[217.0.157.107]) by fmrl01.sul.t-online.com
	with esmtp id 158SqO-01Mh3wC; Fri, 8 Jun 2001 22:26:56 +0200
Received: from localhost (localhost [127.0.0.1])
	by linux.wg.de (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id f58KO7R19497
	for <kronolith@lists.horde.org>; Fri, 8 Jun 2001 22:24:07 +0200
Received: from 192.168.60.1 ( [192.168.60.1])
	as user jan@mail.wg.de by linux.wg.de with HTTP;
	Fri,  8 Jun 2001 22:24:06 +0200
Message-ID: <992031846.3b213466eb341@linux.wg.de>
Date: Fri,  8 Jun 2001 22:24:06 +0200
From: Jan Schneider <janmailing@gmx.de>
To: kronolith@lists.horde.org
References: <992002695.3b20c287dbe95@linux.wg.de> <992031316.3b213254d07e7@marina.horde.org>
In-Reply-To: <992031316.3b213254d07e7@marina.horde.org>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 2.3.7-cvs
X-Sender: 320034214675-0001@t-dialin.net
Subject: Re: [kronolith] Patch

Zitat von Chuck Hagenbuch <chuck@horde.org>:

> Quoting Jan Schneider <janmailing@gmx.de>:
> 
> > - checkbox to set duration to the whole day
> > - allow duration to be set up to 23 hours, 60 minutes
> 
> This mostly looks good, but I don't understand why you need both of these?

I need the latter one to implement the first one.
And the first one often makes sense. Think of birthdays, holidays or events 
that don't have a specific start time.

Jan.


>From chuck@horde.org Date: Fri,  8 Jun 2001 23:58:12 -0400
Return-Path: <chuck@horde.org>
Mailing-List: contact kronolith-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list kronolith@lists.horde.org
Received: (qmail 75636 invoked from network); 9 Jun 2001 03:59:54 -0000
Received: from 208-59-250-206.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com (HELO marina.horde.org) (208.59.250.206)
  by horde.org with SMTP; 9 Jun 2001 03:59:54 -0000
Received: by marina.horde.org (Postfix, from userid 33)
	id D1DA439F4; Fri,  8 Jun 2001 23:58:12 -0400 (EDT)
Received: from 192.168.0.112 ( [192.168.0.112])
	as user chuck@localhost by marina.horde.org with HTTP;
	Fri,  8 Jun 2001 23:58:12 -0400
Message-ID: <992059092.3b219ed49dd99@marina.horde.org>
Date: Fri,  8 Jun 2001 23:58:12 -0400
From: Chuck Hagenbuch <chuck@horde.org>
To: kronolith@lists.horde.org
References: <992002695.3b20c287dbe95@linux.wg.de> <992031316.3b213254d07e7@marina.horde.org> <992031846.3b213466eb341@linux.wg.de>
In-Reply-To: <992031846.3b213466eb341@linux.wg.de>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 2.3.7-cvs
Subject: Re: [kronolith] Patch

Quoting Jan Schneider <janmailing@gmx.de>:

> I need the latter one to implement the first one.
> And the first one often makes sense. Think of birthdays, holidays or
> events that don't have a specific start time.

Certainly - I'm just not convinced you need the one for the other. It won't do 
any harm for now - I'll take a look later.

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
Some fallen angels have their good reasons.


>From janmailing@gmx.de Date: Sat,  9 Jun 2001 19:45:46 +0200
Return-Path: <janmailing@gmx.de>
Mailing-List: contact kronolith-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list kronolith@lists.horde.org
Received: (qmail 93209 invoked from network); 9 Jun 2001 17:47:10 -0000
Received: from mailout01.sul.t-online.com (HELO mailout01.sul.t-online.de) (194.25.134.80)
  by horde.org with SMTP; 9 Jun 2001 17:47:10 -0000
Received: from fwd07.sul.t-online.de 
	by mailout01.sul.t-online.de with smtp 
	id 158mp8-0001IA-02; Sat, 09 Jun 2001 19:46:58 +0200
Received: from linux.wg.de (320034214675-0001@[217.0.157.81]) by fmrl07.sul.t-online.com
	with esmtp id 158mp0-1bNnuqC; Sat, 9 Jun 2001 19:46:50 +0200
Received: from localhost (localhost [127.0.0.1])
	by linux.wg.de (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id f59HjkR27266
	for <kronolith@lists.horde.org>; Sat, 9 Jun 2001 19:45:46 +0200
Received: from 192.168.60.1 ( [192.168.60.1])
	as user jan@mail.wg.de by linux.wg.de with HTTP;
	Sat,  9 Jun 2001 19:45:46 +0200
Message-ID: <992108746.3b2260ca59e8c@linux.wg.de>
Date: Sat,  9 Jun 2001 19:45:46 +0200
From: Jan Schneider <janmailing@gmx.de>
To: kronolith@lists.horde.org
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 2.3.7-cvs
X-Sender: 320034214675-0001@t-dialin.net
Subject: segmentation fault importing calendar entries

Hi,

I'm just writing a module for importing Outlook/vCalendar entries into 
kronolith.

But when I try to insert more than one entry at once I get a segmentation 
fault. This is the backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x4010be15 in strcasecmp () at ../sysdeps/generic/strcasecmp.c:72
72      ../sysdeps/generic/strcasecmp.c: No such file or directory.
(gdb) bt
#0  0x4010be15 in strcasecmp () at ../sysdeps/generic/strcasecmp.c:72
#1  0x4042fcfa in calevent_setattr () at mcal.c:753
#2  0x4035dd28 in php_if_mcal_event_add_attribute () at php_mcal.c:205
#3  0x402fdba9 in execute () at ./zend_execute.c:853
#4  0x402fddfc in execute () at ./zend_execute.c:853
#5  0x4030c766 in zend_execute_scripts () at zend.c:259
#6  0x4031f774 in php_execute_script () at main.c:1141
#7  0x4031b9c0 in apache_php_module_main () at sapi_apache.c:98
#8  0x4031c421 in send_php () at mod_php4.c:437
#9  0x4031c463 in send_parsed_php () at mod_php4.c:437
#10 0x8055250 in ap_invoke_handler ()
#11 0x80677bc in ap_some_auth_required ()
#12 0x8067833 in ap_process_request ()
#13 0x805fd27 in ap_child_terminate ()
#14 0x805fed5 in ap_child_terminate ()
#15 0x8060016 in ap_child_terminate ()
#16 0x8060628 in ap_child_terminate ()
#17 0x8060e95 in main ()
#18 0x400cca8e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93

What I do is basically a foreach loop with this code:

$event = array();
$event['title'] = ...
$event['description'] = ...
$event['location'] = ...
.
.
.
$eventobj = $calendar->getEventObject();
$eventobj->readFormData($event);
$eventobj->save();

The crash occurs when readFormData is calling mcal_event_add_attribute to set 
the location. The locations are "Deutschland" and "" (empty string).

Any idea?

Jan.

::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::