ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMailSearchCoursesMembersTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 include_once('Services/Table/classes/class.ilTable2GUI.php');
13 
14 
16 {
17  protected $lng = null;
18  protected $ctrl;
19  protected $parentObject;
20  protected $mode;
21  protected $mailing_allowed;
31  public function __construct($a_parent_obj, $type = 'crs', $context = 'mail')
32  {
33  global $lng,$ilCtrl, $ilUser, $lng, $rbacsystem;
34 
35  $this->context = $context;
36  if($this->context == "mail")
37  {
38  // check if current user may send mails
39  include_once "Services/Mail/classes/class.ilMail.php";
40  $mail = new ilMail($_SESSION["AccountId"]);
41  $this->mailing_allowed = $rbacsystem->checkAccess('internal_mail',$mail->getMailObjectReferenceId());
42  }
43 
44  parent::__construct($a_parent_obj, 'showMembers');
45  $lng->loadLanguageModule('crs');
46  $this->parentObject = $a_parent_obj;
47  $mode = array();
48  if ($type == 'crs')
49  {
50  $mode["checkbox"] = 'search_crs';
51  $mode["short"] = 'crs';
52  $mode["long"] = 'course';
53  $mode["lng_type"] = $lng->txt('course');
54  $mode["view"] = "crs_members";
55  $mode["tableprefix"] = "crstable_members";
56  }
57  else if ($type == 'grp')
58  {
59  $mode["checkbox"] = 'search_grp';
60  $mode["short"] = 'grp';
61  $mode["long"] = 'group';
62  $mode["lng_type"] = $lng->txt('group');
63  $mode["view"] = "grp_members";
64  $mode["tableprefix"] = "grptable_members";
65  }
66  $this->setTitle($lng->txt('members'));
67  $this->mode = $mode;
68  $ilCtrl->setParameter($a_parent_obj, 'view', $mode['view']);
69  if ($_GET['ref'] != '')
70  $ilCtrl->setParameter($a_parent_obj, 'ref', $_GET['ref']);
71  if (is_array($_POST[$mode["checkbox"]]))
72  $ilCtrl->setParameter($a_parent_obj, $mode["checkbox"], implode(',', $_POST[$mode["checkbox"]]));
73 
74  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
75  $ilCtrl->clearParameters($a_parent_obj);
76 
77  $this->setPrefix($mode['tableprefix']);
78  $this->setSelectAllCheckbox('search_members[]');
79  $this->setRowTemplate('tpl.mail_search_courses_members_row.html', 'Services/Contact');
80 
81  // setup columns
82  $this->addColumn('', '', '1%', true);
83  $this->addColumn($lng->txt('login'), 'members_login', '22%');
84  $this->addColumn($lng->txt('name'), 'members_name', '22%');
85  $this->addColumn($lng->txt($mode['long']), 'members_crs_grp', '22%');
86  $this->addColumn($lng->txt('mail_in_addressbook'), 'members_in_addressbook', '23%');
87  $this->addColumn($lng->txt('actions'), '', '10%');
88 
89  if($this->context == "mail")
90  {
91  if ($this->mailing_allowed)
92  $this->addMultiCommand('mail', $lng->txt('mail_members'));
93  $this->addMultiCommand('adoptMembers', $lng->txt("mail_into_addressbook"));
94  }
95  else
96  {
97  $lng->loadLanguageModule("wsp");
98  $this->addMultiCommand('share', $lng->txt("wsp_share_with_members"));
99  }
100 
101  $this->addCommandButton('cancel', $lng->txt('cancel'));
102  }
103 
111  public function fillRow($a_set)
112  {
113  global $ilCtrl;
114  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
115  $current_selection_list = new ilAdvancedSelectionListGUI();
116  $current_selection_list->setListTitle($this->lng->txt("actions"));
117  $current_selection_list->setId("act_".md5($a_set['members_id'].'::'.$a_set['search_' . $this->mode['short']]));
118 
119  $ilCtrl->setParameter($this->parentObject, 'search_members', $a_set['members_id']);
120  $ilCtrl->setParameter($this->parentObject, 'search_' . $this->mode['short'],
121  is_array($_REQUEST['search_' . $this->mode['short']]) ?
122  implode(',', array_filter(array_map('intval', $_REQUEST['search_' . $this->mode['short']]))) :
123  (int)$_REQUEST['search_' . $this->mode['short']]
124  );
125  $ilCtrl->setParameter($this->parentObject, 'view', $this->mode['view']);
126 
127  if($this->context == "mail")
128  {
129  if ($this->mailing_allowed)
130  $current_selection_list->addItem($this->lng->txt("mail_member"), '', $ilCtrl->getLinkTarget($this->parentObject, "mail"));
131  $current_selection_list->addItem($this->lng->txt("mail_into_addressbook"), '', $ilCtrl->getLinkTarget($this->parentObject, "adoptMembers"));
132  }
133  else
134  {
135  $current_selection_list->addItem($this->lng->txt("wsp_share_with_members"), '', $ilCtrl->getLinkTarget($this->parentObject, "share"));
136  }
137 
138  $this->tpl->setVariable(strtoupper('CURRENT_ACTION_LIST'), $current_selection_list->getHTML());
139 
140  foreach ($a_set as $key => $value)
141  {
142  $this->tpl->setVariable(strtoupper($key), $value);
143  }
144  }
145 }
146 ?>
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
$_POST['username']
Definition: cron.php:12
__construct($a_parent_obj, $type='crs', $context='mail')
Constructor.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
Class Mail this class handles base functions for mail handling.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setPrefix($a_prefix)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.