mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX Don't re-add actions in ModelAdmin->EditForm if they're already present from DataObject->getCMSFields()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@114143 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e1a270a0b1
commit
c579822340
@ -947,13 +947,17 @@ class ModelAdmin_RecordController extends Controller {
|
||||
|
||||
$actions = $this->currentRecord->getCMSActions();
|
||||
if($this->currentRecord->canEdit(Member::currentUser())){
|
||||
$actions->push(new FormAction("doSave", _t('ModelAdmin.SAVE', "Save")));
|
||||
if(!$actions->fieldByName('action_doSave') && !$actions->fieldByName('action_save')) {
|
||||
$actions->push(new FormAction("doSave", _t('ModelAdmin.SAVE', "Save")));
|
||||
}
|
||||
}else{
|
||||
$fields = $fields->makeReadonly();
|
||||
}
|
||||
|
||||
if($this->currentRecord->canDelete(Member::currentUser())) {
|
||||
$actions->insertFirst($deleteAction = new FormAction('doDelete', _t('ModelAdmin.DELETE', 'Delete')));
|
||||
if(!$actions->fieldByName('action_doDelete')) {
|
||||
$actions->insertFirst($deleteAction = new FormAction('doDelete', _t('ModelAdmin.DELETE', 'Delete')));
|
||||
}
|
||||
$deleteAction->addExtraClass('delete');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user