Browse Source

some fixes (and only fixes)

3.0.x
tipaul 15 years ago
parent
commit
23427c51b9
  1. 26
      C4/Biblio.pm
  2. 2
      C4/Output.pm
  3. 1
      C4/Search.pm
  4. 8
      catalogue/moredetail.pl
  5. 51
      cataloguing/addbiblio.pl
  6. 1
      installer/install.pl
  7. 4
      koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
  8. 1
      koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc
  9. 46
      koha-tmpl/opac-tmpl/prog/en/includes/opac.css
  10. 2
      koha-tmpl/opac-tmpl/prog/en/opac-advsearch.tmpl
  11. 2
      koha-tmpl/opac-tmpl/prog/en/opac-authorities-home.tmpl
  12. 9
      misc/cronjobs/build_browser_and_cloud.pl
  13. 12
      misc/migration_tools/rebuild_nozebra.pl
  14. 2
      reserve/renewscript.pl

26
C4/Biblio.pm

@ -1996,14 +1996,11 @@ sub TransformHtmlToXml {
my $xml = MARC::File::XML::header('UTF-8');
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
MARC::File::XML->default_record_format('UNIMARC');
use POSIX qw(strftime);
my $string = strftime( "%Y%m%d", localtime(time) );
$string = sprintf( "%-*s", 35, $string );
substr( $string, 22, 6, "frey50" );
$xml .= "<datafield tag=\"100\" ind1=\"\" ind2=\"\">\n";
$xml .= "<subfield code=\"a\">$string</subfield>\n";
$xml .= "</datafield>\n";
}
}
# in UNIMARC, field 100 contains the encoding
# check that there is one, otherwise the
# MARC::Record->new_from_xml will fail (and Koha will die)
my $unimarc_and_100_exist=0;
my $prevvalue;
my $prevtag = -1;
my $first = 1;
@ -2017,6 +2014,7 @@ sub TransformHtmlToXml {
if ( !utf8::is_utf8( @$values[$i] ) ) {
utf8::decode( @$values[$i] );
}
$unimarc_and_100_exist=1 if C4::Context->preference('marcflavour') eq 'UNIMARC' and @$tags[$i] eq "100" and @$subfields[$i] eq "a";
if ( ( @$tags[$i] ne $prevtag ) ) {
$j++ unless ( @$tags[$i] eq "" );
if ( !$first ) {
@ -2087,6 +2085,15 @@ sub TransformHtmlToXml {
}
$prevtag = @$tags[$i];
}
if (C4::Context->preference('marcflavour') and !$unimarc_and_100_exist) {
use POSIX qw(strftime);
my $string = strftime( "%Y%m%d", localtime(time) );
$string = sprintf( "%-*s", 35, $string );
substr( $string, 22, 6, "frey50" );
$xml .= "<datafield tag=\"100\" ind1=\"\" ind2=\"\">\n";
$xml .= "<subfield code=\"a\">$string</subfield>\n";
$xml .= "</datafield>\n";
}
$xml .= MARC::File::XML::footer();
return $xml;
@ -3936,6 +3943,9 @@ Joshua Ferraro jmf@liblime.com
# $Id$
# $Log$
# Revision 1.212 2007/06/15 13:44:44 tipaul
# some fixes (and only fixes)
#
# Revision 1.211 2007/06/15 09:40:06 toins
# do not get $3 $4 and $5 on GetMarcSubjects GetMarcAuthors on unimarc flavour.
#

2
C4/Output.pm

@ -326,7 +326,7 @@ corresponds to the HTML page $html.
sub output_html_with_http_headers ($$$) {
my($query, $cookie, $html) = @_;
print $query->header(
-type => 'utf-8',
-type => 'text/html; charset=utf-8',
-cookie => $cookie,
), $html;
}

1
C4/Search.pm

@ -1218,6 +1218,7 @@ sub NZanalyse {
# automatic replace for short operators
$left='title' if $left eq 'ti';
$left='author' if $left eq 'au';
$left='publisher' if $left eq 'pb';
$left='koha-Auth-Number' if $left eq 'an';
if ($operator) {
#do a specific search

8
catalogue/moredetail.pl

@ -66,8 +66,8 @@ $data->{'dewey'}=$dewey;
my @results;
my (@items)= itemissues($bi);
my $count=@items;
my $items= GetItemIssues($bi);
my $count=@$items;
$data->{'count'}=$count;
my $ordernum = GetOrderNumber($biblionumber,$bi);
@ -75,7 +75,7 @@ my $order = GetOrder($ordernum);
$results[0]=$data;
foreach my $item (@items){
foreach my $item (@$items){
$item->{'replacementprice'}=sprintf("%.2f", $item->{'replacementprice'});
$item->{'datelastborrowed'}= format_date($item->{'datelastborrowed'});
$item->{'dateaccessioned'} = format_date($item->{'dateaccessioned'});
@ -94,7 +94,7 @@ foreach my $item (@items){
}
$template->param(BIBITEM_DATA => \@results);
$template->param(ITEM_DATA => \@items);
$template->param(ITEM_DATA => \@$items);
$template->param(loggedinuser => $loggedinuser);
output_html_with_http_headers $query, $cookie, $template->output;

51
cataloguing/addbiblio.pl

@ -97,32 +97,31 @@ sub MARCfindbreeding {
my ($file,$marc,$encoding) = $sth->fetchrow;
if ($marc) {
my $record = MARC::Record->new_from_usmarc($marc);
if ($record->field('010')){
foreach my $field ($record->field('010'))
{
foreach my $subfield ($field->subfield('a')){
my $newisbn = $field->subfield('a');
$newisbn =~ s/-//g;
$field->update( 'a' => $newisbn );
}
# $record->insert_fields_ordered($record->field('010'));
}
}
if ($record->subfield(100,'a')){
my $f100a=$record->subfield(100,'a');
my $f100 = $record->field(100);
my $f100temp = $f100->as_string;
$record->delete_field($f100);
if (length($f100temp)>28){
substr($f100temp,26,2,"50");
$f100->update('a' => $f100temp);
my $f100 = MARC::Field->new('100','','','a' => $f100temp);
$record->insert_fields_ordered($f100);
}
}
if ($record->field('010')){
foreach my $field ($record->field('010'))
{
foreach my $subfield ($field->subfield('a')){
my $newisbn = $field->subfield('a');
$newisbn =~ s/-//g;
$field->update( 'a' => $newisbn );
}
# $record->insert_fields_ordered($record->field('010'));
}
}
warn "AVANT : ".$record->as_formatted;
if ($record->subfield(100,'a')) {
my $f100a=$record->subfield(100,'a');
my $f100 = $record->field(100);
my $f100temp = $f100->as_string;
$record->delete_field($f100);
if (length($f100temp)>28) {
substr($f100temp,26,2,"50");
$f100->update('a' => $f100temp);
my $f100 = MARC::Field->new('100','','','a' => $f100temp);
$record->insert_fields_ordered($f100);
}
}
warn "APRES: ".$record->as_formatted;
if (ref($record) eq undef) {
return -1;
} else {

1
installer/install.pl

@ -118,6 +118,7 @@ if ($step && $step==1){
unless (eval {require Digest::MD5}) { push @missing,{name=>"Digest::MD5"} };
unless (eval {require MARC::Record}) { push @missing,{name=>"MARC::Record"} };
unless (eval {require Mail::Sendmail}) { push @missing,{name=>"Mail::Sendmail",usagemail=>1} };
unless (eval {require List::MoreUtils}) { push @missing,{name=>"List::MoreUtils"} };
# The following modules are not mandatory, depends on how the library want to use Koha
unless (eval {require PDF::API2}) {
if ($#missing>=0) { # only when $#missing >= 0 so this isn't fatal

4
koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc

@ -10,10 +10,10 @@
<!-- TMPL_VAR NAME="LibraryName" -->
</div>
<div id="opac-main-search">
<label for="masthead_search">Search</label>
Search
<form name="searchform" method="POST" action="/cgi-bin/koha/opac-search.pl" id="searchform">
<input type="text" name="q" style="width: 30%;"/>
<input type="submit" value="Search" class="submit" />
<input type="submit" value="OK" class="submit" />
</form>
<a href="/cgi-bin/koha/opac-search.pl">more search options</a>
</div>

1
koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc

@ -31,7 +31,6 @@
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</ul>
<br />
</div>
<div id="main"> <!-- MAIN Body start here -->

46
koha-tmpl/opac-tmpl/prog/en/includes/opac.css

@ -47,7 +47,8 @@ label {
display:block;
float:left;
margin-right:0.2em;
width:7em;
width:10em;
font-size:0.8em;
}
a:link, a:visited, a:active {
@ -149,16 +150,19 @@ tr.highlight td, tr.highlight th {
text-align:left;
font-size:150%;
font-weight:bold;
margin-bottom:25px;
margin-bottom:5px;
}
/* The image on the top-left (the logo) */
#masthead-image {
position:fixed;
padding-left:0px;
padding-top:0px;
position:absolute;
left:10px;
top:10px;
background-color:white;
}
#masthead-image img {
background-color:white;
}
/* the itemtype list in advanced search */
@ -184,14 +188,18 @@ tr.highlight td, tr.highlight th {
/* the content part of every page */
#main {
margin-left:20%;
margin-left:15%;
margin-bottom:0px;
}
/* the main menu (home, adv search) */
#menu {
position:fixed;
padding:0px;
position:absolute;
padding:10px;
left:0px;
top:100px;
width:12%;
font-size:0.8em;
font-weight:bold;
color:#384b73;
@ -204,34 +212,42 @@ tr.highlight td, tr.highlight th {
text-decoration:none;
color:#384b73;
white-space: nowrap;
margin:0px;
padding:0px;
}
#menu ul a:hover {
display:block;
margin:5px 5px 0px 5px;
padding :5px 5px 0px 5px;
margin:0;
padding :0;
text-decoration:none;
color:#990033;
white-space: nowrap;
}
#menu ul {
padding-left:0px;
margin-bottom:0px;
margin-top:0px;
margin:0;
padding-bottom:0px;
}
#menu li {
list-style-type:none;
margin:0px;
padding-bottom:10px;
}
/***************/
/* login block */
/***************/
#login {
position:fixed;
bottom:0px;
position:absolute;
left:0px;
bottom:10px;
font-size:0.8em;
background-color : #cccccc;
background-color : #dddddd;
padding:10px;
margin-right:84%;
width:12%;
}
#login input {
font-size:0.8em;

2
koha-tmpl/opac-tmpl/prog/en/opac-advsearch.tmpl

@ -442,7 +442,7 @@
<!-- RANK LIMITS -->
<!-- SEARCH BUTTONS -->
<p>
<input class="submit" type="submit" accesskey="s" name="do" title="Search" value="Search"/>
<input class="submit" type="submit" accesskey="s" name="do" title="Search" value="OK"/>
<!-- TMPL_IF NAME="expanded_options" -->
<a href="/cgi-bin/koha/opac-search.pl">[Fewer Options]</a>
<!-- TMPL_ELSE -->

2
koha-tmpl/opac-tmpl/prog/en/opac-authorities-home.tmpl

@ -60,7 +60,7 @@
</p>
<p>(add % at the end of your word if you want to use right-truncation : <b>theor%</b> will find theory &amp; theories)</p>
<p>
<input type="submit" value="Start search" class="submit">
<input type="submit" value="OK" class="submit">
</p>
</div>
</form>

9
misc/cronjobs/build_browser_and_cloud.pl

@ -46,9 +46,11 @@ die;
#
###################################
$max_digits=3 unless $max_digits;
$field =~ /(\d\d\d)(.?)/;
my $browser_tag = $1;
my $browser_subfield = $2;
warn "browser : $browser_tag / $browser_subfield";
die "no cloud or browser field/subfield defined : nothing to do !" unless $browser_tag or $cloud_tag;
my $dbh = C4::Context->dbh;
@ -107,13 +109,16 @@ while ((my ($biblionumber)= $sth->fetchrow)) {
# fills the browser table
if ($browser_tag) {
print "inserting datas in browser table\n";
# read existing classification table is possible
my $classification;
if (C4::Context->preference('opaclanguages') eq 'en' && $browser_tag eq '676' & $browser_subfield eq 'a') {
if (C4::Context->preference('opaclanguages') eq 'fr' && $browser_tag eq '676' & $browser_subfield eq 'a') {
$classification = dewey_french();
}
$classification = dewey_french();
# calculate end node...
use Data::Dumper;
warn "==>".Dumper(%browser_result);
foreach (keys %browser_result) {
my $father = substr($_,0,-1);
$browser_result{$father}->{notendnode}=1;

12
misc/migration_tools/rebuild_nozebra.pl

@ -55,7 +55,7 @@ unless (%index) {
'biblionumber' =>'0909',
'itemtype' => '200b',
'language' => '101a',
'publisher' => '210x',
'publisher' => '210c',
'date' => '210d',
'note' => '300a,301a,302a,303a,304a,305a,306az,307a,308a,309a,310a,311a,312a,313a,314a,315a,316a,317a,318a,319a,320a,321a,322a,323a,324a,325a,326a,327a,328a,330a,332a,333a,336a,337a,345a',
'Koha-Auth-Number' => '6009,6019,6029,6039,6049,6059,6069,6109,7009,7019,7029,7109,7119,7129',
@ -147,15 +147,20 @@ while (my ($biblionumber) = $sth->fetchrow) {
}
}
}
print "\nInserting records...\n";
$i=0;
my $sth = $dbh->prepare("INSERT INTO nozebra (server,indexname,value,biblionumbers) VALUES ('biblioserver',?,?,?)");
foreach my $key (keys %result) {
foreach my $index (keys %{$result{$key}}) {
if (length($result{$key}->{$index}) > 1000000) {
print "very long index (".length($result{$key}->{$index}).")for $key / $index. update mySQL config file if you have an error just after this warning (max_paquet_size parameter)\n";
}
print "\r$i";
$i++;
$sth->execute($key,$index,$result{$key}->{$index});
}
}
print "\nbiblios done\n";
print "\n***********************************\n";
print "***** building AUTHORITIES indexes *****\n";
@ -237,12 +242,17 @@ while (my ($authid) = $sth->fetchrow) {
}
}
}
print "\nInserting...\n";
$i=0;
my $sth = $dbh->prepare("INSERT INTO nozebra (server,indexname,value,biblionumbers) VALUES ('authorityserver',?,?,?)");
foreach my $key (keys %result) {
foreach my $index (keys %{$result{$key}}) {
if (length($result{$key}->{$index}) > 1000000) {
print "very long index (".length($result{$key}->{$index}).")for $key / $index. update mySQL config file if you have an error just after this warning (max_paquet_size parameter)\n";
}
print "\r$i";
$i++;
$sth->execute($key,$index,$result{$key}->{$index});
}
}
print "\nauthorities done\n";

2
reserve/renewscript.pl

@ -55,7 +55,7 @@ foreach my $itemno (@data) {
# warn "renewal added";
# }else {
# warn "cannot renew";
# }
}
}
#

Loading…
Cancel
Save