ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilGroupParticipantsTableGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once('./Services/Table/classes/class.ilTable2GUI.php');
25 
35 {
36  protected $type = 'admin';
37  protected $show_learning_progress = false;
38 
46  public function __construct($a_parent_obj,$a_type = 'admin',$show_content = true,$show_learning_progress = false)
47  {
48  global $lng,$ilCtrl;
49 
50  $this->show_learning_progress = $show_learning_progress;
51 
52  $this->lng = $lng;
53  $this->lng->loadLanguageModule('grp');
54  $this->lng->loadLanguageModule('trac');
55  $this->ctrl = $ilCtrl;
56 
57  $this->type = $a_type;
58 
59  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
60  $this->privacy = ilPrivacySettings::_getInstance();
61 
62  parent::__construct($a_parent_obj,'members');
63 
64  $this->setFormName('participants');
65 
66  $this->addColumn('','f',"1");
67  $this->addColumn($this->lng->txt('name'),'lastname','20%');
68  $this->addColumn($this->lng->txt('login'),'login','25%');
69 
70  if($this->show_learning_progress)
71  {
72  $this->addColumn($this->lng->txt('learning_progress'),'progress');
73  }
74 
75  if($this->privacy->enabledGroupAccessTimes())
76  {
77  $this->addColumn($this->lng->txt('last_access'),'access_time_unix');
78  }
79  if($this->type == 'admin')
80  {
81  $this->setPrefix('admin');
82  $this->setSelectAllCheckbox('admins');
83  $this->addColumn($this->lng->txt('grp_notification'),'notification');
84  $this->addCommandButton('updateStatus',$this->lng->txt('save'));
85  }
86  else
87  {
88  $this->setPrefix('member');
89  $this->setSelectAllCheckbox('members');
90  }
91  $this->addColumn($this->lng->txt(''),'optional');
92 
93  $this->setRowTemplate("tpl.show_participants_row.html","Modules/Group");
94 
95  if($show_content)
96  {
97  $this->enable('sort');
98  $this->enable('header');
99  $this->enable('numinfo');
100  $this->enable('select_all');
101  }
102  else
103  {
104  $this->disable('content');
105  $this->disable('header');
106  $this->disable('footer');
107  $this->disable('numinfo');
108  $this->disable('select_all');
109  }
110  }
111 
119  public function fillRow($a_set)
120  {
121  global $ilUser,$ilAccess;
122 
123  $this->tpl->setVariable('VAL_ID',$a_set['usr_id']);
124  $this->tpl->setVariable('VAL_NAME',$a_set['lastname'].', '.$a_set['firstname']);
125  if(!$ilAccess->checkAccessOfUser($a_set['usr_id'],'read','',$this->getParentObject()->object->getRefId()) and
126  is_array($info = $ilAccess->getInfo()))
127  {
128  $this->tpl->setVariable('PARENT_ACCESS',$info[0]['text']);
129  }
130 
131 
132  if($this->privacy->enabledGroupAccessTimes())
133  {
134  $this->tpl->setVariable('VAL_ACCESS',$a_set['access_time']);
135  }
136 
137  if($this->show_learning_progress)
138  {
139  $this->tpl->setCurrentBlock('lp');
140  switch($a_set['progress'])
141  {
142  case LP_STATUS_COMPLETED:
143  $this->tpl->setVariable('LP_STATUS_ALT',$this->lng->txt($a_set['progress']));
144  $this->tpl->setVariable('LP_STATUS_PATH',ilUtil::getImagePath('scorm/complete.gif'));
145  break;
146 
148  $this->tpl->setVariable('LP_STATUS_ALT',$this->lng->txt($a_set['progress']));
149  $this->tpl->setVariable('LP_STATUS_PATH',ilUtil::getImagePath('scorm/incomplete.gif'));
150  break;
151 
153  $this->tpl->setVariable('LP_STATUS_ALT',$this->lng->txt($a_set['progress']));
154  $this->tpl->setVariable('LP_STATUS_PATH',ilUtil::getImagePath('scorm/not_attempted.gif'));
155  break;
156 
157  case LP_STATUS_FAILED:
158  $this->tpl->setVariable('LP_STATUS_ALT',$this->lng->txt($a_set['progress']));
159  $this->tpl->setVariable('LP_STATUS_PATH',ilUtil::getImagePath('scorm/failed.gif'));
160  break;
161 
162  }
163  $this->tpl->parseCurrentBlock();
164  }
165 
166 
167  if($this->type == 'admin')
168  {
169  $this->tpl->setVariable('VAL_POSTNAME','admins');
170  $this->tpl->setVariable('VAL_NOTIFICATION_ID',$a_set['usr_id']);
171  $this->tpl->setVariable('VAL_NOTIFICATION_CHECKED',$a_set['notification'] ? 'checked="checked"' : '');
172  }
173  else
174  {
175  $this->tpl->setVariable('VAL_POSTNAME','members');
176  }
177 
178  $this->ctrl->setParameter($this->parent_obj,'member_id',$a_set['usr_id']);
179  $this->tpl->setVariable('LINK_NAME',$this->ctrl->getLinkTarget($this->parent_obj,'editMember'));
180  $this->tpl->setVariable('LINK_TXT',$this->lng->txt('edit'));
181  $this->ctrl->clearParameters($this->parent_obj);
182 
183  $this->tpl->setVariable('VAL_LOGIN',$a_set['login']);
184 
185 
186  }
187 
188 }
189 ?>