' . oc_('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(oc_('Discussions are closed')); exit; } // Check if reviewer, that's ok if (($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] != 'T') && !$OC_configAR['OC_DISCUSSION_reviewerAccess']) { warn(oc_('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 = oc_('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 = oc_('Off'); } } } // Display legend & Notification print '' . oc_('Legend:') . ' '; if ($OC_configAR['OC_paperAdvocates'] && ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == 'T')) { print ' ' . oc_('Advocate') . ' '; } print ' ' . oc_('Reviewer'); if ($uid != 0) { print ' ' . oc_('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 = '' . oc_('Score') . ''; $ptitle = '' . oc_('Submission') . ' '; $lptitle = '' . oc_('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 = '' . oc_('Score') . ' '; $ptitle = '' . oc_('Submission') . ''; $lptitle = '' . oc_('Last Post') . ''; } break; } } if (empty($sort)) { if (empty($order)) { $order = 'desc'; $rsort = 'asc'; } $sort = "`lastpost` " . oc_strtoupper($order) . ", `paperid` ASC"; $stitle = '' . oc_('Score') . ''; $ptitle = '' . oc_('Submission') . ''; $lptitle = '' . oc_('Last Post') . ' '; } // 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(oc_('No submissions are available')); } // Display papers print '' . oc_('Status') . ' | '; if ($OC_configAR['OC_DISCUSSION_showScore']) { print '' . $stitle . ' | '; } } print '' . $ptitle . ' | ' . $lptitle . ' | ' . oc_('Posts') . ' |
---|---|---|---|---|
' . safeHTMLstr($l['accepted']) . ' | '; if ($OC_configAR['OC_DISCUSSION_showScore']) { print '' . (empty($l['recavg']) ? ' ' : $l['recavg']) . ' | '; } } print '' . $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']] : ' ') . ' |