24 include_once
"./classes/class.ilObjectGUI.php";
48 global $rbacsystem,
$lng;
51 $lng->loadLanguageModule(
"survey");
52 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
53 if (!$rbacsystem->checkAccess(
'read',$this->object->getRefId()))
55 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read_assf"),$this->ilias->error_obj->WARNING);
61 $next_class = $this->ctrl->getNextClass($this);
62 $cmd = $this->ctrl->getCmd();
67 case 'ilpermissiongui':
68 include_once(
"./classes/class.ilPermissionGUI.php");
70 $ret =& $this->ctrl->forwardCommand($perm_gui);
109 $this->ctrl->redirect($this);
114 unset(
$_SESSION[
"survey_adm_found_users"]);
115 if (strlen($_POST[
"search"]) < 2)
121 include_once
"./Services/User/classes/class.ilObjUser.php";
122 $found =
ilObjUser::searchUsers($_POST[
"search"], $active = 1, $a_return_ids_only =
false, $filter_settings = FALSE);
125 $_SESSION[
"survey_adm_found_users"] = $found;
133 $this->ctrl->redirect($this,
"specialusers");
142 if ((array_key_exists(
"user_id", $_POST)) && (count($_POST[
"user_id"])))
144 $this->
object->addSpecialUsers($_POST[
"user_id"]);
145 unset(
$_SESSION[
"survey_adm_found_users"]);
151 $this->ctrl->redirect($this,
"specialusers");
156 if ((array_key_exists(
"special_user_id", $_POST)) && (count($_POST[
"special_user_id"])))
158 $this->
object->removeSpecialUsers($_POST[
"special_user_id"]);
165 $this->ctrl->redirect($this,
"specialusers");
175 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_adm_specialusers.html",
"Modules/Survey");
177 if (array_key_exists(
"survey_adm_found_users",
$_SESSION))
179 if (count(
$_SESSION[
"survey_adm_found_users"]))
182 include_once(
"./Modules/Survey/classes/class.ilFoundUsersTableGUI.php");
184 $table_gui->setPrefix(
"fu");
186 $table_gui->setTitle($this->lng->txt(
"found_users"));
187 $table_gui->setData(
$data);
189 $table_gui->addCommandButton(
"addSpecialUser", $this->lng->txt(
"add"));
190 $table_gui->setSelectAllCheckbox(
"user_id");
191 $found_users = $table_gui->getHTML();
195 if (strlen($found_users))
197 $this->tpl->setCurrentBlock(
"search_results");
198 $this->tpl->setVariable(
"SEARCH_RESULTS", $found_users);
199 $this->tpl->parseCurrentBlock();
201 $this->tpl->setCurrentBlock(
"adm_content");
202 $this->tpl->setVariable(
"TXT_SEARCH_USER", $this->lng->txt(
"search_users"));
203 $this->tpl->setVariable(
"TXT_SEARCH", $this->lng->txt(
"search"));
204 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"search"));
206 $special_users = $this->
object->getSpecialUsers();
207 if (count($special_users))
209 include_once(
"./Modules/Survey/classes/class.ilSpecialUsersTableGUI.php");
211 $table_gui->setPrefix(
"su");
213 $table_gui->setTitle($this->lng->txt(
"adm_special_users"));
214 $table_gui->setData($special_users);
216 $table_gui->addCommandButton(
"removeSpecialUser", $this->lng->txt(
"remove"));
217 $table_gui->setSelectAllCheckbox(
"special_user_id");
218 $this->tpl->setVariable(
"SPECIAL_USERS", $table_gui->getHTML());
222 $this->tpl->setVariable(
"SPECIAL_USERS", $this->lng->txt(
"adm_no_special_users"));
224 $this->tpl->parseCurrentBlock();
238 $surveySetting =
new ilSetting(
"survey");
239 $unlimited_invitation = array_key_exists(
"unlimited_invitation",
$_GET) ?
$_GET[
"unlimited_invitation"] : $surveySetting->get(
"unlimited_invitation");
240 $googlechart = array_key_exists(
"googlechart",
$_GET) ?
$_GET[
"googlechart"] : $surveySetting->get(
"googlechart");
241 $use_anonymous_id = array_key_exists(
"use_anonymous_id",
$_GET) ?
$_GET[
"use_anonymous_id"] : $surveySetting->get(
"use_anonymous_id");
242 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
244 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
247 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
249 $form->setFormAction($ilCtrl->getFormAction($this));
250 $form->setTitle($lng->txt(
"survey_defaults"));
253 $enable =
new ilCheckboxInputGUI($lng->txt(
"survey_unlimited_invitation"),
"unlimited_invitation");
255 $enable->setInfo($lng->txt(
"survey_unlimited_invitation_desc"));
256 $form->addItem($enable);
261 $enable->setInfo($lng->txt(
"use_google_chart_api_desc"));
262 $form->addItem($enable);
267 $code->setInfo($lng->txt(
"use_anonymous_id_desc"));
268 $form->addItem($code);
270 $form->addCommandButton(
"saveSettings", $lng->txt(
"save"));
271 $form->addCommandButton(
"defaults", $lng->txt(
"cancel"));
273 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
283 $surveySetting =
new ilSetting(
"survey");
284 $surveySetting->set(
"unlimited_invitation", ($_POST[
"unlimited_invitation"]) ?
"1" :
"0");
285 $surveySetting->set(
"googlechart", ($_POST[
"googlechart"]) ?
"1" :
"0");
286 $surveySetting->set(
"use_anonymous_id", ($_POST[
"use_anonymous_id"]) ?
"1" :
"0");
287 $ilCtrl->redirect($this,
"settings");
304 if ($ilAccess->checkAccess(
"read",
'',$this->object->getRefId()))
306 $tabs_gui->addTarget(
"settings", $this->ctrl->getLinkTarget($this,
"settings"), array(
"settings",
"",
"view"),
"",
"");
307 $tabs_gui->addTarget(
"specialusers", $this->ctrl->getLinkTarget($this,
"specialusers"), array(
"specialusers"),
"",
"");
309 if ($ilAccess->checkAccess(
"edit_permission",
'',$this->object->getRefId()))
311 $tabs_gui->addTarget(
"perm_settings",
312 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');