Public Member Functions

ilObjGroupGUI Class Reference

Inheritance diagram for ilObjGroupGUI:
Collaboration diagram for ilObjGroupGUI:

Public Member Functions

 ilObjGroupGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=false)
 Constructor public.
 viewObject ()
 list childs of current object
executeCommand ()
 execute command note: this method is overwritten in all container objects
 listExportFilesObject ()
 __exportMenu ()
 exportXMLObject ()
 confirmDeleteExportFileObject ()
 downloadExportFileObject ()
 createObject ()
 create new object form
 canceledObject ()
 canceledObject is called when operation is canceled, method links back public
 cancelMemberObject ()
 canceledObject is called when operation is canceled, method links back public
 saveObject ()
 save group object public
 updateObject ()
 update GroupObject public
 editObject ()
 edit Group public
 confirmationObject ($user_id="", $confirm, $cancel, $info="", $status="", $a_cmd_return_location="")
 displays confirmation form public
 leaveGrpObject ()
 leave Group public
 assignMemberObject ()
 displays confirmation formular with users that shall be assigned to group public
 addUserObject ()
 displays confirmation formular with users that shall be assigned to group public
 removeMemberObject ()
 displays confirmation formular with users that shall be removed from group public
 confirmedRemoveMemberObject ()
 remove members from group public
 changeMemberObject ()
 displays form in which the member-status can be changed public
 membersObject ()
 display group members
 membersGalleryObject ()
 Builds a group members gallery as a layer of left-floating images.
 mailMembersObject ()
 showNewRegistrationsObject ()
 assignApplicantsObject ()
 adds applicant to group as member public
 refuseApplicantsObject ()
 adds applicant to group as member public
 updateMemberStatusObject ()
 displays form in which the member-status can be changed public
 searchUserFormObject ()
 __appendToStoredResults ($a_result)
 cancelSearchObject ()
 searchObject ()
 searchCancelledObject ()
 getTabs (&$tabs_gui)
 common tabs for all container objects (should be called at the end of child getTabs() method
 importFileObject ()
 initCourseContentInterface ()
 __unsetSessionVariables ()
 __search ($a_search_string, $a_search_for)
 __showSearchUserTable ($a_result_set, $a_user_ids=NULL, $a_cmd="search")
 __showSearchRoleTable ($a_result_set, $a_role_ids=NULL)
 __showSearchGroupTable ($a_result_set, $a_grp_ids=NULL)
 __showMembersTable ($a_result_set, $a_user_ids=NULL)
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 listUsersRoleObject ()
 removeSmallIconObject ()
 remove small icon
 removeBigIconObject ()
 remove big icon
 listUsersGroupObject ()
 initConditionHandlerGUI ($item_id)
 exportObject ()
 Creates the output form for group member export.
 exportMembersObject ()
 Exports group members to Microsoft Excel file.
 cleanString ($str)
 Clean output string from german umlauts.
 __setSubTabs ($a_tab)
 set sub tabs
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed
 infoScreen ()
 show information screen
 _goto ($a_target)
 goto target group

Detailed Description

Definition at line 43 of file class.ilObjGroupGUI.php.


Member Function Documentation

ilObjGroupGUI::__appendToStoredResults ( a_result  ) 

Definition at line 1649 of file class.ilObjGroupGUI.php.

References $_SESSION, and $result.

Referenced by __search(), listUsersGroupObject(), and listUsersRoleObject().

        {
                $tmp_array = array();
                foreach($a_result as $result)
                {
                        if(is_array($result))
                        {
                                $tmp_array[] = $result['id'];
                        }
                        elseif($result)
                        {
                                $tmp_array[] = $result;
                        }
                }
                // merge results
                
                $_SESSION['grp_usr_search_result'] = array_unique(array_merge((array) $_SESSION['grp_usr_search_result'],$tmp_array));
                return $_SESSION['grp_usr_search_result'];
        }

Here is the caller graph for this function:

ilObjGroupGUI::__exportMenu (  ) 

Definition at line 328 of file class.ilObjGroupGUI.php.

Referenced by listExportFilesObject().

        {
                // create xml export file button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "exportXML"));
                $this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_create_export_file_xml"));
                $this->tpl->parseCurrentBlock();
        }

Here is the caller graph for this function:

& ilObjGroupGUI::__initTableGUI (  ) 

Reimplemented from ilObjectGUI.

Definition at line 2265 of file class.ilObjGroupGUI.php.

Referenced by __showMembersTable(), __showSearchGroupTable(), __showSearchRoleTable(), and __showSearchUserTable().

        {
                include_once "class.ilTableGUI.php";

                return new ilTableGUI(0,false);
        }

Here is the caller graph for this function:

ilObjGroupGUI::__search ( a_search_string,
a_search_for 
)

Definition at line 1954 of file class.ilObjGroupGUI.php.

References $_SESSION, __appendToStoredResults(), sendInfo(), and ilUtil::stripSlashes().

Referenced by searchObject().

        {
                include_once("class.ilSearch.php");

                $this->lng->loadLanguageModule("content");
                $search =& new ilSearch($_SESSION["AccountId"]);
                $search->setPerformUpdate(false);
                $search->setMinWordLength(1);
                $search->setSearchString(ilUtil::stripSlashes($a_search_string));
                $search->setCombination("and");
                $search->setSearchFor(array(0 => $a_search_for));
                $search->setSearchType('new');

                if($search->validate($message))
                {
                        $search->performSearch();
                }
                else
                {
                        sendInfo($message,true);
                        $this->ctrl->redirect($this,"searchUserForm");
                }

                if($a_search_for == 'usr')
                {
                        $this->__appendToStoredResults($search->getResultByType($a_search_for));
                        return $_SESSION['grp_usr_search_result'];
                }

                return $search->getResultByType($a_search_for);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::__setSubTabs ( a_tab  ) 

set sub tabs

Definition at line 2664 of file class.ilObjGroupGUI.php.

References $_GET, and $rbacsystem.

Referenced by editObject(), executeCommand(), mailMembersObject(), membersGalleryObject(), and membersObject().

        {
                global $rbacsystem,$ilUser;
        
                switch ($a_tab)
                {
                                
                        case 'members':
                                $this->tabs_gui->addSubTabTarget("members",
                                $this->ctrl->getLinkTarget($this,'members'),
                                "members", get_class($this));
                                
                                $this->tabs_gui->addSubTabTarget("grp_members_gallery",
                                $this->ctrl->getLinkTarget($this,'membersGallery'),
                                "membersGallery", get_class($this));
                                
                                $this->tabs_gui->addSubTabTarget("mail_members",
                                $this->ctrl->getLinkTarget($this,'mailMembers'),
                                "mailMembers", get_class($this));

                                break;

                        case "activation":
                                $this->tabs_gui->addSubTabTarget("activation",
                                                                                                 $this->ctrl->getLinkTargetByClass('ilCourseItemAdministrationGUI','edit'),
                                                                                                 "edit", get_class($this));
                                $this->ctrl->setParameterByClass('ilconditionhandlerinterface','item_id',(int) $_GET['item_id']);
                                $this->tabs_gui->addSubTabTarget("preconditions",
                                                                                                 $this->ctrl->getLinkTargetByClass('ilConditionHandlerInterface','listConditions'),
                                                                                                 "", "ilConditionHandlerInterface");
                                break;

                        case 'properties':
                                $this->tabs_gui->addSubTabTarget("edit_properties",
                                                                                                 $this->ctrl->getLinkTarget($this,'edit'),
                                                                                                 "edit", get_class($this));
                                
                                $this->tabs_gui->addSubTabTarget('groupings',
                                                                                                 $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui','listGroupings'),
                                                                                                 'listGroupings',
                                                                                                 get_class($this));
                                break;
                }
        }

Here is the caller graph for this function:

ilObjGroupGUI::__setTableGUIBasicData ( &$  tbl,
&$  result_set,
a_from = "" 
)

standard implementation for tables use 'from' variable use different initial setting of table

Reimplemented from ilObjectGUI.

Definition at line 2272 of file class.ilObjGroupGUI.php.

References $_GET, and $tbl.

Referenced by __showMembersTable(), __showSearchGroupTable(), __showSearchRoleTable(), and __showSearchUserTable().

        {
        switch($from)
                {
                        case "subscribers":
                                $offset = $_GET["update_subscribers"] ? $_GET["offset"] : 0;
                                $order = $_GET["update_subscribers"] ? $_GET["sort_by"] : 'login';
                                $direction = $_GET["update_subscribers"] ? $_GET["sort_order"] : '';
                                break;

                        case "group":
                                $offset = $_GET["offset"];
                        $order = $_GET["sort_by"] ? $_GET["sort_by"] : "title";
                                $direction = $_GET["sort_order"];
                                break;
                                
                        case "role":
                                $offset = $_GET["offset"];
                        $order = $_GET["sort_by"] ? $_GET["sort_by"] : "title";
                                $direction = $_GET["sort_order"];
                                break;

                        default:
                                $offset = $_GET["offset"];
                                // init sort_by (unfortunatly sort_by is preset with 'title'
                        if ($_GET["sort_by"] == "title" or empty($_GET["sort_by"]))
                {
                    $_GET["sort_by"] = "login";
                }
                $order = $_GET["sort_by"];
                                $direction = $_GET["sort_order"];
                                break;
                }

                $tbl->setOrderColumn($order);
                $tbl->setOrderDirection($direction);
                $tbl->setOffset($offset);
                $tbl->setLimit($_GET["limit"]);
                //$tbl->setMaxCount(count($result_set));
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
                $tbl->setData($result_set);
        }

Here is the caller graph for this function:

ilObjGroupGUI::__showMembersTable ( a_result_set,
a_user_ids = NULL 
)

Definition at line 2182 of file class.ilObjGroupGUI.php.

References ilObjectGUI::$actions, $ilBench, $rbacsystem, $tbl, ilObjectGUI::$tpl, __initTableGUI(), __setTableGUIBasicData(), ilUtil::array_php2js(), and ilUtil::getImagePath().

Referenced by membersObject().

        {
        global $rbacsystem,$ilBench;
        
                $ilBench->start("GroupGUI", "__showMembersTable");

                $actions = array("RemoveMember"  => $this->lng->txt("remove"),"changeMember"  => $this->lng->txt("change"));

        $tbl =& $this->__initTableGUI();
                $tpl =& $tbl->getTemplateObject();

                $tpl->setCurrentBlock("tbl_form_header");
                $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_row");
                
                //INTERIMS:quite a circumstantial way to show the list on rolebased accessrights
                if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
                {                       //user is administrator
            #$tpl->setCurrentBlock("plain_button");
                    #$tpl->setVariable("PBTN_NAME","searchUserForm");
                    #$tpl->setVariable("PBTN_VALUE",$this->lng->txt("grp_add_member"));
                    #$tpl->parseCurrentBlock();
                    #$tpl->setCurrentBlock("plain_buttons");
                    #$tpl->parseCurrentBlock();
                
                        $tpl->setVariable("COLUMN_COUNTS",7);
                        $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));

            foreach ($actions as $name => $value)
                        {
                                $tpl->setCurrentBlock("tbl_action_btn");
                                $tpl->setVariable("BTN_NAME",$name);
                                $tpl->setVariable("BTN_VALUE",$value);
                                $tpl->parseCurrentBlock();
                        }
                        
                        if (!empty($a_user_ids))
                        {
                                // set checkbox toggles
                                $tpl->setCurrentBlock("tbl_action_toggle_checkboxes");
                                $tpl->setVariable("JS_VARNAME","user_id");                      
                                $tpl->setVariable("JS_ONCLICK",ilUtil::array_php2js($a_user_ids));
                                $tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
                                $tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
                                $tpl->parseCurrentBlock();
                        }
                        
            $tpl->setVariable("TPLPATH",$this->tpl->tplPath);
                }

                $this->ctrl->setParameter($this,"cmd","members");


                // title & header columns
                $tbl->setTitle($this->lng->txt("members"),"icon_usr_b.gif",$this->lng->txt("group_members"));

                //INTERIMS:quite a circumstantial way to show the list on rolebased accessrights
                if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
                {
                        //user must be administrator
                        $tbl->setHeaderNames(array("",$this->lng->txt("username"),$this->lng->txt("firstname"),$this->lng->txt("lastname"),$this->lng->txt("last_visit"),$this->lng->txt("role"),$this->lng->txt("grp_options")));
                        $tbl->setHeaderVars(array("","login","firstname","lastname","date","role","functions"),$this->ctrl->getParameterArray($this,"",false));
                        $tbl->setColumnWidth(array("","22%","22%","22%","22%","10%"));
                }
                else
                {
                        //user must be member
                        $tbl->setHeaderNames(array($this->lng->txt("username"),$this->lng->txt("firstname"),$this->lng->txt("lastname"),$this->lng->txt("last_visit"),$this->lng->txt("role"),$this->lng->txt("grp_options")));
                        $tbl->setHeaderVars(array("login","firstname","lastname","date","role","functions"),$this->ctrl->getParameterArray($this,"",false));
                        $tbl->setColumnWidth(array("22%","22%","22%","22%","10%"));
                }

                $this->__setTableGUIBasicData($tbl,$a_result_set,"members");
                $tbl->render();
                $this->tpl->setVariable("MEMBER_TABLE",$tbl->tpl->get());
                
                $ilBench->stop("GroupGUI", "__showMembersTable");

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::__showSearchGroupTable ( a_result_set,
a_grp_ids = NULL 
)

Definition at line 2122 of file class.ilObjGroupGUI.php.

References $_GET, $tbl, ilObjectGUI::$tpl, __initTableGUI(), __setTableGUIBasicData(), ilObjectGUI::__showButton(), ilUtil::array_php2js(), and ilUtil::getImagePath().

Referenced by searchObject().

        {
                $this->__showButton('searchUserForm',$this->lng->txt("back"));

        $tbl =& $this->__initTableGUI();
                $tpl =& $tbl->getTemplateObject();

                $tpl->setCurrentBlock("tbl_form_header");
                $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME","searchUserForm");
                $tpl->setVariable("BTN_VALUE",$this->lng->txt("back"));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME","listUsersGroup");
                $tpl->setVariable("BTN_VALUE",$this->lng->txt("grp_list_users"));
                $tpl->parseCurrentBlock();
                
                if (!empty($a_grp_ids))
                {
                        // set checkbox toggles
                        $tpl->setCurrentBlock("tbl_action_toggle_checkboxes");
                        $tpl->setVariable("JS_VARNAME","group");                        
                        $tpl->setVariable("JS_ONCLICK",ilUtil::array_php2js($a_grp_ids));
                        $tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
                        $tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
                        $tpl->parseCurrentBlock();
                }

                $tpl->setCurrentBlock("tbl_action_row");
                $tpl->setVariable("COLUMN_COUNTS",5);
                $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
                $tpl->parseCurrentBlock();

                $tbl->setTitle($this->lng->txt("grp_header_edit_members"),"icon_usr_b.gif",$this->lng->txt("grp_header_edit_members"));
                $tbl->setHeaderNames(array("",
                                                                   $this->lng->txt("obj_grp"),
                                                                   $this->lng->txt("grp_count_members")));
                $tbl->setHeaderVars(array("",
                                                                  "title",
                                                                  "nr_members"),
                                                        array("ref_id" => $this->object->getRefId(),
                                                                  "cmd" => "search",
                                                                  "cmdClass" => "ilobjgroupgui",
                                                                  "cmdNode" => $_GET["cmdNode"]));

                $tbl->setColumnWidth(array("","80%","19%"));


                $this->__setTableGUIBasicData($tbl,$a_result_set,"group");
                $tbl->render();
                
                $this->tpl->setVariable("SEARCH_RESULT_TABLE",$tbl->tpl->get());

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::__showSearchRoleTable ( a_result_set,
a_role_ids = NULL 
)

Definition at line 2062 of file class.ilObjGroupGUI.php.

References $_GET, $tbl, ilObjectGUI::$tpl, __initTableGUI(), __setTableGUIBasicData(), ilObjectGUI::__showButton(), ilUtil::array_php2js(), and ilUtil::getImagePath().

Referenced by searchObject().

        {
                $this->__showButton('searchUserForm',$this->lng->txt("back"));

                $tbl =& $this->__initTableGUI();
                $tpl =& $tbl->getTemplateObject();

                $tpl->setCurrentBlock("tbl_form_header");
                $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME","searchUserForm");
                $tpl->setVariable("BTN_VALUE",$this->lng->txt("back"));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME","listUsersRole");
                $tpl->setVariable("BTN_VALUE",$this->lng->txt("grp_list_users"));
                $tpl->parseCurrentBlock();
                
                if (!empty($a_role_ids))
                {
                        // set checkbox toggles
                        $tpl->setCurrentBlock("tbl_action_toggle_checkboxes");
                        $tpl->setVariable("JS_VARNAME","role");                 
                        $tpl->setVariable("JS_ONCLICK",ilUtil::array_php2js($a_role_ids));
                        $tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
                        $tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
                        $tpl->parseCurrentBlock();
                }

                $tpl->setCurrentBlock("tbl_action_row");
                $tpl->setVariable("COLUMN_COUNTS",5);
                $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
                $tpl->parseCurrentBlock();

                $tbl->setTitle($this->lng->txt("grp_header_edit_members"),"icon_usr_b.gif",$this->lng->txt("grp_header_edit_members"));
                $tbl->setHeaderNames(array("",
                                                                   $this->lng->txt("obj_role"),
                                                                   $this->lng->txt("grp_count_members")));
                $tbl->setHeaderVars(array("",
                                                                  "title",
                                                                  "nr_members"),
                                                        array("ref_id" => $this->object->getRefId(),
                                                                  "cmd" => "search",
                                                                  "cmdClass" => "ilobjgroupgui",
                                                                  "cmdNode" => $_GET["cmdNode"]));

                $tbl->setColumnWidth(array("","80%","19%"));


                $this->__setTableGUIBasicData($tbl,$a_result_set,"role");
                $tbl->render();
                
                $this->tpl->setVariable("SEARCH_RESULT_TABLE",$tbl->tpl->get());

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::__showSearchUserTable ( a_result_set,
a_user_ids = NULL,
a_cmd = "search" 
)

Definition at line 1986 of file class.ilObjGroupGUI.php.

References $_GET, $tbl, ilObjectGUI::$tpl, __initTableGUI(), __setTableGUIBasicData(), ilObjectGUI::__showButton(), ilUtil::array_php2js(), and ilUtil::getImagePath().

Referenced by listUsersGroupObject(), listUsersRoleObject(), and searchObject().

        {
                $this->__showButton('searchUserForm',$this->lng->txt("back"));
        
        if ($a_cmd == "listUsersRole" or $a_cmd == "listUsersGroup")
        {
            $return_to = "search";
        }

                $tbl =& $this->__initTableGUI();
                $tpl =& $tbl->getTemplateObject();

                // SET FORMACTION
                $tpl->setCurrentBlock("tbl_form_header");
                $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $tpl->parseCurrentBlock();


                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME","addUser");
                $tpl->setVariable("BTN_VALUE",$this->lng->txt("add"));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("plain_button");
                $tpl->setVariable("PBTN_NAME",'searchUserForm');
                $tpl->setVariable("PBTN_VALUE",$this->lng->txt('append_search'));
                $tpl->parseCurrentBlock();
                
                $tpl->setCurrentBlock("plain_button");
                $tpl->setVariable("PBTN_NAME",'cancelSearch');
                $tpl->setVariable("PBTN_VALUE",$this->lng->txt("grp_new_search"));
                $tpl->parseCurrentBlock();


                if (!empty($a_user_ids))
                {
                        // set checkbox toggles
                        $tpl->setCurrentBlock("tbl_action_toggle_checkboxes");
                        $tpl->setVariable("JS_VARNAME","user");                 
                        $tpl->setVariable("JS_ONCLICK",ilUtil::array_php2js($a_user_ids));
                        $tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
                        $tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
                        $tpl->parseCurrentBlock();
                }

                $tpl->setCurrentBlock("tbl_action_row");
                $tpl->setVariable("COLUMN_COUNTS",5);
                $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
                $tpl->parseCurrentBlock();

                $tbl->setTitle($this->lng->txt("grp_header_edit_members"),"icon_usr_b.gif",$this->lng->txt("grp_header_edit_members"));
                $tbl->setHeaderNames(array("",
                                                                   $this->lng->txt("username"),
                                                                   $this->lng->txt("firstname"),
                                                                   $this->lng->txt("lastname"),
                                                                   $this->lng->txt("last_visit")));
                $tbl->setHeaderVars(array("",
                                                                  "login",
                                                                  "firstname",
                                                                  "lastname",
                                                                  "last_visit"),
                                                        array("ref_id" => $this->object->getRefId(),
                                                                  "cmd" => $a_cmd,
                                                                  "cmdClass" => "ilobjgroupgui",
                                                                  "cmdNode" => $_GET["cmdNode"]));

                $tbl->setColumnWidth(array("","33%","33%","33%"));

                $this->__setTableGUIBasicData($tbl,$a_result_set);
                $tbl->render();
                
                $this->tpl->setVariable("SEARCH_RESULT_TABLE",$tbl->tpl->get());

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::__unsetSessionVariables (  ) 

Definition at line 1943 of file class.ilObjGroupGUI.php.

References $_SESSION.

Referenced by searchUserFormObject().

        {
                unset($_SESSION["grp_delete_member_ids"]);
                unset($_SESSION["grp_delete_subscriber_ids"]);
                unset($_SESSION["grp_search_str"]);
                unset($_SESSION["grp_search_for"]);
                unset($_SESSION["grp_role"]);
                unset($_SESSION["grp_group"]);
                unset($_SESSION["grp_archives"]);
        }

Here is the caller graph for this function:

ilObjGroupGUI::_goto ( a_target  ) 

goto target group

Definition at line 2769 of file class.ilObjGroupGUI.php.

References $_GET, $ilErr, ilObjectGUI::$lng, ilObject::_lookupObjId(), ilObject::_lookupTitle(), exit, and sendInfo().

        {
                global $ilAccess, $ilErr, $lng;

                if ($ilAccess->checkAccess("read", "", $a_target))
                {
                        $_GET["cmd"] = "frameset";
                        $_GET["ref_id"] = $a_target;
                        include("repository.php");
                        exit;
                }
                else
                {
                        // to do: force flat view
                        if ($ilAccess->checkAccess("visible", "", $a_target))
                        {
                                $_GET["cmd"] = "infoScreen";
                                $_GET["ref_id"] = $a_target;
                                include("repository.php");
                                exit;
                        }
                        else
                        {
                                if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
                                {
                                        $_GET["cmd"] = "frameset";
                                        $_GET["target"] = "";
                                        $_GET["ref_id"] = ROOT_FOLDER_ID;
                                        sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
                                                ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
                                        include("repository.php");
                                        exit;
                                }
                        }
                }
                $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
        }

Here is the call graph for this function:

ilObjGroupGUI::addUserObject (  ) 

displays confirmation formular with users that shall be assigned to group public

Definition at line 955 of file class.ilObjGroupGUI.php.

References $_POST, $_SESSION, ilUtil::redirect(), and sendInfo().

        {
                $user_ids = $_POST["user"];
                
                $mail = new ilMail($_SESSION["AccountId"]);

                if (empty($user_ids[0]))
                {
                        // TODO: jumps back to grp content. go back to last search result
                        #$this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
                        sendInfo($this->lng->txt("no_checkbox"));
                
                        return false;
                }

                foreach ($user_ids as $new_member)
                {
                        if (!$this->object->addMember($new_member,$this->object->getDefaultMemberRole()))
                        {
                                $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
                        }
                        
                        $user_obj = $this->ilias->obj_factory->getInstanceByObjId($new_member);
                
                        $user_obj->addDesktopItem($this->object->getRefId(),"grp");
                        $mail->sendMail($user_obj->getLogin(),"","",$this->lng->txtlng("common","grp_mail_subj_new_subscription",$user_obj->getLanguage()).": ".$this->object->getTitle(),$this->lng->txtlng("common","grp_mail_body_new_subscription",$user_obj->getLanguage()),array(),array('normal'));      

                        unset($user_obj);
                }
                
                unset($_SESSION["saved_post"]);
                unset($_SESSION['grp_usr_search_result']);

                sendInfo($this->lng->txt("grp_msg_member_assigned"),true);
                ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
        }

Here is the call graph for this function:

ilObjGroupGUI::assignApplicantsObject (  ) 

adds applicant to group as member public

Definition at line 1533 of file class.ilObjGroupGUI.php.

References $_POST, $_SESSION, $user, ilUtil::redirect(), and sendInfo().

        {
                $user_ids = $_POST["user_id"];

                if (empty($user_ids[0]))
                {
                        $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
                }

                $mail = new ilMail($_SESSION["AccountId"]);

                foreach ($user_ids as $new_member)
                {
                        $user =& $this->ilias->obj_factory->getInstanceByObjId($new_member);

                        if (!$this->object->addMember($new_member, $this->object->getDefaultMemberRole()))
                        {
                                $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
                        }

                        $this->object->deleteApplicationListEntry($new_member);
                        $mail->sendMail($user->getLogin(),"","","New Membership in Group: ".$this->object->getTitle(),"You have been assigned to the group as a member. You can now access all group specific objects like forums, learningmodules,etc..",array(),array('normal'));
                }

                sendInfo($this->lng->txt("grp_msg_applicants_assigned"),true);
                ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
        }

Here is the call graph for this function:

ilObjGroupGUI::assignMemberObject (  ) 

displays confirmation formular with users that shall be assigned to group public

Definition at line 927 of file class.ilObjGroupGUI.php.

References $_POST, $_SESSION, ilUtil::redirect(), and sendInfo().

        {
                $user_ids = $_POST["id"];

                if (empty($user_ids[0]))
                {
                        // TODO: jumps back to grp content. go back to last search result
                        $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
                }

                foreach ($user_ids as $new_member)
                {
                        if (!$this->object->addMember($new_member,$this->object->getDefaultMemberRole()))
                        {
                                $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
                        }
                }

                unset($_SESSION["saved_post"]);

                sendInfo($this->lng->txt("grp_msg_member_assigned"),true);
                ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
        }

Here is the call graph for this function:

ilObjGroupGUI::canceledObject (  ) 

canceledObject is called when operation is canceled, method links back public

Definition at line 563 of file class.ilObjGroupGUI.php.

References $_GET, ilObjectGUI::$return_location, and sendInfo().

        {
                $return_location = $_GET["cmd_return_location"];
                if (strcmp($return_location, "") == 0)
                {
                        $return_location = "";
                }

                sendInfo($this->lng->txt("action_aborted"),true);
                $this->ctrl->redirect($this, $return_location);
        }

Here is the call graph for this function:

ilObjGroupGUI::cancelMemberObject (  ) 

canceledObject is called when operation is canceled, method links back public

Definition at line 579 of file class.ilObjGroupGUI.php.

References $_SESSION, ilObjectGUI::$return_location, ilUtil::redirect(), and sendInfo().

        {
                unset($_SESSION['grp_usr_search_result']);
                $return_location = "members";
                
                sendInfo($this->lng->txt("action_aborted"),true);
                ilUtil::redirect($this->ctrl->getLinkTarget($this,$return_location));
        }

Here is the call graph for this function:

ilObjGroupGUI::cancelSearchObject (  ) 

Definition at line 1669 of file class.ilObjGroupGUI.php.

References $_SESSION, and searchUserFormObject().

        {
                $_SESSION['grp_usr_search_result'] = array();
                $_SESSION['grp_search_str'] = '';
                $this->searchUserFormObject();
        }

Here is the call graph for this function:

ilObjGroupGUI::changeMemberObject (  ) 

displays form in which the member-status can be changed public

Definition at line 1086 of file class.ilObjGroupGUI.php.

References $_GET, $_POST, $_SESSION, $output, $tbl, formatDate(), ilUtil::formSelect(), ilUtil::getImagePath(), infoPanel(), and ilUtil::sortArray().

        {
                if ($_GET["sort_by"] == "title" or $_GET["sort_by"] == "")
                {
                        $_GET["sort_by"] = "login";
                }

                $member_ids = array();

                if (isset($_POST["user_id"]))
                {
                        $member_ids = $_POST["user_id"];
                }
                else if (isset($_GET["mem_id"]))
                {
                        $member_ids[0] = $_GET["mem_id"];
                }

                if (empty($member_ids[0]))
                {
                        $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
                }

                if (!in_array(SYSTEM_ROLE_ID,$_SESSION["RoleId"]) 
                        and !in_array($this->ilias->account->getId(),$this->object->getGroupAdminIds()))
                {
                        $this->ilErr->raiseError($this->lng->txt("grp_err_no_permission"),$this->ilErr->MESSAGE);
                }

                $stati = array_flip($this->object->getLocalGroupRoles(true));
                //var_dump($stati);exit;

                //build data structure
                foreach ($member_ids as $member_id)
                {
                        $member =& $this->ilias->obj_factory->getInstanceByObjId($member_id);
                        $mem_status = $this->object->getMemberRoles($member_id);

                        $this->data["data"][$member->getId()]= array(
                                        "login"         => $member->getLogin(),
                                        "firstname"     => $member->getFirstname(),
                                        "lastname"      => $member->getLastname(),
                                        "last_visit"=> ilFormat::formatDate($member->getLastLogin()),
                                        "grp_role"      => ilUtil::formSelect($mem_status,"member_status_select[".$member->getId()."][]",$stati,true,true,3)
                                );
                }
                
                unset($member);
                
                infoPanel();

                $this->tpl->addBlockfile("ADM_CONTENT", "member_table", "tpl.table.html");

                // load template for table content data
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

                $this->data["buttons"] = array( "updateMemberStatus"  => $this->lng->txt("confirm"),
                                                                                "members"  => $this->lng->txt("back"));

                $this->tpl->setCurrentBlock("tbl_action_row");
                $this->tpl->setVariable("COLUMN_COUNTS",5);
                //$this->tpl->setVariable("TPLPATH",$this->tpl->tplPath);
                $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));

                foreach ($this->data["buttons"] as $name => $value)
                {
                        $this->tpl->setCurrentBlock("tbl_action_btn");
                        $this->tpl->setVariable("BTN_NAME",$name);
                        $this->tpl->setVariable("BTN_VALUE",$value);
                        $this->tpl->parseCurrentBlock();
                }

                //sort data array
                $this->data["data"] = ilUtil::sortArray($this->data["data"], $_GET["sort_by"], $_GET["sort_order"]);
                $output = array_slice($this->data["data"],$_GET["offset"],$_GET["limit"]);
                
                // create table
                include_once "./classes/class.ilTableGUI.php";

                $tbl = new ilTableGUI($output);

                // title & header columns
                $tbl->setTitle($this->lng->txt("grp_mem_change_status"),"icon_usr_b.gif",$this->lng->txt("grp_mem_change_status"));
                //$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
                $tbl->setHeaderNames(array($this->lng->txt("username"),$this->lng->txt("firstname"),$this->lng->txt("lastname"),$this->lng->txt("last_visit"),$this->lng->txt("role")));
                $tbl->setHeaderVars(array("login","firstname","lastname","last_visit","role"),$this->ctrl->getParameterArray($this,"",false));

                $tbl->setColumnWidth(array("20%","20%","20%","40%"));

                $this->tpl->setCurrentBlock("tbl_action_row");
                $this->tpl->parseCurrentBlock();

                // control
                $tbl->setOrderColumn($_GET["sort_by"]);
                $tbl->setOrderDirection($_GET["sort_order"]);
                $tbl->setLimit($_GET["limit"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setMaxCount(count($this->data["data"]));

                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));

                // render table
                $tbl->render();
        }

Here is the call graph for this function:

ilObjGroupGUI::cleanString ( str  ) 

Clean output string from german umlauts.

Clean output string from german umlauts. Replaces ä -> ae etc.

Parameters:
string $str String to clean
Returns:
string Cleaned string

Definition at line 2656 of file class.ilObjGroupGUI.php.

Referenced by exportMembersObject().

        {
                return str_replace(array("ä","ö","ü","ß","Ä","Ö","Ü"), array("ae","oe","ue","ss","Ae","Oe","Ue"), $str);
        }

Here is the caller graph for this function:

ilObjGroupGUI::confirmationObject ( user_id = "",
confirm,
cancel,
info = "",
status = "",
a_cmd_return_location = "" 
)

displays confirmation form public

Definition at line 799 of file class.ilObjGroupGUI.php.

References $_SESSION, $counter, $id, $key, $user_id, ilUtil::getImagePath(), ilUtil::getImageTagByType(), ilObjectGUI::getTemplateFile(), infoPanel(), sendInfo(), and ilUtil::switchColor().

Referenced by leaveGrpObject(), and removeMemberObject().

        {
                $this->data["cols"] = array("type", "title", "description", "last_change");

                if (is_array($user_id))
                {
                        foreach ($user_id as $id)
                        {
                                $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);

                                $this->data["data"]["$id"] = array(
                                        "type"        => $obj_data->getType(),
                                        "title"       => $obj_data->getTitle(),
                                        "desc"        => $obj_data->getDescription(),
                                        "last_update" => $obj_data->getLastUpdateDate(),

                                        );
                        }
                }
                else
                {
                        $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($user_id);

                        $this->data["data"]["$id"] = array(
                                "type"        => $obj_data->getType(),
                                "title"       => $obj_data->getTitle(),
                                "desc"        => $obj_data->getDescription(),
                                "last_update" => $obj_data->getLastUpdateDate(),
                                );
                }

                //write  in sessionvariables
                if(is_array($user_id))
                {
                        $_SESSION["saved_post"]["user_id"] = $user_id;
                }
                else
                {
                        $_SESSION["saved_post"]["user_id"][0] = $user_id;
                }

                if (isset($status))
                {
                        $_SESSION["saved_post"]["status"] = $status;
                }

                $this->data["buttons"] = array( $cancel  => $this->lng->txt("cancel"),
                                                $confirm  => $this->lng->txt("confirm"));

                $this->getTemplateFile("confirm");

                $this->tpl->setVariable("TPLPATH",$this->tpl->tplPath);

                infoPanel();

                sendInfo($this->lng->txt($info));

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)."&cmd_return_location=".$a_cmd_return_location);

                // BEGIN TABLE HEADER
                foreach ($this->data["cols"] as $key)
                {
                        $this->tpl->setCurrentBlock("table_header");
                        $this->tpl->setVariable("TEXT",$this->lng->txt($key));
                        $this->tpl->parseCurrentBlock();
                }
                // END TABLE HEADER

                // BEGIN TABLE DATA
                $counter = 0;

                foreach ($this->data["data"] as $key => $value)
                {
                        // BEGIN TABLE CELL
                        foreach ($value as $key => $cell_data)
                        {
                                $this->tpl->setCurrentBlock("table_cell");

                                // CREATE TEXT STRING
                                if ($key == "type")
                                {
                                        $this->tpl->setVariable("TEXT_CONTENT",ilUtil::getImageTagByType($cell_data,$this->tpl->tplPath));
                                }
                                else
                                {
                                        $this->tpl->setVariable("TEXT_CONTENT",$cell_data);
                                }
                                $this->tpl->parseCurrentBlock();
                        }

                        $this->tpl->setCurrentBlock("table_row");
                        $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
                        $this->tpl->parseCurrentBlock();
                        // END TABLE CELL
                }
                // END TABLE DATA

                // BEGIN OPERATION_BTN
                foreach ($this->data["buttons"] as $name => $value)
                {
                        $this->tpl->setCurrentBlock("operation_btn");
                        $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("spacer.gif"));
                        $this->tpl->setVariable("BTN_NAME",$name);
                        $this->tpl->setVariable("BTN_VALUE",$value);
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::confirmDeleteExportFileObject (  ) 

