pricealarm_list.php

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