summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rwxr-xr-xapps/calendar/ajax/changeview.php31
-rwxr-xr-xapps/calendar/ajax/editevent.php22
-rwxr-xr-xapps/calendar/ajax/getcal.php27
-rwxr-xr-xapps/calendar/ajax/geteventinfo.php22
-rwxr-xr-xapps/calendar/ajax/newevent.php23
-rw-r--r--apps/calendar/appinfo/info.xml2
-rwxr-xr-xapps/calendar/css/style.css188
-rwxr-xr-xapps/calendar/index.php11
-rwxr-xr-xapps/calendar/js/calendar.js579
-rwxr-xr-xapps/calendar/js/calendar_dialog.js14
-rwxr-xr-xapps/calendar/js/calendar_init.js96
-rwxr-xr-xapps/calendar/templates/calendar.php106
12 files changed, 557 insertions, 564 deletions
diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php
new file mode 100755
index 00000000000..a3fc8afbb75
--- /dev/null
+++ b/apps/calendar/ajax/changeview.php
@@ -0,0 +1,31 @@
+<?php
+/*************************************************
+ * ownCloud - Calendar Plugin *
+ * *
+ * (c) Copyright 2011 Georg Ehrke *
+ * author: Georg Ehrke *
+ * email: ownclouddev at georgswebsite dot de *
+ * homepage: ownclouddev.georgswebsite.de *
+ * manual: ownclouddev.georgswebsite.de/manual *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
+ * *
+ * If you are not able to view the License, *
+ * <http://www.gnu.org/licenses/> *
+ * <http://ownclouddev.georgswebsite.de/license/> *
+ * 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()) {
+ die("0");
+}
+$currentview = $_GET["v"];
+OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", $currentview);
+if(OC_Preferences::getValue(OC_USER::getUser(), "calendar", "currentview") == $currentview){
+ die("1");
+}else{
+ die("0");
+}
+?> \ No newline at end of file
diff --git a/apps/calendar/ajax/editevent.php b/apps/calendar/ajax/editevent.php
new file mode 100755
index 00000000000..6182a60e611
--- /dev/null
+++ b/apps/calendar/ajax/editevent.php
@@ -0,0 +1,22 @@
+<?php
+/*************************************************
+ * ownCloud - Calendar Plugin *
+ * *
+ * (c) Copyright 2011 Georg Ehrke *
+ * author: Georg Ehrke *
+ * email: ownclouddev at georgswebsite dot de *
+ * homepage: ownclouddev.georgswebsite.de *
+ * manual: ownclouddev.georgswebsite.de/manual *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
+ * *
+ * <http://www.gnu.org/licenses/> *
+ * If you are not able to view the License, *
+ * <http://www.gnu.org/licenses/> *
+ * <http://ownclouddev.georgswebsite.de/license/> *
+ * please write to the Free Software Foundation. *
+ * Address: *
+ * 59 Temple Place, Suite 330, Boston, *
+ * MA 02111-1307 USA *
+ *************************************************/
+
+?>
diff --git a/apps/calendar/ajax/getcal.php b/apps/calendar/ajax/getcal.php
new file mode 100755
index 00000000000..9d28caeb3df
--- /dev/null
+++ b/apps/calendar/ajax/getcal.php
@@ -0,0 +1,27 @@
+<?php
+/*************************************************
+ * ownCloud - Calendar Plugin *
+ * *
+ * (c) Copyright 2011 Georg Ehrke *
+ * author: Georg Ehrke *
+ * email: ownclouddev at georgswebsite dot de *
+ * homepage: ownclouddev.georgswebsite.de *
+ * manual: ownclouddev.georgswebsite.de/manual *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
+ * *
+ * If you are not able to view the License, *
+ * <http://www.gnu.org/licenses/> *
+ * <http://ownclouddev.georgswebsite.de/license/> *
+ * 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 ;
+}
+require_once ("../lib/calendar.php");
+$calendar = new OC_Calendar_Calendar;
+?> \ No newline at end of file
diff --git a/apps/calendar/ajax/geteventinfo.php b/apps/calendar/ajax/geteventinfo.php
new file mode 100755
index 00000000000..6182a60e611
--- /dev/null
+++ b/apps/calendar/ajax/geteventinfo.php
@@ -0,0 +1,22 @@
+<?php
+/*************************************************
+ * ownCloud - Calendar Plugin *
+ * *
+ * (c) Copyright 2011 Georg Ehrke *
+ * author: Georg Ehrke *
+ * email: ownclouddev at georgswebsite dot de *
+ * homepage: ownclouddev.georgswebsite.de *
+ * manual: ownclouddev.georgswebsite.de/manual *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
+ * *
+ * <http://www.gnu.org/licenses/> *
+ * If you are not able to view the License, *
+ * <http://www.gnu.org/licenses/> *
+ * <http://ownclouddev.georgswebsite.de/license/> *
+ * please write to the Free Software Foundation. *
+ * Address: *
+ * 59 Temple Place, Suite 330, Boston, *
+ * MA 02111-1307 USA *
+ *************************************************/
+
+?>
diff --git a/apps/calendar/ajax/newevent.php b/apps/calendar/ajax/newevent.php
new file mode 100755
index 00000000000..a87eab02af5
--- /dev/null
+++ b/apps/calendar/ajax/newevent.php
@@ -0,0 +1,23 @@
+<?php
+/*************************************************
+ * ownCloud - Calendar Plugin *
+ * *
+ * (c) Copyright 2011 Georg Ehrke *
+ * author: Georg Ehrke *
+ * email: ownclouddev at georgswebsite dot de *
+ * homepage: ownclouddev.georgswebsite.de *
+ * manual: ownclouddev.georgswebsite.de/manual *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
+ * *
+ * <http://www.gnu.org/licenses/> *
+ * If you are not able to view the License, *
+ * <http://www.gnu.org/licenses/> *
+ * <http://ownclouddev.georgswebsite.de/license/> *
+ * please write to the Free Software Foundation. *
+ * Address: *
+ * 59 Temple Place, Suite 330, Boston, *
+ * MA 02111-1307 USA *
+ *************************************************/
+
+?>
+
diff --git a/apps/calendar/appinfo/info.xml b/apps/calendar/appinfo/info.xml
index 4cb6b0dd3f5..f3deb93c59f 100644
--- a/apps/calendar/appinfo/info.xml
+++ b/apps/calendar/appinfo/info.xml
@@ -4,7 +4,7 @@
<name>Calendar</name>
<version>0.1</version>
<licence>AGPL</licence>
- <author>Jakob Sack</author>
+ <author>Jakob Sack, Georg Ehrke (Interface)</author>
<require>2</require>
<description>CalDAV server with viewing support.</description>
</info>
diff --git a/apps/calendar/css/style.css b/apps/calendar/css/style.css
index f74c47eb396..d6190637832 100755
--- a/apps/calendar/css/style.css
+++ b/apps/calendar/css/style.css
@@ -6,7 +6,7 @@
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
- * License: GNU General Public License (GPL) *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* <http://www.gnu.org/licenses/> *
* If you are not able to view the License, *
@@ -16,156 +16,40 @@
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
- **************************************************
- * list of IDs *
- * calendar_container - contains all calendar *
- * choosecalendar - choose Calender holder *
- * choosecalendar_dialog - Dialog to choose cal. *
- * newentry_dialog - Dialog for creating an event *
- * editentry_dialog - Dialog for editing an event *
- * view - container for view chooser *
- * datecontrol - Date in the top middle *
- * datecontrol_label - label for datecontrol *
- * onedayview - view for one day *
- * oneweekview - view for one week *
- * fourweeksview - view for four weeks *
- * onemonthview - view for one month *
- * list of classes *
- * actions - owncloud native class *
- * center - centering an element *
- * control - owncloud native class *
- * dateinfo - date in four weeks and month view *
- * calender_row - normal calender row *
- * calender_time - calender row for time *
- * fourweeksview_item - item in fourweeksview *
- * onemonthview_item - item in onemonthview *
*************************************************/
-#calendar_container {
- position: absolute;
- top: 150px;
- bottom: 10px;
- left: 230px;
- right: 100px;
-}
-#choosecalendar {
- margin-right: 10px;
- float: right;
-}
-#choosecalendar_dialog {
- display: none;
-}
-#newentry_dialog {
- display: none;
-}
-#editentry_dialog {
- display: none;
-}
-#parsingfail_dialog{
- display: none;
-}
-#view {
- margin-left: 10px;
- float: left;
-}
-#datecontrol {
- text-align: center;
-}
-#datecontrol_date_label {
- margin: 0;
- padding: 0;
-}
-#onedayview, #oneweekview, #fourweeksview, #onemonthview, #listview {
- display: none;
-}
-#onedayview table {
- margin: 0;
- padding: 0;
- width: 100%;
-}
-#oneweekview table {
- margin: 0;
- padding: 0;
- width: 100%;
-}
-#fourweeksview table {
- margin: 0;
- padding: 0;
- width: 100%;
-}
-#onemonthview table {
- margin: 0;
- padding: 0;
- width: 100%;
-}
-#fourweeksview_calw1, #fourweeksview_calw2, #fourweeksview_calw3, #fourweeksview_calw4{
- vertical-align: middle;
- text-align: center;
- width: 50px;
-}
-#devbox {
- position: absolute;
- top: 0;
- left: 300px;
- right: 300px;
- text-align: center;
- height: 50px;
-}
-.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;
-}
-.events {
- height: 65px;
- width: 100%;
- margin: 0;
- padding: 0;
-}
-.calendar_row {
- height: 20px;
- text-align: center;
-}
-.calendar_time {
- height: 20px;
- width: 50px;
- text-align:right;
-}
-.fourweeksview_item {
- text-align: center;
- height: 80px;
-}
-.onemonthview_item {
- text-align: center;
- height: 80px;
- margin: 0;
- padding: 0;
- vertical-align: top;
-}
-.weekend{
- text-align: center;
- height: 80px;
- margin: 0;
- padding: 0;
- vertical-align: top;
- background: #F3F3F3;
-}
+#calendar_holder{position: absolute; top: 80px; bottom: 0px; left: 160px; right: 0px;}
-.weekend_thead, .weekend_row{
- height: 20px;
- text-align: center;
- text-align: center;
- background: #F3F3F3;
-} \ No newline at end of file
+#view {margin-left: 10px; float: left; font-size: 12px;}
+#datecontrol {text-align: center;}
+#datecontrol_left{font-size: 12px;}
+#datecontrol_right{font-size: 12px;}
+#datecontrol_date_label {margin: 0; padding: 0; font-size: 12px;}
+#choosecalendar {margin-right: 170px; float: right; font-size: 12px;}
+
+#choosecalendar_dialog {display: none;}
+#newentry_dialog {display: none;}
+#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;}
+#fourweeksview_calw1, #fourweeksview_calw2, #fourweeksview_calw3, #fourweeksview_calw4{vertical-align: middle;text-align: center;width: 50px;}
+
+#sysbox{display: none;}
+
+.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;}
+.events {height: 65px; 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; height: 80px; background: #ffffff;}
+.onemonthview_item {text-align: center; height: 80px; margin: 0; padding: 0; vertical-align: top; background: #ffffff;}
+.weekend{text-align: center;height: 80px;margin: 0; padding: 0; vertical-align: top;background: #F3F3F3;}
+.weekend_thead, .weekend_row{height: 20px;text-align: center;text-align: center;background: #F3F3F3;}
+.thisday{background: #FFFABC;} \ No newline at end of file
diff --git a/apps/calendar/index.php b/apps/calendar/index.php
index ee00b0280b2..b0aaa144495 100755
--- a/apps/calendar/index.php
+++ b/apps/calendar/index.php
@@ -7,7 +7,7 @@
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
- * License: GNU General Public License (GPL) *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
@@ -20,17 +20,14 @@
require_once ("../../lib/base.php");
if(!OC_USER::isLoggedIn()) {
header("Location: " . OC_HELPER::linkTo("", "index.php"));
- exit ;
-}
-if(!file_exists("cfg/" . OC_USER::getUser() . ".cfg.php")) {
- header("Location: install.php");
+ exit;
}
OC_UTIL::addScript("calendar", "calendar");
OC_UTIL::addScript("calendar", "calendar_init");
OC_UTIL::addScript("calendar", "calendar_dialog");
OC_UTIL::addStyle("calendar", "style");
-require_once ("libs/iCalcreator.php");
-require_once ("libs/oc_calendar.php");
+require_once ("template.php");
OC_APP::setActiveNavigationEntry("calendar_index");
$output = new OC_TEMPLATE("calendar", "calendar", "user");
$output -> printpage();
+?> \ No newline at end of file
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index d8b1fece2d6..639107ebda8 100755
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -6,8 +6,9 @@
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
- * License: GNU General Public License (GPL) *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
+ * <http://www.gnu.org/licenses/> *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
@@ -38,30 +39,30 @@
* switch2today - switching to today *
* remove_events - remove old events in view *
*************************************************/
-function calw() {
- var generate_dayofweek = dayofweek;
+function oc_cal_calw() {
+ var generate_dayofweek = oc_cal_dayofweek;
if(generate_dayofweek == 0) {
generate_dayofweek = 7;
}
- var calw = Math.floor((doy() - generate_dayofweek) / 7) + 1;
+ var calw = Math.floor((oc_cal_doy() - generate_dayofweek) / 7) + 1;
return calw;
}
-function doy() {
- if(checkforleapyear(year) == true) {
- var cal = leap_cal;
+function oc_cal_doy() {
+ if(oc_cal_checkforleapyear(oc_cal_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
var doy = 0;
- for(var i = 0; i < month; i++) {
+ for(var i = 0; i < oc_cal_month; i++) {
doy = parseInt(doy) + parseInt(cal[i]);
}
- doy = parseInt(doy) + dayofmonth;
+ doy = parseInt(doy) + oc_cal_dayofmonth;
return doy;
}
-function checkforleapyear(year2check) {
+function oc_cal_checkforleapyear(year2check) {
if((year2check / 600) == Math.floor(year2check / 400)) {
return true;
}
@@ -74,201 +75,209 @@ function checkforleapyear(year2check) {
return false;
}
-function update_view(view, task) {
+function oc_cal_update_view(view, task) {
if(view == "") {
- view = currentview;
+ view = oc_cal_currentview;
}
+ $("#sysbox").load(oc_webroot + "/apps/calendar/ajax/changeview.php?v="+view+"");
+ //no necessary to check whether the response is true or not
switch(view) {
case "onedayview":
if(task == "forward") {
- forward_day();
+ oc_cal_forward_day();
}
if(task == "backward") {
- backward_day();
+ oc_cal_backward_day();
}
- remove_events("oneday");
- load_cal("oneday");
- load_events("oneday");
+ oc_cal_remove_events("oneday");
+ oc_cal_load_cal("oneday");
+ oc_cal_load_events("oneday");
break;
case "oneweekview":
if(task == "forward") {
- forward_week();
+ oc_cal_forward_week();
}
if(task == "backward") {
- backward_week();
+ oc_cal_backward_week();
}
- remove_events("oneweek");
- load_cal("oneweek");
- load_events("oneweek");
+ oc_cal_remove_events("oneweek");
+ oc_cal_load_cal("oneweek");
+ oc_cal_load_events("oneweek");
break;
case "fourweeksview":
if(task == "forward") {
- forward_week();
+ oc_cal_forward_week();
}
if(task == "backward") {
- backward_week();
+ oc_cal_backward_week();
}
- remove_events("fourweeks");
- load_cal("fourweeks");
- load_events("fourweeks");
+ oc_cal_remove_events("fourweeks");
+ oc_cal_load_cal("fourweeks");
+ oc_cal_load_events("fourweeks");
break;
case "onemonthview":
if(task == "forward") {
- forward_month();
+ oc_cal_forward_month();
}
if(task == "backward") {
- backward_month();
+ oc_cal_backward_month();
}
- remove_events("onemonth");
- load_cal("onemonth");
- load_events("onemonth");
+ oc_cal_remove_events("onemonth");
+ oc_cal_load_cal("onemonth");
+ oc_cal_load_events("onemonth");
break;
case "listview":
if(task == "forward") {
- forward_day();
+ oc_cal_forward_day();
}
if(task == "backward") {
- backward_day();
+ oc_cal_backward_day();
}
- remove_events("list");
- load_cal("list");
- load_events("list");
+ oc_cal_remove_events("list");
+ oc_cal_load_cal("list");
+ oc_cal_load_events("list");
break;
default:
- return false;
+ break;
+ }
+ if(oc_cal_month == 0){
+ oc_cal_update_eventsvar(oc_cal_year - 1);
+ }
+ if(oc_cal_month == 11){
+ oc_cal_update_eventsvar(oc_cal_year + 1);
}
}
-function listview(task) {
+function oc_cal_listview(task) {
if(task == "forward") {
- forward_day();
+ oc_cal_forward_day();
}
if(task == "backward") {
- backward_day();
+ oc_cal_backward_day();
}
- document.getElementById("datecontrol_date_label").innerHTML = dayshort[dayofweek] + space + dayofmonth + space + monthshort[month] + space + year;
+ document.getElementById("datecontrol_date").value = dayshort[dayofweek] + space + dayofmonth + space + monthshort[month] + space + year;
}
-function forward_day() {
- if(checkforleapyear(year) == true) {
- var cal = leap_cal;
+function oc_cal_forward_day() {
+ if(oc_cal_checkforleapyear(oc_cal_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
- }
- if(dayofmonth == cal[month]) {
- if(month == 11) {
- date.setFullYear(year++, month = 0, dayofmonth = 1);
- if(dayofweek == 6) {
- dayofweek = 0;
+ var cal = oc_cal_normal_cal;
+ }
+ if(oc_cal_dayofmonth == cal[oc_cal_month]) {
+ if(oc_cal_month == 11) {
+ oc_cal_year++;
+ oc_cal_month = 0;
+ oc_cal_dayofmonth = 1;
+ if(oc_cal_dayofweek == 6) {
+ oc_cal_dayofweek = 0;
} else {
- dayofweek++;
+ oc_cal_dayofweek++;
}
} else {
- date.setMonth(month++, dayofmonth = 1);
- if(dayofweek == 6) {
- dayofweek = 0;
+ oc_cal_month++;
+ oc_cal_dayofmonth = 1;
+ if(oc_cal_dayofweek == 6) {
+ oc_cal_dayofweek = 0;
} else {
- dayofweek++;
+ oc_cal_dayofweek++;
}
}
} else {
- date.setDate(dayofmonth++);
- if(dayofweek == 6) {
- dayofweek = 0;
+ oc_cal_dayofmonth++;
+ if(oc_cal_dayofweek == 6) {
+ oc_cal_dayofweek = 0;
} else {
- dayofweek++;
+ oc_cal_dayofweek++;
}
}
- if(month == 11) {
- update_eventsvar(year + 1);
- }
}
-function forward_week() {
+function oc_cal_forward_week() {
for(var i = 1; i <= 7; i++) {
- forward_day();
+ oc_cal_forward_day();
}
}
-function forward_month() {
- if(checkforleapyear(year) == true) {
- var cal = leap_cal;
+function oc_cal_forward_month() {
+ if(oc_cal_checkforleapyear(oc_cal_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
- for(var i = 1; i <= cal[month]; i++) {
- forward_day();
+ for(var i = 1; i <= cal[oc_cal_month]; i++) {
+ oc_cal_forward_day();
}
}
-function backward_day() {
- if(checkforleapyear(year) == true) {
- var cal = leap_cal;
+function oc_cal_backward_day() {
+ if(oc_cal_checkforleapyear(oc_cal_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
- }
- if(dayofmonth == 1) {
- if(month == 0) {
- date.setFullYear(year--, month = 11, dayofmonth = 31);
- if(dayofweek == 0) {
- dayofweek = 6;
+ var cal = oc_cal_normal_cal;
+ }
+ if(oc_cal_dayofmonth == 1) {
+ if(oc_cal_month == 0) {
+ oc_cal_year--;
+ oc_cal_month = 11;
+ oc_cal_dayofmonth = 31
+ if(oc_cal_dayofweek == 0) {
+ oc_cal_dayofweek = 6;
} else {
- dayofweek--;
+ oc_cal_dayofweek--;
}
} else {
- date.setMonth(month--, dayofmonth = cal[month]);
- if(dayofweek == 0) {
- dayofweek = 6;
+ oc_cal_month--;
+ oc_cal_dayofmonth = cal[oc_cal_month];
+ if(oc_cal_dayofweek == 0) {
+ oc_cal_dayofweek = 6;
} else {
- dayofweek--;
+ oc_cal_dayofweek--;
}
}
} else {
- date.setDate(dayofmonth--);
- if(dayofweek == 0) {
- dayofweek = 6;
+ oc_cal_dayofmonth--;
+ if(oc_cal_dayofweek == 0) {
+ oc_cal_dayofweek = 6;
} else {
- dayofweek--;
+ oc_cal_dayofweek--;
}
}
- if(month == 0) {
- update_eventsvar( year - 1);
- }
}
-function backward_week() {
+function oc_cal_backward_week() {
for(var i = 1; i <= 7; i++) {
- backward_day();
+ oc_cal_backward_day();
}
}
-function backward_month() {
- if(checkforleapyear(year) == true) {
- var cal = leap_cal;
+function oc_cal_backward_month() {
+ if(oc_cal_checkforleapyear(oc_cal_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
- for(var i = cal[month]; i >= 1; i--) {
- backward_day();
+ for(var i = cal[oc_cal_month]; i >= 1; i--) {
+ oc_cal_backward_day();
}
}
-function generate_dates(view) {
+function oc_cal_generate_dates(view) {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(view == "oneweek") {
- var generate_dayofweek = dayofweek;
- var generate_dayofmonth = dayofmonth;
- var generate_month = month;
- var generate_year = year;
+ var generate_dayofweek = oc_cal_dayofweek;
+ var generate_dayofmonth = oc_cal_dayofmonth;
+ var generate_month = oc_cal_month;
+ var generate_year = oc_cal_year;
var dates = new Array();
if(generate_dayofweek == 0) {
generate_dayofweek = 7;
}
for(var i = generate_dayofweek; i > 1; i--) {
- if(checkforleapyear(generate_year) == true) {
- var cal = leap_cal;
+ if(oc_cal_checkforleapyear(generate_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
if(generate_dayofmonth == 1) {
if(generate_month == 0) {
@@ -286,10 +295,10 @@ function generate_dates(view) {
}
dates[0] = new Array(generate_dayofmonth, generate_month, generate_year);
for(var i = 1; i <= 6; i++) {
- if(checkforleapyear(generate_year) == true) {
- var cal = leap_cal;
+ if(oc_cal_checkforleapyear(generate_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
if(generate_dayofmonth == cal[generate_month]) {
if(generate_month == 11) {
@@ -309,19 +318,19 @@ function generate_dates(view) {
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(view == "fourweeks") {
- var generate_dayofweek = dayofweek;
- var generate_dayofmonth = dayofmonth;
- var generate_month = month;
- var generate_year = year;
+ var generate_dayofweek = oc_cal_dayofweek;
+ var generate_dayofmonth = oc_cal_dayofmonth;
+ var generate_month = oc_cal_month;
+ var generate_year = oc_cal_year;
var dates = new Array();
if(generate_dayofweek == 0) {
generate_dayofweek = 7;
}
for(var i = generate_dayofweek; i > 1; i--) {
- if(checkforleapyear(generate_year) == true) {
- var cal = leap_cal;
+ if(oc_cal_checkforleapyear(generate_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
if(generate_dayofmonth == 1) {
if(generate_month == 0) {
@@ -339,10 +348,10 @@ function generate_dates(view) {
}
dates[0] = new Array(generate_dayofmonth, generate_month, generate_year);
for(var i = 1; i <= 27; i++) {
- if(checkforleapyear(generate_year) == true) {
- var cal = leap_cal;
+ if(oc_cal_checkforleapyear(generate_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
if(generate_dayofmonth == cal[generate_month]) {
if(generate_month == 11) {
@@ -362,16 +371,16 @@ function generate_dates(view) {
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(view == "onemonth") {
- var generate_dayofweek = dayofweek;
- var generate_dayofmonth = dayofmonth;
- var generate_month = month;
- var generate_year = year;
+ var generate_dayofweek = oc_cal_dayofweek;
+ var generate_dayofmonth = oc_cal_dayofmonth;
+ var generate_month = oc_cal_month;
+ var generate_year = oc_cal_year;
var dates = new Array();
for(var i = generate_dayofmonth; i > 1; i--) {
- if(checkforleapyear(generate_year) == true) {
- var cal = leap_cal;
+ if(oc_cal_checkforleapyear(generate_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
if(generate_dayofmonth == 1) {
if(generate_month == 0) {
@@ -393,13 +402,13 @@ function generate_dates(view) {
}
if(generate_dayofweek == 0) {
generate_dayofweek = 7;
- rows++;
+ oc_cal_rows++;
}
for(var i = generate_dayofweek; i > 1; i--) {
- if(checkforleapyear(generate_year) == true) {
- var cal = leap_cal;
+ if(oc_cal_checkforleapyear(generate_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
if(generate_dayofmonth == 1) {
if(generate_month == 0) {
@@ -417,10 +426,10 @@ function generate_dates(view) {
}
dates[0] = new Array(generate_dayofmonth, generate_month, generate_year);
for(var i = 1; i <= 41; i++) {
- if(checkforleapyear(generate_year) == true) {
- var cal = leap_cal;
+ if(oc_cal_checkforleapyear(generate_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
if(generate_dayofmonth == cal[generate_month]) {
if(generate_month == 11) {
@@ -442,20 +451,16 @@ function generate_dates(view) {
}
}
-function switch2today() {
- date = today;
- dayofweek = todaydayofweek;
- month = todaymonth;
- dayofmonth = todaydayofmonth;
- year = todayyear;
- update_view('', '');
-}
-
-function load_events(view, date) {
-
+function oc_cal_switch2today() {
+ oc_cal_date = oc_cal_today;
+ oc_cal_dayofweek = oc_cal_todaydayofweek;
+ oc_cal_month = oc_cal_todaymonth;
+ oc_cal_dayofmonth = oc_cal_todaydayofmonth;
+ oc_cal_year = oc_cal_todayyear;
+ oc_cal_update_view('', '');
}
-function update_eventsvar(loadyear) {
+function oc_cal_update_eventsvar(loadyear) {
$("#js_events").load(oc_webroot + "/apps/calendar/ajax/ajax.php?task=load_events&year=" + loadyear);
if(document.getElementById("js_events").innerHTML == "nosession") {
alert("You are not logged in. That can happen if you don't use owncloud for a long time.");
@@ -470,35 +475,35 @@ function update_eventsvar(loadyear) {
}
}
-function load_cal(loadview) {
+function oc_cal_load_cal(loadview) {
if(loadview == "oneday") {
- document.getElementById("datecontrol_date_label").innerHTML = dayshort[dayofweek] + space + dayofmonth + space + monthshort[month] + space + year;
- document.getElementById("onedayview_today").innerHTML = daylong[dayofweek] + space + dayofmonth + space + monthshort[month];
+ document.getElementById("datecontrol_date").value = oc_cal_dayshort[oc_cal_dayofweek] + oc_cal_space + oc_cal_dayofmonth + oc_cal_space + oc_cal_monthshort[oc_cal_month] + oc_cal_space + oc_cal_year;
+ document.getElementById("onedayview_today").innerHTML = oc_cal_daylong[oc_cal_dayofweek] + oc_cal_space + oc_cal_dayofmonth + oc_cal_space + oc_cal_monthshort[oc_cal_month];
}
if(loadview == "oneweek") {
- document.getElementById("datecontrol_date_label").innerHTML = "CW: " + calw();
- var dates = generate_dates("oneweek");
- document.getElementById("oneweekview_monday").innerHTML = dayshort[1] + space + dates[0][0] + space + monthshort[dates[0][1]];
- document.getElementById("oneweekview_tuesday").innerHTML = dayshort[2] + space + dates[1][0] + space + monthshort[dates[1][1]];
- document.getElementById("oneweekview_wednesday").innerHTML = dayshort[3] + space + dates[2][0] + space + monthshort[dates[2][1]];
- document.getElementById("oneweekview_thursday").innerHTML = dayshort[4] + space + dates[3][0] + space + monthshort[dates[3][1]];
- document.getElementById("oneweekview_friday").innerHTML = dayshort[5] + space + dates[4][0] + space + monthshort[dates[4][1]];
- document.getElementById("oneweekview_saturday").innerHTML = dayshort[6] + space + dates[5][0] + space + monthshort[dates[5][1]];
- document.getElementById("oneweekview_sunday").innerHTML = dayshort[0] + space + dates[6][0] + space + monthshort[dates[6][1]];
+ document.getElementById("datecontrol_date").value = "CW: " + oc_cal_calw();
+ var dates = oc_cal_generate_dates("oneweek");
+ document.getElementById("oneweekview_monday").innerHTML = oc_cal_dayshort[1] + oc_cal_space + dates[0][0] + oc_cal_space + oc_cal_monthshort[dates[0][1]];
+ document.getElementById("oneweekview_tuesday").innerHTML = oc_cal_dayshort[2] + oc_cal_space + dates[1][0] + oc_cal_space + oc_cal_monthshort[dates[1][1]];
+ document.getElementById("oneweekview_wednesday").innerHTML = oc_cal_dayshort[3] + oc_cal_space + dates[2][0] + oc_cal_space + oc_cal_monthshort[dates[2][1]];
+ document.getElementById("oneweekview_thursday").innerHTML = oc_cal_dayshort[4] + oc_cal_space + dates[3][0] + oc_cal_space + oc_cal_monthshort[dates[3][1]];
+ document.getElementById("oneweekview_friday").innerHTML = oc_cal_dayshort[5] + oc_cal_space + dates[4][0] + oc_cal_space + oc_cal_monthshort[dates[4][1]];
+ document.getElementById("oneweekview_saturday").innerHTML = oc_cal_dayshort[6] + oc_cal_space + dates[5][0] + oc_cal_space + oc_cal_monthshort[dates[5][1]];
+ document.getElementById("oneweekview_sunday").innerHTML = oc_cal_dayshort[0] + oc_cal_space + dates[6][0] + oc_cal_space + oc_cal_monthshort[dates[6][1]];
}
if(loadview == "fourweeks") {
- var calw1 = calw();
+ var calw1 = oc_cal_calw();
if(calw1 == 52) { //////////////////////////////// !!!! OPTIMIEREN !!!! ///////////////////////////////////////////////////////////
var calw2 = 1;
} else {
- var calw2 = calw() + 1;
+ var calw2 = oc_cal_calw() + 1;
}
if(calw1 == 51) {
var calw3 = 1;
} else if(calw1 == 52) {
var calw3 = 2;
} else {
- var calw3 = calw() + 2;
+ var calw3 = oc_cal_calw() + 2;
}
if(calw1 == 50) {
var calw4 = 1;
@@ -507,53 +512,53 @@ function load_cal(loadview) {
} else if(calw1 == 52) {
var calw4 = 3;
} else {
- var calw4 = calw() + 3;
+ var calw4 = oc_cal_calw() + 3;
}
var calwplusfour = calw4;
- var dates = generate_dates("fourweeks");
- document.getElementById("dateinfo_fourweeksview_monday_1").innerHTML = dates[0][0] + space + monthshort[dates[0][1]];
- document.getElementById("dateinfo_fourweeksview_tuesday_1").innerHTML = dates[1][0] + space + monthshort[dates[1][1]];
- document.getElementById("dateinfo_fourweeksview_wednesday_1").innerHTML = dates[2][0] + space + monthshort[dates[2][1]];
- document.getElementById("dateinfo_fourweeksview_thursday_1").innerHTML = dates[3][0] + space + monthshort[dates[3][1]];
- document.getElementById("dateinfo_fourweeksview_friday_1").innerHTML = dates[4][0] + space + monthshort[dates[4][1]];
- document.getElementById("dateinfo_fourweeksview_saturday_1").innerHTML = dates[5][0] + space + monthshort[dates[5][1]];
- document.getElementById("dateinfo_fourweeksview_sunday_1").innerHTML = dates[6][0] + space + monthshort[dates[6][1]];
- document.getElementById("dateinfo_fourweeksview_monday_2").innerHTML = dates[7][0] + space + monthshort[dates[7][1]];
- document.getElementById("dateinfo_fourweeksview_tuesday_2").innerHTML = dates[8][0] + space + monthshort[dates[8][1]];
- document.getElementById("dateinfo_fourweeksview_wednesday_2").innerHTML = dates[9][0] + space + monthshort[dates[9][1]];
- document.getElementById("dateinfo_fourweeksview_thursday_2").innerHTML = dates[10][0] + space + monthshort[dates[10][1]];
- document.getElementById("dateinfo_fourweeksview_friday_2").innerHTML = dates[11][0] + space + monthshort[dates[11][1]];
- document.getElementById("dateinfo_fourweeksview_saturday_2").innerHTML = dates[12][0] + space + monthshort[dates[12][1]];
- document.getElementById("dateinfo_fourweeksview_sunday_2").innerHTML = dates[13][0] + space + monthshort[dates[13][1]];
- document.getElementById("dateinfo_fourweeksview_monday_3").innerHTML = dates[14][0] + space + monthshort[dates[14][1]];
- document.getElementById("dateinfo_fourweeksview_tuesday_3").innerHTML = dates[15][0] + space + monthshort[dates[15][1]];
- document.getElementById("dateinfo_fourweeksview_wednesday_3").innerHTML = dates[16][0] + space + monthshort[dates[16][1]];
- document.getElementById("dateinfo_fourweeksview_thursday_3").innerHTML = dates[17][0] + space + monthshort[dates[17][1]];
- document.getElementById("dateinfo_fourweeksview_friday_3").innerHTML = dates[18][0] + space + monthshort[dates[18][1]];
- document.getElementById("dateinfo_fourweeksview_saturday_3").innerHTML = dates[19][0] + space + monthshort[dates[19][1]];
- document.getElementById("dateinfo_fourweeksview_sunday_3").innerHTML = dates[20][0] + space + monthshort[dates[20][1]];
- document.getElementById("dateinfo_fourweeksview_monday_4").innerHTML = dates[21][0] + space + monthshort[dates[21][1]];
- document.getElementById("dateinfo_fourweeksview_tuesday_4").innerHTML = dates[22][0] + space + monthshort[dates[22][1]];
- document.getElementById("dateinfo_fourweeksview_wednesday_4").innerHTML = dates[23][0] + space + monthshort[dates[23][1]];
- document.getElementById("dateinfo_fourweeksview_thursday_4").innerHTML = dates[24][0] + space + monthshort[dates[24][1]];
- document.getElementById("dateinfo_fourweeksview_friday_4").innerHTML = dates[25][0] + space + monthshort[dates[25][1]];
- document.getElementById("dateinfo_fourweeksview_saturday_4").innerHTML = dates[26][0] + space + monthshort[dates[26][1]];
- document.getElementById("dateinfo_fourweeksview_sunday_4").innerHTML = dates[27][0] + space + monthshort[dates[27][1]];
+ var dates = oc_cal_generate_dates("fourweeks");
+ document.getElementById("dateinfo_fourweeksview_monday_1").innerHTML = dates[0][0] + oc_cal_space + oc_cal_monthshort[dates[0][1]];
+ document.getElementById("dateinfo_fourweeksview_tuesday_1").innerHTML = dates[1][0] + oc_cal_space + oc_cal_monthshort[dates[1][1]];
+ document.getElementById("dateinfo_fourweeksview_wednesday_1").innerHTML = dates[2][0] + oc_cal_space + oc_cal_monthshort[dates[2][1]];
+ document.getElementById("dateinfo_fourweeksview_thursday_1").innerHTML = dates[3][0] + oc_cal_space + oc_cal_monthshort[dates[3][1]];
+ document.getElementById("dateinfo_fourweeksview_friday_1").innerHTML = dates[4][0] + oc_cal_space + oc_cal_monthshort[dates[4][1]];
+ document.getElementById("dateinfo_fourweeksview_saturday_1").innerHTML = dates[5][0] + oc_cal_space + oc_cal_monthshort[dates[5][1]];
+ document.getElementById("dateinfo_fourweeksview_sunday_1").innerHTML = dates[6][0] + oc_cal_space + oc_cal_monthshort[dates[6][1]];
+ document.getElementById("dateinfo_fourweeksview_monday_2").innerHTML = dates[7][0] + oc_cal_space + oc_cal_monthshort[dates[7][1]];
+ document.getElementById("dateinfo_fourweeksview_tuesday_2").innerHTML = dates[8][0] + oc_cal_space + oc_cal_monthshort[dates[8][1]];
+ document.getElementById("dateinfo_fourweeksview_wednesday_2").innerHTML = dates[9][0] + oc_cal_space + oc_cal_monthshort[dates[9][1]];
+ document.getElementById("dateinfo_fourweeksview_thursday_2").innerHTML = dates[10][0] + oc_cal_space + oc_cal_monthshort[dates[10][1]];
+ document.getElementById("dateinfo_fourweeksview_friday_2").innerHTML = dates[11][0] + oc_cal_space + oc_cal_monthshort[dates[11][1]];
+ document.getElementById("dateinfo_fourweeksview_saturday_2").innerHTML = dates[12][0] + oc_cal_space + oc_cal_monthshort[dates[12][1]];
+ document.getElementById("dateinfo_fourweeksview_sunday_2").innerHTML = dates[13][0] + oc_cal_space + oc_cal_monthshort[dates[13][1]];
+ document.getElementById("dateinfo_fourweeksview_monday_3").innerHTML = dates[14][0] + oc_cal_space + oc_cal_monthshort[dates[14][1]];
+ document.getElementById("dateinfo_fourweeksview_tuesday_3").innerHTML = dates[15][0] + oc_cal_space + oc_cal_monthshort[dates[15][1]];
+ document.getElementById("dateinfo_fourweeksview_wednesday_3").innerHTML = dates[16][0] + oc_cal_space + oc_cal_monthshort[dates[16][1]];
+ document.getElementById("dateinfo_fourweeksview_thursday_3").innerHTML = dates[17][0] + oc_cal_space + oc_cal_monthshort[dates[17][1]];
+ document.getElementById("dateinfo_fourweeksview_friday_3").innerHTML = dates[18][0] + oc_cal_space + oc_cal_monthshort[dates[18][1]];
+ document.getElementById("dateinfo_fourweeksview_saturday_3").innerHTML = dates[19][0] + oc_cal_space + oc_cal_monthshort[dates[19][1]];
+ document.getElementById("dateinfo_fourweeksview_sunday_3").innerHTML = dates[20][0] + oc_cal_space + oc_cal_monthshort[dates[20][1]];
+ document.getElementById("dateinfo_fourweeksview_monday_4").innerHTML = dates[21][0] + oc_cal_space + oc_cal_monthshort[dates[21][1]];
+ document.getElementById("dateinfo_fourweeksview_tuesday_4").innerHTML = dates[22][0] + oc_cal_space + oc_cal_monthshort[dates[22][1]];
+ document.getElementById("dateinfo_fourweeksview_wednesday_4").innerHTML = dates[23][0] + oc_cal_space + oc_cal_monthshort[dates[23][1]];
+ document.getElementById("dateinfo_fourweeksview_thursday_4").innerHTML = dates[24][0] + oc_cal_space + oc_cal_monthshort[dates[24][1]];
+ document.getElementById("dateinfo_fourweeksview_friday_4").innerHTML = dates[25][0] + oc_cal_space + oc_cal_monthshort[dates[25][1]];
+ document.getElementById("dateinfo_fourweeksview_saturday_4").innerHTML = dates[26][0] + oc_cal_space + oc_cal_monthshort[dates[26][1]];
+ document.getElementById("dateinfo_fourweeksview_sunday_4").innerHTML = dates[27][0] + oc_cal_space + oc_cal_monthshort[dates[27][1]];
document.getElementById("fourweeksview_calw1").innerHTML = calw1;
document.getElementById("fourweeksview_calw2").innerHTML = calw2;
document.getElementById("fourweeksview_calw3").innerHTML = calw3;
document.getElementById("fourweeksview_calw4").innerHTML = calw4;
- document.getElementById("datecontrol_date_label").innerHTML = "CWs: " + calw() + " - " + calwplusfour;
+ document.getElementById("datecontrol_date").value = "CWs: " + oc_cal_calw() + " - " + calwplusfour;
}
if(loadview == "onemonth") {
- document.getElementById("datecontrol_date_label").innerHTML = monthlong[month] + space + year;
- if(checkforleapyear(year) == true) {
- var cal = leap_cal;
+ document.getElementById("datecontrol_date").value = oc_cal_monthlong[oc_cal_month] + oc_cal_space + oc_cal_year;
+ if(oc_cal_checkforleapyear(oc_cal_year) == true) {
+ var cal = oc_cal_leap_cal;
} else {
- var cal = normal_cal;
+ var cal = oc_cal_normal_cal;
}
- var monthview_dayofweek = dayofweek;
- var monthview_dayofmonth = dayofmonth;
+ var monthview_dayofweek = oc_cal_dayofweek;
+ var monthview_dayofmonth = oc_cal_dayofmonth;
for(var i = monthview_dayofmonth; i > 1; i--) {
if(monthview_dayofweek == 0) {
monthview_dayofweek = 6;
@@ -563,89 +568,89 @@ function load_cal(loadview) {
}
document.getElementById("onemonthview_week_5").style.display = "none";
document.getElementById("onemonthview_week_6").style.display = "none";
- rows = parseInt(monthview_dayofweek) + parseInt(cal[month]);
- rows = rows / 7;
- rows = Math.ceil(rows);
- var dates = generate_dates("onemonth");
- document.getElementById("dateinfo_onemonthview_monday_1").innerHTML = dates[0][0] + space + monthshort[dates[0][1]];
- document.getElementById("dateinfo_onemonthview_tuesday_1").innerHTML = dates[1][0] + space + monthshort[dates[1][1]];
- document.getElementById("dateinfo_onemonthview_wednesday_1").innerHTML = dates[2][0] + space + monthshort[dates[2][1]];
- document.getElementById("dateinfo_onemonthview_thursday_1").innerHTML = dates[3][0] + space + monthshort[dates[3][1]];
- document.getElementById("dateinfo_onemonthview_friday_1").innerHTML = dates[4][0] + space + monthshort[dates[4][1]];
- document.getElementById("dateinfo_onemonthview_saturday_1").innerHTML = dates[5][0] + space + monthshort[dates[5][1]];
- document.getElementById("dateinfo_onemonthview_sunday_1").innerHTML = dates[6][0] + space + monthshort[dates[6][1]];
- document.getElementById("dateinfo_onemonthview_monday_2").innerHTML = dates[7][0] + space + monthshort[dates[7][1]];
- document.getElementById("dateinfo_onemonthview_tuesday_2").innerHTML = dates[8][0] + space + monthshort[dates[8][1]];
- document.getElementById("dateinfo_onemonthview_wednesday_2").innerHTML = dates[9][0] + space + monthshort[dates[9][1]];
- document.getElementById("dateinfo_onemonthview_thursday_2").innerHTML = dates[10][0] + space + monthshort[dates[10][1]];
- document.getElementById("dateinfo_onemonthview_friday_2").innerHTML = dates[11][0] + space + monthshort[dates[11][1]];
- document.getElementById("dateinfo_onemonthview_saturday_2").innerHTML = dates[12][0] + space + monthshort[dates[12][1]];
- document.getElementById("dateinfo_onemonthview_sunday_2").innerHTML = dates[13][0] + space + monthshort[dates[13][1]];
- document.getElementById("dateinfo_onemonthview_monday_3").innerHTML = dates[14][0] + space + monthshort[dates[14][1]];
- document.getElementById("dateinfo_onemonthview_tuesday_3").innerHTML = dates[15][0] + space + monthshort[dates[15][1]];
- document.getElementById("dateinfo_onemonthview_wednesday_3").innerHTML = dates[16][0] + space + monthshort[dates[16][1]];
- document.getElementById("dateinfo_onemonthview_thursday_3").innerHTML = dates[17][0] + space + monthshort[dates[17][1]];
- document.getElementById("dateinfo_onemonthview_friday_3").innerHTML = dates[18][0] + space + monthshort[dates[18][1]];
- document.getElementById("dateinfo_onemonthview_saturday_3").innerHTML = dates[19][0] + space + monthshort[dates[19][1]];
- document.getElementById("dateinfo_onemonthview_sunday_3").innerHTML = dates[20][0] + space + monthshort[dates[20][1]];
- document.getElementById("dateinfo_onemonthview_monday_4").innerHTML = dates[21][0] + space + monthshort[dates[21][1]];
- document.getElementById("dateinfo_onemonthview_tuesday_4").innerHTML = dates[22][0] + space + monthshort[dates[22][1]];
- document.getElementById("dateinfo_onemonthview_wednesday_4").innerHTML = dates[23][0] + space + monthshort[dates[23][1]];
- document.getElementById("dateinfo_onemonthview_thursday_4").innerHTML = dates[24][0] + space + monthshort[dates[24][1]];
- document.getElementById("dateinfo_onemonthview_friday_4").innerHTML = dates[25][0] + space + monthshort[dates[25][1]];
- document.getElementById("dateinfo_onemonthview_saturday_4").innerHTML = dates[26][0] + space + monthshort[dates[26][1]];
- document.getElementById("dateinfo_onemonthview_sunday_4").innerHTML = dates[27][0] + space + monthshort[dates[27][1]];
- document.getElementById("dateinfo_onemonthview_monday_5").innerHTML = dates[28][0] + space + monthshort[dates[28][1]];
- document.getElementById("dateinfo_onemonthview_tuesday_5").innerHTML = dates[29][0] + space + monthshort[dates[29][1]];
- document.getElementById("dateinfo_onemonthview_wednesday_5").innerHTML = dates[30][0] + space + monthshort[dates[30][1]];
- document.getElementById("dateinfo_onemonthview_thursday_5").innerHTML = dates[31][0] + space + monthshort[dates[31][1]];
- document.getElementById("dateinfo_onemonthview_friday_5").innerHTML = dates[32][0] + space + monthshort[dates[32][1]];
- document.getElementById("dateinfo_onemonthview_saturday_5").innerHTML = dates[33][0] + space + monthshort[dates[33][1]];
- document.getElementById("dateinfo_onemonthview_sunday_5").innerHTML = dates[34][0] + space + monthshort[dates[34][1]];
- document.getElementById("dateinfo_onemonthview_monday_6").innerHTML = dates[35][0] + space + monthshort[dates[35][1]];
- document.getElementById("dateinfo_onemonthview_tuesday_6").innerHTML = dates[36][0] + space + monthshort[dates[36][1]];
- document.getElementById("dateinfo_onemonthview_wednesday_6").innerHTML = dates[37][0] + space + monthshort[dates[37][1]];
- document.getElementById("dateinfo_onemonthview_thursday_6").innerHTML = dates[38][0] + space + monthshort[dates[38][1]];
- document.getElementById("dateinfo_onemonthview_friday_6").innerHTML = dates[39][0] + space + monthshort[dates[39][1]];
- document.getElementById("dateinfo_onemonthview_saturday_6").innerHTML = dates[40][0] + space + monthshort[dates[40][1]];
- document.getElementById("dateinfo_onemonthview_sunday_6").innerHTML = dates[41][0] + space + monthshort[dates[41][1]];
- if(rows == 5) {
+ oc_cal_rows = parseInt(monthview_dayofweek) + parseInt(cal[oc_cal_month]);
+ oc_cal_rows = oc_cal_rows / 7;
+ oc_cal_rows = Math.ceil(oc_cal_rows);
+ var dates = oc_cal_generate_dates("onemonth");
+ document.getElementById("dateinfo_onemonthview_monday_1").innerHTML = dates[0][0] + oc_cal_space + oc_cal_monthshort[dates[0][1]];
+ document.getElementById("dateinfo_onemonthview_tuesday_1").innerHTML = dates[1][0] + oc_cal_space + oc_cal_monthshort[dates[1][1]];
+ document.getElementById("dateinfo_onemonthview_wednesday_1").innerHTML = dates[2][0] + oc_cal_space + oc_cal_monthshort[dates[2][1]];
+ document.getElementById("dateinfo_onemonthview_thursday_1").innerHTML = dates[3][0] + oc_cal_space + oc_cal_monthshort[dates[3][1]];
+ document.getElementById("dateinfo_onemonthview_friday_1").innerHTML = dates[4][0] + oc_cal_space + oc_cal_monthshort[dates[4][1]];
+ document.getElementById("dateinfo_onemonthview_saturday_1").innerHTML = dates[5][0] + oc_cal_space + oc_cal_monthshort[dates[5][1]];
+ document.getElementById("dateinfo_onemonthview_sunday_1").innerHTML = dates[6][0] + oc_cal_space + oc_cal_monthshort[dates[6][1]];
+ document.getElementById("dateinfo_onemonthview_monday_2").innerHTML = dates[7][0] + oc_cal_space + oc_cal_monthshort[dates[7][1]];
+ document.getElementById("dateinfo_onemonthview_tuesday_2").innerHTML = dates[8][0] + oc_cal_space + oc_cal_monthshort[dates[8][1]];
+ document.getElementById("dateinfo_onemonthview_wednesday_2").innerHTML = dates[9][0] + oc_cal_space + oc_cal_monthshort[dates[9][1]];
+ document.getElementById("dateinfo_onemonthview_thursday_2").innerHTML = dates[10][0] + oc_cal_space + oc_cal_monthshort[dates[10][1]];
+ document.getElementById("dateinfo_onemonthview_friday_2").innerHTML = dates[11][0] + oc_cal_space + oc_cal_monthshort[dates[11][1]];
+ document.getElementById("dateinfo_onemonthview_saturday_2").innerHTML = dates[12][0] + oc_cal_space + oc_cal_monthshort[dates[12][1]];
+ document.getElementById("dateinfo_onemonthview_sunday_2").innerHTML = dates[13][0] + oc_cal_space + oc_cal_monthshort[dates[13][1]];
+ document.getElementById("dateinfo_onemonthview_monday_3").innerHTML = dates[14][0] + oc_cal_space + oc_cal_monthshort[dates[14][1]];
+ document.getElementById("dateinfo_onemonthview_tuesday_3").innerHTML = dates[15][0] + oc_cal_space + oc_cal_monthshort[dates[15][1]];
+ document.getElementById("dateinfo_onemonthview_wednesday_3").innerHTML = dates[16][0] + oc_cal_space + oc_cal_monthshort[dates[16][1]];
+ document.getElementById("dateinfo_onemonthview_thursday_3").innerHTML = dates[17][0] + oc_cal_space + oc_cal_monthshort[dates[17][1]];
+ document.getElementById("dateinfo_onemonthview_friday_3").innerHTML = dates[18][0] + oc_cal_space + oc_cal_monthshort[dates[18][1]];
+ document.getElementById("dateinfo_onemonthview_saturday_3").innerHTML = dates[19][0] + oc_cal_space + oc_cal_monthshort[dates[19][1]];
+ document.getElementById("dateinfo_onemonthview_sunday_3").innerHTML = dates[20][0] + oc_cal_space + oc_cal_monthshort[dates[20][1]];
+ document.getElementById("dateinfo_onemonthview_monday_4").innerHTML = dates[21][0] + oc_cal_space + oc_cal_monthshort[dates[21][1]];
+ document.getElementById("dateinfo_onemonthview_tuesday_4").innerHTML = dates[22][0] + oc_cal_space + oc_cal_monthshort[dates[22][1]];
+ document.getElementById("dateinfo_onemonthview_wednesday_4").innerHTML = dates[23][0] + oc_cal_space + oc_cal_monthshort[dates[23][1]];
+ document.getElementById("dateinfo_onemonthview_thursday_4").innerHTML = dates[24][0] + oc_cal_space + oc_cal_monthshort[dates[24][1]];
+ document.getElementById("dateinfo_onemonthview_friday_4").innerHTML = dates[25][0] + oc_cal_space + oc_cal_monthshort[dates[25][1]];
+ document.getElementById("dateinfo_onemonthview_saturday_4").innerHTML = dates[26][0] + oc_cal_space + oc_cal_monthshort[dates[26][1]];
+ document.getElementById("dateinfo_onemonthview_sunday_4").innerHTML = dates[27][0] + oc_cal_space + oc_cal_monthshort[dates[27][1]];
+ document.getElementById("dateinfo_onemonthview_monday_5").innerHTML = dates[28][0] + oc_cal_space + oc_cal_monthshort[dates[28][1]];
+ document.getElementById("dateinfo_onemonthview_tuesday_5").innerHTML = dates[29][0] + oc_cal_space + oc_cal_monthshort[dates[29][1]];
+ document.getElementById("dateinfo_onemonthview_wednesday_5").innerHTML = dates[30][0] + oc_cal_space + oc_cal_monthshort[dates[30][1]];
+ document.getElementById("dateinfo_onemonthview_thursday_5").innerHTML = dates[31][0] + oc_cal_space + oc_cal_monthshort[dates[31][1]];
+ document.getElementById("dateinfo_onemonthview_friday_5").innerHTML = dates[32][0] + oc_cal_space + oc_cal_monthshort[dates[32][1]];
+ document.getElementById("dateinfo_onemonthview_saturday_5").innerHTML = dates[33][0] + oc_cal_space + oc_cal_monthshort[dates[33][1]];
+ document.getElementById("dateinfo_onemonthview_sunday_5").innerHTML = dates[34][0] + oc_cal_space + oc_cal_monthshort[dates[34][1]];
+ document.getElementById("dateinfo_onemonthview_monday_6").innerHTML = dates[35][0] + oc_cal_space + oc_cal_monthshort[dates[35][1]];
+ document.getElementById("dateinfo_onemonthview_tuesday_6").innerHTML = dates[36][0] + oc_cal_space + oc_cal_monthshort[dates[36][1]];
+ document.getElementById("dateinfo_onemonthview_wednesday_6").innerHTML = dates[37][0] + oc_cal_space + oc_cal_monthshort[dates[37][1]];
+ document.getElementById("dateinfo_onemonthview_thursday_6").innerHTML = dates[38][0] + oc_cal_space + oc_cal_monthshort[dates[38][1]];
+ document.getElementById("dateinfo_onemonthview_friday_6").innerHTML = dates[39][0] + oc_cal_space + oc_cal_monthshort[dates[39][1]];
+ document.getElementById("dateinfo_onemonthview_saturday_6").innerHTML = dates[40][0] + oc_cal_space + oc_cal_monthshort[dates[40][1]];
+ document.getElementById("dateinfo_onemonthview_sunday_6").innerHTML = dates[41][0] + oc_cal_space + oc_cal_monthshort[dates[41][1]];
+ if(oc_cal_rows == 5) {
document.getElementById("onemonthview_week_5").style.display = "table-row";
}
- if(rows == 6) {
+ if(oc_cal_rows == 6) {
document.getElementById("onemonthview_week_5").style.display = "table-row";
document.getElementById("onemonthview_week_6").style.display = "table-row";
}
}
if(loadview == "list") {
- document.getElementById("datecontrol_date_label").innerHTML = dayshort[dayofweek] + space + dayofmonth + space + monthshort[month] + space + year;
+ document.getElementById("datecontrol_date").value = oc_cal_dayshort[oc_cal_dayofweek] + oc_cal_space + oc_cal_dayofmonth + oc_cal_space + oc_cal_monthshort[oc_cal_month] + oc_cal_space + oc_cal_year;
}
}
-function load_events(loadview) {
+function oc_cal_load_events(loadview) {
if(loadview == "oneday") {
- if( typeof (events[year][month][dayofmonth]) != "undefined") {
- if( typeof (events[year][month][dayofmonth]["allday"]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][oc_cal_month][oc_cal_dayofmonth]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][oc_cal_month][oc_cal_dayofmonth]["allday"]) != "undefined") {
var eventnumber = 1;
var eventcontainer = document.getElementById("onedayview_wholeday");
- while( typeof (events[year][month][dayofmonth]["allday"][eventnumber]) != "undefined") {
+ while( typeof (oc_cal_events[oc_cal_year][oc_cal_month][oc_cal_dayofmonth]["allday"][eventnumber]) != "undefined") {
var newp = document.createElement("p");
newp.id = "onedayview_allday_" + eventnumber;
newp.className = "onedayview_event";
eventcontainer.appendChild(newp);
- document.getElementById("onedayview_allday_" + eventnumber).innerHTML = events[year][month][dayofmonth]["allday"][eventnumber]["description"];
+ document.getElementById("onedayview_allday_" + eventnumber).innerHTML = events[oc_cal_year][oc_cal_month][oc_cal_dayofmonth]["allday"][eventnumber]["description"];
eventnumber++;
}
}
for( i = 0; i <= 23; i++) {
- if( typeof (events[year][month][dayofmonth][i]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][oc_cal_month][oc_cal_dayofmonth][i]) != "undefined") {
var eventnumber = 1;
- while( typeof (events[year][month][dayofmonth][i][eventnumber]) != "undefined") {
+ while( typeof (oc_cal_events[oc_cal_year][oc_cal_month][oc_cal_dayofmonth][i][eventnumber]) != "undefined") {
var newp = document.createElement("p");
newp.id = "onedayview_" + i + "_" + eventnumber;
newp.className = "onedayview_event";
eventcontainer.appendChild(newp);
- document.getElementById("onedayview_" + i + "_" + eventnumber).innerHTML = events[year][month][dayofmonth][i][eventnumber]["description"];
+ document.getElementById("onedayview_" + i + "_" + eventnumber).innerHTML = events[oc_cal_year][oc_cal_month][oc_cal_dayofmonth][i][eventnumber]["description"];
eventnumber++;
}
}
@@ -654,35 +659,35 @@ function load_events(loadview) {
}
if(loadview == "oneweek") {//(generate_dayofmonth, generate_month, generate_year);
var weekdays = new Array("monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday");
- var dates = generate_dates("oneweek");
+ var dates = oc_cal_generate_dates("oneweek");
document.getElementById("devbox").innerHTML = "";
for(var i = 0; i <= 6; i++) {
var loadevents_month = dates[i][0];
var loadevents_days = dates[i][1];
- if( typeof (events[year][loadevents_month]) != "undefined") {
- if( typeof (events[year][loadevents_month][loadevents_days]) != "undefined") {
- if( typeof (events[year][loadevents_month][loadevents_days]["allday"]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"]) != "undefined") {
var eventnumber = 1;
var eventcontainer = document.getElementById("oneweekview_" + weekdays[i] + "_allday");
- while( typeof (events[year][loadevents_month][loadevents_days]["allday"][eventnumber]) != "undefined") {
+ while( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"][eventnumber]) != "undefined") {
var newp = document.createElement("p");
newp.id = "oneweekview_" + weekdays[i] + "_allday_" + eventnumber;
newp.className = "oneweekview_event";
eventcontainer.appendChild(newp);
- document.getElementById("oneweekview_" + weekdays[i] + "_allday_" + eventnumber).innerHTML = events[year][loadevents_month][loadevents_days]["allday"][eventnumber]["description"];
+ document.getElementById("oneweekview_" + weekdays[i] + "_allday_" + eventnumber).innerHTML = oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"][eventnumber]["description"];
eventnumber++;
}
}
for(var time = 0; time <= 23; time++) {
- if( typeof (events[year][loadevents_month][loadevents_days][time]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][time]) != "undefined") {
var eventnumber = 1;
var eventcontainer = document.getElementById("oneweekview_" + weekdays[i] + "_" + time);
- while( typeof (events[year][loadevents_month][loadevents_days][eventnumber]) != "undefined") {
+ while( typeof (oc_cal_events[year][loadevents_month][loadevents_days][eventnumber]) != "undefined") {
var newp = document.createElement("p");
newp.id = "oneweekview_" + i + "_" + eventnumber;
newp.className = "oneweekview_event";
eventcontainer.appendChild(newp);
- document.getElementById("oneweekview_" + i + "_" + eventnumber).innerHTML = events[year][loadevents_month][loadevents_days][i][eventnumber]["description"];
+ document.getElementById("oneweekview_" + i + "_" + eventnumber).innerHTML = oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][i][eventnumber]["description"];
eventnumber++;
}
}
@@ -693,38 +698,38 @@ function load_events(loadview) {
}
if(loadview == "fourweeks") {
var weekdays = new Array("monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday");
- var dates = generate_dates("fourweeks");
+ var dates = oc_cal_generate_dates("fourweeks");
var weekdaynum = 0;
var weeknum = 1;
for(var i = 0; i <= 27; i++) {
var loadevents_month = dates[i][0];
var loadevents_days = dates[i][1];
- if( typeof (events[year][loadevents_month]) != "undefined") {
- if( typeof (events[year][loadevents_month][loadevents_days]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]) != "undefined") {
var pnum = 0;
- if( typeof (events[year][loadevents_month][loadevents_days]["allday"]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"]) != "undefined") {
var eventnumber = 1;
var eventcontainer = document.getElementById("events_fourweeksview_" + weekdays[weekdaynum] + "_" + weeknum);
- while( typeof (events[year][loadevents_month][loadevents_days]["allday"][eventnumber]) != "undefined") {
+ while( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"][eventnumber]) != "undefined") {
var newp = document.createElement("p");
newp.id = "fourweeksview_" + weekdays[weekdaynum] + "_" + weeknum + "_" + pnum;
newp.className = "fourweeksview_event";
eventcontainer.appendChild(newp);
- document.getElementById("fourweeksview_" + weekdays[weekdaynum] + "_" + weeknum + "_" + pnum).innerHTML = events[year][loadevents_month][loadevents_days]["allday"][eventnumber]["description"];
+ document.getElementById("fourweeksview_" + weekdays[weekdaynum] + "_" + weeknum + "_" + pnum).innerHTML = oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"][eventnumber]["description"];
eventnumber++;
pnum++;
}
}
for(var time = 0; time <= 23; time++) {
- if( typeof (events[year][loadevents_month][loadevents_days][time]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][time]) != "undefined") {
var eventnumber = 1;
var eventcontainer = document.getElementById("events_fourweeksview_" + weekdays[weekdaynum] + "_" + weeknum);
- while( typeof (events[year][loadevents_month][loadevents_days][i][eventnumber]) != "undefined") {
+ while( typeof (events[oc_cal_year][loadevents_month][loadevents_days][i][eventnumber]) != "undefined") {
var newp = document.createElement("p");
newp.id = "fourweeksview_" + i + "_" + eventnumber;
newp.className = "fourweeksview_event";
eventcontainer.appendChild(newp);
- document.getElementById("fourweeksview_" + i + "_" + eventnumber).innerHTML = events[year][loadevents_month][loadevents_days][i][eventnumber]["description"];
+ document.getElementById("fourweeksview_" + i + "_" + eventnumber).innerHTML = oc_cal_events[year][loadevents_month][loadevents_days][i][eventnumber]["description"];
eventnumber++;
pnum++;
}
@@ -742,38 +747,38 @@ function load_events(loadview) {
}
if(loadview == "onemonth") {
var weekdays = new Array("monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday");
- var dates = generate_dates("onemonth");
+ var dates = oc_cal_generate_dates("onemonth");
var weekdaynum = 0;
var weeknum = 1;
for(var i = 0; i <= 41; i++) {
var loadevents_month = dates[i][0];
var loadevents_days = dates[i][1];
- if( typeof (events[year][loadevents_month]) != "undefined") {
- if( typeof (events[year][loadevents_month][loadevents_days]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]) != "undefined") {
var pnum = 0;
- if( typeof (events[year][loadevents_month][loadevents_days]["allday"]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"]) != "undefined") {
var eventnumber = 1;
var eventcontainer = document.getElementById("events_onemonthview_" + weekdays[weekdaynum] + "_" + weeknum);
- while( typeof (events[year][loadevents_month][loadevents_days]["allday"][eventnumber]) != "undefined") {
+ while( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"][eventnumber]) != "undefined") {
var newp = document.createElement("p");
newp.id = "onemonthview_" + weekdays[weekdaynum] + "_" + weeknum + "_" + pnum;
newp.className = "onemonthview_event";
eventcontainer.appendChild(newp);
- document.getElementById("onemonthview_" + weekdays[weekdaynum] + "_" + weeknum + "_" + pnum).innerHTML = events[year][loadevents_month][loadevents_days]["allday"][eventnumber]["description"];
+ document.getElementById("onemonthview_" + weekdays[weekdaynum] + "_" + weeknum + "_" + pnum).innerHTML = oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]["allday"][eventnumber]["description"];
eventnumber++;
pnum++;
}
}
for(var time = 0; time <= 23; time++) {
- if( typeof (events[year][loadevents_month][loadevents_days][time]) != "undefined") {
+ if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][time]) != "undefined") {
var eventnumber = 1;
var eventcontainer = document.getElementById("events_onemonthview_" + weekdays[weekdaynum] + "_" + weeknum);
- while( typeof (events[year][loadevents_month][loadevents_days][i][eventnumber]) != "undefined") {
+ while( typeof (oc_cal_events[year][loadevents_month][loadevents_days][i][eventnumber]) != "undefined") {
var newp = document.createElement("p");
newp.id = "onemonthview_" + i + "_" + eventnumber;
newp.className = "onemonthview_event";
eventcontainer.appendChild(newp);
- document.getElementById("onemonthview_" + i + "_" + eventnumber).innerHTML = events[year][loadevents_month][loadevents_days][i][eventnumber]["description"];
+ document.getElementById("onemonthview_" + i + "_" + eventnumber).innerHTML = oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][i][eventnumber]["description"];
eventnumber++;
pnum++;
}
@@ -794,7 +799,7 @@ function load_events(loadview) {
}
}
-function remove_events(removeview) {
+function oc_cal_remove_events(removeview) {
if(removeview == "oneday") {
document.getElementById("onedayview_wholeday").innerHTML = "";
for(var i = 0; i <= 23; i++) {
diff --git a/apps/calendar/js/calendar_dialog.js b/apps/calendar/js/calendar_dialog.js
index fa89c70e847..785cdde44d6 100755
--- a/apps/calendar/js/calendar_dialog.js
+++ b/apps/calendar/js/calendar_dialog.js
@@ -6,7 +6,7 @@
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
- * License: GNU General Public License (GPL) *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* <http://www.gnu.org/licenses/> *
* If you are not able to view the License, *
@@ -25,32 +25,32 @@
* newevent_dialog_submit - submit *
* editevent_dialog_submit - submit *
*************************************************/
-function choosecalendar_dialog() {
+function oc_cal_choosecalendar_dialog() {
$( function() {
$( "#choosecalendar_dialog" ).dialog();
});
}
-function newevent_dialog() {
+function oc_cal_newevent_dialog() {
$( function() {
$( "#newevent" ).dialog();
});
}
-function editevent_dialog() {
+function oc_cal_editevent_dialog() {
$( function() {
$( "#editevent" ).dialog();
});
}
-function choosecalendar_dialog_submit() {
+function oc_cal_choosecalendar_dialog_submit() {
}
-function newevent_dialog_submit() {
+function oc_cal_newevent_dialog_submit() {
}
-function editevent_dialog_submit() {
+function oc_cal_editevent_dialog_submit() {
} \ No newline at end of file
diff --git a/apps/calendar/js/calendar_init.js b/apps/calendar/js/calendar_init.js
index 89fbe01b364..7c1303b9c25 100755
--- a/apps/calendar/js/calendar_init.js
+++ b/apps/calendar/js/calendar_init.js
@@ -1,61 +1,55 @@
-/************************************************
-* ownCloud - Calendar Plugin *
-* *
-* (c) Copyright 2011 Georg Ehrke *
-* author: Georg Ehrke *
-* email: ownclouddev at georgswebsite dot de *
-* homepage: http://ownclouddev.georgswebsite.de *
-* License: GPL *
-* <http://www.gnu.org/licenses/>. *
-************************************************/
+/*************************************************
+ * ownCloud - Calendar Plugin *
+ * *
+ * (c) Copyright 2011 Georg Ehrke *
+ * author: Georg Ehrke *
+ * email: ownclouddev at georgswebsite dot de *
+ * homepage: ownclouddev.georgswebsite.de *
+ * manual: ownclouddev.georgswebsite.de/manual *
+ * License: GNU AFFERO GENERAL PUBLIC LICENSE *
+ * *
+ * <http://www.gnu.org/licenses/> *
+ * If you are not able to view the License, *
+ * <http://www.gnu.org/licenses/> *
+ * <http://ownclouddev.georgswebsite.de/license/> *
+ * please write to the Free Software Foundation. *
+ * Address: *
+ * 59 Temple Place, Suite 330, Boston, *
+ * MA 02111-1307 USA *
+ *************************************************/
//loading Buttons
$(function(){
- $("#view").buttonset();
$("#choosecalendar").buttonset();
- $("#datecontrol_left").button();
- $("#datecontrol_left").button({ disabled: true });
- $("#datecontrol_date").button();
- $("#datecontrol_right").button();
- $("#datecontrol_right").button({ disabled: true });
$(".choosecalendar_check").button();
- $("#oneday").button();
- $("#oneweek").button();
- $("#fourweek").button();
- $("#onemonth").button();
$("#list").button();
});
//init date vars
-var date = new Date();
-var dayofweek = date.getDay();
-var month = date.getMonth();
-var dayofmonth = date.getDate();
-var year = date.getFullYear();
-var daylong = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
-var dayshort = new Array("Sun.", "Mon.", "Tue.", "Wed.", "Thu.", "Fri.", "Sat.");
-var monthlong = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
-var monthshort = new Array("Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sep.", "Oct.", "Nov.", "Dec.");
-var space = " ";
-var normal_cal = new Array("31","28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");
-var leap_cal = new Array("31","29", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");
+var oc_cal_date = new Date();
+var oc_cal_dayofweek = oc_cal_date.getDay();
+var oc_cal_month = oc_cal_date.getMonth();
+var oc_cal_dayofmonth = oc_cal_date.getDate();
+var oc_cal_year = oc_cal_date.getFullYear();
+var oc_cal_daylong = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
+var oc_cal_dayshort = new Array("Sun.", "Mon.", "Tue.", "Wed.", "Thu.", "Fri.", "Sat.");
+var oc_cal_monthlong = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
+var oc_cal_monthshort = new Array("Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sep.", "Oct.", "Nov.", "Dec.");
+var oc_cal_space = " ";
+var oc_cal_normal_cal = new Array("31","28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");
+var oc_cal_leap_cal = new Array("31","29", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");
//init today date vars
-var today = new Date();
-var todaydayofweek = today.getDay();
-var todaymonth = today.getMonth();
-var todaydayofmonth = today.getDate();
-var todayyear = today.getFullYear();
+var oc_cal_today = new Date();
+var oc_cal_todaydayofweek = oc_cal_today.getDay();
+var oc_cal_todaymonth = oc_cal_today.getMonth();
+var oc_cal_todaydayofmonth = oc_cal_today.getDate();
+var oc_cal_todayyear = oc_cal_today.getFullYear();
//other vars
-var rows;
-var dates;
-var listview_numofevents = 0;
-var listview_count = 0;
+var oc_cal_rows;
+var oc_cal_dates;
+var oc_cal_listview_numofevents = 0;
+var oc_cal_listview_count = 0;
//event vars
-var events = new Array(2011);
-events[2011] = new Array(0,1,2,3,4,5,6,7,8,9,10,11);
-events[2011][7] = new Array();
-events[2011][7][7] = new Array();
-events[2011][7][7]["allday"] = new Array(1, 2);
-events[2011][7][7]["allday"][1] = new Array("description");
-events[2011][7][7]["allday"][1]["description"] = "abc";
-events[2011][7][7]["allday"][2] = new Array("description");
-events[2011][7][7]["allday"][2]["description"] = "ghfgh";
-events[2011][7][13] = new Array();
+var oc_cal_events = new Array(2011);
+oc_cal_events[2011] = new Array(0,1,2,3,4,5,6,7,8,9,10,11);
+oc_cal_events[2011][7] = new Array();
+oc_cal_events[2011][7][7] = new Array();
+oc_cal_events[2011][7][13] = new Array(); \ No newline at end of file
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index dbaf2d86f58..e8f1b81de6a 100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -1,64 +1,50 @@
- <div id="devbox">
- </div>
- <div class="controls">
- <div class="actions">
+ <div id="sysbox"></div>
+ <div id="controls">
+ <div>
<form>
<div id="view">
- <input type="radio" id="onedayview_radio" name="viewchooseradio"/>
- <label onclick="change_view('onedayview');" for="onedayview_radio">
- 1 Day
- </label>
- <input type="radio" id="oneweekview_radio" name="viewchooseradio"/>
- <label onclick="change_view('oneweekview');" for="oneweekview_radio">
- 1 Week
- </label>
- <input type="radio" id="fourweeksview_radio" name="viewchooseradio"/>
- <label onclick="change_view('fourweeksview');" for="fourweeksview_radio">
- 4 Weeks
- </label>
- <input type="radio" id="onemonthview_radio" name="viewchooseradio"/>
- <label onclick="change_view('onemonthview');" for="onemonthview_radio">
- 1 Month
- </label>
- <input type="radio" id="listview_radio" name="viewchooseradio"/>
- <label onclick="change_view('listview');" for="listview_radio">
- List
- </label>
+ <input type="button" value="1 Day" id="onedayview_radio" onclick="oc_cal_change_view('onedayview');"/>
+ <input type="button" value="1 Week" id="oneweekview_radio" onclick="oc_cal_change_view('oneweekview');"/>
+ <input type="button" value="4 Weeks" id="fourweeksview_radio" onclick="oc_cal_change_view('fourweeksview');"/>
+ <input type="button" value="1 Month" id="onemonthview_radio" onclick="oc_cal_change_view('onemonthview');"/>
+ <input type="button" value="Listview" id="listview_radio" onclick="oc_cal_change_view('listview');"/>
</div>
</form>
<form>
<div id="choosecalendar">
- <input type="radio" id="today_input" checked="checked"/>
- <label for="today_input" onclick="switch2today();">
- Today
- </label>
+ <input class="button" type="submit" id="today_input" value="Today" onclick="oc_cal_switch2today();"/>
<input type="radio" id="choosecalendar_input" checked="checked"/>
- <label for="choosecalendar_input" onclick="choosecalendar_dialog();">
+
+<table data-groups="admin">
+ <tr data-uid="root">
+ <td class="select"><input type="checkbox"></input></td>
+ <td class="name">root</td>
+ <td class="groups">
+ <select data-username="root" data-user-groups="admin" data-placeholder="groups" title="Gruppen" multiple="multiple">
+ <option value="admin">admin</option>
+ </select>
+ </td>
+ <td class="remove">
+ </td>
+ </tr>
+ </table>
+
+ <!--
+ <label for="choosecalendar_input" onclick="oc_cal_choosecalendar_dialog();">
Choose your Calendar
- </label>
+ </label>-->
</div>
</form>
<form>
<div id="datecontrol">
- <input type="radio" id="datecontrol_left" />
- <label for="datecontrol_left" onclick="update_view('', 'backward');">
- &lt;
- </label>
- <input type="radio" id="datecontrol_date" checked="checked"/>
- <label for="datecontrol_date">
- <p id="datecontrol_date_label">
- &nbsp;
- </p>
- </label>
- <input type="radio" id="datecontrol_right" />
- <label for="datecontrol_right" onclick="update_view('', 'forward');">
- &gt;
- </label>
+ <input type="button" value="&lt;" id="datecontrol_left" onclick="oc_cal_update_view('', 'backward');"/>
+ <input id="datecontrol_date" type="button" value=""/>
+ <input type="button" value="&gt;" id="datecontrol_left" onclick="oc_cal_update_view('', 'forward');"/>
</div>
</form>
</div>
</div>
- <div class="controls" id="calendar_holder">
+ <div id="calendar_holder">
<div id="onedayview">
<table>
<thead>
@@ -921,11 +907,6 @@
<div id="listview">
</div>
- <p class="center">
- <a href="http://ownclouddev.georgswebsite.de/feedback/" target="_blank">Feedback</a>&nbsp;&nbsp;&nbsp;&diams;&nbsp;&nbsp;&nbsp;
- <a href="http://ownclouddev.georgswebsite.de/devinfo/" target="_blank">Developer information</a>&nbsp;&nbsp;&nbsp;&diams;&nbsp;&nbsp;&nbsp;
- <a href="http://ownclouddev.georgswebsite.de/bugs/">Bugs</a>
- </p>
</div>
<!-- Dialogs -->
<div id="choosecalendar_dialog" title="Please choose visible calendars.">
@@ -965,18 +946,25 @@
</div>
<!-- End of Dialogs -->
<script type="text/javascript">
+ //sending ajax request on every change view and use last view as default on the next
<?php
- include("cfg/" . OC_USER::getUser() . ".cfg.php");
- echo "var currentview = \"" . $defaultview . "\";\n";
+ if(OC_Preferences::getValue(OC_USER::getUser(), "calendar", "currentview") == ""){
+ echo "var oc_cal_currentview = \"onemonthview\";";
+ }else{
+ echo "var oc_cal_currentview = \"" . OC_Preferences::getValue(OC_USER::getUser(), "calendar", "currentview") . "\";";
+ }
+
?>
- document.getElementById(currentview).style.display = "block";
- document.getElementById(currentview + "_radio").checked = "checked";
- update_view(currentview);
- function change_view(view, task){
- document.getElementById(currentview).style.display = "none";
+ document.getElementById(oc_cal_currentview).style.display = "block";
+ document.getElementById(oc_cal_currentview + "_radio").style.color = "#0098E4";
+ oc_cal_update_view(oc_cal_currentview);
+ function oc_cal_change_view(view, task){
+ document.getElementById(oc_cal_currentview).style.display = "none";
+ document.getElementById(oc_cal_currentview + "_radio").style.color = "#000000";
document.getElementById(view).style.display = "block";
- currentview = view;
- update_view(view, task);
+ oc_cal_currentview = view;
+ document.getElementById(oc_cal_currentview + "_radio").style.color = "#0098E4";
+ oc_cal_update_view(view, task);
}
</script>
<script type="text/javascript" id="js_events"></script>