Hi Willr
Thanks for responding, the site is in dev mode but alas i'm getting no errors at all apart from just http 500 error no log files or anything. In firefox with firebug there is nothing either, below is the code for the php page, if i remove the implements mappable it works fine?
class MemberTeamExtension extends DataObjectDecorator implements Mappable {
public function extraStatics() {
return array (
'db' => array (
'DOB' => 'Date',
'Address' => 'Varchar',
'Town' => 'Varchar',
'Postcode' => 'Varchar',
'DefaultNum' => 'Varchar',
'HomeNum' => 'Varchar',
'OtherNum' => 'Varchar',
'Callsign' => 'Varchar(20)',
'KSAROperational' => "Enum('No, Yes')",
'Sector' => "Enum('Sector2, Sector3, Sector4, Sector5, Sector6, No Sector')",
'RecieveEmail' => 'Boolean',
'JacketSize' => "Enum('Size, XS, S, M, L, XL, XXL, XXXL', 'Size')",
'ShirtSize' => "Enum('Size, XS, S, M, L, XL, XXL, XXXL' , 'Size')",
'PoliceVetted' => 'Boolean',
'Lat' =>'Varchar',
'Lon' =>'Varchar'
),
'has_one' => array (
'Photo' => 'Image'
),
'has_many' => array (
'Course' => 'Course',
'SignedOut' => 'SignedOut',
'StageAchieved' => 'StageAchieved'
),
'many_many' => array (
'Roles' => 'Role'
),
'summary_fields' => array(
'Sector' => 'Sector',
'DefaultNum' => 'Number',
'Postcode' => 'Postcode',
'Town' => 'Town',
'RecieveEmail' => 'Recieve Email',
)
);
}
public function updateCMSFields( FieldSet &$fields )
{
$fields->addFieldToTab("Root.Main", $dateField = new DateField("DOB","Date of Birth"));
$dateField->setConfig('showcalendar', true);
$fields->addFieldToTab( "Root.KSAR", new OptionSetField('Sector','Choose a Sector', singleton('Member')->dbObject('Sector')->enumValues()));
$fields->addFieldToTab( "Root.KSAR", new DropDownField( "KSAROperational", "KSAR Operational", singleton('Member')->dbObject('KSAROperational')->enumValues()));
$fields->addFieldToTab( "Root.Main", $upload = new ImageUploadField('Photo', 'Photo'));
$upload->uploadFolder = 'assets/Uploads/Images/TeamMembers';
$fields->removeByName('Lat');
$fields->removeByName('Lon');
$fields->addFieldToTab("Root.Location", new LatLongField(array(
new TextField('Lat','Latitude'),
new TextField('Lon','Longitude')
),
array('Postcode')
));
$fields->removeByName('Roles');
$fac = DataObject::get("Role");
$map = $fac->map('ID','Title');
$fields->addFieldToTab( "Root.KSAR", new CheckboxSetField( 'Roles', 'Role', $map));
$fields->removeByName("PublicFieldsRaw");
$fields->removeByName("DateFormat");
$fields->removeByName("TimeFormat");
$fields->removeByName("Locale");
if(!Member::currentUser()->isAdmin()){
$fields->removeFieldFromTab("Root", "Groups");
$fields->removeFieldFromTab("Root", "Permissions");
}
}
function MyCourses() {
$ID = $this->owner->ID;
return DataObject::get( "Course", "MemberID = '$ID'" );
}
function MyCallouts() {
$ID = $this->owner->ID;
return DataObject::get( "SearchTeam", "MemberID = '$ID'" );
}
function MyKit() {
$ID = $this->owner->ID;
return DataObject::get( "SignedOut", "MemberID = '$ID'" );
}
}
regards
Mick