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);
57 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
63 case 'ilpermissiongui':
64 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
66 $ret =& $this->ctrl->forwardCommand($perm_gui);
105 $this->ctrl->redirect($this);
110 unset(
$_SESSION[
"survey_adm_found_users"]);
111 if (strlen(
$_POST[
"search"]) < 2)
117 include_once
"./Services/User/classes/class.ilObjUser.php";
121 $_SESSION[
"survey_adm_found_users"] = $found;
129 $this->ctrl->redirect($this,
"specialusers");
138 if ((array_key_exists(
"user_id",
$_POST)) && (count(
$_POST[
"user_id"])))
140 $this->
object->addSpecialUsers(
$_POST[
"user_id"]);
141 unset(
$_SESSION[
"survey_adm_found_users"]);
147 $this->ctrl->redirect($this,
"specialusers");
152 if ((array_key_exists(
"special_user_id",
$_POST)) && (count(
$_POST[
"special_user_id"])))
154 $this->
object->removeSpecialUsers(
$_POST[
"special_user_id"]);
161 $this->ctrl->redirect($this,
"specialusers");
173 $a_write_access = ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) ?
true :
false;
174 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_adm_specialusers.html",
"Modules/Survey");
176 if (array_key_exists(
"survey_adm_found_users",
$_SESSION))
178 if (count(
$_SESSION[
"survey_adm_found_users"]))
181 include_once(
"./Modules/Survey/classes/tables/class.ilFoundUsersTableGUI.php");
183 $table_gui->setPrefix(
"fu");
185 $table_gui->setTitle($this->lng->txt(
"found_users"));
186 $table_gui->setData(
$data);
190 $table_gui->addCommandButton(
"addSpecialUser", $this->lng->txt(
"add"));
191 $table_gui->setSelectAllCheckbox(
"user_id");
193 $found_users = $table_gui->getHTML();
197 if (strlen($found_users))
199 $this->tpl->setCurrentBlock(
"search_results");
200 $this->tpl->setVariable(
"SEARCH_RESULTS", $found_users);
201 $this->tpl->parseCurrentBlock();
203 $this->tpl->setCurrentBlock(
"adm_content");
204 $this->tpl->setVariable(
"TXT_SEARCH_USER", $this->lng->txt(
"search_users"));
205 $this->tpl->setVariable(
"TXT_SEARCH", $this->lng->txt(
"search"));
206 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"search"));
208 $special_users = $this->
object->getSpecialUsers();
209 if (count($special_users))
211 include_once(
"./Modules/Survey/classes/tables/class.ilSpecialUsersTableGUI.php");
213 $table_gui->setPrefix(
"su");
215 $table_gui->setTitle($this->lng->txt(
"adm_special_users"));
216 $table_gui->setData($special_users);
220 $table_gui->addCommandButton(
"removeSpecialUser", $this->lng->txt(
"remove"));
221 $table_gui->setSelectAllCheckbox(
"special_user_id");
223 $this->tpl->setVariable(
"SPECIAL_USERS", $table_gui->getHTML());
227 $this->tpl->setVariable(
"SPECIAL_USERS", $this->lng->txt(
"adm_no_special_users"));
229 $this->tpl->parseCurrentBlock();
243 $surveySetting =
new ilSetting(
"survey");
244 $unlimited_invitation = array_key_exists(
"unlimited_invitation",
$_GET) ?
$_GET[
"unlimited_invitation"] : $surveySetting->get(
"unlimited_invitation");
245 $googlechart = array_key_exists(
"googlechart",
$_GET) ?
$_GET[
"googlechart"] : $surveySetting->get(
"googlechart");
246 $use_anonymous_id = array_key_exists(
"use_anonymous_id",
$_GET) ?
$_GET[
"use_anonymous_id"] : $surveySetting->get(
"use_anonymous_id");
248 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
250 $form->setFormAction($ilCtrl->getFormAction($this));
251 $form->setTitle($lng->txt(
"survey_defaults"));
254 $enable =
new ilCheckboxInputGUI($lng->txt(
"survey_unlimited_invitation"),
"unlimited_invitation");
256 $enable->setInfo($lng->txt(
"survey_unlimited_invitation_desc"));
257 $form->addItem($enable);
262 $enable->setInfo($lng->txt(
"use_google_chart_api_desc"));
263 $form->addItem($enable);
268 $code->setInfo($lng->txt(
"use_anonymous_id_desc"));
269 $form->addItem($code);
271 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
273 $form->addCommandButton(
"saveSettings", $lng->txt(
"save"));
276 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
286 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) $ilCtrl->redirect($this,
"settings");
287 $surveySetting =
new ilSetting(
"survey");
288 $surveySetting->set(
"unlimited_invitation", (
$_POST[
"unlimited_invitation"]) ?
"1" :
"0");
289 $surveySetting->set(
"googlechart", (
$_POST[
"googlechart"]) ?
"1" :
"0");
290 $surveySetting->set(
"use_anonymous_id", (
$_POST[
"use_anonymous_id"]) ?
"1" :
"0");
292 $ilCtrl->redirect($this,
"settings");
309 if ($ilAccess->checkAccess(
"read",
'',$this->object->getRefId()))
311 $tabs_gui->addTarget(
"settings", $this->ctrl->getLinkTarget($this,
"settings"), array(
"settings",
"",
"view"),
"",
"");
312 $tabs_gui->addTarget(
"specialusers", $this->ctrl->getLinkTarget($this,
"specialusers"), array(
"specialusers"),
"",
"");
314 if ($ilAccess->checkAccess(
"edit_permission",
'',$this->object->getRefId()))
316 $tabs_gui->addTarget(
"perm_settings",
317 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');