ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjSurveyGUI Class Reference

Class ilObjSurveyGUI. 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
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 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 ()
 
 addDidacticTemplateOptions (array &$a_options)
 
 afterSave (ilObject $new_object)
 
 getTabs ()
 
 initImportForm (string $new_type)
 
 addLocatorItems ()
 
 viewUserResultsObject ()
 
 getUserResultsPlain (int $a_active_id)
 
 checkRbacOrPositionPermission (string $a_rbac_permission, string $a_position_permission)
 
- 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 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...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 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...
 

Protected Attributes

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
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjSurveyGUI::_goto ( string  $a_target)
static

redirect script

Exceptions
ilCtrlException

Definition at line 766 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().

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

◆ addDidacticTemplateOptions()

ilObjSurveyGUI::addDidacticTemplateOptions ( array &  $a_options)
protected

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

References ILIAS\Repository\lng().

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

◆ addLocatorItems()

ilObjSurveyGUI::addLocatorItems ( )
protected

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

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

718  : void
719  {
720  $ilLocator = $this->locator;
721  switch ($this->ctrl->getCmd()) {
722  case "next":
723  case "previous":
724  case "start":
725  case "resume":
726  case "infoScreen":
727  case "redirectQuestion":
728  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $this->requested_ref_id);
729  break;
730  case "evaluation":
731  case "checkEvaluationAccess":
732  case "evaluationdetails":
733  case "evaluationuser":
734  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass("ilsurveyevaluationgui", "evaluation"), "", $this->requested_ref_id);
735  break;
736  case "create":
737  case "save":
738  case "cancel":
739  case "importSurvey":
740  case "cloneAll":
741  break;
742  default:
743  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $this->requested_ref_id);
744 
745  // this has to be done here because ilSurveyEditorGUI is called after finalizing the locator
746  if ($this->edit_request->getQuestionId() > 0 &&
747  !$this->edit_request->getNewForSurvey()) {
748  // not on create
749  // see ilObjSurveyQuestionPool::addLocatorItems
750  $q_id = $this->edit_request->getQuestionId();
751  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
752  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
753  $ilLocator->addItem(
755  $this->ctrl->getLinkTargetByClass(array("ilSurveyEditorGUI", $q_type), "editQuestion")
756  );
757  }
758  break;
759  }
760  }
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.
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ addSubTabs()

ilObjSurveyGUI::addSubTabs ( string  $a_section)

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

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

Referenced by executeCommand(), and propertiesObject().

552  : void {
553  if ($a_section === 'settings') {
554  $this->tabs_gui->addSubTabTarget(
555  "settings",
556  $this->ctrl->getLinkTarget($this, 'properties')
557  );
558 
559  $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
560  if ($lti_settings->hasSettingsAccess()) {
561  $this->tabs_gui->addSubTabTarget(
562  'lti_provider',
563  $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
564  );
565  }
566  }
567  }
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:
+ Here is the caller graph for this function:

◆ addToNavigationHistory()

ilObjSurveyGUI::addToNavigationHistory ( )
protected

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

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

Referenced by executeCommand().

307  : void
308  {
309  $external_rater = $this->status_manager->isExternalRater();
310  // add entry to navigation history
311  if (!$external_rater && !$this->getCreationMode() &&
312  $this->checkPermissionBool("read")) {
313  $this->ctrl->setParameterByClass("ilobjsurveygui", "ref_id", $this->ref_id);
314  $link = $this->ctrl->getLinkTargetByClass("ilobjsurveygui", "infoScreen");
315  $this->nav_history->addItem($this->ref_id, $link, "svy");
316  }
317  }
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 345 of file class.ilObjSurveyGUI.php.

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

345  : void
346  {
347  // #16446
348  $new_object->loadFromDb();
349 
350  //set the mode depending on didactic template
351  if ($this->getDidacticTemplateVar("svy360")) {
352  $new_object->setMode(ilObjSurvey::MODE_360);
353  } elseif ($this->getDidacticTemplateVar("svyselfeval")) {
354  $new_object->setMode(ilObjSurvey::MODE_SELF_EVAL);
355  } elseif ($this->getDidacticTemplateVar("individfeedb")) {
356  $new_object->setMode(ilObjSurvey::MODE_IND_FEEDB);
357  }
358 
359  $svy_mode = $new_object->getMode();
360  if ($svy_mode === ilObjSurvey::MODE_360) {
361  // this should rather be ilObjSurvey::ANONYMIZE_ON - see ilObjSurvey::getUserDataFromActiveId()
362  $new_object->setAnonymize(ilObjSurvey::ANONYMIZE_CODE_ALL);
363  $new_object->setEvaluationAccess(ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS);
364  } elseif ($svy_mode === ilObjSurvey::MODE_SELF_EVAL) {
365  $new_object->setEvaluationAccess(ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS);
366  }
367  $new_object->saveToDB();
368 
369  // always send a message
370  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
371  ilUtil::redirect("ilias.php?baseClass=ilObjSurveyGUI&ref_id=" .
372  $new_object->getRefId() . "&cmd=properties");
373  }
const EVALUATION_ACCESS_PARTICIPANTS
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
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 1062 of file class.ilObjSurveyGUI.php.

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

Referenced by executeCommand().

1065  : bool {
1066  $access = $GLOBALS['DIC']->access();
1068  $a_rbac_permission,
1069  $a_position_permission,
1070  $this->object->getRefId()
1071  );
1072  }
checkRbacOrPositionPermissionAccess(string $rbac_perm, string $pos_perm, int $ref_id)
$GLOBALS["DIC"]
Definition: wac.php:31
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doAutoCompleteObject()

ilObjSurveyGUI::doAutoCompleteObject ( )

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

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

596  : void
597  {
598  $fields = array('login','firstname','lastname','email');
599 
600  $auto = new ilUserAutoComplete();
601  $auto->setSearchFields($fields);
602  $auto->setResultField('login');
603  $auto->enableFieldSearchableCheck(true);
604  $auto->setMoreLinkAvailable(true);
605 
606  if ($this->edit_request->getFetchAll()) {
607  $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
608  }
609 
610  echo $auto->getList(ilUtil::stripSlashes($this->edit_request->getTerm()));
611  exit();
612  }
exit
Definition: login.php:29
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...
+ 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 323 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\ctrl().

323  : void
324  {
325  $eval_gui = new ilSurveyEvaluationGUI($this->survey);
326  $this->ctrl->setCmdClass(get_class($eval_gui));
327  $this->ctrl->redirect($eval_gui, "openEvaluation");
328  }
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:

◆ executeCommand()

ilObjSurveyGUI::executeCommand ( )

Definition at line 125 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().

