diff options
Diffstat (limited to 'apps/calendar')
24 files changed, 133 insertions, 88 deletions
diff --git a/apps/calendar/ajax/calendar/new.form.php b/apps/calendar/ajax/calendar/new.form.php index 6e7423cbe92..fa014351f77 100644 --- a/apps/calendar/ajax/calendar/new.form.php +++ b/apps/calendar/ajax/calendar/new.form.php @@ -7,7 +7,6 @@ */ require_once('../../../../lib/base.php'); -$l10n = new OC_L10N('calendar'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); diff --git a/apps/calendar/ajax/calendar/overview.php b/apps/calendar/ajax/calendar/overview.php index 2f73f5d0710..dd55f3e018f 100644 --- a/apps/calendar/ajax/calendar/overview.php +++ b/apps/calendar/ajax/calendar/overview.php @@ -7,7 +7,7 @@ */ require_once('../../../../lib/base.php'); -$l10n = new OC_L10N('calendar'); +$l10n = OC_L10N::get('calendar'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $output = new OC_TEMPLATE("calendar", "part.choosecalendar"); diff --git a/apps/calendar/ajax/categories/rescan.php b/apps/calendar/ajax/categories/rescan.php new file mode 100644 index 00000000000..0fd878ed8f9 --- /dev/null +++ b/apps/calendar/ajax/categories/rescan.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright (c) 2012 Thomas Tanghus <thomas@tanghus.net> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +require_once('../../../../lib/base.php'); +OC_JSON::checkLoggedIn(); +OC_JSON::checkAppEnabled('calendar'); + +foreach ($_POST as $key=>$element) { + debug('_POST: '.$key.'=>'.print_r($element, true)); +} + +function bailOut($msg) { + OC_JSON::error(array('data' => array('message' => $msg))); + OC_Log::write('calendar','ajax/categories/rescan.php: '.$msg, OC_Log::DEBUG); + exit(); +} +function debug($msg) { + OC_Log::write('calendar','ajax/categories/rescan.php: '.$msg, OC_Log::DEBUG); +} + +$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); +if(count($calendars) == 0) { + bailOut(OC_Calendar_App::$l10n->t('No calendars found.')); +} +$events = array(); +foreach($calendars as $calendar) { + $calendar_events = OC_Calendar_Object::all($calendar['id']); + $events = $events + $calendar_events; +} +if(count($events) == 0) { + bailOut(OC_Calendar_App::$l10n->t('No events found.')); +} + +OC_Calendar_App::scanCategories($events); +$categories = OC_Calendar_App::getCategoryOptions(); + +OC_JSON::success(array('data' => array('categories'=>$categories))); diff --git a/apps/calendar/ajax/event/delete.php b/apps/calendar/ajax/event/delete.php index 862dec6bf5b..5fc12900ef3 100644 --- a/apps/calendar/ajax/event/delete.php +++ b/apps/calendar/ajax/event/delete.php @@ -7,8 +7,6 @@ */ require_once('../../../../lib/base.php'); -$l10n = new OC_L10N('calendar'); - OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/event/edit.form.php b/apps/calendar/ajax/event/edit.form.php index 837edbbbf05..98c22eb0206 100644 --- a/apps/calendar/ajax/event/edit.form.php +++ b/apps/calendar/ajax/event/edit.form.php @@ -41,13 +41,8 @@ switch($dtstart->getDateType()) { $summary = $vevent->getAsString('SUMMARY'); $location = $vevent->getAsString('LOCATION'); -$categories = $vevent->getAsArray('CATEGORIES'); +$categories = $vevent->getAsString('CATEGORIES'); $description = $vevent->getAsString('DESCRIPTION'); -foreach($categories as $category){ - if (!in_array($category, $category_options)){ - array_unshift($category_options, $category); - } -} $last_modified = $vevent->__get('LAST-MODIFIED'); if ($last_modified){ $lastmodified = $last_modified->getDateTime()->format('U'); @@ -189,7 +184,6 @@ if($data['repeating'] == 1){ } $calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); -$category_options = OC_Calendar_App::getCategoryOptions(); $repeat_options = OC_Calendar_App::getRepeatOptions(); $repeat_end_options = OC_Calendar_App::getEndOptions(); $repeat_month_options = OC_Calendar_App::getMonthOptions(); @@ -205,7 +199,6 @@ $tmpl = new OC_Template('calendar', 'part.editevent'); $tmpl->assign('id', $id); $tmpl->assign('lastmodified', $lastmodified); $tmpl->assign('calendar_options', $calendar_options); -$tmpl->assign('category_options', $category_options); $tmpl->assign('repeat_options', $repeat_options); $tmpl->assign('repeat_month_options', $repeat_month_options); $tmpl->assign('repeat_weekly_options', $repeat_weekly_options); @@ -242,7 +235,14 @@ if($repeat['repeat'] != 'doesnotrepeat'){ $tmpl->assign('repeat_bymonthday', $repeat['bymonthday']); $tmpl->assign('repeat_bymonth', $repeat['bymonth']); $tmpl->assign('repeat_byweekno', $repeat['byweekno']); +} else { + $tmpl->assign('repeat_month', 'monthday'); + $tmpl->assign('repeat_weekdays', array()); + $tmpl->assign('repeat_interval', 1); + $tmpl->assign('repeat_end', 'never'); + $tmpl->assign('repeat_count', '10'); + $tmpl->assign('repeat_weekofmonth', 'auto'); + $tmpl->assign('repeat_date', ''); + $tmpl->assign('repeat_year', 'bydate'); } $tmpl->printpage(); - -?>
\ No newline at end of file diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php index c19928a727e..838002a3a09 100644 --- a/apps/calendar/ajax/event/new.form.php +++ b/apps/calendar/ajax/event/new.form.php @@ -32,7 +32,6 @@ $start->setTimezone(new DateTimeZone($timezone)); $end->setTimezone(new DateTimeZone($timezone)); $calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); -$category_options = OC_Calendar_App::getCategoryOptions(); $repeat_options = OC_Calendar_App::getRepeatOptions(); $repeat_end_options = OC_Calendar_App::getEndOptions(); $repeat_month_options = OC_Calendar_App::getMonthOptions(); @@ -46,7 +45,6 @@ $repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions(); $tmpl = new OC_Template('calendar', 'part.newevent'); $tmpl->assign('calendar_options', $calendar_options); -$tmpl->assign('category_options', $category_options); $tmpl->assign('repeat_options', $repeat_options); $tmpl->assign('repeat_month_options', $repeat_month_options); $tmpl->assign('repeat_weekly_options', $repeat_weekly_options); @@ -73,4 +71,3 @@ $tmpl->assign('repeat_weekofmonth', 'auto'); $tmpl->assign('repeat_date', ''); $tmpl->assign('repeat_year', 'bydate'); $tmpl->printpage(); -?> diff --git a/apps/calendar/ajax/event/new.php b/apps/calendar/ajax/event/new.php index 59fda79da73..7070bbf05d7 100644 --- a/apps/calendar/ajax/event/new.php +++ b/apps/calendar/ajax/event/new.php @@ -8,8 +8,6 @@ require_once('../../../../lib/base.php'); -$l10n = new OC_L10N('calendar'); - OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index c62f93c540e..d053df2e4c1 100755 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -8,7 +8,7 @@ require_once ('../../../lib/base.php'); require_once('when/When.php'); -$l = new OC_L10N('calendar'); +$l = OC_L10N::get('calendar'); $unnamed = $l->t('unnamed'); function create_return_event($event, $vevent){ $return_event = array(); diff --git a/apps/calendar/ajax/import/dialog.php b/apps/calendar/ajax/import/dialog.php index 2e002092150..16ec54d14a2 100644 --- a/apps/calendar/ajax/import/dialog.php +++ b/apps/calendar/ajax/import/dialog.php @@ -9,7 +9,6 @@ require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); -$l10n = new OC_L10N('calendar'); $tmpl = new OC_Template('calendar', 'part.import'); $tmpl->assign('path', $_POST['path']); $tmpl->assign('filename', $_POST['filename']); diff --git a/apps/calendar/ajax/settings/guesstimezone.php b/apps/calendar/ajax/settings/guesstimezone.php index d45a70e1ce3..c02b8d10b8d 100755 --- a/apps/calendar/ajax/settings/guesstimezone.php +++ b/apps/calendar/ajax/settings/guesstimezone.php @@ -10,7 +10,7 @@ require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); -$l = new OC_L10N('calendar'); +$l = OC_L10N::get('calendar'); $lat = $_GET['lat']; $lng = $_GET['long']; diff --git a/apps/calendar/ajax/settings/settimezone.php b/apps/calendar/ajax/settings/settimezone.php index c639753fe2f..8dda28335f7 100644 --- a/apps/calendar/ajax/settings/settimezone.php +++ b/apps/calendar/ajax/settings/settimezone.php @@ -9,7 +9,7 @@ // Init owncloud require_once('../../../../lib/base.php'); -$l=new OC_L10N('calendar'); +$l=OC_L10N::get('calendar'); // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php index f297c4d16d4..ea743674fe8 100644 --- a/apps/calendar/appinfo/app.php +++ b/apps/calendar/appinfo/app.php @@ -1,5 +1,5 @@ <?php -$l=new OC_L10N('calendar'); +$l=OC_L10N::get('calendar'); OC::$CLASSPATH['OC_Calendar_App'] = 'apps/calendar/lib/app.php'; OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php'; OC::$CLASSPATH['OC_Calendar_Object'] = 'apps/calendar/lib/object.php'; @@ -7,7 +7,6 @@ OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php'; OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php'; OC::$CLASSPATH['OC_Search_Provider_Calendar'] = 'apps/calendar/lib/search.php'; OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser'); -OC_Hook::connect('OC_DAV', 'initialize', 'OC_Calendar_Hooks', 'initializeCalDAV'); OC_Util::addScript('calendar','loader'); OC_App::register( array( 'order' => 10, @@ -20,4 +19,4 @@ OC_App::addNavigationEntry( array( 'icon' => OC_Helper::imagePath( 'calendar', 'icon.svg' ), 'name' => $l->t('Calendar'))); OC_App::registerPersonal('calendar', 'settings'); -OC_Search::registerProvider('OC_Search_Provider_Calendar');
\ No newline at end of file +OC_Search::registerProvider('OC_Search_Provider_Calendar'); diff --git a/apps/calendar/appinfo/info.xml b/apps/calendar/appinfo/info.xml index 4ac3c5bf099..101840aa1fa 100644 --- a/apps/calendar/appinfo/info.xml +++ b/apps/calendar/appinfo/info.xml @@ -2,7 +2,6 @@ <info> <id>calendar</id> <name>Calendar</name> - <version>0.2.1</version> <licence>AGPL</licence> <author>Georg Ehrke, Bart Visscher, Jakob Sack</author> <require>2</require> diff --git a/apps/calendar/appinfo/version b/apps/calendar/appinfo/version new file mode 100644 index 00000000000..7dff5b89211 --- /dev/null +++ b/apps/calendar/appinfo/version @@ -0,0 +1 @@ +0.2.1
\ No newline at end of file diff --git a/apps/calendar/index.php b/apps/calendar/index.php index c00a4098f7a..f964a13ef79 100644 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -22,6 +22,7 @@ foreach($calendars as $calendar){ $eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar); } OC_Hook::emit('OC_Calendar', 'getSources', array('sources' => &$eventSources)); +$categories = OC_Calendar_App::getCategoryOptions(); //Fix currentview for fullcalendar if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){ @@ -45,9 +46,12 @@ OC_Util::addScript('calendar', 'calendar'); OC_Util::addStyle('calendar', 'style'); OC_Util::addScript('', 'jquery.multiselect'); OC_Util::addStyle('', 'jquery.multiselect'); +OC_Util::addScript('contacts','jquery.multi-autocomplete'); +OC_Util::addScript('','oc-vcategories'); OC_App::setActiveNavigationEntry('calendar_index'); $tmpl = new OC_Template('calendar', 'calendar', 'user'); $tmpl->assign('eventSources', $eventSources); +$tmpl->assign('categories', $categories); if(array_key_exists('showevent', $_GET)){ $tmpl->assign('showevent', $_GET['showevent']); } diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 907d94edb02..858990fb89d 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -32,13 +32,7 @@ Calendar={ $('#totime').timepicker({ showPeriodLabels: false }); - $('#category').multiselect({ - header: false, - noneSelectedText: $('#category').attr('title'), - selectedList: 2, - minWidth:'auto', - classes: 'category', - }); + $('#category').multiple_autocomplete({source: categories}); Calendar.UI.repeat('init'); $('#end').change(function(){ Calendar.UI.repeat('end'); @@ -370,6 +364,11 @@ Calendar={ } $('#'+id).addClass('active'); }, + categoriesChanged:function(newcategories){ + categories = $.map(newcategories, function(v) {return v;}); + console.log('Calendar categories changed to: ' + categories); + $('#category').multiple_autocomplete('option', 'source', categories); + }, Calendar:{ overview:function(){ if($('#choosecalendar_dialog').dialog('isOpen') == true){ @@ -730,6 +729,8 @@ $(document).ready(function(){ loading: Calendar.UI.loading, eventSources: eventSources }); + OCCategories.changed = Calendar.UI.categoriesChanged; + OCCategories.app = 'calendar'; $('#oneweekview_radio').click(function(){ $('#calendar_holder').fullCalendar('changeView', 'agendaWeek'); }); diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php index 6e92cf67c5c..4b481a4f286 100644 --- a/apps/calendar/lib/app.php +++ b/apps/calendar/lib/app.php @@ -9,9 +9,10 @@ /** * This class manages our app actions */ -OC_Calendar_App::$l10n = new OC_L10N('calendar'); +OC_Calendar_App::$l10n = OC_L10N::get('calendar'); class OC_Calendar_App{ public static $l10n; + protected static $categories = null; public static function getCalendar($id){ $calendar = OC_Calendar_Calendar::find( $id ); @@ -54,7 +55,7 @@ class OC_Calendar_App{ } } - public static function getCategoryOptions() + protected static function getDefaultCategories() { return array( self::$l10n->t('Birthday'), @@ -75,6 +76,54 @@ class OC_Calendar_App{ ); } + protected static function getVCategories() { + if (is_null(self::$categories)) { + self::$categories = new OC_VCategories('calendar', null, self::getDefaultCategories()); + } + return self::$categories; + } + + public static function getCategoryOptions() + { + $categories = self::getVCategories()->categories(); + return $categories; + } + + /** + * scan events for categories. + * @param $events VEVENTs to scan. null to check all events for the current user. + */ + public static function scanCategories($events = null) { + if (is_null($events)) { + $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); + if(count($calendars) > 0) { + $events = array(); + foreach($calendars as $calendar) { + $calendar_events = OC_Calendar_Object::all($calendar['id']); + $events = $events + $calendar_events; + } + } + } + if(is_array($events) && count($events) > 0) { + $vcategories = self::getVCategories(); + $vcategories->delete($vcategories->categories()); + foreach($events as $event) { + $vobject = OC_VObject::parse($event['calendardata']); + if(!is_null($vobject)) { + $vcategories->loadFromVObject($vobject->VEVENT, true); + } + } + } + } + + /** + * check VEvent for new categories. + * @see OC_VCategories::loadFromVObject + */ + public static function loadCategoriesFromVCalendar(OC_VObject $calendar) { + self::getVCategories()->loadFromVObject($calendar->VEVENT, true); + } + public static function getRepeatOptions(){ return OC_Calendar_Object::getRepeatOptions(self::$l10n); } diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php index 7eeb004d181..321f4c73ba0 100644 --- a/apps/calendar/lib/calendar.php +++ b/apps/calendar/lib/calendar.php @@ -44,10 +44,8 @@ class OC_Calendar_Calendar{ /** * @brief Returns the list of calendars for a specific user. * @param string $uid User ID - * @param boolean $active + * @param boolean $active Only return calendars with this $active state, default(=null) is don't care * @return array - * - * TODO: what is active for? */ public static function allCalendars($uid, $active=null){ $values = array($uid); diff --git a/apps/calendar/lib/hooks.php b/apps/calendar/lib/hooks.php index 54f1680a36e..22e8d8e20f2 100644 --- a/apps/calendar/lib/hooks.php +++ b/apps/calendar/lib/hooks.php @@ -24,17 +24,4 @@ class OC_Calendar_Hooks{ return true; } - - /** - * @brief Adds the CardDAV resource to the DAV server - * @param paramters parameters from initialize-Hook - * @return array - */ - public static function initializeCalDAV($parameters){ - // We need a backend, the root node and the caldav plugin - $parameters['backends']['caldav'] = new OC_Connector_Sabre_CalDAV(); - $parameters['nodes'][] = new Sabre_CalDAV_CalendarRootNode($parameters['backends']['principal'], $parameters['backends']['caldav']); - $parameters['plugins'][] = new Sabre_CalDAV_Plugin(); - return true; - } } diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index e0c0e83d5d0..d5622f6251f 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -93,6 +93,7 @@ class OC_Calendar_Object{ */ public static function add($id,$data){ $object = OC_VObject::parse($data); + OC_Calendar_App::loadCategoriesFromVCalendar($object); list($type,$startdate,$enddate,$summary,$repeating,$uid) = self::extractData($object); if(is_null($uid)){ @@ -139,6 +140,7 @@ class OC_Calendar_Object{ $oldobject = self::find($id); $object = OC_VObject::parse($data); + OC_Calendar_App::loadCategoriesFromVCalendar($object); list($type,$startdate,$enddate,$summary,$repeating,$uid) = self::extractData($object); $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_objects SET objecttype=?,startdate=?,enddate=?,repeating=?,summary=?,calendardata=?, lastmodified = ? WHERE id = ?' ); @@ -320,27 +322,6 @@ class OC_Calendar_Object{ return $dtend; } - public static function getCategoryOptions($l10n) - { - return array( - $l10n->t('Birthday'), - $l10n->t('Business'), - $l10n->t('Call'), - $l10n->t('Clients'), - $l10n->t('Deliverer'), - $l10n->t('Holidays'), - $l10n->t('Ideas'), - $l10n->t('Journey'), - $l10n->t('Jubilee'), - $l10n->t('Meeting'), - $l10n->t('Other'), - $l10n->t('Personal'), - $l10n->t('Projects'), - $l10n->t('Questions'), - $l10n->t('Work'), - ); - } - public static function getRepeatOptions($l10n) { return array( @@ -457,10 +438,6 @@ class OC_Calendar_Object{ $errnum++; } - if(isset($request['categories']) && !is_array($request['categories'])){ - $errors['categories'] = $l10n->t('Not an array'); - } - $fromday = substr($request['from'], 0, 2); $frommonth = substr($request['from'], 3, 2); $fromyear = substr($request['from'], 6, 4); @@ -628,7 +605,7 @@ class OC_Calendar_Object{ { $title = $request["title"]; $location = $request["location"]; - $categories = isset($request["categories"]) ? $request["categories"] : array(); + $categories = $request["categories"]; $allday = isset($request["allday"]); $from = $request["from"]; $to = $request["to"]; @@ -802,7 +779,7 @@ class OC_Calendar_Object{ $vevent->setString('LOCATION', $location); $vevent->setString('DESCRIPTION', $description); - $vevent->setString('CATEGORIES', join(',', $categories)); + $vevent->setString('CATEGORIES', $categories); /*if($repeat == "true"){ $vevent->RRULE = $repeat; diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php index 8405866392d..da5fa35bc21 100644 --- a/apps/calendar/lib/search.php +++ b/apps/calendar/lib/search.php @@ -1,6 +1,6 @@ <?php -class OC_Search_Provider_Calendar implements OC_Search_Provider{ - static function search($query){ +class OC_Search_Provider_Calendar extends OC_Search_Provider{ + function search($query){ $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1); if(count($calendars)==0 || !OC_App::isEnabled('calendar')){ //return false; diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index 63c3b500296..ba9423a66f1 100755 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -1,6 +1,7 @@ <script type='text/javascript'> var defaultView = '<?php echo OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') ?>'; var eventSources = <?php echo json_encode($_['eventSources']) ?>; + var categories = <?php echo json_encode($_['categories']); ?>; var dayNames = <?php echo json_encode($l->tA(array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'))) ?>; var dayNamesShort = <?php echo json_encode($l->tA(array('Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'))) ?>; var monthNames = <?php echo json_encode($l->tA(array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'))) ?>; diff --git a/apps/calendar/templates/part.choosecalendar.rowfields.php b/apps/calendar/templates/part.choosecalendar.rowfields.php index a789be45a43..d3bf6c0501c 100644 --- a/apps/calendar/templates/part.choosecalendar.rowfields.php +++ b/apps/calendar/templates/part.choosecalendar.rowfields.php @@ -1,4 +1,4 @@ <?php echo "<td width=\"20px\"><input id=\"active_" . $_['calendar']["id"] . "\" type=\"checkbox\" onClick=\"Calendar.UI.Calendar.activation(this, " . $_['calendar']["id"] . ")\"" . ($_['calendar']["active"] ? ' checked="checked"' : '') . "></td>"; echo "<td><label for=\"active_" . $_['calendar']["id"] . "\">" . $_['calendar']["displayname"] . "</label></td>"; - echo "<td width=\"20px\"><a href=\"#\" onclick=\"Calendar.UI.showCalDAVUrl('" . OC_User::getUser() . "', '" . $_['calendar']["uri"] . "');\" title=\"" . $l->t("CalDav Link") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/public.svg\"></a></td><td width=\"20px\"><a href=\"export.php?calid=" . $_['calendar']["id"] . "\" title=\"" . $l->t("Download") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/download.svg\"></a></td><td width=\"20px\"><a href=\"#\" title=\"" . $l->t("Edit") . "\" class=\"action\" onclick=\"Calendar.UI.Calendar.edit(this, " . $_['calendar']["id"] . ");\"><img class=\"svg action\" src=\"../../core/img/actions/rename.svg\"></a></td><td width=\"20px\"><a href=\"#\" onclick=\"Calendar.UI.Calendar.deleteCalendar('" . $_['calendar']["id"] . "');\" title=\"" . $l->t("Delete") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/delete.svg\"></a></td>"; + echo "<td width=\"20px\"><a href=\"#\" onclick=\"Calendar.UI.showCalDAVUrl('" . OC_User::getUser() . "', '" . rawurlencode( $_['calendar']["uri"] ) . "');\" title=\"" . $l->t("CalDav Link") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/public.svg\"></a></td><td width=\"20px\"><a href=\"export.php?calid=" . $_['calendar']["id"] . "\" title=\"" . $l->t("Download") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/download.svg\"></a></td><td width=\"20px\"><a href=\"#\" title=\"" . $l->t("Edit") . "\" class=\"action\" onclick=\"Calendar.UI.Calendar.edit(this, " . $_['calendar']["id"] . ");\"><img class=\"svg action\" src=\"../../core/img/actions/rename.svg\"></a></td><td width=\"20px\"><a href=\"#\" onclick=\"Calendar.UI.Calendar.deleteCalendar('" . $_['calendar']["id"] . "');\" title=\"" . $l->t("Delete") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/delete.svg\"></a></td>"; diff --git a/apps/calendar/templates/part.eventform.php b/apps/calendar/templates/part.eventform.php index 8a8f420f846..3830c273a73 100644 --- a/apps/calendar/templates/part.eventform.php +++ b/apps/calendar/templates/part.eventform.php @@ -10,12 +10,8 @@ <tr> <th width="75px"><?php echo $l->t("Category");?>:</th> <td> - <select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>"> - <?php - if (!isset($_['categories'])) {$_['categories'] = array();} - echo html_select_options($_['category_options'], $_['categories'], array('combine'=>true)); - ?> - </select> + <input id="category" name="categories" type="text" placeholder="<?php echo $l->t('Separate categories with commas'); ?>" value="<?php echo isset($_['categories']) ? htmlspecialchars($_['categories']) : '' ?>"> + <a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a> </td> <?php if(count($_['calendar_options']) > 1) { ?> <th width="75px"> <?php echo $l->t("Calendar");?>:</th> |