View | Details | Raw Unified | Return to bug 20312
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (+22 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% IF ( patron.borrowernumber ) %]
2
[% IF ( patron.borrowernumber ) %]
3
<script>
4
var lastborrowernumber;
5
var lastborrowername;
6
var lastborrowercard;
7
document.addEventListener('DOMContentLoaded', function(){
8
    lastborrowernumber = $.cookie("lastborrowernumber");
9
    lastborrowername = $.cookie("lastborrowername");
10
    lastborrowercard = $.cookie("lastborrowercard");
11
    if (typeof lastborrowernumber !== "undefined"){
12
        $('#lastpatronlink').show();
13
        $('#lastpatronlink').prop('title', lastborrowername + ' (' + lastborrowercard + ')');
14
        $('#lastpatronlink').prop('href', '/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + lastborrowernumber);
15
    }
16
    $.cookie("lastborrowernumber", $("#hiddenborrowernumber").val(), { path: '/' });
17
    $.cookie("lastborrowername", $("#hiddenborrowername").val(), { path: '/' });
18
    $.cookie("lastborrowercard", $("#hiddenborrowercard").val(), { path: '/' });
19
}, false);
20
</script>
3
<div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5>
21
<div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5>
22
<input type="hidden" id="hiddenborrowernumber" value="[% patron.borrowernumber %]">
23
<input type="hidden" id="hiddenborrowername" value="[% patron.surname %] [% patron.firstname %]">
24
<input type="hidden" id="hiddenborrowercard" value="[% patron.cardnumber %]">
25
<input type="hidden" id="hiddenborrower" value="1">
4
<!--[if IE 6]>
26
<!--[if IE 6]>
5
<style type="tex/css">img { width: expression(this.width > 140 ? 140: true);
27
<style type="tex/css">img { width: expression(this.width > 140 ? 140: true);
6
}</style>
28
}</style>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (+1 lines)
Lines 144-148 Link Here
144
            [% END %]
144
            [% END %]
145
        </ul>
145
        </ul>
146
    </div>
146
    </div>
147
    [% INCLUDE 'last-borrower.inc' %]
147
    [% IF ( intranetbookbag ) %]<div id="cartDetails">Your cart is empty.</div>[% END %]
148
    [% IF ( intranetbookbag ) %]<div id="cartDetails">Your cart is empty.</div>[% END %]
148
</div>
149
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc (-1 / +58 lines)
Line 0 Link Here
0
- 
1
<div id="lastpatron-window">
2
    <div id="lastpatron-ref" class="lastpatron"><a id="lastpatronlink" href="" title="">Last patron</a></div>
3
    <div id="lastpatron-remove" class="lastpatron"><img src="/intranet-tmpl/prog/img/x.png" width="10px"></div>
4
</div>
5
<script>
6
var lastborrowernumber;
7
var lastborrowername;
8
var lastborrowercard;
9
document.addEventListener('DOMContentLoaded', function(){
10
    if ($('a#logout').length > 0){
11
        $('a#logout').click(function(){
12
            delCookie('lastborrowernumber');
13
        });
14
    }
15
    if ($("#hiddenborrower").length == 0){
16
        lastborrowernumber = $.cookie("lastborrowernumber");
17
        lastborrowername = $.cookie("lastborrowername");
18
        lastborrowercard = $.cookie("lastborrowercard");
19
20
        if (typeof lastborrowernumber !== "undefined"){
21
            $('#lastpatronlink').prop('title', lastborrowername + ' (' + lastborrowercard + ')');
22
            $('#lastpatronlink').prop('href', '/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + lastborrowernumber);
23
            $('#lastpatron-window').show();
24
        } else {
25
            $('#lastpatron-window').hide();
26
        }
27
   }
28
   $('#lastpatron-remove').click(function() {
29
    delCookie('lastborrowernumber');
30
    $('#lastpatron-window').hide();
31
   });
32
}, false);
33
</script>
34
35
<style>
36
div.lastpatron {
37
	background-color : #e6f0f2;
38
	border : 1px solid #95c6d0;
39
    box-shadow: 1px 1px 1px 0 #999;
40
	padding : .3em .5em .3em .5em;
41
	margin : .4em 0;
42
}
43
#lastpatron-ref {
44
	float: left;
45
    border-radius: 5px 0px 0px 5px;
46
}
47
#lastpatron-remove {
48
	float: right;
49
    border-radius: 0px 5px 5px 0px;
50
    cursor: pointer;
51
}
52
#lastpatron-window {
53
    position: absolute;
54
    display:inline-block;
55
    right: 5px;
56
    top: 100px;
57
}
58
</style>

Return to bug 20312