Definition at line 353 of file class.ilObjGroupGUI.php.

References $_POST, $rbacsystem, listExportFilesObject(), sendInfo(), and ilUtil::stripSlashes().

        {
                global $rbacsystem;

                if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
                {
                        $this->ilErr->raiseError($this->lng->txt("permission_denied"),$this->ilErr->MESSAGE);
                }

                if(!count($_POST['file']))
                {
                        sendInfo('grp_select_one_file');
                }
                else
                {
                        $this->object->deleteExportFiles(ilUtil::stripSlashes($_POST['file']));
                        sendInfo('grp_deleted_export_files');
                }

                $this->listExportFilesObject();

                return true;
        }

Here is the call graph for this function:

ilObjGroupGUI::confirmedRemoveMemberObject (  ) 

remove members from group public

Definition at line 1037 of file class.ilObjGroupGUI.php.

References $_SESSION, ilUtil::redirect(), and sendInfo().

        {
                $removed_self = false;
                
                $mail = new ilMail($_SESSION["AccountId"]);

                //User needs to have administrative rights to remove members...
                foreach($_SESSION["saved_post"]["user_id"] as $member_id)
                {
                        $err_msg = $this->object->removeMember($member_id);

                        if (strlen($err_msg) > 0)
                        {
                                sendInfo($this->lng->txt($err_msg),true);
                                ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
                        }
                        
                        $user_obj = new ilObjUser($member_id);
                        
                        $user_obj->dropDesktopItem($this->object->getRefId(), "grp");
                        
                        if (!$removed_self and $user_obj->getId() == $this->ilias->account->getId())
                        {
                                $removed_self = true;
                        }
                        else
                        {
                                $mail->sendMail($user_obj->getLogin(),"","",$this->lng->txtlng("common","grp_mail_subj_subscription_cancelled",$user_obj->getLanguage()).": ".$this->object->getTitle(),$this->lng->txtlng("common","grp_mail_body_subscription_cancelled",$user_obj->getLanguage()),array(),array('normal'));
                        }                       

                }

                unset($_SESSION["saved_post"]);

                sendInfo($this->lng->txt("grp_msg_membership_annulled"),true);
                
                if ($removed_self)
                {
                        ilUtil::redirect("repository.php?ref_id=".$this->tree->getParentId($this->ref_id));
                }

                ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
        }

