ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilParticipantsTableGUI.php
Go to the documentation of this file.
1<?php
2
3include_once('./Services/Table/classes/class.ilTable2GUI.php');
4
5/*
6 * Abstract base class for course, group participants table guis
7 * @author Stefan Meyer <smeyer.ilias@gmx.de
8 */
9abstract class ilParticipantTableGUI extends ilTable2GUI
10{
11 protected static $export_allowed = false;
12 protected static $confirmation_required = true;
13 protected static $accepted_ids = null;
14 protected static $all_columns = null;
15 protected static $has_odf_definitions = false;
16
21 public function getSelectableColumns()
22 {
23 global $ilSetting;
24
25 $GLOBALS['lng']->loadLanguageModule('ps');
26 if(self::$all_columns)
27 {
28 # return self::$all_columns;
29 }
30
31 include_once './Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
32 $ef = ilExportFieldsInfo::_getInstanceByType($this->getParentObject()->object->getType());
33 self::$all_columns = $ef->getSelectableFieldsInfo($this->getParentObject()->object->getId());
34
35 if ($this->type == 'member' &&
36 $ilSetting->get('user_portfolios'))
37 {
38 self::$all_columns['prtf'] = array(
39 'txt' => $this->lng->txt('obj_prtf'),
40 'default' => false
41 );
42 }
43
44 return self::$all_columns;
45 }
46
52 public function checkAcceptance($a_usr_id)
53 {
54 if(!self::$confirmation_required)
55 {
56 return true;
57 }
58 if(!self::$export_allowed)
59 {
60 return false;
61 }
62 return in_array($a_usr_id,self::$accepted_ids);
63 }
64
69 protected function initSettings()
70 {
71 if(self::$accepted_ids !== NULL)
72 {
73 return true;
74 }
75 self::$export_allowed = ilPrivacySettings::_getInstance()->checkExportAccess($this->getParentObject()->object->getRefId());
76
77 self::$confirmation_required = ($this->getParentObject()->object->getType() == 'crs')
78 ? ilPrivacySettings::_getInstance()->courseConfirmationRequired()
79 : ilPrivacySettings::_getInstance()->groupConfirmationRequired();
80
81 include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
82 self::$accepted_ids = ilMemberAgreement::lookupAcceptedAgreements($this->getParentObject()->object->getId());
83
84 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
85 self::$has_odf_definitions = ilCourseDefinedFieldDefinition::_hasFields($this->getParentObject()->object->getId());
86 }
87
93 protected function showActionLinks($a_set)
94 {
95 if(!$this->show_edit_link)
96 {
97 return true;
98 }
99
100 $loc_enabled = (
101 $this->getParentObject()->object->getType() == 'crs' and
102 $this->getParentObject()->object->getViewMode() == IL_CRS_VIEW_OBJECTIVE
103 );
104
105 if(!self::$has_odf_definitions and !$loc_enabled)
106 {
107 $this->ctrl->setParameter($this->parent_obj, 'member_id', $a_set['usr_id']);
108 $this->tpl->setCurrentBlock('link');
109 $this->tpl->setVariable('LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj, 'editMember'));
110 $this->tpl->setVariable('LINK_TXT', $this->lng->txt('edit'));
111 $this->tpl->parseCurrentBlock();
112 return true;
113 }
114
115 // show action menu
116 include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
117 $list = new ilAdvancedSelectionListGUI();
118 $list->setSelectionHeaderClass('small');
119 $list->setItemLinkClass('small');
120 $list->setId('actl_'.$a_set['usr_id'].'_'.$this->getId());
121 $list->setListTitle($this->lng->txt('actions'));
122
123 $this->ctrl->setParameter($this->parent_obj, 'member_id', $a_set['usr_id']);
124 $list->addItem($this->lng->txt('edit'), '', $this->ctrl->getLinkTarget($this->getParentObject(),'editMember'));
125
126 if(self::$has_odf_definitions)
127 {
128 $this->ctrl->setParameterByClass('ilobjectcustomuserfieldsgui','member_id',$a_set['usr_id']);
129 $trans = $this->lng->txt($this->getParentObject()->object->getType().'_cdf_edit_member');
130 $list->addItem($trans, '', $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui','editMember'));
131 }
132
133 if($loc_enabled)
134 {
135 $this->ctrl->setParameterByClass('illomembertestresultgui','uid', $a_set['usr_id']);
136 $list->addItem(
137 $this->lng->txt('crs_loc_mem_show_res'),
138 '',
139 $this->ctrl->getLinkTargetByClass('illomembertestresultgui','')
140 );
141 }
142
143 $this->tpl->setVariable('ACTION_USER',$list->getHTML());
144
145 }
146
147}
148?>
const IL_CRS_VIEW_OBJECTIVE
User interface class for advanced drop-down selection lists.
static _hasFields($a_container_id)
Check if there are any define fields.
static _getInstanceByType($a_type)
Get Singleton Instance.
static lookupAcceptedAgreements($a_obj_id)
Lookup users who have accepted the agreement.
getSelectableColumns()
Get selectable columns.
showActionLinks($a_set)
show edit links
checkAcceptance($a_usr_id)
Check acceptance.
static _getInstance()
Get instance of ilPrivacySettings.
Class ilTable2GUI.
getParentObject()
Get parent object.
getId()
Get element id.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
global $ilSetting
Definition: privfeed.php:40