Home > osTicket > How to Disable Close Ticket on Reply and on Internal Note in osTicket v1.6 RC5

How to Disable Close Ticket on Reply and on Internal Note in osTicket v1.6 RC5

Someone asked the question in osTicket Discussion Forum about how to disable close ticket feature on reply at the staff-side in osTicket System. Since nobody made it, then I created modification to make it happens. At the same time, I also modified for close ticket on post internal note. This modification will alter your department table by adding two new fields to store the setting for close ticket on reply and close ticket on post internal note. Thus, you can now define whether to enable or disable those both setting for the certain department in order whether to display or hide those options on the viewticket page from staff-side.

  1. First of all, alter your ost_department table by using this following SQL script. Please note that the ost_ is the table prefix name. It could be different with yours. In case it differs with yours, please adjust it by yourself, and please be kind of it!

    ALTER TABLE ost_department
    ADD COLUMN `can_close_on_reply` tinyint(1) default 1 NOT NULL,
    ADD COLUMN `can_close_on_internal_note` tinyint(1) default 1 NOT NULL;
  2. Open your \include\staff\dept.inc.php file, and find this code:

    112
    
            <tr class="header"><td colspan=2>Autoresponders</td></tr>

    before that line, please insert this following code:

    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    
            <!-- MOD Can Close on Reply and Internal Note, by Masino Sinaga, Nov 4, 2009 -->
            <tr class="header"><td colspan=2>Close Ticket</td></tr>
            <tr class="subheader"><td colspan=2>
                Close Ticket will give the ability to department members (staff and manager) whether they can close the ticket on reply and on post internal note or not.
                </td>
            </tr>
            <tr><th>Can Close on Reply:</th>
                <td>
                    <input type="radio" name="can_close_on_reply"  value="1"   <?=$info['can_close_on_reply']?'checked':''?> />Enable
                    <input type="radio" name="can_close_on_reply"  value="0"   <?=!$info['can_close_on_reply']?'checked':''?> />Disable
                </td>
            </tr>
            <tr><th>Can Close on Internal Note:</th>
                <td>
                    <input type="radio" name="can_close_on_internal_note"  value="1"   <?=$info['can_close_on_internal_note']?'checked':''?> />Enable
                    <input type="radio" name="can_close_on_internal_note"  value="0"   <?=!$info['can_close_on_internal_note']?'checked':''?> />Disable
                </td>
            </tr>
            <!-- MOD Can Close on Reply and Internal Note, by Masino Sinaga, Nov 4, 2009 -->
  3. Open your \include\class.dept.php file, and find this code:

    92
    93
    94
    
        function canAppendSignature() {
            return ($this->signature && $this->row['can_append_signature'])?true:false;
        }

    after the last line of that code, please insert this following code:

    96
    97
    98
    99
    100
    101
    102
    103
    104
    
        // MOD Can Close on Reply and Internal Note, by Masino Sinaga, Nov 4, 2009
        function canCloseOnReply() {
            return $this->row['can_close_on_reply']?true:false;
        }
     
        function canCloseOnInternalNote() {
            return $this->row['can_close_on_internal_note']?true:false;
        }
        // MOD Can Close on Reply and Internal Note, by Masino Sinaga, Nov 4, 2009

    Find again this code:

    247
    
                     ',can_append_signature='.db_input(isset($_POST['can_append_signature'])?1:0);

    then replace with this following code:

    247
    248
    249
    
                     ',can_append_signature='.db_input(isset($_POST['can_append_signature'])?1:0).
                     ',can_close_on_reply='.db_input($_POST['can_close_on_reply']). // MOD Can Close on Reply, by Masino Sinaga, Nov 4, 2009
                     ',can_close_on_internal_note='.db_input($_POST['can_close_on_internal_note']); // MOD Can Close on Internal Note, by Masino Sinaga, Nov 4, 2009
  4. Open your \include\staff\viewticket.inc.php file, and find this code:

    328
    329
    330
    331
    
                            <div style="margin-top: 3px;">
                                <label for="ticket_status"><b>Ticket Status:</b></label>
                                <?
                                $checked=isset($info['ticket_status'])?'checked':''; //Staff must explicitly check the box to change status..

    before the first line of that code, please insert this following code:

    327
    
    			<?php if ($dept->canCloseOnReply()) { // MOD Can Close for Dept basis, by Masino Sinaga, Nov 4, 2009 ?>

    Find again this code:

    337
    338
    339
    
                                <input type="checkbox" name="ticket_status" value="Reopen" <?=$checked?> > Reopen on Reply
                                <?}?>
                            </div>

    after the last line of that code, please insert this following code:

    340
    
                            <?php } ?>

    Find again this code:

    369
    370
    371
    372
    
                            <?
                             //When the ticket is assigned Allow assignee, admin or ANY dept manager to close it
                            if(!$ticket->isAssigned() || $thisuser->isadmin()  || $thisuser->isManager() || $thisuser->getId()==$ticket->getStaffId()) {
                             ?>

    after the last line of that code, please insert this following code:

    373
    
                             <?php if ($dept->canCloseOnInternalNote()) { // MOD Can Close for Dept basis, by Masino Sinaga, Nov 4, 2009 ?>

    Find again this code:

    381
    382
    383
    
                                <input type="checkbox" name="ticket_status" value="Reopen" <?=$checked?> > Reopen Ticket
                                <?}?>
                            </div>

    after the last line of that code, please insert this following code:

    384
    
                            <?php } ?>

Have a nice code to you!

  • Share/Bookmark
133 views Print This Post Print This Post

  1. No comments yet.
  1. No trackbacks yet.