125  : void
126  {
127  $ilTabs = $this->tabs;
130  if ($survey) {
131  if (!$access_manager->canAccessInfoScreen()) {
132  $this->noPermission();
133  }
134  $this->addToNavigationHistory();
135  }
136 
137  $cmd = $this->ctrl->getCmd("properties");
138 
139  // workaround for bug #6288, needs better solution
140  if ($cmd === "saveTags") {
141  $this->ctrl->setCmdClass("ilinfoscreengui");
142  }
143 
144  // deep link from repository - "redirect" to page view
145  if (!$this->ctrl->getCmdClass() && $cmd === "questionsrepo") {
146  $this->ctrl->setParameterByClass("ilsurveyeditorgui", "pgov", "1");
147  $this->ctrl->redirectByClass("ilsurveyeditorgui", "questions");
148  }
149 
150  $next_class = $this->ctrl->getNextClass($this);
151  if ($next_class !== "") {
152  $this->ctrl->setReturn($this, "properties");
153  }
154  // deprecated, moved for less file
155  //$this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
156  $this->prepareOutput();
157 
158  $this->log->debug("next_class= $next_class");
159  switch ($next_class) {
160  case 'illtiproviderobjectsettinggui':
161  $this->addSubTabs('settings');
162  $ilTabs->activateTab("settings");
163  $ilTabs->activateSubTab('lti_provider');
164  $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
165  $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
166  $lti_gui->offerLTIRolesForSelection(false);
167  $this->ctrl->forwardCommand($lti_gui);
168  break;
169 
170 
171  case "ilinfoscreengui":
172  if (!in_array(
173  $this->ctrl->getCmdClass(),
174  array('ilpublicuserprofilegui', 'ilobjportfoliogui')
175  )) {
176  $this->addHeaderAction();
177  $this->infoScreen(); // forwards command
178  } else {
179  // #16891
180  $ilTabs->clearTargets();
181  $info = new ilInfoScreenGUI($this);
182  $this->ctrl->forwardCommand($info);
183  }
184  break;
185 
186  case 'ilobjectmetadatagui':
187  $this->checkPermission("write");
188  $ilTabs->activateTab("meta_data");
189  $this->addHeaderAction();
190  $md_gui = new ilObjectMetaDataGUI($this->object);
191  $this->ctrl->forwardCommand($md_gui);
192  break;
193 
194  case "ilsurveyevaluationgui":
195 
196  if ($this->checkRbacOrPositionPermission('read_results', 'access_results') ||
197  ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $this->user->getId())) {
198  $ilTabs->activateTab("svy_results");
199  $this->addHeaderAction();
200  $eval_gui = new ilSurveyEvaluationGUI($survey);
201  $this->ctrl->forwardCommand($eval_gui);
202  }
203  break;
204 
205  case "ilsurveyexecutiongui":
206  $ilTabs->clearTargets();
207  $exec_gui = new ilSurveyExecutionGUI($survey);
208  $this->ctrl->forwardCommand($exec_gui);
209  break;
210 
211  case 'ilpermissiongui':
212  $ilTabs->activateTab("perm_settings");
213  $this->addHeaderAction();
214  $perm_gui = new ilPermissionGUI($this);
215  $this->ctrl->forwardCommand($perm_gui);
216  break;
217 
218  case 'ilobjectcopygui':
219  $cp = new ilObjectCopyGUI($this);
220  $cp->setType('svy');
221  $this->ctrl->forwardCommand($cp);
222  break;
223 
224  case "ilcommonactiondispatchergui":
226  $this->ctrl->forwardCommand($gui);
227  break;
228 
229  // 360, skill service
230  case 'ilsurveyskillgui':
231  $ilTabs->activateTab("survey_competences");
232  $gui = new ilSurveySkillGUI($survey);
233  $this->ctrl->forwardCommand($gui);
234  break;
235 
236  case 'ilsurveyskilldeterminationgui':
237  $ilTabs->activateTab("maintenance");
239  $this->ctrl->forwardCommand($gui);
240  break;
241 
242  case 'ilsurveyeditorgui':
243  $this->checkPermission("write");
244  $ilTabs->activateTab("survey_questions");
245  $gui = new ilSurveyEditorGUI($this);
246  $this->ctrl->forwardCommand($gui);
247  break;
248 
249  case 'ilsurveyconstraintsgui':
250  $this->checkPermission("write");
251  $ilTabs->activateTab("constraints");
252  $gui = new ilSurveyConstraintsGUI($this);
253  $this->ctrl->forwardCommand($gui);
254  break;
255 
256  case 'ilsurveyparticipantsgui':
257  if (!$this->feature_config->usesAppraisees()) {
258  $ilTabs->activateTab("maintenance");
259  } else {
260  $ilTabs->activateTab("survey_360_appraisees");
261  }
262  $gui = new ilSurveyParticipantsGUI($this, $this->checkRbacOrPositionPermission('read_results', 'access_results'));
263  $this->ctrl->forwardCommand($gui);
264  break;
265 
266  case "illearningprogressgui":
267  $ilTabs->activateTab("learning_progress");
268  $new_gui = new ilLearningProgressGUI(
270  $this->object->getRefId()
271  );
272  $this->ctrl->forwardCommand($new_gui);
273  break;
274 
275  case 'ilexportgui':
276  $ilTabs->activateTab("export");
277  $exp_gui = new ilExportGUI($this);
278  $exp_gui->addFormat("xml");
279  $this->ctrl->forwardCommand($exp_gui);
280  break;
281 
282  default:
283  $this->addHeaderAction();
284  $cmd .= "Object";
285 
286  $this->log->debug("Default cmd= $cmd");
287 
288  $this->$cmd();
289  break;
290  }
291 
292  if (strtolower($this->edit_request->getBaseClass()) !== "iladministrationgui" &&
293  $this->getCreationMode() !== true) {
294  $this->tpl->printToStdout();
295 
296  //cherry pick conflict with d97cf1c77b
297  //$this->tpl->show();
298  //$this->log->debug("after tpl show");
299  }
300  }
Class ilSurveyParticipantsGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilInfoScreenGUI.
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...
addSubTabs(string $a_section)
Export User Interface Class.
$GLOBALS["DIC"]
Definition: wac.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 375 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().

