From ebdb492b1132f0007139f78249039e82f67537ce Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Mon, 14 Mar 2016 16:03:57 -0400
Subject: [PATCH] Lightbox: Bulk Actions in MyResearch.

---
 themes/bootstrap3/js/lightbox.js                              | 4 ++--
 .../bootstrap3/templates/myresearch/bulk-action-buttons.phtml | 2 +-
 themes/bootstrap3/templates/myresearch/mylist.phtml           | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js
index 5ada394b19e..664424ac8fd 100644
--- a/themes/bootstrap3/js/lightbox.js
+++ b/themes/bootstrap3/js/lightbox.js
@@ -98,8 +98,8 @@ VuFind.lightbox = (function() {
         if ( // Close the lightbox after deliberate login
           obj.method                           // is a form
           && !html.match(/alert alert-danger/) // skip failed logins
-          && (obj.url.match(/MyResearch/)      // that matches login/create account
-          || obj.url.match(/catalogLogin/))    // catalog login for holds
+          && ((obj.url.match(/MyResearch/) && !obj.url.match(/Bulk/)) // that matches login/create account
+            || obj.url.match(/catalogLogin/))     // catalog login for holds
         ) {
           if (_originalUrl.match(/UserLogin/) || obj.url.match(/catalogLogin/)) {
             var event = new CustomEvent('VuFind.lightbox.login', {
diff --git a/themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml b/themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml
index ae475661b8e..5adb7b86aae 100644
--- a/themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml
+++ b/themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml
@@ -17,7 +17,7 @@
   <? $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?>
     <input class="btn btn-default" type="submit" name="export" value="<?=$this->transEsc('Export')?>" title="<?=$this->transEsc('export_selected')?>"/>
   <? endif; ?>
-  <input class="btn btn-default" type="submit" name="print" value="<?=$this->transEsc('Print')?>" title="<?=$this->transEsc('print_selected')?>"/>
+  <input class="btn btn-default" type="submit" name="print" value="<?=$this->transEsc('Print')?>" title="<?=$this->transEsc('print_selected')?>" data-lightbox-ignore/>
   <? if ($this->cart()->isActive()): ?>
     <input class="btn btn-default" id="<?=$this->idPrefix?>updateCart" type="submit" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/>
   <? endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/mylist.phtml b/themes/bootstrap3/templates/myresearch/mylist.phtml
index 42bee9020da..656626d0bd5 100644
--- a/themes/bootstrap3/templates/myresearch/mylist.phtml
+++ b/themes/bootstrap3/templates/myresearch/mylist.phtml
@@ -55,7 +55,7 @@
           <?=$this->render('search/controls/sort.phtml')?>
         </div>
       </div>
-      <form class="form-inline" method="post" name="bulkActionForm" action="<?=$this->url('cart-myresearchbulk')?>">
+      <form class="form-inline" method="post" name="bulkActionForm" action="<?=$this->url('cart-myresearchbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler">
         <?=$this->context($this)->renderInContext('myresearch/bulk-action-buttons.phtml', array('idPrefix' => '', 'list' => isset($list) ? $list : null, 'account' => $this->account))?>
         <? foreach ($this->results->getResults() as $i=>$current): ?>
           <?=$this->record($current)->getListEntry($list, $user)?>
-- 
GitLab