I
indy_neal

  • Jun 7, 2019
  • Joined Apr 23, 2019
  • 0 best answers
  • So after some persistence I was able to track down where to make the edit.

    On /include/class.thread.php

    FIND:
    function toHtml() {
    return $this->display('html');
    }

    REPLACE WITH:
    function toHtml() {
    //CUSTOMIZATION: ADDED AND MODIFIED
    $display_html = $this->display('html');
    $display_html_final = preg_replace_callback('/[0-9]{10}/', function($match) {
    return sprintf('<a target="_blank" href="https://www.store.com/admin/orders/orderID/%s">%s</a>',
    htmlspecialchars($match[0]),
    htmlspecialchars($match[0])
    );
    }, $display_html);

    	return $display_html_final;
    }

    The pattern matching regex for our order id's is a 10 digit number, so: /[0-9]{10}/

  • I want to create a small core modification that will auto-link / hot-link any order id's that are entered into the main ticket (and task). That way when a user has entered an order id that needs attention, I can hot-link right to the order in the admin of our store.

    I can write the search and replace regex.

    But I don't know where the output for this in the osTicket code.

    Somewhere there is a function returning the data: return $ticket_content

    Does anyone know where this is? And is the output the same for tasks or is this a different function and return? Ideally I'd like both tickets and tasks to be able to do this.

    Thanks,

    Neal

  • I ran into the same problem on our Magento store. All the forms are sent to and from our support email. Also, most severs today or services (Mandrill) will not send the mail as the user submitting form. I'm not sure if I missed something but it does not seem osTicket will use the reply-to email sent with the email header??

    I used the API to send the form data to osTicket: api_ticket_create.php

    Took the example code from that file and included it on the shopping cart send mail page. Works pretty well.