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

[MOD] Merge Tickets

edited November 2013 in Mods and Customizations
This is based off of

masino_sinaga mod for 1.6rc5

http://www.openscriptsolution.com/ticket-system/osticket/adding-merge-ticket-feature-into-osticket-v1-6-rc5/


files involved:
\scp\tickets.php
\include\class.ticket.php
\include\staff\ticket-view.inc.php

It's not pretty for 1.7 but it does work; also tosses a DB error if anyone can figure out how to make it stop tossing that error and to make it look prettier you're more than welcome.

I've left the original code code intact and just added // in the event it's useful but I didn't see a need for it.

\scp\tickets.php

After this section of code



} elseif(!$errors['transfer']) {
$errors['err'] = 'Unable to complete the ticket transfer';
$errors['transfer']='Correct the error(s) below and try again!';
}
}
break;



Add this:



case 'mergeticket':
if( $ticket->mergeTicket($_POST['keepticket'],
$_POST['notifycustomer'],
$_POST['email'],
$_POST['status'] )){
$title='Merged Tickets';
$msg='Ticket Has Been Sucessfully Merged.';
}else{
$errors['err']=$errors['err']?$errors['err']:'Unable to merge tickets or the ticket has been closed.';
}
break;




\include\class.ticket.php

After this section of code

//Insert Internal Notes
function logNote($title, $note, $poster='SYSTEM', $alert=true) {

$errors = array();
return $this->postNote(
array('title' => $title, 'note' => $note),
$errors,
$poster,
$alert);
}


Add this:


//merge this ticket to another ticket
function mergeTicket($keepticket,$notifycustomer,$email,$status) {
global $cfg;
global $thisstaff;
// update these tables...:
// ost_ticket_attachment
$sql1= 'UPDATE '.TICKET_ATTACHMENT_TABLE.' SET '.
' ticket_id='.db_input(Format::striptags($keepticket)).
' WHERE '.
'ticket_id='.db_input($this->getId());
// ost_ticket_message
$sql2= 'UPDATE '.TICKET_THREAD_TABLE.' SET '.
' ticket_id='.db_input(Format::striptags($keepticket)).
' WHERE '.
'ticket_id='.db_input($this->getId());
// ost_ticket_note
//$sql3= 'UPDATE '.TICKET_NOTE_TABLE.' SET '.
// ' ticket_id='.db_input(Format::striptags($keepticket)).
// ' WHERE '.
// 'ticket_id='.db_input($this->getId());
// ost_ticket_response
//$sql4= 'UPDATE '.TICKET_RESPONSE_TABLE.' SET '.
// ' ticket_id='.db_input(Format::striptags($keepticket)).
// ' WHERE '.
// 'ticket_id='.db_input($this->getId());
// create message on this ticket about merge (ost_ticket_message)
$sql5= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET '.
' ticket_id='.db_input($this->getId()).
', source=\"Web\"'.
', created=NOW()'.
', body=CONCAT(\"Merged with ticket \",'.
' ( SELECT ticketID FROM '.TICKET_TABLE.' WHERE ticket_id='.db_input(Format::striptags($keepticket)).' ))'.
';';
// close and unassign this ticket (ost_ticket)
$sql6 = 'UPDATE '.TICKET_TABLE.' SET '.
' staff_id = 0'.
', status = \"closed\"'.
', updated=NOW()'.
', closed=NOW()'.
' WHERE '.
'ticket_id='.db_input($this->getId());

if((db_query($sql1)) && (db_query($sql2)) &&
//(db_query($sql3)) && (db_query($sql4)) &&
(db_query($sql6)) ){
if ( db_query($sql5) && $msgid=db_insert_id() ); { //&& $msgid=db_insert_id($res5)
$sql7= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET '.
//' id='.db_input($msgid).
' ticket_id='.db_input($this->getId()).
', staff_id='.db_input($thisstaff->getId()).
', poster='.db_input($thisstaff->getName()).
', ip_address=\"\"'.
', created=NOW()'.
', body=CONCAT(\"Ticket closed for merging reason \",'.
' ( SELECT ticketID FROM '.TICKET_TABLE.' WHERE ticket_id='.db_input(Format::striptags($keepticket)).' ))'.
';';
db_query($sql7);

$sqlt = 'SELECT ticketID FROM '.TICKET_TABLE.' WHERE ticket_id='.db_input(Format::striptags($keepticket));
$rest=db_query($sqlt);
if($rest && db_num_rows($rest))
list($ticketID)=db_fetch_row($rest);
$sqlm = 'SELECT id FROM '.TICKET_THREAD_TABLE.' m, '.TICKET_TABLE.' t
WHERE t.ticketID='.$ticketID.' AND m.ticket_id=t.ticket_id ORDER BY id ASC LIMIT 1';
$resm=db_query($sqlm);
if($resm && db_num_rows($resm))
list($msgid)=db_fetch_row($resm);

$sql8= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET '.
//' id='.db_input($msgid).
' ticket_id='.db_input(Format::striptags($keepticket)).
', staff_id='.db_input($thisstaff->getId()).
', poster='.db_input($thisstaff->getName()).
', ip_address=\"\"'.
', created=NOW()'.
', body=CONCAT(\"Ticket merged from ticket \",'.$this->getExtId().')';
db_query($sql8);
}

if ($notifycustomer && ($status!='closed')) {
$helpdesk_email=$cfg->getDefaultEmail();
$helpdesk_email->send($email,
'Merging Ticket #'.$this->getExtId().' to Ticket #'.$ticketID,
'Your ticket #'.$this->getExtId().' has been merged to ticket #'.$ticketID.'.');
}
return true;
} else {
return false;
}
}




