Public Member Functions | Data Fields | Protected Member Functions | Private Member Functions

ilEventAdministrationGUI Class Reference

Class ilEventAdministrationGUI. More...

Inheritance diagram for ilEventAdministrationGUI:
Collaboration diagram for ilEventAdministrationGUI:

Public Member Functions

 ilEventAdministrationGUI (&$container_gui_obj, $event_id=0)
 Constructor public.
executeCommand ()
 execute command
 cancel ()
 register ()
 unregister ()
 printViewMembers ()
 editMembers ()
 updateMembers ()
 editUser ()
 updateUser ()
 materials ()
 saveMaterials ()
 info ()
 sendFile ()
 cloneEvent ()
 Clone Event.
 addEvent ()
 edit ()
 confirmDeleteFiles ()
 Confirm delete files.
 deleteFiles ()
 Delete Files.
 update ()
 createEvent ()
 confirmDelete ()
 delete ()
 exportCSV ()
 Events List CSV Export.
 eventsList ()
 Events List.
 __load ()
 __initCourseObject ()
 __initEventObject ()
 __prepareDateSelect ($a_unix_time)
 __prepareTimeSelect ($a_unix_time)
 __toUnix ($date, $time)
 __formatPath ($a_ref_id)
 getTabs ($tabs_gui)
 Build tabs.

Data Fields

 $container_gui
 $container_obj
 $course_obj
 $event_id = null
 $tpl
 $ctrl
 $lng
 $tabs_gui

Protected Member Functions

 initForm ($a_mode)
 Init Form.

Private Member Functions

 setLocator ()
 Append Session to locator.
 setTabs ()
 Set tabs.

Detailed Description

Class ilEventAdministrationGUI.

Author:
Stefan Meyer <smeyer@databay.de>
Version:
Id:
class.ilEventAdministrationGUI.php 14263 2007-07-06 08:29:33Z smeyer

Definition at line 37 of file class.ilEventAdministrationGUI.php.


Member Function Documentation

ilEventAdministrationGUI::__formatPath ( a_ref_id  ) 

Definition at line 1326 of file class.ilEventAdministrationGUI.php.

References ilObjectGUI::$tree.

Referenced by materials().

        {
                global $tree;

                $path = $this->lng->txt('path') . ': ';
                $first = true;
                foreach($tree->getPathFull($a_ref_id,$this->course_obj->getRefId()) as $node)
                {
                        if($node['ref_id'] != $a_ref_id)
                        {
                                if(!$first)
                                {
                                        $path .= ' -> ';
                                }
                                $first = false;
                                $path .= $node['title'];
                        }
                }
                return $path;
        }

Here is the caller graph for this function:

ilEventAdministrationGUI::__initCourseObject (  ) 

Definition at line 1277 of file class.ilEventAdministrationGUI.php.

References ilObjectGUI::$tree, and ilObjectFactory::getInstanceByRefId().

