diff --git a/calendar/day.php b/calendar/day.php
index 7072232f2b..65e0b07eeb 100644
--- a/calendar/day.php
+++ b/calendar/day.php
@@ -89,7 +89,7 @@
$phpgw->template->set_var("small_calendar",$phpgw->calendar->pretty_small_calendar($now["day"],$now["month"],$now["year"],"day.php"));
if (!$friendly) {
- $param = "year=".$now["year"]."&month=".$now["month"]."&day=".$now["day"]."&friendly=1";
+ $param = "year=".$now["year"]."&month=".$now["month"]."&day=".$now["day"]."&friendly=1&filter=".$filter;
$phpgw->template->set_var("print","link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang("Generate printer-friendly version")."'\">[".lang("Printer Friendly")."]");
$phpgw->template->parse("out","day_t");
$phpgw->template->pparse("out","day_t");
diff --git a/calendar/edit_entry_handler.php b/calendar/edit_entry_handler.php
index f69b864d99..5f30b711fb 100755
--- a/calendar/edit_entry_handler.php
+++ b/calendar/edit_entry_handler.php
@@ -57,9 +57,30 @@
if(!$participating && count($cal_info->participants) == 1) {
$cal_info->owner = $cal_info->participants[0];
}
+ if ($phpgw_info["user"]["preferences"]["common"]["timeformat"] == "12") {
+ if ($cal_info->ampm == "pm" && $cal_info->hour <> 12) {
+ $cal_info->hour += 12;
+ }
+ if ($cal_info->end_ampm == "pm" && $cal_info->end_hour <> 12) {
+ $cal_info->end_hour += 12;
+ }
+ }
+ $cal_info->datetime = mktime($cal_info->hour,$cal_info->minute,0,$cal_info->month,$cal_info->day,$cal_info->year) - ((60 * 60) * $phpgw_info["user"]["preferences"]["common"]["tz_offset"]);
+ $cal_info->edatetime = mktime($cal_info->end_hour,$cal_info->end_minute,0,$cal_info->end_month,$cal_info->end_day,$cal_info->end_year) - ((60 * 60) * $phpgw_info["user"]["preferences"]["common"]["tz_offset"]);
+ $cal_info->rpt_end = mktime(12,0,0,$cal_info->rpt_month,$cal_info->rpt_day,$cal_info->rpt_year) - ((60 * 60) * $phpgw_info["user"]["preferences"]["common"]["tz_offset"]);
$phpgw->common->appsession($cal_info);
$datetime_check = validate($cal_info);
- $overlapping_events = $phpgw->calendar->overlap($cal_info->month,$cal_info->day,$cal_info->year,$cal_info->hour,$cal_info->minute,$cal_info->ampm,$cal_info->end_month,$cal_info->end_day,$cal_info->end_year,$cal_info->end_hour,$cal_info->end_minute,$cal_info->end_ampm,$cal_info->participants,$cal_info->owner,$cal_info->id);
+ if ($phpgw_info["user"]["preferences"]["common"]["timeformat"] == "12") {
+ if ($cal_info->hour >= 12) {
+ $cal_info->ampm = "";
+ }
+ if ($cal_info->end_hour >= 12) {
+ $cal_info->end_ampm = "";
+ }
+ }
+ $cal_info->datetime += ((60 * 60) * $phpgw_info["user"]["preferences"]["common"]["tz_offset"]);
+ $cal_info->edatetime += ((60 * 60) * $phpgw_info["user"]["preferences"]["common"]["tz_offset"]);
+ $overlapping_events = $phpgw->calendar->overlap($cal_info->datetime,$cal_info->edatetime,$cal_info->participants,$cal_info->groups,$cal_info->owner,$cal_info->id);
} else {
$cal_info = $phpgw->common->appsession();
}
@@ -76,13 +97,13 @@
$phpgw->template->set_var("color",$phpgw_info["theme"]["bg_text"]);
- $time = $phpgw->calendar->fixtime($cal_info->hour,$cal_info->minute,$cal_info->ampm);
$calendar_overlaps = $phpgw->calendar->getevent($overlapping_events);
+ $format = $phpgw_info["user"]["preferences"]["common"]["dateformat"] . " - ";
if ($phpgw_info["user"]["preferences"]["common"]["timeformat"] == "12") {
- $format = "h:i:s a";
+ $format .= "h:i:s a";
} else {
- $format = "H:i:s";
+ $format .= "H:i:s";
}
$overlap = "";
@@ -94,11 +115,11 @@
$overlap .= "(PRIVATE)";
else
$overlap .= $phpgw->calendar->link_to_entry($cal_over->id,"circle.gif",$cal_over->name);
- $overlap .= " (".$phpgw->common->show_date($cal_over->datetime,$format)." - ".$phpgw->common->show_date($cal_over->edatetime,$format).")
";
+ $overlap .= " (".$phpgw->common->show_date($cal_over->datetime)." - ".$phpgw->common->show_date($cal_over->edatetime).")
";
}
}
if(strlen($overlap)) {
- $phpgw->template->set_var("overlap_text",lang("Your suggested time of x - x conflicts with the following existing calendar entries:",$phpgw->calendar->build_time_for_display($time),$phpgw->calendar->build_time_for_display($phpgw->calendar->addduration($cal_info->hour,$cal_info->minute,$cal_info->ampm,$cal_info->duration))));
+ $phpgw->template->set_var("overlap_text",lang("Your suggested time of x - x conflicts with the following existing calendar entries:",date($format,$cal_info->datetime),date($format,$cal_info->edatetime)));
$phpgw->template->set_var("overlap_list",$overlap);
} else {
$phpgw->template->set_var("overlap_text","");
diff --git a/calendar/inc/header.inc.php b/calendar/inc/header.inc.php
index c5ffde87f1..be0a542a68 100644
--- a/calendar/inc/header.inc.php
+++ b/calendar/inc/header.inc.php
@@ -6,6 +6,8 @@
if(!isset($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"]))
$phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"] = "Sunday";
+ if(!isset($filter) || !$filter)
+ $filter = $phpgw_info["user"]["preferences"]["calendar"]["defaultfilter"];
if (isset($date) && strlen($date) > 0) {
$thisyear = substr($date, 0, 4);
$thismonth = substr($date, 4, 2);
diff --git a/calendar/index.php b/calendar/index.php
index ca0db9463d..e5d2611b51 100755
--- a/calendar/index.php
+++ b/calendar/index.php
@@ -78,7 +78,7 @@
$phpgw->template->set_var("small_calendar_next",$phpgw->calendar->pretty_small_calendar($thisday,$next["month"],$next["year"],"day.php"));
$phpgw->template->set_var("large_month",$phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner));
if (!$friendly) {
- $param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1";
+ $param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1&filter=".$filter;
$phpgw->template->set_var("print","link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window."
. "status = '" . lang("Generate printer-friendly version"). "'\">[". lang("Printer Friendly") . "]");
$phpgw->template->parse("out","index_t");
diff --git a/calendar/preferences.php b/calendar/preferences.php
index 9a8e98ab7f..bc22f88b6e 100644
--- a/calendar/preferences.php
+++ b/calendar/preferences.php
@@ -22,6 +22,7 @@
$phpgw->preferences->change($phpgw_info["user"]["account_id"],"workdaystarts","calendar");
$phpgw->preferences->change($phpgw_info["user"]["account_id"],"workdayends","calendar");
$phpgw->preferences->change($phpgw_info["user"]["account_id"],"defaultcalendar","common");
+ $phpgw->preferences->change($phpgw_info["user"]["account_id"],"defaultfilter","calendar");
if ($mainscreen_showevents) {
$phpgw->preferences->change($phpgw_info["user"]["account_id"],"mainscreen_showevents","calendar");
} else {
@@ -123,6 +124,30 @@
+ nextmatchs->alternate_row_color($tr_color);
+ ?>
+