\include\staff\ticket-view.inc.php

After this section of code:

if($thisstaff->canBanEmails()) {
if(!$emailBanned) {?>
<li><a id=\"ticket-banemail\" href=\"#banemail\"><i class=\"icon-ban-circle\"></i> Ban Email (<?php echo $ticket->getEmail(); ?>)</a></li>
<?php
} elseif($unbannable) { ?>
<li><a id=\"ticket-banemail\" href=\"#unbanemail\"><i class=\"icon-undo\"></i> Unban Email (<?php echo $ticket->getEmail(); ?>)</a></li>
<?php
}
}?>
</ul>
</div>
</td>
</tr>
</table>


Add This:


<table class=\"mergetickets\" cellspacing=\"0\" cellpadding=\"0\" width=\"940\" border=\"0\">
<tr>
<td width=\"50\">
<table border=\"0\" cellspacing=\"\" cellpadding=\"4\" width=\"100%\">
<tr>
<th width=\"100\">Merge Ticket?:</th>

<?
$sql = 'SELECT ticket_id, concat(ticketid,\": \",subject) AS label FROM '.TICKET_TABLE.' WHERE email='.
'(SELECT email FROM ost_ticket WHERE ticket_id = '.$id.') AND status '.
'= \"open\" AND ticket_id <> '.$id.' ORDER BY `created` DESC ';
$lookuptickets = db_query($sql);
if (db_num_rows($lookuptickets)) {
?>
<p>

<form action=\"tickets.php?id=<?=$id?>#mergeticket\" name=\"notes\" method=\"post\" enctype=\"multipart/form-data\">
<?php csrf_token(); ?>
<input type=\"hidden\" name=\"ticket_id\" value=\"<?=$id?>\">
<input type=\"hidden\" name=\"a\" value=\"mergeticket\">
<input type=\"hidden\" name=\"email\" value=\"<?php echo $ticket->getEmail(); ?>\">
<input type=\"hidden\" name=\"status\" value=\"<?php echo $ticket->getStatus(); ?>\">
Merge this current ticket into ticket # <select id=\"keepticket\" name=\"keepticket\">
<?php
while (list($ticket_id,$label) = db_fetch_row($lookuptickets)){
?>
<option value=\"<?=$ticket_id?>\"><?=$label?></option>
<?
}?>
</select>
<div><input type=\"checkbox\" value=\"1\" name=\"notifycustomer\" />Send Email to Customer inform the Ticket Merging</div>
<div style=\"margin-left: 50px; margin-top: 5px; margin-bottom: 10px;border: 0px;\" align=\"left\">
<input class=\"button\" type='submit' value='Merge Ticket'/>
<input class=\"button\" type='reset' value='Reset' />
<input class=\"button\" type='button' value='Cancel' onClick=\"history.go(-1)\" />
</div>
<?php } else {
echo \"Sorry, this ticket cannot be merged into another since there is no ticket has the same email address with this.\";
}
?>
</p>
</form>
</p>
</div>
</tr>
<tr>
</tr>
</table>
«1

