Esempio n. 1
0
 function display($tpl = null)
 {
     $this->config = JBFactory::getConfig();
     $input = JFactory::getApplication()->input;
     AImporter::model('tour');
     $cart = JModelLegacy::getInstance('TourCart', 'bookpro');
     $cart->load();
     $cart->clear();
     $model = new BookProModelTour();
     $id = $input->getInt('id');
     $this->tour = $model->getComplexItem($id);
     $this->itineraries = TourHelper::buildItinerary($id);
     //$this->packages	= $packages;
     $date = TourHelper::getDateFirstInPackagerateFromTourid($this->tour->id);
     $this->date = JFactory::getDate($date)->format(DateHelper::getConvertDateFormat('P'));
     $this->tour->rdate = $this->date;
     $dispatcher = JDispatcher::getInstance();
     //$this->_prepareDocument();
     //		$dispatcher		= JDispatcher::getInstance();
     //		$this->event 	= new stdClass();
     //		JPluginHelper::importPlugin('bookpro');
     //		$results 		= $dispatcher->trigger('onBookproProductAfterTitle', array ($this->tour));
     //		$this->event->afterDisplayTitle=isset($results[0])?$results[0]:null;
     parent::display($tpl);
 }
Esempio n. 2
0
 static function getTourAddon($tour_id)
 {
     AImporter::model('tour');
     $model = new BookProModelTour();
     $exComplex = $model->getComplexItem($tour_id);
     $return = null;
     if (isset($exComplex->addons)) {
         $items = $exComplex->addons;
         $iti_sum = array();
         $dest_ids = array();
         if (count($items) > 0) {
             for ($i = 0; $i < count($items); $i++) {
                 $iti_sum[] = '<span class="label">' . $items[$i]->title . '</span>';
             }
         }
         $return = implode('&nbsp;', $iti_sum);
     }
     return $return;
 }