From be003fdfc99174e951e117d30d968919be073fe8 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 22 Dec 2011 10:13:03 -0500 Subject: [PATCH] SVF in bib record summary: extract attrs on the server This repairs a FIXME within the custom bib overlay code related to parsing metabib.record_attr stores within the JS. Instead, now we use an attr parsing utility function which compiles a regular hash so the client no longer needs to parse it. Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm | 2 +- Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm index 6a9ee333bf..a018e3fdc3 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm @@ -448,7 +448,7 @@ sub biblio_record_record_metadata { my $rec = $editor->retrieve_biblio_record_entry($_); $rec->creator($editor->retrieve_actor_user($rec->creator)); $rec->editor($editor->retrieve_actor_user($rec->editor)); - $rec->attrs($editor->retrieve_metabib_record_attr($rec->id)); + $rec->attrs($U->get_bre_attrs([$rec->id], $editor)->{$rec->id}); $rec->clear_marc; # slim the record down push( @results, $rec ); } diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js b/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js index f939e68cbb..de791b102b 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js @@ -97,16 +97,10 @@ function bib_brief_overlay(params) { // Let's loop through bre.attrs.attrs and put them with any matching // elements in bib_brief_overlay.xul if (params.bre.attrs()) { - // FIXME -- we should do this in the perl; what's below isn't robust - var attrs = JSON2js( - '{' + - params.bre.attrs().attrs().replace( - '=>',':','g').replace('NULL','null','g') - + '}' - ); + var attrs = params.bre.attrs(); for (var attr in attrs) { if (exists(attr)) { - set(attr,attrs[attr]); + set(attr,attrs[attr].code); set_tooltip(attr,attr); } } -- 2.11.0