Esempio n. 1
0
 function getOffers()
 {
     $searchDetails = $this->getSearchParameters();
     $offersTable = JTable::getInstance("Offer", "JTable");
     $offers = $offersTable->getOffersByCategories($searchDetails, $this->getState('limitstart'), $this->getState('limit'));
     foreach ($offers as $offer) {
         switch ($offer->view_type) {
             case 1:
                 $offer->link = JBusinessUtil::getofferLink($offer->id, $offer->alias);
                 break;
             case 2:
                 $itemId = JRequest::getVar('Itemid');
                 $offer->link = JRoute::_("index.php?option=com_content&view=article&Itemid={$itemId}&id=" . $offer->article_id);
                 break;
             case 3:
                 $offer->link = $offer->url;
                 break;
             default:
                 $offer->link = JBusinessUtil::getofferLink($offer->id, $offer->alias);
         }
     }
     if ($this->appSettings->enable_multilingual) {
         JBusinessDirectoryTranslations::updateOffersTranslation($offers);
     }
     return $offers;
 }
Esempio n. 2
0
 function getCompanyOffers()
 {
     $table = $this->getTable("Offer");
     $offers = $table->getCompanyOffers(JRequest::getVar('companyId'));
     if (!empty($offers)) {
         JBusinessDirectoryTranslations::updateOffersTranslation($offers);
         foreach ($offers as $offer) {
             switch ($offer->view_type) {
                 case 1:
                     $offer->link = JBusinessUtil::getofferLink($offer->id, $offer->alias);
                     break;
                 case 2:
                     $offer->link = JRoute::_('index.php?option=com_content&view=article&id=' . $offer->article_id);
                     break;
                 case 3:
                     $offer->link = $offer->url;
                     break;
                 default:
                     $offer->link = JBusinessUtil::getofferLink($offer->id, $offer->alias);
             }
         }
     }
     return $offers;
 }