Set $ctx->{my_bookbag} if we own the bookbag
authorJeff Godin <jgodin@tadl.org>
Thu, 22 May 2014 17:12:32 +0000 (13:12 -0400)
committerJeff Godin <jgodin@tadl.org>
Thu, 22 May 2014 18:28:09 +0000 (14:28 -0400)
Set $ctx->{my_bookbag} if we are viewing a bookbag and we are the
owner of the bookbag.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm

index 9c5c699..c2bc245 100644 (file)
@@ -454,6 +454,11 @@ sub load_rresults {
 
     $self->load_rresults_bookbag_item_notes($rec_ids) if $ctx->{bookbag};
 
+    # Set a clue if we are searching for a bookbag that is owned by the current user
+    if ($ctx->{bookbag} && $ctx->{user}) {
+        $ctx->{my_bookbag} = 1 if ($ctx->{bookbag}->owner eq $ctx->{user}->id);
+    }
+
     $self->timelog("Calling get_records_and_facets()");
     my ($facets, @data) = $self->get_records_and_facets(
         $rec_ids, $results->{facet_key},