added additional copy flesher which grabs more info for opac
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 31 Jul 2006 21:59:46 +0000 (21:59 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 31 Jul 2006 21:59:46 +0000 (21:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5202 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Open-ILS/web/opac/common/js/config.js

index c3c2e57..fafb114 100644 (file)
@@ -253,6 +253,45 @@ sub fleshed_copy_retrieve {
        return $c;
 }
 
+__PACKAGE__->register_method(
+       method  => "fleshed_copy_retrieve2",
+       api_name        => "open-ils.search.asset.copy.fleshed2.retrieve",);
+
+sub fleshed_copy_retrieve2 { 
+       my( $self, $client, $id ) = @_;
+       my $e = new_editor();
+       my $copy = $e->retrieve_asset_copy(
+               [
+                       $id,
+                       { 
+                               flesh                           => 2,
+                               flesh_fields    => { 
+                                       acp => [ qw/ location status stat_cat_entry_copy_maps notes age_protect / ],
+                                       ascecm => [ qw/ stat_cat stat_cat_entry / ],
+                               }
+                       }
+               ]
+       ) or return $e->event;
+
+       # For backwards compatibility
+       $copy->stat_cat_entries($copy->stat_cat_entry_copy_maps);
+
+       return $copy;
+
+#      return $copy unless $copy->stat_cat_entries;
+#
+#      for my $map (@{$copy->stat_cat_entries}) {
+#              $map->stat_cat(
+#                      $e->retrieve_asset_stat_cat($map->stat_cat));
+#              $map->stat_cat_entry(
+#                      $e->retrieve_asset_stat_cat_entry($map->stat_cat_entry));
+#      }
+#      return $copy;
+
+}
+
+
+
 
 
 __PACKAGE__->register_method(
@@ -1176,6 +1215,17 @@ sub copies_created_on {
 }
 
 
+__PACKAGE__->register_method(
+       method => 'fetch_age_protect',
+       api_name => 'open-ils.search.copy.age_protect.retrieve.all',
+);
+
+sub fetch_age_protect {
+       return new_editor()->retrieve_all_config_rule_age_hold_protect();
+}
+
+
+
 1;
 
 
index 9a1b8c6..2f16281 100644 (file)
@@ -306,6 +306,7 @@ var FLESH_CONTAINER                         = 'open-ils.actor:open-ils.actor.container.flesh';
 var FLESH_PUBLIC_CONTAINER             = 'open-ils.actor:open-ils.actor.container.public.flesh';
 var UPDATE_CONTAINER                           = 'open-ils.actor:open-ils.actor.container.update';
 var FETCH_COPY                                         = 'open-ils.search:open-ils.search.asset.copy.retrieve';
+var FETCH_FLESHED_COPY                 = 'open-ils.search:open-ils.search.asset.copy.fleshed2.retrieve';
 var CHECK_HOLD_POSSIBLE                        = 'open-ils.circ:open-ils.circ.title_hold.is_possible';
 var UPDATE_HOLD                                        = 'open-ils.circ:open-ils.circ.hold.update';
 var FETCH_COPIES_FROM_VOLUME   = 'open-ils.search:open-ils.search.copies_by_call_number.retrieve';