pricealarm_list.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class PriceAlarm_List extends oxAdminList
00009 {
00014     protected $_sThisTemplate = 'pricealarm_list.tpl';
00015 
00021     protected $_sListClass = 'oxpricealarm';
00022 
00028     protected $_sDefSortField = "oxuserid";
00029 
00037     protected function _buildSelectString( $oListObject = null )
00038     {
00039         $sViewName = getViewName( "oxarticles", (int) $this->getConfig()->getConfigParam( "sDefaultLang" ) );
00040         $sSql  = "select oxpricealarm.*, {$sViewName}.oxtitle AS articletitle, ";
00041         $sSql .= "oxuser.oxlname as userlname, oxuser.oxfname as userfname ";
00042         $sSql .= "from oxpricealarm left join {$sViewName} on {$sViewName}.oxid = oxpricealarm.oxartid ";
00043         $sSql .= "left join oxuser on oxuser.oxid = oxpricealarm.oxuserid WHERE 1 ";
00044 
00045         return $sSql;
00046     }
00047 
00053     public function buildWhere()
00054     {
00055         $this->_aWhere = parent::buildWhere();
00056         $sViewName = getViewName( "oxpricealarm" );
00057         $sArtViewName = getViewName( "oxarticles" );
00058 
00059         // updating price fields values for correct search in DB
00060         if ( isset( $this->_aWhere[$sViewName.'.oxprice'] ) ) {
00061             $sPriceParam = (double) str_replace( array( '%', ',' ), array( '', '.' ), $this->_aWhere[$sViewName.'.oxprice'] );
00062             $this->_aWhere[$sViewName.'.oxprice'] = '%'. $sPriceParam. '%';
00063         }
00064 
00065         if ( isset( $this->_aWhere[$sArtViewName.'.oxprice'] ) ) {
00066             $sPriceParam = (double) str_replace( array( '%', ',' ), array( '', '.' ), $this->_aWhere[$sArtViewName.'.oxprice'] );
00067             $this->_aWhere[$sArtViewName.'.oxprice'] = '%'. $sPriceParam. '%';
00068         }
00069 
00070 
00071         return $this->_aWhere;
00072     }
00073 
00074 }