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 | site/helpers/operator.php +34 -0 1.8.13 → 1.8.16 View file →
@@ -134,8 +134,33 @@
134 134 return $operator;
135 135 }
136 136
137 137 /**
138 + * Fetches the information and permissions of one operator by email.
139 + *
140 + * @param string $email The operator email address.
141 + *
142 + * @return array Operator record or empty array.
143 + *
144 + * @since 1.18.15 (J) - 1.8.15 (WP)
145 + */
146 + public function getByEmail(string $email)
147 + {
148 + $dbo = JFactory::getDbo();
149 +
150 + $dbo->setQuery(
151 + $dbo->getQuery(true)
152 + ->select('*')
153 + ->from($dbo->qn('#__vikbooking_operators'))
154 + ->where($dbo->qn('email') . ' = ' . $dbo->q($email))
155 + );
156 +
157 + $operator = $dbo->loadAssoc();
158 +
159 + return $operator ? $this->getOne($operator['id']) : [];
160 + }
161 +
162 + /**
138 163 * Returns a list of operators compatible for rendering them as elements.
139 164 *
140 165 * @param array $ids Optional list of IDs to filter.
141 166 *
@@ -617,8 +642,17 @@
617 642 'permissions' => [
618 643 'accept_tasks' => [
619 644 'type' => 'select',
620 645 'label' => JText::translate('VBO_ACCEPT_TASKS'),
646 + 'options' => [
647 + 1 => JText::translate('VBYES'),
648 + 0 => JText::translate('VBNO'),
649 + ],
650 + ],
651 + 'create_tasks' => [
652 + 'type' => 'select',
653 + 'label' => JText::translate('VBO_CREATE_TASKS'),
654 + 'help' => JText::translate('VBO_SETT_E4JC_APP'),
621 655 'options' => [
622 656 1 => JText::translate('VBYES'),
623 657 0 => JText::translate('VBNO'),
624 658 ],