Changeset 12036
- Timestamp:
- 2006-07-06T14:28:57+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cic-hcap/macros/extra.dm
r12035 r12036 1251 1251 if (document.QueryForm.aqv[i].value != "") \{ 1252 1252 var real_index = /aqv([0-9]+)field/.exec(document.QueryForm.aqv[i].id)[1]; 1253 addQueryTerm(document.QueryForm.q, "[" + document.QueryForm.aqv[i].value + "]:" + document.QueryForm.aqi[real_index].value );1253 addQueryTerm(document.QueryForm.q, "[" + document.QueryForm.aqv[i].value + "]:" + document.QueryForm.aqi[real_index].value, "&"); 1254 1254 \} 1255 1255 \} 1256 1256 1257 addIndexValue(document.QueryForm.q, document.QueryForm.fuq, "FU"); 1258 addIndexValue(document.QueryForm.q, document.QueryForm.tmq, "TM"); 1259 addIndexValue(document.QueryForm.q, document.QueryForm.syq, "SY"); 1260 addIndexValue(document.QueryForm.q, document.QueryForm.maq, "MA"); 1261 addIndexValue(document.QueryForm.q, document.QueryForm.deq, "DE"); 1262 addIndexValue(document.QueryForm.q, document.QueryForm.stq, "ST"); 1263 \} 1264 1265 function addIndexValue(query_field_reference, select_reference, index_code) 1257 addIndexValue(document.QueryForm.q, document.QueryForm.fuq, "FU", "&"); 1258 addIndexValue(document.QueryForm.q, document.QueryForm.tmq, "TM", "&"); 1259 addIndexValue(document.QueryForm.q, document.QueryForm.syq, "SY", "&"); 1260 addIndexValue(document.QueryForm.q, document.QueryForm.maq, "MA", "&"); 1261 addIndexValue(document.QueryForm.q, document.QueryForm.deq, "DE", "&"); 1262 addIndexValue(document.QueryForm.q, document.QueryForm.stq, "ST", "&"); 1263 1264 // Remove the trailing combiner 1265 if (document.QueryForm.q.value.lastIndexOf('\)') != -1) \{ 1266 document.QueryForm.q.value = document.QueryForm.q.value.substring(0, document.QueryForm.q.value.lastIndexOf('\)') + 1); 1267 \} 1268 alert(document.QueryForm.q.value); 1269 \} 1270 1271 function addQueryTerm(query_field_reference, index_value, combiner) 1272 \{ 1273 if (index_value != "") \{ 1274 query_field_reference.value += "(" + index_value + ") " + combiner + " "; 1275 \} 1276 \} 1277 1278 function addIndexValue(query_field_reference, select_reference, index_code, combiner) 1266 1279 \{ 1267 1280 var index_value = ""; 1268 1281 for (var i = 0; i < select_reference.options.length; i++) \{ 1269 1282 if (select_reference.options[i].selected) \{ 1270 index_value += ((index_value != "") ? " &" : "");1283 index_value += ((index_value != "") ? " " + combiner + " " : ""); 1271 1284 index_value += '["' + select_reference.options[i].value + '"]:' + index_code; 1272 1285 \} 1273 1286 \} 1274 addQueryTerm(query_field_reference, index_value); 1275 \} 1276 1277 function addQueryTerm(query_field_reference, index_value) 1278 \{ 1279 if (index_value != "") \{ 1280 query_field_reference.value += ((query_field_reference.value != "") ? " & " : ""); 1281 query_field_reference.value += "(" + index_value + ")"; 1282 \} 1287 addQueryTerm(query_field_reference, index_value, "&"); 1283 1288 \} 1284 1289
Note:
See TracChangeset
for help on using the changeset viewer.