Here is the call graph for this function:

ilObjGroupGUI::createObject (  ) 

create new object form

Reimplemented from ilObjectGUI.

Definition at line 404 of file class.ilObjGroupGUI.php.

References $_GET, $_POST, $_SESSION, ilObjectGUI::$data, $key, $rbacsystem, ilUtil::formRadioButton(), formSelect(), ilObjectGUI::getFormAction(), ilUtil::getImagePath(), ilObjectGUI::getTargetFrame(), ilObjectGUI::getTemplateFile(), ilUtil::prepareFormOutput(), and ilUtil::stripSlashes().

Referenced by importFileObject().

        {
                global $rbacsystem;

                $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];

                if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
                {
                        $this->ilErr->raiseError($this->lng->txt("permission_denied"),$this->ilErr->MESSAGE);
                }

                $data = array();

                if ($_SESSION["error_post_vars"])
                {
                        // fill in saved values in case of error
                        $data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
                        $data["fields"]["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);
                        $data["fields"]["password"] = $_SESSION["error_post_vars"]["password"];
                        $data["fields"]["expirationdate"] = $_SESSION["error_post_vars"]["expirationdate"];
                        $data["fields"]["expirationtime"] = $_SESSION["error_post_vars"]["expirationtime"];
                }
                else
                {
                        $data["fields"]["title"] = "";
                        $data["fields"]["desc"] = "";
                        $data["fields"]["password"] = "";
                        $data["fields"]["expirationdate"] = "";
                        $data["fields"]["expirationtime"] = "";
                }

                $this->getTemplateFile("edit", $new_type);
                
                $this->tpl->setCurrentBlock("img1");
                $this->tpl->setVariable("TYPE_IMG1",
                        ilUtil::getImagePath("icon_grp.gif"));
                $this->tpl->setVariable("ALT_IMG1",
                        $this->lng->txt("obj_grp"));
                $this->tpl->parseCurrentBlock();

                foreach ($data["fields"] as $key => $val)
                {
                        $this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
                        $this->tpl->setVariable(strtoupper($key), $val);

                        if ($this->prepare_output)
                        {
                                $this->tpl->parseCurrentBlock();
                        }
                }

                $stati  = array(0=>$this->lng->txt("group_status_public"),1=>$this->lng->txt("group_status_closed"));

                $grp_status = $_SESSION["error_post_vars"]["group_status"];

                $checked = array(0=>0,1=>0,2=>0);

                switch ($_SESSION["error_post_vars"]["enable_registration"])
                {
                        case 0:
                                $checked[0]=1;
                                break;

                        case 1:
                                $checked[1]=1;
                                break;

                        case 2:
                                $checked[2]=1;
                                break;

                        default:
                                $checked[0]=1;
                                break;
                }

                //build form
                $cb_registration[0] = ilUtil::formRadioButton($checked[0], "enable_registration", 0);
                $cb_registration[1] = ilUtil::formRadioButton($checked[1], "enable_registration", 1);
                $cb_registration[2] = ilUtil::formRadioButton($checked[2], "enable_registration", 2);

                $opts   = ilUtil::formSelect(0,"group_status",$stati,false,true);

                $this->tpl->setVariable("FORMACTION", $this->getFormAction("save",$this->ctrl->getFormAction($this)."&new_type=".$new_type));

                $this->tpl->setVariable("TXT_HEADER", $this->lng->txt($new_type."_new"));

                $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
                $this->tpl->setVariable("TXT_REGISTRATION", $this->lng->txt("group_registration"));
                $this->tpl->setVariable("TXT_REGISTRATION_MODE", $this->lng->txt("group_registration_mode"));
                $this->tpl->setVariable("TXT_REGISTRATION_TIME", $this->lng->txt("group_registration_time"));

                $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
                $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($new_type."_add"));
                $this->tpl->setVariable("CMD_SUBMIT", "save");
                $this->tpl->setVariable("CMD_CANCEL", "cancel");
                $this->tpl->setVariable("TARGET", $this->getTargetFrame("save"));
                $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));

                $this->tpl->setVariable("TXT_DISABLEREGISTRATION", $this->lng->txt("group_req_direct"));
                $this->tpl->setVariable("TXT_REGISTRATION_UNLIMITED", $this->lng->txt("grp_registration_unlimited"));
                $this->tpl->setVariable("RB_NOREGISTRATION", $cb_registration[0]);
                $this->tpl->setVariable("TXT_ENABLEREGISTRATION", $this->lng->txt("group_req_registration"));
                $this->tpl->setVariable("RB_REGISTRATION", $cb_registration[1]);
                $this->tpl->setVariable("TXT_PASSWORDREGISTRATION", $this->lng->txt("group_req_password"));
                $this->tpl->setVariable("RB_PASSWORDREGISTRATION", $cb_registration[2]);

                $this->tpl->setVariable("TXT_EXPIRATIONDATE", $this->lng->txt("group_registration_expiration_date"));
                $this->tpl->setVariable("TXT_EXPIRATIONTIME", $this->lng->txt("group_registration_expiration_time"));
                $this->tpl->setVariable("TXT_DATE", $this->lng->txt("DD.MM.YYYY"));
                $this->tpl->setVariable("TXT_TIME", $this->lng->txt("HH:MM"));

                $this->tpl->setVariable("CB_KEYREGISTRATION", $cb_keyregistration);
                $this->tpl->setVariable("TXT_KEYREGISTRATION", $this->lng->txt("group_keyregistration"));
                $this->tpl->setVariable("TXT_PASSWORD", $this->lng->txt("password"));
                $this->tpl->setVariable("SELECT_GROUPSTATUS", $opts);
                $this->tpl->setVariable("TXT_GROUP_STATUS", $this->lng->txt("group_status"));
                $this->tpl->setVariable("TXT_GROUP_STATUS_DESC", $this->lng->txt("group_status_desc"));

                $this->tpl->setCurrentBlock("img2");
                $this->tpl->setVariable("TYPE_IMG2",
                        ilUtil::getImagePath("icon_grp.gif"));
                $this->tpl->setVariable("ALT_IMG2",
                        $this->lng->txt("obj_grp"));
                $this->tpl->parseCurrentBlock();

                // IMPORT
                $this->tpl->setCurrentBlock("create");
                $this->tpl->setVariable("TXT_IMPORT_GRP", $this->lng->txt("import_grp"));
                $this->tpl->setVariable("TXT_GRP_FILE", $this->lng->txt("file"));
                $this->tpl->setVariable("TXT_IMPORT", $this->lng->txt("import"));
                
                $this->tpl->setVariable("TXT_CANCEL2", $this->lng->txt("cancel"));
                $this->tpl->setVariable("CMD_CANCEL2", "cancel");

                // get the value for the maximal uploadable filesize from the php.ini (if available)
                $umf=get_cfg_var("upload_max_filesize");
                // get the value for the maximal post data from the php.ini (if available)
                $pms=get_cfg_var("post_max_size");

                // use the smaller one as limit
                $max_filesize=min($umf, $pms);
                if (!$max_filesize) 
                        $max_filesize=max($umf, $pms);
        
                // gives out the limit as a littel notice :)
                $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice").$max_filesize);
                $this->tpl->parseCurrentBlock();

                $this->tpl->setCurrentBlock("fileinfo");
                $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice").$max_filesize);
                $this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::downloadExportFileObject (  ) 

