Tiny bookbag improvements
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 19 Oct 2011 21:53:58 +0000 (17:53 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 21 Oct 2011 21:33:31 +0000 (17:33 -0400)
Bookbag feed item sort order now defined

Bookbag list sort order on the "My Lists" page is now less agressively
propagated

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>

Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm
Open-ILS/src/templates/opac/myopac/lists.tt2

index 9a36347..f47ad27 100644 (file)
@@ -1013,10 +1013,13 @@ sub bookbag_feed {
         return 302;
     }
 
+    # last created first
+    my @sorted_bucket_items = sort { $b->create_time cmp $a->create_time } @{ $bucket->items };
+
     my $feed = create_record_feed(
         'record',
         $type,
-        [ map { $_->target_biblio_record_entry } @{ $bucket->items } ],
+        [ map { $_->target_biblio_record_entry } @sorted_bucket_items ],
         $unapi,
         $org_unit->[0]->shortname,
         undef,
index c852364..76c9e5b 100644 (file)
             <div class="bookbag-controls most">
                 [% baseurl = ctx.opac_root _ '/myopac/lists';
                 IF bbag.id != CGI.param("id");
-                    url = mkurl(baseurl, {id => bbag.id}, ['edit_notes']);
+                    url = mkurl(baseurl,{id => bbag.id},['edit_notes','sort']);
                     ltitle = l("Show items in list");
                 ELSE;
-                    url = mkurl(baseurl, {}, ['id', 'edit_notes']);
+                    url = mkurl(baseurl, {}, ['id', 'edit_notes', 'sort']);
                     ltitle = l("Hide items in list");
                 END %]
                 <h2 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a></h2>