[OPEN-ILS-GENERAL] Suppressing the view of volumes in OPAC

John Morris jmorris at beau.org
Thu Feb 17 01:59:25 EST 2011


On Wed, 2011-02-16 at 15:48 -0500, Geoff Brown wrote:

> 
> Does anyone know how to set up the OPAC view to suppress the display
> of items in the catalogue (ie: volumes of periodicals)? You can edit
> the item attributes to not be visible in the OPAC when creating
> individual items, however is there an admin function that permits
> you to edit the display of already existing volumes over the entire
> system or do you have to edit each item individually?

Since I'll assume you aren't wanting to hide every holding how would you
select the ones to hide?  For example if you had a list of holding ids
or item barcodes the fastest and perhaps nasty way would be to just use
SQL to "UPDATE asset.copy SET opac_visible = FALSE WHERE barcode = ?"
Wrapping that in a short perl script to do that once for each line in a
file would be pretty simple and using a precompiled query would be
blinding fast even on a long list.  Or if your perl/Pg kung-fu isn't
that strong just transform the list of barcodes into standalone UPDATE
lines which you can feed into psql.  And unless you are modifying
hundreds of thousands of records it should still complete in an
acceptable time.

Since it is so short I can bang it out untested with some level of
confidence, here would be a first cut at the bash version:
#!/bin/bash
while read record; do
echo "UPDATE asset.copy 
      SET opac_visible=FALSE
      WHERE barcode = $record ;"
done

Run the above redirecting input from a file full of barcodes and either
redirect the output in to a file or just pipe it to psql.

$ hide_holdings <barcodes | psql -U evergreen -h dbserver evergreen

Or if there is a set of identifiable things in the particular MARC
records a query on metabib.real_full_rec can get you the list of items
to feed into the above.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://libmail.georgialibraries.org/pipermail/open-ils-general/attachments/20110217/0274c8ae/attachment.pgp 


More information about the Open-ils-general mailing list