This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de ilSurveyRaterGUI: ilRepositorySearchGUI
Definition at line 25 of file class.ilSurveyRaterGUI.php.
◆ __construct()
Definition at line 39 of file class.ilSurveyRaterGUI.php.
References $DIC, $parent, $survey, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\tabs(), ILIAS\Repository\ui(), and ILIAS\Repository\user().
45 $this->
ctrl = $DIC->ctrl();
46 $this->
lng = $DIC->language();
47 $this->
ui = $DIC->ui();
49 $this->main_tpl = $DIC->ui()->mainTemplate();
52 $this->
user = $DIC->user();
53 $this->
access = $DIC->access();
54 $this->
tabs = $DIC->tabs();
56 $this->
ctrl->saveParameter($this,
"appr_id");
57 $this->edit_request = $DIC->survey()
ilSurveyParticipantsGUI $parent
◆ add()
◆ addExternalRater()
Definition at line 410 of file class.ilSurveyRaterGUI.php.
References ILIAS\Repository\ctrl(), and ilPropertyFormGUI\getInput().
Referenced by continue().
412 $appr_id = $this->edit_request->getAppraiseeId();
415 $this->
ctrl->redirect($this,
"listAppraisees");
418 $this->
ctrl->setParameter($this,
"appr_id", $appr_id);
420 $code_id = $this->parent->addCodeForExternal(
426 $this->survey->addRater($appr_id, 0, $code_id);
428 $this->
ctrl->setParameter($this->parent,
"appr_id", $appr_id);
430 $this->
ctrl->setParameter($this,
"rater_id",
"a" . $code_id);
431 $this->
ctrl->redirect($this,
"mailRaters");
433 $this->
ctrl->redirect($this->parent,
"editRaters");
◆ addFromSearch()
ilSurveyRaterGUI::addFromSearch |
( |
array |
$user_ids | ) |
|
Definition at line 436 of file class.ilSurveyRaterGUI.php.
References $access, $ilUser, $user, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().
445 $appr_id = $this->parent->handleRatersAccess();
447 foreach ($user_ids as $user_id) {
449 if ($ilAccess->checkAccess(
"write",
"", $this->survey->getRefId()) ||
450 $this->survey->get360SelfEvaluation() ||
451 $user_id !=
$ilUser->getId()) {
452 if ($appr_id != $user_id) {
453 $this->survey->addRater($appr_id, $user_id);
454 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
456 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"svy_appraisses_cannot_be_raters"),
true);
463 $user_str = implode(
";", array_map(
static function ($u):
string {
467 $this->
ctrl->setParameter($this->parent,
"appr_id", $appr_id);
469 $this->
ctrl->setParameter($this,
"rater_id", $user_str);
470 $this->
ctrl->redirect($this,
"mailRaters");
472 $this->
ctrl->redirect($this->parent,
"editRaters");
◆ addRater()
Definition at line 223 of file class.ilSurveyRaterGUI.php.
References $access, $ilUser, $user, ilObjUser\_lookupId(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getInput(), and ILIAS\Repository\lng().
Referenced by continue().
229 $appr_id = $this->parent->handleRatersAccess();
233 if ($ilAccess->checkAccess(
"write",
"", $this->survey->getRefId()) ||
234 $this->survey->get360SelfEvaluation() ||
235 $user_id !==
$ilUser->getId()) {
236 if ($appr_id !== $user_id) {
237 $this->survey->addRater($appr_id, $user_id);
238 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
240 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"svy_appraisses_cannot_be_raters"),
true);
245 $this->main_tpl->setOnScreenMessage(
247 $this->
lng->txt(
"svy_user_not_found") .
" (" .
$user .
")",
252 $this->
ctrl->setParameter($this->parent,
"appr_id", $appr_id);
254 $this->
ctrl->setParameter($this,
"rater_id",
"u" . $user_id);
255 $this->
ctrl->redirect($this,
"mailRaters");
257 $this->
ctrl->redirect($this->parent,
"editRaters");
static _lookupId($a_user_str)
◆ cancel()
ilSurveyRaterGUI::cancel |
( |
| ) |
|
|
protected |
◆ continue()
ilSurveyRaterGUI::continue |
( |
| ) |
|
|
protected |
◆ doAutoComplete()
ilSurveyRaterGUI::doAutoComplete |
( |
| ) |
|
Definition at line 180 of file class.ilSurveyRaterGUI.php.
References exit, ilUserAutoComplete\MAX_ENTRIES, and ilUserAutoComplete\PRIVACY_MODE_RESPECT_USER_SETTING.
182 $fields = array(
'login',
'firstname',
'lastname',
'email');
185 $auto->setSearchFields($fields);
186 $auto->setResultField(
'login');
187 $auto->enableFieldSearchableCheck(
true);
188 $auto->setMoreLinkAvailable(
true);
191 if ($this->edit_request->getFetchAll()) {
195 echo $auto->getList($this->edit_request->getTerm());
const PRIVACY_MODE_RESPECT_USER_SETTING
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ executeCommand()
ilSurveyRaterGUI::executeCommand |
( |
| ) |
|
Definition at line 64 of file class.ilSurveyRaterGUI.php.
References $ctrl, ILIAS\Repository\ctrl(), and ilCtrl\getNextClass().
71 switch ($next_class) {
73 case 'ilrepositorysearchgui':
76 $this->
ctrl->setParameter($this,
"rate360", 1);
77 $this->
ctrl->saveParameter($this,
"appr_id");
79 $rep_search->setCallback(
86 $this->
ctrl->setReturn($this,
'add');
87 $this->
ctrl->forwardCommand($rep_search);
91 if (in_array($cmd, [
"add",
getCmd(string $fallback_command=null)
getNextClass($a_gui_class=null)
◆ initMailRatersForm()
ilSurveyRaterGUI::initMailRatersForm |
( |
int |
$appr_id, |
|
|
array |
$rec_ids |
|
) |
| |
Definition at line 269 of file class.ilSurveyRaterGUI.php.
References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilCustomInputGUI\setHtml(), and ilFormPropertyGUI\setRequired().
Referenced by mailRatersAction().
274 $form->setFormAction($this->
ctrl->getFormAction($this,
"mailRatersAction"));
275 $form->setTitle($this->
lng->txt(
'compose'));
277 $all_data = $this->survey->getRatersData($appr_id);
280 foreach ($rec_ids as $rec_id) {
281 if (isset($all_data[$rec_id])) {
282 $rec_data[] = $all_data[$rec_id][
"lastname"] .
", " .
283 $all_data[$rec_id][
"firstname"] .
284 " (" . $all_data[$rec_id][
"email"] .
")";
289 $rec->
setHtml(implode(
"<br />", $rec_data));
290 $form->addItem($rec);
293 $subject->setSize(50);
294 $subject->setRequired(
true);
295 $form->addItem($subject);
297 $existingdata = $this->survey->getExternalCodeRecipients();
298 $existingcolumns = array();
299 if (count($existingdata)) {
300 $first = array_shift($existingdata);
301 foreach ($first as
$key => $value) {
302 if (strcmp(
$key,
'code') !== 0 && strcmp(
$key,
'email') !== 0 && strcmp(
$key,
'sent') !== 0) {
303 $existingcolumns[] =
'[' .
$key .
']';
308 $mailmessage_u =
new ilTextAreaInputGUI($this->
lng->txt(
'survey_360_rater_message_content_registered'),
'message_u');
310 $mailmessage_u->setCols(80);
311 $mailmessage_u->setRows(10);
312 $form->addItem($mailmessage_u);
314 $mailmessage_a =
new ilTextAreaInputGUI($this->
lng->txt(
'survey_360_rater_message_content_anonymous'),
'message_a');
316 $mailmessage_a->setCols(80);
317 $mailmessage_a->setRows(10);
318 $mailmessage_a->setInfo(sprintf($this->
lng->txt(
'message_content_info'), implode(
', ', $existingcolumns)));
319 $form->addItem($mailmessage_a);
322 $recf->setValue(implode(
";", $rec_ids));
323 $form->addItem($recf);
325 $form->addCommandButton(
"mailRatersAction", $this->
lng->txt(
"send"));
326 $form->addCommandButton(
"cancel", $this->
lng->txt(
"svy_dont_send"));
328 $subject->setValue(sprintf($this->
lng->txt(
'survey_360_rater_subject_default'), $this->survey->getTitle()));
329 $mailmessage_u->setValue($this->
lng->txt(
'survey_360_rater_message_content_registered_default'));
330 $mailmessage_a->setValue($this->
lng->txt(
'survey_360_rater_message_content_anonymous_default'));
This class represents a text area property in a property form.
◆ initOptionSelectForm()
ilSurveyRaterGUI::initOptionSelectForm |
( |
| ) |
|
Definition at line 119 of file class.ilSurveyRaterGUI.php.
References $ctrl, $email, $lng, ilSubEnabledFormPropertyGUI\addSubItem(), ILIAS\Repository\lng(), and ilRadioOption\setValue().
Referenced by add(), and continue().
124 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
132 $radg->addOption($op1);
135 $user = new \ilTextInputGUI(
$lng->
txt(
"obj_user"),
"user");
136 $user->setDataSource(
144 $user->setRequired(
true);
145 $user->setMulti(
false);
150 $radg->addOption($op2);
153 $radg->addOption($op3);
156 $email->setRequired(
true);
161 $op3->addSubItem($lname);
165 $op3->addSubItem($fname);
168 $form->addItem($radg);
171 $form->addCommandButton(
"continue",
$lng->
txt(
"svy_save_and_continue"));
172 $form->addCommandButton(
"cancel",
$lng->
txt(
"cancel"));
174 $form->setTitle(
$lng->
txt(
"svy_add_rater"));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setValue(string $a_value)
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
◆ mailRaters()
Definition at line 261 of file class.ilSurveyRaterGUI.php.
References ILIAS\Repository\ctrl().
263 $appr_id = $this->parent->handleRatersAccess();
264 $this->
ctrl->setParameterByClass(
"ilSurveyParticipantsGUI",
"appr_id", $appr_id);
265 $this->
ctrl->setParameterByClass(
"ilSurveyParticipantsGUI",
"rater_id", $this->edit_request->getRaterId());
266 $this->
ctrl->redirectByClass(
"ilSurveyParticipantsGUI",
"mailRaters");
◆ mailRatersAction()
ilSurveyRaterGUI::mailRatersAction |
( |
| ) |
|
Definition at line 336 of file class.ilSurveyRaterGUI.php.
References $ilUser, $url, $user, ilLink\_getStaticLink(), ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), initMailRatersForm(), and ILIAS\Repository\lng().
340 $appr_id = $this->parent->handleRatersAccess();
341 $this->
ctrl->setParameter($this,
"appr_id", $appr_id);
343 $rec_ids = $this->edit_request->getRaterIds();
344 if (count($rec_ids) === 0) {
345 $this->
ctrl->redirect($this,
"editRaters");
349 if ($form->checkInput()) {
350 $txt_u = $form->getInput(
"message_u");
351 $txt_a = $form->getInput(
"message_a");
352 $subj = $form->getInput(
"subject");
355 $sender_id = (trim(
$ilUser->getEmail()))
359 $all_data = $this->survey->getRatersData($appr_id);
360 foreach ($rec_ids as $rec_id) {
361 if (isset($all_data[$rec_id])) {
362 $user = $all_data[$rec_id];
365 if (strpos($rec_id,
"a") === 0) {
368 $rcp =
$user[
"email"];
373 $user[
"code"] = $this->
lng->txt(
"survey_code_mail_on_demand");
375 $rcp =
$user[
"login"];
378 $mytxt = str_replace(
379 [
"[lastname]",
"[firstname]",
"[url]",
"[code]"],
384 $mail =
new ilMail($sender_id);
394 $this->survey->set360RaterSent(
396 (strpos($rec_id,
"a") === 0) ? 0 : (
int) substr($rec_id, 1),
397 (strpos($rec_id,
"u") === 0) ? 0 : (
int) substr($rec_id, 1)
402 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"mail_sent"),
true);
403 $this->
ctrl->redirect($this->parent,
"editRaters");
406 $form->setValuesByPost();
initMailRatersForm(int $appr_id, array $rec_ids)
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
Get static link.
◆ $access
◆ $ctrl
ilCtrl ilSurveyRaterGUI::$ctrl |
|
protected |
◆ $edit_request
ILIAS Survey Editing EditingGUIRequest ilSurveyRaterGUI::$edit_request |
|
protected |
◆ $lng
◆ $main_tpl
◆ $parent
◆ $refinery
ILIAS Refinery Factory ilSurveyRaterGUI::$refinery |
|
protected |
◆ $survey
◆ $tabs
◆ $ui
ILIAS DI UIServices ilSurveyRaterGUI::$ui |
|
protected |
◆ $user
The documentation for this class was generated from the following file: