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
...@@ -611,20 +611,29 @@ function vw_idx_handler($type) ...@@ -611,20 +611,29 @@ function vw_idx_handler($type)
// TODO Probably need a better up/down arrow // TODO Probably need a better up/down arrow
function sort_header($field, $name) function sort_header($field, $name)
{ {
global $orderby, $orderdesc; global $orderby, $orderdesc;
$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 ($orderby == $field) { if (!$_REQUEST['project_id']) {
$link .= $orderdesc ? "0" : "1"; $link = "<a class=\"hdr\" href=\"?m=companies&a=view&company_id={$_REQUEST['company_id']}&orderby=$field&orderdesc=";
$arrow .= $orderdesc ? " &uarr;" : " &darr;";
} else { } else {
$link .= "0"; $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"; $link .= "\">$name</a>$arrow";
return $link;
}
return $link;
}
\ No newline at end of file
...@@ -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