]> git.mxchange.org Git - friendica-addons.git/commitdiff
Select only one day by default for weekly recurrence
authorTobias Hößl <tobias@hoessl.eu>
Sat, 28 Jul 2012 09:30:39 +0000 (09:30 +0000)
committerTobias Hößl <tobias@hoessl.eu>
Sat, 28 Jul 2012 09:30:39 +0000 (09:30 +0000)
dav/common/calendar.fnk.php
dav/common/wdcal_edit.inc.php

index b03ed7beefbccaedd3603223f9c13601d2d298e8..1bfe97e2fd20b09579fd19f1434b48b862bd20f3 100644 (file)
@@ -347,7 +347,7 @@ function dav_get_current_user_calendar_by_id(&$server, $id, $with_privilege = ""
 
 /**
  * @param string $uid
- * @return Sabre_VObject_Component_VEvent $vObject
+ * @return Sabre_VObject_Component_VCalendar $vObject
  */
 function dav_create_empty_vevent($uid = "")
 {
@@ -359,8 +359,8 @@ function dav_create_empty_vevent($uid = "")
 
 
 /**
- * @param Sabre_VObject_Component_VEvent $vObject
- * @return Sabre_VObject_Component|null
+ * @param Sabre_VObject_Component_VCalendar $vObject
+ * @return Sabre_VObject_Component_VEvent|null
  */
 function dav_get_eventComponent(&$vObject)
 {
index 261e78660dfdafe42ed006970b8a0975e975b9bf..dac493683ef379d9a92f587c69ed8857c192ecf9 100644 (file)
@@ -261,7 +261,8 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
        if ($recurrence && $recurrence->byDay) {
                $byday = $recurrence->byDay;
        } else {
-               $byday = array("MO", "TU", "WE", "TH", "FR", "SA", "SU");
+               $days = array("MO", "TU", "WE", "TH", "FR", "SA", "SU");
+               $byday = array($days[date("N", $event["StartTime"]) - 1]);
        }
        if ($localization->getFirstDayOfWeek() == 0) {
                $out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='SU' ";
@@ -671,6 +672,7 @@ function wdcal_set_component_alerts(&$component, &$localization, $summary, $dtst
 
        foreach ($prev_alarms as $al) {
                /** @var Sabre_VObject_Component_VAlarm $al */
+               // @TODO Parse notifications that have been there before; e.g. from Lightning
        }
 
        foreach (array_keys($_REQUEST["noti_type"]) as $key) if (is_numeric($key) || ($key == "new" && $_REQUEST["new_alarm"] == 1)) {