diff options
-rw-r--r-- | apps/calendar/ajax/choosecalendar.php | 27 | ||||
-rw-r--r-- | apps/calendar/caldav.php | 2 | ||||
-rwxr-xr-x | apps/calendar/css/style.css | 2 | ||||
-rwxr-xr-x | apps/calendar/index.php | 4 | ||||
-rwxr-xr-x | apps/calendar/js/calendar.js | 8 | ||||
-rwxr-xr-x | apps/calendar/js/calendar_init.js | 1 | ||||
-rw-r--r-- | apps/calendar/l10n/de.php | 10 | ||||
-rwxr-xr-x | apps/calendar/templates/calendar.php | 2 | ||||
-rw-r--r-- | apps/calendar/templates/part.choosecalendar.php | 26 | ||||
-rw-r--r-- | apps/calendar/templates/part.newevent.php | 26 |
10 files changed, 89 insertions, 19 deletions
diff --git a/apps/calendar/ajax/choosecalendar.php b/apps/calendar/ajax/choosecalendar.php new file mode 100644 index 00000000000..03765dabe9d --- /dev/null +++ b/apps/calendar/ajax/choosecalendar.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'); +$l10n = new OC_L10N('calendar'); +if(!OC_USER::isLoggedIn()) { + die("<script type=\"text/javascript\">document.location = oc_webroot;</script>"); +} +$output = new OC_TEMPLATE("calendar", "part.choosecalendar"); +$output -> printpage(); +?>
\ No newline at end of file diff --git a/apps/calendar/caldav.php b/apps/calendar/caldav.php index da56919a528..49fc9633365 100644 --- a/apps/calendar/caldav.php +++ b/apps/calendar/caldav.php @@ -1,6 +1,6 @@ <?php /** - * ownCloud - Addressbook + * ownCloud - Calendar * * @author Jakob Sack * @copyright 2011 Jakob Sack mail@jakobsack.de diff --git a/apps/calendar/css/style.css b/apps/calendar/css/style.css index a4bae178884..afb530bcff0 100755 --- a/apps/calendar/css/style.css +++ b/apps/calendar/css/style.css @@ -52,4 +52,4 @@ .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%; } .weekend_thead, .weekend_row{height: 20px;text-align: center;text-align: center;background: #F3F3F3;} -.thisday{background: #FFFABC;text-align: center;}
\ No newline at end of file +.thisday{background: #FFFABC;text-align: center;} diff --git a/apps/calendar/index.php b/apps/calendar/index.php index e08264ec09f..053b36c4183 100755 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -22,19 +22,15 @@ if(!OC_USER::isLoggedIn()) { header("Location: " . OC_HELPER::linkTo("", "index.php")); exit; } - // Create default calendar ... $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); if( count($calendars) == 0){ OC_Calendar_Calendar::addCalendar(OC_User::getUser(),'default','Default calendar'); $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); } - OC_UTIL::addScript("calendar", "calendar"); OC_UTIL::addScript("calendar", "calendar_init"); -OC_UTIL::addScript("calendar", "calendar_dialog"); OC_UTIL::addStyle("calendar", "style"); - OC_APP::setActiveNavigationEntry("calendar_index"); $output = new OC_TEMPLATE("calendar", "calendar", "user"); $output -> printPage(); diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 067d5f53081..a52d0deeb12 100755 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -873,4 +873,12 @@ function oc_cal_newevent(date, time){ }else{ alert(t("calendar", "You can't open more than one dialog per site!")); } +} +function oc_cal_choosecalendar(){ + if(oc_cal_opendialog == 0){ + $("#dialog_holder").load(oc_webroot + "/apps/calendar/ajax/choosecalendar.php"); + oc_cal_opendialog = 1; + }else{ + alert(t("calendar", "You can't open more than one dialog per site!")); + } }
\ No newline at end of file diff --git a/apps/calendar/js/calendar_init.js b/apps/calendar/js/calendar_init.js index e8f52313297..3b5d37161c7 100755 --- a/apps/calendar/js/calendar_init.js +++ b/apps/calendar/js/calendar_init.js @@ -50,6 +50,7 @@ var oc_cal_listview_numofevents = 0; var oc_cal_listview_count = 0; var oc_cal_opendialog = 0; var oc_cal_datemonthyear = String(oc_cal_dayofmonth) + String(oc_cal_month) + String(oc_cal_year); +var oc_cal_calendars = new Array(); //event vars 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); diff --git a/apps/calendar/l10n/de.php b/apps/calendar/l10n/de.php index 82d9f86073a..325a323d57a 100644 --- a/apps/calendar/l10n/de.php +++ b/apps/calendar/l10n/de.php @@ -63,6 +63,16 @@ "Calendars" => "Kalender", "Time" => "Uhrzeit", "All day" => "Ganztägig", +"Does not repeat" => "Keine Wiederholung", +"Daily" => "Täglich", +"Weekly" => "Wöchentlich", +"Every Weekday" => "jeden Wochentag", +"Bi-Weekly" => "jede 2. Woche", +"Monthly" => "Monatlich", +"Yearly" => "Jährlich", +"Description of the Event" => "Beschreibung des Termins", +"" => "", +"" => "", "" => "" ); ?>
\ No newline at end of file diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index 0cfbea29e55..b9b11f8a274 100755 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -28,7 +28,7 @@ <form> <div id="choosecalendar"> <input type="button" id="today_input" value="Today" onclick="oc_cal_switch2today();"/> - <input type="button" id="choosecalendar_input" value="Calendars" onclick="" /> + <input type="button" id="choosecalendar_input" value="Calendars" onclick="oc_cal_choosecalendar();" /> </div> </form> <form> diff --git a/apps/calendar/templates/part.choosecalendar.php b/apps/calendar/templates/part.choosecalendar.php new file mode 100644 index 00000000000..487ee7645d7 --- /dev/null +++ b/apps/calendar/templates/part.choosecalendar.php @@ -0,0 +1,26 @@ +<div id="choosecalendar_dialog" title="<?php echo $l->t("Choose active calendars"); ?>"> +<?php +$option_calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); +for($i = 0; $i < count($option_calendars); $i++){ + echo "<input type=\"button\" id=\"button_" . $option_calendars[$i]["id"] . "\" value=\"" . $option_calendars[$i]["displayname"] . "\">"; +} +?> +<br /><br /><br /> +<input style="float: left;" type="button" onclick="oc_cal_choosecalendar_submit();" value="<?php echo $l->t("Submit"); ?>"> +</div> +<script type="text/javascript"> + $( "#choosecalendar_dialog" ).dialog({ + width : 500, + close : function() { + oc_cal_opendialog = 0; + var lastchild = document.getElementById("body-user").lastChild + while(lastchild.id != "lightbox"){ + document.getElementById("body-user").removeChild(lastchild); + lastchild = document.getElementById("body-user").lastChild; + } + } + }); + function highlight_button(id){ + document.getElementById("button_" + id).style.color = "#000000"; + } +</script> diff --git a/apps/calendar/templates/part.newevent.php b/apps/calendar/templates/part.newevent.php index 823a2445c8f..bc19042f10c 100644 --- a/apps/calendar/templates/part.newevent.php +++ b/apps/calendar/templates/part.newevent.php @@ -25,10 +25,12 @@ <td width="75px"> <?php echo $l -> t("Calendar");?>:</td> <td> <select class="formselect" id="formcalendar_select" style="width:140px;"> - <option>Coming soon</option><!-- - <option>Calendar 1</option> - <option>Calendar 2</option> - <option>Calendar 3</option>--> + <?php + $option_calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); + for($i = 0; $i < count($option_calendars); $i++){ + echo "<option id=\"option_" . $option_calendars[$i]["id"] . "\">" . $option_calendars[$i]["displayname"] . "</option>"; + } + ?> </select></td> </tr> </table> @@ -86,13 +88,13 @@ <td width="75px"><?php echo $l -> t("Repeat");?>:</td> <td> <select class="formselect" id="formrepeat_select" style="width:350px;"> - <option id="doesnotrepeat" selected="selected">Does not repeat</option> - <option>Daily</option> - <option>Weekly</option> - <option>Every Weekday</option> - <option>Bi-Weekly</option> - <option>Monthly</option> - <option>Yearly</option> + <option id="repeat_doesnotrepeat" selected="selected"><?php echo $l->t("Does not repeat");?></option> + <option id="repeat_daily"><?php echo $l->t("Daily");?></option> + <option id="repeat_weekly"><?php echo $l->t("Weekly");?></option> + <option id="repeat_weekday"><?php echo $l->t("Every Weekday");?></option> + <option id="repeat_biweekly"><?php echo $l->t("Bi-Weekly");?></option> + <option id="repeat_monthly"><?php echo $l->t("Monthly");?></option> + <option id="repeat_yearly"><?php echo $l->t("Yearly");?></option> </select></td> </tr> </table> @@ -107,7 +109,7 @@ <table> <tr> <td width="75px" style="vertical-align: top;"><?php echo $l -> t("Description");?>:</td> - <td> <textarea style="width:350px;height: 150px;"placeholder="Description of the Event"></textarea></td> + <td> <textarea style="width:350px;height: 150px;"placeholder="<?php echo $l->t("Description of the Event");?>"></textarea></td> </tr> </table> <span id="newcalendar_actions"> |