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

Refreshing ticket after send, create duplicate reply.

I find some annoying users refresh the page many times have they have posted a message/reply. This actually resubmits the post and creates a duplicate message.

Comments

  • Hi,
    I found some solution.

    In a file scp/tickets.php at the end of the  if($_POST && !$errors):
    I added:

    
        if($msg)
            $_SESSION['msg'] = $msg;  
        
        if($ticket)
            header('Location: tickets.php?id='.$ticket->getId());


    So there was

    
        if(!$errors)
            $thisstaff ->resetStats(); //We'll need to reflect any changes just made!
        
    endif;
    
    And now there is
    
        if(!$errors)
            $thisstaff ->resetStats(); //We'll need to reflect any changes just made!
        
        if($msg)
            $_SESSION['msg'] = $msg;  
        
        if($ticket)
            header('Location: tickets.php?id='.$ticket->getId());
        
    endif;
    I also have changed file include\staff\header.inc.php:
    
     if ($msg == null)
        {
            $msg = $_SESSION['msg'];
            unset($_SESSION['msg']);
        }
    
    before if($ost->getError())

    I hope it will be usefull.
  • edited September 2
    Hi,

    i add java script to refresh page after posted replay.
    in include > client > view.inc.php added this line :

    <script type="text/javascript">setTimeout(function(){ window.location.href = "tickets.php?id=<?php echo $ticket->getId(); ?>";}, 1200);</script>

    after:

    <div id="msg_notice"><?php echo $msg; ?></div>

    and summary :

    <div id="msg_notice"><?php echo $msg; ?></div>
    <script type="text/javascript">setTimeout(function(){ window.location.href = "tickets.php?id=<?php echo $ticket->getId(); ?>";}, 1200);</script>
Sign In or Register to comment.