ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjSurveyAdministrationGUI Class Reference

Class ilObjSurveyAdministrationGUI. More...

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

Public Member Functions

 ilObjSurveyAdministrationGUI ($a_data, $a_id, $a_call_by_reference)
executeCommand ()
 execute command
 saveObject ()
 save object public
 searchObject ()
 addSpecialUserObject ()
 Add one or more users as special users.
 removeSpecialUserObject ()
 specialusersObject ()
 Add/remove users who may run a survey multiple times.
 settingsObject ()
 display survey settings form
 saveSettingsObject ()
 Save survey settings.
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getTabs (&$tabs_gui)
 get tabs public
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Data Fields

 $conditions
 Constructor public.
- 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

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __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
 __showClipboardTable ($a_result_set, $a_from="")
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Member Function Documentation

ilObjSurveyAdministrationGUI::addSpecialUserObject ( )

Add one or more users as special users.

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

References $_POST, $_SESSION, and ilUtil\sendInfo().

{
if ((array_key_exists("user_id", $_POST)) && (count($_POST["user_id"])))
{
$this->object->addSpecialUsers($_POST["user_id"]);
unset($_SESSION["survey_adm_found_users"]);
}
else
{
ilUtil::sendInfo($this->lng->txt("adm_search_select_user"), TRUE);
}
$this->ctrl->redirect($this, "specialusers");
}

+ Here is the call graph for this function:

& ilObjSurveyAdministrationGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

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

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if($cmd == "" || $cmd == "view")
{
$cmd = "settings";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjSurveyAdministrationGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjSurveyAdministrationGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

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

Referenced by getAdminTabs().

{
global $ilAccess;
if ($ilAccess->checkAccess("read",'',$this->object->getRefId()))
{
$tabs_gui->addTarget("settings", $this->ctrl->getLinkTarget($this, "settings"), array("settings","","view"), "", "");
$tabs_gui->addTarget("specialusers", $this->ctrl->getLinkTarget($this, "specialusers"), array("specialusers"), "", "");
}
if ($ilAccess->checkAccess("edit_permission",'',$this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}

+ Here is the caller graph for this function:

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

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

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

{
global $rbacsystem, $lng;
$this->type = "svyf";
$lng->loadLanguageModule("survey");
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
}

+ Here is the call graph for this function:

ilObjSurveyAdministrationGUI::removeSpecialUserObject ( )

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

References $_POST, $_SESSION, and ilUtil\sendInfo().

{
if ((array_key_exists("special_user_id", $_POST)) && (count($_POST["special_user_id"])))
{
$this->object->removeSpecialUsers($_POST["special_user_id"]);
unset($_SESSION["adm_removed_users"]);
}
else
{
ilUtil::sendInfo($this->lng->txt("adm_remove_select_user"), TRUE);
}
$this->ctrl->redirect($this, "specialusers");
}

+ Here is the call graph for this function:

ilObjSurveyAdministrationGUI::saveObject ( )

save object public

Reimplemented from ilObjectGUI.

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

References ilUtil\sendSuccess().

{
global $rbacadmin;
// create and insert forum in objecttree
$newObj = parent::saveObject();
// put here object specific stuff
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
$this->ctrl->redirect($this);
}

+ Here is the call graph for this function:

ilObjSurveyAdministrationGUI::saveSettingsObject ( )

Save survey settings.

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

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

{
global $ilCtrl, $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) $ilCtrl->redirect($this, "settings");
$surveySetting = new ilSetting("survey");
$surveySetting->set("unlimited_invitation", ($_POST["unlimited_invitation"]) ? "1" : "0");
$surveySetting->set("googlechart", ($_POST["googlechart"]) ? "1" : "0");
$surveySetting->set("use_anonymous_id", ($_POST["use_anonymous_id"]) ? "1" : "0");
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "settings");
}

+ Here is the call graph for this function:

ilObjSurveyAdministrationGUI::searchObject ( )

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

References $_POST, $_SESSION, ilObjUser\searchUsers(), and ilUtil\sendInfo().

{
unset($_SESSION["survey_adm_found_users"]);
if (strlen($_POST["search"]) < 2)
{
ilUtil::sendInfo($this->lng->txt("adm_search_string_too_small"), TRUE);
}
else
{
include_once "./Services/User/classes/class.ilObjUser.php";
$found = ilObjUser::searchUsers($_POST["search"], $active = 1, $a_return_ids_only = false, $filter_settings = FALSE);
if (count($found))
{
$_SESSION["survey_adm_found_users"] = $found;
}
else
{
ilUtil::sendInfo($this->lng->txt("adm_no_users_found"), TRUE);
}
}
$this->ctrl->redirect($this, "specialusers");
}

+ Here is the call graph for this function:

ilObjSurveyAdministrationGUI::settingsObject ( )

display survey settings form

Default settings tab for Survey settings

public

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilCheckboxInputGUI\setChecked().

{
global $ilAccess, $rbacreview, $lng, $ilCtrl, $tpl;
$surveySetting = new ilSetting("survey");
$unlimited_invitation = array_key_exists("unlimited_invitation", $_GET) ? $_GET["unlimited_invitation"] : $surveySetting->get("unlimited_invitation");
$googlechart = array_key_exists("googlechart", $_GET) ? $_GET["googlechart"] : $surveySetting->get("googlechart");
$use_anonymous_id = array_key_exists("use_anonymous_id", $_GET) ? $_GET["use_anonymous_id"] : $surveySetting->get("use_anonymous_id");
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($lng->txt("survey_defaults"));
// unlimited invitation
$enable = new ilCheckboxInputGUI($lng->txt("survey_unlimited_invitation"), "unlimited_invitation");
$enable->setChecked($unlimited_invitation);
$enable->setInfo($lng->txt("survey_unlimited_invitation_desc"));
$form->addItem($enable);
// Google chart API
$enable = new ilCheckboxInputGUI($lng->txt("use_google_chart_api"), "googlechart");
$enable->setChecked($googlechart);
$enable->setInfo($lng->txt("use_google_chart_api_desc"));
$form->addItem($enable);
// Survey Code
$code = new ilCheckboxInputGUI($lng->txt("use_anonymous_id"), "use_anonymous_id");
$code->setChecked($use_anonymous_id);
$code->setInfo($lng->txt("use_anonymous_id_desc"));
$form->addItem($code);
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$form->addCommandButton("saveSettings", $lng->txt("save"));
}
$tpl->setVariable("ADM_CONTENT", $form->getHTML());
}

