Hi, everybody,

I'm trying to construct a simple corporative organizer, so one needs for a certain date to display a list of timeslots (say, every half hour). Inside every timeslot threre is, if exists, list of tasks with diffrent fields.

Something like this:

17 June 2015

10:00
Task: Drink
Responsible: Name
Status: pending
11:00

12:00
Task: clean the processor
Responsible: Name
Status: in progress

and so on.

If a timeslot is empty then by clicking on the hour numbers one can create new entity with a task for _given_ time and date.
The initial idea was to create a view with a field for hours and a field via Views Field View (https://www.drupal.org/project/views_field_view), i.e. view inside view. This secondary view gets timeslot and date through arguments and displays tasks fields for given date and timeslot.

An obstacle is that Views can display and link only existing entities, so that in order to show hours I have to generate an entity (say, node with Date field) for every time slot. i.e. about 20 entities per day, 600 per month and so on for many years in forward. Pretty much.

The calendar modules (Calendar, Events Calendar. Full Calendar) do not allow to create an event for given time/date by clicking.
The Booking Time Slots module uses a JS to determine the mouse cursor position at the click and to identify the timeslot, but otherwise is not suitable.

Thus, the question is: How to display with Views a list of timeslots for given date with link to node creation?

Comments

tolegu’s picture

the problem has been solved by use of hook_views_pre_render().
The list of 'empty' timeslots can be added to $view->result. Links are to be added in the views edit form ('Rewrite the output').