Mage_Adminhtml_Sales_Order_View_GiftmessageController Class Reference

Inheritance diagram for Mage_Adminhtml_Sales_Order_View_GiftmessageController:

Mage_Adminhtml_Controller_Action Mage_Core_Controller_Varien_Action

List of all members.

Public Member Functions

 saveAction ()

Protected Member Functions

 _construct ()
 _getGiftmessageSaveModel ()


Detailed Description

Definition at line 35 of file GiftmessageController.php.


Member Function Documentation

_construct (  )  [protected]

Additional initialization

Reimplemented from Mage_Core_Controller_Varien_Action.

Definition at line 41 of file GiftmessageController.php.

00042     {
00043         $this->setUsedModuleName('Mage_Sales');
00044     }

_getGiftmessageSaveModel (  )  [protected]

Retrieve gift message save model

Returns:
Mage_Adminhtml_Model_Giftmessage_Save

Definition at line 74 of file GiftmessageController.php.

00075     {
00076         return Mage::getSingleton('adminhtml/giftmessage_save');
00077     }

saveAction (  ) 

Definition at line 46 of file GiftmessageController.php.

00047     {
00048         try {
00049             $this->_getGiftmessageSaveModel()
00050                 ->setGiftmessages($this->getRequest()->getParam('giftmessage'))
00051                 ->saveAllInOrder();
00052         } catch (Mage_Core_Exception $e) {
00053             $this->_getSession()->addError($e->getMessage());
00054         } catch (Exception $e) {
00055             $this->_getSession()->addError(Mage::helper('giftmessage')->__('Error while saving gift message'));
00056         }
00057 
00058         if($this->getRequest()->getParam('type')=='order_item') {
00059             $this->getResponse()->setBody(
00060                  $this->_getGiftmessageSaveModel()->getSaved() ? 'YES' : 'NO'
00061             );
00062         } else {
00063             $this->getResponse()->setBody(
00064                 Mage::helper('giftmessage')->__('Gift message has been successfully saved')
00065             );
00066         }
00067     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:29 2009 for Magento by  doxygen 1.5.8