File manager - Edit - /home/verseaumee/ptitsanes/plugins/user/solidres/components/com_solidres/models/myreservation.php
Back
<?php /*------------------------------------------------------------------------ Solidres - Hotel booking extension for Joomla ------------------------------------------------------------------------ @Author Solidres Team @Website http://www.solidres.com @Copyright Copyright (C) 2013 - 2016 Solidres. All Rights Reserved. @License GNU General Public License version 3, or later ------------------------------------------------------------------------*/ defined('_JEXEC') or die; require_once JPATH_ADMINISTRATOR.'/components/com_solidres/models/reservation.php'; class SolidresModelMyReservation extends SolidresModelReservation { /** * Get the return URL. * * @return string The return URL. * * @since 1.6 */ public function getReturnPage() { return base64_encode($this->getState('return_page')); } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @return void * * @since 1.6 */ protected function populateState() { $app = JFactory::getApplication(); // Load state from the request. $pk = $app->input->getInt('id'); $this->setState('reservation.id', $pk); //$this->setState('article.catid', $app->input->getInt('catid')); $return = $app->input->get('return', null, 'base64'); $this->setState('return_page', base64_decode($return)); // Load the parameters. $params = $app->getParams(); $this->setState('params', $params); $this->setState('layout', $app->input->get('layout')); } /** * Method to get the record form. * * @param array $data An optional array of data for the form to interogate. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * @return JForm A JForm object on success, false on failure * @since 1.6 */ public function getForm($data = array(), $loadData = true) { $form = $this->loadForm('com_solidres.reservation', 'myreservation', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } /** * Method to get the data that should be injected in the form. * * @return mixed The data for the form. * @since 1.6 */ protected function loadFormData() { $data = parent::loadFormData(); $user = JFactory::getUser(); $tableCustomer = JTable::getInstance('Customer', 'SolidresTable'); $tableCustomer->load(array('user_id' => $user->get('id'))); // Check for a valid user and that they are the owner. if ($tableCustomer->id == $data->customer_id) { $data->params['access-edit'] = true; } else { $data->params['access-edit'] = false; } return $data; } }
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings