Ticket #1874: mythweb-never_record_on_detail_page.patch

File mythweb-never_record_on_detail_page.patch, 3.1 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

     
    101101                <dt><?php echo t('MythTV Status') ?>:&nbsp;</dt>
    102102                <dd><?php
    103103                    echo $GLOBALS['RecStatus_Reasons'][$program->recstatus];
    104                     ?></dd>
     104                    if (($program->recstatus == 'Recorded') ||
     105                        ($program->recstatus == 'NeverRecord')) {
     106                        if (preg_match('/\\S/', $program->title)
     107                                && (preg_match('/\\S/', $program->programid.$program->subtitle.$program->description))) {
     108                          echo " (<a href=\"".root."tv/detail/"
     109                               .$program->chanid."/".$program->starttime
     110                               ."?forget_old=yes\">".t('Forget Old')."</a>)";
     111                        }
     112                    } ?></dd>
    105113<?php       } ?>
    106114            </dl>
    107115        </div>
     
    263271                else
    264272                    echo t('Find other showings of this program');
    265273            ?></a>
     274            <?php
     275            if (($program->recstatus != 'Recorded') &&
     276                ($program->recstatus != 'NeverRecord') &&
     277                ($program->recstatus != 'Recording')) {
     278                if (preg_match('/\\S/', $program->title)
     279                        && (preg_match('/\\S/', $program->programid.$program->subtitle.$program->description))) {
     280                    echo "<a href=\"".root."tv/detail/".$program->chanid
     281                         .'/'.$program->starttime."?never_record=yes\">"
     282                         .t('Never Record')."</a>";
     283                }
     284            } ?>
     285
    266286            <a href="<?php echo root ?>tv/list?time=<?php echo $_SESSION['list_time'] ?>"><?php
    267287                echo t('Back to the program listing')
    268288            ?></a>