Merged revisions 9734,9736,9739-9742,9749-9750,9755-9757,9760-9763,9766-9769,9778...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Jun 2008 01:59:21 +0000 (01:59 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Jun 2008 01:59:21 +0000 (01:59 +0000)
svn://svn.open-ils.org/ILS/trunk

........
  r9734 | erickson | 2008-05-29 22:10:43 -0400 (Thu, 29 May 2008) | 1 line

  added check to make sure the db handle is not double-closed (causing segfaults)
........
  r9736 | miker | 2008-05-30 09:12:51 -0400 (Fri, 30 May 2008) | 1 line

  adding frozen hold check to nearest_hold
........
  r9739 | dbs | 2008-05-30 11:55:22 -0400 (Fri, 30 May 2008) | 1 line

  Add some protection against broken cover art
........
  r9740 | dbs | 2008-05-30 17:09:10 -0400 (Fri, 30 May 2008) | 2 lines

  Don't forget to set the mime type property for svn
........
  r9741 | miker | 2008-05-31 01:17:09 -0400 (Sat, 31 May 2008) | 1 line

  some new management functions for the materialized reporting view
........
  r9742 | miker | 2008-05-31 01:20:44 -0400 (Sat, 31 May 2008) | 1 line

  adjust spacing for easier diff backporting
........
  r9749 | erickson | 2008-05-31 10:32:49 -0400 (Sat, 31 May 2008) | 1 line

  added some input scrubbing on limit and offset
........
  r9750 | miker | 2008-05-31 10:57:20 -0400 (Sat, 31 May 2008) | 1 line

  remove redundant offset decrement
........
  r9755 | erickson | 2008-05-31 21:08:12 -0400 (Sat, 31 May 2008) | 1 line

  changed key field to "id" for ruleset rule links.  typo on recuring -> recurring
........
  r9756 | erickson | 2008-05-31 21:32:57 -0400 (Sat, 31 May 2008) | 1 line

  some early test code
........
  r9757 | erickson | 2008-06-01 23:32:54 -0400 (Sun, 01 Jun 2008) | 1 line

  typo (copy/paste error)  max_overdue -> max_fines
........
  r9760 | erickson | 2008-06-02 23:35:28 -0400 (Mon, 02 Jun 2008) | 1 line

  adding is_true wrapper on super_user test.  toggled boolean test to allow superuser to edit perms
........
  r9761 | miker | 2008-06-03 20:53:52 -0400 (Tue, 03 Jun 2008) | 1 line

  mod_rewrite mapping script for openurl->opensearch
........
  r9762 | miker | 2008-06-03 20:56:26 -0400 (Tue, 03 Jun 2008) | 1 line

  adding the openurl map script to the makefile
........
  r9763 | miker | 2008-06-03 20:59:02 -0400 (Tue, 03 Jun 2008) | 1 line

  adding the openurl map script to the example apache config
........
  r9766 | miker | 2008-06-04 00:15:53 -0400 (Wed, 04 Jun 2008) | 1 line

  fix the marcxml feed to use default namespace on the record element
........
  r9767 | dbs | 2008-06-05 11:55:09 -0400 (Thu, 05 Jun 2008) | 2 lines

  OLE::Storage_Lite is required by the reporter
........
  r9768 | dbs | 2008-06-05 21:53:46 -0400 (Thu, 05 Jun 2008) | 2 lines

  Synchronize the default reporter directory with opensrf.xml.example
........
  r9769 | dbs | 2008-06-05 23:25:12 -0400 (Thu, 05 Jun 2008) | 2 lines

  One big happy family of synchronized reporter output directories
........
  r9778 | erickson | 2008-06-06 16:48:31 -0400 (Fri, 06 Jun 2008) | 1 line

  more lib ranges
........
  r9781 | erickson | 2008-06-06 17:39:47 -0400 (Fri, 06 Jun 2008) | 1 line

  added not-found event for circ-mod-count objects
........
  r9784 | miker | 2008-06-06 22:24:58 -0400 (Fri, 06 Jun 2008) | 1 line

  allow public containers (such as bookbags) to be exported
........
  r9787 | erickson | 2008-06-07 08:37:23 -0400 (Sat, 07 Jun 2008) | 1 line

  protecting against null circmod count map
........
  r9790 | phasefx | 2008-06-08 23:29:40 -0400 (Sun, 08 Jun 2008) | 1 line

  fix a regression with checkout receipt printing
........
  r9793 | erickson | 2008-06-09 12:35:17 -0400 (Mon, 09 Jun 2008) | 1 line

  moved key attribute from the set of KeyAttrs to a ValueAttr.  XML::Simple as of version 2.18 forces uniquesness on KeyAttrs
........
  r9795 | erickson | 2008-06-09 15:39:50 -0400 (Mon, 09 Jun 2008) | 1 line

  added support for setting an org unit setting to disable auto-record deletion when the last copy for the record is deleted.  also support for enabling an event to be returned when the last copy for a record is deleted
........
  r9798 | phasefx | 2008-06-09 16:04:27 -0400 (Mon, 09 Jun 2008) | 1 line

  tweaks to Volume Editor for window dimensions, and a comforting Cancel button
........
  r9803 | erickson | 2008-06-09 17:19:27 -0400 (Mon, 09 Jun 2008) | 1 line

  added biblio_record update and "undelete" methods.
........
  r9805 | phasefx | 2008-06-09 17:30:18 -0400 (Mon, 09 Jun 2008) | 1 line

  undelete for bib records.  This is local chrome, so need to deploy a new staff client to see this functionality
........
  r9808 | erickson | 2008-06-09 17:49:23 -0400 (Mon, 09 Jun 2008) | 1 line

  applying same text cleaning code to simple search that is used in advanced search
........
  r9809 | erickson | 2008-06-10 13:20:36 -0400 (Tue, 10 Jun 2008) | 1 line

  added missing backslash.  Thanks, Don
........

git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9811 dcc99617-32d9-48b4-a31d-7c20da2025e4

32 files changed:
Evergreen/conf/lib_ips.txt
Open-ILS/examples/apache/eg_vhost.conf
Open-ILS/examples/fm_IDL.xml
Open-ILS/examples/opensrf.xml.example
Open-ILS/src/Makefile
Open-ILS/src/c-apps/oils_cstore.c
Open-ILS/src/extras/Makefile.install
Open-ILS/src/extras/ils_events.xml
Open-ILS/src/extras/openurl_map.pl [new file with mode: 0755]
Open-ILS/src/javascript/backend/circ/circ_lib.js
Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/OpenILS/Application/Cat.pm
Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm
Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm
Open-ILS/src/sql/Pg/1.2.2.0-1.2.2.1-upgrade-db.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/100.circ_matrix.sql
Open-ILS/src/sql/Pg/reporter-schema.sql
Open-ILS/src/support-scripts/test-scripts/indb_circ.pl [new file with mode: 0755]
Open-ILS/web/opac/images/blank.png [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/opac/skin/default/js/search_bar.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
Open-ILS/xul/staff_client/server/cat/volume_editor.xul
Open-ILS/xul/staff_client/server/circ/checkout.js
config.sh

index c800660..7e8e48f 100644 (file)
@@ -436,3 +436,5 @@ LBRLS-UNAD  168.13.30.1 168.13.30.255
 LBRLS-SCH   168.13.33.1 168.13.33.255
 LBRLS-BYRM  168.13.27.1 168.13.27.255
 HALL-SSP    168.12.222.1 168.12.222.255
+KRLS-QU     168.13.60.1 168.13.60.255
+CCL-RING    168.12.143.1 168.12.143.255
index c693f86..1e2fe4d 100644 (file)
@@ -15,28 +15,11 @@ RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml
 RedirectMatch 301 ^/opac/extras/slimpac/start.html$ /opac/en-US/extras/slimpac/start.html
 RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
 
-
-
 # ----------------------------------------------------------------------------------
 # Configure the gateway
 # ----------------------------------------------------------------------------------
 OSRFGatewayConfig /openils/conf/opensrf_core.xml
 
-
-# ----------------------------------------------------------------------------------
-# Set up the book jackets URL
-# XXX This pulls images from Amazon, don't use this in a production environment
-# This is an example of how you can have bookjacket images via Apache redirect,
-# if there is no full-fledged added content plugin for the site you want to 
-# fetch images from.
-# ----------------------------------------------------------------------------------
-#RewriteEngine on
-#ProxyTimeout 2
-#RewriteRule /opac/extras/ac/jacket/small/(.*) \
-#    http://images.amazon.com/images/P/$1.01._SCMZZZZZZZ_.jpg [P,L]
-#RewriteRule /opac/extras/ac/jacket/large/(.*) \
-#    http://images.amazon.com/images/P/$1.01._SCLZZZZZZZ_.jpg [P,L]
-
 # ----------------------------------------------------------------------------------
 # Added content plugin
 # ----------------------------------------------------------------------------------
@@ -48,6 +31,12 @@ OSRFGatewayConfig /openils/conf/opensrf_core.xml
     allow from all
 </Location>
 
+# ----------------------------------------------------------------------------------
+# Replace broken cover images with a transparent GIF by default
+# ----------------------------------------------------------------------------------
+RewriteEngine ON
+RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
+    /opac/images/blank.png [P,L]
        
 # ----------------------------------------------------------------------------------
 # Configure the OPAC
@@ -261,3 +250,10 @@ OSRFGatewayConfig /openils/conf/opensrf_core.xml
     allow from all
 </Location>
 
+# OpenURL 0.1 searching based on OpenSearch
+RewriteEngine on
+RewriteMap openurl prg:/openils/bin/openurl_map.pl
+RewriteCond %{QUERY_STRING} (^.*$)
+RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
+
+
index c385890..7f7ad65 100644 (file)
@@ -625,9 +625,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                </fields>
                <links>
                        <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
-                       <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
-                       <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
-                       <link field="recuring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
+                       <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
+                       <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
+                       <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
                </links>
        </class>
 
index f3d8d30..f940f9f 100644 (file)
@@ -61,7 +61,7 @@ vim:et:ts=4:sw=4:
                 </database>
                 <files>
                     <!-- successful report outputs go here -->
-                    <output_base>/openils/var/web/reporter/output</output_base>
+                    <output_base>/openils/var/web/reporter</output_base>
                     <success_template>/openils/var/data/report-success</success_template>
                     <fail_template>/openils/var/data/report-fail</fail_template>
                 </files>
index 7a09dd2..150e6c5 100644 (file)
@@ -101,6 +101,7 @@ autojs-install:
        cp extras/org_tree_html_options.pl $(BINDIR)
        cp extras/org_tree_proximity.pl $(BINDIR)
        cp extras/autogen.sh $(BINDIR)
+       cp extras/openurl_map.pl $(BINDIR)
        cp support-scripts/offline-blocked-list.pl $(BINDIR) # this should probably be somewhere else
 # -----------------------------------------------------------------------------------
 
index ce5dbdc..8f8820f 100644 (file)
@@ -79,14 +79,15 @@ static int max_flesh_depth = 100;
 void osrfAppChildExit() {
        osrfLogDebug(OSRF_LOG_MARK, "Child is exiting, disconnecting from database...");
 
-       if (writehandle) {
-               dbi_conn_query(writehandle, "ROLLBACK;");
-               dbi_conn_close(writehandle);
-               writehandle = NULL;
-       }
-
-       if (dbhandle)
-               dbi_conn_close(dbhandle);
+    int same = 0;
+    if (writehandle == dbhandle) same = 1;
+    if (writehandle) {
+        dbi_conn_query(writehandle, "ROLLBACK;");
+        dbi_conn_close(writehandle);
+        writehandle = NULL;
+    }
+    if (dbhandle && !same)
+        dbi_conn_close(dbhandle);
 
        // XXX add cleanup of readHandles whenever that gets used
 
index 06ea402..87a8f43 100644 (file)
@@ -97,6 +97,7 @@ DEBS =  \
     libreadline5-dev\
        libtext-csv-perl\
        libspreadsheet-writeexcel-perl\
+       libole-storage-lite-perl\
        libtie-ixhash-perl\
        python-dev\
        python-setuptools\
index 1e7de32..f1cefcb 100644 (file)
        <event code='1673' textcode='ACQ_CURRENCY_TYPE_NOT_FOUND'>
                <desc xml:lang='en-US'>The requested acq.currency_type was not found</desc>
        </event>
+       <event code='1674' textcode='ACTION_OPEN_CIRC_COUNT_BY_CIRC_MOD_NOT_FOUND'>
+               <desc xml:lang='en-US'>The requested action_open_circ_count_by_circ_mod was not found</desc>
+       </event>
 
 
        <event code='1700' textcode='NON_CAT_TYPE_EXISTS'>
diff --git a/Open-ILS/src/extras/openurl_map.pl b/Open-ILS/src/extras/openurl_map.pl
new file mode 100755 (executable)
index 0000000..a376df7
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+#
+
+$|=1;
+
+while (my $openurl = <>) {
+       my $opensearch = '/opac/extras/opensearch/1.1/-/marcxml/-/?';
+       my @parts = split('&', $openurl);
+
+       my %params = (
+               kw => '',
+               au => '',
+               ti => '',
+       );
+
+       for (@parts) {
+               if (/^au[^=]+=(.*)$/o) {
+                       $params{au} .= $1 . ' ';
+               } elsif (/^[sa]?title=(.*)$/o) {
+                       $params{ti} .= $1 . ' ';
+               } elsif (/^e?is.n=(.*)$/o) {
+                       $params{kw} .= $1 . ' ';
+               } elsif (/^[^=]+=(.*)$/o) {
+                       $params{kw} .= $1 . ' ';
+               }
+       }
+       
+       $opensearch .= join('&', map { "$_=$params{$_}" } keys %params );
+
+       print $opensearch . "\n";
+
+};
index 621e453..c708dbf 100644 (file)
@@ -209,7 +209,8 @@ function hasCommonAncestor( org1, org2, depth ) {
 function checkoutsByCircModifier(userid) {
     var key = scratchKey();
     __OILS_FUNC_userCircsByCircmod(scratchPad(key), userid);
-    return getScratch(key);
+    var val = getScratch(key);
+    return (val) ? val : {};
 }
 
 /* useful for testing */
index 768d7e5..9f874ed 100644 (file)
@@ -842,7 +842,7 @@ sub set_user_perms {
        my $perms = $session->request('open-ils.storage.permission.user_perms.atomic', $user_obj->id)->gather(1);
 
        my $all = undef;
-       $all = 1 if ($user_obj->super_user());
+       $all = 1 if ($U->is_true($user_obj->super_user()));
     $all = 1 unless ($U->check_perms($user_obj->id, $user_obj->home_ou, 'EVERYTHING'));
 
        for my $map (@$maps) {
@@ -855,8 +855,7 @@ sub set_user_perms {
                        $map->clear_id;
                }
 
-               next if (!$all || !grep { $_->perm eq $map->perm and $U->is_true($_->grantable) and $_->depth <= $map->depth } @$perms);
-
+               next if (!$all and !grep { $_->perm eq $map->perm and $U->is_true($_->grantable) and $_->depth <= $map->depth } @$perms);
                #warn( "Updating permissions with method $method and session $ses and map $map" );
                $logger->info( "Updating permissions with method $method and map $map" );
 
index 80ec094..7f13fe1 100644 (file)
@@ -246,7 +246,60 @@ sub biblio_record_replace_marc  {
        return undef;
 }
 
+__PACKAGE__->register_method(
+       method  => "update_biblio_record_entry",
+       api_name        => "open-ils.cat.biblio.record_entry.update",
+    signature => q/
+        Updates a biblio.record_entry
+        @param auth The authtoken
+        @param record The record with updated values
+        @return 1 on success, Event on error.
+    /
+);
 
+sub update_biblio_record_entry {
+    my($self, $conn, $auth, $record) = @_;
+    my $e = new_editor(authtoken=>$auth, xact=>1);
+    return $e->die_event unless $e->checkauth;
+    return $e->die_event unless $e->allowed('UPDATE_RECORD');
+    $e->update_biblio_record_entry($record) or return $e->die_event;
+    $e->commit;
+    return 1;
+}
+
+__PACKAGE__->register_method(
+       method  => "undelete_biblio_record_entry",
+       api_name        => "open-ils.cat.biblio.record_entry.undelete",
+    signature => q/
+        Un-deletes a record and sets active=true
+        @param auth The authtoken
+        @param record The record_id to ressurect
+        @return 1 on success, Event on error.
+    /
+);
+sub undelete_biblio_record_entry {
+    my($self, $conn, $auth, $record_id) = @_;
+    my $e = new_editor(authtoken=>$auth, xact=>1);
+    return $e->die_event unless $e->checkauth;
+    return $e->die_event unless $e->allowed('UPDATE_RECORD');
+
+    my $record = $e->retrieve_biblio_record_entry($record_id)
+        or return $e->die_event;
+    $record->deleted('f');
+    $record->active('t');
+
+    # no 2 non-deleted records can have the same tcn_value
+    my $existing = $e->search_biblio_record_entry(
+        {   deleted => 'f', 
+            tcn_value => $record->tcn_value, 
+            id => {'!=' => $record_id}
+        }, {idlist => 1});
+    return OpenILS::Event->new('TCN_EXISTS') if @$existing;
+
+    $e->update_biblio_record_entry($record) or return $e->die_event;
+    $e->commit;
+    return 1;
+}
 
 
 __PACKAGE__->register_method(
@@ -1053,26 +1106,30 @@ sub update_copy {
 
 sub remove_empty_objects {
        my( $editor, $override, $vol ) = @_; 
-       if( title_is_empty($editor, $vol->record) ) {
 
-               # disable the TITLE_LAST_COPY event for now
-               # if( $override ) {
-               if( 1 ) {
+    my $koe = $U->ou_ancestor_setting_value(
+        $editor->requestor->ws_ou, 'cat.bib.keep_on_empty', $editor);
+    my $aoe =  $U->ou_ancestor_setting_value(
+        $editor->requestor->ws_ou, 'cat.bib.alert_on_empty', $editor);
 
-                       # delete this volume if it's not already marked as deleted
-                       unless( $U->is_true($vol->deleted) || $vol->isdeleted ) {
-                               $vol->deleted('t');
-                               $vol->editor($editor->requestor->id);
-                               $vol->edit_date('now');
-                               $editor->update_asset_call_number($vol) or return $editor->event;
-                       }
+       if( title_is_empty($editor, $vol->record) ) {
 
-         my $evt = delete_rec($editor, $vol->record);
-         return $evt if $evt;
+        # delete this volume if it's not already marked as deleted
+        unless( $U->is_true($vol->deleted) || $vol->isdeleted ) {
+            $vol->deleted('t');
+            $vol->editor($editor->requestor->id);
+            $vol->edit_date('now');
+            $editor->update_asset_call_number($vol) or return $editor->event;
+        }
 
-               } else {
-                       return OpenILS::Event->new('TITLE_LAST_COPY', payload => $vol->record );
-               }
+        unless($koe) {
+            # delete the bib record if the keep-on-empty setting is not set
+            my $evt = delete_rec($editor, $vol->record);
+            return $evt if $evt;
+        }
+
+        # return the empty alert if the alert-on-empty setting is set
+        return OpenILS::Event->new('TITLE_LAST_COPY', payload => $vol->record ) if $aoe;
        }
 
        return undef;
index e6640c4..5ddd008 100644 (file)
@@ -758,6 +758,9 @@ sub staged_search {
 
     my $user_offset = $search_hash->{offset} || 0; # user-specified offset
     my $user_limit = $search_hash->{limit} || 10;
+    $user_offset = ($user_offset >= 0) ? $user_offset : 0;
+    $user_limit = ($user_limit >= 0) ? $user_limit : 10;
+
 
     # we're grabbing results on a per-superpage basis, which means the 
     # limit and offset should coincide with superpage boundaries
index cb6b06a..7af6127 100644 (file)
@@ -218,6 +218,7 @@ sub nearest_hold {
                        AND (AGE(NOW(),h.request_time) >= CAST(? AS INTERVAL) OR p.prox = 0)
                        AND h.capture_time IS NULL
                        AND h.cancel_time IS NULL
+            AND h.frozen IS FALSE
                ORDER BY
                        p.prox,
                        h.selection_depth DESC,
index b625f4c..4b100db 100644 (file)
@@ -47,7 +47,7 @@ sub import {
 
         # parse the IDL ...
         my $file = $args{IDL} || OpenSRF::Utils::SettingsClient->new->config_value( 'IDL' );
-        my $idl = XMLin( $file, ForceArray => 0, KeyAttr => ['name', 'key', 'id'] )->{class};
+        my $idl = XMLin( $file, ForceArray => 0, KeyAttr => ['name', 'id'], ValueAttr => {link =>'key'} )->{class};
        for my $c ( keys %$idl ) {
                next unless ($idl->{$c}{'oils_obj:fieldmapper'});
                my $n = 'Fieldmapper::'.$idl->{$c}{'oils_obj:fieldmapper'};
index 1b93f23..4e42171 100644 (file)
@@ -88,11 +88,14 @@ sub handler {
        # still no records ...
        my $container = $cgi->param('containerid');
        if ($container) {
-               my $authid = $cgi->cookie('ses') || $cgi->param('ses');
-               my $auth = verify_login($authid);
-               if (!$auth) {
-                       return 403;
-               }
+               my $bucket = $ses->request( 'open-ils.cstore.direct.container.biblio_record_entry_bucket.retrieve', $container )->gather(1);
+        if ($bucket->pub !~ /t|1/oi) {
+               my $authid = $cgi->cookie('ses') || $cgi->param('ses');
+               my $auth = verify_login($authid);
+                   if (!$auth) {
+                           return 403;
+               }
+        }
                my $recs = $ses->request( 'open-ils.cstore.direct.container.biblio_record_entry_bucket_item.search.atomic', { bucket => $container } )->gather(1);
                @records = map { ($_->target_biblio_record_entry) } @$recs;
        }
index 4c2368a..f5918a8 100644 (file)
@@ -1039,7 +1039,7 @@ sub opensearch_feed {
     my $recs = $search->request(
         'open-ils.search.biblio.multiclass.query' => {
                        org_unit        => $org_unit->[0]->id,
-                       offset          => $offset - 1,
+                       offset          => $offset,
                        limit           => $limit,
                        sort            => $sort,
                        sort_dir        => $sortdir,
index 9ad6c2c..6d382a3 100644 (file)
@@ -5,11 +5,8 @@ use OpenSRF::EX qw(:try);
 use XML::LibXML;
 use XML::LibXSLT;
 use OpenSRF::Utils::SettingsClient;
-use OpenSRF::Utils::Logger qw/$logger/;
 use CGI;
 
-my $log = 'OpenSRF::Utils::Logger';
-
 sub exists {
        my $class = shift;
        my $type = shift;
@@ -215,7 +212,6 @@ sub composeDoc {
 sub toString {
        my $self = shift;
        $self->composeDoc;
-       $log->debug("Document composed");
        return $self->{doc}->toString(1);
 }
 
@@ -518,9 +514,8 @@ sub new {
        my $self = $class->SUPER::build($xml);
        return undef unless $self;
        $self->{doc}->documentElement->setNamespace('http://www.loc.gov/MARC21/slim', undef);
-       $self->{doc}->documentElement->setNamespace('http://www.loc.gov/MARC21/slim', 'marc');
        $self->{type} = 'application/xml';
-       $self->{holdings_xpath} = '/marc:record';
+       $self->{holdings_xpath} = '/*[local-name()="record"]';
        return $self;
 }
 
@@ -531,7 +526,7 @@ sub link {
 
        if ($type eq 'opac') {
                $self->_create_node(
-                       'marc:record',
+                       '*[local-name()="record"]',
                        'http://www.w3.org/1999/xhtml',
                        'xhtml:link',
                        undef,
@@ -540,7 +535,7 @@ sub link {
                $linkid++;
        } elsif ($type eq 'unapi-id') {
                $self->_create_node(
-                       'marc:record',
+                       '*[local-name()="record"]',
                        'http://www.w3.org/1999/xhtml',
                        'xhtml:abbr',
                        undef,
diff --git a/Open-ILS/src/sql/Pg/1.2.2.0-1.2.2.1-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.2.2.0-1.2.2.1-upgrade-db.sql
new file mode 100644 (file)
index 0000000..1f9f4c1
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2008  Equinox Software, Inc.
+ * Mike Rylander <miker@esilibrary.com.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+BEGIN;
+
+-- Handy management functions for the new materialized reporting view
+
+CREATE OR REPLACE FUNCTION reporter.disable_materialized_simple_record_trigger () RETURNS VOID AS $$
+    DROP TRIGGER zzz_update_materialized_simple_record_tgr ON metabib.full_rec;
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION reporter.enable_materialized_simple_record_trigger () RETURNS VOID AS $$
+
+    TRUNCATE TABLE reporter.materialized_simple_record;
+
+    INSERT INTO reporter.materialized_simple_record
+        (id,fingerprint,quality,tcn_source,tcn_value,title,author,publisher,pubdate,isbn,issn)
+        SELECT DISTINCT ON (id) * FROM reporter.old_super_simple_record;
+
+    CREATE TRIGGER zzz_update_materialized_simple_record_tgr
+        AFTER INSERT OR UPDATE OR DELETE ON metabib.full_rec
+        FOR EACH ROW EXECUTE PROCEDURE reporter.simple_rec_sync();
+
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION reporter.refresh_materialized_simple_record () RETURNS VOID AS $$
+    SELECT reporter.disable_materialized_simple_record_trigger();
+    SELECT reporter.enable_materialized_simple_record_trigger();
+$$ LANGUAGE SQL;
+
+COMMIT;
index 3a7b122..c65507a 100644 (file)
@@ -359,7 +359,7 @@ BEGIN
                        current_fines = current_fines - COALESCE(tmp_fines, 0.0);
                END LOOP;
 
-               IF current_fines >= circ_test.max_overdue THEN
+               IF current_fines >= circ_test.max_fines THEN
                        result.fail_part := 'config.circ_matrix_test.max_fines';
                        result.success := FALSE;
                        RETURN NEXT result;
index 8cb513a..3fc2e22 100644 (file)
@@ -154,6 +154,7 @@ SELECT      r.id,
 
 CREATE TABLE reporter.materialized_simple_record AS SELECT * FROM reporter.old_super_simple_record WHERE 1=0;
 ALTER TABLE reporter.materialized_simple_record ADD PRIMARY KEY (id);
+
 CREATE VIEW reporter.super_simple_record AS SELECT * FROM reporter.materialized_simple_record;
 
 CREATE OR REPLACE FUNCTION reporter.simple_rec_sync () RETURNS TRIGGER AS $$
@@ -184,6 +185,29 @@ CREATE TRIGGER zzz_update_materialized_simple_record_tgr
     AFTER INSERT OR UPDATE OR DELETE ON metabib.full_rec
     FOR EACH ROW EXECUTE PROCEDURE reporter.simple_rec_sync();
 
+CREATE OR REPLACE FUNCTION reporter.disable_materialized_simple_record_trigger () RETURNS VOID AS $$
+    DROP TRIGGER zzz_update_materialized_simple_record_tgr ON metabib.full_rec;
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION reporter.enable_materialized_simple_record_trigger () RETURNS VOID AS $$
+
+    TRUNCATE TABLE reporter.materialized_simple_record;
+
+    INSERT INTO reporter.materialized_simple_record
+        (id,fingerprint,quality,tcn_source,tcn_value,title,author,publisher,pubdate,isbn,issn)
+        SELECT DISTINCT ON (id) * FROM reporter.old_super_simple_record;
+
+    CREATE TRIGGER zzz_update_materialized_simple_record_tgr
+        AFTER INSERT OR UPDATE OR DELETE ON metabib.full_rec
+        FOR EACH ROW EXECUTE PROCEDURE reporter.simple_rec_sync();
+
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION reporter.refresh_materialized_simple_record () RETURNS VOID AS $$
+    SELECT reporter.disable_materialized_simple_record_trigger();
+    SELECT reporter.enable_materialized_simple_record_trigger();
+$$ LANGUAGE SQL;
+
 CREATE OR REPLACE VIEW reporter.demographic AS
 SELECT u.id,
        u.dob,
diff --git a/Open-ILS/src/support-scripts/test-scripts/indb_circ.pl b/Open-ILS/src/support-scripts/test-scripts/indb_circ.pl
new file mode 100755 (executable)
index 0000000..b8ed0ca
--- /dev/null
@@ -0,0 +1,80 @@
+#!/usr/bin/perl
+require '../oils_header.pl';
+use vars qw/$authtoken/;
+use strict; use warnings;
+use Time::HiRes qw/time/;
+use OpenILS::Utils::CStoreEditor qw/:funcs/;
+use Data::Dumper;
+use Getopt::Long;
+
+# ---------------------------------------------------------------
+# Initial in-db-circ test code
+# This script takes an org, user, and copy ID and prints out the
+# circulation rules that would apply
+# ---------------------------------------------------------------
+
+my ($config, $org_id, $user_id, $copy_id, $copy_barcode) = 
+    ('/openils/conf/opensrf_core.xml', 326, 3, 301313, undef);
+
+GetOptions(
+    'org=o' => \$org_id,
+    'user=i' => \$user_id,
+    'copy=i' => \$copy_id,
+    'barcode=s' => \$copy_barcode,
+);
+
+osrf_connect($config);
+
+my $CIRC_TEST = {
+    select => {
+        aou => [{
+            transform => 'action.item_user_circ_test',
+            column => 'id',
+            params => [$copy_id, $user_id],
+            result_field => 'matchpoint',
+        }]
+    },
+    from => 'aou',
+    where => {id => $org_id}
+};
+
+my $e = new_editor();
+
+my $mp_id = $e->json_query($CIRC_TEST)->[0]->{id};
+my $mp = $e->retrieve_config_circ_matrix_ruleset([
+    $mp_id,
+    {   flesh => 1,
+        flesh_fields => {
+            'ccmrs' => ['duration_rule', 'recurring_fine_rule', 'max_fine_rule']
+        }
+    }
+]);
+
+my $cp = $e->retrieve_asset_copy($copy_id);
+my ($dur, $recf);
+
+# get the actual duration
+if($cp->loan_duration == 1) {
+    $dur = $mp->duration_rule->shrt;
+} elsif($cp->loan_duration == 2) {
+    $dur = $mp->duration_rule->normal;
+} else {
+    $dur = $mp->duration_rule->extended;
+}
+
+# get the recurring fine level
+if($cp->fine_level == 1) {
+    $recf = $mp->recurring_fine_rule->low;
+} elsif($cp->fine_level == 2) {
+    $recf = $mp->recurring_fine_rule->normal;
+} else {
+    $recf = $mp->recurring_fine_rule->high;
+}
+
+
+print "Duration [".$mp->duration_rule->name."] = $dur\n";
+print "Recurring fines [".$mp->recurring_fine_rule->name."; interval='".
+    $mp->recurring_fine_rule->recurance_interval."'] = \$$recf\n";
+print "Max fine [".$mp->max_fine_rule->name."] = \$".$mp->max_fine_rule->amount."\n";
+
+
diff --git a/Open-ILS/web/opac/images/blank.png b/Open-ILS/web/opac/images/blank.png
new file mode 100644 (file)
index 0000000..ce4a7c1
Binary files /dev/null and b/Open-ILS/web/opac/images/blank.png differ
index c9dd448..36dded8 100644 (file)
 <!ENTITY staff.cat.opac.mark_for_overlay.label "Mark for Overlay">
 <!ENTITY staff.cat.opac.delete_record.accesskey "D">
 <!ENTITY staff.cat.opac.delete_record.label "Delete Record">
+<!ENTITY staff.cat.opac.undelete_record.accesskey "U">
+<!ENTITY staff.cat.opac.undelete_record.label "Undelete Record">
 <!ENTITY staff.cat.opac.menu.accesskey "A">
 <!ENTITY staff.cat.opac.menu.label "Actions for this Record">
 <!ENTITY staff.cat.opac.opac_view.accesskey "O">
index c87d494..5b6cccb 100644 (file)
@@ -55,6 +55,12 @@ function searchBarSubmit(isFilterSort) {
        clearSearchParams();
 
        if(!text || text == "") return;
+
+    text = text.replace(/'/g,' ');
+    text = text.replace(/\\/g,' ');
+    text = text.replace(/^\s*/,'');
+    text = text.replace(/\s*$/,'');
+
        var d   = (newSearchDepth != null) ?  newSearchDepth : depthSelGetDepth();
        if(isNaN(d)) d = 0;
 
index b11012d..1d539fa 100644 (file)
@@ -248,6 +248,25 @@ function delete_record() {
        }
 }
 
+function undelete_record() {
+    if (g.error.yns_alert(
+               document.getElementById('offlineStrings').getFormattedString('cat.opac.undelete_record.confirm', [docid]),
+               document.getElementById('offlineStrings').getString('cat.opac.undelete_record'),
+               document.getElementById('offlineStrings').getString('cat.opac.undelete'),
+               document.getElementById('offlineStrings').getString('cat.opac.cancel'),
+               null,
+               document.getElementById('offlineStrings').getString('cat.opac.record_undeleted.confirm')) == 0) {
+
+        var robj = g.network.simple_request('FM_BRE_UNDELETE',[ses(),docid]);
+        if (typeof robj.ilsevent != 'undefined') {
+                       alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_undeleted.error',  [docid, robj.textcode, robj.desc]) + '\n');
+        } else {
+                       alert(document.getElementById('offlineStrings').getString('cat.opac.record_undeleted'));
+                       refresh_display(docid,true);
+        }
+    }
+}
+
 function refresh_display(id,reset) {
        try { 
                while(top_pane.node.lastChild) top_pane.node.removeChild( top_pane.node.lastChild );
index 8ecf5dd..f147eba 100644 (file)
@@ -53,6 +53,7 @@
                                <menuitem label="&staff.cat.opac.add_bucket.label;" accesskey="&staff.cat.opac.add_bucket.accesskey;" id="add_bucket" oncommand="add_to_bucket();"/>
                                <menuitem label="&staff.cat.opac.mark_for_overlay.label;" accesskey="&staff.cat.opac.mark_for_overlay.accesskey;" id="mark_for_overlay" oncommand="mark_for_overlay();"/>
                                <menuitem label="&staff.cat.opac.delete_record.label;" accesskey="&staff.cat.opac.delete_record.accesskey;" id="delete_record" oncommand="delete_record();"/>
+                               <menuitem label="&staff.cat.opac.undelete_record.label;" accesskey="&staff.cat.opac.undelete_record.accesskey;" id="undelete_record" oncommand="undelete_record();"/>
                                <menuseparator/>
                                <menuitem label="&staff.cat.opac.bib_in_new_tab.label;" id="bib_in_new_tab" oncommand="bib_in_new_tab();"/>
                                <menuitem label="&staff.cat.opac.remove_me.label;" id="remove_me" oncommand="remove_me();"/>
index f6ae1ea..c3ff848 100644 (file)
@@ -137,6 +137,7 @@ const api = {
     'FM_BRE_ID_SEARCH_VIA_MULTICLASS_QUERY' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.multiclass.query.staff' },
        'FM_BRE_ID_SEARCH_VIA_TCN' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.tcn', 'secure' : false },
        'FM_BRE_DELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.delete', 'secure' : false },
+       'FM_BRE_UNDELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.undelete', 'secure' : false },
        'FM_BRN_FROM_MARCXML' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.marcxml_to_brn', 'secure' : false },
        'FM_CCS_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.config.copy_status.retrieve.all', 'secure' : false },
        'FM_CIRC_DETAILS' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.fleshed.retrieve' },
index 35b1cd2..0c34ac0 100644 (file)
@@ -18,9 +18,14 @@ cat.bib_record=Bib Record: %1$s
 cat.opac.delete_record.confirm=Are you sure you want to delete title record #%1$s from the catalog?
 cat.opac.delete_record=Delete Record
 cat.opac.delete=Delete
+cat.opac.undelete_record.confirm=Are you sure you want to undelete title record #%1$s from the catalog?
+cat.opac.undelete_record=Undelete Record
+cat.opac.undelete=Undelete
 cat.opac.cancel=Cancel
 cat.opac.record_deleted=Record deleted.
 cat.opac.record_deleted.confirm=Check here to confirm this action.
+cat.opac.record_undeleted=Record undeleted.
+cat.opac.record_undeleted.confirm=Check here to confirm this action.
 # variables: document ID, error code, error description
 cat.opac.record_delete.error=Error deleting record #%1$s : %2$s : %3$s
 cat.save_record=Save Record
index ac6f315..00171e8 100644 (file)
@@ -20,7 +20,7 @@
 
 <window id="cat_volume_editor_win" 
        onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
-       title="Volumes"
+       title="Volumes" height="400" width="300" persist="height,width"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
        <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
        <groupbox flex="1" style="overflow: auto">
                <caption id="caption" label="Volume Editor"/>
                <hbox>
+                       <button label="Cancel" oncommand="window.close();"/>
                        <spacer flex="1" />
                        <button label="Modify" oncommand="g.stash_and_close();"/>
                </hbox>
index 6f21e3e..7072a51 100644 (file)
@@ -291,7 +291,9 @@ circ.checkout.prototype = {
                        obj.patron = obj.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ses(),obj.patron_id]);
             var params = { 
                 'patron' : obj.patron, 
-                'header' : 'checkout',
+                'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
+                'staff' : obj.data.list.au[0],
+                'template' : 'checkout',
                 'callback' : function() {
                     setTimeout(
                         function(){
index 7030b4c..aa6afd5 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -64,7 +64,7 @@ function buildConfig {
        CATALOGSCRIPTDIR="$PREFIX/var/catalog";
        PENALTYRULESDIR="$PREFIX/var/penalty";
        XSLDIR="$PREFIX/var/xsl";
-       REPORTERDIR="$PREFIX/var/reporter";
+       REPORTERDIR="$PREFIX/var/web/reporter";
        TMP="$(pwd)/.tmp";
        ADMINDIR="$PREFIX/var/admin";