order_address.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Order_Address extends oxAdminDetails
00010 {
00018     public function render()
00019     {
00020         parent::render();
00021 
00022         $soxId = oxConfig::getParameter( "oxid");
00023         // check if we right now saved a new entry
00024         $sSavedID = oxConfig::getParameter( "saved_oxid");
00025         if ( ($soxId == "-1" || !isset( $soxId)) && isset( $sSavedID) ) {
00026             $soxId = $sSavedID;
00027             oxSession::deleteVar( "saved_oxid");
00028             $this->_aViewData["oxid"] =  $soxId;
00029             // for reloading upper frame
00030             $this->_aViewData["updatelist"] =  "1";
00031         }
00032 
00033         if ( $soxId != "-1" && isset( $soxId)) {
00034             // load object
00035             $oOrder = oxNew( "oxorder" );
00036             $oOrder->load( $soxId);
00037 
00038             $this->_aViewData["edit"] =  $oOrder;
00039         }
00040 
00041         $oCountryList = oxNew( "oxCountryList" );
00042         $oCountryList->loadActiveCountries( oxLang::getInstance()->getTplLanguage() );
00043 
00044         $this->_aViewData["countrylist"] = $oCountryList;
00045 
00046         return "order_address.tpl";
00047     }
00048 
00054     public function save()
00055     {
00056 
00057         $soxId      = oxConfig::getParameter( "oxid");
00058         $aParams    = oxConfig::getParameter( "editval");
00059 
00060             // shopid ??? TODO
00061             $sShopID = oxSession::getVar( "actshop");
00062             $aParams['oxorder__oxshopid'] = $sShopID;
00063 
00064         $oOrder = oxNew( "oxorder" );
00065         if ( $soxId != "-1")
00066             $oOrder->load( $soxId);
00067         else
00068             $aParams['oxorder__oxid'] = null;
00069 
00070         $oOrder->assign( $aParams);
00071         $oOrder->save();
00072 
00073         // set oxid if inserted
00074         if ( $soxId == "-1" )
00075             oxSession::setVar( "saved_oxid", $oOrder->oxorder__oxid->value);
00076 
00077         return $this->autosave();
00078     }
00079 }

Generated on Thu Dec 4 12:04:55 2008 for OXID eShop CE by  doxygen 1.5.5