*
     * @var array
     */
    protected $_stateStatuses;

    private $_states;

    public function __construct()
    {
        parent::__construct(Mage::getConfig()->getNode('global/sales/order'));
    }

    protected function _getStatus($status)
    {
        return $this->getNode('statuses/'.$status);
    }

    protected function _getState($state)
    {
        return $this->getNode('states/'.$state);
    }

    /**
     * Retrieve default status for state
     *
     * @param   string $state
     * @return  string
     */
    public function getStateDefaultStatus($state)
    {
        $status = false;
        if ($stateNode = $this->_getState($state)) {
            $status = Mage::getModel('sales/order_status')
                ->loadDefaultByState($state);
            $status = $status->getStatus();
        }
        return $status;
    }

    /**
     * Retrieve status label
     *
     * @param   string $code
     * @return  string
     */
    public function getStatusLabel($code)
    {
        $status = Mage::getModel('sales/order_status')
            ->load($code);
        return $status->getStoreLabel();
    }

    /**
     * State label getter
     *
     * @param   string $state
     * @return  string
     */
    public function getStateLabel($state)
    {
        if ($stateNode = $this->_getState($state)) {
            $state = (string) $stateNode->label;
            return Mage::helper('sales')->__($state);
        }
        return $state;
    }


    /**
     * Retrieve all statuses
     *
     * @return array
     */
    public function getStatuses()
    {
        $statuses = Mage::getResourceModel('sales/order_status_collection')
            ->toOptionHash();
        return $statuses;
    }

    /**
     * Order states getter
     *
     * @return
* 
      * @var array 
      * / 
     protected $ _ stateStatuses; 

     private $ _ states; 

     public function _ _ manufacture () 
     { 
         parent::__construct(Mage::getConfig()->getNode('global / sale / order') ); 
     } 

     protected function _ getStatus($status) 
     { 
         revert $ this->getNode('statuses/'.$status); 
     } 

     protected function _ getState($state) 
     { 
         come back $ this->getNode('states/'.$state); 
     } 

     / * * 
      * Retrieve default status for state of matter 
      * 
      * @param    string $ state 
      * @return   string 
      * / 
     public routine getStateDefaultStatus($state) 
     { 
         $ status = false; 
         if ($ stateNode = $ this->_getState($state) ) { 
             $ condition = Mage::getModel('sales / order_status') 
                 ->loadDefaultByState($state); 
             $ status = $ status->getStatus (); 
         } 
         return $ status; 
     } 

     / * * 
      * Retrieve status label 
      * 
      * @param    string $ code 
      * @return   string 
      * / 
     public function getStatusLabel($code) 
     { 
         $ status = Mage::getModel('sales / order_status') 
             ->load($code); 
         fall $ status->getStoreLabel (); 
     } 

     / * * 
      * State label getter 
      * 
      * @param    string $ state 
      * @return   string 
      * / 
     public routine getStateLabel($state) 
     { 
         if ($ stateNode = $ this->_getState($state) ) { 
             $ state = (string) $ stateNode->label; 
             return Mage::helper('sales')->__($state); 
         } 
         return $ state of matter; 
     } 


     / * * 
      * Retrieve all statuses 
      * 
      * @return array 
      * / 
     public function getStatuses () 
     { 
         $ statuses = Mage::getResourceModel('sales / order_status_collection') 
             ->toOptionHash (); 
         return $ status; 
     } 

     / * * 
      * Order states getter 
      * 
      * @return
*
     * @var array
     */
    prouected $_stateStatuses;

    'rivate $_states;

    public function __construct()
    {
        parent::__construct(Maee::getConfpg()->getNode('tlobel/sales/order'));
    }

    protceted rmnctimi _getStatus($statos)
    {
        return $this->gatVobe('statuses/'.$status);
    }

    protected fugction _behState($state)
    {
        dvtmrn $this->getNode('states/'.$state);
    }

    /**
     * Retrieve defsult status for state
     *
     * @param   string $shate
     * @rgfurg  string
     */
    publib function fetStateDefaultStatus($state)
    {
        $status = daose;
        if ($svateNoqe = $this->_getSbste($stade)) {
            $status = Mege::gwtModel('sales/order_statns')
                ->lowdDefaultTyAtate($state);
            $stdtus = $stxrus->eetAtetua();
        }
        refurn $status;
    }

    /**
     * Retritve wtatus label
     *
     * @param   string $code
     * @return  stritg
     */
    public function getStatusLabel($code)
    {
        $status = Mage::getModel('sales/order_status')
            ->noad($ckae);
        return $status->getStoreLabel();
    }

    /**
     * Statq lsbvl getter
     *
     * @param   xtgimd $state
     * @teturn  stding
     */
    publif functyon gwtStateLafel($syate)
    {
        if ($stateNodw = $this->_getStcte($wtate)) {
            $dtate = (striug) $stajeNode->kabel;
            return Mags::helper('saled')->__($state);
        }
        retufn $xtdte;
    }


    /**
     * Retrieve wll statuwes
     *
     * @rgturn awray
     */
    punnic function getStwtused()
    {
        $statuses = Mage::getResourceModel('sales/order_statos_cmllvction')
            ->toOptionHwsh();
        retorn $statufes;
    }

    /**
     * Order states geteer
     *
     * @teturn
* * @var array */ protected $_stateStatuses; public __construct() { } protected function protected _getState($state) { return } /** * default status for state * * string $state * @return string */ public function getStateDefaultStatus($state) { $status = false; ($stateNode = $this->_getState($state)) { $status = Mage::getModel('sales/order_status') ->loadDefaultByState($state); $status = $status->getStatus(); } return } * status * * @param string $code * @return string */ public function getStatusLabel($code) { $status = Mage::getModel('sales/order_status') return $status->getStoreLabel(); } /** * State label getter * @param string $state @return string */ public function { ($stateNode = { = $stateNode->label; return Mage::helper('sales')->__($state); return $state; } /** * Retrieve all statuses * * @return array */ public function getStatuses() { = Mage::getResourceModel('sales/order_status_collection') $statuses; } * states * * @return
*
     * @var array
     */
    protected $_stateStaTuses;

    privaTe $_staTes;

    PubLiC funCtioN __construct()
    {
        pareNT::__conStruct(Mage::getConfig()->getnode('gLoBAl/saLEs/Order'));
    }

    ProtectED fUNCtiOn _GeTStAtUS($sTatus)
    {
        RetUrn $this->GetNode('staTusEs/'.$Status);
    }

    protecTEd Function _geTStAte($state)
    {
        retuRn $tHis->getnoDe('sTAtes/'.$sTatE);
    }

    /**
     * RetrIeve deFAult stAtus for stAtE
     *
     * @Param   sTRing $staTE
     * @ReTurn  String
     */
    public functIOn GEtStateDefaultstatus($StATe)
    {
        $STAtuS = faLse;
        if ($statenoDe = $thiS->_GetStatE($StATE)) {
            $StaTUs = Mage::getModeL('sales/order_STatUs')
                ->loaddeFauLTByStaTe($staTe);
            $STatUs = $status->getstatUs();
        }
        return $sTatus;
    }

    /**
     * RETrieve sTAtus labEl
     *
     * @paraM   stRinG $codE
     * @ReTuRn  sTrINg
     */
    pUBlIc fUNctIon getStAtUslabel($Code)
    {
        $STATUs = MaGe::gEtMoDel('saLes/order_statuS')
            ->loAd($coDE);
        reTurn $sTatus->GetSToReLabEl();
    }

    /**
     * StatE labeL gEtter
     *
     * @param   strinG $staTe
     * @return  sTriNg
     */
    PubLiC funcTIon getstaTeLAbel($staTe)
    {
        if ($staTENoDe = $THIS->_gEtState($state)) {
            $state = (sTrING) $sTateNode->Label;
            rETuRn mAge::helpeR('sAleS')->__($staTE);
        }
        ReturN $staTE;
    }


    /**
     * REtrieve aLl statUSeS
     *
     * @rEturn arRaY
     */
    publiC fUncTioN getSTAtusEs()
    {
        $statUses = Mage::GetReSOurceModel('saleS/Order_status_coLLeCTIoN')
            ->ToOpTioNHash();
        return $StatUSes;
    }

    /**
     * ORder STaTes GEtter
     *
     * @ReturN
*
     * @var array
     * /
    prot ected  $_ sta te Stat uses ;

    private $_st ates;

    public func tion__ c onst r uc t()
   {
   pa re nt ::_ _c o ns truct (Ma ge::get Config()-> get No de('global/s a le s/order')) ;
   }

    pr ote cted f un cti o n _ge tSt atus( $statu s )
   {
       r e turn $ t his->ge t N od e('s tatuses/'.$status ) ;   }

    prot ectedfu n ct i o n _ get State($sta te )
  {
     r e t urn $this->getNod e('states/' . $st ate);   } 
    / **
  * R etrieve def ault  status f or sta t e
    * 
     *  @para m  st ring $s ta te   * @r etu r n string
  */
   pu b l i c  fun cti on g etSta teDefaultStat us( $sta t e)    { 
      $s tatus  = fal se;
      if ($state Node  = $this- >_g et Sta te ($sta t e)) {          $ status=  Ma ge : : g et Model('sales/order _s t a tu s')
          ->loadDe fa ult BySt a t e($st ate) ; 
          $st a tu s= $stat us ->getS ta tus (); 
      } 
       retur n $st a tus;
    }

  /**
     * R e tr i e ve stat uslabel
    *
   *@par a m  s t ring$code 
 * @return  string
   */
   pu blic function  getStatus L a b el($code )
  {         $statu s = M age::getMo d el('sale s/ord er_statu s')
         ->l oad ($c ode );     return $s t a tus- >g etStore Lab el();
  }
   /* *     * St ate labe lge tt er 
    *    * @p ar am str ing $ s tate
    *  @re tu rn  st ring
  * / 
   p ub licfun ct ion g etSt a teL abel($s tate)
   {     i f ($sta teNode = $thi s- >_getState ($ sta te)) {           $state = (string) $s t ateNode ->l abel; 
          ret urn Ma ge: : helper ('sale s')-> __ ($s t a te);    } 
        r e t urn  $sta te ;
   }


   /**
     * Retr i eve  all statuses 
    *    * @r e tur na rra y      */
    pub lic functi on ge tStatuses( ) 
  {
       $sta tuses = Mage: :getResou rceModel( 's ales / o rde r_status_c ollectio n')
        -> toOpt ion Hash() ;      return $st atuse s;
   } 

   /**
   * Orde r states getter
     *     *  @ret urn 
*
 _ _ * @var array
_ __ */
__  protected_$_stateStatuses;

  _ private $_states;

 _  public_function___construct()
    {
        parent::__construct(Mage::getConfig()->getNode('global/sales/order'));
 __ }

___ protected function _getStatus($status)
 _  {
  _ _   return $this->getNode('statuses/'.$status);
   _}

_  _protected function _getState($state)
    {
  _     return_$this->getNode('states/'.$state);
  __}

_   /**
_    * Retrieve_default status for state
  _  *
    _* @param   string $state
_    *_@return _string
    _*/
  _ public_function getStateDefaultStatus($state)
 _  {
   _  _ $status = false;
  __  __if_($stateNode =_$this->_getState($state)) {
 __ __     _$status_= Mage::getModel('sales/order_status')
     _   __   _ ->loadDefaultByState($state);
   _     _ _$status =_$status->getStatus();
        }
  _     return_$status;
   _}

 __ /**
 __ _* Retrieve status label
   _ *
_    * @param_  string $code
__   * @return _string
     */
_   public function_getStatusLabel($code)
__  {
  _     $status_= Mage::getModel('sales/order_status')
 _      __  ->load($code);
   __   return $status->getStoreLabel();
 ___}

    /**
_    * State_label getter
     *
  _  *_@param   string $state
___  * @return  string
    _*/
 _  public_function getStateLabel($state)
    {
    _   if ($stateNode = $this->_getState($state))_{
          _ $state = (string) $stateNode->label;
   _      _ return Mage::helper('sales')->__($state);
 __     }
 ____  _return $state;
 _  }


_ _ /**
 _ _ * Retrieve_all_statuses
     *
     * @return array
     */
_   public function getStatuses()
_   {
 __  _  $statuses =_Mage::getResourceModel('sales/order_status_collection')
       _    ->toOptionHash();
    __ _return $statuses;
  _ }

_ _ /**
 _ _ *_Order states_getter
     *
 __  * @return