Menu

#11 Secondary sort field in bug list

open
None
5
2002-02-25
2002-01-12
Rob Allen
No

When I sort by Priority, it would be helpful if the
bugs were then sorted by Severity within each priority.

Discussion

  • Benjamin Curtis

    Benjamin Curtis - 2002-02-25
    • assigned_to: nobody --> bcurtis
     
  • Benjamin Curtis

    Benjamin Curtis - 2002-02-25

    Logged In: YES
    user_id=11944

    I'll take a look at adding this.

     
  • Anthony Guarnieri

    Logged In: YES
    user_id=607197

    I've been asked for this as well. So far, I've managed to
    change the .html file, but query.php is going to take a
    while for me to figure out, so I'll vote for this enhancement :)

     
  • Anthony Guarnieri

    Logged In: YES
    user_id=607197

    Luckily my wife is better at php than I am, and we now have
    secondary sort working in the simple query page in 0.8.2. To
    get it to work, she modified query.php and inc/db/mysql.php.
    In query.php, change the line

    list($selrange, $llimit) = multipages($nr, $page,
    "order=$order&sort=$sort");

    tolist($selrange, $llimit) = multipages($nr, $page,
    "order=$order&sort=$sort&order2=$order2&sort2=$sort2");

    and the line

    $order, $sort), $llimit, $selrange)));

    to

    $order, $sort, $order2, $sort2), $llimit, $selrange)));

    In inc/db/mysql.php, change the line

    'order by %s %s, bug_id asc',

    to

    'order by %s %s, %s %s, bug_id asc',

    Of course, the queryform-simple.html file should have the
    selections set up like this:

    <tr>
    <td valign="top"><b>Sort By:</b></td>
    <td valign="top">
    <select name="order2">
    <option value="bug_id">Bug Number</option>
    <option selected value="severity.sort_order">Severity
    </option>
    <option value="reporter">Reporter</option>
    <option value="status.sort_order">Status</option>
    <option value="priority">Priority</option></select>
    <select name="sort2">
    <option selected value="asc">Ascending</option>
    <option value="desc">Descending</option>
    </select>
    </td>
    </tr>

     
  • Anthony Guarnieri

    Logged In: YES
    user_id=607197

    Ok, last comment retracted, as it caused SQL errors
    elsewhere (testing?? whazzat? :) Going to create a new
    function to contain this secondary sort query....

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.