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 Submissions' => 'deleted', 'Delete Withdrawn Submissions' => 'deleted', 'Withdraw Submissions' => 'withdrawn', 'Restore Submissions' => 'restored' ); if (isset($_POST['subaction']) && isset($verbAR[$_POST['subaction']])) { // Check for valid submission if (!validToken('chair')) { warn('Invalid submission'); } if (preg_match("/^(Delete|Withdraw) Submissions$/", $_POST['subaction']) && isset($_POST['papers']) && !empty($_POST['papers'])) { foreach ($_POST['papers'] as $paperid) { if (preg_match("/^\d+$/",$paperid)) { // withdraw? $log = true; if ($_POST['subaction'] == 'Withdraw Submissions') { print "
withdrawing id $paperid ... "; if (! withdrawPaper($paperid, OCC_WORD_CHAIR)) { print 'SUBMISSION NOT FOUND'; } print "
\n"; $log = false; } else { print "deleting id $paperid ...
\n"; } // delete paper deletePaper($paperid, $log); } else { print "Unable to process submission id " . safeHTMLstr($paperid) . ".The number of submissions selected may have been greater than supported by this server. Additional passes may be required.
'; } } elseif (preg_match("/^(Restore|Delete Withdrawn) Submissions$/", $_POST['subaction']) && isset($_POST['wpapers']) && !empty($_POST['wpapers'])) { foreach ($_POST['wpapers'] as $paperid) { if (preg_match("/^\d+$/",$paperid)) { if ($_POST['subaction'] == 'Restore Submissions') { // restore? print "restoring id $paperid ... "; $ret = restorePaper($paperid); if ($ret != $paperid) { if ($ret === null) { print 'SUBMISSION NOT FOUND'; } else { print 'Duplicate ID -- New ID Assigned: ' . safeHTMLstr($ret) . ''; } } print "
\n"; } elseif ($_POST['subaction'] == 'Delete Withdrawn Submissions') { // delete withdrawn? print "deleting withdrawn id $paperid ... "; if ( ! ocsql_query("DELETE FROM `" . OCC_TABLE_WITHDRAWN . "` WHERE `paperid`='" . safeSQLstr($paperid) . "' LIMIT 1") ) { print 'DELETION FAILED'; } print "
\n"; } } else { print "Unable to process submission id " . safeHTMLstr($paperid) . ".The number of submissions selected may have been greater than supported by this server. Additional passes may be required.
'; } } print ''; 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 = 'IDNo submissions available.
'; } 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(); ?>