Skip to content
Snippets Groups Projects
Commit b9295024 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #38 from protich/issue/close+note


Draft cleanup revisited.

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 1a2214ef 926bec51
No related branches found
No related tags found
No related merge requests found
......@@ -167,23 +167,25 @@ if($_POST && !$errors):
$errors['state'] = "You don't have permission to set the state";
}
$wasOpen = ($ticket->isOpen());
$vars = $_POST;
if($_FILES['attachments'])
$vars['files'] = AttachmentFile::format($_FILES['attachments']);
$wasOpen = ($ticket->isOpen());
if(($note=$ticket->postNote($vars, $errors, $thisstaff))) {
// Cleanup drafts for the ticket. If not closed, only clean
// note drafts for this staff. Else clean all drafts for the ticket.
Draft::deleteForNamespace(
sprintf('ticket.%s.%d',
$ticket->isClosed() ? '%' : 'note',
$ticket->getId()),
$ticket->isOpen() ? $thisstaff->getId() : false);
$msg='Internal note posted successfully';
if($wasOpen && $ticket->isClosed())
$ticket = null; //Going back to main listing.
// Cleanup drafts for the ticket. If not closed, only clean
// for this staff. Else clean all drafts for the ticket.
Draft::deleteForNamespace('ticket.%.' . $ticket->getId(),
$ticket->isClosed() ? false : $thisstaff->getId());
} else {
if(!$errors['err'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment