Lines 27-52
use C4::Breeding qw( Z3950Search Z3950SearchAuth );
Link Here
|
27 |
use MARC::Record; |
27 |
use MARC::Record; |
28 |
use Koha::Authorities; |
28 |
use Koha::Authorities; |
29 |
use Koha::Authority::Types; |
29 |
use Koha::Authority::Types; |
|
|
30 |
use C4::AuthoritiesMarc qw( GetAuthority ); |
30 |
|
31 |
|
31 |
my $input = CGI->new; |
32 |
my $input = CGI->new; |
32 |
my $dbh = C4::Context->dbh; |
33 |
my $dbh = C4::Context->dbh; |
33 |
my $error = $input->param('error'); |
34 |
my $error = $input->param('error'); |
34 |
my $authid = $input->param('authid') || 0; |
35 |
my $authid = $input->param('authid') || 0; |
35 |
|
36 |
|
36 |
my $authority = Koha::Authorities->find($authid); |
37 |
my $record = GetAuthority($authid); |
37 |
my $record = $authority->record; |
38 |
my $marc_flavour = C4::Context->preference('marcflavour'); |
38 |
my $authtypecode = $authority ? $authority->authtypecode : ''; |
39 |
my $authfields_mapping = { |
39 |
my $authority_type = Koha::Authority::Types->find($authtypecode); |
40 |
'authorpersonal' => $marc_flavour eq 'MARC21' ? '100' : '200', |
40 |
my $authtag = $authority_type->auth_tag_to_report; |
41 |
'authorcorp' => $marc_flavour eq 'MARC21' ? '110' : '210', |
41 |
my $authfields = $authtag ? $record->field($authtag) : ''; |
42 |
'authormeetingcon' => $marc_flavour eq 'MARC21' ? '111' : '210', |
|
|
43 |
'uniformtitle' => $marc_flavour eq 'MARC21' ? '130' : '230', |
44 |
'subject' => $marc_flavour eq 'MARC21' ? '150' : '250', |
45 |
}; |
46 |
|
42 |
my $nameany = $input->param('nameany'); |
47 |
my $nameany = $input->param('nameany'); |
43 |
my $authorany = $input->param('authorany'); |
48 |
my $authorany = $input->param('authorany'); |
44 |
my $authorcorp = $input->param('authorcorp'); |
49 |
my $authorcorp = |
45 |
my $authorpersonal = $input->param('authorpersonal'); |
50 |
$record |
46 |
my $authormeetingcon = $input->param('authormeetingcon'); |
51 |
? $record->subfield( $authfields_mapping->{'authorcorp'}, 'a' ) |
|
|
52 |
: $input->param('authorcorp'); |
53 |
my $authorpersonal = |
54 |
$record |
55 |
? $record->subfield( $authfields_mapping->{'authorpersonal'}, 'a' ) |
56 |
: $input->param('authorpersonal'); |
57 |
my $authormeetingcon = |
58 |
$record |
59 |
? $record->subfield( $authfields_mapping->{'authormeetingcon'}, 'a' ) |
60 |
: $input->param('authormeetingcon'); |
61 |
|
47 |
my $title = $input->param('title'); |
62 |
my $title = $input->param('title'); |
48 |
my $uniformtitle = $input->param('uniformtitle'); |
63 |
my $uniformtitle = |
49 |
my $subject = $input->param('subject'); |
64 |
$record |
|
|
65 |
? $record->subfield( $authfields_mapping->{'uniformtitle'}, 'a' ) |
66 |
: $input->param('uniformtitle'); |
67 |
my $subject = |
68 |
$record |
69 |
? $record->subfield( $authfields_mapping->{'subject'}, 'a' ) |
70 |
: $input->param('subject'); |
71 |
|
50 |
my $subjectsubdiv = $input->param('subjectsubdiv'); |
72 |
my $subjectsubdiv = $input->param('subjectsubdiv'); |
51 |
my $srchany = $input->param('srchany'); |
73 |
my $srchany = $input->param('srchany'); |
52 |
my $op = $input->param('op')||''; |
74 |
my $op = $input->param('op')||''; |
53 |
- |
|
|