Definition at line 377 of file class.ilObjGroupGUI.php.

References $_POST, listExportFilesObject(), sendInfo(), and ilUtil::stripSlashes().

        {
                if(!count($_POST['file']))
                {
                        sendInfo('grp_select_one_file');
                        $this->listExportFilesObject();
                        return false;
                }
                if(count($_POST['file']) > 1)
                {
                        sendInfo('grp_select_one_file_only');
                        $this->listExportFilesObject();
                        return false;
                }
                
                $this->object->downloadExportFile(ilUtil::stripSlashes($_POST['file'][0]));
                
                // If file wasn't sent
                sendInfo('grp_error_sending_file');
                
                return true;
        }

Here is the call graph for this function:

ilObjGroupGUI::editObject (  ) 

edit Group public

Reimplemented from ilObjectGUI.

Definition at line 696 of file class.ilObjGroupGUI.php.

References $_SESSION, ilObjectGUI::$data, $key, $rbacsystem, __setSubTabs(), ilUtil::formRadioButton(), ilObjectGUI::getTemplateFile(), ilUtil::prepareFormOutput(), ilContainerGUI::showCustomIconsEditing(), and ilUtil::stripSlashes().

        {
                global $rbacsystem;

                if (!$rbacsystem->checkAccess("write", $this->ref_id))
                {
                        $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }

                $data = array();

                if ($_SESSION["error_post_vars"])
                {
                        // fill in saved values in case of error
                        $data["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
                        $data["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);
                        $data["registration"] = $_SESSION["error_post_vars"]["registration"];
                        $data["password"] = $_SESSION["error_post_vars"]["password"];
                        $data["expirationdate"] = $_SESSION["error_post_vars"]["expirationdate"];//$datetime[0];//$this->grp_object->getExpirationDateTime()[0];
                        $data["expirationtime"] = $_SESSION["error_post_vars"]["expirationtime"];//$datetime[1];//$this->grp_object->getExpirationDateTime()[1];

                }
                else
                {
                        $data["title"] = ilUtil::prepareFormOutput($this->object->getTitle());
                        $data["desc"] = $this->object->getDescription();
                        $data["registration"] = $this->object->getRegistrationFlag();
                        $data["password"] = $this->object->getPassword();
                        $datetime = $this->object->getExpirationDateTime();

                        $data["expirationdate"] = $datetime[0];//$this->grp_object->getExpirationDateTime()[0];
                        $data["expirationtime"] =  substr($datetime[1],0,5);//$this->grp_object->getExpirationDateTime()[1];

                }

                $this->getTemplateFile("edit");
                $this->__setSubTabs('properties');

                foreach ($data as $key => $val)
                {
                        $this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
                        $this->tpl->setVariable(strtoupper($key), $val);
                        $this->tpl->parseCurrentBlock();
                }

                $checked = array(0=>0,1=>0,2=>0);

                switch ($this->object->getRegistrationFlag())
                {
                        case 0:
                                $checked[0]=1;
                                break;

                        case 1:
                                $checked[1]=1;
                                break;

                        case 2:
                                $checked[2]=1;
                                break;
                }

                $cb_registration[0] = ilUtil::formRadioButton($checked[0], "enable_registration", 0);
                $cb_registration[1] = ilUtil::formRadioButton($checked[1], "enable_registration", 1);
                $cb_registration[2] = ilUtil::formRadioButton($checked[2], "enable_registration", 2);
                
                $this->showCustomIconsEditing(2);
                $this->tpl->setCurrentBlock("adm_content");

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));//$this->getFormAction("update",$this->ctrl->getFormAction($this)));
                $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("grp_edit"));
                $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
                $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
                $this->tpl->setVariable("CMD_CANCEL", "canceled");
                $this->tpl->setVariable("CMD_SUBMIT", "update");

                $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
                $this->tpl->setVariable("TXT_REGISTRATION", $this->lng->txt("group_registration"));
                $this->tpl->setVariable("TXT_REGISTRATION_MODE", $this->lng->txt("group_registration_mode"));
                $this->tpl->setVariable("TXT_REGISTRATION_TIME", $this->lng->txt("group_registration_time"));

                $this->tpl->setVariable("TXT_DISABLEREGISTRATION", $this->lng->txt("group_req_direct"));
                $this->tpl->setVariable("TXT_REGISTRATION_UNLIMITED", $this->lng->txt("grp_registration_unlimited"));
                $this->tpl->setVariable("RB_NOREGISTRATION", $cb_registration[0]);
                $this->tpl->setVariable("TXT_ENABLEREGISTRATION", $this->lng->txt("group_req_registration"));
                $this->tpl->setVariable("RB_REGISTRATION", $cb_registration[1]);
                $this->tpl->setVariable("TXT_PASSWORDREGISTRATION", $this->lng->txt("group_req_password"));
                $this->tpl->setVariable("RB_PASSWORDREGISTRATION", $cb_registration[2]);

                $this->tpl->setVariable("TXT_EXPIRATIONDATE", $this->lng->txt("group_registration_expiration_date"));
                $this->tpl->setVariable("TXT_EXPIRATIONTIME", $this->lng->txt("group_registration_expiration_time"));           
                $this->tpl->setVariable("TXT_DATE", $this->lng->txt("DD.MM.YYYY"));
                $this->tpl->setVariable("TXT_TIME", $this->lng->txt("HH:MM"));

                $this->tpl->setVariable("CB_KEYREGISTRATION", $cb_keyregistration);
                $this->tpl->setVariable("TXT_KEYREGISTRATION", $this->lng->txt("group_keyregistration"));
                $this->tpl->setVariable("TXT_PASSWORD", $this->lng->txt("password"));
        }

Here is the call graph for this function:

& ilObjGroupGUI::executeCommand (  ) 

execute command note: this method is overwritten in all container objects

Reimplemented from ilContainerGUI.

Definition at line 88 of file class.ilObjGroupGUI.php.

References $_GET, $cmd, $ilErr, $rbacsystem, $reg_gui, $user_gui, __setSubTabs(), ilObjectGUI::getCreationMode(), infoScreen(), and ilObjectGUI::prepareOutput().

        {
                global $ilUser,$rbacsystem,$ilAccess;

                $next_class = $this->ctrl->getNextClass($this);
                $cmd = $this->ctrl->getCmd();
                $this->prepareOutput();

                switch($next_class)
                {
                        case "ilconditionhandlerinterface":
                                include_once './classes/class.ilConditionHandlerInterface.php';

                                if($_GET['item_id'])
                                {
                                        $this->ctrl->saveParameter($this,'item_id',$_GET['item_id']);
                                        $this->__setSubTabs('activation');
                                        $this->tabs_gui->setTabActive('view_content');

                                        $new_gui =& new ilConditionHandlerInterface($this,(int) $_GET['item_id']);
                                        $this->ctrl->forwardCommand($new_gui);
                                }
                                else
                                {
                                        $new_gui =& new ilConditionHandlerInterface($this);
                                        $this->ctrl->forwardCommand($new_gui);
                                }
                                break;

                        case "ilregistergui":
                                $this->ctrl->setReturn($this, "");   // ###
                                $reg_gui = new ilRegisterGUI();
                                $ret =& $this->ctrl->forwardCommand($reg_gui);
                                $this->tabs_gui->setTabActive('join');
                                break;

                        case 'ilpermissiongui':
                                include_once("./classes/class.ilPermissionGUI.php");
                                $perm_gui =& new ilPermissionGUI($this);
                                $ret =& $this->ctrl->forwardCommand($perm_gui);
                                break;

                        case 'ilrepositorysearchgui':
                                include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
                                $rep_search =& new ilRepositorySearchGUI();
                                $rep_search->setCallback($this,'addUserObject');

                                // Set tabs
                                $this->tabs_gui->setTabActive('members');
                                $this->ctrl->setReturn($this,'members');
                                $ret =& $this->ctrl->forwardCommand($rep_search);
                                $this->__setSubTabs('members');
                                $this->tabs_gui->setSubTabActive('members');
                                break;

                        case "ilinfoscreengui":
                                $ret =& $this->infoScreen();
                                break;

                        case "illearningprogressgui":
                                include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';

                                $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY,
                                                                                                          $this->object->getRefId(),
                                                                                                          $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
                                $this->ctrl->forwardCommand($new_gui);
                                $this->tabs_gui->setTabActive('learning_progress');
                                break;

                        case 'ilobjcoursegroupinggui':
                                include_once './course/classes/class.ilObjCourseGroupingGUI.php';

                                $this->ctrl->setReturn($this,'edit');
                                $this->__setSubTabs('properties');
                                $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object,(int) $_GET['obj_id']);
                                $this->ctrl->forwardCommand($crs_grp_gui);
                                $this->tabs_gui->setTabActive('edit_properties');
                                $this->tabs_gui->setSubTabActive('groupings');
                                break;

                        case 'ilcoursecontentgui':

                                include_once './course/classes/class.ilCourseContentGUI.php';
                                $course_content_obj = new ilCourseContentGUI($this);
                                $this->ctrl->forwardCommand($course_content_obj);
                                break;

                        case 'ilcourseitemadministrationgui':

                                include_once 'course/classes/class.ilCourseItemAdministrationGUI.php';

                                $this->ctrl->setReturn($this,'');
                                $item_adm_gui = new ilCourseItemAdministrationGUI($this->object,(int) $_GET['item_id']);
                                $this->ctrl->forwardCommand($item_adm_gui);

                                // (Sub)tabs
                                $this->__setSubTabs('activation');
                                $this->tabs_gui->setTabActive('view_content');
                                $this->tabs_gui->setSubTabActive('activation');
                                break;

                        case 'ilobjusergui':
                                require_once "./classes/class.ilObjUserGUI.php";
                                $user_gui = new ilObjUserGUI("",$_GET["user"], false, false);
                                $html = $this->ctrl->forwardCommand($user_gui);
                                $this->__setSubTabs('members');
                                $this->tabs_gui->setTabActive('group_members');
                                $this->tabs_gui->setSubTabActive('grp_members_gallery');
                                $this->tpl->setVariable("ADM_CONTENT", $html);
                                break;

                        default:
                        
                                // check visible permission
                                if (!$this->getCreationMode() and !$ilAccess->checkAccess('visible','',$this->object->getRefId(),'grp'))
                                {
                                        $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE);
                                }

                                // check read permission
                                if ((!$this->getCreationMode()
                                        && !$rbacsystem->checkAccess('read',$this->object->getRefId()) && $cmd != 'infoScreen')
                                        || $cmd == 'join')
                                {
                                        // no join permission -> redirect to info screen
                                        if (!$rbacsystem->checkAccess('join',$this->object->getRefId()))
                                        {
                                                $this->ctrl->redirect($this, "infoScreen");
                                        }
                                        else    // no read -> show registration
                                        {
                                                $this->ctrl->redirectByClass("ilRegisterGUI", "showRegistrationForm");
                                        }
                                }

                                if(!$cmd)
                                {
                                        $cmd = 'view';
                                }
                                $cmd .= 'Object';
                                $this->$cmd();
                                break;
                }
        }