375  : void
376  {
377  $ilUser = $this->user;
378  $ilHelp = $this->help;
380 
381  if (is_null($this->object)) {
382  return;
383  }
384 
385  // @todo investigate, if this can still be the case
386  if ($this->object instanceof ilObjSurveyQuestionPool) {
387  return;
388  }
389 
390  $ilHelp->setScreenIdComponent("svy");
391 
392  if ($this->checkPermissionBool("write")) {
393  $this->tabs_gui->addTab(
394  "survey_questions",
395  $this->lng->txt("survey_questions"),
396  $this->ctrl->getLinkTargetByClass(array("ilsurveyeditorgui"), "questions")
397  );
398  }
399 
400  if ($this->checkPermissionBool("read")) {
401  $this->tabs_gui->addTab(
402  "info_short",
403  $this->lng->txt("info_short"),
404  $this->ctrl->getLinkTarget($this, 'infoScreen')
405  );
406  }
407 
408  // properties
409  if ($this->checkPermissionBool("write")) {
410  $this->tabs_gui->addTab(
411  "settings",
412  $this->lng->txt("settings"),
413  $this->ctrl->getLinkTarget($this, 'properties')
414  );
415  } elseif ($this->checkPermissionBool("read")) {
416  if ($this->feature_config->usesAppraisees() &&
417  $this->object->get360SelfRaters() &&
418  $this->object->isAppraisee($ilUser->getId()) &&
419  !$this->object->isAppraiseeClosed($ilUser->getId())) {
420  $this->tabs_gui->addTab(
421  "survey_360_edit_raters",
422  $this->lng->txt("survey_360_edit_raters"),
423  $this->ctrl->getLinkTargetByClass('ilsurveyparticipantsgui', 'editRaters')
424  );
425 
426  // :TODO: mail to raters
427  }
428  }
429 
430  // questions
431  if ($this->checkPermissionBool("write") &&
432  $this->object->getMode() === ilObjSurvey::MODE_STANDARD) {
433  // constraints (tab called routing)
434  $this->tabs_gui->addTab(
435  "constraints",
436  $this->lng->txt("constraints"),
437  $this->ctrl->getLinkTargetByClass("ilsurveyconstraintsgui", "constraints")
438  );
439  }
440 
441  if ($this->checkPermissionBool("write")) {
442  if ($feature_config && $feature_config->supportsCompetences()) {
443  $skmg_set = new ilSkillManagementSettings();
444  if ($this->object->getSkillService() && $skmg_set->isActivated()) {
445  $this->tabs_gui->addTab(
446  "survey_competences",
447  $this->lng->txt("survey_competences"),
448  $this->ctrl->getLinkTargetByClass("ilsurveyskillgui", "listQuestionAssignment")
449  );
450  }
451  }
452 
453  if ($feature_config && $feature_config->usesAppraisees()) {
454  $this->tabs_gui->addTab(
455  "survey_360_appraisees",
456  $this->lng->txt("survey_360_appraisees"),
457  $this->ctrl->getLinkTargetByClass('ilsurveyparticipantsgui', 'listAppraisees')
458  );
459  } else {
460  $this->tabs_gui->addTab(
461  "maintenance",
462  $this->lng->txt("svy_participants"),
463  $this->ctrl->getLinkTargetByClass('ilsurveyparticipantsgui', 'maintenance')
464  );
465  }
466  }
467 
468  if ($this->access_manager->canAccessEvaluation()) {
469  // evaluation
470  $this->tabs_gui->addTab(
471  "svy_results",
472  $this->lng->txt("svy_results"),
473  $this->ctrl->getLinkTargetByClass("ilsurveyevaluationgui", "openEvaluation")
474  );
475  }
476 
477  // learning progress
478  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
479  $this->tabs_gui->addTarget(
480  "learning_progress",
481  $this->ctrl->getLinkTargetByClass(array("ilobjsurveygui", "illearningprogressgui"), ""),
482  "",
483  array("illplistofobjectsgui", "illplistofsettingsgui", "illearningprogressgui", "illplistofprogressgui")
484  );
485  }
486 
487  if ($this->checkPermissionBool("write")) {
488  // meta data
489  $mdgui = new ilObjectMetaDataGUI($this->object);
490  $mdtab = $mdgui->getTab();
491  if ($mdtab) {
492  $this->tabs_gui->addTab(
493  "meta_data",
494  $this->lng->txt("meta_data"),
495  $mdtab
496  );
497  }
498 
499  // export
500  $this->tabs_gui->addTab(
501  "export",
502  $this->lng->txt("export"),
503  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
504  );
505  }
506 
507  if ($this->checkPermissionBool("edit_permission")) {
508  // permissions
509  $this->tabs_gui->addTab(
510  "perm_settings",
511  $this->lng->txt("perm_settings"),
512  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
513  );
514  }
515  }
ILIAS Survey Mode FeatureConfig $feature_config
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjSurveyQuestionPool.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 904 of file class.ilObjSurveyGUI.php.

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

