Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Change button text based on Assigned to

Is it possible to change the button within the sticky to read one thing if the ticket is unassigned and another if its got someone assigned to it?

Comments

  • There's a couple of buttons in the sticky bar, so which one are you referring to?
    You'll need to modify the core files to achive this an example that does this already can be found here: https://github.com/osTicket/osTicket/blob/develop/include/staff/ticket-view.inc.php#L105
  • Apoligies, in the sticky there is a button that says Reassign, I want it to say 'Claim' if the ticket is unassigned.
  • But it already says claim on the sticky bar?
    2017-04-19 14-15-52.jpg
    984 x 175 - 71K
  • That may be my problem then, see I've changed my sticky bar so the buttons look like this

    Where it says Reassign I want that to read differently depenising on if the ticket is assigned to someone.

    Capture.JPG
    173 x 47 - 9K
  • Picture
    Capture.JPG
    173 x 47 - 9K
  • Not sure why its not letting me attach an image but here 


  • Can you post the code you have include/staff/ticket-view.inc.php
    between line 99 (should be comment // Assign) and the following 20-30 lines.
  • // Assign
                if ($ticket->isOpen() && $role->hasPerm(TicketModel::PERM_ASSIGN)) {?>
                <span class="action-button pull-right"
                    data-dropdown="#action-dropdown-assign"
                    data-placement="bottom"
                    data-toggle=""
                    title=" <?php echo $ticket->isAssigned() ? __('Assign') : __('Reassign'); ?>"
                    >
                    <i class="icon-caret-down pull-right"></i>
                    <a class="ticket-action" id="ticket-assign"
                        data-redirect="tickets.php?id=<?php echo $ticket->getId(); ?>"
                        href="#tickets/<?php echo $ticket->getId(); ?>/assign"><i class="icon-user"> </i>Reassign</a>
                </span>
                <div id="action-dropdown-assign" class="action-dropdown anchor-right">
                  <ul>
                    <?php
                    // Agent can claim team assigned ticket
                    if (!$ticket->getStaff()
                            && (!$dept->assignMembersOnly()
                                || $dept->isMember($thisstaff))
                            ) { ?>
                     <li><a class="no-pjax ticket-action"
                        data-redirect="tickets.php?id=<?php echo $ticket->getId(); ?>"
                        href="#tickets/<?php echo $ticket->getId(); ?>/claim"><i
                        class="icon-chevron-sign-down"></i> <?php echo __('Claim'); ?></a>
                    <?php
                    } ?>
                     <li><a class="no-pjax ticket-action"
                        data-redirect="tickets.php?id=<?php echo $ticket->getId(); ?>"
                        href="#tickets/<?php echo $ticket->getId(); ?>/assign/agents"><i
                        class="icon-user"></i> <?php echo __('Agent'); ?></a>
                     <li><a class="no-pjax ticket-action"
                        data-redirect="tickets.php?id=<?php echo $ticket->getId(); ?>"
                        href="#tickets/<?php echo $ticket->getId(); ?>/assign/teams"><i
                        class="icon-group"></i> <?php echo __('Team'); ?></a>
                  </ul>
                </div>
                <?php
                } ?>
                <div id="action-dropdown-more" class="action-dropdown anchor-right">
                  <ul>
                    <?php
  • If you look on this line, https://github.com/osTicket/osTicket/blob/develop/include/staff/ticket-view.inc.php#L110
    You've added Reassign, replace that with this <?php echo $ticket->isAssigned() ? __('Assign') : __('Claim'); ?>
  • Thats worked, thank you :) 
Sign In or Register to comment.