OXID eShop CE  4.9.11
 All Classes Files Functions Variables Pages
actions_list.php
Go to the documentation of this file.
1 <?php
2 
9 class Actions_List extends oxAdminList
10 {
11 
17  protected $_sThisTemplate = 'actions_list.tpl';
18 
24  protected $_sListClass = 'oxactions';
25 
31  protected $_sDefSortField = 'oxtitle';
32 
38  public function render()
39  {
41 
42  // passing display type back to view
43  $this->_aViewData["displaytype"] = oxRegistry::getConfig()->getRequestParameter("displaytype");
44 
45  return $this->_sThisTemplate;
46  }
47 
56  protected function _prepareWhereQuery($aWhere, $sqlFull)
57  {
58  $sQ = parent::_prepareWhereQuery($aWhere, $sqlFull);
59  $sDisplayType = (int) oxRegistry::getConfig()->getRequestParameter('displaytype');
60  $sTable = getViewName("oxactions");
61 
62  //searchong for empty oxfolder fields
63  if ($sDisplayType) {
64 
65  $sNow = date('Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime());
66 
67  switch ($sDisplayType) {
68  case 1: // active
69  $sQ .= " and {$sTable}.oxactivefrom < '{$sNow}' and {$sTable}.oxactiveto > '{$sNow}' ";
70  break;
71  case 2: // upcoming
72  $sQ .= " and {$sTable}.oxactivefrom > '{$sNow}' ";
73  break;
74  case 3: // expired
75  $sQ .= " and {$sTable}.oxactiveto < '{$sNow}' and {$sTable}.oxactiveto != '0000-00-00 00:00:00' ";
76  break;
77  }
78  }
79 
80 
81  return $sQ;
82  }
83 }