[open-ils-commits] r8070 - in trunk/Open-ILS/web/opac: common/js skin/default/css skin/default/js skin/default/xml/common

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 15 18:11:26 EST 2007


Author: erickson
Date: 2007-11-15 17:54:33 -0500 (Thu, 15 Nov 2007)
New Revision: 8070

Modified:
   trunk/Open-ILS/web/opac/common/js/config.js
   trunk/Open-ILS/web/opac/skin/default/css/layout.css
   trunk/Open-ILS/web/opac/skin/default/js/adv_global.js
   trunk/Open-ILS/web/opac/skin/default/js/mresult.js
   trunk/Open-ILS/web/opac/skin/default/js/result_common.js
   trunk/Open-ILS/web/opac/skin/default/js/rresult.js
   trunk/Open-ILS/web/opac/skin/default/xml/common/searchbar.xml
Log:
now calling the new search query parsing method for regular bib and metabib searches.  compiling adv. searches into new query lang.  more to do....

Modified: trunk/Open-ILS/web/opac/common/js/config.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/config.js	2007-11-15 22:01:45 UTC (rev 8069)
+++ trunk/Open-ILS/web/opac/common/js/config.js	2007-11-15 22:54:33 UTC (rev 8070)
@@ -272,6 +272,8 @@
 
 var SEARCH_MRS						= 'open-ils.search:open-ils.search.metabib.multiclass:1';
 var SEARCH_RS						= 'open-ils.search:open-ils.search.biblio.multiclass:1';
+var SEARCH_MRS_QUERY			= 'open-ils.search:open-ils.search.metabib.multiclass.query:1';
+var SEARCH_RS_QUERY             = 'open-ils.search:open-ils.search.biblio.multiclass.query:1';
 var FETCH_SEARCH_RIDS			= "open-ils.search:open-ils.search.biblio.record.class.search:1";
 var FETCH_MRMODS					= "open-ils.search:open-ils.search.biblio.metarecord.mods_slim.retrieve";
 var FETCH_MODS_FROM_COPY		= "open-ils.search:open-ils.search.biblio.mods_from_copy";

Modified: trunk/Open-ILS/web/opac/skin/default/css/layout.css
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/css/layout.css	2007-11-15 22:01:45 UTC (rev 8069)
+++ trunk/Open-ILS/web/opac/skin/default/css/layout.css	2007-11-15 22:54:33 UTC (rev 8070)
@@ -82,6 +82,7 @@
 #searchbar_table { border-collapse: collapse; }
 
 .search_box_container { width: 240px; padding: 3px; }/* border: 1px solid #A0A0A0;' class='color_2'>*/
+#search_box { width: 260px; }
 
 
 /* ---------------------------------------------------------------------- */

Modified: trunk/Open-ILS/web/opac/skin/default/js/adv_global.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/adv_global.js	2007-11-15 22:01:45 UTC (rev 8069)
+++ trunk/Open-ILS/web/opac/skin/default/js/adv_global.js	2007-11-15 22:54:33 UTC (rev 8070)
@@ -118,14 +118,14 @@
 	args[PARAM_LITFORM]	= litforms;
 	args[PARAM_AUDIENCE]	= audiences;
 	args[PARAM_LANGUAGE] = languages;
-	args[PARAM_SEARCHES]	= js2JSON(searches); /* break these out */
+	//args[PARAM_SEARCHES]	= js2JSON(searches); /* break these out */
 	args[PARAM_DEPTH]		= depthSelGetDepth();
 	args[PARAM_LOCATION]	= depthSelGetNewLoc();
 	args[PARAM_SORT]		= sortby;
 	args[PARAM_SORT_DIR]	= sortdir;
 	args[PARAM_ADVTYPE]	= ADVTYPE_MULTI;
 	args[PARAM_STYPE]		= "";
-	args[PARAM_TERM]		= "";
+	args[PARAM_TERM]		= searches;
 	args[PARAM_AVAIL]		= limit2avail;
 
 	/* pubdate sorting causes a record (not metarecord) search */
