ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjSurveyGUI Class Reference

ilObjSurveyGUI: ilSurveyEvaluationGUI, ilSurveyExecutionGUI ilObjSurveyGUI: ilObjectMetaDataGUI, ilPermissionGUI ilObjSurveyGUI: ilInfoScreenGUI, ilObjectCopyGUI ilObjSurveyGUI: ilSurveySkillDeterminationGUI ilObjSurveyGUI: ilCommonActionDispatcherGUI, ilSurveySkillGUI ilObjSurveyGUI: ilSurveyEditorGUI, ilSurveyConstraintsGUI ilObjSurveyGUI: ilSurveyParticipantsGUI, ilLearningProgressGUI ilObjSurveyGUI: ilExportGUI, ilLTIProviderObjectSettingGUI ilObjSurveyGUI: ILIAS More...

+ Inheritance diagram for ilObjSurveyGUI:
+ Collaboration diagram for ilObjSurveyGUI:

Public Member Functions

 executeCommand ()
 
 evaluationObject ()
 Redirects the evaluation object call to the ilSurveyEvaluationGUI class Coming from ListGUI... More...
 
 savePropertiesObject ()
 
 initPropertiesForm ()
 
 addSubTabs (string $a_section)
 
 propertiesObject (?ilPropertyFormGUI $a_form=null)
 Display the properties form. More...
 
 doAutoCompleteObject ()
 
 importSurveyObject ()
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreen ()
 show information screen More...
 
 getUserResultsTable (int $a_active_id)
 
 sendUserResultsMail (int $a_active_id, string $a_recipient)
 
 mailUserResultsObject ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 redirect script More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 noPermission ()
 
 addToNavigationHistory ()
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 afterSave (ilObject $new_object)
 
 getTabs ()
 
 addLocatorItems ()
 
 viewUserResultsObject ()
 
 getUserResultsPlain (int $a_active_id)
 
 checkRbacOrPositionPermission (string $a_rbac_permission, string $a_position_permission)
 
 runObject ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

InternalGUIService $gui
 
ILIAS Survey Execution ExecutionGUIRequest $execution_request
 
ILIAS Survey Editing EditingGUIRequest $edit_request
 
ilNavigationHistory $nav_history
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
ilLogger $log
 
Participants InvitationsManager $invitation_manager
 
ILIAS Survey InternalService $survey_service
 
ILIAS Survey Mode FeatureConfig $feature_config = null
 
ILIAS Survey Access AccessManager $access_manager = null
 
ILIAS Survey Execution RunManager $run_manager
 
ILIAS Survey Participants StatusManager $status_manager
 
ilObjSurvey $survey = null
 
ilRbacSystem $rbacsystem
 
ilMailMimeSenderFactory $senderFactory
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjSurveyGUI::_goto ( string  $a_target)
static

redirect script

Exceptions
ilCtrlException

Definition at line 754 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\$ctrl, $DIC, ilObjectGUI\$lng, ilObjectGUI\$ref_id, ilObjectGUI\$request, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\getId(), ILIAS\Repository\int(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), and ilLanguage\txt().

756  : void {
757  global $DIC;
758  $main_tpl = $DIC->ui()->mainTemplate();
759  $request = $DIC->survey()->internal()->gui()->execution()->request();
760  $a_access_code = $request->getAccessCode();
761 
762  $ilAccess = $DIC->access();
763  $lng = $DIC->language();
764  $ctrl = $DIC->ctrl();
765 
766  $t_arr = explode("_", $a_target);
767  $ref_id = (int) $t_arr[0];
768  if ($a_access_code === "" && isset($t_arr[1])) {
769  $a_access_code = $t_arr[1];
770  }
771  // see ilObjSurveyAccess::_checkGoto()
772  if ($a_access_code !== '') {
773  $sess = $DIC->survey()->internal()->repo()
774  ->execution()->runSession();
775  $sess->setCode(ilObject::_lookupObjId($ref_id), $a_access_code);
776  $ctrl->setParameterByClass("ilObjSurveyGUI", "ref_id", $ref_id);
777  $ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
778  }
779 
780  // write permission -> info screen
781  if ($ilAccess->checkAccess("write", "", $ref_id)) {
782  $ctrl->setParameterByClass("ilObjSurveyGUI", "ref_id", $ref_id);
783  $ctrl->redirectByClass("ilObjSurveyGUI", "run");
784  }
785 
786  // read permission, evaluation access and finished run -> evaluation
787  if ($ilAccess->checkAccess("visible", "", $ref_id) ||
788  $ilAccess->checkAccess("read", "", $ref_id)) {
789  $domain_service = $DIC->survey()->internal()->domain();
790  $am = $domain_service->access($ref_id, $DIC->user()->getId());
791  $survey = new ilObjSurvey($ref_id);
792  $run_manager = $domain_service->execution()->run($survey, $DIC->user()->getId());
793  if ($am->canAccessEvaluation()) {
794  $ctrl->setParameterByClass("ilObjSurveyGUI", "ref_id", $ref_id);
795  $ctrl->redirectByClass(["ilObjSurveyGUI", "ilSurveyEvaluationGUI"], "openEvaluation");
796  }
797  $ctrl->setParameterByClass("ilObjSurveyGUI", "ref_id", $ref_id);
798  $ctrl->redirectByClass("ilObjSurveyGUI", "run");
799  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
800  $main_tpl->setOnScreenMessage('failure', sprintf(
801  $lng->txt("msg_no_perm_read_item"),
803  ), true);
805  }
806  }
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
ILIAS Survey Execution RunManager $run_manager
setParameterByClass(string $a_class, string $a_parameter, $a_value)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
static _lookupObjId(int $ref_id)
ilLanguage $lng
static _lookupTitle(int $obj_id)
ServerRequestInterface $request
global $DIC
Definition: shib_login.php:22
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSurveyGUI::addLocatorItems ( )
protected

