summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2008-01-25 19:20:24 +0000
committerAndreas Brachold <vdr07@deltab.de>2008-01-25 19:20:24 +0000
commitb750c520cd965b42488a387e3a2b9c3fab67ccfc (patch)
tree98b9963e544bca5207085a7457dced5b94716784
parentfb3e038cc7e44d3726854c7484d161886495b631 (diff)
downloadxxv-b750c520cd965b42488a387e3a2b9c3fab67ccfc.tar.gz
xxv-b750c520cd965b42488a387e3a2b9c3fab67ccfc.tar.bz2
* SHARE: [Bug #13022] Fix typo
* program,aedit,tedit,redit: choices with group of channels
-rw-r--r--html/program.tmpl9
-rw-r--r--html/widgets/list.tmpl19
-rw-r--r--lib/XXV/MODULES/AUTOTIMER.pm2
-rw-r--r--lib/XXV/MODULES/CHANNELS.pm15
-rw-r--r--lib/XXV/MODULES/EPG.pm3
-rw-r--r--lib/XXV/MODULES/RECORDS.pm16
-rw-r--r--lib/XXV/MODULES/SHARE.pm2
-rw-r--r--lib/XXV/MODULES/TIMERS.pm2
8 files changed, 50 insertions, 18 deletions
diff --git a/html/program.tmpl b/html/program.tmpl
index e8c64a5..cf1ff1c 100644
--- a/html/program.tmpl
+++ b/html/program.tmpl
@@ -28,8 +28,15 @@
<td>
<select name='data' onChange="di(this.form.data.options[this.form.data.options.selectedIndex].value, '?cmd=program&amp;data=')">
<?% FOREACH ch = param.channels %?>
- <option value="<?% ch.1 %?>" <?% "selected" IF channelpos == ch.1 %?>><?% ch.0 %?></option>
+ <?% IF ch.2 != channelgroup %?>
+ <?% IF channelgroup %?>
+ </optgroup>
+ <?% END %?>
+ <optgroup label="<?% channelgroup = ch.2;ch.2 %?>">
+ <?% END %?>
+ <option value="<?% ch.1 %?>"<?% ' selected="selected"' IF channelpos == ch.1 %?>><?% ch.0 %?></option>
<?% END %?>
+ </optgroup>
</select>
</td>
</form>
diff --git a/html/widgets/list.tmpl b/html/widgets/list.tmpl
index 452636b..ca482c8 100644
--- a/html/widgets/list.tmpl
+++ b/html/widgets/list.tmpl
@@ -19,16 +19,25 @@
<?% sel = '' %?>
<?% dis = '' %?>
<?% FOREACH valch = values %?>
- <?% IF (valch == l.1 || valch == l.0) %?>
- <?% sel = ' selected="selected"';values.shift;LAST %?>
+ <?% IF (valch == l.1 || valch == l.0) %?>
+ <?% sel = ' selected="selected"';LAST %?>
<?% END %?>
<?% END %?>
<?% FOREACH valch = data.disabled %?>
- <?% IF (valch == l.1 || valch == l.0) %?>
- <?% dis = ' disabled="disabled"';data.disabled.shift;LAST %?>
+ <?% IF (valch == l.1 || valch == l.0) %?>
+ <?% dis = ' disabled="disabled"';LAST %?>
<?% END %?>
<?% END %?>
- <option value='<?% l.1 %?>'<?% sel %?><?% dis %?>><?% l.0 %?></option>
+ <?% IF l.2 && l.2 != optgroup %?>
+ <?% IF optgroup %?>
+ </optgroup>
+ <?% END %?>
+ <optgroup label="<?% optgroup = l.2;l.2 %?>">
+ <?% END %?>
+ <option value='<?% l.1 %?>'<?% sel %?><?% dis %?>><?% l.0 %?></option>
+ <?% END %?>
+ <?% IF optgroup %?>
+ </optgroup>
<?% END %?>
</select>
</td>
diff --git a/lib/XXV/MODULES/AUTOTIMER.pm b/lib/XXV/MODULES/AUTOTIMER.pm
index 6e6fd30..3bc812a 100644
--- a/lib/XXV/MODULES/AUTOTIMER.pm
+++ b/lib/XXV/MODULES/AUTOTIMER.pm
@@ -722,7 +722,7 @@ You can also fine tune your search :
'Channels' => {
typ => 'list',
def => $epg->{Channels},
- choices => $modC->ChannelArray('Name', sprintf(' NOT (%s)', $obj->{exclude})),
+ choices => $modC->ChannelWithGroup('Name,POS', sprintf(' NOT (%s)', $obj->{exclude})),
options => 'multi',
msg => gettext('Limit search to these channels'),
check => sub{
diff --git a/lib/XXV/MODULES/CHANNELS.pm b/lib/XXV/MODULES/CHANNELS.pm
index 3713c24..755108b 100644
--- a/lib/XXV/MODULES/CHANNELS.pm
+++ b/lib/XXV/MODULES/CHANNELS.pm
@@ -532,6 +532,21 @@ sub ChannelArray {
}
# ------------------
+sub ChannelWithGroup {
+# ------------------
+ my $obj = shift || return error('No object defined!');
+ my $field = shift || return undef;
+ my $where = shift || '';
+ $where = sprintf('WHERE %s', $where) if($where);
+
+ my $sql = sprintf(q|SELECT SQL_CACHE %s, ( SELECT
+ g.Name FROM CHANNELGROUPS as g WHERE c.GRP = g.Id
+ LIMIT 1) as GRP from CHANNELS as c %s order by c.POS|, $field, $where);
+ my $erg = $obj->{dbh}->selectall_arrayref($sql);
+ return $erg;
+}
+
+# ------------------
sub ChannelIDArray {
# ------------------
my $obj = shift || return error('No object defined!');
diff --git a/lib/XXV/MODULES/EPG.pm b/lib/XXV/MODULES/EPG.pm
index bb66842..4cfc013 100644
--- a/lib/XXV/MODULES/EPG.pm
+++ b/lib/XXV/MODULES/EPG.pm
@@ -768,8 +768,9 @@ order by
unshift(@$erg, $fields);
+
$console->table($erg, {
- channels => $mod->ChannelArray('Name'),
+ channels => $mod->ChannelWithGroup('Name,POS'),
current => $mod->ChannelToPos($cid),
}
);
diff --git a/lib/XXV/MODULES/RECORDS.pm b/lib/XXV/MODULES/RECORDS.pm
index 9158cba..1515a12 100644
--- a/lib/XXV/MODULES/RECORDS.pm
+++ b/lib/XXV/MODULES/RECORDS.pm
@@ -1013,7 +1013,7 @@ sub readinfo {
my $file = sprintf("%s/info.vdr", $path);
if(-r $file) {
my $text = load_file($file);
- my $cmod = main::getModule('CHANNELS');
+ my $modC = main::getModule('CHANNELS');
foreach my $zeile (split(/[\r\n]/, $text)) {
if($zeile =~ /^D\s+(.+)/s) {
$info->{description} = $1;
@@ -1023,7 +1023,7 @@ sub readinfo {
}
elsif($zeile =~ /^C\s+(\S+)/s) {
$info->{channel} = $1;
- $info->{type} = $cmod->getChannelType($info->{channel});
+ $info->{type} = $modC->getChannelType($info->{channel});
}
elsif($zeile =~ /^T\s+(.+)$/s) {
$info->{title} = $1;
@@ -1827,7 +1827,7 @@ WHERE
$rec->{title} =~s#^~##g;
$rec->{title} =~s#~$##g;
- my $mod = main::getModule('CHANNELS');
+ my $modC = main::getModule('CHANNELS');
my $questions = [
'title' => {
@@ -1865,19 +1865,19 @@ WHERE
},
'channel' => {
typ => 'list',
- def => $mod->ChannelToPos($status->{channel}),
+ def => $modC->ChannelToPos($status->{channel}),
choices => sub {
- my $erg = $mod->ChannelArray('Name');
- unshift(@$erg, [gettext("Undefined"),undef]);
+ my $erg = $modC->ChannelWithGroup('Name,Pos');
+ unshift(@$erg, [gettext("Undefined"),undef,undef]);
return $erg;
},
msg => gettext('Channel'),
check => sub{
my $value = shift || return;
- if(my $ch = $mod->PosToChannel($value) || $mod->NameToChannel($value) ) {
+ if(my $ch = $modC->PosToChannel($value) || $modC->NameToChannel($value) ) {
return $ch;
- } elsif( ! $mod->NameToChannel($value)) {
+ } elsif( ! $modC->NameToChannel($value)) {
return undef, sprintf(gettext("This channel '%s' does not exist!"),$value);
} else {
return undef, gettext("This is required!");
diff --git a/lib/XXV/MODULES/SHARE.pm b/lib/XXV/MODULES/SHARE.pm
index 2280d2a..ee2a098 100644
--- a/lib/XXV/MODULES/SHARE.pm
+++ b/lib/XXV/MODULES/SHARE.pm
@@ -304,7 +304,7 @@ sub TopTen {
return $console->table($out, {
channels => $can->ChannelHash('Id'),
- timers => $tim->getEpgIds
+ timers => $tim->getEvents()
});
}
diff --git a/lib/XXV/MODULES/TIMERS.pm b/lib/XXV/MODULES/TIMERS.pm
index e8ce776..119b636 100644
--- a/lib/XXV/MODULES/TIMERS.pm
+++ b/lib/XXV/MODULES/TIMERS.pm
@@ -664,7 +664,7 @@ WHERE
'channel' => {
typ => 'list',
def => $con ? $modC->ChannelToPos($timerData->{channel}) : $timerData->{channel},
- choices => $con ? $modC->ChannelArray('Name') : $modC->ChannelIDArray('Name'),
+ choices => $con ? $modC->ChannelArray('Name') : $modC->ChannelWithGroup('Name,Id'),
msg => gettext('Which channel should recorded'),
req => gettext("This is required!"),
check => sub{