summaryrefslogtreecommitdiff
authorOwen Leonard <oleonard@myacpl.org>2016-05-26 11:26:33 (GMT)
committer Kyle M Hall <kyle@bywatersolutions.com>2016-06-10 18:11:43 (GMT)
commit71aa7d9ecfa5c5fa07e02dbb479c78f304338988 (patch) (side-by-side diff)
treef6fef6649f05529e040e0ea7df1334ad3ffb28de
parentdde0e0150344cecfcad5c81df3d00f216dbecbbb (diff)
Bug 16592 - Use Bootstrap modal for MARC and Card preview on acquisitions receipt summary page
This patch replaces Greybox modals on the acquisitions receipt summary page with Bootstrap modals. To test, apply the patch and go to Acquisitions -> Invoices -> View an invoice -> Go to receipt page. - In the list of pending orders, test the "MARC" and "Card" links for various titles. Each should trigger a Bootstrap modal with the correct content. - Repeat the same tests in the list of already received orders. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt33
1 files changed, 30 insertions, 3 deletions
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
index 0500637..c66f2f2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
@@ -10,7 +10,7 @@
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
-[% INCLUDE 'greybox.inc' %]
+<style type="text/css">#dataPreview { width : 80%; margin-left : -40%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
<script type="text/javascript">
//<![CDATA[
@@ -104,6 +104,19 @@
$.cookie("filter_parcel_ean", $("#eanfilter").val());
});
+ $(".previewData").on("click", function(e){
+ e.preventDefault();
+ var ltitle = $(this).text();
+ var page = $(this).attr("href");
+ $("#dataPreviewLabel").text(ltitle);
+ $("#dataPreview .modal-body").load(page + " div");
+ $('#dataPreview').modal({show:true});
+ });
+ $("#dataPreview").on("hidden", function(){
+ $("#dataPreviewLabel").html("");
+ $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
+ });
+
});
// Case-insensitive version of jquery's contains function
@@ -275,7 +288,7 @@
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Add vendor note</a>]
[% END %]
</td>
- <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
+ <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" class="previewData">Card</a></td>
<td>[% loop_order.quantity %]</td>
<td>[% loop_order.ecost | $Price %]</td>
<td>[% loop_order.total | $Price %]</td>
@@ -411,7 +424,7 @@
(<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% order.suggestionid %]&amp;op=show">suggestion #[% order.suggestionid %]</a>)
[% END %]
</td>
- <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
+ <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% order.biblionumber %]" class="previewData">Card</a></td>
<td>[% order.quantityreceived %]</td>
<td>[% order.budget.budget_name %]</td>
<td>[% order.ecost | $Price %]</td>
@@ -446,9 +459,23 @@
</tbody>
</table>
</form>
+
[% ELSE %]There are no received orders.[% END %]
</div>
+<div id="dataPreview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
+ <div class="modal-header">
+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3 id="dataPreviewLabel">MARC preview</h3>
+ </div>
+ <div class="modal-body">
+ <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
+ </div>
+ <div class="modal-footer">
+ <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
+ </div>
+</div>
+
[% IF (invoiceclosedate) %]
<a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">View invoice</a>
[% ELSE %]