Page 1 of 1

Migrate from CGCalendar to Lise

Posted: Sat Mar 06, 2021 11:39 am
by janvl
Hi,

i read the news "state of the project".

Having several CGCalendar-projects i would like a hint on how to start building a calendar
with Lise so i can migrate them all.

I have rebuild cgcompanydirectory with lise and OSM which is functioning well.

Regards,
Jan

Re: Migrate from CGCalendar to Lise

Posted: Sat Mar 06, 2021 3:39 pm
by DIGI3
It's not a full replacement as the backend doesn't have a calendar view or the ability to make recurring events, but JoMorg is willing to make those additions with sponsorship.

If you can manage with the backend interface being as it is now for adding events, you can create a frontend template based on fullcalendar.io (or whatever else you'd like). For a very simple site with not many events, I just made start_date and end_date datepicker fields, a checkbox for all day, and a description field, then added the events to the calendar with this in the fullcalendar init script (placed in a lise summary template):

Code: Select all

       events: [
{if $items|@count > 0}
  {foreach from=$items item=item}
        {
          {if $item->fielddefs.all_day->value == 1}allDay: true,{/if}
          start: '{$item->start_date|date_format:'Y-m-d'}T{$item->start_date|date_format:'%R'}',
          end: '{$item->end_date|date_format:'Y-m-d'}T{$item->end_date|date_format:'%R'}',
          id: '{$item->alias}',
          title: '{$item->title}',
          time: '{if $item->fielddefs.all_day->value != 1}{$item->start_date|date_format:'%l:%M%p'}{/if}',
          url: '{$item->url}',
          description: '{$item->details}',
        }{if !$items@last},{/if}
  {/foreach}
{/if}
      ]
If you have a lot of events you'll probably need something more robust to load them based on the current view, but this is a starting point.

Re: Migrate from CGCalendar to Lise

Posted: Sat Mar 06, 2021 10:13 pm
by janvl
Thank you very much.

this is about what i need, for a kindergarten and similar users.

For complex calendarprojects CGCalender did not fit anyway, a collaboration suit is a better choice then.

As soon as i have time i will try to produce a calendar this way.

Regards,
Jan