Ticket #2752: Sort_By_ProgramID.diff

File Sort_By_ProgramID.diff, 4.5 KB (added by lynchmv@…, 14 years ago)

Patch created with svn diff

  • includes/sorting.php

     
    186186        return strcasecmp($a->director, $b->director);
    187187    }
    188188
     189    function by_programid(&$a, &$b) {
     190        return strcasecmp($a->programid, $b->programid);
     191    }
     192
    189193    function by_category(&$a, &$b) {
    190194        if ($a->category == $b->category) return 0;
    191195        return ($a->category > $b->category) ? 1 : -1;
  • modules/_shared/lang/English.lang

     
    240240"Only match HD programs"
    241241"Only New Episodes"
    242242"or"
     243"originalairdate"
    243244"Original Airdate"
    244245"Part $1 of $2"
    245246"Past Month"
     
    265266"program continues to the left"
    266267"program continues to the right"
    267268"Program Detail"
     269"programid"
    268270"Program ID"
    269271"Program Listing"
    270272"Radar"
  • modules/tv/tmpl/default/recorded.php

     
    188188                .($count > 1 ? ' ('.tn('$1 episode', '$1 episodes', $count).')' : "")
    189189                ."</option>\n";
    190190        }
     191        if ($_GET['title']) {
     192            $title_cols = 1;
     193        } else {
     194            $title_cols = 0;
     195        }
    191196?>
    192197    </select></td>
    193198    <td><noscript><input type="submit" value="<?php echo t('Go') ?>"></noscript></td>
     
    201206$group_field = $_GET['sortby'];
    202207if ($group_field == "") {
    203208    $group_field = "airdate";
    204 } elseif ( ! (($group_field == "title") || ($group_field == "channum") || ($group_field == "airdate") || ($group_field == "recgroup")) ) {
     209} elseif ( ! (($group_field == "title") || ($group_field == "programid") || ($group_field == "channum") || ($group_field == "airdate") || ($group_field == "recgroup")) ) {
    205210    $group_field = "";
    206211}
    207212
     
    227232        echo "\t<td>" . get_sort_link('recgroup', t('recgroup')) . "</td>\n";
    228233?>
    229234    <td><?php echo get_sort_link('airdate',   t('airdate')) ?></td>
     235<?php
     236    if ($title_cols)
     237        echo "\t<td>" . get_sort_link('programid', t('programid')) . "</td>\n";
     238?>
    230239    <td><?php echo get_sort_link('length',    t('length')) ?></td>
    231240    <td><?php echo get_sort_link('file_size', t('file size')) ?></td>
    232241</tr><?php
     
    252261            case 'title':
    253262                $cur_group = $show->title;
    254263                break;
     264            case 'programid':
     265                $cur_group = $show->programid;
     266                break;
    255267        }
    256268
    257269        if ( $cur_group != $prev_group && $group_field != '' ) {
    258270            $section++;
    259             $colspan = 9 + $recgroup_cols;
     271            $colspan = 9 + $recgroup_cols + $title_cols;
    260272            print <<<EOM
    261273<tr id="breakrow_$section" class="list_separator">
    262274    <td colspan="$colspan" class="list_separator">$cur_group</td>
     
    295307        echo "\t<td nowrap align=\"center\">$show->recgroup</td>\n";
    296308?>
    297309    <td nowrap align="center"><?php echo strftime($_SESSION['date_recorded'], $show->starttime) ?></td>
     310<?php
     311    if ($title_cols)
     312        echo "\t<td nowrap align=\"center\">$show->programid</td>\n";
     313?>
    298314    <td nowrap><?php echo nice_length($show->length) ?></td>
    299315    <td nowrap><?php echo nice_filesize($show->filesize) ?></td>
    300316<?php   if ($show->endtime > time()) { ?>
     
    310326<?php   }
    311327
    312328        if ($_SESSION['recorded_descunder'])
    313             echo("</tr><tr id=\"descunderrow_".$row."\" class=\"recorded\">\n\t<td colspan=\"" . (6 + $recgroup_cols) . "\">".$show->description."</td>\n");
     329            echo("</tr><tr id=\"descunderrow_".$row."\" class=\"recorded\">\n\t<td colspan=\"" . (6 + $recgroup_cols + $title_cols) . "\">".$show->description."</td>\n");
    314330?>
    315331</tr><tr id="statusrow_<?php echo $row ?>" class="recorded">
    316     <td nowrap colspan="<?php echo 6 + ($_SESSION['recorded_descunder'] ? 0 : 1) + $recgroup_cols ?>" align="center">
     332    <td nowrap colspan="<?php echo 6 + ($_SESSION['recorded_descunder'] ? 0 : 1) + $recgroup_cols + $title_cols ?>" align="center">
    317333        <span style="padding-right: 25px"><?php echo t('has commflag') ?>:&nbsp;
    318334            <b><?php echo $show->has_commflag ? t('Yes') : t('No') ?></b></span>
    319335        <span style="padding-right: 25px"><?php echo t('has cutlist') ?>:&nbsp;