<<

NAME

C4::ClassSources - handle classification sources in Koha

SYNOPSIS

use C4::ClassSource;

DESCRIPTION

This module deals with manipulating classification sources and sorting rules.

FUNCTIONS

GetClassSources

  my $sources = GetClassSources();

  Returns reference to hash of references to
  the class sources, keyed on cn_source.

Example

my $sources = GetClassSources(); my @sources = (); foreach my $cn_source (sort keys %$sources) { my $source = $sources->{$cn_source}; push @sources, { code => $source->{'cn_source'}, description => $source->{'description'}, used => $source->{'used'}, sortrule => $source->{'class_sort_rule'} } }

AddClassSource

  AddClassSource($cn_source, $description, $used, $class_sort_rule);

  Adds a class_sources row.

GetClassSource

  my $hashref = GetClassSource($cn_source);

  Retrieves a class_sources row by cn_source.

ModClassSource

  ModClassSource($cn_source, $description, $used, $class_sort_rule);

  Updates a class_sources row.

DelClassSource

  DelClassSource($cn_source);

  Deletes class_sources row.

GetClassSortRules

  my $sort_rules = GetClassSortRules();

Returns reference to hash of references to the class sorting rules, keyed on class_sort_rule

Example

  my $sort_rules = GetClassSortRules();
  my @sort_rules = ();
  foreach my $sort_rule (sort keys %$sort_rules) {
      my $sort_rule = $sort_rules->{$sort_rule};
      push @sort_rules,
          {
          rule        => $sort_rule->{'class_sort_rule'},
          description => $sort_rule->{'description'},
          sort_routine    => $sort_rule->{'sort_routine'}
      }
   }

AddClassSortRule

  AddClassSortRule($class_sort_rule, $description, $sort_routine);

  Adds a class_sort_rules row.

GetClassSortRule

  my $hashref = GetClassSortRule($class_sort_rule);

  Retrieves a class_sort_rules row by class_sort_rule.

ModClassSortRule

  ModClassSortRule($class_sort_rule, $description, $sort_routine);

  Updates a class_sort_rules row.

DelClassSortRule

  DelClassSortRule($class_sort_rule);

  Deletes class_sort_rules row.

GetSourcesForSortRule

  my @source = GetSourcesForSortRule($class_sort_rule);

  Retrieves an array class_source.cn_rule for each source
  that uses the supplied $class_sort_rule.

GetClassSort

  my $cn_sort = GetClassSort($cn_source, $cn_class, $cn_item);

Get the sort key corresponding to the classification part and item part and the defined call number source.

AUTHOR

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

<<