Merge commit 'biblibre/3.2_community' into to-push

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Galen Charlton 2010-01-26 14:46:05 -05:00
commit 8e0b1fe58f
343 changed files with 59845 additions and 5327 deletions

View file

@ -41,8 +41,8 @@ BEGIN {
@EXPORT = qw(
&GetBasket &NewBasket &CloseBasket &DelBasket &ModBasket
&GetBasketsByBookseller &GetBasketsByBasketgroup
&ModBasketHeader
&ModBasketHeader
&ModBasketgroup &NewBasketgroup &DelBasketgroup &GetBasketgroup &CloseBasketgroup
&GetBasketgroups &ReOpenBasketgroup
@ -50,7 +50,7 @@ BEGIN {
&NewOrder &DelOrder &ModOrder &GetPendingOrders &GetOrder &GetOrders
&GetOrderNumber &GetLateOrders &GetOrderFromItemnumber
&SearchOrder &GetHistory &GetRecentAcqui
&ModReceiveOrder &ModOrderBiblioitemNumber
&ModReceiveOrder &ModOrderBiblioitemNumber
&NewOrderItem &ModOrderItem
@ -76,7 +76,7 @@ sub GetOrderFromItemnumber {
my $sth = $dbh->prepare($query);
$sth->trace(3);
# $sth->trace(3);
$sth->execute($itemnumber);
@ -85,7 +85,7 @@ sub GetOrderFromItemnumber {
}
# Returns the itemnumber(s) associated with the ordernumber given in parameter
# Returns the itemnumber(s) associated with the ordernumber given in parameter
sub GetItemnumbersFromOrder {
my ($ordernumber) = @_;
my $dbh = C4::Context->dbh;
@ -95,7 +95,7 @@ sub GetItemnumbersFromOrder {
my @tab;
while (my $order = $sth->fetchrow_hashref) {
push @tab, $order->{'itemnumber'};
push @tab, $order->{'itemnumber'};
}
return @tab;
@ -574,10 +574,10 @@ sub ModBasketgroup {
push(@params, $basketgroupinfo->{'id'});
my $sth = $dbh->prepare($query);
$sth->execute(@params);
$sth = $dbh->prepare('UPDATE aqbasket SET basketgroupid = NULL WHERE basketgroupid = ?');
$sth->execute($basketgroupinfo->{'id'});
if($basketgroupinfo->{'basketlist'} && @{$basketgroupinfo->{'basketlist'}}){
$sth = $dbh->prepare("UPDATE aqbasket SET basketgroupid=? WHERE basketno=?");
foreach my $basketno (@{$basketgroupinfo->{'basketlist'}}) {
@ -914,7 +914,7 @@ table of the Koha database.
=item $hashref->{'basketno'} is the basketno foreign key in aqorders, it is mandatory
=item $hashref->{'ordernumber'} is a "minimum order number."
=item $hashref->{'ordernumber'} is a "minimum order number."
=item $hashref->{'budgetdate'} is effectively ignored.
If it's undef (anything false) or the string 'now', the current day is used.
@ -1141,14 +1141,14 @@ sub ModReceiveOrder {
$datereceived = C4::Dates->output('iso') unless $datereceived;
my $suggestionid = GetSuggestionFromBiblionumber( $dbh, $biblionumber );
if ($suggestionid) {
ModSuggestion( {suggestionid=>$suggestionid,
STATUS=>'AVAILABLE',
biblionumber=> $biblionumber}
ModSuggestion( {suggestionid=>$suggestionid,
STATUS=>'AVAILABLE',
biblionumber=> $biblionumber}
);
}
my $sth=$dbh->prepare("
SELECT * FROM aqorders
SELECT * FROM aqorders
WHERE biblionumber=? AND aqorders.ordernumber=?");
$sth->execute($biblionumber,$ordernumber);
@ -1234,7 +1234,7 @@ sub SearchOrder {
LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber
LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno
WHERE (datecancellationprinted is NULL)";
if($ordernumber){
$query .= " AND (aqorders.ordernumber=?)";
push @args, $ordernumber;
@ -1493,15 +1493,16 @@ sub GetLateOrders {
biblioitems.publicationyear,
";
my $from = "
FROM (((
(aqorders LEFT JOIN biblio ON biblio.biblionumber = aqorders.biblionumber)
LEFT JOIN biblioitems ON biblioitems.biblionumber = biblio.biblionumber)
LEFT JOIN aqbudgets ON aqorders.budget_id = aqbudgets.budget_id),
(aqbasket LEFT JOIN borrowers ON aqbasket.authorisedby = borrowers.borrowernumber)
LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
FROM
aqorders LEFT JOIN biblio ON biblio.biblionumber = aqorders.biblionumber
LEFT JOIN biblioitems ON biblioitems.biblionumber = biblio.biblionumber
LEFT JOIN aqbudgets ON aqorders.budget_id = aqbudgets.budget_id,
aqbasket LEFT JOIN borrowers ON aqbasket.authorisedby = borrowers.borrowernumber
LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
WHERE aqorders.basketno = aqbasket.basketno
AND ( (datereceived = '' OR datereceived IS NULL)
OR (aqorders.quantityreceived < aqorders.quantity)
AND ( datereceived = ''
OR datereceived IS NULL
OR aqorders.quantityreceived < aqorders.quantity
)
";
my $having = "";

View file

@ -337,9 +337,10 @@ sub get_template_and_user {
'item-level_itypes' => C4::Context->preference('item-level_itypes'),
patronimages => C4::Context->preference("patronimages"),
singleBranchMode => C4::Context->preference("singleBranchMode"),
XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"),
XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"),
);
XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"),
XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"),
BranchesLoop => GetBranchesLoop(),
);
if ( $in->{'type'} eq "intranet" ) {
$template->param(
@ -392,8 +393,12 @@ sub get_template_and_user {
LibraryName => "" . C4::Context->preference("LibraryName"),
LibraryNameTitle => "" . $LibraryNameTitle,
LoginBranchname => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"",
OPACAmazonSimilarItems => "" . C4::Context->preference("OPACAmazonSimilarItems"),
OPACAmazonEnabled => C4::Context->preference("OPACAmazonEnabled"),
OPACAmazonSimilarItems => C4::Context->preference("OPACAmazonSimilarItems"),
OPACAmazonCoverImages => C4::Context->preference("OPACAmazonCoverImages"),
OPACAmazonReviews => C4::Context->preference("OPACAmazonReviews"),
OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"),
OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"),
OPACItemHolds => C4::Context->preference("OPACItemHolds"),
OPACShelfBrowser => "". C4::Context->preference("OPACShelfBrowser"),
OPACURLOpenInNewWindow => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
@ -433,7 +438,8 @@ sub get_template_and_user {
reviewson => C4::Context->preference("reviewson"),
suggestion => "" . C4::Context->preference("suggestion"),
virtualshelves => "" . C4::Context->preference("virtualshelves"),
OPACSerialIssueDisplayCount => C4::Context->preference("OPACSerialIssueDisplayCount"),
OPACSerialIssueDisplayCount => C4::Context->preference("OPACSerialIssueDisplayCount"),
OpacAddMastheadLibraryPulldown => C4::Context->preference("OpacAddMastheadLibraryPulldown"),
);
}
$template->param(listloop=>[{shelfname=>"Freelist", shelfnumber=>110}]);

View file

@ -24,7 +24,10 @@ use Digest::MD5 qw(md5_base64);
use C4::Debug;
use C4::Context;
use C4::Members qw(AddMember changepassword);
use C4::Members::Attributes;
use C4::Members::AttributeTypes;
use C4::Utils qw( :all );
use List::MoreUtils qw( any );
use Net::LDAP;
use Net::LDAP::Filter;
@ -150,10 +153,29 @@ sub checkpw_ldap {
}
} elsif ($config{replicate}) { # A2, C2
$borrowernumber = AddMember(%borrower) or die "AddMember failed";
} else {
} else {
return 0; # B2, D2
}
return(1, $cardnumber);
if (C4::Context->preference('ExtendedPatronAttributes') && $borrowernumber && ($config{update} ||$config{replicate})) {
my @types = C4::Members::AttributeTypes::GetAttributeTypes();
my @attributes = grep{my $key=$_; any{$_ eq $key}@types;} keys %borrower;
my $extended_patron_attributes = map{{code=>$_,value=>$borrower{$_}}}@attributes;
my @errors;
#Check before add
for (my $i; $i< scalar(@$extended_patron_attributes)-1;$i++) {
my $attr=$extended_patron_attributes->[$i];
unless (C4::Members::Attributes::CheckUniqueness($attr->{code}, $attr->{value}, $borrowernumber)) {
unshift @errors, $i;
warn "ERROR_extended_unique_id_failed $attr->{code} $attr->{value}";
}
}
#Removing erroneous attributes
foreach my $index (@errors){
@$extended_patron_attributes=splice(@$extended_patron_attributes,$index,1);
}
C4::Members::Attributes::SetBorrowerAttributes($borrowernumber, $extended_patron_attributes);
}
return(1, $cardnumber);
}
# Pass LDAP entry object and local cardnumber (userid).

View file

@ -318,6 +318,7 @@ sub GetBudgetPermDropbox {
$labels{'1'} = 'Owner';
$labels{'2'} = 'Library';
my $radio = CGI::scrolling_list(
-id => 'budget_permission',
-name => 'budget_permission',
-values => [ '0', '1', '2' ],
-default => $perm,

316
C4/Creators/Batch.pm Normal file
View file

@ -0,0 +1,316 @@
package C4::Creators::Batch;
use strict;
use warnings;
use autouse 'Data::Dumper' => qw(Dumper);
use C4::Context;
use C4::Debug;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
sub _check_params {
my $given_params = {};
my $exit_code = 0;
my @valid_template_params = (
'label_id',
'batch_id',
'item_number',
'card_number',
'branch_code',
'creator',
);
if (scalar(@_) >1) {
$given_params = {@_};
foreach my $key (keys %{$given_params}) {
if (!(grep m/$key/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of %s', $_);
$exit_code = 1;
}
}
return $exit_code;
}
sub new {
my ($invocant) = shift;
my $type = ref($invocant) || $invocant;
my $self = {
batch_id => 0,
items => [],
branch_code => 'NB',
batch_stat => 0, # False if any data has changed and the db has not been updated
@_,
};
my $sth = C4::Context->dbh->prepare("SELECT MAX(batch_id) FROM creator_batches;");
$sth->execute();
my $batch_id = $sth->fetchrow_array;
$self->{'batch_id'} = ++$batch_id unless $self->{'batch_id'} != 0; # this allows batch_id to be passed in for individual label printing
bless ($self, $type);
return $self;
}
sub add_item {
my $self = shift;
my $number = shift;
ref($self) =~ m/C4::(.+)::.+$/;
my $number_type = ($1 eq 'Patroncards' ? 'borrower_number' : 'item_number');
my $query = "INSERT INTO creator_batches (batch_id, $number_type, branch_code, creator) VALUES (?,?,?,?);";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($self->{'batch_id'}, $number, $self->{'branch_code'}, $1);
if ($sth->err) {
warn sprintf('Database returned the following error on attempted INSERT: %s', $sth->errstr);
return -1;
}
$query = "SELECT max(label_id) FROM creator_batches WHERE batch_id=? AND $number_type=? AND branch_code=?;";
my $sth1 = C4::Context->dbh->prepare($query);
$sth1->execute($self->{'batch_id'}, $number, $self->{'branch_code'});
my $label_id = $sth1->fetchrow_array;
push (@{$self->{'items'}}, {$number_type => $number, label_id => $label_id});
$self->{'batch_stat'} = 1;
return 0;
}
sub get_attr {
my $self = shift;
return $self->{$_[0]};
}
sub remove_item {
my $self = shift;
my $label_id = shift;
my $query = "DELETE FROM creator_batches WHERE label_id=? AND batch_id=?;";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($label_id, $self->{'batch_id'});
if ($sth->err) {
warn sprintf('Database returned the following error on attempted DELETE: %s', $sth->errstr);
return -1;
}
@{$self->{'items'}} = grep{$_->{'label_id'} != $label_id} @{$self->{'items'}};
$self->{'batch_stat'} = 1;
return 0;
}
# FIXME: This method is effectively useless the way the current add_item method is written. Ideally, the items should be added to the object
# and then the save method called. This does not work well in practice due to the inability to pass objects accross cgi script calls.
# I'm leaving it here because it should be here and for consistency's sake and once memcached support is fully implimented this should be as well. -cnighswonger
#
#=head2 $batch->save()
#
# Invoking the I<save> method attempts to insert the batch into the database. The method returns
# the new record batch_id upon success and -1 upon failure (This avoids conflicting with a record
# batch_id of 1). Errors are logged to the Apache log.
#
# example:
# my $exitstat = $batch->save(); # to save the record behind the $batch object
#
#=cut
#
#sub save {
# my $self = shift;
# foreach my $item_number (@{$self->{'items'}}) {
# my $query = "INSERT INTO creator_batches (batch_id, item_number, branch_code) VALUES (?,?,?);";
# my $sth1 = C4::Context->dbh->prepare($query);
# $sth1->execute($self->{'batch_id'}, $item_number->{'item_number'}, $self->{'branch_code'});
# if ($sth1->err) {
# warn sprintf('Database returned the following error on attempted INSERT: %s', $sth1->errstr);
# return -1;
# }
# $self->{'batch_stat'} = 1;
# return $self->{'batch_id'};
# }
#}
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
$type =~ m/C4::(.+)::.+$/;
my $number_type = ($1 eq 'Patroncards' ? 'borrower_number' : 'item_number');
my $record_flag = 0;
my $query = "SELECT * FROM creator_batches WHERE batch_id = ? ORDER BY label_id";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($opts{'batch_id'});
my $self = {
batch_id => $opts{'batch_id'},
items => [],
};
while (my $record = $sth->fetchrow_hashref) {
$self->{'branch_code'} = $record->{'branch_code'};
push (@{$self->{'items'}}, {$number_type => $record->{$number_type}, label_id => $record->{'label_id'}});
$record_flag = 1; # true if one or more rows were retrieved
}
return -2 if $record_flag == 0; # a hackish sort of way of indicating no such record exists
if ($sth->err) {
warn sprintf('Database returned the following error on attempted SELECT: %s', $sth->errstr);
return -1;
}
$self->{'batch_stat'} = 1;
bless ($self, $type);
return $self;
}
sub delete {
my $self = {};
my %opts = ();
my $call_type = '';
my @query_params = ();
if (ref($_[0])) {
$self = shift; # check to see if this is a method call
$call_type = 'C4::Labels::Batch->delete'; # seems hackish
@query_params = ($self->{'batch_id'}, $self->{'branch_code'});
}
else {
shift @_;
%opts = @_;
$call_type = 'C4::Labels::Batch::delete';
@query_params = ($opts{'batch_id'}, $opts{'branch_code'});
}
if ($query_params[0] eq '') { # If there is no template id then we cannot delete it
warn sprintf('%s : Cannot delete batch as the batch id is invalid or non-existent.', $call_type);
return -1;
}
my $query = "DELETE FROM creator_batches WHERE batch_id = ? AND branch_code =?";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute(@query_params);
if ($sth->err) {
warn sprintf('%s : Database returned the following error on attempted INSERT: %s', $call_type, $sth->errstr);
return -1;
}
return 0;
}
sub remove_duplicates {
my $self = shift;
my %seen=();
my $query = "DELETE FROM creator_batches WHERE label_id = ?;"; # ORDER BY timestamp ASC LIMIT ?;";
my $sth = C4::Context->dbh->prepare($query);
my @duplicate_items = grep{$seen{$_->{'item_number'}}++} @{$self->{'items'}};
foreach my $item (@duplicate_items) {
$sth->execute($item->{'label_id'});
if ($sth->err) {
warn sprintf('Database returned the following error on attempted DELETE for label_id %s: %s', $item->{'label_id'}, $sth->errstr);
return -1;
}
$sth->finish(); # Per DBI.pm docs: "If execute() is called on a statement handle that's still active ($sth->{Active} is true) then it should effectively call finish() to tidy up the previous execution results before starting this new execution."
@{$self->{'items'}} = grep{$_->{'label_id'} != $item->{'label_id'}} @{$self->{'items'}}; # the correct label/item must be removed from the current batch object as well; this should be done *after* each sql DELETE in case the DELETE fails
}
return scalar(@duplicate_items);
}
1;
__END__
=head1 NAME
C4::Labels::Batch - A class for creating and manipulating batch objects in Koha
=head1 ABSTRACT
This module provides methods for creating, and otherwise manipulating batch objects used by Koha to create and export labels.
=head1 METHODS
=head2 new()
Invoking the I<new> method constructs a new batch object with no items. It is possible to pre-populate the batch with items and a branch code by passing them
as in the second example below.
B<NOTE:> The items list must be an arrayref pointing to an array of hashes containing a key/data pair after this fashion: {item_number => item_number}. The order of
the array elements determines the order of the items in the batch.
example:
C<my $batch = C4::Labels::Batch->new(); # Creates and returns a new batch object>
C<my $batch = C4::Labels::Batch->new(items => $arrayref, branch_code => branch_code) # Creates and returns a new batch object containing the items passed in
with the branch code passed in.>
B<NOTE:> This batch is I<not> written to the database until C<$batch->save()> is invoked. You have been warned!
=head2 $batch->add_item(item_number => $item_number, branch_code => $branch_code)
Invoking the I<add_item> method will add the supplied item to the batch object.
example:
$batch->add_item(item_number => $item_number, branch_code => $branch_code);
=head2 $batch->get_attr($attribute)
Invoking the I<get_attr> method will return the requested attribute.
example:
my @items = $batch->get_attr('items');
=head2 $batch->remove_item($item_number)
Invoking the I<remove_item> method will remove the supplied item number from the batch object.
example:
$batch->remove_item($item_number);
=head2 C4::Labels::Batch->retrieve(batch_id => $batch_id)
Invoking the I<retrieve> method constructs a new batch object containing the current values for batch_id. The method returns a new object upon success and 1 upon failure.
Errors are logged to the Apache log.
examples:
my $batch = C4::Labels::Batch->retrieve(batch_id => 1); # Retrieves batch 1 and returns an object containing the record
=head2 delete()
Invoking the delete method attempts to delete the template from the database. The method returns -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair simply deleteing that batch from the database. See the example below.
examples:
my $exitstat = $batch->delete(); # to delete the record behind the $batch object
my $exitstat = C4::Labels::Batch->delete(batch_id => 1); # to delete batch 1
=head2 remove_duplicates()
Invoking the remove_duplicates method attempts to remove duplicate items in the batch from the database. The method returns the count of duplicate records removed upon
success and -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair removing duplicates in the batch passed in. See the example below.
examples:
my $remove_count = $batch->remove_duplicates(); # to remove duplicates the record behind the $batch object
my $remove_count = C4::Labels::Batch->remove_duplicates(batch_id => 1); # to remove duplicates in batch 1
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut

435
C4/Creators/Layout.pm Normal file
View file

@ -0,0 +1,435 @@
package C4::Creators::Layout;
use strict;
use warnings;
use autouse 'Data::Dumper' => qw(Dumper);
use C4::Context;
use C4::Debug;
use C4::Creators::PDF;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
# FIXME: Consider this style parameter verification instead...
# my %param = @_;
# for (keys %param)
# { my $lc = lc($_);
# if (exists $default{$lc})
# { $default{$lc} = $param{$_};
# }
# else
# { print STDERR "Unknown parameter $_ , not used \n";
# }
# }
sub _check_params {
my $exit_code = 0;
my @valtmpl_id_params = (
'layout_id',
'barcode_type',
'printing_type',
'layout_name',
'guidebox',
'font',
'font_size',
'callnum_split',
'text_justify',
'format_string',
'layout_xml', # FIXME: all layouts should be stored in xml format to greatly simplify handling -chris_n
'creator',
);
if (scalar(@_) >1) {
my %given_params = @_;
foreach my $key (keys %given_params) {
if (!(grep m/$key/, @valtmpl_id_params)) {
warn sprintf('(Multiple parameters) Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valtmpl_id_params)) {
warn sprintf('(Single parameter) Unrecognized parameter type of "%s".', $_);
$exit_code = 1;
}
}
return $exit_code;
}
sub new {
my $invocant = shift;
my $self = '';
if (_check_params(@_) eq 1) {
return -1;
}
my $type = ref($invocant) || $invocant;
if (grep {$_ eq 'Labels'} @_) {
$self = {
barcode_type => 'CODE39',
printing_type => 'BAR',
layout_name => 'DEFAULT',
guidebox => 0,
font => 'TR',
font_size => 3,
callnum_split => 0,
text_justify => 'L',
format_string => 'title, author, isbn, issn, itemtype, barcode, callnumber',
@_,
};
}
elsif (grep {$_ eq 'Patroncards'} @_) {
$self = {
layout_xml => '<opt>Default Layout</opt>',
@_,
}
}
bless ($self, $type);
return $self;
}
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $query = "SELECT * FROM creator_layouts WHERE layout_id = ? AND creator = ?";
#warn "QUERY: $query\n"; #XXX Remove
#warn "PARAMS: layout_id=" . $opts{'layout_id'} . " creator=" . $opts{'creator'} . "\n"; #XXX Remove
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{'layout_id'}, $opts{'creator'});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $self = $sth->fetchrow_hashref;
bless ($self, $type);
return $self;
}
sub delete {
my $self = {};
my %opts = ();
my $call_type = '';
my @params = ();
if (ref($_[0])) {
$self = shift; # check to see if this is a method call
$call_type = 'C4::Labels::Layout->delete';
push @params, $self->{'layout_id'}, $self->{'creator'};
}
else {
my $class = shift;
%opts = @_;
$call_type = $class . '::delete';
push @params, $opts{'layout_id'}, $opts{'creator'};
}
if (scalar(@params) < 2) { # If there is no layout id or creator type then we cannot delete it
warn sprintf('%s : Cannot delete layout as the profile id is invalid or non-existant.', $call_type) if !$params[0];
warn sprintf('%s : Cannot delete layout as the creator type is invalid or non-existant.', $call_type) if !$params[1];
return -1;
}
my $query = "DELETE FROM creator_layouts WHERE layout_id = ? AND creator = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error on attempted DELETE: %s', $sth->errstr);
return -1;
}
}
sub save {
my $self = shift;
if ($self->{'layout_id'}) { # if we have an id, the record exists and needs UPDATE
my @params;
my $query = "UPDATE creator_layouts SET ";
foreach my $key (keys %{$self}) {
next if ($key eq 'layout_id') || ($key eq 'creator');
push (@params, $self->{$key});
$query .= "$key=?, ";
}
$query = substr($query, 0, (length($query)-2));
$query .= " WHERE layout_id=? AND creator = ?;";
push (@params, $self->{'layout_id'}, $self->{'creator'});
my $sth = C4::Context->dbh->prepare($query);
#local $sth->{TraceLevel} = "3"; # enable DBI trace and set level; outputs to STDERR
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
return $self->{'layout_id'};
}
else { # otherwise create a new record
my @params;
my $query = "INSERT INTO creator_layouts (";
foreach my $key (keys %{$self}) {
push (@params, $self->{$key});
$query .= "$key, ";
}
$query = substr($query, 0, (length($query)-2));
$query .= ") VALUES (";
for (my $i=1; $i<=(scalar keys %$self); $i++) {
$query .= "?,";
}
$query = substr($query, 0, (length($query)-1));
$query .= ");";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $sth1 = C4::Context->dbh->prepare("SELECT MAX(layout_id) FROM creator_layouts;");
$sth1->execute();
my $id = $sth1->fetchrow_array;
$self->{'layout_id'} = $id;
return $id;
}
}
sub get_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my ($attr) = @_;
if (exists($self->{$attr})) {
return $self->{$attr};
}
else {
return -1;
}
return;
}
sub set_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my %attrs = @_;
foreach my $attrib (keys(%attrs)) {
$self->{$attrib} = $attrs{$attrib};
};
return 0;
}
sub get_text_wrap_cols {
my $self = shift;
my %params = @_;
my $string = '';
my $strwidth = 0;
my $col_count = 0;
my $textlimit = $params{'label_width'} - ( 3 * $params{'left_text_margin'});
while ($strwidth < $textlimit) {
$string .= '0';
$col_count++;
$strwidth = C4::Creators::PDF->StrWidth( $string, $self->{'font'}, $self->{'font_size'} );
}
return $col_count;
}
1;
__END__
=head1 NAME
C4::Labels::Layout -A class for creating and manipulating layout objects in Koha
=head1 ABSTRACT
This module provides methods for creating, retrieving, and otherwise manipulating label layout objects used by Koha to create and export labels.
=head1 METHODS
=head2 new()
Invoking the I<new> method constructs a new layout object containing the default values for a layout.
The following parameters are optionally accepted as key => value pairs:
C<barcode_type> Defines the barcode type to be used on labels. NOTE: At present only the following barcode types are supported in the label creator code:
=over 9
=item .
CODE39 = Code 3 of 9
=item .
CODE39MOD = Code 3 of 9 with modulo 43 checksum
=item .
CODE39MOD10 = Code 3 of 9 with modulo 10 checksum
=item .
COOP2OF5 = A varient of 2 of 5 barcode based on NEC's "Process 8000" code
=item .
INDUSTRIAL2OF5 = The standard 2 of 5 barcode (a binary level bar code developed by Identicon Corp. and Computer Identics Corp. in 1970)
=back
C<printing_type> Defines the general layout to be used on labels. NOTE: At present there are only five printing types supported in the label creator code:
=over 9
=item .
BIB = Only the bibliographic data is printed
=item .
BARBIB = Barcode proceeds bibliographic data
=item .
BIBBAR = Bibliographic data proceeds barcode
=item .
ALT = Barcode and bibliographic data are printed on alternating labels
=item .
BAR = Only the barcode is printed
=back
C<layout_name> The descriptive name for this layout.
C<guidebox> Setting this to '1' will result in a guide box being drawn around the labels marking the edge of each label
C<font> Defines the type of font to be used on labels. NOTE: The following fonts are available by default on most systems:
=over 9
=item .
TR = Times-Roman
=item .
TB = Times Bold
=item .
TI = Times Italic
=item .
TBI = Times Bold Italic
=item .
C = Courier
=item .
CB = Courier Bold
=item .
CO = Courier Oblique (Italic)
=item .
CBO = Courier Bold Oblique
=item .
H = Helvetica
=item .
HB = Helvetica Bold
=item .
HBO = Helvetical Bold Oblique
=back
C<font_size> Defines the size of the font in postscript points to be used on labels
C<callnum_split> Setting this to '1' will enable call number splitting on labels
C<text_justify> Defines the text justification to be used on labels. NOTE: The following justification styles are currently supported by label creator code:
=over 9
=item .
L = Left
=item .
C = Center
=item .
R = Right
=back
C<format_string> Defines what fields will be printed and in what order they will be printed on labels. These include any of the data fields that may be mapped
to your MARC frameworks. Specify MARC subfields as a 4-character tag-subfield string: ie. 254a Enclose a whitespace-separated list of fields
to concatenate on one line in double quotes. ie. "099a 099b" or "itemcallnumber barcode" Static text strings may be entered in single-quotes:
ie. 'Some static text here.'
example:
C<my $layout = Layout->new(); # Creates and returns a new layout object>
C<my $layout = C4::Labels::Layout->new(barcode_type => 'CODE39', printing_type => 'BIBBAR', font => 'C', font_size => 6); # Creates and returns a new layout object using
the supplied values to override the defaults>
B<NOTE:> This layout is I<not> written to the database until save() is invoked. You have been warned!
=head2 retrieve(layout_id => layout_id)
Invoking the I<retrieve> method constructs a new layout object containing the current values for layout_id. The method returns a new object upon success and 1 upon failure.
Errors are logged to the Apache log.
example:
C<my $layout = Layout->retrieve(layout_id => 1); # Retrieves layout record 1 and returns an object containing the record>
=head2 delete()
Invoking the delete method attempts to delete the layout from the database. The method returns 0 upon success and -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair simply deleteing that template from the database. See the example below.
examples:
C<my $exitstat = $layout->delete(); # to delete the record behind the $layout object>
C<my $exitstat = Layout->delete(layout_id => 1); # to delete layout record 1>
=head2 save()
Invoking the I<save> method attempts to insert the layout into the database if the layout is new and update the existing layout record if the layout exists.
The method returns the new record id upon success and -1 upon failure (This avoids conflicting with a record id of 1). Errors are logged to the Apache log.
example:
C<my $exitstat = $layout->save(); # to save the record behind the $layout object>
=head2 get_attr($attribute)
Invoking the I<get_attr> method will return the value of the requested attribute or -1 on errors.
example:
C<my $value = $layout->get_attr($attribute);>
=head2 set_attr(attribute => value, attribute_2 => value)
Invoking the I<set_attr> method will set the value of the supplied attributes to the supplied values. The method accepts key/value pairs separated by
commas.
example:
C<$layout->set_attr(attribute => value);>
=head2 get_text_wrap_cols()
Invoking the I<get_text_wrap_cols> method will return the number of columns that can be printed on the label before wrapping to the next line.
examples:
C<my $text_wrap_cols = $layout->get_text_wrap_cols();>
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut

605
C4/Creators/Lib.pm Normal file
View file

@ -0,0 +1,605 @@
package C4::Creators::Lib;
# Copyright 2009 Foundations Bible College.
#
# This file is part of Koha.
#
# Koha 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.
#
# Koha 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.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use warnings;
use autouse 'Data::Dumper' => qw(Dumper);
use C4::Context;
use C4::Debug;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
use base qw(Exporter);
our @EXPORT_OK = qw(get_all_templates
get_all_layouts
get_all_profiles
get_all_image_names
get_batch_summary
get_label_summary
get_card_summary
get_barcode_types
get_label_types
get_font_types
get_text_justification_types
get_output_formats
get_column_names
get_table_names
get_unit_values
html_table
);
}
#=head2 C4::Creators::Lib::_SELECT()
#
# This function returns a recordset upon success and 1 upon failure. Errors are logged to the Apache log.
#
# examples:
#
# my $field_value = _SELECT(field_name, table_name, condition);
#
#=cut
sub _SELECT {
my @params = @_;
my $query = "SELECT $params[0] FROM $params[1]";
$params[2] ? $query .= " WHERE $params[2];" : $query .= ';';
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute();
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return 1;
}
my $record_set = [];
while (my $row = $sth->fetchrow_hashref()) {
push(@$record_set, $row);
}
return $record_set;
}
my $barcode_types = [
{type => 'CODE39', name => 'Code 39', desc => 'Translates the characters 0-9, A-Z, \'-\', \'*\', \'+\', \'$\', \'%\', \'/\', \'.\' and \' \' to a barcode pattern.', selected => 0},
{type => 'CODE39MOD', name => 'Code 39 + Modulo43', desc => 'Translates the characters 0-9, A-Z, \'-\', \'*\', \'+\', \'$\', \'%\', \'/\', \'.\' and \' \' to a barcode pattern. Encodes Mod 43 checksum.', selected => 0},
{type => 'CODE39MOD10', name => 'Code 39 + Modulo10', desc => 'Translates the characters 0-9, A-Z, \'-\', \'*\', \'+\', \'$\', \'%\', \'/\', \'.\' and \' \' to a barcode pattern. Encodes Mod 10 checksum.', selected => 0},
{type => 'COOP2OF5', name => 'COOP2of5', desc => 'Creates COOP2of5 barcodes from a string consisting of the numeric characters 0-9', selected => 0},
# {type => 'EAN13', name => 'EAN13', desc => 'Creates EAN13 barcodes from a string of 12 or 13 digits. The check number (the 13:th digit) is calculated if not supplied.', selected => 0},
# {type => 'EAN8', name => 'EAN8', desc => 'Translates a string of 7 or 8 digits to EAN8 barcodes. The check number (the 8:th digit) is calculated if not supplied.', selected => 0},
# {type => 'IATA2of5', name => 'IATA2of5', desc => 'Creates IATA2of5 barcodes from a string consisting of the numeric characters 0-9', selected => 0},
{type => 'INDUSTRIAL2OF5', name => 'Industrial2of5', desc => 'Creates Industrial2of5 barcodes from a string consisting of the numeric characters 0-9', selected => 0},
# {type => 'ITF', name => 'Interleaved2of5', desc => 'Translates the characters 0-9 to a barcodes. These barcodes could also be called 'Interleaved2of5'.', selected => 0},
# {type => 'MATRIX2OF5', name => 'Matrix2of5', desc => 'Creates Matrix2of5 barcodes from a string consisting of the numeric characters 0-9', selected => 0},
# {type => 'NW7', name => 'NW7', desc => 'Creates a NW7 barcodes from a string consisting of the numeric characters 0-9', selected => 0},
# {type => 'UPCA', name => 'UPCA', desc => 'Translates a string of 11 or 12 digits to UPCA barcodes. The check number (the 12:th digit) is calculated if not supplied.', selected => 0},
# {type => 'UPCE', name => 'UPCE', desc => 'Translates a string of 6, 7 or 8 digits to UPCE barcodes. If the string is 6 digits long, '0' is added first in the string. The check number (the 8:th digit) is calculated if not supplied.', selected => 0},
];
my $label_types = [
{type => 'BIB', name => 'Biblio', desc => 'Only the bibliographic data is printed.', selected => 0},
{type => 'BARBIB', name => 'Barcode/Biblio', desc => 'Barcode proceeds bibliographic data.', selected => 0},
{type => 'BIBBAR', name => 'Biblio/Barcode', desc => 'Bibliographic data proceeds barcode.', selected => 0},
{type => 'ALT', name => 'Alternating', desc => 'Barcode and bibliographic data are printed on alternating labels.', selected => 0},
{type => 'BAR', name => 'Barcode', desc => 'Only the barcode is printed.', selected => 0},
];
my $font_types = [
{type => 'TR', name => 'Times-Roman', selected => 0},
{type => 'TB', name => 'Times-Bold', selected => 0},
{type => 'TI', name => 'Times-Italic', selected => 0},
{type => 'TBI', name => 'Times-Bold-Italic', selected => 0},
{type => 'C', name => 'Courier', selected => 0},
{type => 'CB', name => 'Courier-Bold', selected => 0},
{type => 'CO', name => 'Courier-Oblique', selected => 0},
{type => 'CBO', name => 'Courier-Bold-Oblique', selected => 0},
{type => 'H', name => 'Helvetica', selected => 0},
{type => 'HB', name => 'Helvetica-Bold', selected => 0},
{type => 'HBO', name => 'Helvetica-Bold-Oblique', selected => 0},
];
my $text_justification_types = [
{type => 'L', name => 'Left', selected => 0},
{type => 'C', name => 'Center', selected => 0},
{type => 'R', name => 'Right', selected => 0},
# {type => 'F', name => 'Full', selected => 0},
];
my $unit_values = [
{type => 'POINT', desc => 'PostScript Points', value => 1, selected => 0},
{type => 'AGATE', desc => 'Adobe Agates', value => 5.1428571, selected => 0},
{type => 'INCH', desc => 'US Inches', value => 72, selected => 0},
{type => 'MM', desc => 'SI Millimeters', value => 2.83464567, selected => 0},
{type => 'CM', desc => 'SI Centimeters', value => 28.3464567, selected => 0},
];
my $output_formats = [
{type => 'pdf', desc => 'PDF File'},
{type => 'csv', desc => 'CSV File'},
];
=head2 C4::Creators::Lib::get_all_templates()
This function returns a reference to a hash containing all templates upon success and 1 upon failure. Errors are logged to the Apache log.
examples:
my $templates = get_all_templates();
=cut
sub get_all_templates {
my %params = @_;
my @templates = ();
my $query = "SELECT " . ($params{'field_list'} ? $params{'field_list'} : '*') . " FROM creator_templates";
$query .= ($params{'filter'} ? " WHERE $params{'filter'};" : ';');
my $sth = C4::Context->dbh->prepare($query);
$sth->execute();
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
ADD_TEMPLATES:
while (my $template = $sth->fetchrow_hashref) {
push(@templates, $template);
}
return \@templates;
}
=head2 C4::Creators::Lib::get_all_layouts()
This function returns a reference to a hash containing all layouts upon success and 1 upon failure. Errors are logged to the Apache log.
examples:
my $layouts = get_all_layouts();
=cut
sub get_all_layouts {
my %params = @_;
my @layouts = ();
my $query = "SELECT " . ($params{'field_list'} ? $params{'field_list'} : '*') . " FROM creator_layouts";
$query .= ($params{'filter'} ? " WHERE $params{'filter'};" : ';');
my $sth = C4::Context->dbh->prepare($query);
$sth->execute();
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
ADD_LAYOUTS:
while (my $layout = $sth->fetchrow_hashref) {
push(@layouts, $layout);
}
return \@layouts;
}
=head2 C4::Creators::Lib::get_all_profiles()
This function returns an arrayref whose elements are hashes containing all profiles upon success and 1 upon failure. Errors are logged
to the Apache log. Two parameters are accepted. The first limits the field(s) returned. This parameter should be string of comma separted
fields. ie. "field_1, field_2, ...field_n" The second limits the records returned based on a string containing a valud SQL 'WHERE' filter.
NOTE: Do not pass in the keyword 'WHERE.'
examples:
my $profiles = get_all_profiles();
my $profiles = get_all_profiles(field_list => field_list, filter => filter_string);
=cut
sub get_all_profiles {
my %params = @_;
my @profiles = ();
my $query = "SELECT " . ($params{'field_list'} ? $params{'field_list'} : '*') . " FROM printers_profile";
$query .= ($params{'filter'} ? " WHERE $params{'filter'};" : ';');
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3 if $debug;
$sth->execute();
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
ADD_PROFILES:
while (my $profile = $sth->fetchrow_hashref) {
push(@profiles, $profile);
}
return \@profiles;
}
=head2 C4::Creators::Lib::get_all_image_names()
=cut
sub get_all_image_names {
my $image_names = [];
my $query = "SELECT image_name FROM creator_images";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3 if $debug;
$sth->execute();
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
grep {push @$image_names, {type => $$_[0], name => $$_[0], selected => 0}} @{$sth->fetchall_arrayref([0])};
return $image_names;
}
=head2 C4::Creators::Lib::get_batch_summary()
This function returns an arrayref whose elements are hashes containing the batch_ids of current batches along with the item count
for each batch upon success and 1 upon failure. Item counts are stored under the key '_item_count' Errors are logged to the Apache log.
One parameter is accepted which limits the records returned based on a string containing a valud SQL 'WHERE' filter.
NOTE: Do not pass in the keyword 'WHERE.'
examples:
my $batches = get_batch_summary();
my $batches = get_batch_summary(filter => filter_string);
=cut
sub get_batch_summary {
my %params = @_;
my @batches = ();
my $query = "SELECT DISTINCT batch_id FROM creator_batches WHERE creator=?";
$query .= ($params{'filter'} ? " AND $params{'filter'};" : ';');
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($params{'creator'});
if ($sth->err) {
warn sprintf('Database returned the following error on attempted SELECT: %s', $sth->errstr);
return -1;
}
ADD_BATCHES:
while (my $batch = $sth->fetchrow_hashref) {
my $query = "SELECT count(batch_id) FROM creator_batches WHERE batch_id=? AND creator=?;";
my $sth1 = C4::Context->dbh->prepare($query);
$sth1->execute($batch->{'batch_id'}, $params{'creator'});
if ($sth1->err) {
warn sprintf('Database returned the following error on attempted SELECT count: %s', $sth1->errstr);
return -1;
}
my $count = $sth1->fetchrow_arrayref;
$batch->{'_item_count'} = @$count[0];
push(@batches, $batch);
}
return \@batches;
}
=head2 C4::Creators::Lib::get_label_summary()
This function returns an arrayref whose elements are hashes containing the label_ids of current labels along with the item count
for each label upon success and 1 upon failure. Item counts are stored under the key '_item_count' Errors are logged to the Apache log.
One parameter is accepted which limits the records returned based on a string containing a valud SQL 'WHERE' filter.
NOTE: Do not pass in the keyword 'WHERE.'
examples:
my $labels = get_label_summary();
my $labels = get_label_summary(items => @item_list);
=cut
sub get_label_summary {
my %params = @_;
my $label_number = 0;
my @label_summaries = ();
my $query = " SELECT b.title, b.author, bi.itemtype, i.barcode, i.biblionumber
FROM creator_batches AS c LEFT JOIN items AS i ON (c.item_number=i.itemnumber)
LEFT JOIN biblioitems AS bi ON (i.biblioitemnumber=bi.biblioitemnumber)
LEFT JOIN biblio AS b ON (bi.biblionumber=b.biblionumber)
WHERE itemnumber=? AND batch_id=?;
";
my $sth = C4::Context->dbh->prepare($query);
foreach my $item (@{$params{'items'}}) {
$label_number++;
$sth->execute($item->{'item_number'}, $params{'batch_id'});
if ($sth->err) {
warn sprintf('Database returned the following error on attempted SELECT: %s', $sth->errstr);
return -1;
}
my $record = $sth->fetchrow_hashref;
my $label_summary->{'_label_number'} = $label_number;
$record->{'author'} =~ s/[^\.|\w]$// if $record->{'author'}; # strip off ugly trailing chars... but not periods or word chars
$record->{'title'} =~ s/\W*$//; # strip off ugly trailing chars
# FIXME contructing staff interface URLs should be done *much* higher up the stack - for the most part, C4 module code
# should not know that it's part of a web app
$record->{'title'} = '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' . $record->{'biblionumber'} . '"> ' . $record->{'title'} . '</a>';
$label_summary->{'_summary'} = $record->{'title'} . " | " . ($record->{'author'} ? $record->{'author'} : 'N/A');
$label_summary->{'_item_type'} = $record->{'itemtype'};
$label_summary->{'_barcode'} = $record->{'barcode'};
$label_summary->{'_item_number'} = $item->{'item_number'};
$label_summary->{'_label_id'} = $item->{'label_id'};
push (@label_summaries, $label_summary);
}
return \@label_summaries;
}
=head2 C4::Creators::Lib::get_card_summary()
This function returns an arrayref whose elements are hashes containing the label_ids of current cards along with the item count
for each card upon success and 1 upon failure. Item counts are stored under the key '_item_count' Errors are logged to the Apache log.
One parameter is accepted which limits the records returned based on a string containing a valud SQL 'WHERE' filter.
NOTE: Do not pass in the keyword 'WHERE.'
examples:
my $cards = get_card_summary();
my $cards = get_card_summary(items => @item_list);
=cut
sub get_card_summary {
my %params = @_;
my $card_number = 0;
my @card_summaries = ();
my $query = "SELECT CONCAT_WS(', ', surname, firstname) AS name, cardnumber FROM borrowers WHERE borrowernumber=?;";
my $sth = C4::Context->dbh->prepare($query);
foreach my $item (@{$params{'items'}}) {
$card_number++;
$sth->execute($item->{'borrower_number'});
if ($sth->err) {
warn sprintf('Database returned the following error on attempted SELECT: %s', $sth->errstr);
return -1;
}
my $record = $sth->fetchrow_hashref;
my $card_summary->{'_card_number'} = $card_number;
$card_summary->{'_summary'} = $record->{'name'};
$card_summary->{'borrowernumber'} = $item->{'borrower_number'};
$card_summary->{'_label_id'} = $item->{'label_id'};
push (@card_summaries, $card_summary);
}
return \@card_summaries;
}
=head2 C4::Creators::Lib::get_barcode_types()
This function returns a reference to an array of hashes containing all barcode types along with their name and description.
examples:
my $barcode_types = get_barcode_types();
=cut
sub get_barcode_types {
return $barcode_types;
}
=head2 C4::Creators::Lib::get_label_types()
This function returns a reference to an array of hashes containing all label types along with their name and description.
examples:
my $label_types = get_label_types();
=cut
sub get_label_types {
return $label_types;
}
=head2 C4::Creators::Lib::get_font_types()
This function returns a reference to an array of hashes containing all font types along with their name and description.
examples:
my $font_types = get_font_types();
=cut
sub get_font_types {
return $font_types;
}
=head2 C4::Creators::Lib::get_text_justification_types()
This function returns a reference to an array of hashes containing all text justification types along with their name and description.
examples:
my $text_justification_types = get_text_justification_types();
=cut
sub get_text_justification_types {
return $text_justification_types;
}
=head2 C4::Creators::Lib::get_unit_values()
This function returns a reference to an array of hashes containing all unit types along with their description and multiplier. NOTE: All units are relative to a PostScript Point.
There are 72 PS points to the inch.
examples:
my $unit_values = get_unit_values();
=cut
sub get_unit_values {
return $unit_values;
}
=head2 C4::Creators::Lib::get_output_formats()
This function returns a reference to an array of hashes containing all label output formats along with their description.
examples:
my $label_output_formats = get_output_formats();
=cut
sub get_output_formats {
return $output_formats;
}
=head2 C4::Creators::Lib::get_column_names($table_name)
Return an arrayref of an array containing the column names of the supplied table.
=cut
sub get_column_names {
my $table = shift;
my $dbh = C4::Context->dbh();
my $column_names = [];
my $sth = $dbh->column_info(undef,undef,$table,'%');
while (my $info = $sth->fetchrow_hashref()){
$$column_names[$info->{'ORDINAL_POSITION'}] = $info->{'COLUMN_NAME'};
}
return $column_names;
}
=head2 C4::Creators::Lib::get_table_names($search_term)
Return an arrayref of an array containing the table names which contain the supplied search term.
=cut
sub get_table_names {
my $search_term = shift;
my $dbh = C4::Context->dbh();
my $table_names = [];
my $sth = $dbh->table_info(undef,undef,"%$search_term%");
while (my $info = $sth->fetchrow_hashref()){
push (@$table_names, $info->{'TABLE_NAME'});
}
return $table_names;
}
=head2 C4::Creators::Lib::html_table()
This function returns an arrayref of an array of hashes contianing the supplied data formatted suitably to
be passed off as a T::P template parameter and used to build an html table.
examples:
my $table = html_table(header_fields, array_of_row_data);
$template->param(
TABLE => $table,
);
html example:
<table>
<!-- TMPL_LOOP NAME="TABLE" -->
<!-- TMPL_IF NAME="header_fields" -->
<tr>
<!-- TMPL_LOOP NAME="header_fields" -->
<th><!-- TMPL_VAR NAME="field_label" --></th>
<!-- /TMPL_LOOP -->
</tr>
<!-- TMPL_ELSE -->
<tr>
<!-- TMPL_LOOP NAME="text_fields" -->
<!-- TMPL_IF NAME="select_field" -->
<td align="center"><input type="checkbox" name="action" value="<!-- TMPL_VAR NAME="field_value" -->" /></td>
<!-- TMPL_ELSIF NAME="field_value" -->
<td><!-- TMPL_VAR NAME="field_value" --></td>
<!-- TMPL_ELSE -->
<td>&nbsp;</td>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</tr>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</table>
=cut
sub html_table {
my $headers = shift;
my $data = shift;
return undef if scalar(@$data) == 0; # no need to generate a table if there is not data to display
my $table = [];
my $fields = [];
my @table_columns = ();
my ($row_index, $col_index) = (0,0);
my $cols = 0; # number of columns to wrap on
my $field_count = 0;
my $select_value = undef;
my $link_field = undef;
POPULATE_HEADER:
foreach my $header (@$headers) {
my @key = keys %$header;
if ($key[0] eq 'select' ) {
push (@table_columns, $key[0]);
$$fields[$col_index] = {hidden => 0, select_field => 0, field_name => ($key[0]), field_label => $header->{$key[0]}{'label'}};
# do special formatting stuff....
$select_value = $header->{$key[0]}{'value'};
}
else {
# do special formatting stuff....
$link_field->{$key[0]} = ($header->{$key[0]}{'link_field'} == 1 ? 1 : 0);
push (@table_columns, $key[0]);
$$fields[$col_index] = {hidden => 0, select_field => 0, field_name => ($key[0]), field_label => $header->{$key[0]}{'label'}};
}
$field_count++;
$col_index++;
}
$$table[$row_index] = {header_fields => $fields};
$cols = $col_index;
$field_count *= scalar(@$data); # total fields to be displayed in the table
$col_index = 0;
$row_index++;
$fields = [];
POPULATE_TABLE:
foreach my $db_row (@$data) {
POPULATE_ROW:
foreach my $table_column (@table_columns) {
if (grep {$table_column eq $_} keys %$db_row) {
$$fields[$col_index] = {hidden => 0, link_field => $link_field->{$table_column}, select_field => 0, field_name => ($table_column . "_tbl"), field_value => $db_row->{$table_column}};
$col_index++;
next POPULATE_ROW;
}
elsif ($table_column =~ m/^_((.*)_(.*$))/) { # this a special case
my $table_name = get_table_names($2);
my $record_set = _SELECT($1, @$table_name[0], $2 . "_id = " . $db_row->{$2 . "_id"});
$$fields[$col_index] = {hidden => 0, link_field => $link_field->{$table_column}, select_field => 0, field_name => ($table_column . "_tbl"), field_value => $$record_set[0]{$1}};
$col_index++;
next POPULATE_ROW;
}
elsif ($table_column eq 'select' ) {
$$fields[$col_index] = {hidden => 0, select_field => 1, field_name => 'select', field_value => $db_row->{$select_value}};
}
}
$$table[$row_index] = {text_fields => $fields};
$col_index = 0;
$row_index++;
$fields = [];
}
return $table;
}
1;
__END__
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=cut

View file

@ -1,9 +1,9 @@
package C4::Labels::PDF;
package C4::Creators::PDF;
# Copyright 2009 Foundations Bible College.
#
# This file is part of Koha.
#
#
# Koha 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
@ -135,10 +135,16 @@ sub Init {
prInit($string, $duplicateCode);
}
sub AltJpeg {
my $self = shift;
my ($imageData, $width, $height, $imageFormat, $altImageData, $altImageWidth, $altImageHeight, $altImageFormat) = @_;
return prAltJpeg($imageData, $width, $height, $imageFormat, $altImageData, $altImageWidth, $altImageHeight, $altImageFormat);
}
sub Jpeg {
my $self = shift;
my ($imageFile, $width, $height) = @_;
return prJpeg($imageFile, $width, $height);
my ($imageData, $width, $height, $imageFormat) = @_;
return prJpeg($imageData, $width, $height, $imageFormat);
}
sub Js {
@ -279,8 +285,8 @@ __END__
=head1 NAME
C4::Labels::PDF - A class wrapper for PDF::Reuse and PDF::Reuse::Barcode to allow usage as a psuedo-object. For usage see
PDF::Reuse documentation and C4::Labels::PDF code.
C4::Creators::PDF - A class wrapper for PDF::Reuse and PDF::Reuse::Barcode to allow usage as a psuedo-object. For usage see
PDF::Reuse documentation and C4::Creators::PDF code.
=cut

364
C4/Creators/Profile.pm Normal file
View file

@ -0,0 +1,364 @@
package C4::Creators::Profile;
use strict;
use warnings;
use autouse 'Data::Dumper' => qw(Dumper);
use C4::Context;
use C4::Debug;
use C4::Creators::Lib 1.000000 qw(get_unit_values);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
sub _check_params {
my $given_params = {};
my $exit_code = 0;
my @valid_profile_params = (
'printer_name',
'template_id',
'paper_bin',
'offset_horz',
'offset_vert',
'creep_horz',
'creep_vert',
'units',
'creator',
);
if (scalar(@_) >1) {
$given_params = {@_};
foreach my $key (keys %{$given_params}) {
if (!(grep m/$key/, @valid_profile_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valid_profile_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $_);
$exit_code = 1;
}
}
return $exit_code;
}
sub _conv_points {
my $self = shift;
my @unit_value = grep {$_->{'type'} eq $self->{units}} @{get_unit_values()};
$self->{offset_horz} = $self->{offset_horz} * $unit_value[0]->{'value'};
$self->{offset_vert} = $self->{offset_vert} * $unit_value[0]->{'value'};
$self->{creep_horz} = $self->{creep_horz} * $unit_value[0]->{'value'};
$self->{creep_vert} = $self->{creep_vert} * $unit_value[0]->{'value'};
return $self;
}
sub new {
my $invocant = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my $type = ref($invocant) || $invocant;
my $self = {
printer_name => 'Default Printer',
template_id => '',
paper_bin => 'Tray 1',
offset_horz => 0,
offset_vert => 0,
creep_horz => 0,
creep_vert => 0,
units => 'POINT',
@_,
};
bless ($self, $type);
return $self;
}
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $query = "SELECT * FROM printers_profile WHERE profile_id = ? AND creator = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{'profile_id'}, $opts{'creator'});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $self = $sth->fetchrow_hashref;
$self = _conv_points($self) if ($opts{convert} && $opts{convert} == 1);
bless ($self, $type);
return $self;
}
sub delete {
my $self = {};
my %opts = ();
my $call_type = '';
my @params = ();
if (ref($_[0])) {
$self = shift; # check to see if this is a method call
$call_type = 'C4::'. $self->{'creator'} .'::Profile->delete';
push @params, $self->{'profile_id'}, $self->{'creator'};
}
else {
my $class = shift; #XXX: is this too hackish?
%opts = @_;
$call_type = $class . "::delete";
push @params, $opts{'profile_id'}, $opts{'creator'};
}
if (scalar(@params) < 2) { # If there is no profile id or creator type then we cannot delete it
warn sprintf('%s : Cannot delete profile as the profile id is invalid or non-existant.', $call_type) if !$params[0];
warn sprintf('%s : Cannot delete profile as the creator type is invalid or non-existant.', $call_type) if !$params[1];
return -1;
}
my $query = "DELETE FROM printers_profile WHERE profile_id = ? AND creator = ?";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error on attempted DELETE: %s', $sth->errstr);
return -1;
}
}
sub save {
my $self = shift;
if ($self->{'profile_id'}) { # if we have an profile_id, the record exists and needs UPDATE
my @params;
my $query = "UPDATE printers_profile SET ";
foreach my $key (keys %{$self}) {
next if ($key eq 'profile_id') || ($key eq 'creator');
push (@params, $self->{$key});
$query .= "$key=?, ";
}
$query = substr($query, 0, (length($query)-2));
push (@params, $self->{'profile_id'}, $self->{'creator'});
$query .= " WHERE profile_id=? AND creator=?;";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error on attempted UPDATE: %s', $sth->errstr);
return -1;
}
return $self->{'profile_id'};
}
else { # otherwise create a new record
my @params;
my $query = "INSERT INTO printers_profile (";
foreach my $key (keys %{$self}) {
push (@params, $self->{$key});
$query .= "$key, ";
}
$query = substr($query, 0, (length($query)-2));
$query .= ") VALUES (";
for (my $i=1; $i<=(scalar keys %$self); $i++) {
$query .= "?,";
}
$query = substr($query, 0, (length($query)-1));
$query .= ");";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error on attempted INSERT: %s', $sth->errstr);
return -1;
}
my $sth1 = C4::Context->dbh->prepare("SELECT MAX(profile_id) FROM printers_profile;");
$sth1->execute();
my $tmpl_id = $sth1->fetchrow_array;
return $tmpl_id;
}
}
sub get_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my ($attr) = @_;
if (exists($self->{$attr})) {
return $self->{$attr};
}
else {
warn sprintf('%s is currently undefined.', $attr);
return -1;
}
}
sub set_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my %attrs = @_;
foreach my $attrib (keys(%attrs)) {
$self->{$attrib} = $attrs{$attrib};
};
return 0;
}
1;
__END__
=head1 NAME
C4::Labels::Profile - A class for creating and manipulating profile objects in Koha
=head1 ABSTRACT
This module provides methods for creating, retrieving, and otherwise manipulating label profile objects used by Koha to create and export labels.
=head1 METHODS
=head2 new()
Invoking the I<new> method constructs a new profile object containing the default values for a template.
The following parameters are optionally accepted as key => value pairs:
C<printer_name> The name of the printer to which this profile applies.
C<template_id> The template to which this profile may be applied. NOTE: There may be multiple profiles which may be applied to the same template.
C<paper_bin> The paper bin of the above printer to which this profile applies. NOTE: printer name, template id, and paper bin must form a unique combination.
C<offset_horz> Amount of compensation for horizontal offset (position of text on a single label). This amount is measured in the units supplied by the units parameter in this profile.
C<offset_vert> Amount of compensation for vertical offset.
C<creep_horz> Amount of compensation for horizontal creep (tendency of text to 'creep' off of the labels over the span of the entire page).
C<creep_vert> Amount of compensation for vertical creep.
C<units> The units of measure used for this template. These B<must> match the measures you supply above or
bad things will happen to your document. NOTE: The only supported units at present are:
=over 9
=item .
POINT = Postscript Points (This is the base unit in the Koha label creator.)
=item .
AGATE = Adobe Agates (5.1428571 points per)
=item .
INCH = US Inches (72 points per)
=item .
MM = SI Millimeters (2.83464567 points per)
=item .
CM = SI Centimeters (28.3464567 points per)
=back
example:
C<my $profile = C4::Labels::Profile->new(); # Creates and returns a new profile object>
C<my $profile = C4::Labels::Profile->new(template_id => 1, paper_bin => 'Bypass Tray', offset_horz => 0.02, units => 'POINT'); # Creates and returns a new profile object using
the supplied values to override the defaults>
B<NOTE:> This profile is I<not> written to the database until save() is invoked. You have been warned!
=head2 retrieve(profile_id => $profile_id, convert => 1)
Invoking the I<retrieve> method constructs a new profile object containing the current values for profile_id. The method returns a new object upon success and 1 upon failure.
Errors are logged to the Apache log. One further option maybe accessed. See the examples below for further description.
examples:
C<my $profile = C4::Labels::Profile->retrieve(profile_id => 1); # Retrieves profile record 1 and returns an object containing the record>
C<my $profile = C4::Labels::Profile->retrieve(profile_id => 1, convert => 1); # Retrieves profile record 1, converts the units to points and returns an object containing the record>
=head2 delete()
Invoking the delete method attempts to delete the profile from the database. The method returns -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair simply deleteing that profile from the database. See the example below.
examples:
C<my $exitstat = $profile->delete(); # to delete the record behind the $profile object>
C<my $exitstat = C4::Labels::Profile::delete(profile_id => 1); # to delete profile record 1>
=head2 save()
Invoking the I<save> method attempts to insert the profile into the database if the profile is new and update the existing profile record if the profile exists. The method returns
the new record profile_id upon success and -1 upon failure (This avoids conflicting with a record profile_id of 1). Errors are logged to the Apache log.
example:
C<my $exitstat = $profile->save(); # to save the record behind the $profile object>
=head2 get_attr($attribute)
Invoking the I<get_attr> method will return the value of the requested attribute or -1 on errors.
example:
C<my $value = $profile->get_attr($attribute);>
=head2 set_attr(attribute => value, attribute_2 => value)
Invoking the I<set_attr> method will set the value of the supplied attributes to the supplied values. The method accepts key/value pairs separated by commas.
example:
$profile->set_attr(attribute => value);
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut
#=head1
#drawbox( ($left_margin), ($top_margin), ($page_width-(2*$left_margin)), ($page_height-(2*$top_margin)) ); # FIXME: Breakout code to print alignment page for printer profile setup
#
#=head2 draw_boundaries
#
# sub draw_boundaries ($llx_spine, $llx_circ1, $llx_circ2,
# $lly, $spine_width, $label_height, $circ_width)
#
#This sub draws boundary lines where the label outlines are, to aid in printer testing, and debugging.
#
#=cut
#
## FIXME: Template use for profile adjustment...
##sub draw_boundaries {
##
## my (
## $llx_spine, $llx_circ1, $llx_circ2, $lly,
## $spine_width, $label_height, $circ_width
## ) = @_;
##
## my $lly_initial = ( ( 792 - 36 ) - 90 );
## $lly = $lly_initial; # FIXME - why are we ignoring the y_pos parameter by redefining it?
## my $i = 1;
##
## for ( $i = 1 ; $i <= 8 ; $i++ ) {
##
## _draw_box( $llx_spine, $lly, ($spine_width), ($label_height) );
##
## #warn "OLD BOXES x=$llx_spine, y=$lly, w=$spine_width, h=$label_height";
## _draw_box( $llx_circ1, $lly, ($circ_width), ($label_height) );
## _draw_box( $llx_circ2, $lly, ($circ_width), ($label_height) );
##
## $lly = ( $lly - $label_height );
##
## }
##}
#
#
#
#=cut

430
C4/Creators/Template.pm Normal file
View file

@ -0,0 +1,430 @@
package C4::Creators::Template;
use strict;
use warnings;
use POSIX qw(ceil);
use autouse 'Data::Dumper' => qw(Dumper);
use C4::Context;
use C4::Debug;
use C4::Creators::Profile 1.000000;
use C4::Creators::Lib 1.000000 qw(get_unit_values);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
sub _check_params {
shift if $_[0] =~ m/::/; # this seems a bit hackish
my $given_params = {};
my $exit_code = 0;
my @valid_template_params = (
'profile_id',
'template_code',
'template_desc',
'page_width',
'page_height',
'label_width',
'label_height',
'card_width',
'card_height',
'top_text_margin',
'left_text_margin',
'top_margin',
'left_margin',
'cols',
'rows',
'col_gap',
'row_gap',
'units',
'creator',
'current_label',
);
if (scalar(@_) >1) {
$given_params = {@_};
foreach my $key (keys %{$given_params}) {
if (!(grep m/$key/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $_);
$exit_code = 1;
}
}
return $exit_code;
}
sub _conv_points {
my $self = shift;
my @unit_value = grep {$_->{'type'} eq $self->{'units'}} @{get_unit_values()};
$self->{'page_width'} = $self->{'page_width'} * $unit_value[0]->{'value'};
$self->{'page_height'} = $self->{'page_height'} * $unit_value[0]->{'value'};
$self->{'label_width'} = $self->{'label_width'} * $unit_value[0]->{'value'};
$self->{'label_height'} = $self->{'label_height'} * $unit_value[0]->{'value'};
$self->{'top_text_margin'} = $self->{'top_text_margin'} * $unit_value[0]->{'value'};
$self->{'left_text_margin'} = $self->{'left_text_margin'} * $unit_value[0]->{'value'};
$self->{'top_margin'} = $self->{'top_margin'} * $unit_value[0]->{'value'};
$self->{'left_margin'} = $self->{'left_margin'} * $unit_value[0]->{'value'};
$self->{'col_gap'} = $self->{'col_gap'} * $unit_value[0]->{'value'};
$self->{'row_gap'} = $self->{'row_gap'} * $unit_value[0]->{'value'};
return $self;
}
sub _apply_profile {
my $self = shift;
my $creator = shift;
my $profile = C4::Creators::Profile->retrieve(profile_id => $self->{'profile_id'}, creator => $creator, convert => 1);
$self->{'top_margin'} = $self->{'top_margin'} + $profile->get_attr('offset_vert'); # controls vertical offset
$self->{'left_margin'} = $self->{'left_margin'} + $profile->get_attr('offset_horz'); # controls horizontal offset
$self->{'label_height'} = $self->{'label_height'} + $profile->get_attr('creep_vert'); # controls vertical creep
$self->{'label_width'} = $self->{'label_width'} + $profile->get_attr('creep_horz'); # controls horizontal creep
return $self;
}
sub new {
my $invocant = shift;
my $type = ref($invocant) || $invocant;
if (_check_params(@_) eq 1) {
return -1;
}
my $self = {
profile_id => 0,
template_code => 'DEFAULT TEMPLATE',
template_desc => 'Default description',
page_width => 0,
page_height => 0,
label_width => 0,
label_height => 0,
top_text_margin => 0,
left_text_margin => 0,
top_margin => 0,
left_margin => 0,
cols => 0,
rows => 0,
col_gap => 0,
row_gap => 0,
units => 'POINT',
template_stat => 0, # false if any data has changed and the db has not been updated
@_,
};
bless ($self, $type);
return $self;
}
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $query = "SELECT * FROM " . $opts{'table_name'} . " WHERE template_id = ? AND creator = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{'template_id'}, $opts{'creator'});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $self = $sth->fetchrow_hashref;
$self = _conv_points($self) if (($opts{convert} && $opts{convert} == 1) || $opts{profile_id});
$self = _apply_profile($self, $opts{'creator'}) if $opts{profile_id} && $self->{'profile_id'}; # don't bother if there is no profile_id
$self->{'template_stat'} = 1;
bless ($self, $type);
return $self;
}
sub delete {
my $self = {};
my %opts = ();
my $call_type = '';
my @query_params = ();
if (ref($_[0])) {
$self = shift; # check to see if this is a method call
$call_type = 'C4::Labels::Template->delete';
push @query_params, $self->{'template_id'}, $self->{'creator'};
}
else {
%opts = @_;
$call_type = 'C4::Labels::Template::delete';
push @query_params, $opts{'template_id'}, $opts{'creator'};
}
if (scalar(@query_params) < 2) { # If there is no template id or creator type then we cannot delete it
warn sprintf('%s : Cannot delete template as the template id is invalid or non-existant.', $call_type) if !$query_params[0];
warn sprintf('%s : Cannot delete template as the creator type is invalid or non-existant.', $call_type) if !$query_params[1];
return -1;
}
my $query = "DELETE FROM " . $opts{'table_name'} . " WHERE template_id = ? AND creator = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@query_params);
$self->{'template_stat'} = 0;
}
sub save {
my $self = shift;
my %opts = @_;
if ($self->{'template_id'}) { # if we have an template_id, the record exists and needs UPDATE
my @params;
my $query = "UPDATE " . $opts{'table_name'} . " SET ";
foreach my $key (keys %{$self}) {
next if ($key eq 'template_id') || ($key eq 'template_stat') || ($key eq 'creator');
push (@params, $self->{$key});
$query .= "$key=?, ";
}
$query = substr($query, 0, (length($query)-2));
push (@params, $self->{'template_id'}, $self->{'creator'});
$query .= " WHERE template_id=? AND creator=?;";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
$self->{'template_stat'} = 1;
return $self->{'template_id'};
}
else { # otherwise create a new record
my @params;
my $query = "INSERT INTO " . $opts{'table_name'} ." (";
foreach my $key (keys %{$self}) {
next if $key eq 'template_stat';
push (@params, $self->{$key});
$query .= "$key, ";
}
$query = substr($query, 0, (length($query)-2));
$query .= ") VALUES (";
for (my $i=1; $i<=((scalar keys %$self) - 1); $i++) { # key count less keys not db related...
$query .= "?,";
}
$query = substr($query, 0, (length($query)-1));
$query .= ");";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $sth1 = C4::Context->dbh->prepare("SELECT MAX(template_id) FROM " . $opts{'table_name'} . ";");
$sth1->execute();
my $template_id = $sth1->fetchrow_array;
$self->{'template_id'} = $template_id;
$self->{'template_stat'} = 1;
return $template_id;
}
}
sub get_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my ($attr) = @_;
if (exists($self->{$attr})) {
return $self->{$attr};
}
else {
return -1;
}
}
sub set_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my %attrs = @_;
foreach my $attrib (keys(%attrs)) {
$self->{$attrib} = $attrs{$attrib};
};
}
sub get_label_position {
my ($self, $start_label) = @_;
my $current_label = $self->{'current_label'};
if ($start_label eq 1) {
$current_label->{'row_count'} = 1;
$current_label->{'col_count'} = 1;
$current_label->{'llx'} = $self->{'left_margin'};
$current_label->{'lly'} = ($self->{'page_height'} - $self->{'top_margin'} - $self->{'label_height'});
$self->{'current_label'} = $current_label;
return ($current_label->{'row_count'}, $current_label->{'col_count'}, $current_label->{'llx'}, $current_label->{'lly'});
}
else {
$current_label->{'row_count'} = ceil($start_label / $self->{'cols'});
$current_label->{'col_count'} = ($start_label - (($current_label->{'row_count'} - 1) * $self->{'cols'}));
$current_label->{'llx'} = $self->{'left_margin'} + ($self->{'label_width'} * ($current_label->{'col_count'} - 1)) + ($self->{'col_gap'} * ($current_label->{'col_count'} - 1));
$current_label->{'lly'} = $self->{'page_height'} - $self->{'top_margin'} - ($self->{'label_height'} * $current_label->{'row_count'}) - ($self->{'row_gap'} * ($current_label->{'row_count'} - 1));
$self->{'current_label'} = $current_label;
return ($current_label->{'row_count'}, $current_label->{'col_count'}, $current_label->{'llx'}, $current_label->{'lly'});
}
}
sub get_next_label_pos {
my $self = shift;
my $current_label = $self->{'current_label'};
my $new_page = 0;
if ($current_label->{'col_count'} lt $self->get_attr('cols')) {
$current_label->{'llx'} = ($current_label->{'llx'} + $self->get_attr('label_width') + $self->get_attr('col_gap'));
$current_label->{'col_count'}++;
}
else {
$current_label->{'llx'} = $self->get_attr('left_margin');
if ($current_label->{'row_count'} eq $self->get_attr('rows')) {
$new_page = 1;
#$pdf->Page(); # after invoking this method, the calling script should check row, col and if they are both one then insert a new pdf page
$current_label->{'lly'} = ($self->get_attr('page_height') - $self->get_attr('top_margin') - $self->get_attr('label_height'));
$current_label->{'row_count'} = 1;
}
else {
$current_label->{'lly'} = ($current_label->{'lly'} - $self->get_attr('row_gap') - $self->get_attr('label_height'));
$current_label->{'row_count'}++;
}
$current_label->{'col_count'} = 1;
}
return ($current_label->{'llx'}, $current_label->{'lly'}, $new_page);
}
1;
__END__
=head1 NAME
C4::Creators::Template - A class for creating and manipulating template objects in Koha
=head1 ABSTRACT
This module provides methods for creating, retrieving, and otherwise manipulating label template objects used by Koha.
=head1 METHODS
=head2 new()
Invoking the I<new> method constructs a new template object containing the default values for a template.
The following parameters are optionally accepted as key => value pairs:
C<profile_id> A valid profile id to be assciated with this template. NOTE: The profile must exist in the database and B<not> be assigned to another template.
C<template_code> A template code. ie. 'Avery 5160 | 1 x 2-5/8'
C<template_desc> A readable description of the template. ie. '3 columns, 10 rows of labels'
C<page_width> The width of the page measured in the units supplied by the units parameter in this template.
C<page_height> The height of the page measured in the same units.
C<label_width> The width of a single label on the page this template applies to.
C<label_height> The height of a single label on the page.
C<top_text_margin> The measure of the top margin on a single label on the page.
C<left_text_margin> The measure of the left margin on a single label on the page.
C<top_margin> The measure of the top margin of the page.
C<left_margin> The measure of the left margin of the page.
C<cols> The number of columns of labels on the page.
C<rows> The number of rows of labels on the page.
C<col_gap> The measure of the gap between the columns of labels on the page.
C<row_gap> The measure of the gap between the rows of labels on the page.
C<units> The units of measure used for this template. These B<must> match the measures you supply above or
bad things will happen to your document. NOTE: The only supported units at present are:
=over 9
=item .
POINT = Postscript Points (This is the base unit in the Koha label creator.)
=item .
AGATE = Adobe Agates (5.1428571 points per)
=item .
INCH = US Inches (72 points per)
=item .
MM = SI Millimeters (2.83464567 points per)
=item .
CM = SI Centimeters (28.3464567 points per)
=back
example:
my $template = Template->new(); # Creates and returns a new template object with the defaults
my $template = C4::Labels::Template->new(profile_id => 1, page_width => 8.5, page_height => 11.0, units => 'INCH'); # Creates and returns a new template object using
the supplied values to override the defaults
B<NOTE:> This template is I<not> written to the database untill save() is invoked. You have been warned!
=head2 retrieve(template_id => $template_id)
Invoking the I<retrieve> method constructs a new template object containing the current values for template_id. The method returns
a new object upon success and -1 upon failure. Errors are logged to the Apache log. Two further options may be accessed. See the example
below for further description.
examples:
C<my $template = C4::Labels::Template->retrieve(template_id => 1); # Retrieves template record 1 and returns an object containing the record>
C<my $template = C4::Labels::Template->retrieve(template_id => 1, convert => 1); # Retrieves template record 1, converts the units to points,
and returns an object containing the record>
C<my $template = C4::Labels::Template->retrieve(template_id => 1, profile_id => 1); # Retrieves template record 1, converts the units
to points, applies the currently associated profile id, and returns an object containing the record.>
=head2 delete()
Invoking the delete method attempts to delete the template from the database. The method returns -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair simply deleteing that template from the database. See the example below.
examples:
C<my $exitstat = $template->delete(); # to delete the record behind the $template object>
C<my $exitstat = C4::Labels::Template::delete(template_id => 1); # to delete template record 1>
=head2 save()
Invoking the I<save> method attempts to insert the template into the database if the template is new and update the existing template record if
the template exists. The method returns the new record template_id upon success and -1 upon failure (This avoids template_ids conflicting with a
record template_id of 1). Errors are logged to the Apache log.
example:
C<my $template_id = $template->save(); # to save the record behind the $template object>
=head2 get_attr($attribute)
Invoking the I<get_attr> method will return the value of the requested attribute or -1 on errors.
example:
C<my $value = $template->get_attr($attribute);>
=head2 set_attr(attribute => value, attribute_2 => value)
Invoking the I<set_attr> method will set the value of the supplied attributes to the supplied values. The method accepts key/value pairs separated by
commas.
example:
C<$template->set_attr(attribute => value);>
=head2 get_label_position($start_label)
Invoking the I<get_label_position> method will return the row, column coordinates on the starting page and the lower left x,y coordinates on the starting
label for the template object.
examples:
C<my ($row_count, $col_count, $llx, $lly) = $template->get_label_position($start_label);>
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut

View file

@ -35,11 +35,10 @@ $VERSION = 3.00;
&GetMarcFieldsForCsv
);
my $dbh = C4::Context->dbh;
# Returns all informations about csv profiles
sub GetCsvProfiles {
my $dbh = C4::Context->dbh;
my $query = "SELECT * FROM export_format";
$sth = $dbh->prepare($query);
@ -53,7 +52,7 @@ sub GetCsvProfiles {
sub GetMarcFieldsForCsv {
my ($id) = @_;
my $dbh = C4::Context->dbh;
my $query = "SELECT marcfields FROM export_format WHERE export_format_id=?";
$sth = $dbh->prepare($query);
@ -67,6 +66,7 @@ sub GetMarcFieldsForCsv {
# Returns informations aboout csv profiles suitable for html templates
sub GetCsvProfilesLoop {
# List of existing profiles
my $dbh = C4::Context->dbh;
my $sth;
my $query = "SELECT export_format_id, profile FROM export_format";
$sth = $dbh->prepare($query);

View file

@ -844,7 +844,7 @@ sub GetImportBibliosRange {
my $dbh = C4::Context->dbh;
my $query = "SELECT title, author, isbn, issn, import_record_id, record_sequence,
status, overlay_status
status, overlay_status, matched_biblionumber
FROM import_records
JOIN import_biblios USING (import_record_id)
WHERE import_batch_id = ?";

View file

@ -74,13 +74,13 @@ sub new {
$self->{'port'} = C4::Context->config("port");
$self->{'user'} = C4::Context->config("user");
$self->{'password'} = C4::Context->config("pass");
$self->{'dbh'} = DBI->connect("DBI:$self->{dbms}:dbname=$self->{dbname};host=$self->{hostname}" .
$self->{'dbh'} = DBI->connect("DBI:$self->{dbms}:dbname=$self->{dbname};host=$self->{hostname}" .
( $self->{port} ? ";port=$self->{port}" : "" ),
$self->{'user'}, $self->{'password'});
$self->{'language'} = undef;
$self->{'marcflavour'} = undef;
$self->{'dbh'}->do('set NAMES "utf8"');
$self->{'dbh'}->{'mysql_enable_utf8'}=1;
$self->{'dbh'}->{'mysql_enable_utf8'}=1;
bless $self, $class;
return $self;
@ -150,7 +150,7 @@ sub marc_framework_sql_list {
}
my @listdir = sort grep { !/^\.|marcflavour/ && -d "$dir/$_" } readdir(MYDIR);
closedir MYDIR;
my @fwklist;
my $request = $self->{'dbh'}->prepare("SELECT value FROM systempreferences WHERE variable='FrameworksLoaded'");
$request->execute;
@ -192,7 +192,7 @@ sub marc_framework_sql_list {
$cell{"code"} = lc($requirelevel);
push @fwklist, \%cell;
}
return ($defaulted_to_en, \@fwklist);
}
@ -300,9 +300,9 @@ sub sql_file_list {
my ($marc_defaulted_to_en, $marc_sql) = $self->marc_framework_sql_list($lang, $marcflavour);
my ($sample_defaulted_to_en, $sample_sql) = $self->sample_data_sql_list($lang);
my @sql_list = ();
map {
map {
map {
if ($subset_wanted->{'mandatory'}) {
push @sql_list, $_->{'fwkfile'} if $_->{'mandatory'};
@ -312,11 +312,11 @@ sub sql_file_list {
}
} @{ $_->{'frameworks'} }
} (@$marc_sql, @$sample_sql);
return \@sql_list
}
=head2 load_db_schema
=head2 load_db_schema
=over 4
@ -356,7 +356,7 @@ directory path). This means that dependencies among the scripts are to
be resolved by carefully naming them, keeping in mind that the directory name
does *not* currently count.
FIXME: this is a rather delicate way of dealing with dependencies between
FIXME: this is a rather delicate way of dealing with dependencies between
the install scripts.
The return value C<$list> is an arrayref containing a hashref for each
@ -429,7 +429,7 @@ sub load_sql_in_order {
return ($fwk_language, \@list);
}
=head2 set_marcflavour_syspref
=head2 set_marcflavour_syspref
=over 4
@ -462,7 +462,7 @@ sub set_marcflavour_syspref {
$request->execute;
}
=head2 set_indexing_engine
=head2 set_indexing_engine
=over 4
@ -569,9 +569,12 @@ sub load_sql {
. " $self->{dbname} "; # Therefore, be sure to run 'trust' on localhost in pg_hba.conf -fbcit
$error = qx($strcmd -f $filename 2>&1 1>/dev/null);
# Be sure to set 'client_min_messages = error' in postgresql.conf
# so that only true errors are returned to stderr or else the installer will
# so that only true errors are returned to stderr or else the installer will
# report the import a failure although it really succeded -fbcit
}
# errors thrown while loading installer data should be logged
warn "C4::Installer::load_sql returned the following errors while attempting to load $filename:\n";
warn $error;
return $error;
}
@ -596,7 +599,7 @@ sub get_file_path_from_name {
my $partialname = shift;
my $lang = 'en'; # FIXME: how do I know what language I want?
my ($defaulted_to_en, $list) = $self->sample_data_sql_list($lang);
# warn( Data::Dumper->Dump( [ $list ], [ 'list' ] ) );

View file

@ -1079,7 +1079,7 @@ END_SQL
$query .= 'WHERE ';
$query .= join ' AND ', @where_strings;
}
$query .= ' ORDER BY itemcallnumber, title';
$query .= ' ORDER BY items.cn_sort, itemcallnumber, title';
my $sth = $dbh->prepare($query);
$sth->execute( @bind_params );
@ -2032,8 +2032,11 @@ Returns undef if the move failed or the biblionumber of the destination record o
sub MoveItemFromBiblio {
my ($itemnumber, $frombiblio, $tobiblio) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("UPDATE items SET biblioitemnumber = ?, biblionumber = ? WHERE itemnumber = ? AND biblionumber = ?");
my $return = $sth->execute($tobiblio, $tobiblio, $itemnumber, $frombiblio);
my $sth = $dbh->prepare("SELECT biblioitemnumber FROM biblioitems WHERE biblionumber = ?");
$sth->execute( $tobiblio );
my ( $tobiblioitem ) = $sth->fetchrow();
$sth = $dbh->prepare("UPDATE items SET biblioitemnumber = ?, biblionumber = ? WHERE itemnumber = ? AND biblionumber = ?");
my $return = $sth->execute($tobiblioitem, $tobiblio, $itemnumber, $frombiblio);
if ($return == 1) {
# Getting framework

View file

@ -3,305 +3,45 @@ package C4::Labels::Batch;
use strict;
use warnings;
use C4::Context;
use C4::Debug;
use base qw(C4::Creators::Batch);
use autouse 'Data::Dumper' => qw(Dumper);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
sub _check_params {
my $given_params = {};
my $exit_code = 0;
my @valid_template_params = (
'label_id',
'batch_id',
'item_number',
'branch_code',
);
if (scalar(@_) >1) {
$given_params = {@_};
foreach my $key (keys %{$given_params}) {
if (!(grep m/$key/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of %s', $_);
$exit_code = 1;
}
}
return $exit_code;
}
__PACKAGE__ =~ m/^C4::(.+)::.+$/;
my $me = $1;
sub new {
my ($invocant) = shift;
my $type = ref($invocant) || $invocant;
my $self = {
batch_id => 0,
items => [],
branch_code => 'NB',
batch_stat => 0, # False if any data has changed and the db has not been updated
@_,
};
my $sth = C4::Context->dbh->prepare("SELECT MAX(batch_id) FROM labels_batches;");
$sth->execute();
my $batch_id = $sth->fetchrow_array;
$self->{'batch_id'} = ++$batch_id unless $self->{'batch_id'} != 0; # this allows batch_id to be passed in for individual label printing
bless ($self, $type);
return $self;
}
sub add_item {
my $self = shift;
my $item_number = shift;
my $query = "INSERT INTO labels_batches (batch_id, item_number, branch_code) VALUES (?,?,?);";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($self->{'batch_id'}, $item_number, $self->{'branch_code'});
if ($sth->err) {
warn sprintf('Database returned the following error on attempted INSERT: %s', $sth->errstr);
return -1;
}
$query = "SELECT max(label_id) FROM labels_batches WHERE batch_id=? AND item_number=? AND branch_code=?;";
my $sth1 = C4::Context->dbh->prepare($query);
$sth1->execute($self->{'batch_id'}, $item_number, $self->{'branch_code'});
my $label_id = $sth1->fetchrow_array;
push (@{$self->{'items'}}, {item_number => $item_number, label_id => $label_id});
$self->{'batch_stat'} = 1;
return 0;
push @_, "creator", $me;
return $self->SUPER::new(@_);
}
sub get_attr {
sub save {
my $self = shift;
return $self->{$_[0]};
push @_, "creator", $me;
return $self->SUPER::save(@_);
}
sub remove_item {
my $self = shift;
my $label_id = shift;
my $query = "DELETE FROM labels_batches WHERE label_id=? AND batch_id=?;";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($label_id, $self->{'batch_id'});
if ($sth->err) {
warn sprintf('Database returned the following error on attempted DELETE: %s', $sth->errstr);
return -1;
}
@{$self->{'items'}} = grep{$_->{'label_id'} != $label_id} @{$self->{'items'}};
$self->{'batch_stat'} = 1;
return 0;
}
# FIXME: This method is effectively useless the way the current add_item method is written. Ideally, the items should be added to the object
# and then the save method called. This does not work well in practice due to the inability to pass objects accross cgi script calls.
# I'm leaving it here because it should be here and for consistency's sake. -cnighswonger
#
#=head2 $batch->save()
#
# Invoking the I<save> method attempts to insert the batch into the database. The method returns
# the new record batch_id upon success and -1 upon failure (This avoids conflicting with a record
# batch_id of 1). Errors are logged to the Apache log.
#
# example:
# my $exitstat = $batch->save(); # to save the record behind the $batch object
#
#=cut
#
#sub save {
# my $self = shift;
# foreach my $item_number (@{$self->{'items'}}) {
# my $query = "INSERT INTO labels_batches (batch_id, item_number, branch_code) VALUES (?,?,?);";
# my $sth1 = C4::Context->dbh->prepare($query);
# $sth1->execute($self->{'batch_id'}, $item_number->{'item_number'}, $self->{'branch_code'});
# if ($sth1->err) {
# warn sprintf('Database returned the following error on attempted INSERT: %s', $sth1->errstr);
# return -1;
# }
# $self->{'batch_stat'} = 1;
# return $self->{'batch_id'};
# }
#}
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $record_flag = 0;
my $query = "SELECT * FROM labels_batches WHERE batch_id = ? ORDER BY label_id";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($opts{'batch_id'});
my $self = {
batch_id => $opts{'batch_id'},
items => [],
};
while (my $record = $sth->fetchrow_hashref) {
$self->{'branch_code'} = $record->{'branch_code'};
push (@{$self->{'items'}}, {item_number => $record->{'item_number'}, label_id => $record->{'label_id'}});
$record_flag = 1; # true if one or more rows were retrieved
}
return -2 if $record_flag == 0; # a hackish sort of way of indicating no such record exists
if ($sth->err) {
warn sprintf('Database returned the following error on attempted SELECT: %s', $sth->errstr);
return -1;
}
$self->{'batch_stat'} = 1;
bless ($self, $type);
return $self;
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::retrieve(@_);
}
sub delete {
my $self = {};
my %opts = ();
my $call_type = '';
my @query_params = ();
if (ref($_[0])) {
$self = shift; # check to see if this is a method call
$call_type = 'C4::Labels::Batch->delete';
@query_params = ($self->{'batch_id'}, $self->{'branch_code'});
my $self = shift; # check to see if this is a method call
push @_, "creator", $me;
return $self->SUPER::delete(@_);
}
else {
%opts = @_;
$call_type = 'C4::Labels::Batch::delete';
@query_params = ($opts{'batch_id'}, $opts{'branch_code'});
push @_, "creator", $me;
return __PACKAGE__->SUPER::delete(@_); # XXX: is this too hackish?
}
if ($query_params[0] eq '') { # If there is no template id then we cannot delete it
warn sprtinf('%s : Cannot delete batch as the batch id is invalid or non-existent.', $call_type);
return -1;
}
my $query = "DELETE FROM labels_batches WHERE batch_id = ? AND branch_code =?";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute(@query_params);
if ($sth->err) {
warn sprintf('%s : Database returned the following error on attempted INSERT: %s', $call_type, $sth->errstr);
return -1;
}
return 0;
}
sub remove_duplicates {
my $self = shift;
my %seen=();
my $query = "DELETE FROM labels_batches WHERE label_id = ?;"; # ORDER BY timestamp ASC LIMIT ?;";
my $sth = C4::Context->dbh->prepare($query);
my @duplicate_items = grep{$seen{$_->{'item_number'}}++} @{$self->{'items'}};
foreach my $item (@duplicate_items) {
$sth->execute($item->{'label_id'});
if ($sth->err) {
warn sprintf('Database returned the following error on attempted DELETE for label_id %s: %s', $item->{'label_id'}, $sth->errstr);
return -1;
}
$sth->finish(); # Per DBI.pm docs: "If execute() is called on a statement handle that's still active ($sth->{Active} is true) then it should effectively call finish() to tidy up the previous execution results before starting this new execution."
@{$self->{'items'}} = grep{$_->{'label_id'} != $item->{'label_id'}} @{$self->{'items'}}; # the correct label/item must be removed from the current batch object as well; this should be done *after* each sql DELETE in case the DELETE fails
}
return scalar(@duplicate_items);
}
1;
__END__
=head1 NAME
C4::Labels::Batch - A class for creating and manipulating batch objects in Koha
=head1 ABSTRACT
This module provides methods for creating, and otherwise manipulating batch objects used by Koha to create and export labels.
=head1 METHODS
=head2 new()
Invoking the I<new> method constructs a new batch object with no items. It is possible to pre-populate the batch with items and a branch code by passing them
as in the second example below.
B<NOTE:> The items list must be an arrayref pointing to an array of hashes containing a key/data pair after this fashion: {item_number => item_number}. The order of
the array elements determines the order of the items in the batch.
example:
C<my $batch = C4::Labels::Batch->new(); # Creates and returns a new batch object>
C<my $batch = C4::Labels::Batch->new(items => $arrayref, branch_code => branch_code) # Creates and returns a new batch object containing the items passed in
with the branch code passed in.>
B<NOTE:> This batch is I<not> written to the database until C<$batch->save()> is invoked. You have been warned!
=head2 $batch->add_item(item_number => $item_number, branch_code => $branch_code)
Invoking the I<add_item> method will add the supplied item to the batch object.
example:
$batch->add_item(item_number => $item_number, branch_code => $branch_code);
=head2 $batch->get_attr($attribute)
Invoking the I<get_attr> method will return the requested attribute.
example:
my @items = $batch->get_attr('items');
=head2 $batch->remove_item($item_number)
Invoking the I<remove_item> method will remove the supplied item number from the batch object.
example:
$batch->remove_item($item_number);
=head2 C4::Labels::Batch->retrieve(batch_id => $batch_id)
Invoking the I<retrieve> method constructs a new batch object containing the current values for batch_id. The method returns a new object upon success and 1 upon failure.
Errors are logged to the Apache log.
examples:
my $batch = C4::Labels::Batch->retrieve(batch_id => 1); # Retrieves batch 1 and returns an object containing the record
=head2 delete()
Invoking the delete method attempts to delete the template from the database. The method returns -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair simply deleteing that batch from the database. See the example below.
examples:
my $exitstat = $batch->delete(); # to delete the record behind the $batch object
my $exitstat = C4::Labels::Batch->delete(batch_id => 1); # to delete batch 1
=head2 remove_duplicates()
Invoking the remove_duplicates method attempts to remove duplicate items in the batch from the database. The method returns the count of duplicate records removed upon
success and -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair removing duplicates in the batch passed in. See the example below.
examples:
my $remove_count = $batch->remove_duplicates(); # to remove duplicates the record behind the $batch object
my $remove_count = C4::Labels::Batch->remove_duplicates(batch_id => 1); # to remove duplicates in batch 1
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut

View file

@ -90,7 +90,7 @@ sub _get_label_item {
if ($sth1->err) {
warn sprintf('Database returned the following error: %s', $sth1->errstr);
}
my $data1 = $sth->fetchrow_hashref;
my $data1 = $sth1->fetchrow_hashref;
$data->{'itemtype'} = $data1->{'description'};
$data->{'itype'} = $data1->{'description'};
$barcode_only ? return $data->{'barcode'} : return $data;
@ -286,6 +286,7 @@ sub _BIBBAR {
my $barcode_y_scale_factor = 0.01 * $self->{'height'}; # this scales the barcode height to 10% of the label height
my $line_spacer = ($self->{'font_size'} * 1); # number of pixels between text rows (This is actually leading: baseline to baseline minus font size. Recommended starting point is 20% of font size.).
my $text_lly = ($self->{'lly'} + ($self->{'height'} - $self->{'top_text_margin'}));
warn "Label: llx $self->{'llx'}, lly $self->{'lly'}, Text: lly $text_lly, $line_spacer, Barcode: llx $barcode_llx, lly $barcode_lly, $barcode_width, $barcode_y_scale_factor\n";
return $self->{'llx'}, $text_lly, $line_spacer, $barcode_llx, $barcode_lly, $barcode_width, $barcode_y_scale_factor;
}
@ -442,7 +443,7 @@ sub draw_label_text {
LABEL_LINES: # generate lines of label text for current field
foreach my $line (@label_lines) {
next LABEL_LINES if $line eq '';
my $string_width = C4::Labels::PDF->StrWidth($line, $font, $self->{'font_size'});
my $string_width = C4::Creators::PDF->StrWidth($line, $font, $self->{'font_size'});
if ($self->{'justify'} eq 'R') {
$text_llx = $params{'llx'} + $self->{'width'} - ($self->{'left_text_margin'} + $string_width);
}

View file

@ -3,417 +3,45 @@ package C4::Labels::Layout;
use strict;
use warnings;
use DBI qw(neat);
use base qw(C4::Creators::Layout);
use C4::Context;
use C4::Debug;
use C4::Labels::PDF;
use autouse 'Data::Dumper' => qw(Dumper);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
# FIXME: Consider this style parameter verification instead...
# my %param = @_;
# for (keys %param)
# { my $lc = lc($_);
# if (exists $default{$lc})
# { $default{$lc} = $param{$_};
# }
# else
# { print STDERR "Unknown parameter $_ , not used \n";
# }
# }
sub _check_params {
my $exit_code = 0;
my @valtmpl_id_params = (
'barcode_type',
'printing_type',
'layout_name',
'guidebox',
'font',
'font_size',
'callnum_split',
'text_justify',
'format_string',
);
if (scalar(@_) >1) {
my %given_params = @_;
foreach my $key (keys %given_params) {
if (!(grep m/$key/, @valtmpl_id_params)) {
warn sprintf('(Multiple parameters) Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valtmpl_id_params)) {
warn sprintf('(Single parameter) Unrecognized parameter type of "%s".', $_);
$exit_code = 1;
}
}
return $exit_code;
}
__PACKAGE__ =~ m/^C4::(.+)::.+$/;
my $me = $1;
sub new {
my $invocant = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my $type = ref($invocant) || $invocant;
my $self = {
barcode_type => 'CODE39',
printing_type => 'BAR',
layout_name => 'DEFAULT',
guidebox => 0,
font => 'TR',
font_size => 3,
callnum_split => 0,
text_justify => 'L',
format_string => 'title, author, isbn, issn, itemtype, barcode, callnumber',
@_,
};
bless ($self, $type);
return $self;
}
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $query = "SELECT * FROM labels_layouts WHERE layout_id = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{'layout_id'});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $self = $sth->fetchrow_hashref;
bless ($self, $type);
return $self;
}
sub delete {
my $self = {};
my %opts = ();
my $call_type = '';
my $query_param = '';
if (ref($_[0])) {
$self = shift; # check to see if this is a method call
$call_type = 'C4::Labels::Layout->delete';
$query_param = $self->{'layout_id'};
}
else {
%opts = @_;
$call_type = 'C4::Labels::Layout::delete';
$query_param = $opts{'layout_id'};
}
if ($query_param eq '') { # If there is no layout id then we cannot delete it
warn sprintf('%s : Cannot delete layout as the layout id is invalid or non-existant.', $call_type);
return -1;
}
my $query = "DELETE FROM labels_layouts WHERE layout_id = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($query_param);
if ($sth->err) {
warn sprintf('%s : Database returned the following error: %s', $call_type, $sth->errstr);
return -1;
}
return 0;
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::new(@_);
}
sub save {
my $self = shift;
if ($self->{'layout_id'}) { # if we have an id, the record exists and needs UPDATE
my @params;
my $query = "UPDATE labels_layouts SET ";
foreach my $key (keys %{$self}) {
next if $key eq 'layout_id';
push (@params, $self->{$key});
$query .= "$key=?, ";
}
$query = substr($query, 0, (length($query)-2));
$query .= " WHERE layout_id=?;";
push (@params, $self->{'layout_id'});
my $sth = C4::Context->dbh->prepare($query);
#local $sth->{TraceLevel} = "3"; # enable DBI trace and set level; outputs to STDERR
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
return $self->{'layout_id'};
}
else { # otherwise create a new record
my @params;
my $query = "INSERT INTO labels_layouts (";
foreach my $key (keys %{$self}) {
push (@params, $self->{$key});
$query .= "$key, ";
}
$query = substr($query, 0, (length($query)-2));
$query .= ") VALUES (";
for (my $i=1; $i<=(scalar keys %$self); $i++) {
$query .= "?,";
}
$query = substr($query, 0, (length($query)-1));
$query .= ");";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $sth1 = C4::Context->dbh->prepare("SELECT MAX(layout_id) FROM labels_layouts;");
$sth1->execute();
my $id = $sth1->fetchrow_array;
return $id;
}
push @_, "creator", $me;
return $self->SUPER::save(@_);
}
sub get_attr {
sub retrieve {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my ($attr) = @_;
if (exists($self->{$attr})) {
return $self->{$attr};
push @_, "creator", $me;
return $self->SUPER::retrieve(@_);
}
sub delete {
if (ref($_[0])) {
my $self = shift; # check to see if this is a method call
push @_, "creator", $me;
return $self->SUPER::delete(@_);
}
else {
return -1;
push @_, "creator", $me;
return __PACKAGE__->SUPER::delete(@_); # XXX: is this too hackish?
}
return;
}
sub set_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my %attrs = @_;
foreach my $attrib (keys(%attrs)) {
$self->{$attrib} = $attrs{$attrib};
};
return 0;
}
sub get_text_wrap_cols {
my $self = shift;
my %params = @_;
my $string = '';
my $strwidth = 0;
my $col_count = 0;
my $textlimit = $params{'label_width'} - ( 3 * $params{'left_text_margin'});
while ($strwidth < $textlimit) {
$string .= '0';
$col_count++;
$strwidth = C4::Labels::PDF->StrWidth( $string, $self->{'font'}, $self->{'font_size'} );
}
return $col_count;
}
1;
__END__
=head1 NAME
C4::Labels::Layout -A class for creating and manipulating layout objects in Koha
=head1 ABSTRACT
This module provides methods for creating, retrieving, and otherwise manipulating label layout objects used by Koha to create and export labels.
=head1 METHODS
=head2 new()
Invoking the I<new> method constructs a new layout object containing the default values for a layout.
The following parameters are optionally accepted as key => value pairs:
C<barcode_type> Defines the barcode type to be used on labels. NOTE: At present only the following barcode types are supported in the label creator code:
=over 9
=item .
CODE39 = Code 3 of 9
=item .
CODE39MOD = Code 3 of 9 with modulo 43 checksum
=item .
CODE39MOD10 = Code 3 of 9 with modulo 10 checksum
=item .
COOP2OF5 = A varient of 2 of 5 barcode based on NEC's "Process 8000" code
=item .
INDUSTRIAL2OF5 = The standard 2 of 5 barcode (a binary level bar code developed by Identicon Corp. and Computer Identics Corp. in 1970)
=back
C<printing_type> Defines the general layout to be used on labels. NOTE: At present there are only five printing types supported in the label creator code:
=over 9
=item .
BIB = Only the bibliographic data is printed
=item .
BARBIB = Barcode proceeds bibliographic data
=item .
BIBBAR = Bibliographic data proceeds barcode
=item .
ALT = Barcode and bibliographic data are printed on alternating labels
=item .
BAR = Only the barcode is printed
=back
C<layout_name> The descriptive name for this layout.
C<guidebox> Setting this to '1' will result in a guide box being drawn around the labels marking the edge of each label
C<font> Defines the type of font to be used on labels. NOTE: The following fonts are available by default on most systems:
=over 9
=item .
TR = Times-Roman
=item .
TB = Times Bold
=item .
TI = Times Italic
=item .
TBI = Times Bold Italic
=item .
C = Courier
=item .
CB = Courier Bold
=item .
CO = Courier Oblique (Italic)
=item .
CBO = Courier Bold Oblique
=item .
H = Helvetica
=item .
HB = Helvetica Bold
=item .
HBO = Helvetical Bold Oblique
=back
C<font_size> Defines the size of the font in postscript points to be used on labels
C<callnum_split> Setting this to '1' will enable call number splitting on labels
C<text_justify> Defines the text justification to be used on labels. NOTE: The following justification styles are currently supported by label creator code:
=over 9
=item .
L = Left
=item .
C = Center
=item .
R = Right
=back
C<format_string> Defines what fields will be printed and in what order they will be printed on labels. These include any of the data fields that may be mapped
to your MARC frameworks. Specify MARC subfields as a 4-character tag-subfield string: ie. 254a Enclose a whitespace-separated list of fields
to concatenate on one line in double quotes. ie. "099a 099b" or "itemcallnumber barcode" Static text strings may be entered in single-quotes:
ie. 'Some static text here.'
example:
C<my $layout = Layout->new(); # Creates and returns a new layout object>
C<my $layout = C4::Labels::Layout->new(barcode_type => 'CODE39', printing_type => 'BIBBAR', font => 'C', font_size => 6); # Creates and returns a new layout object using
the supplied values to override the defaults>
B<NOTE:> This layout is I<not> written to the database until save() is invoked. You have been warned!
=head2 retrieve(layout_id => layout_id)
Invoking the I<retrieve> method constructs a new layout object containing the current values for layout_id. The method returns a new object upon success and 1 upon failure.
Errors are logged to the Apache log.
example:
C<my $layout = Layout->retrieve(layout_id => 1); # Retrieves layout record 1 and returns an object containing the record>
=head2 delete()
Invoking the delete method attempts to delete the layout from the database. The method returns 0 upon success and -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair simply deleteing that template from the database. See the example below.
examples:
C<my $exitstat = $layout->delete(); # to delete the record behind the $layout object>
C<my $exitstat = Layout->delete(layout_id => 1); # to delete layout record 1>
=head2 save()
Invoking the I<save> method attempts to insert the layout into the database if the layout is new and update the existing layout record if the layout exists.
The method returns the new record id upon success and -1 upon failure (This avoids conflicting with a record id of 1). Errors are logged to the Apache log.
example:
C<my $exitstat = $layout->save(); # to save the record behind the $layout object>
=head2 get_attr($attribute)
Invoking the I<get_attr> method will return the value of the requested attribute or -1 on errors.
example:
C<my $value = $layout->get_attr($attribute);>
=head2 set_attr(attribute => value, attribute_2 => value)
Invoking the I<set_attr> method will set the value of the supplied attributes to the supplied values. The method accepts key/value pairs separated by
commas.
example:
C<$layout->set_attr(attribute => value);>
=head2 get_text_wrap_cols()
Invoking the I<get_text_wrap_cols> method will return the number of columns that can be printed on the label before wrapping to the next line.
examples:
C<my $text_wrap_cols = $layout->get_text_wrap_cols();>
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut

View file

@ -3,7 +3,7 @@ package C4::Labels::Lib;
# Copyright 2009 Foundations Bible College.
#
# This file is part of Koha.
#
#
# Koha 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
@ -20,7 +20,7 @@ package C4::Labels::Lib;
use strict;
use warnings;
use Data::Dumper;
use autouse 'Data::Dumper' => qw(Dumper);
use C4::Context;
use C4::Debug;
@ -115,7 +115,7 @@ my $text_justification_types = [
{type => 'L', name => 'Left', selected => 0},
{type => 'C', name => 'Center', selected => 0},
{type => 'R', name => 'Right', selected => 0},
# {type => 'F', name => 'Full', selected => 0},
# {type => 'F', name => 'Full', selected => 0},
];
my $unit_values = [
@ -226,7 +226,7 @@ sub get_all_profiles {
This function returns an arrayref whose elements are hashes containing the batch_ids of current batches along with the item count
for each batch upon success and 1 upon failure. Item counts are stored under the key '_item_count' Errors are logged to the Apache log.
One parameter is accepted which limits the records returned based on a string containing a valud SQL 'WHERE' filter.
NOTE: Do not pass in the keyword 'WHERE.'
examples:
@ -269,7 +269,7 @@ sub get_batch_summary {
This function returns an arrayref whose elements are hashes containing the label_ids of current labels along with the item count
for each label upon success and 1 upon failure. Item counts are stored under the key '_item_count' Errors are logged to the Apache log.
One parameter is accepted which limits the records returned based on a string containing a valud SQL 'WHERE' filter.
NOTE: Do not pass in the keyword 'WHERE.'
examples:
@ -445,7 +445,6 @@ sub html_table {
return undef if scalar(@$data) == 0; # no need to generate a table if there is not data to display
my $table = [];
my $fields = [];
my @headers = ();
my @table_columns = ();
my ($row_index, $col_index) = (0,0);
my $cols = 0; # number of columns to wrap on

View file

@ -3,353 +3,45 @@ package C4::Labels::Profile;
use strict;
use warnings;
use C4::Context;
use C4::Debug;
use C4::Labels::Lib 1.000000 qw(get_unit_values);
use base qw(C4::Creators::Profile);
use autouse 'Data::Dumper' => qw(Dumper);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
sub _check_params {
my $given_params = {};
my $exit_code = 0;
my @valid_profile_params = (
'printer_name',
'template_id',
'paper_bin',
'offset_horz',
'offset_vert',
'creep_horz',
'creep_vert',
'units',
);
if (scalar(@_) >1) {
$given_params = {@_};
foreach my $key (keys %{$given_params}) {
if (!(grep m/$key/, @valid_profile_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valid_profile_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $_);
$exit_code = 1;
}
}
return $exit_code;
}
sub _conv_points {
my $self = shift;
my @unit_value = grep {$_->{'type'} eq $self->{units}} @{get_unit_values()};
$self->{offset_horz} = $self->{offset_horz} * $unit_value[0]->{'value'};
$self->{offset_vert} = $self->{offset_vert} * $unit_value[0]->{'value'};
$self->{creep_horz} = $self->{creep_horz} * $unit_value[0]->{'value'};
$self->{creep_vert} = $self->{creep_vert} * $unit_value[0]->{'value'};
return $self;
}
__PACKAGE__ =~ m/^C4::(.+)::.+$/;
my $me = $1;
sub new {
my $invocant = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my $type = ref($invocant) || $invocant;
my $self = {
printer_name => 'Default Printer',
template_id => '',
paper_bin => 'Tray 1',
offset_horz => 0,
offset_vert => 0,
creep_horz => 0,
creep_vert => 0,
units => 'POINT',
@_,
};
bless ($self, $type);
return $self;
}
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $query = "SELECT * FROM printers_profile WHERE profile_id = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{profile_id});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $self = $sth->fetchrow_hashref;
$self = _conv_points($self) if ($opts{convert} && $opts{convert} == 1);
bless ($self, $type);
return $self;
}
sub delete {
my $self = {};
my %opts = ();
my $call_type = '';
my $query_param = '';
if (ref($_[0])) {
$self = shift; # check to see if this is a method call
$call_type = 'C4::Labels::Profile->delete';
$query_param = $self->{'profile_id'};
}
else {
%opts = @_;
$call_type = 'C4::Labels::Profile::delete';
$query_param = $opts{'profile_id'};
}
if ($query_param eq '') { # If there is no profile id then we cannot delete it
warn sprintf('%s : Cannot delete layout as the profile id is invalid or non-existant.', $call_type);
return -1;
}
my $query = "DELETE FROM printers_profile WHERE profile_id = ?";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($query_param);
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::new(@_);
}
sub save {
my $self = shift;
if ($self->{'profile_id'}) { # if we have an profile_id, the record exists and needs UPDATE
my @params;
my $query = "UPDATE printers_profile SET ";
foreach my $key (keys %{$self}) {
next if $key eq 'profile_id';
push (@params, $self->{$key});
$query .= "$key=?, ";
}
$query = substr($query, 0, (length($query)-2));
push (@params, $self->{'profile_id'});
$query .= " WHERE profile_id=?;";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error on attempted UPDATE: %s', $sth->errstr);
return -1;
}
return $self->{'profile_id'};
}
else { # otherwise create a new record
my @params;
my $query = "INSERT INTO printers_profile (";
foreach my $key (keys %{$self}) {
push (@params, $self->{$key});
$query .= "$key, ";
}
$query = substr($query, 0, (length($query)-2));
$query .= ") VALUES (";
for (my $i=1; $i<=(scalar keys %$self); $i++) {
$query .= "?,";
}
$query = substr($query, 0, (length($query)-1));
$query .= ");";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error on attempted INSERT: %s', $sth->errstr);
return -1;
}
my $sth1 = C4::Context->dbh->prepare("SELECT MAX(profile_id) FROM printers_profile;");
$sth1->execute();
my $tmpl_id = $sth1->fetchrow_array;
return $tmpl_id;
}
push @_, "creator", $me;
return $self->SUPER::save(@_);
}
sub get_attr {
sub retrieve {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my ($attr) = @_;
if (exists($self->{$attr})) {
return $self->{$attr};
push @_, "creator", $me;
return $self->SUPER::retrieve(@_);
}
sub delete {
if (ref($_[0])) {
my $self = shift; # check to see if this is a method call
push @_, "creator", $me;
return $self->SUPER::delete(@_);
}
else {
warn sprintf('%s is currently undefined.', $attr);
return -1;
push @_, "creator", $me;
return __PACKAGE__->SUPER::delete(@_); # XXX: is this too hackish?
}
}
sub set_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my %attrs = @_;
foreach my $attrib (keys(%attrs)) {
$self->{$attrib} = $attrs{$attrib};
};
return 0;
}
1;
__END__
=head1 NAME
C4::Labels::Profile - A class for creating and manipulating profile objects in Koha
=head1 ABSTRACT
This module provides methods for creating, retrieving, and otherwise manipulating label profile objects used by Koha to create and export labels.
=head1 METHODS
=head2 new()
Invoking the I<new> method constructs a new profile object containing the default values for a template.
The following parameters are optionally accepted as key => value pairs:
C<printer_name> The name of the printer to which this profile applies.
C<template_id> The template to which this profile may be applied. NOTE: There may be multiple profiles which may be applied to the same template.
C<paper_bin> The paper bin of the above printer to which this profile applies. NOTE: printer name, template id, and paper bin must form a unique combination.
C<offset_horz> Amount of compensation for horizontal offset (position of text on a single label). This amount is measured in the units supplied by the units parameter in this profile.
C<offset_vert> Amount of compensation for vertical offset.
C<creep_horz> Amount of compensation for horizontal creep (tendency of text to 'creep' off of the labels over the span of the entire page).
C<creep_vert> Amount of compensation for vertical creep.
C<units> The units of measure used for this template. These B<must> match the measures you supply above or
bad things will happen to your document. NOTE: The only supported units at present are:
=over 9
=item .
POINT = Postscript Points (This is the base unit in the Koha label creator.)
=item .
AGATE = Adobe Agates (5.1428571 points per)
=item .
INCH = US Inches (72 points per)
=item .
MM = SI Millimeters (2.83464567 points per)
=item .
CM = SI Centimeters (28.3464567 points per)
=back
example:
C<my $profile = C4::Labels::Profile->new(); # Creates and returns a new profile object>
C<my $profile = C4::Labels::Profile->new(template_id => 1, paper_bin => 'Bypass Tray', offset_horz => 0.02, units => 'POINT'); # Creates and returns a new profile object using
the supplied values to override the defaults>
B<NOTE:> This profile is I<not> written to the database until save() is invoked. You have been warned!
=head2 retrieve(profile_id => $profile_id, convert => 1)
Invoking the I<retrieve> method constructs a new profile object containing the current values for profile_id. The method returns a new object upon success and 1 upon failure.
Errors are logged to the Apache log. One further option maybe accessed. See the examples below for further description.
examples:
C<my $profile = C4::Labels::Profile->retrieve(profile_id => 1); # Retrieves profile record 1 and returns an object containing the record>
C<my $profile = C4::Labels::Profile->retrieve(profile_id => 1, convert => 1); # Retrieves profile record 1, converts the units to points and returns an object containing the record>
=head2 delete()
Invoking the delete method attempts to delete the profile from the database. The method returns -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair simply deleteing that profile from the database. See the example below.
examples:
C<my $exitstat = $profile->delete(); # to delete the record behind the $profile object>
C<my $exitstat = C4::Labels::Profile::delete(profile_id => 1); # to delete profile record 1>
=head2 save()
Invoking the I<save> method attempts to insert the profile into the database if the profile is new and update the existing profile record if the profile exists. The method returns
the new record profile_id upon success and -1 upon failure (This avoids conflicting with a record profile_id of 1). Errors are logged to the Apache log.
example:
C<my $exitstat = $profile->save(); # to save the record behind the $profile object>
=head2 get_attr($attribute)
Invoking the I<get_attr> method will return the value of the requested attribute or -1 on errors.
example:
C<my $value = $profile->get_attr($attribute);>
=head2 set_attr(attribute => value, attribute_2 => value)
Invoking the I<set_attr> method will set the value of the supplied attributes to the supplied values. The method accepts key/value pairs separated by commas.
example:
$profile->set_attr(attribute => value);
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut
#=head1
#drawbox( ($left_margin), ($top_margin), ($page_width-(2*$left_margin)), ($page_height-(2*$top_margin)) ); # FIXME: Breakout code to print alignment page for printer profile setup
#
#=head2 draw_boundaries
#
# sub draw_boundaries ($llx_spine, $llx_circ1, $llx_circ2,
# $lly, $spine_width, $label_height, $circ_width)
#
#This sub draws boundary lines where the label outlines are, to aid in printer testing, and debugging.
#
#=cut
#
## FIXME: Template use for profile adjustment...
##sub draw_boundaries {
##
## my (
## $llx_spine, $llx_circ1, $llx_circ2, $lly,
## $spine_width, $label_height, $circ_width
## ) = @_;
##
## my $lly_initial = ( ( 792 - 36 ) - 90 );
## $lly = $lly_initial; # FIXME - why are we ignoring the y_pos parameter by redefining it?
## my $i = 1;
##
## for ( $i = 1 ; $i <= 8 ; $i++ ) {
##
## _draw_box( $llx_spine, $lly, ($spine_width), ($label_height) );
##
## #warn "OLD BOXES x=$llx_spine, y=$lly, w=$spine_width, h=$label_height";
## _draw_box( $llx_circ1, $lly, ($circ_width), ($label_height) );
## _draw_box( $llx_circ2, $lly, ($circ_width), ($label_height) );
##
## $lly = ( $lly - $label_height );
##
## }
##}
#
#
#
#=cut

View file

@ -2,395 +2,42 @@ package C4::Labels::Template;
use strict;
use warnings;
use PDF::Reuse;
use POSIX qw(ceil);
use C4::Context;
use C4::Debug;
use C4::Labels::Profile 1.000000;
use C4::Labels::PDF 1.000000;
use C4::Labels::Lib 1.000000 qw(get_unit_values);
use base qw(C4::Creators::Template);
use autouse 'Data::Dumper' => qw(Dumper);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
sub _check_params {
my $given_params = {};
my $exit_code = 0;
my @valid_template_params = (
'profile_id',
'template_code',
'template_desc',
'page_width',
'page_height',
'label_width',
'label_height',
'top_text_margin',
'left_text_margin',
'top_margin',
'left_margin',
'cols',
'rows',
'col_gap',
'row_gap',
'units',
);
if (scalar(@_) >1) {
$given_params = {@_};
foreach my $key (keys %{$given_params}) {
if (!(grep m/$key/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $_);
$exit_code = 1;
}
}
return $exit_code;
}
use constant TEMPLATE_TABLE => 'creator_templates';
sub _conv_points {
my $self = shift;
my @unit_value = grep {$_->{'type'} eq $self->{'units'}} @{get_unit_values()};
$self->{'page_width'} = $self->{'page_width'} * $unit_value[0]->{'value'};
$self->{'page_height'} = $self->{'page_height'} * $unit_value[0]->{'value'};
$self->{'label_width'} = $self->{'label_width'} * $unit_value[0]->{'value'};
$self->{'label_height'} = $self->{'label_height'} * $unit_value[0]->{'value'};
$self->{'top_text_margin'} = $self->{'top_text_margin'} * $unit_value[0]->{'value'};
$self->{'left_text_margin'} = $self->{'left_text_margin'} * $unit_value[0]->{'value'};
$self->{'top_margin'} = $self->{'top_margin'} * $unit_value[0]->{'value'};
$self->{'left_margin'} = $self->{'left_margin'} * $unit_value[0]->{'value'};
$self->{'col_gap'} = $self->{'col_gap'} * $unit_value[0]->{'value'};
$self->{'row_gap'} = $self->{'row_gap'} * $unit_value[0]->{'value'};
return $self;
}
sub _apply_profile {
my $self = shift;
my $profile = C4::Labels::Profile->retrieve(profile_id => $self->{'profile_id'}, convert => 1);
$self->{'top_margin'} = $self->{'top_margin'} + $profile->get_attr('offset_vert'); # controls vertical offset
$self->{'left_margin'} = $self->{'left_margin'} + $profile->get_attr('offset_horz'); # controls horizontal offset
$self->{'label_height'} = $self->{'label_height'} + $profile->get_attr('creep_vert'); # controls vertical creep
$self->{'label_width'} = $self->{'label_width'} + $profile->get_attr('creep_horz'); # controls horizontal creep
return $self;
}
__PACKAGE__ =~ m/^C4::(.+)::.+$/;
my $me = $1;
sub new {
my $invocant = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my $type = ref($invocant) || $invocant;
my $self = {
profile_id => '0',
template_code => 'DEFAULT TEMPLATE',
template_desc => 'Default description',
page_width => 0,
page_height => 0,
label_width => 0,
label_height => 0,
top_text_margin => 0,
left_text_margin => 0,
top_margin => 0,
left_margin => 0,
cols => 0,
rows => 0,
col_gap => 0,
row_gap => 0,
units => 'POINT',
template_stat => 0, # false if any data has changed and the db has not been updated
@_,
};
bless ($self, $type);
return $self;
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::new(@_);
}
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $query = "SELECT * FROM labels_templates WHERE template_id = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{template_id});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $self = $sth->fetchrow_hashref;
$self = _conv_points($self) if (($opts{convert} && $opts{convert} == 1) || $opts{profile_id});
$self = _apply_profile($self) if $opts{profile_id} && $self->{'profile_id'}; # don't bother if there is no profile_id
$self->{'template_stat'} = 1;
bless ($self, $type);
return $self;
my $self = shift;
push @_, "table_name", TEMPLATE_TABLE, "creator", $me;
return $self->SUPER::retrieve(@_);
}
sub delete {
my $self = {};
my %opts = ();
my $call_type = '';
my $query_param = '';
if (ref($_[0])) {
$self = shift; # check to see if this is a method call
$call_type = 'C4::Labels::Template->delete';
$query_param = $self->{'template_id'};
}
else {
%opts = @_;
$call_type = 'C4::Labels::Template::delete';
$query_param = $opts{'template_id'};
}
if ($query_param eq '') { # If there is no template id then we cannot delete it
warn sprintf('%s : Cannot delete layout as the template id is invalid or non-existant.', $call_type);
return -1;
}
my $query = "DELETE FROM labels_templates WHERE template_id = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($query_param);
$self->{'template_stat'} = 0;
my $self = shift;
push @_, "table_name", TEMPLATE_TABLE, "creator", $me;
return $self->SUPER::delete(@_);
}
sub save {
my $self = shift;
if ($self->{'template_id'}) { # if we have an template_id, the record exists and needs UPDATE
my @params;
my $query = "UPDATE labels_templates SET ";
foreach my $key (keys %{$self}) {
next if ($key eq 'template_id') || ($key eq 'template_stat');
push (@params, $self->{$key});
$query .= "$key=?, ";
}
$query = substr($query, 0, (length($query)-2));
push (@params, $self->{'template_id'});
$query .= " WHERE template_id=?;";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
$self->{'template_stat'} = 1;
return $self->{'template_id'};
}
else { # otherwise create a new record
my @params;
my $query = "INSERT INTO labels_templates (";
foreach my $key (keys %{$self}) {
next if $key eq 'template_stat';
push (@params, $self->{$key});
$query .= "$key, ";
}
$query = substr($query, 0, (length($query)-2));
$query .= ") VALUES (";
for (my $i=1; $i<=((scalar keys %$self) - 1); $i++) { # key count less keys not db related...
$query .= "?,";
}
$query = substr($query, 0, (length($query)-1));
$query .= ");";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $sth1 = C4::Context->dbh->prepare("SELECT MAX(template_id) FROM labels_templates;");
$sth1->execute();
my $template_id = $sth1->fetchrow_array;
$self->{'template_id'} = $template_id;
$self->{'template_stat'} = 1;
return $template_id;
}
}
sub get_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my ($attr) = @_;
if (exists($self->{$attr})) {
return $self->{$attr};
}
else {
return -1;
}
}
sub set_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
return -1;
}
my %attrs = @_;
foreach my $attrib (keys(%attrs)) {
$self->{$attrib} = $attrs{$attrib};
};
}
sub get_label_position {
my ($self, $start_label) = @_;
my ($row_count, $col_count, $llx, $lly) = 0,0,0,0;
if ($start_label eq 1) {
$row_count = 1;
$col_count = 1;
$llx = $self->{'left_margin'};
$lly = ($self->{'page_height'} - $self->{'top_margin'} - $self->{'label_height'});
return ($row_count, $col_count, $llx, $lly);
}
else {
$row_count = ceil($start_label / $self->{'cols'});
$col_count = ($start_label - (($row_count - 1) * $self->{'cols'}));
$llx = $self->{'left_margin'} + ($self->{'label_width'} * ($col_count - 1)) + ($self->{'col_gap'} * ($col_count - 1));
$lly = $self->{'page_height'} - $self->{'top_margin'} - ($self->{'label_height'} * $row_count) - ($self->{'row_gap'} * ($row_count - 1));
return ($row_count, $col_count, $llx, $lly);
}
push @_, "table_name", TEMPLATE_TABLE, "creator", $me;
return $self->SUPER::save(@_);
}
1;
__END__
=head1 NAME
C4::Labels::Template - A class for creating and manipulating template objects in Koha
=head1 ABSTRACT
This module provides methods for creating, retrieving, and otherwise manipulating label template objects used by Koha to create and export labels.
=head1 METHODS
=head2 new()
Invoking the I<new> method constructs a new template object containing the default values for a template.
The following parameters are optionally accepted as key => value pairs:
C<profile_id> A valid profile id to be assciated with this template. NOTE: The profile must exist in the database and B<not> be assigned to another template.
C<template_code> A template code. ie. 'Avery 5160 | 1 x 2-5/8'
C<template_desc> A readable description of the template. ie. '3 columns, 10 rows of labels'
C<page_width> The width of the page measured in the units supplied by the units parameter in this template.
C<page_height> The height of the page measured in the same units.
C<label_width> The width of a single label on the page this template applies to.
C<label_height> The height of a single label on the page.
C<top_text_margin> The measure of the top margin on a single label on the page.
C<left_text_margin> The measure of the left margin on a single label on the page.
C<top_margin> The measure of the top margin of the page.
C<left_margin> The measure of the left margin of the page.
C<cols> The number of columns of labels on the page.
C<rows> The number of rows of labels on the page.
C<col_gap> The measure of the gap between the columns of labels on the page.
C<row_gap> The measure of the gap between the rows of labels on the page.
C<units> The units of measure used for this template. These B<must> match the measures you supply above or
bad things will happen to your document. NOTE: The only supported units at present are:
=over 9
=item .
POINT = Postscript Points (This is the base unit in the Koha label creator.)
=item .
AGATE = Adobe Agates (5.1428571 points per)
=item .
INCH = US Inches (72 points per)
=item .
MM = SI Millimeters (2.83464567 points per)
=item .
CM = SI Centimeters (28.3464567 points per)
=back
example:
my $template = Template->new(); # Creates and returns a new template object with the defaults
my $template = C4::Labels::Template->new(profile_id => 1, page_width => 8.5, page_height => 11.0, units => 'INCH'); # Creates and returns a new template object using
the supplied values to override the defaults
B<NOTE:> This template is I<not> written to the database untill save() is invoked. You have been warned!
=head2 retrieve(template_id => $template_id)
Invoking the I<retrieve> method constructs a new template object containing the current values for template_id. The method returns
a new object upon success and -1 upon failure. Errors are logged to the Apache log. Two further options may be accessed. See the example
below for further description.
examples:
C<my $template = C4::Labels::Template->retrieve(template_id => 1); # Retrieves template record 1 and returns an object containing the record>
C<my $template = C4::Labels::Template->retrieve(template_id => 1, convert => 1); # Retrieves template record 1, converts the units to points,
and returns an object containing the record>
C<my $template = C4::Labels::Template->retrieve(template_id => 1, profile_id => 1); # Retrieves template record 1, converts the units
to points, applies the currently associated profile id, and returns an object containing the record.>
=head2 delete()
Invoking the delete method attempts to delete the template from the database. The method returns -1 upon failure. Errors are logged to the Apache log.
NOTE: This method may also be called as a function and passed a key/value pair simply deleteing that template from the database. See the example below.
examples:
C<my $exitstat = $template->delete(); # to delete the record behind the $template object>
C<my $exitstat = C4::Labels::Template::delete(template_id => 1); # to delete template record 1>
=head2 save()
Invoking the I<save> method attempts to insert the template into the database if the template is new and update the existing template record if
the template exists. The method returns the new record template_id upon success and -1 upon failure (This avoids template_ids conflicting with a
record template_id of 1). Errors are logged to the Apache log.
example:
C<my $template_id = $template->save(); # to save the record behind the $template object>
=head2 get_attr($attribute)
Invoking the I<get_attr> method will return the value of the requested attribute or -1 on errors.
example:
C<my $value = $template->get_attr($attribute);>
=head2 set_attr(attribute => value, attribute_2 => value)
Invoking the I<set_attr> method will set the value of the supplied attributes to the supplied values. The method accepts key/value pairs separated by
commas.
example:
C<$template->set_attr(attribute => value);>
=head2 get_label_position($start_label)
Invoking the I<get_label_position> method will return the row, column coordinates on the starting page and the lower left x,y coordinates on the starting
label for the template object.
examples:
C<my ($row_count, $col_count, $llx, $lly) = $template->get_label_position($start_label);>
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut

View file

@ -800,6 +800,9 @@ sub _send_message_by_email ($) {
Message => $content,
'content-type' => $message->{'content_type'} || 'text/plain; charset="UTF-8"',
);
if ( my $bcc = C4::Context->preference('OverdueNoticeBcc') ) {
$sendmail_params{ Bcc } = $bcc;
}
my $success = sendmail( %sendmail_params );

47
C4/Patroncards/Batch.pm Normal file
View file

@ -0,0 +1,47 @@
package C4::Patroncards::Batch;
use strict;
use warnings;
use base qw(C4::Creators::Batch);
use autouse 'Data::Dumper' => qw(Dumper);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
__PACKAGE__ =~ m/^C4::(.+)::.+$/;
my $me = $1;
sub new {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::new(@_);
}
sub save {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::save(@_);
}
sub retrieve {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::retrieve(@_);
}
sub delete {
if (ref($_[0])) {
my $self = shift; # check to see if this is a method call
push @_, "creator", $me;
return $self->SUPER::delete(@_);
}
else {
push @_, "creator", $me;
return __PACKAGE__->SUPER::delete(@_); # XXX: is this too hackish?
}
}
1;

47
C4/Patroncards/Layout.pm Normal file
View file

@ -0,0 +1,47 @@
package C4::Patroncards::Layout;
use strict;
use warnings;
use base qw(C4::Creators::Layout);
use autouse 'Data::Dumper' => qw(Dumper);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
__PACKAGE__ =~ m/^C4::(.+)::.+$/;
my $me = $1;
sub new {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::new(@_);
}
sub save {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::save(@_);
}
sub retrieve {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::retrieve(@_);
}
sub delete {
if (ref($_[0])) {
my $self = shift; # check to see if this is a method call
push @_, "creator", $me;
return $self->SUPER::delete(@_);
}
else {
push @_, "creator", $me;
return __PACKAGE__->SUPER::delete(@_); # XXX: is this too hackish?
}
}
1;

286
C4/Patroncards/Lib.pm Normal file
View file

@ -0,0 +1,286 @@
package C4::Patroncards::Lib;
# Copyright 2009 Foundations Bible College.
#
# This file is part of Koha.
#
# Koha 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.
#
# Koha 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.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use warnings;
use autouse 'Data::Dumper' => qw(Dumper);
use C4::Context;
use C4::Debug;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
use base qw(Exporter);
our @EXPORT_OK = qw(unpack_UTF8
text_alignment
leading
box
get_borrower_attributes
put_image
get_image
rm_image
);
}
sub unpack_UTF8 {
my ($str) = @_;
my @UTF8 = (unpack("U0U*", $str));
my @HEX = map { sprintf '%2.2x', $_ } @UTF8;
return \@HEX;
}
sub text_alignment {
my ($origin_llx, $text_box_width, $text_llx, $string_width, $line, $alignment) = @_;
my $Tw = 0;
my $Tx = 0;
if ($alignment eq 'J') {
my $UTF82HEX = unpack_UTF8($line);
my $space_count = 0;
grep {$space_count++ if $_ eq '20'} @$UTF82HEX;
$Tw = (($text_box_width - $text_llx) - $string_width) / $space_count;
return $origin_llx, $Tw;
}
elsif ($alignment eq 'C') {
my $center_margin = ($text_box_width / 2) + $text_llx;
$Tx = $center_margin - ($string_width / 2);
return $Tx, $Tw;
}
elsif ($alignment eq 'R') {
$Tx = ($text_box_width - $string_width) + ($text_llx / 2);
return $Tx, $Tw;
}
elsif ($alignment eq 'L') {
return $origin_llx, $Tw;
}
else { # if we are not handed an alignment default to left align text...
return $origin_llx, $Tw;
}
}
sub leading {
return $_[0] + ($_[0] * 0.20); # recommended starting point for leading is 20% of the font point size (See http://www.bastoky.com/KeyRelations.htm)
}
sub box {
my ($llx, $lly, $width, $height, $pdf) = @_;
my $obj_stream = "q\n"; # save the graphic state
$obj_stream .= "0.5 w\n"; # border line width
$obj_stream .= "1.0 0.0 0.0 RG\n"; # border color red
$obj_stream .= "1.0 1.0 1.0 rg\n"; # fill color white
$obj_stream .= "$llx $lly $width $height re\n"; # a rectangle
$obj_stream .= "B\n"; # fill (and a little more)
$obj_stream .= "Q\n"; # restore the graphic state
$pdf->Add($obj_stream);
}
sub get_borrower_attributes {
my ($borrower_number, @fields) = @_;
my $get_branch = 0;
$get_branch = 1 if grep{$_ eq 'branchcode'} @fields;
my $attrib_count = scalar(@fields);
my $query = "SELECT ";
while (scalar(@fields)) {
$query .= shift(@fields);
$query .= ', ' if scalar(@fields);
}
$query .= " FROM borrowers WHERE borrowernumber = ?";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($borrower_number);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return 1;
}
my $borrower_attributes = $sth->fetchrow_hashref();
if ($get_branch) {
$query = "SELECT branchname FROM branches WHERE branchcode = ?";
$sth = C4::Context->dbh->prepare($query);
$sth->execute($borrower_attributes->{'branchcode'});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return 1;
}
$borrower_attributes->{'branchcode'} = $sth->fetchrow_hashref()->{'branchname'};
}
return $borrower_attributes;
}
sub put_image {
my ($image_name, $image_file) = @_;
if (my $image_limit = C4::Context->preference('ImageLimit')) { # enforce quota if set
my $query = "SELECT count(*) FROM creator_images;";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute();
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return 1;
}
return 202 if $sth->fetchrow_array >= $image_limit;
}
my$query = "INSERT INTO creator_images (imagefile, image_name) VALUES (?,?) ON DUPLICATE KEY UPDATE imagefile = ?;";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($image_file, $image_name, $image_file);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return 1;
}
return;
}
sub get_image {
my ($image_name, $fields) = @_;
$fields = '*' unless $fields;
my $query = "SELECT $fields FROM creator_images";
$query .= " WHERE image_name = ?" if $image_name;
my $sth = C4::Context->dbh->prepare($query);
if ($image_name) {
$sth->execute($image_name);
}
else {
$sth->execute();
}
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return 1;
}
return $sth->fetchall_arrayref({});
}
sub rm_image {
my $image_ids = shift;
my $errstr = ();
foreach my $image_id (@$image_ids) {
my $query = "DELETE FROM creator_images WHERE image_id = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($image_id);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
push (@$errstr, $image_id);
}
}
if ($errstr) {
return $errstr;
}
else {
return;
}
}
1;
__END__
=head1 NAME
C4::Patroncards::Lib - A shared library of linear functions used in the Patroncard Creator module in Koha
=head1 ABSTRACT
This library provides functions used by various sections of the Patroncard Creator module.
=head1 FUNCTIONS
=head2 C4::Patroncards::Lib::unpack_UTF8()
This function returns a reference to an array of hex values equivelant to the utf8 values of the string passed in. This assumes, of course, that the string is
indeed utf8.
example:
my $hex = unpack_UTF8($str);
=cut
=head2 C4::Patroncards::Lib::text_alignment()
This function returns $Tx and $Tw values for the supplied text alignment. It accepts six parameters:
C<origin_llx> = the x value for the origin of the text box to align text in
C<text_box_width> = the width in postscript points of the text box
C<text_llx> = the x value for the lower left point of the text to align
C<string_width> = the width in postscript points of the string of text to align
C<line> = the line of text to align (this may be set to 'undef' for all alignment types except 'Justify')
C<alignment> = the type of text alignment desired:
=item .
B<L> Left align
=item .
B<C> Center align
=item .
B<R> Right align
=item .
B<J> Justify
example:
my ($Tx, $Tw) = text_alignment($origin_llx, $text_box_width, $text_llx, $string_width, $line, $alignment);
=cut
=head2 C4::Patroncards::Lib::leading()
This function accepts a single parameter, font postscript point size, and returns the ammount of leading to be added.
example:
my $leading = leading($font_size);
=cut
=head2 C4::Patroncards::Lib::box()
This function will create and insert a "guide box" into the supplied pdf object. It accepts five arguments:
C<llx> = the x value of the lower left coordinate of the guide box
C<lly> = the y value of the lower left coordinate of the guide box
C<width> = the width of the guide box
C<height> = the height of the guide box
C<pdf> = the pdf object into which to insert the guide box
example:
box($llx, $lly, $width, $height, $pdf);
=cut
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=head1 COPYRIGHT
Copyright 2009 Foundations Bible College.
=head1 LICENSE
This file is part of Koha.
Koha 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.
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
=head1 DISCLAIMER OF WARRANTY
Koha 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.
=cut

View file

@ -0,0 +1,290 @@
package C4::Patroncards::Patroncard;
# Copyright 2009 Foundations Bible College.
#
# This file is part of Koha.
#
# Koha 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.
#
# Koha 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.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use warnings;
use autouse 'Data::Dumper' => qw(Dumper);
use Text::Wrap qw(wrap);
#use Font::TTFMetrics;
use C4::Creators::Lib 1.000000 qw(get_font_types);
use C4::Creators::PDF 1.000000 qw(StrWidth);
use C4::Patroncards::Lib 1.000000 qw(unpack_UTF8 text_alignment leading box get_borrower_attributes);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
sub new {
my ($invocant, %params) = @_;
my $type = ref($invocant) || $invocant;
my $self = {
batch_id => $params{'batch_id'},
#card_number => $params{'card_number'},
borrower_number => $params{'borrower_number'},
llx => $params{'llx'},
lly => $params{'lly'},
height => $params{'height'},
width => $params{'width'},
layout => $params{'layout'},
text_wrap_cols => $params{'text_wrap_cols'},
};
bless ($self, $type);
return $self;
}
sub draw_barcode {
my ($self, $pdf) = @_;
#FIXME: We do some scaling foo on the barcode here which probably should be done by the one invoking draw_barcode
my $barcode_width = 0.8 * $self->{'width'}; # this scales the barcode width to 80% of the label width
my $barcode_y_scale_factor = 0.01 * $self->{'height'}; # this scales the barcode height to 1% of the label height
_draw_barcode( $self,
llx => $self->{'llx'} + $self->{'layout'}->{'barcode'}->{'llx'},
lly => $self->{'lly'} + $self->{'layout'}->{'barcode'}->{'lly'},
width => $barcode_width,
y_scale_factor => $barcode_y_scale_factor,
barcode_type => $self->{'layout'}->{'barcode'}->{'type'},
barcode_data => $self->{'layout'}->{'barcode'}->{'data'},
text => $self->{'layout'}->{'barcode'}->{'text_print'},
);
}
sub draw_guide_box {
my ($self, $pdf) = @_;
warn sprintf('No pdf object passed in.') and return -1 if !$pdf;
my $obj_stream = "q\n"; # save the graphic state
$obj_stream .= "0.5 w\n"; # border line width
$obj_stream .= "1.0 0.0 0.0 RG\n"; # border color red
$obj_stream .= "1.0 1.0 1.0 rg\n"; # fill color white
$obj_stream .= "$self->{'llx'} $self->{'lly'} $self->{'width'} $self->{'height'} re\n"; # a rectangle
$obj_stream .= "B\n"; # fill (and a little more)
$obj_stream .= "Q\n"; # restore the graphic state
$pdf->Add($obj_stream);
}
sub draw_text {
my ($self, $pdf, %params) = @_;
warn sprintf('No pdf object passed in.') and return -1 if !$pdf;
my @card_text = ();
my $text = $self->{'layout'}->{'text'};
return unless (ref($text) eq 'ARRAY'); # just in case there is not text
while (scalar @$text) {
my $line = shift @$text;
my $parse_line = $line;
my @orig_line = split(/ /,$line);
if ($parse_line =~ m/<[A-Za-z0-9]+>/) { # test to see if the line has db fields embedded...
my @fields = ();
while ($parse_line =~ m/<([A-Za-z0-9]+)>(.*$)/) {
push (@fields, $1);
$parse_line = $2;
}
my $borrower_attributes = get_borrower_attributes($self->{'borrower_number'},@fields);
grep{ # substitute data for db fields
if ($_ =~ m/<([A-Za-z0-9]+)>/) {
my $field = $1;
$_ =~ s/$_/$borrower_attributes->{$field}/;
}
} @orig_line;
$line = join(' ',@orig_line);
}
my $text_attribs = shift @$text;
my $origin_llx = $self->{'llx'} + $text_attribs->{'llx'};
my $origin_lly = $self->{'lly'} + $text_attribs->{'lly'};
my $Tx = 0; # final text llx
my $Ty = $origin_lly; # final text lly
my $Tw = 0; # final text word spacing. See http://www.adobe.com/devnet/pdf/pdf_reference.html ISO 32000-1
#FIXME: Move line wrapping code to its own sub if possible
my $trim = '';
my @lines = ();
#FIXME: Using embedded True Type fonts is a far superior way of handing things as well as being much more unicode friendly.
# However this will take significant work using better than PDF::Reuse to do it. For the time being, I'm leaving
# the basic code here commented out to preserve the basic method of accomplishing this. -chris_n
#
# my $m = Font::TTFMetrics->new("/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf");
# my $units_per_em = $m->get_units_per_em();
# my $font_units_width = $m->string_width($line);
# my $string_width = ($font_units_width * $text_attribs->{'font_size'}) / $units_per_em;
my $string_width = C4::Creators::PDF->StrWidth($line, $text_attribs->{'font'}, $text_attribs->{'font_size'});
if (($string_width + $text_attribs->{'llx'}) > $self->{'width'}) {
WRAP_LINES:
while (1) {
# $line =~ m/^.*(\s\b.*\b\s*|\s&|\<\b.*\b\>)$/; # original regexp... can be removed after dev stage is over
$line =~ m/^.*(\s.*\s*|\s&|\<.*\>)$/;
warn sprintf('Line wrap failed. DEBUG INFO: Data: \'%s\'\n Method: C4::Patroncards->draw_text Additional Information: Line wrap regexp failed. (Please file in this information in a bug report at http://bugs.koha.org', $line) and last WRAP_LINES if !$1;
$trim = $1 . $trim;
$line =~ s/$1//;
$string_width = C4::Creators::PDF->StrWidth($line, $text_attribs->{'font'}, $text_attribs->{'font_size'});
# $font_units_width = $m->string_width($line);
# $string_width = ($font_units_width * $text_attribs->{'font_size'}) / $units_per_em;
if (($string_width + $text_attribs->{'llx'}) < $self->{'width'}) {
($Tx, $Tw) = text_alignment($origin_llx, $self->{'width'}, $text_attribs->{'llx'}, $string_width, $line, $text_attribs->{'text_alignment'});
push @lines, {line=> $line, Tx => $Tx, Ty => $Ty, Tw => $Tw};
$line = undef;
last WRAP_LINES if $trim eq '';
$Ty -= leading($text_attribs->{'font_size'});
$line = $trim;
$trim = '';
$string_width = C4::Creators::PDF->StrWidth($line, $text_attribs->{'font'}, $text_attribs->{'font_size'});
#$font_units_width = $m->string_width($line);
#$string_width = ($font_units_width * $text_attribs->{'font_size'}) / $units_per_em;
if (($string_width + $text_attribs->{'llx'}) < $self->{'width'}) {
($Tx, $Tw) = text_alignment($origin_llx, $self->{'width'}, $text_attribs->{'llx'}, $string_width, $line, $text_attribs->{'text_alignment'});
$line =~ s/^\s+//g; # strip naughty leading spaces
push @lines, {line=> $line, Tx => $Tx, Ty => $Ty, Tw => $Tw};
last WRAP_LINES;
}
}
}
}
else {
($Tx, $Tw) = text_alignment($origin_llx, $self->{'width'}, $text_attribs->{'llx'}, $string_width, $line, $text_attribs->{'text_alignment'});
$line =~ s/^\s+//g; # strip naughty leading spaces
push @lines, {line=> $line, Tx => $Tx, Ty => $Ty, Tw => $Tw};
}
# Draw boxes around text box areas
# FIXME: This needs to compensate for the point height of decenders. In its current form it is helpful but not really usable. The boxes are also not transparent atm.
# If these things were fixed, it may be desirable to give the user control over whether or not to display these boxes for layout design.
if (0) {
my $box_height = 0;
my $box_lly = $origin_lly;
if (scalar(@lines) > 1) {
$box_height += scalar(@lines) * ($text_attribs->{'font_size'} * 1.2);
$box_lly -= ($text_attribs->{'font_size'} * 0.2);
}
else {
$box_height += $text_attribs->{'font_size'};
}
box ($origin_llx, $box_lly, $self->{'width'} - $text_attribs->{'llx'}, $box_height, $pdf);
}
# my $font_resource = $pdf->TTFont("/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf");
# $pdf->FontSize($text_attribs->{'font_size'});
my $font_resource = $pdf->Font($text_attribs->{'font'});
foreach my $line (@lines) {
# $pdf->Text($line->{'Tx'}, $line->{'Ty'}, $line->{'line'});
my $text_line = "BT /$font_resource $text_attribs->{'font_size'} Tf $line->{'Tx'} $line->{'Ty'} Td $line->{'Tw'} Tw ($line->{'line'}) Tj ET";
$pdf->Add($text_line);
}
}
}
sub draw_image {
my ($self, $pdf) = @_;
warn sprintf('No pdf object passed in.') and return -1 if !$pdf;
my $images = $self->{'layout'}->{'images'};
PROCESS_IMAGES:
foreach my $image (keys %$images) {
next PROCESS_IMAGES if $images->{$image}->{'data_source'}->{'image_source'} eq 'none';
my $Tx = $self->{'llx'} + $images->{$image}->{'Tx'};
my $Ty = $self->{'lly'} + $images->{$image}->{'Ty'};
warn sprintf('No image passed in.') and next if !$images->{$image}->{'data'};
my $intName = $pdf->AltJpeg($images->{$image}->{'data'},$images->{$image}->{'Sx'}, $images->{$image}->{'Sy'}, 1, $images->{$image}->{'alt'}->{'data'},$images->{$image}->{'alt'}->{'Sx'}, $images->{$image}->{'alt'}->{'Sy'}, 1);
my $obj_stream = "q\n";
$obj_stream .= "$images->{$image}->{'Sx'} $images->{$image}->{'Ox'} $images->{$image}->{'Oy'} $images->{$image}->{'Sy'} $Tx $Ty cm\n"; # see http://www.adobe.com/devnet/pdf/pdf_reference.html sec 8.3.3 of ISO 32000-1
$obj_stream .= "/$intName Do\n";
$obj_stream .= "Q\n";
$pdf->Add($obj_stream);
}
}
sub _draw_barcode { # this is cut-and-paste from Label.pm because there is no common place for it atm...
my $self = shift;
my %params = @_;
my $x_scale_factor = 1;
my $num_of_chars = length($params{'barcode_data'});
my $tot_bar_length = 0;
my $bar_length = 0;
my $guard_length = 10;
if ($params{'barcode_type'} =~ m/CODE39/) {
$bar_length = '17.5';
$tot_bar_length = ($bar_length * $num_of_chars) + ($guard_length * 2); # not sure what all is going on here and on the next line; this is old (very) code
$x_scale_factor = ($params{'width'} / $tot_bar_length);
if ($params{'barcode_type'} eq 'CODE39MOD') {
my $c39 = CheckDigits('code_39'); # get modulo 43 checksum
$params{'barcode_data'} = $c39->complete($params{'barcode_data'});
}
elsif ($params{'barcode_type'} eq 'CODE39MOD10') {
my $c39_10 = CheckDigits('siret'); # get modulo 10 checksum
$params{'barcode_data'} = $c39_10->complete($params{'barcode_data'});
}
eval {
PDF::Reuse::Barcode::Code39(
x => $params{'llx'},
y => $params{'lly'},
value => "*$params{barcode_data}*",
xSize => $x_scale_factor,
ySize => $params{'y_scale_factor'},
hide_asterisk => 1,
text => $params{'text'},
mode => 'graphic',
);
};
if ($@) {
warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@);
}
}
elsif ($params{'barcode_type'} eq 'COOP2OF5') {
$bar_length = '9.43333333333333';
$tot_bar_length = ($bar_length * $num_of_chars) + ($guard_length * 2);
$x_scale_factor = ($params{'width'} / $tot_bar_length) * 0.9;
eval {
PDF::Reuse::Barcode::COOP2of5(
x => $params{'llx'},
y => $params{'lly'},
value => "*$params{barcode_data}*",
xSize => $x_scale_factor,
ySize => $params{'y_scale_factor'},
mode => 'graphic',
);
};
if ($@) {
warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@);
}
}
elsif ( $params{'barcode_type'} eq 'INDUSTRIAL2OF5' ) {
$bar_length = '13.1333333333333';
$tot_bar_length = ($bar_length * $num_of_chars) + ($guard_length * 2);
$x_scale_factor = ($params{'width'} / $tot_bar_length) * 0.9;
eval {
PDF::Reuse::Barcode::Industrial2of5(
x => $params{'llx'},
y => $params{'lly'},
value => "*$params{barcode_data}*",
xSize => $x_scale_factor,
ySize => $params{'y_scale_factor'},
mode => 'graphic',
);
};
if ($@) {
warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@);
}
}
}
1;
__END__
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=cut

View file

@ -1,292 +0,0 @@
package C4::Labels::Patroncard;
# Copyright 2009 Foundations Bible College.
#
# This file is part of Koha.
#
# Koha 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.
#
# Koha 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.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use warnings;
use C4::Context;
use C4::Debug;
use C4::Biblio;
use C4::Labels::Layout 1.000000; # use version 1.0.0 or better
use C4::Labels::Template 1.000000;
use Data::Dumper;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
sub _check_params {
my $given_params = {};
my $exit_code = 0;
my @valid_template_params = (
'layout_id',
'tmpl_id',
'prof_id',
);
if (scalar(@_) >1) {
$given_params = {@_};
foreach my $key (keys %{$given_params}) {
if (!(grep m/$key/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $key);
$exit_code = 1;
}
}
}
else {
if (!(grep m/$_/, @valid_template_params)) {
warn sprintf('Unrecognized parameter type of "%s".', $_);
$exit_code = 1;
}
}
return $exit_code;
}
=head1 NAME
C4::Labels::Batch - A class for creating and manipulating batch objects in Koha
=cut
=head1 METHODS
=head2 C4::Labels::Batch->new(layout_id => layout_id, tmpl_id => template_id, prof_id => prof_id)
Invoking the I<new> method constructs a new batch object with no items.
example:
my $batch = C4::Labels::Batch->new(layout_id => layout_id, tmpl_id => template_id, prof_id => prof_id);
# Creates and returns a new batch object
B<NOTE:> This batch is I<not> written to the database untill $batch->save() is invoked. You have been warned!
=cut
sub new {
my ($invocant, %params) = @_;
my $type = ref($invocant) || $invocant;
my $self = {
batch_id => 0,
layout_id => $params{layout_id},
tmpl_id => $params{tmpl_id},
prof_id => $params{prof_id},
items => [],
batch_stat => 0, # False if any data has changed and the db has not been updated
};
bless ($self, $type);
return $self;
}
=head2 $batch->add_item($item_number)
Invoking the I<add_item> method will add the supplied item to the batch object.
example:
$batch->add_item($item_number);
=cut
sub add_item {
my $self = shift;
my $item_num = shift;
push (@{$self->{items}}, $item_num);
$self->{batch_stat} = 0;
}
=head2 $batch->get_attr()
Invoking the I<get_attr> method will return the requested attribute.
example:
my @items = $batch->get_attr($attr);
=cut
sub get_attr {
my $self = shift;
return $self->{$_[0]};
}
=head2 $batch->delete_item()
Invoking the I<delete_item> method will delete the supplied item from the batch object.
example:
$batch->delete_item();
=cut
sub delete_item {
my $self = shift;
my $item_num = shift;
my $index = 0;
++$index until $$self->{items}[$index] == $item_num or $item_num > $#$self->{items};
delete ($$self->{items}[$index]);
$self->{batch_stat} = 0;
}
=head2 $batch->save()
Invoking the I<save> method attempts to insert the batch into the database if the batch is new and
update the existing batch record if the batch exists. The method returns the new record batch_id upon
success and -1 upon failure (This avoids conflicting with a record batch_id of 1). Errors are
logged to the Apache log.
example:
my $exitstat = $batch->save(); # to save the record behind the $batch object
=cut
sub save {
my $self = shift;
if ($self->{batch_id} > 0) {
foreach my $item_number (@$self->{items}) {
my $query = "UPDATE labels_batches SET item_number=?, layout_id=?, tmpl_id=?, prof_id=? WHERE batch_id=?;";
warn "DEBUG: Updating: $query\n" if $debug;
my $sth->C4::Context->dbh->prepare($query);
$sth->execute($item_number, $self->{layout_id}, $self->{tmpl_id}, $self->{prof_id}, $self->{batch_id});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
}
}
else {
foreach my $item_number (@$self->{items}) {
my $query = "INSERT INTO labels_batches (item_number, layout_id, tmpl_id, prof_id) VALUES (?,?,?,?);";
warn "DEBUG: Inserting: $query\n" if $debug;
my $sth->C4::Context->dbh->prepare($query);
$sth->execute($item_number, $self->{layout_id}, $self->{tmpl_id}, $self->{prof_id});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return -1;
}
my $sth1 = C4::Context->dbh->prepare("SELECT MAX(batch_id) FROM labels_batches;");
$sth1->execute();
my $batch_id = $sth1->fetchrow_array;
$self->{batch_id} = $batch_id;
return $batch_id;
}
}
$self->{batch_stat} = 1;
}
=head2 C4::Labels::Template->retrieve(template_id)
Invoking the I<retrieve> method constructs a new template object containing the current values for template_id. The method returns
a new object upon success and 1 upon failure. Errors are logged to the Apache log. Two further options may be accessed. See the example
below for further description.
examples:
my $template = C4::Labels::Template->retrieve(template_id => 1); # Retrieves template record 1 and returns an object containing the record
my $template = C4::Labels::Template->retrieve(template_id => 1, convert => 1); # Retrieves template record 1, converts the units to points,
and returns an object containing the record
my $template = C4::Labels::Template->retrieve(template_id => 1, prof_id => prof_id); # Retrieves template record 1, converts the units
to points, applies the given profile id, and returns an object containing the record
=cut
sub retrieve {
my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $query = "SELECT * FROM labels_batches WHERE batch_id = ? ORDER BY label_id";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{batch_id});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
return 1;
}
my $self = {
items => [],
};
while (my $record = $sth->fetchrow_hashref) {
$self->{batch_id} = $record->{batch_id}; # FIXME: seems a bit wasteful to re-initialize these every trip: is there a better way?
$self->{layout_id} = $record->{layout_id};
$self->{tmpl_id} = $record->{tmpl_id};
$self->{prof_id} = $record->{prof_id};
push (@{$self->{items}}, $record->{item_number});
}
$self->{batch_stat} = 1;
bless ($self, $type);
return $self;
}
=head2 C4::Labels::Batch->delete(batch_id => batch_id) | $batch->delete()
Invoking the delete method attempts to delete the batch from the database. The method returns 0 upon success
and 1 upon failure. Errors are logged to the Apache log.
examples:
my $exitstat = $batch->delete(); # to delete the record behind the $batch object
my $exitstat = C4::Labels::Batch->delete(batch_id => 1); # to delete batch record 1
=cut
sub delete {
my $self = shift;
my %opts = @_;
if ((ref $self) && !$self->{'batch_id'}) { # If there is no batch batch_id then we cannot delete it from the db
warn 'Cannot delete batch: Batch has not been saved.';
return 1;
}
elsif (!$opts{batch_id}) {
warn 'Cannot delete batch: Missing batch_id.';
return 1;
}
my $query = "DELETE FROM labels_batches WHERE batch_id = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($self->{'batch_id'});
return 0;
}
1;
__END__
=head1 AUTHOR
Chris Nighswonger <cnighswonger AT foundations DOT edu>
=cut
#
# elsif ( $label_type eq 'PATCRD' ) {
# my $patron_data = $item;
#
# #FIXME: This needs to be paramatized and passed in from the user...
# #Each element of this hash is a separate line on the patron card. Keys are the text to print and the associated data is the point size.
# my $text = {
# $patron_data->{'description'} => $template->get_attr('font_size'),
# $patron_data->{'branchname'} => ($template->get_attr('font_size') + 3),
# };
#
# $debug and warn "Generating patron card for cardnumber $patron_data->{'cardnumber'}";
#
# my $barcode_height = $label_height / 2.75; #FIXME: Scaling barcode height; this needs to be a user parameter.
# $label->barcode( $llx, $lly, $barcode_height, $label_width, $patron_data->{'cardnumber'},
# $barcodetype );
# DrawPatronCardText( $llx, $lly, $label_height, $label_width, $template->get_attr('font'), $template->get_attr('font_size'),
# $left_text_margin, $text_wrap_cols, $text, $label_type );
# _calc_next_label_pos();
# }

47
C4/Patroncards/Profile.pm Normal file
View file

@ -0,0 +1,47 @@
package C4::Patroncards::Profile;
use strict;
use warnings;
use base qw(C4::Creators::Profile);
use autouse 'Data::Dumper' => qw(Dumper);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
__PACKAGE__ =~ m/^C4::(.+)::.+$/;
my $me = $1;
sub new {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::new(@_);
}
sub save {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::save(@_);
}
sub retrieve {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::retrieve(@_);
}
sub delete {
if (ref($_[0])) {
my $self = shift; # check to see if this is a method call
push @_, "creator", $me;
return $self->SUPER::delete(@_);
}
else {
push @_, "creator", $me;
return __PACKAGE__->SUPER::delete(@_); # XXX: is this too hackish?
}
}
1;

View file

@ -0,0 +1,43 @@
package C4::Patroncards::Template;
use strict;
use warnings;
use base qw(C4::Creators::Template);
use autouse 'Data::Dumper' => qw(Dumper);
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
}
use constant TEMPLATE_TABLE => 'creator_templates';
__PACKAGE__ =~ m/^C4::(.+)::.+$/;
my $me = $1;
sub new {
my $self = shift;
push @_, "creator", $me;
return $self->SUPER::new(@_);
}
sub retrieve {
my $self = shift;
push @_, "table_name", TEMPLATE_TABLE, "creator", $me;
return $self->SUPER::retrieve(@_);
}
sub delete {
my $self = shift;
push @_, "table_name", TEMPLATE_TABLE, "creator", $me;
return $self->SUPER::delete(@_);
}
sub save {
my $self = shift;
push @_, "table_name", TEMPLATE_TABLE, "creator", $me;
return $self->SUPER::save(@_);
}
1;

View file

@ -352,7 +352,7 @@ sub CanBookBeReserved{
my @args;
my $rightsquery = "SELECT categorycode, itemtype, branchcode, reservesallowed
FROM issuingrules
WHERE categorycode = ?";
WHERE categorycode IN (?, '*')";
push @args,$borrower->{categorycode};
if($controlbranch eq "ItemHomeLibrary"){
@ -370,7 +370,6 @@ sub CanBookBeReserved{
}
$rightsquery .= " ORDER BY categorycode DESC, itemtype DESC, branchcode DESC";
my $sthrights = $dbh->prepare($rightsquery);
$sthrights->execute(@args);
@ -405,7 +404,6 @@ sub CanBookBeReserved{
if(my $row = $sthcount->fetchrow_hashref()){
$reservescount = $row->{count};
}
if($reservescount < $reservesrights){
return 1;
}else{

459
C4/RotatingCollections.pm Normal file
View file

@ -0,0 +1,459 @@
package C4::RotatingCollections;
# $Id: RotatingCollections.pm,v 0.1 2007/04/20 kylemhall
# This package is inteded to keep track of what library
# Items of a certain collection should be at.
# Copyright 2007 Kyle Hall
#
# This file is part of Koha.
#
# Koha 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.
#
# Koha 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.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
require Exporter;
use C4::Context;
use C4::Circulation;
use DBI;
use Data::Dumper;
use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
=head1 NAME
C4::RotatingCollections - Functions for managing rotating collections
=head1 FUNCTIONS
=over 2
=cut
@ISA = qw( Exporter );
@EXPORT = qw(
CreateCollection
UpdateCollection
DeleteCollection
GetItemsInCollection
GetCollection
GetCollections
AddItemToCollection
RemoveItemFromCollection
TransferCollection
GetCollectionItemBranches
);
=item CreateCollection
( $success, $errorcode, $errormessage ) = CreateCollection( $title, $description );
Creates a new collection
Input:
$title: short description of the club or service
$description: long description of the club or service
Output:
$success: 1 if all database operations were successful, 0 otherwise
$errorCode: Code for reason of failure, good for translating errors in templates
$errorMessage: English description of error
=cut
sub CreateCollection {
my ( $title, $description ) = @_;
## Check for all neccessary parameters
if ( ! $title ) {
return ( 0, 1, "No Title Given" );
}
if ( ! $description ) {
return ( 0, 2, "No Description Given" );
}
my $success = 1;
my $dbh = C4::Context->dbh;
my $sth;
$sth = $dbh->prepare("INSERT INTO collections ( colId, colTitle, colDesc )
VALUES ( NULL, ?, ? )");
$sth->execute( $title, $description ) or return ( 0, 3, $sth->errstr() );
$sth->finish;
return 1;
}
=item UpdateCollection
( $success, $errorcode, $errormessage ) = UpdateCollection( $colId, $title, $description );
Updates a collection
Input:
$colId: id of the collection to be updated
$title: short description of the club or service
$description: long description of the club or service
Output:
$success: 1 if all database operations were successful, 0 otherwise
$errorCode: Code for reason of failure, good for translating errors in templates
$errorMessage: English description of error
=cut
sub UpdateCollection {
my ( $colId, $title, $description ) = @_;
## Check for all neccessary parameters
if ( ! $colId ) {
return ( 0, 1, "No Id Given" );
}
if ( ! $title ) {
return ( 0, 2, "No Title Given" );
}
if ( ! $description ) {
return ( 0, 3, "No Description Given" );
}
my $dbh = C4::Context->dbh;
my $sth;
$sth = $dbh->prepare("UPDATE collections
SET
colTitle = ?, colDesc = ?
WHERE colId = ?");
$sth->execute( $title, $description, $colId ) or return ( 0, 4, $sth->errstr() );
$sth->finish;
return 1;
}
=item DeleteCollection
( $success, $errorcode, $errormessage ) = DeleteCollection( $colId );
Deletes a collection of the given id
Input:
$colId : id of the Archtype to be deleted
Output:
$success: 1 if all database operations were successful, 0 otherwise
$errorCode: Code for reason of failure, good for translating errors in templates
$errorMessage: English description of error
=cut
sub DeleteCollection {
my ( $colId ) = @_;
## Paramter check
if ( ! $colId ) {
return ( 0, 1, "No Collection Id Given" );;
}
my $dbh = C4::Context->dbh;
my $sth;
$sth = $dbh->prepare("DELETE FROM collections WHERE colId = ?");
$sth->execute( $colId ) or return ( 0, 4, $sth->errstr() );
$sth->finish;
return 1;
}
=item GetCollections
$collections = GetCollections();
Returns data about all collections
Output:
On Success:
$results: Reference to an array of associated arrays
On Failure:
$errorCode: Code for reason of failure, good for translating errors in templates
$errorMessage: English description of error
=cut
sub GetCollections {
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("SELECT * FROM collections");
$sth->execute() or return ( 1, $sth->errstr() );
my @results;
while ( my $row = $sth->fetchrow_hashref ) {
push( @results , $row );
}
$sth->finish;
return \@results;
}
=item GetItemsInCollection
( $results, $success, $errorcode, $errormessage ) = GetItemsInCollection( $colId );
Returns information about the items in the given collection
Input:
$colId: The id of the collection
Output:
$results: Reference to an array of associated arrays
$success: 1 if all database operations were successful, 0 otherwise
$errorCode: Code for reason of failure, good for translating errors in templates
$errorMessage: English description of error
=cut
sub GetItemsInCollection {
my ( $colId ) = @_;
## Paramter check
if ( ! $colId ) {
return ( 0, 0, 1, "No Collection Id Given" );;
}
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("SELECT
biblio.title,
items.itemcallnumber,
items.barcode
FROM collections, collections_tracking, items, biblio
WHERE collections.colId = collections_tracking.colId
AND collections_tracking.itemnumber = items.itemnumber
AND items.biblionumber = biblio.biblionumber
AND collections.colId = ? ORDER BY biblio.title");
$sth->execute( $colId ) or return ( 0, 0, 2, $sth->errstr() );
my @results;
while ( my $row = $sth->fetchrow_hashref ) {
push( @results , $row );
}
$sth->finish;
return \@results;
}
=item GetCollection
( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection( $colId );
Returns information about a collection
Input:
$colId: Id of the collection
Output:
$colId, $colTitle, $colDesc, $colBranchcode
=cut
sub GetCollection {
my ( $colId ) = @_;
my $dbh = C4::Context->dbh;
my ( $sth, @results );
$sth = $dbh->prepare("SELECT * FROM collections WHERE colId = ?");
$sth->execute( $colId ) or return 0;
my $row = $sth->fetchrow_hashref;
$sth->finish;
return (
$$row{'colId'},
$$row{'colTitle'},
$$row{'colDesc'},
$$row{'colBranchcode'}
);
}
=item AddItemToCollection
( $success, $errorcode, $errormessage ) = AddItemToCollection( $colId, $itemnumber );
Adds an item to a rotating collection.
Input:
$colId: Collection to add the item to.
$itemnumber: Item to be added to the collection
Output:
$success: 1 if all database operations were successful, 0 otherwise
$errorCode: Code for reason of failure, good for translating errors in templates
$errorMessage: English description of error
=cut
sub AddItemToCollection {
my ( $colId, $itemnumber ) = @_;
## Check for all neccessary parameters
if ( ! $colId ) {
return ( 0, 1, "No Collection Given" );
}
if ( ! $itemnumber ) {
return ( 0, 2, "No Itemnumber Given" );
}
if ( isItemInThisCollection( $itemnumber, $colId ) ) {
return ( 0, 2, "Item is already in the collection!" );
} elsif ( isItemInAnyCollection( $itemnumber ) ) {
return ( 0, 3, "Item is already in a different collection!" );
}
my $dbh = C4::Context->dbh;
my $sth;
$sth = $dbh->prepare("INSERT INTO collections_tracking ( ctId, colId, itemnumber )
VALUES ( NULL, ?, ? )");
$sth->execute( $colId, $itemnumber ) or return ( 0, 3, $sth->errstr() );
$sth->finish;
return 1;
}
=item RemoveItemFromCollection
( $success, $errorcode, $errormessage ) = RemoveItemFromCollection( $colId, $itemnumber );
Removes an item to a collection
Input:
$colId: Collection to add the item to.
$itemnumber: Item to be removed from collection
Output:
$success: 1 if all database operations were successful, 0 otherwise
$errorCode: Code for reason of failure, good for translating errors in templates
$errorMessage: English description of error
=cut
sub RemoveItemFromCollection {
my ( $colId, $itemnumber ) = @_;
## Check for all neccessary parameters
if ( ! $itemnumber ) {
return ( 0, 2, "No Itemnumber Given" );
}
if ( ! isItemInThisCollection( $itemnumber, $colId ) ) {
return ( 0, 2, "Item is not in the collection!" );
}
my $dbh = C4::Context->dbh;
my $sth;
$sth = $dbh->prepare("DELETE FROM collections_tracking
WHERE itemnumber = ?");
$sth->execute( $itemnumber ) or return ( 0, 3, $sth->errstr() );
$sth->finish;
return 1;
}
=item TransferCollection
( $success, $errorcode, $errormessage ) = TransferCollection( $colId, $colBranchcode );
Transfers a collection to another branch
Input:
$colId: id of the collection to be updated
$colBranchcode: branch where collection is moving to
Output:
$success: 1 if all database operations were successful, 0 otherwise
$errorCode: Code for reason of failure, good for translating errors in templates
$errorMessage: English description of error
=cut
sub TransferCollection {
my ( $colId, $colBranchcode ) = @_;
## Check for all neccessary parameters
if ( ! $colId ) {
return ( 0, 1, "No Id Given" );
}
if ( ! $colBranchcode ) {
return ( 0, 2, "No Branchcode Given" );
}
my $dbh = C4::Context->dbh;
my $sth;
$sth = $dbh->prepare("UPDATE collections
SET
colBranchcode = ?
WHERE colId = ?");
$sth->execute( $colBranchcode, $colId ) or return ( 0, 4, $sth->errstr() );
$sth->finish;
$sth = $dbh->prepare("SELECT barcode FROM items, collections_tracking
WHERE items.itemnumber = collections_tracking.itemnumber
AND collections_tracking.colId = ?");
$sth->execute( $colId ) or return ( 0, 4, $sth->errstr );
my @results;
while ( my $item = $sth->fetchrow_hashref ) {
my ( $dotransfer, $messages, $iteminformation ) = transferbook( $colBranchcode, $item->{'barcode'}, my $ignore_reserves = 1);
}
return 1;
}
=item isItemInThisCollection
$inCollection = isItemInThisCollection( $itemnumber, $colId );
=cut
sub isItemInThisCollection {
my ( $itemnumber, $colId ) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("SELECT COUNT(*) as inCollection FROM collections_tracking WHERE itemnumber = ? AND colId = ?");
$sth->execute( $itemnumber, $colId ) or return( 0 );
my $row = $sth->fetchrow_hashref;
return $$row{'inCollection'};
}
=item isItemInAnyCollection
$inCollection = isItemInAnyCollection( $itemnumber );
=cut
sub isItemInAnyCollection {
my ( $itemnumber ) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("SELECT itemnumber FROM collections_tracking WHERE itemnumber = ?");
$sth->execute( $itemnumber ) or return( 0 );
my $row = $sth->fetchrow_hashref;
my $itemnumber = $$row{'itemnumber'};
$sth->finish;
if ( $itemnumber ) {
return 1;
} else {
return 0;
}
}
1;
__END__
=back
=head1 AUTHOR
Kyle Hall <kylemhall@gmail.com>
=cut

View file

@ -197,7 +197,7 @@ $template->param(result=>\@results);
sub SimpleSearch {
my ( $query, $offset, $max_results, $servers ) = @_;
if ( C4::Context->preference('NoZebra') ) {
my $result = NZorder( NZanalyse($query) )->{'biblioserver'};
my $search_result =
@ -283,7 +283,7 @@ sub SimpleSearch {
);
The all singing, all dancing, multi-server, asynchronous, scanning,
searching, record nabbing, facet-building
searching, record nabbing, facet-building
See verbse embedded documentation.
@ -517,9 +517,9 @@ sub getRecords {
# if it's a branch, label by the name, not the code,
if ( $link_value =~ /branch/ ) {
if (defined $branches
&& ref($branches) eq "HASH"
&& defined $branches->{$one_facet}
if (defined $branches
&& ref($branches) eq "HASH"
&& defined $branches->{$one_facet}
&& ref ($branches->{$one_facet}) eq "HASH")
{
$facet_label_value =
@ -550,7 +550,7 @@ sub getRecords {
push @facets_loop, {
type_link_value => $link_value,
type_id => $link_value . "_id",
"type_label_" . $facets_info->{$link_value}->{'label_value'} => 1,
"type_label_" . $facets_info->{$link_value}->{'label_value'} => 1,
facets => \@this_facets_array,
expandable => $expandable,
expand => $link_value,
@ -578,10 +578,10 @@ sub pazGetRecords {
my $results_hashref = {};
my $stats = XMLin($paz->stat);
my $results = XMLin($paz->show($offset, $results_per_page, 'work-title:1'), forcearray => 1);
# for a grouped search result, the number of hits
# is the number of groups returned; 'bib_hits' will have
# the total number of bibs.
# the total number of bibs.
$results_hashref->{'biblioserver'}->{'hits'} = $results->{'merged'}->[0];
$results_hashref->{'biblioserver'}->{'bib_hits'} = $stats->{'hits'};
@ -613,7 +613,7 @@ sub pazGetRecords {
push @{ $results_hashref->{'biblioserver'}->{'GROUPS'} }, $result_group;
}
# pass through facets
my $termlist_xml = $paz->termlist('author,subject');
my $terms = XMLin($termlist_xml, forcearray => 1);
@ -647,7 +647,7 @@ sub _remove_stopwords {
# we use IsAlpha unicode definition, to deal correctly with diacritics.
# otherwise, a French word like "leçon" woudl be split into "le" "çon", "le"
# is a stopword, we'd get "çon" and wouldn't find anything...
#
#
foreach ( keys %{ C4::Context->stopwords } ) {
next if ( $_ =~ /(and|or|not)/ ); # don't remove operators
$debug && warn "$_ Dump($operand)";
@ -700,13 +700,13 @@ sub _build_stemmed_operand {
# If operand contains a digit, it is almost certainly an identifier, and should
# not be stemmed. This is particularly relevant for ISBNs and ISSNs, which
# can contain the letter "X" - for example, _build_stemmend_operand would reduce
# can contain the letter "X" - for example, _build_stemmend_operand would reduce
# "014100018X" to "x ", which for a MARC21 database would bring up irrelevant
# results (e.g., "23 x 29 cm." from the 300$c). Bug 2098.
return $operand if $operand =~ /\d/;
# FIXME: the locale should be set based on the user's language and/or search choice
warn "$lang";
#warn "$lang";
my $stemmer = Lingua::Stem::Snowball->new( lang => $lang,
encoding => "UTF-8" );
@ -852,13 +852,15 @@ sub buildQuery {
# pass nested queries directly
# FIXME: need better handling of some of these variables in this case
if ( $query =~ /(\(|\))/ ) {
return (
undef, $query, $simple_query, $query_cgi,
$query, $limit, $limit_cgi, $limit_desc,
$stopwords_removed, 'ccl'
);
}
# Nested queries aren't handled well and this implementation is flawed and causes users to be
# unable to search for anything containing () commenting out, will be rewritten for 3.4.0
# if ( $query =~ /(\(|\))/ ) {
# return (
# undef, $query, $simple_query, $query_cgi,
# $query, $limit, $limit_cgi, $limit_desc,
# $stopwords_removed, 'ccl'
# );
# }
# Form-based queries are non-nested and fixed depth, so we can easily modify the incoming
# query operands and indexes and add stemming, truncation, field weighting, etc.
@ -905,7 +907,7 @@ sub buildQuery {
# ISBN,ISSN,Standard Number, don't need special treatment
elsif ( $index eq 'nb' || $index eq 'ns' ) {
$indexes_set++;
(
(
$stemming, $auto_truncation,
$weight_fields, $fuzzy_enabled,
$remove_stopwords
@ -932,8 +934,10 @@ sub buildQuery {
}
if ($auto_truncation){
$operand=~join(" ",map{ "$_*" }split (/\s+/,$operand));
}
# join throws an error if there is a leading space
$operand =~ s/^\s+//;
$operand=~join(" ",map{ "$_*" }split (/\s+/,$operand));
}
# Detect Truncation
my $truncated_operand;
@ -1090,7 +1094,9 @@ sub buildQuery {
}
# Normalize the query and limit strings
$query =~ s/:/=/g;
# This is flawed , means we can't search anything with : in it
# if user wants to do ccl or cql, start the query with that
# $query =~ s/:/=/g;
$limit =~ s/:/=/g;
for ( $query, $query_desc, $limit, $limit_desc ) {
s/ / /g; # remove extra spaces
@ -1195,20 +1201,20 @@ sub searchResults {
}
my $marcflavour = C4::Context->preference("marcflavour");
# We get the biblionumber position in MARC
# We get the biblionumber position in MARC
my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblio.biblionumber','');
my $fw;
# loop through all of the records we've retrieved
for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) {
my $marcrecord = MARC::File::USMARC::decode( $marcresults[$i] );
if ($bibliotag<10){
$fw = GetFrameworkCode($marcrecord->field($bibliotag)->data);
}else{
$fw = GetFrameworkCode($marcrecord->subfield($bibliotag,$bibliosubf));
}
my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, $fw );
$oldbiblio->{subtitle} = GetRecordValue('subtitle', $marcrecord, $fw);
$oldbiblio->{result_number} = $i + 1;
@ -1231,7 +1237,7 @@ sub searchResults {
if ( $itemtypes{ $oldbiblio->{itemtype} }->{summary} ) {
my $summary = $itemtypes{ $oldbiblio->{itemtype} }->{summary};
my @fields = $marcrecord->fields();
my $newsummary;
foreach my $line ( "$summary\n" =~ /(.*)\n/g ){
my $tags = {};
@ -1242,28 +1248,28 @@ sub searchResults {
$tags->{$tag} = $#abc + 1 ;
}
}
# We catch how many times to repeat this line
my $max = 0;
foreach my $tag (keys(%$tags)){
$max = $tags->{$tag} if($tags->{$tag} > $max);
}
# we replace, and repeat each line
for (my $i = 0 ; $i < $max ; $i++){
my $newline = $line;
foreach my $tag ( $newline =~ /\[(\d{3}[\w|\d])\]/g ) {
$tag =~ /(.{3})(.)/;
if($marcrecord->field($1)){
my @repl = $marcrecord->field($1)->subfield($2);
my $subfieldvalue = $repl[$i];
if (! utf8::is_utf8($subfieldvalue)) {
utf8::decode($subfieldvalue);
}
$newline =~ s/\[$tag\]/$subfieldvalue/g;
}
}
@ -1313,7 +1319,7 @@ sub searchResults {
foreach my $code ( keys %subfieldstosearch ) {
$item->{$code} = $field->subfield( $subfieldstosearch{$code} );
}
my $hbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'homebranch' : 'holdingbranch';
my $otherbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'holdingbranch' : 'homebranch';
# set item's branch name, use HomeOrHoldingBranch syspref first, fall back to the other one
@ -1321,7 +1327,7 @@ sub searchResults {
$item->{'branchname'} = $branches{$item->{$hbranch}};
}
elsif ($item->{$otherbranch}) { # Last resort
$item->{'branchname'} = $branches{$item->{$otherbranch}};
$item->{'branchname'} = $branches{$item->{$otherbranch}};
}
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber};
@ -1355,7 +1361,7 @@ sub searchResults {
# is item in transit?
my $transfertwhen = '';
my ($transfertfrom, $transfertto);
unless ($item->{wthdrawn}
|| $item->{itemlost}
|| $item->{damaged}
@ -1381,7 +1387,7 @@ sub searchResults {
if ( $item->{wthdrawn}
|| $item->{itemlost}
|| $item->{damaged}
|| $item->{notforloan}
|| $item->{notforloan}
|| ($transfertwhen ne ''))
{
$wthdrawn_count++ if $item->{wthdrawn};
@ -1460,34 +1466,34 @@ sub searchResults {
$oldbiblio->{orderedcount} = $ordered_count;
$oldbiblio->{isbn} =~
s/-//g; # deleting - in isbn to enable amazon content
push( @newresults, $oldbiblio )
push( @newresults, $oldbiblio )
if(not $hidelostitems
or (($items_count > $itemlost_count )
or (($items_count > $itemlost_count )
&& $hidelostitems));
}
return @newresults;
}
=head2 SearchAcquisitions
Search for acquisitions
Search for acquisitions
=cut
sub SearchAcquisitions{
my ($datebegin, $dateend, $itemtypes,$criteria, $orderby) = @_;
my $dbh=C4::Context->dbh;
# Variable initialization
my $str=qq|
SELECT marcxml
FROM biblio
SELECT marcxml
FROM biblio
LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber
LEFT JOIN items ON items.biblionumber=biblio.biblionumber
WHERE dateaccessioned BETWEEN ? AND ?
WHERE dateaccessioned BETWEEN ? AND ?
|;
my (@params,@loopcriteria);
push @params, $datebegin->output("iso");
push @params, $dateend->output("iso");
@ -1496,53 +1502,53 @@ sub SearchAcquisitions{
$str .= "AND items.itype IN (?".( ',?' x scalar @$itemtypes - 1 ).") ";
}else{
$str .= "AND biblioitems.itemtype IN (?".( ',?' x scalar @$itemtypes - 1 ).") ";
}
}
push @params, @$itemtypes;
}
if ($criteria =~/itemtype/){
if(C4::Context->preference("item-level_itypes")){
$str .= "AND items.itype=? ";
}else{
$str .= "AND biblioitems.itemtype=? ";
}
if(scalar(@$itemtypes) == 0){
my $itypes = GetItemTypes();
for my $key (keys %$itypes){
push @$itemtypes, $key;
}
}
@loopcriteria= @$itemtypes;
}elsif ($criteria=~/itemcallnumber/){
$str .= "AND (items.itemcallnumber LIKE CONCAT(?,'%')
$str .= "AND (items.itemcallnumber LIKE CONCAT(?,'%')
OR items.itemcallnumber is NULL
OR items.itemcallnumber = '')";
@loopcriteria = ("AA".."ZZ", "") unless (scalar(@loopcriteria)>0);
@loopcriteria = ("AA".."ZZ", "") unless (scalar(@loopcriteria)>0);
}else {
$str .= "AND biblio.title LIKE CONCAT(?,'%') ";
@loopcriteria = ("A".."z") unless (scalar(@loopcriteria)>0);
@loopcriteria = ("A".."z") unless (scalar(@loopcriteria)>0);
}
if ($orderby =~ /date_desc/){
$str.=" ORDER BY dateaccessioned DESC";
} else {
$str.=" ORDER BY title";
}
my $qdataacquisitions=$dbh->prepare($str);
my @loopacquisitions;
foreach my $value(@loopcriteria){
push @params,$value;
my %cell;
$cell{"title"}=$value;
$cell{"titlecode"}=$value;
eval{$qdataacquisitions->execute(@params);};
if ($@){ warn "recentacquisitions Error :$@";}
else {
my @loopdata;
@ -1632,7 +1638,7 @@ sub NZanalyse {
# depending of operand, intersect, union or exclude both lists
# to get a result list
if ( $operator eq ' and ' ) {
return NZoperatorAND($leftresult,$rightresult);
return NZoperatorAND($leftresult,$rightresult);
}
elsif ( $operator eq ' or ' ) {
@ -1640,13 +1646,13 @@ sub NZanalyse {
return $leftresult . $rightresult;
}
elsif ( $operator eq ' not ' ) {
return NZoperatorNOT($leftresult,$rightresult);
return NZoperatorNOT($leftresult,$rightresult);
}
}
}
else {
# this error is impossible, because of the regexp that isolate the operand, but just in case...
return $leftresult;
}
}
}
warn "string :" . $string if $DEBUG;
my $left = "";
@ -1738,7 +1744,7 @@ sub NZanalyse {
$left = 'subject' if $left =~ '^su$';
$left = 'koha-Auth-Number' if $left =~ '^an$';
$left = 'keyword' if $left =~ '^kw$';
$left = 'itemtype' if $left =~ '^mc$'; # Fix for Bug 2599 - Search limits not working for NoZebra
$left = 'itemtype' if $left =~ '^mc$'; # Fix for Bug 2599 - Search limits not working for NoZebra
warn "handling leaf... left:$left operator:$operator right:$right" if $DEBUG;
my $dbh = C4::Context->dbh;
if ( $operator && $left ne 'keyword' ) {
@ -1814,10 +1820,10 @@ sub NZanalyse {
sub NZoperatorAND{
my ($rightresult, $leftresult)=@_;
my @leftresult = split /;/, $leftresult;
warn " @leftresult / $rightresult \n" if $DEBUG;
# my @rightresult = split /;/,$leftresult;
my $finalresult;
@ -1838,7 +1844,7 @@ sub NZoperatorAND{
warn "NZAND DONE : $finalresult \n" if $DEBUG;
return $finalresult;
}
sub NZoperatorOR{
my ($rightresult, $leftresult)=@_;
return $rightresult.$leftresult;
@ -1846,7 +1852,7 @@ sub NZoperatorOR{
sub NZoperatorNOT{
my ($leftresult, $rightresult)=@_;
my @leftresult = split /;/, $leftresult;
# my @rightresult = split /;/,$leftresult;
@ -1864,7 +1870,7 @@ sub NZoperatorNOT{
=head2 NZorder
$finalresult = NZorder($biblionumbers, $ordering,$results_per_page,$offset);
TODO :: Description
=cut
@ -2299,12 +2305,12 @@ sub BiblioAddAuthorities{
my $dbh=C4::Context->dbh;
my $query=$dbh->prepare(qq|
SELECT authtypecode,tagfield
FROM marc_subfield_structure
WHERE frameworkcode=?
FROM marc_subfield_structure
WHERE frameworkcode=?
AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|);
# SELECT authtypecode,tagfield
# FROM marc_subfield_structure
# WHERE frameworkcode=?
# FROM marc_subfield_structure
# WHERE frameworkcode=?
# AND (authtypecode IS NOT NULL OR authtypecode<>\"\")|);
$query->execute($frameworkcode);
my ($countcreated,$countlinked);
@ -2316,7 +2322,7 @@ AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|);
my $query='at='.$data->{authtypecode}.' ';
map {$query.= ' and he,ext="'.$_->[1].'"' if ($_->[0]=~/[A-z]/)} $field->subfields();
my ($error, $results, $total_hits)=SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
# there is only 1 result
# there is only 1 result
if ( $error ) {
warn "BIBLIOADDSAUTHORITIES: $error";
return (0,0) ;
@ -2326,14 +2332,14 @@ AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|);
$field->add_subfields('9'=>$marcrecord->field('001')->data);
$countlinked++;
} elsif (scalar(@$results)>1) {
#More than One result
#More than One result
#This can comes out of a lack of a subfield.
# my $marcrecord = MARC::File::USMARC::decode($results->[0]);
# $record->field($data->{tagfield})->add_subfields('9'=>$marcrecord->field('001')->data);
$countlinked++;
} else {
#There are no results, build authority record, add it to Authorities, get authid and add it to 9
###NOTICE : This is only valid if a subfield is linked to one and only one authtypecode
###NOTICE : This is only valid if a subfield is linked to one and only one authtypecode
###NOTICE : This can be a problem. We should also look into other types and rejected forms.
my $authtypedata=C4::AuthoritiesMarc->GetAuthType($data->{authtypecode});
next unless $authtypedata;

View file

@ -24,6 +24,7 @@ use POSIX qw(strftime);
use C4::Suggestions;
use C4::Koha;
use C4::Biblio;
use C4::Branch;
use C4::Items;
use C4::Search;
use C4::Letters;
@ -83,6 +84,8 @@ this function get all suppliers with late issues.
return :
the supplierlist into a hash. this hash containts id & name of the supplier
Only valid suppliers are returned. Late subscriptions lacking a supplier are
ignored.
=back
@ -103,6 +106,7 @@ sub GetSuppliersWithLateIssues {
$sth->execute;
my %supplierlist;
while ( my ( $id, $name ) = $sth->fetchrow ) {
next if !defined $id;
$supplierlist{$id} = $name;
}
return %supplierlist;
@ -457,6 +461,7 @@ sub PrepareSerialsData {
? format_date( $subs->{'publisheddate'} )
: "XXX"
);
$subs->{'branchname'} = GetBranchName( $subs->{'branchcode'} );
$subs->{'planneddate'} = format_date( $subs->{'planneddate'} );
$subs->{ "status" . $subs->{'status'} } = 1;
$subs->{"checked"} = $subs->{'status'} =~ /1|3|4|7/;

View file

@ -33,6 +33,7 @@ use C4::Output;
use C4::Dates qw/format_date/;
use Exporter;
use Data::Dumper;
use C4::Csv;
use vars qw($debug @EXPORT @ISA $VERSION);
@ -181,6 +182,7 @@ SWITCH: {
}
($items, $totitems) = GetShelfContents($shelfnumber, $shelflimit, $shelfoffset);
for my $this_item (@$items) {
my $record = GetMarcBiblio($this_item->{'biblionumber'});
# the virtualshelfcontents table does not store these columns nor are they retrieved from the items
# and itemtypes tables, so I'm commenting them out for now to quiet the log -crn
#$this_item->{imageurl} = $imgdir."/".$itemtypes->{ $this_item->{itemtype} }->{'imageurl'};
@ -188,6 +190,7 @@ SWITCH: {
$this_item->{'dateadded'} = format_date($this_item->{'dateadded'});
$this_item->{'imageurl'} = getitemtypeinfo($this_item->{'itemtype'})->{'imageurl'};
$this_item->{'coins'} = GetCOinSBiblio($this_item->{'biblionumber'});
$this_item->{'subtitle'} = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 'subtitle', $record, '');
}
push @paramsloop, {display => 'privateshelves'} if $category == 1;
$showadd = 1;
@ -317,6 +320,7 @@ $template->param(
shelvesloopall => [(@shelvesloop, @shelveslooppriv)],
numberCanManage => $numberCanManage,
"BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
csv_profiles => GetCsvProfilesLoop()
);
if ($template->param('viewshelf') or
$template->param( 'shelves' ) or

View file

@ -133,6 +133,7 @@ sub XSLTParse4Display {
}
$sysxml .= "</sysprefs>\n";
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
$xmlrecord =~ s/\& /\&amp\; /;
my $parser = XML::LibXML->new();
# don't die when you find &, >, etc

View file

@ -5,7 +5,7 @@ Installation Guide for Installing Koha on Debian Lenny with MySQL 5
Feedback/bug reports: Koha Developer's List:
http://lists.koha.org/mailman/listinfo/koha-devel
This document last modified: 13 March 2009
This document last modified: 19 December 2009
Installation Instructions
=============================
@ -50,35 +50,25 @@ Note: for more information about Git, please see the Koha Git Usage Guide:
Find the latest Koha stable version on http://download.koha.org
and get it:
$ wget http://download.koha.org/koha-3.00.01-stable.tar.gz
$ wget <URL> found on download.koha.org
1.5 Install additional Debian dependencies
IMPORTANT: You should only use CPAN for Perl dependencies which are NOT
available from the package maintainer. You have been warned!
Using the debian-lenny.packages file included in the Koha source tree,
run the following:
Run shell script installing all necessary Debian packages, MySQL Server,
Zebra and all Debian packaged Perl module required by Koha:
$ sudo dpkg --set-selections < install_misc/debian-lenny.packages
Now start dselect:
$ sudo apt-get install dselect
$ sudo dselect
Choose [I]nstall and accept packages to be installed (hit return)
(may take a while)
Choose [C]onfigure, [R]emove and [Q]uit until dselect has completed.
$ sudo install_misc/apt-get-debian-lenny.sh
1.6 Install Perl dependencies that aren't packaged into Debian Lenny
sources
Run the following command:
$ sudo cpan Algorithm::CheckDigits SMS::Send HTTP::OAI
$ sudo cpan Algorithm::CheckDigits SMS::Send HTTP::OAI IPC::Cmd \\
Memoize::Memcached PDF::API2::Simple PDF::Table Storable Test::More
Note: you may need to run CPAN initialization if you've not run cpan
before:
@ -187,27 +177,37 @@ configured to run as the root user.
Option 1: run the Zebra processes from the command line:
Zebra Server:
1.1 Zebra Search Server
This process send responses to search requests sent by Koha or
Z39.50/SRU/SRW clients.
$ sudo -u ${KOHA_USER} zebrasrv -f /etc/koha/koha-conf.xml
(note that the path to koha-conf.xml may be different depending on your
installation choices)
Note: the user you run Zebra as will be the only user with write permission
on the Zebra index; in development mode, you may wish to use your system
user.
Note: the user you run Zebra as will be the only user with write permission
on the Zebra index; in development mode, you may wish to use your
system user.
Zebraqueue Daemon:
$ sudo -u ${KOHA_USER} misc/bin/zebraqueue_daemon.pl
1.2 Zebra Indexer
Added/updated/deleted records in Koha MySQL database must be indexed
into Zebra. A specific script must be launched each time a bibliographic
or an authority record is edited.
$ sudo -u ${KOHA_USER} misc/migration_tools/rebuild_zebra -z -b -a
Note: if you are running in this mode, you may wish to defer starting the
zebraqueue until you've run the web installer (see below).
Option 2: run the Zebra processes as daemons, and add to startup process:
Option 2: run automatically Zebra processes as daemons:
Note that references to $SCRIPT_DIR refer to the directory where
Koha's command-line scripts are installed, e.g., /usr/share/koha/bin.
Zebra Server:
1.1 Zebra Search Server
$ sudo ln -s ${SCRIPT_DIR}/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon
(Note: ${SCRIPT_DIR} is /usr/share/koha/bin/ by default in a standard install)
$ sudo update-rc.d koha-zebra-daemon defaults
@ -215,12 +215,14 @@ Koha's command-line scripts are installed, e.g., /usr/share/koha/bin.
$ sudo ${SCRIPT_DIR}/koha-zebra-ctl.sh start
Zebraqueue Daemon:
$ sudo ln -s ${SCRIPT_DIR}/koha-zebraqueue-ctl.sh /etc/init.d/koha-zebraqueue-daemon
$ sudo update-rc.d koha-zebraqueue-daemon defaults
( Note: see man chkconfig(8) on other distros )
1.2 Zebra Indexer
$ sudo ${SCRIPT_DIR}/koha-zebraqueue-ctl.sh start
Add an entry in Koha user crontab to scheduled added/updated/deleted records
indexing by Zebra with this command:
<path/to/koha>/misc/migration_tools/rebuild_zebra -z -b -a
See check misc/cronjobs/crontab.example for usage examples.
6. Run the Web Installer, populate the database, initial configuration of settings
@ -239,10 +241,14 @@ Koha's command-line scripts are installed, e.g., /usr/share/koha/bin.
(note: use the correct path to your koha-conf.xml)
7.1 Import:
Bibliographic data in MARC21 format
Bibliographic data in MARC21 format
$ misc/migration-tools/bulkmarcimport.pl -file /path/to/marc.iso2709
Authority data in MARC21 format
$ misc/migration-tools/bulkauthimport.pl -file /path/to/auth.iso2709
Authority data in MARC21 format
$ misc/migration-tools/bulkmarcimport.pl -a -file /path/to/auth.iso2709
7.2 Fast Index:
$ misc/migration-tools/rebuild_zebra.pl -b -w
@ -296,10 +302,6 @@ Tested on the following operating environments
==============================================
- Debian Lenny 5.0
Installer Bug reports
=====================
Please send any installer bug reports to jmf AT liblime DOT com
Other Notes
=====================
This file is part of Koha

View file

@ -48,7 +48,7 @@ Makefile.PL - Koha packager and installer
sudo make install
=head2 UPGRADE INSTALLATION
NOTE: This option is only available if koha-install-log exists.
perl Makefile.PL --prev-install-log /path/to/koha-install-log
@ -117,7 +117,7 @@ contents will be copied to the installation target directory.
=item If a subdirectory of a mapped directory is specified,
its target overrides the parent's target for that subdirectory.
=item The value of each map entry may either be a scalar containing
=item The value of each map entry may either be a scalar containing
one target or a reference to a hash containing 'target' and 'trimdir'
keys.
@ -139,7 +139,7 @@ The permitted installation targets are:
=over 4
=item INTRANET_CGI_DIR
=item INTRANET_CGI_DIR
CGI scripts for intranet (staff) interface.
@ -213,7 +213,7 @@ contain information of interest to Koha developers.
=item DOC_DIR
Directory for Koha documentation accessed from the
Directory for Koha documentation accessed from the
command-line, e.g., READMEs.
=item LOG_DIR
@ -255,7 +255,7 @@ my $target_map = {
'./etc' => { target => 'KOHA_CONF_DIR', trimdir => -1 },
'./etc/zebradb' => { target => 'ZEBRA_CONF_DIR', trimdir => -1 },
'./etc/pazpar2' => { target => 'PAZPAR2_CONF_DIR', trimdir => -1 },
'./help.pl' => 'INTRANET_CGI_DIR',
'./help.pl' => 'INTRANET_CGI_DIR',
'./installer-CPAN.pl' => 'NONE',
'./installer' => 'INTRANET_CGI_DIR',
'./errors' => {target => 'INTRANET_CGI_DIR'},
@ -267,10 +267,10 @@ my $target_map = {
'./Makefile.PL' => 'NONE',
'./MANIFEST.SKIP' => 'NONE',
'./members' => 'INTRANET_CGI_DIR',
'./misc' => { target => 'SCRIPT_NONDEV_DIR', trimdir => -1 },
'./misc/bin' => { target => 'SCRIPT_DIR', trimdir => -1 },
'./misc' => { target => 'SCRIPT_NONDEV_DIR', trimdir => -1 },
'./misc/bin' => { target => 'SCRIPT_DIR', trimdir => -1 },
'./misc/release_notes' => { target => 'DOC_DIR', trimdir => 2 },
'./misc/translator' => { target => 'MISC_DIR', trimdir => 2 },
'./misc/translator' => { target => 'MISC_DIR', trimdir => 2 },
'./misc/koha-install-log' => { target => 'MISC_DIR', trimdir => -1 },
'./misc/installer_devel_notes' => 'NONE',
'./opac' => 'OPAC_CGI_DIR',
@ -299,7 +299,7 @@ my $target_map = {
'./svc' => 'INTRANET_CGI_DIR',
'./t' => 'NONE',
'./tags' => 'INTRANET_CGI_DIR',
'./tmp' => 'NONE', # FIXME need to determine whether
'./tmp' => 'NONE', # FIXME need to determine whether
# Koha generates any persistent temp files
# that should go in /var/tmp/koha
'./tools' => 'INTRANET_CGI_DIR',
@ -320,7 +320,7 @@ The following configuration options are used by the installer.
Specifies whether installation will be FHS-compliant (default,
assumes user has root), put everything under
a single directory (for users installing on a web host
that allows CGI scripts and a MySQL database but not root
that allows CGI scripts and a MySQL database but not root
access), or development (for a developer who wants to run
Koha from a git clone with no fuss).
@ -364,7 +364,7 @@ Specifies format of MARC records to be indexed by Zebra.
=item ZEBRA_LANGUAGE
Specifies primary language of records that will be
Specifies primary language of records that will be
indexed by Zebra.
=item ZEBRA_USER
@ -391,7 +391,7 @@ System group that will own Koha's files.
my %config_defaults = (
'DB_TYPE' => 'mysql',
'DB_HOST' => 'localhost',
'DB_NAME' => 'koha',
'DB_NAME' => 'koha',
'DB_USER' => 'kohaadmin',
'DB_PASS' => 'katikoan',
'INSTALL_ZEBRA' => 'yes',
@ -507,7 +507,7 @@ if ($config{'INSTALL_ZEBRA'} eq "yes") {
);
}
$config{'ZEBRA_AUTH_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom' ? 'zebra-authorities-dom.cfg' : 'zebra-authorities.cfg';
$config{'AUTH_RETRIEVAL_CFG'} =
$config{'AUTH_RETRIEVAL_CFG'} =
$config{'AUTH_INDEX_MODE'} eq 'dom' ? 'retrieval-info-auth-dom.xml' : 'retrieval-info-auth-grs1.xml';
}
@ -527,7 +527,7 @@ my %test_suite_override_dirs = (
ZEBRA_DATA_DIR => ['var', 'lib', 'zebradb'],
ZEBRA_RUN_DIR => ['var', 'run', 'zebradb'],
);
WriteMakefile(
NAME => 'koha',
#VERSION => strftime('2.9.%Y%m%d%H',gmtime),
@ -556,8 +556,9 @@ WriteMakefile(
'Digest::SHA' => 5.43,
'Email::Date' => 1.103,
'File::Temp' => 0.16,
'GD' => 2.39, #optional
'GD' => 2.39, #optional, used for patron image feature
'GD::Barcode::UPCE' => 1.1,
'Graphics::Magick' => 1.3.7, #optional, used for patron cards creator
'Getopt::Long' => 2.35,
'Getopt::Std' => 1.05,
'HTML::Template::Pro' => 0.69,
@ -570,6 +571,7 @@ WriteMakefile(
'LWP::Simple' => 1.41,
'LWP::UserAgent' => 2.033,
'Lingua::Stem' => 0.82,
'Lingua::Stem::Snowball' => 0.952,
'List::Util' => 1.18,
'List::MoreUtils' => 0.21,
'Locale::Language' => 2.07,
@ -654,7 +656,7 @@ sub hashdir{
return $tree;
}
=head2 get_file_map
=head2 get_file_map
This function combines the target_map and file hash to
map each source file to its destination relative to
@ -768,7 +770,7 @@ sub _add_to_file_map {
# spaces and shell metacharacters from all file names
$source =~ s/ /\\ /g;
$destination =~ s/ /\\ /g;
$file_map->{$source} = $destination unless (!$install_zebra and $targetdir =~ /ZEBRA/);
}
}
@ -783,7 +785,7 @@ Reads value from the Koha install log specified by
sub get_install_log_values {
my $install_log = shift;
my $values = shift;
open LOG, "<$install_log" or die "Cannot open install log $install_log: $!\n";
while (<LOG>) {
chomp;
@ -823,7 +825,7 @@ By default, Koha can be installed in one of three ways:
standard: Install files in conformance with the Filesystem
Hierarchy Standard (FHS). This is the default mode
and should be used when installing a production
Koha system. On Unix systems, root access is
Koha system. On Unix systems, root access is
needed to complete a standard installation.
single: Install files under a single directory. This option
@ -853,16 +855,16 @@ be run from the current directory.
Configuration directory:);
# FIXME - home directory portability consideration apply
$install_base_default =
$install_base_default =
$ENV{DESTDIR}
|| ( exists $ENV{HOME} ? "$ENV{HOME}/koha-dev" : "$defaults->{'INSTALL_BASE'}-dev" )
|| ( exists $ENV{HOME} ? "$ENV{HOME}/koha-dev" : "$defaults->{'INSTALL_BASE'}-dev" )
;
} elsif ($config{'INSTALL_MODE'} eq 'single') {
$msg = "\nPlease specify the directory in which to install Koha";
# FIXME -- we're assuming under a 'single' mode install
# that user will likely want to install under the home
# directory. This is OK in and of itself, but we should
# use File::HomeDir to locate the home directory portably.
# use File::HomeDir to locate the home directory portably.
# This is deferred for now because File::HomeDir is not yet
# core.
# --we must also keep this portable to the major OS's -fbcit
@ -870,10 +872,10 @@ Configuration directory:);
} else {
# must be standard
$msg = q(
Please specify the directory under which most Koha files
Please specify the directory under which most Koha files
will be installed.
Note that if you are planning in installing more than
Note that if you are planning in installing more than
one instance of Koha, you may want to modify the last
component of the directory path, which will be used
as the package name in the FHS layout.
@ -889,7 +891,7 @@ Base installation directory);
Since you are using the 'standard' install
mode, you should run 'make install' as root.
However, it is recommended that a non-root
user (on Unix and Linux platforms) have
user (on Unix and Linux platforms) have
ownership of Koha's files, including the
Zebra indexes if applicable.
@ -925,8 +927,8 @@ DBMS to use);
$config{'DB_TYPE'} = _get_value('DB_TYPE', $msg, $defaults->{'DB_TYPE'}, $valid_values, $install_log_values);
$msg = q(
Please specify the name or address of your
database server. Note that the database
Please specify the name or address of your
database server. Note that the database
does not have to exist at this point, it
can be created after running 'make install'
and before you try using Koha for the first time.
@ -951,7 +953,7 @@ used by Koha);
$config{'DB_USER'} = _get_value('DB_USER', $msg, $defaults->{'DB_USER'}, $valid_values, $install_log_values);
$msg = q(
Please specify the password of the user that owns the
Please specify the password of the user that owns the
database to be used by Koha);
$config{'DB_PASS'} = _get_value('DB_PASS', $msg, $defaults->{'DB_PASS'}, $valid_values, $install_log_values);
@ -959,7 +961,7 @@ database to be used by Koha);
Koha can use the Zebra search engine for high-performance
searching of bibliographic and authority records. If you
have installed the Zebra software and would like to use it,
please answer 'yes' to the following question. Otherwise,
please answer 'yes' to the following question. Otherwise,
Koha will default to using its internal search engine.
Please note that if you choose *NOT* to install Zebra,
@ -1005,12 +1007,12 @@ records.
Primary language for Zebra indexing);
$msg .= _add_valid_values_disp('ZEBRA_LANGUAGE', $valid_values);
$config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values);
$msg = q(
Koha can use one of two different indexing modes
Koha can use one of two different indexing modes
for the MARC authorities records:
grs1 - uses the Zebra GRS-1 filter, available
grs1 - uses the Zebra GRS-1 filter, available
for legacy support
dom - uses the DOM XML filter; offers improved
functionality.
@ -1018,7 +1020,7 @@ dom - uses the DOM XML filter; offers improved
Authorities indexing mode);
$msg .= _add_valid_values_disp('AUTH_INDEX_MODE', $valid_values);
$config{'AUTH_INDEX_MODE'} = _get_value('AUTH_INDEX_MODE', $msg, $defaults->{'AUTH_INDEX_MODE'}, $valid_values, $install_log_values);
$msg = q(
Please specify Zebra database user);
$config{'ZEBRA_USER'} = _get_value('ZEBRA_USER', $msg, $defaults->{'ZEBRA_USER'}, $valid_values, $install_log_values);
@ -1096,8 +1098,8 @@ PazPar2 port?);
}
}
$msg = q(
Use memcached and memoize to cache the results of some function calls?
This provides a signficant performance improvement.
Use memcached and memoize to cache the results of some function calls?
This provides a signficant performance improvement.
You will need a Memcached server running.);
$msg .= _add_valid_values_disp('USE_MEMCACHED', $valid_values);
$config{'USE_MEMCACHED'} = _get_value('USE_MEMCACHED', $msg, $defaults->{'USE_MEMCACHED'}, $valid_values, $install_log_values);
@ -1108,7 +1110,7 @@ Since you've chosen to use caching, you must specify the memcached servers and t
$msg = q(
Memcached server address?);
$config{'MEMCACHED_SERVERS'} = _get_value('MEMCACHED_SERVERS', $msg, $defaults->{'MEMCACHED_SERVERS'}, $valid_values, $install_log_values);
$msg = q(
Memcached namespace?);
$config{'MEMCACHED_NAMESPACE'} = _get_value('MEMCACHED_NAMESPACE', $msg, $defaults->{'MEMCACHED_NAMESPACE'}, $valid_values, $install_log_values);
@ -1136,7 +1138,7 @@ doing it in a database that you don't want to lose.
Please specify the name of the test database to be
used by Koha);
$config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values);
while ( $config{'TEST_DB_NAME'} eq $config{'DB_NAME'} ) {
$msg = q(Please do not use the same database for testing as you do for production. You run the severe risk of data loss.);
@ -1147,9 +1149,9 @@ used by Koha);
Please specify the user that owns the database to be
used by Koha);
$config{'TEST_DB_USER'} = _get_value('TEST_DB_USER', $msg, $defaults->{'TEST_DB_USER'}, $valid_values, $install_log_values);
$msg = q(
Please specify the password of the user that owns the
Please specify the password of the user that owns the
database to be used by Koha);
$config{'TEST_DB_PASS'} = _get_value('TEST_DB_PASS', $msg, $defaults->{'TEST_DB_PASS'}, $valid_values, $install_log_values);
}
@ -1170,7 +1172,7 @@ database to be used by Koha);
sub _add_valid_values_disp {
my $key = shift;
my $valid_values = shift;
my $disp = "";
if (exists $valid_values->{$key}) {
$disp = " (" . join(", ", sort keys %{ $valid_values->{$key} }) . ")";
@ -1198,7 +1200,7 @@ sub _get_value {
my $val = prompt($msg, $default);
while (exists $valid_values->{$key} and
while (exists $valid_values->{$key} and
$val ne $default and
not exists $valid_values->{$key}->{$val}) {
my $retry_msg = "Value '$val' is not a valid option.\n";
@ -1209,12 +1211,12 @@ sub _get_value {
return $val;
}
=head2 get_target_directories
=head2 get_target_directories
Creates a hash mapping from symbols for installation target
directories to actual directory paths.
Also returns a hash indicating targets for which
Also returns a hash indicating targets for which
files need not be copied -- this is used for the 'dev'
mode installation, where some files are installed in place.
@ -1315,12 +1317,12 @@ sub get_target_directories {
_get_env_overrides(\%dirmap);
_get_argv_overrides(\%dirmap);
_add_destdir(\%dirmap);
_add_destdir(\%dirmap) unless ($^O eq 'MSWin32');
return \%dirmap, \%skipdirs;
}
=head2 get_test_dir
=head2 get_test_dir
Map a directory target to the corresponding path for
the test suite.
@ -1329,14 +1331,14 @@ the test suite.
sub get_test_dir {
my ($dirname) = @_;
my @basedir = (File::Spec->rel2abs(File::Spec->curdir()), 't', 'run');
my @basedir = (File::Spec->rel2abs(File::Spec->curdir()), 't', 'run');
if (exists $test_suite_override_dirs{$dirname}) {
return File::Spec->catdir(@basedir, @{ $test_suite_override_dirs{$dirname} });
} else {
return;
}
}
sub _get_env_overrides {
@ -1352,7 +1354,7 @@ sub _get_env_overrides {
sub _get_argv_overrides {
my $dirmap = shift;
my @new_argv = ();
for (my $i = 0; $i <= $#ARGV; $i++) {
if ($ARGV[$i] =~ /^([^=]+)=([^=]+)$/ and exists $dirmap->{$1}) {
@ -1440,14 +1442,14 @@ sub test {
my $test = $self->SUPER::test(@_);
$test =~ s!\$\(INST_LIB\)!blib/PERL_MODULE_DIR!g;
# set KOHA_CONF
# set KOHA_CONF
$test =~ s!\$\(FULLPERLRUN\)!KOHA_CONF=blib/KOHA_CONF_DIR/koha-conf.xml \$(FULLPERLRUN)!g;
return $test;
}
sub install {
my $self = shift;
my $install = "";
my $install = "";
# NOTE: we're *not* doing this: my $install = $self->SUPER::install(@_);
# This means that we're completely overriding EU::MM's default
# installation and uninstallation targets.
@ -1464,10 +1466,10 @@ KOHA_DEST_$key = $target_directories->{$key}
install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_env_vars
\t\$(NOECHO) \$(NOOP)
);
$install .= "install_koha ::\n";
$install .= "install_koha ::\n";
$install .= "\t\$(NOECHO) umask 022; \$(MOD_INSTALL) \\\n";
foreach my $key (sort keys %$target_directories) {
$install .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
$install .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key};
}
$install .= "\t\t\$(INST_MAN1DIR) \$(DESTINSTALLMAN1DIR) \\\n";
@ -1511,7 +1513,7 @@ install :: all install_koha warn_koha_env_vars
$install .= "install_koha ::\n";
$install .= "\t\$(MOD_INSTALL) \\\n";
foreach my $key (sort keys %$target_directories) {
$install .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
$install .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key};
}
}
@ -1560,7 +1562,7 @@ sub _update_zebra_conf_target {
}
sub upgrade {
my $upgrade = "";
my $upgrade = "";
my $backup_suffix;
if (exists $install_log_values{'KOHA_INSTALLED_VERSION'}) {
@ -1581,7 +1583,7 @@ make_upgrade_backup ::
/;
foreach my $key (qw/KOHA_CONF_DIR INTRANET_TMPL_DIR INTRANET_WWW_DIR OPAC_TMPL_DIR OPAC_WWW_DIR
PAZPAR2_CONF_DIR ZEBRA_CONF_DIR/) {
$upgrade .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
$upgrade .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or
exists $skip_directories->{$key} or
not exists $target_directories->{$key};
@ -1608,16 +1610,16 @@ sub postamble {
# Hereagain, we must alter syntax per platform...
if ( $^O eq 'MSWin32' ) {
# NOTE: it is imperative that there be no whitespaces in ENV=value...
$env = join("\n", map { "__${_}__=$target_directories->{$_}" } keys %$target_directories);
$env = join("\n", map { "__${_}__=$target_directories->{$_}" } keys %$target_directories);
$env .= "\n\n";
$env .= join("\n", map { "__${_}__=$config{$_}" } keys %config);
}
else {
$env = join("\n", map { "export __${_}__ := $target_directories->{$_}" } keys %$target_directories);
$env = join("\n", map { "export __${_}__ := $target_directories->{$_}" } keys %$target_directories);
$env .= "\n\n";
$env .= join("\n", map { "export __${_}__ := $config{$_}" } keys %config);
}
if ( $config{'RUN_DATABASE_TESTS'} eq 'yes' ) {
if ( open( my $confhandle, '>', 't/test-config.txt' ) ) {
print $confhandle "# This configuration file lets the t/Makefile prepare a test koha-conf.xml file.\n";
@ -1639,7 +1641,7 @@ sub postamble {
} else {
warn 'unable to open conf file for database dependent tests: $!';
}
}
return "$env\n";
}

10
README
View file

@ -1,13 +1,11 @@
Koha 3 - the next-generation release of the award-winning Koha open-source
integrated library system.
30 December 2007 - Joshua Ferraro <jmf AT liblime DOT com>
Koha is distributed under the GNU GPL. Please read the file LICENSE for
more details.
To install or upgrade Koha, please see the INSTALL file.
To install or upgrade Koha, please see the INSTALL file appropriate to your platform.
Please report any bugs to the koha mailing lists or bug tracker and we
will try to fix them in a future release. The main koha web site is
http://www.koha.org/
Report bugs at http://bugs.koha.org/
Visit the Koha Project website at http://www.koha.org/

View file

@ -16,7 +16,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use warnings;
use C4::Output; # contains gettemplate
use C4::Auth;
use C4::Context;
@ -97,6 +97,7 @@ JSON
LWP::Simple
LWP::UserAgent
Lingua::Stem
Lingua::Stem::Snowball
List::Util
List::MoreUtils
Locale::Language

View file

@ -41,6 +41,7 @@ thus, it can be REJECTED, ACCEPTED, ORDERED, ASKED, AVAIBLE
=cut
use strict;
use warnings;
use Number::Format;
use CGI;
@ -146,14 +147,19 @@ foreach my $result (@results) {
$result->{'budget_branchname'} = GetBranchName( $result->{'budget_branchcode'} );
my $member = GetMember( $result->{'budget_owner_id'} );
my $member_full = $member->{'firstname'} . ' ' . $member->{'surname'};
my $member_full = $member->{'firstname'} . ' ' . $member->{'surname'} if $member;
$result->{'budget_owner'} = $member_full;
$result->{'budget_avail'} = $result->{'budget_amount'} - $result->{'budget_spent'};
if ($result->{'budget_spent'}){
$result->{'budget_avail'} = $result->{'budget_amount'} - $result->{'budget_spent'};
}
else {
$result->{'budget_avail'} = $result->{'budget_amount'};
}
$result->{'budget_spent'} = GetBudgetSpent( $result->{'budget_id'} );
$total += $result->{'budget_amount'};
$totspent += $result->{'budget_spent'};
$totspent += $result->{'budget_spent'} if $result->{'budget_spent'};
$totavail += $result->{'budget_avail'};
$result->{'budget_amount'} = $num->format_price( $result->{'budget_amount'} );
@ -164,7 +170,7 @@ foreach my $result (@results) {
# $result->{'budget_spent_percent'} = sprintf( "%00d", $spent_percent );
my $borrower = &GetMember( $result->{budget_owner_id} );
$result->{budget_owner_name} = $borrower->{'firstname'} . ' ' . $borrower->{'surname'};
$result->{budget_owner_name} = $borrower->{'firstname'} . ' ' . $borrower->{'surname'} if $borrower;
push( @loop_budget, { %{$result}, toggle => $toggle++ % 2, } );
}

View file

@ -306,4 +306,5 @@ if ( $op eq 'delete_confirm' ) {
grouped => $basket->{basketgroupid},
);
}
output_html_with_http_headers $query, $cookie, $template->output;

View file

@ -154,4 +154,7 @@ elsif ($op eq 'delete') {
enter => 1,
);
}
output_html_with_http_headers $query, $cookie, $template->output;

View file

@ -114,7 +114,14 @@ if ( $op eq 'add_form' ) {
my $budgetperiod_hash=GetBudgetPeriod($budget_period_id);
# get dropboxes
FormatData($budgetperiod_hash);
$$budgetperiod_hash{budget_period_total}= $num->format_price($$budgetperiod_hash{'budget_period_total'});
my $editnum = new Number::Format(
'int_curr_symbol' => '',
'thousands_sep' => '',
'mon_decimal_point' => '.'
);
$$budgetperiod_hash{budget_period_total}= $editnum->format_price($$budgetperiod_hash{'budget_period_total'});
$template->param(
%$budgetperiod_hash
);

View file

@ -152,7 +152,7 @@ if ($op eq 'add_form') {
# build branches select
my $branches = GetBranches;
my @branchloop_select;
foreach my $thisbranch ( keys %$branches ) {
foreach my $thisbranch ( sort keys %$branches ) {
my %row = (
value => $thisbranch,
branchname => $branches->{$thisbranch}->{'branchname'},

View file

@ -231,6 +231,7 @@ $sth = $dbh->prepare("SELECT frameworkcode, frameworktext, tagfield, tagsubfield
LEFT JOIN biblio_framework USING (frameworkcode)
WHERE authtypecode IS NOT NULL
AND authtypecode <> ''
AND tab > '-1'
AND authtypecode NOT IN (SELECT authtypecode FROM auth_types)
ORDER BY frameworkcode, tagfield, tagsubfield");
$sth->execute;

View file

@ -165,11 +165,13 @@ if ($op eq 'add_form') {
my $count = scalar(@$results);
my @loop;
for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
warn Data::Dumper::Dumper($results->[$i]);
push @loop, {
currency => $results->[$i]{'currency'},
rate => $results->[$i]{'rate'},
symbol => $results->[$i]{'symbol'},
timestamp => format_date($results->[$i]{'timestamp'}),
currency => $results->[$i]{'currency'},
rate => $results->[$i]{'rate'},
symbol => $results->[$i]{'symbol'},
timestamp => format_date($results->[$i]{'timestamp'}),
active => $results->[$i]{'active'},
};
}
$template->param(loop => \@loop);

View file

@ -99,8 +99,8 @@ elsif ($op eq 'delete-branch-item') {
# save the values entered
elsif ($op eq 'add') {
my $sth_search = $dbh->prepare("SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?");
my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, fine, finedays, firstremind, chargeperiod) VALUES(?,?,?,?,?,?,?,?,?,?,?)");
my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=? WHERE branchcode=? AND categorycode=? AND itemtype=?");
my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)");
my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, rentaldiscount=? WHERE branchcode=? AND categorycode=? AND itemtype=?");
my $br = $branch; # branch
my $bor = $input->param('categorycode'); # borrower category
@ -115,14 +115,15 @@ elsif ($op eq 'add') {
$maxissueqty =~ s/\s//g;
$maxissueqty = undef if $maxissueqty !~ /^\d+/;
my $issuelength = $input->param('issuelength');
my $rentaldiscount = $input->param('rentaldiscount');
$debug and warn "Adding $br, $bor, $cat, $fine, $maxissueqty";
$sth_search->execute($br,$bor,$cat);
my $res = $sth_search->fetchrow_hashref();
if ($res->{total}) {
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$br,$bor,$cat);
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$rentaldiscount, $br,$bor,$cat);
} else {
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$fine,$finedays,$firstremind,$chargeperiod);
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount);
}
}
elsif ($op eq "set-branch-defaults") {

View file

@ -23,7 +23,7 @@
=head1 systempreferences.pl
ALGO :
ALSO :
this script use an $op to know what to do.
if $op is empty or none of the above values,
- the default screen is build (with all records, or filtered datas).
@ -178,6 +178,7 @@ $tabsysprefs{NewItemsDefaultLocation} = "Circulation";
$tabsysprefs{ReturnToShelvingCart} = "Circulation";
$tabsysprefs{DisplayClearScreenButton} = "Circulation";
$tabsysprefs{AllowAllMessageDeletion} = "Circulation";
$tabsysprefs{OverdueNoticeBcc} = "Circulation";
# Staff Client
$tabsysprefs{TemplateEncoding} = "StaffClient";
@ -264,8 +265,8 @@ $tabsysprefs{BakerTaylorPassword} = 'EnhancedContent';
$tabsysprefs{BakerTaylorUsername} = 'EnhancedContent';
# Library Thing for Libraries
$tabsysprefs{LibraryThingForLibrariesID} = "EnhancedContent";
$tabsysprefs{LibraryThingForLibrariesEnabled} = "EnhancedContent";
$tabsysprefs{LibraryThingForLibrariesID} = "EnhancedContent";
$tabsysprefs{LibraryThingForLibrariesEnabled} = "EnhancedContent";
$tabsysprefs{LibraryThingForLibrariesTabbedView} = "EnhancedContent";
# Syndetics
@ -382,6 +383,11 @@ $tabsysprefs{'OAI-PMH:Subset'} = "OAI-PMH";
# ILS-DI variables
$tabsysprefs{'ILS-DI'} = "ILS-DI";
# Creator variables
$tabsysprefs{'ImageLimit'} = "Creators";
sub StringSearch {
my ( $searchstring, $type ) = @_;
my $dbh = C4::Context->dbh;
@ -413,8 +419,8 @@ sub StringSearch {
if ( $type and $type eq 'all' ) {
$sth = $dbh->prepare( "
SELECT *
FROM systempreferences
WHERE variable LIKE ? OR explanation LIKE ?
FROM systempreferences
WHERE variable LIKE ? OR explanation LIKE ?
ORDER BY VARIABLE" );
$sth->execute( "%$searchstring%", "%$searchstring%" );
} else {

View file

@ -421,7 +421,7 @@ foreach my $tag (sort keys %{$tagslib}) {
}
}
my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" );
my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" );
my $attributes = qq($attributes_no_value value="$value" );
if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
my @authorised_values;
@ -503,7 +503,7 @@ foreach my $tag (sort keys %{$tagslib}) {
-override => 1,
-size => 1,
-multiple => 0,
-tabindex => 1,
# -tabindex => 1,
-id => "tag_".$tag."_subfield_".$subfield."_".$index_subfield,
-class => "input_marceditor",
);

View file

@ -56,6 +56,10 @@ if ($merge) {
my $record = TransformHtmlToMarc( \@params , $input );
my $tobiblio = $input->param('biblio1');
my $frombiblio = $input->param('biblio2');
# Rewriting the leader
$record->leader(GetMarcBiblio($tobiblio)->leader());
my $frameworkcode = &GetFrameworkCode($tobiblio);
my @notmoveditems;

View file

@ -94,7 +94,6 @@ for (@failedrenews) { $renew_failed{$_} = 1; }
my $findborrower = $query->param('findborrower');
$findborrower =~ s|,| |g;
#$findborrower =~ s|'| |g;
my $borrowernumber = $query->param('borrowernumber');
$branch = C4::Context->userenv->{'branch'};
@ -102,7 +101,7 @@ $printer = C4::Context->userenv->{'branchprinter'};
# If AutoLocation is not activated, we show the Circulation Parameters to chage settings of librarian
if (C4::Context->preference("AutoLocation") ne 1) { # FIXME: string comparison to number
if (C4::Context->preference("AutoLocation") != 1) {
$template->param(ManualLocation => 1);
}
@ -133,15 +132,6 @@ if ( $barcode ) {
}
}
#set up cookie.....
# my $branchcookie;
# my $printercookie;
# if ($query->param('setcookies')) {
# $branchcookie = $query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y');
# $printercookie = $query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
# }
#
my ($datedue,$invalidduedate,$globalduedate);
if(C4::Context->preference('globalDueDate') && (C4::Context->preference('globalDueDate') =~ C4::Dates->regexp('syspref'))){
@ -150,19 +140,19 @@ if(C4::Context->preference('globalDueDate') && (C4::Context->preference('globalD
my $duedatespec_allow = C4::Context->preference('SpecifyDueDate');
if($duedatespec_allow){
if ($duedatespec) {
if ($duedatespec =~ C4::Dates->regexp('syspref')) {
my $tempdate = C4::Dates->new($duedatespec);
if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) {
# i.e., it has to be later than today/now
$datedue = $tempdate;
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
}
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
}
if ($duedatespec =~ C4::Dates->regexp('syspref')) {
my $tempdate = C4::Dates->new($duedatespec);
if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) {
# i.e., it has to be later than today/now
$datedue = $tempdate;
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
}
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
}
} else {
# pass global due date to tmpl if specifyduedate is true
# and we have no barcode (loading circ page but not checking out)
@ -240,9 +230,12 @@ if ($borrowernumber) {
my ($warning_year, $warning_month, $warning_day) = split /-/, $borrower->{'dateexpiry'};
my ( $enrol_year, $enrol_month, $enrol_day) = split /-/, $borrower->{'dateenrolled'};
# Renew day is calculated by adding the enrolment period to today
my ( $renew_year, $renew_month, $renew_day) =
Add_Delta_YM( $enrol_year, $enrol_month, $enrol_day,
0 , $borrower->{'enrolmentperiod'}) if ($enrol_year*$enrol_month*$enrol_day>0);
my ( $renew_year, $renew_month, $renew_day);
if ($enrol_year*$enrol_month*$enrol_day>0) {
( $renew_year, $renew_month, $renew_day) =
Add_Delta_YM( $enrol_year, $enrol_month, $enrol_day,
0 , $borrower->{'enrolmentperiod'});
}
# if the expiry date is before today ie they have expired
if ( $warning_year*$warning_month*$warning_day==0
|| Date_to_Days($today_year, $today_month, $today_day )
@ -280,44 +273,44 @@ if ($borrowernumber) {
#
#
if ($barcode) {
# always check for blockers on issuing
my ( $error, $question ) =
# always check for blockers on issuing
my ( $error, $question ) =
CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
my $blocker = $invalidduedate ? 1 : 0;
my $blocker = $invalidduedate ? 1 : 0;
delete $question->{'DEBT'} if ($debt_confirmed);
foreach my $impossible ( keys %$error ) {
$template->param(
$impossible => $$error{$impossible},
IMPOSSIBLE => 1
);
$blocker = 1;
}
delete $question->{'DEBT'} if ($debt_confirmed);
foreach my $impossible ( keys %$error ) {
$template->param(
$impossible => $$error{$impossible},
IMPOSSIBLE => 1
);
$blocker = 1;
}
if( !$blocker ){
my $confirm_required = 0;
unless($issueconfirmed){
unless($issueconfirmed){
# Get the item title for more information
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
$template->param( itemhomebranch => $getmessageiteminfo->{'homebranch'} );
$template->param( itemhomebranch => $getmessageiteminfo->{'homebranch'} );
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed.
foreach my $needsconfirmation ( keys %$question ) {
$template->param(
$needsconfirmation => $$question{$needsconfirmation},
getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
NEEDSCONFIRMATION => 1
);
$confirm_required = 1;
}
}
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed.
foreach my $needsconfirmation ( keys %$question ) {
$template->param(
$needsconfirmation => $$question{$needsconfirmation},
getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
NEEDSCONFIRMATION => 1
);
$confirm_required = 1;
}
}
unless($confirm_required) {
AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
$inprocess = 1;
$inprocess = 1;
if($globalduedate && ! $stickyduedate && $duedatespec_allow ){
$duedatespec = $globalduedate->output();
$stickyduedate = 1;
}
}
}
}
# FIXME If the issue is confirmed, we launch another time GetMemberIssuesAndFines, now display the issue count after issue
@ -333,8 +326,6 @@ if ($borrowernumber) {
##################################################################################
# BUILD HTML
# show all reserves of this borrower, and the position of the reservation ....
my $borrowercategory;
my $category_type;
if ($borrowernumber) {
# new op dev
@ -402,7 +393,7 @@ if ($borrowernumber) {
push( @reservloop, \%getreserv );
# if we have a reserve waiting, initiate waitingreserveloop
if ($getreserv{waiting} eq 1) {
if ($getreserv{waiting} == 1) {
push (@WaitingReserveLoop, \%getWaitingReserveInfo)
}
@ -445,16 +436,16 @@ if ($borrower) {
);
$it->{"renew_error_${can_renew_error}"} = 1 if defined $can_renew_error;
my ( $restype, $reserves ) = CheckReserves( $it->{'itemnumber'} );
$it->{'can_renew'} = $can_renew;
$it->{'can_confirm'} = !$can_renew && !$restype;
$it->{'renew_error'} = $restype;
$it->{'checkoutdate'} = C4::Dates->new($it->{'issuedate'},'iso')->output('syspref');
$it->{'can_renew'} = $can_renew;
$it->{'can_confirm'} = !$can_renew && !$restype;
$it->{'renew_error'} = $restype;
$it->{'checkoutdate'} = C4::Dates->new($it->{'issuedate'},'iso')->output('syspref');
$totalprice += $it->{'replacementprice'};
$it->{'itemtype'} = $itemtypeinfo->{'description'};
$it->{'itemtype_image'} = $itemtypeinfo->{'imageurl'};
$totalprice += $it->{'replacementprice'};
$it->{'itemtype'} = $itemtypeinfo->{'description'};
$it->{'itemtype_image'} = $itemtypeinfo->{'imageurl'};
$it->{'dd'} = format_date($it->{'date_due'});
$it->{'issuedate'} = format_date($it->{'issuedate'});
$it->{'displaydate'} = format_date($it->{'issuedate'});
$it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ;
($it->{'author'} eq '') and $it->{'author'} = ' ';
$it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}};
@ -487,13 +478,12 @@ if ($borrower) {
my $dbh = C4::Context->dbh;
# how many of each is allowed?
my $issueqty_sth = $dbh->prepare( "
SELECT itemtypes.description AS description,issuingrules.itemtype,maxissueqty
FROM issuingrules
LEFT JOIN itemtypes ON (itemtypes.itemtype=issuingrules.itemtype)
WHERE categorycode=?
" );
$issueqty_sth->execute("*"); # This is a literal asterisk, not a wildcard.
my $issueqty_sth = $dbh->prepare(
'SELECT itemtypes.description AS description,issuingrules.itemtype,maxissueqty ' .
'FROM issuingrules LEFT JOIN itemtypes ON (itemtypes.itemtype=issuingrules.itemtype) ' .
'WHERE categorycode=?'
);
$issueqty_sth->execute(q{*}); # This is a literal asterisk, not a wildcard.
while ( my $data = $issueqty_sth->fetchrow_hashref() ) {
@ -504,12 +494,11 @@ while ( my $data = $issueqty_sth->fetchrow_hashref() ) {
$issued_itemtypes_count->{ $data->{'description'} } );
# can't have a negative number of remaining
if ( $data->{'left'} < 0 ) { $data->{'left'} = "0" }
$data->{'flag'} = 1 unless ( $data->{'maxissueqty'} > $data->{'count'} );
unless ( ( $data->{'maxissueqty'} < 1 )
|| ( $data->{'itemtype'} eq "*" )
|| ( $data->{'itemtype'} eq "CIRC" ) )
{
if ( $data->{'left'} < 0 ) { $data->{'left'} = '0' }
if ( $data->{maxissueqty} <= $data->{count} ) {
$data->{flag} = 1;
}
if ( $data->{maxissueqty} > 0 && $data->{itemtype} !~m/^(\*|CIRC)$/ ) {
push @issued_itemtypes_count_loop, $data;
}
}
@ -599,16 +588,7 @@ foreach my $flag ( sort keys %$flags ) {
);
my $items = $flags->{$flag}->{'itemlist'};
# useless ???
# {
# my @itemswaiting;
# foreach my $item (@$items) {
# my ($iteminformation) =
# getiteminformation( $item->{'itemnumber'}, 0 );
# push @itemswaiting, $iteminformation;
# }
# }
if ( ! $query->param('module') or $query->param('module') ne 'returns' ) {
if ( ! $query->param('module') || $query->param('module') ne 'returns' ) {
$template->param( nonreturns => 'true' );
}
}
@ -665,18 +645,18 @@ my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'
$template->param(
issued_itemtypes_count_loop => \@issued_itemtypes_count_loop,
lib_messages_loop => $lib_messages_loop,
bor_messages_loop => $bor_messages_loop,
all_messages_del => C4::Context->preference('AllowAllMessageDeletion'),
findborrower => $findborrower,
borrower => $borrower,
borrowernumber => $borrowernumber,
branch => $branch,
branchname => GetBranchName($borrower->{'branchcode'}),
printer => $printer,
printername => $printer,
firstname => $borrower->{'firstname'},
surname => $borrower->{'surname'},
lib_messages_loop => $lib_messages_loop,
bor_messages_loop => $bor_messages_loop,
all_messages_del => C4::Context->preference('AllowAllMessageDeletion'),
findborrower => $findborrower,
borrower => $borrower,
borrowernumber => $borrowernumber,
branch => $branch,
branchname => GetBranchName($borrower->{'branchcode'}),
printer => $printer,
printername => $printer,
firstname => $borrower->{'firstname'},
surname => $borrower->{'surname'},
dateexpiry => format_date($newexpiry),
expiry => format_date($borrower->{'dateexpiry'}),
categorycode => $borrower->{'categorycode'},
@ -687,8 +667,8 @@ $template->param(
emailpro => $borrower->{'emailpro'},
borrowernotes => $borrower->{'borrowernotes'},
city => $borrower->{'city'},
zipcode => $borrower->{'zipcode'},
country => $borrower->{'country'},
zipcode => $borrower->{'zipcode'},
country => $borrower->{'country'},
phone => $borrower->{'phone'} || $borrower->{'mobile'},
cardnumber => $borrower->{'cardnumber'},
amountold => $amountold,
@ -697,14 +677,14 @@ $template->param(
duedatespec => $duedatespec,
message => $message,
CGIselectborrower => $CGIselectborrower,
totalprice => sprintf("%.2f", $totalprice),
totaldue => sprintf("%.2f", $total),
totalprice => sprintf('%.2f', $totalprice),
totaldue => sprintf('%.2f', $total),
todayissues => \@todaysissues,
previssues => \@previousissues,
inprocess => $inprocess,
memberofinstution => $member_of_institution,
CGIorganisations => $CGIorganisations,
is_child => ($borrower->{'category_type'} eq 'C'),
is_child => ($borrower->{'category_type'} eq 'C'),
circview => 1,
);
@ -713,16 +693,11 @@ if ($stickyduedate) {
$session->param( 'stickyduedate', $duedatespec );
}
#if ($branchcookie) {
#$cookie=[$cookie, $branchcookie, $printercookie];
#}
my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
$template->param( picture => 1 ) if $picture;
# get authorised values with type of BOR_NOTES
my @canned_notes;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare('SELECT * FROM authorised_values WHERE category = "BOR_NOTES"');
$sth->execute();
while ( my $row = $sth->fetchrow_hashref() ) {

View file

@ -43,17 +43,18 @@ use C4::Items;
use C4::Members;
use C4::Branch; # GetBranches GetBranchName
use C4::Koha; # FIXME : is it still useful ?
use C4::RotatingCollections;
my $query = new CGI;
if (!C4::Context->userenv){
my $sessionID = $query->cookie("CGISESSID");
my $session = get_session($sessionID);
if ($session->param('branch') eq 'NO_LIBRARY_SET'){
# no branch set we can't return
print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
exit;
}
my $sessionID = $query->cookie("CGISESSID");
my $session = get_session($sessionID);
if ($session->param('branch') eq 'NO_LIBRARY_SET'){
# no branch set we can't return
print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
exit;
}
}
#getting the template
@ -72,7 +73,6 @@ my ( $template, $librarian, $cookie ) = get_template_and_user(
my $branches = GetBranches();
my $printers = GetPrinters();
#my $branch = C4::Context->userenv?C4::Context->userenv->{'branch'}:"";
my $printer = C4::Context->userenv ? C4::Context->userenv->{'branchprinter'} : "";
my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') ne 'off');
@ -87,10 +87,18 @@ my %riduedate;
my %riborrowernumber;
my @inputloop;
foreach ( $query->param ) {
(next) unless (/ri-(\d*)/);
my $counter;
if (/ri-(\d*)/) {
$counter = $1;
if ($counter > 20) {
next;
}
}
else {
next;
}
my %input;
my $counter = $1;
(next) if ( $counter > 20 );
my $barcode = $query->param("ri-$counter");
my $duedate = $query->param("dd-$counter");
my $borrowernumber = $query->param("bn-$counter");
@ -140,7 +148,7 @@ if ( $query->param('resbarcode') ) {
if ( $messages->{'transfert'} ) {
$template->param(
itemtitle => $iteminfo->{'title'},
itembiblionumber => $iteminfo->{'biblionumber'},
itembiblionumber => $iteminfo->{'biblionumber'},
iteminfo => $iteminfo->{'author'},
tobranchname => GetBranchName($messages->{'transfert'}),
name => $name,
@ -163,15 +171,15 @@ my $exemptfine = $query->param('exemptfine');
my $dropboxmode = $query->param('dropboxmode');
my $dotransfer = $query->param('dotransfer');
my $calendar = C4::Calendar->new( branchcode => $userenv_branch );
#dropbox: get last open day (today - 1)
#dropbox: get last open day (today - 1)
my $today = C4::Dates->new();
my $today_iso = $today->output('iso');
my $dropboxdate = $calendar->addDate($today, -1);
if ($dotransfer){
# An item has been returned to a branch other than the homebranch, and the librarian has chosen to initiate a transfer
my $transferitem = $query->param('transferitem');
my $tobranch = $query->param('tobranch');
ModItemTransfer($transferitem, $userenv_branch, $tobranch);
# An item has been returned to a branch other than the homebranch, and the librarian has chosen to initiate a transfer
my $transferitem = $query->param('transferitem');
my $tobranch = $query->param('tobranch');
ModItemTransfer($transferitem, $userenv_branch, $tobranch);
}
# actually return book and prepare item table.....
@ -263,23 +271,23 @@ if ( $messages->{'WasTransfered'} ) {
}
if ( $messages->{'NeedsTransfer'} ){
$template->param(
found => 1,
needstransfer => 1,
itemnumber => $itemnumber,
);
$template->param(
found => 1,
needstransfer => 1,
itemnumber => $itemnumber,
);
}
if ( $messages->{'Wrongbranch'} ){
$template->param(
wrongbranch => 1,
);
$template->param(
wrongbranch => 1,
);
}
# case of wrong transfert, if the document wasn't transfered to the right library (according to branchtransfer (tobranch) BDD)
if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
$template->param(
$template->param(
WrongTransfer => 1,
TransferWaitingAt => $messages->{'WrongTransfer'},
WrongTransferItem => $messages->{'WrongTransferItem'},
@ -347,7 +355,7 @@ if ( $messages->{'ResFound'}) {
debarred => $borr->{'debarred'},
gonenoaddress => $borr->{'gonenoaddress'},
barcode => $barcode,
destbranch => $reserve->{'branchcode'},
destbranch => $reserve->{'branchcode'},
borrowernumber => $reserve->{'borrowernumber'},
itemnumber => $reserve->{'itemnumber'},
reservenotes => $reserve->{'reservenotes'},
@ -401,7 +409,7 @@ foreach my $code ( keys %$messages ) {
}
elsif ( $code eq 'Wrongbranch' ) {
}
else {
die "Unknown error code $code"; # note we need all the (empty) elsif's above, or we die.
# This forces the issue of staying in sync w/ Circulation.pm
@ -487,32 +495,30 @@ my @riloop;
foreach ( sort { $a <=> $b } keys %returneditems ) {
my %ri;
if ( $count++ < $returned_counter ) {
my $barcode = $returneditems{$_};
my $bar_code = $returneditems{$_};
my $duedate = $riduedate{$_};
my $overduetext;
my $borrowerinfo;
if ($duedate) {
my @tempdate = split( /-/, $duedate );
$ri{year} = $tempdate[0];
$ri{month} = $tempdate[1];
$ri{day} = $tempdate[2];
$ri{duedate} = format_date($duedate);
my ($borrower) = GetMemberDetails( $riborrowernumber{$_}, 0 );
my ($b) = GetMemberDetails( $riborrowernumber{$_}, 0 );
$ri{return_overdue} = 1 if ($duedate lt $today->output('iso'));
$ri{borrowernumber} = $borrower->{'borrowernumber'};
$ri{borcnum} = $borrower->{'cardnumber'};
$ri{borfirstname} = $borrower->{'firstname'};
$ri{borsurname} = $borrower->{'surname'};
$ri{bortitle} = $borrower->{'title'};
$ri{bornote} = $borrower->{'borrowernotes'};
$ri{borcategorycode}= $borrower->{'categorycode'};
$ri{borrowernumber} = $b->{'borrowernumber'};
$ri{borcnum} = $b->{'cardnumber'};
$ri{borfirstname} = $b->{'firstname'};
$ri{borsurname} = $b->{'surname'};
$ri{bortitle} = $b->{'title'};
$ri{bornote} = $b->{'borrowernotes'};
$ri{borcategorycode}= $b->{'categorycode'};
}
else {
$ri{borrowernumber} = $riborrowernumber{$_};
}
# my %ri;
my $biblio = GetBiblioFromItemNumber(GetItemnumberFromBarcode($barcode));
my $biblio = GetBiblioFromItemNumber(GetItemnumberFromBarcode($bar_code));
# fix up item type for display
$biblio->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $biblio->{'itype'} : $biblio->{'itemtype'};
$ri{itembiblionumber} = $biblio->{'biblionumber'};
@ -522,12 +528,12 @@ foreach ( sort { $a <=> $b } keys %returneditems ) {
$ri{itemnote} = $biblio->{'itemnotes'};
$ri{ccode} = $biblio->{'ccode'};
$ri{itemnumber} = $biblio->{'itemnumber'};
$ri{barcode} = $barcode;
$ri{barcode} = $bar_code;
}
else {
last;
}
push( @riloop, \%ri );
push @riloop, \%ri;
}
$template->param(
@ -539,7 +545,7 @@ $template->param(
errmsgloop => \@errmsgloop,
exemptfine => $exemptfine,
dropboxmode => $dropboxmode,
dropboxdate => $dropboxdate->output(),
dropboxdate => $dropboxdate->output(),
overduecharges => $overduecharges,
);

View file

@ -58,6 +58,7 @@ my $default = C4::Context->userenv->{'branch'};
# get the all the branches for reference
my $branches = GetBranches();
my @branchesloop;
my $latetransfers;
foreach my $br ( keys %$branches ) {
my @transferloop;
my %branchloop;
@ -78,15 +79,18 @@ foreach my $br ( keys %$branches ) {
C4::Context->preference('TransfersMaxDaysWarning'));
my $calcDate = Date_to_Days( $sent_year, $sent_month, $sent_day );
my $today = Date_to_Days(&Today);
my $diff = $today - $calcDate;
if ($today > $calcDate) {
$latetransfers = 1;
$getransf{'messcompa'} = 1;
$getransf{'diff'} = $diff;
}
my $gettitle = GetBiblioFromItemNumber( $num->{'itemnumber'} );
my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );
my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $gettitle->{'itype'} : $gettitle->{'itemtype'} );
$getransf{'datetransfer'} = format_date( $num->{'datesent'} );
$getransf{'itemtype'} = $itemtypeinfo->{'description'};
$getransf{'itemtype'} = $itemtypeinfo ->{'description'};
foreach (qw(title biblionumber itemnumber barcode homebranch holdingbranch itemcallnumber)) {
$getransf{$_} = $gettitle->{$_};
}
@ -114,6 +118,8 @@ $template->param(
branchesloop => \@branchesloop,
show_date => format_date(C4::Dates->today('iso')),
'dateformat_' . (C4::Context->preference("dateformat") || '') => 1,
TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'),
latetransfers => $latetransfers ? 1 : 0,
);
output_html_with_http_headers $input, $cookie, $template->output;

View file

@ -431,14 +431,28 @@ May 28 2009 Zeno Tajoli becomes the 93rd committer to have a patch accepted deve
May 29 2009 Matthias Meusburger becomes the 94th committer to have patch accepted developer
May 29 2009 First feature sponsored by Plano Independent School District committed sponsor
June 3 2009 Savitra Sirohi becomes the 95th committer to have a patch accepted developer,India
June 3 2009 IRC general Meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09jun3
June 4 2009 Koha 3.0.2 released releases
June 8 2009 Koha passed 10,000 commits in the master branch (since December 2000) statistics
June 26 2009 Koha 3.0.3 released releases
July 1 2009 IRC general Meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09jul01
July 27 2009 Feature sponsored by East Brunswick Public Library, East Brunswick, NJ USA and Middletown Township Public Library, Middletown, NJ USA committed sponsor
July 30 2009 First message to koha-commits mailing list
August 1 2009 Sébastien Hinderer becomes the 96th committer to have a patched accepted developer,france
August 5 2009 IRC general meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09aug05
August 30 2009 John A. Graziano Memorial Library contributes a icon for Bridge Icon set
September 2 2009 IRC general meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09sep02
September 5 2009 UNIMARC XSLT cleanup and new features Sponsored by BULAC, www.bulac.fr
September 5 2009 Labels rewrite committed, sponsored by Foundations Bible College & Seminary, Dunn, NC USA
September 6 2009 Katrin Fischer becomes the 97th committer to have a patch accepted developer
September 6 2009 Wolfgang Heymans becomes the 98th committer to have a patch accepted developer
September 15 2009 Foundation forming meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09sep15
October 7 2009 IRC general meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09oct07
October 22 2009 Koha 3.0.4 released releases
October 29 2009 Foundation Forming meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09oct29
November 4 2009 General meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09nov04
December 2 2009 KUDOS meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:kudosmeetingnotes09dec02
December 2 2009 General meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09dec02
December 3 2009 Foundation meeting http://wiki.koha.org/doku.php?id=en:events:meetings:irc_meetings:meetingnotes09dec03

View file

@ -6,6 +6,11 @@
<listen id="biblioserver" >unix:__ZEBRA_RUN_DIR__/bibliosocket</listen>
<listen id="authorityserver" >unix:__ZEBRA_RUN_DIR__/authoritysocket</listen>
<!-- uncomment these lines and comment out the above if running on MSWin32 -->
<!--
<listen id="biblioserver" >tcp:localhost:9998/bibliosocket</listen>
<listen id="authorityserver" >tcp:localhost:9999/authoritysocket</listen>
-->
<!-- public server runs on tcp -->
<!-- <listen id="publicserver" >tcp:@:9999</listen> -->

View file

@ -10,8 +10,8 @@
# ServerAlias opac.mydomain.com
ScriptAlias /cgi-bin/koha/ "__OPAC_CGI_DIR__/opac/"
ScriptAlias /index.html "__OPAC_CGI_DIR__/opac/opac-main.pl"
ScriptAlias /opac-search.pl "__OPAC_CGI_DIR__/opac/search"
ScriptAlias /search "__OPAC_CGI_DIR__/opac/search"
ScriptAlias /opac-search.pl "__OPAC_CGI_DIR__/opac/opac-search.pl"
ScriptAlias /search "__OPAC_CGI_DIR__/opac/opac-search.pl"
ErrorLog __LOG_DIR__/koha-opac-error_log
# TransferLog __LOG_DIR__/koha-opac-access_log
SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"

View file

@ -0,0 +1,118 @@
apt-get install \
apache2 \
apache2-mpm-worker \
at \
bzip2 \
daemon \
gcc \
gettext \
idzebra-2.0-common \
idzebra-2.0-doc \
idzebra-2.0 \
idzebra-2.0-utils \
libalgorithm-checkdigits-perl \
libbiblio-endnotestyle-perl \
libcgi-session-perl \
libcgi-session-serialize-yaml-perl \
libclass-accessor-perl \
libclass-factory-util-perl \
libdata-ical-perl \
libdate-calc-perl \
libdate-calc-perl \
libdate-ical-perl \
libdate-ical-perl \
libdate-manip-perl \
libdatetime-format-mail-perl \
libdatetime-format-strptime-perl \
libdatetime-format-w3cdtf-perl \
libdatetime-locale-perl \
libdatetime-perl \
libdatetime-timezone-perl \
libdbd-mysql-perl \
libdbd-mysql-perl \
libdbd-sqlite2-perl \
libdbi-perl \
libdigest-sha-perl \
libemail-date-perl \
libemail-date-perl \
libgcrypt11-dev \
libgcrypt11 \
libgd2-xpm-dev \
libgd-barcode-perl \
libgd-barcode-perl \
libgd-gd2-perl \
libhtml-scrubber-perl \
libhtml-scrubber-perl \
libhtml-template-pro-perl \
libidzebra-2.0-dev \
libidzebra-2.0 \
libidzebra-2.0-mod-alvis \
libidzebra-2.0-mod-grs-marc \
libidzebra-2.0-mod-grs-regx \
libidzebra-2.0-mod-grs-xml \
libidzebra-2.0-mod-text \
libidzebra-2.0-modules \
libimage-magick-perl \
libjson-perl \
libjson-xs-perl \
liblingua-ispell-perl \
liblingua-stem-perl \
liblingua-stem-perl \
liblist-moreutils-perl \
liblocale-gettext-perl \
liblocale-po-perl \
libmail-sendmail-perl \
libmail-sendmail-perl \
libmail-sendmail-perl \
libmarc-charset-perl \
libmarc-crosswalk-dublincore-perl \
libmarc-record-perl \
libmarc-xml-perl \
libmime-lite-perl \
libmime-lite-perl \
libmime-lite-perl \
libmysqlclient15-dev \
libnet-ldap-perl \
libnet-ldap-perl \
libnet-z3950-zoom-perl \
libnumber-format-perl \
libpdf-api2-perl \
libpdf-api2-perl \
libpdf-reuse-barcode-perl \
libpdf-reuse-perl \
libpoe-perl \
libpoe-perl \
libschedule-at-perl \
libtext-charwidth-perl \
libtext-csv-perl \
libtext-iconv-perl \
libtext-wrapi18n-perl \
libtimedate-perl \
libtime-duration-perl \
libtime-format-perl \
libunix-syslog-perl \
libxml2-dev \
libxml2 \
libxml2-utils \
libxml-dom-perl \
libxml-dumper-perl \
libxml-libxml-perl \
libxml-libxslt-perl \
libxml-namespacesupport-perl \
libxml-parser-perl \
libxml-perl \
libxml-regexp-perl \
libxml-rss-perl \
libxml-sax-writer-perl \
libxml-simple-perl \
libxml-xslt-perl \
libxslt1.1 \
libxslt1-dev \
libyaml-perl \
libyaml-syck-perl \
libyaz-dev \
libyaz3 \
make \
mysql-server \
yaz-doc \
yaz

View file

@ -1,116 +0,0 @@
apache2 install
apache2-mpm-worker install
at install
daemon install
gcc install
gettext install
idzebra-2.0-common install
idzebra-2.0-doc install
idzebra-2.0 install
idzebra-2.0-utils install
libbiblio-endnotestyle-perl install
libcgi-session-perl install
libcgi-session-serialize-yaml-perl install
libclass-accessor-perl install
libclass-factory-util-perl install
libdata-ical-perl install
libdate-calc-perl install
libdate-calc-perl install
libdate-ical-perl install
libdate-ical-perl install
libdate-manip-perl install
libdatetime-format-mail-perl install
libdatetime-format-strptime-perl install
libdatetime-format-w3cdtf-perl install
libdatetime-locale-perl install
libdatetime-perl install
libdatetime-timezone-perl install
libdbd-mysql-perl install
libdbd-mysql-perl install
libdbd-sqlite2-perl install
libdbi-perl install
libdigest-sha-perl install
libemail-date-perl install
libemail-date-perl install
libgcrypt11-dev install
libgcrypt11 install
libgd2-noxpm-dev install
libgd-barcode-perl install
libgd-barcode-perl install
libgd-gd2-perl install
libhtml-scrubber-perl install
libhtml-scrubber-perl install
libhtml-template-pro-perl install
libidzebra-2.0-dev install
libidzebra-2.0 install
libidzebra-2.0-mod-alvis install
libidzebra-2.0-mod-grs-marc install
libidzebra-2.0-mod-grs-regx install
libidzebra-2.0-mod-grs-xml install
libidzebra-2.0-mod-text install
libidzebra-2.0-modules install
libimage-magick-perl install
libjson-perl install
libjson-xs-perl install
liblingua-ispell-perl install
liblingua-stem-perl install
liblingua-stem-perl install
liblist-moreutils-perl install
liblocale-gettext-perl install
liblocale-po-perl install
libmail-sendmail-perl install
libmail-sendmail-perl install
libmail-sendmail-perl install
libmarc-charset-perl install
libmarc-crosswalk-dublincore-perl install
libmarc-record-perl install
libmarc-xml-perl install
libmime-lite-perl install
libmime-lite-perl install
libmime-lite-perl install
libmysqlclient15-dev install
libnet-ldap-perl install
libnet-ldap-perl install
libnet-z3950-zoom-perl install
libparam-util-perl install
libpdf-api2-perl install
libpdf-api2-perl install
libpdf-reuse-barcode-perl install
libpdf-reuse-perl install
libpoe-perl install
libpoe-perl install
libschedule-at-perl install
libtext-charwidth-perl install
libtext-csv-perl install
libtext-iconv-perl install
libtext-wrapi18n-perl install
libtimedate-perl install
libtime-duration-perl install
libtime-format-perl install
libunix-syslog-perl install
libxml2-dev install
libxml2 install
libxml2-utils install
libxml-dom-perl install
libxml-dumper-perl install
libxml-libxml-perl install
libxml-libxslt-perl install
libxml-namespacesupport-perl install
libxml-parser-perl install
libxml-perl install
libxml-regexp-perl install
libxml-rss-perl install
libxml-sax-writer-perl install
libxml-simple-perl install
libxml-xslt-perl install
libxslt1.1 install
libxslt1-dev install
libyaml-perl install
libyaml-syck-perl install
libyaz-dev install
libyaz install
make install
mysql-server install
perl-doc install
yaz-doc install
yaz install

View file

@ -23,8 +23,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship','father|mother','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog',1,'If ON, log edit/create/delete actions on patron data',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casAuthentication', '0', 'Enable or disable CAS authentication', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casLogout', '0', 'Does a logout from Koha should also log the user out of CAS?', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casServerUrl', 'https://localhost:8443/cas', 'URL of the cas server', '', 'Free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casLogout', '0', 'Does a logout from Koha should also log the user out of CAS?', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casServerUrl', 'https://localhost:8443/cas', 'URL of the cas server', '', 'Free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CataloguingLog',1,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('checkdigit','none','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','none|katipo','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('delimiter',';','Define the default separator character for exporting reports',';|tabulation|,|/|\\|#|\|','Choice');
@ -109,7 +109,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReservesNeedReturns',1,'If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DebugLevel',2,'Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','0|1|2','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('NoZebra',1,'If ON, Zebra indexing is turned off, simpler setup, but slower searches. WARNING: using NoZebra on even modest sized collections is very slow.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SessionStorage','mysql','Use database or a temporary file for storing session data','mysql|Pg|tmp','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SessionStorage','mysql','Use database or a temporary file for storing session data','mysql|Pg|tmp','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CircAutocompl',1,'If ON, autocompletion is enabled for the Circulation input',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingSerials',1,'If ON, serials routing is enabled',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SearchMyLibraryFirst',0,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in',NULL,'YesNo');
@ -246,8 +246,8 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES (
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'StaffSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the Staff client', 'Integer');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'OPACSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the OPAC', 'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACShowCheckoutName','0','Displays in the OPAC the name of patron who has checked out the material. WARNING: Most sites should leave this off. It is intended for corporate or special sites which need to track who has the item.','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesID','','See:http://librarything.com/forlibraries/','','free');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesEnabled','0','Enable or Disable Library Thing for Libraries Features','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesID','','See:http://librarything.com/forlibraries/','','free');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesEnabled','0','Enable or Disable Library Thing for Libraries Features','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesTabbedView','0','Put LibraryThingForLibraries Content in Tabs.','','YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'AllowNotForLoanOverride', '0', '', 'If ON, Koha will allow the librarian to loan a not for loan item.', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','date_due|now','Choice');
@ -259,6 +259,7 @@ INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('S
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','See: http://aws.amazon.com. Note that this is required after 2009/08/15 in order to retrieve any enhanced content other than book covers from Amazon.','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','Fine limit above which user cannot renew books via OPAC','','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OverdueNoticeBcc','','Email address to bcc outgoing overdue notices sent by email','','free');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'NewItemsDefaultLocation', '', '', 'If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )', '');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'InProcessingToShelvingCart', '0', '', 'If set, when any item with a location code of PROC is ''checked in'', it''s location code will be changed to CART.', 'YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'ReturnToShelvingCart', '0', '', 'If set, when any item is ''checked in'', it''s location code will be changed to CART.', 'YesNo');
@ -270,7 +271,10 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowAllMessageDeletion','0','Allow any Library to delete any message','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowPatronImageInWebBasedSelfCheck', '0', 'If ON, displays patron image when a patron uses web-based self-checkout', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableOpacSearchHistory', '1', 'Enable or disable opac search history', 'YesNo','')
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableOpacSearchHistory', '1', 'Enable or disable opac search history', 'YesNo','');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingListAddReserves','1','If ON the patrons on routing lists are automatically added to holds on the issue.','','YesNo');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'OpacAddMastheadLibraryPulldown', '0', '', 'Adds a pulldown menu to select the library to search on the opac masthead.', 'YesNo' );
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACPatronDetails','1','If OFF the patron details tab in the OPAC is disabled.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','If OFF the patron fines tab in the OPAC is disabled.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingListAddReserves','1','If ON the patrons on routing lists are automatically added to holds on the issue.','','YesNo');
INSERT INTO systempreferences VALUES ('ImageLimit',5,'','Limit images stored in the database by the Patron Card image manager to this number.','Integer');

View file

@ -1,7 +1,7 @@
INSERT INTO permissions (module_bit, code, description) VALUES
( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions'),
( 1, 'override_renewals', 'Override blocked renewals'),
( 9, 'edit_catalogue', 'Edit catalogue'),
( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
( 9, 'fast_cataloging', 'Fast cataloging'),
(11, 'vendors_manage', 'Manage vendors'),
(11, 'contracts_manage', 'Manage contracts'),
@ -31,6 +31,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(13, 'batchmod', 'Perform batch modification of items'),
(13, 'batchdel', 'Perform batch deletion of items'),
(13, 'manage_csv_profiles', 'Manage CSV export profiles'),
(13, 'moderate_tags', 'Moderate patron tags'),
(13, 'rotating_collections', 'Manage rotating collections'),
(16, 'execute_reports', 'Execute SQL reports'),
(16, 'create_reports', 'Create SQL Reports')
;

View file

@ -24,6 +24,8 @@ INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC',
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','GEN','General Stacks');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','AV','Audio Visual');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','REF','Reference');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','CART','Book Cart');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','PROC','Processing Center');
-- collection codes for an item
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('CCODE','FIC','Fiction');
@ -43,3 +45,9 @@ INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_L
-- restricted status of an item, linked to items.restricted
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','0','');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','1','Restricted Access');
-- manual invoice types
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('MANUAL_INV','Copier Fees','.25');
--custom borrower notes
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('BOR_NOTES','ADDR','Address Notes');

View file

@ -1 +0,0 @@
Sample Budgets and Funds

View file

@ -0,0 +1,34 @@
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
LOCK TABLES `creator_layouts` WRITE;
/*!40000 ALTER TABLE `creator_layouts` DISABLE KEYS */;
INSERT INTO `creator_layouts` VALUES (17,'CODE39',1,'BIBBAR','Label Test',0,'TR',3,'POINT',0,'L','title, author, isbn, issn, itemtype, barcode, callnumber','<opt></opt>','Labels'),(18,'CODE39',1,'BAR','DEFAULT',0,'TR',3,'POINT',0,'L','title, author, isbn, issn, itemtype, barcode, callnumber','<opt></opt>','Labels'),(19,'CODE39',1,'BAR','DEFAULT',0,'TR',3,'POINT',0,'L','title, author, isbn, issn, itemtype, barcode, callnumber','<opt></opt>','Labels'),(20,'CODE39',1,'BAR','Test Layout',0,'TR',10,'POINT',0,'L','barcode','<opt page_side="F" units="POINT">
<images name="image_1" Dx="72" Ox="0" Oy="0" Sx="0" Sy="0" Tx="4.5" Ty="63">
<data_source image_name="none" image_source="patronimages" />
</images>
<text>&lt;firstname&gt; &lt;surname&gt;</text>
<text enable="1" font="TR" font_size="10" llx="100" lly="100" text_alignment="L" />
<text>Branch: &lt;branchcode&gt;</text>
<text enable="1" font="TR" font_size="10" llx="100" lly="75" text_alignment="L" />
<text>Expires: August 31, 2010</text>
<text font="TR" font_size="6" llx="115" lly="65" text_alignment="L" />
</opt>
','Patroncards');
/*!40000 ALTER TABLE `creator_layouts` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `creator_templates` WRITE;
/*!40000 ALTER TABLE `creator_templates` DISABLE KEYS */;
INSERT INTO `creator_templates` VALUES (1,1,'Avery 5160 | 1 x 2-5/8','3 columns, 10 rows of labels',8.5,11,2.63,1,0.139,0,0.35,0.23,3,10,0.13,0,'INCH','Labels'),(7,13,'Demco WS14942260','1\" X 1.5\" Spine Label | Setup for up to four lines of text',8.5,11,1.5,1,0.236,0,0.5,0.25,5,10,0.0625,0,'INCH','Labels'),(12,14,'Demco WS14942260','1\" X 1.5\" Spine Label | Setup for five lines of text',8.5,11,1.5,1,0.139,0,0.53,0.3,5,10,0.0625,0,'INCH','Labels'),(22,0,'DEFAULT TEMPLATE 01','Default description',0,5,0,0,0,0,0,0,0,0,0,0,'POINT','Labels'),(23,16,'HB-PC0001','A template for home brewed patron card forms',8.5,11,3.1875,1.9375,0,0,0.6875,0.875,2,4,0.4375,0.1875,'INCH','Patroncards');
/*!40000 ALTER TABLE `creator_templates` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `printers_profile` WRITE;
/*!40000 ALTER TABLE `printers_profile` DISABLE KEYS */;
INSERT INTO `printers_profile` VALUES (1,'Library Laser',1,'Bypass',-2,9,3,0,'POINT','Labels'),(11,'Library Laser',1,'Tray 1',0,0,0,0,'POINT','Labels'),(16,'Test Printer 01',23,'Test Bin',0,0,0,0,'POINT','Patroncards');
/*!40000 ALTER TABLE `printers_profile` ENABLE KEYS */;
UNLOCK TABLES;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;

View file

@ -0,0 +1 @@
Sample Label and Patron Card Data

View file

@ -1,8 +1,8 @@
INSERT INTO `itemtypes` VALUES ('BK', 'Books',5,0,0,'bridge/book.gif','');
INSERT INTO `itemtypes` VALUES ('MX', 'Mixed Materials',5,0,0,'bridge/kit.gif','');
INSERT INTO `itemtypes` VALUES ('CF', 'Computer Files',5,0,0,'bridge/computer_file.gif','');
INSERT INTO `itemtypes` VALUES ('MP', 'Maps',5,0,0,'bridge/map.gif','');
INSERT INTO `itemtypes` VALUES ('VM', 'Visual Materials',5,0,1,'bridge/dvd.gif','');
INSERT INTO `itemtypes` VALUES ('MU', 'Music',5,0,0,'bridge/sound.gif','');
INSERT INTO `itemtypes` VALUES ('CR', 'Continuing Resources',5,0,0,'bridge/periodical.gif','');
INSERT INTO `itemtypes` VALUES ('REF', 'Reference',0,0,1,'','');
INSERT INTO `itemtypes` VALUES ('BK', 'Books',5,0,0,'bridge/book.gif');
INSERT INTO `itemtypes` VALUES ('MX', 'Mixed Materials',5,0,0,'bridge/kit.gif');
INSERT INTO `itemtypes` VALUES ('CF', 'Computer Files',5,0,0,'bridge/computer_file.gif');
INSERT INTO `itemtypes` VALUES ('MP', 'Maps',5,0,0,'bridge/map.gif');
INSERT INTO `itemtypes` VALUES ('VM', 'Visual Materials',5,0,1,'bridge/dvd.gif');
INSERT INTO `itemtypes` VALUES ('MU', 'Music',5,0,0,'bridge/sound.gif');
INSERT INTO `itemtypes` VALUES ('CR', 'Continuing Resources',5,0,0,'bridge/periodical.gif');
INSERT INTO `itemtypes` VALUES ('REF', 'Reference',0,0,1,'');

View file

@ -250,8 +250,8 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES (
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'StaffSerialIssueDisplayCount', '3', '', 'Nombre de bulletins à afficher pour chaque abonnement dans l''interface pro', 'Integer');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'OPACSerialIssueDisplayCount', '3', '', 'Nombre de bulletins à afficher pour chaque abonnement à l''OPAC', 'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACShowCheckoutName','0','Affiche à l''OPAC le nom du lecteur qui a emprunté le document. Attention : la plupart des bibliothèques laisseront ce paramètre à Off. Il sera utile à des bibliothèques d''entreprise','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesID','','Voir : http://librarything.com/forlibraries/','','free');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesEnabled','0','Active les service Library Thing','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesID','','Voir : http://librarything.com/forlibraries/','','free');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesEnabled','0','Active les service Library Thing','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesTabbedView','0','Met le contenu de LibraryThingForLibraries dans les onglets.','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('viewISBD','1','Autoriser l''affichage de la vue ISBD des notices bibliographiques','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('viewLabeledMARC','0','Autoriser l''affichage MARC labellis des notices bibliographiques','','YesNo');
@ -261,6 +261,7 @@ INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('S
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'Activé, un dialogue pour impression sur l''imprimante d''étiquettes en rouleau sera automatiquement affiché', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','Voir: http://aws.amazon.com. Notez que cela est nécessaire après le 15 Aout 2009 pour pouvoir utiliser les webservices Amazon autre que les couvertures de livre.','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','amende limite ci-dessus le lecteur ne peut pas renouveler par l''OPAC','','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OverdueNoticeBcc','','Adresse à laquelle envoyer une copie invisible des courriels de réclamation des retards','','free');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'NewItemsDefaultLocation', '', '', 'Ce qui permit tous les nouveaux exemplaires reçus à l''emplacement de la valeur donnée', '');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'InProcessingToShelvingCart', '0', '', 'Si défini, quand un exemplaire avec localisation de PROC est renvoyé son code sera modifié pour CART.', 'YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'ReturnToShelvingCart', '0', '', 'Si défini, quand un exemplaire est renvoyé son code sera modifié pour CART.', 'YesNo');
@ -273,3 +274,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacSerialDefaultTab', 'serialcollection', 'Ce paramètre définit l''onglet par défaut pour l''affichage des périodiques dans l''OPAC.', 'holdings|serialcollection|subscriptions', 'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingListAddReserves','1','Si activé, des reservations sont automatiquement créées pour chaque lecteur de la liste de circulation d''un numéro de périodique','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Autorise ou non le bibliothécaire à spécifier la date de retour dans le module circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'OpacAddMastheadLibraryPulldown', '0', '', 'Adds a pulldown menu to select the library to search on the opac masthead.', 'YesNo' );
INSERT INTO systempreferences VALUES ('ImageLimit',5,'','Limiter le nombre d''images stockées en base pour la photo Lecteur à cette taille.','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACPatronDetails','1','Si désactivé, l''affichage détaillé des données adhérents est désactivé à l''OPAC.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','Si désactivé, l''onglet Amende est désactivé à l''OPAC.','','YesNo');

View file

@ -28,7 +28,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(11, 'group_manage', 'Gérer les commandes et les bons de commande'),
(11, 'order_receive', 'Gérer les réceptions'),
(11, 'budget_add_del', 'Ajouter et supprimer les budgets (mais pas modifier)'),
(13, 'manage_csv_profiles', 'Manage CSV export profiles'),
(13, 'manage_csv_profiles', 'Gérer les profils d''export CSV'),
(13, 'rotating_collections', 'Gérer les collections tournantes'),
(13, 'batch_mod', 'Modification Par lot des exemplaires'),
(13, 'batch_del', 'Suppression par lot des exemplaires')
;

View file

@ -100,6 +100,7 @@ CREATE TABLE `authorised_values` (
`category` varchar(10) NOT NULL default '',
`authorised_value` varchar(80) NOT NULL default '',
`lib` varchar(80) default NULL,
`lib_opac` VARCHAR(80) default NULL,
`imageurl` varchar(200) default NULL,
PRIMARY KEY (`id`),
KEY `name` (`category`),
@ -333,7 +334,7 @@ CREATE TABLE `branches` (
`branchaddress1` mediumtext,
`branchaddress2` mediumtext,
`branchaddress3` mediumtext,
`branchzip` varchar(25) default NULL,
`branchzip` varchar(25) default NULL,
`branchcity` mediumtext,
`branchcountry` text,
`branchphone` mediumtext,
@ -771,13 +772,13 @@ CREATE TABLE hold_fill_targets (
`item_level_request` tinyint(4) NOT NULL default 0,
PRIMARY KEY `itemnumber` (`itemnumber`),
KEY `bib_branch` (`biblionumber`, `source_branchcode`),
CONSTRAINT `hold_fill_targets_ibfk_1` FOREIGN KEY (`borrowernumber`)
CONSTRAINT `hold_fill_targets_ibfk_1` FOREIGN KEY (`borrowernumber`)
REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `hold_fill_targets_ibfk_2` FOREIGN KEY (`biblionumber`)
CONSTRAINT `hold_fill_targets_ibfk_2` FOREIGN KEY (`biblionumber`)
REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `hold_fill_targets_ibfk_3` FOREIGN KEY (`itemnumber`)
CONSTRAINT `hold_fill_targets_ibfk_3` FOREIGN KEY (`itemnumber`)
REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `hold_fill_targets_ibfk_4` FOREIGN KEY (`source_branchcode`)
CONSTRAINT `hold_fill_targets_ibfk_4` FOREIGN KEY (`source_branchcode`)
REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -841,7 +842,7 @@ CREATE TABLE `import_record_matches` (
`import_record_id` int(11) NOT NULL,
`candidate_match_id` int(11) NOT NULL,
`score` int(11) NOT NULL default 0,
CONSTRAINT `import_record_matches_ibfk_1` FOREIGN KEY (`import_record_id`)
CONSTRAINT `import_record_matches_ibfk_1` FOREIGN KEY (`import_record_id`)
REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `record_score` (`import_record_id`, `score`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -861,7 +862,7 @@ CREATE TABLE `import_biblios` (
`isbn` varchar(30) default NULL,
`issn` varchar(9) default NULL,
`has_items` tinyint(1) NOT NULL default 0,
CONSTRAINT `import_biblios_ibfk_1` FOREIGN KEY (`import_record_id`)
CONSTRAINT `import_biblios_ibfk_1` FOREIGN KEY (`import_record_id`)
REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `matched_biblionumber` (`matched_biblionumber`),
KEY `title` (`title`),
@ -882,7 +883,7 @@ CREATE TABLE `import_items` (
`marcxml` longtext NOT NULL,
`import_error` mediumtext,
PRIMARY KEY (`import_items_id`),
CONSTRAINT `import_items_ibfk_1` FOREIGN KEY (`import_record_id`)
CONSTRAINT `import_items_ibfk_1` FOREIGN KEY (`import_record_id`)
REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `itemnumber` (`itemnumber`),
KEY `branchcode` (`branchcode`)
@ -1013,66 +1014,96 @@ CREATE TABLE `itemtypes` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `labels_batches`
-- Table structure for table `creator_batches`
--
DROP TABLE IF EXISTS `labels_batches`;
CREATE TABLE `labels_batches` (
`label_id` int(11) NOT NULL auto_increment,
`batch_id` int(10) NOT NULL default '1',
`item_number` int(11) NOT NULL default '0',
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`branch_code` varchar(10) NOT NULL default 'NB',
PRIMARY KEY USING BTREE (`label_id`),
KEY `branch_fk` (`branch_code`),
KEY `item_fk` (`item_number`),
CONSTRAINT `item_fk_constraint` FOREIGN KEY (`item_number`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE,
CONSTRAINT `branch_fk_constraint` FOREIGN KEY (`branch_code`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE
DROP TABLE IF EXISTS `creator_batches`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `creator_batches` (
`label_id` int(11) NOT NULL AUTO_INCREMENT,
`batch_id` int(10) NOT NULL DEFAULT '1',
`item_number` int(11) DEFAULT NULL,
`borrower_number` int(11) DEFAULT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`branch_code` varchar(10) NOT NULL DEFAULT 'NB',
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`label_id`) USING BTREE,
KEY `branch_fk_constraint` (`branch_code`),
KEY `item_fk_constraint` (`item_number`),
KEY `borrower_fk_constraint` (`borrower_number`),
CONSTRAINT `creator_batches_ibfk_1` FOREIGN KEY (`borrower_number`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `creator_batches_ibfk_2` FOREIGN KEY (`branch_code`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE,
CONSTRAINT `creator_batches_ibfk_3` FOREIGN KEY (`item_number`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `labels_layouts`
-- Table structure for table `creator_images`
--
DROP TABLE IF EXISTS `labels_layouts`;
CREATE TABLE `labels_layouts` (
`layout_id` int(4) NOT NULL auto_increment,
`barcode_type` char(100) NOT NULL default 'CODE39',
`printing_type` char(32) NOT NULL default 'BAR',
`layout_name` char(20) NOT NULL default 'DEFAULT',
`guidebox` int(1) default '0',
`font` char(10) character set utf8 collate utf8_unicode_ci NOT NULL default 'TR',
`font_size` int(4) NOT NULL default '10',
`callnum_split` int(1) default '0',
`text_justify` char(1) character set utf8 collate utf8_unicode_ci NOT NULL default 'L',
`format_string` varchar(210) NOT NULL default 'barcode',
PRIMARY KEY USING BTREE (`layout_id`)
DROP TABLE IF EXISTS `creator_images`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `creator_images` (
`image_id` int(4) NOT NULL AUTO_INCREMENT,
`imagefile` mediumblob,
`image_name` char(20) NOT NULL DEFAULT 'DEFAULT',
PRIMARY KEY (`image_id`) USING BTREE,
UNIQUE KEY `image_name_index` (`image_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `labels_templates`
-- Table structure for table `creator_layouts`
--
DROP TABLE IF EXISTS `labels_templates`;
CREATE TABLE `labels_templates` (
`template_id` int(4) NOT NULL auto_increment,
`profile_id` int(4) default NULL,
`template_code` char(100) NOT NULL default 'DEFAULT TEMPLATE',
`template_desc` char(100) NOT NULL default 'Default description',
`page_width` float NOT NULL default '0',
`page_height` float NOT NULL default '0',
`label_width` float NOT NULL default '0',
`label_height` float NOT NULL default '0',
`top_text_margin` float NOT NULL default '0',
`left_text_margin` float NOT NULL default '0',
`top_margin` float NOT NULL default '0',
`left_margin` float NOT NULL default '0',
`cols` int(2) NOT NULL default '0',
`rows` int(2) NOT NULL default '0',
`col_gap` float NOT NULL default '0',
`row_gap` float NOT NULL default '0',
`units` char(20) NOT NULL default 'POINT',
PRIMARY KEY (`template_id`),
DROP TABLE IF EXISTS `creator_layouts`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `creator_layouts` (
`layout_id` int(4) NOT NULL AUTO_INCREMENT,
`barcode_type` char(100) NOT NULL DEFAULT 'CODE39',
`start_label` int(2) NOT NULL DEFAULT '1',
`printing_type` char(32) NOT NULL DEFAULT 'BAR',
`layout_name` char(20) NOT NULL DEFAULT 'DEFAULT',
`guidebox` int(1) DEFAULT '0',
`font` char(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'TR',
`font_size` int(4) NOT NULL DEFAULT '10',
`units` char(20) NOT NULL DEFAULT 'POINT',
`callnum_split` int(1) DEFAULT '0',
`text_justify` char(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'L',
`format_string` varchar(210) NOT NULL DEFAULT 'barcode',
`layout_xml` text NOT NULL,
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`layout_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `creator_templates`
--
DROP TABLE IF EXISTS `creator_templates`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `creator_templates` (
`template_id` int(4) NOT NULL AUTO_INCREMENT,
`profile_id` int(4) DEFAULT NULL,
`template_code` char(100) NOT NULL DEFAULT 'DEFAULT TEMPLATE',
`template_desc` char(100) NOT NULL DEFAULT 'Default description',
`page_width` float NOT NULL DEFAULT '0',
`page_height` float NOT NULL DEFAULT '0',
`label_width` float NOT NULL DEFAULT '0',
`label_height` float NOT NULL DEFAULT '0',
`top_text_margin` float NOT NULL DEFAULT '0',
`left_text_margin` float NOT NULL DEFAULT '0',
`top_margin` float NOT NULL DEFAULT '0',
`left_margin` float NOT NULL DEFAULT '0',
`cols` int(2) NOT NULL DEFAULT '0',
`rows` int(2) NOT NULL DEFAULT '0',
`col_gap` float NOT NULL DEFAULT '0',
`row_gap` float NOT NULL DEFAULT '0',
`units` char(20) NOT NULL DEFAULT 'POINT',
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`template_id`),
KEY `template_profile_fk_constraint` (`profile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -1249,13 +1280,13 @@ CREATE TABLE `notifys` (
DROP TABLE IF EXISTS `nozebra`;
CREATE TABLE `nozebra` (
`server` varchar(20) NOT NULL,
`indexname` varchar(40) NOT NULL,
`value` varchar(250) NOT NULL,
`biblionumbers` longtext NOT NULL,
KEY `indexname` (`server`,`indexname`),
KEY `value` (`server`,`value`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;
`server` varchar(20) NOT NULL,
`indexname` varchar(40) NOT NULL,
`value` varchar(250) NOT NULL,
`biblionumbers` longtext NOT NULL,
KEY `indexname` (`server`,`indexname`),
KEY `value` (`server`,`value`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `old_issues`
@ -1277,9 +1308,9 @@ CREATE TABLE `old_issues` (
KEY `old_issuesborridx` (`borrowernumber`),
KEY `old_issuesitemidx` (`itemnumber`),
KEY `old_bordate` (`borrowernumber`,`timestamp`),
CONSTRAINT `old_issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
CONSTRAINT `old_issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
ON DELETE SET NULL ON UPDATE SET NULL,
CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -1306,11 +1337,11 @@ CREATE TABLE `old_reserves` (
KEY `old_reserves_biblionumber` (`biblionumber`),
KEY `old_reserves_itemnumber` (`itemnumber`),
KEY `old_reserves_branchcode` (`branchcode`),
CONSTRAINT `old_reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
CONSTRAINT `old_reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
ON DELETE SET NULL ON UPDATE SET NULL,
CONSTRAINT `old_reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`)
CONSTRAINT `old_reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`)
ON DELETE SET NULL ON UPDATE SET NULL,
CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -1405,8 +1436,9 @@ CREATE TABLE `printers_profile` (
`creep_horz` float NOT NULL default '0',
`creep_vert` float NOT NULL default '0',
`units` char(20) NOT NULL default 'POINT',
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`profile_id`),
UNIQUE KEY `printername` (`printer_name`,`template_id`,`paper_bin`)
UNIQUE KEY `printername` (`printer_name`,`template_id`,`paper_bin`,`creator`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
@ -1427,7 +1459,7 @@ CREATE TABLE `repeatable_holidays` (
--
-- Table structure for table `reports_dictionary`
--
--
DROP TABLE IF EXISTS `reports_dictionary`;
CREATE TABLE reports_dictionary (
@ -1560,7 +1592,7 @@ CREATE TABLE IF NOT EXISTS `search_history` (
KEY `sessionid` (`sessionid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Opac search history results';
--
-- Table structure for table `serial`
--
@ -1585,7 +1617,7 @@ CREATE TABLE `serial` (
-- Table structure for table `sessions`
--
DROP TABLE IF EXISTS sessions;
DROP TABLE IF EXISTS sessions;
CREATE TABLE sessions (
`id` varchar(32) NOT NULL,
`a_session` text NOT NULL,
@ -2009,7 +2041,7 @@ CREATE TABLE `serialitems` (
KEY `serialitems_sfk_1` (`serialid`),
CONSTRAINT `serialitems_sfk_1` FOREIGN KEY (`serialid`) REFERENCES `serial` (`serialid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `user_permissions`;
CREATE TABLE `user_permissions` (
`borrowernumber` int(11) NOT NULL DEFAULT 0,
@ -2156,7 +2188,7 @@ CREATE TABLE branch_transfer_limits (
toBranch varchar(10) NOT NULL,
fromBranch varchar(10) NOT NULL,
itemtype varchar(10) NULL,
ccode varchar(10) NULL,
ccode varchar(10) NULL,
PRIMARY KEY (limitId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -2359,8 +2391,8 @@ CREATE TABLE `aqbudgets` (
`budget_name` varchar(80) default NULL,
`budget_branchcode` varchar(10) default NULL,
`budget_amount` decimal(28,6) NULL default '0.00',
`budget_encumb` decimal(28,6) NULL default '0.00',
`budget_expend` decimal(28,6) NULL default '0.00',
`budget_encumb` decimal(28,6) NULL default '0.00',
`budget_expend` decimal(28,6) NULL default '0.00',
`budget_notes` mediumtext,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`budget_period_id` int(11) default NULL,
@ -2420,7 +2452,7 @@ CREATE TABLE `aqcontract` (
`contractdescription` mediumtext,
`booksellerid` int(11) not NULL,
PRIMARY KEY (`contractnumber`),
CONSTRAINT `booksellerid_fk1` FOREIGN KEY (`booksellerid`)
CONSTRAINT `booksellerid_fk1` FOREIGN KEY (`booksellerid`)
REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@ -2496,7 +2528,7 @@ CREATE TABLE `aqorders_items` (
KEY `ordernumber` (`ordernumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
--
-- Table structure for table `fieldmapping`
--

View file

@ -161,7 +161,9 @@ while (my $template = $sth3->fetchrow_hashref()) {
# Drop old tables....
$sth->do("DROP TABLE IF EXISTS labels;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("DROP TABLE IF EXISTS labels_batches;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("DROP TABLE IF EXISTS labels_conf;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("DROP TABLE IF EXISTS labels_layouts;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("DROP TABLE IF EXISTS labels_profile;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("DROP TABLE IF EXISTS labels_templates;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("DROP TABLE IF EXISTS printers_profile;") or die "DB ERROR: " . $sth->errstr . "\n";

View file

@ -0,0 +1,157 @@
#!/usr/bin/perl
#
# Copyright 2009 Foundations Bible College.
#
# This file is part of Koha.
#
# Koha 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.
#
# Koha 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.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use C4::Context;
my $sth = C4::Context->dbh;
# NOTE: As long as we die on error *before* the DROP TABLE instructions are executed, the script may simply be rerun after addressing whatever errors occur; If we get past the data conversion without error, the DROPs and ALTERs could be executed manually if need be.
# Turn off key checks for duration of script...
$sth->do("
SET UNIQUE_CHECKS = 0;
") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("
SET FOREIGN_KEY_CHECKS = 0;
") or die "DB ERROR: " . $sth->errstr . "\n";
# Create new tables with temporary names...
$sth->do("
DROP TABLE IF EXISTS creator_batches_tmp;");
$sth->do("
CREATE TABLE `creator_batches_tmp` (
`label_id` int(11) NOT NULL AUTO_INCREMENT,
`batch_id` int(10) NOT NULL DEFAULT '1',
`item_number` int(11) DEFAULT NULL,
`borrower_number` int(11) DEFAULT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`branch_code` varchar(10) NOT NULL DEFAULT 'NB',
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`label_id`) USING BTREE,
KEY `branch_fk_constraint` (`branch_code`),
KEY `item_fk_constraint` (`item_number`),
KEY `borrower_fk_constraint` (`borrower_number`),
FOREIGN KEY (`borrower_number`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`branch_code`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE,
FOREIGN KEY (`item_number`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("
DROP TABLE IF EXISTS creator_layouts_tmp;");
$sth->do("
CREATE TABLE `creator_layouts_tmp` (
`layout_id` int(4) NOT NULL AUTO_INCREMENT,
`barcode_type` char(100) NOT NULL DEFAULT 'CODE39',
`start_label` int(2) NOT NULL DEFAULT '1',
`printing_type` char(32) NOT NULL DEFAULT 'BAR',
`layout_name` char(20) NOT NULL DEFAULT 'DEFAULT',
`guidebox` int(1) DEFAULT '0',
`font` char(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'TR',
`font_size` int(4) NOT NULL DEFAULT '10',
`units` char(20) NOT NULL DEFAULT 'POINT',
`callnum_split` int(1) DEFAULT '0',
`text_justify` char(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'L',
`format_string` varchar(210) NOT NULL DEFAULT 'barcode',
`layout_xml` text NOT NULL,
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`layout_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("
DROP TABLE IF EXISTS creator_templates_tmp;");
$sth->do("
CREATE TABLE `creator_templates_tmp` (
`template_id` int(4) NOT NULL AUTO_INCREMENT,
`profile_id` int(4) DEFAULT NULL,
`template_code` char(100) NOT NULL DEFAULT 'DEFAULT TEMPLATE',
`template_desc` char(100) NOT NULL DEFAULT 'Default description',
`page_width` float NOT NULL DEFAULT '0',
`page_height` float NOT NULL DEFAULT '0',
`label_width` float NOT NULL DEFAULT '0',
`label_height` float NOT NULL DEFAULT '0',
`top_text_margin` float NOT NULL DEFAULT '0',
`left_text_margin` float NOT NULL DEFAULT '0',
`top_margin` float NOT NULL DEFAULT '0',
`left_margin` float NOT NULL DEFAULT '0',
`cols` int(2) NOT NULL DEFAULT '0',
`rows` int(2) NOT NULL DEFAULT '0',
`col_gap` float NOT NULL DEFAULT '0',
`row_gap` float NOT NULL DEFAULT '0',
`units` char(20) NOT NULL DEFAULT 'POINT',
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`template_id`),
KEY `template_profile_fk_constraint` (`profile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("
DROP TABLE IF EXISTS `creator_images`;");
$sth->do("
CREATE TABLE `creator_images` (
`image_id` int(4) NOT NULL AUTO_INCREMENT,
`imagefile` mediumblob,
`image_name` char(20) NOT NULL DEFAULT 'DEFAULT',
PRIMARY KEY (`image_id`) USING BTREE,
UNIQUE KEY `image_name_index` (`image_name`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8;
") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("
ALTER TABLE printers_profile ADD COLUMN `creator` char(15) NOT NULL DEFAULT 'Labels';
") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("
ALTER TABLE printers_profile DROP KEY printername;
") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("
ALTER TABLE printers_profile ADD UNIQUE KEY `printername` (`printer_name`,`template_id`,`paper_bin`,`creator`) USING BTREE;
") or die "DB ERROR: " . $sth->errstr . "\n";
# Migrate data from existing tables to new tables...
$sth->do("INSERT INTO `creator_batches_tmp` (label_id, batch_id, item_number, timestamp, branch_code) SELECT label_id, batch_id, item_number, timestamp, branch_code FROM labels_batches;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("INSERT INTO `creator_layouts_tmp` (layout_id, barcode_type, printing_type, layout_name, guidebox, callnum_split, text_justify, format_string) SELECT layout_id, barcode_type, printing_type, layout_name, guidebox, callnum_split, text_justify, format_string FROM labels_layouts;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("INSERT INTO `creator_templates_tmp` (template_id, template_code, template_desc, page_width, page_height, label_width, label_height, top_margin, left_margin, cols, rows, col_gap, row_gap, units) SELECT template_id, template_code, template_desc, page_width, page_height, label_width, label_height, top_margin, left_margin, cols, rows, col_gap, row_gap, units FROM labels_templates;") or die "DB ERROR: " . $sth->errstr . "\n";
# Drop old tables....
$sth->do("DROP TABLE IF EXISTS labels_batches;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("DROP TABLE IF EXISTS labels_layouts;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("DROP TABLE IF EXISTS labels_templates;") or die "DB ERROR: " . $sth->errstr . "\n";
# Rename temporary tables to permenant names...
$sth->do("ALTER TABLE creator_batches_tmp RENAME TO creator_batches;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("ALTER TABLE creator_layouts_tmp RENAME TO creator_layouts;") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("ALTER TABLE creator_templates_tmp RENAME TO creator_templates;") or die "DB ERROR: " . $sth->errstr . "\n";
# Re-enable key checks...
$sth->do("
SET UNIQUE_CHECKS = 1;
") or die "DB ERROR: " . $sth->errstr . "\n";
$sth->do("
SET FOREIGN_KEY_CHECKS = 1;
") or die "DB ERROR: " . $sth->errstr . "\n";

View file

@ -0,0 +1,36 @@
--
-- Default classification sources and filing rules
-- for Koha.
--
-- Copyright (C) 2007 LiblimeA
--
-- This file is part of Koha.
--
-- Koha 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.
--
-- Koha 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.
--
-- You should have received a copy of the GNU General Public License along with
-- Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-- Suite 330, Boston, MA 02111-1307 USA
-- class sorting (filing) rules
INSERT INTO `class_sort_rules` (`class_sort_rule`, `description`, `sort_routine`) VALUES
('dewey', 'Default filing rules for DDC', 'Dewey'),
('lcc', 'Default filing rules for LCC', 'LCC'),
('generic', 'Generic call number filing rules', 'Generic');
-- classification schemes or sources
INSERT INTO `class_sources` (`cn_source`, `description`, `used`, `class_sort_rule`) VALUES
('ddc', 'Dewey Decimal Classification', 1, 'dewey'),
('lcc', 'Library of Congress Classification', 1, 'lcc'),
('udc', 'Universal Decimal Classification', 0, 'generic'),
('sudocs', 'SuDoc Classification (U.S. GPO)', 0, 'generic'),
('anscr', 'ANSCR (Sound Recordings)', 0, 'generic'),
('z', 'Other/Generic Classification Scheme', 0, 'generic');

View file

@ -0,0 +1 @@
Domyślne źródła klasyfikacji i reguły wypełniania

View file

@ -0,0 +1,5 @@
INSERT INTO message_transport_types
(message_transport_type)
values
('email'),
('sms');

View file

@ -0,0 +1 @@
Określa domyślne typy transportu wiadomości.

View file

@ -0,0 +1,14 @@
INSERT INTO `letter` (module, code, name, title, content)
VALUES ('circulation','ODUE','Overdue Notice','Item Overdue',"Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nAccording to our records, you have items that are overdue. Your library does not charge late fines, but please return or renew them as soon as possible.\r\n\r\n<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n<<branches.branchaddress3>>\n<<branches.branchphone>>\n<<branches.branchfax>>\n<<branches.branchemail>>\r\n\r\nIf you have registered a password with the library, you may use it with your library card number to renew online. If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned. The following item is currently overdue:\r\n\r\n<<items.content>>"),
('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received',"<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received."),
('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'),
('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin@yoursite.org'),
('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'),
('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'),
('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'
),
('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.'),
('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>\r\n<<branches.branchcity>> <<branches.branchzip>>'),
('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');

View file

@ -0,0 +1 @@
Przykładowe powiadomienia

View file

@ -0,0 +1,99 @@
INSERT INTO stopwords VALUES
('a'),
('about'),
('also'),
('an'),
('and'),
('another'),
('any'),
('are'),
('as'),
('at'),
('back'),
('be'),
('because'),
('been'),
('being'),
('but'),
('by'),
('can'),
('could'),
('did'),
('do'),
('each'),
('end'),
('even'),
('for'),
('from'),
('get'),
('go'),
('had'),
('have'),
('he'),
('her'),
('here'),
('his'),
('how'),
('i'),
('if'),
('in'),
('into'),
('is'),
('it'),
('just'),
('may'),
('me'),
('might'),
('much'),
('must'),
('my'),
('no'),
('not'),
('of'),
('off'),
('on'),
('only'),
('or'),
('other'),
('our'),
('out'),
('should'),
('so'),
('some'),
('still'),
('such'),
('than'),
('that'),
('the'),
('their'),
('them'),
('then'),
('there'),
('these'),
('they'),
('this'),
('those'),
('to'),
('too'),
('try'),
('two'),
('under'),
('up'),
('us'),
('was'),
('we'),
('were'),
('what'),
('when'),
('where'),
('which'),
('while'),
('who'),
('why'),
('will'),
('with'),
('within'),
('without'),
('would'),
('you'),
('your');

View file

@ -0,0 +1 @@
Angielskie stop words. Możesz je zmienić po intalacji.

View file

@ -0,0 +1,722 @@
-- http://www.w3.org/International/articles/language-tags/
-- BIDI Stuff, Arabic and Hebrew
INSERT INTO language_script_bidi(rfc4646_subtag,bidi)
VALUES( 'Arab', 'rtl');
INSERT INTO language_script_bidi(rfc4646_subtag,bidi)
VALUES( 'Hebr', 'rtl');
-- Default mappings between script and language subcodes
INSERT INTO language_script_mapping(language_subtag,script_subtag)
VALUES( 'ar', 'Arab');
INSERT INTO language_script_mapping(language_subtag,script_subtag)
VALUES( 'he', 'Hebr');
-- EXTENSIONS
-- Interface (i)
-- SELECT * FROM language_subtag_registry WHERE type='i';
-- OPAC
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'opac', 'i', 'OPAC','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'opac', 'i', 'en', 'OPAC');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'opac', 'i', 'fr', 'OPAC');
-- Staff Client
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'intranet', 'i', 'Staff Client','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'intranet', 'i', 'en', 'Staff Client');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'intranet', 'i', 'fr', '????');
-- Theme (t)
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'prog', 't', 'Prog','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'prog', 't', 'en', 'Prog');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'prog', 't', 'fr', 'Prog');
-- LANGUAGES
-- Arabic
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'ar', 'language', 'Arabic','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'ar','ara');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'ar', 'language', 'ar', '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ar', 'language', 'en', 'Arabic');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ar', 'language', 'fr', 'Arabe');
-- Armenian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'hy', 'language', 'Armenian','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'hy','hy');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'hy', 'language', 'hy', '&#1344;&#1377;&#1397;&#1381;&#1408;&#1383;&#1398;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'hy', 'language', 'en', 'Armenian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'hy', 'language', 'fr', 'Armenian');
-- Bulgarian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'bg', 'language', 'Bulgarian','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'bg','bul');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'bg', 'language', 'bg', '&#1041;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'bg', 'language', 'en', 'Bulgarian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'bg', 'language', 'fr', 'Bulgare');
-- Chinese
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'zh', 'language', 'Chinese','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'zh','chi');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'zh', 'language', 'zh', '&#20013;&#25991;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'zh', 'language', 'en', 'Chinese');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'zh', 'language', 'fr', 'Chinois');
-- Czech
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'cs', 'language', 'Czech','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'cs','cze');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'cs', 'language', 'cs', '&#x010D;e&#353;tina');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'cs', 'language', 'en', 'Czech');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'cs', 'language', 'fr', 'Tchèque');
-- Danish
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'da', 'language', 'Danish','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'da','dan');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'da', 'language', 'da', 'D&aelig;nsk');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'da', 'language', 'en', 'Danish');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'da', 'language', 'fr', 'Danois');
-- Dutch, Flemish
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'nl', 'language', 'Dutch','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'nl','dut');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'nl', 'language', 'nl', 'ned&#601;rl&#593;ns');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'nl', 'language', 'en', 'Dutch');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'nl', 'language', 'fr', 'Néerlandais');
-- English
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'en', 'language', 'English','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'en','en');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'en', 'language', 'en', 'English');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'en', 'language', 'fr', 'Anglais');
-- English
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'fi', 'language', 'Finnish','2005-10-16' );
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'fi', 'language', 'fi', 'suomi');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'fi', 'language', 'en', 'Finnish');
-- French
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'fr', 'language', 'French','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'fr','fr');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'fr', 'language', 'en', 'French');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'fr', 'language', 'fr', 'Fran&ccedil;ais');
-- INSERT INTO language_descriptions(subtag, type, lang, description)
-- VALUES( 'fr-CA', 'language', 'fr-CA', 'fran&ccedil;ais');
-- Lao
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'lo', 'language', 'Lao','2005-10-16' );
-- INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
-- VALUES( 'lo','nor'); ???
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'lo', 'language', 'lo', '&#3742;&#3762;&#3754;&#3762;&#3749;&#3762;&#3751;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'lo', 'language', 'en', 'Lao');
-- German
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'de', 'language', 'German','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'de','ger');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'de', 'language', 'de', 'Deutsch');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'de', 'language', 'en', 'German');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'de', 'language', 'fr', 'Allemand');
-- Greek
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'el', 'language', 'Greek, Modern [1453- ]','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'el','gre');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'el', 'language', 'el', '&#949;&#955;&#955;&#951;&#957;&#953;&#954;&#940;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'el', 'language', 'en', 'Greek, Modern [1453- ]');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'el', 'language', 'fr', 'Grec Moderne (Après 1453)');
-- Hebrew
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'he', 'language', 'Hebrew','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'he','heb');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'he', 'language', 'he', '&#1506;&#1489;&#1512;&#1497;&#1514;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'he', 'language', 'en', 'Hebrew');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'he', 'language', 'fr', 'Hébreu');
-- Hindi
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'hi', 'language', 'Hindi','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'hi','hin');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'hi', 'language', 'hi', '&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'hi', 'language', 'en', 'Hindi');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'hi', 'language', 'fr', 'Hindi');
-- Hungarian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'hu', 'language', 'Hungarian','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'hu','hun');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'hu', 'language', 'hu', 'Magyar');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'hu', 'language', 'en', 'Hungarian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'hu', 'language', 'fr', 'Hongrois');
-- Indonesian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'id', 'language', 'Indonesian','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'id','ind');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'id', 'language', 'id', 'Bahasa Indonesia');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'id', 'language', 'en', 'Indonesian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'id', 'language', 'fr', 'Indonésien');
-- Italian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'it', 'language', 'Italian','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'it','ind');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'it', 'language', 'it', 'Italiano');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'it', 'language', 'en', 'Italian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'it', 'language', 'fr', 'Italien');
-- Japanese
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'ja', 'language', 'Japanese','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'ja','jpn');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ja', 'language', 'ja', '&#26085;&#26412;&#35486;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ja', 'language', 'en', 'Japanese');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ja', 'language', 'fr', 'Japonais');
-- Korean
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'ko', 'language', 'Korean','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'ko','kor');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ko', 'language', 'ko', '&#54620;&#44397;&#50612;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ko', 'language', 'en', 'Korean');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ko', 'language', 'fr', 'Coréen');
-- Latin
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'la', 'language', 'Latin','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'la','lat');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'la', 'language', 'la', 'Latina');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'la', 'language', 'en', 'Latin');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'la', 'language', 'fr', 'Latin');
-- Galacian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'gl', 'language', 'Galician','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'gl','glg');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'gl', 'language', 'gl', 'Galego');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'gl', 'language', 'en', 'Galician');
-- Norwegian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'nb','nor');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'nb', 'language', 'nb', 'Norsk');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'nb', 'language', 'en', 'Norwegian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'nb', 'language', 'fr', 'Norvégien');
-- Persian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'fa', 'language', 'Persian','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'fa','per');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'fa', 'language', 'fa', '&#1601;&#1575;&#1585;&#1587;&#1609;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'fa', 'language', 'en', 'Persian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'fa', 'language', 'fr', 'Persan');
-- Polish
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'pl', 'language', 'Polish','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'pl','pol');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'pl', 'language', 'pl', 'Polski');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'pl', 'language', 'en', 'Polish');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'pl', 'language', 'fr', 'Polonais');
-- Portuguese
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'pt', 'language', 'Portuguese','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'pt','pol');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'pt', 'language', 'pt', 'Portugu&ecirc;s');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'pt', 'language', 'en', 'Portuguese');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'pt', 'language', 'fr', 'Portugais');
-- Romanian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'ro', 'language', 'Romanian','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'ro','rum');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ro', 'language', 'ro', 'Rom&acirc;n&#259;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ro', 'language', 'en', 'Romanian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ro', 'language', 'fr', 'Roumain');
-- Russian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'ru', 'language', 'Russian','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'ru','rus');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ru', 'language', 'ru', '&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ru', 'language', 'en', 'Russian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ru', 'language', 'fr', 'Russe');
-- Serbian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'sr', 'language', 'Serbian','2005-10-16' );
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'sr', 'language', 'sr', '&#1089;&#1088;&#1087;&#1089;&#1082;&#1080;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'sr', 'language', 'en', 'Serbian');
-- Spanish, Castilian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'es', 'language', 'Spanish','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'es','spa');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'es', 'language', 'es', 'Espa&ntilde;ol');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'es', 'language', 'en', 'Spanish');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'es', 'language', 'fr', 'Espagnol');
-- Swedish
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'sv', 'language', 'Swedish','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'sv','swe');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'sv', 'language', 'sv', 'Svenska');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'sv', 'language', 'en', 'Swedish');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'sv', 'language', 'fr', 'Suédois');
-- Tetum
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'tet', 'language', 'Tetum','2005-10-16' );
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'tet', 'language', 'tet', 'tetun');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'tet', 'language', 'en', 'Tetum');
-- Thai
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'th', 'language', 'Thai','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'th','tha');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'th', 'language', 'th', '&#3616;&#3634;&#3625;&#3634;&#3652;&#3607;&#3618;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'th', 'language', 'en', 'Thai');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'th', 'language', 'fr', 'Thaï');
-- Turkish
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'tr', 'language', 'Turkish','2005-10-16' );
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'tr','tur');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'tr', 'language', 'tr', 'T&uuml;rk&ccedil;e');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'tr', 'language', 'en', 'Turkish');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'tr', 'language', 'fr', 'Turc');
-- Ukranian
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'uk', 'language', 'Ukranian','2005-10-16');
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
VALUES( 'uk','ukr');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'uk', 'language', 'uk', '&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'uk', 'language', 'en', 'Ukranian');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'uk', 'language', 'fr', 'Ukrainien');
-- English
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'ur', 'language', 'Urdu','2005-10-16' );
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ur', 'language', 'en', 'Urdu');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'ur', 'language', 'ur', '&#1575;&#1585;&#1583;&#1608;');
-- SCRIPTS
-- Arabic
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'Arab', 'script', 'Arabic','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'Arab','script', 'Arab', '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Arab', 'script','en', 'Arabic');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Arab', 'script','fr', 'Arabic');
-- Cyrillic
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'Cyrl', 'script', 'Cyrillic','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'Cyrl', 'script', 'Cyrl', '????');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Cyrl', 'script', 'en', 'Cyrillic');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Cyrl', 'script', 'fr', 'Cyrillic');
-- Greek
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'Grek', 'script', 'Greek','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'Grek', 'script', 'Grek', '????');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Grek', 'script', 'en', 'Greek');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Grek', 'script', 'fr', 'Greek');
-- Han - Simplified
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'Hans', 'script', 'Han (Simplified variant)','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'Hans', 'script', 'Hans', 'Han (Simplified variant)');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Hans', 'script', 'en', 'Han (Simplified variant)');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Hans', 'script', 'fr', 'Han (Simplified variant)');
-- Han - Traditional
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'Hant', 'script', 'Han (Traditional variant)','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'Hant', 'script', 'Hant', 'Han (Traditional variant)');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Hant', 'script', 'en', 'Han (Traditional variant)');
-- Hebrew
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'Hebr', 'script', 'Hebrew','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'Hebr', 'script', 'Hebr', 'Hebrew');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Hebr', 'script', 'en', 'Hebrew');
-- Lao
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'Laoo', 'script', 'Lao','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'Laoo', 'script', 'lo', 'Lao');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'Laoo', 'script', 'en', 'Lao');
-- REGIONS
-- Canada
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'CA', 'region', 'Canada','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'CA', 'region', 'en', 'Canada');
-- Denmark
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'DK', 'region', 'Denmark','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'DK', 'region', 'dk', 'Danmark');
-- France
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'FR', 'region', 'France','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES ( 'FR', 'region', 'fr', 'France');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'FR', 'region', 'en', 'France');
-- New Zealand
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'NZ', 'region', 'New Zealand','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'NZ', 'region', 'en', 'New Zealand');
-- United Kingdom
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'GB', 'region', 'United Kingdom','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'GB', 'region', 'en', 'United Kingdom');
-- United States
INSERT INTO language_subtag_registry( subtag, type, description, added)
VALUES ( 'US', 'region', 'United States','2005-10-16');
INSERT INTO language_descriptions(subtag, type, lang, description)
VALUES( 'US', 'region', 'en', 'United States');

View file

@ -0,0 +1,5 @@
Wsparcie Koha dla I18N
Tłumaczenia dwukierunkowe, arabski i and hebrajski
Domyślne mapowania pomiędzy skryptem a subkodami języków
Rozszerzenia języków

View file

@ -0,0 +1,275 @@
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('acquisitions','normal','Choose Normal, budget-based acquisitions, or Simple bibliographic-data acquisitions','simple|normal','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('advancedMARCeditor',0,"If ON, the MARC editor won\'t display field/subfield descriptions",'','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowHoldDateInFuture','0','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACAllowHoldDateInFuture','0','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonEnabled',0,'Turn ON Amazon Content - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonReviews',0,'Display Amazon review on staff interface - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonSimilarItems',0,'Turn ON Amazon Similar Items feature - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACAmazonEnabled',0,'Turn ON Amazon Content in the OPAC - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACAmazonSimilarItems',0,'Turn ON Amazon Similar Items feature - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','See: http://aws.amazon.com','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See: http://aws.amazon.com','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable Anonymous suggestions',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Babeltheque',0,'Turn ON Babeltheque content - See babeltheque.com to subscribe to this service','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --',10,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoBarcode','OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','incremental|annual|hbyymmincr|OFF','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoLocation',0,'If ON, IP authentication is enabled, blocking access to the staff client from unauthorized IP addresses',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutomaticItemReturn',1,'If ON, Koha will automatically set up a transfer of this item to its homebranch',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum',1,'If ON, patron number is auto-calculated','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BiblioDefaultView','normal','Choose the default detail view in the catalog; choose between normal, marc or isbd','normal|marc|isbd','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField','zipcode|surname|cardnumber','Choose the mandatory fields for a patron\'s account',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship','father|mother','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog',1,'If ON, log edit/create/delete actions on patron data',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casAuthentication', '0', 'Enable or disable CAS authentication', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casLogout', '0', 'Does a logout from Koha should also log the user out of CAS?', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casServerUrl', 'https://localhost:8443/cas', 'URL of the cas server', '', 'Free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CataloguingLog',1,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('checkdigit','none','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','none|katipo','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('delimiter',';','Define the default separator character for exporting reports',';|tabulation|,|/|\\|#|\|','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnhancedMessagingPreferences',0,'If ON, allows patrons to select to receive additional messages about items due or nearly due.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('expandedSearchOption',0,'If ON, set advanced search to be expanded by default',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches',0,'If ON, increases security between libraries',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('insecure',0,'If ON, bypasses all authentication. Be careful!',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','normal|marc|isbd|labeled_marc','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('intranetcolorstylesheet','','Define the color stylesheet to use in the Staff Client','50','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetmainUserblock','','Add a block of HTML that will display on the intranet home page','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetNav','','Use HTML tabs to add navigational links to the top-hand navigational bar in the Staff Client','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('intranetreadinghistory',1,'If ON, Reading History is enabled for all patrons','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('intranetstylesheet','','Enter a complete URL to use an alternate layout stylesheet in Intranet','50','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('intranetuserjs','','Custom javascript for inclusion in Intranet','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('intranet_includes','includes','The includes directory you want for specific look of Koha (includes or includes_npl for example)',NULL,'Free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ISBD','#100||{ 100a }{ 100b }{ 100c }{ 100d }{ 110a }{ 110b }{ 110c }{ 110d }{ 110e }{ 110f }{ 110g }{ 130a }{ 130d }{ 130f }{ 130g }{ 130h }{ 130k }{ 130l }{ 130m }{ 130n }{ 130o }{ 130p }{ 130r }{ 130s }{ 130t }|<br/><br/>\r\n#245||{ 245a }{ 245b }{245f }{ 245g }{ 245k }{ 245n }{ 245p }{ 245s }{ 245h }|\r\n#246||{ : 246i }{ 246a }{ 246b }{ 246f }{ 246g }{ 246n }{ 246p }{ 246h }|\r\n#242||{ = 242a }{ 242b }{ 242n }{ 242p }{ 242h }|\r\n#245||{ 245c }|\r\n#242||{ = 242c }|\r\n#250| - |{ 250a }{ 250b }|\r\n#254|, |{ 254a }|\r\n#255|, |{ 255a }{ 255b }{ 255c }{ 255d }{ 255e }{ 255f }{ 255g }|\r\n#256|, |{ 256a }|\r\n#257|, |{ 257a }|\r\n#258|, |{ 258a }{ 258b }|\r\n#260| - |{ 260a }{ 260b }{ 260c }|\r\n#300| - |{ 300a }{ 300b }{ 300c }{ 300d }{ 300e }{ 300f }{ 300g }|\r\n#306| - |{ 306a }|\r\n#307| - |{ 307a }{ 307b }|\r\n#310| - |{ 310a }{ 310b }|\r\n#321| - |{ 321a }{ 321b }|\r\n#340| - |{ 3403 }{ 340a }{ 340b }{ 340c }{ 340d }{ 340e }{ 340f }{ 340h }{ 340i }|\r\n#342| - |{ 342a }{ 342b }{ 342c }{ 342d }{ 342e }{ 342f }{ 342g }{ 342h }{ 342i }{ 342j }{ 342k }{ 342l }{ 342m }{ 342n }{ 342o }{ 342p }{ 342q }{ 342r }{ 342s }{ 342t }{ 342u }{ 342v }{ 342w }|\r\n#343| - |{ 343a }{ 343b }{ 343c }{ 343d }{ 343e }{ 343f }{ 343g }{ 343h }{ 343i }|\r\n#351| - |{ 3513 }{ 351a }{ 351b }{ 351c }|\r\n#352| - |{ 352a }{ 352b }{ 352c }{ 352d }{ 352e }{ 352f }{ 352g }{ 352i }{ 352q }|\r\n#362| - |{ 362a }{ 351z }|\r\n#440| - |{ 440a }{ 440n }{ 440p }{ 440v }{ 440x }|.\r\n#490| - |{ 490a }{ 490v }{ 490x }|.\r\n#800| - |{ 800a }{ 800b }{ 800c }{ 800d }{ 800e }{ 800f }{ 800g }{ 800h }{ 800j }{ 800k }{ 800l }{ 800m }{ 800n }{ 800o }{ 800p }{ 800q }{ 800r }{ 800s }{ 800t }{ 800u }{ 800v }|.\r\n#810| - |{ 810a }{ 810b }{ 810c }{ 810d }{ 810e }{ 810f }{ 810g }{ 810h }{ 810k }{ 810l }{ 810m }{ 810n }{ 810o }{ 810p }{ 810r }{ 810s }{ 810t }{ 810u }{ 810v }|.\r\n#811| - |{ 811a }{ 811c }{ 811d }{ 811e }{ 811f }{ 811g }{ 811h }{ 811k }{ 811l }{ 811n }{ 811p }{ 811q }{ 811s }{ 811t }{ 811u }{ 811v }|.\r\n#830| - |{ 830a }{ 830d }{ 830f }{ 830g }{ 830h }{ 830k }{ 830l }{ 830m }{ 830n }{ 830o }{ 830p }{ 830r }{ 830s }{ 830t }{ 830v }|.\r\n#500|<br/><br/>|{ 5003 }{ 500a }|\r\n#501|\<br/><br/>|{ 501a }|\r\n#502|<br/><br/>|{ 502a }|\r\n#504|<br/><br/>|{ 504a }|\r\n#505|<br/><br/>|{ 505a }{ 505t }{ 505r }{ 505g }{ 505u }|\r\n#506|<br/><br/>|{ 5063 }{ 506a }{ 506b }{ 506c }{ 506d }{ 506u }|\r\n#507|<br/><br/>|{ 507a }{ 507b }|\r\n#508|<br/><br/>|{ 508a }{ 508a }|\r\n#510|<br/><br/>|{ 5103 }{ 510a }{ 510x }{ 510c }{ 510b }|\r\n#511|<br/><br/>|{ 511a }|\r\n#513|<br/><br/>|{ 513a }{513b }|\r\n#514|<br/><br/>|{ 514z }{ 514a }{ 514b }{ 514c }{ 514d }{ 514e }{ 514f }{ 514g }{ 514h }{ 514i }{ 514j }{ 514k }{ 514m }{ 514u }|\r\n#515|<br/><br/>|{ 515a }|\r\n#516|<br/><br/>|{ 516a }|\r\n#518|<br/><br/>|{ 5183 }{ 518a }|\r\n#520|<br/><br/>|{ 5203 }{ 520a }{ 520b }{ 520u }|\r\n#521|<br/><br/>|{ 5213 }{ 521a }{ 521b }|\r\n#522|<br/><br/>|{ 522a }|\r\n#524|<br/><br/>|{ 524a }|\r\n#525|<br/><br/>|{ 525a }|\r\n#526|<br/><br/>|{\\n510i }{\\n510a }{ 510b }{ 510c }{ 510d }{\\n510x }|\r\n#530|<br/><br/>|{\\n5063 }{\\n506a }{ 506b }{ 506c }{ 506d }{\\n506u }|\r\n#533|<br/><br/>|{\\n5333 }{\\n533a }{\\n533b }{\\n533c }{\\n533d }{\\n533e }{\\n533f }{\\n533m }{\\n533n }|\r\n#534|<br/><br/>|{\\n533p }{\\n533a }{\\n533b }{\\n533c }{\\n533d }{\\n533e }{\\n533f }{\\n533m }{\\n533n }{\\n533t }{\\n533x }{\\n533z }|\r\n#535|<br/><br/>|{\\n5353 }{\\n535a }{\\n535b }{\\n535c }{\\n535d }|\r\n#538|<br/><br/>|{\\n5383 }{\\n538a }{\\n538i }{\\n538u }|\r\n#540|<br/><br/>|{\\n5403 }{\\n540a }{ 540b }{ 540c }{ 540d }{\\n520u }|\r\n#544|<br/><br/>|{\\n5443 }{\\n544a }{\\n544b }{\\n544c }{\\n544d }{\\n544e }{\\n544n }|\r\n#545|<br/><br/>|{\\n545a }{ 545b }{\\n545u }|\r\n#546|<br/><br/>|{\\n5463 }{\\n546a }{ 546b }|\r\n#547|<br/><br/>|{\\n547a }|\r\n#550|<br/><br/>|{ 550a }|\r\n#552|<br/><br/>|{ 552z }{ 552a }{ 552b }{ 552c }{ 552d }{ 552e }{ 552f }{ 552g }{ 552h }{ 552i }{ 552j }{ 552k }{ 552l }{ 552m }{ 552n }{ 562o }{ 552p }{ 552u }|\r\n#555|<br/><br/>|{ 5553 }{ 555a }{ 555b }{ 555c }{ 555d }{ 555u }|\r\n#556|<br/><br/>|{ 556a }{ 506z }|\r\n#563|<br/><br/>|{ 5633 }{ 563a }{ 563u }|\r\n#565|<br/><br/>|{ 5653 }{ 565a }{ 565b }{ 565c }{ 565d }{ 565e }|\r\n#567|<br/><br/>|{ 567a }|\r\n#580|<br/><br/>|{ 580a }|\r\n#581|<br/><br/>|{ 5633 }{ 581a }{ 581z }|\r\n#584|<br/><br/>|{ 5843 }{ 584a }{ 584b }|\r\n#585|<br/><br/>|{ 5853 }{ 585a }|\r\n#586|<br/><br/>|{ 5863 }{ 586a }|\r\n#020|<br/><br/><label>ISBN: </label>|{ 020a }{ 020c }|\r\n#022|\
<br/><br/><label>ISSN: </label>|{ 022a }|\r\n#222| = |{ 222a }{ 222b }|\r\n#210| = |{ 210a }{ 210b }|\r\n#024|<br/><br/><label>Standard No.: </label>|{ 024a }{ 024c }{ 024d }{ 0242 }|\r\n#027|<br/><br/><label>Standard Tech. Report. No.: </label>|{ 027a }|\r\n#028|<br/><br/><label>Publisher. No.: </label>|{ 028a }{ 028b }|\r\n#013|<br/><br/><label>Patent No.: </label>|{ 013a }{ 013b }{ 013c }{ 013d }{ 013e }{ 013f }|\r\n#030|<br/><br/><label>CODEN: </label>|{ 030a }|\r\n#037|<br/><br/><label>Source: </label>|{ 037a }{ 037b }{ 037c }{ 037f }{ 037g }{ 037n }|\r\n#010|<br/><br/><label>LCCN: </label>|{ 010a }|\r\n#015|<br/><br/><label>Nat. Bib. No.: </label>|{ 015a }{ 0152 }|\r\n#016|<br/><br/><label>Nat. Bib. Agency Control No.: </label>|{ 016a }{ 0162 }|\r\n#600|<br/><br/><label>Subjects--Personal Names: </label>|{\\n6003 }{\\n600a}{ 600b }{ 600c }{ 600d }{ 600e }{ 600f }{ 600g }{ 600h }{--600k}{ 600l }{ 600m }{ 600n }{ 600o }{--600p}{ 600r }{ 600s }{ 600t }{ 600u }{--600x}{--600z}{--600y}{--600v}|\r\n#610|<br/><br/><label>Subjects--Corporate Names: </label>|{\\n6103 }{\\n610a}{ 610b }{ 610c }{ 610d }{ 610e }{ 610f }{ 610g }{ 610h }{--610k}{ 610l }{ 610m }{ 610n }{ 610o }{--610p}{ 610r }{ 610s }{ 610t }{ 610u }{--610x}{--610z}{--610y}{--610v}|\r\n#611|<br/><br/><label>Subjects--Meeting Names: </label>|{\\n6113 }{\\n611a}{ 611b }{ 611c }{ 611d }{ 611e }{ 611f }{ 611g }{ 611h }{--611k}{ 611l }{ 611m }{ 611n }{ 611o }{--611p}{ 611r }{ 611s }{ 611t }{ 611u }{--611x}{--611z}{--611y}{--611v}|\r\n#630|<br/><br/><label>Subjects--Uniform Titles: </label>|{\\n630a}{ 630b }{ 630c }{ 630d }{ 630e }{ 630f }{ 630g }{ 630h }{--630k }{ 630l }{ 630m }{ 630n }{ 630o }{--630p}{ 630r }{ 630s }{ 630t }{--630x}{--630z}{--630y}{--630v}|\r\n#648|<br/><br/><label>Subjects--Chronological Terms: </label>|{\\n6483 }{\\n648a }{--648x}{--648z}{--648y}{--648v}|\r\n#650|<br/><br/><label>Subjects--Topical Terms: </label>|{\\n6503 }{\\n650a}{ 650b }{ 650c }{ 650d }{ 650e }{--650x}{--650z}{--650y}{--650v}|\r\n#651|<br/><br/><label>Subjects--Geographic Terms: </label>|{\\n6513 }{\\n651a}{ 651b }{ 651c }{ 651d }{ 651e }{--651x}{--651z}{--651y}{--651v}|\r\n#653|<br/><br/><label>Subjects--Index Terms: </label>|{ 653a }|\r\n#654|<br/><br/><label>Subjects--Facted Index Terms: </label>|{\\n6543 }{\\n654a}{--654b}{--654x}{--654z}{--654y}{--654v}|\r\n#655|<br/><br/><label>Index Terms--Genre/Form: </label>|{\\n6553 }{\\n655a}{--655b}{--655x }{--655z}{--655y}{--655v}|\r\n#656|<br/><br/><label>Index Terms--Occupation: </label>|{\\n6563 }{\\n656a}{--656k}{--656x}{--656z}{--656y}{--656v}|\r\n#657|<br/><br/><label>Index Terms--Function: </label>|{\\n6573 }{\\n657a}{--657x}{--657z}{--657y}{--657v}|\r\n#658|<br/><br/><label>Index Terms--Curriculum Objective: </label>|{\\n658a}{--658b}{--658c}{--658d}{--658v}|\r\n#050|<br/><br/><label>LC Class. No.: </label>|{ 050a }{ / 050b }|\r\n#082|<br/><br/><label>Dewey Class. No.: </label>|{ 082a }{ / 082b }|\r\n#080|<br/><br/><label>Universal Decimal Class. No.: </label>|{ 080a }{ 080x }{ / 080b }|\r\n#070|<br/><br/><label>National Agricultural Library Call No.: </label>|{ 070a }{ / 070b }|\r\n#060|<br/><br/><label>National Library of Medicine Call No.: </label>|{ 060a }{ / 060b }|\r\n#074|<br/><br/><label>GPO Item No.: </label>|{ 074a }|\r\n#086|<br/><br/><label>Gov. Doc. Class. No.: </label>|{ 086a }|\r\n#088|<br/><br/><label>Report. No.: </label>|{ 088a }|','ISBD','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IssueLog',1,'If ON, log checkout activity',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IssuingInProcess',0,'If ON, disables fines if the patron is issuing item that accumulate debt',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('item-level_itypes',1,'If ON, enables Item-level Itemtype / Issuing Rules','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemcallnumber','082ab','The MARC field/subfield that is used to calculate the itemcallnumber (Dewey would be 082ab or 092ab; LOC would be 050ab or 090ab) could be 852hi from an item record',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('DefaultClassificationSource','ddc','Default classification scheme used by the collection. E.g., Dewey, LCC, etc.', NULL,'ClassSources');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('KohaAdminEmailAddress','root@localhost','Define the email address where patron modification requests are sent','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('kohaspsuggest','','Track search queries, turn on by defining host:dbname:user:pass','','');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('LabelMARCView','standard','Define how a MARC record will display','standard|economical','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('LetterLog',1,'If ON, log all notices sent',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('LibraryName','','Podaj nazwę biblioteki która ma być wyświetlana w OPAC','','');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('marc',1,'Turn on MARC support',NULL,'YesNo');
-- this is selected by the web installer now
-- INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('marcflavour','MARC21','Define global MARC flavor (MARC21 or UNIMARC) used for character encoding','MARC21|UNIMARC','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MARCOrgCode','OSt','Define MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',9999,'Maximum fine a patron can have for a single late return','','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxoutstanding',5,'maximum amount withstanding to be able make holds','','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxreserves',50,'Define maximum number of holds a patron can place','','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('memberofinstitution',0,'If ON, patrons can be linked to institutions',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MIME','EXCEL','Define the default application for exporting report data','EXCEL|OPENOFFICE.ORG','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noissuescharge',5,'Define maximum amount withstanding before check outs are blocked','','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('NotifyBorrowerDeparture',30,'Define number of days before expiry where circulation is warned about patron account expiry',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacAuthorities',1,'If ON, enables the search authorities link on OPAC',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacbookbag',1,'If ON, enables display of Cart feature','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacBrowser',0,'If ON, enables subject authorities browser on OPAC (needs to set misc/cronjob/sbuild_browser_and_cloud.pl)',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacCloud',0,'If ON, enables subject cloud on OPAC',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaccolorstylesheet','colors.css','Define the color stylesheet to use in the OPAC','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaccredits','','Define HTML Credits at the bottom of the OPAC page','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacSerialDefaultTab', 'subscriptions', 'Define the default tab for serials in OPAC.', 'holdings|serialcollection|subscriptions', 'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacheader','','Add HTML to be included as a custom header in the OPAC','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaclayoutstylesheet','opac.css','Enter the name of the layout CSS stylesheet to use in the OPAC','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMaintenance',0,'If ON, enables maintenance warning in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','A user-defined block of HTML in the main content area of the opac main page','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacTopissue',0,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserjs','','Define custom javascript for inclusion in OPAC','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserlogin',1,'Enable or disable display of user login features',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('patronimages',0,'Enable patron images for the Staff Client',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('printcirculationslips',1,'If ON, enable printing circulation receipts','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RequestOnOpac',1,'If ON, globally enables patron holds on OPAC',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReservesMaxPickUpDelay',7,'Define the Maximum delay to pick up an item on hold','','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnBeforeExpiry',0,'If ON, checkout will be prevented if returndate is after patron card expiry',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('sortbynonfiling',0,'Sort search results by MARC nonfiling characters (deprecated)',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory',';','Define the display preference for serials issue history in OPAC','simplified|full','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog',1,'If ON, enables subscriptions log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('suggestion',1,'If ON, enables patron suggestions feature in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('template','prog','Define the preferred staff interface template','','Themes');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('TemplateEncoding','utf-8','Globally define the default character encoding','iso-8859-1|utf-8','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('timeout',12000000,'Inactivity timeout for cookies authentication (in seconds)',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('TransfersMaxDaysWarning',3,'Define the days before a transfer is suspected of having a problem',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('useDaysMode','Calendar','Choose the method for calculating due date: select Calendar to use the holidays module, and Days to ignore the holidays module','Calendar|Days|Datedue','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('virtualshelves',1,'If ON, enables Lists management','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('z3950AuthorAuthFields','701,702,700','Define the MARC biblio fields for Personal Name Authorities to fill biblio.author',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('z3950NormalizeAuthor',0,'If ON, Personal Name Authorities will replace authors in biblio.author','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReservesNeedReturns',1,'If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DebugLevel',2,'Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','0|1|2','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('NoZebra',1,'If ON, Zebra indexing is turned off, simpler setup, but slower searches. WARNING: using NoZebra on even modest sized collections is very slow.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SessionStorage','mysql','Use database or a temporary file for storing session data','mysql|Pg|tmp','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CircAutocompl',1,'If ON, autocompletion is enabled for the Circulation input',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingSerials',1,'If ON, serials routing is enabled',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SearchMyLibraryFirst',0,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('dontmerge',1,'If ON, modifying an authority record will not update all associated bibliographic records immediately, ask your system administrator to enable the merge_authorities.pl cron job',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BiblioAddsAuthorities',0,'If ON, adding a new biblio will check for an existing authority record and create one on the fly if one doesn\'t exist',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('QueryStemming',1,'If ON, enables query stemming',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('QueryFuzzy',1,'If ON, enables fuzzy option for searches',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('QueryWeightFields',1,'If ON, enables field weighting',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('yuipath','local','Insert the path to YUI libraries, choose local if you use koha offline',"local|http://yui.yahooapis.com/2.5.1/build",'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('canreservefromotherbranches',1,'With Independent branches on, can a user from one library place a hold on an item from another library','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('FRBRizeEditions',0,'If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFRBRizeEditions',0,'If ON, the OPAC will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('XISBN',0,'Use with FRBRizeEditions. If ON, Koha will use the OCLC xISBN web service in the Editions tab on the detail pages. See: http://www.worldcat.org/affiliate/webservices/xisbn/app.jsp','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OCLCAffiliateID','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('XISBNDailyLimit',499,'The xISBN Web service is free for non-commercial use when usage does not exceed 500 requests per day','','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('PINESISBN',0,'Use with FRBRizeEditions. If ON, Koha will use PINES OISBN web service in the Editions tab on the detail pages.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ThingISBN',0,'Use with FRBRizeEditions. If ON, Koha will use the ThingISBN web service in the Editions tab on the detail pages.','','YesNo');
-- I18N/L10N
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('dateformat','us','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy/mm/dd)','metric|us|iso','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaclanguages','en','Set the default language in the OPAC.',NULL,'Languages');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaclanguagesdisplay',0,'If ON, enables display of Change Language feature on OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersTitles','Mr|Mrs|Miss|Ms','Define appropriate Titles for patrons',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('gist',0,'Default Goods and Services tax rate NOT in %, but in numeric form (0.12 for 12%), set to 0 to disable GST','','Integer');
-- need AddressType to distinguish between US and other, telephone numbers, maori stuff, sex, nationality, etc.
-- LDAP ? required fields?
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('emailLibrarianWhenHoldIsPlaced',0,'If ON, emails the librarian whenever a hold is placed',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('holdCancelLength','','Specify how many days before a hold is canceled',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('libraryAddress','','The address to use for printing receipts, overdues, etc. if different than physical address',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines). Requires accruefines cronjob.','off|test|production','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('globalDueDate','','If set, allows a global static due date for all checkouts','10','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ceilingDueDate','','If set, date due will not be past this date. Enter date according to the dateformat System Preference',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACSubscriptionDisplay','economical','Specify how to display subscription information in the OPAC','economical|off|full','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACDisplayExtendedSubInfo',1,'If ON, extended subscription information is displayed in the OPAC',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACURLOpenInNewWindow',0,'If ON, URLs in the OPAC open in a new window',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACUserCSS','','Add CSS to be included in the OPAC in an embedded <style> tag.',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemsResultsDisplay',"statuses",'statuses : show only the status of items in result list. itemdisplay : show full location of items (branch+location+callnumber) as in staff interface',"statuses|itemdetails",'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('uppercasesurnames',0,'If ON, surnames are converted to upper case in patron entry form',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Specify the sort order of Previous Issues on the circulation page',"asc|desc",'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Specify the sort order of Todays Issues on the circulation page',"asc|desc",'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('language','en','Set the default language in the staff client.',NULL,'Languages');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryAutoTruncate',1,'If ON, query truncation is enabled by default',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryRemoveStopwords',0,'If ON, stopwords listed in the Administration area will be removed from queries',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('NoZebraIndexes','\'title\' => \'130a,210a,222a,240a,243a,245a,245b,246a,246b,247a,247b,250a,250b,440a,830a\',\r\n\'author\' => \'100a,100b,100c,100d,110a,111a,111b,111c,111d,245c,700a,710a,711a,800a,810a,811a\',\r\n\'isbn\' => \'020a\',\r\n\'issn\' => \'022a\',\r\n\'lccn\' => \'010a\',\r\n\'biblionumber\' => \'999c\',\r\n\'itemtype\' => \'942c\',\r\n\'publisher\' => \'260b\',\r\n\'date\' => \'260c\',\r\n\'note\' => \'500a, 501a,504a,505a,508a,511a,518a,520a,521a,522a,524a,526a,530a,533a,538a,541a,546a,555a,556a,562a,563a,583a,585a,582a\',\r\n\'subject\' => \'600*,610*,611*,630*,650*,651*,653*,654*,655*,662*,690*\',\r\n\'dewey\' => \'082\',\r\n\'bc\' => \'952p\',\r\n\'callnum\' => \'952o\',\r\n\'an\' => \'6009,6109,6119\',\r\n\'homebranch\' => \'952a,952c\'','Enter a specific hash for NoZebra indexes. Enter : \'indexname\' => \'100a,245a,500*\',\'index2\' => \'...\'','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacRenewalAllowed',0,'If ON, users can renew their issues directly from their OPAC account',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('PatronsPerPage','20','Number of Patrons Per Page displayed by default','20','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranch','holdingbranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','holdingbranch|homebranch','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHighlightedWords','1','If Set, then queried words are higlighted in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:Set','SET,Experimental set\r\nSET:SUBSET,Experimental subset','OAI-PMH exported set, the set name is followed by a comma and a short description, one set by line','30|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:Subset','itemtype=\'BOOK\'','Restrict answer to matching raws of the biblioitems table EXPERIMENTAL',NULL,'Free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo');
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RenewSerialAddsSuggestion','0','If ON, adds a new suggestion at serial subscription renewal',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GoogleJackets','0','if ON, displays jacket covers from Google Books API',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RandomizeHoldsQueueWeight','0','if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('StaticHoldsQueueWeight','0','Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective',NULL,'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoEmailOpacUser','0','Sends notification emails containing new account details to patrons - when account is created.',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoEmailPrimaryAddress','0','Defines the default email address where \'Account Details\' emails are sent.','email|emailpro|B_email|cardnumber|OFF','Choice');
-- Tags and BakerTaylor (note field order differs from above)
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
('BakerTaylorBookstoreURL','','','URL template for \"My Libary Bookstore\" links, to which the \"key\" value is appended, and \"https://\" is prepended. It should include your hostname and \"Parent Number\". Make this variable empty to turn MLB links off. Example: ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&parentNum=10923&key=',''),
('BakerTaylorEnabled','0','','Enable or disable all Baker & Taylor features.','YesNo'),
('BakerTaylorPassword','','','Baker & Taylor Password for Content Cafe (external content)','Free'),
('BakerTaylorUsername','','','Baker & Taylor Username for Content Cafe (external content)','Free'),
('TagsEnabled','1','','Enables or disables all tagging features. This is the main switch for tags.','YesNo'),
('TagsExternalDictionary',NULL,'','Path on server to local ispell executable, used to set $Lingua::Ispell::path This dictionary is used as a \"whitelist\" of pre-allowed tags.',''),
('TagsInputOnDetail','1','','Allow users to input tags from the detail page.', 'YesNo'),
('TagsInputOnList', '0','','Allow users to input tags from the search results list.', 'YesNo'),
('TagsModeration', NULL,'','Require tags from patrons to be approved before becoming visible.','YesNo'),
('TagsShowOnDetail','10','','Number of tags to display on detail page. 0 is off.', 'Integer'),
('TagsShowOnList', '6','','Number of tags to display on search results list. 0 is off.','Integer');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACShelfBrowser','1','','Enable/disable Shelf Browser on item details page. WARNING: this feature is very resource consuming on collections with large numbers of items.','YesNo');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC WARNING: MARC21 Only','YesNo'),
('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC WARNING: MARC21 Only','YesNo');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo');
-- FIXME: add FrameworksLoaded, noOPACUserLogin, ReadingHistory ?
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OrderPdfTemplate','','Uploads a PDF template to use for printing baskets','NULL','Upload');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OPACDisplayRequestPriority','0','','Show patrons the priority level on holds in the OPAC','YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'UseBranchTransferLimits', '0', '', 'If ON, Koha will will use the rules defined in branch_transfer_limits to decide if an item transfer should be allowed.', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldPolicyOverride', '0', 'Allow staff to override hold policies when placing holds',NULL,'YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'BranchTransferLimitsType', 'ccode', 'itemtype|ccode', 'When using branch transfer limits, choose whether to limit by itemtype or collection code.', 'Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsClientCode', '0', 'Client Code for using Syndetics Solutions content','','free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsEnabled', '0', 'Turn on Syndetics Enhanced Content','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsCoverImages', '0', 'Display Cover Images from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsTOC', '0', 'Display Table of Content information from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsSummary', '0', 'Display Summary Information from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsEditions', '0', 'Display Editions from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsExcerpt', '0', 'Display Excerpts and first chapters on OPAC from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsReviews', '0', 'Display Reviews on OPAC from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsAuthorNotes', '0', 'Display Notes about the Author on OPAC from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsAwards', '0', 'Display Awards on OPAC from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsSeries', '0', 'Display Series information on OPAC from Syndetics','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SyndeticsCoverImageSize', 'MC', 'Choose the size of the Syndetics Cover Image to display on the OPAC detail page, MC is Medium, LC is Large','MC|LC','Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonCoverImages', '0', 'Display cover images on OPAC from Amazon Web Services','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonReviews', '0', 'Display Amazon readers reviews on OPAC','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AmazonCoverImages', '0', 'Display Cover Images in Staff Client from Amazon Web Services','','YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'StaffSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the Staff client', 'Integer');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'OPACSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the OPAC', 'Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACShowCheckoutName','0','Displays in the OPAC the name of patron who has checked out the material. WARNING: Most sites should leave this off. It is intended for corporate or special sites which need to track who has the item.','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesID','','See:http://librarything.com/forlibraries/','','free');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesEnabled','0','Enable or Disable Library Thing for Libraries Features','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesTabbedView','0','Put LibraryThingForLibraries Content in Tabs.','','YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'AllowNotForLoanOverride', '0', '', 'If ON, Koha will allow the librarian to loan a not for loan item.', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','date_due|now','Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('viewISBD','1','Allow display of ISBD view of bibiographic records','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('viewLabeledMARC','0','Allow display of labeled MARC view of bibiographic records','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('viewMARC','1','Allow display of MARC view of bibiographic records','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('FilterBeforeOverdueReport','0','Do not run overdue report until filter selected','','YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '<itemcallnumber><copynumber>', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.', 'Textarea');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','See: http://aws.amazon.com. Note that this is required after 2009/08/15 in order to retrieve any enhanced content other than book covers from Amazon.','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','Fine limit above which user cannot renew books via OPAC','','Integer');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'NewItemsDefaultLocation', '', '', 'If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )', '');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'InProcessingToShelvingCart', '0', '', 'If set, when any item with a location code of PROC is ''checked in'', it''s location code will be changed to CART.', 'YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'ReturnToShelvingCart', '0', '', 'If set, when any item is ''checked in'', it''s location code will be changed to CART.', 'YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'DisplayClearScreenButton', '0', '', 'If set to ON, a clear screen button will appear on the circulation page.', 'YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patron''s cardnumber will be shown instead of their name on the holds and catalog screens', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','<li><a href="http://worldcat.org/search?q={TITLE}" target="_blank">Other Libraries (WorldCat)</a></li>\n<li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Other Databases (Google Scholar)</a></li>\n<li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr" target="_blank">Online Stores (Bookfinder.com)</a></li>','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACPatronDetails','1','If OFF the patron details tab in the OPAC is disabled.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','If OFF the patron fines tab in the OPAC is disabled.','','YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowAllMessageDeletion','0','Allow any Library to delete any message','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowPatronImageInWebBasedSelfCheck', '0', 'If ON, displays patron image when a patron uses web-based self-checkout', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableOpacSearchHistory', '1', 'Enable or disable opac search history','', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingListAddReserves','1','If ON the patrons on routing lists are automatically added to holds on the issue.','','YesNo');

View file

@ -0,0 +1 @@
Domyślne ustawienia systemu

View file

@ -0,0 +1,17 @@
INSERT INTO `userflags` VALUES(0,'superlibrarian','Access to all librarian functions',0);
INSERT INTO `userflags` VALUES(1,'circulate','Circulate books',0);
INSERT INTO `userflags` VALUES(2,'catalogue','View Catalog (Librarian Interface)',0);
INSERT INTO `userflags` VALUES(3,'parameters','Set Koha system parameters',0);
INSERT INTO `userflags` VALUES(4,'borrowers','Add or modify borrowers',0);
INSERT INTO `userflags` VALUES(5,'permissions','Set user permissions',0);
INSERT INTO `userflags` VALUES(6,'reserveforothers','Reserve books for patrons',0);
INSERT INTO `userflags` VALUES(7,'borrow','Borrow books',1);
INSERT INTO `userflags` VALUES(9,'editcatalogue','Edit Catalog (Modify bibliographic/holdings data)',0);
INSERT INTO `userflags` VALUES(10,'updatecharges','Update borrower charges',0);
INSERT INTO `userflags` VALUES(11,'acquisition','Acquisition and/or suggestion management',0);
INSERT INTO `userflags` VALUES(12,'management','Set library management parameters',0);
INSERT INTO `userflags` VALUES(13,'tools','Use tools (export, import, barcodes)',0);
INSERT INTO `userflags` VALUES(14,'editauthorities','Allow to edit authorities',0);
INSERT INTO `userflags` VALUES(15,'serials','Allow to manage serials subscriptions',0);
INSERT INTO `userflags` VALUES(16,'reports','Allow to access to the reports module',0);
INSERT INTO `userflags` VALUES(17,'staffaccess','Modify login / permissions for staff users',0);

View file

@ -0,0 +1 @@
Domyślne uprawnienia użytkowników

View file

@ -0,0 +1,36 @@
INSERT INTO permissions (module_bit, code, description) VALUES
( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions'),
( 1, 'override_renewals', 'Override blocked renewals'),
( 9, 'edit_catalogue', 'Edit catalogue'),
( 9, 'fast_cataloging', 'Szybkie katalogowanie'),
(11, 'vendors_manage', 'Zarządzanei dostawcami'),
(11, 'contracts_manage', 'Zarządzanie kontraktami'),
(11, 'period_manage', 'Manage periods'),
(11, 'budget_manage', 'Manage budgets'),
(11, 'budget_modify', 'Modify budget (can''t create lines, but can modify existing ones)'),
(11, 'planning_manage', 'Manage budget plannings'),
(11, 'order_manage', 'Manage orders & basket'),
(11, 'group_manage', 'Manage orders & basketgroups'),
(11, 'order_receive', 'Manage orders & basket'),
(11, 'budget_add_del', 'Add and delete budgets (but cant modify budgets)'),
(13, 'edit_news', 'RTworzeniei publikowanie wiadomości w interfejsie bibliotekarza i OPAC'),
(13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
(13, 'edit_calendar', 'Define days when the library is closed'),
(13, 'moderate_comments', 'Moderate patron comments'),
(13, 'edit_notices', 'Define notices'),
(13, 'edit_notice_status_triggers', 'Set notice/status triggers for overdue items'),
(13, 'view_system_logs', 'Przeglądanie logów systemowych'),
(13, 'inventory', 'Perform inventory (stocktaking) of your catalog'),
(13, 'stage_marc_import', 'Stage MARC records into the reservoir'),
(13, 'manage_staged_marc', 'Managed staged MARC records, including completing and reversing imports'),
(13, 'export_catalog', 'Export bibliographic and holdings data'),
(13, 'import_patrons', 'Import patron data'),
(13, 'delete_anonymize_patrons', 'Delete old borrowers and anonymize circulation history (deletes borrower reading history)'),
(13, 'batch_upload_patron_images', 'Upload patron images in batch or one at a time'),
(13, 'schedule_tasks', 'Schedule tasks to run'),
(13, 'batchmod', 'Perform batch modification of items'),
(13, 'batchdel', 'Perform batch deletion of items'),
(13, 'manage_csv_profiles', 'Manage CSV export profiles'),
(16, 'execute_reports', 'Execute SQL reports'),
(16, 'create_reports', 'Create SQL Reports')
;

View file

@ -0,0 +1 @@
Szczegółowe uprawnienia personelu

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
Standardowe typy haseł przedmiotowych MARC21:
Personal Name
Corporate Name
Meeting Name
Uniform Title
Chronological Term
Topical Term
Geographic Name
Genre/Form Term

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
Domyślny szablon rekordu bibliograficznego MARC21.

View file

@ -0,0 +1,38 @@
--
-- Default MARC matching rules for Koha
--
-- Copyright (C) 2007 LiblimeA
--
-- This file is part of Koha.
--
-- Koha 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.
--
-- Koha 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.
--
-- You should have received a copy of the GNU General Public License along with
-- Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-- Suite 330, Boston, MA 02111-1307 USA
INSERT INTO marc_matchers (code, description, record_type, threshold)
VALUES ('ISBN', '020$a', 'biblio', 1000);
INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields)
SELECT MAX(matchpoint_id), 1, '020', 'a' FROM matchpoints;
INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine)
SELECT MAX(matchpoint_component_id), 1, 'ISBN' FROM matchpoint_components;
INSERT INTO marc_matchers (code, description, record_type, threshold)
VALUES ('ISSN', '022$a', 'biblio', 1000);
INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields)
SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine)
SELECT MAX(matchpoint_component_id), 1, 'ISSN' FROM matchpoint_components;

View file

@ -0,0 +1,4 @@
Wybrane reguły dopasowania dla rekordu bibliograficznego MARC 21:
ISBN
ISSN

View file

@ -0,0 +1,138 @@
INSERT IGNORE INTO biblio_framework VALUES ( 'FA','Fast Add Framework' );
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
('000', 'LEADER', 'LEADER', 0, 1, '', 'FA'),
('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'FA'),
('010', 'LIBRARY OF CONGRESS CONTROL NUMBER', 'LIBRARY OF CONGRESS CONTROL NUMBER', 0, 0, '', 'FA'),
('020', 'INTERNATIONAL STANDARD BOOK NUMBER', 'INTERNATIONAL STANDARD BOOK NUMBER', 1, 0, NULL, 'FA'),
('022', 'INTERNATIONAL STANDARD SERIAL NUMBER', 'INTERNATIONAL STANDARD SERIAL NUMBER', 1, 0, NULL, 'FA'),
('050', 'LIBRARY OF CONGRESS CALL NUMBER', 'LIBRARY OF CONGRESS CALL NUMBER', 1, 0, NULL, 'FA'),
('090', 'LOCALLY ASSIGNED LC-TYPE CALL NUMBER', 'LOCALLY ASSIGNED LC-TYPE CALL NUMBER', 1, 0, '', 'FA'),
('099', 'LOCAL FREE-TEXT CALL NUMBER', 'LOCAL FREE-TEXT CALL NUMBER', 1, 0, '', 'FA'),
('100', 'MAIN ENTRY--PERSONAL NAME', 'MAIN ENTRY--PERSONAL NAME', 0, 0, NULL, 'FA'),
('245', 'TITLE STATEMENT', 'TITLE STATEMENT', 0, 1, '', 'FA'),
('250', 'EDITION STATEMENT', 'EDITION STATEMENT', 0, 0, NULL, 'FA'),
('260', 'PUBLICATION, DISTRIBUTION, ETC. (IMPRINT)', 'PUBLICATION, DISTRIBUTION, ETC. (IMPRINT)', 1, 0, NULL, 'FA'),
('300', 'PHYSICAL DESCRIPTION', 'PHYSICAL DESCRIPTION', 1, 0, NULL, 'FA'),
('500', 'GENERAL NOTE', 'GENERAL NOTE', 1, 0, NULL, 'FA'),
('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'FA'),
('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'FA'),
('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'FA');
INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
('000','@','fixed length control field','fixed length control field',0,1,'',0,'','','marc21_leader.pl',NULL,0,'FA','',NULL,NULL),
('008','@','fixed length control field','fixed length control field',0,1,'',0,'','','marc21_field_008.pl',NULL,0,'FA','',NULL,NULL),
('010','8','Field link and sequence number','Field link and sequence number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('010','a','LC control number','LC control number',0,0,'biblioitems.lccn',0,'','','',0,0,'FA',NULL,'',''),
('010','b','NUCMC control number','NUCMC control number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('010','z','Canceled/invalid LC control number','Canceled/invalid LC control number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('020','6','Linkage','Linkage',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('020','8','Field link and sequence number','Field link and sequence number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('020','a','International Standard Book Number','International Standard Book Number',0,0,'biblioitems.isbn',0,'','','',0,0,'FA',NULL,'',''),
('020','c','Terms of availability','Terms of availability',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('020','z','Cancelled/invalid ISBN','Cancelled/invalid ISBN',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('050', 'a', 'Classification number', 'Classification number', 1, 0, '', 0, '', '', '', 0, 0, 'FA', '', '', NULL),
('050', 'b', 'Item number', 'Item number', 0, 0, '', 0, '', '', '', 0, 0, 'FA', '', '', NULL),
('082','2','Edition number','Edition number',0,0,'',0,'','','',NULL,0,'FA','',NULL,NULL),
('082','6','Linkage','Linkage',0,0,'',0,'','','',NULL,0,'FA','',NULL,NULL),
('082','8','Field link and sequence number','Field link and sequence number',1,0,'',0,'','','',NULL,0,'FA','',NULL,NULL),
('082','a','Classification number','Classification number',1,0,'',0,'','','',NULL,0,'FA','',NULL,NULL),
('082','b','Item number','Item number',0,0,'',0,'','','',NULL,0,'FA','',NULL,NULL),
('090', 'a', 'Local Classification number (NR)', 'Local Classification number (NR)', 1, 0, '', 0, '', '', '', 0, 5, 'FA', '', '', NULL),
('090', 'b', 'Local cutter number', 'Local cutter number', 0, 0, '', 0, '', '','', 0, 5, 'FA', '', '', NULL),
('100','4','Relator code','Relator code',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','6','Linkage','Linkage',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','8','Field link and sequence number','Field link and sequence number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','9','9 (RLIN)','9 (RLIN)',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','a','Personal name','Personal name',0,0,'biblio.author',0,'','PERSO_NAME','',0,0,'FA',NULL,'',''),
('100','b','Numeration','Numeration',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','c','Titles and other words associated with a name','Titles and other words associated with a name',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','d','Dates associated with a name','Dates associated with a name',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','e','Relator term','Relator term',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','f','Date of a work','Date of a work',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','g','Miscellaneous information','Miscellaneous information',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','j','Attribution qualifier','Attribution qualifier',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','k','Form subheading','Form subheading',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','l','Language of a work','Language of a work',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','n','Number of part/section of a work','Number of part/section of a work',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','p','Name of part/section of a work','Name of part/section of a work',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','q','Fuller form of name','Fuller form of name',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','t','Title of a work','Title of a work',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('100','u','Affiliation','Affiliation',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','6','Linkage','Linkage',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','8','Field link and sequence number','Field link and sequence number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','a','Title','Title',0,1,'biblio.title',0,'','','',0,0,'FA',NULL,'',''),
('245','b','Remainder of title','Remainder of title',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','c','Statement of responsibility, etc','Statement of responsibility, etc',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','d','Designation of section/part/series (SE) [OBSOLETE]','Designation of section section/part/series: (SE) [OBSOLETE]',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','e','Name of part/section/series (SE) [OBSOLETE]','Name of part/section/series (SE) [OBSOLETE]',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','f','Inclusive dates','Inclusive dates',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','g','Bulk dates','Bulk dates',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','h','Medium','Medium',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','k','Form','Form',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','n','Number of part/section of a work','Number of part/section of a work',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','p','Name of part/section of a work','Name of part/section of a work',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('245','s','Version','Version',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('250','6','Linkage','Linkage',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('250','8','Field link and sequence number','Field link and sequence number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('250','a','Edition statement','Edition statement',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('250','b','Remainder of edition statement','Remainder of edition statement',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('260','6','Linkage','Linkage',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('260','8','Field link and sequence number','Field link and sequence number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('260','a','Place of publication, distribution, etc','Place of publication, distribution, etc',1,0,'biblioitems.place',0,'','','',0,0,'FA',NULL,'',''),
('260','b','Name of publisher, distributor, etc','Name of publisher, distributor, etc',1,0,'biblioitems.publishercode',0,'','','',0,0,'FA',NULL,'',''),
('260','c','Date of publication, distribution, etc','Date of publication, distribution, etc',1,0,'biblio.copyrightdate',0,'','','',0,0,'FA',NULL,'',''),
('260','d','Plate or publisher\'s number for music (Pre-AACR 2) [OBSOLETE, CAN/MARC], [LOCAL,','Plate or publisher\'s number for music (Pre-AACR 2) [OBSOLETE, CAN/MARC], [LOCAL,',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('260','e','Place of manufacture','Place of manufacture',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('260','f','Manufacturer','Manufacturer',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('260','g','Date of manufacture','Date of manufacture',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('260','k','Identification/manufacturer number [OBSOLETE, CAN/MARC]','Identification/manufacturer number [OBSOLETE, CAN/MARC]',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('260','l','Matrix and/or take number [OBSOLETE, CAN/MARC]','Matrix and/or take number [OBSOLETE, CAN/MARC]',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('500','3','Materials specified','Materials specified',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('500','5','Institution to which field applies','Institution to which field applies',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('500','6','Linkage','Linkage',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('500','8','Field link and sequence number','Field link and sequence number',1,0,'',0,'','','',0,0,'FA',NULL,'',''),
('500','a','General note','General note',0,0,'biblio.notes',0,'','','',0,0,'FA',NULL,'',''),
('500','l','Library of Congress call number (SE) [OBSOLETE]','Library of Congress call number (SE) [OBSOLETE]',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('500','n','n (RLIN) [OBSOLETE]','n (RLIN) [OBSOLETE]',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('500','x','International Standard Serial Number (SE) [OBSOLETE]','International Standard Serial Number (SE) [OBSOLETE]',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('500','z','Source of note information (AM SE) [OBSOLETE]','Source of note information (AM SE) [OBSOLETE]',0,0,'',0,'','','',0,0,'FA',NULL,'',''),
('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, 5, 'FA', '', '', NULL),
('942', 'c', 'Koha [default] item type', 'Koha item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 5, 'FA', '', '', NULL),
('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, NULL, 9, '', '', '', 0, 5, 'FA', '', '', NULL),
('942', 's', 'Serial record flag', 'Serial record', 0, 0, 'biblio.serial', 9, '', '', '', NULL, 5, 'FA', '', '', NULL),
('952','0','Withdrawn status','Withdrawn status',0,0,'items.wthdrawn',10,'WITHDRAWN','','',NULL,0,'FA','',NULL,NULL),
('952','1','Lost status','Lost status',0,0,'items.itemlost',10,'LOST','','',NULL,0,'FA','',NULL,NULL),
('952','2','Source of classification or shelving scheme','Source of classification or shelving scheme',0,0,'items.cn_source',10,'cn_source','','',NULL,0,'FA','',NULL,NULL),
('952','3','Materials specified (bound volume or other part)','Materials specified (bound volume or other part)',0,0,'items.materials',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','4','Damaged status','Damaged status',0,0,'items.damaged',10,'DAMAGED','','',NULL,0,'FA','',NULL,NULL),
('952','5','Use restrictions','Use restrictions',0,0,'items.restricted',10,'RESTRICTED','','',NULL,0,'FA','',NULL,NULL),
('952','6','Koha normalized classification for sorting','Koha normalized classification for sorting',0,0,'items.cn_sort',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','7','Not for loan','Not for loan',0,0,'items.notforloan',10,'NOT_LOAN','','',NULL,0,'FA','',NULL,NULL),
('952','8','Koha collection','Koha collection',0,0,'items.ccode',10,'CCODE','','',NULL,0,'FA','',NULL,NULL),
('952','9','Koha itemnumber (autogenerated)','Koha itemnumber',0,0,'items.itemnumber',-1,'','','',NULL,0,'FA','',NULL,NULL),
('952','a','Location (home branch)','Location (home branch)',0,0,'items.homebranch',10,'branches','','',NULL,0,'FA','',NULL,NULL),
('952','b','Sublocation or collection (holding branch)','Sublocation or collection (holding branch)',0,0,'items.holdingbranch',10,'branches','','',NULL,0,'FA','',NULL,NULL),
('952','c','Shelving location','Shelving location',0,0,'items.location',10,'LOC','','',NULL,0,'FA','',NULL,NULL),
('952','d','Date acquired','Date acquired',0,0,'items.dateaccessioned',10,'','','dateaccessioned.pl',NULL,0,'FA','',NULL,NULL),
('952','e','Source of acquisition','Source of acquisition',0,0,'items.booksellerid',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','f','Coded location qualifier','Coded location qualifier',0,0,'items.coded_location_qualifier',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','g','Cost, normal purchase price','Cost, normal purchase price',0,0,'items.price',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','h','Serial Enumeration / chronology','Serial Enumeration / chronology',0,0,'items.enumchron',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','j','Shelving control number','Shelving control number',0,0,'items.stack',10,'STACK','','',NULL,0,'FA','',NULL,NULL),
('952','l','Koha issues (times borrowed)','Koha issues (times borrowed)',0,0,'items.issues',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','m','Koha renewals','Koha renewals',0,0,'items.renewals',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','n','Koha reserves (requests)','Koha reserves (requests)',0,0,'items.reserves',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','o','Koha full call number','Koha full call number',0,0,'items.itemcallnumber',10,'','',NULL,NULL,0,'FA','',NULL,NULL),
('952','p','Piece designation (barcode)','Piece designation (barcode)',0,0,'items.barcode',10,'','','barcode.pl',NULL,0,'FA','',NULL,NULL),
('952','q','Koha out on loan','Koha out on loan',0,0,'items.onloan',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','r','Koha date last seen','Koha date last seen',0,0,'items.datelastseen',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','s','Koha date last borrowed','Koha date last borrowed',0,0,'items.datelastborrowed',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','t','Copy number','Copy number',0,0,'items.copynumber',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','u','Uniform Resource Identifier','Uniform Resource Identifier',0,0,'items.uri',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','v','Cost, replacement price','Cost, replacement price',0,0,'items.replacementprice',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','w','Price effective from','Price effective from',0,0,'items.replacementpricedate',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','x','Nonpublic note (lost item payment)','Nonpublic note (lost item payment)',1,0,'items.paidfor',10,'','','',NULL,0,'FA','',NULL,NULL),
('952','y','Koha item type','Koha item type',0,0,'items.itype',10,'itemtypes','','',NULL,0,'FA','',NULL,NULL),
('952','z','Public note','Public note',0,0,'items.itemnotes',10,'','','',NULL,0,'FA','',NULL,NULL),
('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'FA', '', '', NULL),
('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'FA', '', '', NULL);

View file

@ -0,0 +1 @@
"Opis skrócony" minimalny szablon MARC21 przydatny w wypożyczeniach międzybibliotecznych i przy szybkim katalogowaniu.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
Simple MARC 21 bibliographic frameworks for some common types of bibliographic material. Frameworks are used to define the structure of your MARC records and the behavior of the integrated MARC editor. You can change these at any time after installation. The frameworks in this optional default setting include:
BKS Wydawnictwa zwarte
CF CD-ROM, DVD-ROM, Zasoby online
SR Kasety i płyty audio
VR DVD, VHS
AR Modele
KT Materiały mieszane
IR Segregatory
SER Wydawnictwa ciągłe

View file

@ -0,0 +1,823 @@
-- ***********************************************************************
-- KOHA 3.0 STANDARD DEFAULT UNIMARC AUTHORITY FRAMEWORK
--
-- Pretest Version 0.0.1
-- 2007-11-05
--
-- edited
-- with much more work remaining
-- (PLEASE SEE WARNING BELOW)
-- by thd
--
-- originally compiled
-- by Roberto Sturman
--
-- from
--
-- UNIMARC authorities : concise version / IFLA Universal Bibliographic
-- Control and International MARC Core Programme (UBCIM). - 1997. -
-- http://www.ifla.org/VI/3/p1996-1/ucaf.htm .
-- 2006-03-15 a.
-- ***********************************************************************
-- ****************************************************************************
-- WARNING
-- RISK OF DATA LOSS
--
-- Modestly corrected and augmented. Missing many elements. The work of the
-- original compiler had been done before significant improvements to Koha
-- MARC frameworks implementation had been introduced in 2006 for displaying,
-- editing, and preserving record data.
--
-- Completely unsafe for production use without significant correction and
-- augmentation. These problems could be fixed but a few days work would be
-- required to fix them completely. -- thd.
-- ****************************************************************************
-- ******************************************************
-- KOHA DEFAULT UNIMARC AUTHORITY TYPE.
-- ******************************************************
INSERT INTO `auth_types` (`authtypecode`, `authtypetext`, `auth_tag_to_report`, `summary`) VALUES
('', 'Default', '', '');
-- *****************************************************************
-- UNIMARC AUTHORITY FIELDS/SUBFIELDS AND COMMMONLY USED EXTENSIONS.
-- *****************************************************************
INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`) VALUES
('', '000', 'Record Label', 'Record Label', 0, 1, NULL),
('', '001', 'Record Identifier', 'Record Identifier', 0, 1, ''),
('', '005', 'Version Identifier', 'Version Identifier', 0, 0, ''),
('', '015', 'International Standard Authority Data Number (ISADN)', 'International Standard Authority Data Number (ISADN)', 0, 0, ''),
('', '035', 'Other System Control Number', 'Other System Control Number', 0, 0, ''),
('', '100', 'General Processing Data', 'General Processing Data', 0, 1, ''),
('', '101', 'Language of the Entity', 'Language of the Entity', 0, 0, ''),
('', '102', 'Nationality of the Entity', 'Nationality of the Entity', 0, 0, ''),
('', '106', 'Coded Data Field: Personal/Coroprate/Family Name/Trademark Used as Subject Heading', 'Coded Data Field: Personal/Coroprate/Family Name/Trademark Used as Subject Heading', 0, 0, ''),
('', '120', 'Coded Data Field: Personal Name', 'Coded Data Field: Personal Name', 0, 0, ''),
('', '123', 'Coded Data Field: Territorial or Geographical Name', 'Coded Data Field: Territorial or Geographical Name', 1, 0, ''),
('', '150', 'Coded Data Field: Corporate Name', 'Coded Data Field: Corporate Name', 0, 0, ''),
('', '152', 'Rules', 'Rules', 0, 0, ''),
('', '154', 'Coded Data Field: Uniform Titles', 'Coded Data Field: Uniform Titles', 0, 0, ''),
('', '160', 'Geographic Area Code', 'Geographic Area Code', 0, 0, ''),
('', '200', 'Heading - Personal Name', 'Heading - Personal Name', 1, 0, ''),
('', '210', 'Heading - Corporate Body Name', 'Heading - Corporate Body Name', 1, 0, ''),
('', '215', 'Heading - Territorial or Geographical Name', 'Heading - Territorial or Geographical Name', 1, 0, ''),
('', '216', 'Heading - Trademark', 'Heading - Trademark', 1, 0, ''),
('', '220', 'Heading - Family Name', 'Heading - Family Name', 1, 0, ''),
('', '230', 'Heading - Uniform Title', 'Heading - Uniform Title', 1, 0, ''),
('', '235', 'Heading - Collective Uniform Title', 'Heading - Collective Uniform Title', 0, 0, ''),
('', '240', 'Heading - Name/Title', 'Heading - Name/Title', 1, 0, ''),
('', '245', 'Heading - Name/Collective Uniform Title', 'Heading - Name/Collective Uniform Title', 0, 0, ''),
('', '250', 'Heading - Topical Subject', 'Heading - Topical Subject', 1, 0, ''),
('', '260', 'Heading - Place Access', 'Heading - Place Access', 1, 0, ''),
('', '280', 'Heading - Form, Genre or Physical Characteristics', 'Heading - Form, Genre or Physical Characteristics', 0, 0, ''),
('', '300', 'Information Note', 'Information Note', 1, 0, ''),
('', '305', 'Textual See Also Reference Note', 'Textual See Also Reference Note', 1, 0, ''),
('', '310', 'Textual See Reference Note', 'Textual See Reference Note', 1, 0, ''),
('', '320', 'General Explanatory Reference Note', 'General Explanatory Reference Note', 1, 0, ''),
('', '330', 'General Scope Note', 'General Scope Note', 1, 0, ''),
('', '340', 'Biography and Activity Note', 'Biography and Activity Note', 1, 0, ''),
('', '356', 'Geographical Note', 'Geographical Note', 0, 0, ''),
('', '400', 'See Reference Tracing - Personal Name', 'See Reference Tracing - Personal Name', 0, 0, ''),
('', '410', 'See Reference Tracing - Corporate Body Name', 'See Reference Tracing - Corporate Body Name', 1, 0, ''),
('', '415', 'See Reference Tracing - Territorial or Geographical Name', 'See Reference Tracing - Territorial or Geographical Name', 0, 0, ''),
('', '416', 'See Reference Tracing - Trademark', 'See Reference Tracing - Trademark', 1, 0, ''),
('', '420', 'See Reference Tracing - Family Name', 'See Reference Tracing - Family Name', 1, 0, ''),
('', '430', 'See Reference Tracing - Uniform Title', 'See Reference Tracing - Uniform Title', 1, 0, ''),
('', '440', 'See Reference Tracing - Name/Title', 'See Reference Tracing - Name/Title', 0, 0, ''),
('', '445', 'See Reference Tracing - Name/Collective Uniform Title', 'See Reference Tracing - Name/Collective Uniform Title', 1, 0, ''),
('', '450', 'See Reference Tracing - Topical Subject', 'See Reference Tracing - Topical Subject', 1, 0, ''),
('', '460', 'See Reference Tracing - Place Access', 'See Reference Tracing - Place Access', 1, 0, ''),
('', '480', 'See Reference Tracing - Form Genre or Physical Characteristics', 'See Reference Tracing - Form Genre or Physical Characteristics', 0, 0, ''),
('', '500', 'See Also Reference Tracing - Personal Name', 'See Also Reference Tracing - Personal Name', 1, 0, ''),
('', '510', 'See Also Reference Tracing - Corporate Body Name', 'See Also Reference Tracing - Corporate Body Name', 1, 0, ''),
('', '515', 'See Also Reference Tracing - Territorial or Geographical Name', 'See Also Reference Tracing - Territorial or Geographical Name', 1, 0, ''),
('', '516', 'See Also Reference Tracing - Trademark', 'See Also Reference Tracing - Trademark', 1, 0, ''),
('', '520', 'See Also Reference Tracing - Family Name', 'See Also Reference Tracing - Family Name', 1, 0, ''),
('', '530', 'See Also Reference Tracing - Uniform Title', 'See Also Reference Tracing - Uniform Title', 1, 0, ''),
('', '540', 'See Also Reference Tracing - Name/Title', 'See Also Reference Tracing - Name/Title', 1, 0, ''),
('', '545', 'See Also Reference Tracing - Name/Collective Uniform Title', 'See Also Reference Tracing - Name/Collective Uniform Title', 1, 0, ''),
('', '550', 'See Also Reference Tracing - Topical Subject', 'See Also Reference Tracing - Topical Subject', 1, 0, ''),
('', '560', 'See Also Reference Tracing - Place Access', 'See Also Reference Tracing - Place Access', 1, 0, ''),
('', '580', 'See Also Reference Tracing - Form, Genre or Physical Characteristics', 'See Also Reference Tracing - Form, Genre or Physical Characteristics', 1, 0, ''),
('', '675', 'Universal Decimal Classification (UDC)', 'Universal Decimal Classification (UDC)', 1, 0, ''),
('', '676', 'Dewey Decimal Classification (DDC)', 'Dewey Decimal Classification (DDC)', 1, 0, ''),
('', '680', 'Library of Congress Classification (LCC)', 'Library of Congress Classification (LCC)', 1, 0, ''),
('', '686', 'Other Classification Numbers', 'Other Classification Numbers', 1, 0, ''),
('', '700', 'Linking Heading - Personal Name', 'Linking Heading - Personal Name', 1, 0, ''),
('', '710', 'Linking Heading - Corporate Body Name', 'Linking Heading - Corporate Body Name', 1, 0, ''),
('', '715', 'Linking Heading - Territorial or Geographical Name', 'Linking Heading - Territorial or Geographical Name', 1, 0, ''),
('', '716', 'Linking Heading - Trademark', 'Linking Heading - Trademark', 1, 0, ''),
('', '720', 'Linking Heading - Family Name', 'Linking Heading - Family Name', 1, 0, ''),
('', '730', 'Linking Heading - Uniform Title', 'Linking Heading - Uniform Title', 1, 0, ''),
('', '740', 'Linking Heading - Name/title', 'Linking Heading - Name/title', 1, 0, ''),
('', '745', 'Linking Heading - Name/Collective Uniform Title', 'Linking Heading - Name/Collective Uniform Title', 1, 0, ''),
('', '750', 'Linking Heading - Topical Subject', 'Linking Heading - Topical Subject', 1, 0, ''),
('', '760', 'Linking Heading - Place Access', 'Linking Heading - Place Access', 1, 0, ''),
('', '780', 'Linking Heading - Form, Genre or Physical Characteristics', 'Linking Heading - Form, Genre or Physical Characteristics', 1, 0, ''),
('', '801', 'Originating Source', 'Originating Source', 0, 0, ''),
('', '810', 'Source Data Found', 'Source Data Found', 1, 0, ''),
('', '815', 'Source Data Not Found', 'Source Data Not Found', 0, 0, ''),
('', '820', 'Usage or Scope Information', 'Usage or Scope Information', 1, 0, ''),
('', '825', 'Example Under Note', 'Example Under Note', 1, 0, ''),
('', '830', 'General Cataloguer&#039s Note', 'General Cataloguer&#039s Note', 1, 0, ''),
('', '835', 'Deleted Heading Information', 'Deleted Heading Information', 1, 0, ''),
('', '836', 'Replaced Heading Information', 'Replaced Heading Information', 1, 0, ''),
('', '856', 'Electronic Location and Access', 'Electronic Location and Access', 1, 0, ''),
('', '886', 'Data Not Connected From Source Format', 'Data Not Connected From Source Format', 1, 0, '');
INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES
('', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, NULL, NULL, 0, 0, '', '', ''),
('', '001', '@', 'control field', 'control field', 0, 1, 0, '', '', '', 0, 0, '', '', ''),
('', '005', '@', 'control field', 'control field', 0, 0, 0, '', '', '', 0, 0, '', '', ''),
('', '015', '@', 'ISADN', 'ISADN', 0, 0, 0, '', '', '', 0, 0, '', '', ''),
('', '035', 'a', 'System Control Number', 'System Control Number', 0, 0, 0, '', '', '', 0, -5, '', '', ''),
('', '035', 'z', 'Cancelled or invalid control number', 'Cancelled or invalid control number', 1, 0, 0, '', '', '', 0, -5, '', '', ''),
('', '100', 'a', 'General Processing Data', 'General Processing Data', 0, 1, 1, '', '', '', 0, -5, '', '', ''),
('', '101', 'a', 'Language used by the Entity', 'Language used by the Entity', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '102', 'a', 'Country of Nationality', 'Country of Nationality', 1, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '102', 'b', 'Locality', 'Locality', 1, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '106', 'a', 'One Character Code', 'One Character Code', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '120', 'a', 'Coded data: personal names', 'Coded data: personal names', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '123', 'd', 'Co-ordinates: Westernmost Longitude', 'Co-ordinates: Westernmost Longitude', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '123', 'e', 'Co-ordinates: Easternmost Longitude', 'Co-ordinates: Easternmost Longitude', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '123', 'f', 'Co-ordinates: Nothernmost Latitude', 'Co-ordinates: Nothernmost Latitude', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '123', 'g', 'Co-ordinates: Southernmost Latitude', 'Co-ordinates: Southernmost Latitude', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '150', 'a', 'Name Processing Data', 'Name Processing Data', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '152', 'a', 'Cataloguing Rules', 'Cataloguing Rules', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '152', 'b', 'Subject System', 'Subject System', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '154', 'a', 'Title Processing Data', 'Title Processing Data', 0, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '160', 'a', 'Geographic Area Code', 'Geographic Area Code', 1, 0, 1, '', '', '', 0, -5, '', '', ''),
('', '200', '4', 'Relator Code', 'Relator Code', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', '7', 'Script', 'Script', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', '8', 'Language of Cataloguing', 'Language of Cataloguing', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'b', 'Part of Name Other than Entry Element', 'Part of Name Other than Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'c', 'Additions to Name Other than Dates', 'Additions to Name Other than Dates', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'd', 'Roman Numerals', 'Roman Numerals', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'f', 'Dates', 'Dates', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'g', 'Expansion of Initials of Forename', 'Expansion of Initials of Forename', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '200', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', '4', 'Relator Code', 'Relator Code', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', '7', 'Script', 'Script', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', '8', 'Language of Cataloguing', 'Language of Cataloguing', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'b', 'Subdivision', 'Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'c', 'Additions to Name or Qualifier', 'Additions to Name or Qualifier', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'd', 'Number of Meeting', 'Number of Meeting', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'e', 'Location of Meeting', 'Location of Meeting', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'f', 'Date of Meeting', 'Date of Meeting', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'g', 'Inverted Element', 'Inverted Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'h', 'Part of Name Other than Entry Element and Inverted Element', 'Part of Name Other than Entry Element and Inverted Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'j', 'Form Subdivision', 'Form Subdivision', 0, 0, 2, '', NULL, '', 0, 0, '', '', ''),
('', '210', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '210', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '215', '7', 'Script', 'Script', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '215', '8', 'Language of Cataloguing', 'Language of Cataloguing', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '215', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '215', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '215', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '215', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '215', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', '7', 'Script', 'Script', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', 'c', 'Qualification', 'Qualification', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', 'f', 'Dates', 'Dates', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '216', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', '4', 'Relator Code', 'Relator Code', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', 'f', 'Dates', 'Dates', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '220', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', '7', 'Script', 'Script', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', '8', 'Language of Cataloguing', 'Language of Cataloguing', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'b', 'General Material Designation', 'General Material Designation', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'h', 'Number of Section or Part', 'Number of Section or Part', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'i', 'Name of Section or Part', 'Name of Section or Part', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'k', 'Date of Publication', 'Date of Publication', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'l', 'Form Subheading', 'Form Subheading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'm', 'Language (when Part of Heading)', 'Language (when Part of Heading)', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'n', 'Miscellaneous Information', 'Miscellaneous Information', 0, 0, 2, '', NULL, '', 0, 0, '', '', ''),
('', '230', 'q', 'Version (or Date of Version)', 'Version (or Date of Version)', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'r', 'Medium of Performance (for Music)', 'Medium of Performance (for Music)', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 's', 'Numeric Designation (for Music)', 'Numeric Designation (for Music)', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'u', 'Key (for Music)', 'Key (for Music)', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'w', 'Arranged Statement (for Music)', 'Arranged Statement (for Music)', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '230', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'a', 'Collective Uniform Title', 'Collective Uniform Title', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'b', 'General Material Designation', 'General Material Designation', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'e', 'Collective Uniform Subtitle', 'Collective Uniform Subtitle', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'k', 'Date of Publication', 'Date of Publication', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'm', 'Language (when Part of Heading)', 'Language (when Part of Heading)', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'r', 'Medium of Performance (for Music)', 'Medium of Performance (for Music)', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 's', 'Numeric Designation (for Music)', 'Numeric Designation (for Music)', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'u', 'Key (for Music)', 'Key (for Music)', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'w', 'Arranged Statement (for Music)', 'Arranged Statement (for Music)', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '235', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '240', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '240', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '240', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '240', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '240', 't', 'Title', 'Title', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '240', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '240', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '240', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '245', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '245', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '245', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '245', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '245', 't', 'Title', 'Title', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '245', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '245', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '245', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '250', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '250', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '250', 'a', 'Topical Subject', 'Topical Subject', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '250', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '250', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '250', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '250', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '260', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '260', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '260', 'a', 'Country', 'Country', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '260', 'b', 'State or Province, etc.', 'State or Province, etc.', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '260', 'c', 'County', 'County', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '260', 'd', 'City', 'City', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '280', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '280', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '280', 'a', 'Entry Element', 'Entry Element', 0, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '280', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '280', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '280', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '280', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 2, '', '', '', 0, 0, '', '', ''),
('', '300', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '300', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '300', 'a', 'Information Note', 'Information Note', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '305', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '305', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '305', 'a', 'Instruction Phrase', 'Instruction Phrase', 1, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '305', 'b', 'Heading Referred', 'Heading Referred', 1, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '310', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '310', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '310', 'a', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '310', 'b', 'Heading Referred', 'Heading Referred', 1, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '320', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '320', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 3, '', NULL, '', 0, 0, '', '', ''),
('', '320', 'a', 'General Explanatory Reference Note', 'General Explanatory Reference Note', 1, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '330', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '330', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '330', 'a', 'General Scope Note', 'General Scope Note', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '340', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '340', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '340', 'a', 'Biographical or Activity Note', 'Biographical or Activity Note', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '356', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '356', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '356', 'a', 'Geographical Note', 'Geographical Note', 0, 0, 3, '', '', '', 0, -5, '', '', ''),
('', '400', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', '4', 'Relator Code', 'Relator Code', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'b', 'Part of Name Other than Entry Element', 'Part of Name Other than Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'c', 'Additions to Name Other than Dates', 'Additions to Name Other than Dates', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'd', 'Roman Numerals', 'Roman Numerals', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'f', 'Dates', 'Dates', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'g', 'Expansion of Initials of Forename', 'Expansion of Initials of Forename', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '400', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', '2', 'sub', 'sub', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', '4', 'Relator Code', 'Relator Code', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', '7', 'scr', 'scr', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'b', 'Subdivision', 'Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'c', 'Additions to Name or Qualifier', 'Additions to Name or Qualifier', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'd', 'Number of Meeting and/or Part of Meeting', 'Number of Meeting and/or Part of Meeting', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'e', 'Location of Meeting', 'Location of Meeting', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'f', 'Date of Meeting', 'Date of Meeting', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'g', 'Inverted Element', 'Inverted Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'h', 'Part of Name Other than Entry Element and Inverted Element', 'Part of Name Other than Entry Element and Inverted Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '410', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '415', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', 'c', 'Qualification', 'Qualification', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', 'f', 'Dates', 'Dates', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '416', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', '4', 'Relator Code', 'Relator Code', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', NULL, '', 0, 0, '', '', ''),
('', '420', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', 'f', 'Dates', 'Dates', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '420', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'b', 'General Material Designation', 'General Material Designation', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'h', 'Number of Section or Part', 'Number of Section or Part', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'i', 'Name of Section or Part', 'Name of Section or Part', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'k', 'Date of Publication', 'Date of Publication', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'l', 'Form Subheading', 'Form Subheading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'm', 'Language (when Part of Heading)', 'Language (when Part of Heading)', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'n', 'Miscellaneous Information', 'Miscellaneous Information', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'q', 'Version (or Date of Version)', 'Version (or Date of Version)', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'r', 'Medium of Performance (for Music)', 'Medium of Performance (for Music)', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 's', 'Numeric Designation (for Music)', 'Numeric Designation (for Music)', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'u', 'Key (for Music)', 'Key (for Music)', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'w', 'Arranged Statement (for Music)', 'Arranged Statement (for Music)', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '430', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', 't', 'Title', 'Title', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '440', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', 't', 'Title', 'Title', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '445', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '450', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', 'a', 'Country', 'Country', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', 'b', 'State or Province, etc.', 'State or Province, etc.', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', 'c', 'Country', 'Country', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '460', 'd', 'City', 'City', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', '2', 'Subject System Code', 'Subject System Code', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', '5', 'Tracing Control', 'Tracing Control', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', 'a', 'Entry Element', 'Entry Element', 0, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '480', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 4, '', '', '', 0, 0, '', '', ''),
('', '500', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', '4', 'Relator Code', 'Relator Code', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'b', 'Part of Name Other than Entry Element', 'Part of Name Other than Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'c', 'Additions to Name Other than Dates', 'Additions to Name Other than Dates', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'd', 'Roman Numerals', 'Roman Numerals', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'f', 'Dates', 'Dates', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'g', 'Expansion of Initials of Forename', 'Expansion of Initials of Forename', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '500', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', '4', 'Relator Code', 'Relator Code', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'b', 'Subdivision', 'Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'c', 'Additions to Name or Qualifier', 'Additions to Name or Qualifier', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'd', 'Number of Meeting and/or Part of Meeting', 'Number of Meeting and/or Part of Meeting', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'e', 'Location of Meeting', 'Location of Meeting', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'f', 'Date of Meeting', 'Date of Meeting', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'g', 'Inverted Element', 'Inverted Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'h', 'Part of Name Other than Entry Element and Inverted Element', 'Part of Name Other than Entry Element and Inverted Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '510', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '515', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', 'c', 'Qualification', 'Qualification', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', 'f', 'Dates', 'Dates', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '516', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', '4', 'Relator Code', 'Relator Code', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', 'f', 'Dates', 'Dates', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '520', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', '5', 'tra', 'tra', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'b', 'General Material Designation', 'General Material Designation', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'h', 'Number of Section or Part', 'Number of Section or Part', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'i', 'Name of Section or Part', 'Name of Section or Part', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'k', 'Date de Publication', 'Date de Publication', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'l', 'Form Subheading', 'Form Subheading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'm', 'Language (when Part of Heading)', 'Language (when Part of Heading)', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'n', 'Miscellaneous Information', 'Miscellaneous Information', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'q', 'Version (or Date of Version)', 'Version (or Date of Version)', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'r', 'Medium of Performance (for Music)', 'Medium of Performance (for Music)', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 's', 'Numeric Designation (for Music)', 'Numeric Designation (for Music)', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'u', 'Key (for Music)', 'Key (for Music)', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'w', 'Arranged Statement (for Music)', 'Arranged Statement (for Music)', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '530', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', 't', 'Title', 'Title', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '540', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', 't', 'Title', 'Title', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '545', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '550', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', 'a', 'Country', 'Country', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', 'b', 'State or Province, etc.', 'State or Province, etc.', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', 'c', 'County', 'County', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '560', 'd', 'City', 'City', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', '0', 'Instruction Phrase', 'Instruction Phrase', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', '2', 'Subject System Code', 'Subject System Code', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', '5', 'Tracing Control', 'Tracing Control', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', '6', 'Interfield Linking Data', 'Interfield Linking Data', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', 'a', 'Entry Element', 'Entry Element', 0, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '580', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 1, 0, 5, '', '', '', 0, 0, '', '', ''),
('', '675', '3', 'Authority Code Number (Link to Classification Format)', 'Authority Code Number (Link to Classification Format)', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '675', 'a', 'UDC Number, Single or Beginning of a Range', 'UDC Number, Single or Beginning of a Range', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '675', 'b', 'UDC Number, End of a Range', 'UDC Number, End of a Range', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '675', 'c', 'Explanatory Terms', 'Explanatory Terms', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '675', 'v', 'UDC Edition', 'UDC Edition', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '675', 'z', 'Language of Edition', 'Language of Edition', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '676', '3', 'Authority Code Number (Link to Classification Format)', 'Authority Code Number (Link to Classification Format)', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '676', 'a', 'DDC Number, Single or Beginning of a Range', 'DDC Number, Single or Beginning of a Range', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '676', 'b', 'DDC Number, End of a Range', 'DDC Number, End of a Range', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '676', 'c', 'Explanatory Terms', 'Explanatory Terms', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '676', 'v', 'DDC Edition', 'DDC Edition', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '676', 'z', 'Language of Edition', 'Language of Edition', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '680', '3', 'Authority Code Number (Link to Classification Format)', 'Authority Code Number (Link to Classification Format)', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '680', 'a', 'LC Number, Single or Beginning of a Range', 'LC Number, Single or Beginning of a Range', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '680', 'b', 'LC Number, End of a Range', 'LC Number, End of a Range', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '680', 'c', 'Explanatory Terms', 'Explanatory Terms', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '686', '2', 'Subject System Code', 'Subject System Code', 0, 0, 6, '', NULL, '', 0, 0, '', '', ''),
('', '686', 'a', 'Class Number, Single or Beginning of a Range', 'Class Number, Single or Beginning of a Range', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '686', 'b', 'Class Number, End of a Range', 'Class Number, End of a Range', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '686', 'c', 'Explanatory Terms', 'Explanatory Terms', 0, 0, 6, '', '', '', 0, -5, '', '', ''),
('', '700', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', '4', 'Relator Code', 'Relator Code', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'b', 'Part of Name Other than Entry Element', 'Part of Name Other than Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'c', 'Additions to Name Other than Dates', 'Additions to Name Other than Dates', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'd', 'Roman Numerals', 'Roman Numerals', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'f', 'Dates', 'Dates', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'g', 'Expansion of Initials of Forename', 'Expansion of Initials of Forename', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '700', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', '4', 'Relator Code', 'Relator Code', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'b', 'Subdivision', 'Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'c', 'Additions to Name or Qualifier', 'Additions to Name or Qualifier', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'd', 'Number of Meeting and/or Part of Meeting', 'Number of Meeting and/or Part of Meeting', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'e', 'Location of Meeting', 'Location of Meeting', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'f', 'Date of Meeting', 'Date of Meeting', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'g', 'Inverted Element', 'Inverted Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'h', 'Part of Name Other than Entry Element and Inverted Element', 'Part of Name Other than Entry Element and Inverted Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '710', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '715', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', 'a', 'Entry Element (Data Element)', 'Entry Element (Data Element)', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', 'c', 'Qualification', 'Qualification', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', 'f', 'Dates', 'Dates', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '716', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', '4', 'Relator Code', 'Relator Code', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', 'f', 'Dates', 'Dates', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '720', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'b', 'General Material Designation', 'General Material Designation', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'h', 'Number of Section or Part', 'Number of Section or Part', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'i', 'Name of Section or Part', 'Name of Section or Part', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'k', 'Date of Publication', 'Date of Publication', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'l', 'Form Subheading', 'Form Subheading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'm', 'Language (when Part of Heading)', 'Language (when Part of Heading)', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'n', 'Miscellaneous Information', 'Miscellaneous Information', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'q', 'Version (or Date of Version)', 'Version (or Date of Version)', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'r', 'Medium of Performance (for Music)', 'Medium of Performance (for Music)', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 's', 'Numeric Designation (for Music)', 'Numeric Designation (for Music)', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'u', 'Key (for Music)', 'Key (for Music)', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'w', 'Arranged Statement (for Music)', 'Arranged Statement (for Music)', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '730', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', 't', 'Title', 'Title', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '740', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', 't', 'Title', 'Title', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '745', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '750', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '760', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '760', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '760', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '760', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '760', 'a', 'Country', 'Country', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '760', 'b', 'State or Province, etc.', 'State or Province, etc.', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '760', 'c', 'County', 'County', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '760', 'd', 'City', 'City', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', '2', 'Subject System Code', 'Subject System Code', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', '3', 'Authority Record Number', 'Authority Record Number', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', '7', 'Script of Cataloguing and Script of the Base Heading', 'Script of Cataloguing and Script of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', '8', 'Language of Cataloguing and Language of the Base Heading', 'Language of Cataloguing and Language of the Base Heading', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', 'a', 'Entry Element', 'Entry Element', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', 'j', 'Form Subdivision', 'Form Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', 'x', 'Topical Subdivision', 'Topical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', 'y', 'Geographical Subdivision', 'Geographical Subdivision', 1, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '780', 'z', 'Chronological Subdivision', 'Chronological Subdivision', 0, 0, 7, '', '', '', 0, -5, '', '', ''),
('', '801', 'a', 'Country', 'Country', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '801', 'b', 'Agency', 'Agency', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '801', 'c', 'Date of Latest Transaction', 'Date of Latest Transaction', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '810', 'a', 'Citation', 'Citation', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '810', 'b', 'Information Found', 'Information Found', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '815', 'a', 'Citation', 'Citation', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '820', 'a', 'Note Text', 'Note Text', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '825', 'a', 'Note Text', 'Note Text', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '830', 'a', 'Note Text', 'Note Text', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '835', 'a', 'Note Text', 'Note Text', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '835', 'b', 'Replacement Heading', 'Replacement Heading', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '835', 'd', 'Date of the Transaction', 'Date of the Transaction', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '836', 'b', 'Replaced Heading', 'Replaced Heading', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '836', 'd', 'Date of the Transaction', 'Date of the Transaction', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'a', 'Host Name', 'Host Name', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'b', 'Access Number', 'Access Number', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'c', 'Compression Information', 'Compression Information', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'd', 'Path', 'Path', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'e', 'Date and Hour of Consultation and Access (YYYMMDDHHMM)', 'Date and Hour of Consultation and Access (YYYMMDDHHMM)', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'f', 'Electronic Name', 'Electronic Name', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'g', 'Uniform Resource Locator (URL)', 'Uniform Resource Locator (URL)', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'h', 'Processor of Request', 'Processor of Request', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'i', 'Instruction', 'Instruction', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'j', 'Bits per Second', 'Bits per Second', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'k', 'Password', 'Password', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'l', 'Login/Logoff', 'Login/Logoff', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'm', 'Contact for Access Assistance', 'Contact for Access Assistance', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'n', 'Name of Location of Host in Subfield $a', 'Name of Location of Host in Subfield $a', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'o', 'Operating System', 'Operating System', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'p', 'Port', 'Port', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'q', 'Electronic Format Type', 'Electronic Format Type', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'r', 'Settings', 'Settings', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 's', 'File Size', 'File Size', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 't', 'Terminal Emulation', 'Terminal Emulation', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'u', 'Uniform Address Locator (URL)', 'Uniform Address Locator (URL)', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'v', 'Hours Access Method Available', 'Hours Access Method Available', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'w', 'Record Control Number', 'Record Control Number', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'x', 'Nonpublic Note', 'Nonpublic Note', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'y', 'Access Method', 'Access Method', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '856', 'z', 'Public Note', 'Public Note', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '886', '2', 'System Code', 'System Code', 0, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '886', 'a', 'Tag of the Source Format Field', 'Tag of the Source Format Field', 1, 0, 8, '', '', '', 0, -5, '', '', ''),
('', '886', 'b', 'Indicators and Subfields of the Source Format Field', 'Indicators and Subfields of the Source Format Field', 1, 0, 8, '', '', '', 0, -5, '', '', '');

View file

@ -0,0 +1 @@
Authority structure for UNIMARC in English.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
Default UNIMARC bibligraphic framework in English.

View file

@ -0,0 +1,45 @@
-- Reasons for acceptance or rejection of suggestions in acquisitions
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SUGGEST','BSELL','Bestseller');
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SUGGEST','SCD','Shelf Copy Damaged');
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SUGGEST','LCL','Library Copy Lost');
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SUGGEST','AVILL','Available via ILL');
-- availability statuses
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOST','0','');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOST','2','Long Overdue (Lost)');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOST','1','Lost');
INSERT INTO `authorised_values` (category, authorised_value, lib ) VALUES ('LOST','3','Lost and Paid For');
INSERT INTO `authorised_values` (category, authorised_value, lib )VALUES ('LOST','4','Missing');
-- damaged status of an item
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('DAMAGED','0','');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('DAMAGED','1','Damaged');
-- location qualification for an item, departments are linked by default to items.location
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','FIC','Fiction');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','CHILD','Children\'s Area');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','DISPLAY','On Display');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','NEW','New Materials Shelf');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','STAFF','Staff Office');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','GEN','General Stacks');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','AV','Audio Visual');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','REF','Reference');
-- collection codes for an item
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('CCODE','FIC','Fiction');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('CCODE','REF','Reference');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('CCODE','NFIC','Non Fiction');
-- withdrawn status of an item, linked to items.wthdrawn
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('WITHDRAWN','0','');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('WITHDRAWN','1','Withdrawn');
-- loanability status of an item, linked to items.notforloan
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_LOAN','-1','Ordered');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_LOAN','0','');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_LOAN','1','Not For Loan');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_LOAN','2','Staff Collection');
-- restricted status of an item, linked to items.restricted
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','0','');
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','1','Restricted Access');

Some files were not shown because too many files have changed in this diff Show more