Beispiel #1
0
Workflow::prePage($prj_id, 'post_note');
if ($cat == 'post_result' && !empty($_GET['post_result'])) {
    $res = (int) $_GET['post_result'];
    $tpl->assign('post_result', $res);
} elseif ($cat == 'post_note') {
    // change status
    $status = isset($_POST['new_status']) ? (int) $_POST['new_status'] : null;
    if ($status) {
        $res = Issue::setStatus($issue_id, $status);
        if ($res != -1) {
            $new_status = Status::getStatusTitle($status);
            History::add($issue_id, $usr_id, 'status_changed', "Status changed to '{status}' by {user} when sending a note", array('status' => $new_status, 'user' => User::getFullName($usr_id)));
        }
    }
    $res = Note::insertFromPost($usr_id, $issue_id);
    Issue_Field::updateValues($issue_id, 'post_note', @$_REQUEST['issue_field']);
    if ($res == -1) {
        Misc::setMessage(ev_gettext('An error occurred while trying to run your query'), Misc::MSG_ERROR);
    } else {
        Misc::setMessage(ev_gettext('Thank you, the internal note was posted successfully.'), Misc::MSG_INFO);
    }
    $tpl->assign('post_result', $res);
    // enter the time tracking entry about this phone support entry
    if (!empty($_POST['time_spent'])) {
        if (isset($_POST['time_summary']) && !empty($_POST['time_summary'])) {
            $summary = (string) $_POST['time_summary'];
        } else {
            $summary = 'Time entry inserted when sending an internal note.';
        }
        $date = (array) $_POST['date'];
        $ttc_id = (int) $_POST['time_category'];