# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ (\@finalresult, $nbresults)= &SearchAuthorities($tags, $and_or,
+ $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby)
-(\@finalresult, $nbresults)= &SearchAuthorities($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby)
## Adding order
#$query=' @or @attr 7=2 @attr 1=Heading 0 @or @attr 7=1 @attr 1=Heading 1'.$query if ($sortby eq "HeadingDsc");
my $orderstring= ($sortby eq "HeadingAsc"?
## Adding order
#$query=' @or @attr 7=2 @attr 1=Heading 0 @or @attr 7=1 @attr 1=Heading 1'.$query if ($sortby eq "HeadingDsc");
my $orderstring= ($sortby eq "HeadingAsc"?
-=over 4
-
-$authid= &AddAuthority($record, $authid,$authtypecode)
-returns authid of the newly created authority
+ $authid= &AddAuthority($record, $authid,$authtypecode)
+ #update date/time to 005 for marc and unimarc
+ my $time=POSIX::strftime("%Y%m%d%H%M%S",localtime);
+ my $f5=$record->field('005');
+ if (!$f5) {
+ $record->insert_fields_ordered( MARC::Field->new('005',$time.".0") );
+ }
+ else {
+ $f5->update($time.".0");
+ }
+
+ SetUTF8Flag($record);
- my $time=POSIX::strftime("%Y%m%d%H%M%S",localtime);
- if (!$record->field('005')) {
- $record->insert_fields_ordered(
- MARC::Field->new('005',$time.".0")
- );
- }
my $date=POSIX::strftime("%y%m%d",localtime);
if (!$record->field('008')) {
$record->insert_fields_ordered(
my $date=POSIX::strftime("%y%m%d",localtime);
if (!$record->field('008')) {
$record->insert_fields_ordered(
my $date=POSIX::strftime("%Y%m%d",localtime);
if ($record->field('100')){
$record->field('100')->update('a'=>$date."afrey50 ba0");
my $date=POSIX::strftime("%Y%m%d",localtime);
if ($record->field('100')){
$record->field('100')->update('a'=>$date."afrey50 ba0");
my $sth=$dbh->prepare("insert into auth_header (authid,datecreated,authtypecode,marc,marcxml) values (?,now(),?,?,?)");
$sth->execute($authid,$authtypecode,$record->as_usmarc,$record->as_xml_record($format));
$sth->finish;
my $sth=$dbh->prepare("insert into auth_header (authid,datecreated,authtypecode,marc,marcxml) values (?,now(),?,?,?)");
$sth->execute($authid,$authtypecode,$record->as_usmarc,$record->as_xml_record($format));
$sth->finish;
}
ModZebra($authid,'specialUpdate',"authorityserver",$oldRecord,$record);
return ($authid);
}
ModZebra($authid,'specialUpdate',"authorityserver",$oldRecord,$record);
return ($authid);
ModZebra($authid,"recordDelete","authorityserver",GetAuthority($authid),undef);
ModZebra($authid,"recordDelete","authorityserver",GetAuthority($authid),undef);
If the authority type specified by C<$authtypecode> exists,
returns a hashref of the type's fields. If the type
If the authority type specified by C<$authtypecode> exists,
returns a hashref of the type's fields. If the type
return $authid,Summary if duplicate is found.
Comments : an improvement would be to return All the records that match.
return $authid,Summary if duplicate is found.
Comments : an improvement would be to return All the records that match.
- my ($error, $results, $total_hits)=SimpleSearch( $query, 0, 1, [ "authorityserver" ] );
+ my ($error, $results, $total_hits) = C4::Search::SimpleSearch( $query, 0, 1, [ "authorityserver" ] );
# there is at least 1 result => return the 1st one
if (@$results>0) {
my $marcrecord = MARC::File::USMARC::decode($results->[0]);
# there is at least 1 result => return the 1st one
if (@$results>0) {
my $marcrecord = MARC::File::USMARC::decode($results->[0]);
return HTML encoded Summary
Comment : authtypecode can be infered from both record and authid.
Moreover, authid can also be inferred from $record.
Would it be interesting to delete those things.
return HTML encoded Summary
Comment : authtypecode can be infered from both record and authid.
Moreover, authid can also be inferred from $record.
Would it be interesting to delete those things.
# construct UNIMARC summary, that is quite different from MARC21 one
# accepted form
foreach my $field ($record->field('2..')) {
# construct UNIMARC summary, that is quite different from MARC21 one
# accepted form
foreach my $field ($record->field('2..')) {
foreach my $field ($record->field('4..')) {
if ($field->subfield('2')) {
my $thesaurus = "thes. : ".$thesaurus{"$field->subfield('2')"}." : ";
foreach my $field ($record->field('4..')) {
if ($field->subfield('2')) {
my $thesaurus = "thes. : ".$thesaurus{"$field->subfield('2')"}." : ";
}
}
# see :
foreach my $field ($record->field('5..')) {
if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
}
}
# see :
foreach my $field ($record->field('5..')) {
if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
- $broaderterms.= '<span class="BT"> <a href="detail.pl?authid='.$field->subfield('3').'">'.$field->subfield('a')."</a></span> -- \n";
- } elsif (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'h')){
- $narrowerterms.= '<span class="NT"><a href="detail.pl?authid='.$field->subfield('3').'">'.$field->subfield('a')."</a></span> -- \n";
+ $broaderterms.= '<span class="BT"> '.$field->as_string('abcdefgjxyz')."</span> -- \n";
+ } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
+ $narrowerterms.= '<span class="NT">'.$field->as_string('abcdefgjxyz')."</span> -- \n";
$summary.= '<p><div class="label">TG : '.$broaderterms.'</div></p>' if ($broaderterms);
$summary.= '<p><div class="label">TS : '.$narrowerterms.'</div></p>' if ($narrowerterms);
$summary.= '<p><div class="label">TA : '.$seealso.'</div></p>' if ($seealso);
$summary.= '<p><div class="label">TG : '.$broaderterms.'</div></p>' if ($broaderterms);
$summary.= '<p><div class="label">TS : '.$narrowerterms.'</div></p>' if ($narrowerterms);
$summary.= '<p><div class="label">TA : '.$seealso.'</div></p>' if ($seealso);
return text containing trees for hierarchies
for them to be stored in auth_header
Example of text:
122,1314,2452;1324,2342,3,2452
return text containing trees for hierarchies
for them to be stored in auth_header
Example of text:
122,1314,2452;1324,2342,3,2452
my %cell;
my $parents=""; my $children="";
my (@loopparents,@loopchildren);
my %cell;
my $parents=""; my $children="";
my (@loopparents,@loopchildren);
-=over 4
-
-$ref= &merge(mergefrom,$MARCfrom,$mergeto,$MARCto)
-
+ $ref= &merge(mergefrom,$MARCfrom,$mergeto,$MARCto)
Could add some feature : Migrating from a typecode to an other for instance.
Then we should add some new parameter : bibliotargettag, authtargettag
Could add some feature : Migrating from a typecode to an other for instance.
Then we should add some new parameter : bibliotargettag, authtargettag
my $tag=$field->tag();
if ($auth_number==$mergefrom) {
my $field_to=MARC::Field->new(($tag_to?$tag_to:$tag),$field->indicator(1),$field->indicator(2),"9"=>$mergeto);
my $tag=$field->tag();
if ($auth_number==$mergefrom) {
my $field_to=MARC::Field->new(($tag_to?$tag_to:$tag),$field->indicator(1),$field->indicator(2),"9"=>$mergeto);
+ $exclude='['.$exclude.']';
+# add subfields in $field not included in @record_to
+ my @restore= grep {$_->[0]!~/$exclude/} $field->subfields();
+ foreach my $subfield (@restore) {
+ $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
+ }
Get the tag and subfield used to store the heading type
for indexing purposes. The C<$auth_type> parameter is
Get the tag and subfield used to store the heading type
for indexing purposes. The C<$auth_type> parameter is