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;
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
);
</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 %]" />
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;