My that was a mouthful of a title :)
I'm building a website for a company and the user who log in are Reps. Not seeing the need to reinvent the window I'm extending the Member object using the code below.
Reps have a many-to-many relationship with branches. The relationship works, and if I edit a branch I can select as many reps as I need. But... I cannot get a 'Branches' tab to show up when editing a Rep (by going to 'Security' then choosing the 'Reps' group, then editing a user account)!
I'm certain this is possible and I must be doing something wrong. The error is:
ERROR [Warning]: Can't figure out the data class of Member
IN GET /admin/security/EditForm/field/Members/item/2/edit?ajax=1
Line 32 in /var/www/navs/htdocs/sapphire/forms/HasManyComplexTableField.php
and I'm not sure what a data class is - a page? A controller?
<?php
// Based off the forum module & wiki documentation
class RepsRole extends DataObjectDecorator {
function extraStatics() {
/***/
return $fields;
}
function updateCMSFields(FieldSet &$fields) {
$fields->addFieldToTab('Root.Main',new TextField("BeneficiaryNumber", "Beneficiary Number"), "Email");
$fields->addFieldToTab('Root.Main',new TextField("Website", "Website URL"), "Email");
$modulesTablefield = new ManyManyComplexTableField(
'Member',
'RepsBranches',
'BranchPage',
array(
'FirstName' => 'FirstName'
),
'getCMSFields_forPopup'
);
$modulesTablefield->setAddTitle( 'A Rep' );
$fields->addFieldToTab( 'Root.Branches', $modulesTablefield );
}
}
?>
Any help would be much appreciated.