Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

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

Event Calendar upgrade, extended CalendarDateTime field disappears


Reply


3 Posts   1192 Views

Avatar
toddm

Community Member, 15 Posts

31 August 2009 at 8:26am

Hi,

I recently upgrade SS to 2.3.3 and then pulled down the latest Event Calendar code from SVN. I had some extension classes working nicely, but now there are issues.

In particular, how do I get my custom field to show up in the Date popup?

Example:

<?php
class CourseOrEventDateTime extends CalendarDateTime
{
static $db = array (
'Location' => 'Varchar(50)'
);

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

   public function extendTable()
   {
    $this->addTableTitles(array(
    'Location' => 'Location'
    ));
    $this->addTableFields(array(
    'Location' => 'TextField'
    ));
   }
}
?>

How do I get "Location" to appear in the pop-up?

Todd

Avatar
toddm

Community Member, 15 Posts

31 August 2009 at 8:48am

Edited: 31/08/2009 8:48am

Wouldn't you know it, right after I post I find a "solution". Or is the following a hack?

   public function extendTable()
   {
    $this->addTableTitles(array(
    'Location' => 'Location'
    ));
    $this->addTableFields(array(
    'Location' => 'TextField'
    ));
    $newpopup = new TextField('Location');
    $this->addPopupField($newpopup);
   }

Avatar
UncleCheese

4085 Posts

31 August 2009 at 10:31am

Yeah, the addTableField() method is somewhat deprecated. I eventually want EventCalendar to require DataObjectManager, making the old TableFields useless. So what you did is correct. addPopupField() and addPopupFields() are what you should be using.