File'; // table header used for file column $formatField = '`format`'; // paper table format field beginChairSession(); 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? if ($action == 'Withdraw') { print "withdrawing id $paperid ...

\n"; if (! withdrawPaper($paperid, 'Chair')) { print "     SUBMISSION NOT FOUND

\n"; } } else { print "deleting id $paperid ...

\n"; } // delete paper deletePaper($paperid); } } else { print "Unable to process submission id " . safeHTMLstr($paperid) . ".

\n"; } } print ' Submission(s) have been ' . $verbAR[$action] . '.

Return to Submission Listings

'; 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`, `title`, " . $formatField . ", `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 "Count: " . mysql_num_rows($r) . "

\n"; print ' Note: When deleting a submission, all records associated with the submission are permanently removed. When withdrawing a submission, all reviews and assignments, uploaded files, etc, are permanently removed; the submission and author table data however may be restored.

 

'; if ($OC_configAR['OC_trackStudent']) { print ''; } if (oc_moduleActive('oc_subtype')) { print ''; } print $fileTableHeader . ' '; $row = 1; while ($l = mysql_fetch_array($r)) { print ''; if ($OC_configAR['OC_trackStudent']) { print ''; } if (oc_moduleActive('oc_subtype')) { print ''; } print oc_printFileCells($l, true) . "\n"; if ($row==1) { $row=2; } else { $row=1; } } print '
D/W' . $rsortstr . '' . $tsortstr . '' . $nsortstr . '' . $ssortstr . '' . $subtypesortstr . '
 ' . $l['paperid'] . '' . safeHTMLstr($l['title']) . '' . safeHTMLstr($l['name']) . ''. (($l['student'] == 'T') ? 'S' : ' ') . '' . varValue('module_oc_subtype_type', $l, ' ', true) . '
 
'; } $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

Note: Restoring a withdrawn submission will not restore all the submission data, only the information stored in the submission (paper) and authors table.

'; $row = 1; while ($l = mysql_fetch_assoc($r)) { print ''; if ($row==1) { $row=2; } else { $row=1; } } print '
 IDTitleContact AuthorWithdrawn By / On
' . $l['paperid'] . '' . safeHTMLstr($l['title']) . '' . safeHTMLstr($l['contact_author']) . '' . safeHTMLstr($l['withdrawn_by']) . ' / ' . safeHTMLstr($l['withdraw_date']) . '
'; } printFooter(); ?>