<<

NAME

C4::AuthoritiesMarc

GetAuthMARCFromKohaField

  ( $tag, $subfield ) = &GetAuthMARCFromKohaField ($kohafield,$authtypecode);

returns tag and subfield linked to kohafield

Comment : Suppose Kohafield is only linked to ONE subfield

SearchAuthorities

  (\@finalresult, $nbresults)= &SearchAuthorities($tags, $and_or, 
     $excluding, $operator, $value, $offset,$length,$authtypecode,
     $sortby[, $skipmetadata])

returns ref to array result and count of results returned

GuessAuthTypeCode

  my $authtypecode = GuessAuthTypeCode($record);

Get the record and tries to guess the adequate authtypecode from its content.

GuessAuthId

  my $authtid = GuessAuthId($record);

Get the record and tries to guess the adequate authtypecode from its content.

GetTagsLabels

  $tagslabel= &GetTagsLabels($forlibrarian,$authtypecode)

returns a ref to hashref of authorities tag and subfield structure.

tagslabel usage :

  $tagslabel->{$tag}->{$subfield}->{'attribute'}

where attribute takes values in :

  lib
  tab
  mandatory
  repeatable
  authorised_value
  authtypecode
  value_builder
  kohafield
  seealso
  hidden
  isurl
  link

AddAuthority

  $authid= &AddAuthority($record, $authid,$authtypecode)

Either Create Or Modify existing authority. returns authid of the newly created authority

DelAuthority

    DelAuthority({ authid => $authid, [ skip_merge => 1 ] });

Deletes $authid and calls merge to cleanup linked biblio records. Parameter skip_merge is used in authorities/merge.pl. You should normally not use it.

ModAuthority

  $authid= &ModAuthority($authid,$record,$authtypecode)

Modifies authority record, optionally updates attached biblios.

GetAuthorityXML

  $marcxml= &GetAuthorityXML( $authid)

returns xml form of record $authid

GetAuthority

  $record= &GetAuthority( $authid)

Returns MARC::Record of the authority passed in parameter.

FindDuplicateAuthority

  $record= &FindDuplicateAuthority( $record, $authtypecode)

return $authid,Summary if duplicate is found.

Comments : an improvement would be to return All the records that match.

BuildSummary

  $summary= &BuildSummary( $record, $authid, $authtypecode)

Returns a hashref with a summary of the specified record.

Comment : authtypecode can be inferred from both record and authid. Moreover, authid can also be inferred from $record. Would it be interesting to delete those things.

GetAuthorizedHeading

  $heading = &GetAuthorizedHeading({ record => $record, authid => $authid })

Takes a MARC::Record object describing an authority record or an authid, and returns a string representation of the first authorized heading. This routine should be considered a temporary shim to ease the future migration of authority data from C4::AuthoritiesMarc to the object-oriented Koha::*::Authority.

BuildAuthHierarchies

  $text= &BuildAuthHierarchies( $authid, $force)

return text containing trees for hierarchies for them to be stored in auth_header

Example of text: 122,1314,2452;1324,2342,3,2452

BuildAuthHierarchy

  $ref= &BuildAuthHierarchy( $record, $class,$authid)

return a hashref in order to display hierarchy for record and final Authid $authid

"loopparents" "loopchildren" "class" "loopauthid" "current_value" "value"

BuildAuthHierarchyBranch

  $branch = &BuildAuthHierarchyBranch( $tree, $authid[, $cnt])

Return a data structure representing an authority hierarchy given a list of authorities representing a single branch in an authority hierarchy tree. $authid is the current node in the tree (which may or may not be somewhere in the middle). $cnt represents the level of the upper-most item, and is only used when BuildAuthHierarchyBranch is called recursively (i.e., don't ever pass in anything but zero to it).

GenerateHierarchy

  $hierarchy = &GenerateHierarchy($authid);

Return an arrayref holding one or more "trees" representing authority hierarchies.

GetHeaderAuthority

  $ref= &GetHeaderAuthority( $authid)

return a hashref in order auth_header table data

AddAuthorityTrees

  $ref= &AddAuthorityTrees( $authid, $trees)

return success or failure

merge

    $count = merge({
        mergefrom => $mergefrom,
        [ MARCfrom => $MARCfrom, ]
        [ mergeto => $mergeto, ]
        [ MARCto => $MARCto, ]
        [ biblionumbers => [ $a, $b, $c ], ]
        [ override_limit => 1, ]
    });

Merge biblios linked to authority $mergefrom (mandatory parameter). If $mergeto equals mergefrom, the linked biblio field is updated. If $mergeto is different, the biblio field will be linked to $mergeto. If $mergeto is missing, the biblio field is deleted.

MARCfrom is used to determine if a cleared subfield in the authority record should be removed from a biblio. MARCto is used to populate the biblio record with the updated values; if you do not pass it, the biblio field will be deleted (same as missing mergeto).

Normally all biblio records linked to $mergefrom, will be considered. But you can pass specific numbers via the biblionumbers parameter.

The parameter override_limit is used by the cron job to force larger postponed merges.

Note: Although $mergefrom and $mergeto will normally be of the same authority type, merge also supports moving to another authority type.

get_auth_type_location

  my ($tag, $subfield) = get_auth_type_location($auth_type_code);

Get the tag and subfield used to store the heading type for indexing purposes. The $auth_type parameter is optional; if it is not supplied, assume ''.

This routine searches the MARC authority framework for the tag and subfield whose kohafield is auth_header.authtypecode; if no such field is defined in the framework, default to the hardcoded value specific to the MARC format.

AUTHOR

Koha Development Team <http://koha-community.org/>

Paul POULAIN paul.poulain@free.fr

<<