Example #1
0
 function display($tpl = null)
 {
     $item = $this->get('Data');
     $this->item = $item;
     $appSettings = JHotelUtil::getApplicationSettings();
     $this->lodgingtypes = $this->getModel('lodgingtypes');
     $this->facilities = $this->getModel('facilities');
     $this->accomodationtypes = $this->getModel('accomodationtypes');
     $this->environmenttypes = $this->getModel('environmenttypes');
     $this->paymentoptions = $this->getModel('paymentoptions');
     $this->regiontypes = $this->getModel('regiontypes');
     JToolBarHelper::title('J-Hotel Reservation : ' . ($item->hotel_id > 0 ? JText::_("LNG_EDIT", true) : JText::_('LNG_ADD_NEW', true)) . ' ' . JText::_('LNG_HOTEL', true), 'generic.png');
     $elements = new stdClass();
     //hotel important informations
     $elements->allowPets = JHTML::_('select.booleanlist', "pets", '', $item->informations->pets);
     $elements->parking = JHTML::_('select.booleanlist', "parking", '', $item->informations->parking);
     $elements->wifi = JHTML::_('select.booleanlist', "wifi", '', $item->informations->wifi);
     $elements->publicTransport = JHTML::_('select.booleanlist', "public_transport", '', $item->informations->public_transport);
     $elements->suitableDisabled = JHTML::_('select.booleanlist', "suitable_disabled", '', $item->informations->suitable_disabled);
     //recommended
     $elements->recommended = JHTML::_('select.booleanlist', "recommended", '', $item->recommended);
     $this->elements = $elements;
     $hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
     $this->translations = $hoteltranslationsModel->getAllTranslations(HOTEL_TRANSLATION, $this->item->hotel_id);
     $this->addToolbar($this->item);
     $this->includeFunctions();
     parent::display($tpl);
 }
Example #2
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
     $this->translations = $hoteltranslationsModel->getAllTranslations(EXTRA_OPTIONS_TRANSLATION, $this->item->id);
     parent::display($tpl);
     $this->addToolbar();
 }
Example #3
0
 function display($tpl = null)
 {
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     $this->item = $this->get('Item');
     $this->extraOptions = $this->get('ExtraOptions');
     $this->pictures = $this->get('OfferPictures');
     $this->excursions = $this->get('Excursions');
     //get offer translations
     $hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
     $this->offerShortDescTranslations = $hoteltranslationsModel->getAllTranslations(OFFER_SHORT_TRANSLATION, $this->item->offer_id);
     $this->offerTranslations = $hoteltranslationsModel->getAllTranslations(OFFER_TRANSLATION, $this->item->offer_id);
     $this->offerContentTranslations = $hoteltranslationsModel->getAllTranslations(OFFER_CONTENT_TRANSLATION, $this->item->offer_id);
     $this->offerOtherInfoTranslations = $hoteltranslationsModel->getAllTranslations(OFFER_INFO_TRANSLATION, $this->item->offer_id);
     JToolBarHelper::title('J-Hotel Reservation : ' . JText::_($this->item->offer_id > 0 ? "LNG_EDIT" : "LNG_ADD_NEW", true) . ' ' . JText::_('LNG_OFFER', true), 'generic.png');
     $hotel_id = $this->get('HotelId');
     $this->hotel_id = $hotel_id;
     $this->includeFunctions();
     parent::display($tpl);
     $this->addToolbar();
 }
Example #4
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     //$this->form	= $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->hotel = $this->get('Hotel');
     $this->pictures = $this->get('ExcursionPictures');
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     //get hotel translations
     $hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
     $this->translations = $hoteltranslationsModel->getAllTranslations(EXCURSION_TRANSLATION, $this->item->id);
     $this->includeFunctions();
     $appSettings = JHotelUtil::getApplicationSettings();
     parent::display($tpl);
     $this->addToolbar();
 }
