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;
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 ) {
}
$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;
# $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.
#
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;
}
# 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
my @results;
-my (@items)= itemissues($bi);
-my $count=@items;
+my $items= GetItemIssues($bi);
+my $count=@$items;
$data->{'count'}=$count;
my $ordernum = GetOrderNumber($biblionumber,$bi);
$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'});
}
$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;
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 {
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
<!-- 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>
\ No newline at end of file
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</ul>
- <br />
</div>
<div id="main"> <!-- MAIN Body start here -->
display:block;
float:left;
margin-right:0.2em;
- width:7em;
+ width:10em;
+ font-size:0.8em;
}
a:link, a:visited, a:active {
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 */
/* 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;
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;
<!-- 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 -->
</p>
<p>(add % at the end of your word if you want to use right-truncation : <b>theor%</b> will find theory & theories)</p>
<p>
- <input type="submit" value="Start search" class="submit">
+ <input type="submit" value="OK" class="submit">
</p>
</div>
</form>
#
###################################
+$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;
# 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;
'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',
}
}
}
+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";
}
}
}
+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";
# warn "renewal added";
# }else {
# warn "cannot renew";
-# }
+ }
}
#