Referenced by ilEventAdministrationGUI().

        {
                global $tree;

                if($this->container_obj->getType() == 'crs')
                {
                        // Container is course
                        $this->course_obj =& $this->container_obj;
                }
                else
                {
                        $course_ref_id = $tree->checkForParentType($this->container_obj->getRefId(),'crs');
                        $this->course_obj =& ilObjectFactory::getInstanceByRefId($course_ref_id);
                }
                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilEventAdministrationGUI::__initEventObject (  ) 

Definition at line 1294 of file class.ilEventAdministrationGUI.php.

Referenced by ilEventAdministrationGUI().

        {
                if(!is_object($this->event_obj))
                {
                        $this->event_obj = new ilEvent($this->event_id);
                        $this->event_obj->setObjId($this->container_obj->getId());

                        if(!is_object($this->appointment_obj))
                        {
                                $this->appointment_obj =& $this->event_obj->getFirstAppointment();
                        }
                }
                return true;
        }

Here is the caller graph for this function:

ilEventAdministrationGUI::__load (  ) 

Definition at line 1233 of file class.ilEventAdministrationGUI.php.

References ilObjectGUI::$data, $file, $filename, __toUnix(), and ilUtil::stripSlashes().

Referenced by createEvent(), and update().

        {
                $this->appointment_obj->setStartingTime($this->__toUnix($_POST['start']['date'],$_POST['start']['time']));
                $this->appointment_obj->setEndingTime($this->__toUnix($_POST['end']['date'],$_POST['end']['time']));
                $this->appointment_obj->toggleFullTime((bool) $_POST['fulltime']);

                $counter = 1;
                $this->files = array();
                foreach($_FILES as $name => $data)
                {
                        if(!strlen($data['tmp_name']))
                        {
                                ++$counter;
                                continue;
                        }
                        $filename = strlen($_POST['file_name'.$counter]) ?
                                $_POST['file_name'.$counter] : 
                                $data['name'];
                        
                        $file = new ilEventFile();
                        $file->setFileName($filename);
                        $file->setFileSize($data['size']);
                        $file->setFileType($data['type']);
                        $file->setTemporaryName($data['tmp_name']);
                        $file->setErrorCode($data['error']);
                        $this->files[] = $file;
                        ++$counter;
                }
                

                $this->event_obj->setTitle(ilUtil::stripSlashes($_POST['title']));
                $this->event_obj->setDescription(ilUtil::stripSlashes($_POST['desc']));
                $this->event_obj->setLocation(ilUtil::stripSlashes($_POST['location']));
                #$this->event_obj->setFirstname(ilUtil::stripSlashes($_POST['tutor_firstname']));
                $this->event_obj->setName(ilUtil::stripSlashes($_POST['tutor_name']));
                #$this->event_obj->setPTitle(ilUtil::stripSlashes($_POST['tutor_title']));
                $this->event_obj->setEmail(ilUtil::stripSlashes($_POST['tutor_email']));
                $this->event_obj->setPhone(ilUtil::stripSlashes($_POST['tutor_phone']));
                $this->event_obj->setDetails(ilUtil::stripSlashes($_POST['details']));
                $this->event_obj->enableRegistration((int) $_POST['registration']);
                #$this->event_obj->enableParticipation((int) $_POST['participance']);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilEventAdministrationGUI::__prepareDateSelect ( a_unix_time  ) 

Definition at line 1309 of file class.ilEventAdministrationGUI.php.

        {
                return array('y' => date('Y',$a_unix_time),
                                         'm' => date('m',$a_unix_time),
                                         'd' => date('d',$a_unix_time));
        }

ilEventAdministrationGUI::__prepareTimeSelect ( a_unix_time  ) 

Definition at line 1315 of file class.ilEventAdministrationGUI.php.

        {
                return array('h' => date('G',$a_unix_time),
                                         'm' => date('i',$a_unix_time),
                                         's' => date('s',$a_unix_time));
        }

ilEventAdministrationGUI::__toUnix ( date,
time 
)

Definition at line 1321 of file class.ilEventAdministrationGUI.php.

Referenced by __load().

        {
                return mktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
        }

Here is the caller graph for this function:

ilEventAdministrationGUI::addEvent (  ) 

Definition at line 785 of file class.ilEventAdministrationGUI.php.

References ilEvent::_getEvents(), ilUtil::formSelect(), ilUtil::getImagePath(), and initForm().

Referenced by cloneEvent(), and createEvent().

        {
                $this->tabs_gui->clearSubTabs();
                $this->tabs_gui->clearTargets();
                
                
                $this->initForm('create');
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.event_create.html','Modules/Course');
                $this->tpl->setVariable('EVENT_ADD_TABLE',$this->form->getHTML());
                                
                if(!count($events = ilEvent::_getEvents($this->container_obj->getId())))
                {
                        return true;
                }
                $this->tpl->setCurrentBlock('clone_event');
                $this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("CLONE_TITLE_IMG",ilUtil::getImagePath('icon_event.gif'));
                $this->tpl->setVariable("CLONE_TITLE_IMG_ALT",$this->lng->txt('events'));
                $this->tpl->setVariable('CLONE_TITLE',$this->lng->txt('events_clone_title'));
                $this->tpl->setVariable('CLONE_EVENT',$this->lng->txt('event'));
                $this->tpl->setVariable('TXT_BTN_CLONE_EVENT',$this->lng->txt('event_clone_btn'));
                $this->tpl->setVariable('TXT_CLONE_CANCEL',$this->lng->txt('cancel'));
                
                $options[0] = $this->lng->txt('event_select_one');
                foreach($events as $event_obj)
                {
                        $options[$event_obj->getEventId()] = $event_obj->getTitle();
                }
                $this->tpl->setVariable('SEL_EVENT',ilUtil::formSelect(0,'clone_source',$options,false,true));
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilEventAdministrationGUI::cancel (  ) 

Definition at line 95 of file class.ilEventAdministrationGUI.php.

        {
                $this->ctrl->returnToParent($this);
        }

ilEventAdministrationGUI::cloneEvent (  ) 

Clone Event.

public

Parameters:
 

Definition at line 603 of file class.ilEventAdministrationGUI.php.

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

        {
                if(!$_POST['clone_source'])
                {
                        ilUtil::sendInfo($this->lng->txt('event_choose_one'));
                        $this->addEvent();
                        return false;
                }
                $event_obj = new ilEvent($_POST['clone_source']);
                
                $new_event = new ilEvent();
                $new_event->setObjId($this->container_obj->getId());
                $new_event->setTitle($event_obj->getTitle());
                $new_event->setDescription($event_obj->getDescription());
                $new_event->setLocation($event_obj->getLocation());
                $new_event->setName($event_obj->getName());
                $new_event->setPhone($event_obj->getPhone());
                $new_event->setEmail($event_obj->getEmail());
                $new_event->setDetails($event_obj->getDetails());
                $new_event->enableRegistration($event_obj->enabledRegistration());
                $new_event->enableParticipation($event_obj->enabledParticipation());
                $new_event_id = $new_event->create();
                
                // Copy appointments
                foreach($event_obj->getAppointments() as $app_obj)
                {
                        $new_app = new ilEventAppointment();
                        $new_app->setEventId($new_event->getEventId());
                        $new_app->setStartingTime($app_obj->getStartingTime());
                        $new_app->setEndingTime($app_obj->getEndingTime());
                        $new_app->toggleFullTime($app_obj->enabledFullTime());
                        $new_app->create();
                }
                // Copy files
                foreach($event_obj->getFiles() as $file_obj)
                {
                        $file_obj->cloneFiles($new_event->getEventId());
                }
                ilUtil::sendInfo($this->lng->txt('event_cloned'),true);
                $this->ctrl->setParameter($this,'event_id',$new_event_id);
                $this->ctrl->redirect($this,'edit');
        }

Here is the call graph for this function:

ilEventAdministrationGUI::confirmDelete (  ) 

Definition at line 997 of file class.ilEventAdministrationGUI.php.

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

        {
                include_once './Modules/Course/classes/Event/class.ilEvent.php';

                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.event_delete.html','Modules/Course');
                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TXT_EVENT_NAME",$this->lng->txt('title'));
                $this->tpl->setVariable("DELETE",$this->lng->txt('delete'));
                $this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
                

                $events = is_array($_POST['event_ids']) ? $_POST['event_ids'] : array($this->event_id);
                $_SESSION['event_del'] = $events;
                $counter = 0;
                foreach($events as $event)
                {
                        $event_obj = new ilEvent($event);
                        if(strlen($desc = $event_obj->getDescription()))
                        {
                                $this->tpl->setCurrentBlock("desc");
                                $this->tpl->setVariable("DESCRIPTION",$desc);
                                $this->tpl->parseCurrentBlock();
                        }
                        $this->tpl->setCurrentBlock("events");
                        $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
                        $this->tpl->setVariable("EVENT_NAME",$event_obj->getTitle());
                        $this->tpl->parseCurrentBlock();
                }
                ilUtil::sendInfo($this->lng->txt('event_delete_sure'));
                return true;
        }

Here is the call graph for this function:

ilEventAdministrationGUI::confirmDeleteFiles (  ) 

Confirm delete files.

public

Definition at line 858 of file class.ilEventAdministrationGUI.php.

References $file, edit(), ilUtil::sendInfo(), and setTabs().

        {
                $this->setTabs();
                $this->tabs_gui->setTabActive('edit_properties');

                if(!count($_POST['file_id']))
                {
                        ilUtil::sendInfo($this->lng->txt('select_one'));
                        $this->edit();
                        return false;
                }
                
                include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
                $c_gui = new ilConfirmationGUI();
                
                // set confirm/cancel commands
                $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteFiles"));
                $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
                $c_gui->setCancel($this->lng->txt("cancel"), "edit");
                $c_gui->setConfirm($this->lng->txt("confirm"), "deleteFiles");

                // add items to delete
                foreach($_POST["file_id"] as $file_id)
                {
                        $file = new ilEventFile($file_id);
                        if($file->getEventId() != $this->event_obj->getEventId())
                        {
                                ilUtil::sendInfo($this->lng->txt('select_one'));
                                $this->edit();
                                return false;
                        }
                        $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
                }
                
                $this->tpl->setContent($c_gui->getHTML());
        }

Here is the call graph for this function:

ilEventAdministrationGUI::createEvent (  ) 

Definition at line 957 of file class.ilEventAdministrationGUI.php.

References $event_id, $ilErr, __load(), addEvent(), initForm(), and ilUtil::sendInfo().

        {
                global $ilErr;

                $this->__load();
                $this->initForm('create');
                
                $ilErr->setMessage('');
                if(!$this->form->checkInput())
                {
                        $ilErr->setMessage($this->lng->txt('err_check_input'));
                }

                $this->event_obj->validate();
                $this->appointment_obj->validate();

                if(strlen($ilErr->getMessage()))
                {
                        ilUtil::sendInfo($ilErr->getMessage());
                        $this->addEvent();
                        return false;
                }
                // Create event
                $event_id = $this->event_obj->create();

                // create appointment
                $this->appointment_obj->setEventId($event_id);
                $this->appointment_obj->create();

                foreach($this->files as $file_obj)
                {
                        $file_obj->setEventId($this->event_obj->getEventId());
                        $file_obj->create();
                }

                ilUtil::sendInfo($this->lng->txt('event_add_new_event'),true);
                $this->ctrl->returnToParent($this);
                return true;
        }

Here is the call graph for this function:

ilEventAdministrationGUI::delete (  ) 

Definition at line 1029 of file class.ilEventAdministrationGUI.php.

References $_SESSION, $event_id, ilEvent::_delete(), and ilUtil::sendInfo().

        {
                include_once './Modules/Course/classes/Event/class.ilEvent.php';

                if(!is_array($_SESSION['event_del']))
                {
                        ilUtil::sendInfo($this->lng->txt('event_none_selected'));
                        $this->ctrl->returnToParent($this);
                        return false;
                }
                foreach($_SESSION['event_del'] as $event_id)
                {
                        ilEvent::_delete($event_id);
                }

                ilUtil::sendInfo($this->lng->txt('events_deleted'),true);
                $this->ctrl->returnToParent($this);

                return true;
        }

Here is the call graph for this function:

ilEventAdministrationGUI::deleteFiles (  ) 

Delete Files.

public

Parameters:
 

Definition at line 902 of file class.ilEventAdministrationGUI.php.

References $file, edit(), and ilUtil::sendInfo().

        {
                if(!count($_POST['file_id']))
                {
                        ilUtil::sendInfo($this->lng->txt('select_one'));
                        $this->edit();
                        return false;
                }
                foreach($_POST['file_id'] as $id)
                {
                        $file = new ilEventFile($id);
                        $file->delete();
                }
                $this->edit();
                return true;    
        }

Here is the call graph for this function:

ilEventAdministrationGUI::edit (  ) 

Definition at line 816 of file class.ilEventAdministrationGUI.php.

References $file, $files, ilEventFile::_readFilesByEvent(), initForm(), and setTabs().

Referenced by confirmDeleteFiles(), deleteFiles(), and update().

        {
                $this->setTabs();
                $this->tabs_gui->setTabActive('edit_properties');
                
                $this->initForm('edit');
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.event_edit.html','Modules/Course');
                $this->tpl->setVariable('EVENT_EDIT_TABLE',$this->form->getHTML());
                
                if(!count($files = ilEventFile::_readFilesByEvent($this->event_obj->getEventId())))
                {
                        return true;
                }
                $rows = array();
                foreach($files as $file)
                {
                        $table_data['id'] = $file->getFileId();
                        $table_data['filename'] = $file->getFileName();
                        $table_data['filetype'] = $file->getFileType();
                        $table_data['filesize'] = $file->getFileSize();
                        
                        $rows[] = $table_data; 
                }
                
                include_once("./Modules/Course/classes/Event/class.ilEventFileTableGUI.php");
                $table_gui = new ilEventFileTableGUI($this, "edit");
                $table_gui->setTitle($this->lng->txt("event_files"));
                $table_gui->setData($rows);
                $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
                $table_gui->addMultiCommand("confirmDeleteFiles", $this->lng->txt("delete"));
                $table_gui->setSelectAllCheckbox("file_id");
                $this->tpl->setVariable('EVENT_FILE_TABLE',$table_gui->getHTML());

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilEventAdministrationGUI::editMembers (  ) 

Definition at line 193 of file class.ilEventAdministrationGUI.php.

References $_GET, $_SESSION, $tbl, ilCourseParticipants::_getInstanceByObjId(), ilObjUser::_lookupLogin(), ilObjUser::_lookupName(), ilUtil::_sortIds(), ilUtil::getImagePath(), setTabs(), and ilUtil::switchColor().

Referenced by updateMembers(), and updateUser().

        {
                $this->setTabs();
                $this->tabs_gui->setTabActive('event_edit_members');
                
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.event_members.html','Modules/Course');
                $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");

                // display print button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,'printViewMembers'));
                $this->tpl->setVariable("BTN_TXT",$this->lng->txt('print'));
                $this->tpl->setVariable("BTN_TARGET",'target="_blank"');
                $this->tpl->parseCurrentBlock();

                include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
                include_once 'Modules/Course/classes/Event/class.ilEvent.php';
                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';

                $members_obj = ilCourseParticipants::_getInstanceByObjId($this->course_obj->getId());
                $event_obj = new ilEvent((int) $_GET['event_id']);
                $event_part = new ilEventParticipants((int) $_GET['event_id']);

                $members = $members_obj->getParticipants();
                $members = ilUtil::_sortIds($members,'usr_data','lastname','usr_id');

                $this->tpl->addBlockfile("PARTICIPANTS_TABLE","participants_table", "tpl.table.html");
                $this->tpl->addBlockfile('TBL_CONTENT','tbl_content','tpl.event_members_row.html','Modules/Course');

                // Table 
                $tbl = new ilTableGUI();
                $tbl->setTitle($this->lng->txt("event_tbl_participants"),
                                           'icon_usr.gif',
                                           $this->lng->txt('obj_usr'));
                $this->ctrl->setParameter($this,'offset',(int) $_GET['offset']);
                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("COLUMN_COUNTS",6);
                #$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                #$this->tpl->setCurrentBlock("tbl_action_btn");
                #$this->tpl->setVariable("BTN_NAME", "updateMembers");
                #$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("event_save_participants"));
                #$this->tpl->parseCurrentBlock();
                $this->tpl->setCurrentBlock("plain_button");
                $this->tpl->setVariable("PBTN_NAME",'updateMembers');
                $this->tpl->setVariable("PBTN_VALUE",$this->lng->txt('save'));
                $this->tpl->parseCurrentBlock();
                
                $this->tpl->setCurrentBlock("plain_button");
                $this->tpl->setVariable("PBTN_NAME",'cancel');
                $this->tpl->setVariable("PBTN_VALUE",$this->lng->txt('cancel'));
                $this->tpl->parseCurrentBlock();

                if($event_obj->enabledRegistration())
                {
                        $tbl->setHeaderNames(array($this->lng->txt('name'),
                                                                           $this->lng->txt('trac_mark'),
                                                                           $this->lng->txt('trac_comment'),
                                                                           $this->lng->txt('event_tbl_registered'),
                                                                           $this->lng->txt('event_tbl_participated')));
                        $tbl->setHeaderVars(array("name",
                                                                          "mark",
                                                                          "comment",
                                                                          "registered",
                                                                          "participated"),
                                                                $this->ctrl->getParameterArray($this,'editMembers'));
                        $tbl->setColumnWidth(array('','','','',''));
                }
                else
                {
                        $tbl->setHeaderNames(array($this->lng->txt('name'),
                                                                           $this->lng->txt('trac_mark'),
                                                                           $this->lng->txt('trac_comment'),
                                                                           $this->lng->txt('event_tbl_participated')));

                        $tbl->setHeaderVars(array("name",
                                                                          "mark",
                                                                          "comment",
                                                                          "participated"),
                                                                $this->ctrl->getParameterArray($this,'editMembers'));

                        $tbl->setColumnWidth(array('','','',''));
                }

                $tbl->setOrderColumn($_GET["sort_by"]);
                $tbl->setOrderDirection($_GET["sort_order"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setLimit($_GET["limit"]);
                $tbl->setMaxCount(count($members));
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));

                $sliced_users = array_slice($members,$_GET['offset'],$_SESSION['tbl_limit']);
                $tbl->disable('sort');
                $tbl->enable('action');
                $tbl->render();

                $counter = 0;
                foreach($sliced_users as $user_id)
                {
                        $user_data = $event_part->getUser($user_id);

                        if($event_obj->enabledRegistration())
                        {
                                $this->tpl->setCurrentBlock("registered_col");
                                $this->tpl->setVariable("IMAGE_REGISTERED",$event_part->isRegistered($user_id) ? 
                                                                                ilUtil::getImagePath('icon_ok.gif') :
                                                                                ilUtil::getImagePath('icon_not_ok.gif'));
                                $this->tpl->setVariable("REGISTERED",$event_part->isRegistered($user_id) ?
                                                                                $this->lng->txt('event_registered') :
                                                                                $this->lng->txt('event_not_registered'));
                                $this->tpl->parseCurrentBlock();
                        }

                        $this->tpl->setCurrentBlock("tbl_content");
                        $name = ilObjUser::_lookupName($user_id);
                        $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
                        $this->tpl->setVariable("LASTNAME",$name['lastname']);
                        $this->tpl->setVariable("FIRSTNAME",$name['firstname']);
                        $this->tpl->setVariable("LOGIN",ilObjUser::_lookupLogin($user_id));
                        $this->tpl->setVariable("MARK",$user_data['mark']);
                        $this->tpl->setVariable("MARK_NAME",'mark['.$user_id.']');
                        $this->tpl->setVariable("COMMENT_NAME",'comment['.$user_id.']');
                        $this->tpl->setVariable("COMMENT",$user_data['comment']);

                        $this->tpl->setVariable("USER_ID",$user_id);
                        $this->tpl->setVariable("CHECKED",$event_part->hasParticipated($user_id) ? 'checked="checked"' : '');
                        $this->tpl->setVariable("IMAGE_PART",$event_part->hasParticipated($user_id) ? 
                                                                        ilUtil::getImagePath('icon_ok.gif') :
                                                                        ilUtil::getImagePath('icon_not_ok.gif'));
                        $this->tpl->setVariable("PART",$event_part->hasParticipated($user_id) ?
                                                                        $this->lng->txt('event_participated') :
                                                                        $this->lng->txt('event_not_participated'));
                        $this->ctrl->setParameter($this,'user_id',$user_id);
                        $this->tpl->setVariable("EDIT_LINK",$this->ctrl->getLinkTarget($this,'editUser'));
                        $this->tpl->setVariable("TXT_EDIT",$this->lng->txt('edit'));
                        $this->tpl->parseCurrentBlock();
                }
                $this->tpl->setCurrentBlock("select_row");
                $this->tpl->setVariable("SELECT_SPAN",$event_obj->enabledRegistration() ? 4 : 3);
                $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
                $this->tpl->setVariable("SELECT_ALL",$this->lng->txt('select_all'));
                $this->tpl->parseCurrentBlock();
                
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilEventAdministrationGUI::editUser (  ) 

Definition at line 367 of file class.ilEventAdministrationGUI.php.

References $_GET, ilObjUser::_lookupLogin(), and ilUtil::getImagePath().

        {
                global $ilObjDataCache;

                include_once 'Modules/Course/classes/Event/class.ilEvent.php';
                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';

                $event_obj = new ilEvent((int) $_GET['event_id']);
                $part_obj = new ilEventParticipants((int) $_GET['event_id']);


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

                $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.event_edit_user.html','Modules/Course');

                $this->ctrl->setParameter($this,'user_id',(int) $_GET['user_id']);
                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("USR_IMAGE",ilUtil::getImagePath('icon_usr.gif'));
                $this->tpl->setVariable("ALT_USER",$this->lng->txt('obj_usr'));
                $this->tpl->setVariable("EVENT_TITLE",$event_obj->getTitle());
                $this->tpl->setVariable("FULLNAME",$ilObjDataCache->lookupTitle((int) $_GET['user_id']));
                $this->tpl->setVariable("LOGIN",ilObjUser::_lookupLogin((int) $_GET['user_id']));
                
                $this->tpl->setVariable("TXT_PARTICIPANCE",$this->lng->txt('event_tbl_participated'));
                $this->tpl->setVariable("TXT_REGISTERED",$this->lng->txt('event_tbl_registered'));
                $this->tpl->setVariable("TXT_MARK",$this->lng->txt('trac_mark'));
                $this->tpl->setVariable("TXT_COMMENT",$this->lng->txt('trac_comment'));
                $this->tpl->setVariable("TXT_BTN_UPDATE",$this->lng->txt('save'));
                $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));

                $user_data = $part_obj->getUser((int) $_GET['user_id']);
                
                $this->tpl->setVariable("MARK",$user_data['mark']);
                $this->tpl->setVariable("COMMENT",$user_data['comment']);
                $this->tpl->setVariable("PART_CHECKED",$user_data['participated'] ? 'checked="checked"' : '');
                $this->tpl->setVariable("REG_CHECKED",$user_data['registered'] ? 'checked="checked"' : '');
                
        }

Here is the call graph for this function:

ilEventAdministrationGUI::eventsList (  ) 

Events List.

public

Parameters:
 

Definition at line 1112 of file class.ilEventAdministrationGUI.php.

References $_GET, $_SESSION, $ilErr, $tbl, ilEvent::_getEvents(), ilCourseParticipants::_getInstanceByObjId(), ilObjUser::_lookupLogin(), ilObjUser::_lookupName(), ilUtil::_sortIds(), ilUtil::getImagePath(), and ilUtil::switchColor().

        {                       
                global $ilErr,$ilAccess, $ilUser;

                if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
                {
                        $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->MESSAGE);
                }
                
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.event_list.html','Modules/Course');
                $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");

                // display button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,'exportCSV'));
                $this->tpl->setVariable("BTN_TXT",$this->lng->txt('event_csv_export'));
                $this->tpl->parseCurrentBlock();
                                
                include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
                include_once 'Modules/Course/classes/Event/class.ilEvent.php';
                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';
                
                $this->tpl->addBlockfile("EVENTS_TABLE","events_table", "tpl.table.html");
                $this->tpl->addBlockfile('TBL_CONTENT','tbl_content','tpl.event_list_row.html','Modules/Course');
                
                $members_obj = ilCourseParticipants::_getInstanceByObjId($this->course_obj->getId());
                $members = $members_obj->getParticipants();
                $members = ilUtil::_sortIds($members,'usr_data','lastname','usr_id');           
                
                // Table 
                $tbl = new ilTableGUI();
                $tbl->setTitle($this->lng->txt("event_overview"),
                                           'icon_usr.gif',
                                           $this->lng->txt('obj_usr'));
                $this->ctrl->setParameter($this,'offset',(int) $_GET['offset']);        
                
                $events = ilEvent::_getEvents($this->course_obj->getId());              
                
                $headerNames = array();
                $headerVars = array();
                $colWidth = array();
                
                $headerNames[] = $this->lng->txt('name');               
                $headerVars[] = "name";         
                $colWidth[] = '20%';            
                                        
                for ($i = 1; $i <= count($events); $i++)
                {
                        $headerNames[] = $i;
                        $headerVars[] = "event_".$i;
                        $colWidth[] = 80/count($events)."%";    
                }               
                
                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $tbl->setHeaderNames($headerNames);
                $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this,'eventsList'));
                $tbl->setColumnWidth($colWidth);                

                $tbl->setOrderColumn($_GET["sort_by"]);
                $tbl->setOrderDirection($_GET["sort_order"]);
                $tbl->setOffset($_GET["offset"]);                               
                $tbl->setLimit($ilUser->getPref("hits_per_page"));
                $tbl->setMaxCount(count($members));
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
                
                $sliced_users = array_slice($members,$_GET['offset'],$_SESSION['tbl_limit']);
                $tbl->disable('sort');
                $tbl->render();
                
                $counter = 0;
                foreach($sliced_users as $user_id)
                {                       
                        foreach($events as $event_obj)
                        {                                                               
                                $this->tpl->setCurrentBlock("eventcols");
                                                        
                                $event_part = new ilEventParticipants((int) $event_obj->getEventId());                                                                                                          
                                                                                
                                if ($event_obj->enabledParticipation())
                                {                       
                                        $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ? 
                                                                                        ilUtil::getImagePath('icon_ok.gif') :
                                                                                        ilUtil::getImagePath('icon_not_ok.gif'));
                                        
                                        $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
                                                                                $this->lng->txt('event_participated') :
                                                                                $this->lng->txt('event_not_participated'));
                                }                                               
                                
                                $this->tpl->parseCurrentBlock();                                
                        }                       
                        
                        $this->tpl->setCurrentBlock("tbl_content");
                        $name = ilObjUser::_lookupName($user_id);
                        $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
                        $this->tpl->setVariable("LASTNAME",$name['lastname']);
                        $this->tpl->setVariable("FIRSTNAME",$name['firstname']);
                        $this->tpl->setVariable("LOGIN",ilObjUser::_lookupLogin($user_id));                             
                        $this->tpl->parseCurrentBlock();                        
                }               
                
                $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));          
                $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
                $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
                $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
                $this->tpl->setVariable("HEAD_TXT_DATE_TIME",$this->lng->txt("event_date_time"));
                $i = 1;
                foreach($events as $event_obj)
                {
                        $this->tpl->setCurrentBlock("legend_loop");
                        $this->tpl->setVariable("LEGEND_CSS_ROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
                        $this->tpl->setVariable("LEGEND_DIGIT", $i++);
                        $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
                        $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());      
                        $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
                        $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());          
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

