Bugzilla – Attachment 127984 Details for
Bug 29566
Convert bundle contents modal to a notice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29566: Update modal to use slip api
Bug-29566-Update-modal-to-use-slip-api.patch (text/plain), 6.85 KB, created by
Martin Renvoize (ashimema)
on 2021-11-24 16:29:56 UTC
(
hide
)
Description:
Bug 29566: Update modal to use slip api
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-24 16:29:56 UTC
Size:
6.85 KB
patch
obsolete
>From dfa9ebc80b950b45ebfab32cc0a747456c2d3aab Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 24 Nov 2021 14:16:52 +0000 >Subject: [PATCH] Bug 29566: Update modal to use slip api > >--- > .../en/includes/modals/bundle_contents.inc | 23 ++---------- > .../prog/en/modules/circ/returns.tt | 22 ++---------- > .../prog/js/bundle_contents_modal.js | 36 +++++++++++++++++++ > 3 files changed, 41 insertions(+), 40 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/bundle_contents_modal.js > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/bundle_contents.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/bundle_contents.inc >index fe0041923c..eb7c803d91 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/bundle_contents.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/bundle_contents.inc >@@ -4,28 +4,9 @@ > <div class="modal-content"> > <div class="modal-header"> > <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >- <h4 class="modal-title" id="bundleContentsLabel">Bundle contents for [% item.barcode | html %]</h4> >+ <h4 class="modal-title" id="bundleContentsLabel"></h4> > </div> >- <div class="modal-body"> >- <table style="width:100%"> >- <thead> >- <tr> >- <th>Barcode</th> >- <th>Title</th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH bundle_item IN bundle_items %] >- <tr> >- <td>[% bundle_item.barcode | html %]</td> >- <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio %]</td> >- </tr> >- [% END %] >- </tbody> >- <tfoot> >- </tfoot> >- </table> >- </div> <!-- /.modal-body --> >+ <div class="modal-body"></div> <!-- /.modal-body --> > <div class="modal-footer"> > <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> > <button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 1de781a2cd..5ba9c106bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -223,7 +223,7 @@ > <div id="bundle_missing_items" class="dialog alert"> > <h3>Bundle had missing items</h3> > <p>Bundle contents list updated</p> >- <p><a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleContentsModal"><i class="fa fa-eye" aria-hidden="true"></i> View updated contents list</a></p> >+ <p><a class="btn btn-default btn-xs bundle-contents" role="button" data-itemnumber="[% item.itemnumber | html %]" href="#bundleContentsModal"><i class="fa fa-eye bundle-contents-icon" aria-hidden="true"></i><i class="fa fa-spinner fa-pulse fa-fw bundle-contents-spinner" style="display:none"></i> View updated contents list</a></p> > </div> > [% END %] > >@@ -383,7 +383,7 @@ > <div class="dialog message"> > <h3>Bundle varified</h3> > <p>The bundle content was varified</p> >- <p><a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleContentsModal"><i class="fa fa-eye" aria-hidden="true"></i> View contents list</a></p> >+ <p><a class="btn btn-default btn-xs bundle-contents" role="button" data-itemnumber="[% item.itemnumber | html %]" href="#bundleContentsModal"><i class="fa fa-eye bundle-contents-icon" aria-hidden="true"></i><i class="fa fa-spinner fa-pulse fa-fw bundle-contents-spinner" style="display:none"></i> View contents list</a></p> > </div> > [% END %] > [% END # /BLOCK all_checkin_messages %] >@@ -1124,6 +1124,7 @@ > </script> > [% Asset.js("js/resolve_claim_modal.js") | $raw %] > [% END %] >+ [% Asset.js("js/bundle_contents_modal.js") | $raw %] > [% INCLUDE 'timepicker.inc' %] > > <script> >@@ -1315,23 +1316,6 @@ > "bInfo": false, > "order": [[ 1, 'asc' ], [ 0, 'asc' ]] > })); >- >- // print modals >- $('.modal.printable').on('shown.bs.modal', function() { >- $('.modal-dialog', this).addClass('focused'); >- $('body').addClass('modalprinter'); >- >- if ($(this).hasClass('autoprint')) { >- window.print(); >- } >- }).on('hidden.bs.modal', function() { >- $('.modal-dialog', this).removeClass('focused'); >- $('body').removeClass('modalprinter'); >- }); >- >- $('.printModal').click(function() { >- window.print(); >- }); > }); > </script> > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/bundle_contents_modal.js b/koha-tmpl/intranet-tmpl/prog/js/bundle_contents_modal.js >new file mode 100644 >index 0000000000..2d67bd7504 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/bundle_contents_modal.js >@@ -0,0 +1,36 @@ >+$('body').on('click', '.bundle-contents', function (e) { >+ let itemnumber = $(this).data('itemnumber'); >+ >+ let modal = $('#bundleContentsModal'); >+ $('.bundle-contents-icon').hide(); >+ $('.bundle-contents-spinner').show(); >+ $.ajax({ >+ url: '/api/v1/items/' + itemnumber + '/print_slips/BUNDLE', >+ success: function(data) { >+ console.log(data); >+ modal.find('.modal-title').text(data.title); >+ modal.find('.modal-body').html(data.content); >+ modal.modal('show'); >+ $('.bundle-contents-spinner').hide(); >+ $('.bundle-contents-icon').show(); >+ }, >+ contentType: "json" >+ }); >+ >+}); >+ >+$('.modal.printable').on('shown.bs.modal', function() { >+ $('.modal-dialog', this).addClass('focused'); >+ $('body').addClass('modalprinter'); >+ >+ if ($(this).hasClass('autoprint')) { >+ window.print(); >+ } >+}).on('hidden.bs.modal', function() { >+ $('.modal-dialog', this).removeClass('focused'); >+ $('body').removeClass('modalprinter'); >+}); >+ >+$('.printModal').click(function() { >+ window.print(); >+}); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29566
:
127983
|
127984
|
127985
|
135038
|
135039
|
135040
|
137511
|
137512
|
137513