* @copyright Copyright (c) 2014 The University of Nottingham * @package */ require_once '../include/staff_auth.inc'; require_once '../include/errors.inc'; require_once '../include/media.inc'; require_once '../include/mapping.inc'; require_once '../classes/question_status.class.php'; require_once '../classes/paperutils.class.php'; require_once '../classes/logger.class.php'; $paperid = check_var('paperID', 'POST', true, false, true); if (!Paper_utils::paper_exists($paperid, $mysqli)) { $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email')); $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true); } if (!Paper_utils::is_paper_title_unique($_POST['new_paper'], $mysqli)) { // If the paper title is unique. ?> <html> <head> <meta http-equiv="content-type" content="text/html;charset=<?php echo $configObject->get('cfg_page_charset'); ?> " /> <title>Rogō</title> <link rel="stylesheet" type="text/css" href="../css/body.css" /> </head> <body> <table border="0" width="100%" height="100%"> <tr><td valign="middle"> <div align="center">
<meta http-equiv="content-type" content="text/html;charset=<?php echo $configObject->get('cfg_page_charset'); ?> " /> <title><?php echo $string['createnewpaper'] . $configObject->get('cfg_install_type'); ?> </title> <?php // Delete any half completed papers owned by current user. $result = $mysqli->prepare("DELETE FROM properties WHERE deleted='0000-00-00 00:00:00' AND paper_ownerID = ?"); $result->bind_param('i', $userObject->get_user_ID()); $result->execute(); // Check that the new paper name is not already used by any other paper (i.e. unique). $unique = Paper_utils::is_paper_title_unique($_POST['paper_name'], $mysqli); if (!$unique) { ?> <link rel="stylesheet" type="text/css" href="../css/body.css" /> <link rel="stylesheet" type="text/css" href="../css/new_paper.css" /> <script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script> <script> function over(id) { if (id != $('#paper_type').val()) { $('#' + id).css('background-color', '#FFE7A2'); } switch (id) { case 'formative': $('#description').html("<?php echo $string['description0'];
// // Rogō is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Rogō is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Rogō. If not, see <http://www.gnu.org/licenses/>. /** * * Check that a paper name has not already been used elsewhere. * * @author Simon Wilkinson * @version 1.0 * @copyright Copyright (c) 2014 The University of Nottingham * @package */ require '../../include/staff_auth.inc'; require_once '../../include/errors.inc'; require_once '../../classes/paperutils.class.php'; $name = check_var('name', 'POST', true, false, true); if (Paper_utils::is_paper_title_unique($name, $mysqli)) { echo 'unique'; } else { echo 'duplicate'; }