my $tag=$field->tag();
if ($auth_number==$mergefrom) {
my $field_to=MARC::Field->new(($tag_to?$tag_to:$tag),$field->indicator(1),$field->indicator(2),"9"=>$mergeto);
+ my $exclude='9';
foreach my $subfield (@record_to) {
$field_to->add_subfields($subfield->[0] =>$subfield->[1]);
+ $exclude.= $subfield->[0];
}
+ $exclude='['.$exclude.']';
+# add subfields in $field not included in @record_to
+ my @restore= grep {$_->[0]!~/$exclude/} $field->subfields();
+ foreach my $subfield (@restore) {
+ $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
+ }
$marcrecord->delete_field($field);
$marcrecord->insert_grouped_field($field_to);
$update=1;
};
while (my $record = $sth->fetchrow_hashref) {
$self->{'branch_code'} = $record->{'branch_code'};
+ $self->{'creator'} = $record->{'creator'};
push (@{$self->{'items'}}, {$number_type => $record->{$number_type}, label_id => $record->{'label_id'}});
$record_flag = 1; # true if one or more rows were retrieved
}
'format_string',
'layout_xml', # FIXME: all layouts should be stored in xml format to greatly simplify handling -chris_n
'creator',
+ 'units',
+ 'start_label',
);
if (scalar(@_) >1) {
my %given_params = @_;
my $type = ref($invocant) || $invocant;
if (grep {$_ eq 'Labels'} @_) {
$self = {
+ layout_xml => '',
+ units => 'POINT',
+ start_label => 1,
barcode_type => 'CODE39',
printing_type => 'BAR',
layout_name => 'DEFAULT',
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) {
my $string = '';
my $strwidth = 0;
my $col_count = 0;
- my $textlimit = $params{'label_width'} - ( 3 * $params{'left_text_margin'});
+ my $textlimit = $params{'label_width'} - (( 3 * $params{'left_text_margin'} ) || 13.5 );
while ($strwidth < $textlimit) {
$string .= '0';
warn sprintf('Database returned the following error on attempted DELETE: %s', $sth->errstr);
return -1;
}
+ return 0;
}
sub save {
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 $query = "DELETE FROM creator_templates WHERE template_id = ? AND creator = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@query_params);
$self->{'template_stat'} = 0;
'required' => '0',
'min_ver' => '0.97',
},
+ 'Business::ISBN' => {
+ 'usage' => 'Core',
+ 'required' => '0',
+ 'min_ver' => '2.05',
+ },
};
1;
use C4::Output;
use URI::Split qw(uri_split);
use Memoize;
+use Business::ISBN;
use vars qw($VERSION @ISA @EXPORT $DEBUG);
if ( opendir ( my $dh, $directoryname ) ) {
my @images = grep { /\.(gif|png)$/i } readdir( $dh );
closedir $dh;
+ @images = sort(@images);
return @images;
} else {
warn "unable to opendir $directoryname: $!";
}
# Normalizes and returns the first valid ISBN found in the record
+# ISBN13 are converted into ISBN10. This is required to get Amazon cover book.
sub GetNormalizedISBN {
my ($isbn,$record,$marcflavour) = @_;
my @fields;
if ($isbn) {
+ # Koha attempts to store multiple ISBNs in biblioitems.isbn, separated by " | "
+ # anything after " | " should be removed, along with the delimiter
+ $isbn =~ s/(.*)( \| )(.*)/$1/;
return _isbn_cleanup($isbn);
}
return undef unless $record;
}
sub _isbn_cleanup ($) {
- my $normalized_isbn = shift;
- $normalized_isbn =~ s/-//g;
- $normalized_isbn =~/([0-9x]{1,})/i;
- $normalized_isbn = $1;
- if (
- $normalized_isbn =~ /\b(\d{13})\b/ or
- $normalized_isbn =~ /\b(\d{12})\b/i or
- $normalized_isbn =~ /\b(\d{10})\b/ or
- $normalized_isbn =~ /\b(\d{9}X)\b/i
- ) {
- return $1;
- }
- return undef;
+ my $isbn = Business::ISBN->new( shift );
+ return undef unless $isbn;
+ $isbn = $isbn->as_isbn10 if $isbn->type eq 'ISBN13';
+ $isbn = $isbn->as_string;
+ $isbn =~ s/-//g;
+ return $isbn;
}
1;
return \@label_text;
}
+sub draw_guide_box {
+ return $_[0]->{'guidebox'};
+}
+
sub barcode {
my $self = shift;
my %params = @_;
# and parse borrower ...
my $innerletter = $letter;
- my $borinfo = GetMember( 'borrowernumber' => $_->{'borrowernumber'});
+ my $borinfo = C4::Members::GetMember('borrowernumber' => $_->{'borrowernumber'});
parseletter( $innerletter, 'borrowers', $_->{'borrowernumber'} );
# ... then send mail
$flags{'NOTES'} = \%flaginfo;
}
my ( $odues, $itemsoverdue ) = checkoverdues($patroninformation->{'borrowernumber'});
- if ( $odues > 0 ) {
+ if ( $odues && $odues > 0 ) {
my %flaginfo;
$flaginfo{'message'} = "Yes";
$flaginfo{'itemlist'} = $itemsoverdue;
#'
sub UpdateGuarantees {
- my (%data) = @_;
+ my %data = shift;
my $dbh = C4::Context->dbh;
my ( $count, $guarantees ) = GetGuarantees( $data{'borrowernumber'} );
- for ( my $i = 0 ; $i < $count ; $i++ ) {
-
- # FIXME
- # It looks like the $i is only being returned to handle walking through
- # the array, which is probably better done as a foreach loop.
- #
+ foreach my $guarantee (@$guarantees){
my $guaquery = qq|UPDATE borrowers
- SET address='$data{'address'}',fax='$data{'fax'}',
- B_city='$data{'B_city'}',mobile='$data{'mobile'}',city='$data{'city'}',phone='$data{'phone'}'
- WHERE borrowernumber='$guarantees->[$i]->{'borrowernumber'}'
+ SET address=?,fax=?,B_city=?,mobile=?,city=?,phone=?
+ WHERE borrowernumber=?
|;
- my $sth3 = $dbh->prepare($guaquery);
- $sth3->execute;
+ my $sth = $dbh->prepare($guaquery);
+ $sth->execute($data{'address'},$data{'fax'},$data{'B_city'},$data{'mobile'},$data{'city'},$data{'phone'},$guarantee->{'borrowernumber'});
}
}
=head2 GetPendingIssues
# 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));
- }
-
+ $fw = $scan
+ ? undef
+ : $bibliotag < 10
+ ? GetFrameworkCode($marcrecord->field($bibliotag)->data)
+ : GetFrameworkCode($marcrecord->subfield($bibliotag,$bibliosubf));
my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, $fw );
$oldbiblio->{subtitle} = GetRecordValue('subtitle', $marcrecord, $fw);
$oldbiblio->{result_number} = $i + 1;
#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 can be a problem. We should also look into other types and rejected forms.
- my $authtypedata=C4::AuthoritiesMarc->GetAuthType($data->{authtypecode});
+ my $authtypedata=C4::AuthoritiesMarc::GetAuthType($data->{authtypecode});
next unless $authtypedata;
my $marcrecordauth=MARC::Record->new();
my $authfield=MARC::Field->new($authtypedata->{auth_tag_to_report},'','',"a"=>"".$field->subfield('a'));
my $dbh = C4::Context->dbh;
$date = strftime( "%Y-%m-%d", localtime ) unless ($date);
my $query = "
- UPDATE serial SET claimdate=$date,status=7
- WHERE serialid in (" . join( ",", @$serialids ) . ")";
+ UPDATE serial SET claimdate = ?, status = 7
+ WHERE serialid in (" . join( ",", map { '?' } @$serialids ) . ")";
my $rq = $dbh->prepare($query);
- $rq->execute;
+ $rq->execute($date, @$serialids);
return $rq->rows;
}
sub HasItems {
my ($subscriptionid) = @_;
my $dbh = C4::Context->dbh;
- my $query = qq|
+ my $query = q|
SELECT COUNT(serialitems.itemnumber)
FROM serial
LEFT JOIN serialitems USING(serialid)
- WHERE subscriptionid=? AND serialitems.serialid NOT NULL
+ WHERE subscriptionid=? AND serialitems.serialid IS NOT NULL
|;
my $sth=$dbh->prepare($query);
$sth->execute($subscriptionid);
- my ($countitems)=$sth->fetchrow;
+ my ($countitems)=$sth->fetchrow_array();
return $countitems;
}
@ISA = qw(Exporter);
@EXPORT = qw(
&GetShelves &GetShelfContents &GetShelf
- &AddToShelf &AddToShelfFromBiblio &AddShelf
+ &AddToShelf &AddShelf
&ModShelf
&ShelfPossibleAction
&DelFromShelf &DelShelf
This module provides functions for manipulating virtual virtualshelves,
including creating and deleting virtualshelves, and adding and removing
-items to and from virtualshelves.
+bibs to and from virtualshelves.
=head1 FUNCTIONS
=head2 GetShelfContents
- $itemlist = &GetShelfContents($shelfnumber);
+ $biblist = &GetShelfContents($shelfnumber);
Looks up information about the contents of virtual virtualshelves number
C<$shelfnumber>. Sorted by a field in the biblio table. copyrightdate
&AddToShelf($biblionumber, $shelfnumber);
-Adds item number C<$biblionumber> to virtual virtualshelves number
-C<$shelfnumber>, unless that item is already on that shelf.
+Adds bib number C<$biblionumber> to virtual virtualshelves number
+C<$shelfnumber>, unless that bib is already on that shelf.
=cut
$sth->execute( $shelfnumber );
}
-=head2 AddToShelfFromBiblio
-
- &AddToShelfFromBiblio($biblionumber, $shelfnumber)
-
-this function allow to add a virtual into the shelf number $shelfnumber
-from biblionumber.
-
-=cut
-
-sub AddToShelfFromBiblio {
- my ( $biblionumber, $shelfnumber ) = @_;
- return unless $biblionumber;
- my $query = qq(
- SELECT *
- FROM virtualshelfcontents
- WHERE shelfnumber=? AND biblionumber=?
- );
- my $sth = $dbh->prepare($query);
- $sth->execute( $shelfnumber, $biblionumber );
- unless ( $sth->rows ) {
- my $query =qq(
- INSERT INTO virtualshelfcontents
- (shelfnumber, biblionumber, flags)
- VALUES
- (?, ?, 0)
- );
- $sth = $dbh->prepare($query);
- $sth->execute( $shelfnumber, $biblionumber );
- $query = qq(UPDATE virtualshelves
- SET lastmodified = CURRENT_TIMESTAMP
- WHERE shelfnumber = ?);
- $sth = $dbh->prepare($query);
- $sth->execute( $shelfnumber );
- }
-}
-
=head2 ModShelf
ModShelf($shelfnumber, $hashref)
&DelFromShelf( $biblionumber, $shelfnumber);
-Removes item number C<$biblionumber> from virtual virtualshelves number
-C<$shelfnumber>. If the item wasn't on that virtualshelves to begin with,
+Removes bib number C<$biblionumber> from virtual virtualshelves number
+C<$shelfnumber>. If the bib wasn't on that virtualshelves to begin with,
nothing happens.
=cut
if ( $shelfnumber = $query->param('viewshelf') ) {
if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) {
if ( $barcode = $query->param('addbarcode') ) {
- if ( $item = GetItem( 0, $barcode ) ) {
+ $item = GetItem( 0, $barcode );
+ if (defined $item && $item->{'itemnumber'}){
$biblio = GetBiblioFromItemNumber( $item->{'itemnumber'} );
AddToShelf( $biblio->{'biblionumber'}, $shelfnumber )
or push @paramsloop, { duplicatebiblio => $barcode };
Run the following command:
- $ sudo cpan Algorithm::CheckDigits SMS::Send HTTP::OAI IPC::Cmd \\
- Memoize::Memcached PDF::API2::Simple PDF::Table Storable Test::More \\
+ $ sudo cpan Algorithm::CheckDigits SMS::Send HTTP::OAI IPC::Cmd \
+ Memoize::Memcached PDF::API2::Simple PDF::Table Storable Test::More \
Locale::Currency::Format
Note: you may need to run CPAN initialization if you've not run cpan
/etc/perl/XML/SAX/ParserDetails.ini
+ You will need to move the entire section for '[XML::LibXML::SAX::Parser]' to the bottom of the ini file.
+
2.4 Install DBD::mysql Perl module
In order to handle UTF-8 correctly, Koha requires at least version 4.004
--- /dev/null
+=============================
+Installation Guide for Installing Koha on Ubuntu Lucid Lynx (10.04 LTS) with MySQL 5
+=============================
+
+Copyright (C) 2007, 2008 LibLime (http://liblime.com)
+Some parts copyright 2010 Chris Nighswonger
+
+Original author: Joshua Ferraro
+Modified for Ubuntu by: Chris Nighswonger (cnighswonger AT foundations DOT edu)
+
+Feedback/bug reports: Koha Developer's List:
+http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
+
+This document last modified: 11 Sep 2010
+
+Installation Instructions
+=============================
+
+All commands can be performed as a system user with sudo privileges,
+as indicated or by running the command directly as root.
+
+1. Prepare System and Install Dependencies
+
+1.1 Install Ubuntu Lucid Lynx via CD
+
+See http://www.ubuntu.com/getubuntu/download
+
+1.2 Set up your locale
+
+Your locale should be set to UTF-8, as should Apache2 and MySQL 5.
+This step is VERY IMPORTANT for a UNICODE compliant system. Please
+read over the following document carefully:
+
+http://wiki.koha.org/doku.php?id=encodingscratchpad
+
+You can verify your system locale by typing the following command:
+
+ $ locale
+
+IMPORTANT: You _MUST_ follow all the steps outlined there for
+ Apache2, MySQL 5, etc. BEFORE you install Koha.
+
+1.3 Get Koha
+
+1.3.1 Option A: Download Koha via Git (optional)
+
+ $ sudo apt-get install git-core git-email
+ $ git clone git://git.koha-community.org/pub/scm/koha.git kohaclone
+ $ cd kohaclone
+ $ git checkout -b myinstall origin
+
+Note: for more information about Git, please see the Koha Git Usage Guide:
+
+ http://wiki.koha-community.org/wiki/Version_Control_Using_Git
+
+1.3.2 Option B: Download Koha from http://download.koha-community.org
+
+ $ wget http://download.koha-community.org/koha-3.02.00.tar.gz
+ ( Note: use the latest stable version)
+
+1.4 Install additional Ubuntu dependencies
+
+IMPORTANT: You should only use CPAN for Perl dependencies which are NOT
+ available from the package maintainer. You have been warned!
+
+Using the ubuntu.packages file included in the Koha source tree,
+run the following:
+
+ $ sudo dpkg --set-selections < install_misc/ubuntu.packages
+
+Now start dselect (you may need to '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.
+
+Note: If you are installing on an older version of Ubuntu, not all of the
+ packages listed in ubuntu.packages may be available as packages. You
+ will want to verify which ones are installed and which ones not.
+ This can be done by running the following command:
+
+ $ install_misc/ubuntu-pkg-check.sh | grep none
+
+When tracking down any "(none)" results, note that sometimes Ubuntu does the
+right thing and installs a later, differently named version of the package in
+place. To see if this is happening, it is useful to run a command like:
+
+ $ dpkg --get-selections | grep [base_package_name]
+
+1.5 Install Perl dependencies that aren't packaged into Ubuntu Lucid Lynx
+sources
+
+Run the following command:
+
+ $ sudo cpan HTTP::OAI Locale::Currency::Format Memoize::Memcached \
+ PDF::API2::Simple Storable Text::CSV::Encoded
+
+Note: you may need to run CPAN initialization if you've not run cpan
+before:
+
+ /etc/perl/CPAN/Config.pm initialized.
+
+ CPAN is the world-wide archive of perl resources. It consists of about
+ 100 sites that all replicate the same contents all around the globe.
+ Many countries have at least one CPAN site already. The resources
+ found on CPAN are easily accessible with the CPAN.pm module. If you
+ want to use CPAN.pm, you have to configure it properly.
+
+ If you do not want to enter a dialog now, you can answer 'no' to this
+ question and I'll try to autoconfigure. (Note: you can revisit this
+ dialog anytime later by typing 'o conf init' at the cpan prompt.)
+
+ Are you ready for manual configuration? [yes]
+
+When the configuration is completed CPAN will install the Perl modules.
+
+2. Configuration of dependencies
+
+2.1 Update root MySQL password (if dselect didn't do it for you already)
+
+ $ sudo mysqladmin password <password>
+
+2.2 Create the Koha database
+
+ Create the database and user with associated privileges:
+
+ $ mysqladmin -uroot -p<password> create <kohadatabasename>
+ $ mysql -uroot -p<password>
+
+ Welcome to the MySQL monitor. Commands end with ; or \g.
+ Your MySQL connection id is 22
+ Server version: 5.0.32-Debian_7etch3-log Debian etch distribution
+
+ Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
+
+ mysql> grant all on <kohadatabasename>.* to '<kohadatabaseuser>'@'localhost' identified by '<kohadatabaseuserpassword>';
+ Query OK, 0 rows affected (0.00 sec)
+
+ mysql> flush privileges;
+ Query OK, 0 rows affected (0.00 sec)
+
+ mysql> quit
+
+2.3 Test your SAX Parser and correct where necessary
+
+ You must be sure you're using the XML::LibXML SAX parser, not Expat or
+ PurePerl, both of which have outstanding bugs with pre-composed
+ characters. You can test your SAX parser by running:
+
+ $ cd koha
+ $ misc/sax_parser_print.pl
+
+ You should see something like::
+
+ XML::LibXML::SAX::Parser=HASH(0x81fe220)
+
+ If you're using PurePerl or Expat, you'll need to edit your
+ ini file, typically located at:
+
+ /etc/perl/XML/SAX/ParserDetails.ini
+
+ You will need to move the entire section for '[XML::LibXML::SAX::Parser]'
+ to the bottom of the ini file.
+
+3. Run the Koha installer
+
+ $ perl Makefile.PL
+ ( answer questions )
+ $ make
+ $ make test
+ $ sudo make install
+
+4. Configure and start Apache
+ $ sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
+ (note that the path to koha-httpd.conf may be different depending on your
+ installation choices)
+
+Add the following lines to /etc/apache2/ports.conf:
+
+ Listen 80
+ Listen 8080
+
+If not running named virtual hosts (The default koha installation does not use
+named virtual hosts.), comment out the following line:
+
+ NameVirtualHost *:80
+
+Run the following commands:
+
+ $ sudo a2enmod rewrite
+ $ sudo a2ensite koha
+ $ sudo apache2ctl restart
+
+Note: you may still see the usual Apache default site if your VirtualHost
+configuration isn't correct. The command "sudo a2dissite default" may be a
+quick fix, but may have side-effects. See the Apache HTTPD manual section on
+virtual hosts for full instructions.
+
+5. Configure and start Zebra
+
+Note: it's recommended that you daemonize the Zebra process and add it to your
+startup profile. For a non-production test/development installation, running
+Zebra from the command line can be useful. Pick from the two available options
+below, or roll your own :-)
+
+Note: it's also recommended that you create a Koha system user, which you will
+have specified during the install process. Alternatively, Zebra can be
+configured to run as the root user.
+
+To add a user do:
+
+ $ sudo adduser koha
+
+Option 1: run the Zebra processes from the command line:
+
+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.
+
+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: This script should be run as the kohauser (the default is 'koha').
+
+Option 2: run the Zebra process as a daemon, and add to startup process:
+
+Note that references to $SCRIPT_DIR refer to the directory where
+Koha's command-line scripts are installed, e.g., /usr/share/koha/bin.
+
+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
+ ( Note: see man chkconfig(8) on other distros )
+
+ $ sudo ${SCRIPT_DIR}/koha-zebra-ctl.sh start
+
+1.2 Zebra Indexer
+
+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.
+NOTE: This job should be setup under the kohauser (the default is 'koha').
+
+6. Run the Web Installer, populate the database, initial configuration of settings
+
+ Point your browser to http://<servername>:8080/
+
+ It should redirect you to the Web Installer where you can continue the setup.
+ You can install the sample data for libraries, patrons, etc. via the Web Installer
+
+7. What next?
+
+ Once the installer has completed, you can import and index MARC records from the
+ command line thusly (Note: you can also use the 'Stage MARC records for import' from
+ the Tools area of Koha's Staff Client to import a batch of MARC records):
+
+ $ export KOHA_CONF=/usr/share/koha/etc/koha-conf.xml
+ (note: use the correct path to your koha-conf.xml)
+
+7.1 Import:
+ 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
+
+7.2 Fast Index:
+ $ misc/migration_tools/rebuild_zebra.pl -b -w
+
+ Once the indexing has completed, you will be able to search for records in your system.
+ NOTE: This script should be run as the kohauser (the default is 'koha').
+
+7.3 Schedule regular index updates
+
+ You need to run rebuild_zebra.pl -b -a -z as a regular cron job in orde to pick up new bibs
+ and items as you add them. Check misc/cronjobs/crontab.example for usage examples. See 7.0 above.
+ NOTE: This job should be setup under the kohauser (the default is 'koha').
+
+7.4 To enable public Z39.50/SRU servers, you'll need to edit your koha-conf.xml and
+ change the <listen> options to listen on a TCP port; then restart the zebra daemon.
+
+UPGRADE
+=======
+If you are upgrading from a previous installation of Koha 3, you can
+use the following:
+
+ perl Makefile.PL --prev-install-log /path/to/koha-install-log
+ make
+ make test
+ sudo make upgrade
+
+Uninstall Instructions
+=============================
+1) Stop Services:
+ $ sudo a2dissite koha
+ $ sudo rm /etc/apache2/sites-available/koha
+ $ sudo apache2ctl restart
+
+ $ sudo update-rc.d koha-zebra-daemon remove
+ $ sudo rm /etc/init.d/koha-zebra-daemon
+
+2) Remove Database and Indexes
+
+ # MySQL
+ $ mysql -u<kohauser> -p<kohapassword>
+ > drop database koha;
+
+ # Zebra Indexes
+ $ zebraidx -c <prefix>/etc/zebradb/zebra-biblios.cfg -g iso2709 -d biblios init
+ $ zebraidx -c <prefix>/etc/zebradb/zebra-authorities.cfg -g iso2709 -d authorities init
+
+3) Remove Koha Install Directories and Configuration Files
+ Don't forget about any crontab entries
+
+Tested on the following operating environments
+==============================================
+- Ubuntu Jaunty Jackalope 9.04
+
+Installer Bug reports
+=====================
+Please log any installer bug reports at http://bugs.koha-community.org
+
+Other Notes
+=====================
+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.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
if ( $orderinfo->{quantity} ne '0' ) {
#TODO:check to see if biblio exists
unless ( $$orderinfo{biblionumber} ) {
-
#if it doesnt create it
my $record = TransformKohaToMarc(
{
"biblio.title" => "$$orderinfo{title}",
- "biblio.author" => "$$orderinfo{author}",
+ "biblio.author" => $$orderinfo{author} ? $$orderinfo{author} : "",
"biblio.seriestitle" => $$orderinfo{series} ? $$orderinfo{series} : "",
"biblioitems.isbn" => $$orderinfo{isbn} ? $$orderinfo{isbn} : "",
"biblioitems.publishercode" => $$orderinfo{publishercode} ? $$orderinfo{publishercode} : "",
"biblioitems.publicationyear" => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
+ "biblio.copyrightdate" => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
});
+
# create the record in catalogue, with framework ''
my ($biblionumber,$bibitemnum) = AddBiblio($record,'');
# change suggestion status if applicable
orderexists => ( $new eq 'yes' ) ? 0 : 1,
title => $data->{'title'},
author => $data->{'author'},
- publicationyear => $data->{'publicationyear'},
+ publicationyear => $data->{'publicationyear'} ? $data->{'publicationyear'} : $data->{'copyrightdate'},
budget_loop => $budget_loop,
isbn => $data->{'isbn'},
seriestitle => $data->{'seriestitle'},
my $isbn = $input->param('isbn');
my $issn = $input->param('issn');
my $lccn = $input->param('lccn');
+my $lccall = $input->param('lccall');
my $subject= $input->param('subject');
my $dewey = $input->param('dewey');
my $op = $input->param('op');
isbn => $isbn,
issn => $issn,
lccn => $lccn,
+ lccall => $lccall,
title => $title,
author => $author,
serverloop => $serverloop,
$query .= " \@attr 1=9 $lccn ";
$nterms++;
}
+ if ($lccall) {
+ $query .= " \@attr 1=16 \@attr 2=3 \@attr 3=1 \@attr 4=1 \@attr 5=1 \@attr 6=1 \"$lccall\" ";
+ $nterms++;
+ }
for my $i (1..$nterms-1) {
$query = "\@and " . $query;
}
$lang = $template->param( 'lang' );
my $op = $input->param( 'op' ) || '';
my $tab = $input->param( 'tab' );
-$tab ||= 'local-use';
+$tab ||= 'acquisitions'; # Ideally this should be "local-use" but preferences.pl
+ # does not presently support local use preferences
my $highlighted;
$row_data->{delete} = "$script_name?op=delete_confirm&searchfield=" . $results->[$i]{'variable'};
push( @loop_data, $row_data );
}
- $tab = ( $tab ? $tab : "Local Use" );
+ $tab = ( $tab ? $tab : "local-use" );
$template->param( loop => \@loop_data, $tab => 1 );
if ( $offset > 0 ) {
my $prevpage = $offset - $pagesize;
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
my @subscriptions = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
my @subs;
-$dat->{'serial'}=1 if $subscriptionsnumber;
+
foreach my $subscription (@subscriptions) {
my %cell;
my $serials_to_display;
itemdata_enumchron => $itemfields{enumchron},
itemdata_uri => $itemfields{uri},
itemdata_copynumber => $itemfields{copynumber},
- volinfo => $itemfields{enumchron} || $dat->{'serial'} ,
+ volinfo => $itemfields{enumchron},
z3950_search_params => C4::Search::z3950_search_args($dat),
C4::Search::enabled_staff_search_views,
);
use C4::Context;
use C4::Output;
use C4::Biblio;
+use C4::Items;
use C4::Search; # enabled_staff_search_views
my $query = new CGI;
}
);
-$template->param( count => 1, bibliotitle => $biblio->{title} );
+#count of item linked
+my $itemcount = GetItemsCount($biblionumber);
+$template->param( count => $itemcount,
+ bibliotitle => $biblio->{title}, );
#Getting the list of all frameworks
my $queryfwk =
use MARC::File::XML;
+my $dbh = C4::Context->dbh;
+
sub find_value {
my ($tagfield,$insubfield,$record) = @_;
my $result;
}
}
+# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code
+# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
+sub _increment_barcode {
+ my ($record, $frameworkcode) = @_;
+ my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
+ unless ($record->field($tagfield)->subfield($tagsubfield)) {
+ my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items");
+ $sth_barcode->execute;
+ my ($newbarcode) = $sth_barcode->fetchrow;
+ $newbarcode++;
+ # OK, we have the new barcode, now create the entry in MARC record
+ my $fieldItem = $record->field($tagfield);
+ $record->delete_field($fieldItem);
+ $fieldItem->add_subfields($tagsubfield => $newbarcode);
+ $record->insert_fields_ordered($fieldItem);
+ }
+ return $record;
+}
+
+
my $input = new CGI;
-my $dbh = C4::Context->dbh;
my $error = $input->param('error');
my $biblionumber = $input->param('biblionumber');
my $itemnumber = $input->param('itemnumber');
my $add_multiple_copies_submit = $input->param('add_multiple_copies_submit');
my $number_of_copies = $input->param('number_of_copies');
- # if autoBarcode is set to 'incremental', calculate barcode...
- # NOTE: This code is subject to change in 3.2 with the implemenation of ajax based autobarcode code
- # NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
if (C4::Context->preference('autoBarcode') eq 'incremental') {
- my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
- unless ($record->field($tagfield)->subfield($tagsubfield)) {
- my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items");
- $sth_barcode->execute;
- my ($newbarcode) = $sth_barcode->fetchrow;
- $newbarcode++;
- # OK, we have the new barcode, now create the entry in MARC record
- my $fieldItem = $record->field($tagfield);
- $record->delete_field($fieldItem);
- $fieldItem->add_subfields($tagsubfield => $newbarcode);
- $record->insert_fields_ordered($fieldItem);
- }
+ $record = _increment_barcode($record, $frameworkcode);
}
my $addedolditem = TransformMarcToKoha($dbh,$record);
# If we have to add & duplicate
if ($add_duplicate_submit) {
-
- # We try to get the next barcode
- use C4::Barcodes;
- my $barcodeobj = C4::Barcodes->new;
- my $barcodevalue = $barcodeobj->next_value($addedolditem->{'barcode'}) if $barcodeobj;
- my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
- if ($record->field($tagfield)->subfield($tagsubfield)) {
- # If we got the next codebar value, we put it in the record
- if ($barcodevalue) {
- $record->field($tagfield)->update($tagsubfield => $barcodevalue);
- # If not, we delete the recently inserted barcode from the record (so the user can input a barcode himself)
- } else {
- $record->field($tagfield)->update($tagsubfield => '');
- }
- }
$itemrecord = $record;
+ if (C4::Context->preference('autoBarcode') eq 'incremental') {
+ $itemrecord = _increment_barcode($itemrecord, $frameworkcode);
+ }
+ else {
+ # we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin
+ my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
+ my $fieldItem = $itemrecord->field($tagfield);
+ $itemrecord->delete_field($fieldItem);
+ $fieldItem->delete_subfields($tagsubfield);
+ $itemrecord->insert_fields_ordered($fieldItem);
+ }
}
# If we have to add multiple copies
foreach my $thisbranch (@$branches) {
push @authorised_values, $thisbranch->{value};
$authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname};
- # $value = $thisbranch->{value} if $thisbranch->{selected};
+ # in edit item this is set to the data value otherwise use default
+ if ($op ne 'edititem' && $thisbranch->{selected} ) {
+ $value = $thisbranch->{value};
+ }
}
}
elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
= get_template_and_user({template_name => "value_builder/labs_theses.tmpl",
query => $query,
type => 'intranet',
- authnotrequired => 1,
+ authnotrequired => 0,
debug => 1,
});
= get_template_and_user({template_name => "value_builder/labs_theses.tmpl",
query => $query,
type => "intranet",
- authnotrequired => 1,
+ authnotrequired => 0,
});
$template->param(
"cataloguing/value_builder/unimarc_field_4XX.tmpl",
query => $query,
type => 'intranet',
- authnotrequired => 1,
+ authnotrequired => 0,
debug => 1,
}
);
"cataloguing/value_builder/unimarc_field_4XX.tmpl",
query => $query,
type => "intranet",
- authnotrequired => 1,
+ authnotrequired => 0,
}
);
my $isbn = $input->param('isbn');
my $issn = $input->param('issn');
my $lccn = $input->param('lccn');
+my $lccall = $input->param('lccall');
my $subject = $input->param('subject');
my $dewey = $input->param('dewey');
my $controlnumber = $input->param('controlnumber');
isbn => $isbn,
issn => $issn,
lccn => $lccn,
+ lccall => $lccall,
title => $title,
author => $author,
controlnumber=> $controlnumber,
$query .= " \@attr 1=9 $lccn ";
$nterms++;
}
+ if ($lccall) {
+ $query .= " \@attr 1=16 \@attr 2=3 \@attr 3=1 \@attr 4=1 \@attr 5=1 \@attr 6=1 \"$lccall\" ";
+ $nterms++;
+ }
if ($controlnumber) {
$query .= " \@attr 1=12 \"$controlnumber\" ";
$nterms++;
build_package() {
git archive --format=tar --prefix="koha-$1/" HEAD |
gzip -9 > "../koha_$1.tar.gz"
- pdebuild
+ pdebuild $2
}
if ! everything_is_commited
fi
version="$(newversion)"
+if [ -n "$1" ]
+then
+ pdebuildopts="--buildresult $1"
+fi
adjust_debian_changelog "$version"
-build_package "$version"
+build_package "$version" "$pdebuildopts"
reset_debian_changelog
* /etc/koha -- system configuration files
* /etc/cron.hourly/koha-common -- cron job
+* /etc/cron.daily/koha-common -- cron job
+* /etc/cron.d/koha-common -- cron job
* /usr/share/koha -- shared files (HTML templates, Perl code, etc)
Each Koha instance has files in the following places:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
*/5 * * * * root test -x /usr/sbin/koha-rebuild-zebra && koha-rebuild-zebra $(koha-list --enabled)
+*/15 * * * * root koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/process_message_queue.pl
--- /dev/null
+#!/bin/sh
+# /etc/cron.daily/koha-common -- Daily housekeeping tasks for all Kohas.
+# Copyright 2010 Catalyst IT, Ltd
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/overdue_notices.pl -t
+koha-foreach --enabled /usr/share/koha/bin/cronjobs/fines.pl
+koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/advance_notices.pl -c
+koha-foreach --enabled /usr/share/koha/bin/cronjobs/holds/cancel_expired_holds.pl >/dev/null 2>&1
+koha-foreach --enabled /usr/share/koha/bin/cronjobs/services_throttle.pl > /dev/null 2>&1
+koha-foreach --enabled /usr/share/koha/bin/cronjobs/cleanup_database.pl --sessions --zebraqueue 10
+koha-foreach --enabled --noemail /usr/share/koha/bin/cronjobs/cleanup_database.pl --mail
debian/tmp/etc/koha/pazpar2
debian/tmp/etc/koha/zebradb/[!z]*
debian/templates/* etc/koha
-debian/koha-post-install-setup usr/sbin
+debian/koha-post-install-setup usr/sbin
debian/unavailable.html usr/share/koha/intranet/htdocs
debian/unavailable.html usr/share/koha/opac/htdocs
debian/templates/* etc/koha
debian/scripts/koha-disable usr/sbin
debian/scripts/koha-dump usr/sbin
debian/scripts/koha-dump-defaults usr/sbin
+debian/scripts/koha-email-disable usr/sbin
+debian/scripts/koha-email-enable usr/sbin
debian/scripts/koha-enable usr/sbin
debian/scripts/koha-foreach usr/sbin
debian/scripts/koha-list usr/sbin
fi
adduser --no-create-home --disabled-login \
--gecos "Koha instance $username" \
+ --home "/var/lib/koha/$name" \
--quiet "$username"
# Create the site-specific directories.
then
koha-disable "$name"
fi
+
+echo <<eoh
+
+Email for this instance is disabled. When you're ready to enable it, use:
+koha-email-enable $name
+eoh
--- /dev/null
+#!/bin/sh
+#
+# koha-email-disable -- turn off the email for a Koha instance
+# Copyright 2010 Catalyst IT, Ltd
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+if [ "$#" = 0 ]
+then
+ echo "Disables the email for a koha instance." 1>&2
+ echo "Usage: $0 instancename..." 1>&2
+ exit 1
+fi
+libdir=/var/lib/koha
+for name in "$@"
+do
+ if [ ! -d $libdir/$name ]
+ then
+ echo "$0: no koha instance \"$name\"" 1>&2
+ continue
+ fi
+ rm -f $libdir/$name/email.enabled
+done
--- /dev/null
+#!/bin/sh
+#
+# koha-email-enable -- turn on the email for a Koha instance
+# Copyright 2010 Catalyst IT, Ltd
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+if [ "$#" = 0 ]
+then
+ echo "Enables email for a koha instance." 1>&2
+ echo "Usage: $0 instancename..." 1>&2
+ exit 1
+fi
+libdir=/var/lib/koha
+for name in "$@"
+do
+ if [ ! -d $libdir/$name ]
+ then
+ echo "$0: no koha instance \"$name\"" 1>&2
+ continue
+ fi
+ touch $libdir/$name/email.enabled
+done
set -e
-
listopts=""
-if [ "$1" = --enabled ]
-then
- listopts="--enabled"
+while [ ! -z "$1" ]
+do
+ case "$1" in
+ --email) listopts="$listopts --email";;
+ --noemail) listopts="$listopts --noemail";;
+ --enabled) listopts="$listopts --enabled";;
+ *) break;;
+ esac
shift
-fi
-
-
+done
+
for name in $(koha-list $listopts)
do
sudo -u "$name-koha" \
fi
}
-all=yes
-if [ "$1" = --enabled ]
-then
+help() {
+ echo <<eoh
+Lists Koha instances, optionally only those that are enabled or have
+email turned on.
+
+Usage: $0 [--enabled] [--email] [-h]
+Options:
+ --enabled only show instances that are enabled
+ --email only show instances that have email enabled
+ --noemail only show instances that do not have email enabled
+ -h this help
+
+The filtering options can be combined, and you probably want to do this
+(except --email and --noemail, that's just silly.)
+eoh
+}
+
+enabled=no
+email=no
+noemail=no
+args=$(getopt -l enabled,email,noemail -o h -n $0 -- "$@")
+set -- $args
+while [ ! -z "$1" ]
+do
+ case "$1" in
+ -h) help; exit;;
+ --email) email=yes;;
+ --enabled) enabled=yes;;
+ --noemail) noemail=yes;;
+ *) break;;
+ esac
shift
- all=no
-fi
+done
find /etc/koha/sites -mindepth 1 -maxdepth 1 -type d -printf '%f\n' |
sort |
while read name
do
- if [ "$all" = yes ] || is_enabled "$name"
- then
- echo "$name"
- fi
+ [ "$enabled" = yes ] && ! is_enabled "$name" && continue
+ [ "$email" = yes ] && [ ! -e /var/lib/koha/$name/email.enabled ] && continue
+ [ "$noemail" = yes ] && [ -e /var/lib/koha/$name/email.enabled ] && continue
+ echo "$name"
done
for name in "$@"
do
- sudo -u "$name-koha" \
+ sudo -u "$name-koha" -H \
env PERL5LIB=/usr/share/koha/lib \
KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
/usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -a $opts
May 5 2010 General IRC meeting http://wiki.koha-community.org/wiki/General_Meeting,_May_5_2010
May 5 2010 Matthew Hunt becomes the 114th committer to have a patch accepted
May 19 2010 Marcel de Rooy becomes the 115th committer to have a patch accepted
+July 19 2010 Andrew Chilton becomes the 116th committer to have a patch accepted
+June 2 2010 General IRC meeting http://wiki.koha-community.org/wiki/General_IRC_Meeting,_2_June_2010
+July 7 2010 General IRC meeting http://wiki.koha-community.org/wiki/General_IRC_Meeting,_7_July_2010
+June 25 2010 Koha 3.2 Beta released http://koha-community.org/koha-3-2-beta-released/
+July 13 2010 License meeting http://wiki.koha-community.org/wiki/License_Upgrade_Vote_IRC_Meeting,_13_July_2010
+August 11 2010 General IRC meeting http://wiki.koha-community.org/wiki/General_IRC_Meeting,_11_August_2010
+September 1 2010 General IRC meeting http://wiki.koha-community.org/wiki/General_IRC_Meeting,_1_September_2010
+
map Ý y
# mapping blank string
-map (^impr) @
+map (^impr\s) @
map (^impr\.) @
-map (^Impr) @
+map (^Impr\s) @
map (^Impr\.) @
-map (^IMPR) @
+map (^IMPR\s) @
map (^IMPR\.) @
-map (^DL) @
+map (^DL\s) @
map (^DL\.) @
-map (^Dl) @
+map (^Dl\s) @
map (^Dl\.) @
-map (^dl) @
+map (^dl\s) @
map (^dl\.) @
-map (^cop) @
+map (^cop\s) @
map (^cop\.) @
-map (^Cop) @
+map (^Cop\s) @
map (^Cop\.) @
-map (^COP) @
+map (^COP\s) @
map (^COP\.) @
-map (^c) @
+map (^c\s) @
map (^c\.) @
-map (^C) @
+map (^C\s) @
map (^C\.) @
map (^\[sd\]) @
map (^\[s\.d\.\]) @
idzebra-2.0-utils \
libalgorithm-checkdigits-perl \
libbiblio-endnotestyle-perl \
+libbusiness-isbn-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-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 \
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 \
+libnet-server-perl \
libnumber-format-perl \
libpdf-api2-perl \
-libpdf-api2-perl \
libpdf-reuse-barcode-perl \
libpdf-reuse-perl \
-libpoe-perl \
+libpdf-table-perl \
libpoe-perl \
libschedule-at-perl \
libtext-charwidth-perl \
--- /dev/null
+#!/bin/sh
+
+UBUNTU_PACKAGES=`dirname $0`/ubuntu.packages
+
+# sanity checks
+
+if [ ! -e $UBUNTU_PACKAGES ]; then
+ echo ERROR: Could not find $UBUNTU_PACKAGES file for running check.
+ exit
+fi
+
+# main
+
+UBUNTU_PACKAGES_LIST=`awk '{print $1}' $UBUNTU_PACKAGES | grep -v '^\s*#' | grep -v '^\s*$'`
+for F in $UBUNTU_PACKAGES_LIST; do
+ UBUNTU_PKG_POLICY=`apt-cache policy $F | grep "Installed:"`
+ UBUNTU_PKG_VERSION=`echo $UBUNTU_PKG_POLICY | awk '{print $2}'`
+ echo "$F = $UBUNTU_PKG_VERSION"
+done
-at install
-apache2 install
-cvs install
-daemon install
-libgcrypt11 install
-libgcrypt11-dev install
-make install
-gcc install
-gettext install
-mysql-server install
-libcgi-session-perl install
-libclass-factory-util-perl install
-libdate-calc-perl install
-libdate-manip-perl install
-libdate-ical-perl install
-libdatetime-format-mail-perl install
-libgraphics-magick-perl install
-libmail-sendmail-perl install
-liblingua-ispell-perl install
-liblingua-stem-perl install
-libdbd-mysql-perl install
-idzebra-2.0 install
-idzebra-2.0-common install
-idzebra-2.0-doc install
-idzebra-2.0-utils install
-libclass-factory-util-perl install
+apache2 install
+at install
+daemon install
+gcc install
+gettext install
+make install
+
+# mysql packages
+
+mysql-server install
+libmysqlclient16 install
+libmysqlclient16-dev install
+
+# yaz packages
+
+yaz install
+yaz-doc install
+libyaz3 install
+libyaz3-dev install
+
+# zebra packages
+
+idzebra-2.0 install
+idzebra-2.0-common install
+idzebra-2.0-doc install
+idzebra-2.0-utils install
+libidzebra-2.0-0 install
+libidzebra-2.0-dev 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
+
+# crypto packages
+
+libgcrypt11 install
+libgcrypt11-dev install
+
+# xml/xslt packages
+
+libxml2 install
+libxml2-dev install
+libxml2-utils install
+libxslt1.1 install
+libxslt1-dev install
+
+# perl packages
+
+libalgorithm-checkdigits-perl install
+libauthen-cas-client-perl install
+libbiblio-endnotestyle-perl install
+libcgi-session-perl install
+libcgi-session-serialize-yaml-perl install
+libclass-factory-util-perl install
+libdata-ical-perl install
+libdate-calc-perl install
+libdate-ical-perl install
+libdate-manip-perl install
+libdatetime-perl install
+libdatetime-format-mail-perl install
libdatetime-format-strptime-perl install
-libdatetime-format-w3cdtf-perl install
-libdatetime-locale-perl install
-libdatetime-perl install
-liblist-moreutils-perl install
-libdatetime-timezone-perl install
-libdbi-perl install
-libidzebra-2.0 install
-libidzebra-2.0-dev 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
-libmysqlclient15-dev install
-libnet-ldap-perl install
-liblist-moreutils-perl install
-liblocale-gettext-perl install
-liblocale-po-perl install
-libpdf-api2-perl install
-libmime-lite-perl install
-libpoe-perl install
-libtext-csv-perl install
-libtext-charwidth-perl install
-libtext-iconv-perl install
-libtext-wrapi18n-perl install
-libtime-duration-perl install
-libtime-format-perl install
-libtimedate-perl install
-libunix-syslog-perl install
-libxml-dom-perl install
-libxml-dumper-perl install
-libxml-namespacesupport-perl install
-libxml-parser-perl install
-libxml-perl install
-libxml-simple-perl install
-libxml-regexp-perl install
-libxml-xslt-perl install
-libxml-libxml-perl install
-libxml-libxslt-perl install
-libxml2 install
-libxml2-dev install
-libxml2-utils install
-libxslt1-dev install
-libxslt1.1 install
-libyaml-syck-perl install
-libyaz install
-libyaz-dev install
-yaz install
-yaz-doc install
-libcgi-session-serialize-yaml-perl install
-libdata-ical-perl install
-libhtml-template-pro-perl install
-libmarc-charset-perl install
-bmarc-record-perl install
-libmarc-xml-perl install
-libnet-z3950-zoom-perl install
-libpdf-reuse-perl install
-libpdf-reuse-barcode-perl install
-libsms-send-perl install
-libschedule-at-perl install
-libxml-rss-perl install
-libmime-lite-perl install
+libdatetime-format-w3cdtf-perl install
+libdatetime-locale-perl install
+libdatetime-timezone-perl install
+libdbd-mysql-perl install
+libdbd-sqlite2-perl install
+libdbi-perl install
+libemail-date-perl install
+libgd-barcode-perl install
+libgraphics-magick-perl install
+libhtml-scrubber-perl install
+libhtml-template-pro-perl install
+liblingua-ispell-perl install
+liblingua-stem-perl install
+liblingua-stem-snowball-perl install
+liblist-moreutils-perl install
+liblocale-gettext-perl install
+liblocale-po-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
+libmodule-install-perl install
+libnet-ldap-perl install
+libnet-server-perl install
+libnet-z3950-zoom-perl install
+libnumber-format-perl install
+libpdf-api2-perl install
+libpdf-reuse-perl install
+libpdf-reuse-barcode-perl install
+libpdf-table-perl install
+libpoe-perl install
+libschedule-at-perl install
+libsms-send-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
+libuniversal-require-perl install
+libunix-syslog-perl install
+libxml-perl 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-regexp-perl install
+libxml-rss-perl install
+libxml-sax-writer-perl install
+libxml-simple-perl install
+libxml-xslt-perl install
+libyaml-perl install
+libyaml-syck-perl install
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('borrowerRelationship','Vater|Mutter','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('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('BorrowersTitles','Herr|Frau','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?
{ text: _("Attach Item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" },
{ text: _("Edit as New (Duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&frameworkcode=&op=duplicate" },
{ text: _("Delete Record"), onclick: {fn: confirm_deletion }<!-- TMPL_IF NAME="count" -->,id:'disabled'<!-- /TMPL_IF --> },
- { text: _("Delete all Items"), onclick: {fn: confirm_items_deletion } }
+ { text: _("Delete all Items"), onclick: {fn: confirm_items_deletion }<!-- TMPL_UNLESS NAME="count" -->,id:'disabled'<!-- /TMPL_UNLESS --> }
];
var savemenu = [
<option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="branchname" --></option><!-- /TMPL_IF -->
<!-- /TMPL_LOOP --></select>
<label for="categorycode">Category: </label><select name="categorycode" id="categorycode">
- <option value="">Any</option><!-- TMPL_LOOP name="categoryloop" -->
+ <option value="">Any</option><!-- TMPL_LOOP name="categories" -->
<!-- TMPL_IF NAME="selected" -->
<option value="<!-- TMPL_VAR name="categorycode" -->" selected="selected"><!-- TMPL_VAR name="description" --></option><!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR name="categorycode" -->"><!-- TMPL_VAR name="description" --></option><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="authorities" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Authority Control" href="/cgi-bin/koha/admin/preferences.pl?tab=authorities">Authorities</a></li>
<!-- TMPL_IF NAME="cataloguing" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Cataloging" href="/cgi-bin/koha/admin/preferences.pl?tab=cataloguing">Cataloging</a></li>
<!-- TMPL_IF NAME="circulation" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Circulation" href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">Circulation</a></li>
-<!-- TMPL_IF NAME="Creators" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Creators" href="/cgi-bin/koha/admin/preferences.pl?tab=creators">Creators</a></li>
+<!-- TMPL_IF NAME="creators" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Creators" href="/cgi-bin/koha/admin/preferences.pl?tab=creators">Creators</a></li>
<!-- TMPL_IF NAME="enhanced-content" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Enhanced Content Settings" href="/cgi-bin/koha/admin/preferences.pl?tab=enhanced-content">Enhanced Content</a></li>
<!-- TMPL_IF NAME="i18n-l10n" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Internationalization and Localization" href="/cgi-bin/koha/admin/preferences.pl?tab=i18n-l10n">I18N/L10N</a></li>
<!-- TMPL_IF NAME="local-use" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/admin/systempreferences.pl">Local Use</a></li>
+++ /dev/null
-<div id="menu">
-<ul>
-<!-- TMPL_IF NAME="Acquisitions" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Acquisitions" href="/cgi-bin/koha/admin/preferences.pl?tab=acquisitions">Acquisitions</a></li>
-<!-- TMPL_IF NAME="Admin" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Administration" href="/cgi-bin/koha/admin/preferences.pl?tab=admin">Administration</a></li>
-<!-- TMPL_IF NAME="Authorities" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Authority Control" href="/cgi-bin/koha/admin/preferences.pl?tab=authorities">Authorities</a></li>
-<!-- TMPL_IF NAME="Cataloging" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Cataloging" href="/cgi-bin/koha/admin/preferences.pl?tab=cataloging">Cataloging</a></li>
-<!-- TMPL_IF NAME="Circulation" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Circulation" href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">Circulation</a></li>
-<!-- TMPL_IF NAME="Creators" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Creators" href="/cgi-bin/koha/admin/preferences.pl?tab=creators">Creators</a></li>
-<!-- TMPL_IF NAME="EnhancedContent" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Enhanced content settings" href="/cgi-bin/koha/admin/preferences.pl?tab=enhanced-content">Enhanced Content</a></li>
-<!-- TMPL_IF NAME="I18N/L10N" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Internationalization and Localization" href="/cgi-bin/koha/admin/preferences.pl?tab=i18n-l10n">I18N/L10N</a></li>
-<!-- TMPL_IF NAME="" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/admin/systempreferences.pl">Local Use</a></li>
-<!-- TMPL_IF NAME="Logs" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Transaction Logs" href="/cgi-bin/koha/admin/preferences.pl?tab=logs">Logs</a></li>
-<!-- TMPL_IF NAME="OPAC" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Online Public Access Catalog" href="/cgi-bin/koha/admin/preferences.pl?tab=opac">OPAC</a></li>
-<!-- TMPL_IF NAME="Patrons" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Patrons" href="/cgi-bin/koha/admin/preferences.pl?tab=patrons">Patrons</a></li>
-<!-- TMPL_IF NAME="Searching" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Searching" href="/cgi-bin/koha/admin/preferences.pl?tab=searching">Searching</a></li>
-<!-- TMPL_IF NAME="Serials" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Serials" href="/cgi-bin/koha/admin/preferences.pl?tab=serials">Serials</a></li>
-<!-- TMPL_IF NAME="StaffClient" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Staff Client" href="/cgi-bin/koha/admin/preferences.pl?tab=staff-client">Staff Client</a></li>
-<!-- TMPL_IF NAME="OAI-PMH" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Web Services" href="/cgi-bin/koha/admin/preferences.pl?tab=web-services">Web Services</a></li>
-</ul>
-</div>
<li>Danny Bouman</li>
<li>Stan Brinkerhoff</li>
<li>Roger Buck</li>
- <li>Jared Camins-Esakov</li>
+ <li><a href="https://www.ohloh.net/p/koha/contributors/6620692376789">Jared Camins-Esakov</a></li>
<li>Colin Campbell</li>
<li>DeAndre Carroll</li>
<li>Chris Catalfo (new plugin MARC editor)</li>
<li>Ecole des Mines de Saint Etienne, Philippe Jaillon (OAI-PMH support)</li>
<li>Stephen Edwards</li>
<li>Andrew Elwell</li>
- <li>Magnus Enger</li>
+ <li><a href="https://www.ohloh.net/p/koha/contributors/6618544677502">Magnus Enger</a></li>
<li>Esiee School (Jérome Vizcaino, Michel Lerenard, Pierre Cauchois)</li>
<li>Pate Eyler (Kaitiaki from 2002 to 2004)</li>
<li><a href="https://www.ohloh.net/p/koha/contributors/6618544609865">Antoine Farnault</a></li>
- <li>Katrin Fischer</li>
+ <li><a href="https://www.ohloh.net/p/koha/contributors/6618544670742">Katrin Fischer</a></li>
<li>Clay Fouts</li>
<li>Marco Gaiarin</li>
<li>Brendan A. Gallagher</li>
<legend>Basket details</legend>
<ol>
<!-- TMPL_IF NAME="basketnote" --><li><span class="label">Internal note:</span> <!-- TMPL_VAR NAME="basketnote" --></li><!-- /TMPL_IF -->
- <!-- TMPL_IF NAME="basketbooksellernote" --><li><span class="label">Vendor note</span>: <!-- TMPL_VAR NAME="basketbooksellernote" --></li><!-- /TMPL_IF -->
+ <!-- TMPL_IF NAME="basketbooksellernote" --><li><span class="label">Vendor note:</span> <!-- TMPL_VAR NAME="basketbooksellernote" --></li><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="basketcontractno" -->
<li><span class="label">Contract number: </span><!-- TMPL_VAR NAME="basketcontractno" --></li>
<li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=<!-- TMPL_VAR NAME="basketcontractno" -->"><!-- TMPL_VAR NAME="basketcontractname" --></a></li>
<li>
<!-- TMPL_IF name="biblionumber" -->
<span class="label">ISBN: </span>
- <input type="hidden" size="20" name="ISBN" id="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->" /><!-- TMPL_VAR NAME="isbn" -->
+ <input type="hidden" size="20" name="isbn" id="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->" /><!-- TMPL_VAR NAME="isbn" -->
<!-- TMPL_ELSE -->
<label for="ISBN">ISBN: </label>
- <input type="text" size="20" name="ISBN" id="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->" />
+ <input type="text" size="20" name="isbn" id="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->" />
<!-- /TMPL_IF -->
</li>
<li>
<!-- TMPL_IF name="biblionumber" -->
<span class="label">Series: </span>
- <input type="hidden" size="20" name="series" id="series" value="<!-- TMPL_VAR NAME="seriestitle" -->" /><span class="title"><!-- TMPL_VAR NAME="seriestitle" --></span>
+ <input type="hidden" size="20" name="series" id="series" value="<!-- TMPL_VAR NAME="seriestitle" -->" /><!-- TMPL_VAR NAME="seriestitle" -->
<!-- TMPL_ELSE -->
<label for="series">Series: </label>
<input type="text" size="20" name="series" id="series" value="<!-- TMPL_VAR NAME="seriestitle" -->" />
<div class="yui-u first">
<form action="/cgi-bin/koha/admin/preferences.pl" method="post">
<fieldset>
-<h4><a href="/cgi-bin/koha/admin/systempreferences.pl">Global system preferences</a></h4>
+<h4><a href="/cgi-bin/koha/admin/preferences.pl">Global system preferences</a></h4>
<p>Manage global system preferences like MARC flavor, date format, administrator email, and templates.</p>
<input type="hidden" name="op" value="search" />
<input type="text" name="searchfield" value="<!-- TMPL_VAR NAME="searchfield" -->" />
</div>
</div>
<div class="yui-b">
-<!-- TMPL_INCLUDE NAME="sysprefs-menu.inc" -->
+<!-- TMPL_INCLUDE NAME="prefs-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
<Title>Koha -- Authority details</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript">
- window.onload = go();
-
- function go(){
+//<![CDATA[
+ $(document).ready(function(){
var index_start = "<!-- TMPL_VAR NAME='index' -->";
var whichfield;
try {
window.close();
return false;
- }
+ });
+//]]>
</script>
</head>
<body>
</div>
</div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
+<!-- TMPL_INCLUDE NAME="popup-bottom.inc" -->
// setting its '+' and '-' buttons
try {
- var spans = divs[i].getElementsByTagName('span');
- for (var j = 0; j < spans.length; j++) {
- if(spans[j].getAttribute('class') == 'buttonPlus'){
- spans[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
- } else if (spans[j].getAttribute('class') == 'buttonMinus') {
- spans[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
+ var anchors = divs[i].getElementsByTagName('a');
+ for (var j = 0; j < anchors.length; j++) {
+ if(anchors[j].getAttribute('class') == 'buttonPlus'){
+ anchors[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
+ } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
+ anchors[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
}
}
}
label.setAttribute('for',id_input);
<!-- /TMPL_UNLESS -->
- // setting a new if for the parent div
+ // setting a new id for the parent div
clone.setAttribute('id',new_id);
try {
var buttonUp = clone.getElementsByTagName('img')[0];
buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
- var spans = clone.getElementsByTagName('span');
- if(spans.length){
- for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
- if(spans[i].getAttribute('class') == 'buttonPlus'){
- spans[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
- } else if (spans[i].getAttribute('class') == 'buttonMinus') {
- spans[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
+ var anchors = clone.getElementsByTagName('a');
+ if(anchors.length){
+ for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
+ if(anchors[i].getAttribute('class') == 'buttonPlus'){
+ anchors[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
+ } else if (anchors[i].getAttribute('class') == 'buttonMinus') {
+ anchors[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
}
}
}
<!-- TMPL_VAR NAME="marc_value" -->
<!-- TMPL_IF NAME="repeatable" -->
- <span class="subfield_controls"><a href="#" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a>
- <a href="#" onclick="UnCloneField('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a></span>
+ <span class="subfield_controls"><a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a>
+ <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a></span>
<!-- /TMPL_IF -->
<p>It is a good idea to be selective in choosing servers. Defining more than five or six checked servers may slow down your Z39.50 search results, even if they are queried all together.</p>
-<p>IMPORTANT NOTE : the z3950search will NOT work until your system administrator has not activated the z3950 client daemon on your server. The daemon is in KohaDirectory/script/z3950daemon. It should be added to rc.d to be launched during server boot.</p>
-
<!-- TMPL_INCLUDE name="help-bottom.inc" -->
\ No newline at end of file
<option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="branchname" --></option><!-- /TMPL_IF -->
<!-- /TMPL_LOOP --></select></li>
<li><label for="categorycode">Category: </label><select name="categorycode" id="categorycode">
- <option value="">Any</option><!-- TMPL_LOOP name="categoryloop" -->
+ <option value="">Any</option><!-- TMPL_LOOP name="categories" -->
<!-- TMPL_IF NAME="selected" -->
<option value="<!-- TMPL_VAR name="categorycode" -->" selected="selected"><!-- TMPL_VAR name="description" --></option><!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR name="categorycode" -->"><!-- TMPL_VAR name="description" --></option><!-- /TMPL_IF -->
}
if (_alertString.length==0) {
- document.Aform.submit();
+ document.f.submit();
} else {
alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n\n";
<xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>
- <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
+ <xsl:for-each select="marc:datafield[@tag=490]">
<a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">bcg</xsl:with-param>
+ <xsl:with-param name="codes">abcg</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
+ <xsl:with-param name="codes">abcdtvxyz</xsl:with-param>
<xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
<xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
</xsl:call-template>
}
if (_alertString.length==0) {
- document.Aform.submit();
+ document.f.submit();
} else {
alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n\n";
<xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>
- <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
+ <xsl:for-each select="marc:datafield[@tag=490]">
<a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">bcg</xsl:with-param>
+ <xsl:with-param name="codes">abcg</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
+ <xsl:with-param name="codes">abcdtvxyz</xsl:with-param>
<xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
<xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
</xsl:call-template>
<span class="label">Publisher: </span>
<xsl:for-each select="marc:datafield[@tag=260]">
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">bcg</xsl:with-param>
+ <xsl:with-param name="codes">abcg</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</span>
</xsl:for-each>
</span>
</xsl:if>
-
- <span class="results_summary">
- <span class="label">Availability: </span>
- <xsl:choose>
- <xsl:when test="marc:datafield[@tag=856]">
+ <xsl:if test="marc:datafield[@tag=856]">
+ <span class="results_summary">
+ <span class="label">Online Access: </span>
<xsl:for-each select="marc:datafield[@tag=856]">
<xsl:if test="$OPACURLOpenInNewWindow='0'">
<a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
</a>
</xsl:if>
<xsl:choose>
- <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
<xsl:otherwise> | </xsl:otherwise>
</xsl:choose>
</xsl:for-each>
- </xsl:when>
-
-
+ </span>
+ </xsl:if>
+ <span class="results_summary">
+ <span class="label">Availability: </span>
+ <xsl:choose>
<xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">No copies available
</xsl:when>
<xsl:when test="count(key('item-by-status', 'available'))>0">
select="key('item-by-status', 'available')"/>
<xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
<xsl:value-of select="items:homebranch"/>
- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
<xsl:text> (</xsl:text>
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
<xsl:text>)</xsl:text>
select="key('item-by-status', 'reference')"/>
<xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
<xsl:value-of select="items:homebranch"/>
- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
<xsl:text> (</xsl:text>
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
<xsl:text>)</xsl:text>
<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE stylesheet [<!ENTITY nbsp " " >]>
+
<xsl:stylesheet version="1.0"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:items="http://www.koha.org/items"
<?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
+
+<!DOCTYPE stylesheet [<!ENTITY nbsp " " >]>
+
<xsl:stylesheet version="1.0"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:items="http://www.koha.org/items"
<?xml version='1.0'?>
+
+<!DOCTYPE stylesheet [<!ENTITY nbsp " " >]>
+
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="datafield">
</xsl:if>
</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
format_string => $layout->get_attr('format_string'),
text_wrap_cols => $layout->get_text_wrap_cols(label_width => $template->get_attr('label_width'), left_text_margin => $template->get_attr('left_text_margin')),
);
+ $pdf->Add($label_a->draw_guide_box) if $layout->get_attr('guidebox');
my $label_a_text = $label_a->create_label();
_print_text($label_a_text);
($row_count, $col_count, $llx, $lly) = _calc_next_label_pos($row_count, $col_count, $llx, $lly);
format_string => $layout->get_attr('format_string'),
text_wrap_cols => $layout->get_text_wrap_cols(label_width => $template->get_attr('label_width'), left_text_margin => $template->get_attr('left_text_margin')),
);
+ $pdf->Add($label_b->draw_guide_box) if $layout->get_attr('guidebox');
my $label_b_text = $label_b->create_label();
($row_count, $col_count, $llx, $lly) = _calc_next_label_pos($row_count, $col_count, $llx, $lly);
next LABEL_ITEMS;
format_string => $layout->get_attr('format_string'),
text_wrap_cols => $layout->get_text_wrap_cols(label_width => $template->get_attr('label_width'), left_text_margin => $template->get_attr('left_text_margin')),
);
+ $pdf->Add($label->draw_guide_box) if $layout->get_attr('guidebox');
my $label_text = $label->create_label();
_print_text($label_text) if $label_text;
($row_count, $col_count, $llx, $lly) = _calc_next_label_pos($row_count, $col_count, $llx, $lly);
$cgi->param('format_string', $format_string);
}
my @params = (
- barcode_type => $cgi->param('barcode_type'),
- printing_type => $cgi->param('printing_type'),
- layout_name => $cgi->param('layout_name'),
+ barcode_type => $cgi->param('barcode_type') || 'CODE39',
+ printing_type => $cgi->param('printing_type') || 'BAR',
+ layout_name => $cgi->param('layout_name') || 'DEFAULT',
guidebox => ($cgi->param('guidebox') ? 1 : 0),
- font => $cgi->param('font'),
- font_size => $cgi->param('font_size'),
+ font => $cgi->param('font') || 'TR',
+ font_size => $cgi->param('font_size') || 3,
callnum_split => ($cgi->param('callnum_split') ? 1 : 0),
- text_justify => $cgi->param('text_justify'),
- format_string => $cgi->param('format_string'),
+ text_justify => $cgi->param('text_justify') || 'L',
+ format_string => $cgi->param('format_string') || 'title, author, isbn, issn, itemtype, barcode, callnumber',
);
if ($layout_id) { # if a label_id was passed in, this is an update to an existing layout
$layout = C4::Labels::Layout->retrieve(layout_id => $layout_id);
}
elsif ($op eq 'save') {
my @params = (
- printer_name => $cgi->param('printer_name'),
- paper_bin => $cgi->param('paper_bin'),
- offset_horz => $cgi->param('offset_horz'),
- offset_vert => $cgi->param('offset_vert'),
- creep_horz => $cgi->param('creep_horz'),
- creep_vert => $cgi->param('creep_vert'),
- units => $cgi->param('units'),
+ printer_name => $cgi->param('printer_name') || 'DEFAULT PRINTER',
+ paper_bin => $cgi->param('paper_bin') || 'Tray 1',
+ offset_horz => $cgi->param('offset_horz') || 0,
+ offset_vert => $cgi->param('offset_vert') || 0,
+ creep_horz => $cgi->param('creep_horz') || 0,
+ creep_vert => $cgi->param('creep_vert') || 0,
+ units => $cgi->param('units') || 'POINT',
);
if ($profile_id) { # if a label_id was passed in, this is an update to an existing layout
$profile = C4::Labels::Profile->retrieve(profile_id => $profile_id);
}
elsif ($op eq 'save') {
my @params = ( profile_id => $cgi->param('profile_id') || '',
- template_code => $cgi->param('template_code'),
- template_desc => $cgi->param('template_desc'),
- page_width => $cgi->param('page_width'),
- page_height => $cgi->param('page_height'),
- label_width => $cgi->param('label_width'),
- label_height => $cgi->param('label_height'),
- top_text_margin => $cgi->param('top_text_margin'),
- left_text_margin=> $cgi->param('left_text_margin'),
- top_margin => $cgi->param('top_margin'),
- left_margin => $cgi->param('left_margin'),
- cols => $cgi->param('cols'),
- rows => $cgi->param('rows'),
- col_gap => $cgi->param('col_gap'),
- row_gap => $cgi->param('row_gap'),
- units => $cgi->param('units'),
+ template_code => $cgi->param('template_code') || 'DEFAULT_TEMPLATE',
+ template_desc => $cgi->param('template_desc') || 'Default description',
+ page_width => $cgi->param('page_width') || 0,
+ page_height => $cgi->param('page_height') || 0,
+ label_width => $cgi->param('label_width') || 0,
+ label_height => $cgi->param('label_height') || 0,
+ top_text_margin => $cgi->param('top_text_margin') || 0,
+ left_text_margin=> $cgi->param('left_text_margin') || 0,
+ top_margin => $cgi->param('top_margin') || 0,
+ left_margin => $cgi->param('left_margin') || 0,
+ cols => $cgi->param('cols') || 0,
+ rows => $cgi->param('rows') || 0,
+ col_gap => $cgi->param('col_gap') || 0,
+ row_gap => $cgi->param('row_gap') || 0,
+ units => $cgi->param('units') || 'POINT',
);
if ($template_id) { # if a label_id was passed in, this is an update to an existing layout
$label_template = C4::Labels::Template->retrieve(template_id => $template_id);
$count =scalar(@$results);
}
my @resultsdata;
-my $to=($count>$to?$to:$count);
+$to=($count>$to?$to:$count);
my $index=$from;
foreach my $borrower(@$results[$from..$to-1]){
#find out stats
}
}
- if(C4::Context->preference('uppercasesurnames')) {
+ if($newdata{surname} && C4::Context->preference('uppercasesurnames')) {
$newdata{'surname'} = uc($newdata{'surname'});
}
sub usage {
print STDERR <<USAGE;
Usage: $0 [-h|--help] [--sessions] [-v|--verbose] [--zebraqueue DAYS]
- -h --help prints this help message, and exits, ignoring all other options
- --sessions purge the sessions table. If you use this while users are logged
- into Koha, they will have to reconnect.
- -v --verbose will cause the script to give you a bit more information about the run.
- --zebraqueue DAYS purge completed entries from the zebraqueue from more than DAYS days ago.
+ [-m|--mail]
+ -h --help prints this help message, and exits, ignoring all
+ other options
+ --sessions purge the sessions table. If you use this while users
+ are logged into Koha, they will have to reconnect.
+ -v --verbose will cause the script to give you a bit more information
+ about the run.
+ --zebraqueue DAYS purge completed entries from the zebraqueue from
+ more than DAYS days ago.
+ -m --mail purge the mail queue.
USAGE
exit $_[0];
}
-my ($help, $sessions, $verbose, $zebraqueue_days);
+my ($help, $sessions, $verbose, $zebraqueue_days, $mail);
GetOptions(
- 'h|help' => \$help,
- 'sessions' => \$sessions,
+ 'h|help' => \$help,
+ 'sessions' => \$sessions,
'v|verbose' => \$verbose,
+ 'm|mail' => \$mail,
'zebraqueue:i' => \$zebraqueue_days,
) || usage(1);
usage(0);
}
-if (!($sessions || $zebraqueue_days)){
+if (!($sessions || $zebraqueue_days || $mail)){
print "You did not specify any cleanup work for the script to do.\n\n";
usage(1);
}
print "$count records were deleted.\nDone with zebraqueue purge.\n";
}
}
+
+if ($mail) {
+ if ($verbose) {
+ $sth = $dbh->prepare("SELECT COUNT(*) FROM message_queue");
+ $sth->execute() or die $dbh->errstr;
+ my @count_arr = $sth->fetchrow_array;
+ print "Deleting $count_arr[0] entries from the mail queue.\n";
+ }
+ $sth = $dbh->prepare("TRUNCATE message_queue");
+ $sth->execute() or $dbh->errstr;
+ print "Done with purging the mail queue.\n" if ($verbose);
+}
exit(0);
sent to standard out or to a filename if provided. Otherwise, only
overdues that could not be emailed are sent in CSV format to the admin.
+=item B<-html>
+
+Produces html data. if patron does not have a mail address or
+-n (no mail) flag is set, an html file is generated in the specified
+directory. This can be downloaded or futher processed by library staff.
+
=item B<-itemscontent>
comma separated list of fields that get substituted into templates in
$item_format = $1;
}
if ($params->{'letter'}->{'content'} =~ m/<fine>(.*)<\/fine>/) { # process any fine tags...
- no strict; # currency_format behaves badly if we quote the bareword for some reason...
my $formatted_fine = currency_format("$1", "$fine", FMT_SYMBOL);
- use strict;
- $formatted_fine = Encode::encode("utf8", $formatted_fine);
$params->{'letter'}->{'content'} =~ s/<fine>.*<\/fine>/$formatted_fine/;
}
$params->{'letter'} = C4::Letters::parseletter( $params->{'letter'}, 'biblio', $item );
#
$|=1; # flushes output
-
+# If the cron job starts us in an unreadable dir, we will break without
+# this.
+chdir $ENV{HOME} if (!(-r '.'));
my $directory;
my $nosanitize;
my $skip_export;
}
}
} elsif (defined $t) {
+ # Quick fix to bug 4472
+ $t = "<!DOCTYPE stylesheet [" if $t =~ /DOCTYPE stylesheet/ ;
print $output $t;
}
}
@biblionumber = (split /\//,$biblionumber[0]);
}
for my $bib (@biblionumber){
- AddToShelfFromBiblio($bib, $shelfnumber);
+ AddToShelf($bib, $shelfnumber);
}
}
}
}
my $hasRouting = check_routing($subscriptionid);
-my ($totalissues,@serialslist) = GetSerials($subscriptionid);
-$totalissues-- if $totalissues; # the -1 is to have 0 if this is a new subscription (only 1 issue)
-# the subscription must be deletable if there is NO issues for a reason or another (should not happend, but...)
my ($user, $sessionID, $flags);
($user, $cookie, $sessionID, $flags)
'"YES"', \&f, 'OK:1', 'YES' # verify case insensitivity
# Illegal strings
-# ], [
-# 'undef', \&f, C4::Boolean::INVALID_BOOLEAN_STRING_EXCEPTION, undef
-# ], [
-# '"foo"', \&f, C4::Boolean::INVALID_BOOLEAN_STRING_EXCEPTION, 'foo'
+ ], [
+ 'undef', \&f, 'OK:', undef
+ ], [
+ '"foo"', \&f, 'OK:', 'foo'
],
);
}
-BEGIN { $| = 1; print "1..2\n"; }
-END {print "not ok 1\n" unless $loaded;}
-use C4::Koha;
-$loaded = 1;
-print "ok 1\n";
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+use_ok('C4::Koha');
#
# test that &slashifyDate returns correct (non-US) date
#
-$date = "01/01/2002";
-$newdate = &slashifyDate("2002-01-01");
-
-if ($date eq $newdate) {
- print "ok 2\n";
-} else {
- print "not ok 2\n";
-}
-
+my $date = "01/01/2002";
+my $newdate = &slashifyDate("2002-01-01");
+ok($date eq $newdate, 'slashifyDate');
+++ /dev/null
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 6;
-
-BEGIN {
- use FindBin;
- use lib $FindBin::Bin;
- use override_context_prefs;
- use_ok('C4::Auth', qw(checkpw));
- use_ok('C4::Context');
-}
-
-use vars qw($dbh $ldap);
-can_ok('C4::Context', 'config');
-can_ok('C4::Context', 'dbh');
-can_ok('C4::Auth', qw(checkpw));
- ok($dbh = C4::Context->dbh(), "Getting dbh from C4::Context");
-$ldap = C4::Context->config('useldapserver') || 0;
-diag("Using LDAP? $ldap");
-
-while (1) { # forever!
- print "Do you want to test further accounts? (If not, just hit return.)\n";
- my ($user, $pass);
- print "Enter username: ";
- chomp($user = <>);
- ($user) or exit;
- print "Enter password: ";
- chomp($pass = <>);
- my ($retval,$retcard) = checkpw($dbh,$user,$pass);
- $retval ||= '';
- $retcard ||= '';
- diag ("checkpw(\$dbh,$user,$pass) " . ($retval ? 'SUCCEEDS' : ' FAILS ') . "\treturns ($retval,$retcard)");
-}
-
-END {
- diag("C4::Auth - end of test");
-}
-__END__
+++ /dev/null
-#!/bin/perl
-#
-
-use strict;
-use warnings;
-
-use Test::More;
-use vars qw(%cases $dbh $config $context $ldap);
-
-BEGIN {
- %cases = (
- # users from t/LDAP/example3.ldif
- sss => 'password1',
- jts => 'password1',
- rch => 'password2',
- jmf => 'password3',
- );
- plan tests => 8 + scalar(keys %cases);
- use_ok('C4::Context');
- use_ok('C4::Auth_with_ldap', qw(checkpw_ldap));
-}
-
-sub do_checkpw_ldap (;$$) {
- my ($user,$pass) = (shift,shift);
- diag "($user,$pass)";
- my $ret;
- return ($ret = checkpw_ldap($dbh,$user,$pass), sprintf("(%s,%s) returns '%s'",$user,$pass,$ret));
-}
-
-ok($context= C4::Context->new(), "Getting new C4::Context object");
-ok($dbh = C4::Context->dbh(), "Getting dbh from C4::Context");
-ok($dbh = $context->dbh(), "Getting dbh from \$context object");
-
-$ldap = $ENV{KOHA_USELDAPSERVER};
-if(defined($ldap)) {
- diag "Overriding KOHA_CONF <useldapserver> with \$ENV{KOHA_USELDAPSERVER} = $ldap";
-} else {
- diag 'Note: You can use $ENV{KOHA_USELDAPSERVER} to override KOHA_CONF <useldapserver> for this test';
- $ldap = C4::Context->config('useldapserver');
-}
-ok(defined($ldap), "Checking if \$ENV{KOHA_USELDAPSERVER} or <useldapserver> is defined");
-
-SKIP: {
- $ldap or skip("LDAP is disabled.", scalar(keys %cases) + 2);
- diag("The basis of Authentication is that we don't auth everybody.");
- diag("Let's make sure we reject on bad calls.");
- my $ret;
- ok(!($ret = checkpw_ldap($dbh)), "should reject ( no arguments) returns '$ret'");
- ok(!($ret = checkpw_ldap($dbh,'','')), "should reject (empty arguments) returns '$ret'");
- print "\n";
- diag("Now let's check " . scalar(keys %cases) . " test cases: ");
- foreach (sort keys %cases) {
- ok do_checkpw_ldap($_, $cases{$_});
- }
-}
-1;
use strict;
use warnings;
-use Test::More tests=>18;
+use Test::More tests=>17;
BEGIN {use_ok('C4::Budgets') }
use C4::Budgets;
use C4::Dates;
-print "ok 1\n";
use YAML;
#
, budget_description => "MAPERI"}),
"AddBudgetPeriod with iso dates OK");
-if (C4::Context->preference('dateformat') eq "metric"){
- ok($bpid=AddBudgetPeriod(
- { budget_period_startdate => '01-01-2008'
- , budget_period_enddate => '31-12-2008'
- , budget_description => "MAPERI"}),
- "AddBudgetPeriod returned $bpid");
-}
-elsif (C4::Context->preference('dateformat') eq "us"){
- ok($bpid=AddBudgetPeriod(
- { budget_period_startdate => '01-01-2008'
- , budget_period_enddate => '12-31-2008'
- , budget_description => "MAPERI"}),
- "AddBudgetPeriod returned $bpid");
-}
-
ok($budgetperiod=GetBudgetPeriod($bpid),
"GetBudgetPeriod($bpid) returned ".Dump($budgetperiod));
ok(!GetBudgetPeriod(0) ,"GetBudgetPeriod(0) returned undef : noactive BudgetPeriod");
#| budget_encumb | decimal(28,6) | YES | | 0.000000 | |
#| budget_expend | decimal(28,6) | YES | | 0.000000 | |
#| budget_notes | mediumtext | YES | | NULL | |
-#| budget_description | mediumtext | YES | | NULL | |
#| timestamp | timestamp | NO | | CURRENT_TIMESTAMP | |
#| budget_period_id | int(11) | YES | MUL | NULL | |
#| sort1_authcat | varchar(80) | YES | | NULL | |
"GetBudgets OK");
ok(GetBudgets({budget_period_id=>$bpid})>0,
"GetBudgets With Filter OK");
-ok(GetBudgets({budget_period_id=>$bpid},{"budget_description"=>0})>0,
+ok(GetBudgets({budget_period_id=>$bpid},[{"budget_name"=>0}])>0,
"GetBudgets With Order OK");
-ok(GetBudgets({budget_period_id=>GetBudgetPeriod(0)->{budget_period_id}},{"budget_description"=>0})>0,
+ok(GetBudgets({budget_period_id=>GetBudgetPeriod($bpid)->{budget_period_id}},[{"budget_name"=>0}])>0,
"GetBudgets With Order
Getting Active budgetPeriod OK");
ok($del_status=DelBudget($budget_id),
use strict;
use warnings;
-use Test::More tests => 91;
+use Test::More;
use vars qw($debug $koha $dbh $config $ret);
BEGIN {
}
ok($config = $koha->{config}, 'Getting $koha->{config} ');
-# diag("Examining configuration.");
-diag("Note: The overall number of tests may vary by configuration. Disregard the projected number.");
-1;
-__END__
+done_testing();
+1;
use strict;
use warnings;
-use Test::More tests => 22;
+use Test::More tests => 23;
use C4::Context;
use Data::Dumper;
my $branch_code = $sth->fetchrow_hashref()->{'branchcode'};
diag sprintf('Database returned the following error: %s', $sth->errstr) if $sth->errstr;
my $expected_batch = {
+ creator => 'Labels',
items => [],
branch_code => $branch_code,
batch_stat => 0, # False if any data has changed and the db has not been updated
use strict;
use warnings;
-use Test::More tests => 28;
+use Test::More tests => 36;
use C4::Context;
use Data::Dumper;
}
my $default_layout = {
+ creator => 'Labels',
+ layout_xml => '',
+ units => 'POINT',
+ start_label => 1,
barcode_type => 'CODE39',
printing_type => 'BAR',
layout_name => 'TEST',
diag "Testing Layout->set_attr() method.";
my $new_attr = {
+ creator => 'Labels',
+ layout_xml => '',
+ units => 'POINT',
+ start_label => 1,
barcode_type => 'CODE39',
printing_type => 'BIBBAR',
layout_name => 'TEST',
diag "Testing Layout->delete() method.";
my $del_results = $updated_layout->delete();
-ok($del_results eq 0) || diag "Layout->delete() FAILED";
+ok($del_results ne -1) || diag "Layout->delete() FAILED";
use strict;
use warnings;
-use Test::More tests => 25;
+use Test::More tests => 27;
use C4::Context;
use Data::Dumper;
}
my $expected_profile = {
+ creator => 'Labels',
printer_name => 'Circulation Desk',
template_id => '',
paper_bin => 'bypass',
creep_horz => 0.156,
creep_vert => 0.67,
units => 'INCH',
+ creator => 'Labels',
};
foreach my $key (keys %{$new_attr}) {
use strict;
use warnings;
-use Test::More tests => 52;
+use Test::More tests => 54;
use C4::Context;
use Data::Dumper;
}
my $expect_template = {
+ creator => 'Labels',
profile_id => 0,
template_code => 'DEFAULT TEMPLATE',
template_desc => 'Default description',
diag "Testing Template->set_attr() method.";
my $new_attr = {
+ creator => 'Labels',
profile_id => 0,
template_code => 'Avery 5160 | 1 x 2-5/8',
template_desc => '3 columns, 10 rows of labels',
+++ /dev/null
-#!/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.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-## NOTE: This is really broken at this point and needs updating... -chris_n
-
-use strict;
-use warnings;
-
-#use Test::More;
-use Graphics::Magick;
-use XML::Simple;
-use autouse 'Data::Dumper' => qw(Dumper);
-
-use C4::Context;
-use autouse 'C4::Members' => qw(GetPatronImage);
-use C4::Creators::PDF 1.000000;
-use C4::Patroncards::Patroncard 1.000000;
-
-#BEGIN {
-# use_ok('C4::Patroncards::Patroncard');
-#}
-
-my $borrower_number = 3;
-my $pdf = C4::Creators::PDF->new(InitVars => 0);
-
-# All units are in PostScript points in this script
-$pdf->Mbox(0, 0, 612, 792);
-
-# Convert layout to XML and insert into db
-#my $query = "INSERT INTO creator_layouts (layout_id,layout_xml) VALUES (1,?) ON DUPLICATE KEY UPDATE layout_xml=?;";
-#my $sth = C4::Context->dbh->prepare($query);
-my $layout =
-{
- barcode => {
- type => 'CODE39',
- llx => 26,
- lly => 4.5,
- data => '0002120108',
- text => 1, # controls text_under_barcode display: 1 => visible, 0 => not visible
- },
- text => [
- 'John Doe' => {
- font => 'TB',
- font_size => 13,
- llx => 63, # llx & lly are relative to the llx & lly of the card NOT the page
- lly => 103.5,
- alignment => 'C',
- },
- 'Anytown Public Library' => {
- font => 'TR',
- font_size => 8,
- llx => 63,
- lly => 85.5,
- alignment => 'C',
- },
- 'Line 3 Text' => {
- font => 'TB',
- font_size => 10,
- llx => 63,
- lly => 76.5,
- alignment => 'C',
- },
- ],
- images => {
- patron_image => {
- data_source => {'db' => 'patronimages',
- 'card_number' => '0002120108',
- },
- Sx => 0,
- Sy => 0,
- Ox => 0, # Ox,Oy should be set to 0 unless you want special effects see http://www.adobe.com/devnet/pdf/pdf_reference.html ISO 32000-1
- Oy => 0,
- Tx => 4.5, # Lower left corner of image relative to the lower left corner of the card
- Ty => 63,
- Dx => 72, # point height of display image
- },
- image_1 => {
- data_source => {'db' => 'pcards_images',
- 'image_id' => 1,
- },
- Sx => 0,
- Sy => 0,
- Ox => 0, # Ox,Oy should be set to 0 unless you want special effects see http://www.adobe.com/devnet/pdf/pdf_reference.html ISO 32000-1
- Oy => 0,
- Tx => 100, # Lower left corner of image
- Ty => 50,
- Dx => 81,
- },
- },
-};
-
-#$sth->execute(XMLout($layout),XMLout($layout));
-
-# Retrieve XML from database
-my$query = "SELECT layout_xml FROM creator_layouts WHERE layout_id=20;";
-my $xml = C4::Context->dbh->selectrow_array($query);
-
-# Convert back to hash
-$layout = XMLin($xml);
-
-# Do image foo and place binary image data into layout hash
-my $image_data = {};
-my $alt_image_data = {};
-my $error = undef;
-foreach (keys %{$layout->{'images'}}) {
- warn "Processing key: $_\n";
- if (grep{m/db/} keys(%{$layout->{'images'}->{$_}->{'data_source'}})) {
- warn $layout->{'images'}->{$_}->{'data_source'}->{'db'};
- if ($layout->{'images'}->{$_}->{'data_source'}->{'db'} eq 'patronimages') {
- warn "Processing patron image data.\n";
- ($image_data, $error) = GetPatronImage($layout->{'images'}->{$_}->{'data_source'}->{'card_number'});
- warn sprintf('No image exists for borrower number %s.', $borrower_number) if !$image_data;
- next if !$image_data;
- }
- elsif ($layout->{'images'}->{$_}->{'data_source'}->{'db'} eq 'pcards_images') {
- warn "Processing pcards image data for image_id " . $$layout{'images'}{$_}{'data_source'}{'image_id'} . ".\n";
- my $dbh = C4::Context->dbh();
- $dbh->{LongReadLen} = 1000000; # allows us to read approx 1MB
- $image_data = $dbh->selectrow_hashref("SELECT imagefile FROM pcards_images WHERE image_id = \'$$layout{'images'}{$_}{'data_source'}{'image_id'}\'");
- warn sprintf('Image does not exists in db table %s.', $$layout{'images'}{$_}{'data_source'}{'db'}) if !$image_data;
- next if !$image_data;
- # $string =~ s/(.)/sprintf("%x",ord($1))/eg;
- }
- else {
- warn sprintf('No retrieval method for table %s.', $$layout{'images'}{$_}{'data_source'}{'db'}) if !$image_data;
- }
- warn sprintf('Database returned the following error: %s.', $error) if $error;
- }
- elsif (grep{m/foo/} keys(%{$layout->{'images'}->{$_}->{'data_source'}})) {
- # some other image storage/retrieval method
- }
-
-my $binary_data = $image_data->{'imagefile'};
-my $image = Graphics::Magick->new;
-$image->BlobToImage($binary_data);
-my $alt_image = Graphics::Magick->new;
-$alt_image->BlobToImage($binary_data);
-$alt_image->Set(magick => 'jpg', quality => 100);
-
-warn "Print Image Dimensions: " . $image->Get('width') . " X " . $image->Get('height') . "\n";
-
-my $alt_width = $image->Get('width');
-my $alt_height = $image->Get('height');
-my $ratio = $alt_width / $alt_height;
-my $display_height = $layout->{'images'}->{$_}->{'Dx'};
-my $display_width = $ratio * $display_height;
-$image->Resize(width => $display_width, height => $display_height);
-$image->Set(magick => 'jpg', quality => 100);
-
-warn "Display Image dimensions: " . $image->Get('width') . " X " . $image->Get('height') . "\n";
-
-# Write params for alt image...
- $layout->{'images'}->{$_}->{'alt'}->{'Sx'} = $alt_width;
- $layout->{'images'}->{$_}->{'alt'}->{'Sy'} = $alt_height;
- $layout->{'images'}->{$_}->{'alt'}->{'data'} = $alt_image->ImageToBlob();
-## Write params for display image...
- $layout->{'images'}->{$_}->{'Sx'} = $display_width;
- $layout->{'images'}->{$_}->{'Sy'} = $display_height;
- $layout->{'images'}->{$_}->{'data'} = $image->ImageToBlob();
-}
-die "BREAKPOINT...";
-# Create a new patroncard object
-my $patron_card = C4::Patroncards::Patroncard->new(
- batch_id => 1,
- borrower_number => $borrower_number,
- llx => 36,#13.5 # lower left corner of the card
- lly => 639,
- height => 139.5, # of the card
- width => 229.5,
- layout => $layout,
- text_wrap_cols => 30,
-);
-$patron_card->draw_guide_box($pdf);
-$patron_card->draw_barcode($pdf);
-my $err = $patron_card->draw_image($pdf);
-$patron_card->draw_text($pdf);
-$pdf->End;
-exit(1);
use C4::Debug;
use C4::SQLHelper qw(:all);
-use Test::More tests => 19;
+use Test::More tests => 22;
+
+use_ok('C4::SQLHelper');
-#1
-BEGIN {
- use_ok('C4::SQLHelper');
-}
use C4::Category;
use C4::Branch;
my @categories=C4::Category->all;
my $insert;
ok(($insert=InsertInTable("branches",{branchcode=>"ZZZZ",branchname=>"Brancheinconnue",city=>" ",zipcode=>" "},1))==0,"AddBranch (Insert In Table with primary key defined)");
-my $branches=C4::Branch->GetBranches;
+my $branches=C4::Branch::GetBranches;
my @branchcodes=keys %$branches;
my ($borrid, $borrtmp);
ok($borrid=InsertInTable("borrowers",{firstname=>"Jean",surname=>"Valjean",city=>" ",zipcode=>" ",email=>"email",categorycode=>$categories[0]->{categorycode}, branchcode=>$branchcodes[0]}),"Insert In Table");
$borrtmp=InsertInTable("borrowers",{firstname=>"Jean",surname=>"cocteau",city=>" ",zipcode=>" ",email=>"email",categorycode=>$categories[0]->{categorycode}, branchcode=>$branchcodes[0]});
ok(my $status=UpdateInTable("borrowers",{borrowernumber=>$borrid,firstname=>"Jean",surname=>"Valjean",city=>"Dampierre",zipcode=>" ",email=>"email", branchcode=>$branchcodes[1]}),"Update In Table");
my $borrowers=SearchInTable("borrowers");
-#4
ok(@$borrowers>0, "Search In Table All values");
$borrowers=SearchInTable("borrowers",{borrowernumber=>$borrid});
-#5
ok(@$borrowers==1, "Search In Table by primary key on table");
$borrowers=SearchInTable("borrowers",{firstname=>"Jean"});
-#6
ok(@$borrowers>0, "Search In Table hashref");
$borrowers=SearchInTable("borrowers",{firstname=>"Jean"},[{firstname=>1},{borrowernumber=>1}],undef, [qw(borrowernumber)]);
-#7
ok(($$borrowers[0]{borrowernumber} + 0) > ($$borrowers[1]{borrowernumber} + 0), "Search In Table Order");
$borrowers=SearchInTable("borrowers",{firstname=>"Jean"},[{surname=>0},{firstname=>1}], undef, [qw(firstname surname)]);
-#8
ok(uc($$borrowers[0]{surname}) lt uc($$borrowers[1]{surname}), "Search In Table Order");
$borrowers=SearchInTable("borrowers","Jean");
-#9
ok(@$borrowers>0, "Search In Table string");
-#10
#FIXME : When searching on All the fields of the table, seems to return Junk
eval{$borrowers=SearchInTable("borrowers","Jean Valjean",undef,undef,undef,[qw(firstname surname borrowernumber cardnumber)],"start_with")};
#eval{$borrowers=SearchInTable("borrowers","Jean Valjean",undef,undef,undef,undef,"start_with")};
$debug && warn Dump(@$borrowers);
ok(scalar(@$borrowers)==1 && !($@), "Search In Table does an implicit AND of all the words in strings");
$borrowers=SearchInTable("borrowers",["Valjean",{firstname=>"Jean"}]);
-#11
ok(@$borrowers>0, "Search In Table arrayref");
$borrowers=SearchInTable("borrowers",["Valjean",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)]);
-#12
ok(keys %{$$borrowers[0]} ==1, "Search In Table columns out limit");
$borrowers=SearchInTable("borrowers",["Valjean",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(firstname surname title)]);
-#13
ok(@$borrowers>0, "Search In Table columns out limit to borrowernumber AND filter firstname surname title");
$borrowers=SearchInTable("borrowers",["Valjean",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(firstname title)]);
-#14
ok(@$borrowers==0, "Search In Table columns filter firstname title limit Valjean not in other fields than surname ");
$borrowers=SearchInTable("borrowers",["Val",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(surname)],"start_with");
-#15
ok(@$borrowers>0, "Search In Table columns filter surname Val on a wide search found ");
$borrowers=SearchInTable("borrowers",["Val",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(surname)],"exact");
-#16
ok(@$borrowers==0, "Search In Table columns filter surname Val in exact search not found ");
$borrowers=eval{SearchInTable("borrowers",["Val",{member=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(firstname title)],"exact")};
-#17
ok(@$borrowers==0 && !($@), "Search In Table fails gracefully when no correct field passed in hash");
-#18
$borrowers=eval{SearchInTable("borrowers",["Jea"],undef,undef,undef,[qw(firstname surname borrowernumber)],"start_with")};
ok(@$borrowers>0 && !($@), "Search on simple value in firstname");
$status=DeleteInTable("borrowers",{borrowernumber=>$borrid});
-#19
ok($status>0 && !($@), "DeleteInTable OK");
$status=DeleteInTable("borrowers",{borrowernumber=>$borrtmp});
+ok($status>0 && !($@), "DeleteInTable OK");
+$status=DeleteInTable("branches", {branchcode => 'ZZZZ'});
+ok($status>0 && !($@), "DeleteInTable (branch) OK");
use strict;
use warnings;
+use utf8;
+
use YAML;
use C4::Debug;
use C4::Context;
use C4::Search;
-use Test::More tests => 3;
+use Test::More tests => 4;
-BEGIN {
- use_ok('C4::Search');
-}
-foreach my $string ("Leçon","mod\xc3\xa8les"){
-my @results=C4::Search::_remove_stopwords($string,"kw");
-$debug && warn "$string ",Dump(@results);
-ok($results[0] eq $string,"$string is not modified");
+use_ok('C4::Search');
+
+foreach my $string ("Leçon","modèles") {
+ my @results=C4::Search::_remove_stopwords($string,"kw");
+ $debug && warn "$string ",Dump(@results);
+ ok($results[0] eq $string,"$string is not modified");
}
-foreach my $string ("Les chaussettes de l'archiduchesse"){
-my @results=C4::Search::_remove_stopwords($string,"kw");
-$debug && warn "$string ",Dump(@results);
-ok($results[0] ne $string,"$results[0] from $string");
+
+foreach my $string ("Les chaussettes de l'archiduchesse") {
+ my @results=C4::Search::_remove_stopwords($string,"kw");
+ $debug && warn "$string ",Dump(@results);
+ ok($results[0] ne $string,"$results[0] from $string");
}
# Author : Antoine Farnault, antoine@koha-fr.org
#
-use Test;
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
use C4::Context;
-# Making 30 tests.
-BEGIN { plan tests => 112 }
+use Test::More tests => 92;
# Getting some borrowers from database.
my $dbh = C4::Context->dbh;
push @borrowers, $borrower;
}
-# Getting some itemnumber from database
-my $query = qq/
- SELECT itemnumber
- FROM items
- LIMIT 10
-/;
-my $sth = $dbh->prepare($query);
-$sth->execute;
-my @items;
-while(my $item = $sth->fetchrow){
- push @items, $item;
-}
-
# Getting some biblionumbers from database
-my $query = qq/
+$query = qq/
SELECT biblionumber
FROM biblio
LIMIT 10
/;
-my $sth = $dbh->prepare($query);
+$sth = $dbh->prepare($query);
$sth->execute;
my @biblionumbers;
while(my $biblionumber = $sth->fetchrow){
DELETE FROM virtualshelfcontents WHERE 1
/;
-my $sth = $dbh->prepare($delete_virtualshelf);
+$sth = $dbh->prepare($delete_virtualshelf);
$sth->execute;
-my $sth = $dbh->prepare($delete_virtualshelfcontent);
+$sth = $dbh->prepare($delete_virtualshelfcontent);
$sth->execute;
# ---
#
#----------------------------------------------------------------------#
-use C4::VirtualShelves;
-my $version = C4::VirtualShelves->VERSION;
-print "\n----------Testing C4::VirtualShelves version ".$version."--------\n";
-
-ok($version); # First test: the module is loaded & the version is readable.
-
+use_ok('C4::VirtualShelves');
#-----------------------TEST AddShelf function------------------------#
# usage : $shelfnumber = &AddShelf( $shelfname, $owner, $category);
for(my $i=0; $i<10;$i++){
my $ShelfNumber = AddShelf("Shelf_".$i,$borrowers[$i] || '',int(rand(3))+1);
die "test Not ok, remove some shelves before" if ($ShelfNumber == -1);
- ok($ShelfNumber); # Shelf creation successful;
- push @shelves, $ShelfNumber if ok($ShelfNumber);
+ ok($ShelfNumber > -1, "created shelf"); # Shelf creation successful;
+ push @shelves, $ShelfNumber if $ShelfNumber > -1;
}
-ok(10,scalar @shelves); # 10 shelves in @shelves;
+ok(10 == scalar @shelves, 'created 10 lists'); # 10 shelves in @shelves;
# try to create some shelf which already exists.
for(my $i=0;$i<10;$i++){
my $badNumShelf = AddShelf("Shelf_".$i,$borrowers[$i] || '','');
- ok(-1,$badNumShelf); # AddShelf returns -1 if name already exist.
+ ok(-1 == $badNumShelf, 'do not create lists with duplicate names'); # AddShelf returns -1 if name already exist.
}
-#-----------TEST AddToShelf & &AddToShelfFromBiblio & GetShelfContents & DelFromShelf functions--------------#
-# usage : &AddToShelf($itemnumber, $shelfnumber);
-# usage : $itemlist = &GetShelfContents($shelfnumber);
-# usage : $itemlist = GetShelfContents($shelfnumber);
+#-----------TEST AddToShelf & GetShelfContents & DelFromShelf functions--------------#
+# usage : &AddToShelf($biblionumber, $shelfnumber);
+# usage : $biblist = &GetShelfContents($shelfnumber);
+# usage : $biblist = GetShelfContents($shelfnumber);
+my %used = ();
for(my $i=0; $i<10;$i++){
- my $item = $items[int(rand(9))];
+ my $bib = $biblionumbers[int(rand(9))];
my $shelfnumber = $shelves[int(rand(9))];
-
- my ($itemlistBefore,$countbefore) = GetShelfContents($shelfnumber);
- AddToShelf($item,$shelfnumber);
- my ($itemlistAfter,$countafter) = GetShelfContents($shelfnumber);
- ok($countbefore,$countafter - 1); # the item has been successfuly added.
+
+ my $key = "$bib\t$shelfnumber";
+ my $should_fail = exists($used{$key}) ? 1 : 0;
+
+ my ($biblistBefore,$countbefore) = GetShelfContents($shelfnumber);
+ my $status = AddToShelf($bib,$shelfnumber);
+ my ($biblistAfter,$countafter) = GetShelfContents($shelfnumber);
+
+ if ($should_fail) {
+ ok(!defined($status), 'failed to add to list when we should');
+ } else {
+ ok(defined($status), 'added to list when we should');
+ }
+
+ if (defined $status) {
+ ok($countbefore == $countafter - 1, 'added bib to list'); # the bib has been successfuly added.
+ } else {
+ ok($countbefore == $countafter, 'did not add duplicate bib to list'); # the bib has been successfuly added.
+ }
+
+ $used{$key}++;
-
- # same thing with AddToShelfFromBiblio
- my $biblionumber = $biblionumbers[int(rand(10))];
- &AddToShelfFromBiblio($biblionumber, $shelfnumber);
- my ($AfterAgain,$countagain) = GetShelfContents($shelfnumber);
- ok($countafter, $countagain -1);
}
#-----------------------TEST ModShelf & GetShelf functions------------------------#
ModShelf($numA,$shelf);
my ($numB,$nameB,$ownerB,$categoryB) = GetShelf($numA);
- ok($numA,$numB);
- ok($shelf->{shelfname},$nameB);
- ok($shelf->{owner},$ownerB);
- ok($shelf->{category},$categoryB);
+ ok($numA == $numB, 'modified shelf');
+ ok($shelf->{shelfname} eq $nameB, '... and name change took');
+ ok($shelf->{owner} eq $ownerB, '... and owner change took');
+ ok($shelf->{category} eq $categoryB, '... and category change took');
}
#-----------------------TEST DelShelf & DelFromShelf functions------------------------#
# usage : ($status) = &DelShelf($shelfnumber);
-# usage : &DelFromShelf( $itemnumber, $shelfnumber);
for(my $i=0; $i<10;$i++){
my $shelfnumber = $shelves[$i];
my $status = DelShelf($shelfnumber);
- if($status){
- my ($items,$count) = GetShelfContents($shelfnumber);
- ok($status,$count);
- foreach (@$items){ # delete all the item in this shelf
- DelFromShelf($_{'itemnumber'},$shelfnumber);
- }
- ok(DelShelf($shelfnumber));
- }
+ ok(1 == $status, "deleted shelf $shelfnumber and its contents");
}
--- /dev/null
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 6;
+
+BEGIN {
+ use FindBin;
+ use lib $FindBin::Bin;
+ use override_context_prefs;
+ use_ok('C4::Auth', qw(checkpw));
+ use_ok('C4::Context');
+}
+
+use vars qw($dbh $ldap);
+can_ok('C4::Context', 'config');
+can_ok('C4::Context', 'dbh');
+can_ok('C4::Auth', qw(checkpw));
+ ok($dbh = C4::Context->dbh(), "Getting dbh from C4::Context");
+$ldap = C4::Context->config('useldapserver') || 0;
+diag("Using LDAP? $ldap");
+
+while (1) { # forever!
+ print "Do you want to test further accounts? (If not, just hit return.)\n";
+ my ($user, $pass);
+ print "Enter username: ";
+ chomp($user = <>);
+ ($user) or exit;
+ print "Enter password: ";
+ chomp($pass = <>);
+ my ($retval,$retcard) = checkpw($dbh,$user,$pass);
+ $retval ||= '';
+ $retcard ||= '';
+ diag ("checkpw(\$dbh,$user,$pass) " . ($retval ? 'SUCCEEDS' : ' FAILS ') . "\treturns ($retval,$retcard)");
+}
+
+END {
+ diag("C4::Auth - end of test");
+}
+__END__
--- /dev/null
+#!/bin/perl
+#
+
+use strict;
+use warnings;
+
+use Test::More;
+use vars qw(%cases $dbh $config $context $ldap);
+
+BEGIN {
+ %cases = (
+ # users from t/LDAP/example3.ldif
+ sss => 'password1',
+ jts => 'password1',
+ rch => 'password2',
+ jmf => 'password3',
+ );
+ plan tests => 8 + scalar(keys %cases);
+ use_ok('C4::Context');
+ use_ok('C4::Auth_with_ldap', qw(checkpw_ldap));
+}
+
+sub do_checkpw_ldap (;$$) {
+ my ($user,$pass) = (shift,shift);
+ diag "($user,$pass)";
+ my $ret;
+ return ($ret = checkpw_ldap($dbh,$user,$pass), sprintf("(%s,%s) returns '%s'",$user,$pass,$ret));
+}
+
+ok($context= C4::Context->new(), "Getting new C4::Context object");
+ok($dbh = C4::Context->dbh(), "Getting dbh from C4::Context");
+ok($dbh = $context->dbh(), "Getting dbh from \$context object");
+
+$ldap = $ENV{KOHA_USELDAPSERVER};
+if(defined($ldap)) {
+ diag "Overriding KOHA_CONF <useldapserver> with \$ENV{KOHA_USELDAPSERVER} = $ldap";
+} else {
+ diag 'Note: You can use $ENV{KOHA_USELDAPSERVER} to override KOHA_CONF <useldapserver> for this test';
+ $ldap = C4::Context->config('useldapserver');
+}
+ok(defined($ldap), "Checking if \$ENV{KOHA_USELDAPSERVER} or <useldapserver> is defined");
+
+SKIP: {
+ $ldap or skip("LDAP is disabled.", scalar(keys %cases) + 2);
+ diag("The basis of Authentication is that we don't auth everybody.");
+ diag("Let's make sure we reject on bad calls.");
+ my $ret;
+ ok(!($ret = checkpw_ldap($dbh)), "should reject ( no arguments) returns '$ret'");
+ ok(!($ret = checkpw_ldap($dbh,'','')), "should reject (empty arguments) returns '$ret'");
+ print "\n";
+ diag("Now let's check " . scalar(keys %cases) . " test cases: ");
+ foreach (sort keys %cases) {
+ ok do_checkpw_ldap($_, $cases{$_});
+ }
+}
+1;
}
$debug and print STDERR "filters: " . Dumper(\%filters);
my $tagloop = get_approval_rows(\%filters);
+for ( @{$tagloop} ) {
+ $_->{date_approved} = format_date( $_->{date_approved} );
+}
my $qstring = $input->query_string;
$qstring =~ s/([&;])*\blimit=\d+//; # remove pagination var
$qstring =~ s/^;+//; # remove leading delims
@biblionumber = (split /\//,$biblionumber[0]);
}
for my $bib (@biblionumber){
- AddToShelfFromBiblio($bib, $shelfnumber);
+ AddToShelf($bib, $shelfnumber);
}
}