File'; // table header used for file column $formatField = '`format`'; // paper table format field beginChairSession(); oc_addJS('chair/list_papers.js'); 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, '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;
}
$rsortstr = 'ID';
$tsortstr = 'Title';
$nsortstr = 'Contact Author';
$ssortstr = 'Stud.';
$subtypesortstr = 'Type';
if (!isset($_GET['s']) || ($_GET['s'] == "id")) {
$sortby = "`paperid`";
$rsortstr = 'ID
' . $OC_sortImg;
} elseif ($_GET['s'] == "title") {
$sortby = "`title`";
$tsortstr = 'Title
' . $OC_sortImg;
} elseif ($_GET['s'] == "student") {
$sortby = "`student`, `paperid`";
$ssortstr = 'Stud.
' . $OC_sortImg;
} elseif ($_GET['s'] == "subtype") {
$sortby = "`module_oc_subtype_type`, `paperid`";
$subtypesortstr = 'Type
' . $OC_sortImg;
} else { // name sort
$sortby = "`name_last`, `name_first`";
$nsortstr = 'Contact Author
' . $OC_sortImg;
}
$extraFields = '';
if (oc_moduleActive('oc_subtype')) {
$extraFields .= ", `module_oc_subtype_type`";
}
if (oc_hookSet('chair-list_papers-preprocess')) {
foreach ($OC_hooksAR['chair-list_papers-preprocess'] as $v) {
require_once $v;
}
}
$q = "SELECT `" . OCC_TABLE_PAPER . "`.`paperid`, CONCAT_WS(' ', `name_first`, `name_last`) AS `name`, `" . OCC_TABLE_PAPER . "`.`accepted`, `" . OCC_TABLE_PAPER . "`.`title`, " . $formatField . ", `" . OCC_TABLE_PAPER . "`.`student`" . $extraFields . " FROM `" . OCC_TABLE_PAPER . "` LEFT JOIN `" . OCC_TABLE_AUTHOR . "` ON `" . OCC_TABLE_AUTHOR . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` AND `" . OCC_TABLE_AUTHOR . "`.`position`=`" . OCC_TABLE_PAPER . "`.`contactid` ORDER BY $sortby";
$r = ocsql_query($q) or err("Unable to get submissions");
if (mysql_num_rows($r) == 0) {
print 'No submissions have been made yet.
'; } 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 (mysql_num_rows($r) > 0) { print 'Withdrawn Submissions
'; } printFooter(); ?>