[mythtv] [PATCH] mythweb: recording schedules display bugs
Cedric Tefft
cedric at phreaker.net
Tue Aug 31 20:45:58 EDT 2004
This patch fixes several display bugs in Mythweb's recording_schedules
page. It looks like this page was never updated to handle manual
override recording types (7 and 8), so these record entries were
getting displayed with default properties. Also fixes a minor bug
whereby manual overrides generated by mythweb weren't getting the
category of the show inserted into the database, so they would always
show up as category 'unknown'.
- Cedric
-------------- next part --------------
Index: program_detail.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/program_detail.php,v
retrieving revision 1.14
diff -u -r1.14 program_detail.php
--- program_detail.php 11 May 2004 06:18:22 -0000 1.14
+++ program_detail.php 30 Aug 2004 11:41:34 -0000
@@ -110,7 +110,7 @@
or trigger_error('SQL Error: '.mysql_error(), FATAL);
}
else {
- $result = mysql_query('REPLACE INTO record (recordid,type,chanid,station,starttime,startdate,endtime,enddate,title,subtitle,description,profile,recpriority,recgroup,dupin,dupmethod,maxnewest,maxepisodes,autoexpire,startoffset,endoffset,seriesid,programid) values ('
+ $result = mysql_query('REPLACE INTO record (recordid,type,chanid,station,starttime,startdate,endtime,enddate,title,subtitle,description,category,profile,recpriority,recgroup,dupin,dupmethod,maxnewest,maxepisodes,autoexpire,startoffset,endoffset,seriesid,programid) values ('
.escape($this_program->recordid, true) .','
.escape($this_program->type) .','
.escape($this_program->chanid) .','
@@ -122,6 +122,7 @@
.escape($this_program->title) .','
.escape($this_program->subtitle) .','
.escape($this_program->description) .','
+ .escape($this_program->category) .','
.escape($this_program->profile) .','
.escape($this_program->recpriority) .','
.escape($this_program->recgroup) .','
Index: scheduled_recordings.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/scheduled_recordings.php,v
retrieving revision 1.19
diff -u -r1.19 scheduled_recordings.php
--- scheduled_recordings.php 3 Aug 2004 18:04:06 -0000 1.19
+++ scheduled_recordings.php 30 Aug 2004 11:41:34 -0000
@@ -54,7 +54,7 @@
.' AND starttime=FROM_UNIXTIME('.escape($program->starttime).') AND startdate=FROM_UNIXTIME('.escape($program->starttime).')'
.' AND endtime=FROM_UNIXTIME('.escape($program->endtime).') AND enddate=FROM_UNIXTIME('.escape($program->endtime).')')
or trigger_error('SQL Error: '.mysql_error().' [#'.mysql_errno().']', FATAL);
- $result = mysql_query('REPLACE INTO record (type,chanid,station,starttime,startdate,endtime,enddate,title,subtitle,description,profile,recpriority,recgroup,dupin,dupmethod,maxnewest,maxepisodes,autoexpire,startoffset,endoffset,seriesid,programid) values ('
+ $result = mysql_query('REPLACE INTO record (type,chanid,station,starttime,startdate,endtime,enddate,title,subtitle,description,category,profile,recpriority,recgroup,dupin,dupmethod,maxnewest,maxepisodes,autoexpire,startoffset,endoffset,seriesid,programid) values ('
.'8,'
.escape($program->chanid) .','
.escape($channel->callsign) .','
@@ -65,6 +65,7 @@
.escape($program->title) .','
.escape($program->subtitle) .','
.escape($program->description) .','
+ .escape($program->category) .','
.escape($program->profile) .','
.escape($program->recpriority) .','
.escape($program->recgroup) .','
@@ -87,7 +88,7 @@
.' AND starttime=FROM_UNIXTIME('.escape($program->starttime).') AND startdate=FROM_UNIXTIME('.escape($program->starttime).')'
.' AND endtime=FROM_UNIXTIME('.escape($program->endtime).') AND enddate=FROM_UNIXTIME('.escape($program->endtime).')')
or trigger_error('SQL Error: '.mysql_error().' [#'.mysql_errno().']', FATAL);
- $result = mysql_query('REPLACE INTO record (type,chanid,station,starttime,startdate,endtime,enddate,title,subtitle,description,profile,recpriority,recgroup,dupin,dupmethod,maxnewest,maxepisodes,autoexpire,startoffset,endoffset,seriesid,programid) values ('
+ $result = mysql_query('REPLACE INTO record (type,chanid,station,starttime,startdate,endtime,enddate,title,subtitle,description,category,profile,recpriority,recgroup,dupin,dupmethod,maxnewest,maxepisodes,autoexpire,startoffset,endoffset,seriesid,programid) values ('
.'7,'
.escape($program->chanid) .','
.escape($channel->callsign) .','
@@ -98,6 +99,7 @@
.escape($program->title) .','
.escape($program->subtitle) .','
.escape($program->description) .','
+ .escape($program->category) .','
.escape($program->profile) .','
.escape($program->recpriority) .','
.escape($program->recgroup) .','
Index: includes/recordings.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/includes/recordings.php,v
retrieving revision 1.13
diff -u -r1.13 recordings.php
--- includes/recordings.php 15 Jun 2004 06:03:17 -0000 1.13
+++ includes/recordings.php 30 Aug 2004 11:41:34 -0000
@@ -15,7 +15,9 @@
3 => _LANG_RECTYPE_CHANNEL,
4 => _LANG_RECTYPE_ALWAYS,
5 => _LANG_RECTYPE_WEEKLY,
- 6 => _LANG_RECTYPE_FINDONE
+ 6 => _LANG_RECTYPE_FINDONE,
+ 7 => _LANG_RECTYPE_OVERRIDE,
+ 8 => _LANG_RECTYPE_DONTREC
);
/*
Index: languages/English.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/languages/English.php,v
retrieving revision 1.18
diff -u -r1.18 English.php
--- languages/English.php 13 Aug 2004 04:29:24 -0000 1.18
+++ languages/English.php 30 Aug 2004 11:41:34 -0000
@@ -213,10 +213,12 @@
define ('_LANG_RECTYPE_ALWAYS', 'Always');
define ('_LANG_RECTYPE_WEEKLY', 'Weekly');
define ('_LANG_RECTYPE_FINDONE', 'FindOne');
+define ('_LANG_RECTYPE_OVERRIDE', 'Override (record)');
+define ('_LANG_RECTYPE_DONTREC', 'Do Not Record');
define ('_LANG_RECTYPE_LONG_ONCE', 'Record only this showing.');
define ('_LANG_RECTYPE_LONG_DAILY', 'Record this program in this timeslot every day.');
-define ('_LANG_RECTYPE_LONG_CHANNEL', 'Always record this program on channel ');
+define ('_LANG_RECTYPE_LONG_CHANNEL', 'Always record this program on this channel ');
define ('_LANG_RECTYPE_LONG_ALWAYS', 'Always record this program on any channel.');
define ('_LANG_RECTYPE_LONG_WEEKLY', 'Record this program in this timeslot every week.');
define ('_LANG_RECTYPE_LONG_FINDONE', 'Record one showing of this program at any time.');
Index: languages/French.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/languages/French.php,v
retrieving revision 1.6
diff -u -r1.6 French.php
--- languages/French.php 10 Aug 2004 03:56:45 -0000 1.6
+++ languages/French.php 30 Aug 2004 11:41:34 -0000
@@ -212,6 +212,8 @@
define ('_LANG_RECTYPE_ALWAYS', 'Permanente');
define ('_LANG_RECTYPE_WEEKLY', 'Hebdomadaire');
define ('_LANG_RECTYPE_FINDONE', 'Prochain');
+define ('_LANG_RECTYPE_OVERRIDE', '[translate me] Override (record)');
+define ('_LANG_RECTYPE_DONTREC', '[translate me] Do Not Record');
define ('_LANG_RECTYPE_LONG_ONCE', 'Enregistrer uniquement ce programme');
define ('_LANG_RECTYPE_LONG_DAILY', 'Enregistrer ce programme à cet horaire chaque jour');
Index: languages/German.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/languages/German.php,v
retrieving revision 1.8
diff -u -r1.8 German.php
--- languages/German.php 10 Aug 2004 03:56:45 -0000 1.8
+++ languages/German.php 30 Aug 2004 11:41:35 -0000
@@ -213,6 +213,8 @@
define ('_LANG_RECTYPE_ALWAYS', 'Immer');
define ('_LANG_RECTYPE_WEEKLY', 'Wöchentlich');
define ('_LANG_RECTYPE_FINDONE', 'FindOne');
+define ('_LANG_RECTYPE_OVERRIDE', '[translate me] Override (record)');
+define ('_LANG_RECTYPE_DONTREC', '[translate me] Do Not Record');
define ('_LANG_RECTYPE_LONG_ONCE', 'Einmalige Aufnahme.');
define ('_LANG_RECTYPE_LONG_DAILY', 'Täglich zu dieser Zeit aufnehmen.');
Index: languages/Japanese.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/languages/Japanese.php,v
retrieving revision 1.10
diff -u -r1.10 Japanese.php
--- languages/Japanese.php 10 Aug 2004 03:56:45 -0000 1.10
+++ languages/Japanese.php 30 Aug 2004 11:41:35 -0000
@@ -212,6 +212,8 @@
define ('_LANG_RECTYPE_ALWAYS', '常に');
define ('_LANG_RECTYPE_WEEKLY', '週間');
define ('_LANG_RECTYPE_FINDONE', '検索');
+define ('_LANG_RECTYPE_OVERRIDE', '[translate me] Override (record)');
+define ('_LANG_RECTYPE_DONTREC', '[translate me] Do Not Record');
define ('_LANG_RECTYPE_LONG_ONCE', 'この放送のみ録画する');
define ('_LANG_RECTYPE_LONG_DAILY', 'この番組を毎日この時間帯に録画する');
Index: languages/Nederlands.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/languages/Nederlands.php,v
retrieving revision 1.16
diff -u -r1.16 Nederlands.php
--- languages/Nederlands.php 10 Aug 2004 03:56:45 -0000 1.16
+++ languages/Nederlands.php 30 Aug 2004 11:41:35 -0000
@@ -217,6 +217,8 @@
define ('_LANG_RECTYPE_ALWAYS', 'Altijd');
define ('_LANG_RECTYPE_WEEKLY', 'Wekelijks');
define ('_LANG_RECTYPE_FINDONE', 'Eens');
+define ('_LANG_RECTYPE_OVERRIDE', '[translate me] Override (record)');
+define ('_LANG_RECTYPE_DONTREC', '[translate me] Do Not Record');
define ('_LANG_RECTYPE_LONG_ONCE', 'Enkel deze vertoning opnemen.');
define ('_LANG_RECTYPE_LONG_DAILY', 'Neem dagelijks op in dit tijdsslot.');
Index: languages/Swedish.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/languages/Swedish.php,v
retrieving revision 1.3
diff -u -r1.3 Swedish.php
--- languages/Swedish.php 10 Aug 2004 03:56:45 -0000 1.3
+++ languages/Swedish.php 30 Aug 2004 11:41:35 -0000
@@ -212,6 +212,8 @@
define ('_LANG_RECTYPE_ALWAYS', 'Alltid');
define ('_LANG_RECTYPE_WEEKLY', 'Veckovis');
define ('_LANG_RECTYPE_FINDONE', 'Bästa tillfälle');
+define ('_LANG_RECTYPE_OVERRIDE', '[translate me] Override (record)');
+define ('_LANG_RECTYPE_DONTREC', '[translate me] Do Not Record');
define ('_LANG_RECTYPE_LONG_ONCE', 'Spela enbart in denna visning.');
define ('_LANG_RECTYPE_LONG_DAILY', 'Spela in detta program vid denna tid varje dag.');
Index: themes/Default/recording_schedules.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/themes/Default/recording_schedules.php,v
retrieving revision 1.14
diff -u -r1.14 recording_schedules.php
--- themes/Default/recording_schedules.php 23 Jun 2004 06:27:20 -0000 1.14
+++ themes/Default/recording_schedules.php 30 Aug 2004 11:41:35 -0000
@@ -69,9 +68,9 @@
$commands = array();
$urlstr = 'recordid='.$show->recordid;
- $class = 'scheduled';
- // If this is an 'always on any channel' recording, set the channel name to 'Any'
- if (($show->type == 4))
+ $class = ($show->type == 8 ? 'deactivated' : 'scheduled');
+ // If this is an 'always on any channel' or 'find one' recording w/o a channel, set the channel name to 'Any'
+ if ($show->type == 4 || ($show->type == 6 && !preg_match('/\\S/', $show->channel->channum)))
$show->channel->name = '[ '._LANG_ANY.' ]';
// Build a popup table for the mouseover of the cell, with extra program information?
if (show_popup_info) {
@@ -88,7 +87,7 @@
<td align=\"right\">"._LANG_TITLE.":</td>
<td>$show->title</td>
</tr>";
- if (($show->type == 1) || ($show->type == 2) || ($show->type == 5)) {
+ if (($show->type == 1) || ($show->type == 2) || ($show->type == 5) || ($show->type == 7) || ($show->type == 8)) {
$Footnotes[] .= "
<tr>
<td align=\"right\">"._LANG_AIRTIME.":</td>
@@ -164,6 +163,12 @@
elseif ($group_field == 'profile')
$cur_group = $show->profile;
+ $style_class = $show->class;
+ if ($show->type == 7)
+ $style_class .= ' record_override_record';
+ elseif ($show->type == 8)
+ $style_class .= ' record_override_suppress';
+
if ( $cur_group != $prev_group && $group_field != '' ) {
?><tr class="list_separator">
<td colspan="5" class="list_separator"><?php echo $cur_group?></td>
@@ -173,14 +178,14 @@
// Print the content
?><tr class="<?php echo $class?>">
<?php if ($group_field != '') echo "<td class=\"list\"> </td>\n"; ?>
- <td class="<?php echo $show->class?>"><?php
+ <td class="<?php echo $style_class?>"><?php
// Print a link to record this show
echo '<a id="program_'.$program_id_counter.'" href="program_detail.php?recordid='.$show->recordid.'"'
.(show_popup_info ? ' onmouseover="window.status=\'Details for: '.str_replace('\'', '\\\]', $show->title).'\';show(\'program_'.$program_id_counter.'\');return true"'
.' onmouseout="window.status=\'\';hide();return true"'
: '')
.'>'.$show->title
- .($show->type == 1 && preg_match('/\\w/', $show->subtitle) ? ": $show->subtitle" : '')
+ .(($show->type == 1 || $show->type == 7 || $show->type == 8) && preg_match('/\\w/', $show->subtitle) ? ": $show->subtitle" : '')
.'</a>';
?></td>
<td><?php
@@ -188,7 +193,7 @@
echo $show->channel->channum.' - ';
echo $show->channel->name
?></td>
- <td nowrap><?php echo $show->profile ?></td>
+ <td nowrap><?php if($show->type != 8) echo $show->profile; ?></td>
<td nowrap><?php echo $show->texttype ?></td>
<?php foreach ($commands as $command) { ?>
<td nowrap width="5%" class="command command_border_l command_border_t command_border_b command_border_r" align="center"><?php echo $command?></td>
More information about the mythtv-dev
mailing list