Merge branch 'translation' of git://git.workbuffer.org/git/koha into master
authorGalen Charlton <gmcharlt@gmail.com>
Wed, 6 Oct 2010 10:31:43 +0000 (06:31 -0400)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 6 Oct 2010 10:32:07 +0000 (06:32 -0400)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
18 files changed:
C4/Installer/PerlDependencies.pm
C4/Koha.pm
C4/Letters.pm
C4/VirtualShelves/Page.pm
acqui/addorder.pl
admin/preferences.pl
admin/systempreferences.pl
cataloguing/additem.pl
install_misc/apt-get-debian-lenny.sh
koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
members/memberentry.pl
misc/cronjobs/overdue_notices.pl

index 19a84a0..3ac49dc 100644 (file)
@@ -464,6 +464,11 @@ our $PERL_DEPS = {
         'required' => '0',
         'min_ver'  => '0.97',
     },
+    'Business::ISBN' => {
+        'usage'    => 'Core',
+        'required' => '0',
+        'min_ver'  => '2.05',
+    },
 };
 
 1;
index cb93034..fb27ee2 100644 (file)
@@ -24,6 +24,7 @@ use C4::Context;
 use C4::Output;
 use URI::Split qw(uri_split);
 use Memoize;
+use Business::ISBN;
 
 use vars qw($VERSION @ISA @EXPORT $DEBUG);
 
@@ -1235,6 +1236,7 @@ sub GetNormalizedUPC {
 }
 
 # 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;
@@ -1321,19 +1323,12 @@ sub _normalize_match_point {
 }
 
 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;
index 885ed5f..62b339a 100644 (file)
@@ -275,7 +275,7 @@ sub SendAlerts {
 
             # 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
index 73ca42d..9d15847 100644 (file)
@@ -89,7 +89,8 @@ sub shelfpage ($$$$$) {
         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 };
index 2ab5252..10a7ea9 100755 (executable)
@@ -196,7 +196,7 @@ if ( $orderinfo->{quantity} ne '0' ) {
                 "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}: "",
             });
index b5bcde8..7fcf5fc 100755 (executable)
@@ -266,7 +266,8 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 $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;
 
index 824b058..411f434 100755 (executable)
@@ -801,7 +801,7 @@ if ( $op eq 'add_form' ) {
         $row_data->{delete} = "$script_name?op=delete_confirm&amp;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;
index ea4daf9..e6f19d2 100755 (executable)
@@ -433,7 +433,10 @@ foreach my $tag (sort keys %{$tagslib}) {
           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" ) {
index 48c53e4..8b90a85 100755 (executable)
@@ -12,6 +12,7 @@ idzebra-2.0 \
 idzebra-2.0-utils \
 libalgorithm-checkdigits-perl \
 libbiblio-endnotestyle-perl \
+libbusiness-isbn-perl \
 libcgi-session-perl \
 libcgi-session-serialize-yaml-perl \
 libclass-accessor-perl \
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc
deleted file mode 100644 (file)
index 3b2fea4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<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>
index d494cf2..64d5a67 100644 (file)
                 <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>
index 8d54fe0..de9a592 100644 (file)
 </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" -->
index e722afb..3e510c5 100644 (file)
@@ -324,12 +324,12 @@ function CloneField(index) {
             
             // 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') + "')");
                     }
                 }
             }
@@ -479,19 +479,19 @@ function CloneSubfield(index){
     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 + "')");
                 }
             }
         }
@@ -810,8 +810,8 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
                 <!-- 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 -->
 
                 
index 0067cef..7701a22 100644 (file)
                 <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>
index 3572379..6e97ad1 100755 (executable)
                 <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>
index 65e14e5..88f9cca 100644 (file)
     <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>
index 6ec6d8e..eacb2ff 100755 (executable)
@@ -247,7 +247,7 @@ if ($op eq 'save' || $op eq 'insert'){
     }
   }
   
-    if(C4::Context->preference('uppercasesurnames')) {
+    if($newdata{surname} && C4::Context->preference('uppercasesurnames')) {
         $newdata{'surname'} = uc($newdata{'surname'});
     }
 
index 4de6cdd..2e7b2e4 100755 (executable)
@@ -662,10 +662,7 @@ sub parse_letter { # FIXME: this code should probably be moved to C4::Letters:pa
                 $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 );