Hi,
Actually, this MOD is similar with another MOD that I made here:
http://www.osticket.com/forums/showthread.php?t=1990(http://www.osticket.com/forums/showthread.php?t=1990)
After client post message (reply) to his/her ticket that has been created before, then client reload/refresh that next page, the duplicate message will be saved in database.
This MOD will avoid that duplicate message saved in database.
Open \include\class.ticket.php, FIND:
//Insert message from client
function postMessage($msg,$headers='',$source='',$newticket=false){
global $cfg;
if(!$this->getId())
return 0;
AFTER, ADD:
// Begin of MOD Avoid Duplicate Message from Client Saved in Database
// Added by Masino Sinaga, May 4, 2009
$sql1='SELECT ticket_id, message FROM '.TICKET_MESSAGE_TABLE.'
WHERE ticket_id='.db_input($this->getId()).'
AND message='.db_input(Format:($msg)).'';
$res1=db_query($sql1);
if( ($res1 && db_num_rows($res1)) ) {
return 0;
}
// End of MOD Avoid Duplicate Message from Client Saved in Database
// Added by Masino Sinaga, May 4, 2009
Open view.php, FIND:
$errors='Unable to post the message. Try again';
REPLACE WITH:
$errors='Unable to post the message. Make sure the message you will send never sent before. Try again';
Best regards,
Masino Sinaga