示例#1
0
 if ($department_stmt->rowCount() != 1) {
     header('Location:error.php?ec=14');
     exit;
     //non-unique error
 }
 $filedata = new FileData($data_id, $pdo);
 // error check
 if (!$filedata->exists()) {
     header('Location:error.php?ec=2');
     exit;
 } else {
     $category = $filedata->getCategory();
     $realname = $filedata->getName();
     $description = $filedata->getDescription();
     $comment = $filedata->getComment();
     $owner_id = $filedata->getOwner();
     $department = $filedata->getDepartment();
     //CHM
     $table_name_query = "SELECT table_name FROM {$GLOBALS['CONFIG']['db_prefix']}udf WHERE field_type = '4'";
     $table_name_stmt = $pdo->prepare($table_name_query);
     $table_name_stmt->execute();
     $result = $table_name_stmt->fetchAll();
     $num_rows = $table_name_stmt->rowCount();
     $t_name = array();
     $i = 0;
     foreach ($result as $data) {
         $explode_v = explode('_', $data['table_name']);
         $t_name = $explode_v[2];
         $i++;
     }
     // For the User dropdown
示例#2
0
if ($GLOBALS['CONFIG']['file_expired_action'] != 4) {
    $reviewer_comments = 'To=' . msg('author') . ';Subject=' . msg('message_file_expired') . ';Comments=' . msg('email_file_was_rejected_because') . ' ' . $GLOBALS['CONFIG']['revision_expiration'] . ' ' . msg('days') . ';';
    $user_obj = new user($root_id, $pdo);
    $date = date("D F d Y");
    $time = date("h:i A");
    $get_full_name = $user_obj->getFullName();
    $full_name = $get_full_name[0] . ' ' . $get_full_name[1];
    $mail_from = $full_name . ' <' . $user_obj->getEmailAddress() . '>';
    $mail_headers = "From: {$mail_from}";
    $mail_subject = msg('email_subject_review_status');
    $mail_greeting = msg('email_greeting') . ":\n\r\t" . msg('email_i_would_like_to_inform');
    $mail_body = msg('email_was_declined_for_publishing_at') . ' ' . $time . ' on ' . $date . ' ' . msg('email_because_you_did_not_revise') . ' ' . $GLOBALS['CONFIG']['revision_expiration'] . ' ' . msg('days');
    $mail_salute = "\n\r\n\r" . msg('email_salute') . ",\n\r{$full_name}";
    foreach ($data_result as $row) {
        $file_obj = new FileData($row['id'], $pdo);
        $user_obj = new User($file_obj->getOwner(), $pdo);
        $mail_to = $user_obj->getEmailAddress();
        if ($GLOBALS['CONFIG']['demo'] == 'False') {
            mail($mail_to, $mail_subject . $file_obj->getName(), $mail_greeting . $file_obj->getName() . ' ' . $mail_body . $mail_salute, $mail_headers);
        }
    }
}
//do not show file
if ($GLOBALS['CONFIG']['file_expired_action'] == 1) {
    $reviewer_comments = 'To=' . msg('author') . ';Subject=' . msg('message_file_expired') . ';Comments=' . msg('email_file_was_rejected_because') . ' ' . $GLOBALS['CONFIG']['revision_expiration'] . ' ' . msg('days');
    foreach ($data_result as $row) {
        $file_obj = new FileData($row['id'], $pdo);
        $file_obj->Publishable(-1);
        $file_obj->setReviewerComments($reviewer_comments);
    }
}
示例#3
0
 $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}" . "\r\n";
 $mail_headers .= "Content-Type: text/plain; charset=UTF-8" . "\r\n";
 if ($user_obj->isAdmin()) {
     $id_array = $user_obj->getAllRevieweeIds();
 } else {
     $id_array = $user_obj->getRevieweeIds();
 }
 $idfield = explode(' ', trim($lcheckbox));
 foreach ($idfield 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, $GLOBALS['connection'], DB_NAME);
         $user_obj = new User($file_obj->getOwner(), $GLOBALS['connection'], DB_NAME);
         $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 = $lcomments . "\n\n";
             $mail_body1 .= msg('email_your_file_has_been_authorized') . "\n\n";
             $mail_body1 .= msg('label_filename') . ':  ' . $file_obj->getName() . "\n\n";
             $mail_body1 .= msg('label_status') . ': ' . msg('message_authorized') . "\n\n";
             $mail_body1 .= msg('date') . ': ' . $date . "\n\n";
             $mail_body1 .= msg('label_reviewer') . ': ' . $full_name . "\n\n";
             $mail_body1 .= msg('email_thank_you') . ',' . "\n\n";
             $mail_body1 .= msg('email_automated_document_messenger') . "\n\n";
             $mail_body1 .= $GLOBALS['CONFIG']['base_url'] . "\n\n";