private function saveSkillThresholdsCmd()
 {
     require_once 'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
     if (is_array($_POST['threshold'])) {
         $threshold = $_POST['threshold'];
         $assignmentList = $this->buildSkillQuestionAssignmentList();
         $assignmentList->loadFromDb();
         foreach ($assignmentList->getUniqueAssignedSkills() as $data) {
             $skill = $data['skill'];
             $skillKey = $data['skill_base_id'] . ':' . $data['skill_tref_id'];
             $levels = $skill->getLevelData();
             foreach ($levels as $level) {
                 if (isset($threshold[$skillKey]) && isset($threshold[$skillKey][$level['id']])) {
                     $skillLevelThreshold = new ilTestSkillLevelThreshold($this->db);
                     $skillLevelThreshold->setTestId($this->testOBJ->getTestId());
                     $skillLevelThreshold->setSkillBaseId($data['skill_base_id']);
                     $skillLevelThreshold->setSkillTrefId($data['skill_tref_id']);
                     $skillLevelThreshold->setSkillLevelId($level['id']);
                     $skillLevelThreshold->setThreshold($threshold[$skillKey][$level['id']]);
                     $skillLevelThreshold->saveToDb();
                 }
             }
         }
     }
     ilUtil::sendSuccess($this->lng->txt('tst_msg_skl_lvl_thresholds_saved'), true);
     $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_THRESHOLDS);
 }
 /**
  * Handle target parameter
  * @param object $a_target
  * @return 
  */
 public static function handleCode($a_ref_id, $a_type, $a_code)
 {
     global $lng, $tree, $ilUser;
     include_once './Services/Link/classes/class.ilLink.php';
     $lng->loadLanguageModule($a_type);
     try {
         self::useCode($a_code, $a_ref_id);
         $title = ilObject::_lookupTitle(ilObject::_lookupObjectId($a_ref_id));
         ilUtil::sendSuccess(sprintf($lng->txt($a_type . "_admission_link_success_registration"), $title), true);
         ilUtil::redirect(ilLink::_getLink($a_ref_id));
     } catch (ilMembershipRegistrationException $e) {
         switch ($e->getCode()) {
             case 124:
                 //added to waiting list
                 ilUtil::sendSuccess($e->getMessage(), true);
                 break;
             case 123:
                 //object is full
                 ilUtil::sendFailure($lng->txt($a_type . "_admission_link_failure_membership_limited"), true);
                 break;
             case 789:
                 //out of registration period
                 ilUtil::sendFailure($lng->txt($a_type . "_admission_link_failure_registration_period"), true);
                 break;
             default:
                 ilUtil::sendFailure($e->getMessage(), true);
                 break;
         }
         $GLOBALS['ilLog']->logStack();
         $GLOBALS['ilLog']->write($e->getCode() . ': ' . $e->getMessage());
         $parent_id = $tree->getParentId($a_ref_id);
         ilUtil::redirect(ilLink::_getLink($parent_id));
     }
 }
 function changeOwner()
 {
     global $rbacsystem, $ilObjDataCache;
     if (!($user_id = ilObjUser::_lookupId($_POST['owner']))) {
         ilUtil::sendFailure($this->lng->txt('user_not_known'));
         $this->owner();
         return true;
     }
     // no need to change?
     if ($user_id != $this->gui_obj->object->getOwner()) {
         $this->gui_obj->object->setOwner($user_id);
         $this->gui_obj->object->updateOwner();
         $ilObjDataCache->deleteCachedEntry($this->gui_obj->object->getId());
         include_once "Services/AccessControl/classes/class.ilRbacLog.php";
         if (ilRbacLog::isActive()) {
             ilRbacLog::add(ilRbacLog::CHANGE_OWNER, $this->gui_obj->object->getRefId(), array($user_id));
         }
     }
     ilUtil::sendSuccess($this->lng->txt('owner_updated'), true);
     if (!$rbacsystem->checkAccess("edit_permission", $this->gui_obj->object->getRefId())) {
         $this->ctrl->redirect($this->gui_obj);
         return true;
     }
     $this->ctrl->redirect($this, 'owner');
     return true;
 }
 private function save()
 {
     global $tpl, $ilCtrl;
     $form = $this->BuildForm();
     // Formular bauen
     // Eingaben prüfen (Abhängig von SetRequired)
     if ($form->CheckInput()) {
         $form->setValuesByPost();
         // Lade die Benutzereingaben
         $emails = $form->getInput('emails');
         // Speichere die E-Mails in eine Variable
         require_once "Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/UIExample/classes/class.ilEmailSubscriber.php";
         $subscriber = new ilEmailSubscriber($_GET['ref_id']);
         $emails = $subscriber->getEmailsFromString($emails);
         foreach ($emails as $email) {
             $subscriber->subscribeEmail($email);
         }
         //var_dump($subscriber->getEmailsFromString($emails));
         //exit;
         //$emails_untereinander = "";
         //$eintremails_untereinander = ;
         ilUtil::sendSuccess("Die Nutzer folgender E-Mail-Adressen sind jetzt Kursmitglieder: " . $this->werteuntereinander($subscriber->getEmailsFound()), true);
         ilUtil::sendInfo("Die Nutzer folgender E-Mail-Adressen konnten nicht gefunden werden: " . $this->werteuntereinander($subscriber->getEmailsNotFound()), true);
         $this->ctrl->redirect($this, 'show');
         /*
         $ausgabestr .= "Die Nutzer folgender E-Mail-Adressen sind jetzt Kursmitglieder: ".$this->werteuntereinander($subscriber->getEmailsFound());
         $ausgabestr .= "<br /><br /><br />Die Nutzer folgender E-Mail-Adressen konnten nicht gefunden werden: ".$this->werteuntereinander($subscriber->getEmailsNotFound());
         $this->tpl->setContent($ausgabestr);    //Zeige die E-Mails im Content an
         */
     } else {
         $this->tpl->setContent("Nicht Speichern");
     }
 }
 /**
  * @param srCertificate $certificate
  */
 protected function retryGeneration(srCertificate $certificate)
 {
     $certificate->setStatus(srCertificate::STATUS_NEW);
     $certificate->update();
     ilUtil::sendSuccess($this->pl->txt('msg_retry_generation'), true);
     $this->ctrl->redirect($this, 'index');
 }
 /**
  * save object
  * @access	public
  */
 function saveObject()
 {
     global $rbacadmin;
     // create and insert forum in objecttree
     $newObj = parent::saveObject();
     // put here object specific stuff
     // always send a message
     ilUtil::sendSuccess($this->lng->txt("object_added"), true);
     exit;
 }
 /**
  * Save config
  */
 public function save()
 {
     $form = new ilCertificateConfigFormGUI($this);
     if ($form->saveObject()) {
         ilUtil::sendSuccess($this->pl->txt('msg_save_config'), true);
         $this->ctrl->redirect($this, 'configure');
     } else {
         $form->setValuesByPost();
         $this->tpl->setContent($form->getHTML());
     }
 }
 public function saveSettings()
 {
     global $ilSetting;
     $this->checkPermission("write");
     $form = $this->initFormSettings();
     if ($form->checkInput()) {
         $ilSetting->set("links_dynamic", $form->getInput("links_dynamic"));
         ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
         $this->ctrl->redirect($this, "editSettings");
     }
     $form->setValuesByPost();
     $this->editSettings($form);
 }
 /**
  * Save form input (currently does not save anything to db)
  *
  */
 public function save()
 {
     global $tpl, $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     $form = $this->initConfigurationForm();
     if ($form->checkInput()) {
         ilUtil::sendSuccess($pl->txt("saving_invoked"), true);
         $ilCtrl->redirect($this, "configure");
     } else {
         $form->setValuesByPost();
         $tpl->setContent($form->getHtml());
     }
 }
 /**
  * Update
  */
 protected function update()
 {
     include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
     $settings = ilFMSettings::getInstance();
     $form = $this->initSettingsForm();
     if ($form->checkInput()) {
         $settings->enable($form->getInput('active'));
         $settings->enableLocalFS($form->getInput('local'));
         $settings->setMaxFileSize($form->getInput('filesize'));
         $settings->update();
         ilUtil::sendSuccess($GLOBALS['lng']->txt('settings_saved'), true);
         $GLOBALS['ilCtrl']->redirect($this, 'settings');
     }
 }
 public function saveSettings()
 {
     global $ilSetting;
     $this->checkPermission("write");
     $form = $this->initFormSettings();
     if ($form->checkInput()) {
         if ($this->save($form)) {
             $ilSetting->set('mail_' . $this->getParentObjType() . '_member_notification', (int) $form->getInput('mail_member_notification'));
             ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
             $this->ctrl->redirect($this, "editSettings");
         }
     }
     $form->setValuesByPost();
     $this->editSettings($form);
 }
 function updateUser()
 {
     if (isset($_GET["userdetails_id"])) {
         $parent = $this->details_id;
         $this->__initDetails((int) $_GET["userdetails_id"]);
     }
     $this->__updateUser($_REQUEST['user_id'], $this->details_obj_id);
     ilUtil::sendSuccess($this->lng->txt('trac_update_edit_user'));
     if (!isset($_GET["userdetails_id"])) {
         $this->details();
     } else {
         $this->__initDetails($parent);
         $this->userDetails();
     }
 }
 /**
  * Remove a participations.
  *
  * @param integer $booking_id The booking id of the participation.
  */
 public function removeParticipations(array $a_booking_ids)
 {
     foreach ($a_booking_ids as $a_booking_id) {
         if (!ilRoomSharingNumericUtils::isPositiveNumber($a_booking_id)) {
             ilUtil::sendFailure($this->lng->txt("rep_robj_xrs_no_id_submitted"), true);
         }
     }
     //In order to prevent unnessary prepareManip statements, use different function if only one booking shoud be left.
     if (count($a_booking_ids) == 1) {
         $this->ilRoomsharingDatabase->deleteParticipation($this->ilUser->getId(), $a_booking_ids[0]);
     } else {
         $this->ilRoomsharingDatabase->deleteParticipations($this->ilUser->getId(), $a_booking_ids);
     }
     $this->sendQuitMail($a_booking_ids);
     ilUtil::sendSuccess($this->lng->txt('rep_robj_xrs_participations_left'), true);
 }
 /**
  * Save settings
  */
 protected function save()
 {
     global $lng, $ilCtrl;
     $form = $this->initConfigurationForm();
     $settings = ilFhoevEventSettings::getInstance();
     if ($form->checkInput()) {
         $settings->setActive($form->getInput('active'));
         $settings->setTemplateId($form->getInput('dtpl'));
         $settings->save();
         ilUtil::sendSuccess($lng->txt('settings_saved'), true);
         $ilCtrl->redirect($this, 'configure');
     }
     $error = $lng->txt('err_check_input');
     $form->setValuesByPost();
     ilUtil::sendFailure($e);
     $this->configure($form);
 }
 public function save()
 {
     global $lng;
     $table = ilDataCollectionCache::getTableCache($_GET['table_id']);
     $fields =& $table->getFields();
     foreach ($fields as &$field) {
         $field->setVisible($_POST['visible'][$field->getId()] == "on");
         $field->setEditable($_POST['editable'][$field->getId()] == "on");
         $field->setFilterable($_POST['filterable'][$field->getId()] == "on");
         $field->setLocked($_POST['locked'][$field->getId()] == "on");
         $field->setOrder($_POST['order'][$field->getId()]);
         $field->doUpdate();
     }
     $table->buildOrderFields();
     ilUtil::sendSuccess($lng->txt("dcl_table_settings_saved"));
     $this->listFields();
 }
 /** 
  * Called if the user pushes the submit button of the mail options form.
  * Passes the post data to the mail options model instance to store them.
  * 
  * @access public
  * 
  */
 public function saveOptions()
 {
     global $lng, $ilUser, $ilSetting;
     $this->tpl->setTitle($lng->txt('mail'));
     $this->initMailOptionsForm();
     $mailOptions = new ilMailOptions($ilUser->getId());
     if ($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1' && $ilSetting->get('usr_settings_disable_mail_incoming_mail') != '1') {
         $incoming_type = (int) $_POST['incoming_type'];
     } else {
         $incoming_type = $mailOptions->getIncomingType();
     }
     if ($this->form->checkInput()) {
         $mailOptions->updateOptions(ilUtil::stripSlashes($_POST['signature']), (int) $_POST['linebreak'], $incoming_type, (int) $_POST['cronjob_notification']);
         ilUtil::sendSuccess($lng->txt('mail_options_saved'));
     }
     $this->form->setValuesByPost();
     $this->tpl->setContent($this->form->getHTML());
     $this->tpl->show();
 }
 /**
  * Write skills
  *
  * @param
  * @return
  */
 function writeSkills()
 {
     global $lng, $ilCtrl;
     return;
     include_once "./Modules/Survey/classes/class.ilSurveySkill.php";
     $sskill = new ilSurveySkill($this->survey);
     $apps = $this->survey->getAppraiseesData();
     $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
     foreach ($apps as $app) {
         $new_levels = $sskill->determineSkillLevelsForAppraisee($app["user_id"]);
         foreach ($new_levels as $nl) {
             if ($nl["new_level_id"] > 0) {
                 ilBasicSkill::writeUserSkillLevelStatus($nl["new_level_id"], $app["user_id"], $this->survey->getRefId(), $nl["tref_id"], ilBasicSkill::ACHIEVED);
             }
         }
     }
     ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
     $ilCtrl->redirect($this, "listSkillChanges");
 }
 /**
  * Executes the action provided by the user.
  */
 public function executeRoomAttributeAction()
 {
     $this->createAttributesForm();
     if ($this->attributesForm->checkInput()) {
         try {
             $updatedRoomsAmount = $this->proceedRoomAttributeAction();
         } catch (ilRoomSharingAttributesException $exc) {
             ilUtil::sendFailure($this->lng->txt($exc->getMessage()), true);
             $this->ctrl->redirect($this, ATTRC::SHOW_ROOM_ATTR_ACTIONS);
         }
         if (isset($updatedRoomsAmount) && $updatedRoomsAmount > 0) {
             ilUtil::sendSuccess($this->createDeletionMessage($updatedRoomsAmount), true);
         } else {
             ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
         }
         $this->ctrl->redirect($this, ATTRC::SHOW_ROOM_ATTR_ACTIONS);
     }
     $this->attributesForm->setValuesByPost();
     $this->tpl->setContent($this->attributesForm->getHtml());
 }
 /**
  * saves the form on successfull validation and redirects to showForm command
  * 
  * @access	private
  * @global	ilCtrl		$ilCtrl
  * @global	ilLanguage	$lng
  */
 private function saveFormCmd()
 {
     global $ilCtrl, $lng;
     $form = $this->buildForm();
     if ($form->checkInput()) {
         $questionHint = new ilAssQuestionHint();
         if ((int) $form->getInput('hint_id')) {
             $questionHint->load((int) $form->getInput('hint_id'));
         } else {
             $questionHint->setQuestionId($this->questionOBJ->getId());
             $questionHint->setIndex(ilAssQuestionHintList::getNextIndexByQuestionId($this->questionOBJ->getId()));
         }
         $questionHint->setText($form->getInput('hint_text'));
         $questionHint->setPoints($form->getInput('hint_points'));
         $questionHint->save();
         ilUtil::sendSuccess($lng->txt('tst_question_hints_form_saved_msg'), true);
         $ilCtrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
     }
     ilUtil::sendFailure($lng->txt('tst_question_hints_form_invalid_msg'));
     $this->showFormCmd($form);
 }
 protected function save()
 {
     global $tpl;
     $form = $this->buildForm();
     if ($form->checkInput()) {
         $form->setValuesByPost();
         $emails = $form->getInput('emails');
         require_once "Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/CourseEmailSubscription/classes/class.ilEmailSubscriber.php";
         $subscriber = new ilEmailSubscriber($this->courseObject->getRefId());
         $emails = $subscriber->getEmailsFromString($emails);
         foreach ($emails as $email) {
             $subscriber->subscribeEmail($email);
         }
         //$emailsFound = $subscriber->getEmailsFound();
         //$emailsNotFound = $subscriber->getEmailsNotFound();
         ilUtil::sendSuccess('Folgende Benutzer wurden eingeschrieben: ' . implode(', ', $subscriber->getEmailsFound()), true);
         ilUtil::sendInfo('Folgende E-Mail adressen konnten nicht gefunden werden: ' . implode(', ', $subscriber->getEmailsNotFound()), true);
         $this->ctrl->redirect($this, 'show');
     } else {
         $tpl->setContent($form->getHTML());
     }
 }
 function updateUser()
 {
     global $rbacsystem;
     if (isset($_GET["userdetails_id"])) {
         $parent = $this->details_id;
         $this->__initDetails((int) $_GET["userdetails_id"]);
     }
     if (!$rbacsystem->checkAccess('edit_learning_progress', $this->details_id)) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->returnToParent($this);
     }
     $this->__updateUser($_REQUEST['user_id'], $this->details_obj_id);
     ilUtil::sendSuccess($this->lng->txt('trac_update_edit_user'), true);
     $this->ctrl->setParameter($this, "details_id", $this->details_id);
     // #15043
     // #14993
     if (!isset($_GET["userdetails_id"])) {
         $this->ctrl->redirect($this, "details");
     } else {
         $this->ctrl->setParameter($this, "userdetails_id", (int) $_GET["userdetails_id"]);
         $this->ctrl->redirect($this, "userdetails");
     }
 }
 /**
  * Update settings.
  * This command uses the form class to display an input form.
  */
 protected function updateSettings()
 {
     if (!$this->permission->checkPrivilege(PRIVC::ACCESS_SETTINGS)) {
         $this->setActiveTabRegardingPrivilege();
         return false;
     }
     $this->tabs_gui->activateTab('settings');
     $this->initSettingsForm();
     if ($this->settingsForm->checkInput()) {
         // Title and description (Standard)
         $this->object->setTitle($this->settingsForm->getInput('title'));
         $this->object->setDescription($this->settingsForm->getInput('desc'));
         // Online flag
         $this->object->setOnline($this->settingsForm->getInput('online'));
         //			 Max book time
         //			$input = $this->settingsForm->getInput('max_book_time');
         //			$date = $input['date'];
         //			$input1 = $this->settingsForm->getInput('max_book_time');
         //			$time = $input1['time'];
         //			$this->object->setMaxBookTime($date . " " . $time);
         $date = xrsTimeInputGUI::getInputAsDateTime($this->settingsForm->getInput('max_book_time'));
         $this->object->setMaxBookTime('000-00-00 ' . $date->format('H:i:s'));
         // Rooms agreement
         $roomAgreementAcceptable = true;
         $agreementFile = $this->settingsForm->getInput('rooms_agreement');
         if ($agreementFile['size'] != 0 && $this->isAllowedFileType($agreementFile['type'])) {
             $uploadFileId = $this->object->uploadRoomsAgreement($agreementFile, $this->object->getRoomsAgreementFileId());
             $this->object->setRoomsAgreementFileId($uploadFileId);
         } else {
             if ($agreementFile['error'] != 4) {
                 // Errorcode 4 stands for no file was provided.
                 // Send failure when file was provided, but dont meet first criteria (size and type).
                 $roomAgreementAcceptable = false;
                 $roomAgreementField = $this->settingsForm->getItemByPostVar('rooms_agreement');
                 $roomAgreementField->setAlert(" ");
                 ilUtil::sendFailure($this->lng->txt('rep_robj_xrs_room_agreement_upload_error'), true);
             }
         }
         // Start update
         $this->object->update();
         if ($roomAgreementAcceptable) {
             ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
         }
     }
     $this->settingsForm->setValuesByPost();
     $roomAgreementField = $this->settingsForm->getItemByPostVar('rooms_agreement');
     $roomAgreementField->setValue($this->getRoomAgreementLink());
     $this->tpl->setContent($this->settingsForm->getHtml());
 }
 /**
  * save settings
  */
 public function updateSettings()
 {
     global $ilDB, $ilCtrl, $ilUser, $tpl, $ilTabs;
     $form = $this->initSettingsForm();
     if ($form->checkInput()) {
         $mng = $form->getInput('mng');
         if (ilConsultationHourAppointments::setManager($mng)) {
             ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
             $ilCtrl->redirect($this, 'settings');
         } else {
             $ilTabs->activateTab('ch_settings');
             ilUtil::sendFailure($this->lng->txt('cal_ch_unknown_user'));
             $field = $form->getItemByPostVar('mng');
             $field->setValue($mng);
             $tpl->setContent($form->getHTML());
             return;
         }
     }
 }
