Bugzilla – Attachment 77272 Details for
Bug 20312
Add a link towards the last consulted patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20312: Add a link to last consulted patron
Bug-20312-Add-a-link-to-last-consulted-patron.patch (text/plain), 5.40 KB, created by
Pierre-Luc Lapointe
on 2018-07-25 20:40:46 UTC
(
hide
)
Description:
Bug 20312: Add a link to last consulted patron
Filename:
MIME Type:
Creator:
Pierre-Luc Lapointe
Created:
2018-07-25 20:40:46 UTC
Size:
5.40 KB
patch
obsolete
>From bd6a1e40eb0aa22ac1e4135029f42641ec498af4 Mon Sep 17 00:00:00 2001 >From: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com> >Date: Wed, 25 Jul 2018 15:42:37 -0400 >Subject: [PATCH] Bug 20312: Add a link to last consulted patron > >This is an update to Maksim's patch. The link "Last patron" is now on the top-right corner of the screen and has the same style as attachment 75672. Moreover, the "X" button is added to remove the link if clicked on. > >To test: >1- Apply the patch >2- Go to a patron details' page >3- Verify that the link "Last patron" appears on the top-right corner of the screen >4- Go to another page >5- The link should still be here >6- Click on the link >7- Verify that you are at the patron's checkout page >8- Click on the "X" button next to the "Last patron" link >9- The link should be gone >10- Go to another page >11- The link shouldn't appear (until the next patron detail's page) >--- > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 22 ++++++++ > .../intranet-tmpl/prog/en/includes/header.inc | 1 + > .../prog/en/includes/last-borrower.inc | 58 ++++++++++++++++++++++ > 3 files changed, 81 insertions(+) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index fb56a01..a13fca3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -1,6 +1,28 @@ > [% USE Koha %] > [% IF ( patron.borrowernumber ) %] >+<script> >+var lastborrowernumber; >+var lastborrowername; >+var lastborrowercard; >+document.addEventListener('DOMContentLoaded', function(){ >+ lastborrowernumber = $.cookie("lastborrowernumber"); >+ lastborrowername = $.cookie("lastborrowername"); >+ lastborrowercard = $.cookie("lastborrowercard"); >+ if (typeof lastborrowernumber !== "undefined"){ >+ $('#lastpatronlink').show(); >+ $('#lastpatronlink').prop('title', lastborrowername + ' (' + lastborrowercard + ')'); >+ $('#lastpatronlink').prop('href', '/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + lastborrowernumber); >+ } >+ $.cookie("lastborrowernumber", $("#hiddenborrowernumber").val(), { path: '/' }); >+ $.cookie("lastborrowername", $("#hiddenborrowername").val(), { path: '/' }); >+ $.cookie("lastborrowercard", $("#hiddenborrowercard").val(), { path: '/' }); >+}, false); >+</script> > <div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5> >+<input type="hidden" id="hiddenborrowernumber" value="[% patron.borrowernumber %]"> >+<input type="hidden" id="hiddenborrowername" value="[% patron.surname %] [% patron.firstname %]"> >+<input type="hidden" id="hiddenborrowercard" value="[% patron.cardnumber %]"> >+<input type="hidden" id="hiddenborrower" value="1"> > <!--[if IE 6]> > <style type="tex/css">img { width: expression(this.width > 140 ? 140: true); > }</style> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index 3c112ee..e5c4b66 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -144,5 +144,6 @@ > [% END %] > </ul> > </div> >+ [% INCLUDE 'last-borrower.inc' %] > [% IF ( intranetbookbag ) %]<div id="cartDetails">Your cart is empty.</div>[% END %] > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc >new file mode 100644 >index 0000000..35abb38 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc >@@ -0,0 +1,58 @@ >+<div id="lastpatron-window"> >+ <div id="lastpatron-ref" class="lastpatron"><a id="lastpatronlink" href="" title="">Last patron</a></div> >+ <div id="lastpatron-remove" class="lastpatron"><img src="/intranet-tmpl/prog/img/x.png" width="10px"></div> >+</div> >+<script> >+var lastborrowernumber; >+var lastborrowername; >+var lastborrowercard; >+document.addEventListener('DOMContentLoaded', function(){ >+ if ($('a#logout').length > 0){ >+ $('a#logout').click(function(){ >+ delCookie('lastborrowernumber'); >+ }); >+ } >+ if ($("#hiddenborrower").length == 0){ >+ lastborrowernumber = $.cookie("lastborrowernumber"); >+ lastborrowername = $.cookie("lastborrowername"); >+ lastborrowercard = $.cookie("lastborrowercard"); >+ >+ if (typeof lastborrowernumber !== "undefined"){ >+ $('#lastpatronlink').prop('title', lastborrowername + ' (' + lastborrowercard + ')'); >+ $('#lastpatronlink').prop('href', '/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + lastborrowernumber); >+ $('#lastpatron-window').show(); >+ } else { >+ $('#lastpatron-window').hide(); >+ } >+ } >+ $('#lastpatron-remove').click(function() { >+ delCookie('lastborrowernumber'); >+ $('#lastpatron-window').hide(); >+ }); >+}, false); >+</script> >+ >+<style> >+div.lastpatron { >+ background-color : #e6f0f2; >+ border : 1px solid #95c6d0; >+ box-shadow: 1px 1px 1px 0 #999; >+ padding : .3em .5em .3em .5em; >+ margin : .4em 0; >+} >+#lastpatron-ref { >+ float: left; >+ border-radius: 5px 0px 0px 5px; >+} >+#lastpatron-remove { >+ float: right; >+ border-radius: 0px 5px 5px 0px; >+ cursor: pointer; >+} >+#lastpatron-window { >+ position: absolute; >+ display:inline-block; >+ right: 5px; >+ top: 100px; >+} >+</style> >\ No newline at end of file >-- >2.7.4
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 20312
:
72294
|
72638
|
75672
|
77272
|
77769
|
77796
|
77835
|
77977
|
77979
|
78002
|
78005
|
81726
|
81727
|
81728