~porten-deactivatedaccount/eventum/devel

« back to all changes in this revision

Viewing changes to eventum/include/class.support.php

  • Committer: balsdorf
  • Date: 2008-04-14 16:53:06 UTC
  • Revision ID: vcs-imports@canonical.com-20080414165306-3n5so57poap3bo9p
Fixed problem where notes with attachments showed as "blocked" even though they were not.
Display attachment icon on note listing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
488
488
            return;
489
489
        }
490
490
        $message_id = Mail_API::getMessageID($headers, $body);
 
491
        echo $message_id . "\n";
491
492
        $message = $headers . $body;
492
493
        // we don't need $body anymore -- free memory
493
494
        unset($body);
1056
1057
        } else {
1057
1058
            $new_sup_id = $GLOBALS["db_api"]->get_last_insert_id();
1058
1059
            $sup_id = $new_sup_id;
 
1060
            $row['sup_id'] = $sup_id;
1059
1061
            // now add the body and full email to the separate table
1060
1062
            $stmt = "INSERT INTO
1061
1063
                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email_body
2042
2044
            // check whether the current user is allowed to send this email to customers or not
2043
2045
            if (!Support::isAllowedToEmail($_POST["issue_id"], $user_info['usr_email'])) {
2044
2046
                // add the message body as a note
2045
 
                $_POST['blocked_msg'] = $full_email;
 
2047
                $_POST['full_message'] = $full_email;
2046
2048
                $_POST['title'] = $_POST["subject"];
2047
2049
                $_POST['note'] = Mail_API::getCannedBlockedMsgExplanation() . $_POST["message"];
2048
 
                Note::insert(Auth::getUserID(), $_POST["issue_id"]);
 
2050
                Note::insert(Auth::getUserID(), $_POST["issue_id"], false, true, false, true, true);
2049
2051
                Workflow::handleBlockedEmail(Issue::getProjectID($_POST['issue_id']), $_POST['issue_id'], $_POST, 'web');
2050
2052
                return 1;
2051
2053
            }
2487
2489
                (!Support::isAllowedToEmail($issue_id, $sender_email))) {
2488
2490
            // add the message body as a note
2489
2491
            $_POST = array(
2490
 
                'blocked_msg' => $email['full_email'],
 
2492
                'full_message'=> $email['full_email'],
2491
2493
                'title'       => @$email['headers']['subject'],
2492
2494
                'note'        => Mail_API::getCannedBlockedMsgExplanation($issue_id) . $email['body'],
2493
2495
                'message_id'  => Mail_API::getMessageID($text_headers, $body),
2500
2502
                $closing = false;
2501
2503
                $notify = true;
2502
2504
            }
2503
 
            $res = Note::insert(Auth::getUserID(), $issue_id, $email['headers']['from'], false, $closing, $notify);
 
2505
            $res = Note::insert(Auth::getUserID(), $issue_id, $email['headers']['from'], false, $closing, $notify, true);
2504
2506
            // associate the email attachments as internal-only files on this issue
2505
2507
            if ($res != -1) {
2506
2508
                Support::extractAttachments($issue_id, $email['full_email'], true, $res);