Example #1
0
         } elseif (!$errors['assign']) {
             $errors['err'] = __('Unable to complete the ticket assignment');
             $errors['assign'] = __('Correct the error(s) below and try again!');
         }
     }
     break;
 case 'postnote':
     /* Post Internal Note */
     $vars = $_POST;
     $attachments = $note_form->getField('attachments')->getClean();
     $vars['cannedattachments'] = array_merge($vars['cannedattachments'] ?: array(), $attachments);
     $wasOpen = $ticket->isOpen();
     if ($note = $ticket->postNote($vars, $errors, $thisstaff)) {
         $msg = __('Internal note posted successfully');
         // Clear attachment list
         $note_form->setSource(array());
         $note_form->getField('attachments')->reset();
         if ($wasOpen && $ticket->isClosed()) {
             $ticket = null;
         } else {
             // Ticket is still open -- clear draft for the note
             Draft::deleteForNamespace('ticket.note.' . $ticket->getId(), $thisstaff->getId());
         }
     } else {
         if (!$errors['err']) {
             $errors['err'] = __('Unable to post internal note - missing or invalid data.');
         }
         $errors['postnote'] = __('Unable to post the note. Correct the error(s) below and try again!');
     }
     break;
 case 'edit':