/** * Executes parent method parent::render(), passes data to Smarty engine * and returns name of template file "list_review.tpl". * * @return string */ public function render() { oxAdminList::render(); $this->_aViewData["menustructure"] = $this->getNavigation()->getDomXml()->documentElement->childNodes; $this->_aViewData["articleListTable"] = getViewName('oxarticles'); return "list_review.tpl"; }
/** * Adds active promotion check * * @param array $aWhere SQL condition array * @param string $sqlFull SQL query string * * @return $sQ */ protected function _prepareWhereQuery($aWhere, $sqlFull) { $sQ = parent::_prepareWhereQuery($aWhere, $sqlFull); $sDisplayType = (int) oxRegistry::getConfig()->getRequestParameter('displaytype'); $sTable = getViewName("oxactions"); //searchong for empty oxfolder fields if ($sDisplayType) { $sNow = date('Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime()); switch ($sDisplayType) { case 1: // active $sQ .= " and {$sTable}.oxactivefrom < '{$sNow}' and {$sTable}.oxactiveto > '{$sNow}' "; break; case 2: // upcoming $sQ .= " and {$sTable}.oxactivefrom > '{$sNow}' "; break; case 3: // expired $sQ .= " and {$sTable}.oxactiveto < '{$sNow}' and {$sTable}.oxactiveto != '0000-00-00 00:00:00' "; break; } } return $sQ; }
/** * Calls parent::render() and returns name of template to render * * @return string */ public function render() { $oTheme = oxNew('oxtheme'); parent::render(); // assign our list $this->_aViewData['mylist'] = $oTheme->getList(); return 'theme_list.tpl'; }
/** * Deletes selected Voucherserie. * * @return null */ public function deleteEntry() { // first we remove vouchers $oVoucherSerie = oxNew("oxvoucherserie"); $oVoucherSerie->load($this->getEditObjectId()); $oVoucherSerie->deleteVoucherList(); parent::deleteEntry(); }
/** * Returns sorting fields array * * @return array */ public function getListSorting() { $aSorting = parent::getListSorting(); if (isset($aSorting["oxnews"][$this->_sDefSortField])) { $this->_blDesc = true; } return $aSorting; }
/** * Returns sorting fields array. We extend this method for getting a second order by, which will give us not the * undefined order behind the "active" countries. * * @return array */ public function getListSorting() { $aListSorting = parent::getListSorting(); if (array_keys($aListSorting['oxcountry']) === array('oxactive')) { $aListSorting['oxcountry'][$this->_getSecondSortFieldName()] = 'asc'; } return $aListSorting; }
/** * Calls parent::render() and returns name of template to render * * @return string */ public function render() { $sModulesDir = $this->getConfig()->getModulesDir(); $oModuleList = oxNew("oxModuleList"); $aModules = $oModuleList->getModulesFromDir($sModulesDir); parent::render(); // assign our list $this->_aViewData['mylist'] = $aModules; return 'module_list.tpl'; }
/** * Adding folder check and empty folder field check. * * @param array $aWhere SQL condition array * @param string $sqlFull SQL query string * * @return string */ protected function _prepareWhereQuery($aWhere, $sqlFull) { $sQ = parent::_prepareWhereQuery($aWhere, $sqlFull); $sFolder = oxRegistry::getConfig()->getRequestParameter('folder'); $sViewName = getviewName("oxcontents"); //searchong for empty oxfolder fields if ($sFolder == 'CMSFOLDER_NONE' || $sFolder == 'CMSFOLDER_NONE_RR') { $sQ .= " and {$sViewName}.oxfolder = '' "; } elseif ($sFolder && $sFolder != '-1') { $sFolder = oxDb::getDb()->quote($sFolder); $sQ .= " and {$sViewName}.oxfolder = {$sFolder}"; } return $sQ; }
/** * Executes parent method parent::render(), gets entries with authors * and returns template file name "admin_guestbook.tpl". * * @return string */ public function render() { parent::render(); $oList = $this->getItemList(); if ($oList && $oList->count()) { $oDb = oxDb::getDb(); foreach ($oList as $oEntry) { // preloading user info .. if (isset($oEntry->oxgbentries__oxuserid) && $oEntry->oxgbentries__oxuserid->value) { $oEntry->oxuser__oxlname = new oxField($oDb->getOne("select oxlname from oxuser where oxid=" . $oDb->quote($oEntry->oxgbentries__oxuserid->value))); } } } $this->_aViewData["mylist"] = $oList; return $this->_sThisTemplate; }
/** * Builds and returns array of SQL WHERE conditions * * @return array */ public function buildWhere() { $this->_aWhere = parent::buildWhere(); $sViewName = getViewName("oxpricealarm"); $sArtViewName = getViewName("oxarticles"); // updating price fields values for correct search in DB if (isset($this->_aWhere[$sViewName . '.oxprice'])) { $sPriceParam = (double) str_replace(array('%', ','), array('', '.'), $this->_aWhere[$sViewName . '.oxprice']); $this->_aWhere[$sViewName . '.oxprice'] = '%' . $sPriceParam . '%'; } if (isset($this->_aWhere[$sArtViewName . '.oxprice'])) { $sPriceParam = (double) str_replace(array('%', ','), array('', '.'), $this->_aWhere[$sArtViewName . '.oxprice']); $this->_aWhere[$sArtViewName . '.oxprice'] = '%' . $sPriceParam . '%'; } return $this->_aWhere; }
/** * Executes parent method parent::render(), gets entries with authors * and returns template file name "admin_guestbook.tpl". * * @return string */ public function render() { parent::render(); $oList = $this->getItemList(); if ($oList && $oList->count()) { $oDb = oxDb::getDb(); foreach ($oList as $oEntry) { // preloading user info .. $sUserIdField = 'oxgbentries__oxuserid'; $sUserLastNameField = 'oxuser__oxlname'; if (isset($oEntry->{$sUserIdField}) && $oEntry->{$sUserIdField}->value) { $sSql = "select oxlname from oxuser where oxid=" . $oDb->quote($oEntry->{$sUserIdField}->value); $oEntry->{$sUserLastNameField} = new oxField($oDb->getOne($sSql, false, false)); } } } $this->_aViewData["mylist"] = $oList; return $this->_sThisTemplate; }
/** * Loads category tree, passes data to Smarty and returns name of * template file "category_list.tpl". * * @return string */ public function render() { $myConfig = $this->getConfig(); parent::render(); $oLang = oxRegistry::getLang(); $iLang = $oLang->getTplLanguage(); // parent category tree $oCatTree = oxNew("oxCategoryList"); $oCatTree->loadList(); // add Root as fake category // rebuild list as we need the root entry at the first position $aNewList = array(); $oRoot = new stdClass(); $oRoot->oxcategories__oxid = new oxField(null, oxField::T_RAW); $oRoot->oxcategories__oxtitle = new oxField($oLang->translateString("viewAll", $iLang), oxField::T_RAW); $aNewList[] = $oRoot; $oRoot = new stdClass(); $oRoot->oxcategories__oxid = new oxField("oxrootid", oxField::T_RAW); $oRoot->oxcategories__oxtitle = new oxField("-- " . $oLang->translateString("mainCategory", $iLang) . " --", oxField::T_RAW); $aNewList[] = $oRoot; foreach ($oCatTree as $oCategory) { $aNewList[] = $oCategory; } $oCatTree->assign($aNewList); $aFilter = $this->getListFilter(); if (is_array($aFilter) && isset($aFilter["oxcategories"]["oxparentid"])) { foreach ($oCatTree as $oCategory) { if ($oCategory->oxcategories__oxid->value == $aFilter["oxcategories"]["oxparentid"]) { $oCategory->selected = 1; break; } } } $this->_aViewData["cattree"] = $oCatTree; return "category_list.tpl"; }
/** * Builds and returns SQL query string. Adds additional order check. * * @param object $listObject list main object * * @return string */ protected function _buildSelectString($listObject = null) { $query = parent::_buildSelectString($listObject); $database = oxDb::getDb(); $searchQuery = oxRegistry::getConfig()->getRequestParameter('addsearch'); $searchQuery = trim($searchQuery); $searchField = oxRegistry::getConfig()->getRequestParameter('addsearchfld'); if ($searchQuery) { switch ($searchField) { case 'oxorderarticles': $queryPart = "oxorder left join oxorderarticles on oxorderarticles.oxorderid=oxorder.oxid where ( oxorderarticles.oxartnum like " . $database->quote("%{$searchQuery}%") . " or oxorderarticles.oxtitle like " . $database->quote("%{$searchQuery}%") . " ) and "; break; case 'oxpayments': $queryPart = "oxorder left join oxpayments on oxpayments.oxid=oxorder.oxpaymenttype where oxpayments.oxdesc like " . $database->quote("%{$searchQuery}%") . " and "; break; default: $queryPart = "oxorder where oxorder.oxpaid like " . $database->quote("%{$searchQuery}%") . " and "; break; } $query = str_replace('oxorder where', $queryPart, $query); } return $query; }
/** * Executes parent method parent::render() and returns name of template * file "usergroup_list.tpl". * * @return string */ public function render() { parent::render(); return "usergroup_list.tpl"; }
/** * Executes parent method parent::render() and returns name of template * file "selectlist_list.tpl". * * @return string */ public function render() { parent::render(); $this->_aViewData['mylist'] = $this->_getLanguagesList(); return "language_list.tpl"; }
/** * Sets SQL WHERE condition. Returns array of conditions. * * @return array */ public function buildWhere() { // we override this to add our shop if we are not malladmin $this->_aWhere = parent::buildWhere(); if (!oxRegistry::getSession()->getVariable('malladmin')) { // we only allow to see our shop $this->_aWhere[getViewName("oxshops") . ".oxid"] = oxRegistry::getSession()->getVariable("actshop"); } return $this->_aWhere; }
/** * Prepares SQL where query according SQL condition array and attaches it to SQL end. * For each search value if german umlauts exist, adds them * and replaced by spec. char to query * * @param array $whereQuery SQL condition array * @param string $fullQuery SQL query string * * @return string */ public function _prepareWhereQuery($whereQuery, $fullQuery) { $nameWhere = null; if (isset($whereQuery['oxuser.oxlname']) && ($name = $whereQuery['oxuser.oxlname'])) { // check if this is search string (contains % sign at begining and end of string) $isSearchValue = $this->_isSearchValue($name); $name = $this->_processFilter($name); $nameWhere['oxuser.oxfname'] = $nameWhere['oxuser.oxlname'] = $name; unset($whereQuery['oxuser.oxlname']); } $query = parent::_prepareWhereQuery($whereQuery, $fullQuery); if ($nameWhere) { $values = explode(' ', $name); $query .= ' and ('; $queryBoolAction = ''; $utilsString = oxRegistry::get("oxUtilsString"); foreach ($nameWhere as $fieldName => $fieldValue) { //for each search field using AND action foreach ($values as $value) { $query .= " {$queryBoolAction} {$fieldName} "; //for search in same field for different values using AND $queryBoolAction = ' or '; $query .= $this->_buildFilter($value, $isSearchValue); // trying to search spec chars in search value // if found, add cleaned search value to search sql $uml = $utilsString->prepareStrForSearch($value); if ($uml) { $query .= " or {$fieldName} "; $query .= $this->_buildFilter($uml, $isSearchValue); } } } // end for AND action $query .= ' ) '; } return $query; }
/** * Executes parent method parent::render() and returns name of template * file "selectlist_list.tpl". * * @return string */ public function render() { parent::render(); return "country_list.tpl"; }
/** * Sets SQL query parameters (such as sorting), * executes parent method parent::Init(). */ public function init() { oxAdminList::init(); }
/** * Returns sorting fields array * * @return array */ public function getListSorting() { $aSorting = parent::getListSorting(); if (isset($aSorting["oxorder"]["oxbilllname"])) { $this->_blDesc = false; } return $aSorting; }
/** * Deletes entry from the database */ public function deleteEntry() { $sOxId = $this->getEditObjectId(); $oArticle = oxNew("oxarticle"); if ($sOxId && $oArticle->load($sOxId)) { parent::deleteEntry(); } }
/** * Adding folder check * * @param array $aWhere SQL condition array * @param string $sqlFull SQL query string * * @return $sQ */ public function _prepareWhereQuery($aWhere, $sqlFull) { $sQ = oxAdminList::_prepareWhereQuery($aWhere, $sqlFull); $sQ .= " group by oxorderarticles.oxartnum"; return $sQ; }
/** * Executes parent method parent::render() and returns name of template * file "user_list.tpl". * * @return string */ public function render() { parent::render(); return "wrapping_list.tpl"; }
/** * Prepares SQL where query according SQL condition array and attaches it to SQL end. * For each search value if german umlauts exist, adds them * and replaced by spec. char to query * * @param array $aWhere SQL condition array * @param string $sQueryFull SQL query string * * @return string */ public function _prepareWhereQuery($aWhere, $sQueryFull) { $aNameWhere = null; if (isset($aWhere['oxuser.oxlname']) && ($sName = $aWhere['oxuser.oxlname'])) { // check if this is search string (contains % sign at begining and end of string) $blIsSearchValue = $this->_isSearchValue($sName); $sName = $this->_processFilter($sName); $aNameWhere['oxuser.oxfname'] = $aNameWhere['oxuser.oxlname'] = $sName; // unsetting.. unset($aWhere['oxuser.oxlname']); } $sQ = parent::_prepareWhereQuery($aWhere, $sQueryFull); if ($aNameWhere) { $aVal = explode(' ', $sName); $sQ .= ' and ('; $sSqlBoolAction = ''; $myUtilsString = oxRegistry::get("oxUtilsString"); foreach ($aNameWhere as $sFieldName => $sValue) { //for each search field using AND anction foreach ($aVal as $sVal) { $sQ .= " {$sSqlBoolAction} {$sFieldName} "; //for search in same field for different values using AND $sSqlBoolAction = ' or '; $sQ .= $this->_buildFilter($sVal, $blIsSearchValue); // trying to search spec chars in search value // if found, add cleaned search value to search sql $sUml = $myUtilsString->prepareStrForSearch($sVal); if ($sUml) { $sQ .= " or {$sFieldName} "; $sQ .= $this->_buildFilter($sUml, $blIsSearchValue); } } } // end for AND action $sQ .= ' ) '; } return $sQ; }
/** * Overrides parent method to pass referred id. * * @param string $sId Class name */ protected function _setupNavigation($sId) { parent::_setupNavigation('pricealarm_list'); }
/** * @return string */ public function render() { parent::render(); return "mibexample4_list.tpl"; }