Пример #1
0
 /**
  * Show advanced search results.
  */
 function advancedResults()
 {
     parent::validate();
     SearchHandler::setupTemplate(true);
     $rangeInfo = Handler::getRangeInfo('search');
     $publishedPaperDao =& DAORegistry::getDAO('PublishedPaperDAO');
     $searchConferenceId = Request::getUserVar('searchConference');
     if (!empty($searchConferenceId)) {
         $conferenceDao =& DAORegistry::getDAO('ConferenceDAO');
         $conference =& $conferenceDao->getConference($searchConferenceId);
         $yearRange = $publishedPaperDao->getPaperYearRange($conference->getId());
     } else {
         $conference =& Request::getConference();
         $yearRange = $publishedPaperDao->getPaperYearRange(null);
     }
     // Load the keywords array with submitted values
     $keywords = array(null => PaperSearch::parseQuery(Request::getUserVar('query')));
     $keywords[PAPER_SEARCH_AUTHOR] = PaperSearch::parseQuery(Request::getUserVar('author'));
     $keywords[PAPER_SEARCH_TITLE] = PaperSearch::parseQuery(Request::getUserVar('title'));
     $keywords[PAPER_SEARCH_DISCIPLINE] = PaperSearch::parseQuery(Request::getUserVar('discipline'));
     $keywords[PAPER_SEARCH_SUBJECT] = PaperSearch::parseQuery(Request::getUserVar('subject'));
     $keywords[PAPER_SEARCH_TYPE] = PaperSearch::parseQuery(Request::getUserVar('type'));
     $keywords[PAPER_SEARCH_COVERAGE] = PaperSearch::parseQuery(Request::getUserVar('coverage'));
     $keywords[PAPER_SEARCH_GALLEY_FILE] = PaperSearch::parseQuery(Request::getUserVar('fullText'));
     $keywords[PAPER_SEARCH_SUPPLEMENTARY_FILE] = PaperSearch::parseQuery(Request::getUserVar('supplementaryFiles'));
     $fromDate = Request::getUserDateVar('dateFrom', 1, 1);
     if ($fromDate !== null) {
         $fromDate = date('Y-m-d H:i:s', $fromDate);
     }
     $toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);
     if ($toDate !== null) {
         $toDate = date('Y-m-d H:i:s', $toDate);
     }
     $results =& PaperSearch::retrieveResults($conference, $keywords, $fromDate, $toDate, $rangeInfo);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->setCacheability(CACHEABILITY_NO_STORE);
     $templateMgr->assign_by_ref('results', $results);
     SearchHandler::_assignAdvancedSearchParameters($templateMgr, $yearRange);
     $templateMgr->display('search/searchResults.tpl');
 }