Ejemplo n.º 1
0
                            }
                        }
                    }
                } else {
                    if ($fm_stage == "reject") {
                        if (!is_authenticated()) {
                            display_errorbox("You are not authenticated; please log in.");
                            print_review_login_form();
                        } else {
                            if (empty($fm_notes)) {
                                display_errorbox("One or more reasons for rejecting the message must be provided.");
                                print_verify_form(VERIFY_TYPE_REJECT, $fm_sessionid, $fm_requestid);
                            } else {
                                $dbh = open_db();
                                //db_update_request_status($dbh, $fm_requestid, "REJECTED", $fm_notes);
                                db_update_request_status_user($dbh, $fm_requestid, "REJECTED", $fm_notes, $_SESSION['username']);
                                $reqinfo = db_load_request($dbh, $fm_requestid);
                                $requserinfo = db_get_user($dbh, $reqinfo['requester']);
                                $revuserinfo = db_get_user($dbh, $reqinfo['reviewer']);
                                if (send_rejection_to_requester($reqinfo, $revuserinfo, $requserinfo) == true) {
                                    //echo "<p>Sent notice of rejection to requester.</p>";
                                    ?>
      <script type="text/javascript">
        alert('Sent notice of rejection to requester.');
      </script>
<?php 
                                    require_once './include/display_listrequest.php';
                                    //AB
                                    print_requestid_form();
                                } else {
                                    display_errorbox("Unable to send rejection notice to requester.");
Ejemplo n.º 2
0
        $key_field = 'username';
        $key_value = $_POST['username'];
        if ($key_value != 'reviewer1') {
            $result = db_get_records($dbh, $table_name, $key_field, $key_value, $sortby = null);
            if ($result != null) {
                $to_addr = $result[0]['email'];
                $to_name = $result[0]['firstname'] . ' ' . $result[0]['lastname'];
                $key_value = $_POST['fm_username'];
                $result = db_get_records($dbh, $table_name, $key_field, $key_value, $sortby = null);
                $from_addr = $result[0]['email'];
                $from_name = $result[0]['firstname'] . ' ' . $result[0]['lastname'];
                $cc_addrs = array();
                $subject = 'Message with request ID# ' . $fm_requestid . ' is reassigned to you.';
                $url_str = get_review_url($fm_requestid);
                $body = "Hello " . $to_name . "!\n\n" . "{$from_name} has assigned a T-Reqs email approval request to you, for the email titled " . $result_message[0]['message_name'] . ".\n\n" . "Please use the link below to sign into the T-Reqs website, review the message, and either approve or reject it based on Senate guidelines." . ".\n\n" . "    {$url_str}\n\n\n" . "Please reference the information provided below " . "with technical questions.\n\n" . "Request Details:\n" . "    Request ID: {$fm_requestid}\n" . "    Message Name: " . $result_message[0]['message_name'] . "\n" . "    Site Name: " . $result_message[0]['account_name'] . "\n\n" . "\n\n\n" . "Sincerely,\n\n" . "{$from_name}\n" . "(via " . APP_NAME . ")\n\n";
                send_email_message($from_addr, $from_name, $to_addr, $to_name, $cc_addrs, $subject, $body);
            }
        }
    } else {
        $result = db_get_records($dbh, "request", "uuid", $fm_requestid, $sortby = null);
        db_update_request_status_user($dbh, $fm_requestid, $result[0]['status'], $result[0]['request_notes'], $result[0]['reviewer']);
    }
    include 'display_listrequest.php';
    //AB //show request list
    print_requestid_form();
} else {
    print '<h2>T-Reqs blast e-mail message ID# ' . $fm_requestid . ' to be either reassigned to a different reviewer or to a different status.</h2>';
    print '<h2>To put it back to the queue, just choose Default Reviewer and Awaiting Review otherwise choose a reviewer and Under Review to reassign.</h2>';
    review_re_assign_form($dbh, 'user', 'role', 'REVIEWER', $fm_requestid);
    //build the reassign <form>
}