From f8579d2e3b6011f735790298b3f4afca07543785 Mon Sep 17 00:00:00 2001 From: senator Date: Fri, 11 Mar 2011 18:07:54 -0500 Subject: [PATCH] Support for most of the actions on lists and bookbags Show authors too. And other little stuff. --- .../lib/OpenILS/WWW/EGCatLoader/Account.pm | 14 +- .../lib/OpenILS/WWW/EGCatLoader/Container.pm | 8 +- .../web/css/skin/default/opac/semiauto.css | 8 +- .../web/templates/default/opac/mylist.tt2 | 6 +- .../templates/default/opac/myopac/lists.tt2 | 222 ++++++++---------- .../default/opac/parts/anon_list.tt2 | 42 ++-- 6 files changed, 147 insertions(+), 153 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 7fcdfa9a3d..5195b8dfbc 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -528,7 +528,8 @@ sub load_myopac_bookbag_update { my $action = $cgi->param('action'); my $list_id = $cgi->param('list'); my $add_rec = $cgi->param('add_rec'); - my $del_item = $cgi->param('del_item'); + my @del_item = $cgi->param('del_item'); + my $shared = $cgi->param('shared'); my $name = $cgi->param('name'); my $success = 0; my $list; @@ -538,7 +539,7 @@ sub load_myopac_bookbag_update { $list->name($name); $list->owner($e->requestor->id); $list->btype('bookbag'); - $list->pub('f'); + $list->pub($shared ? 't' : 'f'); $success = $U->simplereq('open-ils.actor', 'open-ils.actor.container.create', $e->authtoken, 'biblio', $list) @@ -583,8 +584,13 @@ sub load_myopac_bookbag_update { 'open-ils.actor.container.item.create', $e->authtoken, 'biblio', $item); } elsif($action eq 'del_item') { - $success = $U->simplereq('open-ils.actor', - 'open-ils.actor.container.item.delete', $e->authtoken, 'biblio', $del_item); + foreach (@del_item) { + $success = $U->simplereq( + 'open-ils.actor', + 'open-ils.actor.container.item.delete', $e->authtoken, 'biblio', $_ + ); + last unless $success; + } } return $self->generic_redirect if $success; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Container.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Container.pm index 5a73fdb5d9..38a9755df9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Container.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Container.pm @@ -60,17 +60,19 @@ sub load_mylist_add { # Removes a record ID from My List sub load_mylist_del { my $self = shift; - my $rec_id = $self->cgi->param('record'); + my @rec_ids = $self->cgi->param('record'); my ($cache_key, $list) = $self->fetch_mylist; return $self->mylist_action_redirect unless $cache_key; - $list = [ grep { $_ ne $rec_id } @$list ]; + my @keep; + foreach my $id (@$list) { push(@keep, $id) unless grep { $id eq $_ } @rec_ids; } $cache_key = $U->simplereq( 'open-ils.actor', 'open-ils.actor.anon_cache.set_value', - $cache_key, ANON_CACHE_MYLIST, $list); + $cache_key, ANON_CACHE_MYLIST, \@keep + ); return $self->mylist_action_redirect($cache_key); } diff --git a/Open-ILS/web/css/skin/default/opac/semiauto.css b/Open-ILS/web/css/skin/default/opac/semiauto.css index 84748d0b38..602c9d2542 100644 --- a/Open-ILS/web/css/skin/default/opac/semiauto.css +++ b/Open-ILS/web/css/skin/default/opac/semiauto.css @@ -24,8 +24,8 @@ #lib_selector_span { display: none } .float-left { float: left; } -.opac-auto-039 { float: left; font-weight: bold; padding-top: 5px; } -.opac-auto-040 { float: left; padding: 5px 0px 0px 10px; } +.bookbag-name { float: left; font-weight: bold; padding-top: 5px; } +.bookbag-share { float: left; padding: 5px 0px 0px 10px; } .left-corner { float: left; width: 163px; height: 30px; background: url('/images/utils-corner-mid.png') repeat-x top; } .float-right { float: right; } .opac-auto-045 { float: right; margin-right: 17px; } @@ -55,7 +55,7 @@ .opac-auto-070 { margin-bottom: 20px; } .opac-auto-071 { margin-bottom: 5px; } .opac-auto-072 { margin-left: 20px; } -.opac-auto-073 { margin-left: 5px; margin-top: 5px; } +.bookbag-list { margin-left: 5px; margin-top: 5px; width: 91%; border: 0;} #cn_browse_where { margin-left: 6px; } .opac-auto-075 { margin-right: 20px; } .opac-auto-076 { margin-right: 3px; } @@ -152,7 +152,7 @@ .opac-auto-168 { width: 100%; border: 2px solid #E0F0E0; margin-bottom: 20px; } .opac-auto-169 { width: 100%; height: 100%; } .opac-auto-170 { width: 100%; margin-top: 20px; border-top: 1px dotted #ccc; padding-top: 8px; } -.opac-auto-171 { width: 100%; text-align: center; font-weight: 700; margin-top: 10px; } +.opac-auto-171 { font-size: 120%; text-align: center; font-style: italic; } .opac-auto-172 { width: 100%; text-align: center; padding-bottom: 5px; } .opac-auto-173 { width: 10px; } .opac-auto-174 { width: 111px; height: 25px; } diff --git a/Open-ILS/web/templates/default/opac/mylist.tt2 b/Open-ILS/web/templates/default/opac/mylist.tt2 index f115441c52..daccdb742a 100644 --- a/Open-ILS/web/templates/default/opac/mylist.tt2 +++ b/Open-ILS/web/templates/default/opac/mylist.tt2 @@ -9,7 +9,11 @@
- [% INCLUDE "default/opac/parts/anon_list.tt2" %] + [% IF ctx.mylist.size; + INCLUDE "default/opac/parts/anon_list.tt2"; + ELSE %] +
[% l("You have not created a list yet."); %]
+ [% END %]
diff --git a/Open-ILS/web/templates/default/opac/myopac/lists.tt2 b/Open-ILS/web/templates/default/opac/myopac/lists.tt2 index 3da5062f51..85cf1c0152 100644 --- a/Open-ILS/web/templates/default/opac/myopac/lists.tt2 +++ b/Open-ILS/web/templates/default/opac/myopac/lists.tt2 @@ -21,45 +21,84 @@ [% INCLUDE "default/opac/parts/anon_list.tt2" %] [% IF ctx.bookbags.size %]
+ [% FOR bbag IN ctx.bookbags %]
-
- -
- - [% l('RSS Feed') %] -
-
- [% l('Share') %] -
-
- [% l('Remove') %] +
[% bbag.name %]
+
+ [% IF bbag.pub == 't'; # XXX TODO %] + + [% END %]
+
+
+ + [% IF bbag.pub != 't' %] + + + [% ELSE %] + + + [% END %] +
+
+
+
+ + + +
+
- - - - - - -
- - Title - -
- - + + +
+ + + + + + + + + + [% UNLESS bbag.items.size %] + + [% END %] + [% FOR item IN bbag.items; + item_id = item.id; + attrs = {marc_xml => ctx.bookbags_marc_xml.$item_id}; + PROCESS get_marc_attrs args=attrs %] + + + + + + [% END %] +
+ + [% l('Title') %][% l('Author(s)') %] + + +
+ [% l("This list contains no items.") %] +
[% attrs.title %][% attrs.author %]
+

+ [% END %]
[% END %]
@@ -68,75 +107,9 @@
[% l("You have not created any bookbags") %]
- - - - - - - - - - - - - - - - - - - -
[% l("Name") %][% l("# Items") %][% l("Shared") %][% l("Share / Hide") %][% l("Delete this bookbag?") %]
- - - - [% l("Items") %] - - [% l("No") %] - [% l("Yes") %] - [% l("(View)") %] - - [% l('RSS Feed') %] - - - [% l("Hide") %] - [% l("Share this Bookbag") %] - - [% l("Delete") %] -
-
- [% l("The selected bookbag contains no items...") %] -
- - - - - - - - - - - - - - - -
[% l("Title") %][% l("Authors") %][% l("Remove this item?") %]
- - - [% l("remove") %] -
[% l("Sharing a Bookbag means that the contents of the Bookbag will be visible to others. To see the public view of a shared Bookbag, click the \"View\" link in the \"Shared\" column of the Bookbag list at the top of this page.") %] [% l("Are you sure you wish to remove this bookbag item?") %] @@ -160,31 +133,34 @@ [% l("Bookbag successfully updated") %] -
- - -
-

[% l('Create new list') %]

- [% l('Enter the name of the new list:') %]
- -
- - - - - - -
- [% l('Share this list?') %] - [% l('Sharing Help') %] - - [% l('No') %] -
- [% l('Yes') %] -
- [% l('Submit') %] -       - [% l('Cancel') %] + +
+
+

[% l('Create new list') %]

+ [% l('Enter the name of the new list:') %]
+ +
+ + + + + + +
+ [% l('Share this list?') %] + [% l('Sharing Help') %] + + +
+ +
+ +      +[% l('Cancel') %] +
[% END %] diff --git a/Open-ILS/web/templates/default/opac/parts/anon_list.tt2 b/Open-ILS/web/templates/default/opac/parts/anon_list.tt2 index 2d1d1e39c5..e1e72fe552 100644 --- a/Open-ILS/web/templates/default/opac/parts/anon_list.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/anon_list.tt2 @@ -1,4 +1,5 @@ [% IF ctx.mylist.size %] +
@@ -16,33 +17,38 @@
-
- - - - - -
- [% l('Title') %] - -
- +
+ + + + + + + + [% FOR item IN ctx.mylist; attrs = {marc_xml => ctx.mylist_marc_xml.$item}; PROCESS get_marc_attrs args=attrs %] - + + + [% END %]
+ [% l('Title') %][% l('Author(s)') %] + + +
[% attrs.title %] + + [% attrs.title %][% attrs.author %]


+ [% END %] -- 2.43.2