English 中文(简体)
How to show custom events to a Kronolith calendar
原标题:

I want to show events from an external source in the Kronolith calendar views. I don t want to do this by exporting the events to iCal and then showing them as an external calendar. The events are grouped in multiple calendars, the user should be able to disable/enable these calendars.

最佳回答

You can do this by implementing the listTimeObjects and listTimeObjectCategories API calls. Nag (task list) and Whups (ticket tracking) do it this way. If you are using the Git version, you can use TimeObjects, which wraps everything up in a nice class.

Kronolith calls these functions in initialize() (when filling $all_external_calendars) and listEvents(). It searches all APIs for this function, so you can register it with your own prefix.

timeObject is a generic name for "things that can be shown on a calendar", like events, task due dates, ... A timeObjectCategory is a group of timeObjects, which can be enabled or disabled in a group by the user. (In the default layout: using the panel in the upper-right corner of the calendar view, "Calendars".)

Your implementation for listTimeObjectCategories should return an array, with a category id as the key, and the user-visible name as the value. The category id s are also shown at the bottom of the calendar, and the user can define colors for them.

listTimeObjects is called with the currently selected categories (an array of id s), and a start and end date. These dates might already be Horde_Date objects (to be sure, convert them again: $start = new Horde_Date($start)).

You should return an array of timeObjects that belong to these categories and fall in the specified time range. The keys are event id s, the values are arrays with values for the following keys:

  • id
  • title
  • description
  • start (Horde_Date or timestamp)
  • end (Horde_Date or timestamp)
  • category (Category id)
  • params

If you register the show API call, this will be used for creating the link to the timeObject detail.

问题回答

暂无回答




相关问题
Java Checking number months

I think I figure out what question I am trying to ask I dont want get(Calendar.MONTH) I want the month not to be greater than the last caldendar month that is why i am doing month -1, i realize that ...

How to show custom events to a Kronolith calendar

I want to show events from an external source in the Kronolith calendar views. I don t want to do this by exporting the events to iCal and then showing them as an external calendar. The events are ...

How to reset a field when changing a date ui.datepicker.js

I m using ui.datepicker.js I have a form and when the date is changed I want that another field reset the status (this field is a dropdown select box). The case is the following: The user enter the ...

Calendar returns wrong month [duplicate]

Calendar rightNow = Calendar.getInstance(); String month = String.valueOf(rightNow.get(Calendar.MONTH)); After the execution of the above snippet, month gets a value of 10 instead of 11. How come?

How to determine if date/time is EDT or EST in Java?

I have a PDF that users must complete. The PDF has date and time fields on it. The PDF instructs the users to input the date and time in Eastern format (Not EST or EDT). When the user completes the ...

热门标签