Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Preview: Event Calendar Module

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Go to End
Author Topic: 40901 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Sounds to me like something really simple is missing. Could you provide one, some, or all of the following?

    - The website
    - The code
    - A temporary login to your CMS

  • Chucky2k
    Avatar
    Community Member
    32 Posts

    Re: Preview: Event Calendar Module Link to this post

    Thanks UncleCheese, Detail are:

    Website: www.supportact.com.au/ss/

    Code: SalEvent.php

    <?php

    class SalEvent extends CalendarEvent
    {
    static $db = array (
    'Location' => 'Varchar(100)',
    'Cost' => 'Varchar(50)',
    'RegistrationLink' => 'Varchar(100)'
    );

    static $has_one = array (
    'Image' => 'Image'
    );

    public function getCMSFields()
    {
    $f = parent::getCMSFields();
    $f->addFieldToTab("Root.Content.Main", new TextField('Location'), 'Content');
    $f->addFieldToTab("Root.Content.Main", new TextField('Cost'), 'Content');
    $f->addFieldToTab("Root.Content.Main", new TextField('RegistrationLink','Registration Link'),'Content');
    $f->addFieldToTab("Root.Content.Image", new ImageField('Image'));

    return $f;
    }
    } // end SalEvent subclass

    class SalEvent_Controller extends CalendarEvent_Controller
    {
    }

    ?>

    SalEventHolder.php

    <?php

    class SalEventHolder extends Calendar
    {
       static $has_many = array (
       'SalEvents' => 'SalEvent'
       );

       static $allowed_children = array (
       'SalEvent'
       );
    }

    class SalEventHolder_Controller extends Calendar_Controller
    {
    }

    ?>

    Thanks again

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Sigh.. This is a bug with the CollapseDatesAndTimes function which I've tried so hard to make work, but it looks like it's still not there. You probably wont' need the function, so just take it out.

    Calendar.php, Line 245

    Change this:

          if($events = $this->getStandardEvents($filter))
             $event_list = CalendarUtil::CollapseDatesAndTimes($this->getStandardEvents($filter));

    to this:

          if($events = $this->getStandardEvents($filter))
             $event_list = $events;

    That should fix it. Keep my tempuser account active in case it doesn't.

  • Chucky2k
    Avatar
    Community Member
    32 Posts

    Re: Preview: Event Calendar Module Link to this post

    That worked perfectly.

    Many thanks.

  • George
    Avatar
    Community Member
    41 Posts

    Re: Preview: Event Calendar Module Link to this post

    Is it possible and how to extend the Announcements (for example with locations)
    like it is described for Dates and Times with WorkshopDateTime?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Interesting. I did consider that for that initial release, but here was my thought process:

    "Should I make an API for the Announcement object, too? Nah, no one will ask for that feature."

    I'm hesitant to start moving things around now that is looking much closer to stable, but I'm happy to play around with it. If I add something like that, I'll let you know and you can check it out from the SVN.

  • George
    Avatar
    Community Member
    41 Posts

    Re: Preview: Event Calendar Module Link to this post

    ok. Thanks.

    I have another issue.
    Under configuration event descr behaviour and word count is not shown. (e_c svn + sv 2.3rc3)

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    I took that out in the latest version. You shouldn't need it. It was there to give users more control over the presentation, but I realized that sort of stuff doesn't belong in the CMS -- it belongs on the template.

    40901 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.