Definition at line 706 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\$requested_ref_id, SurveyQuestion\_getQuestionType(), SurveyQuestion\_getTitle(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

706  : void
707  {
708  $ilLocator = $this->gui->locator();
709  switch ($this->ctrl->getCmd()) {
710  case "next":
711  case "previous":
712  case "start":
713  case "resume":
714  case "infoScreen":
715  case "redirectQuestion":
716  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $this->requested_ref_id);
717  break;
718  case "evaluation":
719  case "checkEvaluationAccess":
720  case "evaluationdetails":
721  case "evaluationuser":
722  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass("ilsurveyevaluationgui", "evaluation"), "", $this->requested_ref_id);
723  break;
724  case "create":
725  case "save":
726  case "cancel":
727  case "importSurvey":
728  case "cloneAll":
729  break;
730  default:
731  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $this->requested_ref_id);
732 
733  // this has to be done here because ilSurveyEditorGUI is called after finalizing the locator
734  if ($this->edit_request->getQuestionId() > 0 &&
735  !$this->edit_request->getNewForSurvey()) {
736  // not on create
737  // see ilObjSurveyQuestionPool::addLocatorItems
738  $q_id = $this->edit_request->getQuestionId();
739  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
740  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
741  $ilLocator->addItem(
743  $this->ctrl->getLinkTargetByClass(array("ilSurveyEditorGUI", $q_type), "editQuestion")
744  );
745  }
746  break;
747  }
748  }
static _getQuestionType(int $question_id)
Returns the question type of a question with a given id.
static _getTitle(int $question_id)
Returns the question title of a question with a given id.
+ Here is the call graph for this function:

◆ addSubTabs()

ilObjSurveyGUI::addSubTabs ( string  $a_section)

Definition at line 570 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

Referenced by executeCommand(), and propertiesObject().

572  : void {
573  if ($a_section === 'settings') {
574  $this->tabs_gui->addSubTabTarget(
575  "settings",
576  $this->ctrl->getLinkTarget($this, 'properties')
577  );
578 
579  $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
580  if ($lti_settings->hasSettingsAccess()) {
581  $this->tabs_gui->addSubTabTarget(
582  'lti_provider',
583  $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
584  );
585  }
586  }
587  }
GUI class for LTI provider object settings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addToNavigationHistory()

ilObjSurveyGUI::addToNavigationHistory ( )
protected

Definition at line 311 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ilObjectGUI\getCreationMode().

Referenced by executeCommand().

311  : void
312  {
313  $external_rater = $this->status_manager->isExternalRater();
314  // add entry to navigation history
315  if (!$external_rater && !$this->getCreationMode() &&
316  $this->checkPermissionBool("read")) {
317  $this->ctrl->setParameterByClass("ilobjsurveygui", "ref_id", $this->ref_id);
318  $link = $this->ctrl->getLinkTargetByClass("ilobjsurveygui", "infoScreen");
319  $this->nav_history->addItem($this->ref_id, $link, "svy");
320  }
321  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilObjSurveyGUI::afterSave ( ilObject  $new_object)
protected

Definition at line 351 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\$data, ilObjSurvey\ANONYMIZE_CODE_ALL, ilObjSurvey\EVALUATION_ACCESS_PARTICIPANTS, ilObject\getRefId(), ILIAS\Repository\lng(), ilObjSurvey\MODE_360, ilObjSurvey\MODE_IND_FEEDB, ilObjSurvey\MODE_SELF_EVAL, and ilUtil\redirect().

351  : void
352  {
353  $form = $this
354  ->initCreateForm($this->requested_new_type)
355  ->withRequest($this->request);
356  $data = $form->getData();
357  $dtemplate = $data["didactic_templates"];
358 
359  // #16446
360  $new_object->loadFromDb();
361 
362  // set the mode depending on didactic template
363  if (str_starts_with($dtemplate, "svy360_")) {
364  $new_object->setMode(ilObjSurvey::MODE_360);
365  } elseif (str_starts_with($dtemplate, "svyselfeval_")) {
366  $new_object->setMode(ilObjSurvey::MODE_SELF_EVAL);
367  } elseif (str_starts_with($dtemplate, "individfeedb_")) {
368  $new_object->setMode(ilObjSurvey::MODE_IND_FEEDB);
369  }
370 
371  $svy_mode = $new_object->getMode();
372  if ($svy_mode === ilObjSurvey::MODE_360) {
373  // this should rather be ilObjSurvey::ANONYMIZE_ON - see ilObjSurvey::getUserDataFromActiveId()
374  $new_object->setAnonymize(ilObjSurvey::ANONYMIZE_CODE_ALL);
375  $new_object->setEvaluationAccess(ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS);
376  } elseif ($svy_mode === ilObjSurvey::MODE_SELF_EVAL) {
377  $new_object->setEvaluationAccess(ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS);
378  }
379  $new_object->saveToDB();
380 
381  // always send a message
382  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
383  ilUtil::redirect("ilias.php?baseClass=ilObjSurveyGUI&ref_id=" .
384  $new_object->getRefId() . "&cmd=properties");
385  }
const EVALUATION_ACCESS_PARTICIPANTS
static redirect(string $a_script)
const ANONYMIZE_CODE_ALL
+ Here is the call graph for this function:

◆ checkRbacOrPositionPermission()

ilObjSurveyGUI::checkRbacOrPositionPermission ( string  $a_rbac_permission,
string  $a_position_permission 
)
protected
Todo:
move to access manager

Definition at line 1046 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\$access, $GLOBALS, ilOrgUnitPositionAndRBACAccessHandler\checkRbacOrPositionPermissionAccess(), and ILIAS\Repository\object().

Referenced by executeCommand().

1049  : bool {
1050  $access = $GLOBALS['DIC']->access();
1052  $a_rbac_permission,
1053  $a_position_permission,
1054  $this->object->getRefId()
1055  );
1056  }
checkRbacOrPositionPermissionAccess(string $rbac_perm, string $pos_perm, int $ref_id)
$GLOBALS["DIC"]
Definition: wac.php:53
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doAutoCompleteObject()

