exit; } elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) { header("Location: " . ENTRADA_URL); exit; } elseif (!$ENTRADA_ACL->amIAllowed("configuration", "delete", false)) { add_error("Your account does not have the permissions required to use this feature of this module.<br /><br />If you believe you are receiving this message in error please contact <a href=\"mailto:" . html_encode($AGENT_CONTACTS["administrator"]["email"]) . "\">" . html_encode($AGENT_CONTACTS["administrator"]["name"]) . "</a> for assistance."); echo display_error(); application_log("error", "Group [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] . "] and role [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"] . "] do not have access to this module [" . $MODULE . "]"); } else { $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/settings/manage/descriptors?org=" . $ORGANISATION_ID . "§ion=delete&id=" . $RECORD_ID, "title" => "Delete Evaluation Response Descriptors"); echo "<h1>Delete Evaluation Response Descriptors</h1>"; if (isset($_POST["delete"])) { foreach ($_POST["delete"] as $descriptor_id) { if ($tmp_input = clean_input($descriptor_id, "numeric")) { $PROCESSED["delete"][] = $tmp_input; $descriptors[] = Models_Evaluation_ResponseDescriptor::fetchByID($tmp_input); } } } switch ($STEP) { case 2: if (is_array($descriptors)) { foreach ($descriptors as $descriptor) { $descriptor_data = $descriptor->toArray(); $descriptor_data["active"] = 0; if ($descriptor->fromArray($descriptor_data)->update()) { add_statistic("evaluation_response_descriptor", "delete", "erdescriptor_id", $descriptor->getID(), $ENTRADA_USER->getID()); if (!$ERROR) { add_success("Successfully deleted a Evaluation Response Descriptor [<strong>" . $descriptor->getDescriptor() . "</strong>]. You will now be redirected to the Evaluation Response Descriptors index; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . ENTRADA_URL . "/admin/settings/manage/descriptors?org=" . $ORGANISATION_ID . "\"><strong>click here</strong></a> to continue."); } } else {
* @copyright Copyright 2014 Queen's University. All Rights Reserved. */ if (!defined("PARENT_INCLUDED") || !defined("IN_DESCRIPTORS")) { exit; } elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) { header("Location: " . ENTRADA_URL); exit; } elseif (!$ENTRADA_ACL->amIAllowed("configuration", "update", false)) { $ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "\\'', 15000)"; $ERROR++; $ERRORSTR[] = "Your account does not have the permissions required to use this feature of this module.<br /><br />If you believe you are receiving this message in error please contact <a href=\"mailto:" . html_encode($AGENT_CONTACTS["administrator"]["email"]) . "\">" . html_encode($AGENT_CONTACTS["administrator"]["name"]) . "</a> for assistance."; echo display_error(); application_log("error", "Group [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] . "] and role [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"] . "] does not have access to this module [" . $MODULE . "]"); } else { if (isset($RECORD_ID) && $RECORD_ID) { $descriptor = Models_Evaluation_ResponseDescriptor::fetchByID($RECORD_ID); } else { $descriptor = new Models_Evaluation_ResponseDescriptor(); } switch ($STEP) { case 2: if (isset($_POST["descriptor"]) && ($tmp_input = clean_input($_POST["descriptor"], array("trim", "striptags")))) { if (strlen($tmp_input) <= 256) { $PROCESSED["descriptor"] = $tmp_input; } else { add_error("The descriptor too long. Please specify a descriptor that is 256 characters or less."); } } else { add_error("The descriptor is required."); } /**