Example #1
0
} elseif (isset($_POST['submit']) && $_POST['submit'] == 'Authorize') {
    $checkbox = isset($_REQUEST['checkbox']) ? $_REQUEST['checkbox'] : '';
    $reviewer_comments = "To={$_POST['to']};Subject={$_POST['subject']};Comments={$_POST['comments']};";
    $user_obj = new User($_SESSION['uid'], $pdo);
    $date = date('Y-m-d H:i:s T');
    //locale insensitive
    $get_full_name = $user_obj->getFullName();
    $full_name = $get_full_name[0] . ' ' . $get_full_name[1];
    $mail_subject = !empty($_REQUEST['subject']) ? stripslashes($_REQUEST['subject']) : msg('email_subject_review_status');
    $mail_from = $full_name . ' <' . $user_obj->getEmailAddress() . '>';
    $mail_headers = "From: " . $mail_from . PHP_EOL . PHP_EOL;
    $mail_headers .= "Content-Type: text/plain; charset=UTF-8" . PHP_EOL . PHP_EOL;
    if ($user_obj->isAdmin()) {
        $id_array = $user_obj->getAllRevieweeIds();
    } else {
        $id_array = $user_obj->getRevieweeIds();
    }
    $id_field = explode(' ', trim($checkbox));
    foreach ($id_field as $key => $value) {
        // Check to make sure the current file_id is in their list of reviewable ID's
        if (in_array($value, $id_array)) {
            $fileid = $value;
            $file_obj = new FileData($fileid, $pdo);
            $user_obj = new User($file_obj->getOwner(), $pdo);
            $mail_to = $user_obj->getEmailAddress();
            $dept_id = $file_obj->getDepartment();
            // Build email for author notification
            if (isset($_POST['send_to_users'][0]) && in_array('owner', $_POST['send_to_users'])) {
                // Lets unset this now so the new array will just be user_id's
                $_POST['send_to_users'] = array_slice($_POST['send_to_users'], 1);
                $mail_body1 = $comments . PHP_EOL . PHP_EOL;
Example #2
0
//$_SESSION['uid']=102; $sort_by = 'author';
//$start_time = time();
// includes
$GLOBALS['state'] = 1;
require_once 'odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
draw_header(msg('label_file_listing'), $last_message);
sort_browser();
$user_obj = new User($_SESSION['uid'], $pdo);
if ($user_obj->isAdmin()) {
    $reviewIdCount = sizeof($user_obj->getAllRevieweeIds());
} elseif ($user_obj->isReviewer()) {
    $reviewIdCount = sizeof($user_obj->getRevieweeIds());
} else {
    $reviewIdCount = 0;
}
if ($reviewIdCount > 0) {
    echo '<img src="images/exclamation.gif" /> <a href="toBePublished.php?state=1">' . msg('message_documents_waiting') . '</a>: ' . e::h($reviewIdCount) . '</a><br />';
}
$rejected_files_obj = $user_obj->getRejectedFileIds();
if (isset($rejected_files_obj[0]) && $rejected_files_obj[0] != null) {
    echo '<img src="images/exclamation_red.gif" /> <a href="rejects.php?state=1">' . msg('message_documents_rejected') . '</a>: ' . sizeof($rejected_files_obj) . '<br />';
}
$llen = $user_obj->getNumExpiredFiles();
if ($llen > 0) {
    echo '<img src="images/exclamation_red.gif"><a href="javascript:window.location=\'search.php?submit=submit&sort_by=id&where=author_locked_files&sort_order=asc&keyword=-1&exact_phrase=on\'">' . msg('message_documents_expired') . ': ' . e::h($llen) . '</a><br />';
}
// get a list of documents the user has "view" permission for