[Resolved] Keyboard Shortcut / Edit Ticket

  • January 29, 2021 at 1:21 am #7356
    itcubed
    Participant

    Hi stevland

    I love the keyboard shortcuts which I believe are part of osTicketAwesome.

    Do you think it would be possible to add one to edit the current ticket you’re in? eg SHIFT and E for the URL

    …/scp/tickets.php?id=XXXXX&a=edit

    Thanks

    Oliver.

  • February 18, 2021 at 3:58 pm #7435
    stevland
    Keymaster

    Hi Oliver,

    This is a great idea. It will be added in all future 1.15.x releases.

    In the meantime you can open /osta/js/mousetrap.js, add the following…

    // shift + e
    Mousetrap.bind('shift+e', function(e) {

    var loc = location.href;
    loc += loc.indexOf("?") === -1 ? "?" : "&";
    location.href = loc + '&a=edit';

    });

    …and then have at ‘er.

  • February 26, 2021 at 4:16 pm #7477
    itcubed
    Participant

    Hi Stevland

    Many thanks – working brilliantly. I did come across a minor bug with it.

    After adding a reply/note, the URL goes
    from:
    …/scp/tickets.php?id=XXXXX
    to either:
    …/scp/tickets.php?id=XXXXX#reply
    or
    …/scp/tickets.php?id=XXXXX#note

    Shift E then makes this

    …/scp/tickets.php?id=XXXXX#reply&a=edit

    which doesn’t work.

    I’ve put in a fix to remove the #reply and #note, but you may have something more elegant up your sleeve to roll into the next release. 🙂

    (I also removed the & from the last line (highlighted) as it was putting in a double ampersand)

    Oliver.

    // shift + e
    Mousetrap.bind('shift+e', function(e) {
    
    var loc = location.href;
    loc = loc.split("#")[0];
    loc += loc.indexOf("?") === -1 ? "?" : "&";
    location.href = loc + 'a=edit';
    
    });
    • March 25, 2021 at 4:43 pm #7547
      stevland
      Keymaster

      Thanks for your follow up, Oliver.

      I added shift + e to the latest release. But I’ve now added your last message to my To Do list and I will review it while I’m working on the next release.

You must be logged in to reply to this topic.