+ Here is the call graph for this function:

ilObjSurveyAdministrationGUI::specialusersObject ( )

Add/remove users who may run a survey multiple times.

public

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

References $_SESSION, and ilObjectGUI\$data.

{
global $ilAccess;
$a_write_access = ($ilAccess->checkAccess("write", "", $this->object->getRefId())) ? true : false;
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_adm_specialusers.html", "Modules/Survey");
$found_users = "";
if (array_key_exists("survey_adm_found_users", $_SESSION))
{
if (count($_SESSION["survey_adm_found_users"]))
{
$data = $_SESSION["survey_adm_found_users"];
include_once("./Modules/Survey/classes/tables/class.ilFoundUsersTableGUI.php");
$table_gui = new ilFoundUsersTableGUI($this, "specialusers");
$table_gui->setPrefix("fu");
$table_gui->setTitle($this->lng->txt("found_users"));
$table_gui->setData($data);
if ($a_write_access)
{
$table_gui->addCommandButton("addSpecialUser", $this->lng->txt("add"));
$table_gui->setSelectAllCheckbox("user_id");
}
$found_users = $table_gui->getHTML();
}
}
if (strlen($found_users))
{
$this->tpl->setCurrentBlock("search_results");
$this->tpl->setVariable("SEARCH_RESULTS", $found_users);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TXT_SEARCH_USER", $this->lng->txt("search_users"));
$this->tpl->setVariable("TXT_SEARCH", $this->lng->txt("search"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "search"));
$special_users = $this->object->getSpecialUsers();
if (count($special_users))
{
include_once("./Modules/Survey/classes/tables/class.ilSpecialUsersTableGUI.php");
$table_gui = new ilSpecialUsersTableGUI($this, "specialusers", $a_write_access);
$table_gui->setPrefix("su");
$table_gui->setTitle($this->lng->txt("adm_special_users"));
$table_gui->setData($special_users);
if ($a_write_access)
{
$table_gui->addCommandButton("removeSpecialUser", $this->lng->txt("remove"));
$table_gui->setSelectAllCheckbox("special_user_id");
}
$this->tpl->setVariable("SPECIAL_USERS", $table_gui->getHTML());
}
else
{
$this->tpl->setVariable("SPECIAL_USERS", $this->lng->txt("adm_no_special_users"));
}
$this->tpl->parseCurrentBlock();
}

Field Documentation

ilObjSurveyAdministrationGUI::$conditions

Constructor public.

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


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