From 7d4dd632aca31aa041e431e2c567ba60d0460e54 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 2 Mar 2009 22:23:43 +0000 Subject: [PATCH] added strict/warnings. fixed params, clensing iso date before parsing git-svn-id: svn://svn.open-ils.org/ILS/trunk@12357 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Trigger/EventGroup.pm | 3 +- .../OpenILS/Application/Trigger/Validator.pm | 13 +++- Open-ILS/src/sql/Pg/020.schema.functions.sql | 15 +++++ .../global/config/hold_matrix_matchpoint.tt2 | 62 ++++++------------- 4 files changed, 46 insertions(+), 47 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/EventGroup.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/EventGroup.pm index 2c792e4bd2..cf22b8edee 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/EventGroup.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/EventGroup.pm @@ -1,9 +1,10 @@ package OpenILS::Application::Trigger::EventGroup; use OpenILS::Application::Trigger::Event; use base 'OpenILS::Application::Trigger::Event'; +use strict; use warnings; use OpenSRF::EX qw/:try/; -use OpenSRF::Utils::Logger qw/:level/; +use OpenSRF::Utils::Logger qw/:logger/; use OpenILS::Utils::Fieldmapper; use OpenILS::Utils::CStoreEditor q/:funcs/; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm index c8c74339b2..ba9343f8d3 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm @@ -1,6 +1,9 @@ package OpenILS::Application::Trigger::Validator; +use strict; use warnings; use DateTime; use DateTime::Format::ISO8601; +use OpenSRF::Utils qw/:datetime/; +use OpenSRF::Utils::Logger qw/:logger/; sub fourty_two { return 42 } sub NOOP_True { return 1 } sub NOOP_False { return 0 } @@ -13,12 +16,16 @@ sub CircIsOpen { } sub CircIsOverdue { - my $self; - my $env; + my $self = shift; + my $env = shift; my $circ = $env->{target}; + return 0 if $circ->checkin_time; return 0 if $circ->stop_fines and not $circ->stop_fines =~ /MAXFINES|LONGOVERDUE/; - return 0 if DateTime::Format::ISO8601->new->parse_datetime($circ->due_date) < DateTime->now; + + my $due_date = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($circ->due_date)); + return 0 if $due_date < DateTime->now; + return 1; } diff --git a/Open-ILS/src/sql/Pg/020.schema.functions.sql b/Open-ILS/src/sql/Pg/020.schema.functions.sql index d0fc868863..b1496d4275 100644 --- a/Open-ILS/src/sql/Pg/020.schema.functions.sql +++ b/Open-ILS/src/sql/Pg/020.schema.functions.sql @@ -231,3 +231,18 @@ COMMENT ON FUNCTION actor.org_unit_ancestor_setting( TEXT, INT) IS $$ */ $$; + +CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_setting_all( org_id INT ) RETURNS SETOF actor.org_unit_setting AS $$ +DECLARE + setting RECORD; + name TEXT; +BEGIN + FOR name IN SELECT DISTINCT(name) FROM actor.org_unit_setting LOOP + SELECT INTO setting * FROM actor.org_unit_ancestor_setting(name, org_id); + IF FOUND THEN + RETURN NEXT setting; + END IF; + END LOOP; +END; +$$ LANGUAGE plpgsql; + diff --git a/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2 b/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2 index 7820791c10..f39d7180b3 100644 --- a/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2 +++ b/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2 @@ -1,46 +1,22 @@ +[% ctc.page_title = 'Circulation Policy Configuration' %] [% WRAPPER default/base.tt2 %] - -

Hold Matrix Matchpoint


- -
- - - -
- - - - - - - - - - - - - - - - - - - - -
Matchpoint IDActive?User Home LibraryRequest LibraryPickup LibraryOwning LibraryItem Circ LibraryUser Permission GroupRequestor Permission GroupCirculation ModifierMARC TypeMARC FormatVideorecording FormatReference?
-
+ +
+
Circulation Policy Configuration
+
+
+
+ +
- [% END %] -- 2.43.2