From 8cdd9ab81bd595dbc534e38289b46e1a0fb874c5 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Fri, 2 Sep 2011 12:55:56 +0200 Subject: [PATCH] export function and style fixes in calendar --- apps/calendar/css/style.css | 24 ++++++------ apps/calendar/export.php | 37 +++++++++++++++++++ apps/calendar/js/calendar.js | 14 +++++++ apps/calendar/templates/calendar.php | 2 +- .../part.choosecalendar.rowfields.php | 2 +- 5 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 apps/calendar/export.php diff --git a/apps/calendar/css/style.css b/apps/calendar/css/style.css index afb530bcff..c414b00eb9 100755 --- a/apps/calendar/css/style.css +++ b/apps/calendar/css/style.css @@ -17,7 +17,6 @@ * 59 Temple Place, Suite 330, Boston, * * MA 02111-1307 USA * *************************************************/ -#calendar_holder{position: absolute; top: 80px; bottom: 0px; left: 160px; right: 0px;} #view {margin-left: 10px; float: left; font-size: 12px;} #datecontrol {text-align: center;} @@ -31,12 +30,13 @@ #editentry_dialog {display: none;} #parsingfail_dialog{display: none;} -#view {margin-left: 10px; float: left; font-size: 12px;} -#onedayview, #oneweekview, #fourweeksview, #onemonthview, #listview {display: none;} -#onedayview table {margin: 0; padding: 0; width: 100%; border-spacing:1px; background: #EEEEEE;} -#oneweekview table {margin: 0; padding: 0; width: 100%; border-spacing:1px; background: #EEEEEE;} -#fourweeksview table {margin: 0; padding: 0; width: 100%; border-spacing:1px; background: #EEEEEE;} -#onemonthview table {margin: 0; padding: 0; width: 100%; border-spacing:1px; background: #EEEEEE;} +#view {margin-left: 10px; float: left; font-size: 12px; height: 100%;} +#calendar_holder {height: 100%; width: 100%;} +#onedayview, #oneweekview, #fourweeksview, #onemonthview, #listview {display: none; position: absolute;bottom: 0; right: 0; left: 160px; top: 80px;} +#onedayview table {margin: 0; padding: 0; width: 100%; height: 100%; border-spacing:1px; background: #EEEEEE;} +#oneweekview table {margin: 0; padding: 0; width: 100%; height: 100%; border-spacing:1px; background: #EEEEEE;} +#fourweeksview table {margin: 0; padding: 0; width: 100%; height: 100%; border-spacing:1px; background: #EEEEEE;} +#onemonthview table {margin: 0; padding: 0; width: 100%; height: 100%; border-spacing:1px; background: #EEEEEE;} #fourweeksview_calw1, #fourweeksview_calw2, #fourweeksview_calw3, #fourweeksview_calw4{vertical-align: middle;text-align: center;width: 50px;} #sysbox{display: none;} @@ -44,12 +44,12 @@ .actions {height: 33px; min-width: 800px;} .controls {min-width: 800px;} .center {text-align: center;} -.dateinfo {height: 15px; width: 100%; overflow: hidden; margin: 0; padding: 0; font-size: 12px;background: #F7F7F7;} +.dateinfo {height: 20px;width: 100%; overflow: hidden; margin-top: 0; padding: 0; font-size: 12px;background: #F7F7F7;} .events {height: 80px; width: 100%; margin: 0; padding: 0;} .calendar_row {height: 20px; text-align: center;background: #ffffff;} .calendar_time {height: 20px; width: 50px; text-align:right;background: #ffffff;} -.fourweeksview_item {text-align: center; background: #ffffff;width: 14%;} -.onemonthview_item {text-align: center; height: 80px; margin: 0; padding: 0; vertical-align: top; background: #ffffff; width: 14%; height: 16%;} -.weekend{text-align: center;margin: 0; padding: 0;vertical-align: top;background: #F3F3F3; height: 80px;width: 100%; } +.fourweeksview_item {text-align: center; background: #ffffff;width: 14%;vertical-align: top;height: 25%;} +.onemonthview_item {text-align: center; margin: 0; padding: 0; vertical-align: top; background: #ffffff; width: 14%;} +.weekend{text-align: center;margin: 0; padding: 0;vertical-align: top;background: #F3F3F3; width: 100%; } .weekend_thead, .weekend_row{height: 20px;text-align: center;text-align: center;background: #F3F3F3;} -.thisday{background: #FFFABC;text-align: center;} +.thisday{background: #FFFABC;text-align: center;margin: 0;padding: 0;vertical-align: top;height: 20px;} diff --git a/apps/calendar/export.php b/apps/calendar/export.php new file mode 100644 index 0000000000..3ed7ba0445 --- /dev/null +++ b/apps/calendar/export.php @@ -0,0 +1,37 @@ + * + * * + * please write to the Free Software Foundation. * + * Address: * + * 59 Temple Place, Suite 330, Boston, * + * MA 02111-1307 USA * + *************************************************/ +require_once ("../../lib/base.php"); +if(!OC_USER::isLoggedIn()) { + header("Location: " . OC_HELPER::linkTo("", "index.php")); + exit; +} +$cal = $_GET["calid"]; +$calendar = OC_Calendar_Calendar::findCalendar($cal); +if($calendar["userid"] != OC_User::getUser()){ + header("Location: " . OC_HELPER::linkTo("", "index.php")); + exit; +} +$calobjects = OC_Calendar_Calendar::allCalendarObjects($cal); +header("Content-Type: text/Calendar"); +header("Content-Disposition: inline; filename=calendar.ics"); +for($i = 0;$i <= count($calobjects); $i++){ + echo $calobjects[$i]["calendardata"] . "\n"; +} +?> \ No newline at end of file diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 01e678e962..f9633ae04d 100755 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -611,12 +611,26 @@ Calendar={ weekday++; } } + if(oc_cal_rows == 4){ + for(var i = 1;i <= 6;i++){ + $("#fourweeksview_week_" + i).height("25%"); + } + $("td.thisday").height("25%"); + } if(oc_cal_rows == 5) { $("#onemonthview_week_5").css('display', "table-row"); + for(var i = 1;i <= 6;i++){ + $("#fourweeksview_week_" + i).height("20%"); + } + $("td.thisday").height("20%"); } if(oc_cal_rows == 6) { $("#onemonthview_week_5").css('display', "table-row"); $("#onemonthview_week_6").css('display', "table-row"); + for(var i = 1;i <= 6;i++){ + $("#fourweeksview_week_" + i).height("16%"); + } + $("td.thisday").height("16%"); } }, showEvents:function(){ diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index 32da13f8c3..ca6ba16f47 100755 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -374,7 +374,7 @@ - + diff --git a/apps/calendar/templates/part.choosecalendar.rowfields.php b/apps/calendar/templates/part.choosecalendar.rowfields.php index ebe1ca0b13..52edda4e25 100755 --- a/apps/calendar/templates/part.choosecalendar.rowfields.php +++ b/apps/calendar/templates/part.choosecalendar.rowfields.php @@ -1,4 +1,4 @@ "; echo ""; - echo "t("Download") . "\" class=\"action\">t("Edit") . "\" class=\"action\" onclick=\"oc_cal_editcalendar(this, " . $_['calendar']["id"] . ");\">"; + echo "t("Download") . "\" class=\"action\">t("Edit") . "\" class=\"action\" onclick=\"oc_cal_editcalendar(this, " . $_['calendar']["id"] . ");\">";