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] . '.

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`, `" . 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 '

Number of Submissions: ' . mysql_num_rows($r) . '      

'; if ($OC_configAR['OC_trackStudent']) { print ''; } if (oc_moduleActive('oc_subtype')) { print ''; } print $fileTableHeader . ' '; $row = 1; $missingFileAR = array(); // global var hack bec. call_user_func does not allow pass by reference for non-object 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"; $accCountAR[(empty($l['accepted']) ? 'Pending' : $l['accepted'])][] = $l['paperid']; if ($row==1) { $row=2; } else { $row=1; } } print '
 ' . $rsortstr . '' . $tsortstr . '' . $nsortstr . '' . $ssortstr . '' . $subtypesortstr . '
' . $l['paperid'] . '' . safeHTMLstr($l['title']) . '' . safeHTMLstr($l['name']) . ''. (($l['student'] == 'T') ? 'S' : ' ') . '' . varValue('module_oc_subtype_type', $l, ' ', true) . '
 

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 submission-related modules have not been uninstalled.

'; } $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

'; $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']) . '

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

'; } printFooter(); ?>