updated/moved plugin from plugins/abook_take to squirrelmail/plugins/abook_take
[squirrelmail.git] / plugins / calendar / event_create.php
index 14ee40d981e36ccfaabc7fd952ca2f889e6e975e..72386ae9445a42720c84319d24d7e0580146211c 100644 (file)
@@ -7,7 +7,7 @@
  *
  *  functions to create a event for calendar.
  *
- *  18 Jan 2002 Adapted to official SM rules philippe@squirrelmail.org.
+ * $Id$
  */
 
 require_once('calendar_data.php');
@@ -28,7 +28,7 @@ function show_event_form() {
          "      <INPUT TYPE=hidden NAME=\"year\" VALUE=\"$year\">\n".
          "      <INPUT TYPE=hidden NAME=\"month\" VALUE=\"$month\">\n".
          "      <INPUT TYPE=hidden NAME=\"day\" VALUE=\"$day\">\n".
-         "      <TR><TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>" . ("Start time:") . "</TD>\n".
+         "      <TR><TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>" . _("Start time:") . "</TD>\n".
          "      <TD BGCOLOR=\"$color[4]\" ALIGN=LEFT>\n".
          "      <SELECT NAME=\"event_hour\">\n";
     select_option_hour($hour);
@@ -63,16 +63,16 @@ function show_event_form() {
 }
 
 
-if ($month <= 0){
+if ( !isset($month) || $month <= 0){
     $month = date( 'm' );
 }
-if ($year <= 0){
+if ( !isset($year) || $year <= 0){
     $year = date( 'Y' );
 }
-if ($day <= 0){
+if (!isset($day) || $day <= 0){
     $day = date( 'd' );
 }
-if ($hour <= 0){
+if (!isset($hour) || $hour <= 0){
     $hour = '08';
 }
 
@@ -98,7 +98,12 @@ if(!isset($event_text)){
     $event_text=nl2br($event_text);
     $event_text=ereg_replace ("\n", "", $event_text);
     $event_text=ereg_replace ("\r", "", $event_text);
-    $calendardata["$month$day$year"]["$event_hour$event_minute"] = array("length"=>"$event_length","priority"=>"$event_priority","title"=>"$event_title","message"=>"$event_text");
+    $calendardata["$month$day$year"]["$event_hour$event_minute"] =
+    array( 'length' => $event_length,
+           'priority' => $event_priority,
+           'title' => $event_title,
+           'message' => $event_text,
+           'reminder' => '' );
     //save
     writecalendardata();
     echo "  <TABLE BORDER=0 CELLPADDING=2 CELLSPACING=1 BGCOLOR=\"$color[0]\">\n".