Project

General

Profile

Revision f35d3f4a

IDf35d3f4af268376f38613236284c902269cb70e9
Parent e8074ec5
Child 24f57e45

Added by Patrick Plitzner over 5 years ago

#5890 Handle taxon name parsing in service method -> only pass taxon
name

View differences:

modules/cdm_dataportal/cdm_csv_export/cdm_csv_export.module
111 111
    $form['csv_export_taxon_select'] = array(
112 112
        '#title' => t('Taxon'),
113 113
        '#type' => 'textfield',
114
        '#name' => 'taxonName',
114 115
        '#prefix' => '<div id="taxon-selection">',
115 116
        '#suffix' => '</div>',
116
        '#attributes' => array(
117
            'onchange' => 'return validateForm()'
118
        ),
119 117
    );
120 118
    if(variable_get('cdm_dataportal_taxon_auto_suggest')){
121 119
        $form['csv_export_taxon_select']['#autocomplete_path'] = 'cdm_dataportal/taxon/autosuggest////';
122 120
    }
123
    $form['taxonUuidStore'] = array(
124
        '#type' => 'hidden',
125
        '#value' => '',
126
        '#name' => taxonUuid,
127
        '#attributes' => array(
128
            'id' => 'taxonUuid',
129
        )
130
    );
131 121

  
132 122
    $form['redListField'] = array(
133 123
        '#type' => 'fieldset',
modules/cdm_dataportal/cdm_csv_export/js/cdm_csv_export.js
36 36
    if(classification_select.value==null || classification_select.value == -1|| classification_select.value==""){
37 37
        classification_select.selectedIndex = 0;
38 38
    }
39
    var taxon_select = document.getElementById("edit-csv-export-taxon-select");
40
    var taxon_uuid = document.getElementById("taxonUuid");
41
    var selectedTaxon = taxon_select.value.toString();
42
    if(selectedTaxon!=null){
43
        uuid = selectedTaxon.substring(selectedTaxon.indexOf("[[")+2);
44
		selectedTaxon = selectedTaxon.substring(0, selectedTaxon.indexOf("[["));
45
        taxon_select.value = selectedTaxon;
46
        taxon_uuid.value = uuid;
47
    }
48 39
}
49 40

  
50 41

  
modules/cdm_dataportal/cdm_dataportal.search.php
147 147
      $titleCache = $record->entity->titleCache;
148 148
      preg_match('/(.*) sec.*/', $titleCache, $trimmedTitle); //remove sec reference
149 149
      $trimmedTitle = trim($trimmedTitle[1]);
150
      $matches[$trimmedTitle.'[['.$record->entity->uuid] = check_plain($trimmedTitle).'[['.$record->entity->uuid;
150
      $matches[$trimmedTitle] = check_plain($trimmedTitle);
151 151
  }
152 152
  drupal_json_output($matches);
153 153
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)