I am new to this so forgive me if the subject is not too clear.
I have a site I am building in 2.10 and I am not sure how to go about getting the following information in the CMS. Basically I have a 'SlipBookingPage' that has many 'SlipBookings'
...
public static $has_many = array(
'SlipBookings' => 'SlipBooking'
);
...
A SlipBooking has one Boat
SlipBooking code:
...
public static $db = array (
'DateIn' => 'Date',
'DateOut' => 'Date',
'CradleNumber' => 'Varchar(100)',
'Confirmed' => 'Boolean'
);
public static $has_one = array(
'Boat' => 'Boat',
'SlipBookingPage' => 'Page'
);
...
And a boat has one member
Boat code
class Boat extends DataObject {
public static $db = array (
'BoatName' => 'Varchar(100)',
'BoatRegistration' => 'Varchar(20)',
'SYCPenned' => 'Int',
'BoatLength' => 'Varchar(100)',
'BoatBeam' => 'Varchar(100)',
'BoatWeight' => 'Varchar(100)',
'KeelType' => 'Enum("Kiel, No Keel, Yacht Keel")',
'ShaftType' => 'Enum("Shaft, Twin Shaft")',
'VDrive' => 'Boolean',
'Propulsion' => 'Enum("Inboard-Outboard(Leg), Twin Inboard-Outboard(Legs),Outboard, Twin Outboard")',
'CraneAccess' => 'Boolean'
);
public static $has_one = array(
'Member' => 'Member'
);
//Fields to show in the DOM table
static $summary_fields = array(
'BoatName' => 'BoatName',
'BoatRegistration' => 'BoatRegistration'
);
}
The problem I am having is getting information from the member and the boat to display in the CMS in the Popup for the HasManyComplexTableField. In the summary information I have gotten the members name and boat rego, but can't seem to get more information (eg all the boat details) in the pop up (so in the code below the mobile phone and boat length do not display in the pop up)
HasManyComplexTableField code:
...
$tablefield = new HasManyComplexTableField(
$this,
'SlipBookings',
'SlipBooking',
array(
'Member.FirstName' => 'First Name',
'Member.Surname' => 'Surname',
'Boat.BoatRegistration' => 'Boat Rego',
'DateIn' => 'Date In',
'DateOut' => 'Date Out',
'CradleNumber' => 'Cradle Number',
'Confirmed' => 'Confirmed'
),
new FieldSet(
new TextField( 'CradleNumber', 'Cradle Number'),
$dateField,
$dateField2,
new CheckboxField( 'Confirmed', 'Confirmed' ),
new TextField( 'Member.MobilePhone', 'Mobile'),
new TextField( 'BoatLength', 'Length'))
);
....
If anyone can point me in the right direction of how to achieve this, that would be awesome!
Thanks