From: erickson Date: Wed, 11 Jun 2008 01:59:21 +0000 (+0000) Subject: Merged revisions 9734,9736,9739-9742,9749-9750,9755-9757,9760-9763,9766-9769,9778... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=424a25ad129fd9b84c87e5e3d8bf8c99077313ae;p=Evergreen.git Merged revisions 9734,9736,9739-9742,9749-9750,9755-9757,9760-9763,9766-9769,9778,9781,9784,9787,9790,9793,9795,9798,9803,9805,9808-9809 via svnmerge from 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 --- diff --git a/Evergreen/conf/lib_ips.txt b/Evergreen/conf/lib_ips.txt index c800660de7..7e8e48fcdd 100644 --- a/Evergreen/conf/lib_ips.txt +++ b/Evergreen/conf/lib_ips.txt @@ -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 diff --git a/Open-ILS/examples/apache/eg_vhost.conf b/Open-ILS/examples/apache/eg_vhost.conf index c693f862a0..1e2fe4d39d 100644 --- a/Open-ILS/examples/apache/eg_vhost.conf +++ b/Open-ILS/examples/apache/eg_vhost.conf @@ -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 +# ---------------------------------------------------------------------------------- +# 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 +# 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] + + diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index c385890256..7f7ad6563f 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -625,9 +625,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - - + + + diff --git a/Open-ILS/examples/opensrf.xml.example b/Open-ILS/examples/opensrf.xml.example index f3d8d30196..f940f9f1ef 100644 --- a/Open-ILS/examples/opensrf.xml.example +++ b/Open-ILS/examples/opensrf.xml.example @@ -61,7 +61,7 @@ vim:et:ts=4:sw=4: - /openils/var/web/reporter/output + /openils/var/web/reporter /openils/var/data/report-success /openils/var/data/report-fail diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index 7a09dd25a6..150e6c55f1 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -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 # ----------------------------------------------------------------------------------- diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index ce5dbdc25e..8f8820f11f 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -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 diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index 06ea4026e7..87a8f43aed 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -97,6 +97,7 @@ DEBS = \ libreadline5-dev\ libtext-csv-perl\ libspreadsheet-writeexcel-perl\ + libole-storage-lite-perl\ libtie-ixhash-perl\ python-dev\ python-setuptools\ diff --git a/Open-ILS/src/extras/ils_events.xml b/Open-ILS/src/extras/ils_events.xml index 1e7de32ba7..f1cefcb79d 100644 --- a/Open-ILS/src/extras/ils_events.xml +++ b/Open-ILS/src/extras/ils_events.xml @@ -616,6 +616,9 @@ The requested acq.currency_type was not found + + The requested action_open_circ_count_by_circ_mod was not found + diff --git a/Open-ILS/src/extras/openurl_map.pl b/Open-ILS/src/extras/openurl_map.pl new file mode 100755 index 0000000000..a376df7e0e --- /dev/null +++ b/Open-ILS/src/extras/openurl_map.pl @@ -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"; + +}; diff --git a/Open-ILS/src/javascript/backend/circ/circ_lib.js b/Open-ILS/src/javascript/backend/circ/circ_lib.js index 621e45363e..c708dbf68c 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_lib.js +++ b/Open-ILS/src/javascript/backend/circ/circ_lib.js @@ -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 */ diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 768d7e5aad..9f874ed19e 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -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" ); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm index 80ec094a13..7f13fe142f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm @@ -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; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index e6640c4984..5ddd0087ed 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -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 diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index cb6b06a8ee..7af61273d9 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -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, diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm b/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm index b625f4cb55..4b100dbdd8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm @@ -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'}; diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm index 1b93f236fe..4e42171c37 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm @@ -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; } diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index 4c2368a02d..f5918a8cb4 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -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, diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm index 9ad6c2c3ca..6d382a37d1 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm @@ -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 index 0000000000..1f9f4c171c --- /dev/null +++ b/Open-ILS/src/sql/Pg/1.2.2.0-1.2.2.1-upgrade-db.sql @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008 Equinox Software, Inc. + * Mike Rylander + * + * 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; diff --git a/Open-ILS/src/sql/Pg/100.circ_matrix.sql b/Open-ILS/src/sql/Pg/100.circ_matrix.sql index 3a7b122db0..c65507a752 100644 --- a/Open-ILS/src/sql/Pg/100.circ_matrix.sql +++ b/Open-ILS/src/sql/Pg/100.circ_matrix.sql @@ -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; diff --git a/Open-ILS/src/sql/Pg/reporter-schema.sql b/Open-ILS/src/sql/Pg/reporter-schema.sql index 8cb513a3ce..3fc2e22f14 100644 --- a/Open-ILS/src/sql/Pg/reporter-schema.sql +++ b/Open-ILS/src/sql/Pg/reporter-schema.sql @@ -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 index 0000000000..b8ed0cae52 --- /dev/null +++ b/Open-ILS/src/support-scripts/test-scripts/indb_circ.pl @@ -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 index 0000000000..ce4a7c1fbe Binary files /dev/null and b/Open-ILS/web/opac/images/blank.png differ diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index c9dd4484b5..36dded85fc 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -236,6 +236,8 @@ + + diff --git a/Open-ILS/web/opac/skin/default/js/search_bar.js b/Open-ILS/web/opac/skin/default/js/search_bar.js index c87d494f75..5b6cccbb77 100644 --- a/Open-ILS/web/opac/skin/default/js/search_bar.js +++ b/Open-ILS/web/opac/skin/default/js/search_bar.js @@ -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; diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js index b11012d3aa..1d539fa5b1 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -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 ); diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul b/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul index 8ecf5ddf3c..f147eba7b9 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul @@ -53,6 +53,7 @@ + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index f6ae1ea291..c3ff848f66 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -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' }, diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties index 35b1cd203c..0c34ac0ca2 100644 --- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties +++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties @@ -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 diff --git a/Open-ILS/xul/staff_client/server/cat/volume_editor.xul b/Open-ILS/xul/staff_client/server/cat/volume_editor.xul index ac6f315568..00171e80b1 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_editor.xul +++ b/Open-ILS/xul/staff_client/server/cat/volume_editor.xul @@ -20,7 +20,7 @@ @@ -100,6 +100,7 @@ +