From 574fdb190dcd1c0b187158f3c4c42899189ef29b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 11 Aug 2008 00:14:48 +0000 Subject: [PATCH] (merged from branches/roa. use "svn log -c -g " for detailed commit message) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@60287 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/ModelAdmin.php | 6 ++++-- javascript/ModelAdmin.js | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/ModelAdmin.php b/code/ModelAdmin.php index 0c20915a..6ca12606 100644 --- a/code/ModelAdmin.php +++ b/code/ModelAdmin.php @@ -167,7 +167,9 @@ abstract class ModelAdmin extends LeftAndMain { protected function ManagedModelsSelect() { $models = $this->getManagedModels(); $modelMap = array(); - foreach($models as $modelName) $modelMap[$modelName] = singleton($modelName)->singular_name(); + foreach($models as $modelName) { + if(singleton($modelName)->canCreate(Member::currentUser())) $modelMap[$modelName] = singleton($modelName)->singular_name(); + } $form = new Form( $this, @@ -616,7 +618,7 @@ class ModelAdmin_RecordController extends Controller { * @return mixed */ function doSave($data, $form, $request) { - $this->currentRecord->update($request->postVars()); + $form->saveInto($this->currentRecord); $this->currentRecord->write(); // Behaviour switched on ajax. diff --git a/javascript/ModelAdmin.js b/javascript/ModelAdmin.js index e2b5d491..4d037470 100644 --- a/javascript/ModelAdmin.js +++ b/javascript/ModelAdmin.js @@ -38,6 +38,8 @@ jQuery(document).ready(function() { function saveRecord(uri, data) { jQuery.post(uri, data, function(result){ jQuery('#right #ModelAdminPanel').html(result); + + statusMessage("Saved"); // TODO/SAM: It seems a bit of a hack to have to list all the little updaters here. // Is livequery a solution?