[open-ils-commits] [GIT] Evergreen ILS branch master updated. 7ab686868965f22323a330f119be950c0db7bd76

Evergreen Git git at git.evergreen-ils.org
Wed Nov 30 14:32:20 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  7ab686868965f22323a330f119be950c0db7bd76 (commit)
      from  c1202c1492a210ea51610a164d938faef4a4d28c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7ab686868965f22323a330f119be950c0db7bd76
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Wed Nov 16 09:48:11 2011 -0500

    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 <lebbeous at esilibrary.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

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 e97f499..48a07d8 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 76c9e5b..20d9ec1 100644
--- a/Open-ILS/src/templates/opac/myopac/lists.tt2
+++ b/Open-ILS/src/templates/opac/myopac/lists.tt2
@@ -126,15 +126,48 @@
         </div>
         [% IF CGI.param("id") == bbag.id %]
         <div class="bookbag-specific">
-            <form method="GET">
-                <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
-                [% INCLUDE "opac/parts/filtersort.tt2"
-                    value=CGI.param('sort') mode='bookbag' %]
-                <input type="hidden" name="id"
-                    value="[% CGI.param('id') | html %]" />
-                <input type="submit" value="[% l('Sort') %]" />
-            </form>
+            <div class="sort">
+                <form method="GET">
+                    <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
+                    [% INCLUDE "opac/parts/filtersort.tt2"
+                        value=CGI.param('sort') mode='bookbag' %]
+                    <input type="hidden" name="id"
+                        value="[% CGI.param('id') | html %]" />
+                    <input type="submit" value="[% l('Sort') %]" />
+                </form>
+            </div>
+            <div class="meta">
+                <form method="POST">
+                    <input type="hidden" name="id" value="[% bbag.id %]" />
+                    <input type="hidden" name="action" value="editmeta" />
+                    <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
+                    <table id="bbag-name-desc-form">
+                        <tr>
+                            <th>
+                                <label for="bbag-edit-name">[% l('Name:') %]</label>
+                            </th>
+                            <td>
+                                <input name="name" type="text"
+                                    value="[% bbag.name | html %]"
+                                    id="bbag-edit-name" />
+                            </td>
+                            <td rowspan="2" class="saver">
+                                [% l("Save changes to name or description?") %]<br />
+                                <input type="submit" value="[% l('Save') %]" />
+                            </td>
+                        </tr>
+                        <tr>
+                            <th><label for="bbag-edit-description">[% l('Description:') %]</label></th>
+                            <td>
+                                <textarea name="description"
+                                    id="bbag-edit-description">[% bbag.description | html %]</textarea>
+                            </td>
+                        </tr>
+                    </table>
+                </form>
+            </div>
         </div>
+        <br class="clear-both" />
         <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
         <input type="hidden" name="list" value="[% bbag.id %]" />
         <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css
index e81b9d6..6433166 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;

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |   28 +++++++++++
 Open-ILS/src/templates/opac/myopac/lists.tt2       |   49 ++++++++++++++++---
 Open-ILS/web/css/skin/default/opac/style.css       |    7 +++
 3 files changed, 76 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list