Disallow bibs from certain sources from having copies added

Bug #869338 reported by Jason Stephenson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

We have records from certain bibliographic record sources that we do not want staff manually adding volumes or copies to. In our case, these are sources for electronic records that may be transcendent (i.e. display in the OPAC without copies attached) or have targeted 856 urls and so only display for the libraries that subscribe to the service. In one case, we are expected to add, remove and update these records on a regular basis and staff added volumes and copies can impede that process or lead to angry questions from staff who want to know why their copies were deleted.

So, to implement the above, I have created a code branch that adds a field, can_have_copies, to the config.bib_source table and updates the staff client and OPAC code where appropriate to block the manual addition of volumes to bib records from a source when the can_have_copies field is FALSE. If the can_have_copies field is TRUE, then volumes and copies can be added as normal.

These code modifications do not affect the automatic creation of volumes for bib records with targeted 856 URLS.

You can get the branch from the working repo:

You need only add the remote once, regardless of how many branches you wish to look at.
To add this repo as working:
 Read-only (git protocol):
  git remote add working git://git.evergreen-ils.org/working/Evergreen
 Read-write (ssh protocol):
  git remote add working <email address hidden>:working/Evergreen

Once you have the remote added you can check out this branch:
git checkout -b config.bib_source.can_have_copies working/user/dyrcona/config.bib_source.can_have_copies

Dan Scott (denials)
Changed in evergreen:
assignee: nobody → Dan Scott (denials)
Revision history for this message
Dan Scott (denials) wrote :

Quick comments as I merged the code to a local branch for review:

1) There is some code duplication that could be reduced; I would like to see something like a commonly defined "can_bib_source_have_copies(bib_id)" JS function that just returns true or false.

2) Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm should be taught about the new column on config.bib_source

Revision history for this message
Jason Stephenson (jstephenson) wrote :

1) So, basically start the work over from scratch?

2) Ok will take a look at it.

Revision history for this message
Dan Scott (denials) wrote :

1) Oh no, not from scratch! I was thinking that you could just define the function in something like opac/common/js/opac_utils.js and then invoke it from where the code is currently duplicated - should be pretty straightforward. If you like, I could take a stab at doing that.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Made most of the changes suggested by dbs. I couldn't get chrome/content/cat/opac.js to work with cat/util.js from the server, so I reverted the changes to that file.

Rebased and forced pushed to the above branch.

I've installed on my dev machine and checked it with a few records and I get what I expect.

Changed in evergreen:
milestone: 2.2.0alpha1 → 2.2.0alpha2
milestone: 2.2.0alpha2 → none
Revision history for this message
Dan Scott (denials) wrote :

I rebased the branch to remove tiny typo fix commits and restored some munged whitespace, then wrapped the upgrade script with 0655 and pushed to master.

It works quite nicely in my testing - thanks so much for your contribution!

Changed in evergreen:
milestone: none → 2.2.0alpha2
status: New → Fix Committed
assignee: Dan Scott (denials) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.