[open-ils-commits] r10711 - in trunk/Open-ILS/web/opac: common/js
locale/en-US skin/default/js skin/default/xml/advanced
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 26 14:54:22 EDT 2008
Author: erickson
Date: 2008-09-26 14:54:19 -0400 (Fri, 26 Sep 2008)
New Revision: 10711
Modified:
trunk/Open-ILS/web/opac/common/js/config.js
trunk/Open-ILS/web/opac/common/js/opac_utils.js
trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
trunk/Open-ILS/web/opac/skin/default/js/adv_global.js
trunk/Open-ILS/web/opac/skin/default/js/result_common.js
trunk/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml
Log:
added params for filtering pubdate before/after/between/during. added functional support for before/after/between from advanced search interface. suggestions on labels appreciated
Modified: trunk/Open-ILS/web/opac/common/js/config.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/config.js 2008-09-26 18:43:36 UTC (rev 10710)
+++ trunk/Open-ILS/web/opac/common/js/config.js 2008-09-26 18:54:19 UTC (rev 10711)
@@ -39,6 +39,10 @@
var PARAM_REDIR = 're'; /* true if we have been redirected by IP (we're at a real lib) */
var PARAM_AVAIL = 'av'; /* limit search results to available items */
var PARAM_COPYLOCS = 'cl'; // copy (shelving) locations
+var PARAM_PUBD_BEFORE = 'pdb';
+var PARAM_PUBD_AFTER = 'pda';
+var PARAM_PUBD_BETWEEN = 'pdt';
+var PARAM_PUBD_DURING = 'pdd';
/* URL param values (see comments above) */
var TERM;
@@ -75,6 +79,10 @@
var RDEPTH;
var AVAIL;
var COPYLOCS;
+var PUBD_BEFORE;
+var PUBD_AFTER;
+var PUBD_BETWEEN;
+var PUBD_DURING;
/* cookie values */
var SBEXTRAS;
Modified: trunk/Open-ILS/web/opac/common/js/opac_utils.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/opac_utils.js 2008-09-26 18:43:36 UTC (rev 10710)
+++ trunk/Open-ILS/web/opac/common/js/opac_utils.js 2008-09-26 18:54:19 UTC (rev 10711)
@@ -167,8 +167,12 @@
RDEPTH = cgi.param(PARAM_RDEPTH);
AVAIL = cgi.param(PARAM_AVAIL);
COPYLOCS = cgi.param(PARAM_COPYLOCS);
+ PUBD_BEFORE = cgi.param(PARAM_PUBD_BEFORE);
+ PUBD_AFTER = cgi.param(PARAM_PUBD_AFTER);
+ PUBD_BETWEEN = cgi.param(PARAM_PUBD_BETWEEN);
+ PUBD_DURING = cgi.param(PARAM_PUBD_DURING);
+
-
/* set up some sane defaults */
//if(isNaN(DEPTH)) DEPTH = 0;
if(isNaN(RDEPTH)) RDEPTH = 0;
@@ -208,6 +212,10 @@
RDEPTH = null;
AVAIL = null;
COPYLOCS = null;
+ PUBD_BEFORE = null;
+ PUBD_AFTER = null;
+ PUBD_BETWEEN = null;
+ PUBD_DURING = null;
}
@@ -219,8 +227,6 @@
SKIN = cookieManager.read(COOKIE_SKIN);
if(findCurrentPage() == HOME)
cookieManager.remove(COOKIE_SEARCH);
-
-
}
/* URL param accessors */
@@ -258,6 +264,10 @@
function getRdepth() { return RDEPTH; }
function getAvail() { return AVAIL; }
function getCopyLocs() { return COPYLOCS; }
+function getPubdBefore() { return PUBD_BEFORE; }
+function getPubdAfter() { return PUBD_AFTER; }
+function getPubdBetween() { return PUBD_BETWEEN; }
+function getPubdDuring() { return PUBD_DURING; }
function findBasePath() {
@@ -412,7 +422,16 @@
string += _appendParam(AVAIL, PARAM_AVAIL, args, getAvail, string);
if(getCopyLocs())
string += _appendParam(COPYLOCS, PARAM_COPYLOCS, args, getCopyLocs, string);
+ if(getPubdBefore())
+ string += _appendParam(PUBD_BEFORE, PARAM_PUBD_BEFORE, args, getPubdBefore, string);
+ if(getPubdAfter())
+ string += _appendParam(PUBD_AFTER, PARAM_PUBD_AFTER, args, getPubdAfter, string);
+ if(getPubdBetween())
+ string += _appendParam(PUBD_BETWEEN, PARAM_PUBD_BETWEEN, args, getPubdBetween, string);
+ if(getPubdDuring())
+ string += _appendParam(PUBD_DURING, PARAM_PUBD_DURING, args, getPubdDuring, string);
+
return string.replace(/\&$/,'').replace(/\?\&/,"?");
}
Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-09-26 18:43:36 UTC (rev 10710)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-09-26 18:54:19 UTC (rev 10711)
@@ -464,6 +464,12 @@
<!ENTITY advanced.sort.desc "Descending / Z to A">
<!ENTITY advanced.frbrize "Group Formats and Editions">
<!ENTITY advanced.go "Go">
+<!ENTITY advanced.biblevel "Bib Level">
+<!ENTITY advanced.filter.pubyear "Publication Year">
+<!ENTITY advanced.filter.pubyear.equals "Is">
+<!ENTITY advanced.filter.pubyear.before "Before">
+<!ENTITY advanced.filter.pubyear.after "After">
+<!ENTITY advanced.filter.pubyear.between "Between">
<!-- =================================================================
Rdetail
Modified: trunk/Open-ILS/web/opac/skin/default/js/adv_global.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/adv_global.js 2008-09-26 18:43:36 UTC (rev 10710)
+++ trunk/Open-ILS/web/opac/skin/default/js/adv_global.js 2008-09-26 18:54:19 UTC (rev 10711)
@@ -49,11 +49,36 @@
if(getAvail())
$('opac.result.limit2avail').checked = true;
+ // not sure we want to propogate the pubdate filter,
+ // since other filters are not propogated
+ //advInitPubFilter();
+
initSearchBoxes();
-
advSyncCopyLocLink(getLocation());
}
+function advInitPubFilter() {
+ var i1 = $('adv_global_pub_date_1');
+ var i2 = $('adv_global_pub_date_2');
+ var sel = $('adv_global_pub_date_type');
+ if(getPubdBefore()) {
+ i1.value = getPubdBefore();
+ setSelector(sel, 'before');
+ } else if(getPubdAfter()) {
+ i1.value = getPubdAfter();
+ setSelector(sel, 'after');
+ } else if(getPubdBetween()) {
+ var values = getPubdBetween().split(',');
+ i1.value = values[0]
+ if(values[0] == values[1]) {
+ setSelector(sel, 'equals');
+ } else {
+ setSelector(sel, 'between');
+ i2.value = values[1];
+ }
+ }
+}
+
function advSyncCopyLocLink(org) {
// display the option to filter by copy location
advLocationsLoaded = false;
@@ -202,6 +227,27 @@
args[PARAM_TERM] = searches;
args[PARAM_AVAIL] = limit2avail;
+ // publicate year filtering
+ var pub1;
+ if( (pub1 = $('adv_global_pub_date_1').value) && (''+pub1).match(/\d{4}/)) {
+ switch(getSelectorVal($('adv_global_pub_date_type'))) {
+ case 'equals':
+ args[PARAM_PUBD_BETWEEN] = pub1+','+pub1;
+ break;
+ case 'before':
+ args[PARAM_PUBD_BEFORE] = pub1;
+ break;
+ case 'after':
+ args[PARAM_PUBD_AFTER] = pub1;
+ break;
+ case 'between':
+ var pub2 = $('adv_global_pub_date_2').value;
+ if((''+pub2).match(/\d{4}/))
+ args[PARAM_PUBD_BETWEEN] = pub1+','+pub2;
+ break;
+ }
+ }
+
/* pubdate sorting causes a record (not metarecord) search */
if( sortby == SORT_TYPE_PUBDATE || !$('adv_group_titles').checked ) {
args.page = RRESULT;
Modified: trunk/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/result_common.js 2008-09-26 18:43:36 UTC (rev 10710)
+++ trunk/Open-ILS/web/opac/skin/default/js/result_common.js 2008-09-26 18:54:19 UTC (rev 10711)
@@ -86,6 +86,9 @@
if(getLanguage()) args.language = getLanguage().split(/,/);
if(getBibLevel()) args.bib_level = getBibLevel().split(/,/);
if(getCopyLocs()) args.locations = getCopyLocs().split(/,/);
+ if(getPubdBefore()) args.before = getPubdBefore();
+ else if(getPubdAfter()) args.after = getPubdAfter();
+ else if(getPubdBetween()) args.between = getPubdBetween().split(/,/);
_debug('Search args: ' + js2JSON(args));
_debug('Raw query: ' + getTerm());
Modified: trunk/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml 2008-09-26 18:43:36 UTC (rev 10710)
+++ trunk/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml 2008-09-26 18:54:19 UTC (rev 10711)
@@ -174,7 +174,7 @@
<tr>
<td align='right'>
- <span>Bib Level</span>
+ <span>&advanced.biblevel;</span>
</td>
<td align='left'>
<select multiple='multiple' size='3' id='adv_global_bib_level'>
@@ -182,6 +182,31 @@
</td>
</tr>
+ <tr>
+ <td align='right'>
+ <span>&advanced.filter.pubyear;</span>
+ </td>
+ <td align='left'>
+ <select id='adv_global_pub_date_type' onchange='
+ if($("adv_global_pub_date_type").selectedIndex == 3)
+ unHideMe($("adv_global_pub_date_2_span"));
+ else
+ hideMe($("adv_global_pub_date_2_span"));'>
+ <option value='equals' selected='selected'>&advanced.filter.pubyear.equals;</option>
+ <option value='before'>&advanced.filter.pubyear.before;</option>
+ <option value='after'>&advanced.filter.pubyear.after;</option>
+ <option value='between'>&advanced.filter.pubyear.between;</option>
+ </select>
+ <div style='margin-top:5px;'>
+ <input id='adv_global_pub_date_1' type='text' size='4' maxlength='4'/>
+ <span id='adv_global_pub_date_2_span' class='hide_me'>
+ &common.and; <input id='adv_global_pub_date_2' type='text' size='4' maxlength='4'/>
+ </span>
+ </div>
+ </td>
+ </tr>
+
+
<!-- copy location selector -->
<tr id='adv_copy_location_filter_row' class='hide_me'>
<td align='right'>&opac.advanced.copy_loc_filter;</td>
@@ -196,7 +221,7 @@
</tr>
<tr style='border-top: none;'>
- <td align='center' valign='bottom' style='border-top: none;'>
+ <td align='center' valign='top' style='border-top: none;'>
<table style='border: none; width: 100%;'>
<tr>
More information about the open-ils-commits
mailing list