From: erickson Date: Wed, 9 Jul 2008 20:29:43 +0000 (+0000) Subject: Merged revisions 9947,9950,9953-9955,9964,9966,9969-9981,9984,9995,10002-10003 via... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b92df383cbdf6595fe9669e8687cd0763683eee6;p=Evergreen.git Merged revisions 9947,9950,9953-9955,9964,9966,9969-9981,9984,9995,10002-10003 via svnmerge from svn://svn.open-ils.org/ILS/trunk ........ r9947 | miker | 2008-06-27 10:27:31 -0400 (Fri, 27 Jun 2008) | 1 line hit "d" /twice/ ... (thinko, need to remove old WHERE clause) ........ r9950 | dbs | 2008-06-29 03:07:00 -0400 (Sun, 29 Jun 2008) | 14 lines Address a few RSS and Atom feed validation problems: * Make OPAC URLs absolute (needs refinement to respect locale/skin) * Push datetime creation down to the feed and item level * Atom: * Merge summary fields into a single element * RSS2: * Generate a channel/description field * Merge item/description fields into a single element * Use RFC-822 dates (adds DateTime::Format::Mail as a prerequisite) * Set guid isPermaLink attribute false as we're using tag: URIs * Place alternate link elements in the xhtml namespace * Generate a link element with no attributes ........ r9953 | miker | 2008-07-01 21:34:39 -0400 (Tue, 01 Jul 2008) | 1 line converting time-interval to text-interval ........ r9954 | miker | 2008-07-01 21:42:00 -0400 (Tue, 01 Jul 2008) | 1 line treat full birth/death dates specially, as tsearch2 is inconsistent between 8.1 and 8.2 ........ r9955 | miker | 2008-07-01 22:19:25 -0400 (Tue, 01 Jul 2008) | 1 line update the currently indexed data to handle birth/death date stemming consistently ........ r9964 | dbs | 2008-07-03 00:25:39 -0400 (Thu, 03 Jul 2008) | 2 lines Clean up brown paper bag commit ........ r9966 | dbs | 2008-07-03 22:37:16 -0400 (Thu, 03 Jul 2008) | 3 lines Wrap those attributes in quotes, dangit. And move one more attribute into an entity. ........ r9969 | dbs | 2008-07-06 12:01:49 -0400 (Sun, 06 Jul 2008) | 3 lines Tighten up our entity checks; include a more complete range of legal entity chars Add a missing entity discovered by our more stringent entity tests ........ r9970 | dbs | 2008-07-06 12:06:30 -0400 (Sun, 06 Jul 2008) | 2 lines Patch from Craig Ricciuto to bring i18n to the patron staff client interfaces ........ r9971 | dbs | 2008-07-06 12:20:05 -0400 (Sun, 06 Jul 2008) | 2 lines Convert a few more hardcoded strings to i18n ........ r9972 | dbs | 2008-07-06 12:28:59 -0400 (Sun, 06 Jul 2008) | 2 lines Separate field name and field values with a space ........ r9973 | dbs | 2008-07-06 15:46:24 -0400 (Sun, 06 Jul 2008) | 3 lines Make current fm_IDL.xml example validate; - but do we really want to allow maxOccurs=2 for context inside retrieve elements? ........ r9974 | dbs | 2008-07-06 16:09:39 -0400 (Sun, 06 Jul 2008) | 2 lines Minor typo: confrim -> confirm ........ r9975 | dbs | 2008-07-06 16:10:47 -0400 (Sun, 06 Jul 2008) | 2 lines Another minor typo: confim -> confirm ........ r9976 | miker | 2008-07-06 20:00:56 -0400 (Sun, 06 Jul 2008) | 1 line context element can occur as many times as needed ... in practice, maybe 3 times ........ r9977 | dbs | 2008-07-06 21:53:48 -0400 (Sun, 06 Jul 2008) | 2 lines Check for expected database procedural languages ........ r9978 | dbs | 2008-07-06 23:59:51 -0400 (Sun, 06 Jul 2008) | 4 lines Terminology consistency and clarity; prepping for translation * Remove contractions and most abbreviations (Lib -> Library) * Standardize on "ID" rather than "Id" ........ r9979 | dbs | 2008-07-07 09:29:03 -0400 (Mon, 07 Jul 2008) | 2 lines Rename user_edit.xml to user_edit.xhtml to auto-enable XMLENT processing ........ r9980 | dbs | 2008-07-07 09:33:07 -0400 (Mon, 07 Jul 2008) | 2 lines Restore PostgreSQL 8.1 support in trunk schema ........ r9981 | miker | 2008-07-08 11:50:46 -0400 (Tue, 08 Jul 2008) | 1 line correct schema definition; thanks to Bill Ott for pointing it out ........ r9984 | dbs | 2008-07-08 12:02:18 -0400 (Tue, 08 Jul 2008) | 2 lines Add check for DateTime::Format::Mail (new dependency with r9550) ........ r9995 | miker | 2008-07-08 15:32:09 -0400 (Tue, 08 Jul 2008) | 1 line add status as a public note in exporter ........ r10002 | miker | 2008-07-08 23:50:07 -0400 (Tue, 08 Jul 2008) | 1 line fixing display of online resources with all-numeric display labels (thanks to Dan Scott for the RBI) ........ r10003 | dbs | 2008-07-09 09:17:18 -0400 (Wed, 09 Jul 2008) | 5 lines Enhance URL detection and linking just a tiny bit further: * Require a slash to avoid matching online URL for "HTTP: The Complete Reference" * Use same tests to determine whether the name is just the URL repeated (or a slight variation thereof) ........ git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@10005 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/fm_IDL.xsd b/Open-ILS/examples/fm_IDL.xsd index 90b8ecfee2..6f540acefe 100644 --- a/Open-ILS/examples/fm_IDL.xsd +++ b/Open-ILS/examples/fm_IDL.xsd @@ -101,6 +101,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/examples/oils_persist.xsd b/Open-ILS/examples/oils_persist.xsd index b4324cf7d3..ad1345ccef 100644 --- a/Open-ILS/examples/oils_persist.xsd +++ b/Open-ILS/examples/oils_persist.xsd @@ -37,5 +37,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/examples/permacrud.xsd b/Open-ILS/examples/permacrud.xsd index ded4f017f4..d819ae05fd 100644 --- a/Open-ILS/examples/permacrud.xsd +++ b/Open-ILS/examples/permacrud.xsd @@ -22,9 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA --> @@ -34,66 +34,62 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - + + - + + - - - + + - - - + + - - - + + - - - - - - + + + + @@ -101,7 +97,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index 26dd7e6c88..980f7e0747 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -101,6 +101,7 @@ DEBS = \ libclass-dbi-abstractsearch-perl\ libtemplate-perl\ libtext-aspell-perl\ + libdatetime-format-mail-perl\ libdatetime-timezone-perl\ libdatetime-perl\ libunix-syslog-perl\ diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm index 39285ca389..61694be438 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm @@ -695,6 +695,9 @@ sub xpath_to_string { $string .= $value->textContent . " "; } } + + $string =~ s/(\d{4})-(\d{4})/$1 $2/sgo; + return NFD($string); } @@ -900,6 +903,7 @@ sub _marcxml_to_full_rows { $val =~ s/\pM+//sgo; $val =~ s/\pC+//sgo; $val =~ s/\W+$//sgo; + $val =~ s/(\d{4})-(\d{4})/$1 $2/sgo; $ns->value( lc($val) ); push @ns_list, $ns; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm index 6dd03c0382..f881a22f1d 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm @@ -106,6 +106,7 @@ sub decompose { $term =~ s/(^|\s+)-(\w+)/$1!$2/go; $term =~ s/\b(\+)(\w+)/$2/go; $term =~ s/^\s*\b(.+)\b\s*$/$1/o; + $term =~ s/(\d{4})-(\d{4})/$1 $2/go; #$term =~ s/^(?:an?|the)\b(.*)/$1/o; $log->debug("Stripped search term string is [$term]",DEBUG); 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 e77eefc5f9..015d4bc9f5 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -570,7 +570,10 @@ sub generate_fines { my $due = $due_dt->epoch; my $now = time; - my $fine_interval = interval_to_seconds( $c->fine_interval ); + + my $fine_interval = $c->fine_interval; + $fine_interval =~ s/(\d{2}):(\d{2}):(\d{2})/$1 h $2 m $3 s/o; + $fine_interval = interval_to_seconds( $fine_interval ); if ( interval_to_seconds( $c->fine_interval ) >= interval_to_seconds('1d') ) { my $tz_offset_s = 0; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm index 8cd9f24133..0871160463 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm @@ -55,7 +55,6 @@ sub usr_breakdown_out { my $out_sql = <<" SQL"; SELECT id FROM action.circulation - WHERE usr = ? AND checkin_time IS NULL AND due_date >= 'today' AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE')) WHERE usr = ? AND checkin_time IS NULL AND ( (fine_interval >= '1 day' AND due_date >= 'today') diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm index 4e42171c37..fba5fe6d85 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm @@ -154,6 +154,7 @@ sub handler { my %orgs; my %shelves; + my %statuses; my $flesh = {}; if ($holdings) { @@ -178,6 +179,16 @@ sub handler { } $req->finish; + $req = $ses->request( 'open-ils.cstore.direct.config.copy_status.search', { id => { '!=' => undef } } ); + + while (my $s = $req->recv) { + next if ($req->failed); + $s = $s->content; + last unless ($s); + $statuses{$s->id} = $s; + } + $req->finish; + $flesh = { flesh => 2, flesh_fields => { bre => [ 'call_numbers' ], acn => [ 'copies' ] } }; } @@ -246,6 +257,7 @@ sub handler { ($cp->holdable eq 'f' ? ( x => 'unholdable' ) : ()), ($cp->circulate eq 'f' ? ( x => 'noncirculating' ) : ()), ($cp->opac_visible eq 'f' ? ( x => 'hidden' ) : ()), + z => $statuses{$cp->status}->name, ) ); diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index a348336bc5..f3bf99d040 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -412,7 +412,7 @@ sub unapi { $feed->root($root); $feed->creator($host); - $feed->update_ts(gmtime_ISO8601()); + $feed->update_ts(); $feed->link( unapi => $base) if ($flesh_feed); print "Content-type: ". $feed->type ."; charset=utf-8\n\n"; @@ -656,7 +656,9 @@ sub supercat { $feed->root($root); $feed->creator($host); - $feed->update_ts(gmtime_ISO8601()); + + $feed->update_ts(); + $feed->link( unapi => $base) if ($flesh_feed); print "Content-type: ". $feed->type ."; charset=utf-8\n\n"; @@ -745,7 +747,7 @@ sub bookbag_feed { $feed->title("Items in Book Bag [".$bucket->name."]"); $feed->creator($host); - $feed->update_ts(gmtime_ISO8601()); + $feed->update_ts(); $feed->link(alternate => $base . "/rss2-full/$id" => 'application/rss+xml'); $feed->link(atom => $base . "/atom-full/$id" => 'application/atom+xml'); @@ -754,7 +756,7 @@ sub bookbag_feed { $feed->link( OPAC => - '/opac/en-US/skin/default/xml/rresult.xml?rt=list&' . + $host . '/opac/en-US/skin/default/xml/rresult.xml?rt=list&' . join('&', map { 'rl=' . $_->target_biblio_record_entry } @{$bucket->items} ), 'text/html' ); @@ -814,7 +816,7 @@ sub changes_feed { } $feed->creator($host); - $feed->update_ts(gmtime_ISO8601()); + $feed->update_ts(); $feed->link(alternate => $base . "/rss2-full/$rtype/$axis/$limit/$date" => 'application/rss+xml'); $feed->link(atom => $base . "/atom-full/$rtype/$axis/$limit/$date" => 'application/atom+xml'); @@ -823,7 +825,7 @@ sub changes_feed { $feed->link( OPAC => - '/opac/en-US/skin/default/xml/rresult.xml?rt=list&' . + $host . '/opac/en-US/skin/default/xml/rresult.xml?rt=list&' . join('&', map { 'rl=' . $_} @$list ), 'text/html' ); @@ -1069,7 +1071,7 @@ sub opensearch_feed { $feed->title("Search results for [$terms] at ".$org_unit->[0]->name); $feed->creator($host); - $feed->update_ts(gmtime_ISO8601()); + $feed->update_ts(); $feed->_create_node( $feed->{item_xpath}, diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm index ba9d3cc848..bce56dd350 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm @@ -6,6 +6,9 @@ use XML::LibXML; use XML::LibXSLT; use OpenSRF::Utils::SettingsClient; use CGI; +use DateTime; +use DateTime::Format::Mail; + sub exists { my $class = shift; @@ -225,6 +228,7 @@ sub creator {}; package OpenILS::WWW::SuperCat::Feed::atom; use base 'OpenILS::WWW::SuperCat::Feed'; +use OpenSRF::Utils qw/:datetime/; sub new { my $class = shift; @@ -244,7 +248,8 @@ sub title { sub update_ts { my $self = shift; - my $text = shift; + # ATOM demands RFC-3339 compliant datetime formats + my $text = shift || gmtime_ISO8601(); $self->_create_node($self->{item_xpath},'http://www.w3.org/2005/Atom','updated', $text); } @@ -317,11 +322,15 @@ sub title { my $self = shift; my $text = shift; $self->_create_node('/rss/channel',undef,'title', $text); + # RSS2 demands a /channel/description element; just dupe title until we give + # users the ability to provide a description for their bookbags + $self->_create_node('/rss/channel',undef,'description', $text); } sub update_ts { my $self = shift; - my $text = shift; + # RSS2 demands RFC-822 compliant datetime formats + my $text = shift || DateTime::Format::Mail->format_datetime(DateTime->now()); $self->_create_node($self->{item_xpath},undef,'lastBuildDate', $text); } @@ -337,17 +346,27 @@ sub link { my $id = shift; my $mime = shift || "application/x-$type+xml"; - $type = 'self' if ($type eq 'rss2'); - - $self->_create_node( - $self->{item_xpath}, - undef, - 'link', - $id, - { rel => $type, - type => $mime, - } - ); + if ($type eq 'rss2' or $type eq 'alternate') { + # Just link to ourself using standard RSS2 link element + $self->_create_node( + $self->{item_xpath}, + undef, + 'link', + $id, + undef + ); + } else { + # Alternate link: use XHTML link element + $self->_create_node( + $self->{item_xpath}, + 'http://www.w3.org/1999/xhtml', + 'xhtml:link', + $id, + { rel => $type, + type => $mime, + } + ); + } } sub id { @@ -372,11 +391,33 @@ sub new { sub update_ts { my $self = shift; + # RSS2 demands RFC-822 compliant datetime formats my $text = shift; + if (!$text) { + # No date passed in, default to now + $text = DateTime::Format::Mail->format_datetime(DateTime->now()); + } elsif ($text =~ m/^\s*(\d{4})\.?\s*$/o) { + # Publication date is just a year, convert accordingly + my $year = DateTime->new(year=>$1); + $text = DateTime::Format::Mail->format_datetime($year); + } $self->_create_node($self->{item_xpath},undef,'pubDate', $text); } +sub id { + my $self = shift; + my $id = shift; + $self->_create_node( + $self->{item_xpath}, + undef, + 'guid', + $id, + { + isPermaLink=>"false" + } + ); +} #---------------------------------------------------------- diff --git a/Open-ILS/src/sql/Pg/002.functions.aggregate.sql b/Open-ILS/src/sql/Pg/002.functions.aggregate.sql index b6d308f77b..0463321c72 100644 --- a/Open-ILS/src/sql/Pg/002.functions.aggregate.sql +++ b/Open-ILS/src/sql/Pg/002.functions.aggregate.sql @@ -15,9 +15,15 @@ * */ -BEGIN; +-- Allow these to fail gracelessly outside the transaction +-- because PostgreSQL 8.1 does not support IF EXISTS +DROP AGGREGATE array_accum(anyelement) CASCADE; +DROP AGGREGATE public.first(anyelement) CASCADE; +DROP AGGREGATE public.last(anyelement) CASCADE; +DROP AGGREGATE public.agg_text(text) CASCADE; +DROP AGGREGATE public.agg_tsvector(tsvector) CASCADE; -DROP AGGREGATE IF EXISTS array_accum(anyelement) CASCADE; +BEGIN; CREATE AGGREGATE array_accum ( sfunc = array_append, @@ -30,8 +36,6 @@ CREATE OR REPLACE FUNCTION public.first_agg ( anyelement, anyelement ) RETURNS a SELECT CASE WHEN $1 IS NULL THEN $2 ELSE $1 END; $$ LANGUAGE SQL STABLE; -DROP AGGREGATE IF EXISTS public.first(anyelement) CASCADE; - CREATE AGGREGATE public.first ( sfunc = public.first_agg, basetype = anyelement, @@ -42,8 +46,6 @@ CREATE OR REPLACE FUNCTION public.last_agg ( anyelement, anyelement ) RETURNS an SELECT $2; $$ LANGUAGE SQL STABLE; -DROP AGGREGATE IF EXISTS public.last(anyelement) CASCADE; - CREATE AGGREGATE public.last ( sfunc = public.last_agg, basetype = anyelement, @@ -60,8 +62,6 @@ SELECT END; $$ LANGUAGE SQL STABLE; -DROP AGGREGATE IF EXISTS public.agg_text(text) CASCADE; - CREATE AGGREGATE public.agg_text ( sfunc = public.text_concat, basetype = text, @@ -78,8 +78,6 @@ SELECT END; $$ LANGUAGE SQL STABLE; -DROP AGGREGATE IF EXISTS public.agg_tsvector(tsvector) CASCADE; - CREATE AGGREGATE public.agg_tsvector ( sfunc = public.tsvector_concat, basetype = tsvector, diff --git a/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql index eb47a0011f..6820a9adb5 100644 --- a/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql +++ b/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql @@ -19,7 +19,7 @@ BEGIN; CREATE SCHEMA extend_reporter; CREATE TABLE extend_reporter.legacy_circ_count ( - id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id) + id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id), circ_count INT NOT NULL DEFAULT 0 ); @@ -30,5 +30,29 @@ CREATE VIEW extend_reporter.full_circ_count AS LEFT JOIN "action".circulation circ ON circ.target_copy = c.id GROUP BY cp.id; +UPDATE metabib.title_field_entry + SET value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g') + WHERE value ~ E'(\\d{4})-(\\d{4})'; + +UPDATE metabib.author_field_entry + SET value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g') + WHERE value ~ E'(\\d{4})-(\\d{4})'; + +UPDATE metabib.keyword_field_entry + SET value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g') + WHERE value ~ E'(\\d{4})-(\\d{4})'; + +UPDATE metabib.subject_field_entry + SET value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g') + WHERE value ~ E'(\\d{4})-(\\d{4})'; + +UPDATE metabib.series_field_entry + SET value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g') + WHERE value ~ E'(\\d{4})-(\\d{4})'; + +UPDATE metabib.full_rec + SET value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g') + WHERE value ~ E'(\\d{4})-(\\d{4})'; + COMMIT; diff --git a/Open-ILS/src/support-scripts/settings-tester.pl b/Open-ILS/src/support-scripts/settings-tester.pl index 5b51713a01..9cd2e54321 100755 --- a/Open-ILS/src/support-scripts/settings-tester.pl +++ b/Open-ILS/src/support-scripts/settings-tester.pl @@ -212,34 +212,78 @@ sub test_db_connect { my $dsn = "dbi:Pg:dbname=$db_name;host=$db_host;port=$db_port"; my $de = undef; - my ($dbh, $encoding); + my ($dbh, $encoding, $langs); try { $dbh = DBI->connect($dsn, $db_user, $db_pw); unless($dbh) { $de = "* $osrf_xpath :: Unable to connect to database $dsn, user=$db_user, password=$db_pw\n"; warn "* $osrf_xpath :: Unable to connect to database $dsn, user=$db_user, password=$db_pw\n"; } - my $sth = $dbh->prepare("show server_encoding"); + + # Get server encoding + my $sth = $dbh->prepare("SHOW server_encoding"); $sth->execute; $sth->bind_col(1, \$encoding); $sth->fetch; $sth->finish; + + # Get list of server languages + $sth = $dbh->prepare("SELECT lanname FROM pg_catalog.pg_language"); + $sth->execute; + $langs = $sth->fetchall_arrayref([0]); + $sth->finish; + $dbh->disconnect; } catch Error with { $de = "* $osrf_xpath :: Unable to connect to database $dsn, user=$db_user, password=$db_pw\n" . shift() . "\n"; warn "* $osrf_xpath :: Unable to connect to database $dsn, user=$db_user, password=$db_pw\n" . shift() . "\n"; }; print "* $osrf_xpath :: Successfully connected to database $dsn\n" unless ($de); + + # Check encoding if ($encoding !~ m/(utf-?8|unicode)/i) { $de .= "* ERROR: $osrf_xpath :: Database $dsn has encoding $encoding instead of UTF8 or UNICODE.\n"; warn "* ERROR: $osrf_xpath :: Database $dsn has encoding $encoding instead of UTF8 or UNICODE.\n"; } else { print " * Database has the expected server encoding $encoding.\n"; } + + my $result = check_db_langs($langs); + if ($result) { + $de .= $result; + warn $result; + } + return ($de) ? $de : "* $osrf_xpath :: Successfully connected to database $dsn with encoding $encoding\n"; } +sub check_db_langs { + my $langs = shift; + + my $errors; + + # Ensure the following PostgreSQL languages have been enabled + my %languages = ( + 'plperl' => 0, + 'plperlu' => 0, + 'plpgsql' => 0, + ); + + foreach my $lang (@$langs) { + my $lower = lc($$lang[0]); + $languages{$lower} = 1; + } + + foreach my $lang (keys %languages) { + if (!$languages{$lang}) { + $errors .= " * ERROR: Language '$lang' is not enabled in the target database\n"; + } + } + + return $errors; +} + sub check_libdbd { my $results = ''; my @location = `locate libdbdpgsql.so | grep -v home | grep -v .libs`; # simple(ton) attempt to filter out build versions @@ -329,6 +373,7 @@ CGI DateTime::TimeZone DateTime DateTime::Format::ISO8601 +DateTime::Format::Mail Unix::Syslog GD::Graph3d JavaScript::SpiderMonkey diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 0ce32ac475..e33aaba61a 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2005,6 +2005,7 @@ + @@ -2025,6 +2026,7 @@ + @@ -2067,6 +2069,8 @@ + + @@ -2198,3 +2202,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 063e40e976..63306b10f4 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -207,12 +207,13 @@ function _rdetailDraw(r) { // see if the record has any external links var links = record.online_loc(); - for( var i = 0; links && links.length > 0 && i < links.length; i++ ) { + for( var i = 0; links && links.length > 0 && i < links.length; i = i + 2 ) { var href = links[i]; - if( href.match(/http/) ) { + // avoid matching "HTTP: The Complete Reference" + if( href.match(/https?:\/|ftps?:\/|mailto:/i) ) { unHideMe($('rdetail_online_row')); - var name = links[i+1]; - if(!name || name.match(/http/)) name = href; + var name = '' + links[i+1]; + if(!name || name.match(/https?:\/|ftps?:\/|mailto:/i)) name = href; $('rdetail_online').appendChild(elem('a', {href:href,'class':'classic_link'}, name)); $('rdetail_online').appendChild(elem('br')); } diff --git a/Open-ILS/xsl/MARC21slim2ATOM.xsl b/Open-ILS/xsl/MARC21slim2ATOM.xsl index e706763b41..dd0c7e1497 100644 --- a/Open-ILS/xsl/MARC21slim2ATOM.xsl +++ b/Open-ILS/xsl/MARC21slim2ATOM.xsl @@ -24,6 +24,7 @@ + @@ -77,17 +78,23 @@ + - - - - - + + + + + + diff --git a/Open-ILS/xsl/MARC21slim2RSS2.xsl b/Open-ILS/xsl/MARC21slim2RSS2.xsl index 8461557f5a..bb8f852a00 100644 --- a/Open-ILS/xsl/MARC21slim2RSS2.xsl +++ b/Open-ILS/xsl/MARC21slim2RSS2.xsl @@ -78,6 +78,7 @@ + @@ -94,11 +95,12 @@ - - - - - + + + + + + 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 c3ff848f66..6e952ae756 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -285,7 +285,7 @@ const urls = { 'XUL_PATRON_BILL_WIZARD' : '/xul/server/patron/bill_wizard.xul', 'XUL_PATRON_DISPLAY' : '/xul/server/patron/display.xul', 'XUL_PATRON_EDIT' : '/xul/server/patron/ue.xhtml', - 'XUL_USER_PERM_EDITOR' : '/xul/server/patron/user_edit.xml', + 'XUL_USER_PERM_EDITOR' : '/xul/server/patron/user_edit.xhtml', 'XUL_PATRON_HOLDS' : '/xul/server/patron/holds.xul', 'XUL_PATRON_INFO' : '/xul/server/patron/info.xul', 'XUL_PATRON_INFO_NOTES' : '/xul/server/patron/info_notes.xul', diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul index 151093fe7f..8d267e9c9a 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul @@ -21,15 +21,15 @@ - - + - + - + - diff --git a/Open-ILS/xul/staff_client/server/patron/user_edit.js b/Open-ILS/xul/staff_client/server/patron/user_edit.js index 32a64e4ad7..cf1999ce13 100644 --- a/Open-ILS/xul/staff_client/server/patron/user_edit.js +++ b/Open-ILS/xul/staff_client/server/patron/user_edit.js @@ -10,6 +10,8 @@ var ou_type_list = []; var user_work_ous = []; var work_ou_list = []; +function $(id) { return document.getElementById(id); } + function set_work_ou(row) { var wid = findNodeByName(row,'a.id').getAttribute('workou_id'); var wapply = findNodeByName(row,'a.id').checked; @@ -103,7 +105,7 @@ function save_user () { break; } } - throw "Depth is required on the " + p.code() + " permission."; + throw $("patronStrings").getFormattedString('staff.patron.user_edit.save_user.depth_required', [p.code()]); } save_perms.push( user_perms[i] ); @@ -128,9 +130,7 @@ function save_user () { if (pok.ilsevent) throw pok; if (pok || wok) { - alert( 'User ' + user.usrname() + - ' [' + user.card().barcode() + '] ' + - ' successfully modified.\n' + pok + ' permissions and ' + wok + ' work locations updated.'); + alert($("patronStrings").getFormattedString('staff.patron.user_edit.save_user.user_modified_successfully', [user.usrname(), user.card().barcode(), pok, wok])); } init_editor(); @@ -373,7 +373,7 @@ function display_perm (root,perm_def,staff_perms, r) { (up ? up.depth() : findOrgDepth(user.home_ou())), { label_field : 'name', value_field : 'depth', - empty_label : '-- Select One --', + empty_label : $("patronStrings").getString('staff.patron.user_edit.display_perm.select_one'), empty_value : '', clear : true } ); diff --git a/Open-ILS/xul/staff_client/server/patron/user_edit.xhtml b/Open-ILS/xul/staff_client/server/patron/user_edit.xhtml new file mode 100644 index 0000000000..cff0a78aa1 --- /dev/null +++ b/Open-ILS/xul/staff_client/server/patron/user_edit.xhtml @@ -0,0 +1,155 @@ + + + + + +]> + + + + + Evergreen: User Editor + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
&staff.patron.user_edit.user_name.label;&staff.patron.user_edit.barcode.label;
First Name:Middle Name:Last Name:
+ + + + + + + + +
Working Location
+
+ + + + + + + + + + +
PermissionAppliedDepthGrantable
+
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + + + + + + () + + +
+ + + + diff --git a/Open-ILS/xul/staff_client/server/patron/user_edit.xml b/Open-ILS/xul/staff_client/server/patron/user_edit.xml deleted file mode 100644 index 773e69656e..0000000000 --- a/Open-ILS/xul/staff_client/server/patron/user_edit.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - Evergreen: User Editor - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
User Name:Barcode:
First Name:Middle Name:Last Name:
- - - - - - - - -
Working Location
-
- - - - - - - - - - -
PermissionAppliedDepthGrantable
-
- - -
- - -
- - - - - - - - - - - -
- - -
- - - - - - - () - - -
- - - - diff --git a/build/i18n/tests/check_entities.py b/build/i18n/tests/check_entities.py index 3355581a9f..784effc942 100644 --- a/build/i18n/tests/check_entities.py +++ b/build/i18n/tests/check_entities.py @@ -62,6 +62,8 @@ def parse_entities(): prefix = os.path.commonprefix(dtd_files) for d_file in dtd_files: + if DEBUG: + print "Checking %s\n" % (d_file) # Get the shortest unique address for this file short_df = d_file[len(prefix):] @@ -79,7 +81,7 @@ def parse_entities(): # Parse entity/value unpack = re.search(r'', line) if DEBUG and unpack: - print unpack.groups() + print(unpack.groups()) # Skip anything other than entity definitions # Note that this makes some massive assumptions: @@ -96,7 +98,7 @@ def parse_entities(): entity_key, quote, value = unpack.groups() if DEBUG: - print entity_key, value + print(entity_key, value) if not entities.has_key(entity_key): entities[entity_key] = [{'value': value, 'file': short_df}] @@ -139,23 +141,35 @@ def check_xul(root, filename, entities): # Typical entity usage: # &blah.blah.blah_bity.blah; - strings = re.compile(r'''&([a-zA-Z._]+);''') + strings = re.compile(r'''&([a-zA-Z:_][a-zA-Z0-9:_\-.]+);''') xul = open(os.path.join(root, filename), 'r') content = xul.read() xul.close() if DEBUG: - print "File: %s" % (os.path.normpath(os.path.join(root, filename))) + print("File: %s" % (os.path.normpath(os.path.join(root, filename)))) for s_match in strings.finditer(content): num_strings += 1 if not entities.has_key(s_match.group(1)): - print "File: %s" % (os.path.normpath(os.path.join(root, filename))) - print "\tEntity %s not found, expected in %s" % (s_match.group(1), 'lang.dtd') + print("File: %s" % (os.path.normpath(os.path.join(root, filename)))) + print("\tEntity %s not found, expected in %s" % (s_match.group(1), 'lang.dtd')) + + # Find bad entities + bad_strings = re.compile(r'''&([^a-zA-Z:_]?[a-zA-Z0-9:_]*[^a-zA-Z0-9:_\-.;][a-zA-Z0-9:_\-.]*);''') + + # Match character entities ( etc), which are okay + char_entity = re.compile(r'''^((#([0-9])+)|(#x([0-9a-fA-F])+))$''') + + for s_match in bad_strings.finditer(content): + # Rule out character entities and URL concatenation + if (not char_entity.search(s_match.group(1))) and s_match.group(1) != "'": + print("File: %s" % (os.path.normpath(os.path.join(root, filename)))) + print("\tBad entity: %s" % (s_match.group(1))) if DEBUG: - print "\t%d entities found" % (num_strings) + print("\t%d entities found" % (num_strings)) if __name__ == '__main__': entities = parse_entities()