@@ -146,7 +146,7 @@
 
 function advBuildSearchBlob() {
 
-	var searches;
+	var searches = '';
 	var tbody    = $('adv_global_tbody');
 	var rows     = tbody.getElementsByTagName('tr');
 
@@ -162,14 +162,6 @@
 		if(!term) continue;
 
 		var string = "";
-
-		if(!searches) searches = {};
-
-		if(searches[stype]) 
-			string = searches[stype].term;
-		else 
-			searches[stype] = { term : "" };
-
 		switch(contains) {
 			case 'contains' : 
 				string += " " + term; 
@@ -190,10 +182,15 @@
 		if(string) {
 			string = string.replace(/'/g,' ');
 			string = string.replace(/\\/g,' ');
-			searches[stype].term = string;
+            string = string.replace(/^\s*/,'');
+            string = string.replace(/\s*$/,'');
+			//searches[stype].term = string;
+            if(searches) searches += ' ';
+            searches += stype + ':'+ string;
 		}
 	}
 
+    _debug("created search query " + searches);
 	return searches;
 }
 

Modified: trunk/Open-ILS/web/opac/skin/default/js/mresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/mresult.js	2007-11-15 22:01:45 UTC (rev 8069)
+++ trunk/Open-ILS/web/opac/skin/default/js/mresult.js	2007-11-15 22:54:33 UTC (rev 8070)
@@ -37,11 +37,11 @@
 }
 
 function _mresultCollectIds() { 
-	resultCollectSearchIds(true, SEARCH_MRS, mresultHandleMRIds ); 
+	resultCollectSearchIds(true, SEARCH_MRS_QUERY, mresultHandleMRIds ); 
 }
 
 function mresultCollectAdvIds() { 
-	resultCollectSearchIds(false, SEARCH_MRS, mresultHandleMRIds ); 
+	resultCollectSearchIds(false, SEARCH_MRS_QUERY, mresultHandleMRIds ); 
 }
 
 

Modified: trunk/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/result_common.js	2007-11-15 22:01:45 UTC (rev 8069)
+++ trunk/Open-ILS/web/opac/skin/default/js/result_common.js	2007-11-15 22:54:33 UTC (rev 8070)
@@ -42,21 +42,11 @@
 	var args = {};
 
 	if( type ) {
-		args.searches = {};
-		args.searches[getStype()] = {};
-		var term = getTerm();
-		if( term ) {
-			term = term.replace(/'/g,' ');
-			term = term.replace(/\\/g,' ');
-			args.searches[getStype()].term = term;
-		}
-
 		var form = parseForm(getForm());
 		item_type = form.item_type;
 		item_form = form.item_form;
 
 	} else {
-		args.searches = JSON2js(getSearches());
 		item_type = (getItemType()) ? getItemType().split(/,/) : null;
 		item_form = (getItemForm()) ? getItemForm().split(/,/) : null;
 	}
@@ -73,6 +63,7 @@
 	args.limit    = limit;
 	args.offset   = getOffset();
 	args.visibility_limit = 3000;
+    args.default_class = getStype();
 
 	if(sort) args.sort = sort;
 	if(sortdir) args.sort_dir = sortdir;
@@ -85,10 +76,10 @@
 	if(getLitForm()) args.lit_form	= getLitForm().split(/,/);
 	if(getLanguage()) args.language	= getLanguage().split(/,/);
 
-	//alert(js2JSON(args));
+	_debug('Search args: ' + js2JSON(args));
+	_debug('Raw query: ' + getTerm());
 
-	_debug('SEARCH: \n' + js2JSON(args) + '\n\n');
-	var req = new Request(method, args, 1);
+	var req = new Request(method, args, getTerm(), 1);
 	req.callback(handler);
 	req.send();
 }
@@ -184,6 +175,8 @@
 	sreq.callback(resultSuggestSpelling);
 	sreq.send();
 
+    /* XXX patch to use the search results */
+
 	var words = getTerm().split(' ');
 	var word;
 	while( word = words.shift() ) {

Modified: trunk/Open-ILS/web/opac/skin/default/js/rresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rresult.js	2007-11-15 22:01:45 UTC (rev 8069)
+++ trunk/Open-ILS/web/opac/skin/default/js/rresult.js	2007-11-15 22:54:33 UTC (rev 8070)
@@ -283,12 +283,12 @@
 
 function rresultDoRecordSearch() { 
 	rresultIsPaged = true;
-	resultCollectSearchIds(true, SEARCH_RS, rresultFilterSearchResults ); 
+	resultCollectSearchIds(true, SEARCH_RS_QUERY, rresultFilterSearchResults ); 
 }
 
 function rresultDoRecordMultiSearch() { 
 	rresultIsPaged = true;
-	resultCollectSearchIds(false, SEARCH_RS, rresultFilterSearchResults ); 
+	resultCollectSearchIds(false, SEARCH_RS_QUERY, rresultFilterSearchResults ); 
 }
 
 

Modified: trunk/Open-ILS/web/opac/skin/default/xml/common/searchbar.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/common/searchbar.xml	2007-11-15 22:01:45 UTC (rev 8069)
+++ trunk/Open-ILS/web/opac/skin/default/xml/common/searchbar.xml	2007-11-15 22:54:33 UTC (rev 8070)
@@ -28,7 +28,7 @@
 
 				<td nowrap='nowrap' align='center'  class='search_box_container color_2'>
 
-					<input id='search_box' style='width: 190px;' type='text' />
+					<input id='search_box' type='text' />
 					<span style='padding-left: 6px;'>
 						<input type='button' style='width: 40px;' id='search_submit' value='&button.go;' />
 					</span>



More information about the open-ils-commits mailing list