first commit

This commit is contained in:
Your Name
2021-04-20 11:13:47 +05:30
parent b76859a3f1
commit 0a18b88eba
408 changed files with 47723 additions and 0 deletions
+107
View File
@@ -0,0 +1,107 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
// Advocate fields
// See include-forms.inc for syntax format
// Get advocate values
$accValues = array();
foreach ($OC_acceptanceValuesAR as $acc) {
$accValues[] = $acc['value'];
}
$accValues[] = 'Undecided';
// Get topics
$topq = "SELECT * FROM `" . OCC_TABLE_TOPIC . "`";
if ($OC_configAR['OC_topicDisplayAlpha']) {
$topq .= " ORDER BY `topicname`";
}
$topr = ocsql_query($topq) or err('unable to retrieve topics');
$topicAR = array();
if (($tnum = ocsql_num_rows($topr)) > 0) {
while ($topl = ocsql_fetch_assoc($topr)) {
$topicAR[$topl['topicid']] = $topl['topicname'];
}
}
// Hooks
if (oc_hookSet('committee-advocate-preinc')) {
foreach ($GLOBALS['OC_hooksAR']['committee-advocate-preinc'] as $v) {
require_once $v;
}
}
if (!isset($mod_oc_customforms_customAdvForm) || (!$mod_oc_customforms_customAdvForm)) { // skip if we have a custom form
$OC_advocateQuestionsAR = array(
'adv_recommendation' => array(
'name' => oc_('Recommendation'),
'short' => oc_('Recommendation'),
'note' => '',
'type' => 'radio',
'display' => 'newline',
'required' => false,
'longlabel' => true,
'usekey' => false,
'values' => $accValues
),
'adv_comments' => array(
'name' => oc_('Committee Comments'),
'short' => oc_('Committee Comments'),
'note' => oc_('Reasons must be included for all submissions, because they help us determine what to do when reviewers disagree with each other.'),
'longlabel' => true,
'type' => 'textarea'
)
);
// Set up fieldset
$OC_advocateQuestionsFieldsetAR = array(
'fs_advocate' => array(
'fieldset' => '',
'note' => '',
'fields' => array_keys($OC_advocateQuestionsAR)
)
);
} // if ! custom form
if (oc_hookSet('committee-advocate-inc')) {
foreach ($GLOBALS['OC_hooksAR']['committee-advocate-inc'] as $v) {
require_once $v;
}
}
// Make updates if not customforms edit
if (! isset($mod_oc_customforms_edit) || ! $mod_oc_customforms_edit) {
// Update valuetypes
foreach ($OC_advocateQuestionsAR as $sfk => $sf) {
if (isset($sf['valuetype']) && !empty($sf['valuetype']) && ($sf['valuetype'] != 'custom')) {
switch($sf['valuetype']) {
case 'country':
require_once OCC_COUNTRY_FILE;
$OC_advocateQuestionsAR[$sfk]['values'] = $GLOBALS['OC_countryAR'];
break;
case 'topic':
$OC_advocateQuestionsAR[$sfk]['values'] = $topicAR;
break;
default: // lib file
require_once OCC_LIB_DIR . $sf['valuetype'] . '.inc';
$OC_advocateQuestionsAR[$sfk]['values'] = $GLOBALS['OC_' . $sf['valuetype'] . 'AR'];
break;
}
}
}
}
+185
View File
@@ -0,0 +1,185 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
beginSession();
printHeader(oc_('Advocate'), 2);
if ( ! $OC_statusAR['OC_pc_signin_open'] || ! $OC_statusAR['OC_advocating_open']) {
warn(oc_('This feature is currently disabled'));
}
// Advocate?
if ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] != "T") {
warn(oc_('You are not listed as being on the program committee'));
exit;
}
// Valid PID?
if (isset($_POST['submit'])) {
if (!isset($_POST['pid']) || !preg_match("/^\d+$/",$_POST['pid'])) {
warn(oc_('Submission ID is invalid'));
} else {
$pid = $_POST['pid'];
}
} elseif (!isset($_GET['pid']) || !preg_match("/^\d+$/",$_GET['pid'])) {
warn(oc_('Submission ID is invalid'));
} else {
$pid = $_GET['pid'];
}
// Make sure advocate is assigned paper and get info
$q3 = "SELECT `title`, `type` FROM `" . OCC_TABLE_PAPER . "`, `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `" . OCC_TABLE_PAPER . "`.`paperid`='" . safeSQLstr($pid) . "' AND `" . OCC_TABLE_PAPERADVOCATE . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` AND `" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid`='" . $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'] . "'";
$r3 = ocsql_query($q3) or err("Unable to get submission info");
if (ocsql_num_rows($r3) != 1) { // bail if not found
warn('Invalid request');
exit;
}
$subinfo = ocsql_fetch_array($r3);
require_once OCC_FORM_INC_FILE;
require_once OCC_ADVOCATE_INC_FILE;
require_once OCC_REVIEW_INC_FILE; // used for displaying reviews
function printAdvocateForm($recommendation, $pid, $subinfo) {
print '<p style="text-align: center"><span style="font-size: 1.05em; font-weight: bold; font-style: italic;">' . safeHTMLstr($subinfo['title']) . '</span><br />' . oc_('Submission ID') . ': ' . $pid;
if (isset($subinfo['type']) && !empty($subinfo['type'])) {
print '<br />(' . safeHTMLstr($subinfo['type']) . ')<br />';
}
print '
<br />
<form method="POST" ACTION="' . $_SERVER['PHP_SELF'] . '" class="ocform ocreviewform">
<input type="hidden" name="token" value="' . $_SESSION[OCC_SESSION_VAR_NAME]['actoken'] . '" />
<input type="hidden" name="pid" value="' . safeHTMLstr($pid) . '">
<input type="hidden" name="ocaction" value="Submit Recommendation" />
';
if (oc_hookSet('committee-advocate-fields')) {
foreach ($GLOBALS['OC_hooksAR']['committee-advocate-fields'] as $v) {
require_once $v;
}
}
oc_displayFieldSet($GLOBALS['OC_advocateQuestionsFieldsetAR'], $GLOBALS['OC_advocateQuestionsAR'], $recommendation);
if (oc_hookSet('committee-advocate-extra')) {
foreach ($GLOBALS['OC_hooksAR']['committee-advocate-extra'] as $v) {
require_once $v;
}
}
print '
<input type="submit" name="submit" class="submit" value="' . oc_('Submit Recommendation') . '">
</form>
';
// Display Reviews
print '<p style="text-align: center; border-top: 2px solid #000; font-size: 11pt; font-weight: bold; text-align: center; margin-top: 2em; padding-top: 1em;">Reviews</p>';
if ($emailList = getPaperReviewersEmail($pid)) { // email reviewers link
print '<p style="text-align: center;">(<a href="mailto:' . $emailList . '">' . oc_('Email Reviewers') . '</a>)</p>';
}
$q = "SELECT `" . OCC_TABLE_PAPERREVIEWER . "`.*, CONCAT_WS(' ', `" . OCC_TABLE_REVIEWER . "`.`name_first`, `" . OCC_TABLE_REVIEWER . "`.`name_last`) as `name`, `" . OCC_TABLE_REVIEWER . "`.`email` FROM `" . OCC_TABLE_PAPERREVIEWER . "`, `" . OCC_TABLE_REVIEWER . "` WHERE `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`='" . safeSQLstr($pid) . "' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid`=`" . OCC_TABLE_REVIEWER . "`.`reviewerid` ORDER BY `score`, `reviewerid`";
$r = ocsql_query($q) or err("Unable to get information");
if (ocsql_num_rows($r)==0) {
print '<p>' . oc_('No reviews found') . ' (2)</p>';
} else {
displayReviews($pid, $r, $subinfo['type']);
}
}
// submission?
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Submit Recommendation")) {
// Check for valid submission
if (!validToken('ac')) {
$w = sprintf(oc_('This submission failed our security check, possibly due to you have signed in again, or a third-party having redirected you here. Below is the information provided. If you were attempting to submit a review, print this information out or copy/paste it to a new document so it can be re-entered; then <a href="%s">try again</a>. If the problem persists, please contact the Chair.'), ($_SERVER['PHP_SELF'] . '?pid=' . (is_numeric($_POST['pid']) ? $_POST['pid'] : ''))) . '<div style="color: #000; margin-top: 1em; font-weight: normal;">';
$OC_advocateQuestionsARkeys = array_keys($OC_advocateQuestionsAR);
foreach ($_POST as $k => $v) {
if (($k == 'submit') || ($k == 'token')) { continue; }
if (in_array($k, $OC_advocateQuestionsARkeys)) {
$w .= "<br />\n<hr /><br />\n<strong>" . safeHTMLstr($OC_advocateQuestionsAR[$k]['short']) . "</strong> ";
if ($OC_advocateQuestionsAR[$k]['usekey']) {
$w .= $OC_advocateQuestionsAR[$k]['values'][$v];
} else {
$w .= safeHTMLstr($v);
}
} else {
$w .= "<br />\n<hr /><br />\n<strong>" . safeHTMLstr($k) . ":</strong> " . safeHTMLstr($v);
}
}
$w .= '<hr /></div>';
warn($w);
}
// Validate fields
$qfields = array();
$err = '';
foreach ($GLOBALS['OC_advocateQuestionsFieldsetAR'] as $fsid => $fs) {
foreach ($fs['fields'] as $fid) {
oc_validateField($fid, $GLOBALS['OC_advocateQuestionsAR'], $qfields, $err);
}
}
// Hooks
if (oc_hookSet('committee-advocate-validate')) {
foreach ($GLOBALS['OC_hooksAR']['committee-advocate-validate'] as $v) {
require_once $v;
}
}
// Error?
if (!empty($err)) {
print '<div class="warn">' . oc_('Please check the following:') . '<ul>' . $err . '</ul></div><hr />';
printAdvocateForm($_POST, $pid, $subinfo);
return;
}
// Compose sql and update
$q = "UPDATE `" . OCC_TABLE_PAPERADVOCATE . "` SET ";
foreach ($qfields as $qid => $qval) {
$q .= "`" . $qid . "`=" . $qval . ",";
}
$q = rtrim($q, ',');
$q .= " WHERE `paperid`='" . safeSQLstr($pid) . "' AND `advocateid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
ocsql_query($q) or err("Unable to submit recommendation");
if (oc_hookSet('committee-advocate-save')) {
foreach ($GLOBALS['OC_hooksAR']['committee-advocate-save'] as $v) {
require_once $v;
}
}
print '<p>' . oc_('Recommendation has been submitted.') . '</p>';
print '<p>&#187; <a href="advocate.php?pid=' . $pid . '">' . oc_('Return to Recommendation') . '</a></p>';
//T: Member = Committee Member -- see "Member Home" string
print '<p>&#187; ' . sprintf('<a href="%s">Return to Member home page</a>', 'reviewer.php') . '</p>';
printFooter();
exit;
}
// Retrieve advocate recommendation
$advq = "SELECT * FROM `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `paperid`='" . safeSQLstr($pid) . "' AND `advocateid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$advr = ocsql_query($advq) or err("Unable to get advocate info");
$recommendation = ocsql_fetch_array($advr);
// Display form
printAdvocateForm($recommendation, $pid, $subinfo);
printFooter();
?>
+92
View File
@@ -0,0 +1,92 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
// Check for existing/valid email registration
if ( isset($OC_reviewerFieldAR['email']) && isset($_POST['email']) && validEmail(trim($_POST['email'])) ) {
if (preg_match("/signup\.php/", $_SERVER['PHP_SELF'])) { // signup
$eq = "SELECT `reviewerid` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `email`='" . safeSQLstr(trim($_POST['email'])) . "'";
} else { // profile update
$eq = "SELECT `reviewerid` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `email`='" . safeSQLstr(trim($_POST['email'])) . "' AND `reviewerid`!='" . safeSQLstr(((isset($chair) && $chair && isset($rid)) ? $rid : $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'])) . "'";
}
$er = ocsql_query($eq) or err("could not check email address");
if (ocsql_num_rows($er) != 0) {
print '<p class="warn" style="text-align: center">' . sprintf(oc_('An account for the email address entered already exists. Would you like to <a href="%1$s">Sign In</a> or <a href="%2$s">Recover Username</a>?'), 'signin.php', 'email_username.php') . '</p>';
printFooter();
exit;
}
}
// Validate fields
foreach ($GLOBALS['OC_reviewerFieldSetAR'] as $fsid => $fs) {
foreach ($fs['fields'] as $fid) {
if (!preg_match("/^(?:username|password\d)$/", $fid)) { // skip validation of special fields
oc_validateField($fid, $GLOBALS['OC_reviewerFieldAR'], $qfields, $err);
}
}
}
// Check account
if (isset($OC_reviewerFieldAR['username']) && oc_fieldEnabled('username', $GLOBALS['OC_reviewerFieldAR'])) {
if (!isset($_POST['username']) || !preg_match("/^[\p{L}\p{Nd}_\.\-\@]{5,50}$/u", trim($_POST['username']))) {
//T: $1$d and $2$d = range of characters permitted (e.g., 5 and 50)
$err .= '<li>' . sprintf(oc_('Username must be between %1$d and %2$d characters: letters, numbers, period, hyphen, @'), 5, 50) . '</li>';
} elseif (preg_match("/signup\.php/", $_SERVER['PHP_SELF'])) {
// check that user does not yet have an account; notify & bail if they do
$uq = "SELECT `reviewerid` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `username`='" . safeSQLstr(oc_strtolower(trim($_POST['username']))) . "'";
$ur = ocsql_query($uq) or err("could not check username");
if (ocsql_num_rows($ur) != 0) {
$err .= '<li>' . sprintf(oc_('Username is already taken; select a different username (or <a href="%s">Sign In</a> if you already registered)'), 'signin.php') . '</li>';
} else {
$qfields['username'] = "'" . safeSQLstr(oc_strtolower(trim($_POST['username']))) . "'";
}
}
}
// Check password if either field is not empty or it's an original signup
if ( (isset($_POST['password1']) && !empty($_POST['password1'])) // fld pwd1 set
|| (isset($_POST['password2']) && !empty($_POST['password2'])) // fld pwd 2 set
|| ( ! isset($OC_cmtEdit) ) // profile update
) {
if (!isset($_POST['password1']) || !isset($_POST['password2']) || empty($_POST['password1'])) {
$err .= '<li>' . oc_('Password must be entered twice') . '</li>';
} elseif ($_POST['password1'] != $_POST['password2']) {
$err .= '<li>' . oc_('Passwords entered do not match') . '</li>';
} elseif ( ! preg_match("/^.{8}/",$_POST['password1'])) {
//T: %d = number of characters
$err .= '<li>' . sprintf(oc_('Password must be at least %d characters'), 8) . '</li>';
} else {
$qfields['password'] = "'" . safeSQLstr(oc_password_hash($_POST['password1'])) . "'";
}
}
// Update topics
if (isset($qfields['topics'])) {
if ($qfields['topics'] != 'NULL') {
if (!preg_match("/^'[\d\,]*'$/", $qfields['topics'])) {
$err .= '<li>' . sprintf(oc_('%s field does not appear to be valid'), oc_('Topic')) . '</li>'; // should only trigger if validateField above fails
} else {
$tfields = explode(',', trim($qfields['topics'], "'"));
}
}
unset($qfields['topics']);
}
// Add datetime to consent
if (isset($qfields['consent']) && preg_match("/^\'.*\'$/", $qfields['consent'])) {
$qfields['consent'] = rtrim($qfields['consent'], "'") . safeSQLstr(" (" . gmdate('Y-m-d H:i:s') . " UTC)") . "'"; // add datetime to consent field
}
// hook
if (oc_hookSet('committee-profile-validate')) {
foreach ($GLOBALS['OC_hooksAR']['committee-profile-validate'] as $hook) {
require_once $hook;
}
}
+280
View File
@@ -0,0 +1,280 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
// Committee sign up
// See include-forms.inc for syntax format
// Get topics
$topq = "SELECT * FROM `" . OCC_TABLE_TOPIC . "`";
if ($OC_configAR['OC_topicDisplayAlpha']) {
$topq .= " ORDER BY `topicname`";
}
$topr = ocsql_query($topq) or err('unable to retrieve topics');
$topicAR = array();
$shortTopicAR = array();
if (($tnum = ocsql_num_rows($topr)) > 0) {
while ($topl = ocsql_fetch_assoc($topr)) {
if ($topl['topicname'] == 'N/A') { continue; }
$topicAR[$topl['topicid']] = $topl['topicname'];
if (!empty($topl['short'])) {
$shortTopicAR[$topl['topicid']] = $topl['short'];
}
}
}
$OC_reviewerFieldAR = array();
$OC_reviewerFieldSetAR = array();
// Hooks
if (oc_hookSet('committee-profile-preinc')) {
foreach ($GLOBALS['OC_hooksAR']['committee-profile-preinc'] as $v) {
require_once $v;
}
}
if (!isset($mod_oc_customforms_customCmtForm) || (!$mod_oc_customforms_customCmtForm)) { // skip if we have a custom form
// Consent
if (
(OCC_LICENSE != 'Public')
||
((OCC_LICENSE == 'Public') && ($OC_configAR['OC_privacy_display'] > 0))
) {
$OC_reviewerFieldAR['consent'] = array(
'name' => oc_('Consent'),
'short' => oc_('Consent'),
'note' => '',
'type' => 'checkbox',
'usekey' => false,
'required' => true,
'delimiter' => '',
'values' => array(oc_('I consent to the collection and use of my personal information, including receiving emails, consistent with the Privacy Policy linked above.'))
);
$OC_reviewerFieldSetAR['fs_consent'] = array(
'fieldset' => oc_('Consent'),
'note' => '',
'fields' => array('consent')
);
}
// Personal Info
$OC_reviewerFieldAR['orcid'] = array(
'name' => oc_('ORCID'),
'short' => oc_('ORCID'),
'note' => '',
'type' => 'text',
'width' => 30,
'maxchars' => 30,
'required' => false
);
$OC_reviewerFieldAR['name_first'] = array(
'name' => oc_('First/Given Name'),
'short' => oc_('First Name'),
'note' => '',
'type' => 'text',
'maxchars' => 60,
'required' => false
);
$OC_reviewerFieldAR['name_last'] = array(
'name' => oc_('Last/Family Name'),
'short' => oc_('Last Name'),
'note' => '',
'type' => 'text',
'maxchars' => 40,
'required' => true
);
$OC_reviewerFieldAR['email'] = array(
'name' => oc_('Email'),
'short' => oc_('Email'),
'note' => '',
'type' => 'email',
'required' => true
);
$OC_reviewerFieldAR['organization'] = array(
'name' => oc_('Organization'),
'short' => oc_('Organization'),
'note' => '',
'type' => 'text',
'maxchars' => 150, // limitation as a result of utf8mb4 keys
'required' => false
);
$OC_reviewerFieldAR['country'] = array(
'name' => oc_('Country'),
'short' => oc_('Country'),
'note' => '',
'type' => 'dropdown',
'blank' => true,
'required' => false,
'valuetype' => 'country'
);
$OC_reviewerFieldAR['telephone'] = array(
'name' => oc_('Telephone'),
'short' => oc_('Telephone'),
'note' => '',
'type' => 'text',
'required' => false
);
$OC_reviewerFieldAR['url'] = array(
'name' => oc_('Web Site'),
'short' => oc_('Web Site'),
'note' => '',
'type' => 'text',
'required' => false,
'placeholder' => 'https://'
);
$OC_reviewerFieldSetAR['fs_personal'] = array(
'fieldset' => oc_('Personal Info'),
'note' => '',
'fields' => array('orcid', 'name_first', 'name_last', 'email', 'organization', 'country', 'telephone', 'url')
);
// Topics
$OC_reviewerFieldAR['topics'] = array(
'name' => oc_('Topic Areas'),
'short' => oc_('Topic(s)'),
'note' => '',
'type' => 'checkbox',
'usekey' => true,
'display' => 'newline',
'required' => true,
'valuetype' => 'topic'
);
if ($OC_configAR['OC_multipleCommitteeTopics'] != 1) { // (!1 = limited to 1)
$OC_reviewerFieldAR['topics']['maxselections'] = 1;
}
$OC_reviewerFieldSetAR['fs_topics'] = array(
'fieldset' => oc_('Topic Areas'),
'note' => oc_('To help match submissions to reviewers, please select the area(s) most applicable to your submission'),
'fields' => array('topics')
);
// Comments
$OC_reviewerFieldAR['comments'] = array(
'name' => oc_('Comments to Chair'),
'short' => oc_('Comments'),
'note' => '',
'type' => 'textarea',
'height' => 5,
'required' => false
);
$OC_reviewerFieldSetAR['fs_comments'] = array(
'fieldset' => oc_('Comments'),
'note' => '',
'fields' => array('comments')
);
// Account
$OC_reviewerFieldAR['username'] = array(
'name' => oc_('Username'),
'short' => oc_('Username'),
//T: %1$d-%2$d = range of letters allowed (e.g., 5-50)
'note' => sprintf(oc_('%1$d-%2$d characters: letters, numbers, @, period (.), hyphen (-)'), 5, 50),
'minchars' => 5,
'maxchars' => 50,
'type' => 'text',
'donotvalidate' => true,
'required' => true // always true
);
$OC_reviewerFieldAR['password1'] = array(
'name' => oc_('Password'),
'short' => oc_('Password'),
'note' => sprintf(oc_('%d or more characters (any)'), 8),
'type' => 'password',
'donotvalidate' => true,
'required' => true
);
$OC_reviewerFieldAR['password2'] = array(
'name' => oc_('Re-enter Password'),
'short' => oc_('Confirm'),
'note' => '',
'type' => 'password',
'donotvalidate' => true,
'required' => true
);
$OC_reviewerFieldSetAR['fs_passwords'] = array(
'fieldset' => oc_('Account'),
'note' => '',
'fields' => array('username', 'password1', 'password2')
);
// Unset fields that should not be displayed on form
if (!empty($GLOBALS['OC_configAR']['OC_hideCmtFields'])) {
$hCF = explode(',', $GLOBALS['OC_configAR']['OC_hideCmtFields']);
foreach ($hCF as $hc_f) {
list($a_fs, $a_f) = explode(':', $hc_f);
unset($OC_reviewerFieldAR[$a_f]);
if (in_array($a_f, $OC_reviewerFieldSetAR[$a_fs]['fields'])) {
$OC_reviewerFieldSetAR[$a_fs]['fields'] = array_values(array_diff($OC_reviewerFieldSetAR[$a_fs]['fields'], array($a_f)));
}
}
}
} // if ! custom form
if (oc_hookSet('committee-profile-inc')) {
foreach ($GLOBALS['OC_hooksAR']['committee-profile-inc'] as $v) {
require_once $v;
}
}
// Make updates if not customforms edit
if (! isset($mod_oc_customforms_edit) || ! $mod_oc_customforms_edit) {
foreach ($OC_reviewerFieldAR as $sfk => $sf) {
// remove fields designated for new submissions (sign up) only if profile being edited
if (isset($sf['newsubonly']) && $sf['newsubonly'] && isset($GLOBALS['OC_cmtEdit']) && $GLOBALS['OC_cmtEdit']) {
unset($OC_reviewerFieldAR[$sfk]);
foreach ($OC_reviewerFieldSetAR as $fsid => $fsar) {
if (in_array($sfk, $fsar['fields'])) {
$OC_reviewerFieldSetAR[$fsid]['fields'] = array_diff($OC_reviewerFieldSetAR[$fsid]['fields'], array($sfk));
continue; // field should only be in one fieldset
}
}
} else { // update valuetypes
if (isset($sf['valuetype']) && !empty($sf['valuetype']) && ($sf['valuetype'] != 'custom')) {
switch($sf['valuetype']) {
case 'country':
require_once OCC_COUNTRY_FILE;
$OC_reviewerFieldAR[$sfk]['values'] = $GLOBALS['OC_countryAR'];
break;
case 'topic':
$OC_reviewerFieldAR[$sfk]['values'] = $topicAR;
break;
default: // lib file
require_once OCC_LIB_DIR . $sf['valuetype'] . '.inc';
$OC_reviewerFieldAR[$sfk]['values'] = $GLOBALS['OC_' . $sf['valuetype'] . 'AR'];
break;
}
}
}
}
// Update Topics to radio if required and max selections = 1
if (isset($OC_reviewerFieldAR['topics']['required']) && $OC_reviewerFieldAR['topics']['required'] && isset($OC_reviewerFieldAR['topics']['maxselections']) && ($OC_reviewerFieldAR['topics']['maxselections'] == 1) && ($OC_reviewerFieldAR['topics']['type'] == 'checkbox')){
$OC_reviewerFieldAR['topics']['type'] = 'radio';
}
}
+57
View File
@@ -0,0 +1,57 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
$hdr = oc_('Download');
$hdrfn = 2;
beginSession();
$urlBase = OCC_BASE_URL . 'review/download.php?';
if (isset($_GET['pc']) && ($_GET['pc'] == 1)) {
if ( $_SESSION[OCC_SESSION_VAR_NAME]['acpc'] != "T" ) {
warn(oc_('Invalid request'), $hdr, $hdrfn);
}
$table = OCC_TABLE_PAPERADVOCATE;
$field = 'advocateid';
$urlBase .= 'pc=1&';
} else {
$table = OCC_TABLE_PAPERREVIEWER;
$field = 'reviewerid';
}
$dir = $OC_configAR['OC_paperDir'];
$formatDBFldName = 'format';
$zipFilePrefix = $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'];
$savePath = '';
// MultiFile hook - verifies reviewers allowed access to file type & updates $dir
if (oc_hookSet('committee-paper-predisplay')) {
foreach ($OC_hooksAR['committee-paper-predisplay'] as $v) {
require_once $v;
}
} elseif (!isset($_GET['t']) || ($_GET['t'] != 1)) {
warn(oc_('Invalid file type'), $hdr, $hdrfn);
}
if ($_GET['t'] > 1) {
$formatDBFldName = 'oc_multifile_' . $_GET['t'] . '_format';
}
$q = "SELECT `" . OCC_TABLE_PAPER . "`.`paperid`, `" . OCC_TABLE_PAPER . "`.`" . $formatDBFldName . "` FROM `" . OCC_TABLE_PAPER . "`, `" . $table . "` WHERE `" . $table . "`.`" . $field . "`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "' AND `" . OCC_TABLE_PAPER . "`.`paperid`=`" . $table . "`.`paperid` AND `" . OCC_TABLE_PAPER . "`.`" . $formatDBFldName . "` IS NOT NULL AND `" . OCC_TABLE_PAPER . "`.`" . $formatDBFldName . "`!='' ORDER BY `paperid`";
require_once '../include-download.inc';
exit;
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
printHeader(oc_('Email Username'), 3);
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Email Username") && (!empty($_POST['email']))) {
// check for valid email
if (!validEmail($_POST['email'])) {
print '<p style="text-align: center" class="warn">' . oc_('Email address entered is invalid') . '</p>';
printFooter();
exit;
}
$q = "SELECT `reviewerid`, `username`, `email` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `email`='" . safeSQLstr(oc_strtolower($_POST['email'])) . "'";
$r = ocsql_query($q) or err("Error checking email");
if (($rnum=ocsql_num_rows($r)) == 0) {
print '<p style="text-align: center" class="warn">' . oc_('Email address entered is invalid') . ' (2)</p>';
}
elseif ($rnum > 1) {
err("multiple accounts with this email address");
} else {
$e = ocsql_fetch_array($r);
//T: %s = conference short name (e.g., CONF2012)
$msg = "\n" . sprintf(oc_('Your username for accessing the %s OpenConf system is:'), $OC_configAR['OC_confName']) . "\n\n " . $e['username'] . "\n\n";
sendEmail($_POST['email'], oc_('Username Recovery'), $msg, $OC_configAR['OC_notifyReviewerEmailUsername']);
print '<p>' . sprintf(oc_('We have emailed your username. Once you receive it, you may <a href="%s">sign in here</a>.'), 'signin.php') . '</p>';
printFooter();
exit;
}
}
else {
print '<p style="text-align: center">' . oc_('Please enter the email you registered with below') . '</p>';
}
print '
<form method="post" action="' . $_SERVER['PHP_SELF'] . '">
<input type="hidden" name="ocaction" value="Email Username" />
<table border="0" style="margin: 0 auto">
<tr><td><strong><label for="email">' . oc_('Email') . ':</label></strong></td><td><input size=20 name="email" id="email" value="' . safeHTMLstr(varValue('email', $_POST)) . '"></td></tr>
<tr><th align="center" colspan=2><br><input type="submit" name="submit" class="submit" value="' . oc_('Email Username') . '"></th></tr>
</table>
</form>
<p>
';
printFooter();
?>
View File
View File
+165
View File
@@ -0,0 +1,165 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
//T: File = table header used for file column
$fileTableHeader = '<th>' . oc_('File') . '</th>'; // table header used for file column
$formatField = '`format`'; // paper table format field
$blanks = '<td>&nbsp;</td><td>&nbsp;</td>'; // cell padding (see below)
beginSession();
printHeader(oc_('View Submissions'), 2);
// Get permissions
$readOtherPapers = 0;
$seeAssignedReviews = 0;
$seeOtherReviews = 0;
$seeIncomplete = 1;
$seeDecision = 0;
// If advocate, apply advocate permissions
if ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") {
$seeAssignedReviews = 1;
if ($OC_configAR['OC_advocateReadPapers']) {
$readOtherPapers = 1;
if ($OC_configAR['OC_advocateSeeOtherReviews']) {
$seeOtherReviews = 1;
}
}
if ($OC_configAR['OC_advocateSeeDecision']) { $seeDecision = 1; }
}
if ($OC_configAR['OC_reviewerReadPapers']) {
$readOtherPapers = 1;
if ($OC_configAR['OC_reviewerSeeOtherReviews']) {
$seeOtherReviews = 1;
}
}
if ($OC_configAR['OC_reviewerSeeAssignedReviews']) { $seeAssignedReviews = 1; }
if ($OC_configAR['OC_reviewerCompleteBeforeSAR']) { $seeIncomplete = 0; }
if ($OC_configAR['OC_reviewerSeeDecision']) { $seeDecision = 1; }
// Anything left to see?
if (!$readOtherPapers && !$seeAssignedReviews && !$seeOtherReviews) {
warn(oc_('Settings prohibit viewing additional submission information'));
}
// Get list of assigned papers & incomplete reviews
$assignedPaperAR = array();
$incompleteReviewAR = array();
$q = "SELECT `paperid`, `completed`, `score` FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$r = ocsql_query($q) or err("Unable to retrieve permitted reviews");
while ($l=ocsql_fetch_array($r)) {
$assignedPaperAR[] = $l['paperid'];
if (($l['completed'] == 'F') || !$l['score']) {
$incompleteReviewAR[] = $l['paperid'];
}
}
// If advocate, get list of advocating papers
$advocatingPaperAR = array();
if ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") {
$q = "SELECT `paperid` FROM `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `advocateid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$r = ocsql_query($q) or err("Unable to retrieve advocating submissions");
while ($l=ocsql_fetch_array($r)) {
$advocatingPaperAR[] = $l['paperid'];
}
}
// Get list of conflicts
$conflictAR = getConflicts($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']);
if (oc_hookSet('committee-list_papers-preprocess')) {
foreach ($OC_hooksAR['committee-list_papers-preprocess'] as $v) {
require_once $v;
}
}
// List papers
$q = "SELECT `paperid`, `title`, `accepted`, " . $formatField . " FROM `" . OCC_TABLE_PAPER . "` ORDER BY `paperid`";
$r = ocsql_query($q) or err("Unable to get submissions");
if (ocsql_num_rows($r) == 0) {
print '<p class="warn">' . oc_('No submissions have been made yet.') . '</p>';
} else {
$row = 1;
$count = 0;
print '<div id="reviewSubmissions"><p class="note">' . oc_('Note: <b>bold</b> submission titles indicate ones assigned to you') . '</p>';
print '<table border="0" cellspacing="1" cellpadding="4"><thead><tr class="rowheader">';
if ($seeAssignedReviews || $seeOtherReviews) { print '<th>' . oc_('Reviews') . '</th>'; }
print '<th>' . oc_('Abstract') . '</th>' . $fileTableHeader . '<th>' . oc_('Submission') . '</th>';
if ($seeDecision) { print '<th>' . oc_('Status') . '</th>'; }
print "</tr></thead>\n<tbody>\n";
while ($l = ocsql_fetch_array($r)) {
// Skip if in conflict
if (in_array($l['paperid'].'-'.$_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'],$conflictAR)
&& !in_array($l['paperid'], $assignedPaperAR)
&& !in_array($l['paperid'], $advocatingPaperAR)
) {
continue;
}
if (in_array($l['paperid'],$assignedPaperAR)) { $assigned = 1; }
else { $assigned = 0; }
if (in_array($l['paperid'],$incompleteReviewAR)) { $completed = 0; }
else { $completed = 1; }
if (in_array($l['paperid'],$advocatingPaperAR)) { $advocating = 1; }
else { $advocating = 0; }
$i = 0;
$tr = '';
if ($seeAssignedReviews || $seeOtherReviews) {
if ($advocating || (($seeIncomplete || $completed) && (($seeOtherReviews && !$assigned) || ($seeAssignedReviews && $assigned)))) {
$tr .= '<td align="center"><a href="show_reviews.php?pid=' . $l['paperid'] . '">' . safeHTMLstr(oc_('view')) . '</a></td>';
$i++;
} else {
$tr .= '<td>&nbsp;</td>';
}
}
if (($assigned || $advocating || $readOtherPapers)) {
$i++;
$tr .= '<td align="center"><a href="show_abstract.php?pid=' . $l['paperid'] . '"><img src="../images/document-sm.gif" border="0" alt="' . safeHTMLstr(oc_('view abstract')) . '" title="' . safeHTMLstr(oc_('view abstract')) . '" width="13" height="16" /></a></td>' . oc_printFileCells($l);
} else {
$tr .= $blanks;
}
if ($i > 0) {
print '<tr class="row' . $row . '">' . $tr . '<td>';
$paperstr = $l['paperid'] . '. ' . safeHTMLstr($l['title']);
if ($assigned || $advocating) { print "<strong><em>$paperstr</em></strong>"; }
else { print $paperstr; }
print '</td>';
if ($seeDecision) {
if (!empty($l['accepted'])) {
print '<td' . (isset($OC_acceptanceColorAR[$l['accepted']]) ? (' style="background-color: #' . $OC_acceptanceColorAR[$l['accepted']] . ';"') : '') . '>' . safeHTMLstr($l['accepted']) . '</td>';
} else {
print '<td style="font-style: italic;">' . safeHTMLstr(oc_('Pending')) . '</td>';
}
}
print '</tr>';
$row = $rowAR[$row];
$count++;
}
}
print '</tbody></table></div>';
if ($count == 0) {
print '
<p class="warn">' . oc_('There are no submissions available for you to view.') . '</p>
<script language="javascript" type="text/javascript">
<!--
document.getElementById("reviewSubmissions").style.display="none";
// -->
</script>
';
}
}
printFooter();
?>
+84
View File
@@ -0,0 +1,84 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
$dir = $OC_configAR['OC_paperDir'];
$hdr = oc_('File Retrieval');
if (isset($_GET['c']) && ($_GET['c'] == 1)) {
beginChairSession();
$hdrfn = 1; // chair
} else { // not chair
beginSession();
$hdrfn = 2; //reviewer
}
// Check for valid file name
if (!preg_match("/^(\d+)\.(\w+)$/",$_GET['p'],$matches)) {
//T: %s = filename (e.g., 1.pdf)
warn(sprintf(oc_('Invalid submission file: %s'), safeHTMLstr($_GET['p'])), $hdr, $hdrfn);
}
// Extract paper ID
$pid = $matches[1];
// Permission checks for reviewers
if ($hdrfn == 2) {
// Check for conflict
$conflictAR = getConflicts($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']);
if (oc_inConflict($conflictAR, $pid, $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'])) {
warn(oc_('You appear to have a conflict with this submission'), $hdr, $hdrfn);
}
$ok = 0;
// Check that reviewer has permission
if ($OC_configAR['OC_reviewerReadPapers']) {
$ok = 1;
} else { // make sure reviewer is assigned
$q = "SELECT `paperid` FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `paperid`='" . safeSQLstr($pid) . "' AND `reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$r = ocsql_query($q) or err("Unable to check reviewer permissions", $hdr, $hdrfn);
if (ocsql_num_rows($r) == 1) {
$ok = 1;
}
}
// If not ok, check if advocate & has permission
if (!$ok && ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T")) {
if ($OC_configAR['OC_advocateReadPapers']) {
$ok = 1;
} else { // make sure advocate is assigned
$q = "SELECT `paperid` FROM `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `paperid`='" . safeSQLstr($pid) . "' AND `advocateid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$r = ocsql_query($q) or err("Unable to check advocate permissions", $hdr, $hdrfn);
if (ocsql_num_rows($r) == 1) {
$ok = 1;
}
}
}
// If still not ok, show error
if (!$ok) {
warn(oc_('You do not have permission to retrieve this submission'), $hdr, $hdrfn);
}
} // reviewer
if (oc_hookSet('committee-paper-predisplay')) {
foreach ($OC_hooksAR['committee-paper-predisplay'] as $v) {
require_once $v;
}
}
if (! oc_displayFile($dir . $_GET['p'], $matches[2])) {
warn(oc_('File does not exist'), $hdr, $hdrfn);
}
exit;
?>
+84
View File
@@ -0,0 +1,84 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
beginSession();
// Make sure we have a submit
if (!isset($_SESSION[OCC_SESSION_VAR_NAME]['POST']['submit'])) {
header('Location: reviewer.php?' . strip_tags(SID));
exit;
}
// Types of submit we accept and where to redirect them
$whatLocAR = array(
'Review' => 'review.php',
'Recommendation' => 'advocate.php'
);
// Submit type
$what = substr($_SESSION[OCC_SESSION_VAR_NAME]['POST']['submit'], (strrpos($_SESSION[OCC_SESSION_VAR_NAME]['POST']['submit'], " ") + 1));
// Valid submit type?
if (!in_array($what, array_keys($whatLocAR))) {
header('Location: reviewer.php?' . strip_tags(SID));
exit;
}
ob_start();
printHeader("Recover Submission", 2);
// Display form with current POST values
print '<p style="font-weight: bold">' . oc_('Your session timed out prior to your submission being completed. Would you like to submit it now?') . '</p>
<dl><dd>
<form method="post" action="' . safeHTMLstr($whatLocAR[$what]) . '">
<input type="hidden" name="token" value="' . $_SESSION[OCC_SESSION_VAR_NAME]['actoken'] . '" />
<input type="hidden" name="ocaction" value="Submit ' . safeHTMLstr($what) . '" />
';
// Undefine submit so it doesn't get included
unset($_SESSION[OCC_SESSION_VAR_NAME]['POST']['submit']);
foreach ($_SESSION[OCC_SESSION_VAR_NAME]['POST'] as $k => $v) {
if ($k == 'token') { // skip old token
continue;
}
if (is_array($v)) {
foreach ($v as $vv) {
print '<input type="hidden" name="' . safeHTMLstr($k) . '[]" value="' . safeHTMLstr($vv) . '" />' . "\n";
}
} else {
print '<input type="hidden" name="' . safeHTMLstr($k) . '" value="' . safeHTMLstr($v) . '" />' . "\n";
}
}
// Undefine session POST var so user not asked again later
unset($_SESSION[OCC_SESSION_VAR_NAME]['POST']);
ob_end_flush();
print '
<input type="submit" name="submit" class="submit" value="' . oc_('Submit') . '" />
</form>
<br /><br />
<form method="get" action="reviewer.php">
<input type="submit" value="No, Thanks" />
</form>
</dd></dl>
<br /><br />
';
printFooter();
?>
+60
View File
@@ -0,0 +1,60 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
printHeader(oc_('Reset Password'), 3);
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Reset Password") && preg_match("/^[\p{L}\p{Nd}_\.\-\@]+$/u",trim($_POST['uname'])) && !empty($_POST['email'])) {
$q = "SELECT `reviewerid`, `username`, `email` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `username`='" . safeSQLstr(oc_strtolower(trim($_POST['uname']))) . "'";
$r = ocsql_query($q) or err("Error checking username");
if (($rnum=ocsql_num_rows($r)) == 0) { print '<p style="text-align: center" class="warn">Invalid username.</p>'; }
elseif ($rnum > 1) { err("multiple accounts with this username"); }
else {
$e = ocsql_fetch_array($r);
if (oc_strtolower($e['email']) != oc_strtolower($_POST['email'])) {
print '<p style="text-align: center" class="warn">' . oc_('Email does not match username.') . '</p>';
}
else { // username valid, reset pwd
$newpwd = oc_password_generate();
$q2 = "UPDATE `" . OCC_TABLE_REVIEWER . "` SET `password`='" . oc_password_hash($newpwd) . "' WHERE `reviewerid`='" . safeSQLstr($e['reviewerid']) . "'";
$r2 = ocsql_query($q2) or err(oc_('Unable to update password'));
//T: $s = conference short name (e.g., CONF2012)
$msg = "\n" . sprintf(oc_('Per your request, we have issued you a new password for accessing the %s OpenConf system. The new password is:'), $OC_configAR['OC_confName']) . "\n\n " . $newpwd . "\n\n" . oc_('You may change this password at any time by signing in to the OpenConf system and updating your profile.') . "\n\n";
if (sendEmail($_POST['email'], "Reviewer Password Reset", $msg, $OC_configAR['OC_notifyReviewerReset'])) {
print sprintf(oc_('We have emailed you a new password. Once you receive it, please <a href="%s">sign in</a> and change it.'), 'signin.php') . '<br /><br />';
} else {
warn(oc_('We have reset your password, but have been unable to email it to you. Please contact the administrator.'));
}
printFooter();
exit;
}
}
}
else {
print '<p style="text-align: center">' . oc_('Please enter your username and the email you registered with below') . '</p>';
}
print '
<form method="post" action="'.$_SERVER['PHP_SELF'].'">
<input type="hidden" name="ocaction" value="Reset Password" />
<table border="0" style="margin: 0 auto">
<tr><td><strong><label for="uname">' . oc_('Username') . ':</label></strong></td><td><input size=20 name="uname" id="uname" value="' . safeHTMLstr(varValue('uname', $_POST)) . '"></td></tr>
<tr><td><strong><label for="email">' . oc_('Email') . ':</label></strong></td><td><input size=20 name="email" id="email" value="' . safeHTMLstr(varValue('email', $_POST)) . '"></td></tr>
<tr><th align="center" colspan=2><br><input type="submit" name="submit" class="submit" value="' . oc_('Reset Password') . '"></th></tr>
</table>
</form>
<p>
';
printFooter();
?>
+252
View File
@@ -0,0 +1,252 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
// Review questions
// See include-forms.inc for syntax format
// Get topics
$topq = "SELECT * FROM `" . OCC_TABLE_TOPIC . "`";
if ($OC_configAR['OC_topicDisplayAlpha']) {
$topq .= " ORDER BY `topicname`";
}
$topr = ocsql_query($topq) or err('unable to retrieve topics');
$topicAR = array();
if (($tnum = ocsql_num_rows($topr)) > 0) {
while ($topl = ocsql_fetch_assoc($topr)) {
$topicAR[$topl['topicid']] = $topl['topicname'];
}
}
// Hooks
if (oc_hookSet('committee-review-preinc')) {
foreach ($GLOBALS['OC_hooksAR']['committee-review-preinc'] as $v) {
require_once $v;
}
}
if (!isset($mod_oc_customforms_customRevForm) || (!$mod_oc_customforms_customRevForm)) { // skip if we have a custom form
// Note: The recommendation field value is used for calculating a submission's score.
// The field is defined as TINYINT(3), which may need to be changed if a larger value will be stored
$OC_reviewQuestionsAR = array(
'recommendation' => array(
'name' => oc_('Recommendation'),
'short' => oc_('Recommendation'),
'note' => '',
'type' => 'radio',
'display' => 'newline',
'required' => true,
'score' => true,
'usekey' => true,
'longlabel' => true,
'values' => array(
1 => oc_('Reject: Content inappropriate to the conference or has little merit'),
2 => oc_('Probable Reject: Basic flaws in content or presentation or very poorly written'),
3 => oc_('Marginal Tend to Reject: Not as badly flawed; major effort necessary to make acceptable but content well-covered in literature already'),
4 => oc_('Marginal Tend to Accept: Content has merit, but accuracy, clarity, completeness, and/or writing should and could be improved in time'),
5 => oc_('Clear Accept: Content, presentation, and writing meet professional norms; improvements may be advisable but acceptable as is'),
6 => oc_('Must Accept: Candidate for outstanding submission. Suggested improvements still appropriate')
)
),
'category' => array(
'name' => oc_('Submission Categorization'),
'short' => oc_('Category'),
'note' => '',
'type' => 'radio',
'display' => 'newline',
'longlabel' => true,
'usekey' => true,
'values' => array(
1 => oc_('Highly theoretical'),
2 => oc_('Tends towards theoretical'),
3 => oc_('Balanced theory and practice'),
4 => oc_('Tends toward practical'),
5 => oc_('Highly practical')
)
),
'value' => array(
'name' => oc_('Overall Value Added to the Field'),
'short' => oc_('Value'),
'note' => oc_('Check as many as appropriate'),
'type' => 'checkbox',
'display' => 'newline',
'longlabel' => true,
'usekey' => true,
'values' => array(
1 => oc_('New information'),
2 => oc_('Valuable confirmation of present knowledge'),
3 => oc_('Clarity to present understanding'),
4 => oc_('New perspective, issue, or problem definition'),
5 => oc_('Not much'),
6 => oc_('Other')
)
),
'familiar' => array(
'name' => oc_('Reviewer Familiarity with Subject Matter'),
'short' => oc_('Familiarity'),
'note' => oc_('Relates to the confidence you have in your review'),
'type' => 'radio',
'display' => 'newline',
'longlabel' => true,
'usekey' => true,
'values' => array(
'Low' => oc_('Low'),
'Moderate' => oc_('Moderate'),
'High' => oc_('High')
)
),
'bpcandidate' => array(
'name' => oc_('Is this submission a candidate for the best submission award'),
'short' => oc_('Best Sub.'),
'note' => '',
'type' => 'radio',
'display' => 'newline',
'longlabel' => true,
'usekey' => true,
'values' => array(
'Yes' => oc_('Yes'),
'No' => oc_('No'),
'Unsure' => oc_('Unsure')
)
),
'length' => array(
'name' => oc_('Is the submission length appropriate'),
'short' => oc_('Length'),
'note' => '',
'type' => 'radio',
'display' => 'newline',
'longlabel' => true,
'usekey' => true,
'values' => array(
'Yes' => oc_('Yes'),
'No' => oc_('No'),
'Unsure' => oc_('Unsure')
)
),
'difference' => array(
'name' => oc_('If from reading the submission you know who the author is, how different is this from earlier submissions on the same topic by the same author? That is, is it the same as or a slight modification of other submissions, with little or no new information'),
'short' => oc_('Prior Work Diff.'),
'note' => oc_('We use these suggestions in assigning submissions to sessions for the conference, but not in determining whether the submission is accepted)'),
'type' => 'radio',
'display' => 'newline',
'longlabel' => true,
'usekey' => true,
'values' => array(
1 => oc_('Totally or largely different from other submissions'),
2 => oc_('Moderately different from other submissions'),
3 => oc_('Totally or largely identical to other submissions'),
4 => oc_("Don't know")
)
),
'sessions' => array( // NOTE: sessions field should not have showauthor attribute set
'name' => oc_('Which of the following session(s) would be the most appropriate for this submission'),
'short' => oc_('Session(s)'),
'note' => oc_('We use these suggestions in assigning submissions to sessions for the conference, but not in determining whether the submission is accepted)'),
'type' => 'checkbox',
'longlabel' => true,
'usekey' => true,
'display' => 'newline',
'required' => false,
'valuetype' => 'topic'
),
'authorcomments' => array(
'name' => oc_('Comments for the Authors'),
'short' => oc_('Author Comments'),
'note' => oc_('Constructive comments to the author(s) would be appreciated.'),
'type' => 'textarea',
'showauthor' => true,
'longlabel' => true
),
'pccomments' => array(
'name' => oc_('Comments for the Program Committee (authors will not see these comments)'),
'short' => oc_('PC Comments'),
'note' => oc_('Reasons must be included for all submissions, because they help us determine what to do when reviewers disagree with each other.'),
'type' => 'textarea',
'longlabel' => true
)
);
// Set up fieldset
$OC_reviewQuestionsFieldsetAR = array(
'fs_review' => array(
'fieldset' => oc_('Review'),
'note' => '',
'fields' => array_keys($OC_reviewQuestionsAR)
)
);
// Unset fields that should not be displayed on form -- defaults to fs_review fieldset
if (!empty($GLOBALS['OC_configAR']['OC_hideRevFields'])) {
$hRF = explode(',', $GLOBALS['OC_configAR']['OC_hideRevFields']);
foreach ($hRF as $hr_f) {
unset($OC_reviewQuestionsAR[$hr_f]);
if (in_array($hr_f, $OC_reviewQuestionsFieldsetAR['fs_review']['fields'])) {
$OC_reviewQuestionsFieldsetAR['fs_review']['fields'] = array_values(array_diff($OC_reviewQuestionsFieldsetAR['fs_review']['fields'], array($hr_f)));
}
}
}
} // if ! custom form
// Fill in session topics
if (isset($OC_reviewQuestionsAR['sessions'])) {
$tq = "SELECT * FROM `" . OCC_TABLE_TOPIC . "`";
$tr = ocsql_query($tq) or err("Unable to retrieve topics");
while ($tt = ocsql_fetch_assoc($tr)) {
$OC_reviewQuestionsAR['sessions']['values'][$tt['topicid']] = $tt['topicname'];
}
}
if (oc_hookSet('committee-review-inc')) {
foreach ($GLOBALS['OC_hooksAR']['committee-review-inc'] as $v) {
require_once $v;
}
}
// Make updates if not customforms edit
if (! isset($mod_oc_customforms_edit) || ! $mod_oc_customforms_edit) {
// Update valuetypes
foreach ($OC_reviewQuestionsAR as $sfk => $sf) {
if (isset($sf['valuetype']) && !empty($sf['valuetype']) && ($sf['valuetype'] != 'custom')) {
switch($sf['valuetype']) {
case 'country':
require_once OCC_COUNTRY_FILE;
$OC_reviewQuestionsAR[$sfk]['values'] = $GLOBALS['OC_countryAR'];
break;
case 'topic':
$OC_reviewQuestionsAR[$sfk]['values'] = $topicAR;
break;
default: // lib file
require_once OCC_LIB_DIR . $sf['valuetype'] . '.inc';
$OC_reviewQuestionsAR[$sfk]['values'] = $GLOBALS['OC_' . $sf['valuetype'] . 'AR'];
break;
}
}
}
// Update Topics to radio if required and max selections = 1
if (isset($OC_reviewQuestionsAR['sessions']['required']) && $OC_reviewQuestionsAR['sessions']['required'] && isset($OC_reviewQuestionsAR['sessions']['maxselections']) && ($OC_reviewQuestionsAR['sessions']['maxselections'] == 1) && ($OC_reviewQuestionsAR['sessions']['type'] == 'checkbox')){
$OC_reviewQuestionsAR['sessions']['type'] = 'radio';
}
}
+336
View File
@@ -0,0 +1,336 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
beginSession();
printHeader(oc_('Review'), 2);
if ( ! $OC_statusAR['OC_rev_signin_open'] || ! $OC_statusAR['OC_reviewing_open']) {
warn(oc_('This feature is currently disabled'));
}
$showEmailCopy = 2; // 0 = do not display; 1 = display unchecked; 2 = display checked
$showCompletedReview = 1; // 0 = do not display; 1 = display unchecked; 2 = display checked
$useFieldValueForScore = false; // index (1-#) is used by default; setting to true allows values of 0+ (must be integers)
function saveReviewForm($review, $thepid) {
global $OC_reviewQuestionsAR;
// Check for valid submission
if (!validToken('ac')) {
$w = sprintf(oc_('This submission failed our security check, possibly due to you have signed in again, or a third-party having redirected you here. Below is the information provided. If you were attempting to submit a review, print this information out or copy/paste it to a new document so it can be re-entered; then <a href="%s">try again</a>. If the problem persists, please contact the Chair.'), ($_SERVER['PHP_SELF'] . '?pid=' . (is_numeric($_POST['pid']) ? $_POST['pid'] : ''))) . '<div style="color: #000; margin-top: 1em; font-weight: normal;">';
$OC_reviewQuestionsARkeys = array_keys($OC_reviewQuestionsAR);
foreach ($_POST as $k => $v) {
if (($k == 'submit') || ($k == 'token')) { continue; }
if (in_array($k, $OC_reviewQuestionsARkeys)) {
$w .= "<br />\n<hr /><br />\n<strong>" . safeHTMLstr($OC_reviewQuestionsAR[$k]['short']) . "</strong> ";
if ($OC_reviewQuestionsAR[$k]['usekey']) {
$w .= $OC_reviewQuestionsAR[$k]['values'][$v];
} else {
$w .= safeHTMLstr($v);
}
} else {
$w .= "<br />\n<hr /><br />\n<strong>" . safeHTMLstr($k) . ":</strong> " . safeHTMLstr($v);
}
}
$w .= '<hr /></div>';
warn($w);
}
// Email review copy - do it here in case of errors/problems below
if (isset($_POST['emailcopy']) && ($_POST['emailcopy'] == "1")) {
// ocIgnore included so poEdit picks up (DB) template translation
//T: [:sid:] is the numeric submission ID
$ocIgnoreSubject = oc_('Review of submission [:sid:]');
//T: [:OC_confName:] is the event name; [:sid:] is the numeric submission ID
$ocIgnoreBody = oc_('Following is a copy of your review for submission number [:sid:] submitted to [:OC_confName:]. Note that you will receive this email even if an error occurred during submission.
[:fields:]');
list($mailsubject, $msg) = oc_getTemplate('committee-review');
$fields = oc_genFieldMessage($GLOBALS['OC_reviewQuestionsFieldsetAR'], $GLOBALS['OC_reviewQuestionsAR'], $_POST);
$templateExtraAR = array(
'sid' => $thepid,
'fields' => $fields
);
$mailsubject = oc_replaceVariables($mailsubject, $templateExtraAR);
$msg = oc_replaceVariables($msg, $templateExtraAR);
if (oc_hookSet('committee-review-msg')) {
foreach ($GLOBALS['OC_hooksAR']['committee-review-msg'] as $v) {
require_once $v;
}
}
if (!sendEmail($review['email'], $mailsubject, $msg)) {
print '<p class="err">' . oc_('We were unable to send copy of the review via email') . '</p>';
}
}
// Validate fields
$qfields = array();
$err = '';
foreach ($GLOBALS['OC_reviewQuestionsFieldsetAR'] as $fsid => $fs) {
foreach ($fs['fields'] as $fid) {
if (isset($GLOBALS['OC_reviewQuestionsAR'][$fid])) {
oc_validateField($fid, $GLOBALS['OC_reviewQuestionsAR'], $qfields, $err);
}
}
}
// Check for completion and calculate score
$score = null;
if (isset($_POST['completed']) && ($_POST['completed'] == 1)) {
$completed = 'T';
} else {
$completed = 'F';
}
foreach ($OC_reviewQuestionsAR as $fid => $far) {
if (isset($far['score']) && $far['score'] && isset($_POST[$fid]) && preg_match("/^\d+$/", $_POST[$fid])) {
if (
$useFieldValueForScore
&& isset($far['values'])
&& isset($far['values'][$_POST[$fid]])
&& preg_match("/^[0-9]+$/", $far['values'][$_POST[$fid]])
) {
$scoreValue = $far['values'][$_POST[$fid]];
} else {
$scoreValue = $_POST[$fid];
}
if ($score === null) {
$score = $scoreValue;
} else {
$score += $scoreValue;
}
}
if (($completed == 'T') && isset($far['required']) && $far['required'] && !isset($qfields[$fid])) {
$completed = 'F';
}
}
// Hooks
if (oc_hookSet('committee-review-validate')) {
foreach ($GLOBALS['OC_hooksAR']['committee-review-validate'] as $v) {
require_once $v;
}
}
// Error?
if (!empty($err)) {
print '<div class="warn">' . oc_('Your review has not been saved.') . ' ' . oc_('Please check the following:') . '<ul>' . $err . '</ul></div><hr />';
printReviewForm($_POST, $thepid);
return;
}
// Update sessions
$sfields = array();
if (isset($qfields['sessions'])) {
if ($qfields['sessions'] != 'NULL') {
if (!preg_match("/^'[\d\,]*'$/", $qfields['sessions'])) {
$err .= '<li>' . sprintf(oc_('%s field does not appear to be valid'), oc_('Session(s)')) . '</li>'; // should only trigger if validation above fails
} else {
$sfields = explode(',', trim($qfields['sessions'], "'"));
}
}
unset($qfields['sessions']);
}
// Compose sql and update
$q = "UPDATE `" . OCC_TABLE_PAPERREVIEWER . "` SET `updated`='" . safeSQLstr(date('Y-m-d')) . "', ";
if ($score !== null) {
$q .= "`score`=" . (int) $score . ", ";
}
foreach ($qfields as $qid => $qval) {
$q .= "`" . $qid . "`=" . $qval . ", ";
}
$q .= "`completed`='" . safeSQLstr($completed) . "' WHERE `paperid`='" . safeSQLstr($thepid) . "' AND `reviewerid`='" . safeSQLstr(safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'])) . "'";
ocsql_query($q) or err("Unable to submit review");
// Update papersession
if (isset($OC_reviewQuestionsAR['sessions'])) {
$q2 = "DELETE FROM `" . OCC_TABLE_PAPERSESSION . "` WHERE `paperid`='" . safeSQLstr($thepid) . "' AND `reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
ocsql_query($q2) or err("Unable to update sessions");
if (!empty($sfields) && ($sfields != 'NULL')) {
$q3 = "INSERT INTO `" . OCC_TABLE_PAPERSESSION . "` (`paperid`,`reviewerid`,`topicid`) VALUES";
foreach ($sfields as $s) {
$q3 .= " ('" . safeSQLstr($thepid) . "','" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "','" . safeSQLstr($s) . "'),";
}
ocsql_query(rtrim($q3, ',')) or err(oc_('Unable to add sessions'));
}
}
if (oc_hookSet('committee-review-save')) {
foreach ($GLOBALS['OC_hooksAR']['committee-review-save'] as $v) {
require_once $v;
}
}
print '<p>' . oc_('Review has been submitted.') . '</p>';
if (isset($_POST['completed']) && ($_POST['completed'] == 1) && ($completed == 'F')) {
print '<p class="warn">' . oc_('However as not all required questions were answered, the review was not marked as completed.') . '</p>';
}
print '<p>&#187; <a href="review.php?pid=' . safeHTMLstr($thepid) . '">' . oc_('Return to Review') . '</a></p>';
//T: Member = Committee Member -- see "Member Home" string
print '<p>&#187; <a href="reviewer.php">' . oc_('Return to Member home page') . '</a></p>';
}// function saveReviewForm
function printReviewForm($review, $thepid) {
global $OC_configAR, $OC_reviewQuestionsAR;
print '<p style="text-align: center"><span style="font-size: 1.05em; font-weight: bold; font-style: italic;">' . safeHTMLstr($review['title']) . '</span>';
if (isset($review['type']) && !empty($review['type'])) {
print '<br />(' . safeHTMLstr($review['type']) . ')';
}
print '<br />' . oc_('Submission ID') . ': ' . safeHTMLstr($thepid);
if (isset($OC_configAR['OC_reviewerSeeAdvocate']) && $OC_configAR['OC_reviewerSeeAdvocate'] && isset($review['advocate_name']) && !empty($review['advocate_name'])) {
print '<br />' . oc_('Advocate') . ': <a href="mailto:' . safeHTMLstr($review['advocate_email']) . '">' . safeHTMLstr($review['advocate_name']) . '</a>';
}
print '</p>';
$tip = '<hr /><span style="color: #060; font-style: italic">' . oc_("TIP: Use a local text editor to write your review, and then select/copy the information below. This way, in case of a network outage, you won't lose the review.") . '</span><hr /><br />';
print '
<form method="POST" action="' . $_SERVER['PHP_SELF'] . '" class="ocform ocreviewform">
<input type="hidden" name="token" value="' . $_SESSION[OCC_SESSION_VAR_NAME]['actoken'] . '" />
<input type="hidden" name="pid" value="' . safeHTMLstr($thepid) . '">
<input type="hidden" name="title" value="' . safeHTMLstr($review['title']) . '">
<input type="hidden" name="format" value="' . safeHTMLstr($review['format']) . '">
<input type="hidden" name="type" value="' . safeHTMLstr($review['type']) . '">
<input type="hidden" name="ocaction" value="Submit Review" />
';
if (oc_hookSet('committee-review-fields')) {
foreach ($GLOBALS['OC_hooksAR']['committee-review-fields'] as $v) {
require_once $v;
}
}
print $tip;
oc_displayFieldSet($GLOBALS['OC_reviewQuestionsFieldsetAR'], $GLOBALS['OC_reviewQuestionsAR'], $review);
if (oc_hookSet('committee-review-extra')) {
foreach ($GLOBALS['OC_hooksAR']['committee-review-extra'] as $v) {
require_once $v;
}
}
if ($GLOBALS['showEmailCopy']) {
print '<dl><dt><label><input type="checkbox" name="emailcopy" value="1" ' . (($GLOBALS['showEmailCopy'] === 1) ? '' : 'checked') . ' /> ' . oc_('Email me a copy of this review') . '</label></dt><dd><span class="note">' . oc_('Useful for your own record or in case there is some kind of error during updating.') . ' ';
if ($OC_configAR['OC_ReviewerTimeout'] > 0) {
print oc_('Note that if your session times out, you may not receive an email; you should log back in right away to recover the review.');
}
print "</span></dd></dl>\n";
}
if ($GLOBALS['showCompletedReview']) {
print '<dl><dt><label><input type="checkbox" name="completed" value="1"';
if ((varValue('completed', $review) == "T") || ($GLOBALS['showCompletedReview'] === 2)) { print ' checked'; }
print '> ' . oc_('I have completed the review') . '</label></dt><dd><span class="note">' . oc_('Check this box when you have finished the review for this submission. This is used only to track how many outstanding reviews there are. You will still be able to edit this review after checking this box, until the review deadline date.') . "</span></dd></dl>\n";
}
print "<br />\n";
if ($thepid != "blank") {
print '<p><input type="submit" name="submit" class="submit" value="' . oc_('Submit Review') . '"></p>';
}
else {
print '<p>[ ' . oc_('Sample Review Form - Fill in and submit review by clicking the submission title on main reviewer page') . ' ]</p>';
}
if ($OC_configAR['OC_ReviewerTimeout'] > 0) {
print '<p class="note">' . oc_('Should your session timeout while filling out this review, log back in right away as we may be able to recover your review.') . '</p>';
}
} // function printReviewForm
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Submit Review")) {
if (!isset($_POST['pid']) || !preg_match("/^\d+$/", $_POST['pid'])) {
warn('Invalid submission ID');
}
$q = "SELECT `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`, `" . OCC_TABLE_REVIEWER . "`.`email` FROM `" . OCC_TABLE_PAPERREVIEWER . "`, `" . OCC_TABLE_REVIEWER . "` WHERE `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`='" . safeSQLstr($_POST['pid']) . "' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid`=`" . OCC_TABLE_REVIEWER . "`.`reviewerid`";
$thepid = $_POST['pid'];
} else {
if (!isset($_GET['pid']) || (($_GET['pid'] != 'blank') && !preg_match("/^\d+$/", $_GET['pid']))) {
warn(oc_('Submission ID is invalid'));
}
$q = "SELECT `title`, `format`, `type`, `" . OCC_TABLE_PAPERREVIEWER . "`.* FROM `" . OCC_TABLE_PAPERREVIEWER . "`, `" . OCC_TABLE_PAPER . "` WHERE `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`='" . safeSQLstr($_GET['pid']) . "' AND `reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid`";
$thepid = $_GET['pid'];
}
require_once OCC_FORM_INC_FILE;
require_once OCC_REVIEW_INC_FILE;
if ($thepid == "blank") { // display blank form
$review = array();
$review['title'] = oc_('Sample Review');
$review['format'] = "";
$review['type'] = "";
printReviewForm($review, 0);
} elseif (!preg_match("/^\d+$/", $thepid)) {
print '<span class="err">' . oc_('Submission ID is invalid') . '</span><p>';
} else {
$r = ocsql_query($q) or err("Unable to retrieve submission for review");
if (ocsql_num_rows($r) == 0) {
//T: Use care with href - "mailto" and "subject" should not be translated
print '<span class="err">' . sprintf(oc_('Either the submission does not exist, or you have not been assigned it for review. If this is in error, please contact the <a href="mailto:%s?subject=Review error">Chair</a>.'), $OC_configAR['OC_pcemail']) . '</span><p>';
} else {
$review = ocsql_fetch_array($r);
// remove fields with matching hidesubtypes
$subtype = varValue('type', $_POST, varValue('type', $review));
if (!empty($subtype)) {
foreach ($OC_reviewQuestionsAR as $fid => $far) {
if (isset($far['hidesubtypes']) && is_array($far['hidesubtypes']) && in_array($subtype, $far['hidesubtypes'])) {
unset($OC_reviewQuestionsAR[$fid]);
}
}
}
// process action
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Submit Review")) {
saveReviewForm($review, $thepid); // save form
} else {
// Add sessions to review array
$sq = "SELECT `topicid` FROM `" . OCC_TABLE_PAPERSESSION . "` WHERE `paperid`='" . safeSQLstr($thepid) . "' AND `reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$sr = ocsql_query($sq);
$review['sessions'] = array();
while ($sl = ocsql_fetch_array($sr)) {
$review['sessions'][] = $sl['topicid'];
}
if ( isset($OC_reviewQuestionsAR['sessions']['type']) && ($OC_reviewQuestionsAR['sessions']['type'] == 'radio') && isset($review['sessions'][0]) ) {
$review['sessions'] = $review['sessions'][0];
}
// Add advocate to review array
if (isset($OC_configAR['OC_reviewerSeeAdvocate']) && $OC_configAR['OC_reviewerSeeAdvocate']) {
$aq = "SELECT CONCAT_WS(' ', `name_first`, `name_last`) AS `name`, `email` FROM `" . OCC_TABLE_REVIEWER . "`, `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `" . OCC_TABLE_PAPERADVOCATE . "`.`paperid`='" . safeSQLstr($thepid) . "' AND `" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid`=`" . OCC_TABLE_REVIEWER . "`.`reviewerid`";
$ar = ocsql_query($aq) or err('Unable to retrieve advocate');
if (ocsql_num_rows($ar) == 1) {
$al = ocsql_fetch_assoc($ar);
$review['advocate_name'] = $al['name'];
$review['advocate_email'] = $al['email'];
}
}
// print form
printReviewForm($review, $thepid);
}
}
}
printFooter();
?>
+252
View File
@@ -0,0 +1,252 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
require_once OCC_REVIEW_INC_FILE;
//T: File = table header used for file column
$fileTableHeader = '<th scope="col">' . oc_('File') . '</th>'; // table header used for file column
$formatField = '`format`'; // paper table format field
$extraCols = 0; // extra columns to skip when displaying ZIP download icons (e.g., abstract, type)
$abstractCol = 'Abstract'; // name for abstract column -- set to empty to not display
$advocateOrder = '!ISNULL(`adv_recommendation`), `paperid`'; // Submission to Advocate ORDER BY fields
$showReviewScore = false; // EXPERIMENTAL. Displays review score in Submissions to Review table
beginSession();
printHeader(oc_('Committee Member'), 2);
print "<dl>\n";
$conflictAR = getConflicts($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']);
if (oc_hookSet('committee-menu-preprocess')) {
foreach ($OC_hooksAR['committee-menu-preprocess'] as $v) {
require_once $v;
}
}
if (!empty($abstractCol)) { $extraCols++; } // it's here so it's checked after the hook
// Track Type?
$OC_trackType = false;
$sr = ocsql_query("SELECT COUNT(*) AS `count` FROM `" . OCC_TABLE_PAPER . "` WHERE `type`!='' AND `type` IS NOT NULL") or err('Unable to check type field');
if (($sl = ocsql_fetch_assoc($sr)) && ($sl['count'] > 0)) {
$OC_trackType = true;
$extraCols++;
}
// Can reviewers still sign-in?
if ($OC_statusAR['OC_rev_signin_open']) {
$extraFields = '';
print '<dt id="ocrevviewsubs">&#8226; <strong><a href="list_papers.php">' . safeHTMLstr(oc_('View Submissions')) . '</a></strong><br /><br /></dt>';
if (oc_hookSet('committee-menu-prereview')) {
foreach ($OC_hooksAR['committee-menu-prereview'] as $v) {
print '<dt>&#8226; ' . $v . '<br /><br /></dt>';
}
}
if (oc_hookSet('committee-menu-pc-prereview') && ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") && $OC_statusAR['OC_pc_signin_open']) {
foreach ($OC_hooksAR['committee-menu-pc-prereview'] as $v) {
print '<dt>&#8226; ' . $v . '<br /><br /></dt>';
}
}
// Is reviewing open?
if ($OC_statusAR['OC_reviewing_open']) {
print '
<dt style="margin-top: 1.5em; font-size: 1.3em; font-weight: bold;">' . safeHTMLstr(oc_('Submissions to Review:')) . '</dt>
<dd><br />
';
// delete assignments?
if (($OC_configAR['OC_reviewerUnassignReviews'] == 1)
&& isset($_POST['ocaction']) && ($_POST['ocaction'] == 'Delete Review Assignments')
&& isset($_POST['submissions']) && is_array($_POST['submissions']) && (count($_POST['submissions'] > 0))
) {
// Check for valid submission
if (!validToken('ac')) {
warn(oc_('Invalid submission'));
}
// iterate through subs
foreach ($_POST['submissions'] as $sid) {
if (!preg_match("/^[1-9]\d*$/", $sid)) {
warn(oc_('Invalid request'));
}
// verify assignment
if (($unassign_r1 = ocsql_query("SELECT `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid` AS `sid`, `" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid`, `" . OCC_TABLE_PAPER . "`.`title`, `" . OCC_TABLE_REVIEWER . "`.`username`, CONCAT_WS(' ', `" . OCC_TABLE_REVIEWER . "`.`name_first`, `" . OCC_TABLE_REVIEWER . "`.`name_last`) AS `name` FROM `" . OCC_TABLE_REVIEWER . "`, `" . OCC_TABLE_PAPERREVIEWER . "`, `" . OCC_TABLE_PAPER . "` WHERE `" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`='" . safeSQLstr($sid) . "' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` AND `" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid`=`" . OCC_TABLE_REVIEWER . "`.`reviewerid`"))
&& (ocsql_num_rows($unassign_r1) == 1)
&& ($unassign_l1 = ocsql_fetch_assoc($unassign_r1))
) {
$mailto = '';
// retrieve advocate email for notification
if (
($unassign_r2 = ocsql_query("SELECT `" . OCC_TABLE_REVIEWER . "`.`email` FROM `" . OCC_TABLE_REVIEWER . "`, `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `" . OCC_TABLE_PAPERADVOCATE . "`.`paperid`='" . safeSQLstr($sid) . "' AND `" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid`=`" . OCC_TABLE_REVIEWER . "`.`reviewerid`"))
&& (ocsql_num_rows($unassign_r2) == 1)
&& ($unassign_l2 = ocsql_fetch_assoc($unassign_r2))
) {
$mailto = $unassign_l2['email'];
}
// delete assignment
oc_deleteAssignments($sid, $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'], 'reviewer', 'reviewer');
// notify
list($mailsubject, $mailbody) = oc_getTemplate('committee-reviewunassign');
$mailsubject = oc_replaceVariables($mailsubject, $unassign_l1);
$mailbody = oc_replaceVariables($mailbody, $unassign_l1);
sendEmail($mailto, $mailsubject, $mailbody, 1);
}
}
}
// show reviews
$q = "SELECT `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`, `" . OCC_TABLE_PAPERREVIEWER . "`.`score`, " . $formatField . ", `title`, `type`, `completed`" . $extraFields . " FROM `" . OCC_TABLE_PAPERREVIEWER . "`, `" . OCC_TABLE_PAPER . "` WHERE `reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` ORDER BY CAST(`completed` AS CHAR), `paperid`";
$r = ocsql_query($q) or err("Unable to retrieve submissions for review");
if (ocsql_num_rows($r) == 0) {
print '<span class="warn">' . safeHTMLstr(oc_('You do not have any submissions to review.')) . '</span><p>';
} else {
print '<p>' . sprintf(oc_('A <a href="%s" target="_blank">blank review form</a> (that opens in a separate window) is available for you to print out if you prefer writing it out before typing it in.'), 'review.php?pid=blank') . '</p>';
print '<table border="0" cellspacing="0" cellpadding="0"><tr><td><em>' . safeHTMLstr(oc_('Legend:')) . '</em> &nbsp; </td><td bgcolor="#afa"> &nbsp;o&nbsp; </td><td> &nbsp; <em>' . safeHTMLstr(oc_('Review completed')) . ($showReviewScore ? (' (' . oc_('Score') . ')') : '') . '</em> &nbsp; &nbsp; </td><td bgcolor="#fcc"> &nbsp;x&nbsp; </td><td> &nbsp; <em>' . safeHTMLstr(oc_('Review not yet completed')) . '</em></td></tr></table><br /><br />';
if ($OC_configAR['OC_reviewerUnassignReviews'] == 1) {
print '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="token" value="' . safeHTMLstr($_SESSION[OCC_SESSION_VAR_NAME]['actoken']) . '" /><input type="hidden" name="ocaction" value="Delete Review Assignments" />';
}
print '<table border="0" cellspacing="1" cellpadding="3" style="margin-bottom: 5px;"><tr class="rowheader">';
if ($OC_configAR['OC_reviewerUnassignReviews'] == 1) {
print '<th style="background-color: #ccf;" title="check boxes and click Delete button below to unassign reviews" scope="col">*</th>';
$extraCols++; // do it here so it doesn't impact advocate table
}
print '<th title="' . safeHTMLstr(oc_('Status')) . ' / ' . safeHTMLstr(oc_('Score')) . '" scope="col">&nbsp;</th><th scope="col">' . safeHTMLstr(oc_('Title - click for review form')) . '</th>' . (!empty($abstractCol) ? ('<th scope="col">' . safeHTMLstr(oc_($abstractCol)) . '</th>') : '');
if ($OC_trackType) {
//T: Type = Submission Type (e.g., paper, poster)
print '<th scope="col">' . safeHTMLstr(oc_('Type')) . '</th>';
}
print $fileTableHeader . '</tr>';
$row = 1;
$OC_downloadZipAR = array();
while ($p = ocsql_fetch_array($r)) {
if ($p['completed'] == "T") {
$bgcolor = '#afa';
$symbol = (($showReviewScore && preg_match("/^\d+$/", $p['score'])) ? $p['score'] : 'o');
}
else {
$bgcolor = '#fcc';
$symbol = 'x';
}
print '<tr class="row' . $row . '">';
if ($OC_configAR['OC_reviewerUnassignReviews']) {
print '<td style="text-align: center; background-color: #ccf;"><input type="checkbox" name="submissions[]" value="' . safeHTMLstr($p['paperid']) . '" title="' . safeHTMLstr($p['paperid']) . '" /></td>';
}
print '<td valign="top" style="background-color:' . $bgcolor . '; color:#555; text-align: center;">&nbsp;' . $symbol . '&nbsp;</td><td valign="top" scope="row"><a href="review.php?pid=' . $p['paperid'] . '" alt="' . safeHTMLstr(sprintf(oc_('review form for submission ID %d'), $p['paperid'])) . '">' . $p['paperid'] . ' - ' . safeHTMLstr($p['title']) . '</a></td>';
if (!empty($abstractCol)) {
print '<td align="center"><a href="show_abstract.php?pid=' . safeHTMLstr($p['paperid']) . '"><img src="../images/document-sm.gif" border="0" alt="' . safeHTMLstr(oc_('view abstract')) . '" title="' . safeHTMLstr(oc_('view abstract')) . '" width="13" height="16" /></a></td>';
}
if ($OC_trackType) {
print '<td>' . varValue('type', $p, '&nbsp;', true) . '</td>';
}
print oc_printFileCells($p) . "</tr>\n";
$row = $rowAR[$row];
}
if (class_exists('ZipArchive')) {
if (oc_hookSet('print_file_cells_zip')) {
$str = call_user_func($GLOBALS['OC_hooksAR']['print_file_cells_zip'][0], $row, ($extraCols + 2)); // only one hook allowed here
print $str;
} elseif (isset($OC_downloadZipAR[1]) && ($OC_downloadZipAR[1] > 1)) {
print '<tr><td colspan="' . ($extraCols + 2) . '">&nbsp;</td><td class="row' . $row . '" style="text-align: center; font-size: 0.8em;"><a href="download.php?t=1&s=' . urlencode($OC_downloadZipAR[1]['size']) . '"><img src="../images/documentmulti-sm.gif" border="0" alt="' . safeHTMLstr(oc_('Download All')) . '" title="' . safeHTMLstr(oc_('Download All')) . '" width="17" height="20" /><br />ZIP</a></td></tr>';
}
}
print "</table>\n";
if ($OC_configAR['OC_reviewerUnassignReviews']) {
print '<div><span style="background-color: #ccf; padding: 8px 5px;"><span style="font-weight:bold;" title="check boxes above then click Delete button">*</span> <input type="submit" name="submit" value="' . safeHTMLstr(oc_('Delete Review Assignments')) . '" onclick="return confirm(\'' . safeHTMLstr(oc_('Delete review data and unassign review(s)?')) . '\');" /></span></div></form>';
$extraCols--; // undo it here so it doesn't impact advocate table
}
}
print '</dd>';
}
}
if (($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") && $OC_statusAR['OC_pc_signin_open']) {
$extraFields = '';
$extraGroupByFields = '';
if (! $OC_statusAR['OC_rev_signin_open']) {
print '<dt id="ocrevviewsubs">&#8226; <strong><a href="list_papers.php">' . safeHTMLstr(oc_('View Submissions')) . '</a></strong><br /><br /></dt>';
if (oc_hookSet('committee-menu-prereview')) {
foreach ($OC_hooksAR['committee-menu-prereview'] as $v) {
print '<dt>&#8226; ' . $v . '<br /><br /></dt>';
}
}
if (oc_hookSet('committee-menu-pc-prereview') && ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") && $OC_statusAR['OC_pc_signin_open']) {
foreach ($OC_hooksAR['committee-menu-pc-prereview'] as $v) {
print '<dt>&#8226; ' . $v . '<br /><br /></dt>';
}
}
}
if ($OC_configAR['OC_paperAdvocates'] && $OC_statusAR['OC_advocating_open']) {
print '
<dt style="margin-top: 1.5em; font-size: 1.3em; font-weight: bold;">' . safeHTMLstr(oc_('Submissions to Advocate:')) . '</dt>
<dd><br />
';
$q = "SELECT `" . OCC_TABLE_PAPERADVOCATE . "`.`paperid`, `" . OCC_TABLE_PAPERADVOCATE . "`.`adv_recommendation`, " . $formatField . ", `title`, `type`, AVG(`score`) AS `paperavg`" . $extraFields . " FROM (`" . OCC_TABLE_PAPERADVOCATE . "`, `" . OCC_TABLE_PAPER . "`) LEFT JOIN `" . OCC_TABLE_PAPERREVIEWER . "` ON `" . OCC_TABLE_PAPERADVOCATE . "`.`paperid`=`" . OCC_TABLE_PAPERREVIEWER . "`.`paperid` WHERE `" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "' AND `" . OCC_TABLE_PAPERADVOCATE . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` GROUP BY `paperid`, `adv_recommendation`, " . $formatField . ", `title`, `type`" . $extraGroupByFields . " ORDER BY " . $advocateOrder;
$r = ocsql_query($q) or err("Unable to retrieve submissions for advocating");
if (ocsql_num_rows($r) == 0) {
print '<span class="warn">' . safeHTMLstr(oc_('You do not have any submissions to advocate.')) . '</span><p>';
} else {
//T: Recom. = Recommendation (e.g., Accept, Reject) [abbreviate if possible]; Score = Average reviews score
print '<table border="0" cellspacing="1" cellpadding="3"><tr class="rowheader"><th scope="col" title="Recommendation">' . safeHTMLstr(oc_('Recom.')) . '</th><th scope="col">' . safeHTMLstr(oc_('Score')) . '</th><th scope="col">' . safeHTMLstr(oc_('Title - click for recommendation form')) . '</th>' . (!empty($abstractCol) ? ('<th scope="col">' . safeHTMLstr(oc_($abstractCol)) . '</th>') : '');
if ($OC_trackType) {
//T: Type = Submission Type (e.g., paper, poster)
print '<th scope="col">' . safeHTMLstr(oc_('Type')) . '</th>';
}
print $fileTableHeader . '</tr>';
$row = 1;
$OC_downloadZipAR = array();
while ($p = ocsql_fetch_array($r)) {
if ($p['paperavg'] != '') {
$usescore = number_format($p['paperavg'], 2);
} else {
$usescore = '&#8211;';
}
print '<tr class="row' . $row . '"><td valign="top" align="center" style="color: #555; ' . (!empty($p['adv_recommendation']) ? ('background-color: #' . $OC_acceptanceColorAR[$p['adv_recommendation']]) : '') . '">'. safeHTMLstr($p['adv_recommendation']) . '</td><td valign="top" align="center">' . $usescore . '</td><td valign="top" scope="row"><a href="advocate.php?pid='.$p['paperid'].'" title="' . safeHTMLstr(sprintf(oc_('see reviews and make recommendation for submission ID %d'), $p['paperid'])) . '">' . $p['paperid'] . ' - ' . safeHTMLstr($p['title']) . '</a></td>';
if (!empty($abstractCol)) {
print ' <td align="center"><a href="show_abstract.php?pid=' . $p['paperid'] . '"><img src="../images/document-sm.gif" border="0" alt="' . safeHTMLstr(oc_('view abstract')) . '" title="' . safeHTMLstr(oc_('view abstract')) . '" width="13" height="16" /></a></td>';
}
if ($OC_trackType) {
print '<td>' . varValue('type', $p, '&nbsp;', true) . '</td>';
}
print oc_printFileCells($p) . "</tr>\n";
$row = $rowAR[$row];
}
if (class_exists('ZipArchive')) {
if (oc_hookSet('print_file_cells_zip')) {
$str = call_user_func($GLOBALS['OC_hooksAR']['print_file_cells_zip'][0], $row, ($extraCols + 3), 1); // only one hook allowed here
print $str;
} elseif (isset($OC_downloadZipAR[1]) && ($OC_downloadZipAR[1]['count'] > 1)) {
print '<tr><td colspan="' . ($extraCols + 3) . '">&nbsp;</td><td class="row' . $row . '" style="text-align: center; font-size: 0.8em;"><a href="download.php?t=1&pc=1&s=' . urlencode($OC_downloadZipAR[1]['size']) . '"><img src="../images/documentmulti-sm.gif" border="0" alt="' . safeHTMLstr(oc_('Download All')) . '" title="' . safeHTMLstr(oc_('Download All')) . '" width="17" height="20" /><br />ZIP</a></td></tr>';
}
}
print "</table>\n";
}
print '</dd>';
}
}
print "</dl>\n";
if (!empty($OC_configAR['OC_committeeFooter'])) {
print '<div style="margin-top: 2em; padding-top: 1em; border-top: 2px solid #666;">' . (preg_match("/\<(?:p|br) ?\/?\>/", $OC_configAR['OC_committeeFooter']) ? oc_($OC_configAR['OC_committeeFooter']) : nl2br(oc_($OC_configAR['OC_committeeFooter']))) . '</div>';
}
printFooter();
?>
+125
View File
@@ -0,0 +1,125 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
beginSession();
printHeader(oc_('Submission Information'), 2);
if (!preg_match("/^\d+$/",$_REQUEST['pid'])) {
warn(oc_('Submission ID is invalid'));
}
$pid = $_REQUEST['pid'];
$showReferenceSites = $OC_configAR['OC_includeReferenceSearchLinks'];
// Check for conflict
$conflictAR = getConflicts($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']);
if (oc_inConflict($conflictAR, $pid, $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'])) {
warn(oc_('You appear to have a conflict with this submission'));
}
$ok = 0;
$blind = true;
// Check that reviewer has permission
if ($OC_configAR['OC_reviewerReadPapers']) {
$ok = 1;
} else { // make sure reviewer is assigned
$q = "SELECT `paperid` FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `paperid`=" . (int) $pid . " AND `reviewerid`=" . (int) $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'];
$r = ocsql_query($q) or err("Unable to check reviewer permissions");
if (ocsql_num_rows($r) == 1) {
$ok = 1;
}
}
if ($OC_configAR['OC_reviewerSeeAuthors']) {
$blind = false;
}
// If not ok, check if advocate & has permission
if ($_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") {
if ( ! $ok ) {
if ($OC_configAR['OC_advocateReadPapers']) {
$ok = 1;
} else { // make sure advocate is assigned
$q = "SELECT `paperid` FROM `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `paperid`=" . (int) $pid . " AND `advocateid`=" . (int) $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'];
$r = ocsql_query($q) or err("Unable to check advocate permissions");
if (ocsql_num_rows($r) == 1) {
$ok = 1;
}
}
}
if ( $blind && $OC_configAR['OC_advocateSeeAuthors'] ) {
$blind = false;
}
}
// If still not ok, show error
if (!$ok) {
warn(oc_('You do not have permission to retrieve this submission'));
}
require_once OCC_FORM_INC_FILE;
require_once OCC_SUBMISSION_INC_FILE;
if (oc_hookSet('committee-show-abstract-preprocess')) {
foreach ($GLOBALS['OC_hooksAR']['committee-show-abstract-preprocess'] as $v) {
require_once $v;
}
}
// Get sub fields
$q = "SELECT * FROM `" . OCC_TABLE_PAPER . "` WHERE paperid='" . $pid . "'";
$r = ocsql_query($q) or err("Unable to retrieve abstract");
if (ocsql_num_rows($r) != 1) {
warn(sprintf(oc_('Submission ID %d was not found'), $pid));
}
$spl = ocsql_fetch_array($r);
// Get authors
$oc_authorNum = 0;
$qa = "SELECT *, CONCAT_WS(' ', `name_first`, `name_last`) AS `name` FROM `" . OCC_TABLE_AUTHOR . "` WHERE `paperid`='" . safeSQLstr($pid) . "'";
$ra = ocsql_query($qa) or err("Unable to get " . oc_strtolower(OCC_WORD_AUTHOR) . "s ");
while ($a = ocsql_fetch_array($ra)) {
$apos = $a['position'];
foreach ($a as $akey => $aval) {
if (preg_match("/^(?:paperid|position)$/", $akey)) { continue; }
$spl[$akey . $apos] = $aval;
}
}
$oc_authorNum = $apos;
// Get topics
$qt = "SELECT `topicid` FROM `" . OCC_TABLE_PAPERTOPIC . "` WHERE `paperid`='" . safeSQLstr($pid) . "'";
$rt = ocsql_query($qt) or err("Unable to get topics ");
$spl['topics'] = array();
while ($t = ocsql_fetch_array($rt)) {
$spl['topics'][] = $t['topicid'];
}
// Display fields
print '
<table class="ocfields">
<tr><th>' . oc_('Submission ID') . ':</th><td>' . safeHTMLstr($pid) . '</td></tr>
';
oc_showFieldSet($OC_submissionFieldSetAR, $OC_submissionFieldAR, $spl, $blind, true, $showReferenceSites);
print '</table>';
if (oc_hookSet('committee-show-abstract')) {
foreach ($GLOBALS['OC_hooksAR']['committee-show-abstract'] as $v) {
require_once $v;
}
}
printFooter();
?>
+91
View File
@@ -0,0 +1,91 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
require_once OCC_REVIEW_INC_FILE;
beginSession();
printHeader(oc_('Reviews'), 2);
if (!isset($_GET['pid']) || !preg_match("/^\d+$/",$_GET['pid'])) {
warn(oc_('Submission ID is invalid'));
}
// Warn if conflict
$conflictAR = getConflicts($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']);
if (oc_inConflict($conflictAR, $_GET['pid'], $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'])) {
warn(oc_('You appear to have a conflict with this submission'));
}
// Check whether review assigned/completed?
$assigned = 0;
$completed = 0;
$q = "SELECT `paperid`, `score`, `completed` FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `paperid`='" . safeSQLstr($_GET['pid']) . "' AND `reviewerid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$r = ocsql_query($q) or err("Unable to check reviewer permissions");
if (ocsql_num_rows($r) == 1) {
$assigned = 1;
$l = ocsql_fetch_array($r);
if ($l['score'] && ($l['completed'] == 'T')) { $completed = 1; }
}
$ok = 0;
// Check that reviewer has permission
if (!$assigned && $OC_configAR['OC_reviewerSeeOtherReviews'] && $OC_configAR['OC_reviewerReadPapers']) {
$ok = 1;
} elseif ($assigned && $OC_configAR['OC_reviewerSeeAssignedReviews']) { // make sure reviewer is assigned
if (!$OC_configAR['OC_reviewerCompleteBeforeSAR'] || $completed) { // and doesn't hinge on completed review
$ok = 1;
}
}
// If not ok, check if advocate & has permission
if (!$ok && $_SESSION[OCC_SESSION_VAR_NAME]['acpc'] == "T") {
if ($OC_configAR['OC_advocateSeeOtherReviews'] && $OC_configAR['OC_advocateReadPapers']) {
$ok = 1;
} else { // make sure advocate is assigned
$q = "SELECT `paperid` FROM `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `paperid`='" . safeSQLstr($_GET['pid']) . "' AND `advocateid`='" . safeSQLstr($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) . "'";
$r = ocsql_query($q) or err("Unable to check advocate permissions");
if (ocsql_num_rows($r) == 1) {
$ok = 1;
}
}
}
if (!$ok) {
warn(oc_('You do not have permission to see the reviews for this submission'));
}
// Get/display sub info
$sr = ocsql_query("SELECT `title`, `type` FROM `" . OCC_TABLE_PAPER . "` WHERE `paperid`='" . safeSQLstr($_GET['pid']) . "'") or err('Unable to retrieve submission type');
$sl = ocsql_fetch_assoc($sr);
print '<p style="text-align: center"><span style="font-size: 1.05em; font-weight: bold; font-style: italic;">' . safeHTMLstr($sl['title']) . '</span><br />' . sprintf(oc_('Submission ID %s'), safeHTMLstr($_GET['pid']));
if (!empty($sl['type'])) {
$subtype = $sl['type'];
print '<br />(' . safeHTMLstr($subtype) . ')';
} else {
$subtype = '';
}
print '</p>';
if ($OC_configAR['OC_reviewerSeeOtherReviewers'] && $assigned && ($emailList = getPaperReviewersEmail($_GET['pid']))) {
print '<p style="text-align: center"><a href="mailto:' . $emailList . '">' . oc_('Email Reviewers') . '</a></p>';
}
// Display reviews
$q = "SELECT `" . OCC_TABLE_PAPERREVIEWER . "`.*, CONCAT_WS(' ',`" . OCC_TABLE_REVIEWER . "`.`name_first`,`" . OCC_TABLE_REVIEWER . "`.`name_last`) as `name` FROM `" . OCC_TABLE_PAPERREVIEWER . "`, `" . OCC_TABLE_REVIEWER . "` WHERE `" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`='" . safeSQLstr($_GET['pid']) . "' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid`=`" . OCC_TABLE_REVIEWER . "`.`reviewerid`";
$r = ocsql_query($q) or err("Unable to get information");
if (ocsql_num_rows($r) == 0) {
warn(oc_('No reviews found'));
}
displayReviews($_GET['pid'], $r, $subtype);
printFooter();
?>
+162
View File
@@ -0,0 +1,162 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
function oc_committeeSignIn(&$p, &$lowusername) {
// If session timed out, is it same reviewer coming back?
if (isset($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']) && ($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'] == $p['reviewerid'])) {
$sameid = true;
} else {
$sameid = false;
}
// Set session vars
$_SESSION[OCC_SESSION_VAR_NAME]['acusername'] = $lowusername;
$_SESSION[OCC_SESSION_VAR_NAME]['name'] = $p['name_first'] . ' ' . $p['name_last'];
$_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'] = $p['reviewerid'];
$_SESSION[OCC_SESSION_VAR_NAME]['aclast'] = time();
$_SESSION[OCC_SESSION_VAR_NAME]['acpc'] = $p['onprogramcommittee'];
$_SESSION[OCC_SESSION_VAR_NAME]['actoken'] = oc_idGen();
// Update lastsignin date in DB
ocsql_query("UPDATE `" . OCC_TABLE_REVIEWER . "` SET `lastsignin`='" . safeSQLstr(date('Y-m-d')) . "' WHERE `reviewerid`='" . safeSQLstr($p['reviewerid']) . "' LIMIT 1");
// Route user to recover submission if timed out or onwards to main page
if ($sameid && isset($_SESSION[OCC_SESSION_VAR_NAME]['POST']['submit'])) {
$_SESSION[OCC_SESSION_VAR_NAME]['POST']['token'] = $_SESSION[OCC_SESSION_VAR_NAME]['actoken']; // reset token
session_write_close();
header('Location: recover.php?' . strip_tags(SID));
} else {
// Remove POST if set
if (isset($_SESSION[OCC_SESSION_VAR_NAME]['POST'])) {
unset($_SESSION[OCC_SESSION_VAR_NAME]['POST']);
}
session_write_close();
header('Location: reviewer.php?' . strip_tags(SID));
}
exit;
}
function signInClosed() {
printHeader(oc_('Sign In'), 3);
print '<p style="text-align: center" class="warn">' . oc_('Committee sign-in is closed') . '</p>';
printFooter();
exit;
}
if (oc_hookSet('committee-signin')) {
foreach ($GLOBALS['OC_hooksAR']['committee-signin'] as $hook) {
require_once $hook;
}
}
session_regenerate_id(); // prevent login session fixation
$vformar[1] = "lkalskjo24uakd";
$vformar[2] = "lkiqwje0913284";
$vformar[3] = "loj0923489wefs";
$errmsg = "";
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Sign In")) {
// Check for bad uname or pwd
if (!preg_match("/^[\p{L}\p{Nd}_\.\-\@]{5,50}$/u",$_POST['uname']) || empty($_POST['upwd'])) {
//T: Use care with href - "mailto" and "subject" should not be translated
$errmsg = '<span class="err">' . sprintf(oc_('Username and/or password not valid. Please try again. If you continue to have a problem signing in, please <a href="../author/contact.php">contact the Chair</a>.'), $OC_configAR['OC_pcemail']) . '</span><p>';
} else {
$lowusername = oc_strtolower(trim($_POST['uname']));
$q = "SELECT `reviewerid`, `name_last`, `name_first`, `password`, `onprogramcommittee` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `username`='" . safeSQLstr($lowusername) . "'";
$r = ocsql_query($q) or err("Unable to query database");
// Check for multiple matching usernames
if (($rnum=ocsql_num_rows($r)) > 1) {
printHeader(safeHTMLstr(oc_('Sign In')));
err("Multiple usernames");
}
// Check for unknown username
if ($rnum == 0) {
//T: Use care with href - "mailto" and "subject" should not be translated
$errmsg = '<span class="err">' . sprintf(oc_('Incorrect username or password. Please try again. If you continue to have a problem signing in, please contact the <a href="mailto:%s?subject=sign-in problem">Chair</a>.'), $OC_configAR['OC_pcemail']) . '</span><p>';
} else {
$p = ocsql_fetch_array($r);
// Check that sign-in is still open for user
if (!$OC_statusAR['OC_rev_signin_open']) {
if ($p['onprogramcommittee'] == "F") {
signInClosed();
} elseif (!$OC_statusAR['OC_pc_signin_open']) {
signInClosed();
}
}
// Check for bad pwd
if (!oc_password_verify($_POST['upwd'], $p['password'], 'committee', $p['reviewerid'])) {
$errmsg = '
<span class="err">' . sprintf(oc_('Incorrect username or password. Please try again below or <a href="%s">click here to reset your password</a>.'), 'reset.php') . '</span>
<p>
';
} else { // We have a winner!
oc_committeeSignIn($p, $lowusername);
}
}
}
// Weak attempt at catching multiple failed logins
if ($_POST['validform'] == $vformar[1]) { $vform = $vformar[2]; }
else {
$vform = $vformar[3];
if ($_POST['validform'] == $vformar[3]) {
$errmsg .= '
<span class="err">' . oc_('If you click the "<em>forgot</em>" links, we will be glad to help you out.') . '</span><p>
';
}
}
}
else {
$vform = $vformar[1];
}
printHeader(oc_('Sign In'),3);
if (!empty($errmsg)) {
print $errmsg;
}
elseif (isset($_GET['e']) && ($_GET['e'] == "exp")) {
print '<p class="err">' . safeHTMLstr(oc_('Your session has timed out or you did not sign in properly. Please sign in again.')) . '</p>';
if (isset($_SESSION[OCC_SESSION_VAR_NAME]['POST']['submit'])) {
print '<p class="warn">' . safeHTMLstr(oc_('It appears you were filling out a review form -- by signing back in right now with the same username, you will have the option to save the review.')) . '</p>';
}
}
print '
<br>
<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . strip_tags(SID) . '">
<input type="hidden" name="ocaction" value="Sign In" />
<table border="0" style="margin: 0 auto">
<tr><td><strong><label for="uname">' . safeHTMLstr(oc_('Username')) . ':</label></strong></td><td><input size=20 name="uname" id="uname" value="' . safeHTMLstr(varValue('uname', $_POST)) . '" tabindex="1" /></td><td><font size="-1">( <a href="email_username.php" tabindex="4">' . oc_('forgot username?') . '</a> )</font></td></tr>
<tr><td><strong><label for="upwd">' . safeHTMLstr(oc_('Password')) . ':</label></strong></td><td><input type="password" size=20 name="upwd" id="upwd" tabindex="2" /></td><td><font size="-1">( <a href="reset.php" tabindex="5">' . safeHTMLstr(oc_('forgot password?')) . '</a> )</font></td></tr>
<tr><th align="center" colspan="3"><br><input type="submit" name="submit" class="submit" value="' . safeHTMLstr(oc_('Sign In')) . '" tabindex="3" /></th></tr>
</table>
<input type="hidden" name="validform" value="' . $vform . '">
</form>
<br /><br />
<script language="javascript">
<!--
document.forms[0].elements[0].focus();
// -->
</script>
';
if ($OC_configAR['OC_ReviewerTimeout'] > 0) {
print '<p style="text-align: center" class="note">' . safeHTMLstr(sprintf(oc_('Note: Session times out after %d minutes of inactivity'), $OC_configAR['OC_ReviewerTimeout'])) . '</p>';
}
printFooter();
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
if (oc_hookSet('committee-signout-pre')) {
foreach ($GLOBALS['OC_hooksAR']['committee-signout-pre'] as $hook) {
require_once $hook;
}
}
unset($_SESSION[OCC_SESSION_VAR_NAME]['acusername']);
unset($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid']);
session_write_close();
if (oc_hookSet('committee-signout-post')) {
foreach ($GLOBALS['OC_hooksAR']['committee-signout-post'] as $hook) {
require_once $hook;
}
}
header("Location: ../");
?>
+161
View File
@@ -0,0 +1,161 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
$hdr = oc_('Committee Signup');
$hdrfn = 3;
if (isset($_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'])) {
warn(sprintf(oc_('You already appear to be signed into a committee account. Please <a href="%s">sign out</a> first before trying to create a new account.'), 'signout.php'), $hdr, $hdrfn);
printFooter();
exit;
}
oc_sendNoCacheHeaders();
require_once OCC_FORM_INC_FILE;
require_once OCC_COMMITTEE_INC_FILE;
if (oc_hookSet('committee-signup-pre')) {
foreach ($GLOBALS['OC_hooksAR']['committee-signup-pre'] as $hook) {
require_once $hook;
}
}
// Verify keycode
$programKeycodeAR = explode(',', $OC_configAR['OC_keycode_program']);
$reviewerKeycodeAR = explode(',', $OC_configAR['OC_keycode_reviewer']);
if ($OC_configAR['OC_paperAdvocates'] && isset($_POST['keycode']) && in_array($_POST['keycode'], $programKeycodeAR)) {
printHeader(oc_('Program Committee Signup'), 3);
if (! $OC_statusAR['OC_pc_signup_open']) {
warn(oc_('Committee sign-up is closed'));
}
$committee = "program";
$committeeTrans = oc_('Program Committee');
$oncommittee = "T";
$signUpNotice = $OC_configAR['OC_programSignUpNotice'];
}
elseif (isset($_POST['keycode']) && in_array($_POST['keycode'], $reviewerKeycodeAR)) {
printHeader(oc_('Reviewer Committee Signup'), 3);
if (! $OC_statusAR['OC_rev_signup_open']) {
warn(oc_('Committee sign-up is closed'));
}
$committee = "reviewer";
$committeeTrans = oc_('Review Committee');
$oncommittee = "F";
$signUpNotice = $OC_configAR['OC_reviewerSignUpNotice'];
} else {
warn(oc_('The keycode entered is incorrect. Please click on the Back button to try again. If you are still unable to access the committee sign up page, please contact the Chair.'), $hdr, $hdrfn);
}
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Sign Up")) {
$err = '';
$qfields = array();
$tfields = array();
require_once 'committee-validate.inc';
if (!empty($err)) {
print '<div class="warn">' . oc_('Please check the following:') . '<ul>' . $err . '</ul></div>';
} else { // let's submit
$q = "INSERT INTO `" . OCC_TABLE_REVIEWER . "` SET `onprogramcommittee`='" . $oncommittee . "', `signupdate`='" . safeSQLstr(date("Y-m-d")) . "'";
foreach ($qfields as $qid => $qval) {
$q .= ", `" . $qid . "`=" . $qval;
}
$r = ocsql_query($q) or err("unable to submit form");
$rid = ocsql_insert_id() or err("unable to get reviewer id");
// add topic(s)
if (!empty($tfields)) {
$q = "INSERT INTO `" . OCC_TABLE_REVIEWERTOPIC . "` (`reviewerid`,`topicid`) VALUES";
foreach ($tfields as $t) {
$q .= " ($rid,$t),";
}
$r = ocsql_query(rtrim($q, ',')) or err("unable to add reviewer topic, but account created ");
}
$confirmmsg = '
<p>' . oc_('Thank you for signing up. We have emailed you a confirmation with your information.') . '</p>
<p>' .
//T: Use care when translating the href - "mailto" and "subject" are not translated. %2%s = event short name (e.g., CONF2012)
sprintf(oc_('If you have any questions, please contact the <a href="mailto:%1$s?subject=%2$s Committee Sign Up Question">Chair</a>'), $OC_configAR['OC_pcemail'], $OC_configAR['OC_confName']) . '</p>
';
// ocIgnore included so poEdit picks up (DB) template translation
$ocIgnoreSubject = oc_('Committee Signup');
//T: [:OC_confName:] is the event name; [:committee:] will be either "Program Committee" or "Review Committee"; [:OC_pcemail:] is an email address
$ocIgnoreBody = oc_('Thank you for signing up for the [:OC_confName:] [:committee:]. Below is the information you provided. If you have any questions, please contact [:OC_pcemail:] or reply to this email.
[:fields:]');
list($mailsubject, $mailbody) = oc_getTemplate('committee-signup');
$fields = oc_genFieldMessage($OC_reviewerFieldSetAR, $OC_reviewerFieldAR, $_POST);
$templateExtraAR = array(
'committee' => $committeeTrans,
'fields' => oc_('Reviewer ID') . ': ' . $rid . "\n\n" . $fields
);
$mailsubject = oc_replaceVariables($mailsubject, $templateExtraAR);
$mailbody = oc_replaceVariables($mailbody, $templateExtraAR);
if (oc_hookSet('committee-signup-add')) {
foreach ($GLOBALS['OC_hooksAR']['committee-signup-add'] as $hook) {
require_once $hook;
}
}
print $confirmmsg;
sendEmail($_POST['email'], $mailsubject, $mailbody, $OC_configAR['OC_notifyReviewerSignup']);
printFooter();
exit;
}
}
// Display notice & form
if (!empty($signUpNotice)) {
print '<div>' . (preg_match("/\<(?:p|br) ?\/?\>/", $signUpNotice) ? oc_($signUpNotice) : nl2br(oc_($signUpNotice))) . '</div><p><hr /></p>';
}
print '
<form method="post" action="' . $_SERVER['PHP_SELF'] . '" class="ocform" id="cmtform">
<input type="hidden" name="keycode" value="' . safeHTMLstr(varValue('keycode', $_POST)) . '">
<input type="hidden" name="ocaction" value="Sign Up" />
';
oc_displayFieldSet($OC_reviewerFieldSetAR, $OC_reviewerFieldAR, $_POST);
if (oc_hookSet('committee-signup-fields')) {
foreach ($GLOBALS['OC_hooksAR']['committee-signup-fields'] as $hook) {
require_once $hook;
}
}
print '
<div id="oc_submit_emailConfirmOuter">
<div id="oc_submit_emailConfirmInner" aria-live="polite">
<p class="note">' . oc_('The confirmation email will be sent to:') . '</p>
<p id="oc_submit_emailConfirm"></p>
</div>
</div>
<p><input type="submit" name="submit" value="' . oc_('Sign Up') . '" class="submit" /></p></form>
<script type="text/javascript">
document.getElementById("cmtform").addEventListener("change", function (evt) { oc_updateSubmitEmailAddresses(evt); });
oc_updateSubmitEmailAddresses(null);
</script>
';
printFooter();
?>
+212
View File
@@ -0,0 +1,212 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
$OC_cmtEdit = true; // flag for designating profile editing
require_once "../include.php";
oc_sendNoCacheHeaders();
if (OCC_CHAIR_PWD_TRUMPS && isset($_POST['c']) && ($_POST['c'] == 1)) {
$hdrfn = 1;
beginChairSession();
$chair = true;
$rid = $_POST['rid'];
} else {
beginSession();
$hdrfn = 2;
$rid = $_SESSION[OCC_SESSION_VAR_NAME]['acreviewerid'];
$chair = false;
}
if (oc_hookSet('committee-update-pre')) {
foreach ($GLOBALS['OC_hooksAR']['committee-update-pre'] as $hook) {
require_once $hook;
}
}
printHeader(oc_('Update Profile'), $hdrfn);
if (!preg_match("/^\d+$/", $rid)) {
warn('Invalid ID');
exit;
}
$hdr = ''; // set these so req OCC_COMMITTEE_INC_FILE below skips printHeader
$hdrfn = 0;
require_once OCC_FORM_INC_FILE;
require_once OCC_COMMITTEE_INC_FILE;
$postFields = array();
// Update fields for editing profile
unset($OC_reviewerFieldAR['username']);
if (isset($OC_reviewerFieldSetAR['fs_passwords'])) {
$OC_reviewerFieldSetAR['fs_passwords']['fieldset'] = oc_('Change Password');
$OC_reviewerFieldSetAR['fs_passwords']['note'] = oc_('Leave these fields blank if you do not want to change the password');
$OC_reviewerFieldSetAR['fs_passwords']['fields'] = array('password1', 'password2');
}
if (isset($OC_reviewerFieldAR['password1']) && isset($OC_reviewerFieldAR['password2'])) {
$OC_reviewerFieldAR['password1']['name'] = oc_('New Password');
$OC_reviewerFieldAR['password1']['required'] = false;
$OC_reviewerFieldAR['password2']['required'] = false;
}
if (isset($OC_reviewerFieldAR['consent'])) { // remove consent field if already given
$cr = ocsql_query("SELECT `consent` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `reviewerid`='" . safeSQLstr($rid) . "'") or err('Unable to query consent status');
$cl = ocsql_fetch_assoc($cr);
if (!empty($cl['consent'])) {
unset($OC_reviewerFieldAR['consent']);
foreach ($OC_reviewerFieldSetAR as $fsid => $fsar) { // remove from fieldset
if (in_array('consent', $fsar['fields'])) {
$OC_reviewerFieldSetAR[$fsid]['fields'] = array_diff($OC_reviewerFieldSetAR[$fsid]['fields'], array('consent'));
continue; // field should only be in one fieldset
}
}
}
}
// Process submission
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Update Profile")) {
// Check for valid submission
if ( $chair ) {
if ( !validToken('chair') ) {
warn(oc_('Invalid submission'));
}
} elseif ( ! validToken('ac') ) {
warn(oc_('Invalid submission'));
}
$err = '';
$qfields = array();
$tfields = array();
require_once 'committee-validate.inc';
if (!empty($err)) {
print '<div class="warn">' . oc_('Please check the following:') . '<ul>' . $err . '</ul></div><hr />';
} else {
// check password
$q = "SELECT `password` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `reviewerid`='" . safeSQLstr($rid) . "'";
$r = ocsql_query($q) or err('Unable to retrieve reviewer information');
$rinfo = ocsql_fetch_array($r);
if ($chair || oc_password_verify($_POST['oldpwd'], $rinfo['password'])) {
// Update fields
$q = "UPDATE `" . OCC_TABLE_REVIEWER . "` SET `lastupdate`='" . safeSQLstr(date('Y-m-d')) . "', ";
foreach ($qfields as $qid => $qval) {
$q .= "`" . $qid . "`=" . $qval . ", ";
}
$q = rtrim($q, ', ');
$q .= " WHERE `reviewerid`='" . safeSQLstr($rid) . "' LIMIT 1";
ocsql_query($q) or err('Unable to update database');
// Update topics
issueSQL("DELETE FROM `" . OCC_TABLE_REVIEWERTOPIC . "` WHERE `reviewerid`='" . safeSQLstr($rid) . "'");
if (!empty($tfields)) {
$q = "INSERT INTO `" . OCC_TABLE_REVIEWERTOPIC . "` (`reviewerid`,`topicid`) VALUES";
foreach ($tfields as $t) {
$q .= " (" . safeSQLstr($rid) . ",$t),";
}
$r = ocsql_query(rtrim($q, ',')) or err("unable to add reviewer topic, but account created ");
}
if ($chair) { // display back links
print '<div style="text-align: center"><p class="note">profile updated</p><p><a href="../chair/show_reviewer.php?rid=' . urlencode($rid) . '">View This Committee Member</a> | <a href="../chair/list_reviewers.php">View All Committee Members</a></p></div>';
} else {
print '<p>' . sprintf(oc_('Your profile has been successfully updated. <a href="%s">Return to the main Committee page</a>.'), 'reviewer.php') . '</p>';
// ocIgnore included so poEdit picks up (DB) template translation
$ocIgnoreSubject = oc_('Committee Member Profile Updated');
$ocIgnoreBody = oc_('Your profile has been updated. The submitted information follows below:
[:fields:]');
list($mailsubject, $mailbody) = oc_getTemplate('committee-update');
$fields = oc_genFieldMessage($OC_reviewerFieldSetAR, $OC_reviewerFieldAR, $_POST);
$templateExtraAR = array(
'fields' => oc_('Username') . ": " . $_SESSION[OCC_SESSION_VAR_NAME]['acusername'] . "\n\n" . $fields
);
$mailsubject = oc_replaceVariables($mailsubject, $templateExtraAR);
$mailbody = oc_replaceVariables($mailbody, $templateExtraAR);
if (oc_hookSet('committee-signup-update')) {
foreach ($GLOBALS['OC_hooksAR']['committee-signup-update'] as $hook) {
require_once $hook;
}
}
sendEmail($_POST['email'], $mailsubject, $mailbody, $OC_configAR['OC_notifyReviewerProfileUpdate']);
}
printFooter();
// log
oc_logit('committee', 'Member ID ' . $rid . ' profile edited' . ($chair ? ' by Chair' : ''));
exit;
} else {
print '<p class="warn">' . oc_('Current password is not correct') . '</p><hr />';
}
}
$postFields = $_POST;
} else { // not submitting
// get stored values
$q = "SELECT * FROM `" . OCC_TABLE_REVIEWER . "` WHERE `reviewerid`='" . safeSQLstr($rid) . "'";
$r = ocsql_query($q) or err("Unable to retrieve reviewer information");
$postFields = array_merge((array)$_POST, ocsql_fetch_assoc($r));
// Get list of reviewer topics
$tq = "SELECT * FROM `" . OCC_TABLE_REVIEWERTOPIC . "` WHERE `reviewerid`='" . safeSQLstr($rid) . "'";
$tr = ocsql_query($tq) or err("Unable to retrieve topics");
$postFields['topics'] = array();
while ($tl = ocsql_fetch_assoc($tr)) {
$postFields['topics'][] = $tl['topicid'];
}
if ( isset($OC_reviewerFieldAR['topics']['type']) && ($OC_reviewerFieldAR['topics']['type'] == 'radio') && isset($postFields['topics'][0]) ) {
$postFields['topics'] = $postFields['topics'][0];
}
}
print '
<form method="post" action="' . $_SERVER['PHP_SELF'] . '" class="ocform">
<input type="hidden" name="ocaction" value="Update Profile" />
';
if ( $chair ) {
print '
<input type="hidden" name="rid" value="' . safeHTMLstr($rid) . '" />
<input type="hidden" name="c" value="1">
<input type="hidden" name="token" value="' . $_SESSION[OCC_SESSION_VAR_NAME]['chairtoken'] . '" />
';
} else {
print '
<p class="note">' . oc_('Make the changes you want below, then enter your password for verification and click the <em>Update Profile</em> button at the bottom.') . '</p>
<input type="hidden" name="token" value="' . $_SESSION[OCC_SESSION_VAR_NAME]['actoken'] . '" />
';
}
oc_displayFieldSet($OC_reviewerFieldSetAR, $OC_reviewerFieldAR, $postFields);
if (! $chair ) {
print '
<span class="note2">' . oc_('Enter your current password and click the <em>Update Profile</em> button') . '</span><p>
' . oc_('Current Password') . ': <input size="20" name="oldpwd" type="password" style="background-color: #f6f6f6" />
&nbsp; &nbsp; &nbsp;
';
}
print '
<input type="submit" name="submit" value="' . oc_('Update Profile') . '" class="submit" />
</form>
';
printFooter();
?>