Ticket #1529: toggle_autoexpire.patch

File toggle_autoexpire.patch, 3.5 KB (added by derek@…, 15 years ago)

Allow toggle of auto expire flag for recordings

  • themes/default/tv/recorded.php

     
    304304?>
    305305</tr><tr id="statusrow_<?php echo $row ?>" class="recorded">
    306306    <td nowrap colspan="<?php echo 6 + ($_SESSION['recorded_descunder'] ? 0 : 1) + $recgroup_cols ?>" align="center">
    307         <span style="padding-right: 25px"><?php echo t('has commflag') ?>:&nbsp;
    308             <b><?php echo $show->has_commflag ? t('Yes') : t('No') ?></b></span>
    309         <span style="padding-right: 25px"><?php echo t('has cutlist') ?>:&nbsp;
    310             <b><?php echo $show->has_cutlist ? t('Yes') : t('No') ?></b></span>
    311         <span style="padding-right: 25px"><?php echo t('is editing') ?>:&nbsp;
    312             <b><?php echo $show->is_editing ? t('Yes') : t('No') ?></b></span>
    313         <span style="padding-right: 25px"><?php echo t('auto-expire') ?>:&nbsp;
    314             <b><?php echo $show->auto_expire ? t('Yes') : t('No') ?></b></span>
    315         <?php echo t('has bookmark') ?>:&nbsp;
    316             <b><?php echo $show->bookmark ? t('Yes') : t('No') ?></b>
    317         </td>
     307        <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
     308            <input type="hidden" name="task" value="chgRecorded" />
     309            <span style="padding-right: 25px"><?php echo t('has commflag') ?>:&nbsp;
     310                <input type="checkbox" name="commflag" <?php echo $show->has_commflag ? 'checked="checked"' : '' ?> disabled="disabled" /></span>
     311
     312            <span style="padding-right: 25px"><?php echo t('has cutlist') ?>:&nbsp;
     313                <input type="checkbox" name="cutlist" <?php echo $show->has_cutlist ? 'checked="checked"' : '' ?> disabled="disabled" /></span>
     314
     315            <span style="padding-right: 25px"><?php echo t('is editing') ?>:&nbsp;
     316                <input type="checkbox" name="editing" <?php echo $show->is_editing ? 'checked="checked"' : '' ?> disabled="disabled" /></span>
     317
     318            <span style="padding-right: 25px"><?php echo t('auto-expire') ?>:&nbsp;
     319                <input type="hidden" name="filename" value="<?php echo basename($show->filename) ?>" />
     320                <input type="checkbox" name="autoExpire" <?php echo $show->auto_expire ? 'checked="checked"' : '' ?> onchange="this.form.submit()" /></span>
     321
     322            <?php echo t('has bookmark') ?>:&nbsp;
     323                <input type="checkbox" name="bookmark" <?php echo $show->bookmark ? 'checked="checked"' : '' ?> disabled="disabled" />
     324        </form>
     325    </td>
    318326    <td width="5%" class="command command_border_l command_border_t command_border_b command_border_r" align="center">
    319327        <a id="delete_rerecord_<?php echo $row ?>"
    320328            href="<?php echo root ?>tv/recorded?delete=yes&file=<?php echo urlencode($show->filename) ?>&forget_old"
  • modules/tv/recorded.php

     
    1313 *
    1414/**/
    1515
     16// If requested, toggle an auto-expire flag
     17    if(isset($_POST['task']) && $_POST['task'] == 'chgRecorded') {
     18         $qry = 'UPDATE recorded SET autoexpire = ';
     19         if(isset($_POST['autoExpire']))
     20             $qry .= '1';
     21         else
     22             $qry .= '0';
     23         $qry .= " WHERE basename = " . $db->escape($_POST['filename']);
     24         $db->query($qry);
     25    }
     26 
    1627// Populate the $Channels array
    1728    load_all_channels();
    1829