Commit d5b710fe authored by Jean-Paul Saman's avatar Jean-Paul Saman

Move sort_header() helpdesk.functions.php

Both files list.php and helpdesk.functions.php declared the function sort_headers().
This resulted in an PHP error and blank page. By moving the function to helpdesk.functions.php
from list.php and ditching the version from helpdesk.functions.php the situation no longer exists.
parent c76d12b6
...@@ -615,7 +615,15 @@ function sort_header($field, $name) ...@@ -615,7 +615,15 @@ function sort_header($field, $name)
$arrow = ""; $arrow = "";
if (!$_REQUEST['project_id'] && !$_REQUEST['company_id']) {
$link = "<a class=\"hdr\" href=\"?m=helpdesk&a=list&orderby=$field&orderdesc="; $link = "<a class=\"hdr\" href=\"?m=helpdesk&a=list&orderby=$field&orderdesc=";
} else {
if (!$_REQUEST['project_id']) {
$link = "<a class=\"hdr\" href=\"?m=companies&a=view&company_id={$_REQUEST['company_id']}&orderby=$field&orderdesc=";
} else {
$link = "<a class=\"hdr\" href=\"?m=projects&a=view&project_id={$_REQUEST['project_id']}&orderby=$field&orderdesc=";
}
}
if ($orderby == $field) { if ($orderby == $field) {
$link .= $orderdesc ? "0" : "1"; $link .= $orderdesc ? "0" : "1";
...@@ -628,3 +636,4 @@ function sort_header($field, $name) ...@@ -628,3 +636,4 @@ function sort_header($field, $name)
return $link; return $link;
} }
...@@ -665,32 +665,3 @@ echo '</td></tr>'; ...@@ -665,32 +665,3 @@ echo '</td></tr>';
print "</small></center>"; print "</small></center>";
// Returns a header link used to sort results
// TODO Probably need a better up/down arrow
function sort_header($field, $name)
{
global $orderby, $orderdesc;
$arrow = "";
if (!$_REQUEST['project_id'] && !$_REQUEST['company_id']) {
$link = "<a class=\"hdr\" href=\"?m=helpdesk&a=list&orderby=$field&orderdesc=";
} else {
if (!$_REQUEST['project_id']) {
$link = "<a class=\"hdr\" href=\"?m=companies&a=view&company_id={$_REQUEST['company_id']}&orderby=$field&orderdesc=";
} else {
$link = "<a class=\"hdr\" href=\"?m=projects&a=view&project_id={$_REQUEST['project_id']}&orderby=$field&orderdesc=";
}
}
if ($orderby == $field) {
$link .= $orderdesc ? "0" : "1";
$arrow .= $orderdesc ? " &uarr;" : " &darr;";
} else {
$link .= "0";
}
$link .= "\">$name</a>$arrow";
return $link;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment