OXID eShop CE  4.8.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 {
15  protected $_sThisTemplate = 'actions_list.tpl';
16 
22  protected $_sListClass = 'oxactions';
23 
29  protected $_sDefSortField = 'oxtitle';
30 
36  public function render()
37  {
39 
40  // passing display type back to view
41  $this->_aViewData["displaytype"] = oxConfig::getParameter( "displaytype" );
42 
43  return $this->_sThisTemplate;
44  }
45 
54  protected function _prepareWhereQuery( $aWhere, $sqlFull )
55  {
56  $sQ = parent::_prepareWhereQuery( $aWhere, $sqlFull );
57  $sDisplayType = (int) oxConfig::getParameter( 'displaytype' );
58  $sTable = getViewName( "oxactions" );
59 
60  //searchong for empty oxfolder fields
61  if ( $sDisplayType ) {
62 
63  $sNow = date( 'Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime() );
64 
65  switch ( $sDisplayType ) {
66  case 1: // active
67  $sQ .= " and {$sTable}.oxactivefrom < '{$sNow}' and {$sTable}.oxactiveto > '{$sNow}' ";
68  break;
69  case 2: // upcoming
70  $sQ .= " and {$sTable}.oxactivefrom > '{$sNow}' ";
71  break;
72  case 3: // expired
73  $sQ .= " and {$sTable}.oxactiveto < '{$sNow}' and {$sTable}.oxactiveto != '0000-00-00 00:00:00' ";
74  break;
75  }
76  }
77 
78 
79  return $sQ;
80  }
81 }