[open-ils-commits] r13415 - in trunk/Open-ILS: src/perlmods/OpenILS src/perlmods/OpenILS/Application/Cat src/support-scripts web/js/dojo/openils/widget web/templates (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jun 19 16:01:12 EDT 2009


Author: erickson
Date: 2009-06-19 16:01:08 -0400 (Fri, 19 Jun 2009)
New Revision: 13415

Added:
   trunk/Open-ILS/src/support-scripts/clear_expired_circ_history.srfsh
Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat/AuthCommon.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Event.pm
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
   trunk/Open-ILS/web/templates/base.tt2
Log:
cron script to run the clear-expired-circ-history items proc

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat/AuthCommon.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat/AuthCommon.pm	2009-06-19 19:41:38 UTC (rev 13414)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat/AuthCommon.pm	2009-06-19 20:01:08 UTC (rev 13415)
@@ -36,6 +36,10 @@
 	$rec->edit_date('now');
 	$rec->marc($U->entityize($marc_doc->documentElement->toString));
 
+    my ($arn, $evt) = find_arn($e, $marc_doc);
+    return $evt if $evt;
+    $rec->arn_value($arn);
+
     $rec = $e->create_authority_record_entry($rec) or return $e->die_event;
 
     # we don't care about the result, just fire off the request
@@ -64,4 +68,24 @@
 	return $rec;
 }
 
+sub find_arn {
+    my($e, $marc_doc) = @_;
+
+	my $xpath = '//marc:controlfield[@tag="001"]';
+	my ($arn) = $marc_doc->documentElement->findvalue($xpath);
+
+    if(my $existing_rec = $e->search_authority_record_entry({arn_value => $arn, deleted => 'f'})->[0]) {
+        # this arn is taken
+        return (
+            undef, 
+            OpenILS::Event->new(
+                'AUTHORITY_RECORD_NUMBER_EXISTS', 
+                payload => {existing_record => $existing_rec, arn => $arn}
+            )
+        );
+    }
+
+    return ($arn);
+}
+
 1;

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Event.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Event.pm	2009-06-19 19:41:38 UTC (rev 13414)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Event.pm	2009-06-19 20:01:08 UTC (rev 13415)
@@ -23,7 +23,7 @@
 	_load_events() unless $events;
 
 	throw OpenSRF::EX ("Bad event name: $event") unless $event;
-	my $e = $events->{$event};
+	my $e = $events->{$event} || -1;
 
 	my( $m, $f, $l ) = caller(0);
 	my( $mm, $ff, $ll ) = caller(1);

Added: trunk/Open-ILS/src/support-scripts/clear_expired_circ_history.srfsh
===================================================================
--- trunk/Open-ILS/src/support-scripts/clear_expired_circ_history.srfsh	                        (rev 0)
+++ trunk/Open-ILS/src/support-scripts/clear_expired_circ_history.srfsh	2009-06-19 20:01:08 UTC (rev 13415)
@@ -0,0 +1,2 @@
+#!BINDIR/srfsh
+request open-ils.cstore open-ils.cstore.json_query {"from":["container.clear_all_expired_circ_history_items"]}


Property changes on: trunk/Open-ILS/src/support-scripts/clear_expired_circ_history.srfsh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-06-19 19:41:38 UTC (rev 13414)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-06-19 20:01:08 UTC (rev 13415)
@@ -447,7 +447,7 @@
                     onresponse : function(r) {
                         var item = openils.Util.readResponse(r);
                         self.store.newItem(item.toStoreItem());
-                    }
+                    },
                 });
                 if(search)
                     new openils.PermaCrud().search(this.fmClass, search, opts);
@@ -471,10 +471,31 @@
             fmField: this.field,
             widgetValue : val,
             readOnly : true,
-            forceSync : true
         });
-        //autoWidget.build();
-        return autoWidget.getDisplayString();
-    }
+
+        var syncTest = 0;
+        var self = this;
+
+        autoWidget.build(
+            function(w, ww) {
+                if(syncTest == 1) { //async
+                    var node = self.grid.views.views[0].getCellNode(rowIndex, self.index);
+                    if(node && !node.__autogrid_value_set) {
+                        node.innerHTML = ww.getDisplayString();
+                        node.__autogrid_value_set = true;
+                    }
+                }
+                syncTest = 2;
+            }
+        );
+
+        var val = '';
+
+        if(syncTest == 2) // sync
+            val = autoWidget.getDisplayString(); // sync
+
+        syncTest = 1;
+        return val;
+    };
 }
 

Modified: trunk/Open-ILS/web/templates/base.tt2
===================================================================
--- trunk/Open-ILS/web/templates/base.tt2	2009-06-19 19:41:38 UTC (rev 13414)
+++ trunk/Open-ILS/web/templates/base.tt2	2009-06-19 20:01:08 UTC (rev 13415)
@@ -10,7 +10,7 @@
         <link rel='stylesheet' type='text/css'
             href='[% ctx.media_prefix %]/css/theme/[% ctx.skin %].css'></link>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/dojo.js"
-            djConfig="parseOnLoad: true, isDebug:false"></script>
+            djConfig="parseOnLoad: true, isDebug:true"></script>
      <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/openils_dojo.js"
             djConfig="parseOnLoad: true, isDebug:false"></script>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/md5.js"></script>



More information about the open-ils-commits mailing list