|
Lines 664-670
sub AddAuthority {
Link Here
|
| 664 |
} |
664 |
} |
| 665 |
|
665 |
|
| 666 |
my $auth_exists=0; |
666 |
my $auth_exists=0; |
| 667 |
my $oldRecord; |
|
|
| 668 |
if (!$authid) { |
667 |
if (!$authid) { |
| 669 |
my $sth=$dbh->prepare("select max(authid) from auth_header"); |
668 |
my $sth=$dbh->prepare("select max(authid) from auth_header"); |
| 670 |
$sth->execute; |
669 |
$sth->execute; |
|
Lines 680-686
sub AddAuthority {
Link Here
|
| 680 |
# warn "auth_exists = $auth_exists"; |
679 |
# warn "auth_exists = $auth_exists"; |
| 681 |
} |
680 |
} |
| 682 |
if ($auth_exists>0){ |
681 |
if ($auth_exists>0){ |
| 683 |
$oldRecord=GetAuthority($authid); |
|
|
| 684 |
$record->add_fields('001',$authid) unless ($record->field('001')); |
682 |
$record->add_fields('001',$authid) unless ($record->field('001')); |
| 685 |
# warn "\n\n\n enregistrement".$record->as_formatted; |
683 |
# warn "\n\n\n enregistrement".$record->as_formatted; |
| 686 |
my $sth=$dbh->prepare("update auth_header set authtypecode=?,marc=?,marcxml=? where authid=?"); |
684 |
my $sth=$dbh->prepare("update auth_header set authtypecode=?,marc=?,marcxml=? where authid=?"); |
|
Lines 693-699
sub AddAuthority {
Link Here
|
| 693 |
$sth->finish; |
691 |
$sth->finish; |
| 694 |
logaction( "AUTHORITIES", "ADD", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); |
692 |
logaction( "AUTHORITIES", "ADD", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); |
| 695 |
} |
693 |
} |
| 696 |
ModZebra($authid,'specialUpdate',"authorityserver",$oldRecord,$record); |
694 |
ModZebra( $authid, 'specialUpdate', 'authorityserver', $record ); |
| 697 |
return ($authid); |
695 |
return ($authid); |
| 698 |
} |
696 |
} |
| 699 |
|
697 |
|
| 700 |
- |
|
|