ILIAS  release_4-4 Revision
class.ilBookingSchedulesTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 
15 {
22  function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
23  {
24  global $ilCtrl, $lng, $ilAccess, $lng, $ilObjDataCache;
25 
26  $this->ref_id = $a_ref_id;
27  $this->setId("bksd");
28 
29  parent::__construct($a_parent_obj, $a_parent_cmd);
30 
31  $this->addColumn($this->lng->txt("title"), "title");
32  $this->addColumn($this->lng->txt("book_is_used"));
33  $this->addColumn($this->lng->txt("actions"));
34 
35  $this->setEnableHeader(true);
36  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
37  $this->setRowTemplate("tpl.booking_schedule_row.html", "Modules/BookingManager");
38 
39  $this->getItems($ilObjDataCache->lookupObjId($this->ref_id));
40  }
41 
47  function getItems($a_pool_id)
48  {
49  include_once 'Modules/BookingManager/classes/class.ilBookingSchedule.php';
50  $data = ilBookingSchedule::getList($a_pool_id);
51 
52  $this->setMaxCount(sizeof($data));
53  $this->setData($data);
54  }
55 
60  protected function fillRow($a_set)
61  {
62  global $lng, $ilAccess, $ilCtrl;
63 
64  $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
65 
66  if($a_set["is_used"])
67  {
68  $this->tpl->setVariable("TXT_IS_USED", $lng->txt("yes"));
69  }
70  else
71  {
72  $this->tpl->setVariable("TXT_IS_USED", $lng->txt("no"));
73  }
74 
75  $ilCtrl->setParameter($this->parent_obj, 'schedule_id', $a_set['booking_schedule_id']);
76 
77  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
78  $alist = new ilAdvancedSelectionListGUI();
79  $alist->setId($a_set['booking_schedule_id']);
80  $alist->setListTitle($lng->txt("actions"));
81 
82  if ($ilAccess->checkAccess('write', '', $this->ref_id))
83  {
84  $alist->addItem($lng->txt('edit'), 'edit', $ilCtrl->getLinkTarget($this->parent_obj, 'edit')); // #12306
85 
86  if(!$a_set["is_used"])
87  {
88  $alist->addItem($lng->txt('delete'), 'delete', $ilCtrl->getLinkTarget($this->parent_obj, 'confirmDelete'));
89  }
90  }
91 
92  $this->tpl->setVariable("LAYER", $alist->getHTML());
93  }
94 }
95 ?>
getItems($a_pool_id)
Build summary item rows for given object and filter(s)
setId($a_val)
Set id.
List booking schedules (for booking pool)
global $ilCtrl
Definition: ilias.php:18
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.
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
User interface class for advanced drop-down selection lists.
global $lng
Definition: privfeed.php:40
setFormAction($a_form_action)
Set Form action parameter.
setEnableHeader($a_enableheader)
Set Enable Header.
setMaxCount($a_max_count)
set max.
static getList($a_pool_id)
Get list of booking objects for given pool.