Browse Source

removing $dbh as a parameter in AuthoritiesMarc functions

And reporting all differences into the scripts taht relies on those functions.
3.0.x
hdl 17 years ago
parent
commit
1ab5cdfd44
  1. 111
      C4/AuthoritiesMarc.pm
  2. 14
      C4/Biblio.pm
  3. 2
      authorities/authorities-home.pl
  4. 16
      authorities/authorities.pl
  5. 6
      authorities/blinddetail-biblio-search.pl
  6. 8
      authorities/detail.pl
  7. 4
      misc/marc_into_authority.pl
  8. 14
      misc/merge_authority.pl
  9. 2
      opac/opac-authorities-home.pl
  10. 10
      opac/opac-authoritiesdetail.pl

111
C4/AuthoritiesMarc.pm

@ -55,7 +55,8 @@ $VERSION = 0.01;
);
sub AUTHfind_marc_from_kohafield {
my ( $dbh, $kohafield,$authtypecode ) = @_;
my ( $kohafield,$authtypecode ) = @_;
my $dbh=C4::Context->dbh;
return 0, 0 unless $kohafield;
$authtypecode="" unless $authtypecode;
my $marcfromkohafield;
@ -144,14 +145,12 @@ while (($i = ZOOM::event(\@oAuth)) != 0) {
goto NOLUCK;
}
my $nbresults;
$nbresults=$oAResult->size();
my $nremains=$nbresults;
my @result = ();
my @finalresult = ();
if ($nbresults>0){
##Find authid and linkid fields
@ -207,8 +206,6 @@ if ($nbresults>0){
$counter++;
push @finalresult, \%newline;
}## while counter
###
for (my $z=0; $z<@finalresult; $z++){
my $count=AUTHcount_usage($finalresult[$z]{authid});
@ -226,7 +223,8 @@ NOLUCK:
# Creates the SQL Request
sub create_request {
my ($dbh,$tags, $and_or, $operator, $value) = @_;
my ($tags, $and_or, $operator, $value) = @_;
my $dbh=C4::Context->dbh;
my $sql_tables; # will contain marc_subfield_table as m1,...
my $sql_where1; # will contain the "true" where
@ -234,12 +232,10 @@ sub create_request {
my $nb_active=0; # will contain the number of "active" entries. and entry is active is a value is provided.
my $nb_table=1; # will contain the number of table. ++ on each entry EXCEPT when an OR is provided.
for(my $i=0; $i<=@$value;$i++) {
if (@$value[$i]) {
$nb_active++;
if ($nb_active==1) {
$sql_tables = "auth_subfield_table as m$nb_table,";
$sql_where1 .= "( m$nb_table.subfieldvalue like '@$value[$i]' ";
if (@$tags[$i]) {
@ -247,12 +243,7 @@ sub create_request {
}
$sql_where1.=")";
} else {
$nb_table++;
$sql_tables .= "auth_subfield_table as m$nb_table,";
$sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue like '@$value[$i]' ";
if (@$tags[$i]) {
@ -260,8 +251,6 @@ sub create_request {
}
$sql_where1.=")";
$sql_where2.="m1.authid=m$nb_table.authid and ";
}
}
}
@ -302,7 +291,8 @@ return ($result);
sub AUTHfind_authtypecode {
my ($dbh,$authid) = @_;
my ($authid) = @_;
my $dbh=C4::Context->dbh;
my $sth = $dbh->prepare("select authtypecode from auth_header where authid=?");
$sth->execute($authid);
my ($authtypecode) = $sth->fetchrow;
@ -311,7 +301,8 @@ sub AUTHfind_authtypecode {
sub AUTHgettagslib {
my ($dbh,$forlibrarian,$authtypecode)= @_;
my ($forlibrarian,$authtypecode)= @_;
my $dbh=C4::Context->dbh;
$authtypecode="" unless $authtypecode;
my $sth;
my $libfield = ($forlibrarian eq 1)? 'liblibrarian' : 'libopac';
@ -323,7 +314,10 @@ sub AUTHgettagslib {
my ($total) = $sth->fetchrow;
$authtypecode="" unless ($total >0);
$sth= $dbh->prepare(
"select tagfield,liblibrarian,libopac,mandatory,repeatable from auth_tag_structure where authtypecode=? order by tagfield"
"SELECT tagfield,liblibrarian,libopac,mandatory,repeatable
FROM auth_tag_structure
WHERE authtypecode=?
ORDER BY tagfield"
);
$sth->execute($authtypecode);
@ -335,7 +329,11 @@ $sth->execute($authtypecode);
$res->{$tag}->{mandatory} = $mandatory;
$res->{$tag}->{repeatable} = $repeatable;
}
$sth= $dbh->prepare("select tagfield,tagsubfield,liblibrarian,libopac,tab, mandatory, repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl from auth_subfield_structure where authtypecode=? order by tagfield,tagsubfield"
$sth= $dbh->prepare(
"SELECT tagfield,tagsubfield,liblibrarian,libopac,tab, mandatory, repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl
FROM auth_subfield_structure
WHERE authtypecode=?
ORDER BY tagfield,tagsubfield"
);
$sth->execute($authtypecode);
@ -374,8 +372,8 @@ $sth->execute($authtypecode);
sub AUTHaddauthority {
# pass the MARC::Record to this function, and it will create the records in the authority table
my ($dbh,$record,$authid,$authtypecode) = @_;
my ($record,$authid,$authtypecode) = @_;
my $dbh=C4::Context->dbh;
#my $leadercode=AUTHfind_leader($dbh,$authtypecode);
my $leader=' a ';##Fixme correct leader as this one just adds utf8 to MARC21
#substr($leader,8,1)=$leadercode;
@ -416,7 +414,7 @@ my $leader=' a ';##Fixme correct leader as this one just ad
$sth->finish;
}
$dbh->do("unlock tables");
zebraop($dbh,$authid,'specialUpdate',"authorityserver");
zebraop($authid,'specialUpdate',"authorityserver");
# if ($record->field($linkidfield)){
# my @fields=$record->field($linkidfield);
@ -433,21 +431,23 @@ my $leader=' a ';##Fixme correct leader as this one just ad
}
sub AUTHaddlink{
my ($dbh,$linkid,$authid)=@_;
my $record=AUTHgetauthority($dbh,$linkid);
my $authtypecode=AUTHfind_authtypecode($dbh,$linkid);
my ($linkid,$authid)=@_;
my $dbh=C4::Context->dbh;
my $record=AUTHgetauthority($linkid);
my $authtypecode=AUTHfind_authtypecode($linkid);
#warn "adding l:$linkid,a:$authid,auth:$authtypecode";
$record=AUTH2marcOnefieldlink($dbh,$record,"auth_header.linkid",$authid,$authtypecode);
$record=AUTH2marcOnefieldlink($record,"auth_header.linkid",$authid,$authtypecode);
$dbh->do("lock tables auth_header WRITE");
my $sth=$dbh->prepare("update auth_header set marc=? where authid=?");
$sth->execute($record->as_usmarc,$linkid);
$sth->finish;
$dbh->do("unlock tables");
zebraop($dbh,$linkid,'specialUpdate',"authorityserver");
zebraop($linkid,'specialUpdate',"authorityserver");
}
sub AUTH2marcOnefieldlink {
my ( $dbh, $record, $kohafieldname, $newvalue,$authtypecode ) = @_;
my ( $record, $kohafieldname, $newvalue,$authtypecode ) = @_;
my $dbh=C4::Context->dbh;
my $sth = $dbh->prepare(
"select tagfield,tagsubfield from auth_subfield_structure where authtypecode=? and kohafield=?"
);
@ -460,12 +460,10 @@ my ($tagfield,$tagsubfield)=$sth->fetchrow;
sub XMLgetauthority {
# Returns MARC::XML of the authority passed in parameter.
my ( $dbh, $authid ) = @_;
my ( $authid ) = @_;
my $dbh=C4::Context->dbh;
my $sth =
$dbh->prepare("select marc from auth_header where authid=? " );
$sth->execute($authid);
my ($marc)=$sth->fetchrow;
$marc=MARC::File::USMARC::decode($marc);
@ -477,7 +475,7 @@ $marc=MARC::File::USMARC::decode($marc);
sub AUTHfind_leader{
##Hard coded for NEU auth types
my($dbh,$authtypecode)=@_;
my($authtypecode)=@_;
my $leadercode;
if ($authtypecode eq "AUTH"){
@ -494,7 +492,8 @@ return $leadercode;
sub AUTHgetauthority {
# Returns MARC::Record of the biblio passed in parameter.
my ($dbh,$authid)=@_;
my ($authid)=@_;
my $dbh=C4::Context->dbh;
my $sth=$dbh->prepare("select marc from auth_header where authid=?");
$sth->execute($authid);
my ($marc) = $sth->fetchrow;
@ -512,14 +511,15 @@ sub AUTHgetauth_type {
}
sub AUTHmodauthority {
my ($dbh,$authid,$record,$authtypecode,$merge)=@_;
my ($oldrecord)=&AUTHgetauthority($dbh,$authid);
my ($authid,$record,$authtypecode,$merge)=@_;
my $dbh=C4::Context->dbh;
my ($oldrecord)=&AUTHgetauthority($authid);
if ($oldrecord eq $record) {
return;
}
my $sth=$dbh->prepare("update auth_header set marc=? where authid=?");
#warn find if linked records exist and delete them
my($linkidfield,$linkidsubfield)=AUTHfind_marc_from_kohafield($dbh,"auth_header.linkid",$authtypecode);
my($linkidfield,$linkidsubfield)=AUTHfind_marc_from_kohafield("auth_header.linkid",$authtypecode);
if ($oldrecord->field($linkidfield)){
my @fields=$oldrecord->field($linkidfield);
@ -527,22 +527,22 @@ my @fields=$oldrecord->field($linkidfield);
my $linkid=$field->subfield($linkidsubfield) ;
if ($linkid){
##Modify the record of linked
my $linkrecord=AUTHgetauthority($dbh,$linkid);
my $linktypecode=AUTHfind_authtypecode($dbh,$linkid);
my ( $linkidfield2,$linkidsubfield2)=AUTHfind_marc_from_kohafield($dbh,"auth_header.linkid",$linktypecode);
my $linkrecord=AUTHgetauthority($linkid);
my $linktypecode=AUTHfind_authtypecode($linkid);
my ( $linkidfield2,$linkidsubfield2)=AUTHfind_marc_from_kohafield("auth_header.linkid",$linktypecode);
my @linkfields=$linkrecord->field($linkidfield2);
foreach my $linkfield (@linkfields){
if ($linkfield->subfield($linkidsubfield2) eq $authid){
$linkrecord->delete_field($linkfield);
$sth->execute($linkrecord->as_usmarc,$linkid);
zebraop($dbh,$linkid,'specialUpdate',"authorityserver");
zebraop($linkid,'specialUpdate',"authorityserver");
}
}#foreach linkfield
}
}#foreach linkid
}
#Now rewrite the $record to table with an add
$authid=AUTHaddauthority($dbh,$record,$authid,$authtypecode);
$authid=AUTHaddauthority($record,$authid,$authtypecode);
### If a library thinks that updating all biblios is a long process and wishes to leave that to a cron job to use merge_authotities.p
@ -561,23 +561,25 @@ if (C4::Context->preference('dontmerge') ){
print AUTH $authid;
close AUTH;
} else {
&merge($dbh,$authid,$record,$authid,$record);
&merge($authid,$record,$authid,$record);
}
return $authid;
}
sub AUTHdelauthority {
my ($dbh,$authid,$keep_biblio) = @_;
my ($authid,$keep_biblio) = @_;
my $dbh=C4::Context->dbh;
# if the keep_biblio is set to 1, then authority entries in biblio are preserved.
zebraop($dbh,$authid,"recordDelete","authorityserver");
zebraop($authid,"recordDelete","authorityserver");
$dbh->do("delete from auth_header where authid=$authid") ;
# FIXME : delete or not in biblio tables (depending on $keep_biblio flag)
}
sub AUTHhtml2marc {
my ($dbh,$rtags,$rsubfields,$rvalues,%indicators) = @_;
my ($rtags,$rsubfields,$rvalues,%indicators) = @_;
my $dbh=C4::Context->dbh;
my $prevtag = -1;
my $record = MARC::Record->new();
#---- TODO : the leader is missing
@ -773,18 +775,18 @@ sub BuildUnimarcHierarchies{
my @globalresult;
my $dbh=C4::Context->dbh;
my $hierarchies;
my $data = AUTHgetheader($dbh,$authid);
my $data = AUTHgetheader($authid);
if ($data->{'authtrees'} and not $force){
return $data->{'authtrees'};
} elsif ($data->{'authtrees'}){
$hierarchies=$data->{'authtrees'};
} else {
my $record = AUTHgetauthority($dbh,$authid);
my $record = AUTHgetauthority($authid);
my $found;
foreach my $field ($record->field('550')){
if ($field->subfield('5') && $field->subfield('5') eq 'g'){
my $parentrecord = AUTHgetauthority($dbh,$field->subfield('3'));
my $parentrecord = AUTHgetauthority($field->subfield('3'));
my $localresult=$hierarchies;
my $trees;
$trees = BuildUnimarcHierarchies($field->subfield('3'));
@ -859,9 +861,10 @@ sub AUTHsavetrees{
sub merge {
my ($dbh,$mergefrom,$MARCfrom,$mergeto,$MARCto) = @_;
my $authtypecodefrom = AUTHfind_authtypecode($dbh,$mergefrom);
my $authtypecodeto = AUTHfind_authtypecode($dbh,$mergeto);
my ($mergefrom,$MARCfrom,$mergeto,$MARCto) = @_;
my $dbh=C4::Context->dbh;
my $authtypecodefrom = AUTHfind_authtypecode($mergefrom);
my $authtypecodeto = AUTHfind_authtypecode($mergeto);
# return if authority does not exist
my @X = $MARCfrom->fields();
return if $#X == -1;
@ -950,6 +953,10 @@ Paul POULAIN paul.poulain@free.fr
# $Id$
# $Log$
# Revision 1.40 2007/03/28 10:39:16 hdl
# removing $dbh as a parameter in AuthoritiesMarc functions
# And reporting all differences into the scripts taht relies on those functions.
#
# Revision 1.39 2007/03/16 01:25:08 kados
# Using my precrash CVS copy I did the following:
#

14
C4/Biblio.pm

@ -121,6 +121,8 @@ push @EXPORT, qw(
&checkitems
);
use MARC::Charset;
MARC::Charset->ignore_errors(1);
=head1 NAME
C4::Biblio - acquisitions and cataloging management functions
@ -492,7 +494,7 @@ sub DelBiblio {
return $error if $error;
# Delete in Zebra
zebraop($dbh,$biblionumber,"delete_record","biblioserver");
zebraop($biblionumber,"delete_record","biblioserver");
# delete biblio from Koha tables and save in deletedbiblio
$error = &_koha_delete_biblio( $dbh, $biblionumber );
@ -1385,7 +1387,7 @@ sub MARCaddbiblio {
$biblionumber );
# warn $record->as_xml_record();
$sth->finish;
zebraop($dbh,$biblionumber,"specialUpdate","biblioserver");
zebraop($biblionumber,"specialUpdate","biblioserver");
return $biblionumber;
}
@ -3501,8 +3503,8 @@ zebraop( $dbh, $biblionumber, $op, $server );
sub zebraop {
###Accepts a $server variable thus we can use it for biblios authorities or other zebra dbs
my ( $dbh, $biblionumber, $op, $server ) = @_;
my ( $biblionumber, $op, $server ) = @_;
my $dbh=C4::Context->dbh;
#warn "SERVER:".$server;
#
# true zebraop commented until indexdata fixes zebraDB crashes (it seems they occur on multiple updates
@ -3695,6 +3697,10 @@ Joshua Ferraro jmf@liblime.com
# $Id$
# $Log$
# Revision 1.189 2007/03/28 10:39:16 hdl
# removing $dbh as a parameter in AuthoritiesMarc functions
# And reporting all differences into the scripts taht relies on those functions.
#
# Revision 1.188 2007/03/09 14:31:47 tipaul
# rel_3_0 moved to HEAD
#

2
authorities/authorities-home.pl

@ -146,7 +146,7 @@ if ($op eq "do_search") {
} elsif ($op eq "delete") {
&AUTHdelauthority($dbh,$authid, 1);
&AUTHdelauthority($authid, 1);
($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "authorities/authorities-home.tmpl",

16
authorities/authorities.pl

@ -349,7 +349,7 @@ my $linkid=$input->param('linkid');
my $authtypecode = $input->param('authtypecode');
my $dbh = C4::Context->dbh;
$authtypecode = &AUTHfind_authtypecode($dbh,$authid) if !$authtypecode;
$authtypecode = &AUTHfind_authtypecode($authid) if !$authtypecode;
my ($template, $loggedinuser, $cookie)
@ -361,17 +361,17 @@ my ($template, $loggedinuser, $cookie)
debug => 1,
});
$template->param(nonav => $nonav,index=>$myindex,authtypecode=>$authtypecode,);
$tagslib = AUTHgettagslib($dbh,1,$authtypecode);
$tagslib = AUTHgettagslib(1,$authtypecode);
my $record=-1;
my $encoding="";
$record = AUTHgetauthority($dbh,$authid) if ($authid);
$record = AUTHgetauthority($authid) if ($authid);
my ($oldauthnumtagfield,$oldauthnumtagsubfield);
my ($oldauthtypetagfield,$oldauthtypetagsubfield);
$is_a_modif=0;
if ($authid) {
$is_a_modif=1;
($oldauthnumtagfield,$oldauthnumtagsubfield) = &AUTHfind_marc_from_kohafield($dbh,"auth_header.authid",$authtypecode);
($oldauthtypetagfield,$oldauthtypetagsubfield) = &AUTHfind_marc_from_kohafield($dbh,"auth_header.authtypecode",$authtypecode);
($oldauthnumtagfield,$oldauthnumtagsubfield) = &AUTHfind_marc_from_kohafield("auth_header.authid",$authtypecode);
($oldauthtypetagfield,$oldauthtypetagsubfield) = &AUTHfind_marc_from_kohafield("auth_header.authtypecode",$authtypecode);
}
#------------------------------------------------------------------------------------------------------------------------------
@ -399,9 +399,9 @@ warn "duplicate:$duplicateauthid,$duplicateauthvalue";
if (!$duplicateauthid or $confirm_not_duplicate) {
# warn "noduplicate";
if ($is_a_modif ) {
$authid=AUTHmodauthority($dbh,$authid,$record,$authtypecode,1);
$authid=AUTHmodauthority($authid,$record,$authtypecode,1);
} else {
($authid) = AUTHaddauthority($dbh,$record,$authid,$authtypecode);
($authid) = AUTHaddauthority($record,$authid,$authtypecode);
}
# now, redirect to detail page
@ -445,7 +445,7 @@ warn "duplicate:$duplicateauthid,$duplicateauthvalue";
} elsif ($op eq "delete") {
#------------------------------------------------------------------------------------------------------------------------------
&AUTHdelauthority($dbh,$authid);
&AUTHdelauthority($authid);
if ($nonav){
print $input->redirect("auth_finder.pl");
}else{

6
authorities/blinddetail-biblio-search.pl

@ -57,13 +57,13 @@ my $dbh=C4::Context->dbh;
my $authid = $query->param('authid');
my $index = $query->param('index');
my $tagid = $query->param('tagid');
my $authtypecode = &AUTHfind_authtypecode($dbh,$authid);
my $tagslib = &AUTHgettagslib($dbh,1,$authtypecode);
my $authtypecode = &AUTHfind_authtypecode($authid);
my $tagslib = &AUTHgettagslib(1,$authtypecode);
my $auth_type = AUTHgetauth_type($authtypecode);
warn "XX = ".$auth_type->{auth_tag_to_report};
my $record =AUTHgetauthority($dbh,$authid);
my $record =AUTHgetauthority($authid);
warn "record auth :".$record->as_formatted;
# open template
my ($template, $loggedinuser, $cookie)

8
authorities/detail.pl

@ -70,8 +70,8 @@ my $authid = $query->param('authid');
my $authtypecode = &AUTHfind_authtypecode($dbh,$authid);
my $tagslib = &AUTHgettagslib($dbh,1,$authtypecode);
my $authtypecode = &AUTHfind_authtypecode($authid);
my $tagslib = &AUTHgettagslib(1,$authtypecode);
my $record;
if (C4::Context->preference("AuthDisplayHierarchy")){
@ -86,7 +86,7 @@ if (C4::Context->preference("AuthDisplayHierarchy")){
my @loophierarchy;
foreach my $element (@tree){
my %cell;
my $elementdata = AUTHgetauthority($dbh,$element);
my $elementdata = AUTHgetauthority($element);
$record= $elementdata if ($authid==$element);
push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
$cnt++;
@ -98,7 +98,7 @@ if (C4::Context->preference("AuthDisplayHierarchy")){
'loophierarchies' =>\@loophierarchies,
);
} else {
$record=AUTHgetauthority($dbh,$authid);
$record=AUTHgetauthority($authid);
}
my $count = AUTHcount_usage($authid);

4
misc/marc_into_authority.pl

@ -68,8 +68,8 @@ my $sth2 = $dbh->prepare("UPDATE auth_header set marc=? where authid=?" );
while (my ($authid,$authtypecode)=$sth->fetchrow ){
my $record = AUTHgetauthorityold($dbh,$authid);
##Add authid and authtypecode to record. Old records did not have these fields
my ($authidfield,$authidsubfield)=AUTHfind_marc_from_kohafield($dbh,"auth_header.authid",$authtypecode);
my ($authidfield,$authtypesubfield)=AUTHfind_marc_from_kohafield($dbh,"auth_header.authtypecode",$authtypecode);
my ($authidfield,$authidsubfield)=AUTHfind_marc_from_kohafield("auth_header.authid",$authtypecode);
my ($authidfield,$authtypesubfield)=AUTHfind_marc_from_kohafield("auth_header.authtypecode",$authtypecode);
##Both authid and authtypecode is expected to be in the same field. Modify if other requirements arise
$record->add_fields($authidfield,'','',$authidsubfield=>$authid,$authtypesubfield=>$authtypecode);
$sth2->execute($record->as_usmarc,$authid);

14
misc/merge_authority.pl

@ -46,11 +46,11 @@ my $dbh = C4::Context->dbh;
# my @subf = $subfields =~ /(##\d\d\d##.)/g;
$|=1; # flushes output
my $authfrom = AUTHgetauthority($dbh,$mergefrom);
my $authto = AUTHgetauthority($dbh,$mergeto);
my $authfrom = AUTHgetauthority($mergefrom);
my $authto = AUTHgetauthority($mergeto);
my $authtypecodefrom = AUTHfind_authtypecode($dbh,$mergefrom);
my $authtypecodeto = AUTHfind_authtypecode($dbh,$mergeto);
my $authtypecodefrom = AUTHfind_authtypecode($mergefrom);
my $authtypecodeto = AUTHfind_authtypecode($mergeto);
unless ($noconfirm) {
print "************\n";
@ -99,13 +99,13 @@ while (my ($bibid,$tag,$tag_indicator,$tagorder,$subfieldcode,$subfieldorder) =
# delete all subfields that are in the same tag/tagorder and that are in the authority (& that are not in tab ignore in the biblio)
# then recreate them with the new authority.
foreach my $subfield (@record_from) {
&MARCdelsubfield($dbh,$bibid,$tag,$tagorder,$subfield->[0]);
&MARCdelsubfield($bibid,$tag,$tagorder,$subfield->[0]);
}
&MARCdelsubfield($dbh,$bibid,$tag,$tagorder,'9');
foreach my $subfield (@record_to) {
&MARCaddsubfield($dbh,$bibid,$tag,$tag_indicator,$tagorder,$subfield->[0],$subfieldorder,$subfield->[1]);
&MARCaddsubfield($bibid,$tag,$tag_indicator,$tagorder,$subfield->[0],$subfieldorder,$subfield->[1]);
}
&MARCaddsubfield($dbh,$bibid,$tag,$tag_indicator,$tagorder,'9',$subfieldorder,$mergeto);
&MARCaddsubfield($bibid,$tag,$tag_indicator,$tagorder,'9',$subfieldorder,$mergeto);
my $biblio = GetMarcBiblio($bibid);
print "AFTER : ".$biblio->as_formatted."\n" if $verbose;
$nbdone++;

2
opac/opac-authorities-home.pl

@ -147,7 +147,7 @@ if ( $op eq "do_search" ) {
}
elsif ( $op eq "delete" ) {
&AUTHdelauthority( $dbh, $authid, 1 );
&AUTHdelauthority( $authid, 1 );
( $template, $loggedinuser, $cookie ) = get_template_and_user(
{

10
opac/opac-authoritiesdetail.pl

@ -19,7 +19,7 @@
=head1 NAME
etail.pl : script to show an authority in MARC format
opac-authoritiesdetail.pl : script to show an authority in MARC format
=head1 SYNOPSIS
@ -54,8 +54,8 @@ my $query = new CGI;
my $dbh = C4::Context->dbh;
my $authid = $query->param('authid');
my $authtypecode = &AUTHfind_authtypecode( $dbh, $authid );
my $tagslib = &AUTHgettagslib( $dbh, 1, $authtypecode );
my $authtypecode = &AUTHfind_authtypecode( $authid );
my $tagslib = &AUTHgettagslib( 1, $authtypecode );
# open template
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@ -88,7 +88,7 @@ if ( C4::Context->preference("AuthDisplayHierarchy") ) {
# warn "tree :$element";
my %cell;
my $elementdata = AUTHgetauthority( $dbh, $element );
my $elementdata = AUTHgetauthority( $element );
$record = $elementdata if ( $authid == $element );
push @loophierarchy,
BuildUnimarcHierarchy( $elementdata, "child" . $cnt, $authid );
@ -103,7 +103,7 @@ if ( C4::Context->preference("AuthDisplayHierarchy") ) {
}
}
else {
$record = AUTHgetauthority( $dbh, $authid );
$record = AUTHgetauthority( $authid );
}
my $count = AUTHcount_usage($authid);

Loading…
Cancel
Save