Ejemplo n.º 1
0
 function display($tpl = null)
 {
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_('LNG_MANAGE_ARRIVAL_OPTIONS', true), 'generic.png');
         //JRequest::setVar( 'hidemainmenu', 1 );
         JToolBarHelper::custom('back', JUtil::getDashBoardIcon(), 'home', 'Back', false, false);
         $hotel_id =& $this->get('HotelId');
         if ($hotel_id > 0) {
             JToolBarHelper::deleteList(JText::_('LNG_ARE_YOU_SURE_YOU_WANT_TO_DELETE', true), 'Delete', 'Delete', 'Detele button', false, false);
             JToolBarHelper::editList();
             JToolBarHelper::addNewX();
         }
         $this->hotel_id = $hotel_id;
         $items =& $this->get('Datas');
         $this->items = $items;
         $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;
         JToolBarHelper::title('J-Hotel Reservation : ' . ($item->arrival_option_id > 0 ? JText::_('LNG_EDIT', true) : JText::_('LNG_ADD_NEW', true)) . ' ' . JText::_('LNG_MANAGE_ARRIVAL_OPTION', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::cancel();
         JToolBarHelper::save();
     }
     parent::display($tpl);
 }
Ejemplo n.º 2
0
 function display($tpl = null)
 {
     if (JRequest::getString('task') == 'save' && JRequest::getString('is_save_ok') == 0) {
         if (JRequest::getString('offer_id') == 0) {
             JRequest::setVar('task', 'add');
         } else {
             JRequest::setVar('task', 'edit');
         }
     }
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_('LNG_MANAGE_OFFERS', true), 'generic.png');
         // JRequest::setVar( 'hidemainmenu', 1 );
         $hotel_id =& $this->get('HotelId');
         JHotelReservationHelper::addSubmenu('offers');
         if ($hotel_id > 0) {
             JToolBarHelper::addNew('manageoffers.edit');
             JToolBarHelper::editList('manageoffers.edit');
             JToolBarHelper::deleteList('', 'manageoffers.delete', JText::_('LNG_DELETE', true));
         }
         JToolBarHelper::custom('back', JUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
         $this->hotel_id = $hotel_id;
         $items =& $this->get('Datas');
         // dbg($items);
         $this->items = $items;
         $hotels =& $this->get('Hotels');
         $hotels = checkHotels(JFactory::getUser()->id, $hotels);
         $this->hotels = $hotels;
     } else {
         $item =& $this->get('Data');
         $this->item = $item;
         $this->extraOptions = $this->get('ExtraOptions');
         $hotel_id =& $this->get('HotelId');
         $this->hotel_id = $hotel_id;
         if (JRequest::getString('is_error_save') == '1') {
             //exit;
         }
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_($item->offer_id > 0 ? "LNG_EDIT" : "LNG_ADD_NEW", true) . ' ' . JText::_('LNG_OFFER', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::apply('manageoffers.apply');
         JToolBarHelper::save('manageoffers.save');
         JToolBarHelper::custom('manageoffers.saveAsNew', 'save.png', 'save.png', 'Duplicate', false, false);
         JToolBarHelper::cancel('manageoffers.cancel');
         $this->includeFunctions();
     }
     parent::display($tpl);
 }