Referenced by sendUserResultsMail().

906  : string {
907  $res = array();
908 
909  $show_titles = (bool) $this->object->getShowQuestionTitles();
910 
911  foreach ($this->object->getSurveyPages() as $page) {
912  if (count($page) > 0) {
913  $res[] = "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
914 
915  // question block
916  if (count($page) > 1) {
917  if ($page[0]["questionblock_show_blocktitle"]) {
918  $res[$this->lng->txt("questionblock")] = trim($page[0]["questionblock_title"] ?? "") . "\n";
919  }
920  }
921 
922  // questions
923 
924  $page_res = array();
925 
926  foreach ($page as $question) {
927  $question_gui = $this->object->getQuestionGUI($question["type_tag"], $question["question_id"]);
928  $question_parts = array();
929 
930  // heading
931  if (strlen($question["heading"] ?? "")) {
932  $question_parts[$this->lng->txt("heading")] = trim($question["heading"] ?? "");
933  }
934 
935  if ($show_titles) {
936  $question_parts[$this->lng->txt("title")] = trim($question["title"] ?? "");
937  }
938 
939  if ($question["questionblock_show_questiontext"]) {
940  $question_parts[$this->lng->txt("question")] = trim(strip_tags($question_gui->object->getQuestionText()));
941  }
942 
943  $answers = $question_gui->getParsedAnswers(
944  $this->object->loadWorkingData($question["question_id"], $a_active_id),
945  true
946  );
947 
948  if (count($answers)) {
949  $multiline = false;
950  if (count($answers) > 1 ||
951  get_class($question_gui) === "SurveyTextQuestionGUI") {
952  $multiline = true;
953  }
954 
955  $parts = array();
956  foreach ($answers as $answer) {
957  $text = null;
958  if ($answer["textanswer"] ?? false) {
959  $text = ' ("' . $answer["textanswer"] . '")';
960  }
961  if (!isset($answer["cols"])) {
962  if (isset($answer["title"])) {
963  $parts[] = $answer["title"] . $text;
964  } elseif (isset($answer["value"])) {
965  $parts[] = $answer["value"];
966  } elseif ($text) {
967  $parts[] = substr($text, 2, -1);
968  }
969  }
970  // matrix
971  else {
972  $tmp = array();
973  foreach ($answer["cols"] as $col) {
974  $tmp[] = $col["title"];
975  }
976  $parts[] = $answer["title"] . ": " . implode(", ", $tmp) . $text;
977  }
978  }
979  $question_parts[$this->lng->txt("answer")] =
980  ($multiline ? "\n" : "") . implode("\n", $parts);
981  }
982 
983  $tmp = array();
984  foreach ($question_parts as $type => $value) {
985  $tmp[] = $type . ": " . $value;
986  }
987  $page_res[] = implode("\n", $tmp);
988  }
989 
990  $res[] = implode("\n\n-------------------------------\n\n", $page_res);
991  }
992  }
993 
994  $res[] = "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
995 
996  return implode("\n", $res);
997  }
$res
Definition: ltiservices.php:69
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
+ 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 827 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\object().

