Project

General

Profile

« Previous | Next » 

Revision efa372e9

Added by Andreas Kohlbecker almost 6 years ago

fix #4497 simple exclusion of all areas with absent status from taxon search

View differences:

modules/cdm_dataportal/cdm_dataportal.search.php
503 503
 *   the processed request parameters submitted by the search form and
504 504
 *   also stores them in $_SESSION['cdm']['search']
505 505
 */
506
function cdm_dataportal_search_form_request()
506
function cdm_dataportal_search_request()
507 507
{
508 508

  
509 509
  $form_params = array();
......
535 535
    foreach ($_REQUEST['search']['areas']['area'] as $areas) {
536 536
      $area_uuids = array_merge($area_uuids, $areas);
537 537
    }
538
    // The area filter is limited to areas with non absent distribution status
539
    $presence_terms_options = cdm_vocabulary_as_option(UUID_PRESENCE_ABSENCE_TERM, null, FALSE, array('absenceTerm' => '/false/'));
540
    $presence_term_uuids = array_keys($presence_terms_options);
541
    $form_params['status'] = $presence_term_uuids;
538 542
  }
539 543
  if(count($area_uuids) > 0){
540 544
    $form_params['area'] = implode(',', $area_uuids);
......
546 550
  if (!isset($form_params['tree']) && !variable_get(SIMPLE_SEARCH_IGNORE_CLASSIFICATION, 0)) {
547 551
    $form_params['tree'] = get_current_classification_uuid();
548 552
  }
549
  // If the 'NONE' classification has been chosen (adanced search)
553
  // If the 'NONE' classification has been chosen (advanced search)
550 554
  // delete the tree information to avoid unknown uuid exceptions in the
551 555
  // cdm service.
552 556
  if (isset($form_params['tree'])
......
569 573
 * Provides the classification to which the last search has been limited to..
570 574
 *
571 575
 * This function should only be used after the cdm_dataportal_search_execute()
572
 * handler has been run, otherwise it will return the infomation from the last
576
 * handler has been run, otherwise it will return the information from the last
573 577
 * search executed. The information is retrieved from
574 578
 * the $_SESSION variable:  $_SESSION['cdm']['search']['tree']
575 579
 *
......
607 611
 * Sends a search request at the cdm web server.
608 612
 *
609 613
 * The parameters to build the query are taken obtained by calling
610
 * cdm_dataportal_search_form_request() which reads the query parameters
614
 * cdm_dataportal_search_request() which reads the query parameters
611 615
 * from $_REQUEST and add additional query parameters if nessecary.
612 616
 *
613
 * @see cdm_dataportal_search_form_request()
617
 * @see cdm_dataportal_search_request()
614 618
 */
615 619
function cdm_dataportal_search_execute() {
616 620

  
......
634 638

  
635 639
  // Read the query parameters from $_REQUEST and add additional query
636 640
  // parameters if necessary.
637
  $request_params = cdm_dataportal_search_form_request();
641
  $request_params = cdm_dataportal_search_request();
638 642

  
639 643
  $taxon_pager = cdm_ws_get($_REQUEST['ws'], NULL, queryString($request_params));
640 644

  

Also available in: Unified diff