NOTE: THIS MOD HAS BEEN WRITTEN FOR OST 1.6 RC5 ONCE I UPGRADE I WILL NOTE ANY CHANGES HERE
This mod adds a button to the right of each internal note allowing them to be deleted. two versions on the last step allow for either all staff or only admin to have this function.
So as always follow carefully and backup your files!
in class.ticket.php
above
function delete(){
insert
function deleteNote($note_id){
db_query ( 'DELETE FROM ' . TICKET_NOTE_TABLE . ' WHERE note_id=' . $note_id );
}
In tickets.php
below
default:
$errors='You must select action to perform';
endswitch;
break;
insert
case 'deletenote':
$ticket->deleteNote($_POST);
break;
In viewticket.inc.php
replace
<table align="center" class="note" cellspacing="0" cellpadding="1" width="100%" border=0>
<tr><th><?=Format:($row)?> - posted by <?=$row?></th></tr>
<? if($row) {?>
<tr class="header"><td><?=Format:($row)?></td></tr>
<?} ?>
<tr><td><?=Format:($row)?></td></tr>
</table>
with
<table align="center" class="note" cellspacing="0" cellpadding="1" width="100%" border=0>
<tr><th><?=Format:($row)?> - posted by <?=$row?></th>
<th width = "10%" valign="middle">
<form action="tickets.php" method="post">
<input type="hidden" name="id" value="<?=$id;?>" />
<input type="hidden" name="note_id" value="<?=$row;?>" />
<input type="hidden" name="a" value="deletenote">
<input class="button" type="submit" value="Delete" onClick='return confirm("Are you sure you want to DELETE selected note?");'>
</form>
</th></tr>
<? if($row) {?>
<tr class="header" ><td colspan="2"><?=Format:($row)?></td></tr>
<?} ?>
<tr><td colspan="2"><?=Format:($row)?></td></tr>
</table>
or replace with this to only allow admins this function
<table align="center" class="note" cellspacing="0" cellpadding="1" width="100%" border=0>
<tr><th><?=Format:($row)?> - posted by <?=$row?></th>
<?php
if($thisuser->isAdmin()){?>
<th width = "10%" valign="middle">
<form action="tickets.php" method="post">
<input type="hidden" name="id" value="<?=$id;?>" />
<input type="hidden" name="note_id" value="<?=$row;?>" />
<input type="hidden" name="a" value="deletenote">
<input class="button" type="submit" value="Delete" onClick='return confirm("Are you sure you want to DELETE selected note?");'>
</form>
<?}?>
</th></tr>
<? if($row) {?>
<tr class="header" ><td colspan="2"><?=Format:($row)?></td></tr>
<?}
If (!$row){
?><tr><td colspan="2">No note attached.</td></tr><?
}else{
?><tr><td colspan="2"><?=Format:($row)?></td></tr><?
}?>
</table>