Referenced by viewUserResultsObject().

829  : string {
830  $rtpl = new ilTemplate("tpl.svy_view_user_results.html", true, true, "Modules/Survey");
831 
832  $show_titles = $this->object->getShowQuestionTitles();
833 
834  foreach ($this->object->getSurveyPages() as $page) {
835  if (count($page) > 0) {
836  // question block
837  if (count($page) > 1) {
838  if ($page[0]["questionblock_show_blocktitle"]) {
839  $rtpl->setVariable("BLOCK_TITLE", trim($page[0]["questionblock_title"] ?? ""));
840  }
841  }
842 
843  // questions
844  foreach ($page as $question) {
845  $question_gui = $this->object->getQuestionGUI($question["type_tag"], $question["question_id"]);
846  $rtpl->setCurrentBlock("question_bl");
847 
848  // heading
849  if (strlen($question["heading"] ?? "")) {
850  $rtpl->setVariable("HEADING", trim($question["heading"] ?? ""));
851  }
852 
853  $rtpl->setVariable(
854  "QUESTION_DATA",
855  $question_gui->getPrintView(
856  $show_titles,
857  (bool) $question["questionblock_show_questiontext"],
858  $this->object->getId(),
859  $this->object->loadWorkingData($question["question_id"], $a_active_id)
860  )
861  );
862 
863  $rtpl->parseCurrentBlock();
864  }
865 
866  $rtpl->setCurrentBlock("block_bl");
867  $rtpl->parseCurrentBlock();
868  }
869  }
870 
871  return $rtpl->get();
872  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importSurveyObject()

ilObjSurveyGUI::importSurveyObject ( )

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

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

644  : void
645  {
646  $tpl = $this->tpl;
647 
648  $new_type = $this->edit_request->getNewType();
649 
650  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
651  $this->checkPermission("create", "", $new_type);
652 
653  $this->lng->loadLanguageModule($new_type);
654  $this->ctrl->setParameter($this, "new_type", $new_type);
655 
656  $form = $this->initImportForm($new_type);
657  if ($form->checkInput()) {
658  $newObj = new ilObjSurvey();
659  $newObj->setType($new_type);
660  $newObj->setTitle("dummy");
661  $newObj->create(true);
662  $this->putObjectInTree($newObj);
663 
664  // copy uploaded file to import directory
665 
666  $this->log->debug("form->getInput(spl) = " . $form->getInput("spl"));
667 
668  $error = $newObj->importObject($_FILES["importfile"], (int) $form->getInput("spl"));
669  if ($error !== '') {
670  $newObj->delete();
671  $this->tpl->setOnScreenMessage('failure', $error);
672  return;
673  }
674 
675  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
676  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
677  "&baseClass=ilObjSurveyGUI");
678  }
679 
680  // display form to correct errors
681  $form->setValuesByPost();
682  $tpl->setContent($form->getHTML());
683  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
ilErrorHandling $error
static redirect(string $a_script)
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position.
initImportForm(string $new_type)
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 705 of file class.ilObjSurveyGUI.php.

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

Referenced by executeCommand(), and infoScreenObject().

705  : void
706  {
707  $ilTabs = $this->tabs;
708  if (!$this->access_manager->canAccessInfoScreen()) {
709  $this->noPermission();
710  }
711  $ilTabs->activateTab("info_short");
712 
713  $info = $this->survey_service->gui()->infoScreen($this, $this->toolbar);
714 
715  $this->ctrl->forwardCommand($info);
716  }
+ 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 695 of file class.ilObjSurveyGUI.php.

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

695  : void
696  {
697  $this->ctrl->setCmd("showSummary");
698  $this->ctrl->setCmdClass("ilinfoscreengui");
699  $this->infoScreen();
700  }
infoScreen()
show information screen
+ Here is the call graph for this function:

◆ initImportForm()

ilObjSurveyGUI::initImportForm ( string  $new_type)
protected

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilSelectInputGUI\setOptions(), and ilFileInputGUI\setSuffixes().

Referenced by importSurveyObject().

619  {
620  $form = new ilPropertyFormGUI();
621  $form->setTarget("_top");
622  $form->setFormAction($this->ctrl->getFormAction($this));
623  $form->setTitle($this->lng->txt("import_svy"));
624 
625  $fi = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
626  $fi->setSuffixes(array("zip"));
627  $fi->setRequired(true);
628  $form->addItem($fi);
629 
630  $svy = new ilObjSurvey();
631  $questionspools = $svy->getAvailableQuestionpools(true, true, true);
632 
633  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool_short"), "spl");
634  $pools->setOptions(array("" => $this->lng->txt("dont_use_questionpool")) + $questionspools);
635  $pools->setRequired(false);
636  $form->addItem($pools);
637 
638  $form->addCommandButton("importSurvey", $this->lng->txt("import"));
639  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
640 
641  return $form;
642  }
This class represents a selection list property in a property form.
This class represents a file property in a property form.
setSuffixes(array $a_suffixes)
setOptions(array $a_options)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPropertiesForm()

ilObjSurveyGUI::initPropertiesForm ( )

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

Referenced by propertiesObject().

544  {
545  $form = $this->survey_service
546  ->gui()->surveySettings($this->survey)->form("ilObjSurveyGUI");
547  return $form;
548  }
+ Here is the caller graph for this function:

◆ mailUserResultsObject()

ilObjSurveyGUI::mailUserResultsObject ( )

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

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

1034  : void
1035  {
1036  $ilUser = $this->user;
1037 
1038  $anonymous_code = $this->run_manager->getCode();
1039  $active_id = $this->object->getActiveID($ilUser->getId(), $anonymous_code, 0);
1040  if (!$this->run_manager->hasFinished() ||
1041  !$active_id) {
1042  $this->ctrl->redirect($this, "infoScreen");
1043  }
1044 
1045  $recipient = $this->edit_request->getMail();
1046  if (!$recipient) {
1047  $recipient = $ilUser->getEmail();
1048  }
1049  if (!ilUtil::is_email($recipient)) {
1050  $this->ctrl->redirect($this, "infoScreen");
1051  }
1052 
1053  $this->sendUserResultsMail($active_id, $recipient);
1054 
1055  $this->tpl->setOnScreenMessage('success', $this->lng->txt("mail_sent"), true);
1056  $this->ctrl->redirect($this, "infoScreen");
1057  }
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 302 of file class.ilObjSurveyGUI.php.

References ILIAS\Repository\lng().

Referenced by executeCommand(), and infoScreen().

302  : void
303  {
304  throw new ilObjectException($this->lng->txt("permission_denied"));
305  }
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:
+ Here is the caller graph for this function:

◆ propertiesObject()

ilObjSurveyGUI::propertiesObject ( ilPropertyFormGUI  $a_form = null)

Display the properties form.

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

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

Referenced by savePropertiesObject().

575  : void {
576  $ilTabs = $this->tabs;
577  $ilHelp = $this->help;
578 
579  $this->checkPermission("write");
580 
581  $this->addSubTabs('settings');
582  $ilTabs->activateTab("settings");
583  $ilTabs->activateSubTab('settings');
584 
585  if ($this->object->get360Mode()) {
586  $ilHelp->setScreenId("settings_360");
587  }
588 
589  if (!$a_form) {
590  $a_form = $this->initPropertiesForm();
591  }
592 
593  $this->tpl->setContent($a_form->getHTML());
594  }
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:

◆ savePropertiesObject()

ilObjSurveyGUI::savePropertiesObject ( )

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

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

522  : void
523  {
524  $settings_ui = $this->survey_service->gui()->surveySettings($this->survey);
525 
526  $form = $settings_ui->form("ilObjSurveyGUI");
527  if ($settings_ui->checkForm($form)) {
528  $settings_ui->saveForm($form);
529 
530  // settings change clear the code
531  // this is adopted from ILIAS 7, unsure if or when this is necessary
532  $this->run_manager->clearCode();
533 
534  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
535  $this->ctrl->redirect($this, "properties");
536  }
537 
538  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("form_input_not_valid"));
539  $form->setValuesByPost();
540  $this->propertiesObject($form);
541  }
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 999 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().

