コード例 #1
0
 */
if ($_POST['fire_away'] && $user->hasPermission('imaging_browser_qc')) {
    // clear all predefined comments
    $comments->clearAllComments();
    // set selected predefined comments
    $comments->setPredefinedComments($_POST['savecomments']['predefined']);
    // save all textual comments but only if there is an entry [sebas]
    foreach ($_POST['savecomments']['text'] as $comment_type_id => $comment_message) {
        if (trim($comment_message)) {
            $comments->addTextComment(trim($comment_message), $comment_type_id);
        }
    }
    // save all comment status fields
    if (is_array($_POST['saveCommentStatusField'])) {
        foreach ($_POST['saveCommentStatusField'] as $status_field => $value) {
            $comments->setMRIValue($status_field, $value);
        }
    }
}
// get the currently saved comments
$saved_comments = $comments->getComments();
/*
 * DISPLAY HTML PAGES
 */
// show identifier of subject/volume
if ($comments->objectType == 'volume') {
    $query = "SELECT c.CandID AS DCCID, c.PSCID, s.Visit_label, s.SubprojectID,\n                    f.File AS File_name, st.Scan_type\n                FROM files AS f, session AS s, candidate AS c, mri_scan_type AS st\n                WHERE f.FileID=:FID\n                    AND f.SessionID=s.ID\n                    AND s.CandID=c.CandID\n                    AND f.AcquisitionProtocolID=st.ID\n                    AND s.Active='Y'";
    $qparams = array('FID' => $comments->fileID);
} elseif ($comments->objectType == 'visit') {
    $query = "SELECT c.CandID, c.PSCID, s.Visit_label, s.SubprojectID\n                FROM session AS s, candidate AS c\n              WHERE s.ID=:SID AND s.CandID=c.CandID AND s.Active='Y'";
    $qparams = array('SID' => $comments->sessionID);