예제 #1
0
 function display($tpl = null)
 {
     $this->companies = $this->get('UserCompanies');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->states = JBusinessDirectoryHelper::getStatuses();
     $this->translations = JBusinessDirectoryTranslations::getAllTranslations(OFFER_DESCRIPTION_TRANSLATION, $this->item->id);
     $this->languages = JBusinessUtil::getLanguages();
     //check if user has access to offer
     $user = JFactory::getUser();
     $found = false;
     foreach ($this->companies as $company) {
         if ($company->userId == $user->id && $this->item->companyId == $company->id) {
             $found = true;
         }
     }
     $this->appSettings = JBusinessUtil::getInstance()->getApplicationSettings();
     $this->categoryOptions = JBusinessUtil::getCategoriesOptions(true);
     //redirect if the user has no access and the event is not new
     if (!$found && $this->item->id != 0) {
         $msg = JText::_("LNG_ACCESS_RESTRICTED");
         $app =& JFactory::getApplication();
         $app->redirect(JRoute::_('index.php?option=com_jbusinessdirectory&view=managecompanyoffers', $msg));
     }
     parent::display($tpl);
 }
예제 #2
0
 function display($tpl = null)
 {
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->translations = JBusinessDirectoryTranslations::getAllTranslations(BUSSINESS_DESCRIPTION_TRANSLATION, $this->item->id);
     $this->translationsSlogan = JBusinessDirectoryTranslations::getAllTranslations(BUSSINESS_SLOGAN_TRANSLATION, $this->item->id);
     $this->languages = JBusinessUtil::getLanguages();
     $this->appSettings = JBusinessUtil::getInstance()->getApplicationSettings();
     $this->categoryOptions = JBusinessUtil::getCategoriesOptions(true);
     //get all upgrade packages - cannot downgrade
     $price = 0;
     if (!empty($this->item->lastActivePackage) && $this->item->lastActivePackage->expired == false) {
         $price = $this->item->lastActivePackage->price;
     }
     $this->packageOptions = JBusinessDirectoryHelper::getPackageOptions($price);
     $this->location = $this->get('Location');
     $user = JFactory::getUser();
     if ($this->item->userId != $user->id && $this->item->id != 0) {
         $msg = JText::_("LNG_ACCESS_RESTRICTED");
         $app =& JFactory::getApplication();
         $app->redirect(JRoute::_('index.php?option=com_jbusinessdirectory&view=managecompanies', $msg));
     }
     $layout = JRequest::getVar("layout");
     if (!empty($layout)) {
         $this->setLayout($layout);
     }
     parent::display($tpl);
 }
예제 #3
0
 function getPackages()
 {
     $packageTable = JTable::getInstance("Package", "JTable");
     $packages = $packageTable->getPackages();
     foreach ($packages as $package) {
         $package->features = explode(",", $package->featuresS);
     }
     if ($this->appSettings->enable_multilingual) {
         JBusinessDirectoryTranslations::updatePackagesTranslation($packages);
     }
     return $packages;
 }
예제 #4
0
파일: event.php 프로젝트: benji1979/teszt1
 function getEvent()
 {
     $eventsTable = JTable::getInstance("Event", "JTable");
     $event = $eventsTable->getEvent($this->eventId);
     $event->pictures = $eventsTable->getEventPictures($this->eventId);
     $eventsTable->increaseViewCount($this->eventId);
     $companiesTable = JTable::getInstance("Company", "JTable");
     $company = $companiesTable->getCompany($event->company_id);
     $event->company = $company;
     if ($this->appSettings->enable_multilingual) {
         JBusinessDirectoryTranslations::updateEntityTranslation($event, EVENT_DESCRIPTION_TRANSLATION);
     }
     return $event;
 }
예제 #5
0
 function getCompaniesByLetter()
 {
     $companiesTable = $this->getTable("Company");
     $categoryId = JRequest::getVar('categoryId');
     $companies = $companiesTable->getCompaniesByLetter($this->letter, $this->enablePackages, $this->showPendingApproval, $this->getState('limitstart'), $this->getState('limit'));
     foreach ($companies as $company) {
         $company->packageFeatures = explode(",", $company->features);
         $attributesTable = $this->getTable('CompanyAttributes');
         $company->customAttributes = $attributesTable->getCompanyAttributes($company->id);
     }
     if ($this->appSettings->enable_multilingual) {
         JBusinessDirectoryTranslations::updateBusinessListingsTranslation($companies);
         JBusinessDirectoryTranslations::updateBusinessListingsSloganTranslation($companies);
     }
     return $companies;
 }
예제 #6
0
파일: offer.php 프로젝트: benji1979/teszt1
 function getOffer()
 {
     $offersTable = JTable::getInstance("Offer", "JTable");
     $offer = $offersTable->getOffer($this->offerId);
     $offer->pictures = $offersTable->getOfferPictures($this->offerId);
     $offersTable->increaseViewCount($this->offerId);
     $companiesTable = JTable::getInstance("Company", "JTable");
     $company = $companiesTable->getCompany($offer->companyId);
     $offer->company = $company;
     $offersTable = JTable::getInstance("Offer", "JTable");
     if ($this->appSettings->enable_multilingual) {
         JBusinessDirectoryTranslations::updateEntityTranslation($offer, OFFER_DESCRIPTION_TRANSLATION);
     }
     $offer->attachments = JBusinessDirectoryAttachments::getAttachemnts(OFFER_ATTACHMENTS, $this->offerId);
     return $offer;
 }
예제 #7
0
파일: search.php 프로젝트: benji1979/teszt1
 function getCategory()
 {
     $categoryTable = $this->getTable("Category", "JBusinessTable");
     $category = $categoryTable->getCategoryById($this->categoryId);
     if ($this->appSettings->enable_multilingual) {
         JBusinessDirectoryTranslations::updateEntityTranslation($category, CATEGORY_TRANSLATION);
     }
     return $category;
 }
예제 #8
0
파일: events.php 프로젝트: benji1979/teszt1
 function getEvents()
 {
     $eventsTable = JTable::getInstance("Event", "JTable");
     $searchDetails = $this->getSearchParameters();
     $events = $eventsTable->getEventsByCategories($searchDetails, $this->getState('limitstart'), $this->getState('limit'));
     if ($this->appSettings->enable_multilingual) {
         JBusinessDirectoryTranslations::updateEventsTranslation($events);
     }
     return $events;
 }
예제 #9
0
 function getCompanyEvents()
 {
     $table = $this->getTable("Event");
     $events = $table->getCompanyEvents(JRequest::getVar('companyId'));
     if (!empty($events) && $this->appSettings->enable_multilingual) {
         JBusinessDirectoryTranslations::updateEventsTranslation($events);
     }
     return $events;
 }