Ignore:
Timestamp:
Feb 23, 2011, 1:25:46 PM (10 years ago)
Author:
t.w.abma@…
Message:
  • duplicate fuzzymatched properties fixed, when a fuzzy match has been used for a property, the next properties having the same fuzzy match will be put on "don't import"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/importer/common/_properties_horizontal.gsp

    r1525 r1552  
    3636                <g:select name="importmapping_id" from="${importer_importmappings}" noSelection="['':'-Select mapping-']" optionValue="name" optionKey="id"/>
    3737              </div>
    38             </td>           
     38            </td>
     39           
     40            <g:set var="usedfuzzymatches" value="${'-'}"/>
     41
    3942            <g:each var="mappingcolumn" in="${importer_header}">
    4043              <!-- set selected values based on submitted columnproperties, actually refresh -->
     
    4649              </g:else>
    4750
     51              <g:set var="matchvalue" value="${mappingcolumn.name}"/>
     52
    4853                          <td class="header" width="200px">
    4954                                <b>${mappingcolumn.name}</b>
    50                   <importer:propertyChooser name="columnproperty" mappingcolumn="${mappingcolumn}" matchvalue="${mappingcolumn.name}" selected="${selected}" fuzzymatching="${importer_fuzzymatching}" template_id="${importer_template_id}" "allfieldtypes="true"/>
    51                           </td>                                 
     55
     56                <!-- store the found match -->
     57                <g:set var="fuzzymatch" value="${importer.propertyChooser(name:columnproperty, mappingcolumn:mappingcolumn, matchvalue:mappingcolumn.name, selected:selected, fuzzymatching:importer_fuzzymatching, template_id:importer_template_id, returnmatchonly:'true')}"/>
     58 
     59                  <g:if test="${usedfuzzymatches.contains( fuzzymatch.toString() ) }">                       
     60                       <g:set var="matchvalue" value=""/>
     61                  </g:if>                 
     62               
     63                  <importer:propertyChooser name="columnproperty" mappingcolumn="${mappingcolumn}" matchvalue="${matchvalue}" selected="${selected}" fuzzymatching="${importer_fuzzymatching}" template_id="${importer_template_id}" allfieldtypes="true"/>
     64                          </td>
     65
     66              <!-- build up a string with fuzzy matches used, to prevent duplicate fuzzy matching -->
     67              <g:set var="usedfuzzymatches" value="${usedfuzzymatches + ',' + fuzzymatch.toString() }"/>
     68
    5269            </g:each>
    5370                </tr>
Note: See TracChangeset for help on using the changeset viewer.