[open-ils-commits] r12357 - in trunk/Open-ILS: src/perlmods/OpenILS/Application/Trigger src/sql/Pg web/templates/default/conify/global/config (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Mar 2 17:23:48 EST 2009


Author: erickson
Date: 2009-03-02 17:23:43 -0500 (Mon, 02 Mar 2009)
New Revision: 12357

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/EventGroup.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm
   trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
   trunk/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2
Log:
added strict/warnings.  fixed params, clensing iso date before parsing

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/EventGroup.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/EventGroup.pm	2009-03-02 20:27:55 UTC (rev 12356)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/EventGroup.pm	2009-03-02 22:23:43 UTC (rev 12357)
@@ -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/;

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm	2009-03-02 20:27:55 UTC (rev 12356)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm	2009-03-02 22:23:43 UTC (rev 12357)
@@ -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 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;
 }
 

Modified: trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql	2009-03-02 20:27:55 UTC (rev 12356)
+++ trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql	2009-03-02 22:23:43 UTC (rev 12357)
@@ -231,3 +231,18 @@
 */
 $$;
 
+
+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;
+

Modified: trunk/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2	2009-03-02 20:27:55 UTC (rev 12356)
+++ trunk/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2	2009-03-02 22:23:43 UTC (rev 12357)
@@ -1,46 +1,22 @@
+[% ctc.page_title = 'Circulation Policy Configuration' %]
 [% WRAPPER default/base.tt2 %]
-<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/config/hold_matrix_matchpoint.js'> </script>
-<h1>Hold Matrix Matchpoint</h1> <br/>
-
-<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
-
-    <button dojoType='dijit.form.Button' onclick='deleteFromGrid();'>Delete Selected</button>
-     
-    <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
-        <table jsId="hmGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'>
-            <thead>
-                <tr>
-                    <th field="id">Matchpoint ID</th>
-                    <th field="active" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox'>Active?</th>
-                    <th field="user_home_ou" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getOrgInfo'>User Home Library</th>
-                    <th field="request_ou" width='auto' editable='true' 
-                        cellType='dojox.grid.cells.Select' get='getOrgInfo'>Request Library</th>
-                    <th field="pickup_ou" editable='true' cellType='dojox.grid.cells.Select' get='getOrgInfo'>Pickup Library</th>
-                    <th field="item_owning_ou" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getOrgInfo'>Owning Library</th>
-                         <th field="item_circ_ou" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getOrgInfo'>Item Circ Library</th>
-                         <th field="usr_grp" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getGroupName'>User Permission Group</th>
-                         <th field="requestor_grp" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getGroupName'>Requestor Permission Group</th>
-                        <th field="circ_modifier" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox'>Circulation Modifier</th>
-                         <th field="marc_type" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getMarcType'>MARC Type</th>
-                         <th field="marc_form" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getMarcForm'>MARC Format</th>
-                         <th field="marc_vr_format" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getVrForm'>Videorecording Format</th>
-                         <th field="ref_flag" width='auto' editable='true' 
-                        cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' formatter='formatReference'>Reference?</th>
-                        
-                </tr>
-            </thead>
-        </table>    
-    </div>
+<script>
+    dojo.require('dijit.layout.ContentPane');
+    dojo.require('dijit.form.Button');
+    dojo.require('openils.widget.AutoGrid');
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+    <div>Circulation Policy Configuration</div>
+    <div><button dojoType='dijit.form.Button' onClick='cmGrid.showCreateDialog()'>New</button></div>
 </div>
-
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
+    <table  jsId="cmGrid" 
+            dojoType="openils.widget.AutoGrid" 
+            fieldOrder="['id', 'active', 'org_unit', 'grp', 'circ_modifier', 'marc_type', 'marc_form', 'marc_vr_format', 'ref_flag', 'usr_age_lower_bound', 'usr_age_upper_bound']"
+            defaultCellWidth='12'
+            query="{id: '*'}" 
+            fmClass='ccmm' 
+            editOnEnter='true'>
+    </table>
+</div>
 [% END %]



More information about the open-ils-commits mailing list