Erstmal muss folgende Anleitung befolgt werden:
—–
If you want to customize the ticket number in your osTicket System, then this modification is for you. As we know, the ticketID field in ost_ticket table has the field type as int(11). It means that this field can only contains of the numerical data. Sometimes you want to change that original ticket number from which contains of the six digits numerical data become something which contains of the alpha-numeric characters. For example, you want to add the Custom prefix which in this case contains of letters, then you have to alter that field type, for instance, become varchar(12).
- Alter your ost_ticket table by changing the type of ticketID field, from int(11) become varchar(12). Adjust the value: 12 with your requirement.
- Open your \include\class.misc.php file, and find this code:
30
return mt_rand($start,$end);then replace with:
30
return "Custom".mt_rand($start,$end); - Open your login.php file, and find this code:
44 45
//See if we can fetch local ticket id associated with the ID given if(!$errors && is_numeric($ticketID) && Validator::is_email($email) && ($tid=Ticket::getIdByExtId($ticketID))) {then replace with this following code:
44 45
//See if we can fetch local ticket id associated with the ID given if(!$errors && Validator::is_email($email) && ($tid=Ticket::getIdByExtId($ticketID))) { - Open your \include\staff\tickets.inc.php file, and find this code:
136
if(is_numeric($searchTerm)){then replace with this following code:
136
if($searchTerm){ - Open your \include\ajax.tickets.php file, and find this code:
49
if(is_numeric($input)) {then replace with this following code:
49
if($input) {Find again this code:
71
if(!$params['tid'] or !is_numeric($params['tid']))then replace with this following code:
71
if(!$params['tid'])Find again this code:
104
if(!$params['id'] or !is_numeric($params['id']))then replace with this following code:
104
if(!$params['id']) - Open your tickets.php file, and find this code:
if(($id=$_REQUEST['id']?$_REQUEST['id']:$_POST['ticket_id']) && is_numeric($id)) { //id given fetch the ticket info and check perm. $ticket= new Ticket(Ticket::getIdByExtId((int)$id));then replace with this following code:
if(($id=$_REQUEST['id']?$_REQUEST['id']:$_POST['ticket_id']) && $id) { //id given fetch the ticket info and check perm. $ticket= new Ticket(Ticket::getIdByExtId($id));
In this example, you want to add the Custom prefix into the ticket number.
——-
Und dann noch der fehlende letzte Schritt von mir:
——-
in include\class.ticket.php
Line 1331 and 1332 search for:
$extId=$id; //To make things really easy we are going to use autoincrement ticket_id.
db_query(‘UPDATE ‘.TICKET_TABLE.’ SET ticketID=’.db_input($extId).’ WHERE ticket_id=’.$id);
replace with:
$extId=$id; //To make things really easy we are going to use autoincrement ticket_id.
db_query(‘UPDATE ‘.TICKET_TABLE.’ SET ticketID=”Custom’.db_input($extId).’” WHERE ticket_id=’.$id);
——-
