From 806140d0c3dc685f7973212730bb201e637e1b08 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 28 Sep 2016 16:27:59 -0400 Subject: [PATCH] JBAS-1377 New headings report UI / report view. Adds a new reporter.cataloged_browse_entry DB view for finding browse headings based on when their bibs were cataloged. Adds a UI for searching and displayin such headings. Signed-off-by: Bill Erickson --- KCLS/sql/schema/deploy/new-headings-report.sql | 286 ++++++++++++++++++ KCLS/sql/schema/revert/new-headings-report.sql | 31 ++ KCLS/sql/schema/sqitch.plan | 1 + KCLS/sql/schema/verify/new-headings-report.sql | 7 + Open-ILS/examples/fm_IDL.xml | 53 ++++ .../src/templates/cat/authority/new_headings.tt2 | 301 +++++++++++++++++++ .../js/ui/default/cat/authority/new_headings.js | 321 +++++++++++++++++++++ Open-ILS/xul/staff_client/server/admin/index.xhtml | 3 + 8 files changed, 1003 insertions(+) create mode 100644 KCLS/sql/schema/deploy/new-headings-report.sql create mode 100644 KCLS/sql/schema/revert/new-headings-report.sql create mode 100644 KCLS/sql/schema/verify/new-headings-report.sql create mode 100644 Open-ILS/src/templates/cat/authority/new_headings.tt2 create mode 100644 Open-ILS/web/js/ui/default/cat/authority/new_headings.js diff --git a/KCLS/sql/schema/deploy/new-headings-report.sql b/KCLS/sql/schema/deploy/new-headings-report.sql new file mode 100644 index 0000000000..0c6332164b --- /dev/null +++ b/KCLS/sql/schema/deploy/new-headings-report.sql @@ -0,0 +1,286 @@ +-- Deploy kcls-evergreen:new-headings-report to pg +-- requires: po-print-li-count-and-date + +BEGIN; + +ALTER TABLE metabib.browse_author_entry + ADD COLUMN create_date TIMESTAMP WITH TIME ZONE + NOT NULL DEFAULT NOW(); + +ALTER TABLE metabib.browse_subject_entry + ADD COLUMN create_date TIMESTAMP WITH TIME ZONE + NOT NULL DEFAULT NOW(); + +ALTER TABLE metabib.browse_series_entry + ADD COLUMN create_date TIMESTAMP WITH TIME ZONE + NOT NULL DEFAULT NOW(); + +ALTER TABLE metabib.browse_title_entry + ADD COLUMN create_date TIMESTAMP WITH TIME ZONE + NOT NULL DEFAULT NOW(); + +ALTER TABLE metabib.browse_call_number_entry + ADD COLUMN create_date TIMESTAMP WITH TIME ZONE + NOT NULL DEFAULT NOW(); + +CREATE INDEX by_cataloging_date_idx + ON biblio.record_entry (cataloging_date) + WHERE deleted IS FALSE or deleted = FALSE; + +-- Given a tag (or tag substring), create a single string +-- concatenating the combined set of tags, indicators, subfields, +-- and values into a single string. +CREATE OR REPLACE FUNCTION evergreen.marc_tag_to_string + (tag TEXT, marcxml TEXT) RETURNS TEXT AS $FUNK$ +DECLARE + final TEXT DEFAULT ''; + datafield XML; + subfield XML; +BEGIN + FOR datafield IN SELECT UNNEST(XPATH( + '//*[starts-with(@tag,"'||tag||'")]', marcxml::XML)) LOOP + + -- delineate marc tags + IF final <> '' THEN final := final || ' | '; END IF; + + -- add the tag + final := final || (SELECT ARRAY_TO_STRING( + XPATH('//*/@tag[1]', datafield ), '')); + + -- add indicator 1 and 2, defaulting to _ + final := final || ' ' + || (SELECT REGEXP_REPLACE(ARRAY_TO_STRING( + XPATH('//*/@ind1[1]', datafield), ''), '^\s?$', '_')) + || (SELECT REGEXP_REPLACE(ARRAY_TO_STRING( + XPATH('//*/@ind2[1]', datafield), ''), '^\s?$', '_')); + + -- append each code and subfield value + FOR subfield IN SELECT UNNEST(XPATH( + '//*[@code]', datafield)) LOOP + final := final || ' $' || ( + SELECT evergreen.xml_famous5_to_text( -- unescape XML + ARRAY_TO_STRING(XPATH( + '//*/@code[1]|//*/text()[1]', subfield), ' '))); + END LOOP; + + END LOOP; + RETURN final; +END; +$FUNK$ LANGUAGE PLPGSQL; + +-- Returns a browse entry summary object of the selected type directly +-- preceeding or following the provided browse entry sort value. +-- If 'is_next' is true, return the next entry, otherwise the preceeding. +CREATE OR REPLACE FUNCTION + reporter.metabib_browse_entry_window_part + (browse_type TEXT, pivot_sort_value TEXT, is_next BOOLEAN) + RETURNS TABLE ( + entry BIGINT, + entry_value TEXT, + entry_sort_value TEXT, + entry_create_date TIMESTAMPTZ, + bib_record BIGINT, + bib_editor INTEGER, + bib_edit_date TIMESTAMPTZ, + bib_create_date TIMESTAMPTZ, + bib_cataloging_date TIMESTAMPTZ, + field_def INTEGER, + field_label TEXT, + auth_tag CHARACTER(3) + ) AS $FUNK$ +DECLARE + pivot_where TEXT; + pivot_sort TEXT; +BEGIN + + pivot_where := '<'; + pivot_sort := 'DESC'; + + IF is_next THEN + pivot_where := '>'; + pivot_sort := 'ASC'; + END IF; + + RETURN QUERY EXECUTE $$ + SELECT + entry.id, entry.value, entry.sort_value, entry.create_date, + bre.id, bre.editor, bre.edit_date, bre.create_date, + bre.cataloging_date, map.def, cmf.label, field.tag + FROM metabib.browse_$$ || browse_type || $$_entry entry + LEFT JOIN metabib.browse_$$ || + browse_type || $$_entry_def_map map + ON (map.entry = entry.id) + LEFT JOIN biblio.record_entry bre + ON (bre.id = map.source AND NOT bre.deleted) + LEFT JOIN config.metabib_field cmf ON (cmf.id = map.def) + LEFT JOIN metabib.browse_$$ || + browse_type || $$_entry_simple_heading_map hmap + ON (map.source IS NULL AND hmap.entry = entry.id) + LEFT JOIN authority.simple_heading ash ON + (ash.id = hmap.simple_heading) + LEFT JOIN authority.control_set_authority_field field + ON (field.id = ash.atag) + WHERE + (map.source IS NOT NULL OR hmap.entry IS NOT NULL) AND + entry.sort_value $$ || pivot_where || ' ' + || QUOTE_LITERAL(pivot_sort_value) || $$ + ORDER BY entry.sort_value $$ || pivot_sort || $$ + LIMIT 1 + $$; +END; +$FUNK$ LANGUAGE PLPGSQL; + + +-- Returns a browse entry summary object of the selected type directly +-- preceeding the provided browse entry sort value. +CREATE OR REPLACE FUNCTION + reporter.metabib_browse_entry_window_prev + (browse_type TEXT, pivot_sort_value TEXT) + RETURNS TABLE ( + prev_entry BIGINT, + prev_entry_value TEXT, + prev_entry_sort_value TEXT, + prev_entry_create_date TIMESTAMPTZ, + prev_bib_record BIGINT, + prev_bib_editor INTEGER, + prev_bib_edit_date TIMESTAMPTZ, + prev_bib_create_date TIMESTAMPTZ, + prev_bib_cataloging_date TIMESTAMPTZ, + prev_field_def INTEGER, + prev_field_label TEXT, + prev_auth_tag CHARACTER(3) + ) +AS $FUNK$ + SELECT * FROM + reporter.metabib_browse_entry_window_part( + browse_type, pivot_sort_value, FALSE); +$FUNK$ LANGUAGE SQL; + +-- Returns a browse entry summary object of the selected type directly +-- preceeding the provided browse entry sort value. +CREATE OR REPLACE FUNCTION + reporter.metabib_browse_entry_window_next + (browse_type TEXT, pivot_sort_value TEXT) + RETURNS TABLE ( + next_entry BIGINT, + next_entry_value TEXT, + next_entry_sort_value TEXT, + next_entry_create_date TIMESTAMPTZ, + next_bib_record BIGINT, + next_bib_editor INTEGER, + next_bib_edit_date TIMESTAMPTZ, + next_bib_create_date TIMESTAMPTZ, + next_bib_cataloging_date TIMESTAMPTZ, + next_field_def INTEGER, + next_field_label TEXT, + next_auth_tag CHARACTER(3) + ) +AS $FUNK$ + SELECT * FROM + reporter.metabib_browse_entry_window_part( + browse_type, pivot_sort_value, TRUE); +$FUNK$ LANGUAGE SQL; + +-- Returns all browse entries that link to at least one non-deleted bib +-- record that has a value set for the cataloging date. Includes details +-- on the linked record. +CREATE OR REPLACE FUNCTION + reporter.cataloged_browse_entries(browse_type TEXT) + RETURNS TABLE ( + entry BIGINT, + entry_value TEXT, + entry_sort_value TEXT, + entry_create_date TIMESTAMPTZ, + bib_record BIGINT, + bib_editor INTEGER, + bib_edit_date TIMESTAMPTZ, + bib_cataloging_date TIMESTAMPTZ, + bib_create_date TIMESTAMPTZ, + field_def INTEGER, + heading_date TIMESTAMPTZ, + rank BIGINT + ) AS $FUNK$ +BEGIN + RETURN QUERY EXECUTE $$ + WITH cataloged_entries AS ( + SELECT + entry.id, entry.value, entry.sort_value, entry.create_date, + map.source, bre.editor, bre.edit_date, bre.cataloging_date, + bre.create_date, map.def, + GREATEST(bre.cataloging_date, entry.create_date), + RANK() OVER ( + PARTITION BY entry.id + ORDER BY + bre.cataloging_date, + map.id -- tie breaker + ) + FROM metabib.browse_$$ || browse_type || $$_entry entry + JOIN metabib.browse_$$ || browse_type || $$_entry_def_map map + ON (map.entry = entry.id) + JOIN biblio.record_entry bre ON (bre.id = map.source) + WHERE + bre.deleted IS FALSE AND + bre.cataloging_date IS NOT NULL + ) + SELECT all_entries.* + FROM cataloged_entries all_entries + -- we only want the most relevent linked bib record + WHERE all_entries.rank = 1 + $$; +END; +$FUNK$ LANGUAGE PLPGSQL; + +CREATE OR REPLACE VIEW reporter.cataloged_browse_entry_combined AS + SELECT 'subject'::TEXT AS browse_axis, * + FROM reporter.cataloged_browse_entries('subject') + UNION ALL + SELECT 'author'::TEXT AS browse_axis, * + FROM reporter.cataloged_browse_entries('author') + UNION ALL + SELECT 'series'::TEXT AS browse_axis, * + FROM reporter.cataloged_browse_entries('series') + ; + +CREATE OR REPLACE VIEW reporter.cataloged_browse_entry AS +SELECT entry.*, + cmf.label AS field_label, + usr.usrname AS bib_editor_usrname, + evergreen.marc_tag_to_string('1', bre.marc) AS bib_marc_1xx, + evergreen.marc_tag_to_string('245', bre.marc) AS bib_marc_245, + (reporter.metabib_browse_entry_window_prev( + entry.browse_axis, entry.entry_sort_value)).*, + (reporter.metabib_browse_entry_window_next( + entry.browse_axis, entry.entry_sort_value)).* +FROM reporter.cataloged_browse_entry_combined entry + JOIN config.metabib_field cmf ON (cmf.id = entry.field_def) + JOIN biblio.record_entry bre ON (bre.id = entry.bib_record) + JOIN actor.usr usr ON (usr.id = bre.editor) +ORDER BY + CASE entry.browse_axis + WHEN 'author' THEN 1 + WHEN 'subject' THEN 2 + ELSE 3 + END, + entry.entry_sort_value +; + +-- Local testing + +/* +update metabib.browse_series_entry set create_date = now() - '2 days'::interval; +update metabib.browse_series_entry set create_date = now() WHERE id between 1 and 1000; +update metabib.browse_subject_entry set create_date = now() - '2 days'::interval; +update metabib.browse_subject_entry set create_date = now() WHERE id between 1 and 1000; +update metabib.browse_author_entry set create_date = now() - '2 days'::interval; +update metabib.browse_author_entry set create_date = now() WHERE id between 1 and 1000; +*/ + +/* +SELECT * +FROM reporter.cataloged_browse_subject_entry +WHERE DATE(heading_date) >= current_date ORDER BY entry_sort_value; +*/ + +-- /LOCAL TESTING + +COMMIT; diff --git a/KCLS/sql/schema/revert/new-headings-report.sql b/KCLS/sql/schema/revert/new-headings-report.sql new file mode 100644 index 0000000000..a8530d1a36 --- /dev/null +++ b/KCLS/sql/schema/revert/new-headings-report.sql @@ -0,0 +1,31 @@ +-- Revert kcls-evergreen:new-headings-report from pg + +BEGIN; + +/* +DROP VIEW reporter.cataloged_browse_subject_entry; +DROP VIEW reporter.cataloged_browse_author_entry; +DROP VIEW reporter.cataloged_browse_series_entry; +*/ + +DROP VIEW reporter.cataloged_browse_entry; +DROP VIEW reporter.cataloged_browse_entry_combined; + +DROP FUNCTION IF EXISTS + reporter.cataloged_browse_entries(TEXT); +DROP FUNCTION IF EXISTS + reporter.metabib_browse_entry_window_prev(TEXT, TEXT); +DROP FUNCTION IF EXISTS + reporter.metabib_browse_entry_window_next(TEXT, TEXT); +DROP FUNCTION IF EXISTS + reporter.metabib_browse_entry_window_part (TEXT, TEXT, BOOLEAN); + +DROP FUNCTION evergreen.marc_tag_to_string(TEXT, TEXT); + +ALTER TABLE metabib.browse_author_entry DROP COLUMN create_date; +ALTER TABLE metabib.browse_subject_entry DROP COLUMN create_date; +ALTER TABLE metabib.browse_series_entry DROP COLUMN create_date; +ALTER TABLE metabib.browse_title_entry DROP COLUMN create_date; +ALTER TABLE metabib.browse_call_number_entry DROP COLUMN create_date; + +COMMIT; diff --git a/KCLS/sql/schema/sqitch.plan b/KCLS/sql/schema/sqitch.plan index 52cad6b20f..8ba54230bb 100644 --- a/KCLS/sql/schema/sqitch.plan +++ b/KCLS/sql/schema/sqitch.plan @@ -32,3 +32,4 @@ sip-act-type-freegalsip [payflow-hosted-org-settings] 2016-08-19T20:24:01Z Bill audit-table-maint [payflow-hosted-org-settings] 2016-07-22T14:49:08Z Bill Erickson # Audit table cleanup functions payflow-hosted-static-silent-post-url [payflow-hosted-org-settings] 2016-08-17T13:14:48Z Bill Erickson # Fall back to PP silent post URL teacher-group [student-groups] 2016-09-16T17:43:41Z Bill Erickson # Teach ecard group and policy configs +new-headings-report [po-print-li-count-and-date] 2016-01-28T22:23:12Z Bill Erickson # Support for reporting on new browse headings diff --git a/KCLS/sql/schema/verify/new-headings-report.sql b/KCLS/sql/schema/verify/new-headings-report.sql new file mode 100644 index 0000000000..1ee44e2bd7 --- /dev/null +++ b/KCLS/sql/schema/verify/new-headings-report.sql @@ -0,0 +1,7 @@ +-- Verify kcls-evergreen:new-headings-report on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK; diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 854aa3e40e..f77f7213a5 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4248,6 +4248,59 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ Loading page ... + +
+ +
+ No new headings were found for the date range specified +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Previous: + + + +
New: + + + +
Next: + + + +
From TCN: + + + + + Indexed As: + +
Edited By: + + Heading Date: + +
From 1XX:
From 245:
+
+ + +
+ +[% END %] diff --git a/Open-ILS/web/js/ui/default/cat/authority/new_headings.js b/Open-ILS/web/js/ui/default/cat/authority/new_headings.js new file mode 100644 index 0000000000..bf213b6944 --- /dev/null +++ b/Open-ILS/web/js/ui/default/cat/authority/new_headings.js @@ -0,0 +1,321 @@ +dojo.require('dijit.Dialog'); +dojo.require('dijit.form.DateTextBox'); +dojo.require('dijit.form.Button'); +dojo.require('dojo.date.locale'); +dojo.require("fieldmapper.Fieldmapper"); +dojo.require('openils.CGI'); +dojo.require('openils.PermaCrud'); +dojo.require('openils.Util'); +dojo.require('openils.XUL'); + +var cgi = new openils.CGI(); +var pcrud = new openils.PermaCrud(); +var page_size = 50; // TODO UI +var page_offset = 0; // TODO UI +var start_date; +var end_date; +// Max summary display field length before truncation +var max_val_length = 80; +var headings_tbody; +var template_row; +var cached_headings +var all_fetched; + +var summary_fields = [ + 'prev_entry_value', + 'entry_value', + 'next_entry_value', + 'field_label', + 'bib_record', + 'heading_date', + 'bib_editor_usrname', + 'prev_auth_tag', + 'next_auth_tag', + 'bib_marc_1xx', + 'bib_marc_245' +]; + +var extended_fields = [ + 'prev_entry', + 'prev_bib_record', + 'prev_field_label', + 'entry', + 'entry_create_date', + 'bib_edit_date', + 'bib_create_date', + 'bib_cataloging_date', + 'next_entry', + 'next_bib_record', + 'next_field_label', +]; + +extended_fields = extended_fields.concat(summary_fields); + +function load() { + + if (!headings_tbody) { + headings_tbody = dojo.byId('headings-tbody'); + template_row = headings_tbody.removeChild( + dojo.byId('headings-row-template')); + } + + setup_paging(); + + dojo.byId('apply-dates-btn').onclick = function() { + page_offset = 0; + load_headings(true); // reset + } + + load_headings(true); +} + +// Fetch headings. +// Limiting each pcrud query by browse_axis significantly speeds up +// the DB query, so fetch in order of display: author -> subject -> series. +function load_headings(is_new, new_page) { + + if (is_new) { // reset cache + cached_headings = []; + all_fetched = false; + new_page = true; + openils.Util.hide('zero-hits'); + } + + if (new_page) { + openils.Util.show('loading-indicator'); + dojo.byId('ind-page').innerHTML = page_number(); + openils.Util.hide('headings-table'); + openils.Util.hide('author-header-row'); + openils.Util.hide('subject-header-row'); + openils.Util.hide('series-header-row'); + dojo.query('[class=heading-row]').forEach(function(node) { + node.parentNode.removeChild(node) + }); + } + + // force the main dojo body div to scroll to the top + // during all navigation. + dojo.byId('oils-base-body-block').scrollTop = 0; + + if (cached_headings.length >= page_offset + page_size || all_fetched) { + return draw(); + } + + /* cache 4 pages, plus 1 heading at a time */ + var fetch_count = page_size * 4 + 1; + + pcrud.search('rcbe', compile_date_filter(), { + offset : page_offset, + limit : fetch_count, + async : true, + oncomplete : function(r) { + var new_headings = openils.Util.readResponse(r); + cached_headings = cached_headings.concat(new_headings); + + var fetched = new_headings.length; + console.log('Loaded ' + fetched + ' headings'); + + if (fetched < fetch_count) all_fetched = true; + draw(); + } + }); +} + +var first_load = true; +function compile_date_filter() { + + if (first_load) { + first_load = false; + startDate.attr('value', new Date()); + endDate.attr('value', new Date()); + } + + start_date = startDate.attr('value'); + end_date = endDate.attr('value'); + + if (start_date) { + start_date = openils.Util.getYMD(start_date); + } + + if (end_date) { + // the end date has to be extended by one day, since the between + // query cuts off at midnight (0 hour) on the end date, which + // would miss all headings for that date created after hour 0. + // note: setDate() will rollover to the next month when needed. + end_date.setDate(end_date.getDate() + 1); + end_date = openils.Util.getYMD(end_date); + } + + var date_filter = {heading_date : {}}; + + if (start_date && end_date) { + date_filter.heading_date = {between : [start_date, end_date]} + } else if (start_date) { + date_filter.heading_date = {'>=' : start_date}; + } else { + date_filter.heading_date = {'<=' : end_date}; + } + + return date_filter; +} + +function page_number() { + return (page_offset / page_size) + 1 +} + +function setup_paging() { + + dojo.byId('page-number').innerHTML = page_number(); + + dojo.byId('prev-page-btn').onclick = function() { + if (page_offset <= 0) return; + page_offset -= page_size; + load_headings(false, true); + dojo.byId('page-number').innerHTML = page_number(); + } + + dojo.byId('next-page-btn').onclick = function() { + page_offset += page_size; + load_headings(false, true); + dojo.byId('page-number').innerHTML = page_number(); + } +} + +function draw() { + + headings = cached_headings.slice(page_offset, page_offset + page_size); + openils.Util.hide('loading-indicator'); + + if (headings.length == 0) { + openils.Util.show('zero-hits'); + return; + } + + openils.Util.show('headings-table', 'table'); + + if (page_offset == 0) { + dojo.byId('prev-page-btn').setAttribute('disabled', true); + } else { + dojo.byId('prev-page-btn').removeAttribute('disabled'); + } + + console.log('total = ' + cached_headings.length); + console.log('page size = ' + page_size); + console.log('page offset = ' + page_offset); + + if (cached_headings.length > page_size + page_offset) { + dojo.byId('next-page-btn').removeAttribute('disabled'); + } else { + dojo.byId('next-page-btn').setAttribute('disabled', true); + } + + dojo.forEach(headings, function(heading, idx) { + + var row = template_row.cloneNode(true); + row.id = 'headings-row-' + idx; + + if (heading.browse_axis() == 'author') { + headings_tbody.insertBefore(row, dojo.byId('subject-header-row')); + openils.Util.show('author-header-row', 'table-row'); + } else if (heading.browse_axis() == 'subject') { + openils.Util.show('subject-header-row', 'table-row'); + headings_tbody.insertBefore(row, dojo.byId('series-header-row')); + } else { + openils.Util.show('series-header-row', 'table-row'); + headings_tbody.appendChild(row); + } + + if (!heading.prev_bib_record()) { + openils.Util.show( + openils.Util.getNodeByName('prev-auth-tag-wrapper', row), + 'inline' + ); + } + + if (!heading.next_bib_record()) { + openils.Util.show( + openils.Util.getNodeByName('next-auth-tag-wrapper', row), + 'inline' + ); + } + + dojo.forEach(summary_fields, function(heading_field) { + var value = heading[heading_field](); + + if (heading_field.match(/date/)) { + value = dojo.date.locale.format( + new Date(Date.parse(value)), {formatLength:'short'}); + } else { + // prevent values from being crazy long + if (value && value.length > max_val_length) + value = value.substr(0, max_val_length) + '...'; + } + + openils.Util.getNodeByName(heading_field, row).innerHTML = value; + + if (heading_field == 'entry_value') { + var link = openils.Util.getNodeByName( + 'heading-dialog-link', row); + + link.onclick = function() { + flesh_details_dialog(heading); + } + } else if (heading_field.match('entry_value')) { + var node = openils.Util.getNodeByName( + heading_field + '-auth-bib-tag', row); + if (heading_field == 'prev_entry_value') { + node.innerHTML = heading.prev_bib_record() ? 'B: ' : 'A: '; + } else { + node.innerHTML = heading.next_bib_record() ? 'B: ' : 'A: '; + } + } + + if (heading_field == 'bib_record') { + var link = openils.Util.getNodeByName( + 'bib_record-catalog-link', row); + + // append the bib record ID to the in-template catalog link. + link.setAttribute('href', link.getAttribute('href') + value); + + if (openils.XUL.isXUL()) { + // open a new staff client tab to view the bib record + var target_url = oilsBasePath + '/opac/record/' + value; + + link.onclick = function() { + openils.XUL.newTabEasy( + xulG.url_prefix( + 'chrome://open_ils_staff_client/content/cat/opac.xul'), + null, {'opac_url' : target_url} + ); + return false; + } + } + } + }); + }); +} + +function flesh_details_dialog(heading) { + + detail_dialog.show(); + + dojo.forEach(extended_fields, function(heading_field) { + var value = heading[heading_field](); + + if (heading_field.match(/date/)) { + value = dojo.date.locale.format( + new Date(Date.parse(value)), {formatLength:'short'}); + } + + try { + openils.Util.getNodeByName('extended-' + heading_field, + detail_dialog.domNode).innerHTML = value; + } catch (E) { + console.error('Error setting value for field ' + heading_field); + throw E; + } + }); +} + +dojo.addOnLoad(load); + diff --git a/Open-ILS/xul/staff_client/server/admin/index.xhtml b/Open-ILS/xul/staff_client/server/admin/index.xhtml index ea4a3f1447..739fbf4940 100644 --- a/Open-ILS/xul/staff_client/server/admin/index.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/index.xhtml @@ -93,6 +93,9 @@ + -- 2.11.0