- show next logical order number when creating new ticket category, fixes #464

This commit is contained in:
Michael Kaufmann (d00p)
2010-11-08 07:11:00 +00:00
parent 5cd1c1284a
commit 59bbfcef4f
2 changed files with 17 additions and 1 deletions

View File

@@ -442,6 +442,20 @@ class ticket
return null;
}
/**
* get the highest order number
*
* @param object $_db database-object
*
* @return int highest order number
*/
static public function getHighestOrderNumber($_db = null)
{
$sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`;";
$result = $_db->query_first($sql);
return (isset($result['highestorder']) ? (int)$result['highestorder'] : 1);
}
/**
* returns the last x archived tickets
*/