Example #24
0
 function assignSave()
 {
     global $rbacreview, $rbacadmin;
     if (!$this->ilAccess->checkAccess("cat_administrate_users", "", $_GET["ref_id"])) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this, "");
     }
     include_once './Services/User/classes/class.ilLocalUser.php';
     // check hack
     if (!isset($_GET['obj_id']) or !in_array($_REQUEST['obj_id'], ilLocalUser::_getAllUserIds())) {
         ilUtil::sendFailure('no_user_selected');
         $this->index();
         return true;
     }
     $roles = $this->__getAssignableRoles();
     // check minimum one global role
     if (!$this->__checkGlobalRoles($_POST['role_ids'])) {
         ilUtil::sendFailure($this->lng->txt('no_global_role_left'));
         $this->assignRolesObject();
         return false;
     }
     $new_role_ids = $_POST['role_ids'] ? $_POST['role_ids'] : array();
     $assigned_roles = $rbacreview->assignedRoles((int) $_REQUEST['obj_id']);
     foreach ($roles as $role) {
         if (in_array($role['obj_id'], $new_role_ids) and !in_array($role['obj_id'], $assigned_roles)) {
             $rbacadmin->assignUser($role['obj_id'], (int) $_REQUEST['obj_id']);
         }
         if (in_array($role['obj_id'], $assigned_roles) and !in_array($role['obj_id'], $new_role_ids)) {
             $rbacadmin->deassignUser($role['obj_id'], (int) $_REQUEST['obj_id']);
         }
     }
     ilUtil::sendSuccess($this->lng->txt('role_assignment_updated'));
     $this->assignRoles();
     return true;
 }