Here is the call graph for this function:

ilObjGroupGUI::exportMembersObject (  ) 

Exports group members to Microsoft Excel file.

Exports group members to Microsoft Excel file

Definition at line 2510 of file class.ilObjGroupGUI.php.

References ilObjectGUI::$data, $row, $title, and cleanString().

        {
                $title = preg_replace("/\s/", "_", $this->object->getTitle());
                include_once "./classes/class.ilExcelWriterAdapter.php";
                $adapter = new ilExcelWriterAdapter("export_" . $title . ".xls");
                $workbook = $adapter->getWorkbook();
                // Creating a worksheet
                $format_bold =& $workbook->addFormat();
                $format_bold->setBold();
                $format_percent =& $workbook->addFormat();
                $format_percent->setNumFormat("0.00%");
                $format_datetime =& $workbook->addFormat();
                $format_datetime->setNumFormat("DD/MM/YYYY hh:mm:ss");
                $format_title =& $workbook->addFormat();
                $format_title->setBold();
                $format_title->setColor('black');
                $format_title->setPattern(1);
                $format_title->setFgColor('silver');
                $worksheet =& $workbook->addWorksheet();
                $column = 0;
                $profile_data = array("email", "gender", "firstname", "lastname", "person_title", "institution", 
                        "department", "street", "zipcode","city", "country", "phone_office", "phone_home", "phone_mobile",
                        "fax", "matriculation");
                foreach ($profile_data as $data)
                {
                        $worksheet->writeString(0, $column++, $this->cleanString($this->lng->txt($data)), $format_title);
                }
                $member_ids = $this->object->getGroupMemberIds();
                $row = 1;
                foreach ($member_ids as $member_id)
                {
                        $column = 0;
                        $member =& $this->ilias->obj_factory->getInstanceByObjId($member_id);
                        if ($member->getPref("public_email")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getEmail()));
                        }
                        else
                        {
                                $column++;
                        }
                        $worksheet->writeString($row, $column++, $this->cleanString($this->lng->txt("gender_" . $member->getGender())));
                        $worksheet->writeString($row, $column++, $this->cleanString($member->getFirstname()));
                        $worksheet->writeString($row, $column++, $this->cleanString($member->getLastname()));
                        $worksheet->writeString($row, $column++, $this->cleanString($member->getUTitle()));
                        if ($member->getPref("public_institution")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getInstitution()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_department")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getDepartment()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_street")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getStreet()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_zip")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getZipcode()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_city")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getCity()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_country")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getCountry()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_phone_office")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneOffice()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_phone_home")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneHome()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_phone_mobile")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneMobile()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_fax")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getFax()));
                        }
                        else
                        {
                                $column++;
                        }
                        if ($member->getPref("public_matriculation")=="y")
                        {
                                $worksheet->writeString($row, $column++, $this->cleanString($member->getMatriculation()));
                        }
                        else
                        {
                                $column++;
                        }
                        $row++;
                }
                $workbook->close();
        }

Here is the call graph for this function:

ilObjGroupGUI::exportObject (  ) 

Creates the output form for group member export.

Creates the output form for group member export

Definition at line 2495 of file class.ilObjGroupGUI.php.

References ilObjectGUI::getFormAction().

        {
                $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.grp_members_export.html");
                $this->tpl->setCurrentBlock("adm_content");
                $this->tpl->setVariable("FORMACTION", $this->getFormAction("export",$this->ctrl->getFormAction($this)));
                $this->tpl->setVariable("BUTTON_EXPORT", $this->lng->txt("export_group_members"));
                $this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

ilObjGroupGUI::exportXMLObject (  ) 

Definition at line 337 of file class.ilObjGroupGUI.php.

References $rbacsystem, and listExportFilesObject().

        {
                global $rbacsystem;

                if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
                {
                        $this->ilErr->raiseError($this->lng->txt("permission_denied"),$this->ilErr->MESSAGE);
                }

                $this->object->exportXML();
                
                $this->listExportFilesObject();

                return true;
        }

Here is the call graph for this function:

ilObjGroupGUI::getTabs ( &$  tabs_gui  ) 

common tabs for all container objects (should be called at the end of child getTabs() method

Reimplemented from ilContainerGUI.

Definition at line 1819 of file class.ilObjGroupGUI.php.

References $_GET, $rbacsystem, ilObjUserTracking::_enabledLearningProgress(), and ilObjGroup::_isMember().

        {
                global $rbacsystem,$ilUser;

                if ($rbacsystem->checkAccess('read',$this->ref_id))
                {
                        $force_active = (($_GET["cmd"] == "view" || $_GET["cmd"] == "")
                                && $_GET["cmdClass"] == "")
                                ? true
                                : false;
                        $tabs_gui->addTarget("view_content",
                                $this->ctrl->getLinkTarget($this, ""), array("", "view","addToDesk","removeFromDesk"), get_class($this),
                                "", $force_active);
                }
                if ($rbacsystem->checkAccess('visible',$this->ref_id))
                {
                        $tabs_gui->addTarget("info_short",
                                                                 $this->ctrl->getLinkTargetByClass(
                                                                 array("ilobjgroupgui", "ilinfoscreengui"), "showSummary"),
                                                                 "infoScreen",
                                                                 "", "",false);
                }


                if ($rbacsystem->checkAccess('write',$this->ref_id))
                {
                        $force_active = ($_GET["cmd"] == "edit" && $_GET["cmdClass"] == "")
                                ? true
                                : false;
                        $tabs_gui->addTarget("edit_properties",
                                $this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this),
                                "", $force_active);
//  Export tab to export group members to an excel file. Only available for group admins
//  commented out for following reason: clearance needed with developer list
//                      $tabs_gui->addTarget("export",
//                              $this->ctrl->getLinkTarget($this, "export"), "export", get_class($this));
                }

                if ($rbacsystem->checkAccess('read',$this->ref_id))
                {
                        $mem_cmd = ($rbacsystem->checkAccess('write',$this->ref_id))
                                ? "members"
                                : "membersGallery";

                        $tabs_gui->addTarget("group_members",
                                $this->ctrl->getLinkTarget($this, $mem_cmd), array("members","mailMembers","membersGallery","showProfile"), get_class($this));
                }
                
                $applications = $this->object->getNewRegistrations();

                if (is_array($applications) and $this->object->isAdmin($this->ilias->account->getId()))
                {
                        $tabs_gui->addTarget("group_new_registrations",
                                $this->ctrl->getLinkTarget($this, "ShownewRegistrations"), "ShownewRegistrations", get_class($this));
                }

                // learning progress
                include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
                if($rbacsystem->checkAccess('read',$this->ref_id) and ilObjUserTracking::_enabledLearningProgress())
                {
                        $tabs_gui->addTarget('learning_progress',
                                                                 $this->ctrl->getLinkTargetByClass(array('ilobjgroupgui','illearningprogressgui'),''),
                                                                 '',
                                                                 array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
                }

                
                if ($rbacsystem->checkAccess('write',$this->object->getRefId()))
                {
                        $tabs_gui->addTarget('export',
                                                                 $this->ctrl->getLinkTarget($this,'listExportFiles'),
                                                                 array('listExportFiles','exportXML','confirmDeleteExportFile','downloadExportFile'),
                                                                 get_class($this));
                }
                
                if ($rbacsystem->checkAccess('join',$this->object->getRefId())
                   and !ilObjGroup::_isMember($ilUser->getId(),$this->object->getRefId()))
                {
                        $tabs_gui->addTarget("join",
                                                                 $this->ctrl->getLinkTarget($this, "join"), 
                                                                 'join',
                                                                 "");
                }

        // parent tabs (all container: edit_permission, clipboard, trash
                parent::getTabs($tabs_gui);
        }

Here is the call graph for this function:

ilObjGroupGUI::ilObjGroupGUI ( a_data,
a_id,
a_call_by_reference,
a_prepare_output = false 
)

Constructor public.

Definition at line 49 of file class.ilObjGroupGUI.php.

References ilContainerGUI::ilContainerGUI().

        {
                $this->type = "grp";
                $this->ilContainerGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);

                $this->lng->loadLanguageModule('grp');
        }

Here is the call graph for this function:

ilObjGroupGUI::importFileObject (  ) 

Definition at line 1910 of file class.ilObjGroupGUI.php.

References $_GET, ilObjectGUI::$ref_id, ilObjGroup::_importFromFile(), createObject(), ilUtil::redirect(), and sendInfo().

        {
                if(!is_array($_FILES['xmldoc']))
                {
                        sendInfo($this->lng->txt("import_file_not_valid"));
                        $this->createObject();
                        return false;
                }
                
                include_once 'classes/class.ilObjGroup.php';

                if($ref_id = ilObjGroup::_importFromFile($_FILES['xmldoc'],(int) $_GET['ref_id']))
                {
                        $this->ctrl->setParameter($this, "ref_id", $ref_id);
                        sendInfo($this->lng->txt("import_grp_finished"),true);
                        ilUtil::redirect($this->ctrl->getLinkTarget($this,'edit'));
                }
                
                sendInfo($this->lng->txt("import_file_not_valid"));
                $this->createObject();
        }       

Here is the call graph for this function:

ilObjGroupGUI::infoScreen (  ) 

show information screen

Definition at line 2725 of file class.ilObjGroupGUI.php.

References $rbacsystem.

Referenced by executeCommand(), and infoScreenObject().

        {
                global $rbacsystem;
                
                $this->tabs_gui->setTabActive('info_short');

                if(!$rbacsystem->checkAccess("visible", $this->ref_id))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
                }

                include_once("classes/class.ilInfoScreenGUI.php");
                $info = new ilInfoScreenGUI($this);
                $info->enablePrivateNotes();
                $info->enableLearningProgress(true);

                $info->addSection($this->lng->txt('group_registration'));
                switch($this->object->getRegistrationFlag())
                {
                        case GRP_REGISTRATION_DIRECT:
                                $info->addProperty($this->lng->txt('group_registration_mode'),
                                                                   $this->lng->txt('group_req_direct'));
                                break;
                                                                                                   
                        case GRP_REGISTRATION_REQUEST:
                                $info->addProperty($this->lng->txt('group_registration_mode'),
                                                                   $this->lng->txt('group_req_registration'));
                                break;

                        case GRP_REGISTRATION_PASSWORD:
                                $info->addProperty($this->lng->txt('group_registration_mode'),
                                                                   $this->lng->txt('group_req_password'));
                                break;
                }
                $date_times = $this->object->getExpirationDateTime();
                $info->addProperty($this->lng->txt('group_registration_time'),
                                                   $date_times[0].' '.$date_times[1]);
                // forward the command
                $this->ctrl->forwardCommand($info);
        }

Here is the caller graph for this function:

ilObjGroupGUI::infoScreenObject (  ) 

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 2715 of file class.ilObjGroupGUI.php.

References infoScreen().

        {
                $this->ctrl->setCmd("showSummary");
                $this->ctrl->setCmdClass("ilinfoscreengui");
                $this->infoScreen();
        }

