ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 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 ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

 $conditions
 Constructor public. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $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
 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...
 
 showMountWebfolderIcon ()
 
 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...
 
 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...
 
 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...
 

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...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References ilObjectGUI\$lng.

47  {
48  global $lng;
49 
50  $this->type = "svyf";
51  $lng->loadLanguageModule("survey");
52  parent::__construct($a_data,$a_id,$a_call_by_reference,false);
53  }

Member Function Documentation

◆ executeCommand()

ilObjSurveyAdministrationGUI::executeCommand ( )

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

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

56  {
57  global $ilTabs;
58 
59  $next_class = $this->ctrl->getNextClass($this);
60  $cmd = $this->ctrl->getCmd();
61  $this->prepareOutput();
62 
63  switch($next_class)
64  {
65  case 'ilpermissiongui':
66  $ilTabs->activateTab("perm_settings");
67  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
68  $perm_gui = new ilPermissionGUI($this);
69  $ret =& $this->ctrl->forwardCommand($perm_gui);
70  break;
71 
72  case 'ilsettingstemplategui':
73  $ilTabs->activateTab("templates");
74  include_once("./Services/Administration/classes/class.ilSettingsTemplateGUI.php");
75  $set_tpl_gui = new ilSettingsTemplateGUI($this->getSettingsTemplateConfig());
76  $this->ctrl->forwardCommand($set_tpl_gui);
77  break;
78 
79  default:
80  if($cmd == "" || $cmd == "view")
81  {
82  $cmd = "settings";
83  }
84  $cmd .= "Object";
85  $this->$cmd();
86 
87  break;
88  }
89  return true;
90  }
getSettingsTemplateConfig()
Get settings template configuration object.
$cmd
Definition: sahs_server.php:35
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 219 of file class.ilObjSurveyAdministrationGUI.php.

References getTabs().

220  {
221  $this->getTabs();
222  }
+ 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 266 of file class.ilObjSurveyAdministrationGUI.php.

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

Referenced by executeCommand().

267  {
268  global $lng;
269 
270  $lng->loadLanguageModule("survey");
271  include_once "Modules/Survey/classes/class.ilObjSurvey.php";
272 
273  include_once("./Services/Administration/classes/class.ilSettingsTemplateConfig.php");
274  $config = new ilSettingsTemplateConfig("svy");
275 
276  $config->addHidableTab("survey_question_editor", $lng->txt("survey_question_editor_settings_template"));
277  $config->addHidableTab("constraints", $lng->txt("constraints"));
278  $config->addHidableTab("invitation", $lng->txt("invitation"));
279  $config->addHidableTab("meta_data", $lng->txt("meta_data"));
280  $config->addHidableTab("export", $lng->txt("export"));
281 
282  $config->addSetting(
283  "use_pool",
285  $lng->txt("survey_question_pool_usage"),
286  true,
287  0,
288  array(1 => $this->lng->txt("survey_question_pool_usage_active"),
289  0 => $this->lng->txt("survey_question_pool_usage_inactive"))
290  );
291 
292 
293  $config->addSetting(
294  "enabled_start_date",
296  $lng->txt("start_date"),
297  true
298  );
299 
300  $config->addSetting(
301  "enabled_end_date",
303  $lng->txt("end_date"),
304  true
305  );
306 
307  $config->addSetting(
308  "show_question_titles",
310  $lng->txt("svy_show_questiontitles"),
311  true
312  );
313 
314 
315  // #17585
316 
317  $config->addSetting(
318  "acc_codes",
320  $lng->txt("survey_access_codes"),
321  true
322  );
323 
324  $config->addSetting(
325  "evaluation_access",
327  $lng->txt("evaluation_access"),
328  true,
329  0,
330  array(ilObjSurvey::EVALUATION_ACCESS_OFF => $this->lng->txt("evaluation_access_off"),
331  ilObjSurvey::EVALUATION_ACCESS_ALL => $this->lng->txt("evaluation_access_all"),
332  ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS => $this->lng->txt("evaluation_access_participants"))
333  );
334 
335  $config->addSetting(
336  "anonymization_options",
338  $lng->txt("survey_results_anonymization"),
339  true,
340  0,
341  array("statpers" => $this->lng->txt("survey_results_personalized"),
342  "statanon" => $this->lng->txt("survey_results_anonymized"))
343  );
344 
345  /*
346  $config->addSetting(
347  "rte_switch",
348  ilSettingsTemplateConfig::SELECT,
349  $lng->txt("set_edit_mode"),
350  true,
351  0,
352  array(0 => $this->lng->txt("rte_editor_disabled"),
353  1 => $this->lng->txt("rte_editor_enabled"))
354  );
355  */
356 
357  return $config;
358  }
const EVALUATION_ACCESS_OFF
const EVALUATION_ACCESS_PARTICIPANTS
Create styles array
The data for the language used.
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 229 of file class.ilObjSurveyAdministrationGUI.php.

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

