'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);
}
# 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;
}
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;
# 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
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 };
"biblio.title" => "$$orderinfo{title}",
"biblio.author" => "$$orderinfo{author}",
"biblio.seriestitle" => $$orderinfo{series} ? $$orderinfo{series} : "",
- "biblioitems.isbn" => $$orderinfo{isbn} ? $$orderinfo{isbn} : "",
+ "biblioitems.isbn" => $$orderinfo{ISBN} ? $$orderinfo{ISBN} : "",
"biblioitems.publishercode" => $$orderinfo{publishercode} ? $$orderinfo{publishercode} : "",
"biblioitems.publicationyear" => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
});
$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;
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" ) {
idzebra-2.0-utils \
libalgorithm-checkdigits-perl \
libbiblio-endnotestyle-perl \
+libbusiness-isbn-perl \
libcgi-session-perl \
libcgi-session-serialize-yaml-perl \
libclass-accessor-perl \
+++ /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>
</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" -->
// 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 -->
<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>
<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>
}
}
- if(C4::Context->preference('uppercasesurnames')) {
+ if($newdata{surname} && C4::Context->preference('uppercasesurnames')) {
$newdata{'surname'} = uc($newdata{'surname'});
}
$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 );