summaryrefslogtreecommitdiffstats
path: root/apps/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'apps/calendar')
-rw-r--r--apps/calendar/ajax/createcalendar.php2
-rw-r--r--apps/calendar/ajax/getcal.php699
-rw-r--r--apps/calendar/ajax/newcalendar.php1
-rw-r--r--apps/calendar/ajax/updatecalendar.php2
-rw-r--r--apps/calendar/appinfo/database.xml6
-rw-r--r--apps/calendar/css/style.css7
-rw-r--r--apps/calendar/import.php2
-rw-r--r--apps/calendar/js/calendar.js4
-rw-r--r--apps/calendar/lib/calendar.php23
-rw-r--r--apps/calendar/lib/connector_sabre.php6
-rw-r--r--apps/calendar/templates/part.editcalendar.php6
-rw-r--r--apps/calendar/templates/part.import.php8
-rw-r--r--apps/calendar/templates/settings.php52
13 files changed, 79 insertions, 739 deletions
diff --git a/apps/calendar/ajax/createcalendar.php b/apps/calendar/ajax/createcalendar.php
index 82176d4368a..3fb2e8398a3 100644
--- a/apps/calendar/ajax/createcalendar.php
+++ b/apps/calendar/ajax/createcalendar.php
@@ -15,7 +15,7 @@ OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
$userid = OC_User::getUser();
-$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], $_POST['description'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
+$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
$calendar = OC_Calendar_Calendar::findCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
diff --git a/apps/calendar/ajax/getcal.php b/apps/calendar/ajax/getcal.php
index 3d43677075f..a65c6cf2602 100644
--- a/apps/calendar/ajax/getcal.php
+++ b/apps/calendar/ajax/getcal.php
@@ -28,674 +28,43 @@ $select_year = $_GET["year"];
$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London");
foreach($events as $event)
{
- if($select_year != substr($event['startdate'], 0, 4) && $event["repeating"] == false)
+ if ($select_year != substr($event['startdate'], 0, 4))
continue;
- if($select_year == substr($event['startdate'], 0, 4) && $event["repeating"] == false){
- $object = Sabre_VObject_Reader::read($event['calendardata']);
- $vevent = $object->VEVENT;
- $dtstart = $vevent->DTSTART;
- $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
- $start_dt = $dtstart->getDateTime();
- $start_dt->setTimezone(new DateTimeZone($user_timezone));
- $end_dt = $dtend->getDateTime();
- $end_dt->setTimezone(new DateTimeZone($user_timezone));
- $year = $start_dt->format('Y');
- $month = $start_dt->format('n') - 1; // return is 0 based
- $day = $start_dt->format('j');
- $hour = $start_dt->format('G');
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
+ $object = Sabre_VObject_Reader::read($event['calendardata']);
+ $vevent = $object->VEVENT;
+ $dtstart = $vevent->DTSTART;
+ $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
+ $start_dt = $dtstart->getDateTime();
+ $start_dt->setTimezone(new DateTimeZone($user_timezone));
+ $end_dt = $dtend->getDateTime();
+ $end_dt->setTimezone(new DateTimeZone($user_timezone));
+ $year = $start_dt->format('Y');
+ $month = $start_dt->format('n') - 1; // return is 0 based
+ $day = $start_dt->format('j');
+ $hour = $start_dt->format('G');
+ if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
+ $hour = 'allday';
+ }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop)
- {
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- if ($hour == 'allday')
- {
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour]))
- {
- $return[$year][$month][$day][$hour][] = $return_event;
- }
- else
- {
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
+ $return_event = array();
+ foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop)
+ {
+ $return_event[$prop] = $event[$prop];
+ }
+ $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
+ $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
+ $return_event['description'] = $event['summary'];
+ if ($hour == 'allday')
+ {
+ $return_event['allday'] = true;
+ }
+ if (isset($return[$year][$month][$day][$hour]))
+ {
+ $return[$year][$month][$day][$hour][] = $return_event;
}
- if($event["repeating"] == 1){
- $object = Sabre_VObject_Reader::read($event['calendardata']);
- $vevent = $object->VEVENT;
- //echo substr_count($event["calendardata"], "EXDATE");
- $numofelements = substr_count($vevent->RRULE, ";");
- $properties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false");
- $exruleproperties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false");
- $byday = array("MO"=>"false", "TU"=>"false", "WE"=>"false", "TH"=>"false", "FR"=>"false", "SA"=>"false", "SU"=>"false");
- if($numofelements != 0){
- $rrule = explode(";", $vevent->RRULE);
- for($i = 0;$i <= $numofelements;$i++){
- $rule = explode("=", $rrule[$i]);
- $property = $rule[0];
- $value = $rule[1];
- $properties[$property] = $value;
- }
- if($properties["BYDAY"] != "false"){
- $numofdays = substr_count($properties["BYDAY"], ",");
- if($numofdays == 0){
- if(strlen($properties["BYDAY"]) != 2){
- $lenght = strlen($properties["BYDAY"]);
- switch($lenght){
- case "3":
- $properties["BYSETPOS"] = substr($properties["BYDAY"],0,1);
- $properties["BYDAY"] = substr($properties["BYDAY"],1,2);
- break;
- case "4":
- $properties["BYSETPOS"] = substr($properties["BYDAY"],0,2);
- $properties["BYDAY"] = substr($properties["BYDAY"],2,2);
- break;
- case "5":
- $properties["BYSETPOS"] = substr($properties["BYDAY"],0,3);
- $properties["BYDAY"] = substr($properties["BYDAY"],3,2);
- break;
- case "6":
- $properties["BYSETPOS"] = substr($properties["BYDAY"],0,4);
- $properties["BYDAY"] = substr($properties["BYDAY"],4,2);
- break;
- }
- }
- $byday[$properties["BYDAY"]] = true;
-
- }else{
- $days = explode(",", $properties["BYDAY"]);
- for($i = 0;$i <= $numofdays;$i++){
- $day = $days[$i];
- $byday[$day] = true;
- }
- }
- }
- }else{
- $rule = explode("=", $vevent->RRULE);
- $properties[$rule[0]] = $rule[1];
- }
- if($properties["INTERVAL"] == "false"){
- $properties["INTERVAL"] = 1;
- }
- $count = 0; //counts all loops
- $countedoutputs = 0; //counts only the outputs
- $countchecker = true;
- $dtstart = $vevent->DTSTART;
- $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
- $start_dt = $dtstart->getDateTime();
- $start_dt->setTimezone(new DateTimeZone($user_timezone));
- $end_dt = $dtend->getDateTime();
- $end_dt->setTimezone(new DateTimeZone($user_timezone));
- $firststart_year = $start_dt->format('Y');
- $firststart_month = $start_dt->format('n');
- $firststart_day = $start_dt->format('j');
- $hour = $start_dt->format('G');
- $interval = 0;
- if($properties["UNTIL"] != "false"){
- $until = $properties["UNTIL"];
- $until_year = substr($until, 0, 4);
- $until_month = substr($until, 4, 2);
- $until_day = substr($until, 6, 2);
- }
- //print_r($properties);
- //print_r($byday);
- if($properties["FREQ"] == "DAILY"){
- if($properties["BYDAY"] == "false"){
- $byday = array("MO"=>"1", "TU"=>"1", "WE"=>"1", "TH"=>"1", "FR"=>"1", "SA"=>"1", "SU"=>"1");
- }
- while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){
- if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){
- $newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval);
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = date("j", $newunixtime);
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- }
- $count++;
- }
- }
- if($properties["FREQ"] == "WEEKLY"){
- if($properties["BYDAY"] == "false"){
- $byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year)), 0, 2))] = "1";
- }
- while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){
- if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){
- $newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval);
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = date("j", $newunixtime);
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- }
- $count++;
- }
- }
- if($properties["FREQ"] == "MONTHLY"){
- if(substr_count($properties["BYMONTHDAY"], ",") != 0){
- $numofBYMONTHDAY = substr_count($properties["BYMONTHDAY"], ",");
- if($numofBYMONTHDAY == 0){
- $BYMONTHDAY = array();
- $BYMONTHDAY[0] = $properties["BYMONTHDAY"];
- }else{
- $BYMONTHDAY = explode(",", $properties["BYMONTHDAY"]);
- }
- while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){
- for($i = 0;$i <= $numofBYMONTHDAY;$i++){
- $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $BYMONTHDAY[$i], $firststart_year);
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = date("j", $newunixtime);
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- }
- $count++;
- }
- }
- //if($properties["BYMONTHDAY"] != "false"){
- if($properties["BYSETPOS"] == "false"){
- while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){
- $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year);
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = date("j", $newunixtime);
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- $count++;
- }
- }else{
- if(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] >= 1){
- while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
- $lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year));
- $matches = 0;
- $matchedday = "";
- for($i = 1;$i <= $lastdayofmonth;$i++){
- $thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year));
- $thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2));
- //echo $thisdayname . " " . $thisday . "\n";
- if($byday[$thisdayname] == 1){
- $matches++;
- }
- if($matches == $properties["BYSETPOS"]){
- $matchedday = $thisday;
- $i = 32;
- }
- }
- $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = $matchedday;
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- $count++;
- }
- }elseif(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] <= -1){
- while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
- $lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), 1, $firststart_year));
- $matches = 0;
- $matchedday = "";
- for($i = $lastdayofmonth;$i >= 1;$i--){
- $thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year));
- $thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2));
- //echo $thisdayname . " " . $thisday . "\n";
- if($byday[$thisdayname] == 1){
- $matches++;
- }
- if($matches == $properties["BYSETPOS"]){
- $matchedday = $thisday;
- $i = 0;
- }
- }
- $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = $matchedday;
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- $count++;
- }
- //}
- }
- }
- if(strlen($properties["BYDAY"]) == 2){
- while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
- if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)), 0, 2))] == "1"){
- $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = date("j", $newunixtime);
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- }
- $count++;
- }
- }else{
- while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
- $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
- $year = date("Y", $newunixtime);
- $month = $month - 1; // return is 0 based
- $day = $dateofweekone;
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- $count++;
- }
- }
- }
- if($properties["FREQ"] == "YEARLY"){
- if($properties["BYMONTH"] != "false"){
- if($properties["BYMONTHDAY"] == false){
- $properties["BYMONTHDAY"] = date("j", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year));
- }
- if($properties["BYDAY"] == "false"){
- while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
- $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = date("j", $newunixtime);
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- $count++;
- }
- }
- if(strlen($properties["BYDAY"]) == 2){
- while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
- $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = date("j", $newunixtime);
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- $count++;
- }
- }else{
- $number = substr($properties["BYDAY"],0,1);
- $weekday = substr($properties["BYDAY"],1,2);
- $month = $properties["BYMONTH"];
- $dateofweekone = "";
- for($i = 0; $i <= 7;$i++){
- if(strtoupper(substr(date("D", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year)), 0, 2)) == $weekday){
- $dateofweekone = date("j", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year));
- $i = 8;
- }
- }
- if($number != 1){
- $dateofweekone = $dateofweekone + (7 * ($number - 1));
- }
- while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
- $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
- $year = date("Y", $newunixtime);
- $month = $month - 1; // return is 0 based
- $day = $dateofweekone;
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- $count++;
- }
- }
- }elseif($properties["BYYEARDAY"] != false){
- $numofyeardays = substr_count($properties["BYYEARDAY"], ",");
- if($numofyeardays == 0){
- $yeardays = array();
- $yeardays[0] = $properties["BYYEARDAY"];
- }else{
- $yeardays = explode(",", $properties["BYYEARDAY"]);
- }
- while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval)) + ($yeardays[$numofyeardays]-1) * 86400) <= $select_year && $countchecker == true){
- for($i = 0;$i <= $numofyeardays;$i++){
- $newunixtime = mktime(0,0,0, 1, 1, $firststart_year + ($count * $interval)) + ($yeardays[$i] -1) * 86400;
- $year = date("Y", $newunixtime);
- $month = date("n", $newunixtime) - 1; // return is 0 based
- $day = date("j", $newunixtime);
- if($properties["UNTIL"] != "false"){
- if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
- break;
- }
- }
- if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
- $hour = 'allday';
- }
- $return_event = array();
- foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
- $return_event[$prop] = $event[$prop];
- }
- $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
- $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
- $return_event['description'] = $event['summary'];
- $interval = $properties["INTERVAL"];
- $countedoutputs++;
- if($properties["COUNT"] != "false"){
- if($countedoutputs == $properties["COUNT"]){
- $countchecker = false;
- }
- }
- if ($hour == 'allday'){
- $return_event['allday'] = true;
- }
- if (isset($return[$year][$month][$day][$hour])){
- $return[$year][$month][$day][$hour][] = $return_event;
- }else{
- $return[$year][$month][$day][$hour] = array(1 => $return_event);
- }
- }
- $count++;
- }
- }
- }
+ else
+ {
+ $return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
OC_JSON::encodedPrint($return);
diff --git a/apps/calendar/ajax/newcalendar.php b/apps/calendar/ajax/newcalendar.php
index e01ae01ee8a..f00dd0fb862 100644
--- a/apps/calendar/ajax/newcalendar.php
+++ b/apps/calendar/ajax/newcalendar.php
@@ -15,7 +15,6 @@ OC_JSON::checkAppEnabled('calendar');
$calendar = array(
'id' => 'new',
'displayname' => '',
- 'description' => '',
'calendarcolor' => '',
);
$tmpl = new OC_Template('calendar', 'part.editcalendar');
diff --git a/apps/calendar/ajax/updatecalendar.php b/apps/calendar/ajax/updatecalendar.php
index 5cf48d50ea1..a81644ded17 100644
--- a/apps/calendar/ajax/updatecalendar.php
+++ b/apps/calendar/ajax/updatecalendar.php
@@ -15,7 +15,7 @@ OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
$calendarid = $_POST['id'];
-OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']);
+OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], null, null, null, $_POST['color']);
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
$calendar = OC_Calendar_Calendar::findCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
diff --git a/apps/calendar/appinfo/database.xml b/apps/calendar/appinfo/database.xml
index bf92179c40b..7f7b6457559 100644
--- a/apps/calendar/appinfo/database.xml
+++ b/apps/calendar/appinfo/database.xml
@@ -154,12 +154,6 @@
</field>
<field>
- <name>description</name>
- <type>clob</type>
- <notnull>false</notnull>
- </field>
-
- <field>
<name>calendarorder</name>
<type>integer</type>
<default>0</default>
diff --git a/apps/calendar/css/style.css b/apps/calendar/css/style.css
index 5e19b88f55a..80d29ca8974 100644
--- a/apps/calendar/css/style.css
+++ b/apps/calendar/css/style.css
@@ -5,7 +5,7 @@
* See the COPYING-README file.
*/
-#view {margin-left: 10px; float: left; font-size: 12px;}
+#view { float: left; font-size: 12px; height: 100%;}
#datecontrol {text-align: center;}
#datecontrol_left{font-size: 12px;}
#datecontrol_right{font-size: 12px;}
@@ -17,7 +17,6 @@
#editentry_dialog {display: none;}
#parsingfail_dialog{display: none;}
-#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;}
@@ -59,5 +58,5 @@ color:#A9A9A9;
select#category{width:140px;}
button.category{margin:0 3px;}
-.calendar-colorpicker-color{display:inline-block;width:20px;height:20px;margin-right:2px;cursor:pointer;}
-.calendar-colorpicker-color.active{background-image:url("../../../core/img/jquery-ui/ui-icons_222222_256x240.png");background-position:-62px -143px;}
+.calendar-colorpicker-color{display:inline-block;width:20px;height:20px;margin-right:2px;cursor:pointer;border:2px solid transparent;}
+.calendar-colorpicker-color.active{border:2px solid black;}
diff --git a/apps/calendar/import.php b/apps/calendar/import.php
index 46822349448..211791f551b 100644
--- a/apps/calendar/import.php
+++ b/apps/calendar/import.php
@@ -23,7 +23,7 @@ if($_GET["import"] == "existing"){
$filename = "/" . $_GET["file"];
}
}else{
- $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname'], $_POST['description']);
+ $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']);
OC_Calendar_Calendar::setCalendarActive($id, 1);
$calid = $id;
if($_POST["path"] != ""){
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index 131325007a0..87954b7aac6 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -491,8 +491,6 @@ Calendar={
// based on jquery-colorpicker at jquery.webspirited.com
var obj = $('.colorpicker', container);
var picker = $('<div class="calendar-colorpicker"></div>');
- var size = 20;
-
//build an array of colors
var colors = {};
$(obj).children('option').each(function(i, elm) {
@@ -501,7 +499,7 @@ Calendar={
colors[i].label = $(elm).text();
});
for (var i in colors) {
- picker.append('<span class="calendar-colorpicker-color ' + (colors[i].color == $(obj).children(":selected").val() ? ' active' : '') + '" rel="' + colors[i].label + '" style="background-color: #' + colors[i].color + '; width: ' + size + 'px; height: ' + size + 'px;"></span>');
+ picker.append('<span class="calendar-colorpicker-color ' + (colors[i].color == $(obj).children(":selected").val() ? ' active' : '') + '" rel="' + colors[i].label + '" style="background-color: #' + colors[i].color + ';"></span>');
}
picker.delegate(".calendar-colorpicker-color", "click", function() {
$(obj).val($(this).attr('rel'));
diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index 4549af8b3c0..959cb14bf8f 100644
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -30,7 +30,6 @@
* uri VARCHAR(100),
* active INTEGER UNSIGNED NOT NULL DEFAULT '0',
* ctag INTEGER UNSIGNED NOT NULL DEFAULT '0',
- * description TEXT,
* calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0',
* calendarcolor VARCHAR(10),
* timezone TEXT,
@@ -94,14 +93,13 @@ class OC_Calendar_Calendar{
* @brief Creates a new calendar
* @param string $userid
* @param string $name
- * @param string $description
* @param string $components Default: "VEVENT,VTODO,VJOURNAL"
* @param string $timezone Default: null
* @param integer $order Default: 1
* @param string $color Default: null
* @return insertid
*/
- public static function addCalendar($userid,$name,$description,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){
+ public static function addCalendar($userid,$name,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){
$all = self::allCalendars($userid);
$uris = array();
foreach($all as $i){
@@ -110,8 +108,8 @@ class OC_Calendar_Calendar{
$uri = self::createURI($name, $uris );
- $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' );
- $result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components));
+ $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
+ $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
return OC_DB::insertid();
}
@@ -121,18 +119,17 @@ class OC_Calendar_Calendar{
* @param string $principaluri
* @param string $uri
* @param string $name
- * @param string $description
* @param string $components
* @param string $timezone
* @param integer $order
* @param string $color
* @return insertid
*/
- public static function addCalendarFromDAVData($principaluri,$uri,$name,$description,$components,$timezone,$order,$color){
+ public static function addCalendarFromDAVData($principaluri,$uri,$name,$components,$timezone,$order,$color){
$userid = self::extractUserID($principaluri);
- $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' );
- $result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components));
+ $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
+ $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
return OC_DB::insertid();
}
@@ -141,7 +138,6 @@ class OC_Calendar_Calendar{
* @brief Edits a calendar
* @param integer $id
* @param string $name Default: null
- * @param string $description Default: null
* @param string $components Default: null
* @param string $timezone Default: null
* @param integer $order Default: null
@@ -150,20 +146,19 @@ class OC_Calendar_Calendar{
*
* Values not null will be set
*/
- public static function editCalendar($id,$name=null,$description=null,$components=null,$timezone=null,$order=null,$color=null){
+ public static function editCalendar($id,$name=null,$components=null,$timezone=null,$order=null,$color=null){
// Need these ones for checking uri
$calendar = self::findCalendar($id);
// Keep old stuff
if(is_null($name)) $name = $calendar['name'];
- if(is_null($description)) $description = $calendar['description'];
if(is_null($components)) $components = $calendar['components'];
if(is_null($timezone)) $timezone = $calendar['timezone'];
if(is_null($order)) $order = $calendar['calendarorder'];
if(is_null($color)) $color = $calendar['color'];
- $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,description=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' );
- $result = $stmt->execute(array($name,$description,$order,$color,$timezone,$components,$id));
+ $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' );
+ $result = $stmt->execute(array($name,$order,$color,$timezone,$components,$id));
return true;
}
diff --git a/apps/calendar/lib/connector_sabre.php b/apps/calendar/lib/connector_sabre.php
index b94e6fb3ae7..13a542fccad 100644
--- a/apps/calendar/lib/connector_sabre.php
+++ b/apps/calendar/lib/connector_sabre.php
@@ -102,13 +102,12 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
}
if(!isset($newValues['displayname'])) $newValues['displayname'] = 'unnamed';
- if(!isset($newValues['description'])) $newValues['description'] = '';
if(!isset($newValues['components'])) $newValues['components'] = 'VEVENT,VTODO';
if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = 0;
if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
- return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['description'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
+ return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
}
/**
@@ -191,12 +190,11 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
// Success
if(!isset($newValues['displayname'])) $newValues['displayname'] = null;
- if(!isset($newValues['description'])) $newValues['description'] = null;
if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = null;
if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
- OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],$newValues['description'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
+ OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
return true;
diff --git a/apps/calendar/templates/part.editcalendar.php b/apps/calendar/templates/part.editcalendar.php
index c2c22913bee..b4ff573ec81 100644
--- a/apps/calendar/templates/part.editcalendar.php
+++ b/apps/calendar/templates/part.editcalendar.php
@@ -26,12 +26,6 @@
</tr>
<?php endif; ?>
<tr>
- <th><?php echo $l->t('Description') ?></th>
- <td>
- <textarea id="description_<?php echo $_['calendar']['id'] ?>"><?php echo $_['calendar']['description'] ?></textarea>
- </td>
-</tr>
-<tr>
<th><?php echo $l->t('Calendar color') ?></th>
<td>
<select id="calendarcolor_<?php echo $_['calendar']['id'] ?>" class="colorpicker">
diff --git a/apps/calendar/templates/part.import.php b/apps/calendar/templates/part.import.php
index 37493674371..b8805e6b6ef 100644
--- a/apps/calendar/templates/part.import.php
+++ b/apps/calendar/templates/part.import.php
@@ -31,11 +31,6 @@ foreach($calendars as $calendar){
<input id="displayname" type="text" value="">
</td>
</tr>
-<th><?php echo $l->t('Description') ?></th>
-<td>
-<textarea id="description"></textarea>
-</td>
-</tr>
</table>
<!-- end of modified part -->
<br><br>
@@ -65,8 +60,7 @@ function importcal(importtype){
}
if(importtype == "new"){
var calname = $("#displayname").val();
- var description = $("#description").val();
- $.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'description':description, 'path':path, 'file':file}, function(){
+ $.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'path':path, 'file':file}, function(){
$("#importdialog").dialog('destroy').remove();
$("#importdialogholder").remove();
});
diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php
index 19a1a543b46..56fb55d235c 100644
--- a/apps/calendar/templates/settings.php
+++ b/apps/calendar/templates/settings.php
@@ -6,39 +6,39 @@
* later.
* See the COPYING-README file.
*/
-OC_UTIL::addScript('', 'jquery.multiselect');
-OC_UTIL::addStyle('', 'jquery.multiselect');
?>
<form id="calendar">
<fieldset class="personalblock">
- <table class="nostyle">
- <tr><td><label for="timezone" class="bold"><?php echo $l->t('Timezone');?></label></td><td><select style="display: none;" id="timezone" name="timezone">
+ <table class="nostyle">
+ <tr><td><label for="timezone" class="bold"><?php echo $l->t('Timezone');?></label></td><td><select style="display: none;" id="timezone" name="timezone">
<?php
- $continent = '';
- foreach($_['timezones'] as $timezone):
- if ( preg_match( '/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $timezone ) ):
- $ex=explode('/', $timezone, 2);//obtain continent,city
- if ($continent!=$ex[0]):
- if ($continent!="") echo '</optgroup>';
- echo '<optgroup label="'.$ex[0].'">';
- endif;
- $city=$ex[1];
- $continent=$ex[0];
- echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
- endif;
+ $continent = '';
+ foreach($_['timezones'] as $timezone):
+ $ex=explode('/', $timezone, 2);//obtain continent,city
+ if (!isset($ex[1])) {
+ $ex[1] = $ex[0];
+ $ex[0] = "Other";
+ }
+ if ($continent!=$ex[0]):
+ if ($continent!="") echo '</optgroup>';
+ echo '<optgroup label="'.$ex[0].'">';
+ endif;
+ $city=strtr($ex[1], '_', ' ');
+ $continent=$ex[0];
+ echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
endforeach;?>
- </select></td></tr>
+ </select></td></tr>
- <tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td>
- <select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
- <option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
- <option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
- </select>
- </td></tr>
+ <tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td>
+ <select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
+ <option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
+ <option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
+ </select>
+ </td></tr>
- </table>
+ </table>
- <?php echo $l->t('Calendar CalDAV syncing address:');?>
- <?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br />
+ <?php echo $l->t('Calendar CalDAV syncing address:');?>
+ <?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br />
</fieldset>
</form>