Here is the call graph for this function:

ilObjGroupGUI::initConditionHandlerGUI ( item_id  ) 

Definition at line 2469 of file class.ilObjGroupGUI.php.

References $_GET.

        {
                include_once './classes/class.ilConditionHandlerInterface.php';

                if(!is_object($this->chi_obj))
                {
                        if($_GET['item_id'])
                        {
                                $this->chi_obj =& new ilConditionHandlerInterface($this,$item_id);
                                $this->ctrl->saveParameter($this,'item_id',$_GET['item_id']);
                        }
                        else
                        {
                                $this->chi_obj =& new ilConditionHandlerInterface($this);
                        }
                }
                return true;
        }

ilObjGroupGUI::initCourseContentInterface (  ) 

Definition at line 1932 of file class.ilObjGroupGUI.php.

References $ilCtrl.

        {
                global $ilCtrl;

                include_once "./course/classes/class.ilCourseContentInterface.php";
                
                $this->object->ctrl =& $ilCtrl;
                $this->cci_obj =& new ilCourseContentInterface($this,$this->object->getRefId());
        }

ilObjGroupGUI::leaveGrpObject (  ) 

leave Group public

Definition at line 911 of file class.ilObjGroupGUI.php.

References $_GET, and confirmationObject().

        {
                $member = array($_GET["mem_id"]);
                //set methods that are called after confirmation
                $confirm = "confirmedDeleteMember";
                $cancel  = "canceled";
                $info    = "info_delete_sure";
                $status  = "";
                $return  = "";
                $this->confirmationObject($member, $confirm, $cancel, $info, $status, $return);
        }

Here is the call graph for this function:

ilObjGroupGUI::listExportFilesObject (  ) 

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

References $_GET, $rbacsystem, $tbl, __exportMenu(), ilUtil::getImagePath(), and ilUtil::switchColor().

Referenced by confirmDeleteExportFileObject(), downloadExportFileObject(), and exportXMLObject().

        {
                global $rbacsystem;

                $this->lng->loadLanguageModule('content');

                if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
                {
                        $this->ilErr->raiseError($this->lng->txt("permission_denied"),$this->ilErr->MESSAGE);
                }

                $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
                $this->__exportMenu();

                $this->object->__initFileObject();
                $export_files = $this->object->file_obj->getExportFiles();
                
                require_once("classes/class.ilTableGUI.php");
                $tbl = new ilTableGUI();

                $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
                $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.grp_export_file_row.html");

                $num = 0;

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

                $tbl->setTitle($this->lng->txt("cont_export_files"));
                $tbl->setHeaderNames(array("", $this->lng->txt("type"),
                        $this->lng->txt("cont_file"),
                        $this->lng->txt("cont_size"), $this->lng->txt("date") ));

                $cols = array("", "type", "file", "size", "date");
                $header_params = array("ref_id" => $_GET["ref_id"],
                                                           "cmd" => "listExportFiles", "cmdClass" => strtolower(get_class($this)));
                $tbl->setHeaderVars($cols, $header_params);
                $tbl->setColumnWidth(array("1%", "9%", "40%", "25%", "25%"));
                
                // control
                $tbl->setOrderColumn($_GET["sort_by"]);
                $tbl->setOrderDirection($_GET["sort_order"]);
                $tbl->setLimit($_GET["limit"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setMaxCount($this->maxcount);             // ???
                $tbl->disable("sort");

                $this->tpl->setVariable("COLUMN_COUNTS", 5);

                // delete button
                $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                $this->tpl->setCurrentBlock("tbl_action_btn");
                $this->tpl->setVariable("BTN_NAME", "confirmDeleteExportFile");
                $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
                $this->tpl->parseCurrentBlock();

                $this->tpl->setCurrentBlock("tbl_action_btn");
                $this->tpl->setVariable("BTN_NAME", "downloadExportFile");
                $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("download"));
                $this->tpl->parseCurrentBlock();

                // footer
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));

                $tbl->setMaxCount(count($export_files));
                $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
                $tbl->render();
                foreach($export_files as $exp_file)
                {
                        $this->tpl->setCurrentBlock("tbl_content");
                        $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
                        
                        $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
                        $this->tpl->setVariable("CSS_ROW", $css_row);

                        $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
                        $this->tpl->setVariable("TXT_TYPE", $exp_file["type"]);
                        $this->tpl->setVariable("CHECKBOX_ID",$exp_file["file"]);

                        $file_arr = explode("__", $exp_file["file"]);
                        $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s",$file_arr[0]));

                        $this->tpl->parseCurrentBlock();
                }
                if(!count($export_files))
                {
                        $tbl->disable('footer');
                        $this->tpl->setCurrentBlock("notfound");
                        $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
                        $this->tpl->setVariable("NUM_COLS", 4);
                        $this->tpl->parseCurrentBlock();
                }

                $this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::listUsersGroupObject (  ) 

Definition at line 2396 of file class.ilObjGroupGUI.php.

References $_POST, $_SESSION, $counter, $rbacreview, $rbacsystem, ilObjectGUI::$tree, $user, __appendToStoredResults(), __showSearchUserTable(), formatDate(), ilUtil::formCheckbox(), ilObjectFactory::getInstanceByObjId(), ilObjectFactory::getInstanceByRefId(), searchObject(), and sendInfo().

        {
                global $rbacsystem,$rbacreview,$tree;

                $_SESSION["grp_group"] = $_POST["group"] = $_POST["group"] ? $_POST["group"] : $_SESSION["grp_group"];

                // MINIMUM ACCESS LEVEL = 'administrate'
                if(!$rbacsystem->checkAccess("write", $this->object->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
                }

                if(!is_array($_POST["group"]))
                {
                        sendInfo($this->lng->txt("grp_no_groups_selected"));
                        $this->searchObject();

                        return false;
                }

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.grp_usr_selection.html");
                #$this->__showButton("cancelSearch",$this->lng->txt("grp_new_search"));

                // GET ALL MEMBERS
                $members = array();
                foreach($_POST["group"] as $group_id)
                {
                        if (!$tree->isInTree($group_id))
                        {
                                continue;
                        }
                        if (!$tmp_obj = ilObjectFactory::getInstanceByRefId($group_id))
                        {
                                continue;
                        }

                        $members = array_merge($tmp_obj->getGroupMemberIds(),$members);

                        unset($tmp_obj);
                }

                $members = array_unique($members);

                // append users
                $members = $this->__appendToStoredResults($members);

                // FORMAT USER DATA
                $counter = 0;
                $f_result = array();
                foreach($members as $user)
                {
                        if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user,false))
                        {
                                continue;
                        }
                        
                        $user_ids[$counter] = $user;
                        
                        $f_result[$counter][] = ilUtil::formCheckbox(0,"user[]",$user);
                        $f_result[$counter][] = $tmp_obj->getLogin();
                        $f_result[$counter][] = $tmp_obj->getLastname();
                        $f_result[$counter][] = $tmp_obj->getFirstname();
                        $f_result[$counter][] = ilFormat::formatDate($tmp_obj->getLastLogin());

                        unset($tmp_obj);
                        ++$counter;
                }
                $this->__showSearchUserTable($f_result,$user_ids,"listUsersGroup");

                return true;
        }

Here is the call graph for this function:

ilObjGroupGUI::listUsersRoleObject (  ) 

Definition at line 2315 of file class.ilObjGroupGUI.php.

References $_POST, $_SESSION, $counter, $rbacreview, $rbacsystem, $role_id, $user, __appendToStoredResults(), __showSearchUserTable(), formatDate(), ilUtil::formCheckbox(), ilObjectFactory::getInstanceByObjId(), searchObject(), and sendInfo().

        {
                global $rbacsystem,$rbacreview;

                $_SESSION["grp_role"] = $_POST["role"] = $_POST["role"] ? $_POST["role"] : $_SESSION["grp_role"];

                // MINIMUM ACCESS LEVEL = 'administrate'
                if(!$rbacsystem->checkAccess("write", $this->object->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
                }

                if(!is_array($_POST["role"]))
                {
                        sendInfo($this->lng->txt("grp_no_roles_selected"));
                        $this->searchObject();

                        return false;
                }

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.grp_usr_selection.html");
                #$this->__showButton("cancelSearch",$this->lng->txt("grp_new_search"));

                // GET ALL MEMBERS
                $members = array();
                foreach($_POST["role"] as $role_id)
                {
                        $members = array_merge($rbacreview->assignedUsers($role_id),$members);
                }

                $members = array_unique($members);
                $members = $this->__appendToStoredResults($members);

                // FORMAT USER DATA
                $counter = 0;
                $f_result = array();
                foreach($members as $user)
                {
                        if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user,false))
                        {
                                continue;
                        }
                        
                        $user_ids[$counter] = $user;

                        $f_result[$counter][] = ilUtil::formCheckbox(0,"user[]",$user);
                        $f_result[$counter][] = $tmp_obj->getLogin();
                        $f_result[$counter][] = $tmp_obj->getLastname();
                        $f_result[$counter][] = $tmp_obj->getFirstname();
                        $f_result[$counter][] = ilFormat::formatDate($tmp_obj->getLastLogin());

                        unset($tmp_obj);
                        ++$counter;
                }
                $this->__showSearchUserTable($f_result,$user_ids,"listUsersRole");

                return true;
        }

Here is the call graph for this function:

ilObjGroupGUI::mailMembersObject (  ) 

Definition at line 1400 of file class.ilObjGroupGUI.php.

References $rbacreview, __setSubTabs(), ilUtil::formCheckbox(), and ilUtil::getImagePath().

        {
                global $rbacreview;

                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.mail_members.html');

                $this->__setSubTabs('members');

                $this->tpl->setVariable("MAILACTION",'mail_new.php?type=role');
                $this->tpl->setVariable("MAIL_MEMBERS",$this->lng->txt('send_mail_members'));
                $this->tpl->setVariable("MAIL_ADMIN",$this->lng->txt('send_mail_admins'));
                $this->tpl->setVariable("CHECK_MEMBER",ilUtil::formCheckbox(1,'roles[]','#il_grp_member_'.$this->object->getRefId()));
                $this->tpl->setVariable("CHECK_ADMIN",ilUtil::formCheckbox(0,'roles[]','#il_grp_admin_'.$this->object->getRefId()));
                $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.gif'));
                $this->tpl->setVariable("OK",$this->lng->txt('ok'));
        }

Here is the call graph for this function:

ilObjGroupGUI::membersGalleryObject (  ) 

Builds a group members gallery as a layer of left-floating images.

Author:
Arturo Gonzalez <arturogf@gmail.com> public

Definition at line 1283 of file class.ilObjGroupGUI.php.

References $file, $rbacsystem, __setSubTabs(), exit, ilObjectFactory::getInstanceByObjId(), ilUtil::getStyleSheetLocation(), and ilUtil::sortArray().

        {
                global $rbacsystem;
                
                $is_admin = (bool) $rbacsystem->checkAccess("write", $this->object->getRefId());
                
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_members_gallery.html','course');
                
                $this->__setSubTabs('members');
                
                $member_ids = $this->object->getGroupMemberIds();
                $admin_ids = $this->object->getGroupAdminIds();
                
                // fetch all users data in one shot to improve performance
                $members = $this->object->getGroupMemberData($member_ids);
                
                // MEMBERS
                if(count($members))
                {
                        $ordered_members = array();

                        foreach($members as $member)
                        {
                                // get user object
                                if(!($usr_obj = ilObjectFactory::getInstanceByObjId($member["id"],false)))
                                {
                                        continue;
                                }
        
                                array_push($ordered_members,array("id" => $member_id, 
                                                                  "login" => $usr_obj->getLogin(),
                                                                  "lastname" => strtoupper($usr_obj->getLastName()),
                                                                  "firstname" => strtoupper($usr_obj->getFirstName()),
                                                                  "usr_obj" => $usr_obj));
                        }

                        $ordered_members=ilUtil::sortArray($ordered_members,"lastname","asc");

                        foreach($ordered_members as $member)
                        {
        
                          $usr_obj = $member["usr_obj"];

                                $public_profile = $usr_obj->getPref("public_profile");

                                // SET LINK TARGET FOR USER PROFILE
                                $this->ctrl->setParameterByClass("ilobjusergui", "user", $member["id"]);
                                $profile_target = $this->ctrl->getLinkTargetByClass("ilobjusergui", "getPublicProfile");
                        
                                // GET USER IMAGE
                                $file = $usr_obj->getPersonalPicturePath("xsmall");
                                
                                switch(in_array($member["id"],$admin_ids))
                                {
                                        //admins
                                        case 1:
                                                if ($public_profile == "y")
                                                {
                                                        $this->tpl->setCurrentBlock("tutor_linked");
                                                        $this->tpl->setVariable("LINK_PROFILE", $profile_target);
                                                        $this->tpl->setVariable("SRC_USR_IMAGE", $file);
                                                        $this->tpl->parseCurrentBlock();
                                                }
                                                else
                                                {
                                                        $this->tpl->setCurrentBlock("tutor_not_linked");
                                                        $this->tpl->setVariable("SRC_USR_IMAGE", $file);
                                                        $this->tpl->parseCurrentBlock();
                                                }
                                                $this->tpl->setCurrentBlock("tutor");
                                                break;
                                
                                        case 0:
                                                if ($public_profile == "y")
                                                {
                                                        $this->tpl->setCurrentBlock("member_linked");
                                                        $this->tpl->setVariable("LINK_PROFILE", $profile_target);
                                                        $this->tpl->setVariable("SRC_USR_IMAGE", $file);
                                                        $this->tpl->parseCurrentBlock();
                                                }
                                                else
                                                {
                                                        $this->tpl->setCurrentBlock("member_not_linked");
                                                        $this->tpl->setVariable("SRC_USR_IMAGE", $file);
                                                        $this->tpl->parseCurrentBlock();
                                                }
                                                $this->tpl->setCurrentBlock("member");
                                                break;
                                }
                        
                                // do not show name, if public profile is not activated
                                if ($public_profile == "y")
                                {
                                        $this->tpl->setVariable("FIRSTNAME", $member["firstname"]);
                                        $this->tpl->setVariable("LASTNAME", $member["lastname"]);
                                }
                                $this->tpl->setVariable("LOGIN", $usr_obj->getLogin());
                                $this->tpl->parseCurrentBlock();
                        }
                        $this->tpl->setCurrentBlock("members"); 
                        //$this->tpl->setVariable("MEMBERS_TABLE_HEADER",$this->lng->txt('crs_members_title'));
                        $this->tpl->parseCurrentBlock();
                }
                
                $this->tpl->setVariable("TITLE",$this->lng->txt('crs_members_print_title'));
                $this->tpl->setVariable("CSS_PATH",ilUtil::getStyleSheetLocation());
                
                //$headline = $this->object->getTitle()."<br/>".$this->object->getDescription();
                
                //$this->tpl->setVariable("HEADLINE",$headline);
                
                $this->tpl->show();
                exit;
        }