Example #5
0
 function display($tpl = null)
 {
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_('LNG_MANAGE_EMAILS_DEFAULT', true), 'generic.png');
         JToolBarHelper::custom('manageemails.show', JHotelUtil::getDashBoardIcon(), 'home', 'Back', false, false);
         JToolBarHelper::editList('manageemailsdefault.edit');
         $items = $this->get('Datas');
         $this->items = $items;
         $this->hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
     } else {
         $item = $this->get('Data');
         $this->item = $item;
         $hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
         $this->translations = $hoteltranslationsModel->getAllTranslations(EMAIL_TEMPLATE_TRANSLATION, $this->item->email_default_id);
         JToolBarHelper::title('J-Hotel Reservation : ' . ($item->email_default_id > 0 ? JText::_('LNG_EDIT', true) : JText::_('LNG_ADD_NEW', true)) . ' ' . JText::_('LNG_EMAIL', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::apply('manageemailsdefault.apply');
         JToolBarHelper::save('manageemailsdefault.save');
         JToolBarHelper::cancel('manageemailsdefault.cancel');
     }
     parent::display($tpl);
 }
Example #6
0
 function display($tpl = null)
 {
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_('LNG_MANAGE_EMAILS_TEMPLATES', true), 'generic.png');
         $hotel_id = $this->get('HotelId');
         JHotelReservationHelper::addSubmenu('emailtemplates');
         if ($hotel_id > 0) {
             JToolBarHelper::addNew('manageemails.edit');
             JToolBarHelper::editList('manageemails.edit');
             JToolBarHelper::deleteList('', 'manageemails.delete', JText::_('LNG_DELETE', true));
         }
         JToolBarHelper::custom('manageemailsdefault.show', JHotelUtil::getEmailDefaultIcon(), 'home', JText::_('LNG_MANAGE_EMAILS_DEFAULT'), false, false);
         JToolBarHelper::custom('manageemails.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
         $this->hotel_id = $hotel_id;
         $items = $this->get('Datas');
         $this->items = $items;
         $this->hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
         $hotels = $this->get('Hotels');
         $hotels = checkHotels(JFactory::getUser()->id, $hotels);
         $this->hotels = $hotels;
     } else {
         $item = $this->get('Data');
         $this->item = $item;
         $hotel_id = $this->get('HotelId');
         $this->hotel_id = $hotel_id;
         $hotel = $this->get('Hotel');
         $this->hotel = $hotel;
         $hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
         $this->translations = $hoteltranslationsModel->getAllTranslations(EMAIL_TEMPLATE_TRANSLATION, $this->item->email_id);
         JToolBarHelper::title('J-Hotel Reservation : ' . ($item->email_id > 0 ? JText::_('LNG_EDIT', true) : JText::_('LNG_ADD_NEW', true)) . ' ' . JText::_('LNG_EMAIL', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::apply('manageemails.apply');
         JToolBarHelper::save('manageemails.save');
         JToolBarHelper::cancel('manageemails.cancel');
     }
     parent::display($tpl);
 }
Example #7
0
 function copyEmailContent($hotelId)
 {
     //copy emails default
     $row_email_default = $this->getTable('ManageEmailsDefault');
     $defaultEmails = $row_email_default->getDefaultEmailsForHotel($hotelId);
     foreach ($defaultEmails as $defaultEmail) {
         $emailsTable = $this->getTable('ManageEmails');
         $emailsTable->hotel_id = $hotelId;
         $emailsTable->email_subject = $defaultEmail->email_default_subject;
         $emailsTable->email_name = $defaultEmail->email_default_name;
         $emailsTable->email_type = $defaultEmail->email_default_type;
         $emailsTable->is_default = 1;
         if (!$emailsTable->store()) {
             throw new Exception("Error saving email templates");
         }
         $newEmailId = $emailsTable->email_id;
         $hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
         $translations = $hoteltranslationsModel->getAllTranslationObjects(EMAIL_TEMPLATE_TRANSLATION, $defaultEmail->email_default_id);
         if (count($translations) > 0) {
             foreach ($translations as $translation) {
                 $translationTable = $this->getTable('HotelTranslations');
                 $translationTable->bind($translation);
                 $translationTable->object_id = $newEmailId;
                 $translationTable->id = null;
                 if (!$translationTable->store()) {
                     throw new Exception("Error saving email templates translation");
                 }
             }
         }
     }
     return true;
 }