Ejemplo n.º 1
0
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require_once '../include/admin_auth.inc';
require_once '../include/errors.inc';
require_once '../classes/userutils.class.php';
$userID = check_var('userID', 'REQUEST', true, false, true);
if (isset($_POST['submit'])) {
    // Clear the team of all members.
    UserUtils::clear_staff_modules_by_userID($_POST['userID'], $mysqli);
    // Insert a record for each team member.
    for ($i = 0; $i < $_POST['module_no']; $i++) {
        if (isset($_POST["mod{$i}"]) and $_POST["mod{$i}"] != '') {
            UserUtils::add_staff_to_module($userID, $_POST["mod{$i}"], $mysqli);
        }
    }
    ?>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="content-type" content="text/html;charset=<?php 
    echo $configObject->get('cfg_page_charset');
    ?>
" />
  <title><?php 
    echo $string['manageteams'] . ' ' . $configObject->get('cfg_install_type');
    ?>
</title>
  <script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
Ejemplo n.º 2
0
 /**
  * add current user to module as staff
  *
  * @param $idMod
  */
 public function add_staff_to_module($idMod)
 {
     $return = UserUtils::add_staff_to_module($this->get_user_ID(), $idMod, $this->db);
     $this->load_staff_modules();
     return $return;
 }
Ejemplo n.º 3
0
    $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 (!$userObject->has_role(array('SysAdmin', 'Admin'))) {
    if ($module_details['add_team_members'] == 0) {
        $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 (isset($_POST['submit'])) {
    // Clear the team of all members.
    UserUtils::clear_staff_modules_by_moduleID($moduleID, $mysqli);
    // Insert a record for each team member.
    for ($i = 0; $i < $_POST['staff_no']; $i++) {
        if (isset($_POST["staff{$i}"]) and $_POST["staff{$i}"] != '') {
            UserUtils::add_staff_to_module($_POST["staff{$i}"], $moduleID, $mysqli);
        }
    }
    ?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html;charset=<?php 
    echo $configObject->get('cfg_page_charset');
    ?>
" />
  <title><?php 
    echo $string['teammembers'] . ' ' . $module_details['moduleid'];
    ?>
</title>
  <script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>