CMS MADE SIMPLE FORGE

EventsManager

 

[#8800] Calendar View and Combining by Date

avatar
Created By: Robert Hunt (mrenigma)
Date Submitted: 2013-01-02 11:18

Assigned To: Mathieu Muths (airelibre) (airelibre)
Resolution: None
State: Open
Summary:
Calendar View and Combining by Date
Detailed Description:
I would like to see a calendar view added to this module (possibly using
CGCalendar as the base?). Since it is an events module, it would be handy to see
the events for the month, week etc...

It would also be handy if you could combine events by their start/end date and
then group display them per date, so the array could end up like:

Events (
 YEAR-MONTH-DAY (
  event (
   id,
   title,
   description,
   start_time,
   end_time,
   ---
  ),
  event (
   ...
  )
 ),
 YEAR-MONTH-DAY (
  ...
 )
)

With events spanning multiple days multiplied appropriately. This would be
useful to in combination with a calendar event view to get a quick overview of a
days events etc.

History

Comments
avatar
Date: 2013-01-14 10:19
Posted By: luca clemenzi (clemmy)

Hi, I second Robert Hunt request, this is would be very useful also to me.

So far I achieved the final result with a temporary solution, that I reported in
the forum here http://forum.cmsmadesimple.org/viewtopic.php?f=7&t=61756 But I
don't like it because it calls the EventManager module 30-31 times: one per day!
I think it's really too much!

What I did is altering the CGCalendar montlhy template so the it calls the
EventManager module to retrieve and display the events of each day. But as I
said, there is one call to EventManager per day. I use this system in two pages
of my website, in one it's working very good. In the other one is working only
sometimes, I don't know why. Many there is some sort of overload on the server.

I think my problems would be solved if I could place just one call to the
EventManager module and retrieve all the events of the current month. Then
storing the information in some sort of array and display it conveniently. But
so far I'm stuck.
      
avatar
Date: 2013-01-14 10:22
Posted By: Mathieu Muths (airelibre) (airelibre)

Hi,

I think you can do that all in Smarty, with the "start_datetime" and
"end_datetime" params

But I'll see if I can add some useful things in the module to handle such a
view.
      
avatar
Date: 2013-01-15 06:05
Posted By: luca clemenzi (clemmy)

Hi Mathieu, thanks for your reply.

I'm already doing it using the "start_datetime" and "end_datetime" parameters,
but still I'm doing one call per day.

In my calendar template I have a "foreach" loop which iterate through the day of
the month and calls the EventManager module like this {EventsManager
summarytemplate="mytemplate" show='custom' start_datetime="$year-$month-$key
00:00:00" end_datetime="$year-$month-$key 23:59:59"}. $year and $month remain
the same, but $key varies from 01 to 31 (or 30, or 28, depending on the month)
and EventManager is called once per day.


Eg, for building the January calendar, my template calls the module like this:

{EventsManager summarytemplate="mytemplate" show='custom'
start_datetime="2013-01-01 00:00:00" end_datetime="2013-01-01 23:59:59"} for the
first day of the month

then

{EventsManager summarytemplate="mytemplate" show='custom'
start_datetime="2013-01-02 00:00:00" end_datetime="2013-01-02 23:59:59"} for the
second day of the month

then

{EventsManager summarytemplate="mytemplate" show='custom'
start_datetime="2013-01-03 00:00:00" end_datetime="2013-01-03 23:59:59"} for the
third day of the month


and so on, up to the 

{EventsManager summarytemplate="mytemplate" show='custom'
start_datetime="2013-01-31 00:00:00" end_datetime="2013-01-31 23:59:59"} for the
last day of the month


In one page it's working very well, but in another page it happens that the
events are not retrieved. I don't know why, it's completely random, so I suspect
some sort of server-side overload/timeout due to the multiple calls. So I'd like
to modify my template, so that is calls the module just once, eg. like this
{EventsManager summarytemplate="mytemplate" show='custom'
start_datetime="2013-01-01 00:00:00" end_datetime="2013-01-31 23:59:59"} and to
store all the events in an array. Then build the calendar and fill in the events
of the days retrieving the events from the array. I think in php it's easily
done, but my knowledge of smarty is still poor and I'm stuck.

Do you think this solution would put less overload on the server?


      
Updates

Updated: 2013-01-02 11:18
resolution_id: => 5
assigned_to_id: 100 => 13536