Project

General

Profile

« Previous | Next » 

Revision 4562

added "generic" search term picklist
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3520

View differences:

lib/style/skins/first/search.js
388 388
                         
389 389
    for (var i in searchTerms) {
390 390
    	var key = i;
391
    	var value = searchTerms[i];                        
392
		queryString +=
393
			"<queryterm searchmode=\"contains\" casesensitive=\"false\">";
394
			if (key != "anyValue") {
395
				queryString += "<pathexpr>" + key + "</pathexpr>";
396
			}	
397
	      	queryString += "<value>" + value + "</value>";
398
	    queryString +="</queryterm>";
391
    	var value = searchTerms[i];
392
    	//only if we have a value  
393
    	if (value.length > 0) {                   
394
			queryString +=
395
				"<queryterm searchmode=\"contains\" casesensitive=\"false\">";
396
				if (key != "anyValue") {
397
					queryString += "<pathexpr>" + key + "</pathexpr>";
398
				}	
399
		      	queryString += "<value>" + value + "</value>";
400
		    queryString +="</queryterm>";
401
		}
399 402
    }
400 403
    
401 404
	queryString +=
lib/style/skins/first/index.jsp
59 59
			var instructor = document.getElementById("instructor").value;
60 60
			var course = document.getElementById("course").value;
61 61
			var year = document.getElementById("year").value;
62
			var otherField = document.getElementById("otherField").value;
63
			var otherValue = document.getElementById("otherValue").value;
62 64
			var searchTerms = new Object();
63 65
			searchTerms["anyValue"] = searchString;
64 66
			searchTerms["institution/organizationName"] = institution;
65 67
			searchTerms["instructor/individualName/surName"] = instructor;
66 68
			searchTerms["course/lom/general/title/string"] = course;
67 69
			searchTerms["course/year"] = year;
70
			searchTerms[otherField] = otherValue;
68 71
			
69 72
			var operator = "UNION";
70 73
			if (document.getElementById("all").checked) {
......
139 142
								<td>Year: </td>
140 143
								<td><input name="year" id="year" type="text" size="4"/></td>
141 144
							</tr>
145
							<tr>
146
								<td>
147
									<select id="otherField" name="otherValue">
148
										<option value="assessment/@title">Assessment Title</option>
149
										<option value="assessment/@type">Assessment Type</option>
150
										<option value="assessment/duration">Assessment Duration</option>
151
										<option value="course/term">Course Term</option>
152
									</select>
153
								</td>
154
								<td><input name="otherValue" id="otherValue" type="text" size="14"/></td>
155
							</tr>
142 156
						</table>
143 157
					</td>
144 158
					<td valign="bottom" class="borderbottom">

Also available in: Unified diff