From: miker Date: Wed, 7 Apr 2010 14:55:14 +0000 (+0000) Subject: safer still metarecord constituent type/form matching X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f62dc28df9dd18c7a62e3b9d730c6c2c3bb53db0;p=evergreen%2Fbjwebb.git safer still metarecord constituent type/form matching git-svn-id: svn://svn.open-ils.org/ILS/trunk@16155 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/skin/default/js/holds.js b/Open-ILS/web/opac/skin/default/js/holds.js index d2d153df8..4c7c1697c 100644 --- a/Open-ILS/web/opac/skin/default/js/holds.js +++ b/Open-ILS/web/opac/skin/default/js/holds.js @@ -584,6 +584,7 @@ function holdsSetFormatSelector() { for( var i = 0; i < avail_formats.length; i++ ) { var form = avail_formats[i]; var opt = findFormatSelectorOptByParts(selector,form); + if (!opt) continue; if(type=='M') opt.selected=true; unHideMe(opt); } @@ -595,7 +596,7 @@ function findFormatSelectorOptByParts( sel, val ) { var opt = sel.options[i]; var oval = opt.value; var oparts = oval.split('-'); - if( oparts[0].indexOf(parts[0]) > -1 && ((!oparts[1] && !parts[1]) || (oparts[1].indexOf(parts[1]) > -1)) ) return opt; + if( oparts[0].indexOf(parts[0]) > -1 && (!parts[1] || oparts[1].indexOf(parts[1]) > -1) ) return opt; } return null; } @@ -650,8 +651,7 @@ function holdsGetFormats() { function _t_f_2_format(type, form) { if( (type == 'a' || type == 't') && form == 's' ) return 'at-s'; if( form == 'd' ) return 'at-d'; - return (type == 'a' || type == 't') ? 'at' : - ( type == 'i' || type == 'g' || type == 'j' ) ? type : null; + return (type == 'a' || type == 't') ? 'at' : type; } function holdsSetSelectedFormats() {