Discussions are closed

'; } // Get assigned papers & display legend if not chair $reviewPaperAR = array(); $completedPaperAR = array(); $advocatePaperAR = array(); $conflictAR = array(); if ($access != 1) { // Check that discussions are open if (!$OC_statusAR['OC_DISCUSSION_open']) { warn('Discussion is closed at this time'); exit; } // Check if reviewer, that's ok if (($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] != 'T') && !$OC_configAR['OC_DISCUSSION_reviewerAccess']) { warn('You do not have permission to access the discussion'); exit; } // Get review papers $q = "SELECT `paperid`, `completed` FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `reviewerid`='" . safeSQLstr($uid) . "'"; $r = ocsql_query($q) or err('Unable to retrieve review submissions'); while ($l = mysql_fetch_assoc($r)) { $reviewPaperAR[] = $l['paperid']; if ($l['completed'] == 'T') { $completedPaperAR[] = $l['paperid']; } } // Get advocate papers if ($OC_configAR['OC_paperAdvocates']) { $q = "SELECT `paperid` FROM `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `advocateid`='" . safeSQLstr($uid) . "'"; $r = ocsql_query($q) or err('Unable to retrieve advocate submissions'); while ($l = mysql_fetch_assoc($r)) { $advocatePaperAR[] = $l['paperid']; } } // Get conflicts $conflictAR = getConflicts($uid); // Get notification status if ! chair $notification = 'On'; if ($uid != 0) { $q = "SELECT `notification` FROM `" . OCC_TABLE_MODULE_OC_DISCUSSION_NOTIFICATION . "` WHERE `accountid`='" . safeSQLstr($uid) . "'"; $r = ocsql_query($q) or err('Unable to retrieve notification status'); if (mysql_num_rows($r) == 1) { $l = mysql_fetch_assoc($r); if ($l['notification'] == 0) { $notification = 'Off'; } } } // Display legend & Notification print '

Legend:   '; if ($OC_configAR['OC_paperAdvocates'] && ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == 'T')) { print '    Advocate     '; } print '    Reviewer'; if ($uid != 0) { print '      Notification: ' . $notification . ''; } print '