ilObjSurveyGUI::doAutoCompleteObject ( )

Definition at line 616 of file class.ilObjSurveyGUI.php.

References exit, ilUserAutoComplete\MAX_ENTRIES, and ilUtil\stripSlashes().

616  : void
617  {
618  $fields = array('login','firstname','lastname','email');
619 
620  $auto = new ilUserAutoComplete();
621  $auto->setSearchFields($fields);
622  $auto->setResultField('login');
623  $auto->enableFieldSearchableCheck(true);
624  $auto->setMoreLinkAvailable(true);
625 
626  if ($this->edit_request->getFetchAll()) {
627  $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
628  }
629 
630  echo $auto->getList(ilUtil::stripSlashes($this->edit_request->getTerm()));
631  exit();
632  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ evaluationObject()

ilObjSurveyGUI::evaluationObject ( )

Redirects the evaluation object call to the ilSurveyEvaluationGUI class Coming from ListGUI...

Definition at line 327 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\ctrl().

327  : void
328  {
329  $eval_gui = new ilSurveyEvaluationGUI($this->survey);
330  $this->ctrl->redirect($eval_gui, "openEvaluation");
331  }
Survey evaluation graphical output.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSurveyGUI::executeCommand ( )

Definition at line 124 of file class.ilObjSurveyGUI.php.

References $access_manager, $GLOBALS, $survey, $tabs, ilObjSurveyAccess\_hasEvaluationAccess(), ilObjectGUI\addHeaderAction(), addSubTabs(), addToNavigationHistory(), ilObjectGUI\checkPermission(), checkRbacOrPositionPermission(), ILIAS\Repository\ctrl(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, noPermission(), ILIAS\Repository\object(), ilObjectGUI\prepareOutput(), ILIAS\Repository\rbac(), ilLTIProviderObjectSettingGUI\setCustomRolesForSelection(), and ILIAS\Repository\user().

124  : void
125  {
126  $ilTabs = $this->tabs;
129  if ($survey) {
130  if (!$access_manager->canAccessInfoScreen()) {
131  $this->noPermission();
132  }
133  $this->addToNavigationHistory();
134  }
135 
136  $cmd = $this->ctrl->getCmd("properties");
137 
138 
139  // deep link from repository - "redirect" to page view
140  if (!$this->ctrl->getCmdClass() && $cmd === "questionsrepo") {
141  $this->ctrl->setParameterByClass("ilsurveyeditorgui", "pgov", "1");
142  $this->ctrl->redirectByClass("ilsurveyeditorgui", "questions");
143  }
144 
145  $next_class = $this->ctrl->getNextClass($this);
146  if ($next_class !== "") {
147  $this->ctrl->setReturn($this, "properties");
148  }
149  // deprecated, moved for less file
150  //$this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "components/ILIAS/Survey"), "screen");
151  $this->prepareOutput();
152 
153  $this->log->debug("next_class= $next_class");
154  switch ($next_class) {
155  case 'illtiproviderobjectsettinggui':
156  $this->addSubTabs('settings');
157  $ilTabs->activateTab("settings");
158  $ilTabs->activateSubTab('lti_provider');
159  $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
160  $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
161  $lti_gui->offerLTIRolesForSelection(false);
162  $this->ctrl->forwardCommand($lti_gui);
163  break;
164 
165 
166  case "ilinfoscreengui":
167  if (!in_array(
168  $this->ctrl->getCmdClass(),
169  array('ilpublicuserprofilegui', 'ilobjportfoliogui')
170  )) {
171  $this->addHeaderAction();
172  $this->infoScreen(); // forwards command
173  } else {
174  // #16891
175  $ilTabs->clearTargets();
176  $info = new ilInfoScreenGUI($this);
177  $this->ctrl->forwardCommand($info);
178  }
179  break;
180 
181  case 'ilobjectmetadatagui':
182  $this->checkPermission("write");
183  $ilTabs->activateTab("meta_data");
184  $this->addHeaderAction();
185  $md_gui = new ilObjectMetaDataGUI($this->object);
186  $this->ctrl->forwardCommand($md_gui);
187  break;
188 
189  case "ilsurveyevaluationgui":
190 
191  if ($this->checkRbacOrPositionPermission('read_results', 'access_results') ||
192  ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $this->user->getId())) {
193  $ilTabs->activateTab("svy_results");
194  $this->addHeaderAction();
195  $eval_gui = new ilSurveyEvaluationGUI($survey);
196  $this->ctrl->forwardCommand($eval_gui);
197  }
198  break;
199 
200  case "ilsurveyexecutiongui":
201  $ilTabs->clearTargets();
202  $exec_gui = new ilSurveyExecutionGUI($survey);
203  $this->ctrl->forwardCommand($exec_gui);
204  break;
205 
206  case 'ilpermissiongui':
207  $ilTabs->activateTab("perm_settings");
208  $this->addHeaderAction();
209  $perm_gui = new ilPermissionGUI($this);
210  $this->ctrl->forwardCommand($perm_gui);
211  break;
212 
213  case 'ilobjectcopygui':
214  $cp = new ilObjectCopyGUI($this);
215  $cp->setType('svy');
216  $this->ctrl->forwardCommand($cp);
217  break;
218 
219  case "ilcommonactiondispatchergui":
221  $this->ctrl->forwardCommand($gui);
222  break;
223 
224  // 360, skill service
225  case 'ilsurveyskillgui':
226  $ilTabs->activateTab("survey_competences");
228  $this->ctrl->forwardCommand($gui);
229  break;
230 
231  case 'ilsurveyskilldeterminationgui':
232  $ilTabs->activateTab("maintenance");
234  $this->ctrl->forwardCommand($gui);
235  break;
236 
237  case 'ilsurveyeditorgui':
238  $this->checkPermission("write");
239  $ilTabs->activateTab("survey_questions");
240  $gui = new ilSurveyEditorGUI($this);
241  $this->ctrl->forwardCommand($gui);
242  break;
243 
244  case 'ilsurveyconstraintsgui':
245  $this->checkPermission("write");
246  $ilTabs->activateTab("constraints");
247  $gui = new ilSurveyConstraintsGUI($this);
248  $this->ctrl->forwardCommand($gui);
249  break;
250 
251  case 'ilsurveyparticipantsgui':
252  if (!$this->feature_config->usesAppraisees()) {
253  $ilTabs->activateTab("maintenance");
254  } else {
255  $ilTabs->activateTab("survey_360_appraisees");
256  }
257  $gui = new ilSurveyParticipantsGUI($this, $this->checkRbacOrPositionPermission('read_results', 'access_results'));
258  $this->ctrl->forwardCommand($gui);
259  break;
260 
261  case "illearningprogressgui":
262  $ilTabs->activateTab("learning_progress");
263  $new_gui = new ilLearningProgressGUI(
265  $this->object->getRefId()
266  );
267  $this->ctrl->forwardCommand($new_gui);
268  break;
269 
270  case 'ilexportgui':
271  $ilTabs->activateTab("export");
272  $exp_gui = new ilExportGUI($this);
273  $exp_gui->addFormat("xml");
274  $this->ctrl->forwardCommand($exp_gui);
275  break;
276 
277  case strtolower(\ILIAS\Survey\Execution\LaunchGUI::class):
278  $ilTabs->activateTab("run");
279  $this->ctrl->forwardCommand(
280  $this->gui->execution()->launchGUI(
281  $this->survey
282  )
283  );
284  break;
285 
286  default:
287  $this->addHeaderAction();
288  $cmd .= "Object";
289 
290  $this->log->debug("Default cmd= $cmd");
291 
292  $this->$cmd();
293  break;
294  }
295 
296  if (strtolower($this->edit_request->getBaseClass()) !== "iladministrationgui" &&
297  $this->getCreationMode() !== true) {
298  $this->tpl->printToStdout();
299 
300  //cherry pick conflict with d97cf1c77b
301  //$this->tpl->show();
302  //$this->log->debug("after tpl show");
303  }
304  }
Class ilSurveyParticipantsGUI.
Class ilObjectMetaDataGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilSurveyEditorGUI.
GUI class for the workflow of copying objects.
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer Contains several chained tasks and infos about them.
InternalGUIService $gui
addSubTabs(string $a_section)
$GLOBALS["DIC"]
Definition: wac.php:53
GUI class for LTI provider object settings.
Survey execution graphical output.
ILIAS Survey Access AccessManager $access_manager
infoScreen()
show information screen
static _hasEvaluationAccess(int $a_obj_id, int $user_id)
setCustomRolesForSelection(array $a_roles)
Set custom roles for mapping to LTI roles.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Survey evaluation graphical output.
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
checkRbacOrPositionPermission(string $a_rbac_permission, string $a_position_permission)
+ Here is the call graph for this function:

◆ getTabs()

ilObjSurveyGUI::getTabs ( )
protected

Definition at line 387 of file class.ilObjSurveyGUI.php.

References $feature_config, $help, ilObjectGUI\$user, ilLearningProgressAccess\checkAccess(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObjSurvey\MODE_STANDARD, and ILIAS\Repository\object().

387  : void
388  {
389  $ilUser = $this->user;
390  $ilHelp = $this->help;
392 
393  if (is_null($this->object)) {
394  return;
395  }
396 
397  // @todo investigate, if this can still be the case
398  if ($this->object instanceof ilObjSurveyQuestionPool) {
399  return;
400  }
401 
402  $ilHelp->setScreenIdComponent("svy");
403 
404  if ($this->checkPermissionBool("read")) {
405  $this->tabs_gui->addTab(
406  "run",
407  $this->lng->txt("obj_svy"),
408  $this->ctrl->getLinkTarget($this, 'run')
409  );
410  }
411 
412  if ($this->checkPermissionBool("write")) {
413  $this->tabs_gui->addTab(
414  "survey_questions",
415  $this->lng->txt("survey_questions"),
416  $this->ctrl->getLinkTargetByClass(array("ilsurveyeditorgui"), "questions")
417  );
418  }
419 
420  if ($this->checkPermissionBool("read")) {
421  $this->tabs_gui->addTab(
422  "info_short",
423  $this->lng->txt("info_short"),
424  $this->ctrl->getLinkTarget($this, 'infoScreen')
425  );
426  }
427 
428  // properties
429  if ($this->checkPermissionBool("write")) {
430  $this->tabs_gui->addTab(
431  "settings",
432  $this->lng->txt("settings"),
433  $this->ctrl->getLinkTarget($this, 'properties')
434  );
435  } elseif ($this->checkPermissionBool("read")) {
436  if ($this->feature_config->usesAppraisees() &&
437  $this->object->get360SelfRaters() &&
438  $this->object->isAppraisee($ilUser->getId()) &&
439  !$this->object->isAppraiseeClosed($ilUser->getId())) {
440  $this->tabs_gui->addTab(
441  "survey_360_edit_raters",
442  $this->lng->txt("survey_360_edit_raters"),
443  $this->ctrl->getLinkTargetByClass('ilsurveyparticipantsgui', 'editRaters')
444  );
445 
446  // :TODO: mail to raters
447  }
448  }
449 
450  // questions
451  if ($this->checkPermissionBool("write") &&
452  $this->object->getMode() === ilObjSurvey::MODE_STANDARD) {
453  // constraints (tab called routing)
454  $this->tabs_gui->addTab(
455  "constraints",
456  $this->lng->txt("constraints"),
457  $this->ctrl->getLinkTargetByClass("ilsurveyconstraintsgui", "constraints")
458  );
459  }
460 
461  if ($this->checkPermissionBool("write")) {
462  if ($feature_config && $feature_config->supportsCompetences()) {
463  $skmg_set = new ilSkillManagementSettings();
464  if ($this->object->getSkillService() && $skmg_set->isActivated()) {
465  $this->tabs_gui->addTab(
466  "survey_competences",
467  $this->lng->txt("survey_competences"),
468  $this->ctrl->getLinkTargetByClass("ilsurveyskillgui", "listQuestionAssignment")
469  );
470  }
471  }
472 
473  if ($feature_config && $feature_config->usesAppraisees()) {
474  $this->tabs_gui->addTab(
475  "survey_360_appraisees",
476  $this->lng->txt("survey_360_appraisees"),
477  $this->ctrl->getLinkTargetByClass('ilsurveyparticipantsgui', 'listAppraisees')
478  );
479  } else {
480  $this->tabs_gui->addTab(
481  "maintenance",
482  $this->lng->txt("svy_participants"),
483  $this->ctrl->getLinkTargetByClass('ilsurveyparticipantsgui', 'maintenance')
484  );
485  }
486  }
487 
488  if ($this->access_manager->canAccessEvaluation()) {
489  // evaluation
490  $this->tabs_gui->addTab(
491  "svy_results",
492  $this->lng->txt("svy_results"),
493  $this->ctrl->getLinkTargetByClass("ilsurveyevaluationgui", "openEvaluation")
494  );
495  }
496 
497  // learning progress
498  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
499  $this->tabs_gui->addTarget(
500  "learning_progress",
501  $this->ctrl->getLinkTargetByClass(array("ilobjsurveygui", "illearningprogressgui"), ""),
502  "",
503  array("illplistofobjectsgui", "illplistofsettingsgui", "illearningprogressgui", "illplistofprogressgui")
504  );
505  }
506 
507  if ($this->checkPermissionBool("write")) {
508  // meta data
509  $mdgui = new ilObjectMetaDataGUI($this->object);
510  $mdtab = $mdgui->getTab();
511  if ($mdtab) {
512  $this->tabs_gui->addTab(
513  "meta_data",
514  $this->lng->txt("meta_data"),
515  $mdtab
516  );
517  }
518 
519  // export
520  $this->tabs_gui->addTab(
521  "export",
522  $this->lng->txt("export"),
523  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
524  );
525  }
526 
527  if ($this->checkPermissionBool("edit_permission")) {
528  // permissions
529  $this->tabs_gui->addTab(
530  "perm_settings",
531  $this->lng->txt("perm_settings"),
532  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
533  );
534  }
535  }
ILIAS Survey Mode FeatureConfig $feature_config
Class ilObjectMetaDataGUI.
Class ilObjSurveyQuestionPool.
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ getUserResultsPlain()

ilObjSurveyGUI::getUserResultsPlain ( int  $a_active_id)
protected
Todo:
move to evaluation sub-service

Definition at line 888 of file class.ilObjSurveyGUI.php.

References $parts, $res, ilObjectGUI\$type, ILIAS\Repository\lng(), null, and ILIAS\Repository\object().

Referenced by sendUserResultsMail().

890  : string {
891  $res = array();
892 
893  $show_titles = (bool) $this->object->getShowQuestionTitles();
894 
895  foreach ($this->object->getSurveyPages() as $page) {
896  if (count($page) > 0) {
897  $res[] = "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
898 
899  // question block
900  if (count($page) > 1) {
901  if ($page[0]["questionblock_show_blocktitle"]) {
902  $res[$this->lng->txt("questionblock")] = trim($page[0]["questionblock_title"] ?? "") . "\n";
903  }
904  }
905 
906  // questions
907 
908  $page_res = array();
909 
910  foreach ($page as $question) {
911  $question_gui = $this->object->getQuestionGUI($question["type_tag"], $question["question_id"]);
912  $question_parts = array();
913 
914  // heading
915  if (strlen($question["heading"] ?? "")) {
916  $question_parts[$this->lng->txt("heading")] = trim($question["heading"] ?? "");
917  }
918 
919  if ($show_titles) {
920  $question_parts[$this->lng->txt("title")] = trim($question["title"] ?? "");
921  }
922 
923  if ($question["questionblock_show_questiontext"]) {
924  $question_parts[$this->lng->txt("question")] = trim(strip_tags($question_gui->object->getQuestionText()));
925  }
926 
927  $answers = $question_gui->getParsedAnswers(
928  $this->object->loadWorkingData($question["question_id"], $a_active_id),
929  true
930  );
931 
932  if (count($answers)) {
933  $multiline = false;
934  if (count($answers) > 1 ||
935  get_class($question_gui) === "SurveyTextQuestionGUI") {
936  $multiline = true;
937  }
938 
939  $parts = array();
940  foreach ($answers as $answer) {
941  $text = null;
942  if ($answer["textanswer"] ?? false) {
943  $text = ' ("' . $answer["textanswer"] . '")';
944  }
945  if (!isset($answer["cols"])) {
946  if (isset($answer["title"])) {
947  $parts[] = $answer["title"] . $text;
948  } elseif (isset($answer["value"])) {
949  $parts[] = $answer["value"];
950  } elseif ($text) {
951  $parts[] = substr($text, 2, -1);
952  }
953  }
954  // matrix
955  else {
956  $tmp = array();
957  foreach ($answer["cols"] as $col) {
958  $tmp[] = $col["title"];
959  }
960  $parts[] = $answer["title"] . ": " . implode(", ", $tmp) . $text;
961  }
962  }
963  $question_parts[$this->lng->txt("answer")] =
964  ($multiline ? "\n" : "") . implode("\n", $parts);
965  }
966 
967  $tmp = array();
968  foreach ($question_parts as $type => $value) {
969  $tmp[] = $type . ": " . $value;
970  }
971  $page_res[] = implode("\n", $tmp);
972  }
973 
974  $res[] = implode("\n\n-------------------------------\n\n", $page_res);
975  }
976  }
977 
978  $res[] = "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
979 
980  return implode("\n", $res);
981  }
$res
Definition: ltiservices.php:66
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserResultsTable()

ilObjSurveyGUI::getUserResultsTable ( int  $a_active_id)
Todo:
move to evaluation sub-service

Definition at line 811 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\object().

Referenced by viewUserResultsObject().

813  : string {
814  $rtpl = new ilTemplate("tpl.svy_view_user_results.html", true, true, "components/ILIAS/Survey");
815 
816  $show_titles = $this->object->getShowQuestionTitles();
817 
818  foreach ($this->object->getSurveyPages() as $page) {
819  if (count($page) > 0) {
820  // question block
821  if (count($page) > 1) {
822  if ($page[0]["questionblock_show_blocktitle"]) {
823  $rtpl->setVariable("BLOCK_TITLE", trim($page[0]["questionblock_title"] ?? ""));
824  }
825  }
826 
827  // questions
828  foreach ($page as $question) {
829  $question_gui = $this->object->getQuestionGUI($question["type_tag"], $question["question_id"]);
830  $rtpl->setCurrentBlock("question_bl");
831 
832  // heading
833  if (strlen($question["heading"] ?? "")) {
834  $rtpl->setVariable("HEADING", trim($question["heading"] ?? ""));
835  }
836 
837  $rtpl->setVariable(
838  "QUESTION_DATA",
839  $question_gui->getPrintView(
840  $show_titles,
841  (bool) $question["questionblock_show_questiontext"],
842  $this->object->getId(),
843  $this->object->loadWorkingData($question["question_id"], $a_active_id)
844  )
845  );
846 
847  $rtpl->parseCurrentBlock();
848  }
849 
850  $rtpl->setCurrentBlock("block_bl");
851  $rtpl->parseCurrentBlock();
852  }
853  }
854 
855  return $rtpl->get();
856  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importSurveyObject()

ilObjSurveyGUI::importSurveyObject ( )

Definition at line 634 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\$error, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObjectGUI\putObjectInTree(), ilUtil\redirect(), and ILIAS\UICore\GlobalTemplate\setContent().

634  : void
635  {
636  $tpl = $this->tpl;
637 
638  $new_type = $this->edit_request->getNewType();
639 
640  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
641  $this->checkPermission("create", "", $new_type);
642 
643  $this->lng->loadLanguageModule($new_type);
644  $this->ctrl->setParameter($this, "new_type", $new_type);
645 
646  $form = $this->initImportForm($new_type);
647  if ($form->checkInput()) {
648  $newObj = new ilObjSurvey();
649  $newObj->setType($new_type);
650  $newObj->setTitle("dummy");
651  $newObj->create(true);
652  $this->putObjectInTree($newObj);
653 
654  // copy uploaded file to import directory
655 
656  $this->log->debug("form->getInput(spl) = " . $form->getInput("spl"));
657 
658  $error = $newObj->importObject($_FILES["importfile"], (int) $form->getInput("spl"));
659  if ($error !== '') {
660  $newObj->delete();
661  $this->tpl->setOnScreenMessage('failure', $error);
662  return;
663  }
664 
665  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
666  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
667  "&baseClass=ilObjSurveyGUI");
668  }
669 
670  // display form to correct errors
671  $form->setValuesByPost();
672  $tpl->setContent($form->getHTML());
673  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
ilErrorHandling $error
static redirect(string $a_script)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ infoScreen()

ilObjSurveyGUI::infoScreen ( )

show information screen

Definition at line 693 of file class.ilObjSurveyGUI.php.

References $tabs, ILIAS\Repository\ctrl(), noPermission(), and ILIAS\Repository\toolbar().

Referenced by executeCommand().

693  : void
694  {
695  $ilTabs = $this->tabs;
696  if (!$this->access_manager->canAccessInfoScreen()) {
697  $this->noPermission();
698  }
699  $ilTabs->activateTab("info_short");
700 
701  $info = $this->survey_service->gui()->infoScreen($this, $this->toolbar);
702 
703  $this->ctrl->forwardCommand($info);
704  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjSurveyGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 685 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\ctrl().

685  : void
686  {
687  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
688  }
+ Here is the call graph for this function:

◆ initPropertiesForm()

ilObjSurveyGUI::initPropertiesForm ( )

Definition at line 563 of file class.ilObjSurveyGUI.php.

Referenced by propertiesObject().

564  {
565  $form = $this->survey_service
566  ->gui()->surveySettings($this->survey)->form("ilObjSurveyGUI");
567  return $form;
568  }
+ Here is the caller graph for this function:

◆ mailUserResultsObject()

ilObjSurveyGUI::mailUserResultsObject ( )

Definition at line 1018 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\$user, ILIAS\Repository\ctrl(), ilUtil\is_email(), ILIAS\Repository\lng(), and sendUserResultsMail().

1018  : void
1019  {
1020  $ilUser = $this->user;
1021 
1022  $anonymous_code = $this->run_manager->getCode();
1023  $active_id = $this->object->getActiveID($ilUser->getId(), $anonymous_code, 0);
1024  if (!$this->run_manager->hasFinished() ||
1025  !$active_id) {
1026  $this->ctrl->redirect($this, "infoScreen");
1027  }
1028 
1029  $recipient = $this->edit_request->getMail();
1030  if (!$recipient) {
1031  $recipient = $ilUser->getEmail();
1032  }
1033  if (!ilUtil::is_email($recipient)) {
1034  $this->ctrl->redirect($this, "infoScreen");
1035  }
1036 
1037  $this->sendUserResultsMail($active_id, $recipient);
1038 
1039  $this->tpl->setOnScreenMessage('success', $this->lng->txt("mail_sent"), true);
1040  $this->ctrl->redirect($this, "infoScreen");
1041  }
static is_email(string $a_email, ?ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
sendUserResultsMail(int $a_active_id, string $a_recipient)
+ Here is the call graph for this function:

◆ noPermission()

ilObjSurveyGUI::noPermission ( )
protected

Definition at line 306 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\lng().

Referenced by executeCommand(), and infoScreen().

306  : void
307  {
308  throw new ilObjectException($this->lng->txt("permission_denied"));
309  }
Base exception class for object service.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ propertiesObject()

ilObjSurveyGUI::propertiesObject ( ?ilPropertyFormGUI  $a_form = null)

Display the properties form.

Definition at line 593 of file class.ilObjSurveyGUI.php.

References $help, $tabs, addSubTabs(), ilObjectGUI\checkPermission(), initPropertiesForm(), and ILIAS\Repository\object().

Referenced by savePropertiesObject().

595  : void {
596  $ilTabs = $this->tabs;
597  $ilHelp = $this->help;
598 
599  $this->checkPermission("write");
600 
601  $this->addSubTabs('settings');
602  $ilTabs->activateTab("settings");
603  $ilTabs->activateSubTab('settings');
604 
605  if ($this->object->get360Mode()) {
606  $ilHelp->setScreenId("settings_360");
607  }
608 
609  if (!$a_form) {
610  $a_form = $this->initPropertiesForm();
611  }
612 
613  $this->tpl->setContent($a_form->getHTML());
614  }
addSubTabs(string $a_section)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ retrieveAdditionalDidacticTemplateOptions()

ilObjSurveyGUI::retrieveAdditionalDidacticTemplateOptions ( )
protected

Definition at line 333 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\lng().

333  : array
334  {
335  $a_options = [];
336  // JF, 2013-06-10
337  $a_options["svy360_1"] = array($this->lng->txt("survey_360_mode"),
338  $this->lng->txt("survey_360_mode_info"));
339 
340  //Self evaluation only
341  $a_options["svyselfeval_1"] = array($this->lng->txt("svy_self_ev_mode"),
342  $this->lng->txt("svy_self_ev_info"));
343 
344  // individual feedback
345  $a_options["individfeedb_1"] = array($this->lng->txt("svy_ind_feedb_mode"),
346  $this->lng->txt("svy_ind_feedb_info"));
347 
348  return $a_options;
349  }
+ Here is the call graph for this function:

◆ runObject()

ilObjSurveyGUI::runObject ( )
protected

Definition at line 1058 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\ctrl().

1058  : void
1059  {
1060  $this->ctrl->redirectByClass(
1061  \ILIAS\Survey\Execution\LaunchGUI::class
1062  );
1063  }
Interface Observer Contains several chained tasks and infos about them.
+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjSurveyGUI::savePropertiesObject ( )

Definition at line 542 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and propertiesObject().

542  : void
543  {
544  $settings_ui = $this->survey_service->gui()->surveySettings($this->survey);
545 
546  $form = $settings_ui->form("ilObjSurveyGUI");
547  if ($settings_ui->checkForm($form)) {
548  $settings_ui->saveForm($form);
549 
550  // settings change clear the code
551  // this is adopted from ILIAS 7, unsure if or when this is necessary
552  $this->run_manager->clearCode();
553 
554  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
555  $this->ctrl->redirect($this, "properties");
556  }
557 
558  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("form_input_not_valid"));
559  $form->setValuesByPost();
560  $this->propertiesObject($form);
561  }
propertiesObject(?ilPropertyFormGUI $a_form=null)
Display the properties form.
+ Here is the call graph for this function:

◆ sendUserResultsMail()

ilObjSurveyGUI::sendUserResultsMail ( int  $a_active_id,
string  $a_recipient 
)

Definition at line 983 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\$user, ilMail\_getInstallationSignature(), ilDatePresentation\formatDate(), ilMail\getSalutation(), getUserResultsPlain(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by mailUserResultsObject().

986  : void {
987  $ilUser = $this->user;
988 
989  $finished = $this->object->getSurveyParticipants(array($a_active_id));
990  $finished = array_pop($finished);
991  $finished = ilDatePresentation::formatDate(new ilDateTime($finished["finished_tstamp"], IL_CAL_UNIX));
992 
993  $body = ilMail::getSalutation($ilUser->getId()) . "\n\n";
994  $body .= $this->lng->txt("svy_mail_own_results_body") . "\n";
995  $body .= "\n" . $this->lng->txt("obj_svy") . ": " . $this->object->getTitle() . "\n";
996  $body .= ilLink::_getLink($this->object->getRefId(), "svy") . "\n";
997  $body .= "\n" . $this->lng->txt("survey_results_finished") . ": " . $finished . "\n\n";
998 
999  if ($this->object->hasMailOwnResults()) {
1000  $subject = "svy_mail_own_results_subject";
1001  $body .= $this->getUserResultsPlain($a_active_id);
1002  } else {
1003  $subject = "svy_mail_confirmation_subject";
1004  }
1005 
1006  // $body .= ilMail::_getAutoGeneratedMessageString($this->lng);
1008 
1009 
1010  $mmail = new ilMimeMail();
1011  $mmail->From($this->senderFactory->system());
1012  $mmail->To($a_recipient);
1013  $mmail->Subject(sprintf($this->lng->txt($subject), $this->object->getTitle()), true);
1014  $mmail->Body($body);
1015  $mmail->Send();
1016  }
const IL_CAL_UNIX
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
getUserResultsPlain(int $a_active_id)
static _getInstallationSignature()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ viewUserResultsObject()

ilObjSurveyGUI::viewUserResultsObject ( )
protected
Todo:
move to evaluation sub-service

Definition at line 861 of file class.ilObjSurveyGUI.php.

References ilObjectGUI\$html, $tabs, ilObjectGUI\$tpl, ilObjectGUI\$user, ILIAS\Repository\ctrl(), getUserResultsTable(), ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setContent().

861  : void
862  {
863  $ilUser = $this->user;
864  $tpl = $this->tpl;
865  $ilTabs = $this->tabs;
866 
867  $anonymous_code = $this->run_manager->getCode();
868  $active_id = $this->object->getActiveID($ilUser->getId(), $anonymous_code, 0);
869 
870  if (!$this->run_manager->hasFinished() ||
871  !$active_id) {
872  $this->ctrl->redirect($this, "infoScreen");
873  }
874 
875  $ilTabs->clearTargets();
876  $ilTabs->setBackTarget(
877  $this->lng->txt("btn_back"),
878  $this->ctrl->getLinkTarget($this, "infoScreen")
879  );
880 
881  $html = $this->getUserResultsTable($active_id);
883  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
getUserResultsTable(int $a_active_id)
+ Here is the call graph for this function:

Field Documentation

◆ $access_manager

ILIAS Survey Access AccessManager ilObjSurveyGUI::$access_manager = null
protected

Definition at line 45 of file class.ilObjSurveyGUI.php.

Referenced by executeCommand().

◆ $edit_request

ILIAS Survey Editing EditingGUIRequest ilObjSurveyGUI::$edit_request
protected

Definition at line 37 of file class.ilObjSurveyGUI.php.

◆ $execution_request

ILIAS Survey Execution ExecutionGUIRequest ilObjSurveyGUI::$execution_request
protected

Definition at line 36 of file class.ilObjSurveyGUI.php.

◆ $feature_config

ILIAS Survey Mode FeatureConfig ilObjSurveyGUI::$feature_config = null
protected

Definition at line 44 of file class.ilObjSurveyGUI.php.

Referenced by getTabs().

◆ $gui

InternalGUIService ilObjSurveyGUI::$gui
protected

Definition at line 35 of file class.ilObjSurveyGUI.php.

◆ $help

ilHelpGUI ilObjSurveyGUI::$help
protected

Definition at line 40 of file class.ilObjSurveyGUI.php.

Referenced by getTabs(), and propertiesObject().

◆ $invitation_manager

Participants InvitationsManager ilObjSurveyGUI::$invitation_manager
protected

Definition at line 42 of file class.ilObjSurveyGUI.php.

◆ $log

ilLogger ilObjSurveyGUI::$log
protected

Definition at line 41 of file class.ilObjSurveyGUI.php.

◆ $nav_history

ilNavigationHistory ilObjSurveyGUI::$nav_history
protected

Definition at line 38 of file class.ilObjSurveyGUI.php.

◆ $rbacsystem

ilRbacSystem ilObjSurveyGUI::$rbacsystem
protected

Definition at line 49 of file class.ilObjSurveyGUI.php.

◆ $run_manager

ILIAS Survey Execution RunManager ilObjSurveyGUI::$run_manager
protected

Definition at line 46 of file class.ilObjSurveyGUI.php.

◆ $senderFactory

ilMailMimeSenderFactory ilObjSurveyGUI::$senderFactory
protected

Definition at line 50 of file class.ilObjSurveyGUI.php.

◆ $status_manager

ILIAS Survey Participants StatusManager ilObjSurveyGUI::$status_manager
protected

Definition at line 47 of file class.ilObjSurveyGUI.php.

◆ $survey

ilObjSurvey ilObjSurveyGUI::$survey = null
protected

Definition at line 48 of file class.ilObjSurveyGUI.php.

Referenced by executeCommand().

◆ $survey_service

ILIAS Survey InternalService ilObjSurveyGUI::$survey_service
protected

Definition at line 43 of file class.ilObjSurveyGUI.php.

◆ $tabs

ilTabsGUI ilObjSurveyGUI::$tabs
protected

The documentation for this class was generated from the following file: