Z39.50 Batch Search/Overlay TPAC my-list entry point
authorBill Erickson <berick@esilibrary.com>
Mon, 25 Feb 2013 18:17:59 +0000 (13:17 -0500)
committerDan Wells <dbw2@calvin.edu>
Fri, 7 Jun 2013 18:52:25 +0000 (14:52 -0400)
Similar to the staff client bucket UI, this adds a button which allows
staff to access the batch Z39 search-and-queue operation directly from
the TPAC my-lists UI.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/myopac/lists.tt2

index ec7bb96..ca917a9 100644 (file)
@@ -23,6 +23,10 @@ sub prepare_extended_user_info {
     my $local_xact = !$e->{xact_id}; 
     $e->xact_begin if $local_xact;
 
+    # keep the original user object so we can restore
+    # login-specific data (e.g. workstation)
+    my $usr = $self->ctx->{user};
+
     $self->ctx->{user} = $self->editor->retrieve_actor_user([
         $self->ctx->{user}->id,
         {
@@ -36,6 +40,9 @@ sub prepare_extended_user_info {
 
     $e->rollback if $local_xact;
 
+    $self->ctx->{user}->wsid($usr->wsid);
+    $self->ctx->{user}->ws_ou($usr->ws_ou);
+
     # discard replaced (negative-id) addresses.
     $self->ctx->{user}->addresses([
         grep {$_->id > 0} @{$self->ctx->{user}->addresses} ]);
index 0b2977d..ba78f76 100644 (file)
                     [% END %]
                 </div>
             </form>
+            [% IF ctx.is_staff %]
+            <div class="bookbag-controls">
+                <input 
+                    type="submit" 
+                    onclick='
+                       var path = 
+                          "oils://remote/xul/server/cat/bucketz39_dialog.xul";
+                        window.openDialog(
+                            xulG.url_prefix(path),
+                            "bucketz39_dialog",
+                            "width=800,height=500",
+                            "[% ctx.user.id %]",
+                            "[% ctx.authtoken %]",
+                            "[% ctx.user.ws_ou %]",
+                            "[% bbag.id %]",
+                            xulG
+                        )'
+                    value="[% l('Locate Z39.59 Matches') %]" 
+                />
+            </div>
+            [% END %]
             <div class="bookbag-controls">
                 [% IF bbag.pub == 't'; %]
                 <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]'><img