44                $this->parent_gui = $a_parent_gui;
 
   45                $this->parent_obj = $a_parent_obj;
 
   46                $this->participants = $a_participants_object;
 
   47                $this->waiting_list = $a_waiting_list;
 
   50                $this->presets[
'name'] = array(
$lng->txt(
'name'), 
true);
 
   51                $this->presets[
'login'] = array(
$lng->txt(
'login'), 
true);
 
   56                $lng->loadLanguageModule(
'crs');
 
   59                $roles = $this->participants->getRoles();
 
   60                foreach(
$roles as $role_id)
 
   63                        switch(substr(
$title, 0, 8))
 
   67                                        $this->
addRole($role_id, 
$lng->txt(
'event_tbl_admin'), 
'admin');
 
   71                                        $this->
addRole($role_id, 
$lng->txt(
'event_tbl_tutor'), 
'tutor');
 
   76                                        $this->
addRole($role_id, 
$lng->txt(
'event_tbl_member'), 
'member');
 
   81                                        $this->has_local_role = 
true;
 
   94                include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
 
   95                include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
 
   96                include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
 
   97                include_once(
'Services/User/classes/class.ilUserDefinedFields.php');
 
  100                $field_info->sortExportFields();
 
  102                foreach($field_info->getExportableFields() as $field)
 
  114                        $this->presets[$field] = array(
 
  122                foreach($udf->getExportableFields($this->parent_obj->getId()) as $field_id => $udf_data)
 
  124                        $this->presets[
'udf_'.$field_id] = array(
 
  125                                $udf_data[
'field_name'],
 
  131                include_once 
'./Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
 
  134                        $this->presets[
'cdf_'.$field_obj->getId()] = array(
 
  135                                $field_obj->getName(),
 
  149        function addPreset($a_id, $a_caption, $a_selected = 
false)
 
  151                $this->presets[$a_id] = array($a_caption, $a_selected);
 
  161                $this->pre_blanks[] = $a_caption;
 
  172                $this->title = $a_title;
 
  173                $this->description = $a_description;
 
  185                $this->role_data[$a_id] = array($a_caption, 
$a_type);
 
  195                $this->roles = $a_role_ids;
 
  207                $this->user_filters[$a_id] = array($a_caption, $a_checked);
 
  219                $subscriber_ids = $this->participants->getSubscribers();
 
  221                $user_ids = $subscriber_ids;            
 
  223                if($this->waiting_list)
 
  225                        $user_ids = array_merge($user_ids, $this->waiting_list->getUserIds());
 
  230                foreach($profile_data as $user_id => $fields)
 
  232                        foreach((array) $fields as $field => $value)
 
  234                                $a_res[$user_id][$field] = $value;
 
  238                include_once 
'./Services/User/classes/class.ilUserDefinedFields.php';
 
  241                foreach($udf->getExportableFields($this->parent_obj->getId()) as $field_id => $udf_data)
 
  243                        foreach($profile_data as $user_id => $field)
 
  245                                include_once 
'./Services/User/classes/class.ilUserDefinedData.php';
 
  247                                $a_res[$user_id][
'udf_'.$field_id] = (string) $udf_data->get(
'f_'.$field_id);
 
  251                if(
sizeof($user_ids))
 
  254                        include_once 
'Modules/Course/classes/Export/class.ilCourseUserData.php';
 
  257                        foreach(array_unique($user_ids) as $user_id)
 
  261                                        $a_res[$user_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();               
 
  262                                        $a_res[$user_id][
'email'] = $tmp_obj->getEmail();               
 
  264                                        if(in_array($user_id, $subscriber_ids))
 
  266                                                $a_res[$user_id][
'status'] = 
$lng->txt(
'crs_subscriber'); 
 
  270                                                $a_res[$user_id][
'status'] = 
$lng->txt(
'crs_waiting_list'); 
 
  273                                        foreach((array) $cdfs[$user_id] as $field_id => $value)
 
  275                                                $a_res[$user_id][
'cdf_'.$field_id] = (string) $value;
 
  289                if(!implode(
"", $a_values))
 
  295                        foreach($a_values as $idx => $value)
 
  297                                $a_values[$idx] = trim($value);
 
  298                                if($a_values[$idx] == 
"")
 
  300                                        unset($a_values[$idx]);
 
  304                $this->blank_columns = $a_values;
 
  314                $this->callback = $a_callback;
 
  324                $this->
id = (string)$a_value;
 
  337                $lng->loadLanguageModule(
'crs');
 
  339                include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');            
 
  341                $form->setFormAction(
$ilCtrl->getFormAction($this->parent_gui,$a_cmd));
 
  342                $form->setTarget(
'_blank');
 
  343                $form->setPreventDoubleSubmission(
false);
 
  344                $form->setTitle(
$lng->txt(
'sess_gen_attendance_list'));
 
  347                $title->setValue($this->title);
 
  351                $desc->setValue($this->description);
 
  352                $form->addItem($desc);
 
  354                if(
sizeof($this->presets))
 
  357                        $preset_value = array();
 
  358                        foreach($this->presets as 
$id => $item)
 
  363                                        $preset_value[] = 
$id;
 
  366                        $preset->setValue($preset_value);
 
  367                        $form->addItem($preset);
 
  371                $blank->setMulti(
true);         
 
  372                $form->addItem($blank);                 
 
  374                if($this->pre_blanks)
 
  376                        $blank->setValue($this->pre_blanks);
 
  384                foreach($this->role_data as $role_id => 
$role_data)
 
  388                        $role_name = $role_id;
 
  389                        if(substr(
$title, 0, 10) == 
'il_'.$this->parent_obj->getType().
'_adm')
 
  393                        if(substr(
$title, 0, 10) == 
'il_'.$this->parent_obj->getType().
'_mem')
 
  397                        if(substr(
$title, 0, 10) == 
'il_'.$this->parent_obj->getType().
'_tut')
 
  403                        $checked[] = 
'role_'.$role_name;
 
  404                        $chk_grp->addOption($chk);
 
  407                if($this->waiting_list)
 
  410                        $chk_grp->addOption($chk);
 
  413                        $chk_grp->addOption($chk);
 
  416                if($this->user_filters)
 
  418                        foreach($this->user_filters as $sub_id => $sub_item)
 
  424                                        $checked[] = 
'members_'.$sub_id;
 
  426                                $chk_grp->addOption($chk);
 
  429                $chk_grp->setValue($checked);
 
  430                $form->addItem($chk_grp);
 
  432                $form->addCommandButton($a_cmd,
$lng->txt(
'sess_print_attendance_list'));
 
  434                if($this->
id && $a_cmd)
 
  436                        include_once 
"Services/User/classes/class.ilUserFormSettings.php";
 
  438                        if(!$settings->hasStoredEntry())
 
  443                        $settings->deleteValue(
'desc'); 
 
  444                        $settings->exportToForm($form);
 
  456                if($form->checkInput())
 
  458                        foreach(array_keys($this->presets) as 
$id)
 
  460                                $this->presets[
$id][1] = 
false;
 
  462                        foreach($form->getInput(
'preset') as $value)
 
  464                                if(isset($this->presets[$value]))
 
  466                                        $this->presets[$value][1] = 
true;
 
  474                        $this->
setTitle($form->getInput(
'title'), $form->getInput(
'desc'));
 
  477                        $selection_of_users = (array)$form->getInput(
'selection_of_users'); 
 
  480                        foreach(array_keys($this->role_data) as $role_id)
 
  483                                $role_name = $role_id;
 
  484                                if(substr(
$title, 0, 10) == 
'il_'.$this->parent_obj->getType().
'_adm')
 
  488                                if(substr(
$title, 0, 10) == 
'il_'.$this->parent_obj->getType().
'_mem')
 
  492                                if(substr(
$title, 0, 10) == 
'il_'.$this->parent_obj->getType().
'_tut')
 
  498                                if(in_array(
'role_'.$role_name, (array) $selection_of_users))
 
  506                        if($this->waiting_list)
 
  508                                $this->include_subscribers = (bool)in_array(
'subscr', $selection_of_users);
 
  509                                $this->include_waiting_list = (bool)in_array(
'wlist', $selection_of_users);
 
  512                        if($this->user_filters)
 
  514                                foreach(array_keys($this->user_filters) as $msub_id)
 
  516                                        $this->user_filters[$msub_id][2] = (bool)in_array(
"members_".$msub_id, $selection_of_users);
 
  522                                $form->setValuesByPost();
 
  524                                include_once 
"Services/User/classes/class.ilUserFormSettings.php";
 
  526                                $settings->deleteValue(
'desc'); 
 
  527                                $settings->importFromForm($form);
 
  542                $tpl->setBodyClass(
"ilBodyPrint");
 
  546                $tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
 
  548                $tpl->setVariable(
"BODY_ATTRIBUTES",
'onload="window.print()"');
 
  561                $tpl = 
new ilTemplate(
'tpl.attendance_list_print.html',
true,
true,
'Services/Membership');
 
  569                $tpl->setVariable(
'TXT_TITLE', $this->title);
 
  570                if($this->description)
 
  572                        $tpl->setVariable(
'TXT_DESCRIPTION', $this->description.
" (".$time.
")");
 
  576                        $tpl->setVariable(
'TXT_DESCRIPTION', $time);
 
  582                $tpl->setCurrentBlock(
'head_item');
 
  583                foreach($this->presets as 
$id => $item)
 
  587                                $tpl->setVariable(
'TXT_HEAD', $item[0]);
 
  588                                $tpl->parseCurrentBlock();
 
  592                if($this->blank_columns)
 
  594                        foreach($this->blank_columns as $blank)
 
  596                                $tpl->setVariable(
'TXT_HEAD', $blank);
 
  597                                $tpl->parseCurrentBlock();                              
 
  604                $valid_user_ids = $filters = array();
 
  608                        if($this->has_local_role)
 
  611                                foreach($this->participants->getMembers() as $member_id)
 
  613                                        foreach($this->participants->getAssignedRoles($member_id) as $role_id)
 
  615                                                $members[$role_id][] = $member_id;
 
  621                                $members = $this->participants->getMembers();
 
  624                        foreach($this->roles as $role_id)
 
  626                                switch($this->role_data[$role_id][1])
 
  629                                                $valid_user_ids = array_merge($valid_user_ids, $this->participants->getAdmins());
 
  633                                                $valid_user_ids = array_merge($valid_user_ids, $this->participants->getTutors());
 
  638                                                if(!$this->has_local_role)
 
  640                                                        $valid_user_ids = array_merge($valid_user_ids, (array)$members);
 
  644                                                        $valid_user_ids = array_merge($valid_user_ids, (array)$members[$role_id]);
 
  651                if($this->include_subscribers)
 
  653                        $valid_user_ids = array_merge($valid_user_ids, $this->participants->getSubscribers());                  
 
  656                if($this->include_waiting_list)
 
  658                        $valid_user_ids = array_merge($valid_user_ids, $this->waiting_list->getUserIds());                      
 
  661                if($this->user_filters)
 
  663                        foreach($this->user_filters as $sub_id => $sub_item)
 
  665                                $filters[$sub_id] = (bool)$sub_item[2];
 
  669                $valid_user_ids = 
ilUtil::_sortIds(array_unique($valid_user_ids),
'usr_data',
'lastname',
'usr_id');                                               
 
  674                foreach($valid_user_ids as $user_id)
 
  678                                $user_data = call_user_func_array($this->callback, array($user_id, $filters));  
 
  684                                $tpl->setCurrentBlock(
"row_preset");
 
  685                                foreach($this->presets as 
$id => $item)
 
  695                                                                        $value = $name[
"lastname"].
", ".$name[
"firstname"];
 
  708                                                                $value = (string) $user_data[
$id];
 
  711                                                $tpl->setVariable(
"TXT_PRESET", (
string) $value);
 
  712                                                $tpl->parseCurrentBlock();
 
  717                        if($this->blank_columns)
 
  721                                        $tpl->touchBlock(
'row_blank');
 
  725                        $tpl->touchBlock(
"member_row");
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Base class for attendance lists.
setCallback($a_callback)
Set participant detail callback.
getHTML()
render attendance list
initForm($a_cmd="")
Init form.
addRole($a_id, $a_caption, $a_type)
Add role.
addPreset($a_id, $a_caption, $a_selected=false)
Add user field.
setRoleSelection($a_role_ids)
Set role selection.
addBlank($a_caption)
Add blank column preset.
__construct($a_parent_gui, $a_parent_obj, ilParticipants $a_participants_object=null, ilWaitingList $a_waiting_list=null)
Constructor.
setTitle($a_title, $a_description=null)
Set titles.
getFullscreenHTML()
render list in fullscreen mode
getNonMemberUserData(array &$a_res)
Get user data for subscribers and waiting list.
readOrderedExportableFields()
read object export fields
addUserFilter($a_id, $a_caption, $a_checked=false)
Add user filter.
setBlankColumns(array $a_values)
Add blank columns.
setId($a_value)
Set id (used for user form settings)
initFromForm()
Set list attributes from post values.
This class represents an option in a checkbox group.
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static _getInstanceByType($a_type)
Get Singleton Instance.
static getLogger($a_component_id)
Get component logger.
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupTitle($a_id)
lookup object title
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static _getInstance()
Get instance.
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
Base class for course and group waiting lists.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.