diff --git a/C4/Serials.pm b/C4/Serials.pm index 35cc5be846..032246c4e8 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -405,14 +405,17 @@ sub PrepareSerialsData { my $first; my $previousnote = ""; - foreach my $subs (@$lines) { - $subs->{'publisheddate'} = ( - $subs->{'publisheddate'} - ? format_date( $subs->{'publisheddate'} ) - : "XXX" - ); + foreach my $subs (@{$lines}) { + for my $datefield ( qw(publisheddate planneddate) ) { + # handle both undef and undef returned as 0000-00-00 + if (!defined $subs->{$datefield} or $subs->{$datefield}=~m/^00/) { + $subs->{$datefield} = 'XXX'; + } + else { + $subs->{$datefield} = format_date( $subs->{$datefield} ); + } + } $subs->{'branchname'} = GetBranchName( $subs->{'branchcode'} ); - $subs->{'planneddate'} = format_date( $subs->{'planneddate'} ); $subs->{ "status" . $subs->{'status'} } = 1; $subs->{"checked"} = $subs->{'status'} =~ /1|3|4|7/; diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl index 7f04754d12..1238e16ae2 100755 --- a/acqui/z3950_search.pl +++ b/acqui/z3950_search.pl @@ -2,6 +2,7 @@ # This is a completely new Z3950 clients search using async ZOOM -TG 02/11/06 # Copyright 2000-2002 Katipo Communications +# Copyright 2010 Catalyst IT # # This file is part of Koha. # @@ -89,12 +90,12 @@ my $DEBUG = 0; # if set to 1, many debug message are send on syslog. my $frameworks = getframeworks; my @frameworkcodeloop; foreach my $thisframeworkcode ( keys %$frameworks ) { - my $row = { + my %row = ( value => $thisframeworkcode, frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, - }; - if ( $row->{'value'} eq $frameworkcode){ - $row->{'active'} = 'true'; + ); + if ( $row{'value'} eq $frameworkcode){ + $row{'active'} = 'true'; } push @frameworkcodeloop, $row; } @@ -246,8 +247,8 @@ sub displayresults { # In rel2_2 i am not sure what encoding is so no character conversion is done here ##Add necessary encoding changes to here -TG my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" ); - $oldbiblio->{isbn} =~ s/ |-|\.//g, - $oldbiblio->{issn} =~ s/ |-|\.//g, + $oldbiblio->{isbn} =~ s/ |-|\.//g if $oldbiblio->{isbn}; + $oldbiblio->{issn} =~ s/ |-|\.//g if $oldbiblio->{issn}; my ( $notmarcrecord, $alreadyindb, $alreadyinfarm, $imported, $breedingid @@ -283,14 +284,13 @@ sub displayresults { server => $servername[$k], numberpending => $numberpending, ); - output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0; # print $template->output if $firstresult !=1; $firstresult++; } displayresults(); -if ( --$nremaining > 0 ) { +while ( --$nremaining > 0 ) { displayresults(); } } ## if op=search diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 9e90d617ce..24d83d9cd6 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -52,6 +52,8 @@ use C4::Languages qw(getTranslatedLanguages); use C4::ClassSource; use C4::Log; use C4::Output; +use YAML::Syck qw( Dump LoadFile ); + # use Smart::Comments; @@ -95,8 +97,39 @@ $tabsysprefs{Intranet_includes} = "Admin"; $tabsysprefs{AutoLocation} = "Admin"; $tabsysprefs{DebugLevel} = "Admin"; $tabsysprefs{SessionStorage} = "Admin"; + +# This script is depricated so all of these prefs are lumped here to avoid their being displayed in the local use prefs tab + $tabsysprefs{noItemTypeImages} = "Admin"; $tabsysprefs{OPACBaseURL} = "Admin"; +$tabsysprefs{AnonymousPatron} = "Admin"; +$tabsysprefs{casAuthentication} = "Admin"; +$tabsysprefs{casLogout} = "Admin"; +$tabsysprefs{casServerUrl} = "Admin"; +$tabsysprefs{Disable_Dictionary} = "Admin"; +$tabsysprefs{EnableOpacSearchHistory} = "Admin"; +$tabsysprefs{'ILS-DI:AuthorizedIPs'} = "Admin"; +$tabsysprefs{Intranetbookbag} = "Admin"; +$tabsysprefs{maxitemsinSearchResults} = "Admin"; +$tabsysprefs{noOPACUserLogin} = "Admin"; +$tabsysprefs{'OAI-PMH:ConfFile'} = "Admin"; +$tabsysprefs{OpacAddMastheadLibraryPulldown} = "Admin"; +$tabsysprefs{opaclargeimage} = "Admin"; +$tabsysprefs{OpacPrivacy} = "Admin"; +$tabsysprefs{OPACXSLTDetailsDisplay} = "Admin"; +$tabsysprefs{OPACXSLTResultsDisplay} = "Admin"; +$tabsysprefs{PDFFontType} = "Admin"; +$tabsysprefs{PINESISBN} = "Admin"; +$tabsysprefs{PrintNoticesMaxLines} = "Admin"; +$tabsysprefs{ReservesControlBranch} = "Admin"; +$tabsysprefs{ResultsDisplay} = "Admin"; +$tabsysprefs{NoReturnSetLost} = "Admin"; +$tabsysprefs{SearchURL} = "Admin"; +$tabsysprefs{ShowPictures} = "Admin"; +$tabsysprefs{soundon} = "Admin"; +$tabsysprefs{SpineLabelShowPrintOnBibDetails} = "Admin"; +$tabsysprefs{WebBasedSelfCheckHeader} = "Admin"; +$tabsysprefs{WebBasedSelfCheckTimeout} = "Admin"; # Authorities $tabsysprefs{authoritysep} = "Authorities"; @@ -427,12 +460,14 @@ sub StringSearch { ORDER BY VARIABLE" ); $sth->execute( "%$searchstring%", "%$searchstring%" ); } else { - my $strsth = "Select variable,value,explanation,type,options from systempreferences where variable not in ("; - foreach my $syspref ( keys %tabsysprefs ) { - $strsth .= $dbh->quote($syspref) . ","; + my $strsth = "Select variable,value,explanation,type,options from systempreferences where variable in ("; + my $first = 1; + for my $name ( get_local_prefs() ) { + $strsth .= ',' unless $first; + $strsth .= "'$name'"; + $first = 0; } - $strsth =~ s/,$/) /; - $strsth .= " order by variable"; + $strsth .= ") order by variable"; $sth = $dbh->prepare($strsth); $sth->execute(); } @@ -779,3 +814,79 @@ if ( $op eq 'add_form' ) { $template->param( tab => $tab, ); } #---- END $OP eq DEFAULT output_html_with_http_headers $input, $cookie, $template->output; + + +# Return an array containing all preferences defined in current Koha instance +# .pref files. + +sub get_prefs_from_files { + my $context = C4::Context->new(); + my $path_pref_en = $context->config('intrahtdocs') . + '/prog/en/modules/admin/preferences'; + # Get all .pref file names + opendir ( my $fh, $path_pref_en ); + my @pref_files = grep { /.pref/ } readdir($fh); + close $fh; + + my @names = (); + my $append = sub { + my $prefs = shift; + for my $pref ( @$prefs ) { + for my $element ( @$pref ) { + if ( ref( $element) eq 'HASH' ) { + my $name = $element->{pref}; + next unless $name; + push @names, $name; + last; + } + } + } + }; + for my $file (@pref_files) { + my $pref = LoadFile( "$path_pref_en/$file" ); + for my $tab ( keys %$pref ) { + my $content = $pref->{$tab}; + if ( ref($content) eq 'ARRAY' ) { + $append->($content); + next; + } + for my $section ( keys %$content ) { + my $syspref = $content->{$section}; + $append->($syspref); + } + } + } + return @names; +} + + +# Return an array containg all preferences defined in DB + +sub get_prefs_from_db { + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("SELECT variable FROM systempreferences"); + $sth->execute; + my @names = (); + while ( (my $name) = $sth->fetchrow_array ) { + push @names, $name if $name; + } + return @names; +} + + +# Return an array containing all local preferences: those which are defined in +# DB and not defined in Koha .pref files. + +sub get_local_prefs { + my @prefs_file = get_prefs_from_files(); + my @prefs_db = get_prefs_from_db(); + + my %prefs_file = map { $_ => 1 } @prefs_file; + my @names = (); + foreach my $name (@prefs_db) { + push @names, $name unless $prefs_file{$name}; + } + + return @names; +} + diff --git a/install_misc/apt-get-debian-lenny.sh b/install_misc/apt-get-debian-lenny.sh index eb3aa70a84..48c53e4291 100755 --- a/install_misc/apt-get-debian-lenny.sh +++ b/install_misc/apt-get-debian-lenny.sh @@ -52,7 +52,7 @@ libidzebra-2.0-mod-grs-regx \ libidzebra-2.0-mod-grs-xml \ libidzebra-2.0-mod-text \ libidzebra-2.0-modules \ -libimage-magick-perl \ +libgraphics-magick-perl \ libjson-perl \ libjson-xs-perl \ liblingua-ispell-perl \ diff --git a/install_misc/debian.packages b/install_misc/debian.packages index 11dfeb4b30..5ff782fd1f 100644 --- a/install_misc/debian.packages +++ b/install_misc/debian.packages @@ -38,7 +38,7 @@ libidzebra-2.0-mod-grs-regx install libidzebra-2.0-mod-grs-xml install libidzebra-2.0-mod-text install libidzebra-2.0-modules install -libimage-magick-perl install +libgraphics-magick-perl install libjson-perl install liblingua-ispell-perl install liblingua-stem-perl install diff --git a/install_misc/install_koha_on_fresh_debian b/install_misc/install_koha_on_fresh_debian index 3595bf5e50..f20127bc05 100644 --- a/install_misc/install_koha_on_fresh_debian +++ b/install_misc/install_koha_on_fresh_debian @@ -467,7 +467,7 @@ libxslt1-dev libyaml-syck-perl libhtml-template-pro-perl libdbd-mysql-perl/testing -libimage-magick-perl +libgraphics-magick-perl liblist-moreutils-perl libtext-iconv-perl/testing libalgorithm-checkdigits-perl diff --git a/install_misc/ubuntu.packages b/install_misc/ubuntu.packages index 818358ad02..56430bfc32 100644 --- a/install_misc/ubuntu.packages +++ b/install_misc/ubuntu.packages @@ -14,7 +14,7 @@ libdate-calc-perl install libdate-manip-perl install libdate-ical-perl install libdatetime-format-mail-perl install -libimage-magick-perl install +libgraphics-magick-perl install libmail-sendmail-perl install liblingua-ispell-perl install liblingua-stem-perl install diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc index d7c87c4822..c508af0cd3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc @@ -23,7 +23,7 @@ var newmenu = [ - + { text: "", url: "/cgi-bin/koha/members/memberentry.pl?op=add&categorycode=" }, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc index 2716ec876c..b72e305ee5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc @@ -8,7 +8,7 @@
  • Creators
  • Enhanced Content
  • I18N/L10N
  • -
  • Local Use
  • +
  • Local Use
  • Logs
  • OPAC
  • Patrons
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc index 6e535a5ac1..3b2fea47b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc @@ -1,20 +1,20 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl index 05ca4e4433..afa2a35801 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl @@ -18,7 +18,7 @@
    -

    Global system preferences

    +

    Global system preferences

    Manage global system preferences like MARC flavor, date format, administrator email, and templates.

    " /> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl index 2460c9207c..569d87515c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl @@ -225,7 +225,7 @@ $(document).ready(function() { remove it from all classification source definitions before trying again.

    " method="get"> - +
    @@ -240,13 +240,13 @@ $(document).ready(function() {

    Classification Sources

    -Added classification source +
    Added classification source
    -Modified classification source +
    Modified classification source
    -Deleted classification source +
    Deleted classification source
    @@ -279,13 +279,13 @@ $(document).ready(function() {

    Classification Filing Rules

    -Added filing rule +
    Added filing rule
    -Modified filing rule +
    Modified filing rule
    -Deleted filing rule +
    Deleted filing rule
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tmpl index 9caef3c3de..a8207e4b96 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tmpl @@ -1,4 +1,5 @@ -Koha Online Catalog › Sending Your Cart + +<!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog › Sending Your Cart diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl index 49fd9e663b..e7ec2f22f0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl @@ -1,14 +1,14 @@ Koha Online Catalog › An Error Has Occurred - + +
    +
    - -
    -
    -
    -
    +
    +
    +

    An Error has Occurred

    Error 400

    -
    -
    -
    -
    - - - - - +
    +
    + +
    +
    + +
    +
    +
    + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl index 73ed72b0af..cd975604dc 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl @@ -1,14 +1,14 @@ Koha Online Catalog › An Error Has Occurred - + +
    +
    - -
    -
    -
    -
    +
    +
    +

    An Error has Occurred

    Error 401

    -
    -
    -
    -
    - - - - - +
    +
    + +
    +
    + +
    +
    +
    + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/402.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/402.tmpl index 13eb795c3d..003526628d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/errors/402.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/402.tmpl @@ -1,14 +1,14 @@ Koha Online Catalog › An Error Has Occurred - + +
    +
    - -
    -
    -
    -
    +
    +
    +

    An Error has Occurred

    Error 402

    -
    -
    -
    -
    - - - - - +
    +
    + +
    +
    + +
    +
    +
    + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl index 81b15da9d1..f099511379 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl @@ -1,14 +1,14 @@ Koha Online Catalog › An Error Has Occurred - + +
    +
    - -
    -
    -
    -
    +
    +
    +

    An Error has Occurred

    Error 403

    -
    -
    -
    -
    - - - - - +
    +
    + +
    +
    + +
    +
    +
    + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl index bb07e535ac..0f7472eaff 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl @@ -1,14 +1,14 @@ Koha Online Catalog › An Error Has Occurred - + +
    +
    - -
    -
    -
    -
    +
    +
    +

    An Error has Occurred

    Error 404

    -
    -
    -
    -
    - - - - - +
    +
    + +
    +
    + +
    +
    +
    + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl index f96e407559..d45c5db95d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl @@ -1,14 +1,14 @@ Koha Online Catalog › An Error Has Occurred - + +
    +
    - -
    -
    -
    -
    +
    +
    +

    An Error has Occurred

    Error 500

    -
    -
    -
    -
    - - - - - +
    +
    + +
    +
    + +
    +
    +
    + diff --git a/members/members-home.pl b/members/members-home.pl index e497f4adaf..04fc557045 100755 --- a/members/members-home.pl +++ b/members/members-home.pl @@ -54,7 +54,7 @@ if($quicksearch){ my @categories=C4::Category->all; $template->param( branchloop=>(defined $branch?GetBranchesLoop($branch):GetBranchesLoop()), - categoryloop=>\@categories, + categories=>\@categories, ); $template->param( "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",