[open-ils-commits] [GIT] Evergreen ILS branch master updated. 672b6863ecb31a061c9de597df0f7fe4c9bef0ca
Evergreen Git
git at git.evergreen-ils.org
Wed Oct 19 12:12:38 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 672b6863ecb31a061c9de597df0f7fe4c9bef0ca (commit)
from 0249e850f99c1686de7c0492389cfa5af5b1393f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 672b6863ecb31a061c9de597df0f7fe4c9bef0ca
Author: Bill Erickson <berick at esilibrary.com>
Date: Tue Sep 20 15:44:12 2011 -0400
ACQ: Add open holds count to lineitem worksheet
Includes a generic bre_open_holds_count reactor utility method
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
index 0f6262f..5f07972 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
@@ -237,6 +237,15 @@ my $_TT_helpers = {
return $str;
},
+
+ bre_open_hold_count => sub {
+ my $bre_id = shift;
+ return 0 unless $bre_id;
+ return $U->simplereq(
+ 'open-ils.circ',
+ 'open-ils.circ.bre.holds.count', $bre_id);
+ },
+
xml_doc => sub {
my ($str) = @_;
return $str ? (new XML::LibXML)->parse_string($str) : undef;
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index acccf52..02ba712 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,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 ('0641', :eg_version); -- tsbere/phasefx
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0642', :eg_version); -- berick/senator
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 637a014..9ea1baa 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -7570,6 +7570,7 @@ $$
<div>Author: [% helpers.get_li_attr("author", "", li.attributes) %]</div>
<div class="count">Item Count: [% li.lineitem_details.size %]</div>
<div class="lineid">Lineitem ID: [% li.id %]</div>
+ <div>Open Holds: [% helpers.bre_open_hold_count(li.eg_bib_id) %]</div>
[% IF li.distribution_formulas.size > 0 %]
[% SET forms = [] %]
diff --git a/Open-ILS/src/sql/Pg/upgrade/0642.data.acq-worksheet-hold-count.sql b/Open-ILS/src/sql/Pg/upgrade/0642.data.acq-worksheet-hold-count.sql
new file mode 100644
index 0000000..ad90989
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0642.data.acq-worksheet-hold-count.sql
@@ -0,0 +1,85 @@
+-- Evergreen DB patch 0642.data.acq-worksheet-hold-count.sql
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0642', :eg_version);
+
+UPDATE action_trigger.event_definition SET template =
+$$
+[%- USE date -%]
+[%- SET li = target; -%]
+<div class="wrapper">
+ <div class="summary" style='font-size:110%; font-weight:bold;'>
+
+ <div>Title: [% helpers.get_li_attr("title", "", li.attributes) %]</div>
+ <div>Author: [% helpers.get_li_attr("author", "", li.attributes) %]</div>
+ <div class="count">Item Count: [% li.lineitem_details.size %]</div>
+ <div class="lineid">Lineitem ID: [% li.id %]</div>
+ <div>Open Holds: [% helpers.bre_open_hold_count(li.eg_bib_id) %]</div>
+
+ [% IF li.distribution_formulas.size > 0 %]
+ [% SET forms = [] %]
+ [% FOREACH form IN li.distribution_formulas; forms.push(form.formula.name); END %]
+ <div>Distribution Formulas: [% forms.join(',') %]</div>
+ [% END %]
+
+ [% IF li.lineitem_notes.size > 0 %]
+ Lineitem Notes:
+ <ul>
+ [%- FOR note IN li.lineitem_notes -%]
+ <li>
+ [% IF note.alert_text %]
+ [% note.alert_text.code -%]
+ [% IF note.value -%]
+ : [% note.value %]
+ [% END %]
+ [% ELSE %]
+ [% note.value -%]
+ [% END %]
+ </li>
+ [% END %]
+ </ul>
+ [% END %]
+ </div>
+ <br/>
+ <table>
+ <thead>
+ <tr>
+ <th>Branch</th>
+ <th>Barcode</th>
+ <th>Call Number</th>
+ <th>Fund</th>
+ <th>Shelving Location</th>
+ <th>Recd.</th>
+ <th>Notes</th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH detail IN li.lineitem_details.sort('owning_lib') %]
+ [%
+ IF detail.eg_copy_id;
+ SET copy = detail.eg_copy_id;
+ SET cn_label = copy.call_number.label;
+ ELSE;
+ SET copy = detail;
+ SET cn_label = detail.cn_label;
+ END
+ %]
+ <tr>
+ <!-- acq.lineitem_detail.id = [%- detail.id -%] -->
+ <td style='padding:5px;'>[% detail.owning_lib.shortname %]</td>
+ <td style='padding:5px;'>[% IF copy.barcode %]<span class="barcode" >[% detail.barcode %]</span>[% END %]</td>
+ <td style='padding:5px;'>[% IF cn_label %]<span class="cn_label" >[% cn_label %]</span>[% END %]</td>
+ <td style='padding:5px;'>[% IF detail.fund %]<span class="fund">[% detail.fund.code %] ([% detail.fund.year %])</span>[% END %]</td>
+ <td style='padding:5px;'>[% copy.location.name %]</td>
+ <td style='padding:5px;'>[% IF detail.recv_time %]<span class="recv_time">[% detail.recv_time %]</span>[% END %]</td>
+ <td style='padding:5px;'>[% detail.note %]</td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+</div>
+$$
+WHERE id = 14;
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
.../lib/OpenILS/Application/Trigger/Reactor.pm | 9 +++++++
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 1 +
....sql => 0642.data.acq-worksheet-hold-count.sql} | 25 +++++++------------
4 files changed, 20 insertions(+), 17 deletions(-)
copy Open-ILS/src/sql/Pg/upgrade/{0208.data.titles_received_worksheet_tweaks.sql => 0642.data.acq-worksheet-hold-count.sql} (84%)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list