Malte Glöckner

Weltenverbesserer, IT-Experte, Umweltkämpfer

  • @hermesDE Ja, soll sie. Es gibt sogar seit gestern Abend eine einmalige Vollmacht. Die heute nicht beachtet wurde.… t.co/4xoxmne5eG

  • @hermesDE Sendungsnummer 33275120008177, eigentlich gibt es eine globale Abstellgenehmigung?

  • #fire #Feuer #feuerschale t.co/rPFilxuEPx

  • Erste finale Steckdosen-/Schalterbestellung ist da. Und dann noch 50% gespart 😀 #kopp t.co/fXUCheztgm

  • "Nimm ruhig dem Aufsteller mit"... Muss ich mir Gedanken machen 😀 t.co/7JzoDsvTg2

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).

  1. 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.
  2. 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);
  3. 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))) {
  4. 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){
  5. 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'])
  6. 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);

——-

1 Kommentar

  • Malte Glöckner, 18. März 2010 at 11:32:06

    Hey Malte,

    du hast noch was vergessen ;o

    in include\class.mailfetch.php ab Zeile 242

    if(preg_match („[[#][0-9]{1,10}]“,$var[’subject‘],$regs)) {
    $extid=trim(preg_replace(„/[^0-9]/“, „“, $regs[0]));

    ersetzen durch

    list($dummy,$var[’subject_edited‘])=split(„#Custom“,$var[’subject‘],2);
    $var[’subject_edited‘]=“#Custom“.$var[’subject_edited‘];

    if(preg_match („[[#][A-Z0-9-]{1,12}]“,$var[’subject_edited‘],$regs)) {
    $extid=trim(preg_replace(„/[^A-Z0-9-]/“, „“, $regs[0]));

    Reply

Leave a commentCancel reply