I'd like to sort issues by 3 different fields in View Issues Page; First sort by Priority, then by Status, then by Date Submitted. Is this possible and how to do it?
Thanks a lot!
Please help,
Moderators: Developer, Contributor
Code: Select all
$t_sort_fields = explode( ',', $t_filter[FILTER_PROPERTY_SORT_FIELD_NAME] );
$t_dir_fields = explode( ',', $t_filter[FILTER_PROPERTY_SORT_DIRECTION] );
for( $i = 0;$i < 3;$i++ ) {Code: Select all
if( !isset( $t_sort_fields[2] ) ) {
$t_sort_fields[2] = '';
$t_dir_fields[2] = '';
}Code: Select all
echo ', ';
# for third sort
echo '<select name="', FILTER_PROPERTY_SORT_FIELD_NAME, '_2">';
foreach( $t_shown_fields as $key => $val ) {
echo '<option value="' . $key . '"';
check_selected( $key, $t_sort_fields[2] );
echo '>' . $val . '</option>';
}
echo '</select>';
echo '<select name="', FILTER_PROPERTY_SORT_DIRECTION, '_2">';
foreach( $t_shown_dirs as $key => $val ) {
echo '<option value="' . $key . '"';
check_selected( $key, $t_dir_fields[2] );
echo '>' . $val . '</option>';
}
echo '</select>';Code: Select all
echo '<input type="hidden" name="', FILTER_PROPERTY_SORT_FIELD_NAME, '_2" value="last_updated" />';
echo '<input type="hidden" name="', FILTER_PROPERTY_SORT_DIRECTION, '_2" value="DESC" />';Code: Select all
$f_sort_2 = gpc_get_string( FILTER_PROPERTY_SORT_FIELD_NAME . '_2', 'summary' );
$f_dir_2 = gpc_get_string( FILTER_PROPERTY_SORT_DIRECTION . '_2', 'ASC' );Code: Select all
$f_sort = ( ( $f_sort_d != "" ) ? $f_sort_d : $f_sort_0 ) . ( ( $f_sort_1 != "" ) ? "," . $f_sort_1 : "" ) . ( ( $f_sort_2 != "" ) ? "," . $f_sort_2 : "" );
$f_dir = ( ( $f_dir_d != "" ) ? $f_dir_d : $f_dir_0 ) . ( ( $f_dir_1 != "" ) ? "," . $f_dir_1 : "" ) . ( ( $f_dir_2 != "" ) ? "," . $f_dir_2 : "" );