Lines 108-121
sub GetAuthMARCFromKohaField {
Link Here
|
108 |
|
108 |
|
109 |
(\@finalresult, $nbresults)= &SearchAuthorities($tags, $and_or, |
109 |
(\@finalresult, $nbresults)= &SearchAuthorities($tags, $and_or, |
110 |
$excluding, $operator, $value, $offset,$length,$authtypecode, |
110 |
$excluding, $operator, $value, $offset,$length,$authtypecode, |
111 |
$sortby[, $skipmetadata]) |
111 |
$sortby[, $skipmetadata, $est_headings]) |
112 |
|
112 |
|
113 |
returns ref to array result and count of results returned |
113 |
returns ref to array result and count of results returned |
114 |
|
114 |
|
115 |
=cut |
115 |
=cut |
116 |
|
116 |
|
117 |
sub SearchAuthorities { |
117 |
sub SearchAuthorities { |
118 |
my ($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby,$skipmetadata) = @_; |
118 |
my ($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby,$skipmetadata,$est_headings) = @_; |
119 |
# warn Dumper($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby); |
119 |
# warn Dumper($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby); |
120 |
my $dbh=C4::Context->dbh; |
120 |
my $dbh=C4::Context->dbh; |
121 |
$sortby="" unless $sortby; |
121 |
$sortby="" unless $sortby; |
Lines 139-144
sub SearchAuthorities {
Link Here
|
139 |
while ($n>1){$query= "\@or ".$query;$n--;} |
139 |
while ($n>1){$query= "\@or ".$query;$n--;} |
140 |
} |
140 |
} |
141 |
} |
141 |
} |
|
|
142 |
## optionally search for established headings |
143 |
if ($est_headings) { |
144 |
$query = "\@and " . $query; |
145 |
my $n = 0; |
146 |
my @est_values = ( 'a', 'f', '|' ); |
147 |
foreach my $v (@est_values) { |
148 |
$query .= " \@attr 1=Kind-of-record \@attr 5=100 " . $v; |
149 |
$n++; |
150 |
} |
151 |
if ( $n > 1 ) { |
152 |
while ( $n > 1 ) { $query = "\@or " . $query; $n--; } |
153 |
} |
154 |
} |
142 |
|
155 |
|
143 |
my $dosearch; |
156 |
my $dosearch; |
144 |
my $and=" \@and " ; |
157 |
my $and=" \@and " ; |