& ilEventAdministrationGUI::executeCommand (  ) 

execute command

Reimplemented from ilObjectGUI.

Definition at line 78 of file class.ilEventAdministrationGUI.php.

References $cmd.

        {
                global $ilAccess;

                $cmd = $this->ctrl->getCmd();
                switch($this->ctrl->getNextClass($this))
                {
                        default:
                                if(!$cmd)
                                {
                                        $cmd = 'addEvent';
                                }
                                $this->$cmd();
                                break;
                }
        }

ilEventAdministrationGUI::exportCSV (  ) 

Events List CSV Export.

public

Parameters:
 

Definition at line 1057 of file class.ilEventAdministrationGUI.php.

References ilEvent::_getEvents(), ilCourseParticipants::_getInstanceByObjId(), ilObjUser::_lookupLogin(), ilObjUser::_lookupName(), ilUtil::_sortIds(), and ilUtil::deliverData().

        {
                include_once('Services/Utilities/classes/class.ilCSVWriter.php');
                include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
                include_once 'Modules/Course/classes/Event/class.ilEvent.php';
                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';
                
                $members_obj = ilCourseParticipants::_getInstanceByObjId($this->course_obj->getId());
                $members = $members_obj->getParticipants();
                $members = ilUtil::_sortIds($members,'usr_data','lastname','usr_id');           
                
                $events = ilEvent::_getEvents($this->course_obj->getId());
                
                $this->csv = new ilCSVWriter();
                $this->csv->addColumn($this->lng->txt("lastname"));
                $this->csv->addColumn($this->lng->txt("firstname"));
                $this->csv->addColumn($this->lng->txt("login"));
                
                foreach($events as $event_obj)
                {                       
                        $this->csv->addColumn($event_obj->getTitle().' ('.$event_obj->getFirstAppointment()->appointmentToString().')');
                }
                
                $this->csv->addRow();
                
                foreach($members as $user_id)
                {
                        $name = ilObjUser::_lookupName($user_id);
                        
                        $this->csv->addColumn($name['lastname']);
                        $this->csv->addColumn($name['firstname']);
                        $this->csv->addColumn(ilObjUser::_lookupLogin($user_id));
                        
                        foreach($events as $event_obj)
                        {                       
                                $event_part = new ilEventParticipants((int) $event_obj->getEventId());
                                
                                $this->csv->addColumn($event_part->hasParticipated($user_id) ?
                                                                                $this->lng->txt('event_participated') :
                                                                                $this->lng->txt('event_not_participated'));
                        }
                        
                        $this->csv->addRow();
                }
                
                ilUtil::deliverData($this->csv->getCSVString(), date("Y_m_d")."_course_events.csv", "text/csv");                
        }

