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);
99 $this->ctrl->redirect($this);
104 unset(
$_SESSION[
"survey_adm_found_users"]);
105 if (strlen(
$_POST[
"search"]) < 2)
111 include_once
"./Services/User/classes/class.ilObjUser.php";
115 $_SESSION[
"survey_adm_found_users"] = $found;
123 $this->ctrl->redirect($this,
"specialusers");
132 if ((array_key_exists(
"user_id",
$_POST)) && (count(
$_POST[
"user_id"])))
134 $this->
object->addSpecialUsers(
$_POST[
"user_id"]);
135 unset(
$_SESSION[
"survey_adm_found_users"]);
141 $this->ctrl->redirect($this,
"specialusers");
146 if ((array_key_exists(
"special_user_id",
$_POST)) && (count(
$_POST[
"special_user_id"])))
148 $this->
object->removeSpecialUsers(
$_POST[
"special_user_id"]);
155 $this->ctrl->redirect($this,
"specialusers");
167 $a_write_access = ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) ?
true :
false;
168 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_adm_specialusers.html",
"Modules/Survey");
170 if (array_key_exists(
"survey_adm_found_users",
$_SESSION))
172 if (count(
$_SESSION[
"survey_adm_found_users"]))
175 include_once(
"./Modules/Survey/classes/tables/class.ilFoundUsersTableGUI.php");
177 $table_gui->setPrefix(
"fu");
179 $table_gui->setTitle($this->lng->txt(
"found_users"));
180 $table_gui->setData(
$data);
184 $table_gui->addCommandButton(
"addSpecialUser", $this->lng->txt(
"add"));
185 $table_gui->setSelectAllCheckbox(
"user_id");
187 $found_users = $table_gui->getHTML();
191 if (strlen($found_users))
193 $this->tpl->setCurrentBlock(
"search_results");
194 $this->tpl->setVariable(
"SEARCH_RESULTS", $found_users);
195 $this->tpl->parseCurrentBlock();
197 $this->tpl->setCurrentBlock(
"adm_content");
198 $this->tpl->setVariable(
"TXT_SEARCH_USER", $this->lng->txt(
"search_users"));
199 $this->tpl->setVariable(
"TXT_SEARCH", $this->lng->txt(
"search"));
200 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"search"));
202 $special_users = $this->
object->getSpecialUsers();
203 if (count($special_users))
205 include_once(
"./Modules/Survey/classes/tables/class.ilSpecialUsersTableGUI.php");
207 $table_gui->setPrefix(
"su");
209 $table_gui->setTitle($this->lng->txt(
"adm_special_users"));
210 $table_gui->setData($special_users);
214 $table_gui->addCommandButton(
"removeSpecialUser", $this->lng->txt(
"remove"));
215 $table_gui->setSelectAllCheckbox(
"special_user_id");
217 $this->tpl->setVariable(
"SPECIAL_USERS", $table_gui->getHTML());
221 $this->tpl->setVariable(
"SPECIAL_USERS", $this->lng->txt(
"adm_no_special_users"));
223 $this->tpl->parseCurrentBlock();
237 $surveySetting =
new ilSetting(
"survey");
238 $unlimited_invitation = array_key_exists(
"unlimited_invitation",
$_GET) ?
$_GET[
"unlimited_invitation"] : $surveySetting->get(
"unlimited_invitation");
239 $googlechart = array_key_exists(
"googlechart",
$_GET) ?
$_GET[
"googlechart"] : $surveySetting->get(
"googlechart");
240 $use_anonymous_id = array_key_exists(
"use_anonymous_id",
$_GET) ?
$_GET[
"use_anonymous_id"] : $surveySetting->get(
"use_anonymous_id");
242 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
244 $form->setFormAction($ilCtrl->getFormAction($this));
245 $form->setTitle($lng->txt(
"survey_defaults"));
248 $enable =
new ilCheckboxInputGUI($lng->txt(
"survey_unlimited_invitation"),
"unlimited_invitation");
250 $enable->setInfo($lng->txt(
"survey_unlimited_invitation_desc"));
251 $form->addItem($enable);
256 $enable->setInfo($lng->txt(
"use_google_chart_api_desc"));
257 $form->addItem($enable);
262 $code->setInfo($lng->txt(
"use_anonymous_id_desc"));
263 $form->addItem($code);
265 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
267 $form->addCommandButton(
"saveSettings", $lng->txt(
"save"));
270 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
280 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) $ilCtrl->redirect($this,
"settings");
281 $surveySetting =
new ilSetting(
"survey");
282 $surveySetting->set(
"unlimited_invitation", (
$_POST[
"unlimited_invitation"]) ?
"1" :
"0");
283 $surveySetting->set(
"googlechart", (
$_POST[
"googlechart"]) ?
"1" :
"0");
284 $surveySetting->set(
"use_anonymous_id", (
$_POST[
"use_anonymous_id"]) ?
"1" :
"0");
286 $ilCtrl->redirect($this,
"settings");
303 if ($ilAccess->checkAccess(
"read",
'',$this->object->getRefId()))
305 $tabs_gui->addTarget(
"settings", $this->ctrl->getLinkTarget($this,
"settings"), array(
"settings",
"",
"view"),
"",
"");
306 $tabs_gui->addTarget(
"specialusers", $this->ctrl->getLinkTarget($this,
"specialusers"), array(
"specialusers"),
"",
"");
308 if ($ilAccess->checkAccess(
"edit_permission",
'',$this->object->getRefId()))
310 $tabs_gui->addTarget(
"perm_settings",
311 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');