diff --git a/drivers/caldav/caldav_driver.php b/drivers/caldav/caldav_driver.php index eef9bff..8770468 100644 --- a/drivers/caldav/caldav_driver.php +++ b/drivers/caldav/caldav_driver.php @@ -193,7 +193,6 @@ class caldav_driver extends calendar_driver 'active' => !in_array($id, $hidden), 'group' => 'x-birthdays', 'editable' => false, - 'editable_name' => true, 'default' => false, 'children' => false, ); @@ -1898,11 +1897,11 @@ class caldav_driver extends calendar_driver 'SELECT source_id, caldav_url FROM '.$this->db_sources .' WHERE user_id = ?', $this->rc->user->ID ); + $sources_exist = $this->rc->db->num_rows($result); if($this->rc->db->num_rows($result)) { $is_ical = new html_checkbox( array( 'name' => "is_ical", 'value' => 1, - 'onload' => 'alert(123)', 'onclick' => ' if(this.checked) { $("#ical_url").removeClass("hidden"); @@ -1914,7 +1913,7 @@ else { }' )); $formfields['is_ical'] = array( - 'label' => $this->cal->gettext('calendar_is_ical'), + 'label' => $this->cal->gettext('calendar_ical_file'), 'value' => $is_ical->show(null), 'class' => 'hidden' ); @@ -1925,7 +1924,6 @@ else { 'class' => 'hidden' )); - $caldav_url = new html_select([ 'name' => 'source_id', 'id' => 'caldav_url' @@ -1939,8 +1937,19 @@ else { ); } else { - $this->rc->output->show_message($this->cal->gettext('nosources_error'), 'error'); - return null; + $ical_url = new html_inputfield( array( + 'name' => 'ical_url', + 'size' => 20, + )); + $formfields['url'] = array( + 'label' => $this->cal->gettext('calendar_ical_file'), + 'value' => $ical_url->show(null), + ); + $enable_ics = new html_hiddenfield(['name' => 'is_ical', 'value' => 1]); + $formfields['hidden'] = array( + 'label' => ' ', + 'value' =>$enable_ics->show(null), + ); } } diff --git a/localization/de.inc b/localization/de.inc index 38e3529..1eed9ca 100644 --- a/localization/de.inc +++ b/localization/de.inc @@ -8,9 +8,8 @@ */ $labels['addsources'] = 'CalDAV Quellen hinzufügen'; $labels['deletesources'] = 'CalDAV Quellen löschen'; -$labels['nosources_error'] = 'Keine CalDAV Quellen vorhanden.'; $labels['source_notadded_error'] = 'CalDAV Quelle konnte nicht hinzugefügt werden.'; -$labels['calendar_is_ical'] = 'Ist ics-Datei'; +$labels['calendar_ical_file'] = 'ics-Datei'; $labels['default_view'] = 'Standardansicht'; $labels['time_format'] = 'Zeitformatierung'; diff --git a/localization/de_CH.inc b/localization/de_CH.inc index 41c84c8..537caf4 100644 --- a/localization/de_CH.inc +++ b/localization/de_CH.inc @@ -8,9 +8,8 @@ */ $labels['addsources'] = 'CalDAV Quellen hinzufügen'; $labels['deletesources'] = 'CalDAV Quellen löschen'; -$labels['nosources_error'] = 'Keine CalDAV Quellen vorhanden.'; $labels['source_notadded_error'] = 'CalDAV Quelle konnte nicht hinzugefügt werden.'; -$labels['calendar_is_ical'] = 'Ist ics-Datei'; +$labels['calendar_ical_file'] = 'ics-Datei'; $labels['default_view'] = 'Standardansicht'; $labels['time_format'] = 'Zeitformatierung'; diff --git a/localization/de_DE.inc b/localization/de_DE.inc index 9839876..1cd495d 100644 --- a/localization/de_DE.inc +++ b/localization/de_DE.inc @@ -8,9 +8,8 @@ */ $labels['addsources'] = 'CalDAV Quellen hinzufügen'; $labels['deletesources'] = 'CalDAV Quellen löschen'; -$labels['nosources_error'] = 'Keine CalDAV Quellen vorhanden.'; $labels['source_notadded_error'] = 'CalDAV Quelle konnte nicht hinzugefügt werden.'; -$labels['calendar_is_ical'] = 'Ist ics-Datei'; +$labels['calendar_ical_file'] = 'ics-Datei'; $labels['default_view'] = 'Standardansicht'; $labels['time_format'] = 'Zeitformatierung'; diff --git a/localization/en_US.inc b/localization/en_US.inc index d47e708..8626d9f 100644 --- a/localization/en_US.inc +++ b/localization/en_US.inc @@ -13,9 +13,8 @@ $labels = array(); //caldav driver $labels['addsources'] = 'Add CalDAV sources'; $labels['deletesources'] = 'Delete CalDAV sources'; -$labels['nosources_error'] = 'No CalDAV sources available.'; $labels['source_notadded_error'] = 'CalDAV source could not be added.'; -$labels['calendar_is_ical'] = 'Is ics file'; +$labels['calendar_ical_file'] = 'ics file'; // preferences $labels['default_view'] = 'Default view';