Changed edit product to redirect to the edited product.

This commit is contained in:
Karl Cordes 2011-11-14 17:13:48 +11:00
parent 14c8d56a37
commit 9984696f02
2 changed files with 3 additions and 2 deletions

View file

@ -99,7 +99,8 @@ class ProductsController extends AppController {
if (!empty($this->data)) { if (!empty($this->data)) {
if ($this->Product->save($this->data)) { if ($this->Product->save($this->data)) {
$this->Session->setFlash(__('The Product has been saved', true)); $this->Session->setFlash(__('The Product has been saved', true));
$this->redirect(array('action'=>'index')); $id = $this->Product->id;
$this->redirect(array('action'=>'view/'.$id));
} else { } else {
$this->Session->setFlash(__('The Product could not be saved. Please, try again.', true)); $this->Session->setFlash(__('The Product could not be saved. Please, try again.', true));
} }

View file

@ -267,7 +267,7 @@ $(function() {
var descText = ''; var descText = '';
if(data.item_code) { if(data.item_code) {
descText = descText + '<b>Item Code:</b> ' + data.item_code; descText = descText + '<br><b>Item Code:</b> ' + data.item_code;
} }
if(data.item_description) { if(data.item_description) {