Changeset 422
- Timestamp:
- 02/03/08 18:34:08 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
2.0/trunk/app/controllers/product_images_controller.php
r421 r422 74 74 if ($this->ProductImage->save($this->data)) { 75 75 $this->Session->setFlash(__('The ProductImage has been saved', true)); 76 $this->redirect(array(' action'=>'index'));76 $this->redirect(array('controller' => 'products', 'action'=>'view', $this->data['ProductImage']['product_id'])); 77 77 } else { 78 78 $this->Session->setFlash(__('The ProductImage could not be saved. Please, try again.', true)); … … 84 84 $products = $this->ProductImage->Product->find('list'); 85 85 $this->set(compact('products')); 86 87 $product = $this->ProductImage->Product->read(null, $this->data['ProductImage']['product_id']); 88 $this->set('product', $product['Product']); 89 86 90 } 87 91 … … 91 95 $this->redirect(array('action'=>'index')); 92 96 } 97 if (empty($this->data)) { 98 $this->data = $this->ProductImage->read(null, $id); 99 } 100 93 101 if ($this->ProductImage->del($id)) { 94 102 $this->Session->setFlash(__('ProductImage deleted', true)); 95 $this->redirect(array(' action'=>'index'));103 $this->redirect(array('controller' => 'products', 'action'=>'view', $this->data['ProductImage']['product_id'])); 96 104 } 97 105 } 2.0/trunk/app/views/product_images/admin_edit.ctp
r409 r422 28 28 <?php echo $form->create('ProductImage');?> 29 29 <fieldset> 30 <legend><?php __('Edit ProductImage ');?></legend>30 <legend><?php __('Edit ProductImage for: ' . $product['name']);?></legend> 31 31 <?php 32 32 echo $form->input('id'); 33 echo $form->input('product_id'); 33 echo $form->input('product_id', array('type' => 'hidden', 'value' => $product['id'])); 34 //echo $form->input('product_id'); 34 35 echo $form->input('image'); 35 36 echo $form->input('priority');
