move these lingering methods from Cat.pm to Cat/BibCommon.pm and put a trailing 1...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 20 Sep 2008 06:03:57 +0000 (06:03 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 20 Sep 2008 06:03:57 +0000 (06:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10655 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Cat.pm
Open-ILS/src/perlmods/OpenILS/Application/Cat/BibCommon.pm

index 1bba432..25f7507 100644 (file)
@@ -81,18 +81,6 @@ sub _load_marc_template {
        return XML::LibXML->new->parse_string($xml)->documentElement->toString;
 }
 
-my $__bib_sources;
-sub bib_source_from_name {
-       my $name = shift;
-       $logger->debug("searching for bib source: $name");
-
-       fetch_bib_sources();
-
-       my ($s) = grep { lc($_->source) eq lc($name) } @$__bib_sources;
-
-       return $s->id if $s;
-       return undef;
-}
 
 
 __PACKAGE__->register_method(
@@ -100,13 +88,9 @@ __PACKAGE__->register_method(
        api_name => 'open-ils.cat.bib_sources.retrieve.all');
 
 sub fetch_bib_sources {
-       $__bib_sources = new_editor()->retrieve_all_config_bib_source()
-               unless $__bib_sources;
-       return $__bib_sources;
+       return OpenILS::Application::Cat::BibCommon->fetch_bib_sources();
 }
 
-
-
 __PACKAGE__->register_method(
        method  => "create_record_xml",
        api_name        => "open-ils.cat.biblio.record.xml.create.override",
index 492fb65..8f2b35d 100644 (file)
@@ -15,6 +15,25 @@ my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim';
 # Shared bib mangling code.  Do not publish methods from here.
 # ---------------------------------------------------------------------------
 
+my $__bib_sources;
+sub bib_source_from_name {
+       my $name = shift;
+       $logger->debug("searching for bib source: $name");
+
+       fetch_bib_sources();
+
+       my ($s) = grep { lc($_->source) eq lc($name) } @$__bib_sources;
+
+       return $s->id if $s;
+       return undef;
+}
+
+sub fetch_bib_sources {
+       $__bib_sources = new_editor()->retrieve_all_config_bib_source()
+               unless $__bib_sources;
+       return $__bib_sources;
+}
+
 
 sub biblio_record_replace_marc  {
        my($class, $e, $recid, $newxml, $source, $fixtcn, $override) = @_;
@@ -271,4 +290,4 @@ sub _tcn_exists {
        return 0;
 }
 
-
+1;