File'; // table header used for file column $formatField = '`format`'; // paper table format field beginChairSession(); oc_addJS('chair/list_papers.js'); // Retrieve submission types - do it here as used for filtering validation below $subTypeAR = array(); $r = ocsql_query("SELECT DISTINCT `type` FROM `" . OCC_TABLE_PAPER . "` WHERE `type` IS NOT NULL AND `type`!='' ORDER BY `type`") or err('Unable to retrieve submission types', 'Submissions', 1); while ($l = ocsql_fetch_assoc($r)) { $subTypeAR[$l['type']] = substr($l['type'], 0, 50); } // Filter? $atype = (isset($_SESSION[OCC_SESSION_VAR_NAME]['chairvars']['accfilter']) ? $_SESSION[OCC_SESSION_VAR_NAME]['chairvars']['accfilter'] : ''); // accepteance type $stype = (isset($_SESSION[OCC_SESSION_VAR_NAME]['chairvars']['typefilter']) ? $_SESSION[OCC_SESSION_VAR_NAME]['chairvars']['typefilter'] : ''); // submission type if (isset($_POST['fsubmit']) && ($_POST['fsubmit'] == 'Filter')) { if (!isset($_POST['atype']) || empty($_POST['atype'])) { $atype = ''; } elseif (($_POST['atype'] == 'Pending') || isset($OC_acceptanceColorAR[$_POST['atype']])) { $atype = $_POST['atype']; } $_SESSION[OCC_SESSION_VAR_NAME]['chairvars']['accfilter'] = $atype; if (!isset($_POST['stype']) || empty($_POST['stype']) || !isset($subTypeAR[$_POST['stype']])) { $stype = ''; } else { $stype = $_POST['stype']; } $_SESSION[OCC_SESSION_VAR_NAME]['chairvars']['typefilter'] = $stype; session_write_close(); } printHeader("Submissions",1); $verbAR = array( 'Delete' => 'deleted', 'Withdraw' => 'withdrawn', 'Restore' => 'restored' ); if (isset($_POST['subaction']) && preg_match("/^(Delete|Withdraw|Restore) Submissions$/", $_POST['subaction'], $matches) && !empty($_POST['papers'])) { $action = $matches[1]; // Check for valid submission if (!validToken('chair')) { warn('Invalid submission'); } foreach ($_POST['papers'] as $paperid) { if (preg_match("/^\d+$/",$paperid)) { // restore paper? if ($action == 'Restore') { print "restoring id $paperid ...
\n"; restorePaper($paperid); } else { // withdraw paper? $log = true; if ($action == 'Withdraw') { print "withdrawing id $paperid ...\n"; if (! withdrawPaper($paperid, OCC_WORD_CHAIR)) { print " SUBMISSION NOT FOUND\n"; } $log = false; } else { print "deleting id $paperid ...\n"; } // delete paper deletePaper($paperid, $log); } } else { print "Unable to process submission id " . safeHTMLstr($paperid) . ".
\n"; } } print ' Submission(s) have been ' . $verbAR[$action] . '.
';
printFooter();
exit;
}
// Headers & Sorting
$rsortstr = 'ID';
$tsortstr = 'Title';
$nsortstr = 'Contact ' . OCC_WORD_AUTHOR . '';
$ssortstr = 'Stud.';
$stsortstr = 'Type';
if (!isset($_GET['s'])) {
$_GET['s'] = 'id';
}
switch ($_GET['s']) {
case 'id':
$sortby = "`paperid`";
$rsortstr = 'ID
' . $OC_sortImg;
break;
case 'title':
$sortby = "`title`";
$tsortstr = 'Title
' . $OC_sortImg;
break;
case 'student':
$sortby = "`student`, `paperid`";
$ssortstr = 'Stud.
' . $OC_sortImg;
break;
case 'type':
$sortby = "`type`, `paperid`";
$stsortstr = 'Type
' . $OC_sortImg;
break;
case 'name':
default:
$sortby = "`name_last`, `name_first`";
$nsortstr = 'Contact ' . OCC_WORD_AUTHOR . '
' . $OC_sortImg;
$_GET['s'] = 'id';
break;
}
// Display Filter
$aAR = array_keys($OC_acceptanceColorAR);
$aAR[] = 'Pending';
print '
'; } else { print '
'; } $q = "SELECT `paperid`, `title`, `contact_author`, `contact_email`, `withdraw_date`, `withdrawn_by` FROM `" . OCC_TABLE_WITHDRAWN . "` ORDER BY `paperid`"; $r = ocsql_query($q) or err('Unable to check for withdrawn submissions'); if ((ocsql_num_rows($r) > 0) && empty($atype) && empty($stype)) { print 'Withdrawn Submissions
'; } printFooter(); ?>