1002  : void {
1003  $ilUser = $this->user;
1004 
1005  $finished = $this->object->getSurveyParticipants(array($a_active_id));
1006  $finished = array_pop($finished);
1007  $finished = ilDatePresentation::formatDate(new ilDateTime($finished["finished_tstamp"], IL_CAL_UNIX));
1008 
1009  $body = ilMail::getSalutation($ilUser->getId()) . "\n\n";
1010  $body .= $this->lng->txt("svy_mail_own_results_body") . "\n";
1011  $body .= "\n" . $this->lng->txt("obj_svy") . ": " . $this->object->getTitle() . "\n";
1012  $body .= ilLink::_getLink($this->object->getRefId(), "svy") . "\n";
1013  $body .= "\n" . $this->lng->txt("survey_results_finished") . ": " . $finished . "\n\n";
1014 
1015  if ($this->object->hasMailOwnResults()) {
1016  $subject = "svy_mail_own_results_subject";
1017  $body .= $this->getUserResultsPlain($a_active_id);
1018  } else {
1019  $subject = "svy_mail_confirmation_subject";
1020  }
1021 
1022  // $body .= ilMail::_getAutoGeneratedMessageString($this->lng);
1024 
1025 
1026  $mmail = new ilMimeMail();
1027  $mmail->From($this->senderFactory->system());
1028  $mmail->To($a_recipient);
1029  $mmail->Subject(sprintf($this->lng->txt($subject), $this->object->getTitle()), true);
1030  $mmail->Body($body);
1031  $mmail->Send();
1032  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=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 877 of file class.ilObjSurveyGUI.php.

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

877  : void
878  {
879  $ilUser = $this->user;
880  $tpl = $this->tpl;
881  $ilTabs = $this->tabs;
882 
883  $anonymous_code = $this->run_manager->getCode();
884  $active_id = $this->object->getActiveID($ilUser->getId(), $anonymous_code, 0);
885 
886  if (!$this->run_manager->hasFinished() ||
887  !$active_id) {
888  $this->ctrl->redirect($this, "infoScreen");
889  }
890 
891  $ilTabs->clearTargets();
892  $ilTabs->setBackTarget(
893  $this->lng->txt("btn_back"),
894  $this->ctrl->getLinkTarget($this, "infoScreen")
895  );
896 
897  $html = $this->getUserResultsTable($active_id);
899  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
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 46 of file class.ilObjSurveyGUI.php.

Referenced by executeCommand().

◆ $edit_request

ILIAS Survey Editing EditingGUIRequest ilObjSurveyGUI::$edit_request
protected

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

◆ $execution_request

ILIAS Survey Execution ExecutionGUIRequest ilObjSurveyGUI::$execution_request
protected

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

◆ $feature_config

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

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

Referenced by getTabs().

◆ $help

ilHelpGUI ilObjSurveyGUI::$help
protected

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

Referenced by getTabs(), and propertiesObject().

◆ $invitation_manager

Participants InvitationsManager ilObjSurveyGUI::$invitation_manager
protected

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

◆ $log

ilLogger ilObjSurveyGUI::$log
protected

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

◆ $nav_history

ilNavigationHistory ilObjSurveyGUI::$nav_history
protected

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

◆ $rbacsystem

ilRbacSystem ilObjSurveyGUI::$rbacsystem
protected

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

◆ $run_manager

ILIAS Survey Execution RunManager ilObjSurveyGUI::$run_manager
protected

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

◆ $senderFactory

ilMailMimeSenderFactory ilObjSurveyGUI::$senderFactory
protected

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

◆ $status_manager

ILIAS Survey Participants StatusManager ilObjSurveyGUI::$status_manager
protected

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

◆ $survey

ilObjSurvey ilObjSurveyGUI::$survey = null
protected

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

Referenced by executeCommand().

◆ $survey_service

ILIAS Survey InternalService ilObjSurveyGUI::$survey_service
protected

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

◆ $tabs

ilTabsGUI ilObjSurveyGUI::$tabs
protected

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