PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/views/rooms/view.html.php +12 -7 1.6.4 → 1.8.16 View file →
@@ -12,14 +12,19 @@
12 12
13 13 // import Joomla view library
14 14 jimport('joomla.application.component.view');
15 15
16 -class VikBookingViewRooms extends JViewVikBooking {
17 -
18 - function display($tpl = null) {
16 +class VikBookingViewRooms extends JViewVikBooking
17 +{
18 + public function display($tpl = null)
19 + {
19 20 // Set the toolbar
20 21 $this->addToolBar();
21 22
23 + if (!JFactory::getUser()->authorise('core.vbo.rooms', 'com_vikbooking')) {
24 + VBOHttpDocument::getInstance()->close(403, JText::translate('JERROR_ALERTNOAUTHOR'));
25 + }
26 +
22 27 $rows = "";
23 28 $navbut = "";
24 29 $mainframe = JFactory::getApplication();
25 30 $pmodtar = VikRequest::getString('modtar', '', 'request');
@@ -52,9 +57,9 @@
52 57 $lim0 = VikRequest::getVar('limitstart', 0, '', 'int');
53 58 $session = JFactory::getSession();
54 59 $pvborderby = VikRequest::getString('vborderby', '', 'request');
55 60 $pvbordersort = VikRequest::getString('vbordersort', '', 'request');
56 - $validorderby = array('name', 'toadult', 'tochild', 'totpeople', 'units');
61 + $validorderby = array('name', 'toadult', 'tochild', 'totpeople', 'units', 'avail');
57 62 $orderby = $session->get('vbViewRoomsOrderby', 'name');
58 63 $ordersort = $session->get('vbViewRoomsOrdersort', 'ASC');
59 64 if (!empty($pvborderby) && in_array($pvborderby, $validorderby)) {
60 65 $orderby = $pvborderby;
@@ -88,9 +93,9 @@
88 93 /**
89 94 * Call assertListQuery() from the View class to make sure the filters set
90 95 * do not produce an empty result. This would reset the page in this case.
91 96 *
92 - * @since 1.3.0
97 + * @since 1.13.0 (J) - 1.3.0 (WP)
93 98 */
94 99 $this->assertListQuery($lim0, $lim);
95 100 //
96 101
@@ -115,9 +120,10 @@
115 120
116 121 /**
117 122 * Sets the toolbar
118 123 */
119 - protected function addToolBar() {
124 + protected function addToolBar()
125 + {
120 126 JToolBarHelper::title(JText::translate('VBMAINDEAFULTTITLE'), 'vikbooking');
121 127 if (JFactory::getUser()->authorise('core.create', 'com_vikbooking')) {
122 128 JToolBarHelper::addNew('newroom', JText::translate('VBMAINDEFAULTNEW'));
123 129 JToolBarHelper::spacer();
@@ -134,6 +140,5 @@
134 140 JToolBarHelper::deleteList(JText::translate('VBDELCONFIRM'), 'removeroom', JText::translate('VBMAINDEFAULTDEL'));
135 141 JToolBarHelper::spacer();
136 142 }
137 143 }
138 -
139 144 }