-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaf0cd7
commit 6a7d091
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/code/community/TM/Core/Block/Adminhtml/Module/Grid/Filter/Version.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
class TM_Core_Block_Adminhtml_Module_Grid_Filter_Version | ||
extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select | ||
{ | ||
const VERSION_AVAILABLE = 'available'; | ||
const VERSION_UNAVAILABLE = 'unavailable'; | ||
|
||
protected static $_options = array( | ||
null => null, | ||
self::VERSION_AVAILABLE => 'Available', | ||
self::VERSION_UNAVAILABLE => 'Unavailable', | ||
); | ||
|
||
protected function _getOptions() | ||
{ | ||
$result = array(); | ||
foreach (self::$_options as $code => $label) { | ||
$result[] = array( | ||
'value' => $code, | ||
'label' => Mage::helper('adminhtml')->__($label) | ||
); | ||
} | ||
|
||
return $result; | ||
} | ||
|
||
public function getCondition() | ||
{ | ||
switch ($this->getValue()) { | ||
case self::VERSION_AVAILABLE: | ||
return array('neq' => ''); | ||
case self::VERSION_UNAVAILABLE: | ||
return array('eq' => ''); | ||
default: | ||
return null; | ||
} | ||
} | ||
} |