Referenced by getAdminTabs().

230  {
231  global $lng;
232 
233  if ($this->checkPermissionBool("read"))
234  {
235  $this->tabs_gui->addTab("settings",
236  $lng->txt("settings"),
237  $this->ctrl->getLinkTarget($this, "settings"));
238 
239  // #7927: special users are deprecated
240  /*
241  $tabs_gui->addTab("specialusers",
242  $lng->txt("specialusers"),
243  $this->ctrl->getLinkTarget($this, "specialusers"));
244  */
245 
246  if ($this->checkPermissionBool("write"))
247  {
248  $this->tabs_gui->addTab("templates",
249  $lng->txt("adm_settings_templates"),
250  $this->ctrl->getLinkTargetByClass("ilsettingstemplategui", ""));
251  }
252  }
253  if ($this->checkPermissionBool("edit_permission"))
254  {
255  $this->tabs_gui->addTab("perm_settings",
256  $lng->txt("perm_settings"),
257  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"));
258  }
259  }
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 114 of file class.ilObjSurveyAdministrationGUI.php.

References $_GET, $code, $ilCtrl, ilObjectGUI\$lng, ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilTextInputGUI\setSize().

Referenced by saveSettingsObject(), and settingsObject().

115  {
116  global $ilAccess, $lng, $ilCtrl;
117 
118  $surveySetting = new ilSetting("survey");
119  $unlimited_invitation = array_key_exists("unlimited_invitation", $_GET) ? $_GET["unlimited_invitation"] : $surveySetting->get("unlimited_invitation");
120  $use_anonymous_id = array_key_exists("use_anonymous_id", $_GET) ? $_GET["use_anonymous_id"] : $surveySetting->get("use_anonymous_id");
121 
122  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
123  $form = new ilPropertyFormGUI();
124  $form->setFormAction($ilCtrl->getFormAction($this));
125  $form->setTitle($lng->txt("survey_defaults"));
126 
127  // unlimited invitation
128  $enable = new ilCheckboxInputGUI($lng->txt("survey_unlimited_invitation"), "unlimited_invitation");
129  $enable->setChecked($unlimited_invitation);
130  $enable->setInfo($lng->txt("survey_unlimited_invitation_desc"));
131  $form->addItem($enable);
132 
133  // Survey Code
134  $code = new ilCheckboxInputGUI($lng->txt("use_anonymous_id"), "use_anonymous_id");
135  $code->setChecked($use_anonymous_id);
136  $code->setInfo($lng->txt("use_anonymous_id_desc"));
137  $form->addItem($code);
138 
139  // Skipped
140  $eval_skipped = new ilRadioGroupInputGUI($lng->txt("svy_eval_skipped_value"), "skcust");
141  $eval_skipped->setRequired(true);
142  $form->addItem($eval_skipped);
143 
144  $eval_skipped->setValue($surveySetting->get("skipped_is_custom", false)
145  ? "cust"
146  : "lng");
147 
148  $skipped_lng = new ilRadioOption($lng->txt("svy_eval_skipped_value_lng"), "lng");
149  $skipped_lng->setInfo(sprintf($lng->txt("svy_eval_skipped_value_lng_info"), $lng->txt("skipped")));
150  $eval_skipped->addOption($skipped_lng);
151  $skipped_cust = new ilRadioOption($lng->txt("svy_eval_skipped_value_custom"), "cust");
152  $skipped_cust->setInfo($lng->txt("svy_eval_skipped_value_custom_info"));
153  $eval_skipped->addOption($skipped_cust);
154 
155  $skipped_cust_value = new ilTextInputGUI($lng->txt("svy_eval_skipped_value_custom_value"), "cust_value");
156  $skipped_cust_value->setSize(15);
157  $skipped_cust_value->setValue($surveySetting->get("skipped_custom_value", ""));
158  $skipped_cust->addSubItem($skipped_cust_value);
159 
160  $anon_part = new ilCheckboxInputGUI($lng->txt("svy_anonymous_participants"), "anon_part");
161  $anon_part->setInfo($lng->txt("svy_anonymous_participants_info"));
162  $anon_part->setChecked($surveySetting->get("anonymous_participants", false));
163  $form->addItem($anon_part);
164 
165  $anon_part_min = new ilNumberInputGUI($lng->txt("svy_anonymous_participants_min"), "anon_part_min");
166  $anon_part_min->setInfo($lng->txt("svy_anonymous_participants_min_info"));
167  $anon_part_min->setSize(4);
168  $anon_part_min->setMinValue(1);
169  $anon_part_min->setValue($surveySetting->get("anonymous_participants_min", null));
170  $anon_part->addSubItem($anon_part_min);
171 
172  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
173  {
174  $form->addCommandButton("saveSettings", $lng->txt("save"));
175  }
176 
177  return $form;
178  }
This class represents an option in a radio group.
ILIAS Setting Class.
This class represents a property form user interface.
$_GET["client_id"]
$code
Definition: example_050.php:99
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.
setSize($a_size)
Set Size.
This class represents a text 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 183 of file class.ilObjSurveyAdministrationGUI.php.

References $_POST, $ilCtrl, initSettingsForm(), ilUtil\sendSuccess(), and settingsObject().

184  {
185  global $ilCtrl, $ilAccess;
186 
187  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
188  {
189  $ilCtrl->redirect($this, "settings");
190  }
191 
192  $form = $this->initSettingsForm();
193  if($form->checkInput())
194  {
195  $surveySetting = new ilSetting("survey");
196  $surveySetting->set("unlimited_invitation", ($_POST["unlimited_invitation"]) ? "1" : "0");
197  $surveySetting->set("use_anonymous_id", ($_POST["use_anonymous_id"]) ? "1" : "0");
198  $surveySetting->set("anonymous_participants", ($_POST["anon_part"]) ? "1" : "0");
199  $surveySetting->set("anonymous_participants_min", (trim($_POST["anon_part_min"])) ? (int)$_POST["anon_part_min"] : null);
200 
201  if($_POST["skcust"] == "lng")
202  {
203  $surveySetting->set("skipped_is_custom", false);
204  }
205  else
206  {
207  $surveySetting->set("skipped_is_custom", true);
208  $surveySetting->set("skipped_custom_value", trim($_POST["cust_value"]));
209  }
210 
211  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
212  $ilCtrl->redirect($this, "settings");
213  }
214 
215  $form->setValuesByPost();
216  $this->settingsObject($form);
217  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
ILIAS Setting Class.
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 100 of file class.ilObjSurveyAdministrationGUI.php.

References ilObjectGUI\$tpl, and initSettingsForm().

Referenced by saveSettingsObject().

101  {
102  global $tpl, $ilTabs;
103 
104  $ilTabs->activateTab("settings");
105 
106  if(!$a_form)
107  {
108  $a_form = $this->initSettingsForm();
109  }
110 
111  $tpl->setContent($a_form->getHTML());
112  }
+ 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 44 of file class.ilObjSurveyAdministrationGUI.php.


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