1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

v.4.92.6 - Ticket create new user account

Discussion in 'LoginShare' started by jeffshead, Feb 11, 2019.

  1. jeffshead

    jeffshead Established Member

    I know Kayako Classic is on it's last legs but I would like to keep it going till the very end so if anyone on here is bored and can take a moment to help, I'd greatly appreciate it.

    This Loginshare script has served me well for several years (Thanks Brett!):
    http://forge.kayako.com/projects/php-loginshare

    I'm currently running Fusion 4.90. I finally took the time to attempt an upgrade to 4.92.6 but there are drastic changes to the code. I can't figure out how to integrate the Loginshare script hook in the __apps\tickets\models\Ticket\class.SWIFT_Ticket.php file.

    Basically, the hook is supposed to be inserted in the code where Kayako creates a user account if one does not already exist for the ticket creator. I attached the unedited class.SWIFT_Ticket.php from 4.92.6 and the one from 4.90 with the hook already inserted.

    Can someone please take a peak and let me know where I should insert the hook in 4.92.6? All of my attempts have failed.

    Below is the hook code:
    PHP:
                // Begin Hook: client_user_ticket_createCSCartAccount
                
    unset($_hookCode);
                
    $_hookResult null;
                (
    $_hookCode SWIFT_Hook::Execute('client_user_ticket_createCSCartAccount')) ? ($_hookResult = eval($_hookCode)) : false;
                if (
    $_hookResult !== null)
                    return 
    $_hookResult;
                
    // End Hook
    Just search for "Begin Hook" in the 4.90 file and you will get an idea of how it works by seeing the surrounding code.

    Thanks,

    Jeff
     

    Attached Files:

  2. jeffshead

    jeffshead Established Member

    I fixed it. The code has changed a lot since 4.90.x.
    The hook no longer goes in 'class.SWIFT_Ticket.php'. It needs to be inserted into '__apps/tickets/models/Ticket/SWIFT_TicketGettersTrait.php'. Also, since a namespace is specified in this file, you have to include '__swift/library/Hook/class.SWIFT_Hook.php' and add the hook class.
     

Share This Page