This mod - which adds a button next to "Refresh" above the "Tickets" list to negate customised sorting and return to the default ticket order (status, then priority, then last response date/time...) - has been tested and works with v1.7.0. Note that the following patches should be applied at the TLD of your osTicket installation (using patch -p0 < ). Several files are affected:
include/staff/tickets.inc.php
scp/css/scp.css
Note that my line numbers might differ from yours, and the order in which I apply this mod with others will most likely differ form the order in which you do.
The patch, containing all changes:
--- include/staff/tickets.inc.php 2013-05-03 09.000000000 -0600
+++ include/staff/tickets.inc.php 2013-05-29 13.000000000 -0600
@@ -210,6 +210,8 @@
//Sorting options...
$queue = isset($_REQUEST)?strtolower($_REQUEST):$status;
$order_by=$order=null;
+if($_REQUEST == 'default') // Default sort - no action required SG20130529
+ $_SESSION = $_SESSION = $_REQUEST = null;
if($_REQUEST && $sortOptions[$_REQUEST)
$order_by =$sortOptions[$_REQUEST;
elseif($sortOptions[$_SESSION) {
@@ -337,6 +339,7 @@
<form action="tickets.php" method="POST" name='tickets'>
<?php csrf_token(); ?>
<a class="refresh" href="<?php echo $_SERVER; ?>">Refresh</a>
+ <a class="sort" href="<?php $baseURL = preg_replace(array('/(sort|order)=\w+&/', '/&(sort|order)=\w+/', '/(sort|order)=\w+/', '/\?$/'), '', $_SERVER); echo $baseURL.(strpos($baseURL, '=')?'&':'?').'sort=default'; ?>">Default Sort</a>
<input type="hidden" name="a" value="mass_process" >
<input type="hidden" name="do" id="action" value="" >
<input type="hidden" name="status" value="<?php echo Format:($_REQUEST); ?>" >
--- scp/css/scp.css 2013-04-01 23.000000000 -0600
+++ scp/css/scp.css 2013-05-29 13.000000000 -0600
@@ -332,6 +332,7 @@
.Icon.file { background-image: url(../images/icons/file.gif); }
.Icon.refresh { background-image: url(../images/icons/refresh.gif); }
+.Icon.sort{ background-image: url(../images/asc_desc.gif); }
.Icon.note {
font-weight: bold;
font-size: 1em;
@@ -465,6 +466,23 @@
background-image(../images/icons/refresh.gif);
}
+a.sort {
+ display;
+ float;
+ width;
+ height;
+ line-height;
+ padding 5px 2px 2px;
+ background-position 50%;
+ background-repeat-repeat;
+ padding-left;
+ margin-left;
+ margin-bottom: 2px;
+ border solid #aaa;
+ background-image(../images/asc_desc.gif);
+ background-position:-3px;
+}
+
a.edit, a.print {
display;
float;