ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjSurveyAdministrationGUI Class Reference

Class ilObjSurveyAdministrationGUI. More...

+ Inheritance diagram for ilObjSurveyAdministrationGUI:
+ Collaboration diagram for ilObjSurveyAdministrationGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference)
 
 executeCommand ()
 
 settingsObject (ilPropertyFormGUI $a_form=null)
 display survey settings form More...
 
 saveSettingsObject ()
 Save survey settings. More...
 
 getAdminTabs ()
 
 getTabs ()
 get tabs public More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Data Fields

 $conditions
 Constructor public. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initSettingsForm ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $tabs
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Private Member Functions

 getSettingsTemplateConfig ()
 Get settings template configuration object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSurveyAdministrationGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Definition at line 25 of file class.ilObjSurveyAdministrationGUI.php.

References $DIC, ilObjectGUI\$lng, and ILIAS\GlobalScreen\Provider\__construct().

26  {
27  global $DIC;
28 
29  $this->lng = $DIC->language();
30  $this->tabs = $DIC->tabs();
31  $this->tpl = $DIC["tpl"];
32  $this->access = $DIC->access();
33  $this->ctrl = $DIC->ctrl();
34  $lng = $DIC->language();
35 
36  $this->type = "svyf";
37  $lng->loadLanguageModule("survey");
38  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
39  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjSurveyAdministrationGUI::executeCommand ( )

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

References $ret, $tabs, getSettingsTemplateConfig(), and ilObjectGUI\prepareOutput().

42  {
43  $ilTabs = $this->tabs;
44 
45  $next_class = $this->ctrl->getNextClass($this);
46  $cmd = $this->ctrl->getCmd();
47  $this->prepareOutput();
48 
49  switch ($next_class) {
50  case 'ilpermissiongui':
51  $ilTabs->activateTab("perm_settings");
52  $perm_gui = new ilPermissionGUI($this);
53  $ret = &$this->ctrl->forwardCommand($perm_gui);
54  break;
55 
56  case 'ilsettingstemplategui':
57  $ilTabs->activateTab("templates");
58  $set_tpl_gui = new ilSettingsTemplateGUI($this->getSettingsTemplateConfig());
59  $this->ctrl->forwardCommand($set_tpl_gui);
60  break;
61 
62  default:
63  if ($cmd == "" || $cmd == "view") {
64  $cmd = "settings";
65  }
66  $cmd .= "Object";
67  $this->$cmd();
68 
69  break;
70  }
71  return true;
72  }
getSettingsTemplateConfig()
Get settings template configuration object.
prepareOutput($a_show_subobjects=true)
prepare output
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjSurveyAdministrationGUI::getAdminTabs ( )

Definition at line 198 of file class.ilObjSurveyAdministrationGUI.php.

References getTabs().

199  {
200  $this->getTabs();
201  }
+ Here is the call graph for this function:

◆ getSettingsTemplateConfig()

ilObjSurveyAdministrationGUI::getSettingsTemplateConfig ( )
private

Get settings template configuration object.

Returns
object settings template configuration object

Definition at line 246 of file class.ilObjSurveyAdministrationGUI.php.

References $config, ilObjectGUI\$lng, ilSettingsTemplateConfig\BOOL, ilObjSurvey\EVALUATION_ACCESS_ALL, ilObjSurvey\EVALUATION_ACCESS_OFF, ilObjSurvey\EVALUATION_ACCESS_PARTICIPANTS, and ilSettingsTemplateConfig\SELECT.

Referenced by executeCommand().

247  {
248  $lng = $this->lng;
249 
250  $lng->loadLanguageModule("survey");
251 
252  $config = new ilSettingsTemplateConfig("svy");
253 
254  $config->addHidableTab("survey_question_editor", $lng->txt("survey_question_editor_settings_template"));
255  $config->addHidableTab("constraints", $lng->txt("constraints"));
256  //$config->addHidableTab("invitation", $lng->txt("invitation"));
257  $config->addHidableTab("meta_data", $lng->txt("meta_data"));
258  $config->addHidableTab("export", $lng->txt("export"));
259 
260  $config->addSetting(
261  "use_pool",
263  $lng->txt("survey_question_pool_usage"),
264  true,
265  0,
266  array(1 => $this->lng->txt("survey_question_pool_usage_active"),
267  0 => $this->lng->txt("survey_question_pool_usage_inactive"))
268  );
269 
270 
271  $config->addSetting(
272  "enabled_start_date",
274  $lng->txt("start_date"),
275  true
276  );
277 
278  $config->addSetting(
279  "enabled_end_date",
281  $lng->txt("end_date"),
282  true
283  );
284 
285  $config->addSetting(
286  "show_question_titles",
288  $lng->txt("svy_show_questiontitles"),
289  true
290  );
291 
292 
293  // #17585
294 
295  $config->addSetting(
296  "acc_codes",
298  $lng->txt("survey_access_codes"),
299  true
300  );
301 
302  $config->addSetting(
303  "evaluation_access",
305  $lng->txt("evaluation_access"),
306  true,
307  0,
308  array(ilObjSurvey::EVALUATION_ACCESS_OFF => $this->lng->txt("evaluation_access_off"),
309  ilObjSurvey::EVALUATION_ACCESS_ALL => $this->lng->txt("evaluation_access_all"),
310  ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS => $this->lng->txt("evaluation_access_participants"))
311  );
312 
313  $config->addSetting(
314  "anonymization_options",
316  $lng->txt("survey_results_anonymization"),
317  true,
318  0,
319  array("statpers" => $this->lng->txt("survey_results_personalized"),
320  "statanon" => $this->lng->txt("survey_results_anonymized"))
321  );
322 
323  /*
324  $config->addSetting(
325  "rte_switch",
326  ilSettingsTemplateConfig::SELECT,
327  $lng->txt("set_edit_mode"),
328  true,
329  0,
330  array(0 => $this->lng->txt("rte_editor_disabled"),
331  1 => $this->lng->txt("rte_editor_enabled"))
332  );
333  */
334 
335  return $config;
336  }
const EVALUATION_ACCESS_OFF
const EVALUATION_ACCESS_PARTICIPANTS
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Settings template config class.
const EVALUATION_ACCESS_ALL
+ Here is the caller graph for this function:

◆ getTabs()

ilObjSurveyAdministrationGUI::getTabs ( )

get tabs public

Parameters
objecttabs gui object

Definition at line 208 of file class.ilObjSurveyAdministrationGUI.php.

References ilObjectGUI\$lng, and ilObjectGUI\checkPermissionBool().

Referenced by getAdminTabs().

209  {
210  $lng = $this->lng;
211 
212  if ($this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
213  $this->tabs_gui->addTab(
214  "settings",
215  $lng->txt("settings"),
216  $this->ctrl->getLinkTarget($this, "settings")
217  );
218 
219  // #7927: special users are deprecated
220  /*
221  $tabs_gui->addTab("specialusers",
222  $lng->txt("specialusers"),
223  $this->ctrl->getLinkTarget($this, "specialusers"));
224  */
225 
226  $this->tabs_gui->addTab(
227  "templates",
228  $lng->txt("adm_settings_templates"),
229  $this->ctrl->getLinkTargetByClass("ilsettingstemplategui", "")
230  );
231  }
232  if ($this->checkPermissionBool("edit_permission")) {
233  $this->tabs_gui->addTab(
234  "perm_settings",
235  $lng->txt("perm_settings"),
236  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
237  );
238  }
239  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjSurveyAdministrationGUI::initSettingsForm ( )
protected

Definition at line 96 of file class.ilObjSurveyAdministrationGUI.php.

References $_GET, ilObjectGUI\$access, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), and ilFormPropertyGUI\setRequired().

Referenced by saveSettingsObject(), and settingsObject().

97  {
98  $ilAccess = $this->access;
99  $lng = $this->lng;
101 
102  $surveySetting = new ilSetting("survey");
103  $unlimited_invitation = array_key_exists("unlimited_invitation", $_GET) ? $_GET["unlimited_invitation"] : $surveySetting->get("unlimited_invitation");
104  $use_anonymous_id = array_key_exists("use_anonymous_id", $_GET) ? $_GET["use_anonymous_id"] : $surveySetting->get("use_anonymous_id");
105 
106  $form = new ilPropertyFormGUI();
107  $form->setFormAction($ilCtrl->getFormAction($this));
108  $form->setTitle($lng->txt("survey_defaults"));
109 
110  // unlimited invitation
111  /*
112  $enable = new ilCheckboxInputGUI($lng->txt("survey_unlimited_invitation"), "unlimited_invitation");
113  $enable->setChecked($unlimited_invitation);
114  $enable->setInfo($lng->txt("survey_unlimited_invitation_desc"));
115  $form->addItem($enable);*/
116 
117  // Survey Code
118  $code = new ilCheckboxInputGUI($lng->txt("use_anonymous_id"), "use_anonymous_id");
119  $code->setChecked($use_anonymous_id);
120  $code->setInfo($lng->txt("use_anonymous_id_desc"));
121  $form->addItem($code);
122 
123  // Skipped
124  $eval_skipped = new ilRadioGroupInputGUI($lng->txt("svy_eval_skipped_value"), "skcust");
125  $eval_skipped->setRequired(true);
126  $form->addItem($eval_skipped);
127 
128  $eval_skipped->setValue($surveySetting->get("skipped_is_custom", false)
129  ? "cust"
130  : "lng");
131 
132  $skipped_lng = new ilRadioOption($lng->txt("svy_eval_skipped_value_lng"), "lng");
133  $skipped_lng->setInfo(sprintf($lng->txt("svy_eval_skipped_value_lng_info"), $lng->txt("skipped")));
134  $eval_skipped->addOption($skipped_lng);
135  $skipped_cust = new ilRadioOption($lng->txt("svy_eval_skipped_value_custom"), "cust");
136  $skipped_cust->setInfo($lng->txt("svy_eval_skipped_value_custom_info"));
137  $eval_skipped->addOption($skipped_cust);
138 
139  $skipped_cust_value = new ilTextInputGUI($lng->txt("svy_eval_skipped_value_custom_value"), "cust_value");
140  $skipped_cust_value->setSize(15);
141  $skipped_cust_value->setValue($surveySetting->get("skipped_custom_value", ""));
142  $skipped_cust->addSubItem($skipped_cust_value);
143 
144  $anon_part = new ilCheckboxInputGUI($lng->txt("svy_anonymous_participants"), "anon_part");
145  $anon_part->setInfo($lng->txt("svy_anonymous_participants_info"));
146  $anon_part->setChecked($surveySetting->get("anonymous_participants", false));
147  $form->addItem($anon_part);
148 
149  $anon_part_min = new ilNumberInputGUI($lng->txt("svy_anonymous_participants_min"), "anon_part_min");
150  $anon_part_min->setInfo($lng->txt("svy_anonymous_participants_min_info"));
151  $anon_part_min->setSize(4);
152  $anon_part_min->setMinValue(1);
153  $anon_part_min->setValue($surveySetting->get("anonymous_participants_min", null));
154  $anon_part->addSubItem($anon_part_min);
155 
156  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
157  $form->addCommandButton("saveSettings", $lng->txt("save"));
158  }
159 
160  return $form;
161  }
This class represents an option in a radio group.
This class represents a property form user interface.
$_GET["client_id"]
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Info.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
setChecked($a_checked)
Set Checked.
This class represents a property in a property form.
This class represents a number property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettingsObject()

