$(APT_TOOL) install $(PGSQL_CLIENT_DEBS_84)
install_pgsql_server_debs_84:
- LANG=C $(APT_TOOL) install $(PGSQL_SERVER_DEBS_84)
+ $(APT_TOOL) install $(PGSQL_SERVER_DEBS_84)
install_pgsql_client_debs_83:
$(APT_TOOL) install $(PGSQL_CLIENT_DEBS_83)
$mods->author($copy->dummy_author);
} else {
- my $u = OpenILS::Utils::ModsParser->new();
- $u->start_mods_batch($circ->target_copy->call_number->record->marc);
- $mods = $u->finish_mods_batch();
- }
+ $mods = $U->record_to_mvr($circ->target_copy->call_number->record);
+ }
# more de-fleshiing
$circ->target_copy($circ->target_copy->id);
);
__PACKAGE__->register_method(
method => "run_method",
+ api_name => "open-ils.circ.reservation.return.override"
+);
+__PACKAGE__->register_method(
+ method => "run_method",
api_name => "open-ils.circ.checkout.inspect",
desc => q/Returns the circ matrix test result and, on success, the rule set and matrix test object/
);
$argshash->{patron_id},
{
flesh => 1,
- flesh_fields => { au => ["mailing_address"] }
+ flesh_fields => { au => ["mailing_address", "card"] }
}
]
) or return $e->event;
$content{FirstName} = $content{first_name}; # kludge mcugly for PP
$content{LastName} = $content{last_name};
+ # makes patron barcode accessible in CC payment records
+ my $bc = ($patron->card) ? $patron->card->barcode : '';
+ $content{description} = "$bc " . ($content{description} || '');
# Especially for the following fields, do we need to support different
# mapping of fields for different payment processors, particularly ones
# in other countries?
- $content{address} ||= $patron->mailing_address->street1;
- $content{address} .= ", " . $patron->mailing_address->street2
- if $patron->mailing_address->street2;
+ if(!$content{address}) {
+ $content{address} = $patron->mailing_address->street1;
+ $content{address} .= ", " . $patron->mailing_address->street2
+ if $patron->mailing_address->street2;
+ }
$content{city} ||= $patron->mailing_address->city;
$content{state} ||= $patron->mailing_address->state;
use DateTime::Format::ISO8601;
use DateTime::Set;
use DateTime::SpanSet;
-
-
+
my $_dt_parser = DateTime::Format::ISO8601->new;
my $log = 'OpenSRF::Utils::Logger';
# group 2 = phone, ident
# group 3 = barcode
- my $usr = join ' AND ', map { "LOWER(CAST($_ AS text)) ~ ?" } grep { ''.$$search{$_}{group} eq '0' } keys %$search;
- my @usrv = map { "^$$search{$_}{value}" } grep { ''.$$search{$_}{group} eq '0' } keys %$search;
+ my $usr = join ' AND ', map { "evergreen.lowercase(CAST($_ AS text)) ~ ?" } grep { ''.$$search{$_}{group} eq '0' } keys %$search;
+ my @usrv = map { "^" . $$search{$_}{value} } grep { ''.$$search{$_}{group} eq '0' } keys %$search;
- my $addr = join ' AND ', map { "LOWER(CAST($_ AS text)) ~ ?" } grep { ''.$$search{$_}{group} eq '1' } keys %$search;
- my @addrv = map { "^$$search{$_}{value}" } grep { ''.$$search{$_}{group} eq '1' } keys %$search;
+ my $addr = join ' AND ', map { "evergreen.lowercase(CAST($_ AS text)) ~ ?" } grep { ''.$$search{$_}{group} eq '1' } keys %$search;
+ my @addrv = map { "^" . $$search{$_}{value} } grep { ''.$$search{$_}{group} eq '1' } keys %$search;
my $pv = $$search{phone}{value};
my $iv = $$search{ident}{value};
my $card = '';
if ($cv) {
- $card = 'JOIN (SELECT DISTINCT usr FROM actor.card WHERE LOWER(barcode) LIKE ?||\'%\') AS card ON (card.usr = users.id)';
+ $card = 'JOIN (SELECT DISTINCT usr FROM actor.card WHERE evergreen.lowercase(barcode) LIKE ?||\'%\') AS card ON (card.usr = users.id)';
unshift(@usrv, $cv);
}
my @phonev;
if ($pv) {
for my $p ( qw/day_phone evening_phone other_phone/ ) {
- push @ps, "LOWER($p) ~ ?";
+ push @ps, "evergreen.lowercase($p) ~ ?";
push @phonev, "^$pv";
}
$phone = '(' . join(' OR ', @ps) . ')';
my @identv;
if ($iv) {
for my $i ( qw/ident_value ident_value2/ ) {
- push @is, "LOWER($i) ~ ?";
+ push @is, "evergreen.lowercase($i) ~ ?";
push @identv, "^$iv";
}
$ident = '(' . join(' OR ', @is) . ')';
my @namev;
if (0 && $nv) {
for my $n ( qw/first_given_name second_given_name family_name/ ) {
- push @ns, "LOWER($n) ~ ?";
+ push @ns, "evergreen.lowercase($n) ~ ?";
push @namev, "^$nv";
}
$name = '(' . join(' OR ', @ns) . ')';
return undef if (!$select && !$card);
- my $order_by = join ', ', map { 'LOWER(CAST(users.'. (split / /,$_)[0] . ' AS text)) ' . (split / /,$_)[1] } @$sort;
- my $distinct_list = join ', ', map { 'LOWER(CAST(users.'. (split / /,$_)[0] . ' AS text))' } @$sort;
+ my $order_by = join ', ', map { 'evergreen.lowercase(CAST(users.'. (split / /,$_)[0] . ' AS text)) ' . (split / /,$_)[1] } @$sort;
+ my $distinct_list = join ', ', map { 'evergreen.lowercase(CAST(users.'. (split / /,$_)[0] . ' AS text))' } @$sort;
my $group_list = $distinct_list;
if ($inactive) {
if($self->{record_type} eq 'bib') {
$queues = $e->search_vandelay_bib_queue(
- [$search, {order_by => {vbq => 'lower(name)'}}]);
+ [$search, {order_by => {vbq => 'evergreen.lowercase(name)'}}]);
} else {
$queues = $e->search_vandelay_authority_queue(
- [$search, {order_by => {vaq => 'lower(name)'}}]);
+ [$search, {order_by => {vaq => 'evergreen.lowercase(name)'}}]);
}
$conn->respond($_) for @$queues;
$e->rollback;
my $params = $self->resolve_param( $self->{_column}->{params} );
my $start = $$params[0];
my $len = $$params[1];
- return 'LOWER("' . $self->{_relation} . '"."' . $self->name . '")';
+ return 'evergreen.lowercase("' . $self->{_relation} . '"."' . $self->name . '")';
}
sub is_aggregate { return 0 }
'group' => 1 },
'lower' => {
'label' => 'Transform string to lower case',
- 'select' => 'LOWER(?COLNAME?)',
+ 'select' => 'evergreen.lowercase(?COLNAME?)',
'group' => 1 },
'upper' => {
'label' => 'Transform string to upper case',
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Georgia Public Library Service
- * Copyright (C) 2008 Equinox Software, Inc.
- * Mike Rylander <miker@esilibrary.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;
-
-CREATE OR REPLACE FUNCTION oils_tsearch2 () RETURNS TRIGGER AS $$
-BEGIN
- NEW.index_vector = to_tsvector(TG_ARGV[0], NEW.value);
- RETURN NEW;
-END;
-$$ LANGUAGE PLPGSQL;
-
-INSERT INTO pg_ts_cfg VALUES ('title', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('author', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('subject', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('keyword', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('identifier', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('series', 'default','C');
-
-INSERT INTO pg_ts_dict VALUES ('en_stem_nostop', 'snb_en_init(internal)', '', 'snb_lexize(internal,internal,integer)', 'English Stemmer. Snowball. No stop words.');
-
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'lhword', '{en_stem_nostop}');
-
-SELECT set_curcfg('default');
-
-COMMIT;
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Georgia Public Library Service
- * Copyright (C) 2008 Equinox Software, Inc.
- * Mike Rylander <miker@esilibrary.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;
-
-CREATE OR REPLACE FUNCTION oils_tsearch2 () RETURNS TRIGGER AS $$
-BEGIN
- NEW.index_vector = to_tsvector(TG_ARGV[0], NEW.value);
- RETURN NEW;
-END;
-$$ LANGUAGE PLPGSQL;
-
-INSERT INTO pg_ts_cfg VALUES ('title', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('author', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('subject', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('keyword', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('identifier', 'default','C');
-INSERT INTO pg_ts_cfg VALUES ('series', 'default','C');
-
-INSERT INTO pg_ts_dict VALUES ('en_stem_nostop', 'snb_en_init(internal)', '', 'snb_lexize(internal,internal,integer)', 'English Stemmer. Snowball. No stop words.');
-
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('title', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('author', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lhword', '{en_stem_nostop}');
-
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'word', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'email', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'url', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'host', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'sfloat', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'version', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'part_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlpart_hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'hword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlhword', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'uri', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'file', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'float', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'int', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'uint', '{simple}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'lword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'lpart_hword', '{en_stem_nostop}');
-INSERT INTO pg_ts_cfgmap VALUES ('series', 'lhword', '{en_stem_nostop}');
-
-SELECT set_curcfg('default');
-
-COMMIT;
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Georgia Public Library Service
- * Copyright (C) 2008 Equinox Software, Inc., Laurentian University
- * Mike Rylander <miker@esilibrary.com>
- * Dan Scott <dscott@laurentian.ca>
- *
- * 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;
-
-CREATE OR REPLACE FUNCTION oils_tsearch2 () RETURNS TRIGGER AS $$
-BEGIN
- NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, NEW.value);
- RETURN NEW;
-END;
-$$ LANGUAGE PLPGSQL;
-
-DROP TEXT SEARCH DICTIONARY IF EXISTS english_nostop CASCADE;
-
-CREATE TEXT SEARCH DICTIONARY english_nostop (TEMPLATE=pg_catalog.snowball, language='english');
-COMMENT ON TEXT SEARCH DICTIONARY english_nostop IS 'English snowball stemmer with no stopwords for ASCII words only.';
-
-CREATE TEXT SEARCH CONFIGURATION title ( COPY = pg_catalog.english );
-ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR word, hword, hword_part WITH pg_catalog.simple;
-ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH public.english_nostop;
-CREATE TEXT SEARCH CONFIGURATION author ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION subject ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION keyword ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION identifier ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION series ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION "default" ( COPY = title );
-
-COMMIT;
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Georgia Public Library Service
- * Copyright (C) 2008 Equinox Software, Inc., Laurentian University
- * Mike Rylander <miker@esilibrary.com>
- * Dan Scott <dscott@laurentian.ca>
- *
- * 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;
-
-CREATE OR REPLACE FUNCTION oils_tsearch2 () RETURNS TRIGGER AS $$
-BEGIN
- NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, NEW.value);
- RETURN NEW;
-END;
-$$ LANGUAGE PLPGSQL;
-
-DROP TEXT SEARCH DICTIONARY IF EXISTS english_nostop CASCADE;
-
-CREATE TEXT SEARCH DICTIONARY english_nostop (TEMPLATE=pg_catalog.snowball, language='english');
-COMMENT ON TEXT SEARCH DICTIONARY english_nostop IS 'English snowball stemmer with no stopwords for ASCII words only.';
-
-CREATE TEXT SEARCH CONFIGURATION title ( COPY = pg_catalog.english );
-ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR word, hword, hword_part WITH pg_catalog.simple;
-ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH public.english_nostop;
-CREATE TEXT SEARCH CONFIGURATION author ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION subject ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION keyword ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION identifier ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION series ( COPY = title );
-CREATE TEXT SEARCH CONFIGURATION "default" ( COPY = title );
-
-COMMIT;
CREATE TEXT SEARCH CONFIGURATION title ( COPY = pg_catalog.english );
ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR word, hword, hword_part WITH pg_catalog.simple;
-ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH public.english_nostop;
+ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH english_nostop;
CREATE TEXT SEARCH CONFIGURATION author ( COPY = title );
CREATE TEXT SEARCH CONFIGURATION subject ( COPY = title );
CREATE TEXT SEARCH CONFIGURATION keyword ( COPY = title );
*
*/
--- 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;
-
BEGIN;
+DROP AGGREGATE IF EXISTS array_accum(anyelement) CASCADE;
+DROP AGGREGATE IF EXISTS public.first(anyelement) CASCADE;
+DROP AGGREGATE IF EXISTS public.last(anyelement) CASCADE;
+DROP AGGREGATE IF EXISTS public.agg_text(text) CASCADE;
+DROP AGGREGATE IF EXISTS public.agg_tsvector(tsvector) CASCADE;
+
CREATE AGGREGATE array_accum (
sfunc = array_append,
basetype = anyelement,
--- /dev/null
+-- Rather than polluting the public schema with general Evergreen
+-- functions, carve out a dedicated schema
+
+DROP SCHEMA IF EXISTS evergreen CASCADE;
+
+BEGIN;
+
+CREATE SCHEMA evergreen;
+
+CREATE OR REPLACE FUNCTION evergreen.lowercase( TEXT ) RETURNS TEXT AS $$
+ return lc(shift);
+$$ LANGUAGE PLPERLU STRICT IMMUTABLE;
+
+COMMIT;
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0496'); -- dbs
+INSERT INTO config.upgrade_log (version) VALUES ('0498'); -- dbs
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
CREATE INDEX actor_usr_mailing_address_idx ON actor.usr (mailing_address);
CREATE INDEX actor_usr_billing_address_idx ON actor.usr (billing_address);
-CREATE INDEX actor_usr_first_given_name_idx ON actor.usr (lower(first_given_name));
-CREATE INDEX actor_usr_second_given_name_idx ON actor.usr (lower(second_given_name));
-CREATE INDEX actor_usr_family_name_idx ON actor.usr (lower(family_name));
+CREATE INDEX actor_usr_first_given_name_idx ON actor.usr (evergreen.lowercase(first_given_name));
+CREATE INDEX actor_usr_second_given_name_idx ON actor.usr (evergreen.lowercase(second_given_name));
+CREATE INDEX actor_usr_family_name_idx ON actor.usr (evergreen.lowercase(family_name));
-CREATE INDEX actor_usr_email_idx ON actor.usr (lower(email));
+CREATE INDEX actor_usr_email_idx ON actor.usr (evergreen.lowercase(email));
-CREATE INDEX actor_usr_day_phone_idx ON actor.usr (lower(day_phone));
-CREATE INDEX actor_usr_evening_phone_idx ON actor.usr (lower(evening_phone));
-CREATE INDEX actor_usr_other_phone_idx ON actor.usr (lower(other_phone));
+CREATE INDEX actor_usr_day_phone_idx ON actor.usr (evergreen.lowercase(day_phone));
+CREATE INDEX actor_usr_evening_phone_idx ON actor.usr (evergreen.lowercase(evening_phone));
+CREATE INDEX actor_usr_other_phone_idx ON actor.usr (evergreen.lowercase(other_phone));
-CREATE INDEX actor_usr_ident_value_idx ON actor.usr (lower(ident_value));
-CREATE INDEX actor_usr_ident_value2_idx ON actor.usr (lower(ident_value2));
+CREATE INDEX actor_usr_ident_value_idx ON actor.usr (evergreen.lowercase(ident_value));
+CREATE INDEX actor_usr_ident_value2_idx ON actor.usr (evergreen.lowercase(ident_value2));
CREATE FUNCTION actor.crypt_pw_insert () RETURNS TRIGGER AS $$
BEGIN
$$;
CREATE INDEX actor_card_usr_idx ON actor.card (usr);
-CREATE INDEX actor_card_barcode_lower_idx ON actor.card (lower(barcode));
+CREATE INDEX actor_card_barcode_evergreen_lowercase_idx ON actor.card (evergreen.lowercase(barcode));
CREATE TABLE actor.org_unit_type (
id SERIAL PRIMARY KEY,
CREATE INDEX actor_usr_addr_usr_idx ON actor.usr_address (usr);
-CREATE INDEX actor_usr_addr_street1_idx ON actor.usr_address (lower(street1));
-CREATE INDEX actor_usr_addr_street2_idx ON actor.usr_address (lower(street2));
+CREATE INDEX actor_usr_addr_street1_idx ON actor.usr_address (evergreen.lowercase(street1));
+CREATE INDEX actor_usr_addr_street2_idx ON actor.usr_address (evergreen.lowercase(street2));
-CREATE INDEX actor_usr_addr_city_idx ON actor.usr_address (lower(city));
-CREATE INDEX actor_usr_addr_state_idx ON actor.usr_address (lower(state));
-CREATE INDEX actor_usr_addr_post_code_idx ON actor.usr_address (lower(post_code));
+CREATE INDEX actor_usr_addr_city_idx ON actor.usr_address (evergreen.lowercase(city));
+CREATE INDEX actor_usr_addr_state_idx ON actor.usr_address (evergreen.lowercase(state));
+CREATE INDEX actor_usr_addr_post_code_idx ON actor.usr_address (evergreen.lowercase(post_code));
CREATE TABLE actor.usr_password_reset (
id SERIAL PRIMARY KEY,
-- Looks like an ISBN? check for an isbn match
IF (attr.attr_value ~* $r$^[0-9x]+$$r$ AND character_length(attr.attr_value) IN (10,13)) THEN
- FOR eg_rec IN EXECUTE $$SELECT * FROM metabib.full_rec fr WHERE fr.value LIKE LOWER('$$ || attr.attr_value || $$%') AND fr.tag = '020' AND fr.subfield = 'a'$$ LOOP
+ FOR eg_rec IN EXECUTE $$SELECT * FROM metabib.full_rec fr WHERE fr.value LIKE evergreen.lowercase('$$ || attr.attr_value || $$%') AND fr.tag = '020' AND fr.subfield = 'a'$$ LOOP
PERFORM id FROM biblio.record_entry WHERE id = eg_rec.record AND deleted IS FALSE;
IF FOUND THEN
INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('isbn', attr.id, NEW.id, eg_rec.record);
'interval'
);
+-- 0XXX.patron_registration.sql
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype ) VALUES
+
+( 'ui.patron.edit.au.active.show',
+ oils_i18n_gettext('ui.patron.edit.au.active.show', 'GUI: Show active field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.active.show', 'The active field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.active.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.active.suggest', 'GUI: Suggest active field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.active.suggest', 'The active field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.alert_message.show',
+ oils_i18n_gettext('ui.patron.edit.au.alert_message.show', 'GUI: Show alert_message field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.alert_message.show', 'The alert_message field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.alert_message.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.alert_message.suggest', 'GUI: Suggest alert_message field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.alert_message.suggest', 'The alert_message field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.alias.show',
+ oils_i18n_gettext('ui.patron.edit.au.alias.show', 'GUI: Show alias field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.alias.show', 'The alias field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.alias.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.alias.suggest', 'GUI: Suggest alias field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.alias.suggest', 'The alias field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.barred.show',
+ oils_i18n_gettext('ui.patron.edit.au.barred.show', 'GUI: Show barred field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.barred.show', 'The barred field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.barred.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.barred.suggest', 'GUI: Suggest barred field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.barred.suggest', 'The barred field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.claims_never_checked_out_count.show',
+ oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.show', 'GUI: Show claims_never_checked_out_count field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.show', 'The claims_never_checked_out_count field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.claims_never_checked_out_count.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.suggest', 'GUI: Suggest claims_never_checked_out_count field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.suggest', 'The claims_never_checked_out_count field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.claims_returned_count.show',
+ oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.show', 'GUI: Show claims_returned_count field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.show', 'The claims_returned_count field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.claims_returned_count.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.suggest', 'GUI: Suggest claims_returned_count field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.suggest', 'The claims_returned_count field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.day_phone.example',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.example', 'GUI: Example for day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.example', 'The Example for validation on the day_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.day_phone.regex',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', 'GUI: Regex for day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', 'The Regular Expression for validation on the day_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.day_phone.require',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.require', 'GUI: Require day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.require', 'The day_phone field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.day_phone.show',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.show', 'GUI: Show day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.show', 'The day_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.day_phone.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.suggest', 'GUI: Suggest day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.suggest', 'The day_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.dob.calendar',
+ oils_i18n_gettext('ui.patron.edit.au.dob.calendar', 'GUI: Show calendar widget for dob field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.dob.calendar', 'If set the calendar widget will appear when editing the dob field on the patron registration form.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.dob.require',
+ oils_i18n_gettext('ui.patron.edit.au.dob.require', 'GUI: Require dob field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.dob.require', 'The dob field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.dob.show',
+ oils_i18n_gettext('ui.patron.edit.au.dob.show', 'GUI: Show dob field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.dob.show', 'The dob field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.dob.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.dob.suggest', 'GUI: Suggest dob field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.dob.suggest', 'The dob field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.email.example',
+ oils_i18n_gettext('ui.patron.edit.au.email.example', 'GUI: Example for email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.example', 'The Example for validation on the email field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.email.regex',
+ oils_i18n_gettext('ui.patron.edit.au.email.regex', 'GUI: Regex for email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.regex', 'The Regular Expression for validation on the email field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.email.require',
+ oils_i18n_gettext('ui.patron.edit.au.email.require', 'GUI: Require email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.require', 'The email field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.email.show',
+ oils_i18n_gettext('ui.patron.edit.au.email.show', 'GUI: Show email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.show', 'The email field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.email.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.email.suggest', 'GUI: Suggest email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.suggest', 'The email field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.evening_phone.example',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.example', 'GUI: Example for evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.example', 'The Example for validation on the evening_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.evening_phone.regex',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.regex', 'GUI: Regex for evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.regex', 'The Regular Expression for validation on the evening_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.evening_phone.require',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.require', 'GUI: Require evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.require', 'The evening_phone field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.evening_phone.show',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.show', 'GUI: Show evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.show', 'The evening_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.evening_phone.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.suggest', 'GUI: Suggest evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.suggest', 'The evening_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.ident_value.show',
+ oils_i18n_gettext('ui.patron.edit.au.ident_value.show', 'GUI: Show ident_value field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.ident_value.show', 'The ident_value field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.ident_value.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.ident_value.suggest', 'GUI: Suggest ident_value field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.ident_value.suggest', 'The ident_value field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.ident_value2.show',
+ oils_i18n_gettext('ui.patron.edit.au.ident_value2.show', 'GUI: Show ident_value2 field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.ident_value2.show', 'The ident_value2 field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.ident_value2.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.ident_value2.suggest', 'GUI: Suggest ident_value2 field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.ident_value2.suggest', 'The ident_value2 field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.juvenile.show',
+ oils_i18n_gettext('ui.patron.edit.au.juvenile.show', 'GUI: Show juvenile field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.juvenile.show', 'The juvenile field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.juvenile.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.juvenile.suggest', 'GUI: Suggest juvenile field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.juvenile.suggest', 'The juvenile field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.master_account.show',
+ oils_i18n_gettext('ui.patron.edit.au.master_account.show', 'GUI: Show master_account field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.master_account.show', 'The master_account field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.master_account.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.master_account.suggest', 'GUI: Suggest master_account field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.master_account.suggest', 'The master_account field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.other_phone.example',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.example', 'GUI: Example for other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.example', 'The Example for validation on the other_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.other_phone.regex',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.regex', 'GUI: Regex for other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.regex', 'The Regular Expression for validation on the other_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.other_phone.require',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.require', 'GUI: Require other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.require', 'The other_phone field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.other_phone.show',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.show', 'GUI: Show other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.show', 'The other_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.other_phone.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.suggest', 'GUI: Suggest other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.suggest', 'The other_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.second_given_name.show',
+ oils_i18n_gettext('ui.patron.edit.au.second_given_name.show', 'GUI: Show second_given_name field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.second_given_name.show', 'The second_given_name field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.second_given_name.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.second_given_name.suggest', 'GUI: Suggest second_given_name field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.second_given_name.suggest', 'The second_given_name field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.suffix.show',
+ oils_i18n_gettext('ui.patron.edit.au.suffix.show', 'GUI: Show suffix field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.suffix.show', 'The suffix field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.suffix.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.suffix.suggest', 'GUI: Suggest suffix field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.suffix.suggest', 'The suffix field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.aua.county.require',
+ oils_i18n_gettext('ui.patron.edit.aua.county.require', 'GUI: Require county field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.aua.county.require', 'The county field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.aua.post_code.example',
+ oils_i18n_gettext('ui.patron.edit.aua.post_code.example', 'GUI: Example for post_code field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.aua.post_code.example', 'The Example for validation on the post_code field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.aua.post_code.regex',
+ oils_i18n_gettext('ui.patron.edit.aua.post_code.regex', 'GUI: Regex for post_code field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.aua.post_code.regex', 'The Regular Expression for validation on the post_code field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.default_suggested',
+ oils_i18n_gettext('ui.patron.edit.default_suggested', 'GUI: Default showing suggested patron registration fields', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.default_suggested', 'Instead of All fields, show just suggested fields in patron registration by default.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.phone.example',
+ oils_i18n_gettext('ui.patron.edit.phone.example', 'GUI: Example for phone fields on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.phone.example', 'The Example for validation on phone fields in patron registration. Applies to all phone fields without their own setting.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.phone.regex',
+ oils_i18n_gettext('ui.patron.edit.phone.regex', 'GUI: Regex for phone fields on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.phone.regex', 'The Regular Expression for validation on phone fields in patron registration. Applies to all phone fields without their own setting.', 'coust', 'description'),
+ 'string');
+
-- *** Has to go below coust definition to satisfy referential integrity ***
-- In booking, elbow room defines:
-- a) how far in the future you must make a reservation on a given item if
-DROP SCHEMA unapi CASCADE;
+DROP SCHEMA IF EXISTS unapi CASCADE;
BEGIN;
CREATE SCHEMA unapi;
001.schema.offline.sql
+ 002.functions.general.sql
002.schema.config.sql
002.functions.aggregate.sql
002.functions.config.sql
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0497');
+
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype ) VALUES
+
+( 'ui.patron.edit.au.active.show',
+ oils_i18n_gettext('ui.patron.edit.au.active.show', 'GUI: Show active field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.active.show', 'The active field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.active.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.active.suggest', 'GUI: Suggest active field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.active.suggest', 'The active field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.alert_message.show',
+ oils_i18n_gettext('ui.patron.edit.au.alert_message.show', 'GUI: Show alert_message field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.alert_message.show', 'The alert_message field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.alert_message.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.alert_message.suggest', 'GUI: Suggest alert_message field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.alert_message.suggest', 'The alert_message field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.alias.show',
+ oils_i18n_gettext('ui.patron.edit.au.alias.show', 'GUI: Show alias field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.alias.show', 'The alias field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.alias.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.alias.suggest', 'GUI: Suggest alias field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.alias.suggest', 'The alias field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.barred.show',
+ oils_i18n_gettext('ui.patron.edit.au.barred.show', 'GUI: Show barred field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.barred.show', 'The barred field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.barred.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.barred.suggest', 'GUI: Suggest barred field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.barred.suggest', 'The barred field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.claims_never_checked_out_count.show',
+ oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.show', 'GUI: Show claims_never_checked_out_count field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.show', 'The claims_never_checked_out_count field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.claims_never_checked_out_count.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.suggest', 'GUI: Suggest claims_never_checked_out_count field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.suggest', 'The claims_never_checked_out_count field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.claims_returned_count.show',
+ oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.show', 'GUI: Show claims_returned_count field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.show', 'The claims_returned_count field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.claims_returned_count.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.suggest', 'GUI: Suggest claims_returned_count field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.suggest', 'The claims_returned_count field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.day_phone.example',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.example', 'GUI: Example for day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.example', 'The Example for validation on the day_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.day_phone.regex',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', 'GUI: Regex for day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', 'The Regular Expression for validation on the day_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.day_phone.require',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.require', 'GUI: Require day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.require', 'The day_phone field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.day_phone.show',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.show', 'GUI: Show day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.show', 'The day_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.day_phone.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.suggest', 'GUI: Suggest day_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.day_phone.suggest', 'The day_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.dob.calendar',
+ oils_i18n_gettext('ui.patron.edit.au.dob.calendar', 'GUI: Show calendar widget for dob field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.dob.calendar', 'If set the calendar widget will appear when editing the dob field on the patron registration form.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.dob.require',
+ oils_i18n_gettext('ui.patron.edit.au.dob.require', 'GUI: Require dob field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.dob.require', 'The dob field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.dob.show',
+ oils_i18n_gettext('ui.patron.edit.au.dob.show', 'GUI: Show dob field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.dob.show', 'The dob field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.dob.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.dob.suggest', 'GUI: Suggest dob field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.dob.suggest', 'The dob field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.email.example',
+ oils_i18n_gettext('ui.patron.edit.au.email.example', 'GUI: Example for email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.example', 'The Example for validation on the email field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.email.regex',
+ oils_i18n_gettext('ui.patron.edit.au.email.regex', 'GUI: Regex for email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.regex', 'The Regular Expression for validation on the email field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.email.require',
+ oils_i18n_gettext('ui.patron.edit.au.email.require', 'GUI: Require email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.require', 'The email field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.email.show',
+ oils_i18n_gettext('ui.patron.edit.au.email.show', 'GUI: Show email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.show', 'The email field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.email.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.email.suggest', 'GUI: Suggest email field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.email.suggest', 'The email field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.evening_phone.example',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.example', 'GUI: Example for evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.example', 'The Example for validation on the evening_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.evening_phone.regex',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.regex', 'GUI: Regex for evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.regex', 'The Regular Expression for validation on the evening_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.evening_phone.require',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.require', 'GUI: Require evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.require', 'The evening_phone field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.evening_phone.show',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.show', 'GUI: Show evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.show', 'The evening_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.evening_phone.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.suggest', 'GUI: Suggest evening_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.evening_phone.suggest', 'The evening_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.ident_value.show',
+ oils_i18n_gettext('ui.patron.edit.au.ident_value.show', 'GUI: Show ident_value field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.ident_value.show', 'The ident_value field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.ident_value.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.ident_value.suggest', 'GUI: Suggest ident_value field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.ident_value.suggest', 'The ident_value field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.ident_value2.show',
+ oils_i18n_gettext('ui.patron.edit.au.ident_value2.show', 'GUI: Show ident_value2 field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.ident_value2.show', 'The ident_value2 field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.ident_value2.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.ident_value2.suggest', 'GUI: Suggest ident_value2 field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.ident_value2.suggest', 'The ident_value2 field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.juvenile.show',
+ oils_i18n_gettext('ui.patron.edit.au.juvenile.show', 'GUI: Show juvenile field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.juvenile.show', 'The juvenile field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.juvenile.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.juvenile.suggest', 'GUI: Suggest juvenile field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.juvenile.suggest', 'The juvenile field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.master_account.show',
+ oils_i18n_gettext('ui.patron.edit.au.master_account.show', 'GUI: Show master_account field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.master_account.show', 'The master_account field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.master_account.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.master_account.suggest', 'GUI: Suggest master_account field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.master_account.suggest', 'The master_account field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.other_phone.example',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.example', 'GUI: Example for other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.example', 'The Example for validation on the other_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.other_phone.regex',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.regex', 'GUI: Regex for other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.regex', 'The Regular Expression for validation on the other_phone field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.au.other_phone.require',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.require', 'GUI: Require other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.require', 'The other_phone field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.other_phone.show',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.show', 'GUI: Show other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.show', 'The other_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.other_phone.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.suggest', 'GUI: Suggest other_phone field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.other_phone.suggest', 'The other_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.second_given_name.show',
+ oils_i18n_gettext('ui.patron.edit.au.second_given_name.show', 'GUI: Show second_given_name field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.second_given_name.show', 'The second_given_name field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.second_given_name.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.second_given_name.suggest', 'GUI: Suggest second_given_name field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.second_given_name.suggest', 'The second_given_name field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.suffix.show',
+ oils_i18n_gettext('ui.patron.edit.au.suffix.show', 'GUI: Show suffix field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.suffix.show', 'The suffix field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.au.suffix.suggest',
+ oils_i18n_gettext('ui.patron.edit.au.suffix.suggest', 'GUI: Suggest suffix field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.au.suffix.suggest', 'The suffix field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.aua.county.require',
+ oils_i18n_gettext('ui.patron.edit.aua.county.require', 'GUI: Require county field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.aua.county.require', 'The county field will be required on the patron registration screen.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.aua.post_code.example',
+ oils_i18n_gettext('ui.patron.edit.aua.post_code.example', 'GUI: Example for post_code field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.aua.post_code.example', 'The Example for validation on the post_code field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.aua.post_code.regex',
+ oils_i18n_gettext('ui.patron.edit.aua.post_code.regex', 'GUI: Regex for post_code field on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.aua.post_code.regex', 'The Regular Expression for validation on the post_code field in patron registration.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.default_suggested',
+ oils_i18n_gettext('ui.patron.edit.default_suggested', 'GUI: Default showing suggested patron registration fields', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.default_suggested', 'Instead of All fields, show just suggested fields in patron registration by default.', 'coust', 'description'),
+ 'bool'),
+( 'ui.patron.edit.phone.example',
+ oils_i18n_gettext('ui.patron.edit.phone.example', 'GUI: Example for phone fields on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.phone.example', 'The Example for validation on phone fields in patron registration. Applies to all phone fields without their own setting.', 'coust', 'description'),
+ 'string'),
+( 'ui.patron.edit.phone.regex',
+ oils_i18n_gettext('ui.patron.edit.phone.regex', 'GUI: Regex for phone fields on patron registration', 'coust', 'label'),
+ oils_i18n_gettext('ui.patron.edit.phone.regex', 'The Regular Expression for validation on phone fields in patron registration. Applies to all phone fields without their own setting.', 'coust', 'description'),
+ 'string');
+
+COMMIT;
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0498'); -- dbs
+
+-- Rather than polluting the public schema with general Evergreen
+-- functions, carve out a dedicated schema
+CREATE SCHEMA evergreen;
+
+-- Replace all uses of PostgreSQL's built-in LOWER() function with
+-- a more locale-savvy PLPERLU evergreen.lowercase() function
+CREATE OR REPLACE FUNCTION evergreen.lowercase( TEXT ) RETURNS TEXT AS $$
+ return lc(shift);
+$$ LANGUAGE PLPERLU STRICT IMMUTABLE;
+
+-- update actor.usr_address indexes
+DROP INDEX IF EXISTS actor.actor_usr_addr_street1_idx;
+DROP INDEX IF EXISTS actor.actor_usr_addr_street2_idx;
+DROP INDEX IF EXISTS actor.actor_usr_addr_city_idx;
+DROP INDEX IF EXISTS actor.actor_usr_addr_state_idx;
+DROP INDEX IF EXISTS actor.actor_usr_addr_post_code_idx;
+
+CREATE INDEX actor_usr_addr_street1_idx ON actor.usr_address (evergreen.lowercase(street1));
+CREATE INDEX actor_usr_addr_street2_idx ON actor.usr_address (evergreen.lowercase(street2));
+CREATE INDEX actor_usr_addr_city_idx ON actor.usr_address (evergreen.lowercase(city));
+CREATE INDEX actor_usr_addr_state_idx ON actor.usr_address (evergreen.lowercase(state));
+CREATE INDEX actor_usr_addr_post_code_idx ON actor.usr_address (evergreen.lowercase(post_code));
+
+-- update actor.usr indexes
+DROP INDEX IF EXISTS actor.actor_usr_first_given_name_idx;
+DROP INDEX IF EXISTS actor.actor_usr_second_given_name_idx;
+DROP INDEX IF EXISTS actor.actor_usr_family_name_idx;
+DROP INDEX IF EXISTS actor.actor_usr_email_idx;
+DROP INDEX IF EXISTS actor.actor_usr_day_phone_idx;
+DROP INDEX IF EXISTS actor.actor_usr_evening_phone_idx;
+DROP INDEX IF EXISTS actor.actor_usr_other_phone_idx;
+DROP INDEX IF EXISTS actor.actor_usr_ident_value_idx;
+DROP INDEX IF EXISTS actor.actor_usr_ident_value2_idx;
+
+CREATE INDEX actor_usr_first_given_name_idx ON actor.usr (evergreen.lowercase(first_given_name));
+CREATE INDEX actor_usr_second_given_name_idx ON actor.usr (evergreen.lowercase(second_given_name));
+CREATE INDEX actor_usr_family_name_idx ON actor.usr (evergreen.lowercase(family_name));
+CREATE INDEX actor_usr_email_idx ON actor.usr (evergreen.lowercase(email));
+CREATE INDEX actor_usr_day_phone_idx ON actor.usr (evergreen.lowercase(day_phone));
+CREATE INDEX actor_usr_evening_phone_idx ON actor.usr (evergreen.lowercase(evening_phone));
+CREATE INDEX actor_usr_other_phone_idx ON actor.usr (evergreen.lowercase(other_phone));
+CREATE INDEX actor_usr_ident_value_idx ON actor.usr (evergreen.lowercase(ident_value));
+CREATE INDEX actor_usr_ident_value2_idx ON actor.usr (evergreen.lowercase(ident_value2));
+
+-- update actor.card indexes
+DROP INDEX IF EXISTS actor.actor_card_barcode_evergreen_lowercase_idx;
+CREATE INDEX actor_card_barcode_evergreen_lowercase_idx ON actor.card (evergreen.lowercase(barcode));
+
+CREATE OR REPLACE FUNCTION vandelay.match_bib_record ( ) RETURNS TRIGGER AS $func$
+DECLARE
+ attr RECORD;
+ attr_def RECORD;
+ eg_rec RECORD;
+ id_value TEXT;
+ exact_id BIGINT;
+BEGIN
+
+ DELETE FROM vandelay.bib_match WHERE queued_record = NEW.id;
+
+ SELECT * INTO attr_def FROM vandelay.bib_attr_definition WHERE xpath = '//*[@tag="901"]/*[@code="c"]' ORDER BY id LIMIT 1;
+
+ IF attr_def IS NOT NULL AND attr_def.id IS NOT NULL THEN
+ id_value := extract_marc_field('vandelay.queued_bib_record', NEW.id, attr_def.xpath, attr_def.remove);
+
+ IF id_value IS NOT NULL AND id_value <> '' AND id_value ~ $r$^\d+$$r$ THEN
+ SELECT id INTO exact_id FROM biblio.record_entry WHERE id = id_value::BIGINT AND NOT deleted;
+ SELECT * INTO attr FROM vandelay.queued_bib_record_attr WHERE record = NEW.id and field = attr_def.id LIMIT 1;
+ IF exact_id IS NOT NULL THEN
+ INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('id', attr.id, NEW.id, exact_id);
+ END IF;
+ END IF;
+ END IF;
+
+ IF exact_id IS NULL THEN
+ FOR attr IN SELECT a.* FROM vandelay.queued_bib_record_attr a JOIN vandelay.bib_attr_definition d ON (d.id = a.field) WHERE record = NEW.id AND d.ident IS TRUE LOOP
+
+ -- All numbers? check for an id match
+ IF (attr.attr_value ~ $r$^\d+$$r$) THEN
+ FOR eg_rec IN SELECT * FROM biblio.record_entry WHERE id = attr.attr_value::BIGINT AND deleted IS FALSE LOOP
+ INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('id', attr.id, NEW.id, eg_rec.id);
+ END LOOP;
+ END IF;
+
+ -- Looks like an ISBN? check for an isbn match
+ IF (attr.attr_value ~* $r$^[0-9x]+$$r$ AND character_length(attr.attr_value) IN (10,13)) THEN
+ FOR eg_rec IN EXECUTE $$SELECT * FROM metabib.full_rec fr WHERE fr.value LIKE evergreen.lowercase('$$ || attr.attr_value || $$%') AND fr.tag = '020' AND fr.subfield = 'a'$$ LOOP
+ PERFORM id FROM biblio.record_entry WHERE id = eg_rec.record AND deleted IS FALSE;
+ IF FOUND THEN
+ INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('isbn', attr.id, NEW.id, eg_rec.record);
+ END IF;
+ END LOOP;
+
+ -- subcheck for isbn-as-tcn
+ FOR eg_rec IN SELECT * FROM biblio.record_entry WHERE tcn_value = 'i' || attr.attr_value AND deleted IS FALSE LOOP
+ INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('tcn_value', attr.id, NEW.id, eg_rec.id);
+ END LOOP;
+ END IF;
+
+ -- check for an OCLC tcn_value match
+ IF (attr.attr_value ~ $r$^o\d+$$r$) THEN
+ FOR eg_rec IN SELECT * FROM biblio.record_entry WHERE tcn_value = regexp_replace(attr.attr_value,'^o','ocm') AND deleted IS FALSE LOOP
+ INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('tcn_value', attr.id, NEW.id, eg_rec.id);
+ END LOOP;
+ END IF;
+
+ -- check for a direct tcn_value match
+ FOR eg_rec IN SELECT * FROM biblio.record_entry WHERE tcn_value = attr.attr_value AND deleted IS FALSE LOOP
+ INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('tcn_value', attr.id, NEW.id, eg_rec.id);
+ END LOOP;
+
+ -- check for a direct item barcode match
+ FOR eg_rec IN
+ SELECT DISTINCT b.*
+ FROM biblio.record_entry b
+ JOIN asset.call_number cn ON (cn.record = b.id)
+ JOIN asset.copy cp ON (cp.call_number = cn.id)
+ WHERE cp.barcode = attr.attr_value AND cp.deleted IS FALSE
+ LOOP
+ INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('id', attr.id, NEW.id, eg_rec.id);
+ END LOOP;
+
+ END LOOP;
+ END IF;
+
+ RETURN NULL;
+END;
+$func$ LANGUAGE PLPGSQL;
+
+
+COMMIT;
.dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
-.hide-non-required tr:not([required]) {
+.hide-non-required tr:not([required]), .hide-non-required tr[required=suggested] {
+ visibility:hidden;
+ display:none;
+}
+
+.hide-non-suggested tr:not([required]) {
visibility:hidden;
display:none;
}
*/
if(!dojo._hasResource["fieldmapper.Fieldmapper"]){
- dojo._hasResource["fieldmapper.Fieldmapper"] = true;
+ dojo._hasResource["fieldmapper.Fieldmapper"] = true;
- dojo.provide("fieldmapper.Fieldmapper");
- dojo.require("DojoSRF");
+ dojo.provide("fieldmapper.Fieldmapper");
+ dojo.require("DojoSRF");
/* generate fieldmapper javascript classes. This expects a global variable
- called 'fmclasses' to be fleshed with the classes we need to build */
-
- function FMEX(message) { this.message = message; }
- FMEX.toString = function() { return "FieldmapperException: " + this.message + "\n"; }
-
- dojo.declare( "fieldmapper.Fieldmapper", null, {
-
- constructor : function (initArray) {
- if (initArray) {
- if (dojo.isArray(initArray)) {
- this.a = initArray;
- } else {
- this.a = [];
- }
- }
- },
-
- _isfieldmapper : true,
-
- clone : function() {
- var obj = new this.constructor();
-
- for( var i in this.a ) {
- var thing = this.a[i];
- if(thing == null) continue;
-
- if( thing._isfieldmapper ) {
- obj.a[i] = thing.clone();
- } else {
-
- if(dojo.isArray(thing)) {
- obj.a[i] = new Array();
-
- for( var j in thing ) {
-
- if( thing[j]._isfieldmapper )
- obj.a[i][j] = thing[j].clone();
- else
- obj.a[i][j] = thing[j];
- }
- } else {
- obj.a[i] = thing;
- }
- }
- }
- return obj;
- },
+ called 'fmclasses' to be fleshed with the classes we need to build */
+
+ function FMEX(message) { this.message = message; }
+ FMEX.toString = function() { return "FieldmapperException: " + this.message + "\n"; };
+
+ dojo.declare( "fieldmapper.Fieldmapper", null, {
+
+ constructor : function (initArray) {
+ if (initArray) {
+ if (dojo.isArray(initArray)) {
+ this.a = initArray;
+ } else {
+ this.a = [];
+ }
+ }
+ },
+
+ _isfieldmapper : true,
+
+ clone : function() {
+ var obj = new this.constructor();
+
+ for( var i in this.a ) {
+ var thing = this.a[i];
+ if(thing === null) continue;
+
+ if( thing._isfieldmapper ) {
+ obj.a[i] = thing.clone();
+ } else {
+
+ if(dojo.isArray(thing)) {
+ obj.a[i] = [];
+
+ for( var j in thing ) {
+
+ if( thing[j]._isfieldmapper )
+ obj.a[i][j] = thing[j].clone();
+ else
+ obj.a[i][j] = thing[j];
+ }
+ } else {
+ obj.a[i] = thing;
+ }
+ }
+ }
+ return obj;
+ },
RequiredField : function (f) {
if (!f) return;
return;
}
- });
+ });
fieldmapper.vivicateClass = function (cl) {
- dojo.provide( cl );
- dojo.declare( cl , fieldmapper.Fieldmapper, {
- constructor : function () {
- if (!this.a) this.a = [];
- this.classname = this.declaredClass;
+ dojo.provide( cl );
+ dojo.declare( cl , fieldmapper.Fieldmapper, {
+ constructor : function () {
+ if (!this.a) this.a = [];
+ this.classname = this.declaredClass;
this._fields = [];
+ var p, f;
if (fieldmapper.IDL && fieldmapper.IDL.loaded) {
- this.Structure = fieldmapper.IDL.fmclasses[this.classname]
+ this.Structure = fieldmapper.IDL.fmclasses[this.classname];
- for (var f in fieldmapper.IDL.fmclasses[this.classname].fields) {
+ for (f in fieldmapper.IDL.fmclasses[this.classname].fields) {
var field = fieldmapper.IDL.fmclasses[this.classname].fields[f];
- var p = field.array_position;
- this._fields.push( field.name );
- this[field.name]=new Function('n', 'if(arguments.length==1)this.a['+p+']=n;return this.a['+p+'];');
+ p = field.array_position;
+ this._fields.push( field.name );
+ this[field.name]=new Function('n', 'if(arguments.length==1)this.a['+p+']=n;return this.a['+p+'];');
}
} else {
- this._fields = fmclasses[this.classname];
+ this._fields = fmclasses[this.classname];
- for( var pos = 0; pos < this._fields.length; pos++ ) {
- var p = parseInt(pos);
- var f = this._fields[pos];
- this[f]=new Function('n', 'if(arguments.length==1)this.a['+p+']=n;return this.a['+p+'];');
- }
+ for( var pos = 0; pos < this._fields.length; pos++ ) {
+ p = parseInt(pos, 10);
+ f = this._fields[pos];
+ this[f]=new Function('n', 'if(arguments.length==1)this.a['+p+']=n;return this.a['+p+'];');
+ }
}
- }
- });
+ }
+ });
- fieldmapper[cl] = window[cl]; // alias into place
+ fieldmapper[cl] = window[cl]; // alias into place
if (fieldmapper.IDL && fieldmapper.IDL.loaded)
fieldmapper[cl].Identifier = fieldmapper.IDL.fmclasses[cl].pkey;
fieldmapper[cl].prototype.fromStoreItem = _fromStoreItem;
fieldmapper[cl].toStoreData = _toStoreData;
fieldmapper[cl].toStoreItem = _toStoreItem;
- fieldmapper[cl].prototype.toStoreItem = function ( args ) { return _toStoreItem(this, args) };
+ fieldmapper[cl].prototype.toStoreItem = function ( args ) { return _toStoreItem(this, args); };
fieldmapper[cl].initStoreData = _initStoreData;
fieldmapper[cl].prototype.toHash = _toHash;
fieldmapper[cl].toHash = _toHash;
fieldmapper[cl].fromHash = _fromHash;
};
- fieldmapper._request = function ( meth, staff, params ) {
- var ses = OpenSRF.CachedClientSession( meth[0] );
- if (!ses) return null;
+ fieldmapper._request = function ( meth, staff, params ) {
+ var ses = OpenSRF.CachedClientSession( meth[0] );
+ if (!ses) return null;
- var result = null;
- var args = {};
+ var result = null;
+ var args = {};
- if (dojo.isArray(params)) {
- args.params = params;
- } else {
+ if (dojo.isArray(params)) {
+ args.params = params;
+ } else {
- if (dojo.isObject(params)) {
- args = params;
- } else {
+ if (dojo.isObject(params)) {
+ args = params;
+ } else {
args.params = [].splice.call(arguments, 2, arguments.length - 2);
- }
+ }
- }
+ }
if (!args.async && !args.timeout) args.timeout = 10;
if(!args.onmethoderror) {
args.onmethoderror = function(r, stat, stat_text) {
throw new Error('Method error: ' + r.stat + ' : ' + stat_text);
+ };
}
- }
if(!args.ontransporterror) {
args.ontransporterror = function(xreq) {
throw new Error('Transport error method='+args.method+', status=' + xreq.status);
+ };
}
- }
- if (!args.onerror) {
- args.onerror = function (r) {
- throw new Error('Request error encountered! ' + r);
- }
- }
+ if (!args.onerror) {
+ args.onerror = function (r) {
+ throw new Error('Request error encountered! ' + r);
+ };
+ }
- if (!args.oncomplete) {
- args.oncomplete = function (r) {
- var x = r.recv();
- if (x) result = x.content();
- }
- }
+ if (!args.oncomplete) {
+ args.oncomplete = function (r) {
+ var x = r.recv();
+ if (x) result = x.content();
+ };
+ }
- args.method = meth[1];
- if (staff && meth[2]) args.method += '.staff';
+ args.method = meth[1];
+ if (staff && meth[2]) args.method += '.staff';
- ses.request(args).send();
+ ses.request(args).send();
- return result;
- };
+ return result;
+ };
- fieldmapper.standardRequest = function (meth, params) { return fieldmapper._request(meth, false, params) };
- fieldmapper.Fieldmapper.prototype.standardRequest = fieldmapper.standardRequest;
+ fieldmapper.standardRequest = function (meth, params) { return fieldmapper._request(meth, false, params); };
+ fieldmapper.Fieldmapper.prototype.standardRequest = fieldmapper.standardRequest;
- fieldmapper.staffRequest = function (meth, params) { return fieldmapper._request(meth, true, params) };
- fieldmapper.Fieldmapper.prototype.staffRequest = fieldmapper.staffRequest;
+ fieldmapper.staffRequest = function (meth, params) { return fieldmapper._request(meth, true, params); };
+ fieldmapper.Fieldmapper.prototype.staffRequest = fieldmapper.staffRequest;
- fieldmapper.OpenSRF = {};
+ fieldmapper.OpenSRF = {};
- /* Methods are defined as [ service, method, have_staff ]
- An optional 3rd component is when a method is followed by true, such methods
- have a staff counterpart and should have ".staff" appended to the method
- before the method is called when in XUL mode */
- fieldmapper.OpenSRF.methods = {
- FETCH_ORG_BY_SHORTNAME : ['open-ils.actor','open-ils.actor.org_unit.retrieve_by_shortname'],
- FETCH_ORG_SETTING : ['open-ils.actor','open-ils.actor.ou_setting.ancestor_default'],
- FETCH_ORG_SETTING_BATCH : ['open-ils.actor','open-ils.actor.ou_setting.ancestor_default.batch']
- };
+ /* Methods are defined as [ service, method, have_staff ]
+ An optional 3rd component is when a method is followed by true, such methods
+ have a staff counterpart and should have ".staff" appended to the method
+ before the method is called when in XUL mode */
+ fieldmapper.OpenSRF.methods = {
+ FETCH_ORG_BY_SHORTNAME : ['open-ils.actor','open-ils.actor.org_unit.retrieve_by_shortname'],
+ FETCH_ORG_SETTING : ['open-ils.actor','open-ils.actor.ou_setting.ancestor_default'],
+ FETCH_ORG_SETTING_BATCH : ['open-ils.actor','open-ils.actor.ou_setting.ancestor_default.batch']
+ };
//** FROM HASH **/
- function _fromHash (_hash) {
- for ( var i=0; i < this._fields.length; i++) {
- if (_hash[this._fields[i]] != null)
- this[this._fields[i]]( _hash[this._fields[i]] );
- }
- return this;
- }
-
- function _toHash (includeNulls, virtFields) {
- var _hash = {};
- for ( var i=0; i < this._fields.length; i++) {
- if (includeNulls || this[this._fields[i]]() != null) {
- if (this[this._fields[i]]() == null)
+ function _fromHash (_hash) {
+ for ( var i=0; i < this._fields.length; i++) {
+ if (_hash[this._fields[i]] !== null)
+ this[this._fields[i]]( _hash[this._fields[i]] );
+ }
+ return this;
+ }
+
+ function _toHash (includeNulls, virtFields) {
+ var _hash = {};
+ var i;
+ for (i=0; i < this._fields.length; i++) {
+ if (includeNulls || this[this._fields[i]]() !== null) {
+ if (this[this._fields[i]]() === null)
_hash[this._fields[i]] = null;
else
- _hash[this._fields[i]] = '' + this[this._fields[i]]();
+ _hash[this._fields[i]] = '' + this[this._fields[i]]();
}
- }
+ }
- if (virtFields && virtFields.length > 0) {
- for (var i = 0; i < virtFields.length; i++) {
- if (!_hash[virtFields[i]])
- _hash[virtFields[i]] = null;
- }
- }
+ if (virtFields && virtFields.length > 0) {
+ for (i = 0; i < virtFields.length; i++) {
+ if (!_hash[virtFields[i]])
+ _hash[virtFields[i]] = null;
+ }
+ }
- return _hash;
- }
+ return _hash;
+ }
//** FROM HASH **/
/** FROM dojoData **/
- function _fromStoreItem (data) {
- this.fromHash(data);
+ function _fromStoreItem (data) {
+ this.fromHash(data);
- for (var i = 0; this._ignore_fields && i < this._ignore_fields.length; i++)
- this[this._ignore_fields[i]](null);
+ var i;
+ for (i = 0; this._ignore_fields && i < this._ignore_fields.length; i++)
+ this[this._ignore_fields[i]](null);
- for (var i = 0; this._fields && i < this._fields.length; i++) {
- if (dojo.isArray( this[this._fields[i]]() ))
- this[this._fields[i]]( this[this._fields[i]]()[0] );
- }
- return this;
- }
+ for (i = 0; this._fields && i < this._fields.length; i++) {
+ if (dojo.isArray( this[this._fields[i]]() ))
+ this[this._fields[i]]( this[this._fields[i]]()[0] );
+ }
+ return this;
+ }
function _initStoreData(label, params) {
- if (!params) params = {};
- if (!params.identifier) params.identifier = this.Identifier;
- if (!label) label = params.label;
- if (!label) label = params.identifier;
- return { label : label, identifier : params.identifier, items : [] };
+ if (!params) params = {};
+ if (!params.identifier) params.identifier = this.Identifier;
+ if (!label) label = params.label;
+ if (!label) label = params.identifier;
+ return { label : label, identifier : params.identifier, items : [] };
}
function _toStoreItem(fmObj, params) {
- if (!params) params = {};
+ if (!params) params = {};
return fmObj.toHash(true, params.virtualFields);
}
- function _toStoreData (list, label, params) {
- if (!params) params = {};
+ function _toStoreData (list, label, params) {
+ if (!params) params = {};
var data = this.initStoreData(label, params);
- for (var i = 0; list && i < list.length; i++) data.items.push( list[i].toHash(true, params.virtualFields) );
-
- if (params.children && params.parent) {
- var _hash_list = data.items;
+ var i, j;
+ for (i = 0; list && i < list.length; i++) data.items.push( list[i].toHash(true, params.virtualFields) );
- var _find_root = {};
- for (var i = 0; _hash_list && i < _hash_list.length; i++) {
- _find_root[_hash_list[i][params.identifier]] = _hash_list[i];
- }
+ if (params.children && params.parent) {
+ var _hash_list = data.items;
- var item_data = [];
- for (var i = 0; _hash_list && i < _hash_list.length; i++) {
- var obj = _hash_list[i]
- obj[params.children] = [];
+ var _find_root = {};
+ for (i = 0; _hash_list && i < _hash_list.length; i++) {
+ _find_root[_hash_list[i][params.identifier]] = _hash_list[i];
+ }
- for (var j = 0; _hash_list && j < _hash_list.length; j++) {
- var kid = _hash_list[j];
- if (kid[params.parent] == obj[params.identifier]) {
- obj[params.children].push( { _reference : kid[params.identifier] } );
- kid._iskid = true;
- if (_find_root[kid[params.identifier]]) delete _find_root[kid[params.identifier]];
- }
- }
+ var item_data = [];
+ for (i = 0; _hash_list && i < _hash_list.length; i++) {
+ var obj = _hash_list[i];
+ obj[params.children] = [];
+
+ for (j = 0; _hash_list && j < _hash_list.length; j++) {
+ var kid = _hash_list[j];
+ if (kid[params.parent] == obj[params.identifier]) {
+ obj[params.children].push( { _reference : kid[params.identifier] } );
+ kid._iskid = true;
+ if (_find_root[kid[params.identifier]]) delete _find_root[kid[params.identifier]];
+ }
+ }
- item_data.push( obj );
- }
+ item_data.push( obj );
+ }
- for (var j in _find_root) {
- _find_root[j]['_top'] = 'true';
- if (!_find_root[j][params.parent])
- _find_root[j]['_trueRoot'] = 'true';
- }
+ for (j in _find_root) {
+ _find_root[j]['_top'] = 'true';
+ if (!_find_root[j][params.parent])
+ _find_root[j]['_trueRoot'] = 'true';
+ }
- data.items = item_data;
- }
+ data.items = item_data;
+ }
- return data;
- }
+ return data;
+ }
/** FROM dojoData **/
/** FROM dojoData **/
/* set up some known class attributes */
- if (fieldmapper.aou) fieldmapper.aou.prototype._ignore_fields = ['children'];
- if (fieldmapper.aout) fieldmapper.aout.prototype._ignore_fields = ['children'];
- if (fieldmapper.pgt) fieldmapper.pgt.prototype._ignore_fields = ['children'];
-
- fieldmapper.aou.toStoreData = function (list, label) {
- if (!label) label = 'shortname';
- return _toStoreData.call(this, list, label, { 'parent' : 'parent_ou', 'children' : 'children' });
- }
-
- fieldmapper.aout.toStoreData = function (list, label) {
- if (!label) label = 'name';
- return _toStoreData.call(this, list, label, { 'parent' : 'parent', 'children' : 'children' });
- }
-
- fieldmapper.pgt.toStoreData = function (list, label) {
- if (!label) label = 'name';
- return _toStoreData.call(this, list, label, { 'parent' : 'parent', 'children' : 'children' });
- }
+ if (fieldmapper.aou) fieldmapper.aou.prototype._ignore_fields = ['children'];
+ if (fieldmapper.aout) fieldmapper.aout.prototype._ignore_fields = ['children'];
+ if (fieldmapper.pgt) fieldmapper.pgt.prototype._ignore_fields = ['children'];
+
+ fieldmapper.aou.toStoreData = function (list, label) {
+ if (!label) label = 'shortname';
+ return _toStoreData.call(this, list, label, { 'parent' : 'parent_ou', 'children' : 'children' });
+ };
+
+ fieldmapper.aout.toStoreData = function (list, label) {
+ if (!label) label = 'name';
+ return _toStoreData.call(this, list, label, { 'parent' : 'parent', 'children' : 'children' });
+ };
+
+ fieldmapper.pgt.toStoreData = function (list, label) {
+ if (!label) label = 'name';
+ return _toStoreData.call(this, list, label, { 'parent' : 'parent', 'children' : 'children' });
+ };
/** FROM dojoData **/
fieldmapper.IDL.fmclasses[c] = window._preload_fieldmapper_IDL[c];
window.fmclasses[c] = [];
- dojo.forEach(fieldmapper.IDL.fmclasses[c].fields, function(obj){ window.fmclasses[c].push(obj.name) });
+ dojo.forEach(fieldmapper.IDL.fmclasses[c].fields, function(obj){ window.fmclasses[c].push(obj.name); });
if (classlist && classlist.length)
classlist = dojo.filter(classlist, function(x){return x != c;});
var obj = {
field : field,
- name : name,
+ name : name,
label : fieldmapper._getAttributeNS(field,this.NS_REPORTS,'label'),
datatype : fieldmapper._getAttributeNS(field,this.NS_REPORTS,'datatype'),
primitive : fieldmapper._getAttributeNS(field,this.NS_PERSIST,'primitive'),
selector : fieldmapper._getAttributeNS(field,this.NS_REPORTS,'selector'),
array_position : position++,
- type : 'field',
+ type : 'field',
virtual : (fieldmapper._getAttributeNS(fields[i],this.NS_PERSIST, 'virtual') == 'true'),
required : (fieldmapper._getAttributeNS(fields[i],this.NS_OBJ, 'required') == 'true'),
i18n : (fieldmapper._getAttributeNS(fields[i],this.NS_PERSIST, 'i18n') == 'true')
};
window.fmclasses = {};
- fieldmapper.IDL.load = function (list) { if (!list) list = []; return new fieldmapper.IDL(list); };
+ fieldmapper.IDL.load = function (list) {
+ if (!list) list = [];
+ return new fieldmapper.IDL(list);
+ };
fieldmapper.IDL.loaded = false;
JSON2js.fallbackObjectifier = function (arg, key_name, val_name) {
console.log("Firing IDL loader for " + arg[key_name]);
fieldmapper.IDL.load([arg[key_name]]);
return decodeJS(arg);
- }
+ };
}
if(!dojo._hasResource["fieldmapper.OrgUtils"]){
- dojo._hasResource["fieldmapper.OrgUtils"] = true;
- dojo.provide("fieldmapper.OrgUtils");
- dojo.require("fieldmapper.Fieldmapper");
- dojo.require("fieldmapper.OrgTree", true);
- dojo.require("fieldmapper.OrgLasso", true);
-
- fieldmapper.aou.slim_ok = true;
- fieldmapper.aou.globalOrgTree = {};
- fieldmapper.aou.OrgCache = {};
- fieldmapper.aou.OrgCacheSN = {};
- fieldmapper.aout.OrgTypeCache = {};
-
- fieldmapper.aout.LoadOrgTypes = function () {
- for (var i in fieldmapper.aout.OrgTypeCache) {
- return;
- }
-
- var types = fieldmapper.standardRequest(['open-ils.actor','open-ils.actor.org_types.retrieve']);
-
- for (var i = 0; i < types.length; i++) {
- fieldmapper.aout.OrgTypeCache[types[i].id()] = {
- loaded : true,
- type : types[i]
- };
- }
- }
-
- fieldmapper.aou.LoadOrg = function (id, slim_ok) {
- if (slim_ok == null) slim_ok = fieldmapper.aou.slim_ok;
- var slim_o = fieldmapper.aou.OrgCache[id];
-
- if (slim_o && (slim_ok || slim_o.loaded))
- return fieldmapper.aou.OrgCache[id].org;
-
- var o = fieldmapper.standardRequest(['open-ils.actor','open-ils.actor.org_unit.retrieve'],[null,id]);
+ dojo._hasResource["fieldmapper.OrgUtils"] = true;
+ dojo.provide("fieldmapper.OrgUtils");
+ dojo.require("fieldmapper.Fieldmapper");
+ dojo.require("fieldmapper.OrgTree", true);
+ dojo.require("fieldmapper.OrgLasso", true);
+
+ fieldmapper.aou.slim_ok = true;
+ fieldmapper.aou.globalOrgTree = {};
+ fieldmapper.aou.OrgCache = {};
+ fieldmapper.aou.OrgCacheSN = {};
+ fieldmapper.aout.OrgTypeCache = {};
+
+ fieldmapper.aout.LoadOrgTypes = function () {
+ var i;
+ for (i in fieldmapper.aout.OrgTypeCache) {
+ return;
+ }
+
+ var types = fieldmapper.standardRequest(['open-ils.actor','open-ils.actor.org_types.retrieve']);
+
+ for (i = 0; i < types.length; i++) {
+ fieldmapper.aout.OrgTypeCache[types[i].id()] = {
+ loaded : true,
+ type : types[i]
+ };
+ }
+ };
+
+ fieldmapper.aou.LoadOrg = function (id, slim_ok) {
+ if (slim_ok === null) slim_ok = fieldmapper.aou.slim_ok;
+ var slim_o = fieldmapper.aou.OrgCache[id];
+
+ if (slim_o && (slim_ok || slim_o.loaded))
+ return fieldmapper.aou.OrgCache[id].org;
+
+ var o = fieldmapper.standardRequest(['open-ils.actor','open-ils.actor.org_unit.retrieve'],[null,id]);
if(!(o && o.id)) {
throw new Error("fieldmapper.aou.LoadOrg(): No org unit found with ID " + id);
}
- o.children = fieldmapper.aou.OrgCache[o.id()].children;
- fieldmapper.aou.OrgCache[o.id()] = { loaded : true, org : o };
- return o;
- }
- fieldmapper.aou.findOrgUnit = fieldmapper.aou.LoadOrg;
-
- if (window._l) {
- for (var i = 0; i < _l.length; i++) {
- fieldmapper.aou.OrgCache[_l[i][0]] = {
- loaded: false,
- org : new fieldmapper.aou().fromHash({
- id : _l[i][0],
- ou_type : _l[i][1],
- parent_ou : _l[i][2],
- name : _l[i][3],
- opac_visible : _l[i][4],
- shortname : _l[i][5]
- })
- };
-
- }
-
- for (var i in fieldmapper.aou.OrgCache) {
- var x = fieldmapper.aou.OrgCache[i].org;
- if (x.parent_ou() == null || x.parent_ou() == '') {
- fieldmapper.aou.globalOrgTree = x;
- continue;
- }
-
- var par = fieldmapper.aou.findOrgUnit(x.parent_ou(),true);
- if (!par.children()) par.children([]);
- par.children().push(x);
- fieldmapper.aou.OrgCache[x.id()].treePtr = x;
- }
-
- for (var i = 0; i < globalOrgTypes.length; i++) {
- fieldmapper.aout.OrgTypeCache[globalOrgTypes[i].id()] = {
- loaded : true,
- type : globalOrgTypes[i]
- };
- }
- }
+ o.children = fieldmapper.aou.OrgCache[o.id()].children;
+ fieldmapper.aou.OrgCache[o.id()] = { loaded : true, org : o };
+ return o;
+ };
+ fieldmapper.aou.findOrgUnit = fieldmapper.aou.LoadOrg;
+
+ if (window._l) {
+ for (var i = 0; i < _l.length; i++) {
+ fieldmapper.aou.OrgCache[_l[i][0]] = {
+ loaded: false,
+ org : new fieldmapper.aou().fromHash({
+ id : _l[i][0],
+ ou_type : _l[i][1],
+ parent_ou : _l[i][2],
+ name : _l[i][3],
+ opac_visible : _l[i][4],
+ shortname : _l[i][5]
+ })
+ };
+
+ }
+
+ for (var i in fieldmapper.aou.OrgCache) {
+ var x = fieldmapper.aou.OrgCache[i].org;
+ if (x.parent_ou() === null || x.parent_ou() === '') {
+ fieldmapper.aou.globalOrgTree = x;
+ continue;
+ }
+
+ var par = fieldmapper.aou.findOrgUnit(x.parent_ou(),true);
+ if (!par.children()) par.children([]);
+ par.children().push(x);
+ fieldmapper.aou.OrgCache[x.id()].treePtr = x;
+ }
+
+ for (var i = 0; i < globalOrgTypes.length; i++) {
+ fieldmapper.aout.OrgTypeCache[globalOrgTypes[i].id()] = {
+ loaded : true,
+ type : globalOrgTypes[i]
+ };
+ }
+ }
/* ---------------------------------------------------------------------- */
- fieldmapper.aou.prototype.fetchOrgSettingDefault = function (name) {
- return this.standardRequest( fieldmapper.OpenSRF.methods.FETCH_ORG_SETTING, [this.id(), name] );
- }
-
- fieldmapper.aou.prototype.fetchOrgSettingBatch = function (nameList) {
- return this.standardRequest( fieldmapper.OpenSRF.methods.FETCH_ORG_SETTING_BATCH, [this.id(), nameList] );
- }
-
- fieldmapper.aou.fetchOrgSettingDefault = function (orgId, name) {
- return fieldmapper.standardRequest( fieldmapper.OpenSRF.methods.FETCH_ORG_SETTING, [orgId, name] );
- }
-
- fieldmapper.aou.fetchOrgSettingBatch = function (orgId, nameList) {
- return fieldmapper.standardRequest( fieldmapper.OpenSRF.methods.FETCH_ORG_SETTING_BATCH, [orgId, nameList] );
- }
-
- fieldmapper.aout.findOrgType = function (id) {
- fieldmapper.aout.LoadOrgTypes();
- return fieldmapper.aout.OrgTypeCache[id].type;
- }
-
- fieldmapper.aou.prototype.findOrgDepth = function (id) {
- if (!id) id = this.id;
- if (!id) return null;
-
- var org = fieldmapper.aou.findOrgUnit(id);
- return fieldmapper.aout.findOrgType(
- fieldmapper.aou.findOrgUnit(id).ou_type()
- ).depth();
- }
- fieldmapper.aou.findOrgDepth = fieldmapper.aou.prototype.findOrgDepth;
-
- fieldmapper.aout.findOrgTypeFromDepth = function (depth) {
- if( depth == null ) return null;
- fieldmapper.aout.LoadOrgTypes();
- for( var i in fieldmapper.aout.OrgTypeCache ) {
- var t = fieldmapper.aout.OrgTypeCache[i].type;
- if( t.depth() == depth ) return t;
- }
- return null;
- }
-
- fieldmapper.aou.findOrgUnitSN = function (sn, slim_ok) {
- if (slim_ok == null) slim_ok = fieldmapper.aou.slim_ok;
- var org = fieldmapper.aou.OrgCacheSN[sn];
- if (!org) {
- for (var i in fieldmapper.aou.OrgCache) {
- var o = fieldmapper.aou.OrgCache[i];
- if (o.org.shortname() == sn) {
- fieldmapper.aou.OrgCacheSN[o.org.shortname()] = o;
- org = o;
- }
- }
-
- if (!slim_ok && !fieldmapper.aou.OrgCache[org.id()].loaded) {
- org = fieldmapper.standardRequest(fieldmapper.OpenSRF.methods.FETCH_ORG_BY_SHORTNAME, sn);
-
- org.children = fieldmapper.aou.OrgCache[org.id()].children;
- fieldmapper.aou.OrgCache[org.id()] = { loaded : true, org : org };
- fieldmapper.aou.OrgCacheSN[org.shortname()] = { loaded : true, org : org };
- }
-
- }
-
- return org;
- }
-
- fieldmapper.aou.prototype.orgNodeTrail = function(node, asId) {
- if (!node) node = this;
- if (!node) return [];
-
- var na = [];
-
- while( node ) {
- na.push(node);
- if (node.parent_ou())
- node = fieldmapper.aou.findOrgUnit(node.parent_ou());
- else
- node = null;
- }
-
- na.reverse();
- if (asId) return na.map(function(o) { return o.id(); });
- else return na;
- }
- fieldmapper.aou.orgNodeTrail = fieldmapper.aou.prototype.orgNodeTrail;
-
- fieldmapper.aou.prototype.orgIsMine = function (me, org) {
- if (this._isfieldmapper) {
- org = me;
- me = this;
- }
-
- if(!me || !org) return false;
-
- if(me.id() == org.id()) return true;
-
- for( var i in me.children() ) {
- if(me.children()[i].orgIsMine(org)) return true;
- }
- return false;
- }
+ fieldmapper.aou.prototype.fetchOrgSettingDefault = function (name) {
+ return this.standardRequest( fieldmapper.OpenSRF.methods.FETCH_ORG_SETTING, [this.id(), name] );
+ };
+
+ fieldmapper.aou.prototype.fetchOrgSettingBatch = function (nameList) {
+ return this.standardRequest( fieldmapper.OpenSRF.methods.FETCH_ORG_SETTING_BATCH, [this.id(), nameList] );
+ };
+
+ fieldmapper.aou.fetchOrgSettingDefault = function (orgId, name) {
+ return fieldmapper.standardRequest( fieldmapper.OpenSRF.methods.FETCH_ORG_SETTING, [orgId, name] );
+ };
+
+ fieldmapper.aou.fetchOrgSettingBatch = function (orgId, nameList) {
+ return fieldmapper.standardRequest( fieldmapper.OpenSRF.methods.FETCH_ORG_SETTING_BATCH, [orgId, nameList] );
+ };
+
+ fieldmapper.aout.findOrgType = function (id) {
+ fieldmapper.aout.LoadOrgTypes();
+ return fieldmapper.aout.OrgTypeCache[id].type;
+ };
+
+ fieldmapper.aou.prototype.findOrgDepth = function (id) {
+ if (!id) id = this.id;
+ if (!id) return null;
+
+ var org = fieldmapper.aou.findOrgUnit(id);
+ return fieldmapper.aout.findOrgType(
+ fieldmapper.aou.findOrgUnit(id).ou_type()
+ ).depth();
+ };
+ fieldmapper.aou.findOrgDepth = fieldmapper.aou.prototype.findOrgDepth;
+
+ fieldmapper.aout.findOrgTypeFromDepth = function (depth) {
+ if( depth === null ) return null;
+ fieldmapper.aout.LoadOrgTypes();
+ for( var i in fieldmapper.aout.OrgTypeCache ) {
+ var t = fieldmapper.aout.OrgTypeCache[i].type;
+ if( t.depth() == depth ) return t;
+ }
+ return null;
+ };
+
+ fieldmapper.aou.findOrgUnitSN = function (sn, slim_ok) {
+ if (slim_ok === null) slim_ok = fieldmapper.aou.slim_ok;
+ var org = fieldmapper.aou.OrgCacheSN[sn];
+ if (!org) {
+ for (var i in fieldmapper.aou.OrgCache) {
+ var o = fieldmapper.aou.OrgCache[i];
+ if (o.org.shortname() == sn) {
+ fieldmapper.aou.OrgCacheSN[o.org.shortname()] = o;
+ org = o;
+ }
+ }
+
+ if (!slim_ok && !fieldmapper.aou.OrgCache[org.id()].loaded) {
+ org = fieldmapper.standardRequest(fieldmapper.OpenSRF.methods.FETCH_ORG_BY_SHORTNAME, sn);
+
+ org.children = fieldmapper.aou.OrgCache[org.id()].children;
+ fieldmapper.aou.OrgCache[org.id()] = { loaded : true, org : org };
+ fieldmapper.aou.OrgCacheSN[org.shortname()] = { loaded : true, org : org };
+ }
+
+ }
+
+ return org;
+ };
+
+ fieldmapper.aou.prototype.orgNodeTrail = function(node, asId) {
+ if (!node) node = this;
+ if (!node) return [];
+
+ var na = [];
+
+ while( node ) {
+ na.push(node);
+ if (node.parent_ou())
+ node = fieldmapper.aou.findOrgUnit(node.parent_ou());
+ else
+ node = null;
+ }
+
+ na.reverse();
+ if (asId) return na.map(function(o) { return o.id(); });
+ else return na;
+ };
+ fieldmapper.aou.orgNodeTrail = fieldmapper.aou.prototype.orgNodeTrail;
+
+ fieldmapper.aou.prototype.orgIsMine = function (me, org) {
+ if (this._isfieldmapper) {
+ org = me;
+ me = this;
+ }
+
+ if(!me || !org) return false;
+
+ if(me.id() == org.id()) return true;
+
+ for( var i in me.children() ) {
+ if(me.children()[i].orgIsMine(org)) return true;
+ }
+ return false;
+ };
/** Given an org id, returns an array of org units including
* the org for the ID provided and all descendant orgs */
}
addNode(fieldmapper.aou.findOrgUnit(orgId));
return list;
- }
+ };
fieldmapper.aou.fullPath = function(orgId, asId) {
var orgList = fieldmapper.aou.orgNodeTrail(fieldmapper.aou.findOrgUnit(orgId));
orgList.pop(); // prevent dupes
- orgList = orgList.concat(fieldmapper.aou.descendantNodeList(orgId))
+ orgList = orgList.concat(fieldmapper.aou.descendantNodeList(orgId));
if(!asId) return orgList;
return orgList.map( function(node) { return node.id(); } );
- }
+ };
- dojo.addOnUnload( function () {
- for (var i in fieldmapper.aou.OrgCache) {
- x=fieldmapper.aou.OrgCache[i].treePtr;
- if (!x) continue;
-
- x.children(null);
- x.parent_ou(null);
- fieldmapper.aou.OrgCache[i]=null;
- }
- fieldmapper.aou.globalOrgTree = null;
- fieldmapper.aou.OrgCache = null;
- fieldmapper.aou.OrgCacheSN = null;
- fieldmapper.aout.OrgTypeCache = null;
- });
+ dojo.addOnUnload( function () {
+ for (var i in fieldmapper.aou.OrgCache) {
+ x=fieldmapper.aou.OrgCache[i].treePtr;
+ if (!x) continue;
+
+ x.children(null);
+ x.parent_ou(null);
+ fieldmapper.aou.OrgCache[i]=null;
+ }
+ fieldmapper.aou.globalOrgTree = null;
+ fieldmapper.aou.OrgCache = null;
+ fieldmapper.aou.OrgCacheSN = null;
+ fieldmapper.aout.OrgTypeCache = null;
+ });
}
function _fromStoreItem (data) {
this.fromHash(data);
- for (var i = 0; this._ignore_fields && i < this._ignore_fields.length; i++)
+ var i;
+ for (i = 0; this._ignore_fields && i < this._ignore_fields.length; i++)
this[this._ignore_fields[i]](null);
- for (var i = 0; this._fields && i < this._fields.length; i++) {
+ for (i = 0; this._fields && i < this._fields.length; i++) {
if (dojo.isArray( this[this._fields[i]]() ))
this[this._fields[i]]( this[this._fields[i]]()[0] );
}
if (!params) params = {};
var data = this.initStoreData(label, params);
- for (var i = 0; list && i < list.length; i++) data.items.push( list[i].toHash(true, params.virtualFields) );
+ var i, j;
+ for (i = 0; list && i < list.length; i++) data.items.push( list[i].toHash(true, params.virtualFields) );
if (params.children && params.parent) {
var _hash_list = data.items;
var _find_root = {};
- for (var i = 0; _hash_list && i < _hash_list.length; i++) {
+ for (i = 0; _hash_list && i < _hash_list.length; i++) {
_find_root[_hash_list[i][params.identifier]] = _hash_list[i];
}
var item_data = [];
- for (var i = 0; _hash_list && i < _hash_list.length; i++) {
- var obj = _hash_list[i]
+ for (i = 0; _hash_list && i < _hash_list.length; i++) {
+ var obj = _hash_list[i];
obj[params.children] = [];
- for (var j = 0; _hash_list && j < _hash_list.length; j++) {
+ for (j = 0; _hash_list && j < _hash_list.length; j++) {
var kid = _hash_list[j];
if (kid[params.parent] == obj[params.identifier]) {
obj[params.children].push( { _reference : kid[params.identifier] } );
item_data.push( obj );
}
- for (var j in _find_root) {
+ for (j in _find_root) {
_find_root[j]['_top'] = 'true';
if (!_find_root[j][params.parent])
_find_root[j]['_trueRoot'] = 'true';
fieldmapper[i].prototype.fromStoreItem = _fromStoreItem;
fieldmapper[i].toStoreData = _toStoreData;
fieldmapper[i].toStoreItem = _toStoreItem;
- fieldmapper[i].prototype.toStoreItem = function ( args ) { return _toStoreItem(this, args) };
+ fieldmapper[i].prototype.toStoreItem = function ( args ) { return _toStoreItem(this, args); };
fieldmapper[i].initStoreData = _initStoreData;
}
fieldmapper.aou.toStoreData = function (list, label) {
if (!label) label = 'shortname';
return _toStoreData.call(this, list, label, { 'parent' : 'parent_ou', 'children' : 'children' });
- }
+ };
fieldmapper.aout.toStoreData = function (list, label) {
if (!label) label = 'name';
return _toStoreData.call(this, list, label, { 'parent' : 'parent', 'children' : 'children' });
- }
+ };
fieldmapper.pgt.toStoreData = function (list, label) {
if (!label) label = 'name';
return _toStoreData.call(this, list, label, { 'parent' : 'parent', 'children' : 'children' });
- }
+ };
/*
ppl.toStoreData = function (list, label) {
/* XXX Content loaded in Fieldmapper */
/* XXX deprecate this file **/
+ var i;
function _fromHash (_hash) {
- for ( var i=0; i < this._fields.length; i++) {
- if (_hash[this._fields[i]] != null)
+ for (i = 0; i < this._fields.length; i++) {
+ if (_hash[this._fields[i]] !== null)
this[this._fields[i]]( _hash[this._fields[i]] );
}
return this;
function _toHash (includeNulls, virtFields) {
var _hash = {};
- for ( var i=0; i < this._fields.length; i++) {
- if (includeNulls || this[this._fields[i]]() != null) {
- if (this[this._fields[i]]() == null)
+ for (i = 0; i < this._fields.length; i++) {
+ if (includeNulls || this[this._fields[i]]() !== null) {
+ if (this[this._fields[i]]() === null)
_hash[this._fields[i]] = null;
else
_hash[this._fields[i]] = '' + this[this._fields[i]]();
}
if (virtFields && virtFields.length > 0) {
- for (var i = 0; i < virtFields.length; i++) {
+ for (i = 0; i < virtFields.length; i++) {
if (!_hash[virtFields[i]])
_hash[virtFields[i]] = null;
}
"DUPE_PATRON_PHONE" : "Found ${0} patron(s) with the same phone number",
"DUPE_PATRON_ADDR" : "Found ${0} patron(s) with the same address",
"REPLACED_ADDRESS" : "<div>Replaces address <b>${0}</b><br/> ${1} ${2}<br/> ${3}, ${4} ${5}</div>",
- "INVALID_FORM" : "Form is invalid. Please edit and try again."
+ "INVALID_FORM" : "Form is invalid. Please edit and try again.",
+ "EXAMPLE" : "Example: "
}
"AUTO_ATTR_VALUE_reset": "Clear / New Patron",
"AUTO_ATTR_VALUE_pickup": "Pick up",
"AUTO_ATTR_VALUE_return": "Return",
- "ADDRESS": "${0}\n${1}\n${2}, ${3} ${4}"
+ "ADDRESS": "${0}\n${1}\n${2}, ${3} ${4}",
+ "COPY_ALERT": "${0}:\n${1}\n\nDo you wish to process it anyway?"
}
case 'timestamp':
dojo.require('dijit.form.DateTextBox');
dojo.require('dojo.date.stamp');
+ if(!this.dijitArgs.constraints) {
+ this.dijitArgs.constraints = {};
+ }
+ if(!this.dijitArgs.constraints.datePattern) {
+ var user = new openils.User().user;
+ if(user.ws_ou()) {
+ var datePattern = fieldmapper.aou.fetchOrgSettingDefault(user.ws_ou(), 'format.date');
+ if(datePattern) this.dijitArgs.constraints.datePattern = datePattern.value;
+ }
+ }
this.widget = new dijit.form.DateTextBox(this.dijitArgs, this.parentNode);
if (this.widgetValue != null) {
this.widgetValue = openils.Util.timeStampAsDateObj(
var count = 0;
this.reset();
fieldmapper.standardRequest(
- ["open-ils.acq", "open-ils.acq.claim.eligible.lineitem_detail"], {
+ ["open-ils.acq", "open-ils.acq.claim.eligible.lineitem_detail.atomic"], {
"params": [openils.User.authtoken, this.filter],
"async": true,
- "onresponse": function(r) {
- if (r = openils.Util.readResponse(r)) {
- if (!count++)
- openils.Util.show("acq-eligible-claim-controls");
- self.addIfMissing(r.lineitem());
- } else {
- progressDialog.hide();
- }
- },
- "oncomplete": function() {
- if (count < 1) self.showEmpty();
+ "oncomplete": function(r) {
progressDialog.hide();
+ var rset = openils.Util.readResponse(r);
+ if (rset.length < 1) self.showEmpty();
+ else {
+ var byLi = {};
+ rset.forEach(
+ function(r) {
+ byLi[r.lineitem()] =
+ (byLi[r.lineitem()] || 0) + 1;
+ }
+ );
+ for (var key in byLi)
+ self.addIfMissing(key, byLi[key]);
+ }
}
}
);
nodeByName("lid_link", "eligible-li-" + liId).onclick =
function() {
location.href = oilsBasePath + "/acq/po/view/" +
- self.liCache[liId].purchase_order().id() + "," +
+ self.liCache[liId].purchase_order().id() + "/" +
liId;
};
openils.Util.show(
/* Despite being called with an argument that's a lineitem ID, this method
* is actually called once per lineitem _detail_. */
- this.addIfMissing = function(liId) {
- this._updateLidLink(liId);
- if (this.liCache[liId]) return;
-
+ this.addIfMissing = function(liId, number_of_appearances) {
var row = dojo.clone(this.rowTemplate);
var checkbox = nodeByName("selector", row);
dojo.attr(row, "id", "eligible-li-" + liId);
dojo.attr(checkbox, "value", liId);
dojo.place(row, self.tBody, "last");
+
+ for (var i = 0; i < number_of_appearances; i++)
+ self._updateLidLink(liId);
}
);
};
'ui.patron.default_country',
'ui.patron.registration.require_address',
'circ.holds.behind_desk_pickup_supported',
- 'circ.patron_edit.clone.copy_address'
+ 'circ.patron_edit.clone.copy_address',
+ 'ui.patron.edit.au.second_given_name.show',
+ 'ui.patron.edit.au.second_given_name.suggest',
+ 'ui.patron.edit.au.suffix.show',
+ 'ui.patron.edit.au.suffix.suggest',
+ 'ui.patron.edit.au.alias.show',
+ 'ui.patron.edit.au.alias.suggest',
+ 'ui.patron.edit.au.dob.require',
+ 'ui.patron.edit.au.dob.show',
+ 'ui.patron.edit.au.dob.suggest',
+ 'ui.patron.edit.au.dob.calendar',
+ 'ui.patron.edit.au.juvenile.show',
+ 'ui.patron.edit.au.juvenile.suggest',
+ 'ui.patron.edit.au.ident_value.show',
+ 'ui.patron.edit.au.ident_value.suggest',
+ 'ui.patron.edit.au.ident_value2.show',
+ 'ui.patron.edit.au.ident_value2.suggest',
+ 'ui.patron.edit.au.email.require',
+ 'ui.patron.edit.au.email.show',
+ 'ui.patron.edit.au.email.suggest',
+ 'ui.patron.edit.au.email.regex',
+ 'ui.patron.edit.au.email.example',
+ 'ui.patron.edit.au.day_phone.require',
+ 'ui.patron.edit.au.day_phone.show',
+ 'ui.patron.edit.au.day_phone.suggest',
+ 'ui.patron.edit.au.day_phone.regex',
+ 'ui.patron.edit.au.day_phone.example',
+ 'ui.patron.edit.au.evening_phone.require',
+ 'ui.patron.edit.au.evening_phone.show',
+ 'ui.patron.edit.au.evening_phone.suggest',
+ 'ui.patron.edit.au.evening_phone.regex',
+ 'ui.patron.edit.au.evening_phone.example',
+ 'ui.patron.edit.au.other_phone.require',
+ 'ui.patron.edit.au.other_phone.show',
+ 'ui.patron.edit.au.other_phone.suggest',
+ 'ui.patron.edit.au.other_phone.regex',
+ 'ui.patron.edit.au.other_phone.example',
+ 'ui.patron.edit.phone.regex',
+ 'ui.patron.edit.phone.example',
+ 'ui.patron.edit.au.active.show',
+ 'ui.patron.edit.au.active.suggest',
+ 'ui.patron.edit.au.barred.show',
+ 'ui.patron.edit.au.barred.suggest',
+ 'ui.patron.edit.au.master_account.show',
+ 'ui.patron.edit.au.master_account.suggest',
+ 'ui.patron.edit.au.claims_returned_count.show',
+ 'ui.patron.edit.au.claims_returned_count.suggest',
+ 'ui.patron.edit.au.claims_never_checked_out_count.show',
+ 'ui.patron.edit.au.claims_never_checked_out_count.suggest',
+ 'ui.patron.edit.au.alert_message.show',
+ 'ui.patron.edit.au.alert_message.suggest',
+ 'ui.patron.edit.aua.post_code.regex',
+ 'ui.patron.edit.aua.post_code.example',
+ 'ui.patron.edit.aua.county.require',
+ 'format.date',
+ 'ui.patron.edit.default_suggested'
]);
for(k in orgSettings)
tbody = dojo.byId('uedit-tbody');
+ if(orgSettings['ui.patron.edit.default_suggested'])
+ uEditToggleRequired(2);
+
addrTemplateRows = dojo.query('tr[type=addr-template]', tbody);
dojo.forEach(addrTemplateRows, function(row) { row.parentNode.removeChild(row); } );
statCatTemplate = tbody.removeChild(dojo.byId('stat-cat-row-template'));
var wconstraints = row.getAttribute('wconstraints');
/* use CSS to set the zindex for widgets you want to disable. */
var disabled = dojo.style(row, 'zIndex') == -1 ? true : false;
+ var isphone = (fmcls == 'au') && (fmfield.search('_phone') != -1);
var isPasswd2 = (fmfield == 'passwd2');
if(isPasswd2) fmfield = 'passwd';
var htd = existing[0] || row.appendChild(document.createElement('td'));
var ltd = existing[1] || row.appendChild(document.createElement('td'));
var wtd = existing[2] || row.appendChild(document.createElement('td'));
+ var ftd = existing[3] || row.appendChild(document.createElement('td'));
openils.Util.addCSSClass(htd, 'uedit-help');
if(fieldDoc[fmcls] && fieldDoc[fmcls][fmfield]) {
}
if(!ltd.textContent) {
- var span = document.createElement('span');
ltd.appendChild(document.createTextNode(fieldIdl.label));
}
- span = document.createElement('span');
+ if(!ftd.textContent) {
+ if(orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.example']) {
+ ftd.appendChild(document.createTextNode(localeStrings.EXAMPLE + orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.example']));
+ }
+ else if(isphone && orgSettings['ui.patron.edit.phone.example']) {
+ ftd.appendChild(document.createTextNode(localeStrings.EXAMPLE + orgSettings['ui.patron.edit.phone.example']));
+ }
+ else if(fieldIdl.datatype == 'timestamp') {
+ ftd.appendChild(document.createTextNode(localeStrings.EXAMPLE + dojo.date.locale.format(new Date(1970,0,31),{selector: "date", fullYear: true, datePattern: (orgSettings['format.date'] ? orgSettings['format.date'] : null)})));
+ }
+ }
+
+ var span = document.createElement('span');
wtd.appendChild(span);
var fmObject = null;
break;
}
- var required = row.getAttribute('required') == 'required';
+ // Adjust required value by org settings
+ var curRequired = row.getAttribute('required');
+ var required = curRequired == 'required';
+ if(orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.require']) {
+ row.setAttribute('required', 'required');
+ required = true;
+ }
+ else if (curRequired != 'required' && orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.show']) {
+ row.setAttribute('required', 'show');
+ }
+ else if (curRequired != 'required' && curRequired != 'show' && orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.suggest']) {
+ row.setAttribute('required', 'suggested');
+ }
// password data is not fetched/required/displayed for existing users
if(!patron.isnew() && 'passwd' == fmfield)
disabled : disabled
};
+ // Org settings provided regex?
+ if(orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.regex']) {
+ dijitArgs.regExp = orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.regex'];
+ }
+ else if(isphone && orgSettings['ui.patron.edit.phone.regex']) {
+ dijitArgs.regExp = orgSettings['ui.patron.edit.phone.regex'];
+ }
+
if(fmcls == 'au' && fmfield == 'passwd') {
if (orgSettings['global.password_regex']) {
dijitArgs.regExp = orgSettings['global.password_regex'];
}
}
- // TODO RSN: Add Setting!
- if(fmcls == 'au' && fmfield == 'dob')
+ if(fmcls == 'au' && fmfield == 'dob' && !orgSettings['ui.patron.edit.au.dob.calendar'])
dijitArgs.popupClass = "";
var value = row.getAttribute('wvalue');
return;
case 'day_phone':
- // if configured, use the last for digits of the day phone number as the password
+ // if configured, use the last four digits of the day phone number as the password
if(uEditUsePhonePw && patron.isnew()) {
dojo.connect(widget.widget, 'onChange',
function(newVal) {
widgetPile = widgetPile.filter(function(w){return (w._addr != id)});
}
-function uEditToggleRequired() {
- if((tbody.className +'').match(/hide-non-required/))
- openils.Util.removeCSSClass(tbody, 'hide-non-required');
- else
- openils.Util.addCSSClass(tbody, 'hide-non-required');
- openils.Util.toggle('uedit-show-required');
- openils.Util.toggle('uedit-show-all');
+function uEditToggleRequired(level) {
+ openils.Util.removeCSSClass(tbody, 'hide-non-required');
+ openils.Util.removeCSSClass(tbody, 'hide-non-suggested');
+ openils.Util.show('uedit-show-required');
+ openils.Util.show('uedit-show-required-br');
+ openils.Util.show('uedit-show-suggested');
+ openils.Util.show('uedit-show-suggested-br');
+ openils.Util.show('uedit-show-all');
+ switch(level) {
+ case 1:
+ openils.Util.hide('uedit-show-required');
+ openils.Util.hide('uedit-show-required-br');
+ openils.Util.addCSSClass(tbody, 'hide-non-required');
+ break;
+ case 2:
+ openils.Util.hide('uedit-show-suggested');
+ openils.Util.hide('uedit-show-suggested-br');
+ openils.Util.addCSSClass(tbody, 'hide-non-suggested');
+ break;
+ default:
+ openils.Util.hide('uedit-show-all');
+ break;
+ }
}
function printable_output() {
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dojo.date.locale");
dojo.require("openils.PermaCrud");
+dojo.require("dojo.string");
function Populator(widgets, primary_input) {
this.widgets = widgets;
this.reveal_container(this.widgets.patron);
/* Maybe add patron's home OU or something here later... */
};
-Populator.prototype.return_by_resource = function(barcode) {
+Populator.prototype.return_by_resource = function(barcode, override) {
/* XXX instead of talking to the server every time we do this, we could
* also check the "out" cache, iff we have one. */
var r = fieldmapper.standardRequest(
alert(localeStrings.NOTICE_CHANGE_OF_PATRON);
}
this.patron_barcode = new_barcode;
- var ret = this.return(r);
+ var ret = this.return(r, override);
if (!ret) {
alert(localeStrings.RETURN_NO_RESPONSE);
} else if (is_ils_event(ret) && ret.textcode != "SUCCESS") {
- if (ret.textcode == "ROUTE_ITEM")
+ if (ret.textcode == "ROUTE_ITEM") {
display_transit_slip(ret);
- else
+ } else if (ret.textcode == "COPY_ALERT_MESSAGE") {
+ if (
+ confirm(
+ dojo.string.substitute(
+ localeStrings.COPY_ALERT, [ret.desc, ret.payload]
+ )
+ )
+ ) {
+ this.return_by_resource(barcode, true /*override*/);
+ return;
+ }
+ } else {
alert(my_ils_error(localeStrings.RETURN_ERROR, ret));
+ }
} else {
/* XXX speedbump should go, but something has to happen else
* there's no indication to staff that anything happened when
}]
);
};
-Populator.prototype.return = function(reservation) {
+Populator.prototype.return = function(reservation, override) {
+ var method = "open-ils.circ.reservation.return";
+ if (override) method += ".override";
return fieldmapper.standardRequest(
- ["open-ils.circ", "open-ils.circ.reservation.return"],
+ ["open-ils.circ", method],
[openils.User.authtoken, {
"patron_barcode": this.patron_barcode,
"reservation": reservation.id()
var reservations = selected_id_list.map(function(o) { return cache[o]; });
/* Do we have to process these one at a time? I think so... */
- for (var i in reservations) {
- var result = this[how](reservations[i]);
+ var self = this;
+ function looper(reservation, override) {
+ if (looper._done) return;
+ var result = self[how](reservation, override);
if (!result) {
alert(no_response_msg);
} else if (is_ils_event(result) && result.textcode != "SUCCESS") {
- if (result.textcode == "ROUTE_ITEM")
+ if (result.textcode == "ROUTE_ITEM") {
display_transit_slip(result);
- else
+ } else if (result.textcode == "COPY_ALERT_MESSAGE") {
+ if (confirm(
+ dojo.string.substitute(
+ localeStrings.COPY_ALERT, [result.desc, result.payload]
+ )
+ )) {
+ looper(reservation, true);
+ }
+ return; // continues processing other resvs
+ } else {
alert(my_ils_error(error_msg, result));
+ }
} else {
- continue;
+ return;
}
- break;
+ looper._done = true;
}
+ dojo.forEach(reservations, looper);
this.populate();
};
<!ENTITY staff.patron_search_form.phone.label 'Phone:'>
<!ENTITY staff.patron_search_form.post_code.accesskey ''>
<!ENTITY staff.patron_search_form.post_code.label 'ZIP:'>
+<!ENTITY staff.patron_search_form.profile.accesskey ''>
+<!ENTITY staff.patron_search_form.profile.label 'Filter by Permission Profile:'>
<!ENTITY staff.patron_search_form.search.accesskey 'S'>
<!ENTITY staff.patron_search_form.search.label 'Search'>
<!ENTITY staff.patron_search_form.second_given_name.accesskey ''>
<!ENTITY staff.server.admin.org_unit_settings.title "Organization Unit Settings">
<!ENTITY staff.server.admin.org_unit_settings.context "Context Location">
<!ENTITY staff.server.admin.org_unit_settings.uninherited " * Indicates the setting is not inherited from the parent org unit at run time">
+<!ENTITY staff.server.admin.org_unit_settings.no_perms "You do not have permission to view org unit settings">
<!ENTITY staff.server.admin.org_unit_settings.edit_setting "Edit Setting">
<!ENTITY staff.server.admin.org_unit_settings.delete_setting "Delete Setting">
<!ENTITY staff.server.admin.org_unit_settings.update_setting "Update Setting">
var record = r.getResultObject();
var circid = r.circ;
- if(!record || checkILSEvent(record)) {
+ /* Draw pre-cataloged items */
+ if(!record || checkILSEvent(record) || !(record.title() && record.author())) {
var req = new Request( FETCH_COPY, r.copy );
- req.request.circ = circid
- req.callback(myOPACDrawNonCatalogedItem);
+ req.request.circ = circid;
+ req.callback(myOPACDrawPreCatalogedItem);
req.send();
return;
}
var row = $('myopac_checked_row_ ' + circid);
var tlink = $n( row, "myopac_checked_title_link" );
var alink = $n( row, "myopac_checked_author_link" );
+
buildTitleDetailLink(record, tlink);
buildSearchLink(STYPE_AUTHOR, record.author(), alink);
__circ_titles[circid] = record.title();
}
-function myOPACDrawNonCatalogedItem(r) {
+function myOPACDrawPreCatalogedItem(r) {
var copy = r.getResultObject();
var circid = r.circ;
<button dojoType='dijit.form.Button' jsId='saveButton' onClick='uEditSave' scrollOnFocus='false'>Save</button>
<button dojoType='dijit.form.Button' jsId='saveCloneButton' onClick='uEditSaveClone' scrollOnFocus='false'>Save & Clone</button>
<div id='require-toggle'>
- <a href='javascript:uEditToggleRequired();' id='uedit-show-required'>Show Only Required Fields</a>
- <a href='javascript:uEditToggleRequired();' id='uedit-show-all' class='hidden'>Show All Fields</a>
+ <a href='javascript:uEditToggleRequired(1);' id='uedit-show-required'>Show Only Required Fields</a><br id='uedit-show-required-br'/>
+ <a href='javascript:uEditToggleRequired(2);' id='uedit-show-suggested'>Show Suggested Fields</a><br id='uedit-show-suggested-br'/>
+ <a href='javascript:uEditToggleRequired(0);' id='uedit-show-all' class='hidden'>Show All Fields</a>
</div>
</div>
</tr>
<!-- stat cats -->
- <tr class='divider' id='stat-cat-divider'><td colspan='0'>Statistical Categories</td></tr>
- <tr id='stat-cat-row-template'><td class='uedit-help'/><td name='name'/><td name='widget'/></tr>
+ <tr class='divider' id='stat-cat-divider' required='suggested'><td colspan='0'>Statistical Categories</td></tr>
+ <tr id='stat-cat-row-template'><td class='uedit-help' required='suggested'/><td name='name'/><td name='widget'/></tr>
<!-- surveys -->
- <tr id='survey-row-template' class='divider'><td colspan='0' name='name'/></tr>
- <tr id='survey-question-row-template'><td class='uedit-help'/><td name='question'/><td name='answers'/></tr>
+ <tr id='survey-row-template' class='divider' required='suggested'><td colspan='0' name='name'/></tr>
+ <tr id='survey-question-row-template'><td class='uedit-help' required='suggested'/><td name='question'/><td name='answers'/></tr>
</tbody>
# from http://closure-compiler.googlecode.com/files/compiler-latest.zip FIXME: Autotools this?
export CLOSURE_COMPILER_JAR = ~/closure-compiler/compiler.jar
-XULRUNNER_VERSION=1.9.2.13
+XULRUNNER_VERSION=1.9.2.15
XULRUNNER_WINFILE=xulrunner-$(XULRUNNER_VERSION).en-US.win32.zip
XULRUNNER_LINUXFILE=xulrunner-$(XULRUNNER_VERSION).en-US.linux-i686.tar.bz2
XULRUNNER_URL=http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/$(XULRUNNER_VERSION)/runtimes/
contextOrg = user.user.ws_ou();
openils.User.authtoken = authtoken;
- var connect = function() { dojo.connect(contextOrg, 'onChange', osChangeContext); };
- new openils.User().buildPermOrgSelector('STAFF_LOGIN', osContextSelector, null, connect);
+ var connect = function() {
+ dojo.connect(contextOrg, 'onChange', osChangeContext);
+
+ // don't draw the org settings grid unless the user has permission
+ // to view org settings in at least 1 org unit
+ osContextSelector.store.fetch({query: {}, start: 0, count: 0,
+ onBegin: function(size) {
+ if(size) { osDraw(); return; }
+ dojo.removeClass('no-perms', 'hide_me');
+ }
+ });
+ };
- osDraw();
+ new openils.User().buildPermOrgSelector('VIEW_ORG_SETTINGS', osContextSelector, null, connect);
}
dojo.addOnLoad(osInit);
</span>
<span>&staff.server.admin.org_unit_settings.uninherited;</span>
</div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+ <div class='hide_me' id='no-perms'><b>&staff.server.admin.org_unit_settings.no_perms;</b></div>
+ </div>
<div dojoType="dijit.layout.ContentPane" layoutAlign='client' class='tall'>
<script>
var osGridLayout = [{
staff.main.gen_offline_widgets.registration.override=Override Registration Failure?
staff.main.gen_offline_widgets.registration.error=Workstation Registration error (%1$s)
staff.main.gen_offline_widgets.registration.success=Registration successful
+staff.main.gen_offline_widgets.registration.empty=Please specify a workstation name
staff.util.timestamp_dialog.future_date_disallowed=Future dates disallowed.
staff.util.timestamp_dialog.past_date_disallowed=Past dates disallowed.
staff.util.timestamp_dialog.today_disallowed=Today disallowed.
}
function register() {
+ if(g.tb.value.length == 0) {
+ alert(document.getElementById('commonStrings').getString('staff.main.gen_offline_widgets.registration.empty'));
+ return;
+ }
try {
var robj = g.network.simple_request(
'AUTH_WORKSTATION',
payment_blob.payment_type = $('payment_type').value;
var tally_blob = tally_pending();
payment_blob.payments = tally_blob.payments;
- payment_blob.patron_credit = $('convert_change_to_credit').checked ? tally_blob.change : '0.00';
+ // Handle patron credit
+ if ( payment_blob.payment_type == 'credit_payment' ) { // paying with patron credit
+ if ( $('convert_change_to_credit').checked ) {
+ // No need to convert credit into credit, handled automatically
+ payment_blob.patron_credit = '0.00';
+ } else {
+ // Cashing out extra credit as change
+ payment_blob.patron_credit = 0 - tally_blob.change;
+ }
+ } else if ( $('convert_change_to_credit').checked ) {
+ // Saving change from a non-credit payment as patron credit on server
+ payment_blob.patron_credit = tally_blob.change;
+ } else {
+ payment_blob.patron_credit = '0.00';
+ }
if ( payment_blob.payments.length == 0 && payment_blob.patron_credit == '0.00' ) {
alert($("patronStrings").getString('staff.patron.bills.apply_payment.nothing_applied'));
return;
};
}
],
+ 'profile' : [ ['render'], function(e) {
+ return function() {};
+ }
+ ],
'inactive' : [ ['render'], function(e) {
return function() {};
}
'search_depth' : [ ['render'],function(e) {
return function() {};
}
- ],
+ ]
}
}
);
util.widgets.load_attributes(file);
ml.value = ml.getAttribute('value');
if (! ml.value) {
- ml.value = 0
+ ml.value = 0;
ml.setAttribute('value',ml.value);
}
);
cb.checked = cb.getAttribute('value') == "true" ? true : false;
+ /* Populate the Patron Profile filter */
+ util.widgets.remove_children(obj.controller.view.profile);
+ var profile_ml = util.widgets.make_menulist(
+ util.functional.map_list( obj.OpenILS.data.list.pgt,
+ function(el,idx) {
+ return [ el.name(), el.id() ]
+ }
+ ).sort(
+ function(a,b) {
+ if (a[0] < b[0]) return -1;
+ if (a[0] > b[0]) return 1;
+ return 0;
+ }
+ )
+ );
+ profile_ml.addEventListener('command', function() {
+ profile_ml.parentNode.setAttribute('value', profile_ml.value);
+ }, false
+ );
+ profile_ml.setAttribute('id','profile_ml');
+
+ /* Add an empty menu item as the default profile */
+ var empty = document.createElement('menuitem');
+ profile_ml.firstChild.insertBefore(empty, profile_ml.firstChild.firstChild);
+ empty.setAttribute('label', '');
+ empty.setAttribute('value', '');
+ obj.controller.view.profile.appendChild(profile_ml);
+ profile_ml.value = profile_ml.getAttribute('value');
},
'on_submit' : function(q) {
if (id == 'inactive') {
query[id] = node.getAttribute('value');
obj.error.sdump('D_DEBUG','id = ' + id + ' value = ' + node.getAttribute('value') + '\n');
+ } else if (id == 'profile') {
+ query[id] = node.firstChild.getAttribute('value');
+ obj.error.sdump('D_DEBUG','id = ' + id + ' value = ' + node.getAttribute('value') + '\n');
} else {
if (id == 'search_depth') {
query[id] = node.firstChild.getAttribute('value');
obj.error.sdump('D_DEBUG','id = ' + id + ' value = ' + value + '\n');
}
}
- }
+ }
}
}
if (typeof obj.on_submit == 'function') {
accesskey="&staff.patron_search_form.post_code.accesskey;"/>
<textbox id="post_code" group="1" context="clipboard"/>
</row>
+ <row>
+ <label value="&staff.patron_search_form.profile.label;"/>
+ <hbox id="profile" />
+ </row>
<row id="psr12">
<spacer id="pss12"/>
<button id="search" label="&staff.patron_search_form.search.label;"
obj.search_term_count++;
break;
- case 'family_name': case 'first_given_name': case 'second_given_name': case 'email': case 'alias': case 'usrname':
+ case 'family_name': case 'first_given_name': case 'second_given_name': case 'email': case 'alias': case 'usrname': case 'profile':
search_hash[ i ] = {};
search_hash[ i ].value = query[i];
commands, we assume that you are working with PostgreSQL 9.0 on a Debian-based
system:
-createdb --template template0 --encoding UNICODE evergreen
+createdb --template template0 --lc-ctype=C --lc-collate=C --encoding UNICODE evergreen
createlang plperl evergreen
createlang plperlu evergreen
createlang plpgsql evergreen
cp $(PROJECT)/$(LOCALE)/TranslatorPopup.js $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)/TranslatorPopup.js
cp $(PROJECT)/$(LOCALE)/XULTermLoader.js $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)/XULTermLoader.js
-install_all_locales: newpo newpot
+install_all_locales: newpot
for i in `ls po/*/*po|grep -v en-US | cut -f3 -d'/' | cut -f1 -d. | sort | uniq`; \
do \
make LOCALE=$$i install; \