ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilMailingListsGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 require_once "Services/Table/classes/class.ilTable2GUI.php";
6 require_once "Services/Contact/classes/class.ilMailingLists.php";
7 require_once "Services/Mail/classes/class.ilFormatMail.php";
8 require_once "Services/Contact/classes/class.ilAddressbook.php";
9 
17 {
18  private $tpl = null;
19  private $ctrl = null;
20  private $lng = null;
21 
22  private $umail = null;
23  private $mlists = null;
24  private $abook = null;
25 
26  private $error = array();
27 
28  private $form_gui = null;
29 
30  public function __construct()
31  {
32  global $tpl, $ilCtrl, $lng, $ilUser;
33 
34  $this->tpl = $tpl;
35  $this->ctrl = $ilCtrl;
36  $this->lng = $lng;
37 
38  $this->umail = new ilFormatMail($ilUser->getId());
39  $this->abook = new ilAddressbook($ilUser->getId());
40 
41  $this->mlists = new ilMailingLists($ilUser);
42  $this->mlists->setCurrentMailingList($_GET['ml_id']);
43 
44  $this->ctrl->saveParameter($this, 'mobj_id');
45  $this->ctrl->saveParameter($this, 'ref');
46  }
47 
48  public function executeCommand()
49  {
50  $forward_class = $this->ctrl->getNextClass($this);
51  switch ($forward_class)
52  {
53  default:
54  if (!($cmd = $this->ctrl->getCmd()))
55  {
56  $cmd = 'showMailingLists';
57  }
58 
59  $this->$cmd();
60  break;
61  }
62  return true;
63  }
64 
65  public function confirmDelete()
66  {
67  $ml_ids = ((int)$_GET['ml_id']) ? array($_GET['ml_id']) : $_POST['ml_id'];
68  if (!$ml_ids)
69  {
70  ilUtil::sendInfo($this->lng->txt('mail_select_one_entry'));
71  $this->showMailingLists();
72  return true;
73  }
74 
75  include_once('Services/Utilities/classes/class.ilConfirmationGUI.php');
76  $c_gui = new ilConfirmationGUI();
77 
78  $c_gui->setFormAction($this->ctrl->getFormAction($this, 'performDelete'));
79  $c_gui->setHeaderText($this->lng->txt('mail_sure_delete_entry'));
80  $c_gui->setCancel($this->lng->txt('cancel'), 'showMailingLists');
81  $c_gui->setConfirm($this->lng->txt('confirm'), 'performDelete');
82 
83  $entries = $this->mlists->getSelected($ml_ids);
84  foreach($entries as $entry)
85  {
86  $c_gui->addItem('ml_id[]', $entry->getId(), $entry->getTitle());
87  }
88 
89  $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
90  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_list.html', 'Services/Contact');
91  $this->tpl->setVariable('DELETE_CONFIRMATION', $c_gui->getHTML());
92 
93  $this->tpl->show();
94 
95  return true;
96  }
97 
98  public function performDelete()
99  {
100  global $ilUser;
101 
102  if (is_array($_POST['ml_id']))
103  {
104  $counter = 0;
105  foreach ($_POST['ml_id'] as $id)
106  {
107  if(ilMailingList::_isOwner($id, $ilUser->getId()))
108  {
109  $this->mlists->get(ilUtil::stripSlashes($id))->delete();
110  ++$counter;
111  }
112  }
113  if($counter)
114  ilUtil::sendInfo($this->lng->txt('mail_deleted_entry'));
115  }
116  else
117  {
118  ilUtil::sendInfo($this->lng->txt('mail_delete_error'));
119  }
120 
121  $this->showMailingLists();
122 
123  return true;
124  }
125 
126  public function mailToList()
127  {
128  global $ilUser, $rbacsystem;
129 
130  // check if current user may send mails
131  include_once "Services/Mail/classes/class.ilMail.php";
132  $mail = new ilMail($_SESSION["AccountId"]);
133  $mailing_allowed = $rbacsystem->checkAccess('internal_mail',$mail->getMailObjectReferenceId());
134 
135  if (!$mailing_allowed)
136  {
137  ilUtil::sendFailure($this->lng->txt('no_permission'));
138  return true;
139  }
140 
141  $ml_ids = ((int)$_GET['ml_id']) ? array($_GET['ml_id']) : $_POST['ml_id'];
142  if (!$ml_ids)
143  {
144  ilUtil::sendInfo($this->lng->txt('mail_select_one_entry'));
145  $this->showMailingLists();
146  return true;
147  }
148 
149  $mail_data = $this->umail->getSavedData();
150  if(!is_array($mail_data))
151  {
152  $this->umail->savePostData($ilUser->getId(), array(), '', '', '', '', '', '', '', '');
153  }
154 
155  $lists = array();
156  foreach($ml_ids as $id)
157  {
158  if(ilMailingList::_isOwner($id, $ilUser->getId()) &&
159  !$this->umail->doesRecipientStillExists('#il_ml_'.$id, $mail_data['rcp_to']))
160  {
161  $lists[] = '#il_ml_'.$id;
162  }
163  }
164 
165  if(count($lists))
166  {
167  $mail_data = $this->umail->appendSearchResult($lists, 'to');
168  $this->umail->savePostData(
169  $mail_data['user_id'],
170  $mail_data['attachments'],
171  $mail_data['rcp_to'],
172  $mail_data['rcp_cc'],
173  $mail_data['rcp_bcc'],
174  $mail_data['m_type'],
175  $mail_data['m_email'],
176  $mail_data['m_subject'],
177  $mail_data['m_message'],
178  $mail_data['use_placeholders']
179  );
180  }
181 
182  ilUtil::redirect("ilias.php?baseClass=ilMailGUI&type=search_res");
183 
184  return true;
185  }
186 
187  public function showMailingLists()
188  {
189  global $rbacsystem;
190 
191  $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
192  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_list.html', 'Services/Contact');
193 
194  // check if current user may send mails
195  include_once "Services/Mail/classes/class.ilMail.php";
196  $mail = new ilMail($_SESSION["AccountId"]);
197  $mailing_allowed = $rbacsystem->checkAccess('internal_mail',$mail->getMailObjectReferenceId());
198 
199  $tbl = new ilTable2GUI($this);
200  $tbl->setId('show_mlng_lists_tbl');
201  $tbl->setFormAction($this->ctrl->getFormAction($this), 'showForm');
202  $tbl->setTitle($this->lng->txt('mail_mailing_lists'));
203  $tbl->setRowTemplate('tpl.mail_mailing_lists_listrow.html', 'Services/Contact');
204 
205  $tbl->setDefaultOrderField('title');
206 
207  $result = array();
208 
209  $tbl->addColumn('', 'check', '10%', true);
210  $tbl->addColumn($this->lng->txt('title'), 'title', '30%');
211  $tbl->addColumn($this->lng->txt('description'), 'description', '30%');
212  $tbl->addColumn($this->lng->txt('members'), 'members', '20%');
213  $tbl->addColumn($this->lng->txt('actions'), '', '10%');
214 
215  $entries = $this->mlists->getAll();
216  if (count($entries))
217  {
218  $tbl->enable('select_all');
219  $tbl->setSelectAllCheckbox('ml_id');
220 
221  $counter = 0;
222 
223  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
224 
225  foreach ($entries as $entry)
226  {
227  $result[$counter]['check'] = ilUtil::formCheckbox(0, 'ml_id[]', $entry->getId());
228  $result[$counter]['title'] = $entry->getTitle() . " [#il_ml_" . $entry->getId() . "]";
229  $result[$counter]['description'] = $entry->getDescription();
230  $result[$counter]['members'] = count($entry->getAssignedEntries());
231 
232  $this->ctrl->setParameter($this, 'ml_id', $entry->getId());
233  //$result[$counter]['edit_text'] = $this->lng->txt("edit");
234  //$result[$counter]['edit_url'] = $this->ctrl->getLinkTarget($this, "showForm");
235  //$result[$counter]['members_text'] = $this->lng->txt("members");
236  //$result[$counter]['members_url'] = $this->ctrl->getLinkTarget($this, "showMembersList");
237 
238  $current_selection_list = new ilAdvancedSelectionListGUI();
239  $current_selection_list->setListTitle($this->lng->txt("actions"));
240  $current_selection_list->setId("act_".$counter);
241 
242  $current_selection_list->addItem($this->lng->txt("edit"), '', $this->ctrl->getLinkTarget($this, "showForm"));
243  $current_selection_list->addItem($this->lng->txt("members"), '', $this->ctrl->getLinkTarget($this, "showMembersList"));
244  if ($mailing_allowed)
245  $current_selection_list->addItem($this->lng->txt("send_mail_to"), '', $this->ctrl->getLinkTarget($this, "mailToList"));
246  $current_selection_list->addItem($this->lng->txt("delete"), '', $this->ctrl->getLinkTarget($this, "confirmDelete"));
247 
248  $result[$counter]['COMMAND_SELECTION_LIST'] = $current_selection_list->getHTML();
249 
250  ++$counter;
251  }
252 
253  if ($mailing_allowed)
254  $tbl->addMultiCommand('mailToList', $this->lng->txt('send_mail_to'));
255  $tbl->addMultiCommand('confirmDelete', $this->lng->txt('delete'));
256  }
257  else
258  {
259  $tbl->disable('header');
260  $tbl->disable('footer');
261 
262  $tbl->setNoEntriesText($this->lng->txt('mail_search_no'));
263  }
264 
265  $tbl->setData($result);
266 
267  $tbl->addCommandButton('showForm', $this->lng->txt('add'));
268 
269  if(isset($_GET['ref']) && $_GET['ref'] == 'mail')
270  {
271  $tbl->addCommandButton('cancel', $this->lng->txt('cancel'));
272  }
273 
274  $this->tpl->setVariable('MAILING_LISTS', $tbl->getHTML());
275  $this->tpl->show();
276 
277  return true;
278  }
279 
283  public function cancel()
284  {
285  if(isset($_GET['ref']) && $_GET['ref'] == 'mail')
286  {
287  $this->ctrl->returnToParent($this);
288  }
289  else
290  {
291  $this->showMailingLists();
292  }
293  }
294 
295  public function saveForm()
296  {
297  if($this->mlists->getCurrentMailingList()->getId())
298  {
299  global $ilUser, $ilErr;
300 
301  if(!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $ilUser->getId()))
302  {
303  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
304  }
305 
306  $this->ctrl->setParameter($this, 'ml_id', $this->mlists->getCurrentMailingList()->getId());
307  $this->initForm('edit');
308  }
309  else
310  {
311  $this->initForm();
312  }
313 
314  if($this->form_gui->checkInput())
315  {
316  $this->mlists->getCurrentMailingList()->setTitle($_POST['title']);
317  $this->mlists->getCurrentMailingList()->setDescription($_POST['description']);
318  if($this->mlists->getCurrentMailingList()->getId())
319  {
320  $this->mlists->getCurrentMailingList()->setChangedate(date('Y-m-d H:i:s', time()));
321  $this->mlists->getCurrentMailingList()->update();
322  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
323  }
324  else
325  {
326  $this->mlists->getCurrentMailingList()->setCreatedate(date('Y-m-d H:i:s', time()));
327  $this->mlists->getCurrentMailingList()->insert();
328  $this->ctrl->setParameter($this, 'ml_id', $this->mlists->getCurrentMailingList()->getId());
329  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'saveForm'));
330 
331  $this->ctrl->setParameter($this, 'ml_id', $this->mlists->getCurrentMailingList()->getId());
332  $this->ctrl->redirect($this,'showMembersList');
333 
334  exit;
335  }
336  }
337 
338  $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
339  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_form.html', 'Services/Contact');
340 
341  $this->form_gui->setValuesByPost();
342 
343  $this->tpl->setVariable('FORM', $this->form_gui->getHTML());
344  return $this->tpl->show();
345  }
346 
347  private function initForm($a_type = 'create')
348  {
349  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
350  $this->form_gui = new ilPropertyFormGUI();
351 
352  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'saveForm'));
353  $this->form_gui->setTitle($this->lng->txt('mail_mailing_list'));
354 
355  $titleGui = new ilTextInputGUI($this->lng->txt('title'), 'title');
356  $titleGui->setRequired(true);
357  $this->form_gui->addItem($titleGui);
358 
359  $descriptionGui = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
360  $descriptionGui->setCols(40);
361  $descriptionGui->setRows(8);
362  $this->form_gui->addItem($descriptionGui);
363 
364  $this->form_gui->addCommandButton('saveForm',$this->lng->txt('save'));
365  $this->form_gui->addCommandButton('showMailingLists',$this->lng->txt('cancel'));
366  }
367 
368  private function setValuesByObject()
369  {
370  $this->form_gui->setValuesByArray(array(
371  'title' => $this->mlists->getCurrentMailingList()->getTitle(),
372  'description' => $this->mlists->getCurrentMailingList()->getDescription()
373  ));
374  }
375 
376  private function setDefaultValues()
377  {
378  $this->form_gui->setValuesByArray(array(
379  'title' => '',
380  'description' => ''
381  ));
382  }
383 
384  public function showForm()
385  {
386  global $ilUser, $ilErr;
387 
388  $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
389  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_form.html', 'Services/Contact');
390 
391  if($this->mlists->getCurrentMailingList()->getId())
392  {
393  if(!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $ilUser->getId()))
394  {
395  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
396  }
397 
398  $this->ctrl->setParameter($this, 'ml_id', $this->mlists->getCurrentMailingList()->getId());
399  $this->initForm('edit');
400  $this->setValuesByObject();
401  }
402  else
403  {
404  $this->initForm();
405  $this->setDefaultValues();
406  }
407 
408  $this->tpl->setVariable('FORM', $this->form_gui->getHTML());
409  return $this->tpl->show();
410  }
411 
412  public function showMembersList()
413  {
414  if (!$this->mlists->getCurrentMailingList()->getId())
415  {
416  $this->showMailingLists();
417 
418  return true;
419  }
420 
421  $this->ctrl->setParameter($this, 'cmd', 'post');
422  $this->ctrl->setParameter($this, 'ml_id', $this->mlists->getCurrentMailingList()->getId());
423 
424  $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
425  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_members.html', 'Services/Contact');
426 
427  $tbl = new ilTable2GUI($this);
428  $tbl->setId('show_mlng_mmbrs_list_tbl');
429  $tbl->setFormAction($this->ctrl->getFormAction($this), 'showMemberForm');
430  $tbl->setTitle($this->lng->txt('mail_members_of_mailing_list') . ' ' .$this->mlists->getCurrentMailingList()->getTitle());
431  $tbl->setRowTemplate('tpl.mail_mailing_lists_membersrow.html', 'Services/Contact');
432 
433  $this->ctrl->setParameter($this, 'cmd', 'showMembersList');
434 
435  $tbl->setDefaultOrderField('title');
436 
437  $result = array();
438 
439  $tbl->addColumn('', 'check', '10%');
440  $tbl->addColumn($this->lng->txt('title'), 'title', '90%');
441 
442  $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
443  if (count($assigned_entries))
444  {
445  $tbl->enable('select_all');
446  $tbl->setSelectAllCheckbox('a_id');
447 
448  $counter = 0;
449  foreach ($assigned_entries as $entry)
450  {
451  $result[$counter]['check'] = ilUtil::formCheckbox(0, 'a_id[]', $entry['a_id']);
452  $result[$counter]['title'] = ($entry['login'] != '' ? $entry['login'] : $entry['email']);
453 
454  ++$counter;
455  }
456 
457  $tbl->addMultiCommand('confirmDeleteMembers', $this->lng->txt('delete'));
458  }
459  else
460  {
461  $tbl->disable('header');
462  $tbl->disable('footer');
463 
464  $tbl->setNoEntriesText($this->lng->txt('mail_search_no'));
465  }
466 
467  $tbl->setData($result);
468 
469  $tbl->addCommandButton('showAssignmentForm', $this->lng->txt('add'));
470  $tbl->addCommandButton('showMailingLists', $this->lng->txt('back'));
471 
472  $this->tpl->setVariable('MEMBERS_LIST', $tbl->getHTML());
473  $this->tpl->show();
474 
475  return true;
476  }
477 
478  public function confirmDeleteMembers()
479  {
480  if (!isset($_POST['a_id']))
481  {
482  ilUtil::sendInfo($this->lng->txt('mail_select_one_entry'));
483  $this->showMembersList();
484  return true;
485  }
486 
487  include_once('Services/Utilities/classes/class.ilConfirmationGUI.php');
488  $c_gui = new ilConfirmationGUI();
489  $this->ctrl->setParameter($this, 'ml_id', $this->mlists->getCurrentMailingList()->getId());
490  $c_gui->setFormAction($this->ctrl->getFormAction($this, 'performDeleteMembers'));
491  $c_gui->setHeaderText($this->lng->txt('mail_sure_delete_entry'));
492  $c_gui->setCancel($this->lng->txt('cancel'), 'showMembersList');
493  $c_gui->setConfirm($this->lng->txt('confirm'), 'performDeleteMembers');
494 
495  $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
496  if (is_array($assigned_entries))
497  {
498  foreach ($assigned_entries as $entry)
499  {
500  if (in_array($entry['a_id'], $_POST['a_id']))
501  {
502  $c_gui->addItem('a_id[]', $entry['a_id'], ($entry['login'] != '' ? $entry['login'] : $entry['email']));
503  }
504  }
505  }
506 
507  $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
508  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_members.html', 'Services/Contact');
509  $this->tpl->setVariable('DELETE_CONFIRMATION', $c_gui->getHTML());
510 
511  $this->tpl->show();
512 
513  return true;
514  }
515 
516  public function performDeleteMembers()
517  {
518  global $ilUser, $ilErr;
519 
520  if(!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $ilUser->getId()))
521  {
522  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
523  }
524 
525  if (is_array($_POST['a_id']))
526  {
527  foreach ($_POST['a_id'] as $id)
528  {
529  $this->mlists->getCurrentMailingList()->deassignAddressbookEntry(ilUtil::stripSlashes($id));
530  }
531 
532  ilUtil::sendInfo($this->lng->txt('mail_deleted_entry'));
533  }
534  else
535  {
536  ilUtil::sendInfo($this->lng->txt('mail_delete_error'));
537  }
538 
539  $this->showMembersList();
540 
541  return true;
542  }
543 
544  public function saveAssignmentForm()
545  {
546  global $ilUser, $ilErr;
547 
548  if(!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $ilUser->getId()))
549  {
550  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
551  }
552 
553  if ($_POST['addr_id'] == '') $this->setError($this->lng->txt('mail_entry_of_addressbook'));
554 
555  if (!$this->isError())
556  {
557  $found = false;
558 
559  $all_entries = $this->abook->getEntries();
560  if ((int)count($all_entries))
561  {
562  foreach ($all_entries as $entry)
563  {
564  if($entry['addr_id'] == $_POST['addr_id'])
565  {
566  $found = true;
567  break;
568  }
569  }
570  }
571 
572  if($found)
573  {
574  $this->mlists->getCurrentMailingList()->assignAddressbookEntry(ilUtil::stripSlashes($_POST['addr_id']));
575 
576  ilUtil::sendInfo($this->lng->txt('saved_successfully'));
577  }
578 
579  $this->showMembersList();
580  }
581  else
582  {
583  $mandatory = '';
584 
585  while ($error = $this->getError())
586  {
587  $mandatory .= $error;
588  if ($this->isError()) $mandatory .= ', ';
589  }
590 
591  ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields') . ': ' . $mandatory);
592 
593  $this->showAssignmentForm();
594  }
595 
596  return true;
597  }
598 
599  public function showAssignmentForm()
600  {
601  global $ilUser, $ilErr;
602 
603  if (!$this->mlists->getCurrentMailingList()->getId())
604  {
605  $this->showMembersList();
606 
607  return true;
608  }
609 
610  if(!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $ilUser->getId()))
611  {
612  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
613  }
614 
615  $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
616  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_members_form.html', 'Services/Contact');
617 
618  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
619 
620  $form = new ilPropertyFormGUI();
621  $this->ctrl->setParameter($this, 'ml_id', $this->mlists->getCurrentMailingList()->getId());
622  $form->setFormAction($this->ctrl->getFormAction($this, 'saveForm'));
623  $form->setTitle($this->lng->txt('mail_assign_entry_to_mailing_list') . ' ' . $this->mlists->getCurrentMailingList()->getTitle());
624 
625  $options = array();
626  $options[''] = $this->lng->txt('please_select');
627 
628  $all_entries = $this->abook->getEntries();
629  if ((int)count($all_entries))
630  {
631  foreach ($all_entries as $entry)
632  {
633  $options[$entry['addr_id']] = ($entry['login'] != '' ? $entry['login'] : $entry['email']);
634  }
635  }
636 
637  $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
638  if ((int)count($assigned_entries))
639  {
640  foreach ($assigned_entries as $assigned_entry)
641  {
642  if (is_array($options) && array_key_exists($assigned_entry['addr_id'], $options))
643  {
644  unset($options[$assigned_entry['addr_id']]);
645  }
646  }
647  }
648 
649  if (count($options) > 1)
650  {
651  $formItem = new ilSelectInputGUI($this->lng->txt('mail_entry_of_addressbook'), 'addr_id');
652  $formItem->setOptions($options);
653  $formItem->setValue($this->mlists->getCurrentMailingList()->getTitle());
654  $form->addItem($formItem);
655 
656  $form->addCommandButton('saveAssignmentForm',$this->lng->txt('assign'));
657  }
658  else if(count($options) == 1 && (int)count($all_entries))
659  {
660  ilUtil::sendInfo($this->lng->txt('mail_mailing_lists_all_addressbook_entries_assigned'));
661  }
662  else if(!(int)count($all_entries))
663  {
664  ilUtil::sendInfo($this->lng->txt('mail_mailing_lists_no_addressbook_entries'));
665  }
666 
667 
668  $form->addCommandButton('showMembersList',$this->lng->txt('cancel'));
669 
670  $this->tpl->setVariable('FORM', $form->getHTML());
671  $this->tpl->show();
672 
673  return true;
674  }
675 
676  public function setError($a_error = '')
677  {
678  return $this->error[] = $a_error;
679  }
680  public function getError()
681  {
682  return array_pop($this->error);
683  }
684  public function isError()
685  {
686  if (is_array($this->error) && !empty($this->error)) return true;
687 
688  return false;
689  }
690 }
691 ?>