예제 #1
0
 function alloffers()
 {
     $searchstring = Convert::raw2sql($this->getRequest()->getVar('search'));
     $displayAsListView = intval($this->getRequest()->getVar('aslist'));
     if (!Permission::check("VIEW_ALL_OFFERS")) {
         Security::permissionFailure();
         die('missing permissions');
     }
     //Get the Product
     //build page title
     $title = 'Angebote durchsuchen';
     if ($searchstring != '') {
         $title = 'Suche nach: ' . $searchstring;
     }
     if ($catID = $this->getRequest()->getVar('catid')) {
         $cat = OfferCategory::get_by_id('OfferCategory', $catID);
         if ($cat) {
             if ($searchstring != '') {
                 $title = 'Kategorie "' . $cat->Name . '" nach "' . $searchstring . '" durchsuchen';
             } else {
                 $title = 'Kategorie "' . $cat->Name . '" durchsuchen';
             }
         }
     }
     if ($offers = $this->getAllOffers()) {
         $offers->setPageLength(15);
         $Data = array('Offers' => $offers, 'ListView' => $displayAsListView, 'Title' => $title, 'MetaTitle' => 'Alle Angebote', 'MyPage' => false, 'FilterParams' => $this->buildFilterParams(), 'Categories' => $this->getRootCategories(), 'ActiveCategoryID' => Convert::raw2sql($this->getRequest()->getVar('catid')), 'SearchString' => $searchstring, 'SortString' => Convert::raw2sql($this->getRequest()->getVar('sort')), 'Message' => $this->getOfferMessage(), 'CleanSortString' => $this->getCleanSortString());
         //return our $Data array to use, rendering with the ProductPage.ss template
         return $this->customise($Data)->renderWith(array('OfferPage', 'Page'));
     } else {
         return $this->httpError(404, 'Momentan existieren noch keine Angebote.');
     }
 }
예제 #2
0
 function allrequests()
 {
     $searchstring = Convert::raw2sql($this->getRequest()->getVar('search'));
     $displayAsListView = intval($this->getRequest()->getVar('aslist'));
     //build page title
     $title = 'Gesuche durchsuchen';
     if ($searchstring != '') {
         $title = 'Suche nach: ' . $searchstring;
     }
     if ($catID = $this->getRequest()->getVar('catid')) {
         $cat = OfferCategory::get_by_id('OfferCategory', $catID);
         if ($cat) {
             if ($searchstring != '') {
                 $title = 'Kategorie "' . $cat->Name . '" nach "' . $searchstring . '" durchsuchen';
             } else {
                 $title = 'Kategorie "' . $cat->Name . '" durchsuchen';
             }
         }
     }
     if ($requests = $this->getAllRequests()) {
         $requests->setPageLength(15);
         $Data = array('Requests' => $requests, 'ListView' => $displayAsListView, 'Title' => $title, 'MetaTitle' => 'Alle Gesuche', 'MyPage' => false, 'FilterParams' => $this->buildFilterParams(), 'Categories' => $this->getRootCategories(), 'ActiveCategoryID' => Convert::raw2sql($this->getRequest()->getVar('catid')), 'SearchString' => $searchstring, 'SortString' => Convert::raw2sql($this->getRequest()->getVar('sort')), 'Message' => $this->getRequestMessage(), 'CleanSortString' => $this->getCleanSortString());
         //return our $Data array to use, rendering with the ProductPage.ss template
         return $this->customise($Data)->renderWith(array('RequestPage', 'Page'));
     } else {
         return $this->httpError(404, 'Momentan existieren noch keine Gesuche.');
     }
 }