ilObjSurveyAdministrationGUI::saveSettingsObject ( )

Save survey settings.

Definition at line 166 of file class.ilObjSurveyAdministrationGUI.php.

References $_POST, ilObjectGUI\$access, ilObjectGUI\$ctrl, $ilCtrl, initSettingsForm(), and settingsObject().

167  {
169  $ilAccess = $this->access;
170 
171  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
172  $ilCtrl->redirect($this, "settings");
173  }
174 
175  $form = $this->initSettingsForm();
176  if ($form->checkInput()) {
177  $surveySetting = new ilSetting("survey");
178  //$surveySetting->set("unlimited_invitation", ($_POST["unlimited_invitation"]) ? "1" : "0");
179  $surveySetting->set("use_anonymous_id", ($_POST["use_anonymous_id"]) ? "1" : "0");
180  $surveySetting->set("anonymous_participants", ($_POST["anon_part"]) ? "1" : "0");
181  $surveySetting->set("anonymous_participants_min", (trim($_POST["anon_part_min"])) ? (int) $_POST["anon_part_min"] : null);
182 
183  if ($_POST["skcust"] == "lng") {
184  $surveySetting->set("skipped_is_custom", false);
185  } else {
186  $surveySetting->set("skipped_is_custom", true);
187  $surveySetting->set("skipped_custom_value", trim($_POST["cust_value"]));
188  }
189 
190  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
191  $ilCtrl->redirect($this, "settings");
192  }
193 
194  $form->setValuesByPost();
195  $this->settingsObject($form);
196  }
global $ilCtrl
Definition: ilias.php:18
settingsObject(ilPropertyFormGUI $a_form=null)
display survey settings form
$_POST["username"]
+ Here is the call graph for this function:

◆ settingsObject()

ilObjSurveyAdministrationGUI::settingsObject ( ilPropertyFormGUI  $a_form = null)

display survey settings form

Default settings tab for Survey settings

public

Definition at line 82 of file class.ilObjSurveyAdministrationGUI.php.

References $tabs, ilObjectGUI\$tpl, and initSettingsForm().

Referenced by saveSettingsObject().

83  {
84  $tpl = $this->tpl;
85  $ilTabs = $this->tabs;
86 
87  $ilTabs->activateTab("settings");
88 
89  if (!$a_form) {
90  $a_form = $this->initSettingsForm();
91  }
92 
93  $tpl->setContent($a_form->getHTML());
94  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $conditions

ilObjSurveyAdministrationGUI::$conditions

Constructor public.

Definition at line 23 of file class.ilObjSurveyAdministrationGUI.php.

◆ $tabs

ilObjSurveyAdministrationGUI::$tabs
protected

Definition at line 17 of file class.ilObjSurveyAdministrationGUI.php.

Referenced by executeCommand(), and settingsObject().


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