Here is the call graph for this function:

ilEventAdministrationGUI::getTabs ( tabs_gui  ) 

Build tabs.

public

Definition at line 1353 of file class.ilEventAdministrationGUI.php.

References $tabs_gui.

Referenced by setTabs().

        {
                global $ilAccess,$ilTabs;

                $tabs_gui->setBackTarget($this->lng->txt('back_to_crs_content'),$this->ctrl->getParentReturn($this));
                $tabs_gui->addTarget('info_short',
                                                         $this->ctrl->getLinkTarget($this,'info'));

                if($ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
                {
                        $tabs_gui->addTarget('edit_properties',
                                                                 $this->ctrl->getLinkTarget($this,'edit'));
                        $tabs_gui->addTarget('crs_materials',
                                                                 $this->ctrl->getLinkTarget($this,'materials'));
                        $tabs_gui->addTarget('event_edit_members',
                                                                 $this->ctrl->getLinkTarget($this,'editMembers'));
                        
                }
        }

Here is the caller graph for this function:

ilEventAdministrationGUI::ilEventAdministrationGUI ( &$  container_gui_obj,
event_id = 0 
)

Constructor public.

Definition at line 54 of file class.ilEventAdministrationGUI.php.

References $event_id, $ilCtrl, $lng, $tpl, __initCourseObject(), and __initEventObject().

        {
                global $tpl,$ilCtrl,$lng,$ilObjDataCache,$ilTabs;

                $this->tpl =& $tpl;

                $this->ctrl =& $ilCtrl;
                $this->ctrl->saveParameter($this,'event_id');

                $this->lng =& $lng;
                $this->lng->loadLanguageModule('crs');
                $this->lng->loadLanguageModule('trac');
                $this->tabs_gui =& $ilTabs;

                $this->event_id = $event_id;

                $this->container_gui =& $container_gui_obj;
                $this->container_obj =& $this->container_gui->object;

                // 
                $this->__initCourseObject();
                $this->__initEventObject();
        }               

Here is the call graph for this function:

ilEventAdministrationGUI::info (  ) 

Definition at line 500 of file class.ilEventAdministrationGUI.php.

References $file, $files, $location, $tpl, and setTabs().

        {
                $this->setTabs();
                $this->tabs_gui->setTabActive('info_short');
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.event_info.html','Modules/Course');

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

                include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
                $info = new ilInfoScreenGUI($this);
                
                $appointment_obj =& $this->event_obj->getFirstAppointment();
                

                // syllabus section
                $info->addSection($this->lng->txt("event_general_properties"));
                $info->addProperty($this->lng->txt('event_title'),
                                                   $this->event_obj->getTitle());
                if(strlen($desc = $this->event_obj->getDescription()))
                {
                        $info->addProperty($this->lng->txt('event_desc'),
                                                           nl2br($this->event_obj->getDescription()));
                }
                if(strlen($location = $this->event_obj->getLocation()))
                {
                        $info->addProperty($this->lng->txt('event_location'),
                                                           nl2br($this->event_obj->getLocation()));
                }
                $info->addProperty($this->lng->txt('event_date'),
                                                        $appointment_obj->appointmentToString());

                if($this->event_obj->hasTutorSettings())
                {
                        $info->addSection($this->lng->txt('event_tutor_data'));
                        if(strlen($fullname = $this->event_obj->getFullname()))
                        {
                                $info->addProperty($this->lng->txt('event_lecturer'),
                                                                   $fullname);
                        }
                        if(strlen($email = $this->event_obj->getEmail()))
                        {
                                $info->addProperty($this->lng->txt('tutor_email'),
                                                                   $email);
                        }
                        if(strlen($phone = $this->event_obj->getPhone()))
                        {
                                $info->addProperty($this->lng->txt('tutor_phone'),
                                                                   $phone);
                        }
                }

                $details = $this->event_obj->getDetails();
                $files = $this->event_obj->getFiles();

                if(strlen($details) or is_array($files))
                {
                        $info->addSection($this->lng->txt('event_further_informations'));
                        
                        if(strlen($details))
                        {
                                $info->addProperty($this->lng->txt('event_details_workflow'),
                                                                   nl2br($details));
                        }

                        if(count($files))
                        {
                                $tpl = new ilTemplate('tpl.event_info_file.html',true,true,'Modules/Course');

                                foreach($files as $file)
                                {
                                        $tpl->setCurrentBlock("files");
                                        $this->ctrl->setParameter($this,'file_id',$file->getFileId());
                                        $tpl->setVariable("DOWN_LINK",$this->ctrl->getLinkTarget($this,'sendfile'));
                                        $tpl->setVariable("DOWN_NAME",$file->getFileName());
                                        $tpl->setVariable("DOWN_INFO_TXT",$this->lng->txt('event_file_size_info'));
                                        $tpl->setVariable("DOWN_SIZE",$file->getFileSize());
                                        $tpl->setVariable("TXT_BYTES",$this->lng->txt('bytes'));
                                        $tpl->parseCurrentBlock();
                                }
                                $info->addProperty($this->lng->txt('event_file_download'),
                                                                   $tpl->get());
                        }
                        
                }
                                
                $this->tpl->setVariable("INFO_TABLE",$info->getHTML());
        }

Here is the call graph for this function:

ilEventAdministrationGUI::initForm ( a_mode  )  [protected]

Init Form.

protected

Definition at line 651 of file class.ilEventAdministrationGUI.php.

References $file, $title, and ilUtil::getImagePath().

Referenced by addEvent(), createEvent(), edit(), and update().

        {
                if(is_object($this->form))
                {
                        return true;
                }
        
                include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");

                $this->form = new ilPropertyFormGUI();
                $this->form->setFormAction($this->ctrl->getFormAction($this));
                
                // title
                $title = new ilTextInputGUI($this->lng->txt('event_title'),'title');
                $title->setValue($this->event_obj->getTitle());
                $title->setSize(20);
                $title->setMaxLength(70);
                $title->setRequired(TRUE);
                $this->form->addItem($title);
                
                // desc
                $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'),'desc');
                $desc->setValue($this->event_obj->getDescription());
                $desc->setRows(4);
                $desc->setCols(50);
                $this->form->addItem($desc);
                
                // location
                $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'),'location');
                $desc->setValue($this->event_obj->getLocation());
                $desc->setRows(4);
                $desc->setCols(50);
                $this->form->addItem($desc);
                
                // registration
                $reg = new ilCheckboxInputGUI($this->lng->txt('event_registration'),'registration');
                $reg->setChecked($this->event_obj->enabledRegistration() ? true : false);
                $reg->setOptionTitle($this->lng->txt('event_registration_info'));
                $this->form->addItem($reg);
                
                // section
                $section = new ilFormSectionHeaderGUI();
                $section->setTitle($this->lng->txt('event_date_time'));
                $this->form->addItem($section);
                
                // start
                $start = new ilDateTimeInputGUI($this->lng->txt('event_start_date'),'start');
                $start->setMinuteStepSize(5);
                $start->setUnixTime($this->appointment_obj->getStartingTime());
                $start->setShowTime(true);
                $this->form->addItem($start);
                
                // end
                $end = new ilDateTimeInputGUI($this->lng->txt('event_end_date'),'end');
                $end->setMinuteStepSize(5);
                $end->setUnixTime($this->appointment_obj->getEndingTime());
                $end->setShowTime(true);
                $this->form->addItem($end);

                $full = new ilCheckboxInputGUI($this->lng->txt('event_fullday'),'fulltime');
                $full->setChecked($this->appointment_obj->enabledFulltime() ? true : false);
                $full->setOptionTitle($this->lng->txt('event_fulltime_info'));
                $this->form->addItem($full);

                // section
                $section = new ilFormSectionHeaderGUI();
                $section->setTitle($this->lng->txt('event_tutor_data'));
                $this->form->addItem($section);
                
                $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'),'tutor_name');
                $tutor_name->setValue($this->event_obj->getName());
                $tutor_name->setSize(20);
                $tutor_name->setMaxLength(70);
                $this->form->addItem($tutor_name);
                
                $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'),'tutor_email');
                $tutor_email->setValue($this->event_obj->getEmail());
                $tutor_email->setSize(20);
                $tutor_email->setMaxLength(70);
                $this->form->addItem($tutor_email);

                $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'),'tutor_phone');
                $tutor_phone->setValue($this->event_obj->getPhone());
                $tutor_phone->setSize(20);
                $tutor_phone->setMaxLength(70);
                $this->form->addItem($tutor_phone);
                
                $section = new ilFormSectionHeaderGUI();
                $section->setTitle($this->lng->txt('event_further_informations'));
                $this->form->addItem($section);
                
                $file = new ilFileInputGUI($this->lng->txt('event_file').' 1','file1');
                $file->enableFileNameSelection('file_name1');
                $this->form->addItem($file);
                
                $file = new ilFileInputGUI($this->lng->txt('event_file').' 2','file2');
                $file->enableFileNameSelection('file_name2');
                $this->form->addItem($file);

                $file = new ilFileInputGUI($this->lng->txt('event_file').' 3','file3');
                $file->enableFileNameSelection('file_name3');
                $this->form->addItem($file);

                $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'),'details');
                $details->setValue($this->event_obj->getDetails());
                $details->setCols(50);
                $details->setRows(4);
                $this->form->addItem($details);

                switch($a_mode)
                {
                        case 'create':
                                $this->form->setTitle($this->lng->txt('event_table_create'));
                                $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.gif'));
                
                                $this->form->addCommandButton('createEvent',$this->lng->txt('event_btn_add'));
                                $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
                
                                return true;
                        
                        case 'edit':
                                $this->form->setTitle($this->lng->txt('event_table_update'));
                                $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.gif'));
                        
                                $this->form->addCommandButton('update',$this->lng->txt('save'));
                                $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
                                
                                return true;
                }

                
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilEventAdministrationGUI::materials (  ) 

Definition at line 423 of file class.ilEventAdministrationGUI.php.

References ilObjectGUI::$objDefinition, ilObjectGUI::$tree, __formatPath(), ilUtil::formCheckbox(), ilUtil::getImagePath(), setTabs(), and ilUtil::switchColor().

        {
                global $tree, $objDefinition;

                $this->setTabs();
                $this->tabs_gui->setTabActive('crs_materials');

                include_once 'Modules/Course/classes/Event/class.ilEventItems.php';
                $this->event_items = new ilEventItems($this->event_id);
                $items = $this->event_items->getItems();

                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.event_materials.html','Modules/Course');
                $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");

                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("COLL_TITLE_IMG",ilUtil::getImagePath('icon_event.gif'));
                $this->tpl->setVariable("COLL_TITLE_IMG_ALT",$this->lng->txt('events'));
                $this->tpl->setVariable("TABLE_TITLE",$this->lng->txt('event_assign_materials_table'));
                $this->tpl->setVariable("TABLE_INFO",$this->lng->txt('event_assign_materials_info'));

                $nodes = $tree->getSubTree($tree->getNodeData($this->course_obj->getRefId()));
                $counter = 1;
                foreach($nodes as $node)
                {
                        // No side blocks here
                        if ($objDefinition->isSideBlock($node['type']))
                        {
                                continue;
                        }
                        
                        if($node['type'] == 'rolf')
                        {
                                continue;
                        }
                        if($counter++ == 1)
                        {
                                continue;
                        }
                        $this->tpl->setCurrentBlock("material_row");
                        $this->tpl->setVariable("ROW_CLASS",ilUtil::switchColor($counter,'tblrow1','tblrow2'));
                        $this->tpl->setVariable("CHECK_COLL",ilUtil::formCheckbox(in_array($node['ref_id'],$items) ? 1 : 0,
                                                                                                                                          'items[]',$node['ref_id']));
                        $this->tpl->setVariable("COLL_TITLE",$node['title']);

                        if(strlen($node['description']))
                        {
                                $this->tpl->setVariable("COLL_DESC",$node['description']);
                        }
                        $this->tpl->setVariable("ASSIGNED_IMG_OK",in_array($node['ref_id'],$items) ? 
                                                                        ilUtil::getImagePath('icon_ok.gif') :
                                                                        ilUtil::getImagePath('icon_not_ok.gif'));
                        $this->tpl->setVariable("ASSIGNED_STATUS",$this->lng->txt('event_material_assigned'));
                        $this->tpl->setVariable("COLL_PATH",$this->__formatPath($node['ref_id']));
                        $this->tpl->parseCurrentBlock();
                }

                $this->tpl->setVariable("SELECT_ROW",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
                $this->tpl->setVariable("SELECT_ALL",$this->lng->txt('select_all'));
                $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.gif'));
                $this->tpl->setVariable("BTN_SAVE",$this->lng->txt('save'));

        }

Here is the call graph for this function:

ilEventAdministrationGUI::printViewMembers (  ) 

Definition at line 122 of file class.ilEventAdministrationGUI.php.

References $_GET, $ilErr, $tpl, ilCourseParticipants::_getInstanceByObjId(), ilObjUser::_lookupLogin(), ilObjUser::_lookupName(), ilUtil::_sortIds(), exit, ilFormat::formatUnixTime(), and ilUtil::getStyleSheetLocation().

        {
                include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
                include_once 'Modules/Course/classes/Event/class.ilEvent.php';
                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';


                global $ilErr,$ilAccess;

                if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
                {
                        $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->MESSAGE);
                }
                $members_obj = ilCourseParticipants::_getInstanceByObjId($this->course_obj->getId());
                $event_obj = new ilEvent((int) $_GET['event_id']);
                $event_app =& $event_obj->getFirstAppointment();
                $event_part = new ilEventParticipants((int) $_GET['event_id']);
                

                $this->tpl = new ilTemplate('tpl.main.html',true,true);
                // load style sheet depending on user's settings
                $location_stylesheet = ilUtil::getStyleSheetLocation();
                $this->tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);

                $tpl = new ilTemplate('tpl.event_members_print.html',true,true,'Modules/Course');

                $tpl->setVariable("EVENT",$this->lng->txt('event'));
                $tpl->setVariable("EVENT_NAME",$event_obj->getTitle());
                $tpl->setVariable("DATE",ilFormat::formatUnixTime($event_app->getStartingTime(),false)." ".
                                                  $event_app->formatTime());
                $tpl->setVariable("TXT_NAME",$this->lng->txt('name'));
                $tpl->setVariable("TXT_MARK",$this->lng->txt('trac_mark'));
                $tpl->setVariable("TXT_COMMENT",$this->lng->txt('trac_comment'));
                $tpl->setVariable("TXT_PARTICIPATED",$this->lng->txt('event_tbl_participated'));
                if($event_obj->enabledRegistration())
                {
                        $tpl->setVariable("TXT_REGISTERED",$this->lng->txt('event_tbl_registered'));
                }

                $members = $members_obj->getParticipants();
                $members = ilUtil::_sortIds($members,'usr_data','lastname','usr_id');
                foreach($members as $user_id)
                {
                        
                        $user_data = $event_part->getUser($user_id);

                        if($event_obj->enabledRegistration())
                        {
                                $tpl->setCurrentBlock("reg_col");
                                $tpl->setVariable("REGISTERED",$event_part->isRegistered($user_id) ? "X" : "");
                                $tpl->parseCurrentBlock();
                        }
                        $tpl->setVariable("COMMENT",$user_data['comment']);

                        $tpl->setCurrentBlock("member_row");
                        $name = ilObjUser::_lookupName($user_id);
                        $tpl->setVariable("LASTNAME",$name['lastname']);
                        $tpl->setVariable("FIRSTNAME",$name['firstname']);
                        $tpl->setVariable("LOGIN",ilObjUser::_lookupLogin($user_id));
                        $tpl->setVariable("MARK",$user_data['mark']);
                        $tpl->setVariable("PARTICIPATED",$event_part->hasParticipated($user_id) ? "X" : "");
                        $tpl->parseCurrentBlock();
                }

                $this->tpl->setVariable("CONTENT",$tpl->get());
                $this->tpl->setVariable("BODY_ATTRIBUTES",'onload="window.print()"');
                $this->tpl->show();
                exit;
        }

Here is the call graph for this function:

ilEventAdministrationGUI::register (  ) 

Definition at line 100 of file class.ilEventAdministrationGUI.php.

References $_GET, ilEventParticipants::_register(), and ilUtil::sendInfo().

        {
                global $ilUser;

                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';
                ilEventParticipants::_register($ilUser->getId(),(int) $_GET['event_id']);

                ilUtil::sendInfo($this->lng->txt('event_registered'),true);
                $this->ctrl->returnToParent($this);
        }

Here is the call graph for this function:

ilEventAdministrationGUI::saveMaterials (  ) 

Definition at line 486 of file class.ilEventAdministrationGUI.php.

References ilUtil::sendInfo().

        {
                include_once 'Modules/Course/classes/Event/class.ilEventItems.php';
                
                $this->event_items = new ilEventItems($this->event_id);
                $this->event_items->setItems(is_array($_POST['items']) ? $_POST['items'] : array());
                $this->event_items->update();

                ilUtil::sendInfo($this->lng->txt('settings_saved'),true);
                $this->ctrl->returnToParent($this);
        }

Here is the call graph for this function:

ilEventAdministrationGUI::sendFile (  ) 

Definition at line 588 of file class.ilEventAdministrationGUI.php.

References $_GET, $file, and ilUtil::deliverFile().

        {
                $file = new ilEventFile((int) $_GET['file_id']);
                
                ilUtil::deliverFile($file->getAbsolutePath(),$file->getFileName(),$file->getFileType());
                return true;
        }

Here is the call graph for this function:

ilEventAdministrationGUI::setLocator (  )  [private]

Append Session to locator.

private

Reimplemented from ilObjectGUI.

Definition at line 1379 of file class.ilEventAdministrationGUI.php.

        {
                global $ilLocator;
                
                #$ilLocator->addItem($this->event_obj->getTitle(),$this->ctrl->getLinkTarget($this,'info'));
        }

ilEventAdministrationGUI::setTabs (  )  [private]

Set tabs.

private

Parameters:
 

Reimplemented from ilObjectGUI.

Definition at line 1393 of file class.ilEventAdministrationGUI.php.

References getTabs().

Referenced by confirmDeleteFiles(), edit(), editMembers(), info(), and materials().

        {
                global $ilTabs;

                $this->tabs_gui->clearSubTabs();
                $this->tabs_gui->clearTargets();
                $this->getTabs($this->tabs_gui);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilEventAdministrationGUI::unregister (  ) 

Definition at line 111 of file class.ilEventAdministrationGUI.php.

References $_GET, ilEventParticipants::_unregister(), and ilUtil::sendInfo().

        {
                global $ilUser;

                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';
                ilEventParticipants::_unregister($ilUser->getId(),(int) $_GET['event_id']);

                ilUtil::sendInfo($this->lng->txt('event_unregistered'),true);
                $this->ctrl->returnToParent($this);
        }

Here is the call graph for this function:

ilEventAdministrationGUI::update (  ) 

Definition at line 919 of file class.ilEventAdministrationGUI.php.

References $ilErr, __load(), edit(), initForm(), and ilUtil::sendInfo().

        {
                global $ilErr;

                $this->__load();
                $this->initForm('edit');
                
                $ilErr->setMessage('');
                if(!$this->form->checkInput())
                {
                        $ilErr->setMessage($this->lng->txt('err_check_input'));
                }
                $this->event_obj->validate();
                $this->appointment_obj->validate();

                if(strlen($ilErr->getMessage()))
                {
                        ilUtil::sendInfo($ilErr->getMessage());
                        $this->edit();
                        return false;
                }
                // Update event
                $this->event_obj->update();

                // create appointment
                $this->appointment_obj->update();

                foreach($this->files as $file_obj)
                {
                        $file_obj->setEventId($this->event_obj->getEventId());
                        $file_obj->create();
                }

                ilUtil::sendInfo($this->lng->txt('event_updated'));
                $this->edit();
                return true;
        }

Here is the call graph for this function:

ilEventAdministrationGUI::updateMembers (  ) 

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

References $_GET, $_SESSION, $user, ilCourseParticipants::_getInstanceByObjId(), ilEventParticipants::_isRegistered(), ilUtil::_sortIds(), editMembers(), ilUtil::sendInfo(), and ilUtil::stripSlashes().

        {
                include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
                include_once 'Modules/Course/classes/Event/class.ilEvent.php';
                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';

                $_POST['participants'] = is_array($_POST['participants']) ? $_POST['participants'] : array();

                $members_obj = ilCourseParticipants::_getInstanceByObjId($this->course_obj->getId());
                
                $event_part = new ilEventParticipants((int) $_GET['event_id']);

                $members = $members_obj->getParticipants();
                $members = ilUtil::_sortIds($members,'usr_data','lastname','usr_id');
                $sliced_users = array_slice($members,$_GET['offset'],$_SESSION['tbl_limit']);

                foreach($sliced_users as $user)
                {
                        $part = new ilEventParticipants((int) $_GET['event_id']);
                        $part->setUserId($user);
                        $part->setMark(ilUtil::stripSlashes($_POST['mark'][$user]));
                        $part->setComment(ilUtil::stripSlashes($_POST['comment'][$user]));
                        $part->setParticipated(in_array($user,$_POST['participants']));
                        $part->setRegistered(ilEventParticipants::_isRegistered($user,(int) $_GET['event_id']));
                        $part->updateUser();
                }
                ilUtil::sendInfo($this->lng->txt('settings_saved'));
                $this->editMembers();
        }

Here is the call graph for this function:

ilEventAdministrationGUI::updateUser (  ) 

Definition at line 406 of file class.ilEventAdministrationGUI.php.

References $_GET, editMembers(), ilUtil::sendInfo(), and ilUtil::stripSlashes().

        {
                include_once 'Modules/Course/classes/Event/class.ilEventParticipants.php';
                $part_obj = new ilEventParticipants((int) $_GET['event_id']);
                
                $part_obj->setUserId((int) $_GET['user_id']);
                $part_obj->setMark(ilUtil::stripSlashes($_POST['mark']));
                $part_obj->setComment(ilUtil::stripSlashes($_POST['comment']));
                $part_obj->setRegistered($_POST['registration']);
                $part_obj->setParticipated($_POST['participance']);
                $part_obj->updateUser((int) $_GET['user_id']);

                ilUtil::sendInfo($this->lng->txt('settings_saved'));
                $this->editMembers();
        }

Here is the call graph for this function:


Field Documentation

ilEventAdministrationGUI::$container_gui

Definition at line 39 of file class.ilEventAdministrationGUI.php.

ilEventAdministrationGUI::$container_obj

Definition at line 40 of file class.ilEventAdministrationGUI.php.

ilEventAdministrationGUI::$course_obj

Definition at line 41 of file class.ilEventAdministrationGUI.php.

ilEventAdministrationGUI::$ctrl

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

ilEventAdministrationGUI::$event_id = null
ilEventAdministrationGUI::$lng

Reimplemented from ilObjectGUI.

Definition at line 47 of file class.ilEventAdministrationGUI.php.

Referenced by ilEventAdministrationGUI().

ilEventAdministrationGUI::$tabs_gui

Definition at line 48 of file class.ilEventAdministrationGUI.php.

Referenced by getTabs().

ilEventAdministrationGUI::$tpl

Reimplemented from ilObjectGUI.

Definition at line 45 of file class.ilEventAdministrationGUI.php.

Referenced by ilEventAdministrationGUI(), info(), and printViewMembers().


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