'; } // Sort order $order = ''; if (isset($_REQUEST['order']) && in_array($_REQUEST['order'], array('asc','desc'))) { $order = $_REQUEST['order']; if ($order == 'asc') { $rsort = 'desc'; } else { $rsort = 'asc'; } } // Sort by $sort = ''; if (isset($_REQUEST['sort'])) { switch ($_REQUEST['sort']) { case 'paperid': if (empty($order)) { $order = 'asc'; $rsort = 'desc'; } $sort = "`paperid` " . oc_strtoupper($order); $stitle = 'Score'; $ptitle = 'Submission ID. Title sorted ' . $order . 'ending - click to reverse sort order'; $lptitle = 'Last Post'; break; case 'score': if ($OC_configAR['OC_DISCUSSION_includeStatus'] && $OC_configAR['OC_DISCUSSION_showScore']) { if (empty($order)) { $order = 'desc'; $rsort = 'asc'; } $sort = "`recavg` " . oc_strtoupper($order); $stitle = 'Score sorted ' . $order . 'ending - click to reverse sort order'; $ptitle = 'Submission ID. Title'; $lptitle = 'Last Post'; } break; } } if (empty($sort)) { if (empty($order)) { $order = 'desc'; $rsort = 'asc'; } $sort = "`lastpost` " . oc_strtoupper($order) . ", `paperid` ASC"; $stitle = 'Score'; $ptitle = 'Submission ID. Title'; $lptitle = 'Last Post sorted ' . $order . 'ending - click to reverse sort order'; } // Get posts per paper $q = "SELECT `paperid`, COUNT(`paperid`) AS `count` FROM `" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "` GROUP BY `paperid`"; $r = ocsql_query($q) or err('Unable to retrieve post counts'); $postCountAR = array(); while ($l = mysql_fetch_assoc($r)) { $postCountAR[$l['paperid']] = $l['count']; } // Get first new post $q = "SELECT `" . OCC_TABLE_MODULE_OC_DISCUSSION_READ . "`.`paperid`, MIN(`" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`postid`) AS `firstnew` FROM `" . OCC_TABLE_MODULE_OC_DISCUSSION_READ . "` LEFT JOIN (`" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`) ON (`" . OCC_TABLE_MODULE_OC_DISCUSSION_READ . "`.`paperid`=`" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`paperid` AND `" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`postid`>`" . OCC_TABLE_MODULE_OC_DISCUSSION_READ . "`.`lastread`) WHERE `" . OCC_TABLE_MODULE_OC_DISCUSSION_READ . "`.`accountid`='" . $uid . "' GROUP BY `paperid`"; $r = ocsql_query($q) or err('Unable to retrieve new post info'); $newPostAR = array(); while ($l = mysql_fetch_assoc($r)) { $newPostAR[$l['paperid']] = $l['firstnew']; } // Get papers $q = "SELECT `" . OCC_TABLE_PAPER . "`.`paperid`, `" . OCC_TABLE_PAPER . "`.`title`, `" . OCC_TABLE_PAPER . "`.`accepted`, MAX(`" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`time`) AS `lastpost`, MAX(`" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`postid`) AS `lastpostid`, FORMAT(AVG(`recommendation`),2) AS `recavg` FROM `" . OCC_TABLE_PAPER . "` LEFT JOIN (`" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`) ON (`" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid`) LEFT JOIN (`" . OCC_TABLE_PAPERREVIEWER . "`) ON (`" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid`) GROUP BY `" . OCC_TABLE_PAPER . "`.`paperid` ORDER BY $sort"; $r = ocsql_query($q) or err('Unable to retrieve submissions'); if (mysql_num_rows($r) == 0) { warn("There are no submissions available for discussion"); } // Display papers print ' '; if ($OC_configAR['OC_DISCUSSION_includeStatus']) { print ''; if ($OC_configAR['OC_DISCUSSION_showScore']) { print ''; } } print ' '; $row = 1; while ($l = mysql_fetch_assoc($r)) { $class = ''; $incompleteReview = false; // if not chair, check whether to skip & set row color if ($access != 1) { // set row color if (in_array($l['paperid'], $advocatePaperAR)) { $class = 'oc_discussion_advocate'; } elseif (in_array($l['paperid'], $reviewPaperAR)) { $class = 'oc_discussion_review'; } // skip if not allowed access if ((!$OC_configAR['OC_DISCUSSION_accessAllPapers'] && empty($class)) // Not Assigned || (!$OC_configAR['OC_DISCUSSION_overrideConflict'] && in_array($l['paperid'] . '-' . $uid, $conflictAR)) // In conflict ) { continue; } // incomplete review? if (in_array($l['paperid'], $reviewPaperAR) && !$OC_configAR['OC_DISCUSSION_incompleteReviewAccess'] && !in_array($l['paperid'], $completedPaperAR)) { $incompleteReview = true; } } else { // set row color to use if ($row == 1) { $class = 'row2'; $row = 2; } else { $class = 'row1'; $row = 1; } } // Display first new icon? if (!empty($l['lastpost']) && !$incompleteReview && (!array_key_exists($l['paperid'],$newPostAR) || !empty($newPostAR[$l['paperid']]))) { $firstnewLink = 'Go to first new post '; } else { $firstnewLink = ''; } // Link in last post if ($incompleteReview) { $lastpost = 'incomplete review'; } elseif (!empty($l['lastpost'])) { $lastpost = '' . strftime('%c', $l['lastpost']) . ''; } else { $lastpost = ' '; } print ''; if ($OC_configAR['OC_DISCUSSION_includeStatus']) { $status = $l['accepted']; $statusStyle = 'color: #555; background-color: #' . (isset($OC_acceptanceColorAR[$l['accepted']]) ? $OC_acceptanceColorAR[$l['accepted']] : 'ddd'); print ''; if ($OC_configAR['OC_DISCUSSION_showScore']) { print ''; } } print ' '; } print '
Status' . $stitle . '' . $ptitle . '' . $lptitle . 'Posts
' . safeHTMLstr($l['accepted']) . '' . (empty($l['recavg']) ? ' ' : $l['recavg']) . '' . $firstnewLink; if ($incompleteReview) { print '' . $l['paperid'] . '. ' . safeHTMLstr($l['title']) . ''; } else { print '' . $l['paperid'] . '. ' . safeHTMLstr($l['title']) . ''; } print '' . $lastpost . '' . (isset($postCountAR[$l['paperid']]) ? $postCountAR[$l['paperid']] : ' ') . '

All times are UTC ' . date('O') . '. The time now is ' . strftime('%X') . '
'; printFooter();