From 5ba8553a87320256e0534b9f5bdf5a3b433e20bb Mon Sep 17 00:00:00 2001 From: dbs Date: Wed, 29 Dec 2010 03:37:38 +0000 Subject: [PATCH] Create authority records with meaningful cataloging agency values Hardcoded values in the 040 are problematic for sites that want to be a source of authority records; with the addition of another parameter to the open-ils.cat.authority.record.create_from_bib(.readonly) API, we can solve that problem. The callers of this API (the MARC editor) have access to the cat.marc_control_number_identifier OU setting, so as long as that is set correctly, problem solved. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19073 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Cat/Authority.pm | 11 +++++++++-- Open-ILS/xul/staff_client/server/cat/marcedit.js | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat/Authority.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat/Authority.pm index 823f430682..1995edf887 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat/Authority.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat/Authority.pm @@ -44,6 +44,7 @@ __PACKAGE__->register_method( desc => q/Create an authority record entry from a field in a bibliographic record/, params => q/ @param field A hash representing the field to control, consisting of: { tag: string, ind1: string, ind2: string, subfields: [ [code, value] ... ] } + @param identifier A MARC control number identifier @param authtoken A valid authentication token @returns The new record object /} @@ -56,12 +57,18 @@ __PACKAGE__->register_method( desc => q/Creates MARCXML for an authority record entry from a field in a bibliographic record/, params => q/ @param field A hash representing the field to control, consisting of: { tag: string, ind1: string, ind2: string, subfields: [ [code, value] ... ] } + @param identifier A MARC control number identifier @returns The MARCXML for the authority record /} ); sub create_authority_record_from_bib_field { - my($self, $conn, $field, $auth) = @_; + my($self, $conn, $field, $cni, $auth) = @_; + + # Control number identifier should have been passed in + if (!$cni) { + $cni = 'UNSET'; + } # Change the first character of the incoming bib field tag to a '1' # for use in our authority record; close enough for now? @@ -95,7 +102,7 @@ sub create_authority_record_from_bib_field { nz a22 o 4500 $arn |||||||||||||||||||||||||||||||||| -CONSCONS +$cni$cni $control MARCXML diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index f1f6ad204a..fa8678047e 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -2398,7 +2398,7 @@ function browseAuthority (sf_popup, menu_id, target, sf, limit, page) { var source_f = summarizeField(sf); var new_auth = fieldmapper.standardRequest( ["open-ils.cat", "open-ils.cat.authority.record.create_from_bib"], - [source_f, ses()] + [source_f, xulG.marc_control_number_identifier, ses()] ); if (new_auth && new_auth.id()) { var id_sf = ({xulG.marc_control_number_identifier}){new_auth.id()}; @@ -2423,7 +2423,7 @@ function browseAuthority (sf_popup, menu_id, target, sf, limit, page) { var pcrud = new openils.PermaCrud({"authtoken": authtoken}); var rec = fieldmapper.standardRequest( ["open-ils.cat", "open-ils.cat.authority.record.create_from_bib.readonly"], - { "params": [source_f] } + { "params": [source_f, xulG.marc_control_number_identifier] } ); loadMarcEditor(pcrud, rec, target, sf); } -- 2.11.0