Bugzilla – Attachment 77979 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.86 KB, created by
Martin Renvoize (ashimema)
on 2018-08-17 14:00:40 UTC
(
hide
)
Description:
Bug 20312: Add a link to last consulted patron
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-08-17 14:00:40 UTC
Size:
5.86 KB
patch
obsolete
>From 4554f80ce0657d8dbc53768a6b15117f96ff31b0 Mon Sep 17 00:00:00 2001 >From: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com> >Date: Wed, 15 Aug 2018 11:10:07 -0400 >Subject: [PATCH] Bug 20312: Add a link to last consulted patron > >This new feature adds a link to the last patron consulted >in the staff site. It uses cookies to save this information. >When a staff site user accesses a patron record, the ID, name >and card number of the patron will be saved in the cookie. > >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) > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/css/src/staff-global.scss | 27 +++++++++++++++++++ > .../prog/en/includes/circ-menu.inc | 4 +++ > .../intranet-tmpl/prog/en/includes/header.inc | 1 + > .../prog/en/includes/last-borrower.inc | 4 +++ > .../intranet-tmpl/prog/js/staff-global.js | 27 +++++++++++++++++++ > 5 files changed, 63 insertions(+) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index b17c6e4517..acae734284 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -4069,6 +4069,33 @@ span { > } > } > >+.lastborrower { >+ background-color: #E6F0F2; >+ border: 1px solid #95C6D0; >+ box-shadow: 1px 1px 1px 0 #999; >+ color: #CC0000; >+ margin: .4em 0; >+ padding: .3em .5em .3em .5em; >+} >+ >+#lastborrower-ref { >+ border-radius: 5px 0px 0px 5px; >+ float: left; >+} >+ >+#lastborrower-remove { >+ border-radius: 0px 5px 5px 0px; >+ cursor: pointer; >+ float: right; >+} >+ >+#lastborrower-window { >+ display: inline-block; >+ position: absolute; >+ right: 5px; >+ top: 100px; >+} >+ > /* ==== MODULE LINKS - Start ==== */ > > ul { >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 2d36462d69..748603e754 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,10 @@ > [% USE Koha %] > [% IF ( patron.borrowernumber ) %] > <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 3c112ee70c..e5c4b6621c 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 0000000000..1c5c9dfce1 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc >@@ -0,0 +1,4 @@ >+<div id="lastborrower-window"> >+ <div id="lastborrower-ref" class="lastborrower"><a id="lastborrowerlink" href="" title="">Last patron</a></div> >+ <div id="lastborrower-remove" class="lastborrower"><i class="fa fa-remove"></i></div> >+</div> >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index db5539a6ec..d57e3bf1e3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -74,6 +74,33 @@ $.fn.selectTabByID = function (tabID) { > $("a[href$=\"/" + path + params + "\"]", navmenulist).addClass("current"); > } > >+ $.cookie("lastborrowernumber", $("#hiddenborrowernumber").val(), { path: "/" }); >+ $.cookie("lastborrowername", $("#hiddenborrowername").val(), { path: "/" }); >+ $.cookie("lastborrowercard", $("#hiddenborrowercard").val(), { path: "/" }); >+ var lastborrowernumber = $.cookie("lastborrowernumber"); >+ var lastborrowername = $.cookie("lastborrowername"); >+ var lastborrowercard = $.cookie("lastborrowercard"); >+ if (typeof lastborrowernumber !== "undefined"){ >+ $("#lastborrowerlink").show(); >+ $("#lastborrowerlink").prop("title", lastborrowername + " (" + lastborrowercard + ")"); >+ $("#lastborrowerlink").prop("href", "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + lastborrowernumber); >+ $("#lastborrower-window").show(); >+ } else { >+ $("#lastborrower-window").hide(); >+ } >+ if ($("a#logout").length > 0) { >+ $("a#logout").click(function() { >+ delCookie("lastborrowernumber"); >+ delCookie("lastborrowername"); >+ delCookie("lastborrowercard"); >+ }); >+ } >+ $("#lastborrower-remove").click(function() { >+ delCookie("lastborrowernumber"); >+ delCookie("lastborrowername"); >+ delCookie("lastborrowercard"); >+ $("#lastborrower-window").hide(); >+ }); > }); > > // http://jennifermadden.com/javascript/stringEnterKeyDetector.html >-- >2.18.0
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