link = 'catalogue/search.pl?q=';
} else if ( content.length == 12 && content.substr(0,2) == 20 ) {
link = 'members/member.pl?member=';
+ } else if ( tag.tag_type == 'SmartX' ) {
+ link = 'members/member.pl?member=';
} else {
html += '<b>UNKNOWN TAG</b> '+content;
}
}
console.debug( 'calling', state, content );
- window[state]( content, tag.sid ); // call function with barcode
+ window[state]( content, tag ); // call function with barcode
}
});
var circulation_type;
var book_barcodes = {};
-function start( cardnumber ) {
+function start( cardnumber, tag ) {
- if ( cardnumber.length != 12 || cardnumber.substr(0,2) != "20" ) {
- console.error(cardnumber, ' is not borrower card');
+ if ( tag.tag_type != 'SmartX' && ( cardnumber.length != 12 || cardnumber.substr(0,2) != "20" ) ) {
+ console.error(cardnumber, 'is not borrower card', tag);
return;
}
// nop
}
-function circulation( barcode, sid ) {
+function circulation( barcode, tag ) {
if ( barcode
&& barcode.length == 10
&& barcode.substr(0,3) == 130
) { // book, not seen yet
book_barcodes[ barcode ] = 1;
pending_jsonp++;
- $.getJSON('/sip2/'+circulation_type+'/'+borrower_cardnumber+'/'+barcode+'/'+sid , function( data ) {
+ $.getJSON('/sip2/'+circulation_type+'/'+borrower_cardnumber+'/'+barcode+'/'+tag.sid , function( data ) {
console.info( circulation_type, data );
var color = 'red';