Skip to content

Commit

Permalink
use the filter values from the Default template
Browse files Browse the repository at this point in the history
Patch by Karl Newman
Fixes #11706
  • Loading branch information
dekarl committed Apr 12, 2014
1 parent 022cc27 commit fc8db22
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions modules/tv/classes/Schedule.php
Expand Up @@ -76,7 +76,7 @@ public static function availableRecordFilters() {
if (empty($cache)) {
global $db;
$cache = $db->query_keyed_list_assoc('filterid',
'SELECT filterid,description,newruledefault
'SELECT filterid,description
FROM recordfilter
ORDER BY filterid'
);
Expand All @@ -88,22 +88,14 @@ public static function availableRecordFilters() {
*
* @return an array of the filters for this Schedule. Array includes
* a property called "enabled" to indicate if the filter is enabled.
* If this is not a real schedule "enabled" is from the newruledefault
* property
*
/**/
public function recordFilters() {
$filters = array();
foreach (Schedule::availableRecordFilters() as $id => $filter) {
$filters[$id] = $filter;
// if this is a real schedule, use the filter property
if ($this->recordid) {
$mask = 1 << $id;
$filters[$id]['enabled'] = ($this->filter & $mask) == $mask;
// otherwise it's not a real schedule, so use the default value
} else {
$filters[$id]['enabled'] = $filter['newruledefault'];
}
$mask = 1 << $id;
$filters[$id]['enabled'] = ($this->filter & $mask) == $mask;
}
return $filters;
}
Expand Down

0 comments on commit fc8db22

Please sign in to comment.