12 include_once(
'Services/Table/classes/class.ilTable2GUI.php');
13 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
50 public function __construct($a_parent_obj, $a_parent_cmd =
'', $is_mailing_allowed =
false, $is_chat_active =
false)
60 $this->
setId(
'addr_book');
63 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj,
'setAddressbookFilter'));
65 $this->
setTitle($lng->txt(
"mail_addr_entries"));
66 $this->
setRowTemplate(
"tpl.mail_addressbook_row.html",
"Services/Contact");
70 $this->cron_upd_adrbook = $ilSetting->get(
'cron_upd_adrbook', 0);
73 if($this->cron_upd_adrbook != 0)
78 $this->
addColumn(
'',
'addr_id',
'1px',
true);
79 $this->
addColumn($this->lng->txt(
'login'),
'login', $width);
80 $this->
addColumn($this->lng->txt(
'firstname'),
'firstname', $width);
81 $this->
addColumn($this->lng->txt(
'lastname'),
'lastname', $width);
82 $this->
addColumn($this->lng->txt(
'email'),
'email', $width);
84 if($ilSetting->get(
'cron_upd_adrbook', 0) != 0)
86 $this->
addColumn($this->lng->txt(
'auto_update'),
'auto_update', $width);
88 $this->
addColumn($this->lng->txt(
'actions'),
'actions',
'20%');
90 $this->
enable(
'select_all');
94 if($this->mailing_allowed)
100 if($this->chat_active)
102 $this->
addMultiCommand(
'inviteToChat', $this->lng->txt(
'invite_to_chat'));
123 if($this->cron_upd_adrbook != 0)
125 $value = $value == 1 ? $this->lng->txt(
'yes') : $this->lng->txt(
'no');
146 foreach (
$row as $key => $value)
149 $this->ctrl->setParameter($this->parent_obj,
'addr_id',
$row[
'addr_id']);
153 $this->tpl->setVariable(
"VAL_LOGIN_LINKED_LOGIN", $value);
156 if($key ==
"login" && $value !=
"")
158 if($this->mailing_allowed)
160 $this->tpl->setVariable(
"VAL_LOGIN_LINKED_LINK", $this->ctrl->getLinkTarget($this->parent_obj,
'mailToUsers'));
161 $this->tpl->setVariable(
"VAL_LOGIN_LINKED_LOGIN", $value);
165 $this->tpl->setVariable(
"VAL_LOGIN_UNLINKED", $value);
171 if(
$_GET[
"baseClass"] ==
"ilMailGUI" && $this->smtp_mailing_allowed)
173 $this->tpl->setVariable(
"VAL_EMAIL_LINKED_LINK", $this->ctrl->getLinkTarget($this->parent_obj,
'mailToUsers'));
174 $this->tpl->setVariable(
"VAL_EMAIL_LINKED_EMAIL", $value);
178 $this->tpl->setVariable(
"VAL_EMAIL_UNLINKED", $value);
182 if($key ==
'auto_update' && $this->cron_upd_adrbook != 0)
184 $this->tpl->setVariable(
"VAL_CRON_AUTO_UPDATE", $value);
187 $this->tpl->setVariable(
"VAL_".strtoupper($key), $value);
191 $current_selection_list->setListTitle($this->lng->txt(
"actions"));
192 $current_selection_list->setId(
"act_" .
$row[
'addr_id']);
194 $current_selection_list->addItem($this->lng->txt(
"edit"),
'', $this->ctrl->getLinkTarget($this->parent_obj,
"showAddressForm"));
196 if($this->mailing_allowed)
198 $current_selection_list->addItem($this->lng->txt(
"send_mail_to"),
'', $this->ctrl->getLinkTarget($this->parent_obj,
"mailToUsers"));
201 $current_selection_list->addItem($this->lng->txt(
"delete"),
'', $this->ctrl->getLinkTarget($this->parent_obj,
"confirmDelete"));
204 if($this->chat_active)
206 $current_selection_list->addItem($this->lng->txt(
"invite_to_chat"),
'', $this->ctrl->getLinkTarget($this->parent_obj,
"inviteToChat"));
208 $this->tpl->setVariable(
"VAL_ACTIONS", $current_selection_list->getHTML());
214 include_once
'Services/Form/classes/class.ilTextInputGUI.php';
215 $ul =
new ilTextInputGUI($this->lng->txt(
'login').
'/'.$this->lng->txt(
'email').
'/'.$this->lng->txt(
'name'),
'query');
216 $ul->
setDataSource($this->ctrl->getLinkTarget($this->getParentObject(),
'lookupAddressbookAsync',
'',
true));
218 $ul->setSubmitFormOnEnter(
true);
220 $ul->readFromSession();
221 $this->filter[
'query'] = $ul->getValue();
251 return $this->filter[
'query'];