From: Lebbeous Fogle-Weekley Date: Wed, 16 Nov 2011 14:48:11 +0000 (-0500) Subject: Tpac: ability to edit name, description of bookbags later X-Git-Tag: sprint4-merge-nov22~4777 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7ab686868965f22323a330f119be950c0db7bd76;p=working%2FEvergreen.git Tpac: ability to edit name, description of bookbags later You could already name and describe when creating them, and now you can edit that later. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Dan Scott --- 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 e97f499ac8..48a07d8046 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1334,6 +1334,16 @@ sub load_myopac_update_password { return $self->generic_redirect($url); } +sub _update_bookbag_metadata { + my ($self, $bookbag) = @_; + + $bookbag->name($self->cgi->param("name")); + $bookbag->description($self->cgi->param("description")); + + return 1 if $self->editor->update_container_biblio_record_entry_bucket($bookbag); + return 0; +} + sub load_myopac_bookbags { my $self = shift; my $e = $self->editor; @@ -1376,6 +1386,24 @@ sub load_myopac_bookbags { return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR; } + if ($self->cgi->param("action") eq "editmeta") { + if (!$self->_update_bookbag_metadata($bookbag)) { + $e->rollback; + return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR; + } else { + $e->commit; + my $url = $self->ctx->{opac_root} . '/myopac/lists?id=' . + $bookbag->id; + + # Keep it if we've got it + if ($self->cgi->param("sort")) { + $url .= ";sort=" . $self->cgi->param("sort"); + } + + return $self->generic_redirect($url); + } + } + my $query = $self->_prepare_bookbag_container_query( $bookbag->id, $sorter, $modifier ); diff --git a/Open-ILS/src/templates/opac/myopac/lists.tt2 b/Open-ILS/src/templates/opac/myopac/lists.tt2 index 76c9e5b984..20d9ec1a61 100644 --- a/Open-ILS/src/templates/opac/myopac/lists.tt2 +++ b/Open-ILS/src/templates/opac/myopac/lists.tt2 @@ -126,15 +126,48 @@ [% IF CGI.param("id") == bbag.id %]
-
- - [% INCLUDE "opac/parts/filtersort.tt2" - value=CGI.param('sort') mode='bookbag' %] - - -
+
+
+ + [% INCLUDE "opac/parts/filtersort.tt2" + value=CGI.param('sort') mode='bookbag' %] + + +
+
+
+
+ + + + + + + + + + + + + +
+ + + + + [% l("Save changes to name or description?") %]
+ +
+ +
+
+
+
diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index e81b9d6900..6433166b1b 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -1157,10 +1157,17 @@ a.opac-button { h2.bookbag-name { margin-bottom: 0em; padding-bottom: 0em; } .bookbag-share .fixed { min-width: 4em; } .bookbag-specific { margin-left: 1em; } +.bookbag-specific div.sort { float: left; width: 45%; text-align: left; } +.bookbag-specific div.meta { float: right; width: 54%; text-align: right; } +#bbag-name-desc-form tr th { vertical-align: middle; } +#bbag-name-desc-form .saver { vertical-align: middle; text-align: center; } .bookbag-description { padding-top: 0em; font-style: italic; } +#bbag-edit-description { width: 20em; } +#bbag-edit-name { width: 20em; } +textarea { font-family: sans-serif; } table.bookbag-specific { border-right: 1px solid #999; border-bottom: 1px solid #666;