From: Bill Erickson Date: Wed, 15 Aug 2018 18:08:41 +0000 (-0400) Subject: LP#1721575 Stamping DB upgrade: batch catalog actions X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4e0528b11a244734b0d2835dd8ce6c96fb28a5fd;p=Evergreen.git LP#1721575 Stamping DB upgrade: batch catalog actions Also replaced a remaining reference to "cart" with "basket" Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 08763f66f6..728d937a19 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1117', :eg_version); -- berick/kmlussier +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1118', :eg_version); -- gmcharlt/berick CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1118.data.bre_format_title_fix.sql b/Open-ILS/src/sql/Pg/upgrade/1118.data.bre_format_title_fix.sql new file mode 100644 index 0000000000..73470ac0e8 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1118.data.bre_format_title_fix.sql @@ -0,0 +1,90 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1118', :eg_version); + +UPDATE action_trigger.event_definition +SET template = +$$ +[%- USE date -%] +[%- SET user = target.0.owner -%] +To: [%- params.recipient_email || user.email %] +From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] +Subject: Bibliographic Records +Auto-Submitted: auto-generated + +[% FOR cbreb IN target %] +[% FOR item IN cbreb.items; + bre_id = item.target_biblio_record_entry; + + bibxml = helpers.unapi_bre(bre_id, {flesh => '{mra}'}); + title = ''; + FOR part IN bibxml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b"]'); + title = title _ part.textContent; + END; + + author = bibxml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent; + item_type = bibxml.findnodes('//*[local-name()="attributes"]/*[local-name()="field"][@name="item_type"]').getAttribute('coded-value'); + publisher = bibxml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent; + pubdate = bibxml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent; + isbn = bibxml.findnodes('//*[@tag="020"]/*[@code="a"]').textContent; + issn = bibxml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent; + upc = bibxml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent; +%] + +[% loop.count %]/[% loop.size %]. Bib ID# [% bre_id %] +[% IF isbn %]ISBN: [% isbn _ "\n" %][% END -%] +[% IF issn %]ISSN: [% issn _ "\n" %][% END -%] +[% IF upc %]UPC: [% upc _ "\n" %] [% END -%] +Title: [% title %] +Author: [% author %] +Publication Info: [% publisher %] [% pubdate %] +Item Type: [% item_type %] + +[% END %] +[% END %] +$$ +WHERE hook = 'biblio.format.record_entry.email' +-- from previous stock definition +AND MD5(template) = 'ee4e6c1b3049086c570c7a77413d46c1'; + +UPDATE action_trigger.event_definition +SET template = +$$ +
+ +
    + [% FOR cbreb IN target %] + [% FOR item IN cbreb.items; + bre_id = item.target_biblio_record_entry; + + bibxml = helpers.unapi_bre(bre_id, {flesh => '{mra}'}); + title = ''; + FOR part IN bibxml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b"]'); + title = title _ part.textContent; + END; + + author = bibxml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent; + item_type = bibxml.findnodes('//*[local-name()="attributes"]/*[local-name()="field"][@name="item_type"]').getAttribute('coded-value'); + publisher = bibxml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent; + pubdate = bibxml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent; + isbn = bibxml.findnodes('//*[@tag="020"]/*[@code="a"]').textContent; + %] + +
  1. + Bib ID# [% bre_id %] ISBN: [% isbn %]
    + Title: [% title %]
    + Author: [% author %]
    + Publication Info: [% publisher %] [% pubdate %]
    + Item Type: [% item_type %] +
  2. + [% END %] + [% END %] +
+
+$$ +WHERE hook = 'biblio.format.record_entry.print' +-- from previous stock definition +AND MD5(template) = '9ada7ea8417cb23f89d0dc8f15ec68d0'; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.bre_format_title_fix.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.bre_format_title_fix.sql deleted file mode 100644 index 68e47cb8a8..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.bre_format_title_fix.sql +++ /dev/null @@ -1,86 +0,0 @@ -BEGIN; - -UPDATE action_trigger.event_definition -SET template = -$$ -[%- USE date -%] -[%- SET user = target.0.owner -%] -To: [%- params.recipient_email || user.email %] -From: [%- params.sender_email || default_sender %] -Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] -Subject: Bibliographic Records -Auto-Submitted: auto-generated - -[% FOR cbreb IN target %] -[% FOR item IN cbreb.items; - bre_id = item.target_biblio_record_entry; - - bibxml = helpers.unapi_bre(bre_id, {flesh => '{mra}'}); - title = ''; - FOR part IN bibxml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b"]'); - title = title _ part.textContent; - END; - - author = bibxml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent; - item_type = bibxml.findnodes('//*[local-name()="attributes"]/*[local-name()="field"][@name="item_type"]').getAttribute('coded-value'); - publisher = bibxml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent; - pubdate = bibxml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent; - isbn = bibxml.findnodes('//*[@tag="020"]/*[@code="a"]').textContent; - issn = bibxml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent; - upc = bibxml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent; -%] - -[% loop.count %]/[% loop.size %]. Bib ID# [% bre_id %] -[% IF isbn %]ISBN: [% isbn _ "\n" %][% END -%] -[% IF issn %]ISSN: [% issn _ "\n" %][% END -%] -[% IF upc %]UPC: [% upc _ "\n" %] [% END -%] -Title: [% title %] -Author: [% author %] -Publication Info: [% publisher %] [% pubdate %] -Item Type: [% item_type %] - -[% END %] -[% END %] -$$ -WHERE hook = 'biblio.format.record_entry.email' --- from previous stock definition -AND MD5(template) = 'ee4e6c1b3049086c570c7a77413d46c1'; - -UPDATE action_trigger.event_definition -SET template = -$$ -
- -
    - [% FOR cbreb IN target %] - [% FOR item IN cbreb.items; - bre_id = item.target_biblio_record_entry; - - bibxml = helpers.unapi_bre(bre_id, {flesh => '{mra}'}); - title = ''; - FOR part IN bibxml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b"]'); - title = title _ part.textContent; - END; - - author = bibxml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent; - item_type = bibxml.findnodes('//*[local-name()="attributes"]/*[local-name()="field"][@name="item_type"]').getAttribute('coded-value'); - publisher = bibxml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent; - pubdate = bibxml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent; - isbn = bibxml.findnodes('//*[@tag="020"]/*[@code="a"]').textContent; - %] - -
  1. - Bib ID# [% bre_id %] ISBN: [% isbn %]
    - Title: [% title %]
    - Author: [% author %]
    - Publication Info: [% publisher %] [% pubdate %]
    - Item Type: [% item_type %] -
  2. - [% END %] - [% END %] -
-
-$$ -WHERE hook = 'biblio.format.record_entry.print' --- from previous stock definition -AND MD5(template) = '9ada7ea8417cb23f89d0dc8f15ec68d0'; diff --git a/Open-ILS/src/templates/opac/parts/anon_list.tt2 b/Open-ILS/src/templates/opac/parts/anon_list.tt2 index a834dabbda..56fbd6cee5 100644 --- a/Open-ILS/src/templates/opac/parts/anon_list.tt2 +++ b/Open-ILS/src/templates/opac/parts/anon_list.tt2 @@ -3,7 +3,7 @@

[% l('Basket') %]

- + [% INCLUDE "opac/parts/filtersort.tt2" mode='bookbag' id="anonsort" name="anonsort" value=CGI.param("anonsort") %]