Here is the call graph for this function:

ilObjGroupGUI::membersObject (  ) 

display group members

Definition at line 1194 of file class.ilObjGroupGUI.php.

References $counter, $ilBench, $rbacsystem, __setSubTabs(), __showMembersTable(), and formatDate().

        {
                global $rbacsystem,$ilBench,$ilDB,$ilUser;

                $this->tpl->addBlockFile("ADM_CONTENT","adm_content","tpl.grp_members.html");
                $this->__setSubTabs('members');

                // display member search button
                $this->lng->loadLanguageModule('crs');
                $is_admin = (bool) $rbacsystem->checkAccess("write", $this->object->getRefId());
                if($is_admin)
                {
                        $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
                        $this->tpl->setCurrentBlock("btn_cell");
                        $this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','start'));
                        $this->tpl->setVariable("BTN_TXT",$this->lng->txt("crs_add_member"));
                        $this->tpl->parseCurrentBlock();
                }

                $ilBench->start("GroupGUI", "membersObject");
                
                //if current user is admin he is able to add new members to group
                $val_contact = "<img src=\"".ilUtil::getImagePath("icon_pencil_b.gif")."\" alt=\"".$this->lng->txt("grp_mem_send_mail")."\" title=\"".$this->lng->txt("grp_mem_send_mail")."\" border=\"0\" vspace=\"0\"/>";
                $val_change = "<img src=\"".ilUtil::getImagePath("icon_change_b.gif")."\" alt=\"".$this->lng->txt("grp_mem_change_status")."\" title=\"".$this->lng->txt("grp_mem_change_status")."\" border=\"0\" vspace=\"0\"/>";
                $val_leave = "<img src=\"".ilUtil::getImagePath("icon_group_out_b.gif")."\" alt=\"".$this->lng->txt("grp_mem_leave")."\" title=\"".$this->lng->txt("grp_mem_leave")."\" border=\"0\" vspace=\"0\"/>";

                // store access checks to improve performance
                $access_leave = $rbacsystem->checkAccess("leave",$this->object->getRefId());
                $access_write = $rbacsystem->checkAccess("write",$this->object->getRefId());

                $member_ids = $this->object->getGroupMemberIds();
                
                // fetch all users data in one shot to improve performance
                $members = $this->object->getGroupMemberData($member_ids);
                
                $account_id = $this->ilias->account->getId();
                $counter = 0;

                foreach ($members as $mem)
                {
                        $link_contact = "mail_new.php?type=new&rcp_to=".$mem["login"];
                        $link_change = $this->ctrl->getLinkTarget($this,"changeMember")."&mem_id=".$mem["id"];
                
                        //build function
                        if ($access_write)
                        {
                                $member_functions = "<a href=\"$link_change\">$val_change</a>";
                        }

                        if (($mem["id"] == $account_id && $access_leave) || $access_write)
                        {
                                $link_leave = $this->ctrl->getLinkTarget($this,"RemoveMember")."&mem_id=".$mem["id"];
                                $member_functions .="<a href=\"$link_leave\">$val_leave</a>";
                        }

                        // this is twice as fast than the code above
                        $str_member_roles = $this->object->getMemberRolesTitle($mem["id"]);

                        if ($access_write)
                        {
                                $result_set[$counter][] = ilUtil::formCheckBox(0,"user_id[]",$mem["id"]);
                        }
                        
                        $user_ids[$counter] = $mem["id"];
            
            //discarding the checkboxes
                        $result_set[$counter][] = $mem["login"];
                        $result_set[$counter][] = $mem["firstname"];
                        $result_set[$counter][] = $mem["lastname"];
                        $result_set[$counter][] = ilFormat::formatDate($mem["last_login"]);
                        $result_set[$counter][] = $str_member_roles;
                        $result_set[$counter][] = "<a href=\"$link_contact\">".$val_contact."</a>".$member_functions;

                        ++$counter;

                        unset($member_functions);
                }

                $ilBench->stop("GroupGUI", "membersObject");

                return $this->__showMembersTable($result_set,$user_ids);
    }

Here is the call graph for this function:

ilObjGroupGUI::refuseApplicantsObject (  ) 

adds applicant to group as member public

Definition at line 1565 of file class.ilObjGroupGUI.php.

References $_POST, $_SESSION, $user, ilUtil::redirect(), and sendInfo().

        {
                $user_ids = $_POST["user_id"];

                if (empty($user_ids[0]))
                {
                        $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
                }

                $mail = new ilMail($_SESSION["AccountId"]);

                foreach ($user_ids as $new_member)
                {
                        $user =& $this->ilias->obj_factory->getInstanceByObjId($new_member);

                        $this->object->deleteApplicationListEntry($new_member);
                        $mail->sendMail($user->getLogin(),"","","Membership application refused: Group ".$this->object->getTitle(),"Your application has been refused.",array(),array('normal'));
                }

                sendInfo($this->lng->txt("grp_msg_applicants_removed"),true);
                ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
        }

Here is the call graph for this function:

ilObjGroupGUI::removeBigIconObject (  ) 

remove big icon

public

Definition at line 2390 of file class.ilObjGroupGUI.php.

References ilUtil::redirect().

        {
                $this->object->removeBigIcon();
                ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit"));
        }

Here is the call graph for this function:

ilObjGroupGUI::removeMemberObject (  ) 

displays confirmation formular with users that shall be removed from group public

Definition at line 996 of file class.ilObjGroupGUI.php.

References $_GET, $_POST, $_SESSION, and confirmationObject().

        {
                $user_ids = array();

                if (isset($_POST["user_id"]))
                {
                        $user_ids = $_POST["user_id"];
                }
                else if (isset($_GET["mem_id"]))
                {
                        $user_ids[] = $_GET["mem_id"];
                }

                if (empty($user_ids[0]))
                {
                        $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
                }
                
                if (count($user_ids) == 1 and $this->ilias->account->getId() != $user_ids[0])
                {
                        if (!in_array(SYSTEM_ROLE_ID,$_SESSION["RoleId"]) 
                                and !in_array($this->ilias->account->getId(),$this->object->getGroupAdminIds()))
                        {
                                $this->ilErr->raiseError($this->lng->txt("grp_err_no_permission"),$this->ilErr->MESSAGE);
                        }
                }
                //bool value: says if $users_ids contains current user id
                $is_dismiss_me = array_search($this->ilias->account->getId(),$user_ids);
                
                $confirm = "confirmedRemoveMember";
                $cancel  = "canceled";
                $info    = ($is_dismiss_me !== false) ? "grp_dismiss_myself" : "grp_dismiss_member";
                $status  = "";
                $return  = "members";
                $this->confirmationObject($user_ids, $confirm, $cancel, $info, $status, $return);
        }

Here is the call graph for this function:

ilObjGroupGUI::removeSmallIconObject (  ) 

remove small icon

public

Definition at line 2379 of file class.ilObjGroupGUI.php.

References ilUtil::redirect().

        {
                $this->object->removeSmallIcon();
                ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit"));
        }

Here is the call graph for this function:

ilObjGroupGUI::saveObject (  ) 

save group object public

Reimplemented from ilObjectGUI.

Definition at line 592 of file class.ilObjGroupGUI.php.

References $_GET, $_POST, $rbacadmin, ilUtil::groupNameExists(), ilObjectGUI::redirectToRefId(), sendInfo(), and ilUtil::stripSlashes().

        {
                global $rbacadmin;

                // check required fields
                if (empty($_POST["Fobject"]["title"]))
                {
                        $this->ilErr->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilErr->MESSAGE);
                }

                // check registration & password
                if ($_POST["enable_registration"] == 2 and empty($_POST["password"]))
                {
                        $this->ilErr->raiseError($this->lng->txt("no_password"),$this->ilErr->MESSAGE);
                }

                // check groupname
                if (ilUtil::groupNameExists(ilUtil::stripSlashes($_POST["Fobject"]["title"])))

                {
                        $this->ilErr->raiseError($this->lng->txt("grp_name_exists"),$this->ilErr->MESSAGE);
                }

                // create and insert group in objecttree
                $groupObj = parent::saveObject();
                
                // setup rolefolder & default local roles (admin & member)
                $roles = $groupObj->initDefaultRoles();

                // ...finally assign groupadmin role to creator of group object
                $groupObj->addMember($this->ilias->account->getId(),$groupObj->getDefaultAdminRole());

                $groupObj->setRegistrationFlag(ilUtil::stripSlashes($_POST["enable_registration"]));//0=no registration, 1=registration enabled 2=passwordregistration
                $groupObj->setPassword(ilUtil::stripSlashes($_POST["password"]));
                $groupObj->setExpirationDateTime(ilUtil::stripSlashes($_POST["expirationdate"])." ".
                        ilUtil::stripSlashes($_POST["expirationtime"]).":00");

                $this->ilias->account->addDesktopItem($groupObj->getRefId(),"grp");             
                
                // always send a message
                sendInfo($this->lng->txt("grp_added"),true);

                $this->redirectToRefId($_GET["ref_id"]);
        }

Here is the call graph for this function:

ilObjGroupGUI::searchCancelledObject (  ) 

Definition at line 1812 of file class.ilObjGroupGUI.php.

References ilUtil::redirect(), and sendInfo().

        {
                sendInfo($this->lng->txt("action_aborted"),true);
                ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
        }

Here is the call graph for this function:

ilObjGroupGUI::searchObject (  ) 

Definition at line 1676 of file class.ilObjGroupGUI.php.

References $_POST, $_SESSION, $counter, $rbacsystem, $result, ilObjectGUI::$tree, $user, __search(), __showSearchGroupTable(), __showSearchRoleTable(), __showSearchUserTable(), formatDate(), ilUtil::formCheckbox(), ilObjectFactory::getInstanceByObjId(), ilObjectFactory::getInstanceByRefId(), searchUserFormObject(), sendInfo(), and ilUtil::stripSlashes().

Referenced by listUsersGroupObject(), and listUsersRoleObject().

        {
                global $rbacsystem,$tree;

                $_SESSION["grp_search_str"] = $_POST["search_str"] = $_POST["search_str"] ? $_POST["search_str"] : $_SESSION["grp_search_str"];
                $_SESSION["grp_search_for"] = $_POST["search_for"] = $_POST["search_for"] ? $_POST["search_for"] : $_SESSION["grp_search_for"];
                
                // MINIMUM ACCESS LEVEL = 'administrate'
                if(!$rbacsystem->checkAccess("write", $this->object->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
                }

                if(!isset($_POST["search_for"]) or !isset($_POST["search_str"]))
                {
                        sendInfo($this->lng->txt("grp_search_enter_search_string"));
                        $this->searchUserFormObject();
                        
                        return false;
                }

                if(!count($result = $this->__search(ilUtil::stripSlashes($_POST["search_str"]),$_POST["search_for"])))
                {
                        sendInfo($this->lng->txt("grp_no_results_found"));
                        $this->searchUserFormObject();

                        return false;
                }
                
                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.grp_usr_selection.html");
                #$this->__showButton("cancelSearch",$this->lng->txt("grp_new_search"));
                
                $counter = 0;
                $f_result = array();

                switch($_POST["search_for"])
                {
                case "usr":
                                foreach($result as $user)
                                {
                                        if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user,false))
                                        {
                                                continue;
                                        }
                                        $user_ids[$counter] = $user;
                                        
                                        $f_result[$counter][] = ilUtil::formCheckbox(0,"user[]",$user);
                                        $f_result[$counter][] = $tmp_obj->getLogin();
                                        $f_result[$counter][] = $tmp_obj->getFirstname();
                                        $f_result[$counter][] = $tmp_obj->getLastname();
                                        $f_result[$counter][] = ilFormat::formatDate($tmp_obj->getLastLogin());

                                        unset($tmp_obj);
                                        ++$counter;
                                }
                                $this->__showSearchUserTable($f_result,$user_ids);

                                return true;

                        case "role":
                                foreach($result as $role)
                                {
                    // exclude anonymous role
                    if ($role["id"] == ANONYMOUS_ROLE_ID)
                    {
                        continue;
                    }

                    if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($role["id"],false))
                                        {
                                                continue;
                                        }
                                        
                                    // exclude roles with no users assigned to
                    if ($tmp_obj->getCountMembers() == 0)
                    {
                        continue;
                    }
                    
                    $role_ids[$counter] = $role["id"];
                    
                                        $f_result[$counter][] = ilUtil::formCheckbox(0,"role[]",$role["id"]);
                                        $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
                                        $f_result[$counter][] = $tmp_obj->getCountMembers();
                                        
                                        unset($tmp_obj);
                                        ++$counter;
                                }
                                
                                $this->__showSearchRoleTable($f_result,$role_ids);

                                return true;
                                
                        case "grp":
                                foreach($result as $group)
                                {
                                        if(!$tree->isInTree($group["id"]))
                                        {
                                                continue;
                                        }
                                        
                                        if(!$tmp_obj = ilObjectFactory::getInstanceByRefId($group["id"],false))
                                        {
                                                continue;
                                        }
                                        
                    // exclude myself :-)
                    if ($tmp_obj->getId() == $this->object->getId())
                    {
                        continue;
                    }
                    
                    $grp_ids[$counter] = $group["id"];
                    
                                        $f_result[$counter][] = ilUtil::formCheckbox(0,"group[]",$group["id"]);
                                        $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
                                        $f_result[$counter][] = $tmp_obj->getCountMembers();
                                        
                                        unset($tmp_obj);
                                        ++$counter;
                                }
                                
                                if(!count($f_result))
                                {
                                        sendInfo($this->lng->txt("grp_no_results_found"));
                                        $this->searchUserFormObject();

                                        return false;
                                }
                                
                                $this->__showSearchGroupTable($f_result,$grp_ids);

                                return true;
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::searchUserFormObject (  ) 

