From: Paul Poulain Date: Thu, 2 Feb 2012 14:21:45 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/new/bug_6488' X-Git-Tag: v3.08.00~556 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=522a7a3255c38047e6c68269c695e6e03f8baa12;hp=1f66e9fa691f9cfd705375450a21c623e0155f52;p=koha_gimpoz Merge remote-tracking branch 'origin/new/bug_6488' --- diff --git a/C4/Biblio.pm b/C4/Biblio.pm index ad559faca6..631e8911e0 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -320,7 +320,7 @@ sub ModBiblio { SetUTF8Flag($record); my $dbh = C4::Context->dbh; - $frameworkcode = "" unless $frameworkcode; + $frameworkcode = "" if !$frameworkcode || $frameworkcode eq "Default"; # XXX _strip_item_fields($record, $frameworkcode); @@ -1043,9 +1043,13 @@ for the given frameworkcode sub GetMarcFromKohaField { my ( $kohafield, $frameworkcode ) = @_; - return 0, 0 unless $kohafield and defined $frameworkcode; + return (0, undef) unless $kohafield and defined $frameworkcode; my $relations = C4::Context->marcfromkohafield; - return ( $relations->{$frameworkcode}->{$kohafield}->[0], $relations->{$frameworkcode}->{$kohafield}->[1] ); + if ( my $mf = $relations->{$frameworkcode}->{$kohafield} ) { + return @$mf; + } + warn qq{No marc tags for framework "$frameworkcode" field $kohafield}; + return (0, undef); } =head2 GetMarcBiblio @@ -3157,9 +3161,24 @@ sub _koha_marc_update_bib_ids { # we drop the original field # we add the new builded field. my ( $biblio_tag, $biblio_subfield ) = GetMarcFromKohaField( "biblio.biblionumber", $frameworkcode ); + die qq{No biblionumber tag for framework "$frameworkcode"} unless $biblio_tag; my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber", $frameworkcode ); + die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblio_tag; - if ( $biblio_tag != $biblioitem_tag ) { + if ( $biblio_tag == $biblioitem_tag ) { + + # biblionumber & biblioitemnumber are in the same field (can't be <10 as fields <10 have only 1 value) + my $new_field = MARC::Field->new( + $biblio_tag, '', '', + "$biblio_subfield" => $biblionumber, + "$biblioitem_subfield" => $biblioitemnumber + ); + + # drop old field and create new one... + my $old_field = $record->field($biblio_tag); + $record->delete_field($old_field) if $old_field; + $record->insert_fields_ordered($new_field); + } else { # biblionumber & biblioitemnumber are in different fields @@ -3187,20 +3206,6 @@ sub _koha_marc_update_bib_ids { $old_field = $record->field($biblioitem_tag); $record->delete_field($old_field) if $old_field; $record->insert_fields_ordered($new_field); - - } else { - - # biblionumber & biblioitemnumber are in the same field (can't be <10 as fields <10 have only 1 value) - my $new_field = MARC::Field->new( - $biblio_tag, '', '', - "$biblio_subfield" => $biblionumber, - "$biblioitem_subfield" => $biblioitemnumber - ); - - # drop old field and create new one... - my $old_field = $record->field($biblio_tag); - $record->delete_field($old_field) if $old_field; - $record->insert_fields_ordered($new_field); } } diff --git a/C4/Members.pm b/C4/Members.pm index 1d7bc42920..b81872c5b5 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -1687,7 +1687,9 @@ sub ExtendMemberSubscriptionTo { my $dbh = C4::Context->dbh; my $borrower = GetMember('borrowernumber'=>$borrowerid); unless ($date){ - $date=POSIX::strftime("%Y-%m-%d",localtime()); + $date = (C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry') ? + C4::Dates->new($borrower->{'dateexpiry'}, 'iso')->output("iso") : + C4::Dates->new()->output("iso"); $date = GetExpiryDate( $borrower->{'categorycode'}, $date ); } my $sth = $dbh->do(<{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan}; - + # can place hold on item ? if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems')) && !$item->{itemlost} @@ -2637,7 +2638,15 @@ $template->param ( MYLOOP => C4::Search::z3950_search_args($searchscalar) ) sub z3950_search_args { my $bibrec = shift; - $bibrec = { title => $bibrec } if !ref $bibrec; + my $isbn = Business::ISBN->new($bibrec); + + if (defined $isbn && $isbn->is_valid) + { + $bibrec = { isbn => $bibrec } if !ref $bibrec; + } + else { + $bibrec = { title => $bibrec } if !ref $bibrec; + } my $array = []; for my $field (qw/ lccn isbn issn title author dewey subject /) { diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl index 47dbe5265e..80503e0d82 100755 --- a/acqui/z3950_search.pl +++ b/acqui/z3950_search.pl @@ -134,8 +134,17 @@ if ( $op ne "do_search" ) { } else { my @id = $input->param('id'); + + if ( not defined @id ) { + # empty server list -> report and exit + $template->param( emptyserverlist => 1 ); + output_html_with_http_headers $input, $cookie, $template->output; + exit; + } + my @oConnection; my @oResult; + my @errconn; my $s = 0; my $query; my $nterms; @@ -164,7 +173,7 @@ else { $query .= " \@attr 1=21 \"$subject\" "; $nterms++; } - if ($lccn) { + if ($lccn) { $query .= " \@attr 1=9 $lccn "; $nterms++; } @@ -186,7 +195,6 @@ warn "query ".$query if $DEBUG; $sth->execute($servid); while ( $server = $sth->fetchrow_hashref ) { warn "serverinfo ".join(':',%$server) if $DEBUG; - my $noconnection = 0; my $option1 = new ZOOM::Options(); $option1->option( 'async' => 1 ); $option1->option( 'elementSetName', 'F' ); @@ -237,9 +245,10 @@ sub displayresults { my ( $error, $errmsg, $addinfo, $diagset ) = $oConnection[$k]->error_x(); if ($error) { - warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n" - if $DEBUG; - + if ($error =~ m/^(10000|10007)$/ ) { + push(@errconn, {'server' => $serverhost[$k]}); + } + $DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n"; } else { my $numresults = $oResult[$k]->size(); @@ -280,13 +289,6 @@ sub displayresults { ) = ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' ); my %row_data; - if ( $i % 2 ) { - $toggle = 1; - } - else { - $toggle = 0; - } - $row_data{toggle} = $toggle; $row_data{server} = $servername[$k]; $row_data{isbn} = $oldbiblio->{isbn}; $row_data{lccn} = $oldbiblio->{lccn}; @@ -295,9 +297,9 @@ sub displayresults { $row_data{breedingid} = $breedingid; $row_data{biblionumber} = $biblionumber; push( @breeding_loop, \%row_data ); - + } else { - push(@breeding_loop,{'toggle'=>($i % 2)?1:0,'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1}); + push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1}); } # $rec } # upto 5 results } #$numresults @@ -308,10 +310,11 @@ sub displayresults { breeding_loop => \@breeding_loop, server => $servername[$k], numberpending => $numberpending, + errconn => \@errconn ); output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0; - # print $template->output if $firstresult !=1; + # print $template->output if $firstresult !=1; $firstresult++; } displayresults(); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index fcf1f2b57a..db38551fde 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -35,6 +35,7 @@ use C4::Serials; use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn); use C4::External::Amazon; use C4::Search; # enabled_staff_search_views +use C4::Tags qw(get_tags); use C4::VirtualShelves; use C4::XSLT; use C4::Images; @@ -395,4 +396,16 @@ if (C4::Context->preference('OPACBaseURL')){ $template->param( OpacUrl => C4::Context->preference('OPACBaseURL') ); } +# Displaying tags + +my $tag_quantity; +if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) { + $template->param( + TagsEnabled => 1, + TagsShowOnDetail => $tag_quantity + ); + $template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1, + 'sort'=>'-weight', limit=>$tag_quantity})); +} + output_html_with_http_headers $query, $cookie, $template->output; diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index 0b881f1c13..020001d010 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -27,6 +27,7 @@ use C4::Auth; use C4::Items; use C4::Biblio; use C4::Serials; +use C4::Koha; use C4::Reserves qw/MergeHolds/; my $input = new CGI; @@ -61,7 +62,7 @@ if ($merge) { # Rewriting the leader $record->leader(GetMarcBiblio($tobiblio)->leader()); - my $frameworkcode = &GetFrameworkCode($tobiblio); + my $frameworkcode = $input->param('frameworkcode'); my @notmoveditems; # Modifying the reference record @@ -108,77 +109,107 @@ if ($merge) { push @errors, $error if ($error); } - # Errors - my @errors_loop = map{{error => $_}}@errors; - # Parameters $template->param( - errors => \@errors_loop, result => 1, biblio1 => $input->param('biblio1') ); - #------------------------- # Show records to merge #------------------------- } else { - my $mergereference = $input->param('mergereference'); my $biblionumber = $input->param('biblionumber'); - my $data1 = GetBiblioData($biblionumber[0]); - my $data2 = GetBiblioData($biblionumber[1]); - - # Ask the user to choose which record will be the kept - if (not $mergereference) { - $template->param( - choosereference => 1, - biblio1 => $biblionumber[0], - biblio2 => $biblionumber[1], - title1 => $data1->{'title'}, - title2 => $data2->{'title'} - ); - } else { - - if (scalar(@biblionumber) != 2) { - push @errors, "An unexpected number of records was provided for merging. Currently only two records at a time can be merged."; - } - - # Checks if both records use the same framework - my $frameworkcode1 = &GetFrameworkCode($biblionumber[0]); - my $frameworkcode2 = &GetFrameworkCode($biblionumber[1]); - my $framework; - if ($frameworkcode1 ne $frameworkcode2) { - push @errors, "The records selected for merging are using different frameworks. Currently merging is only available for records using the same framework."; - } else { - $framework = $frameworkcode1; - } - - # Getting MARC Structure - my $tagslib = GetMarcStructure(1, $framework); - - my $notreference = ($biblionumber[0] == $mergereference) ? $biblionumber[1] : $biblionumber[0]; - - # Creating a loop for display - my @record1 = _createMarcHash(GetMarcBiblio($mergereference), $tagslib); - my @record2 = _createMarcHash(GetMarcBiblio($notreference), $tagslib); - - # Errors - my @errors_loop = map{{error => $_}}@errors; - - # Parameters - $template->param( - errors => \@errors_loop, - biblio1 => $mergereference, - biblio2 => $notreference, - mergereference => $mergereference, - record1 => @record1, - record2 => @record2, - framework => $framework - ); + if (scalar(@biblionumber) != 2) { + push @errors, "An unexpected number of records was provided for merging. Currently only two records at a time can be merged."; + } + else { + my $data1 = GetBiblioData($biblionumber[0]); + my $record1 = GetMarcBiblio($biblionumber[0]); + + my $data2 = GetBiblioData($biblionumber[1]); + my $record2 = GetMarcBiblio($biblionumber[1]); + + # Checks if both records use the same framework + my $frameworkcode1 = &GetFrameworkCode($biblionumber[0]); + my $frameworkcode2 = &GetFrameworkCode($biblionumber[1]); + + + my $subtitle1 = GetRecordValue('subtitle', $record1, $frameworkcode1); + my $subtitle2 = GetRecordValue('subtitle', $record2, $frameworkcode1); + + if ($mergereference) { + + my $framework; + if ($frameworkcode1 ne $frameworkcode2) { + $framework = $input->param('frameworkcode') + or push @errors, "Famework not selected."; + } else { + $framework = $frameworkcode1; + } + + # Getting MARC Structure + my $tagslib = GetMarcStructure(1, $framework); + + my $notreference = ($biblionumber[0] == $mergereference) ? $biblionumber[1] : $biblionumber[0]; + + # Creating a loop for display + my @record1 = _createMarcHash(GetMarcBiblio($mergereference), $tagslib); + my @record2 = _createMarcHash(GetMarcBiblio($notreference), $tagslib); + + # Parameters + $template->param( + biblio1 => $mergereference, + biblio2 => $notreference, + mergereference => $mergereference, + record1 => @record1, + record2 => @record2, + framework => $framework, + ); + } + else { + + # Ask the user to choose which record will be the kept + $template->param( + choosereference => 1, + biblio1 => $biblionumber[0], + biblio2 => $biblionumber[1], + title1 => $data1->{'title'}, + subtitle1 => $subtitle1, + title2 => $data2->{'title'}, + subtitle2 => $subtitle2 + ); + if ($frameworkcode1 ne $frameworkcode2) { + my $frameworks = getframeworks; + my @frameworkselect; + foreach my $thisframeworkcode ( keys %$frameworks ) { + my %row = ( + value => $thisframeworkcode, + frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, + ); + if ($frameworkcode1 eq $thisframeworkcode){ + $row{'selected'} = 1; + } + push @frameworkselect, \%row; + } + $template->param( + frameworkselect => \@frameworkselect, + frameworkcode1 => $frameworkcode1, + frameworkcode2 => $frameworkcode2, + ); + } + } } } + +if (@errors) { + # Errors + my @errors_loop = map{{error => $_}}@errors; + $template->param( errors => \@errors_loop ); +} + output_html_with_http_headers $input, $cookie, $template->output; exit; diff --git a/circ/circulation.pl b/circ/circulation.pl index 1b6c6194ff..e8d22cb158 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -705,6 +705,7 @@ $template->param( soundon => C4::Context->preference("SoundOn"), fast_cataloging => $fast_cataloging, CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); # save stickyduedate to session diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml index a3e15200a5..ec1e426663 100644 --- a/debian/docs/koha-create.xml +++ b/debian/docs/koha-create.xml @@ -24,11 +24,13 @@ koha-create - || + ||| marc21|normarc|unimarc en|nb|fr /path/to/some.sql /path/to/config + /path/to/passwd + database n instancename @@ -40,7 +42,7 @@ - Create a new datbase on localhost. If the database you want to use does not reside on localhost, you can use and , see below. + Create a new database on localhost. If the database you want to use does not reside on localhost, you can use and , see below. If the database already exists, you can use , see below. @@ -54,7 +56,14 @@ - When you have run koha-create with the option, and a database has been set up, you can finnish your installation by running koha-create with this option. + When you have run koha-create with the option, and a database has been set up, you can finish your installation by running koha-create with this option. + + + + + + + When the database you want to use has already been populated, you can run koha-create with this option to take care of all the other set-up configuration. @@ -66,6 +75,13 @@ + + + MySQL database to use. + + + + Path to an SQL-file other than the one pointed to in the default or alternative config file. Corresponds to the DEFAULTSQL config file variable. @@ -80,6 +96,13 @@ + + + Path to an alternative passwd file. This file is in the same format as the default (Koha) passwd file, see below for details. + + + + Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable. @@ -107,6 +130,27 @@ + + + The port for the OPAC. + + + + + + + This is inserted before the instance name when forming Apache ServerName. For subdomains, make sure it ends with a period. + + + + + + + This is inserted after the instance name, but before the domain name, when forming Apache ServerName. + + + + The port for the intranet. If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX. @@ -169,6 +213,13 @@ Configuration variables are read from this file, if it exists. + + + + + Pre-selected database credentials are read from this file, if it exists. The format for this file is instancename:username:passwd:database. Database is optional, but the other three are required if you want to use pre-determined database user credentials. + + diff --git a/debian/docs/koha-remove.xml b/debian/docs/koha-remove.xml index ee2b26673b..4e272f8186 100644 --- a/debian/docs/koha-remove.xml +++ b/debian/docs/koha-remove.xml @@ -23,14 +23,27 @@ - koha-remove instancename + koha-remove + + instancename + Options + + + + + Leave the MySQL database and user when removing the Koha instance. + + + + + Description Remove a Koha instance. - + See also koha-disable(8) @@ -39,7 +52,7 @@ koha-restore(8) - + diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index ddfa0b0062..bb2b642082 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -19,25 +19,28 @@ set -e -usage="Usage: $0 [--create-db|--request-db|--populate-db] \ +usage="Usage: $0 [--create-db|--request-db|--populate-db|--use-db] \ [--marcflavor marc21|normarc|unimarc] \ [--zebralang en|nb|fr] \ [--defaultsql /path/to/some.sql] \ - [--configfile /path/to/config] [--adminuser n] instancename" + [--configfile /path/to/config] [--passwdfile /path/to/passwd] \ + [--database database] [--adminuser n] instancename" die() { echo "$@" 1>&2 exit 1 } +# UPPER CASE VARIABLES - from configfile or default value +# lower case variables - generated within this script generate_config_file() { touch "$2" chown "root:$username" "$2" chmod 0640 "$2" sed -e "s/__KOHASITE__/$name/g" \ - -e "s/__OPACPORT__/80/g" \ + -e "s/__OPACPORT__/$OPACPORT/g" \ -e "s/__INTRAPORT__/$INTRAPORT/g" \ - -e "s/__OPACSERVER__/$domain/g" \ + -e "s/__OPACSERVER__/$opacdomain/g" \ -e "s/__INTRASERVER__/$intradomain/g" \ -e "s/__ZEBRA_PASS__/$zebrapwd/g" \ -e "s/__ZEBRA_MARC_FORMAT__/$ZEBRA_MARC_FORMAT/g" \ @@ -73,6 +76,9 @@ getinstancemysqldatabase() { # Set defaults and read config file, if it exists. DOMAIN="" +OPACPORT="80" +OPACPREFIX="" +OPACSUFFIX="" INTRAPORT="8080" INTRAPREFIX="" INTRASUFFIX="" @@ -80,14 +86,15 @@ DEFAULTSQL="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" ADMINUSER="1" +PASSWDFILE="/etc/koha/passwd" if [ -e /etc/koha/koha-sites.conf ] then . /etc/koha/koha-sites.conf fi -[ $# -ge 2 ] && [ $# -le 12 ] || die $usage +[ $# -ge 2 ] && [ $# -le 16 ] || die $usage -TEMP=`getopt -o crpm:l:d:f:a: -l create-db,request-db,populate-db,marcflavor:,zebralang:,defaultsql:,configfile:,adminuser: \ +TEMP=`getopt -o crpm:l:d:f:a: -l create-db,request-db,populate-db,use-db,marcflavor:,zebralang:,defaultsql:,configfile:,passwdfile:,adminuser: \ -n "$0" -- "$@"` # Note the quotes around `$TEMP': they are essential! @@ -104,10 +111,13 @@ while true ; do -c|--create-db) op=create ; shift ;; -r|--request-db) op=request ; shift ;; -p|--populate-db) op=populate ; shift ;; + -u|--use-db) op=use ; shift ;; -m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; -l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; -d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;; -f|--configfile) configfile="$2" ; shift 2 ;; + -s|--passwdfile) CLO_PASSWDFILE="$2" ; shift 2 ;; + -b|--database) CLO_DATABASE="$2" ; shift 2 ;; -a|--adminuser) CLO_ADMINUSER="$2" ; shift 2 ;; --) shift ; break ;; *) die "Internal error processing command line arguments" ;; @@ -142,31 +152,54 @@ if [ "$CLO_ADMINUSER" != "" ] then ADMINUSER="$CLO_ADMINUSER" fi +if [ "$CLO_PASSWDFILE" != "" ] +then + PASSWDFILE="$CLO_PASSWDFILE" +fi name="$1" -domain="$name$DOMAIN" -if [ "$INTRAPORT" = 80 ] || [ "$INTRAPORT" = "" ] +opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN" +intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN" + + +if [ `cat $PASSWDFILE | grep "^$name:"` ] then - intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN" -else - intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN:$INTRAPORT" + passwdline=`cat $PASSWDFILE | grep "^$name:"` + mysqluser=`echo $passwdline | cut -d ":" -f 2` + mysqlpwd=`echo $passwdline | cut -d ":" -f 3` + mysqldb=`echo $passwdline | cut -d ":" -f 4` fi +# The order of precedence for MySQL database name is: +# default < passwd file < command line +if [ "$mysqldb" = "" ] +then + mysqldb="koha_$name" +fi +if [ "$CLO_DATABASE" != "" ] +then + mysqldb="$CLO_DATABASE" +fi -mysqldb="koha_$name" +if [ "$mysqluser" = "" ] +then + mysqluser="koha_$name" +fi mysqlhost="$(getmysqlhost)" -mysqluser="koha_$name" -if [ "$op" = create ] || [ "$op" = request ] +if [ "$op" = create ] || [ "$op" = request ] || [ "$op" = use ] then - mysqlpwd="$(pwgen -1)" + if [ "$mysqlpwd" = "" ] + then + mysqlpwd="$(pwgen -1)" + fi else mysqlpwd="$(getinstancemysqlpassword $name)" fi -if [ "$op" = create ] || [ "$op" = request ] +if [ "$op" = create ] || [ "$op" = request ] || [ "$op" = use ] then # Create new user and group. username="$name-koha" @@ -199,6 +232,15 @@ FLUSH PRIVILEGES; eof fi #` + if [ "$op" = use ] + then + mysql --defaults-extra-file=/etc/mysql/koha-common.cnf --force <dbh; +$dbh->do(<preference("Version") < TransformToNum($DBversion) ) { $dbh->do( q|INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Upload local cover images')| ); - print "Upgrade done (Added support for local cover images)\n"; + print "Upgrade to $DBversion done (Added support for local cover images)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.07.00.011"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do(<Add child[% END %] + [% IF ( adultborrower AND activeBorrowerRelationship ) %]
  • Add child
  • [% END %] [% IF ( CAN_user_staffaccess ) %]
  • Change Password
  • [% END %] [% END %]
  • Duplicate
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index bc3e920af3..bad8502d4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -114,7 +114,7 @@ function update_child() {
  • Edit
  • [% END %] [% END %] - [% IF ( adultborrower ) %]
  • Add child
  • [% END %] + [% IF ( adultborrower AND activeBorrowerRelationship ) %]
  • Add child
  • [% END %] [% IF CAN_user_staffaccess %]
  • Change Password
  • [% END %]
  • Duplicate
  • Print Page
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 46f07241a0..40e0ff3916 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -268,6 +268,7 @@
  • Andrei V. Toutoukine
  • Darrell Ulm
  • Universidad ORT Uruguay (Ernesto Silva, Andres Tarallo)
  • +
  • Aleksa Vujicic
  • Reed Wade
  • Ian Walls
  • Jane Wagner
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt index 66dbc6e287..1f2ad60b78 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt @@ -120,7 +120,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :

    [% END %] -
    Cancel
    +
    Cancel
    @@ -155,6 +155,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %] [% ELSE %] + [% IF ( emptyserverlist ) %] + You didn't select any Z39.50 target. + [% ELSE %] + [% FOREACH errcon IN errconn %] + Connection failed to [% errcon.server %] + [% END %] + [% END %]

    Nothing found. Try another search.

    [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 0e2f73bbb0..3d88883843 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -42,7 +42,7 @@ Patrons: - "Guarantors can be the following of those they guarantee:" - pref: borrowerRelationship class: multi - - (input multiple choices separated by |) + - (input multiple choices separated by |). Leave empty to deactivate - - "Borrowers can have the following titles:" - pref: BorrowersTitles @@ -114,3 +114,9 @@ Patrons: yes: Do no: "Don't" - store and display surnames in upper case. + - + - When renewing borrowers, base the new expiry date on + - pref: BorrowerRenewalPeriodBase + choices: + now: current date. + dateexpiry: current membership expiry date. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 38a26c9528..80e04a976d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -102,6 +102,18 @@ function verify_images() { [% END %] [% END %] + [% IF ( TagsEnabled && TagsShowOnDetail && TagLoop ) %] + Tags: + [% FOREACH TagLoo IN TagLoop %] + [% IF ( CAN_user_tools_moderate_tags ) %] + [% TagLoo.term |html %] + [% ELSE %] + [% TagLoo.term |html %] + [% END %] + ([% TagLoo.weight_total %])[% IF ( loop.last ) %][% ELSE %], [% END %] + [% END %] + + [% END %] [% IF ( holdcount ) %]Holds: [% holdcount %][% ELSE %][% END %] [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]
    @@ -220,9 +232,24 @@ function verify_images() { [% END %] + [% IF ( TagsEnabled && TagsShowOnDetail && TagLoop ) %] +
  • Tags: +
      + [% FOREACH TagLoo IN TagLoop %] +
    • + [% IF ( CAN_user_tools_moderate_tags ) %] + [% TagLoo.term |html %] + [% ELSE %] + [% TagLoo.term |html %] + [% END %] + ([% TagLoo.weight_total %])[% IF ( loop.last ) %][% ELSE %], [% END %]
    • + [% END %] +
  • + [% END %] [% IF ( holdcount ) %]
  • Holds: [% holdcount %]
  • [% ELSE %][% END %] [% END %] +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt index 0d8a84ca43..9235fdd08c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt @@ -1,5 +1,6 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloging › Merging records +[% INCLUDE 'greybox.inc' %] [% INCLUDE 'doc-head-close.inc' %] + + +[% INCLUDE 'header.inc' %] +[% INCLUDE 'cat-search.inc' %] + + + +
    +
    +
    +
    +[% IF ( titles ) %] +

    Titles tagged with the term [% tag %]

    + + + + + + + + [% FOREACH title IN titles %] + [% IF ( title.even ) %] + + [% ELSE %] + + [% END %] + + + + + [% END %] +
    TitleLocation 
    [% INCLUDE 'biblio-default-view.inc' biblionumber = title.biblionumber %][% title.title |html %][% FOREACH subtitl IN title.subtitle %] [% subtitl.subfield %][% END %] + [% title.author %] +

    [% IF ( title.publishercode ) %]- [% title.publishercode|html %] + [% IF ( title.place ) %] [% title.place %][% END %][% END %] + [% IF ( title.pages ) %] - [% title.pages %][% IF ( title.size ) %] [% title.size %] + [% END %] + [% END %]

    + [% IF ( title.notes ) %] +

    [% title.notes |html%]

    [% END %] + [% IF ( title.TagLoop ) %]

    Tagged with: [% FOREACH TagLoo IN title.TagLoop %] + [% TagLoo.term |html %] ([% TagLoo.weight_total %])[% IF ( loop.last ) %][% ELSE %], [% END %] + [% END %]

    + [% END %] +
    [% IF ( title.items ) %]
      [% FOREACH item IN title.items %] +
    • + [% item.branchname %] [% item.location_description %] + [% IF ( item.itemcallnumber ) %] + ([% item.itemcallnumber %]) + [% END %] +
    • + [% END %]
    [% ELSE %]This record has no items.[% END %] +
    +[% ELSE %] +
    There are no titles tagged with the term [% tag %]
    +[% END %] + +
    +
    + +
    +[% INCLUDE 'intranet-bottom.inc' %] \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt index 5d025af6d3..843f7cad70 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt @@ -217,7 +217,7 @@ td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% ELSE %] [% END %] - [% tagloo.term %] + [% tagloo.term %] [% tagloo.weight_total %] diff --git a/kohaversion.pl b/kohaversion.pl index a73324e5f0..c6379f02ec 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.07.00.010'; + our $VERSION = '3.07.00.011'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/members/boraccount.pl b/members/boraccount.pl index 2805f275cd..44db953da5 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -128,6 +128,7 @@ $template->param( is_child => ($data->{'category_type'} eq 'C'), reverse_col => $reverse_col, accounts => $accts, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/deletemem.pl b/members/deletemem.pl index b1ba709c65..924245a62c 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -102,6 +102,7 @@ if ($countissues > 0 or $flags->{'CHARGES'} or $data->{'borrowernumber'}){ email => $bor->{'email'}, branchcode => $bor->{'branchcode'}, branchname => GetBranchName($bor->{'branchcode'}), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); if ($countissues >0) { $template->param(ItemsOnIssues => $countissues); diff --git a/members/mancredit.pl b/members/mancredit.pl index 3c664c2ce6..88200d0e20 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -106,6 +106,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { branchcode => $data->{'branchcode'}, branchname => GetBranchName($data->{'branchcode'}), is_child => ($data->{'category_type'} eq 'C'), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 1f42093677..f1c572c1d7 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -133,6 +133,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { branchcode => $data->{'branchcode'}, branchname => GetBranchName($data->{'branchcode'}), is_child => ($data->{'category_type'} eq 'C'), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/member-flags.pl b/members/member-flags.pl index 76f300e398..ca8c9d0860 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -191,6 +191,7 @@ $template->param( branchname => GetBranchName($bor->{'branchcode'}), loop => \@loop, is_child => ($bor->{'category_type'} eq 'C'), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/member-password.pl b/members/member-password.pl index 25e9551c8d..8128a3dff8 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -121,6 +121,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { destination => $destination, is_child => ($bor->{'category_type'} eq 'C'), defaultnewpassword => $defaultnewpassword, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); diff --git a/members/moremember.pl b/members/moremember.pl index 6e5407c58a..c477100658 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -481,6 +481,7 @@ $template->param( "dateformat_" . (C4::Context->preference("dateformat") || '') => 1, samebranch => $samebranch, quickslip => $quickslip, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); #Get the slip news items diff --git a/members/notices.pl b/members/notices.pl index 41f2a903bf..51a843c2f6 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -68,6 +68,7 @@ $template->param( sentnotices => 1, branchname => GetBranchName($borrower->{'branchcode'}), categoryname => $borrower->{'description'}, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/pay.pl b/members/pay.pl index 6bc18fc774..72a109f49c 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -103,6 +103,8 @@ for (@names) { } } +$template->param( activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne '') ); + add_accounts_to_template(); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/paycollect.pl b/members/paycollect.pl index cbddc05be6..e05a5a662b 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -138,6 +138,7 @@ $template->param( borrowenumber => $borrowernumber, # some templates require global borrower => $borrower, total => $total_due + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/readingrec.pl b/members/readingrec.pl index b4fb8a7d9c..c4a8237815 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -133,6 +133,7 @@ $template->param( branchname => GetBranchName($data->{'branchcode'}), showfulllink => (scalar @loop_reading > 50), loop_reading => \@loop_reading, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index fd3124b46b..610b22efae 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -59,7 +59,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( template_name => "opac-addbybiblionumber.tmpl", query => $query, type => "opac", - authnotrequired =>( C4::Context->preference("OpacPublic") ? 1 : 0 ), + authnotrequired => 0, } ); diff --git a/t/Csv.t b/t/Csv.t deleted file mode 100755 index 17cd8bbb03..0000000000 --- a/t/Csv.t +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/perl -# -# This Koha test module is a stub! -# Add more tests here!!! - -use strict; -use warnings; - -use Test::More tests => 4; - -BEGIN { - use_ok('C4::Csv'); -} - -ok(C4::Csv::GetCsvProfiles(), 'test getting csv profiles'); -is(C4::Csv::GetCsvProfile(),undef, 'test getting csv profiles'); - -ok(C4::Csv::GetCsvProfilesLoop(), 'test getting profile loop'); diff --git a/t/Reports.t b/t/Reports.t deleted file mode 100755 index e28efd682e..0000000000 --- a/t/Reports.t +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl -# -# This Koha test module is a stub! -# Add more tests here!!! - -use strict; -use warnings; - -use Test::More tests => 2; - -BEGIN { - use_ok('C4::Reports'); -} - - -ok(GetDelimiterChoices(),"Testing getting delimeter choices"); #Not testing the value of the output just that it returns something. diff --git a/t/db_dependent/Csv.t b/t/db_dependent/Csv.t new file mode 100755 index 0000000000..17cd8bbb03 --- /dev/null +++ b/t/db_dependent/Csv.t @@ -0,0 +1,18 @@ +#!/usr/bin/perl +# +# This Koha test module is a stub! +# Add more tests here!!! + +use strict; +use warnings; + +use Test::More tests => 4; + +BEGIN { + use_ok('C4::Csv'); +} + +ok(C4::Csv::GetCsvProfiles(), 'test getting csv profiles'); +is(C4::Csv::GetCsvProfile(),undef, 'test getting csv profiles'); + +ok(C4::Csv::GetCsvProfilesLoop(), 'test getting profile loop'); diff --git a/t/db_dependent/Reports.t b/t/db_dependent/Reports.t new file mode 100755 index 0000000000..e28efd682e --- /dev/null +++ b/t/db_dependent/Reports.t @@ -0,0 +1,16 @@ +#!/usr/bin/perl +# +# This Koha test module is a stub! +# Add more tests here!!! + +use strict; +use warnings; + +use Test::More tests => 2; + +BEGIN { + use_ok('C4::Reports'); +} + + +ok(GetDelimiterChoices(),"Testing getting delimeter choices"); #Not testing the value of the output just that it returns something. diff --git a/tags/list.pl b/tags/list.pl new file mode 100755 index 0000000000..6a363ac112 --- /dev/null +++ b/tags/list.pl @@ -0,0 +1,93 @@ +#!/usr/bin/perl + +# Copyright 2011 Athens County Public Libraries +# +# 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. + +use warnings; +use strict; +use CGI; + +use C4::Auth qw(:DEFAULT check_cookie_auth); +use C4::Biblio; +use C4::Context; +use C4::Dates qw(format_date); +use C4::Items; +use C4::Koha; +use C4::Tags 0.03 qw(get_tags remove_tag get_tag_rows); +use C4::Output; + +my $needed_flags = { tools => 'moderate_tags' +}; # FIXME: replace when more specific permission is created. + +my $query = CGI->new; +my $op = $query->param('op') || ''; +my $biblionumber = $query->param('biblionumber'); +my $tag = $query->param('tag'); +my $tag_id = $query->param('tag_id'); + +my ( $template, $borrowernumber, $cookie ) = get_template_and_user( + { + template_name => "tags/list.tmpl", + query => $query, + type => "intranet", + debug => 1, + authnotrequired => 0, + flagsrequired => $needed_flags, + } +); + +if ( $op eq "del" ) { + remove_tag($tag_id); + print $query->redirect("/cgi-bin/koha/tags/list.pl?tag=$tag"); +} +else { + + my $marcflavour = C4::Context->preference('marcflavour'); + my @results; + + if ($tag) { + my $taglist = get_tag_rows( { term => $tag } ); + for ( @{$taglist} ) { + my $dat = &GetBiblioData( $_->{biblionumber} ); + my $record = &GetMarcBiblio( $_->{biblionumber} ); + $dat->{'subtitle'} = + GetRecordValue( 'subtitle', $record, + GetFrameworkCode( $_->{biblionumber} ) ); + my @items = GetItemsInfo( $_->{biblionumber} ); + $dat->{biblionumber} = $_->{biblionumber}; + $dat->{tag_id} = $_->{tag_id}; + $dat->{items} = \@items; + $dat->{TagLoop} = get_tags( + { + biblionumber => $_->{biblionumber}, + 'sort' => '-weight', + limit => 10 + } + ); + push( @results, $dat ); + } + + my $resultsarray = \@results; + + $template->param( + tag => $tag, + titles => $resultsarray, + ); + } +} + +output_html_with_http_headers $query, $cookie, $template->output;