Example #25
0
 public function adoptTeamAssignmentsObject()
 {
     global $ilCtrl, $lng;
     $this->checkPermission("write");
     $src_ass_id = (int) $_POST["ass_adpt"];
     if ($this->ass && $src_ass_id > 0) {
         // no notifications, assignment is not ready
         $this->ass->adoptTeams($src_ass_id);
         ilUtil::sendSuccess($lng->txt("settings_saved"), true);
     }
     $ilCtrl->redirect($this, "listAssignments");
 }
 /**
  * saves the login information data
  *
  * @access protected
  * @author Michael Jansen
  */
 protected function saveLoginInfo()
 {
     global $rbacsystem, $lng, $ilSetting;
     if (!$rbacsystem->checkAccess("write", $this->getRefId())) {
         $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
     }
     $this->initLoginForm();
     if ($this->form->checkInput()) {
         if (is_array($_POST)) {
             // @todo: Move settings ilAuthLoginPageSettings
             $this->loginSettings = new ilSetting("login_settings");
             foreach ($_POST as $key => $val) {
                 if (substr($key, 0, 14) == "login_message_") {
                     $this->loginSettings->set($key, $val);
                 }
             }
         }
         if ($_POST['default_auth_mode']) {
             $ilSetting->set('default_auth_mode', (int) $_POST['default_auth_mode']);
         }
         ilUtil::sendSuccess($this->lng->txt("login_information_settings_saved"), true);
     }
     $this->ctrl->redirect($this, 'show');
 }
 /**
  * Upload appointments
  */
 protected function uploadAppointments()
 {
     // @todo permission check
     $form = $this->initImportForm();
     if ($form->checkInput()) {
         $file = $form->getInput('file');
         $tmp = ilUtil::ilTempnam();
         ilUtil::moveUploadedFile($file['tmp_name'], $file['name'], $tmp);
         $num = $this->doImportFile($tmp, (int) $_REQUEST['category_id']);
         ilUtil::sendSuccess(sprintf($this->lng->txt('cal_imported_success'), (int) $num), true);
         $this->ctrl->redirect($this, 'manage');
     }
     ilUtil::sendFailure($this->lng->txt('cal_err_file_upload'), true);
     $this->initImportForm($form);
 }
 /**
  * Create or update a type
  */
 public function saveType()
 {
     $type = $this->type === NULL ? new srCertificateType() : $this->type;
     $form = new srCertificateTypeFormGUI($this, $type);
     if ($form->saveObject()) {
         ilUtil::sendSuccess($this->pl->txt('msg_type_saved'), true);
         $this->ctrl->setParameter($this, 'type_id', $type->getId());
         $this->ctrl->redirect($this, 'editType');
     } else {
         $this->tpl->setContent($form->getHTML());
     }
 }
 /**
  * Deletes all user data of the survey after confirmation
  */
 public function confirmDeleteAllUserData()
 {
     global $lng, $ilCtrl;
     $this->object->deleteAllUserData();
     ilUtil::sendSuccess($lng->txt("svy_all_user_data_deleted"), true);
     $this->renderPage();
 }
 /**
  * Delete multiple records
  *
  * @param array $record_ids
  */
 public function deleteRecords(array $record_ids = array())
 {
     /** @var ilCtrl $ilCtrl */
     global $ilCtrl, $lng;
     $record_ids = count($record_ids) ? $record_ids : $_POST['record_ids'];
     $record_ids = is_null($record_ids) ? array() : $record_ids;
     // Invoke deletion
     $n_skipped = 0;
     foreach ($record_ids as $record_id) {
         /** @var ilDataCollectionRecord $record */
         $record = ilDataCollectionCache::getRecordCache($record_id);
         if ($record) {
             if ($record->hasPermissionToDelete((int) $_GET['ref_id'])) {
                 $record->doDelete();
             } else {
                 $n_skipped++;
             }
         }
     }
     $n_deleted = count($record_ids) - $n_skipped;
     if ($n_deleted) {
         ilUtil::sendSuccess(sprintf($lng->txt('dcl_deleted_records'), $n_deleted), true);
     }
     if ($n_skipped) {
         ilUtil::sendInfo(sprintf($lng->txt('dcl_skipped_delete_records'), $n_skipped), true);
     }
     $ilCtrl->redirect($this, 'listRecords');
 }