SetUTF8Flag($record);
my $dbh = C4::Context->dbh;
- $frameworkcode = "" unless $frameworkcode;
+ $frameworkcode = "" if !$frameworkcode || $frameworkcode eq "Default"; # XXX
_strip_item_fields($record, $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
# 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
$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);
}
}
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(<<EOF);
use C4::Charset;
use YAML;
use URI::Escape;
+use Business::ISBN;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
$item_in_transit_count++ if $transfertwhen ne '';
$item_onhold_count++ if $reservestatus eq 'Waiting';
$item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
-
+
# can place hold on item ?
if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems'))
&& !$item->{itemlost}
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 /)
{
}
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;
$query .= " \@attr 1=21 \"$subject\" ";
$nterms++;
}
- if ($lccn) {
+ if ($lccn) {
$query .= " \@attr 1=9 $lccn ";
$nterms++;
}
$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' );
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();
)
= 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};
$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
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();
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;
$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;
use C4::Items;
use C4::Biblio;
use C4::Serials;
+use C4::Koha;
use C4::Reserves qw/MergeHolds/;
my $input = new CGI;
# Rewriting the leader
$record->leader(GetMarcBiblio($tobiblio)->leader());
- my $frameworkcode = &GetFrameworkCode($tobiblio);
+ my $frameworkcode = $input->param('frameworkcode');
my @notmoveditems;
# Modifying the reference record
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;
soundon => C4::Context->preference("SoundOn"),
fast_cataloging => $fast_cataloging,
CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"),
+ activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
);
# save stickyduedate to session
<refsynopsisdiv>
<cmdsynopsis>
<command>koha-create</command>
- <arg choice="req"><option>--create-db</option>|<option>--request-db</option>|<option>--populate-db</option></arg>
+ <arg choice="req"><option>--create-db</option>|<option>--request-db</option>|<option>--populate-db</option>|<option>--use-db</option></arg>
<arg><option>--marcflavor</option> marc21|normarc|unimarc</arg>
<arg><option>--zebralang</option> en|nb|fr</arg>
<arg><option>--defaultsql</option> /path/to/some.sql</arg>
<arg><option>--configfile</option> /path/to/config</arg>
+ <arg><option>--passwdfile</option> /path/to/passwd</arg>
+ <arg><option>--database</option> database</arg>
<arg><option>--adminuser</option> n</arg>
<arg choice="req" rep="norepeat"><replaceable>instancename</replaceable></arg>
</cmdsynopsis>
<varlistentry>
<term><option>--create-db</option></term>
<listitem>
- <para>Create a new datbase on localhost. If the database you want to use does not reside on localhost, you can use <option>--request-db</option> and <option>--populate-db</option>, see below.</para>
+ <para>Create a new database on localhost. If the database you want to use does not reside on localhost, you can use <option>--request-db</option> and <option>--populate-db</option>, see below. If the database already exists, you can use <option>--use-db</option>, see below.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--populate-db</option></term>
<listitem>
- <para>When you have run koha-create with the <option>--request-db</option> option, and a database has been set up, you can finnish your installation by running <command>koha-create</command> with this option.</para>
+ <para>When you have run koha-create with the <option>--request-db</option> option, and a database has been set up, you can finish your installation by running <command>koha-create</command> with this option.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--use-db</option></term>
+ <listitem>
+ <para>When the database you want to use has already been populated, you can run <command>koha-create</command> with this option to take care of all the other set-up configuration.</para>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
+ <term><option>--database</option></term>
+ <listitem>
+ <para>MySQL database to use.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>--defaultsql</option></term>
<listitem>
<para>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.</para>
</varlistentry>
<varlistentry>
+ <term><option>--passwdfile</option></term>
+ <listitem>
+ <para>Path to an alternative passwd file. This file is in the same format as the default (Koha) passwd file, see below for details.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>--zebralang</option></term>
<listitem>
<para>Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable.</para>
</varlistentry>
<varlistentry>
+ <term><option>OPACPORT</option></term>
+ <listitem>
+ <para>The port for the OPAC.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>OPACPREFIX</option></term>
+ <listitem>
+ <para>This is inserted before the instance name when forming Apache ServerName. For subdomains, make sure it ends with a period.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>OPACSUFFIX</option></term>
+ <listitem>
+ <para>This is inserted after the instance name, but before the domain name, when forming Apache ServerName.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>INTRAPORT</option></term>
<listitem>
<para>The port for the intranet. If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX.</para>
<para>Configuration variables are read from this file, if it exists.</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><option><filename>/etc/koha/passwd</filename></option></term>
+ <listitem>
+ <para>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.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>
<refsynopsisdiv>
<cmdsynopsis>
- <command>koha-remove</command> <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg>
+ <command>koha-remove</command>
+ <arg><option>--keep-mysql</option></arg>
+ <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
+ <refsect1><title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>--keep-mysql</option></term>
+ <listitem>
+ <para>Leave the MySQL database and user when removing the Koha instance.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
<refsect1><title>Description</title>
<para>Remove a Koha instance.</para>
</refsect1>
-
+
<refsect1><title>See also</title>
<simplelist type="inline">
<member><command>koha-disable(8)</command></member>
<member><command>koha-restore(8)</command></member>
</simplelist>
</refsect1>
-
+
</refentry>
</article>
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" \
# Set defaults and read config file, if it exists.
DOMAIN=""
+OPACPORT="80"
+OPACPREFIX=""
+OPACSUFFIX=""
INTRAPORT="8080"
INTRAPREFIX=""
INTRASUFFIX=""
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!
-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" ;;
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"
eof
fi #`
+ if [ "$op" = use ]
+ then
+ mysql --defaults-extra-file=/etc/mysql/koha-common.cnf --force <<eof
+CREATE USER \`$mysqluser\`@'%' IDENTIFIED BY '$mysqlpwd';
+GRANT ALL PRIVILEGES ON \`$mysqldb\`.* TO \`$mysqluser\`;
+FLUSH PRIVILEGES;
+eof
+ fi #`
+
# Generate and install Apache site-available file and log dir.
generate_config_file apache-site.conf.in \
"/etc/apache2/sites-available/$name"
fi
-if [ "$op" = create ] || [ "$op" = populate ]
+if [ "$op" = create ] || [ "$op" = populate ] || [ "$op" = use ]
then
# Reconfigure Apache.
a2ensite "$name"
set -e
+args=$(getopt -l keep-mysql -o k -n $0 -- "$@")
+set -- $args
+while [ ! -z "$1" ]
+do
+ case "$1" in
+ -k|--keep-mysql) keepmysql=1; exit;;
+ *) break;;
+ esac
+ shift
+done
+
for name in "$@"
do
echo "Removing Koha instance $name"
- mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
+ if [ "$keepmysql" != "1" ]
+ then
+ mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
DROP USER \`koha_$name\`;
DROP DATABASE \`koha_$name\`;
FLUSH PRIVILEGES;
eof
+ fi #`
koha-stop-zebra $name
[ -f "/etc/apache2/sites-available/$name" ] && \
January 17 2012 Connor Dewar becomes the 169th developer to have a patch pushed (as part of the Catalyst Open Source Academy)
January 17 2012 Sam Sanders becomes the 170th developer to have a patch pushed (as part of the Catalyst Open Source Academy)
January 18 2012 Olivier Crouzet becomes the 171st developer to have a patch pushed
+January 31 2012 Bart Jorgensen becomes the 172st developer to have a patch pushed
+January 31 2012 Kate Henderson becomes the 173st developer to have a patch pushed
+January 31 2012 Jono Mingard becomes the 174st developer to have a patch pushed
+January 31 2012 Jorgia Kelsey becomes the 175st developer to have a patch pushed
+February 1 2012 Aleksa Vujicic becomes the 176th developer to have a patch pushed
+February 1 2012 Peter Lorimer becomes the 177th developer to have a patch pushed
+
--- /dev/null
+#! /usr/bin/perl
+use strict;
+use warnings;
+use C4::Context;
+my $dbh=C4::Context->dbh;
+$dbh->do(<<ENDOFRENEWAL);
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice');
+ENDOFRENEWAL
+print "Upgrade done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n";
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACLocalCoverImages','0','Display local cover images on OPAC search and details pages.','1','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('LocalCoverImages','0','Display local cover images on intranet details pages.','1','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowMultipleCovers','0','Allow multiple cover images to be attached to each bibliographic record.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice');
$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(<<ENDOFRENEWAL);
+ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice');
+ENDOFRENEWAL
+ print "Upgrade to $DBversion done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n";
SetVersion($DBversion);
}
=head1 FUNCTIONS
[% END %]
[% END %]
[% IF ( CAN_user_borrowers ) %]
- [% IF ( adultborrower ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C">Add child</a></li>[% END %]
+ [% IF ( adultborrower AND activeBorrowerRelationship ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C">Add child</a></li>[% END %]
[% IF ( CAN_user_staffaccess ) %] <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change Password</a></li>[% END %]
[% END %]
<li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]">Duplicate</a></li>
<li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&borrowernumber=[% borrowernumber %]&category_type=A">Edit</a></li>
[% END %]
[% END %]
- [% IF ( adultborrower ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C">Add child</a></li>[% END %]
+ [% IF ( adultborrower AND activeBorrowerRelationship ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C">Add child</a></li>[% END %]
[% IF CAN_user_staffaccess %]<li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change Password</a></li> [% END %]
<li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]">Duplicate</a></li>
<li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=page">Print Page</a></li>
<li>Andrei V. Toutoukine</li>
<li>Darrell Ulm</li>
<li>Universidad ORT Uruguay (Ernesto Silva, Andres Tarallo)</li>
+ <li>Aleksa Vujicic</li>
<li>Reed Wade</li>
<li>Ian Walls</li>
<li><a href="http://www.ohloh.net/accounts/janewagner">Jane Wagner</a></li>
</p>
[% END %]
- <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
+ <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a></fieldset>
</div>
</form>
[% END %]</tbody>
</table>
[% ELSE %]
+ [% IF ( emptyserverlist ) %]
+ You didn't select any Z39.50 target.
+ [% ELSE %]
+ [% FOREACH errcon IN errconn %]
+ Connection failed to [% errcon.server %]
+ [% END %]
+ [% END %]
<p>Nothing found. <a href="javascript: history.back()">Try another search</a>.</p>
[% END %]
- "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
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.
[% END %]
</span>
[% END %]
+ [% IF ( TagsEnabled && TagsShowOnDetail && TagLoop ) %]
+ <span class="results_summary"><span class="label">Tags:</span>
+ [% FOREACH TagLoo IN TagLoop %]
+ [% IF ( CAN_user_tools_moderate_tags ) %]
+ <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |url %]">[% TagLoo.term |html %]</a>
+ [% ELSE %]
+ [% TagLoo.term |html %]
+ [% END %]
+ <span class="weight">([% TagLoo.weight_total %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
+ [% END %]
+ </span>
+ [% END %]
[% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %]
[% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
</ul>
</li>
[% END %]
+ [% IF ( TagsEnabled && TagsShowOnDetail && TagLoop ) %]
+ <li><strong>Tags:</strong>
+ <ul id="tagslist">
+ [% FOREACH TagLoo IN TagLoop %]
+ <li>
+ [% IF ( CAN_user_tools_moderate_tags ) %]
+ <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |url %]">[% TagLoo.term |html %]</a>
+ [% ELSE %]
+ [% TagLoo.term |html %]
+ [% END %]
+ <span class="weight">([% TagLoo.weight_total %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]</li>
+ [% END %]
+ </ul></li>
+ [% END %]
[% IF ( holdcount ) %]<li><strong>Holds:</strong> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></li>[% ELSE %][% END %]
</ul>
[% END %]
+
</div>
</div>
<div id="bibliodetails" class="toptabs">
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Cataloging › Merging records</title>
+[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
<style type="text/css">
div.record ul, div.record li { float:none; display:block; }
});
+function changeFramework(fw) {
+ $("#Frameworks").val(fw);
+}
+
//]]>
</script>
</head>
<body>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cataloging-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> › [% IF ( biblionumber ) %]Editing <em>[% title |html %]</em> (Record Number [% biblionumber %])[% ELSE %]Add MARC Record[% END %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> › Merging records</div>
<div id="doc" class="yui-t7">
<fieldset class="rows">
<legend>Merge reference</legend>
<ol>
- <li class="radio"><input type="radio" value="[% biblio1 %]" checked="checked" id="mergereference1" name="mergereference" /><label style="float:none" for="mergereference1">[% title1 %] ([% biblio1 %])</label></li>
- <li class="radio"><input type="radio" value="[% biblio2 %]" id="mergereference2" name="mergereference" /><label style="float:none" for="mergereference2">[% title2 %] ([% biblio2 %])</label></li>
+ <li class="radio"><input type="radio" value="[% biblio1 %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% frameworkcode1 %]')" /><label for="mergereference1">[% title1 %] [% FOREACH subtitl1 IN subtitle1 %] [% subtitl1.subfield %][% END %] (<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblio1 %]" title="MARC" rel="gb_page_center[600,500]">[% biblio1 %]</a>)</label></li>
+ <li class="radio"><input type="radio" value="[% biblio2 %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 %]')" /><label for="mergereference2">[% title2 %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2.subfield %][% END %] (<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblio2 %]" title="MARC" rel="gb_page_center[600,500]">[% biblio2 %]</a>)</label></li>
+
+ [% IF frameworkselect %]
+ <li><label for="frameworkcode">Using framework:</label>
+ <select name="frameworkcode" id="frameworkcode">
+ <option value="Default">Default</option>
+ [% FOREACH frameworkcodeloo IN frameworkselect %]
+ [% IF ( frameworkcodeloo.selected ) %]
+ <option value="[% frameworkcodeloo.value %]" selected="selected">
+ [% ELSE %]
+ <option value="[% frameworkcodeloo.value %]">
+ [% END %]
+ [% frameworkcodeloo.frameworktext %]
+ </option>
+ [% END %]
+ </select></li>
+ [% END %]
</ol>
+
<input type="hidden" name="biblionumber" value="[% biblio1 %]" />
<input type="hidden" name="biblionumber" value="[% biblio2 %]" />
<fieldset class="action"><input type="submit" value="Next" /></fieldset>
[% END %]
</ul>
+</div>
+</div> <!-- // #result -->
+</div> <!-- .yui-u -->
<input type="hidden" name="biblio1" value="[% biblio1 %]" />
<input type="hidden" name="biblio2" value="[% biblio2 %]" />
<input type="hidden" name="mergereference" value="[% mergereference %]" />
+<input type="hidden" name="frameworkcode" value="[% framework %]" />
-</div>
-</div> <!-- // #result -->
-</div> <!-- .yui-u -->
<fieldset class="action"><input type="submit" name="merge" value="Merge" /></fieldset>
</div>
</form>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
+<script type=text/javascript>
+
+function confirmWriteoffAll() {
+ return confirm(_("Are you sure you want to writeoff all fines?"));
+}
+
+</script>
+
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Pay Fines for [% borrower.firstname %] [% borrower.surname %]</div>
<div id="doc3" class="yui-t2">
</table>
<fieldset class="action">
<input type="submit" name="paycollect" value="Pay Amount" class="submit" />
-<input type="submit" name="woall" value="Writeoff All" class="submit" />
-<input type="submit" name="payselected" value="Pay Selected" class="submit" />
+<input type="submit" name="woall" value="Writeoff All" class="submit" onclick="return confirmWriteoffAll()" />
+<input type="submit" name="payselected" value="Pay Selected" class="submit"/>
<a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
</fieldset>
</form>
--- /dev/null
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha › Tools › Tags › [% IF ( do_it ) %]Review › [% ELSE %]Review Tags[% END %]</title>
+[% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript">
+//<![CDATA[
+ $.tablesorter.addParser({
+ id: 'articles',
+ is: function(s) {return false; },
+ format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
+ type: 'text'
+ });
+ $(document).ready(function() {
+ $(".delete").click(function (event) {
+ $(this).parent().parent().parent().addClass("selected");
+ var answer = confirm(_("Are you sure you want to remove the tag from this title?"));
+ if (!answer){
+ $("tr").removeClass("selected");
+ event.preventDefault();
+ }
+ });
+ $("#itemst").tablesorter({
+ sortList: [[0,0]],
+ headers: { 0: { sorter: 'articles' },1: { sorter: false },2:{sorter:false}}
+ });
+ });
+//]]>
+</script>
+<style type="text/css">
+tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }</style>
+</head>
+<body>
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'cat-search.inc' %]
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/tags/review.pl">Tags</a> › Results for tag <i>[% tag %]</i></div>
+
+<div id="doc3" class="yui-t2">
+ <div id="bd">
+ <div id="yui-main">
+ <div class="yui-b">
+[% IF ( titles ) %]
+<h3>Titles tagged with the term <i>[% tag %]</i></h3>
+<table id="itemst">
+ <thead><tr>
+ <th>Title</th>
+ <th>Location</th>
+ <th> </th>
+ </tr></thead>
+
+ [% FOREACH title IN titles %]
+ [% IF ( title.even ) %]
+ <tr class="highlight">
+ [% ELSE %]
+ <tr>
+ [% END %]
+ <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = title.biblionumber %][% title.title |html %][% FOREACH subtitl IN title.subtitle %] [% subtitl.subfield %][% END %]</a>
+ [% title.author %]
+ <p>[% 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 %]</p>
+ [% IF ( title.notes ) %]
+ <p>[% title.notes |html%]</p>[% END %]
+ [% IF ( title.TagLoop ) %]<p style="font-size:90%"><strong>Tagged with:</strong> [% FOREACH TagLoo IN title.TagLoop %]
+ <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term %]">[% TagLoo.term |html %]</a> <span class="weight">([% TagLoo.weight_total %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
+ [% END %]</p>
+ [% END %]
+ </td>
+ <td>[% IF ( title.items ) %]<ul style="font-size:80%">[% FOREACH item IN title.items %]
+ <li>
+ [% item.branchname %] [% item.location_description %]
+ [% IF ( item.itemcallnumber ) %]
+ ([% item.itemcallnumber %])
+ [% END %]
+ </li>
+ [% END %]</ul>[% ELSE %]This record has no items.[% END %]
+ </td>
+ <td><form method="post" action="/cgi-bin/koha/tags/list.pl"><input type="hidden" name="op" value="del" /><input type="hidden" name="tag" value="[% tag %]" /><input type="hidden" name="tag_id" value="[% title.tag_id %]" /><input type="submit" class="delete" value="Remove tag" /></form></td>
+ </tr>
+ [% END %]
+ </table>
+[% ELSE %]
+ <div class="dialog message">There are no titles tagged with the term <i>[% tag %]</i></div>
+[% END %]
+</form>
+ </div>
+ </div>
+ <div class="yui-b">
+ <ul>
+ <li><a href="/cgi-bin/koha/tags/review.pl?approved=1">Approved tags</a>
+ </li>
+ <li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected tags</a>
+ </li>
+ <li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending tags</a>
+ </li>
+ <li><a href="/cgi-bin/koha/tags/review.pl?approved=all">All tags</a>
+ </li>
+ </ul>
+ </div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
[% ELSE %]<td class="pending">
[% END %]
</td>
- <td>[% tagloo.term %]
+ <td><a href="/cgi-bin/koha/tags/list.pl?tag=[% tagloo.term %]">[% tagloo.term %]</a>
</td>
<td>[% tagloo.weight_total %]
</td>
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
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;
email => $bor->{'email'},
branchcode => $bor->{'branchcode'},
branchname => GetBranchName($bor->{'branchcode'}),
+ activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
);
if ($countissues >0) {
$template->param(ItemsOnIssues => $countissues);
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;
}
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;
}
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;
destination => $destination,
is_child => ($bor->{'category_type'} eq 'C'),
defaultnewpassword => $defaultnewpassword,
+ activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
);
"dateformat_" . (C4::Context->preference("dateformat") || '') => 1,
samebranch => $samebranch,
quickslip => $quickslip,
+ activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
);
#Get the slip news items
sentnotices => 1,
branchname => GetBranchName($borrower->{'branchcode'}),
categoryname => $borrower->{'description'},
+ activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
);
output_html_with_http_headers $input, $cookie, $template->output;
}
}
+$template->param( activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne '') );
+
add_accounts_to_template();
output_html_with_http_headers $input, $cookie, $template->output;
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;
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;
template_name => "opac-addbybiblionumber.tmpl",
query => $query,
type => "opac",
- authnotrequired =>( C4::Context->preference("OpacPublic") ? 1 : 0 ),
+ authnotrequired => 0,
}
);
+++ /dev/null
-#!/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');
+++ /dev/null
-#!/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.
--- /dev/null
+#!/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');
--- /dev/null
+#!/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.
--- /dev/null
+#!/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;