Quantcast
Channel: Open Script Solution» duplicate
Viewing all articles
Browse latest Browse all 3

How to Avoid Duplicate Ticket Content Saved in HESK v2.1

0
0

Actually, this modification I created was being intended for a friend of mine who implemented HESK for his department. I was interested with its interface, so I tried to create a new ticket and tested after submitting the ticket, I reload the “thank-you” page. In fact, a new ticket then would be created, the same condition that occured in osTicket, which I have created the modification regarding it to fix the same problem.

  1. Open your submit_ticket.php file, and find this code:
    hesk_dbConnect();
    

    then after that line, please insert this following code:

    /* MOD: Avoid duplicate ticket (identified by its Subject & Message) */
    /* modified by Masino Sinaga, November 30, 2009 */
    $sqlcek = "SELECT `subject`,`message` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` 
            WHERE `subject`='".hesk_dbEscape($subject)."' AND `message`='".hesk_dbEscape($message)."'";
    $rescek = hesk_dbQuery($sqlcek);
    if (hesk_dbNumRows($rescek) > 0) {
        //header('Location: index.php?a=add');
        header('Location: sorry.php');
        echo "This ticket content already exists in database!";
        exit();	
    }
    /* MOD: Avoid duplicate ticket (identified by its Subject & Message) */
    
  2. Create a new php file, and name it with sorry.php, copy and paste this code below, and put this file to your HESK’s root directory:
    <?php
    
    /* Created by Masino Sinaga, http://www.openscriptsolution.com, November 30, 2009 */
    
    define('IN_SCRIPT',1);
    define('HESK_PATH','');
    
    /* Get all the required files and functions */
    require(HESK_PATH . 'hesk_settings.inc.php');
    require(HESK_PATH . 'inc/common.inc.php');
    
    /* Print header */
    require_once(HESK_PATH . 'inc/header.inc.php');
    ?>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="3"><img src="img/headerleftsm.jpg" width="3" height="25" alt="" /></td>
    <td class="headersm"><?php hesk_showTopBar($hesklang['invalid_action']); ?></td>
    <td width="3"><img src="img/headerrightsm.jpg" width="3" height="25" alt="" /></td>
    </tr>
    </table>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td><span class="smaller"><a href="<?php echo $hesk_settings['site_url']; ?>" class="smaller"><?php echo $hesk_settings['site_title']; ?></a> >
    <a href="<?php echo $hesk_settings['hesk_url']; ?>" class="smaller"><?php echo $hesk_settings['hesk_title']; ?></a>
    > <?php echo $hesklang['invalid_action']; ?></span></td>
    </tr>
    </table>
    
    </td>
    </tr>
    <tr>
    <td>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    	<td width="7" height="7"><img src="img/roundcornerslt.jpg" width="7" height="7" alt="" /></td>
    	<td class="roundcornerstop"></td>
    	<td><img src="img/roundcornersrt.jpg" width="7" height="7" alt="" /></td>
    </tr>
    <tr>
    	<td class="roundcornersleft">&nbsp;</td>
    	<td>
    
    	<p>&nbsp;</p>
    	<p align="center"><?php echo "Sorry, the ticket you have just sent already exists in our database."; ?></p>
    	<p>&nbsp;</p>
    	<p align="center"><a href="<?php echo $hesk_settings['hesk_url']; ?>"><?php echo $hesk_settings['hesk_title']; ?></a></p>
    	<p>&nbsp;</p>
    
    	</td>
    	<td class="roundcornersright">&nbsp;</td>
    </tr>
    <tr>
    	<td><img src="img/roundcornerslb.jpg" width="7" height="7" alt="" /></td>
    	<td class="roundcornersbottom"></td>
    	<td width="7" height="7"><img src="img/roundcornersrb.jpg" width="7" height="7" alt="" /></td>
    </tr>
    </table>
    
    <?php
    
    require_once(HESK_PATH . 'inc/footer.inc.php');
    exit();
    

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images