Definition at line 1613 of file class.ilObjGroupGUI.php.

References $_POST, $_SESSION, $rbacsystem, __unsetSessionVariables(), and ilUtil::formRadioButton().

Referenced by cancelSearchObject(), and searchObject().

        {
                global $rbacsystem;

                $this->lng->loadLanguageModule('search');

                // MINIMUM ACCESS LEVEL = 'administrate'
                if(!$rbacsystem->checkAccess("write", $this->object->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
                }

                $this->tpl->addBlockFile("ADM_CONTENT","adm_content","tpl.grp_members_search.html");
                
                $this->tpl->setVariable("F_ACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("SEARCH_ASSIGN_USR",$this->lng->txt("grp_search_members"));
                $this->tpl->setVariable("SEARCH_SEARCH_TERM",$this->lng->txt("search_search_term"));
                $this->tpl->setVariable("SEARCH_VALUE",$_SESSION["grp_search_str"] ? $_SESSION["grp_search_str"] : "");
                $this->tpl->setVariable("SEARCH_FOR",$this->lng->txt("exc_search_for"));
                $this->tpl->setVariable("SEARCH_ROW_TXT_USER",$this->lng->txt("exc_users"));
                $this->tpl->setVariable("SEARCH_ROW_TXT_ROLE",$this->lng->txt("exc_roles"));
                $this->tpl->setVariable("SEARCH_ROW_TXT_GROUP",$this->lng->txt("exc_groups"));
                $this->tpl->setVariable("BTN2_VALUE",$this->lng->txt("cancel"));
                $this->tpl->setVariable("BTN1_VALUE",$this->lng->txt("search"));
                
        $usr = ($_POST["search_for"] == "usr" || $_POST["search_for"] == "") ? 1 : 0;
                $grp = ($_POST["search_for"] == "grp") ? 1 : 0;
                $role = ($_POST["search_for"] == "role") ? 1 : 0;

                $this->tpl->setVariable("SEARCH_ROW_CHECK_USER",ilUtil::formRadioButton($usr,"search_for","usr"));
                $this->tpl->setVariable("SEARCH_ROW_CHECK_ROLE",ilUtil::formRadioButton($role,"search_for","role"));
        $this->tpl->setVariable("SEARCH_ROW_CHECK_GROUP",ilUtil::formRadioButton($grp,"search_for","grp"));

                $this->__unsetSessionVariables();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjGroupGUI::showNewRegistrationsObject (  ) 

Definition at line 1418 of file class.ilObjGroupGUI.php.

References $_GET, $output, $rbacsystem, $tbl, $user, ilUtil::getImagePath(), and ilUtil::sortArray().

        {
                global $rbacsystem;

                //get new applicants
                $applications = $this->object->getNewRegistrations();
                
                if (!$applications)
                {
                        $this->ilErr->raiseError($this->lng->txt("no_applications"),$this->ilErr->MESSAGE);
                }
                
                if ($_GET["sort_by"] == "title" or $_GET["sort_by"] == "")
                {
                        $_GET["sort_by"] = "login";
                }

                $val_contact = "<img src=\"".ilUtil::getImagePath("icon_pencil_b.gif")."\" alt=\"".$this->lng->txt("grp_app_send_mail")."\" title=\"".$this->lng->txt("grp_app_send_mail")."\" border=\"0\" vspace=\"0\"/>";

                foreach ($applications as $applicant)
                {
                        $user =& $this->ilias->obj_factory->getInstanceByObjId($applicant->user_id);

                        $link_contact = "mail_new.php?mobj_id=3&type=new&rcp_to=".$user->getLogin();
                        $link_change = $this->ctrl->getLinkTarget($this,"changeMember")."&mem_id=".$user->getId();
                        $member_functions = "<a href=\"$link_change\">$val_change</a>";
                        if (strcmp($_GET["check"], "all") == 0)
                        {
                                $checked = 1;
                        }
                        else
                        {
                                $checked = 0;
                        }
                        $this->data["data"][$user->getId()]= array(
                                "check"         => ilUtil::formCheckBox($checked,"user_id[]",$user->getId()),
                                "username"      => $user->getLogin(),
                                "fullname"      => $user->getFullname(),
                                "subject"       => $applicant->subject,
                                "date"          => $applicant->application_date,
                                "functions"     => "<a href=\"$link_contact\">".$val_contact."</a>"
                                );

                                unset($member_functions);
                                unset($user);
                }
                // load template for table content data
                //echo $this->ctrl->getFormAction($this,"post");
                //var_dump($this->ctrl->getParameterArray($this,"ShownewRegistrations",false));
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this,"post"));

                $this->data["buttons"] = array( "refuseApplicants"  => $this->lng->txt("refuse"),
                                                                                "assignApplicants"  => $this->lng->txt("assign"));

                $this->tpl->addBlockfile("ADM_CONTENT", "member_table", "tpl.table.html");

                //prepare buttons [cancel|assign]
                foreach ($this->data["buttons"] as $name => $value)
                {
                        $this->tpl->setCurrentBlock("tbl_action_btn");
                        $this->tpl->setVariable("BTN_NAME",$name);
                        $this->tpl->setVariable("BTN_VALUE",$value);
                        $this->tpl->parseCurrentBlock();
                }
                
                $this->tpl->setCurrentBlock("tbl_action_plain_select");
                $this->tpl->setVariable("SELECT_ACTION", "<a href=\"" . $this->ctrl->getLinkTarget($this,"ShownewRegistrations") . "&check=all\">" . $this->lng->txt("check_all") . "</a>" . " / " . "<a href=\"" . $this->ctrl->getLinkTarget($this,"ShownewRegistrations") . "&check=none\">" . $this->lng->txt("uncheck_all") . "</a>");
                $this->tpl->parseCurrentBlock();

                if (isset($this->data["data"]))
                {
                        //sort data array
                        $this->data["data"] = ilUtil::sortArray($this->data["data"], $_GET["sort_by"], $_GET["sort_order"]);
                        $output = array_slice($this->data["data"],$_GET["offset"],$_GET["limit"]);
                }

                $this->tpl->setCurrentBlock("tbl_action_row");
                $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                $this->tpl->setVariable("COLUMN_COUNTS",6);
                $this->tpl->setVariable("TPLPATH",$this->tpl->tplPath);

                // create table
                include_once "./classes/class.ilTableGUI.php";
                $tbl = new ilTableGUI($output);
                // title & header columns
                $tbl->setTitle($this->lng->txt("group_new_registrations"),"icon_usr_b.gif",$this->lng->txt("group_applicants"));
                //$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
                $tbl->setHeaderNames(array("",$this->lng->txt("username"),$this->lng->txt("fullname"),$this->lng->txt("subject"),$this->lng->txt("application_date"),$this->lng->txt("grp_options")));
                $tbl->setHeaderVars(array("","username","fullname","subject","date","functions"),$this->ctrl->getParameterArray($this,"ShownewRegistrations",false));
                $tbl->setColumnWidth(array("","20%","20%","35%","20%","5%"));
                
                if ($_GET["sort_by"] == "login")
                {
                        $_GET["sort_by"] = "username";
                }
                
                if (!$_GET["sort_order"])
                {
                        $_GET["sort_order"] = "asc";
                }
                
                // control
                $tbl->setOrderColumn($_GET["sort_by"]);
                $tbl->setOrderDirection($_GET["sort_order"]);
                $tbl->setLimit($_GET["limit"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setMaxCount(count($this->data["data"]));
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
                $tbl->render();
        }

Here is the call graph for this function:

ilObjGroupGUI::updateMemberStatusObject (  ) 

displays form in which the member-status can be changed public

Definition at line 1592 of file class.ilObjGroupGUI.php.

References $_POST, $key, $rbacsystem, ilUtil::redirect(), and sendInfo().

        {
                global $rbacsystem;

                if (!$rbacsystem->checkAccess("write",$this->object->getRefId()) )
                {
                        $this->ilErr->raiseError("permission_denied",$this->ilErr->MESSAGE);
                }

                if (isset($_POST["member_status_select"]))
                {
                        foreach ($_POST["member_status_select"] as $key=>$value)
                        {
                                $this->object->setMemberStatus($key,$value);
                        }
                }

                sendInfo($this->lng->txt("msg_obj_modified"),true);
                ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
        }

Here is the call graph for this function:

ilObjGroupGUI::updateObject (  ) 

update GroupObject public

Reimplemented from ilObjectGUI.

Definition at line 641 of file class.ilObjGroupGUI.php.

References $_GET, $_POST, $rbacsystem, ilObjectGUI::getReturnLocation(), ilUtil::groupNameExists(), ilUtil::isPassword(), ilUtil::redirect(), sendInfo(), and ilUtil::stripSlashes().

        {
                global $rbacsystem;
                
                if (!$rbacsystem->checkAccess("write",$_GET["ref_id"]) )
                {
                        $this->ilErr->raiseError($this->lng->txt("permission_denied"),$this->ilErr->MESSAGE);
                }

                // check required fields
                if (empty($_POST["Fobject"]["title"]))
                {
                        $this->ilErr->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilErr->MESSAGE);
                }

                if ($_POST["enable_registration"] == 2 && empty($_POST["password"]) || empty($_POST["expirationdate"]) || empty($_POST["expirationtime"]) )//Password-Registration Mode
                {
                        $this->ilErr->raiseError($this->lng->txt("grp_err_registration_data"),$this->ilErr->MESSAGE);
                }
                // check groupname
                if (ilUtil::groupNameExists(ilUtil::stripSlashes($_POST["Fobject"]["title"]),$this->object->getId()))
                {
                        $this->ilErr->raiseError($this->lng->txt("grp_name_exists"),$this->ilErr->MESSAGE);
                }

                $this->object->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
                $this->object->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));

                if ($_POST["enable_registration"] == 2 && !ilUtil::isPassword($_POST["password"]))
                {
                        $this->ilErr->raiseError($this->lng->txt("passwd_invalid"),$this->ilErr->MESSAGE);
                }

                $this->object->setRegistrationFlag(ilUtil::stripSlashes($_POST["enable_registration"]));
                $this->object->setPassword(ilUtil::stripSlashes($_POST["password"]));
                $this->object->setExpirationDateTime(ilUtil::stripSlashes($_POST["expirationdate"])." ".
                        ilUtil::stripSlashes($_POST["expirationtime"]).":00");

                //save custom icons
                if ($this->ilias->getSetting("custom_icons"))
                {
                        $this->object->saveIcons($_FILES["cont_big_icon"],
                                $_FILES["cont_small_icon"]);
                }

                $this->update = $this->object->update();

                sendInfo($this->lng->txt("msg_obj_modified"),true);
                ilUtil::redirect($this->getReturnLocation("update",$this->ctrl->getLinkTarget($this,"")));
        }

Here is the call graph for this function:

ilObjGroupGUI::viewObject (  ) 

list childs of current object

public

Reimplemented from ilObjectGUI.

Definition at line 57 of file class.ilObjGroupGUI.php.

References $_GET, $rbacsystem, ilObjectGUI::$tree, ilLearningProgress::_tracProgress(), and ilContainerGUI::renderObject().

        {
                global $tree,$rbacsystem,$ilUser;

                include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
                ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),'grp');

                if (strtolower($_GET["baseClass"]) == "iladministrationgui")
                {
                        parent::viewObject();
                        return true;
                }
                else if(!$tree->checkForParentType($this->ref_id,'crs'))
                {
                        $this->renderObject();
                        //$this->ctrl->returnToParent($this);
                }
                else
                {
                        include_once './course/classes/class.ilCourseContentGUI.php';
                        $course_content_obj = new ilCourseContentGUI($this);
                        
                        $this->ctrl->setCmdClass(get_class($course_content_obj));
                        $this->ctrl->forwardCommand($course_content_obj);
                }

                $this->tabs_gui->setTabActive('view_content');
                return true;
        }

Here is the call graph for this function:


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