custom order of ticket-categories has to be admin/reseller-dependend

Signed-off-by: Michael Kaufmann (d00p) <mkaufmann@nutime.de>
This commit is contained in:
Michael Kaufmann (d00p)
2013-02-25 15:54:33 +01:00
parent 0c471639b1
commit 8b9bc44279
2 changed files with 22 additions and 15 deletions

View File

@@ -449,9 +449,13 @@ class ticket
*
* @return int highest order number
*/
static public function getHighestOrderNumber($_db = null)
static public function getHighestOrderNumber($_db = null, $_uid = 0)
{
$sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`;";
$where = '';
if ($_uid > 0) {
$where = ' WHERE `adminid` = "'.(int)$_uid.'"';
}
$sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`".$where.";";
$result = $_db->query_first($sql);
return (isset($result['highestorder']) ? (int)$result['highestorder'] : 0);
}