Comments

  • No luck my friend on this one ..

    Got a bunch of SQL errors as a result. (I've got a Fresh install of 1.7 Stable)


    Example of some of them:

    [INSERT INTO ost_ticket_thread SET id=110, ticket_id=11, staff_id=1, poster='Jason Berresford', ip_address=\"\", created=NOW(), body=CONCAT(\"Ticket merged from ticket \",48)]

    Duplicate entry '110' for key 1



    [SELECT id FROM ost_ticket_thread m, ost_ticket t 
    WHERE t.ticketID=11 AND m.ticket_id=t.ticket_id ORDER BY msg_id ASC LIMIT 1]

    Unknown column 'msg_id' in 'order clause'
  • jasonberresford;40401 said:
    No luck my friend on this one ..

    Got a bunch of SQL errors as a result. (I've got a Fresh install of 1.7 Stable)

    try now cleaned up my sloppiness, I'm not getting anymore DB errors
  • just update the code above into \include\class.ticket.php that is where the DB errors were coming from.
  • Perfect,

    I'll give it a shot tomorrow .. Thanks so much!!
  • well done!

    Works well now.
    No errors, no duplication errors.
  • Thank you!!! Works perfect, was looking for that solution for a while!
  • I hacked in a very simple merge functionality earlier, glad to be able to change it out for something a little more thought out.
  • Sadly this mod didn't work for me at all. I'm not sure if it's somehow conflicting with a mod already in my system, but oddly it was telling me that the else statement in \include\staff\ticket-view.inc.php was unexpected.
  • Quick tags

    In case this is breaking someone's ticket view, there are PHP short tags in the mod which will cause hiccups if your php.ini doesn't allow them. Simply replace all instances of <? with <?php
  • Does not work on my side. Shows this error on every opened ticket. Despite having several open tickets from that email.
    Is there something that I am missing?

    image
  • Email to Customer

    This is an awesome MOD, exactly what I needed. One question, is there any way to add the link to the new ticket in the email sent to the customer?

    Like in the other emails sent out:

    You can view this ticket's progress online here: http://link.to.new.ticket

    Thanks!

    Andrew
  • Added to the [MOD]

    Thanks for the great MOD, I fancied it up a bit. Here is the screenshot and code.

    NOTE: I only tested it in 1.7RC5

    change the first two files like shown.

    but change the ticket-view-inc.php to this:

    After:


    <div id=\"response_options\">
    <ul>
    <?php
    if($thisstaff->canPostReply()) { ?>
    <li><a id=\"reply_tab\" href=\"#reply\">Post Reply</a></li>
    <?php
    } ?>
    <li><a id=\"note_tab\" href=\"#note\">Post Internal Note</a></li>
    <?php
    if($thisstaff->canTransferTickets()) { ?>
    <li><a id=\"transfer_tab\" href=\"#transfer\">Dept. Transfer</a></li>
    <?php
    }
    if($thisstaff->canAssignTickets()) { ?>
    <li><a id=\"assign_tab\" href=\"#assign\"><?php echo $ticket->isAssigned()?'Reassign Ticket':'Assign Ticket'; ?></a></li>
    <?php
    } ?>


    Add:


    <!--- MOD: Merge Ticket, 8-19-13 --->
    <?php
    $sql = 'SELECT ticket_id, concat(ticketid,\": \",subject) AS label FROM '.TICKET_TABLE.' WHERE email='.
    '(SELECT email FROM ost_ticket WHERE ticket_id = '.$id.') AND status '.
    '= \"open\" AND ticket_id <> '.$id.' ORDER BY `created` DESC ';
    $lookuptickets_email = db_query($sql);

    if (db_num_rows($lookuptickets_email) && $ticket->isOpen()) {?>
    <li><a id=\"merge_tab\" href=\"#merge\">Merge</a></li>
    <?php
    } ?>
    <!--- END MOD: Merge Ticket, 8-19-13 --->


    After:


    </table>
    <p style=\"padding-left:165px;\">
    <input class=\"btn_sm\" type=\"submit\" value=\"<?php echo $ticket->isAssigned()?'Reassign':'Assign'; ?>\">
    <input class=\"btn_sm\" type=\"reset\" value=\"Reset\">
    </p>
    </form>
    <?php
    } ?>



    Add:


    <!--- MOD: Merge Ticket, 8-19-13 --->
    <form id=\"merge\" action=\"tickets.php?id=<?php echo $ticket->getId(); ?>#mergeticket\" name=\"notes\" method=\"post\" enctype=\"multipart/form-data\">
    <?php csrf_token(); ?>
    <input type=\"hidden\" name=\"ticket_id\" value=\"<?=$id?>\">
    <input type=\"hidden\" name=\"a\" value=\"mergeticket\">
    <input type=\"hidden\" name=\"email\" value=\"<?php echo $ticket->getEmail(); ?>\">
    <input type=\"hidden\" name=\"status\" value=\"<?php echo $ticket->getStatus(); ?>\">
    <table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
    <tr><td width=\"160\">
    <label for=\"assignId\"><strong>Ticket:</strong></label>
    <td width=\"765\">
    <span class=\"faded\">Merge this current ticket into ticket #</span>
    <br>
    <select id=\"keepticket\" name=\"keepticket\">
    <?php
    while (list($ticket_id,$label) = db_fetch_row($lookuptickets_email)){
    ?>
    <option value=\"<?=$ticket_id?>\"><?=$label?></option>
    <?php
    } ?>
    </select>
    <tr><td width=\"160\">
    <td width=\"765\">
    <input type=\"checkbox\" value=\"1\" name=\"notifycustomer\" />Send Email to Customer inform the Ticket Merging
    </table>
    <p style=\"padding-left:165px;\">
    <input class=\"btn_sm\" type='submit' value='Merge Ticket'/>
    <input class=\"btn_sm\" type='reset' value='Reset' />
    </p>
    </form>
    <!--- END MOD: Merge Ticket, 8-19-13 --->



    It should work in 1.7 STABLE with this change:

    Change:

    	<form id=\"merge\" action=\"tickets.php?id=<?php echo $ticket->getId(); ?>#mergeticket\" name=\"merge\" method=\"post\" enctype=\"multipart/form-data\">


    To:

    <form id=\"merge\" action=\"tickets.php?id=<?=$id?>#mergeticket\" name=\"merge\" method=\"post\" enctype=\"multipart/form-data\">


    I also moved my response options to the left, because I have a "View Attachements" tab, by changing the scp css file here:

    #response_options ul {
    /*padding:4px 0 0 19px;*/
    padding:0;


    There is a spelling error in the original MOD also... \include\class.ticket.php Here:

    $msg='Ticket Has Been Sucessfully Merged.';


    (In my application I also have it look for duplicate phone numbers, to list available tickets to merge with, in case one person sends in two tickets from different emails.)

    Hope people find this useful, and I'm not trying to highjack your thread just add to the great MOD.
    merge.jpg
    620 x 157 - 23K
    merge2.jpg
    607 x 132 - 21K
  • limak;42489 said:
    Does not work on my side. Shows this error on every opened ticket. Despite having several open tickets from that email.
    Is there something that I am missing?

    image
    Same error message here as your image:
    Sorry, this ticket cannot be merged into another since there is no ticket has the same email address with this.
  • I to have the same issue as above
  • Thanks

    Thanks. It was awesome and working well. :p
  • Thanks

    Thanks.It was awesome and working well.You saved my time.
  • Thank you for this mod,

    I just added it without too much problems.
  • Thanks this one works even with 1.7.1.4

    Best regards
    Jazz
  • edited November 2013
    After all the changes, I get the list of tickets, but when I want to view a ticket, there is an empty page.
    See the attachment.

    Any idea? For the moment we use OST 1.7.3

    Thanks Martin
    osticket_ticket_view.jpg
    1065 x 496 - 47K
  • tested on 1.7.2, it works
    I will try to create a function to reverse the merger
    I was thinking to add a merged_from field in the thread table, containing a comma-separated list of former ticket IDs.
    In closed tickets, I was thinking to add a form (activated only in case the ticket id is found in any merged_from field in thread table) to restore the ticket from merger.
    Any suggestion or any better ideas?
  • Just one note: I had to delete all backslashes to make it work
  • edited December 2013
    [MOD] Merge and Unmerge!

    Ok, I have done it!

    The following "mod of the mod" supports unmerging tickets, even if there are multiple sequential mergers (in such a case, one may unmerge the last merged ticket first and then go backwards through the merger sequence)

    Moreover, if one ticket has been closed because of merger, one cannot simply reopen it, but must instead unmerge and reopen it (I changed the button).

    I also added a check so only staff that can close tickets can merge-unmerge them.

    Finally, I added a link to the merge-unmerge messages, so one can open the other merged-unmerged ticket-



    That said, we are ready to go.  (I have to split the post in more than one comment)

    First, modify the files as explained by tristannovak above.

    Then, add a varchar column named 'merged_from' to the ost_ticket_thread table.

    Then, in staff/tickets.php, after:

                        } else {
                            $errors['err']=__('Problems deleting the ticket. Try again');
                        }
                        break;

    add:

                    case 'unmerge':
                        if($ticket->unmergeTicket()){
                        $msg="Ticket successfully unmerged";
                        } else {
                         $errors['err']=__('Cannot unmerge the ticket. Try again');
                        }
                    break;


    in include/class.ticket.php, change:

            // ost_ticket_message
            $sql2= 'UPDATE '.TICKET_THREAD_TABLE.' SET  '.
                    ' ticket_id='.db_input(Format::striptags($keepticket)).
                ' WHERE '.
                    'ticket_id='.db_input($this->getId());

    to:

            // ost_ticket_message
            $sql2= 'UPDATE '.TICKET_THREAD_TABLE.' SET  '.
                    ' ticket_id='.db_input(Format::striptags($keepticket)).
                    ', merged_from=CONCAT(merged_from, '.db_input("/".$this->getId()."/").')'.
                ' WHERE '.
                    'ticket_id='.db_input($this->getId());




  • edited December 2013
    change

                $sql5= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET  '.
    [.......]
                        ', body=CONCAT("Merged with ticket ",'.
                        '  ( SELECT ticketID FROM '.TICKET_TABLE.' WHERE ticket_id='.db_input(Format::striptags($keepticket)).' ))'.
                        ';';


    to:

                $sql5= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET  '.
    [.....]
                        ', body=CONCAT("Merged with ticket ",'.
                        '  ( SELECT ticketID FROM '.TICKET_TABLE.' WHERE ticket_id='.db_input(Format::striptags($keepticket)).' ), '.
                        db_input(' '.$cfg->getBaseUrl().'/scp/tickets.php?id='.$keepticket).')'.

                        ';';



    change:

                      $sql8= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET  '.
    [.....]
                        ', body=CONCAT("Ticket merged from ticket ",'.$this->getExtId().')';


    to:

                      $sql8= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET  '.
    [.....]
                        ', body=CONCAT("Ticket merged from ticket ",'.$this->getExtId().', '.
                        db_input(' '.$cfg->getBaseUrl().'/scp/tickets.php?id='.$this->getId()).')';




  • edited December 2013
    then, after:

                    'Merging Ticket #'.$this->getExtId().' to Ticket #'.$ticketID,
                    'Your ticket #'.$this->getExtId().' has been merged to ticket #'.$ticketID.'.');
                   }                                            
               return true;
            } else {
               return false;
            }
            }


    add:

        function unmergeTicket(){
            global $thisstaff;
            global $cfg;
       
            // get ticket id and no. of the ticket which this ticket has been merged to
            $sql="SELECT ticket_id, ticketID FROM ".TICKET_TABLE.
                 " WHERE ticket_id=".
                      "(SELECT ticket_id FROM ".TICKET_THREAD_TABLE.
                      " WHERE merged_from LIKE ".db_input("%/".$this->getId()."/")." LIMIT 1)";
            if(($res=db_query($sql)) && db_num_rows($res))
                list($mergedTo_ticket_id, $mergedTo_ticketID)=db_fetch_row($res);
               
            // restore ticket thread AND attachments AND reopen ticket in one mysql transaction
            db_query("START TRANSACTION");
               $restoreAttachments = db_query("UPDATE ".TICKET_ATTACHMENT_TABLE." SET ticket_id=".db_input($this->getId()).
                     " WHERE ref_id IN (SELECT id FROM ".TICKET_THREAD_TABLE." WHERE merged_from LIKE ".db_input("%/".$this->getId()."/").")");
               $restoreThread = db_query("UPDATE ".TICKET_THREAD_TABLE." SET ticket_id=".db_input($this->getId()).
                     ", merged_from = REPLACE (merged_from, ".db_input("/".$this->getId()."/").", '') ".
                     "WHERE merged_from LIKE ".db_input("%/".$this->getId()."/"));
               $reopenTicket = db_query("UPDATE ".TICKET_TABLE." SET status='open' WHERE ticket_id=".db_input($this->getId()));

            if ($restoreAttachments && $restoreThread && $reopenTicket) {
               db_query("COMMIT");
               //add message to this ticket
                         
               $sql= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET  '.
                    ' ticket_id='.db_input($this->getId()).
                    ', staff_id='.db_input($thisstaff->getId()).
                    ', poster='.db_input($thisstaff->getName()).
                    ', ip_address=""'.
                    ', created=NOW()'.
                    ', body=CONCAT("Ticket unmerged from Ticket ", '.db_input($mergedTo_ticketID).', '.
                    db_input(' '.$cfg->getBaseUrl().'/scp/tickets.php?id='.$mergedTo_ticket_id).')';
                  db_query($sql);
              
               //add message to the ticket which this ticket had been merged to
               $sql= 'INSERT INTO '.TICKET_THREAD_TABLE.' SET  '.
                    ' ticket_id='.db_input($mergedTo_ticket_id).
                    ', staff_id='.db_input($thisstaff->getId()).
                    ', poster='.db_input($thisstaff->getName()).
                    ', ip_address=""'.
                    ', created=NOW()'.
                    ', body=CONCAT("Ticket ", '.db_input($this->getExtId()).', '.
                    db_input(' ('.$cfg->getBaseUrl().'/scp/tickets.php?id='.$this->getId().')').', " unmerged from this ticket")';
                  db_query($sql);
              
               return true;
            } else {       
               db_query("ROLLBACK");
               return false;
            }
        }
  • then, in include/staff/ticket-view.inc.php, change:

                if($thisstaff->canCloseTickets()) {
                    if($ticket->isOpen()) {?>
                    <a id="ticket-close" class="action-button" href="#close"><i class="icon-remove-circle"></i>Close</a>
                    <?php
                    } else { ?>
                    <a id="ticket-reopen" class="action-button" href="#reopen"><i class="icon-undo"></i>Reopen</a>
                    <?php
                    } ?>
                <?php
                } ?>

    to:


                if($thisstaff->canCloseTickets()) {
                    $sql="SELECT * FROM ".TICKET_THREAD_TABLE." WHERE merged_from LIKE ".db_input("%/".$ticket->getId()."/");
                    $sql2="SELECT * FROM ".TICKET_THREAD_TABLE." WHERE merged_from LIKE ".db_input("%/".$ticket->getId()."/%");            
                    if($ticket->isOpen()) {?>
                    <a id="ticket-close" class="action-button" href="#close"><i class="icon-remove-circle"></i>Close</a>
                    <?php
                    } elseif(($res=db_query($sql)) && db_num_rows($res)) { //closed after merge ?>
                    <a id="ticket-unmerge" class="action-button" href="#unmerge"><i class="icon-undo"></i>Unmerge</a>
                    <?php
                    } elseif(!$res=db_query($sql2) || !db_num_rows($res)) { //not in a previous merge ?>
                    <a id="ticket-reopen" class="action-button" href="#reopen"><i class="icon-undo"></i>Reopen</a>
                    <?php
                    } ?>
                <?php
                } ?>


    change:

                if (db_num_rows($lookuptickets_email) && $ticket->isOpen()) {?>
            <li><a id="merge_tab" href="#merge">Merge</a></li>   

    to:

                if (db_num_rows($lookuptickets_email) && $ticket->isOpen() && $thisstaff->canCloseTickets()) {?>
            <li><a id="merge_tab" href="#merge">Merge</a></li>   


    change:

        <form id="merge" action="tickets.php?id=<?php echo $ticket->getId(); ?>#mergeticket" name="notes" method="post" enctype="multipart/form-data">

    to:

        <form id="merge" onsubmit="return confirm('This ticket will be merged and closed. Are you sure you want to proceed?');" action="tickets.php?id=<?php echo $ticket->getId(); ?>#mergeticket" name="merge" method="post" enctype="multipart/form-data">
  • edited December 2013
    after:

        <p class="confirm-action" style="display:none;" id="claim-confirm">Are you sure want to <b>claim</b> (self assign) this ticket?
       </p>


    add:

        <p class="confirm-action" style="display:none;" id="unmerge-confirm">
    Are you sure you want to unmerge and reopen this ticket?
        </p>




    Finally, in staff/js/Tickets.js, change:

       //ticket actions confirmation - Delete + more
        $('a#ticket-delete, a#ticket-claim, #action-dropdown-more li a').click(function(e) {

    to

        //ticket actions confirmation - Delete + more
        $('a#ticket-delete, a#ticket-claim, a#ticket-unmerge, #action-dropdown-more li a').click(function(e) {



    You're done, it took a little time, but it was worth it!  :)


  • I have the newest version, v1.8.0.2, installed on our site.

    Does this work with the newest version?

    Is there an easy to upload mod or fresh instructions for this version?

     

    Thanks in advance!

    :)

  • This mod does not appear to have been updated for 1.8.x
  • I am still using 1.7 on my site
    I am planning to move to 1.8, when I will migrate I will port this mod, however, if someone else is willing to help me is welcome :)
  • it would be totaly awesome to get this ported to 1.8 ;).

    As i don't have too much programming skills myself i'll have to wait for you to do it ;).

    i'll be waiting ;)
Sign In or Register to comment.