From 9e396e70ff5f7f7fb4ec7f8a1d4456531ef83193 Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Mon, 15 Aug 2016 11:09:13 -0400 Subject: [PATCH 01/20] Relax blacklight version requirement --- blacklight_cornell_requests.gemspec | 2 +- release_notes.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/blacklight_cornell_requests.gemspec b/blacklight_cornell_requests.gemspec index 0cee801..dec1314 100755 --- a/blacklight_cornell_requests.gemspec +++ b/blacklight_cornell_requests.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |s| s.add_dependency 'haml-rails' s.add_dependency 'httpclient' s.add_dependency 'net-ldap' - s.add_dependency 'blacklight',['5.9'] + s.add_dependency 'blacklight',['>= 5.9'] s.add_dependency 'i18n' s.add_dependency 'nokogiri' s.add_dependency 'dotenv' diff --git a/release_notes.md b/release_notes.md index 9a62814..dfc476c 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,9 @@ # Release Notes - blacklight-cornell-requests +## v1.3 + +- Updated to work with Blacklight 6 (now requires Blacklight 5.9 or higher) + ## v1.2.5 ### Bug fixes From b8c15dd8912800ecc8a401dd4735830a7b05633e Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Tue, 16 Aug 2016 11:34:43 -0400 Subject: [PATCH 02/20] v1.3beta (BL6): Replace call to SolrHelper with Blacklight::Catalog fetch method --- .../request_controller.rb | 13 ++++++++++--- lib/blacklight_cornell_requests/version.rb | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/controllers/blacklight_cornell_requests/request_controller.rb b/app/controllers/blacklight_cornell_requests/request_controller.rb index 2311fe3..4e0d704 100755 --- a/app/controllers/blacklight_cornell_requests/request_controller.rb +++ b/app/controllers/blacklight_cornell_requests/request_controller.rb @@ -4,13 +4,20 @@ module BlacklightCornellRequests class RequestController < ApplicationController - include Blacklight::SolrHelper + include Blacklight::Catalog # needed for "fetch", replaces "include SolrHelper" include Cornell::LDAP - + + # This may seem redundant, but it makes it easier to fetch the document from + # various model classes + def get_solr_doc doc_id + resp, document = fetch doc_id + document + end + def magic_request target='' @id = params[:bibid] - resp, @document = get_solr_response_for_doc_id(@id) + resp, @document = fetch @id @document = @document Rails.logger.debug "Viewing item #{@id} (within request controller) - session: #{session}" diff --git a/lib/blacklight_cornell_requests/version.rb b/lib/blacklight_cornell_requests/version.rb index 72be193..b75a49e 100755 --- a/lib/blacklight_cornell_requests/version.rb +++ b/lib/blacklight_cornell_requests/version.rb @@ -1,3 +1,3 @@ module BlacklightCornellRequests - VERSION = "1.2.5" + VERSION = "1.3beta" end From 0b141d89c010c8fc4677fd98ac957ef4be2cdb14 Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Tue, 16 Aug 2016 11:38:49 -0400 Subject: [PATCH 03/20] Replace catalog_path with solr_document_path --- app/views/shared/_back_to_item.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_back_to_item.html.haml b/app/views/shared/_back_to_item.html.haml index 93c8f2f..5ed546e 100644 --- a/app/views/shared/_back_to_item.html.haml +++ b/app/views/shared/_back_to_item.html.haml @@ -1,8 +1,8 @@ - if @counter.blank? - = link_to catalog_path(@id), { :title => @ti, :class => 'return-link' } do + = link_to solr_document_path(@id), { :title => @ti, :class => 'return-link' } do %i.fa.fa-arrow-circle-left Back to item - else - = link_to catalog_path(@id), { :title => @ti, :class => 'return-link', 'data-counter'.to_sym => @counter } do + = link_to solr_document_path(@id), { :title => @ti, :class => 'return-link', 'data-counter'.to_sym => @counter } do %i.fa.fa-arrow-circle-left Back to item \ No newline at end of file From 2f35c3580b99e7170ccf87f9521c608b3f3aaa52 Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Tue, 16 Aug 2016 14:07:14 -0400 Subject: [PATCH 04/20] Remove calls to render_document_show_field_value and use ShowPresenter.field_value instead --- .../request_helper.rb | 7 +- .../request/bd.html.haml | 3 +- .../request/document_delivery.html.haml | 3 +- .../request/hold.html.haml | 3 +- .../request/l2l.html.haml | 8 +- .../request/pda.html.haml | 3 +- .../request/purchase.html.haml | 105 ++++++++++-------- .../request/recall.html.haml | 3 +- 8 files changed, 73 insertions(+), 62 deletions(-) diff --git a/app/helpers/blacklight_cornell_requests/request_helper.rb b/app/helpers/blacklight_cornell_requests/request_helper.rb index 9d8a06f..e57d1b9 100755 --- a/app/helpers/blacklight_cornell_requests/request_helper.rb +++ b/app/helpers/blacklight_cornell_requests/request_helper.rb @@ -12,6 +12,11 @@ def delivery_estimate_display time_estimate end end - + + # Retrieve the 'responsibility' field value (used by several views) + def take_responsibility + Blacklight::ShowPresenter.new(@document, self).field_value 'title_responsibility_display' + end + end end diff --git a/app/views/blacklight_cornell_requests/request/bd.html.haml b/app/views/blacklight_cornell_requests/request/bd.html.haml index 06c369d..f1227e0 100644 --- a/app/views/blacklight_cornell_requests/request/bd.html.haml +++ b/app/views/blacklight_cornell_requests/request/bd.html.haml @@ -1,6 +1,5 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') --responsibility = render_document_show_field_value :document => @document, :field => 'title_responsibility_display' - @selected_volume = params[:volume] = render :partial => 'shared/back_to_item' %h2 @@ -14,7 +13,7 @@ -if copyd[:item_enum].present? = copyd[:item_enum] - %div.request-author=responsibility + %div.request-author=take_responsibility %p To request this item, search Borrow Direct and place a request. - if !@estimate.blank? diff --git a/app/views/blacklight_cornell_requests/request/document_delivery.html.haml b/app/views/blacklight_cornell_requests/request/document_delivery.html.haml index 7251d39..255e910 100644 --- a/app/views/blacklight_cornell_requests/request/document_delivery.html.haml +++ b/app/views/blacklight_cornell_requests/request/document_delivery.html.haml @@ -1,12 +1,11 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') --responsibility = render_document_show_field_value :document => @document, :field => 'title_responsibility_display' = render :partial => 'shared/back_to_item' %h2 Document Delivery %div.well %h3.item-title-request.blacklight-title_display=title - %div.request-author=responsibility + %div.request-author=take_responsibility %p Click the button below to go to the Document Delivery form and place your request. .clearfix diff --git a/app/views/blacklight_cornell_requests/request/hold.html.haml b/app/views/blacklight_cornell_requests/request/hold.html.haml index b3fd6f7..944fa6f 100644 --- a/app/views/blacklight_cornell_requests/request/hold.html.haml +++ b/app/views/blacklight_cornell_requests/request/hold.html.haml @@ -1,6 +1,5 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') --responsibility = render_document_show_field_value :document => @document, :field => 'title_responsibility_display' - @selected_volume = params[:volume] = render :partial => 'shared/back_to_item' %h1.request-type @@ -9,7 +8,7 @@ %div.row %div.well %h2.item-title-request.blacklight-title_display=title - %div.request-author=responsibility + %div.request-author=take_responsibility %form#req.form-horizontal{:method => 'post', :action => make_voyager_request_path} -if @volumes.present? && @volumes.count > 1 .form-group diff --git a/app/views/blacklight_cornell_requests/request/l2l.html.haml b/app/views/blacklight_cornell_requests/request/l2l.html.haml index 847d067..cbc992c 100644 --- a/app/views/blacklight_cornell_requests/request/l2l.html.haml +++ b/app/views/blacklight_cornell_requests/request/l2l.html.haml @@ -1,15 +1,15 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') --responsibility = render_document_show_field_value :document => @document, :field => 'title_responsibility_display' +-presenter = Blacklight::ShowPresenter.new(@document, self) - @selected_volume = params[:volume] = render :partial => 'shared/back_to_item' %h1.request-type - = "Request Cornell library to library delivery for user: " + request.env['REMOTE_USER'].inspect + = "Request Cornell library to library delivery for user: #{@netid}" %div.row %div.well %h2.blacklight-title_display.item-title-request =title - %div.request-author=responsibility + %div.request-author=take_responsibility %form#req.l2l-request.form-horizontal{:method => 'post', :action => make_voyager_request_path({:bibid =>@id})} -if @volumes.present? && @volumes.count > 1 .form-group @@ -25,7 +25,7 @@ %label.control-label.col-sm-2{:for => 'reqcomments'} Notes to library staff: .col-sm-10 %textarea(name="reqcomments" id="reqcomments" class="form-control") - - if !@estimate.blank? + - if @estimate.present? .form-group %label.control-label.col-sm-2 Delivery time: .delivery-estimate.col-sm-10 diff --git a/app/views/blacklight_cornell_requests/request/pda.html.haml b/app/views/blacklight_cornell_requests/request/pda.html.haml index fe318cd..000410e 100644 --- a/app/views/blacklight_cornell_requests/request/pda.html.haml +++ b/app/views/blacklight_cornell_requests/request/pda.html.haml @@ -1,13 +1,12 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') --responsibility = render_document_show_field_value :document => @document, :field => 'title_responsibility_display' = render :partial => 'shared/back_to_item' %h2 = "Purchase request for user: " + request.env["REMOTE_USER"].inspect %div.well %h3.blacklight-title_display.item-title-request =title - %div.request-author=responsibility + %div.request-author=take_responsibility .clearfix -if @alternate_request_options and @alternate_request_options.count >= 2 %a{:href => @iis[:pda][:url], :title =>'Submit Purchase Request',:class => 'btn btn-danger pull-left'} diff --git a/app/views/blacklight_cornell_requests/request/purchase.html.haml b/app/views/blacklight_cornell_requests/request/purchase.html.haml index 7c29c1b..a18abcb 100644 --- a/app/views/blacklight_cornell_requests/request/purchase.html.haml +++ b/app/views/blacklight_cornell_requests/request/purchase.html.haml @@ -1,30 +1,29 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') --responsibility = render_document_show_field_value :document => @document, :field => 'title_responsibility_display' = render :partial => 'shared/back_to_item' - unless flash[:success] %h1.request-type Purchase Request %div.row %div.well %h2.item-title-request.blacklight-title_display=title - %div.request-author=responsibility + %div.request-author=take_responsibility %form#req.form-horizontal{:method => 'post', :action => blacklight_cornell_request.make_purchase_request_path} %input(type="hidden" name="bid" value="#{@id}" id="bid") %input(type="hidden" name="request_action" value="purchase" id="request_action") - .form-group - %label.control-label.col-sm-2{:for => 'reqname'} Name: - .col-sm-10 - %input#reqname.form-control{:type => 'text', :name => 'name', :value => @name} - .help-block.required (required) - .form-group - %label.control-label.col-sm-2{:for => 'reqemail'} Email address: - .col-sm-10 - %input#reqemail.form-control{:type => 'text', :name => 'email', :value => "#{@netid}@cornell.edu"} - .help-block.required (required) - .form-group - %label.control-label.col-sm-2{:for => 'reqstatus'} Status: - .col-sm-10 - %select#reqstatus.form-control{:name => 'reqstatus'} + .control-group + %label.control-label{:for => 'reqname'} Name: + .controls + %input#reqname{:type => 'text', :name => 'name', :value => @name} + .help-inline.required (required) + .control-group + %label.control-label{:for => 'reqemail'} Email address: + .controls + %input#reqemail{:type => 'text', :name => 'email', :value => "#{@netid}@cornell.edu"} + .help-inline.required (required) + .control-group + %label.control-label{:for => 'reqstatus'} Status: + .controls + %select#reqstatus{:name => 'reqstatus'} %option{:value => ''} - Select - %option{:value => 'undergrad'} Cornell Undergraduate Student %option{:value => 'grad'} Cornell Graduate Student @@ -32,38 +31,50 @@ %option{:value => 'staff'} Cornell Staff %option{:value => 'alum'} Alumnus/Alumna %option{:value => 'other'} Other - .help-block.required (required) - .form-group - %label.control-label.col-sm-2{:for => 'reqtitle'} Title: - .col-sm-10 - %input#reqtitle.form-control{:type => 'text', :name => 'reqtitle', :value => @ti} - .help-block.required (required) - .form-group - %label.control-label.col-sm-2{:for => 'reqauthor'} Author: - .col-sm-10 - %input#reqauthor.form-control{:type => 'text', :name => 'reqauthor', :value => @au} - .form-group - %label.control-label.col-sm-2{:for => 'reqseries'} Series: - .col-sm-10 - %input#reqseries.form-control{:type => 'text', :name => 'reqseries', :value => (!@document[:title_series_display].nil? ? @document[:title_series_display][0] : '')} - .form-group - %label.control-label.col-sm-2{:for => 'reqpublication'} Place, publisher, and year of publication: - .col-sm-10 - %input#reqpublication.form-control{:type => 'text', :name => 'reqpublication', :value => @document[:pub_info_display][0]} - .form-group - %label.control-label.col-sm-2{:for => 'reqidentifier'} ISBN, ISSN, or URL: - .col-sm-10 - %input#reqidentifier.form-control{:type => 'text', :name => 'reqidentifier', :value => (!@isbn.nil? ? @isbn[0] : '')} - .form-group - %label.control-label.col-sm-2{:for => 'reqcomments'} Source of information or comments concerning this request: - .col-sm-10 + .help-inline.required (required) + + .control-group + %label.control-label{:for => 'reqtitle'} Title: + .controls + %input#reqtitle.input-xxlarge{:type => 'text', :name => 'reqtitle', :value => @ti} + .help-inline.required (required) + + .control-group + %label.control-label{:for => 'reqauthor'} Author: + .controls + %input#reqauthor.input-xxlarge{:type => 'text', :name => 'reqauthor', :value => @au} + .control-group + %label.control-label{:for => 'reqseries'} Series: + .controls + %input#reqseries.input-xxlarge{:type => 'text', :name => 'reqseries', :value => (!@document[:title_series_display].nil? ? @document[:title_series_display][0] : '')} + .control-group + %label.control-label{:for => 'reqpublication'} Place, publisher, and year of publication: + .controls + %input#reqpublication.input-xxlarge{:type => 'text', :name => 'reqpublication', :value => @document[:pub_info_display][0]} + .control-group + %label.control-label{:for => 'reqidentifier'} ISBN, ISSN, or URL: + .controls + %input#reqidentifier{:type => 'text', :name => 'reqidentifier', :value => (!@isbn.nil? ? @isbn[0] : '')} + .control-group + %label.control-label{:for => 'reqcomments'} Source of information or comments concerning this request: + .controls %textarea(name="reqcomments" id="reqcomments" class="form-control") Bibliographic information provided by CUL catalog. - .form-group - %label.control-label.col-sm-2{:for => 'reqnotify'} Would you like to be notified when this item is cataloged?: - .col-sm-10 - %select#reqnotify.form-control{:name => 'reqnotify'} + .control-group + %label.control-label{:for => 'reqnotify'} Would you like to be notified when this item is cataloged?: + .controls + %select#reqnotify{:name => 'reqnotify'} %option{:value => 'yes', :selected => 'selected'} Yes %option{:value => 'no'} No - %input#request-submit.btn.btn-danger.pull-left(type="submit" name="submit" value="Submit purchase request") - = render :partial => 'shared/request_options' + .control-group + .controls.clearfix + %input#request-submit.btn.btn-danger.pull-left(type="submit" name="submit" value="Submit purchase request") + %div.accordion-heading.request-options.form-alternative-action.pull-left + or + =link_to 'Other options', '#collapseOne', {:data => {:toggle => 'collapse', :parent => '#accordion2'}} + .controls + %div.accordion#accordion2.request-options.form-alternative-action + %div#collapseOne.accordion-body.collapse + %div.accordion-inner + %div.span4 + = render :partial => 'shared/request_options' diff --git a/app/views/blacklight_cornell_requests/request/recall.html.haml b/app/views/blacklight_cornell_requests/request/recall.html.haml index e77d34d..7cb1ff5 100644 --- a/app/views/blacklight_cornell_requests/request/recall.html.haml +++ b/app/views/blacklight_cornell_requests/request/recall.html.haml @@ -1,6 +1,5 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') --responsibility = render_document_show_field_value :document => @document, :field => 'title_responsibility_display' - @selected_volume = params[:volume] = render :partial => 'shared/back_to_item' %h1.request-type @@ -8,7 +7,7 @@ %div.row %div.well %h2.item-title-request.blacklight-title_display=title - %div.request-author=responsibility + %div.request-author=take_responsibility %form#req.form-horizontal{:method => 'post', :action => make_voyager_request_path} -if @volumes.present? && @volumes.count > 1 .form-group From 32ec57ab3741ef59eebb1be8d7354e769b7241f8 Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Tue, 23 Aug 2016 16:37:25 -0400 Subject: [PATCH 05/20] Bump version to 1.3 --- lib/blacklight_cornell_requests/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/blacklight_cornell_requests/version.rb b/lib/blacklight_cornell_requests/version.rb index b75a49e..0a5c120 100755 --- a/lib/blacklight_cornell_requests/version.rb +++ b/lib/blacklight_cornell_requests/version.rb @@ -1,3 +1,3 @@ module BlacklightCornellRequests - VERSION = "1.3beta" + VERSION = "1.3" end From 044a0805f0233b3c03d0320bb29880ded1f8e0f5 Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Tue, 23 Aug 2016 16:53:43 -0400 Subject: [PATCH 06/20] Use show_presenter the *right* way for responsibility statement --- app/helpers/blacklight_cornell_requests/request_helper.rb | 5 ----- app/views/blacklight_cornell_requests/request/bd.html.haml | 4 +++- .../request/document_delivery.html.haml | 3 ++- app/views/blacklight_cornell_requests/request/hold.html.haml | 3 ++- app/views/blacklight_cornell_requests/request/l2l.html.haml | 4 ++-- app/views/blacklight_cornell_requests/request/pda.html.haml | 3 ++- .../blacklight_cornell_requests/request/purchase.html.haml | 3 ++- .../blacklight_cornell_requests/request/recall.html.haml | 3 ++- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/helpers/blacklight_cornell_requests/request_helper.rb b/app/helpers/blacklight_cornell_requests/request_helper.rb index e57d1b9..05b5556 100755 --- a/app/helpers/blacklight_cornell_requests/request_helper.rb +++ b/app/helpers/blacklight_cornell_requests/request_helper.rb @@ -13,10 +13,5 @@ def delivery_estimate_display time_estimate end - # Retrieve the 'responsibility' field value (used by several views) - def take_responsibility - Blacklight::ShowPresenter.new(@document, self).field_value 'title_responsibility_display' - end - end end diff --git a/app/views/blacklight_cornell_requests/request/bd.html.haml b/app/views/blacklight_cornell_requests/request/bd.html.haml index f1227e0..083e2a1 100644 --- a/app/views/blacklight_cornell_requests/request/bd.html.haml +++ b/app/views/blacklight_cornell_requests/request/bd.html.haml @@ -13,7 +13,9 @@ -if copyd[:item_enum].present? = copyd[:item_enum] - %div.request-author=take_responsibility + %div.request-author + =show_presenter(@document).field_value 'title_responsibility_display' + %p To request this item, search Borrow Direct and place a request. - if !@estimate.blank? diff --git a/app/views/blacklight_cornell_requests/request/document_delivery.html.haml b/app/views/blacklight_cornell_requests/request/document_delivery.html.haml index 255e910..b6d2d2c 100644 --- a/app/views/blacklight_cornell_requests/request/document_delivery.html.haml +++ b/app/views/blacklight_cornell_requests/request/document_delivery.html.haml @@ -5,7 +5,8 @@ %h2 Document Delivery %div.well %h3.item-title-request.blacklight-title_display=title - %div.request-author=take_responsibility + %div.request-author + =show_presenter(@document).field_value 'title_responsibility_display' %p Click the button below to go to the Document Delivery form and place your request. .clearfix diff --git a/app/views/blacklight_cornell_requests/request/hold.html.haml b/app/views/blacklight_cornell_requests/request/hold.html.haml index 944fa6f..db8efa3 100644 --- a/app/views/blacklight_cornell_requests/request/hold.html.haml +++ b/app/views/blacklight_cornell_requests/request/hold.html.haml @@ -8,7 +8,8 @@ %div.row %div.well %h2.item-title-request.blacklight-title_display=title - %div.request-author=take_responsibility + %div.request-author + =show_presenter(@document).field_value 'title_responsibility_display' %form#req.form-horizontal{:method => 'post', :action => make_voyager_request_path} -if @volumes.present? && @volumes.count > 1 .form-group diff --git a/app/views/blacklight_cornell_requests/request/l2l.html.haml b/app/views/blacklight_cornell_requests/request/l2l.html.haml index cbc992c..9fb1d9a 100644 --- a/app/views/blacklight_cornell_requests/request/l2l.html.haml +++ b/app/views/blacklight_cornell_requests/request/l2l.html.haml @@ -1,6 +1,5 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') --presenter = Blacklight::ShowPresenter.new(@document, self) - @selected_volume = params[:volume] = render :partial => 'shared/back_to_item' %h1.request-type @@ -9,7 +8,8 @@ %div.well %h2.blacklight-title_display.item-title-request =title - %div.request-author=take_responsibility + %div.request-author + =show_presenter(@document).field_value 'title_responsibility_display' %form#req.l2l-request.form-horizontal{:method => 'post', :action => make_voyager_request_path({:bibid =>@id})} -if @volumes.present? && @volumes.count > 1 .form-group diff --git a/app/views/blacklight_cornell_requests/request/pda.html.haml b/app/views/blacklight_cornell_requests/request/pda.html.haml index 000410e..010d236 100644 --- a/app/views/blacklight_cornell_requests/request/pda.html.haml +++ b/app/views/blacklight_cornell_requests/request/pda.html.haml @@ -6,7 +6,8 @@ %div.well %h3.blacklight-title_display.item-title-request =title - %div.request-author=take_responsibility + %div.request-author + =show_presenter(@document).field_value 'title_responsibility_display' .clearfix -if @alternate_request_options and @alternate_request_options.count >= 2 %a{:href => @iis[:pda][:url], :title =>'Submit Purchase Request',:class => 'btn btn-danger pull-left'} diff --git a/app/views/blacklight_cornell_requests/request/purchase.html.haml b/app/views/blacklight_cornell_requests/request/purchase.html.haml index a18abcb..10543d4 100644 --- a/app/views/blacklight_cornell_requests/request/purchase.html.haml +++ b/app/views/blacklight_cornell_requests/request/purchase.html.haml @@ -6,7 +6,8 @@ %div.row %div.well %h2.item-title-request.blacklight-title_display=title - %div.request-author=take_responsibility + %div.request-author + =show_presenter(@document).field_value 'title_responsibility_display' %form#req.form-horizontal{:method => 'post', :action => blacklight_cornell_request.make_purchase_request_path} %input(type="hidden" name="bid" value="#{@id}" id="bid") %input(type="hidden" name="request_action" value="purchase" id="request_action") diff --git a/app/views/blacklight_cornell_requests/request/recall.html.haml b/app/views/blacklight_cornell_requests/request/recall.html.haml index 7cb1ff5..c349594 100644 --- a/app/views/blacklight_cornell_requests/request/recall.html.haml +++ b/app/views/blacklight_cornell_requests/request/recall.html.haml @@ -7,7 +7,8 @@ %div.row %div.well %h2.item-title-request.blacklight-title_display=title - %div.request-author=take_responsibility + %div.request-author + =show_presenter(@document).field_value 'title_responsibility_display' %form#req.form-horizontal{:method => 'post', :action => make_voyager_request_path} -if @volumes.present? && @volumes.count > 1 .form-group From a4d10087a9fba7790ac077a3430c9fe8bd6a9cb7 Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Mon, 29 Aug 2016 12:07:36 -0400 Subject: [PATCH 07/20] Add check for empty circ_policy_locs table --- .../request_controller.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/controllers/blacklight_cornell_requests/request_controller.rb b/app/controllers/blacklight_cornell_requests/request_controller.rb index 4e0d704..44766a1 100755 --- a/app/controllers/blacklight_cornell_requests/request_controller.rb +++ b/app/controllers/blacklight_cornell_requests/request_controller.rb @@ -2,6 +2,15 @@ module BlacklightCornellRequests + class RequestDatabaseException < StandardError + attr_reader :data + + def initialize(data) + super + @data = data + end + end + class RequestController < ApplicationController include Blacklight::Catalog # needed for "fetch", replaces "include SolrHelper" @@ -21,6 +30,17 @@ def magic_request target='' @document = @document Rails.logger.debug "Viewing item #{@id} (within request controller) - session: #{session}" + + # Do a check to see whether the circ_policy_locs table is populated — for some + # bizarre reason, it has been turning up empty in production. + begin + if Circ_policy_locs.count() < 1 + raise BlacklightCornellRequests::RequestDatabaseException, 'circ_policy_locs table has less than one row' + end + rescue BlacklightCornellRequests::RequestDatabaseException => e + Rails.logger.error "Requests database exception: #{e}" + Appsignal.add_exception(e) + end # If the holdings data has been stored in the session (:holdings_status_short), # we'll pass it in to the request to be reused instead of making From e13d7312b452a0a594e6f95d58d02f95870a9e12 Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Mon, 29 Aug 2016 12:09:28 -0400 Subject: [PATCH 08/20] Update release notes for v1.3 --- release_notes.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release_notes.md b/release_notes.md index dfc476c..981202f 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,8 +1,10 @@ # Release Notes - blacklight-cornell-requests ## v1.3 +- Engine updated for compatibility with Blacklight 6 -- Updated to work with Blacklight 6 (now requires Blacklight 5.9 or higher) +## v1.2.6 + - Added a check for empty circ_policy_locs database table with AppSignal integration ## v1.2.5 From 5ae3ce75ddac4c488c49bc66cd7990a7b7dcb932 Mon Sep 17 00:00:00 2001 From: Matthew Connolly Date: Wed, 31 Aug 2016 11:14:39 -0400 Subject: [PATCH 09/20] Fix bug preventing reserve items from being requested through BD --- .../blacklight_cornell_requests/request.rb | 20 ++++++++++++++----- release_notes.md | 1 + 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/models/blacklight_cornell_requests/request.rb b/app/models/blacklight_cornell_requests/request.rb index d12eb45..ee4ee5a 100755 --- a/app/models/blacklight_cornell_requests/request.rb +++ b/app/models/blacklight_cornell_requests/request.rb @@ -405,6 +405,7 @@ def set_volumes(items) # environments file. # holdings_param = { :bibid => , :type => retrieve|retrieve_detail_raw} def get_holdings document + #Rails.logger.debug "es287_log: #{__FILE__} #{__LINE__} entered get_holdings" holdings = document[:item_record_display].present? ? document[:item_record_display].map { |item| parseJSON item } : Array.new #Rails.logger.debug "es287_log: #{__FILE__} #{__LINE__} #{holdings.inspect}" @@ -589,6 +590,13 @@ def noncirculating?(item) return false end end + + def on_reserve?(item) + item['temp_location'] && + item['temp_location']['name'] && + (item['temp_location']['name'].include?('Reserve') || + item['temp_location']['name'].include?('reserve') ) + end # Locate and translate the actual item status # from the text string in the holdings data @@ -718,13 +726,16 @@ def get_cornell_delivery_options item item_loan_type = loan_type typeCode request_options = [] - # Borrow direct check where appropriate: + # Allow Borrow Direct where appropriate: # item type is noncirculating, # item is not at bindery # item status is charged, lost, or missing - if (item_loan_type == 'nocirc' || noncirculating?(item)) || - (! [AT_BINDERY, NOT_CHARGED].include?(item[:status])) - #if available_in_bd? self.netid, params + # item is on reserve + if (item_loan_type == 'nocirc' || + noncirculating?(item)) || + (! [AT_BINDERY, NOT_CHARGED].include?(item[:status])) || + on_reserve?(item) + if self.in_borrow_direct request_options.push( {:service => BD, :location => item[:location] } ) end @@ -1153,7 +1164,6 @@ def patron_barcode(netid) JSON.parse(response.body)['bc'] end - end end diff --git a/release_notes.md b/release_notes.md index 981202f..4b62e1b 100644 --- a/release_notes.md +++ b/release_notes.md @@ -2,6 +2,7 @@ ## v1.3 - Engine updated for compatibility with Blacklight 6 +- Fixed a bug that prevented reserve items from being requested through BD ## v1.2.6 - Added a check for empty circ_policy_locs database table with AppSignal integration From 68bcd27115a677ee12b875cb77f6d4f1fcb60449 Mon Sep 17 00:00:00 2001 From: Rick Silterra Date: Mon, 12 Sep 2016 14:45:01 -0400 Subject: [PATCH 10/20] DISCOVERYACCESS-2864 -remove obsolete catalog_path, replace with solr_document_path. --- .../blacklight_cornell_requests/request_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/blacklight_cornell_requests/request_controller.rb b/app/controllers/blacklight_cornell_requests/request_controller.rb index 44766a1..adac35b 100755 --- a/app/controllers/blacklight_cornell_requests/request_controller.rb +++ b/app/controllers/blacklight_cornell_requests/request_controller.rb @@ -233,7 +233,7 @@ def make_voyager_request if response[:failure].blank? # Note: the :flash=>'success' in this case is not setting the actual flash message, # but instead specifying a URL parameter that acts as a flag in Blacklight's show.html.erb view. - render js: "window.location = '#{Rails.application.routes.url_helpers.catalog_path(params[:bibid], :flash=>'success')}'" + render js: "window.location = '#{Rails.application.routes.url_helpers.solr_document_path(params[:bibid], :flash=>'success')}'" return else Rails.logger.info "Response: was failure" + response[:failure].inspect From fbf5d8617f8c754ebf6bec6277a5b5c499d0f354 Mon Sep 17 00:00:00 2001 From: Melissa Wallace Date: Tue, 11 Oct 2016 11:41:00 -0400 Subject: [PATCH 11/20] DISCOVERYACCESS-2705: change labels for Document Delivery to ScanIt --- .../blacklight_cornell_requests/delivery_method.rb | 2 +- .../request/document_delivery.html.haml | 12 ++++++------ app/views/shared/_request_options.html.haml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/blacklight_cornell_requests/delivery_method.rb b/app/models/blacklight_cornell_requests/delivery_method.rb index e4fa53d..4a6e53e 100644 --- a/app/models/blacklight_cornell_requests/delivery_method.rb +++ b/app/models/blacklight_cornell_requests/delivery_method.rb @@ -272,7 +272,7 @@ class DocumentDelivery < DeliveryMethod TemplateName = 'document_delivery' def self.description - 'Document Delivery' + 'ScanIt' end def self.time(options = {}) diff --git a/app/views/blacklight_cornell_requests/request/document_delivery.html.haml b/app/views/blacklight_cornell_requests/request/document_delivery.html.haml index b6d2d2c..aa0be43 100644 --- a/app/views/blacklight_cornell_requests/request/document_delivery.html.haml +++ b/app/views/blacklight_cornell_requests/request/document_delivery.html.haml @@ -2,21 +2,21 @@ -title = the_vernaculator('title_display', 'title_vern_display') -subtitle = the_vernaculator('subtitle_display', 'subtitle_vern_display') = render :partial => 'shared/back_to_item' -%h2 Document Delivery +%h2 ScanIt %div.well %h3.item-title-request.blacklight-title_display=title %div.request-author =show_presenter(@document).field_value 'title_responsibility_display' %p - Click the button below to go to the Document Delivery form and place your request. + Click the button below to go to the ScanIt form and place your request. .clearfix -if @alternate_request_options and @alternate_request_options.count >= 2 - %a{:href => BlacklightCornellRequests::Request::DOCUMENT_DELIVERY_URL, :title =>'Submit Document Delivery Request',:class => 'btn btn-danger pull-left', :target => '_blank'} - Go to Document Delivery + %a{:href => BlacklightCornellRequests::Request::DOCUMENT_DELIVERY_URL, :title =>'Submit ScanIt Request',:class => 'btn btn-danger pull-left', :target => '_blank'} + Go to ScanIt = render :partial => 'shared/request_options' -else - %a{:href => BlacklightCornellRequests::Request::DOCUMENT_DELIVERY_URL, :title =>'Submit Document Delivery Request',:class => 'btn btn-danger pull-left', :target => '_blank'} - Go to Document Delivery + %a{:href => BlacklightCornellRequests::Request::DOCUMENT_DELIVERY_URL, :title =>'Submit ScanIt Request',:class => 'btn btn-danger pull-left', :target => '_blank'} + Go to ScanIt %div.accordion-heading.request-options.pull-left.form-alternative-action or =link_to 'Ask a Librarian','http://ask.library.cornell.edu' diff --git a/app/views/shared/_request_options.html.haml b/app/views/shared/_request_options.html.haml index f013cf5..bd9d67a 100644 --- a/app/views/shared/_request_options.html.haml +++ b/app/views/shared/_request_options.html.haml @@ -74,7 +74,7 @@ %td = link_to request_document_delivery_path(@id), {:title => @ti} do %i.fa.fa-arrow-circle-right - Document delivery + ScanIt %td = delivery_estimate_display option[:estimate] - elsif option[:option] == 'pda' From e7a6c73f0f1a6d9779be5171e484c0958fb068e3 Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Tue, 11 Oct 2016 15:40:24 -0400 Subject: [PATCH 12/20] Fix rspec problem in dummy --- spec/dummy/config/environments/development.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb index 82c74d1..d4f2935 100644 --- a/spec/dummy/config/environments/development.rb +++ b/spec/dummy/config/environments/development.rb @@ -23,11 +23,11 @@ config.action_dispatch.best_standards_support = :builtin # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict + #config.active_record.mass_assignment_sanitizer = :strict # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) - config.active_record.auto_explain_threshold_in_seconds = 0.5 + #config.active_record.auto_explain_threshold_in_seconds = 0.5 # Do not compress assets config.assets.compress = false From 9ee8228f49d67b9069d49d6e23106c3f39649142 Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Fri, 14 Oct 2016 11:25:53 -0400 Subject: [PATCH 13/20] DISCOVERYACCESS-2766: Fix TypeError in request options --- .../blacklight_cornell_requests/request.rb | 276 +++++++++--------- 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/app/models/blacklight_cornell_requests/request.rb b/app/models/blacklight_cornell_requests/request.rb index ee4ee5a..4fb2510 100755 --- a/app/models/blacklight_cornell_requests/request.rb +++ b/app/models/blacklight_cornell_requests/request.rb @@ -20,7 +20,7 @@ class Request DOCUMENT_DELIVERY_URL = ENV['ILLIAD_URL'] + '?Action=10&Form=22' HOLD_PADDING_TIME = 3 OCLC_TYPE_ID = 'OCoLC' - + NOT_CHARGED = 1 CHARGED = 2 RENEWED = 3 @@ -63,13 +63,13 @@ class Request attr_accessor :WITHDRAWN, :AT_BINDERY, :CATALOG_REVIEW, :CIRCULATION_REVIEW, :SCHEDULED, :IN_PROCESS attr_accessor :CALL_SLIP_REQUEST, :SHORT_LOAN_REQUEST, :REMOTE_STORAGE_REQUEST, :REQUESTED attr_reader :holdings_status_short - + validates_presence_of :bibid def save(validate = true) validate ? valid? : true end - # The holdings_status_short parameter is used to pass in the saved result of a + # The holdings_status_short parameter is used to pass in the saved result of a # call to the status_short method of the holdings service, usually stored in the # session. Since session ordinarily can't be accessed from a model, we have to # pass it in here and hang on to it @@ -87,7 +87,7 @@ def get_hold_padding HOLD_PADDING_TIME end - ##################### Calculate optimum request method ##################### + ##################### Calculate optimum request method ##################### def magic_request(document, env_http_host, options = {}) target = options[:target] volume = options[:volume] @@ -111,8 +111,8 @@ def magic_request(document, env_http_host, options = {}) self.in_borrow_direct = available_in_bd? self.netid, bd_params # Get item status and location for each item in each holdings record; store in working_items - # We now have two item arrays! working_items (which eventually gets set in self.items) is a - # list of all 'active' items, e.g., those for a particular volume or other set. + # We now have two item arrays! working_items (which eventually gets set in self.items) is a + # list of all 'active' items, e.g., those for a particular volume or other set. # self.all_items includes *all* the items in the holdings data for the bibid, so that we can # use that list to, for example, obtain a list of all the volumes in the bibid. working_items = [] @@ -131,7 +131,7 @@ def magic_request(document, env_http_host, options = {}) # Require a match on all three iterator values to determine a match next if ( y != h[:year] or c != h[:chron] or e != h[:item_enum]) end - + # Only a subset of all_items gets put into working_items working_items.push h end @@ -154,19 +154,19 @@ def magic_request(document, env_http_host, options = {}) item[:services] = services end populate_document_values - + #Rails.logger.debug "es287_log :#{__FILE__}:#{__LINE__} services established for each item."+ Time.new.inspect - + # handle pda patron_type = get_patron_type self.netid if patron_type == 'cornell' && !document['url_pda_display'].blank? self.document = document - + pda_url = document[:url_pda_display][0] pda_url, note = pda_url.split('|') iids = { :itemid => 'pda', :url => pda_url, :note => note } pda_entry = { :service => PDA, :iid => iids, :estimate => get_delivery_time(PDA, nil) } - + bd_entry = nil if available_in_bd? self.netid, bd_params bd_entry = { :service => BD, :iid => {}, :estimate => get_delivery_time(BD, nil) } @@ -189,11 +189,11 @@ def magic_request(document, env_http_host, options = {}) alternate_options.push pda_entry alternate_options.push bd_entry unless bd_entry.nil? end - + self.request_options = request_options self.alternate_options = alternate_options - populate_options self.service, request_options + populate_options self.service, request_options return end #Rails.logger.debug "es287_log :#{__FILE__}:#{__LINE__} bd/pda processed."+ Time.new.inspect @@ -216,9 +216,9 @@ def magic_request(document, env_http_host, options = {}) end #Rails.logger.debug "es287_log :#{__FILE__}:#{__LINE__} self request options: #{self.request_options}" - + # This is presumably just for PDA records, so limit it to that condition - if self.document[:url_pda_display] && working_items.size < 1 + if self.document[:url_pda_display] && working_items.size < 1 hld_entry = {:service => HOLD, :location => '', :status => ''} request_options.push hld_entry end @@ -227,14 +227,16 @@ def magic_request(document, env_http_host, options = {}) elsif request_options.present? # Don't present document delivery as the default option unless # there's no other choice - if (request_options[0][:service] == DOCUMENT_DELIVERY) and + if (request_options[0][:service] == DOCUMENT_DELIVERY) and (request_options.length > 1) # There may be more than one DD option in the queue, so we have to # check the whole list. (There really shouldn't be more than one, # probably!) index = request_options.index{ |o| o[:service] != DOCUMENT_DELIVERY } - request_options[0], request_options[index] = request_options[index], request_options[0] + if index != nil + request_options[0], request_options[index] = request_options[index], request_options[0] + end end self.service = request_options[0][:service] @@ -247,7 +249,7 @@ def magic_request(document, env_http_host, options = {}) self.document = document end - + def populate_options target, request_options self.alternate_options = [] self.request_options = [] @@ -266,40 +268,40 @@ def populate_options target, request_options end # set the class volumes from a list of item records - def set_volumes(items) + def set_volumes(items) volumes = {} num_enum = 0 num_chron = 0 num_year = 0 - + # Skip items if they're in RMC - they shouldn't appear in the list items.delete_if do |item| - item['perm_location'].present? && + item['perm_location'].present? && item['perm_location']['code'].present? && item['perm_location']['code'].include?('rmc') end - + ## take first integer from each of enum, chron and year ## if not populated, use big number to rank low ## if the field is blank, use 'z' to rank low - ## record number of occurances for each of the + ## record number of occurances for each of the items.each do |item| - + # Rails.logger.warn "mjc12test: item: #{item}" - - # item[:numeric_enumeration] = item[:item_enum][/\d+/] - enums = item[:item_enum].scan(/\d+/) - if enums.count > 0 - numeric_enumeration = '' - enums.each do |enum| - numeric_enumeration = numeric_enumeration + enum.rjust(9,'0') - end + + # item[:numeric_enumeration] = item[:item_enum][/\d+/] + enums = item[:item_enum].scan(/\d+/) + if enums.count > 0 + numeric_enumeration = '' + enums.each do |enum| + numeric_enumeration = numeric_enumeration + enum.rjust(9,'0') + end item[:numeric_enumeration] = numeric_enumeration num_enum = num_enum + 1 else item[:numeric_enumeration] = '999999999' end - + item[:numeric_chron] = item[:chron][/\d+/] if !item[:numeric_chron].blank? item[:numeric_chron] = item[:numeric_chron].to_i @@ -307,7 +309,7 @@ def set_volumes(items) else item[:numeric_chron] = 999999999 end - + item[:numeric_year] = item[:year][/\d+/] if !item[:numeric_year].blank? item[:numeric_year] = item[:numeric_year].to_i @@ -315,21 +317,21 @@ def set_volumes(items) else item[:numeric_year] = 999999999 end - - if item[:item_enum].blank? - item[:item_enum_compare] = 'z' - else - item[:item_enum_compare] = item[:item_enum] + + if item[:item_enum].blank? + item[:item_enum_compare] = 'z' + else + item[:item_enum_compare] = item[:item_enum] end - - if item[:chron].blank? - item[:chron_compare] = 'z' - item[:chron_month] = 13 - else - item[:chron_compare] = item[:chron].delete(' ') - item[:chron_month] = Date::ABBR_MONTHNAMES.index(item[:chron]).to_i + + if item[:chron].blank? + item[:chron_compare] = 'z' + item[:chron_month] = 13 + else + item[:chron_compare] = item[:chron].delete(' ') + item[:chron_month] = Date::ABBR_MONTHNAMES.index(item[:chron]).to_i end - + if item[:year].blank? item[:year_compare] = 'z' else @@ -359,13 +361,13 @@ def set_volumes(items) sorted_items = items.sort_by {|h| [ h[:numeric_chron],h[:chron_month],h[:chron_compare],h[:numeric_enumeration],h[:item_enum_compare],h[:numeric_year],h[:year_compare] ]} end end - + ## as of ruby 1.9, hash preserves insertion order sorted_items.each do |item| e = item[:item_enum] c = item[:chron] y = item[:year] - + next if e.blank? and c.blank? and y.blank? # if e.present? and c.blank? and y.blank? @@ -384,7 +386,7 @@ def set_volumes(items) # end # volumes[label] = "|#{e}|#{c}|#{y}|" # end - + label = '' [e, c, y].each do |element| if element.present? @@ -395,7 +397,7 @@ def set_volumes(items) volumes[label] = "|#{e}|#{c}|#{y}|" end - + self.volumes = volumes end @@ -405,7 +407,7 @@ def set_volumes(items) # environments file. # holdings_param = { :bibid => , :type => retrieve|retrieve_detail_raw} def get_holdings document - + #Rails.logger.debug "es287_log: #{__FILE__} #{__LINE__} entered get_holdings" holdings = document[:item_record_display].present? ? document[:item_record_display].map { |item| parseJSON item } : Array.new #Rails.logger.debug "es287_log: #{__FILE__} #{__LINE__} #{holdings.inspect}" @@ -418,10 +420,10 @@ def get_holdings document response = parseJSON(HTTPClient.get_content(Rails.configuration.voyager_holdings + "/holdings/status_short/#{self.bibid}")) end #Rails.logger.debug "es287_log: #{__FILE__} #{__LINE__} #{response.inspect}" - + bib = self.bibid.to_s - if response[bib] && - response[bib][bib] && + if response[bib] && + response[bib][bib] && response[bib][bib][:records] statuses = {} call_numbers = {} @@ -435,14 +437,14 @@ def get_holdings document end end end - + #Rails.logger.debug "es287_log: #{__FILE__} #{__LINE__} #{call_numbers.inspect}" location_seen = Hash.new location_ids = Array.new ## assume there is one holdings location per bibid locations = Hash.new call_number = '' - + # store a hash of locations {:number => :name} from the holdings record display document[:holdings_record_display].each do |hrd| hrdJSON = parseJSON hrd @@ -450,23 +452,23 @@ def get_holdings document locations[loc[:number].to_s] = loc[:name] end end if document[:holdings_record_display] # ?? - + holdings.each do |holding| holding[:status] = item_status statuses[holding['item_id'].to_s] # This doesn't do anything — calling item_status on a call number only # returns the same call number. # holding[:call_number] = item_status call_numbers[holding['item_id'].to_s] holding[:call_number] = call_numbers[holding['item_id'].to_s] - + # Pick a location to use - either perm_location or temp_location location = holding[:perm_location] if location.is_a?(Hash) - location = location['number'].to_s + location = location['number'].to_s end if holding[:temp_location].is_a?(Hash) - temp_location_s = holding[:temp_location]['number'].to_s + temp_location_s = holding[:temp_location]['number'].to_s temp_location = holding[:temp_location] - else + else temp_location_s = holding[:temp_location] end if temp_location_s == '0' @@ -476,20 +478,20 @@ def get_holdings document # use temp location #tempLocJSON = parseJSON holding[:temp_location] if temp_location.is_a?(Hash) - tempLocJSON = temp_location + tempLocJSON = temp_location holding[:location] = tempLocJSON[:name] else Rails.logger.warn "#{__FILE__}:#{__LINE__} Cannot use temp location (not a hash) Your solr database is not up to date.: #{temp_location.inspect}" end end - + # Rails.logger.info "sk274_log: holding: #{holding.inspect}" location_seen[location] = location_seen[location] || 1 exclude_location_list = Array.new - + if location_seen[location] == 1 circ_group_id = Circ_policy_locs.select('CIRC_GROUP_ID').where( 'LOCATION_ID' => location ) - + ## handle exceptions ## group id 3 - Olin ## group id 19 - Uris @@ -499,12 +501,12 @@ def get_holdings document ## Law group can deliver to itself ## Others can't deliver to itself # logger.debug "sk274_log: " + circ_group_id.inspect - - # there might not be an entry in this table - if circ_group_id.present? + + # there might not be an entry in this table + if circ_group_id.present? group = circ_group_id[0]['CIRC_GROUP_ID'] group = group.nil? ? 0 : Float(group) - + case group when 3, 19 ## include both group id if Olin or Uris @@ -518,7 +520,7 @@ def get_holdings document holding[:exclude_location_id] = exclude_location_list next end - + # logger.debug "sk274_log: circ group id: " + circ_group_id.inspect locs = Circ_policy_locs.select('LOCATION_ID').where( :circ_group_id => circ_group_id, :pickup_location => 'Y' ) locs.each do |loc| @@ -533,7 +535,7 @@ def get_holdings document # Rails.logger.info "sk274_log: #{holding[:item_id].inspect}, #{holding[:exclude_location_id].inspect}" end end - + #Rails.logger.debug "es287_log: #{__FILE__} #{__LINE__} #{holdings.inspect}" holdings @@ -562,7 +564,7 @@ def minute_loan?(loan_code) def self.no_l2l_day_loan_types [10, 17, 23, 24] end - + def no_l2l_day_loan_types?(loan_code) [10, 17, 23, 24].include? loan_code.to_i end @@ -590,7 +592,7 @@ def noncirculating?(item) return false end end - + def on_reserve?(item) item['temp_location'] && item['temp_location']['name'] && @@ -598,7 +600,7 @@ def on_reserve?(item) item['temp_location']['name'].include?('reserve') ) end - # Locate and translate the actual item status + # Locate and translate the actual item status # from the text string in the holdings data def item_status item_status @@ -627,7 +629,7 @@ def item_status item_status return LOST else - # covers self-returning statuses + # covers self-returning statuses # like LOST, MISSING, AT_BINDERY, CHARGED, NOT_CHARGED return item_status end @@ -642,7 +644,7 @@ def delivery_services # Main entry point for determining which delivery services are available for a given item # Returns an array of hashes with the following structure: # { :service => SERVICE NAME, :estimate => ESTIMATED DELIVERY TIME } - # The array is sorted by delivery time estimate, so the first array item should be + # The array is sorted by delivery time estimate, so the first array item should be # the fastest (i.e., the "best") delivery option. def get_delivery_options item @@ -665,7 +667,7 @@ def get_delivery_options item option[:iid] = item end end - + # Rails.logger.info "sk274_log: #{options.inspect}" #Rails.logger.debug "es287_log :#{__FILE__}:#{__LINE__} end of deliv options (#{options.inspect})"+ Time.new.inspect @@ -673,20 +675,20 @@ def get_delivery_options item return options end - + # Given an item hash, return a location (either temp or permanent if no temp) def get_location(item) - + location = item[:perm_location] location = location['number'].to_s if location.is_a?(Hash) - + if item[:temp_location].is_a?(Hash) - temp_location_s = item[:temp_location]['number'].to_s + temp_location_s = item[:temp_location]['number'].to_s temp_location = item[:temp_location] - else + else temp_location_s = item[:temp_location] end - + if temp_location_s == '0' # use holdings location return location @@ -700,21 +702,21 @@ def get_location(item) return nil end - + end - + # Determine whether an item at the library and can be requested - def music_library_requestable?(item) + def music_library_requestable?(item) # 2 conditions: item is at the music library, and item type is book or music (3 or 5) # bit hacky: return true if item is *not* at the music library (i.e., for everything # else being tested here) if %w[88 90 91 92 93 179].include?(get_location(item)) - return [3, 5].include?(item['item_type_id'].to_i) + return [3, 5].include?(item['item_type_id'].to_i) else # if *not* at the Music library return true end end - + # Test for new item type, "unbound" (#39). Can do hold and recall, but not L2L def unbound_type?(item_type) item_type == '39' @@ -725,17 +727,17 @@ def get_cornell_delivery_options item typeCode = (item[:temp_item_type_id].blank? || item[:temp_item_type_id] == '0') ? item[:item_type_id] : item[:temp_item_type_id] item_loan_type = loan_type typeCode request_options = [] - + # Allow Borrow Direct where appropriate: # item type is noncirculating, # item is not at bindery # item status is charged, lost, or missing # item is on reserve - if (item_loan_type == 'nocirc' || + if (item_loan_type == 'nocirc' || noncirculating?(item)) || (! [AT_BINDERY, NOT_CHARGED].include?(item[:status])) || on_reserve?(item) - + if self.in_borrow_direct request_options.push( {:service => BD, :location => item[:location] } ) end @@ -746,28 +748,28 @@ def get_cornell_delivery_options item if docdel_eligible? item request_options.push( {:service => DOCUMENT_DELIVERY }) end - + Rails.logger.debug "mjc12test: loantype: #{item_loan_type}, status: #{item[:status ]}" # Check the rest of the cases - if item_loan_type == 'nocirc' || + if item_loan_type == 'nocirc' || noncirculating?(item) - request_options.push({:service => ILL, + request_options.push({:service => ILL, :location => item[:location]}) - elsif item_loan_type == 'regular' && + elsif item_loan_type == 'regular' && item[:status] == NOT_CHARGED && music_library_requestable?(item) && !unbound_type?(typeCode) - request_options.push({:service => L2L, - :location => item[:location] } ) - elsif item_loan_type == 'regular' && + request_options.push({:service => L2L, + :location => item[:location] } ) + elsif item_loan_type == 'regular' && item[:status] == CHARGED - request_options.push({:service => ILL, + request_options.push({:service => ILL, :location => item[:location]}) if music_library_requestable?(item) request_options.push({:service => RECALL, :location => item[:location]}, - {:service => HOLD, - :location => item[:location], + {:service => HOLD, + :location => item[:location], :status => item[:status]}) end elsif item_loan_type == 'regular' && @@ -777,40 +779,40 @@ def get_cornell_delivery_options item :location => item[:location]}, {:service => HOLD, :location => item[:location]}) - elsif ['regular','day'].include?(item_loan_type) && + elsif ['regular','day'].include?(item_loan_type) && [MISSING, LOST].include?(item[:status]) - request_options.push({:service => PURCHASE, + request_options.push({:service => PURCHASE, :location => item[:location]}, {:service => ILL, :location => item[:location]}) - elsif item_loan_type == 'day' && + elsif item_loan_type == 'day' && item[:status] == CHARGED - request_options.push({:service => ILL, + request_options.push({:service => ILL, :location => item[:location] }) if music_library_requestable?(item) - request_options.push({:service => HOLD, - :location => item[:location], + request_options.push({:service => HOLD, + :location => item[:location], :status => item[:status] }) end - elsif item_loan_type == 'day' && + elsif item_loan_type == 'day' && item[:status] == NOT_CHARGED if Request.no_l2l_day_loan_types.include? typeCode #return request_options elsif music_library_requestable?(item) && !unbound_type?(item) - request_options.push( {:service => L2L, + request_options.push( {:service => L2L, :location => item[:location] } ) end elsif item_loan_type == 'minute' - return request_options.push( {:service => ASK_CIRCULATION, + return request_options.push( {:service => ASK_CIRCULATION, :location => item[:location] } ) elsif item[:status] == AT_BINDERY - return request_options.push( {:service => ILL, + return request_options.push( {:service => ILL, :location => item[:location] } ) end - + request_options - + end # Determine delivery options for a single item if the patron is a guest (non-Cornell) @@ -818,9 +820,9 @@ def get_guest_delivery_options item typeCode = (item[:temp_item_type_id].blank? || item[:temp_item_type_id] == '0') ? item[:item_type_id] : item[:temp_item_type_id] item_loan_type = loan_type typeCode - if noncirculating? item + if noncirculating? item [] - elsif item[:status] == NOT_CHARGED && (item_loan_type == 'regular' || item_loan_type == 'day') + elsif item[:status] == NOT_CHARGED && (item_loan_type == 'regular' || item_loan_type == 'day') [ { :service => L2L, :location => item[:location] } ] unless (no_l2l_day_loan_types?(item_loan_type) || !music_library_requestable?(item) || unbound_type?(typeCode)) elsif item[:status] == CHARGED && (item_loan_type == 'regular' || item_loan_type == 'day') && music_library_requestable?(item) [ { :service => HOLD, :location => item[:location], :status => item[:itemStatus] } ] @@ -828,7 +830,7 @@ def get_guest_delivery_options item [ { :service => ASK_CIRCULATION, :location => item[:location] } ] else # default case covers: - # item_loan_type == 'nocirc' + # item_loan_type == 'nocirc' # item[:status] == MISSING or item[:status] == LOST # anything else [] @@ -851,15 +853,15 @@ def docdel_eligible? item return true if annex_locations.include? get_location(item) # Specifically exclude based on item_type - eligible_formats = ['Book', - 'Image', - 'Journal', - 'Manuscript/Archive', - 'Musical Recording', - 'Musical Score', - 'Non-musical Recording', + eligible_formats = ['Book', + 'Image', + 'Journal', + 'Manuscript/Archive', + 'Musical Recording', + 'Musical Score', + 'Non-musical Recording', 'Journal/Periodical', - 'Research Guide', + 'Research Guide', 'Thesis'] item_formats = self.document[:format] @@ -878,7 +880,7 @@ def get_delivery_time service, item_data, return_range = true # Delivery time estimates are kept as ranges (as per requested) instead of single numbers range = [9999, 9999] # default value - case service + case service when L2L if item_data[:location] == LIBRARY_ANNEX @@ -950,7 +952,7 @@ def get_delivery_time service, item_data, return_range = true end end - + def populate_document_values unless self.document.blank? self.isbn = self.document[:isbn_display] @@ -965,7 +967,7 @@ def populate_document_values create_ill_link end end - + def create_ill_link document = self.document @@ -1013,18 +1015,18 @@ def create_ill_link ill_link = ill_link + "&rfe_dat=#{oclc.join(',')}" end end - + self.ill_link = ill_link end - + def deep_copy(o) Marshal.load(Marshal.dump(o)).with_indifferent_access end - + def parseJSON data JSON.parse(data).with_indifferent_access end - + ###################### Make Voyager requests ################################ # Handle a request for a Voyager action @@ -1036,7 +1038,7 @@ def make_voyager_request params # Need bibid, netid, itemid to proceed if self.bibid.nil? return { :error => I18n.t('requests.errors.bibid.blank') } - elsif netid.nil? + elsif netid.nil? return { :error => I18n.t('requests.errors.email.blank') } elsif params[:holding_id].nil? #return { :error => I18n.t('requests.errors.holding_id.blank') } @@ -1059,7 +1061,7 @@ def make_voyager_request params when 'callslip' v.itemid.blank? ? v.place_callslip_title! : v.place_callslip_item! end - #Rails.logger.debug "Response" + v.inspect + #Rails.logger.debug "Response" + v.inspect if v.mtype.strip == 'success' return { :success => I18n.t('requests.success') } else @@ -1144,7 +1146,7 @@ def available_in_bd? netid, params Rails.logger.warn 'Requests: Borrow Direct gave error.' Rails.logger.warn e.message Rails.logger.warn e.backtrace.inspect - Rails.logger.warn response.inspect + Rails.logger.warn response.inspect return false end end @@ -1164,7 +1166,7 @@ def patron_barcode(netid) JSON.parse(response.body)['bc'] end - + end end @@ -1179,5 +1181,3 @@ def clean_isbn temp end end - - From 75f4227f2c2c50160e409b384cc09fc60403d7c5 Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Mon, 17 Oct 2016 10:23:19 -0400 Subject: [PATCH 14/20] Fix bug where a single multivol_b item (a bound-with) goes into an endless loop upon request (#74) --- .../request_controller.rb | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/controllers/blacklight_cornell_requests/request_controller.rb b/app/controllers/blacklight_cornell_requests/request_controller.rb index adac35b..d857b8b 100755 --- a/app/controllers/blacklight_cornell_requests/request_controller.rb +++ b/app/controllers/blacklight_cornell_requests/request_controller.rb @@ -10,19 +10,19 @@ def initialize(data) @data = data end end - + class RequestController < ApplicationController include Blacklight::Catalog # needed for "fetch", replaces "include SolrHelper" include Cornell::LDAP - - # This may seem redundant, but it makes it easier to fetch the document from + + # This may seem redundant, but it makes it easier to fetch the document from # various model classes def get_solr_doc doc_id resp, document = fetch doc_id document end - + def magic_request target='' @id = params[:bibid] @@ -30,9 +30,9 @@ def magic_request target='' @document = @document Rails.logger.debug "Viewing item #{@id} (within request controller) - session: #{session}" - + # Do a check to see whether the circ_policy_locs table is populated — for some - # bizarre reason, it has been turning up empty in production. + # bizarre reason, it has been turning up empty in production. begin if Circ_policy_locs.count() < 1 raise BlacklightCornellRequests::RequestDatabaseException, 'circ_policy_locs table has less than one row' @@ -42,7 +42,7 @@ def magic_request target='' Appsignal.add_exception(e) end - # If the holdings data has been stored in the session (:holdings_status_short), + # If the holdings data has been stored in the session (:holdings_status_short), # we'll pass it in to the request to be reused instead of making # the expensive holdings service call again. As soon as it's used, the session # data gets cleared so that we don't end up passing stale session data for a different @@ -50,7 +50,7 @@ def magic_request target='' # the normal catalog path). A better way of handling this might be to compare the # bibid and the key of the holdings data, which should be the same. session_holdings = session[:holdings_status_short] - session[:holdings_status_short] = nil + session[:holdings_status_short] = nil req = BlacklightCornellRequests::Request.new(@id, session_holdings) req.netid = request.env['REMOTE_USER'] req.netid.sub!('@CORNELL.EDU', '') unless req.netid.nil? @@ -61,7 +61,7 @@ def magic_request target='' # preserve the volume selection; this would be the case if the page is reloaded # or the user selects an alternate delivery method for the same item. if session[:setvol].nil? && (request.referer && request.referer.include?('catalog')) - session[:volume] = nil + session[:volume] = nil end session[:setvol] = nil @@ -69,12 +69,12 @@ def magic_request target='' # Reset session var after use so that we don't get weird results if # user goes to another catalog item session[:volume] = nil - + # If there's a URL-based volume present, that overrides the session data (this # should only happen now if someone is linking into requests from outside the main # catalog). if params[:enum] || params[:chron] || params[:year] - params[:volume] = "|#{params[:enum]}|#{params[:chron]}|#{params[:year]}|" + params[:volume] = "|#{params[:enum]}|#{params[:chron]}|#{params[:year]}|" end req.magic_request @document, request.env['HTTP_HOST'], {:target => target, :volume => params[:volume]} @@ -119,7 +119,9 @@ def magic_request target='' else # a bit hacky solution here to get to request path # will need more rails compliant solution down the road... - redirect_to '/request' + request.env['PATH_INFO'] + "/#{req.volumes[req.volumes.keys[0]]}" + # modified to use new volume specification schema + enum, chron, year = req.volumes[req.volumes.keys[0]][1..-1].split /\|/ + redirect_to '/request' + request.env['PATH_INFO'] + "?enum=#{enum}&chron=#{chron}&year=#{year}" #{}"/#{req.volumes[req.volumes.keys[0]]}" return end elsif req.request_options.present? From 0f3ee10a9ca6ea70f2dfb79daf0855e0af115c17 Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Mon, 17 Oct 2016 10:27:30 -0400 Subject: [PATCH 15/20] Update release notes --- release_notes.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/release_notes.md b/release_notes.md index 4b62e1b..f44654d 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,14 @@ # Release Notes - blacklight-cornell-requests +## NEW VERSION TBD - 1.3.1? + +### Enhancements +- "Document Delivery" labels changed to "ScanIt" (DISCOVERYACCESS-2705) + +### Bug fixes +- Fixed a TypeError bug (DISCOVERYACCESS-2766) +- Fix bug where a single multivol_b item (a bound-with) goes into an endless loop upon request (#74) + ## v1.3 - Engine updated for compatibility with Blacklight 6 - Fixed a bug that prevented reserve items from being requested through BD @@ -58,4 +67,4 @@ ## v1.1.4 ### Bug fixes -- Added Borrow Direct API key and updated to latest version of borrow_direct gem to fix broken BD calling \ No newline at end of file +- Added Borrow Direct API key and updated to latest version of borrow_direct gem to fix broken BD calling From 40e470df90ddd71ff23709a37a576f63a4ea1071 Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Wed, 19 Oct 2016 10:56:11 -0400 Subject: [PATCH 16/20] Add disabling for borrow direct --- app/models/blacklight_cornell_requests/request.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/blacklight_cornell_requests/request.rb b/app/models/blacklight_cornell_requests/request.rb index 8c9ee93..272cd92 100755 --- a/app/models/blacklight_cornell_requests/request.rb +++ b/app/models/blacklight_cornell_requests/request.rb @@ -1103,6 +1103,9 @@ def make_voyager_request params # params = { :isbn, :title } # ISBN is best, but title will work if ISBN isn't available. def available_in_bd? netid, params + + # Don't bother if BD has been disabled in .env + return false if ENV['DISABLE_BORROW_DIRECT'].present? # Set up params for BorrowDirect gem BorrowDirect::Defaults.api_key = ENV['BORROW_DIRECT_TEST_API_KEY'] From ad678f941ca338799604cc3184a9ffc4975d4e9f Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Wed, 19 Oct 2016 11:17:04 -0400 Subject: [PATCH 17/20] Add disabling for Voyager delivery methods (L2L, hold, recall) --- .../blacklight_cornell_requests/request.rb | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/models/blacklight_cornell_requests/request.rb b/app/models/blacklight_cornell_requests/request.rb index 272cd92..0998c47 100755 --- a/app/models/blacklight_cornell_requests/request.rb +++ b/app/models/blacklight_cornell_requests/request.rb @@ -765,7 +765,8 @@ def get_cornell_delivery_options item elsif item_loan_type == 'regular' && item[:status] == NOT_CHARGED && music_library_requestable?(item) && - !unbound_type?(typeCode) + !unbound_type?(typeCode) && + !ENV['DISABLE_L2L'].present? request_options.push({:service => L2L, :location => item[:location] } ) elsif item_loan_type == 'regular' && @@ -774,18 +775,18 @@ def get_cornell_delivery_options item :location => item[:location]}) if music_library_requestable?(item) request_options.push({:service => RECALL, - :location => item[:location]}, - {:service => HOLD, + :location => item[:location]}) unless ENV['DISABLE_RECALL'].present? + request_options.push({:service => HOLD, :location => item[:location], - :status => item[:status]}) + :status => item[:status]}) unless ENV['DISABLE_HOLD'].present? end elsif item_loan_type == 'regular' && [IN_TRANSIT_DISCHARGED, IN_TRANSIT_ON_HOLD].include?(item[:status]) && music_library_requestable?(item) request_options.push({:service => RECALL, - :location => item[:location]}, - {:service => HOLD, - :location => item[:location]}) + :location => item[:location]}) unless ENV['DISABLE_RECALL'].present? + request_options.push({:service => HOLD, + :location => item[:location]}) unless ENV['DISABLE_HOLD'].present? elsif ['regular','day'].include?(item_loan_type) && [MISSING, LOST].include?(item[:status]) request_options.push({:service => PURCHASE, @@ -799,7 +800,7 @@ def get_cornell_delivery_options item if music_library_requestable?(item) request_options.push({:service => HOLD, :location => item[:location], - :status => item[:status] }) + :status => item[:status] }) unless ENV['DISABLE_HOLD'].present? end elsif item_loan_type == 'day' && item[:status] == NOT_CHARGED @@ -808,7 +809,7 @@ def get_cornell_delivery_options item elsif music_library_requestable?(item) && !unbound_type?(item) request_options.push( {:service => L2L, - :location => item[:location] } ) + :location => item[:location] } ) unless ENV['DISABLE_L2L'].present? end elsif item_loan_type == 'minute' return request_options.push( {:service => ASK_CIRCULATION, @@ -830,9 +831,9 @@ def get_guest_delivery_options item if noncirculating? item [] elsif item[:status] == NOT_CHARGED && (item_loan_type == 'regular' || item_loan_type == 'day') - [ { :service => L2L, :location => item[:location] } ] unless (no_l2l_day_loan_types?(item_loan_type) || !music_library_requestable?(item) || unbound_type?(typeCode)) + [ { :service => L2L, :location => item[:location] } ] unless (no_l2l_day_loan_types?(item_loan_type) || !music_library_requestable?(item) || unbound_type?(typeCode) || ENV['DISABLE_L2L'].present?) elsif item[:status] == CHARGED && (item_loan_type == 'regular' || item_loan_type == 'day') && music_library_requestable?(item) - [ { :service => HOLD, :location => item[:location], :status => item[:itemStatus] } ] + [ { :service => HOLD, :location => item[:location], :status => item[:itemStatus] } ] unless ENV['DISABLE_HOLD'].present? elsif item_loan_type == 'minute' && (item[:status] == NOT_CHARGED || item[:status] == CHARGED) [ { :service => ASK_CIRCULATION, :location => item[:location] } ] else From 214f26f7247a35469f5c6c3940541c396a9ab6bd Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Wed, 19 Oct 2016 11:52:21 -0400 Subject: [PATCH 18/20] Add disabling for ILL and document delivery/scanit --- .../blacklight_cornell_requests/request.rb | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/app/models/blacklight_cornell_requests/request.rb b/app/models/blacklight_cornell_requests/request.rb index 0998c47..d0c298b 100755 --- a/app/models/blacklight_cornell_requests/request.rb +++ b/app/models/blacklight_cornell_requests/request.rb @@ -761,7 +761,7 @@ def get_cornell_delivery_options item if item_loan_type == 'nocirc' || noncirculating?(item) request_options.push({:service => ILL, - :location => item[:location]}) + :location => item[:location]}) unless ENV['DISABLE_ILL'].present? elsif item_loan_type == 'regular' && item[:status] == NOT_CHARGED && music_library_requestable?(item) && @@ -772,7 +772,7 @@ def get_cornell_delivery_options item elsif item_loan_type == 'regular' && item[:status] == CHARGED request_options.push({:service => ILL, - :location => item[:location]}) + :location => item[:location]}) unless ENV['DISABLE_ILL'].present? if music_library_requestable?(item) request_options.push({:service => RECALL, :location => item[:location]}) unless ENV['DISABLE_RECALL'].present? @@ -790,13 +790,13 @@ def get_cornell_delivery_options item elsif ['regular','day'].include?(item_loan_type) && [MISSING, LOST].include?(item[:status]) request_options.push({:service => PURCHASE, - :location => item[:location]}, - {:service => ILL, :location => item[:location]}) + request_options.push({:service => ILL, + :location => item[:location]}) unless ENV['DISABLE_ILL'].present? elsif item_loan_type == 'day' && item[:status] == CHARGED request_options.push({:service => ILL, - :location => item[:location] }) + :location => item[:location] }) unless ENV['DISABLE_ILL'].present? if music_library_requestable?(item) request_options.push({:service => HOLD, :location => item[:location], @@ -816,7 +816,7 @@ def get_cornell_delivery_options item :location => item[:location] } ) elsif item[:status] == AT_BINDERY return request_options.push( {:service => ILL, - :location => item[:location] } ) + :location => item[:location] } ) unless ENV['DISABLE_ILL'].present? end request_options @@ -854,6 +854,8 @@ def sort_request_options request_options # Determine whether document delivery should be available for a given item # This is based on library location and item format def docdel_eligible? item + + return false if ENV['DISABLE_DOCUMENT_DELIVERY'].present? # Pretty much everything at the Annex should be requestable through DD # (DISCOVERYACCESS-1257) @@ -1083,23 +1085,6 @@ def make_voyager_request params end - - # def xxborrowDirect_available? params - # - # if !@bd.nil? - # return @bd - # else - # begin - # @bd = available_in_bd?(self.netid, params) - # return @bd - # rescue => e - # Rails.logger.info "Error checking borrow direct availability: exception #{e.class.name} : #{e.message}" - # @bd = false - # return @bd - # end - # end - # end - # Determine Borrow Direct availability for an ISBN or title # params = { :isbn, :title } # ISBN is best, but title will work if ISBN isn't available. From 3a99754d274ff99e2ca1febcbbcac48bfecbe44a Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Wed, 19 Oct 2016 11:55:54 -0400 Subject: [PATCH 19/20] Update release notes for #80 --- release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release_notes.md b/release_notes.md index d6f7bd6..536328c 100644 --- a/release_notes.md +++ b/release_notes.md @@ -4,6 +4,7 @@ ### Enhancements - "Document Delivery" labels changed to "ScanIt" (DISCOVERYACCESS-2705) +- Delivery methods can now be individually disabled by using the ENV file configuration (#80) ### Bug fixes - Fixed a TypeError bug (DISCOVERYACCESS-2766) From 0258b48d85ce81bd4031a7ce6ca86500cd91592f Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Mon, 24 Oct 2016 14:19:09 -0400 Subject: [PATCH 20/20] Bump version to 1.3.1 for release --- lib/blacklight_cornell_requests/version.rb | 2 +- release_notes.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/blacklight_cornell_requests/version.rb b/lib/blacklight_cornell_requests/version.rb index 07f3ebc..9e90ba8 100755 --- a/lib/blacklight_cornell_requests/version.rb +++ b/lib/blacklight_cornell_requests/version.rb @@ -1,3 +1,3 @@ module BlacklightCornellRequests - VERSION = "1.3.1dev" + VERSION = "1.3.1" end diff --git a/release_notes.md b/release_notes.md index d6f7bd6..0756efc 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,6 +1,6 @@ # Release Notes - blacklight-cornell-requests -## NEW VERSION TBD - 1.3.1? +## v1.3.1 ### Enhancements - "Document Delivery" labels changed to "ScanIt" (DISCOVERYACCESS-2705)