' . oc_('File') . ''; // table header used for file column
$formatField = '`format`'; // paper table format field
$blanks = '
| | '; // cell padding (see below)
beginSession();
printHeader(oc_('View Submissions'), 2);
// Get permissions
$readOtherPapers = 0;
$seeAssignedReviews = 0;
$seeOtherReviews = 0;
$seeIncomplete = 1;
$seeDecision = 0;
// If advocate, apply advocate permissions
if ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") {
$seeAssignedReviews = 1;
if ($OC_configAR['OC_advocateReadPapers']) {
$readOtherPapers = 1;
if ($OC_configAR['OC_advocateSeeOtherReviews']) {
$seeOtherReviews = 1;
}
}
if ($OC_configAR['OC_advocateSeeDecision']) { $seeDecision = 1; }
}
if ($OC_configAR['OC_reviewerReadPapers']) {
$readOtherPapers = 1;
if ($OC_configAR['OC_reviewerSeeOtherReviews']) {
$seeOtherReviews = 1;
}
}
if ($OC_configAR['OC_reviewerSeeAssignedReviews']) { $seeAssignedReviews = 1; }
if ($OC_configAR['OC_reviewerCompleteBeforeSAR']) { $seeIncomplete = 0; }
if ($OC_configAR['OC_reviewerSeeDecision']) { $seeDecision = 1; }
// Anything left to see?
if (!$readOtherPapers && !$seeAssignedReviews && !$seeOtherReviews) {
warn(oc_('Settings prohibit viewing additional submission information'));
}
// Get list of assigned papers & incomplete reviews
$assignedPaperAR = array();
$incompleteReviewAR = array();
$q = "SELECT `paperid`, `completed`, `score` FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$r = ocsql_query($q) or err("Unable to retrieve permitted reviews");
while ($l=ocsql_fetch_array($r)) {
$assignedPaperAR[] = $l['paperid'];
if (($l['completed'] == 'F') || !$l['score']) {
$incompleteReviewAR[] = $l['paperid'];
}
}
// If advocate, get list of advocating papers
$advocatingPaperAR = array();
if ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") {
$q = "SELECT `paperid` FROM `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `advocateid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$r = ocsql_query($q) or err("Unable to retrieve advocating submissions");
while ($l=ocsql_fetch_array($r)) {
$advocatingPaperAR[] = $l['paperid'];
}
}
// Get list of conflicts
$conflictAR = getConflicts($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']);
if (oc_hookSet('committee-list_papers-preprocess')) {
foreach ($OC_hooksAR['committee-list_papers-preprocess'] as $v) {
require_once $v;
}
}
// List papers
$q = "SELECT `paperid`, `title`, `accepted`, " . $formatField . " FROM `" . OCC_TABLE_PAPER . "` ORDER BY `paperid`";
$r = ocsql_query($q) or err("Unable to get submissions");
if (ocsql_num_rows($r) == 0) {
print '' . oc_('No submissions have been made yet.') . '
';
} else {
$row = 1;
$count = 0;
print '' . oc_('Note: bold submission titles indicate ones assigned to you') . '
';
print '
\n\n";
while ($l = ocsql_fetch_array($r)) {
// Skip if in conflict
if (in_array($l['paperid'].'-'.$_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'],$conflictAR)
&& !in_array($l['paperid'], $assignedPaperAR)
&& !in_array($l['paperid'], $advocatingPaperAR)
) {
continue;
}
if (in_array($l['paperid'],$assignedPaperAR)) { $assigned = 1; }
else { $assigned = 0; }
if (in_array($l['paperid'],$incompleteReviewAR)) { $completed = 0; }
else { $completed = 1; }
if (in_array($l['paperid'],$advocatingPaperAR)) { $advocating = 1; }
else { $advocating = 0; }
$i = 0;
$tr = '';
if ($seeAssignedReviews || $seeOtherReviews) {
if ($advocating || (($seeIncomplete || $completed) && (($seeOtherReviews && !$assigned) || ($seeAssignedReviews && $assigned)))) {
$tr .= '| ' . safeHTMLstr(oc_('view')) . ' | ';
$i++;
} else {
$tr .= ' | ';
}
}
if (($assigned || $advocating || $readOtherPapers)) {
$i++;
$tr .= ' | ' . oc_printFileCells($l);
} else {
$tr .= $blanks;
}
if ($i > 0) {
print '' . $tr . '| ';
$paperstr = $l['paperid'] . '. ' . safeHTMLstr($l['title']);
if ($assigned || $advocating) { print "$paperstr"; }
else { print $paperstr; }
print ' | ';
if ($seeDecision) {
if (!empty($l['accepted'])) {
print '' . safeHTMLstr($l['accepted']) . ' | ';
} else {
print '' . safeHTMLstr(oc_('Pending')) . ' | ';
}
}
print '
';
$row = $rowAR[$row];
$count++;
}
}
print '
';
if ($count == 0) {
print '
' . oc_('There are no submissions available for you to view.') . '
';
}
}
printFooter();
?>