Ticket #1874: mythweb-never_record_on_detail_page-local_links.patch

File mythweb-never_record_on_detail_page-local_links.patch, 2.6 KB (added by sphery <mtdean@…>, 18 years ago)
  • mythweb/modules/tv/detail.php

     
    146146            $schedule->save($type);
    147147        }
    148148    }
     149    elseif (isset($_GET['forget_old']) || isset($_POST['forget_old'])) {
     150        $program->rec_forget_old();
     151    // Wait for a second so the backend can catch up
     152        sleep(1);
     153
     154    // Redirect back to the page again, but without the query string, so reloads are cleaner
     155        header('Location: '.root.'tv/detail/'.$program->chanid.'/'.$program->starttime);
     156        exit;
     157    }
     158    elseif (isset($_GET['never_record']) || isset($_POST['never_record'])) {
     159        $program->rec_never_record();
     160    // Wait for a second so the backend can catch up
     161        sleep(1);
     162
     163    // Redirect back to the page again, but without the query string, so reloads are cleaner
     164        header('Location: '.root.'tv/detail/'.$program->chanid.'/'.$program->starttime);
     165        exit;
     166    }
    149167// Load default settings for recpriority, autoexpire etc
    150168    else {
    151169    // auto-commercial-flag
  • mythweb/modules/tv/tmpl/default/detail.php

     
    263263                else
    264264                    echo t('Find other showings of this program');
    265265            ?></a>
     266            <?php
     267        // Offer to adjust old recording info
     268            if (preg_match('/\\S/', $program->title)
     269                    && (preg_match('/\\S/', $program->programid.$program->subtitle.$program->description))) {
     270                $urlstr = '/'.$program->chanid.'/'.$program->starttime;
     271                if (($program->recstatus != 'Recorded') &&
     272                    ($program->recstatus != 'NeverRecord') &&
     273                    ($program->recstatus != 'Recording'))
     274                    echo "<a href=\"".root."tv/detail".$urlstr
     275                         ."?never_record=yes\">".t('Never Record')."</a>";
     276                elseif (($program->recstatus == 'Recorded') ||
     277                        ($program->recstatus == 'NeverRecord'))
     278                    echo "<a href=\"".root."tv/detail".$urlstr
     279                         ."?forget_old=yes\">".t('Forget Old')."</a>";
     280            } ?>
     281
    266282            <a href="<?php echo root ?>tv/list?time=<?php echo $_SESSION['list_time'] ?>"><?php
    267283                echo t('Back to the program listing')
    268284            ?></a>