Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ruby File.read('.ruby-version').strip
gem 'awesome_print', '>=1.8.0'
gem 'base64'
gem 'berkeley_library-docker', '~> 0.2.0'
gem 'berkeley_library-location', '~> 4.1.0'
gem 'berkeley_library-location', '~> 4.2.0'
gem 'berkeley_library-logging', '~> 0.2', '>= 0.2.7'
gem 'berkeley_library-marc', '~> 0.3.1'
gem 'berkeley_library-tind', '~> 0.8.0'
Expand Down
26 changes: 10 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ GEM
berkeley_library-util (~> 0.1, >= 0.1.2)
nokogiri (~> 1.13, >= 1.13.6)
berkeley_library-docker (0.2.0)
berkeley_library-location (4.1.0)
berkeley_library-location (4.2.0)
berkeley_library-logging (~> 0.2)
berkeley_library-util (~> 0.1, >= 0.1.9)
jsonpath (~> 0.5.8)
Expand Down Expand Up @@ -198,7 +198,7 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
json (2.6.2)
json (2.7.2)
jsonpath (0.5.8)
multi_json
jwt (1.5.6)
Expand Down Expand Up @@ -233,7 +233,7 @@ GEM
mime-types-data (3.2025.0722)
mini_mime (1.1.5)
minitest (5.25.5)
multi_json (1.15.0)
multi_json (1.19.1)
mutex_m (0.3.0)
net-imap (0.5.9)
date
Expand All @@ -252,8 +252,6 @@ GEM
racc (~> 1.4)
nokogiri (1.18.9-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-gnu)
racc (~> 1.4)
oj (3.16.11)
Expand Down Expand Up @@ -335,7 +333,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.4.1)
rexml (3.4.4)
roo (2.9.0)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
Expand Down Expand Up @@ -396,9 +394,9 @@ GEM
ruby-prof (1.3.2)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyXL (3.4.33)
rubyXL (3.4.34)
nokogiri (>= 1.10.8)
rubyzip (>= 1.3.0)
rubyzip (~> 2.4)
rubyzip (2.4.1)
sassc (2.4.0)
ffi (~> 1.9)
Expand Down Expand Up @@ -463,19 +461,15 @@ GEM
zeitwerk (2.7.3)

PLATFORMS
aarch64-linux
arm64-darwin-21
aarch64-linux-gnu
arm64-darwin-23
arm64-darwin-24
x86_64-darwin-19
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
awesome_print (>= 1.8.0)
base64
berkeley_library-docker (~> 0.2.0)
berkeley_library-location (~> 4.1.0)
berkeley_library-location (~> 4.2.0)
berkeley_library-logging (~> 0.2, >= 0.2.7)
berkeley_library-marc (~> 0.3.1)
berkeley_library-tind (~> 0.8.0)
Expand Down Expand Up @@ -533,7 +527,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 3.3.8p144
ruby 3.3.10p183

BUNDLED WITH
2.5.22
2.5.3
2 changes: 1 addition & 1 deletion app/controllers/location_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class LocationRequestsController < ApplicationController
before_action :require_framework_admin!, only: %i[immediate index]

REQUIRED_PARAMS = %i[email input_file].freeze
OPTIONAL_PARAMS = %i[rlf uc hathi immediate].freeze
OPTIONAL_PARAMS = %i[slf uc hathi immediate].freeze
ALL_PARAMS = (REQUIRED_PARAMS + OPTIONAL_PARAMS)

# GET /location_requests
Expand Down
8 changes: 4 additions & 4 deletions app/models/location_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def ensure_admin_if_immediate(request, user:)
# Synthetic accessors

def world_cat?
rlf? || uc?
slf? || uc?
end

def incomplete?
Expand Down Expand Up @@ -207,7 +207,7 @@ def search_wc_symbols
return unless world_cat?

[].tap do |symbols|
symbols.concat(BerkeleyLibrary::Location::WorldCat::Symbols::RLF) if rlf?
symbols.concat(BerkeleyLibrary::Location::WorldCat::Symbols::SLF) if slf?
symbols.concat(BerkeleyLibrary::Location::WorldCat::Symbols::UC) if uc?
end
end
Expand Down Expand Up @@ -249,7 +249,7 @@ def with_uploaded_input_file
def options_selected
return if world_cat? || hathi?

errors.add(:base, 'At least one of RLF, Other UC, or HathiTrust must be selected')
errors.add(:base, 'At least one of SLF, Other UC, or HathiTrust must be selected')
end

def new_result(oclc_number, wc_sym_str, wc_error, ht_record_url, ht_error)
Expand All @@ -269,7 +269,7 @@ def write_output_file!
end

def write_results_to(ss)
writer = XLSXWriter.new(ss, rlf:, uc:, hathi_trust: hathi)
writer = XLSXWriter.new(ss, slf:, uc:, hathi_trust: hathi)
result_data = location_records.pluck(*RESULT_ARGS)
result_data.each { |row| writer << new_result(*row) }
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/fees/_nonberk_instructions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</thead>
<tbody>
<tr>
<td>UC Los Angeles, including SRLF</td>
<td>UC Los Angeles, including SLF-S</td>
<td><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr>
Expand Down
10 changes: 5 additions & 5 deletions app/views/location_requests/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
<legend>Include</legend>
<ul class="form-input required">
<li>
<%= form.check_box :rlf %>
<%= form.label :rlf %>
<%= form.check_box :slf %>
<%= form.label :slf %>
<p class="option-note">
Checks OCLC for
<%= BerkeleyLibrary::Location::WorldCat::Symbols::NRLF.join('/') %>
<%= BerkeleyLibrary::Location::WorldCat::Symbols::SLFN.join('/') %>
and
<%= BerkeleyLibrary::Location::WorldCat::Symbols::SRLF.join('/') %>
<%= BerkeleyLibrary::Location::WorldCat::Symbols::SLFS.join('/') %>
holdings symbols
</p>
</li>
Expand All @@ -82,7 +82,7 @@
<strong>Note:</strong>
At least one of
<%=
[:rlf, :uc, :hathi]
[:slf, :uc, :hathi]
.map { |opt| t("activerecord.attributes.location_request.#{opt}") }
.to_sentence(last_word_connector: ', or ')
%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/location_requests/_location_request.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<td>
<table class="options attributes">
<tbody>
<% [:rlf, :uc, :hathi].each do |opt| %>
<% [:slf, :uc, :hathi].each do |opt| %>
<tr>
<th scope="row"><%= t("activerecord.attributes.location_request.#{opt}") %></th>
<td>
Expand Down
4 changes: 2 additions & 2 deletions app/views/location_requests/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<td></td>
<th scope="col">Email</th>
<th scope="col">Input file</th>
<th scope="col">RLF</th>
<th scope="col">SLF</th>
<th scope="col">UC</th>
<th scope="col">HT</th>
<th scope="col">Submitted</th>
Expand All @@ -34,7 +34,7 @@
<%= location_request.filename %>
<% end %>
</td>
<% [:rlf, :uc, :hathi].each do |opt| %>
<% [:slf, :uc, :hathi].each do |opt| %>
<td>
<% value = location_request.send(opt) || false %>
<%= t("activerecord.attributes.location_request.include.#{value}") %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/location_requests/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<p>
The Location Request tool takes an OCLC number and queries OCLC and/or HathiTrust.
The tool is good for searching for single-volume monographs. For multi-volume monographs
or serials, the tool is most useful if nothing is held at an RLF. If an OCLC number is
found at an RLF or HathiTrust, more checking will be necessary to determine which
or serials, the tool is most useful if nothing is held at an SLF. If an OCLC number is
found at an SLF or HathiTrust, more checking will be necessary to determine which
volume(s) is/are actually held.
</p>

Expand Down
2 changes: 1 addition & 1 deletion app/views/reference_card_forms/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'denial_reason',
['Item listed at another library',
'3-month maximum exceeded',
'Item at NRLF',
'Item at SLF-N',
'Other'],
{prompt: 'Select reason for denial'},
{:class => 'custom-select custom-select-sm col-md-4',
Expand Down
6 changes: 3 additions & 3 deletions app/views/request_mailer/reference_card_denied.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<% elsif @reference_card_form.denial_reason == '3-month maximum exceeded' %>
<p>Denied - 3-month maximum exceeded</p>
<p>Your request for a Reference Card has been denied. The maximum allowed Reference Card term is 3 months in one year. You have exceeded the term limit.</p>
<% elsif @reference_card_form.denial_reason == 'Item at NRLF' %>
<p>Denied - Item at NRLF</p>
<p>Your request for a Reference Card has been denied. The item that you have listed <%= @reference_card_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off site at the <%= link_to 'Northern Regional Library Facility (NRLF)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact NRLF to request to have the item pulled so you may view it on-site at NRLF. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from NRLF to campus.</p>
<% elsif @reference_card_form.denial_reason == 'Item at SLF-N' %>
<p>Denied - Item at SLF-N</p>
<p>Your request for a Reference Card has been denied. The item that you have listed <%= @reference_card_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off site at the <%= link_to 'Systemwide Library Facility-North (SLF-N)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact SLF-N to request to have the item pulled so you may view it on-site at SLF-N. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from SLF-N to campus.</p>
<% else %>
<p>Denied - Other</p>
<p>Your request for a Reference Card has been denied for the following reason: <%= @reference_card_form.denial_reason %>.</p>
Expand Down
6 changes: 3 additions & 3 deletions app/views/request_mailer/reference_card_denied.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<% elsif @reference_card_form.denial_reason == '3-month maximum exceeded' %>
Denied - 3-month maximum exceeded
Your request for a Reference Card has been denied. The maximum allowed Reference Card term is 3 months in one year. You have exceeded the term limit.
<% elsif @reference_card_form.denial_reason == 'Item at NRLF' %>
Denied - Item at NRLF
Your request for a Reference Card has been denied. The item that you have listed <%= @reference_card_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off site at the <%= link_to 'Northern Regional Library Facility (NRLF)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact NRLF to request to have the item pulled so you may view it on-site at NRLF. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from NRLF to campus.
<% elsif @reference_card_form.denial_reason == 'Item at SLF-N' %>
Denied - Item at SLF-N
Your request for a Reference Card has been denied. The item that you have listed <%= @reference_card_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off site at the <%= link_to 'Systemwide Library Facility-North (SLF-N)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact SLF-N to request to have the item pulled so you may view it on-site at SLF-N. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from SLF-N to campus.
<% else %>
Denied - Other
Your request for a Reference Card has been denied for the following reason: <%= @reference_card_form.denial_reason %>.
Expand Down
6 changes: 3 additions & 3 deletions app/views/request_mailer/stack_pass_denied.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<% elsif @stackpass_form.denial_reason == 'Too many passes requested' %>
<p>Denied - Too many passes requested</p>
<p>Our records show that you have utilized more than our limit of ad hoc day passes to the Main (Gardner) Stacks. Please come in person to speak with a reference librarian regarding your project to see if a more long-term option is available to you. Please also see the <%= link_to 'Information for Alumni', 'https://www.lib.berkeley.edu/information/alumni'%> and <%= link_to 'Information for Visitors', 'https://www.lib.berkeley.edu/information/visitors' %> pages on the <%= link_to 'UC Berkeley Library website', 'https://www.lib.berkeley.edu/' %>.</p>
<% elsif @stackpass_form.denial_reason == 'Item at NRLF' %>
<p>Denied - Item at NRLF</p>
<p>Your request for a Stack Pass has been denied. The item that you have listed <%= @stackpass_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off-site at the <%= link_to 'Northern Regional Library Facility (NRLF)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact NRLF to request to have the item pulled so you may view it on-site at NRLF. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from NRLF to campus.</p>
<% elsif @stackpass_form.denial_reason == 'Item at SLF-N' %>
<p>Denied - Item at SLF-N</p>
<p>Your request for a Stack Pass has been denied. The item that you have listed <%= @stackpass_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off-site at the <%= link_to 'Systemwide Library Facility-North (SLF-N)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact SLF-N to request to have the item pulled so you may view it on-site at SLF-N. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from SLF-N to campus.</p>
<% else %>
<p>Denied - reason Other</p>
<p>Your request for a Stack Pass has been denied for the following reason: <%= @stackpass_form.denial_reason %>.</p>
Expand Down
6 changes: 3 additions & 3 deletions app/views/request_mailer/stack_pass_denied.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<% elsif @stackpass_form.denial_reason == 'Too many passes requested' %>
Denied - Too many passes requested
Our records show that you have utilized more than our limit of ad hoc day passes to the Main (Gardner) Stacks. Please come in person to speak with a reference librarian regarding your project to see if a more long-term option is available to you. Please also see the <%= link_to 'Information for Alumni', 'https://www.lib.berkeley.edu/information/alumni'%> and <%= link_to 'Information for Visitors', 'https://www.lib.berkeley.edu/information/visitors' %> pages on the <%= link_to 'UC Berkeley Library website', 'https://www.lib.berkeley.edu/' %>.
<% elsif @stackpass_form.denial_reason == 'Item at NRLF' %>
Denied - Item at NRLF
Your request for a Stack Pass has been denied. The item that you have listed <%= @stackpass_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off-site at the <%= link_to 'Northern Regional Library Facility (NRLF)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact NRLF to request to have the item pulled so you may view it on-site at NRLF. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from NRLF to campus.
<% elsif @stackpass_form.denial_reason == 'Item at SLF-N' %>
Denied - Item at SLF-N
Your request for a Stack Pass has been denied. The item that you have listed <%= @stackpass_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off-site at the <%= link_to 'Systemwide Library Facility-North (SLF-N)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact SLF-N to request to have the item pulled so you may view it on-site at SLF-N. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from SLF-N to campus.
<% else %>
Denied - reason Other
Your request for a Stack Pass has been denied for the following reason: <%= @stackpass_form.denial_reason %>.
Expand Down
2 changes: 1 addition & 1 deletion app/views/stack_pass_forms/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
'denial_reason',
['Item listed at another library',
'Too many passes requested',
'Item at NRLF',
'Item at SLF-N',
'Other'],
{prompt: 'Select reason for denial'},
{:class => 'custom-select custom-select-sm col-md-4',
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ en:
filename: Input file
input_file: Input file
output_file: Output file
rlf: NRLF/SRLF holdings
slf: SLF-N/SLF-S holdings
uc: UC campus library holdings
hathi: HathiTrust URLs
include:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RenameRlfToSlfOnLocationRequests < ActiveRecord::Migration[7.0]
def change
rename_column :location_requests, :rlf, :slf
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2025_04_04_180042) do
ActiveRecord::Schema[7.0].define(version: 2025_12_22_223043) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -186,7 +186,7 @@
create_table "location_requests", force: :cascade do |t|
t.string "email", null: false
t.string "filename", null: false
t.boolean "rlf", default: false, null: false
t.boolean "slf", default: false, null: false
t.boolean "uc", default: false, null: false
t.boolean "hathi", default: false, null: false
t.datetime "created_at", null: false
Expand Down
2 changes: 1 addition & 1 deletion spec/data/location/world_cat/39281966.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"oclcSymbol": "ZAP",
"registryId": 5690,
"institutionNumber": 4218,
"institutionName": "University of California, NRLF",
"institutionName": "University of California, SLF-N",
"alsoCalled": "Northern Regional Library Facility",
"hasOPACLink": true,
"self": "https://worldcat.org/oclc-config/institution/data/5690",
Expand Down
2 changes: 1 addition & 1 deletion spec/data/location/world_cat/43903564.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"oclcSymbol": "ZAP",
"registryId": 5690,
"institutionNumber": 4218,
"institutionName": "University of California, NRLF",
"institutionName": "University of California, SLF-N",
"alsoCalled": "Northern Regional Library Facility",
"hasOPACLink": true,
"self": "https://worldcat.org/oclc-config/institution/data/5690",
Expand Down
2 changes: 1 addition & 1 deletion spec/data/location/world_cat/52937386.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"oclcSymbol": "ZAP",
"registryId": 5690,
"institutionNumber": 4218,
"institutionName": "University of California, NRLF",
"institutionName": "University of California, SLF-N",
"alsoCalled": "Northern Regional Library Facility",
"hasOPACLink": true,
"self": "https://worldcat.org/oclc-config/institution/data/5690",
Expand Down
2 changes: 1 addition & 1 deletion spec/jobs/location/world_cat_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Location
end

it 'rejects a non-Worldcat request' do
req.update(rlf: false, uc: false)
req.update(slf: false, uc: false)

expect { WorldCatJob.perform_now(req) }.to raise_error(ArgumentError)
end
Expand Down
Loading