Auto Staff Time Sheet in Editing Ticket of osTicket v1.6 RC5

This following modification is the continuation of another modification that I created in the article: Add Auto Staff Time Sheet Feature into osTicket v1.6 RC5. Since I received the feedback from osTicket Discussion Forum that informed me about the SQL error after editing a ticket by staff, then I found that the original one need to be improved. So, here is the additional modification that you should apply if you want to avoid SQL error after implementing the first modification while editing a ticket. Please note that if you want to implement the modification in this article, first of all, you have to implement the original modification via that link above.

  1. Open your /include/staff/editticket.inc.php file, and find this code:
    36
    
        <input type='hidden' name='a' value='update'>

    after that line, please insert this following code:

    37
    38
    39
    
        <?php // Begin of MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010 ?>
        <input type="hidden" name="start_time" value="<?php echo date('Y-m-d H:i:s'); ?>">
        <?php // End of MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010 ?>
  2. Open your /include/class.ticket.php file, and find this code:

    1183
    
        function update($var,&$errors) {

    then replace with this following code:

    1183
    
        function update($var,&$errors,$start_time) {  // MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010

    Find again this code:

    1249
    
                     $this->postNote('Ticket Edit',$var['note']);

    then replace with this following code:

    1249
    
                     $this->postNote('Ticket Edit',$var['note'],'true','',$start_time); // MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010
  3. Open your /scp/tickets.php file, and find this code:

    216
    
                elseif($ticket->update($_POST,$errors)){

    then replace with this following code:

    216
    
                elseif($ticket->update($_POST,$errors,$_POST['start_time'])){ // MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010

Now you should not receive SQL error anymore after editing a ticket if you implement the Auto Staff Time Sheet modification that I created above. Have a nice code, everyone!

Share

1,902 viewsPrint This Post Print This Post

Comments

  1. somantriozawa@yahoo.com says:

    Script di bawah ada di file mana gan? di /include/class.ticket.php kok gk ada ya,
    Temukan lagi kode yang ini:

    1249                 $this->postNote('Ticket Edit',$var['note']);

Speak Your Mind

*


*