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?