Ability to move records from temp list to bookbag
[evergreen-equinox.git] / Open-ILS / src / perlmods / lib / OpenILS / WWW / EGCatLoader / Container.pm
index 38a9755..a930144 100644 (file)
@@ -57,8 +57,8 @@ sub load_mylist_add {
     return $self->mylist_action_redirect($cache_key);
 }
 
-# Removes a record ID from My List
-sub load_mylist_del {
+# Removes a record ID from My List, or moves to an actual bookbag
+sub load_mylist_move {
     my $self = shift;
     my @rec_ids = $self->cgi->param('record');
 
@@ -74,6 +74,12 @@ sub load_mylist_del {
         $cache_key, ANON_CACHE_MYLIST, \@keep
     );
 
+    if ($self->ctx->{user} and $self->cgi->param('action') =~ /^\d+$/) {
+        # in this case, action becomes list_id
+        $self->load_myopac_bookbag_update('add_rec', $self->cgi->param('action'));
+        # XXX TODO: test for failure of above
+    }
+
     return $self->mylist_action_redirect($cache_key);
 }