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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt (-142 / +41 lines)
Lines 1-104 Link Here
1
[% BLOCK controls %]
2
    <p style="padding: 7px 0; border-top : 1px solid #E8E8E8;">
3
        <a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a> <a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a>
4
        | <b>Selected items :</b>
5
        <a href="#" id="remove_from_cart">Remove</a>
6
7
        [% IF ( loggedinusername ) %]
8
             | <a href="#" id="add_to_list">Add to a list</a>
9
        [% END %]
10
11
        [% IF ( CAN_user_reserveforothers ) %]
12
             | <a href="#" id="place_hold">Place hold</a>
13
        [% END %]
14
15
        [% IF CAN_user_tools_records_batchmod %]
16
            | <a href="#" id="batch_modify">Batch modify</a>
17
        [% END %]
18
19
        [% IF CAN_user_tools_records_batchdel %]
20
            | <a href="#" id="batch_delete">Batch delete</a>
21
        [% END %]
22
    </p>
23
[% END %]
1
[% INCLUDE 'doc-head-open.inc' %]
24
[% INCLUDE 'doc-head-open.inc' %]
2
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] Catalog &rsaquo; Your cart</title>
25
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] Catalog &rsaquo; Your cart</title>
3
    [% IF ( print_basket ) %]
26
    [% IF ( print_basket ) %]
4
27
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
29
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
7
<meta http-equiv="Content-Language" content="en-us" />
8
<style type="text/css">
30
<style type="text/css">
9
    @import url([% interface %]/[% theme %]/css/print.css);
31
    @import url([% interface %]/[% theme %]/css/print.css);
10
</style>
32
</style>
11
    [% ELSE %][% INCLUDE 'doc-head-close.inc' %]
33
    [% ELSE %][% INCLUDE 'doc-head-close.inc' %]
34
<script type="text/javascript" src="[% interface %]/[% theme %]/js/cart.js"></script>
12
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
35
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
13
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
36
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
14
[% INCLUDE 'datatables.inc' %]
37
[% INCLUDE 'datatables.inc' %]
15
<script type="text/javascript">
16
	//<![CDATA[
17
18
function placeHold () {
19
    var checkedItems = $("input:checkbox:checked");
20
    if ($(checkedItems).size() == 0) {
21
        alert(MSG_NO_RECORD_SELECTED);
22
        return false;
23
    }
24
25
    var newloc;
26
27
    if ($(checkedItems).size() > 1) {
28
        var bibs = "";
29
        $(checkedItems).each(function() {
30
            var bib = $(this).val();
31
            bibs += bib + "/";
32
        });
33
34
        newloc = "/cgi-bin/koha/reserve/request.pl?biblionumbers=" + bibs + "&multi_hold=1";
35
    } else {
36
        var bib = checkedItems[0].value;
37
        newloc = "/cgi-bin/koha/reserve/request.pl?biblionumber=" + bib;
38
    }
39
40
    window.opener.location = newloc;
41
    window.close();
42
}
43
[% IF CAN_user_tools_records_batchdel %]
44
function batchDelete(){
45
    var checkedItems = $("input:checkbox:checked");
46
    if ($(checkedItems).size() == 0) {
47
        alert(MSG_NO_RECORD_SELECTED);
48
        return false;
49
    }
50
    var newloc;
51
52
    var bibs = "";
53
    $(checkedItems).each(function() {
54
        var bib = $(this).val();
55
        bibs += bib + "/";
56
    });
57
58
    newloc = "/cgi-bin/koha/tools/batch_delete_records.pl?op=list&type=biblio&bib_list=" + bibs;
59
60
    window.opener.location = newloc;
61
    window.close();
62
}
63
[% END %]
64
	$(document).ready(function(){
65
                $("#items-popover").popover();
66
		$("#CheckAll").click(function(){
67
		var checked = [];
68
		$("#bookbag_form").checkCheckboxes("*", true).each(
69
		    function() {
70
				selRecord(this.value,true);
71
			}
72
		);
73
	        return false;
74
	    });
75
	    $("#CheckNone").click(function(){
76
	    var checked = [];
77
		$("#bookbag_form").unCheckCheckboxes("*",true).each(
78
		    function() {
79
				selRecord(this.value,false);
80
			}
81
		);
82
	        return false;
83
	    });
84
        $(".holdsep").text("| ");
85
        $(".hold").text(_("Place hold"));
86
        $("#downloadcartc").empty();
87
88
        $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
89
            "sDom": 't',
90
            "aoColumnDefs": [
91
                { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
92
                { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
93
                { "sType": "callnumbers", "aTargets" : [ "callnumbers"] }
94
            ],
95
            "aaSorting": [[ 1, "asc" ]],
96
            "bPaginate": false
97
        }));
98
99
	});
100
	//]]>
101
	</script>
102
	[% END %]
38
	[% END %]
103
</head>
39
</head>
104
[% IF ( print_basket ) %]<body id="cart_basket" class="cart" onload="print();history.back();">[% ELSE %]<body id="cart_basket" class="cart">[% END %]
40
[% IF ( print_basket ) %]<body id="cart_basket" class="cart" onload="print();history.back();">[% ELSE %]<body id="cart_basket" class="cart">[% END %]
Lines 109-116 function batchDelete(){ Link Here
109
<h1>Your cart</h1>
45
<h1>Your cart</h1>
110
46
111
<div id="toolbar" class="btn-toolbar">
47
<div id="toolbar" class="btn-toolbar">
112
    [% IF ( verbose ) %]<a href="basket.pl" class="btn btn-small" onclick="showLess(); return false;"><i class="fa fa-folder"></i> Brief display</a>[% ELSE %]<a href="basket.pl" class="btn btn-small" onclick="showMore(); return false;"><i class="fa fa-folder-open"></i> More details</a>[% END %]
48
    [% IF ( verbose ) %]
113
    <a class="btn btn-small" href="basket.pl" onclick="sendBasket(); return false;"><i class="fa fa-envelope"></i> Send</a>
49
        <a href="basket.pl" class="btn btn-small showdetails showless"><i class="fa fa-folder"></i> Brief display</a>
50
    [% ELSE %]
51
        <a href="basket.pl" class="btn btn-small showdetails showmore"><i class="fa fa-folder-open"></i> More details</a>
52
    [% END %]
53
54
    <a class="btn btn-small" href="basket.pl" id="send_cart"><i class="fa fa-envelope"></i> Send</a>
114
    <div class="btn-group">
55
    <div class="btn-group">
115
        <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#" id="downloadcart"><i class="fa fa-download"></i> Download <span class="caret"></span> </a>
56
        <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#" id="downloadcart"><i class="fa fa-download"></i> Download <span class="caret"></span> </a>
116
        <ul class="dropdown-menu">
57
        <ul class="dropdown-menu">
Lines 122-161 function batchDelete(){ Link Here
122
        [% END %]
63
        [% END %]
123
        </ul>
64
        </ul>
124
    </div>
65
    </div>
125
    [% IF CAN_user_tools_records_batchmod %]
66
    <a class="btn btn-small" href="basket.pl" id="print_cart"><i class="fa fa-print"></i> Print</a>
126
      <div class="btn-group">
67
    <a class="btn btn-small" href="basket.pl" id="empty_cart"><i class="fa fa-trash"></i> Empty and close</a>
127
        <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#" id="actioncart"><i class="fa fa-play"></i> Actions <span class="caret"></span> </a>
128
        <ul class="dropdown-menu">
129
          [% IF CAN_user_tools_records_batchmod %]
130
            <li><a href="/cgi-bin/koha/tools/batch_record_modification.pl?op=list&amp;bib_list=[% bib_list %]&amp;type=biblio">Modify</a></li>
131
          [% END %]
132
        </ul>
133
      </div>
134
    [% END %]
135
    <a class="btn btn-small" href="basket.pl" onclick="printBasket(); return false;"><i class="fa fa-print"></i> Print</a>
136
    <a class="btn btn-small" href="basket.pl" onclick="delBasket('popup'); return false;"><i class="fa fa-trash"></i> Empty and close</a>
137
    <a class="btn btn-small close" href="basket.pl"><i class="fa fa-times-circle"></i> Hide window</a>
68
    <a class="btn btn-small close" href="basket.pl"><i class="fa fa-times-circle"></i> Hide window</a>
138
</div>
69
</div>
139
        [% END %]
70
        [% END %]
140
71
141
[% IF ( verbose ) %]
72
[% IF ( verbose ) %]
142
    [% UNLESS ( print_basket ) %]<p style="padding: 7px 0; border-top : 1px solid #E8E8E8;"><a id="CheckAll" href="#">Select all</a> <a id="CheckNone" href="#">Clear all</a> | <b>Selected items :</b>
73
    [% UNLESS ( print_basket ) %]
143
74
        [% PROCESS controls %]
144
    <a href="#" onclick="delSelRecords(); return false;">Remove</a>
75
    [% END %]
145
146
[% IF ( loggedinusername ) %]
147
     | <a href="#" onclick="addSelToShelf(); return false;">Add to a list</a>
148
[% END %]
149
150
[% IF ( CAN_user_reserveforothers ) %]
151
     | <a href="#" onclick="placeHold(); return false;">Place hold</a>
152
[% END %]
153
154
[% IF CAN_user_tools_records_batchdel %]
155
    | <a href="#" onclick="batchDelete(); return false;">Batch delete</a>
156
[% END %]
157
158
</p>[% END %]
159
            <form action="basket.pl" method="get" name="bookbag_form" id="bookbag_form">
76
            <form action="basket.pl" method="get" name="bookbag_form" id="bookbag_form">
160
    [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
77
    [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
161
    <h3>
78
    <h3>
Lines 164-170 function batchDelete(){ Link Here
164
                [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
81
                [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
165
                [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author %][% END %]
82
                [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author %][% END %]
166
        [% ELSE %]
83
        [% ELSE %]
167
                <input type="checkbox" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked)" />
84
                <input type="checkbox" class="select_record" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" />
168
                [% BIBLIO_RESULT.title |html %]
85
                [% BIBLIO_RESULT.title |html %]
169
                [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
86
                [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
170
                [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author %][% END %]
87
                [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author %][% END %]
Lines 317-344 function batchDelete(){ Link Here
317
234
318
[% ELSE %]
235
[% ELSE %]
319
[% UNLESS ( print_basket ) %]
236
[% UNLESS ( print_basket ) %]
320
<p style="border-top : 1px solid #E8E8E8;">
237
    <form action="/cgi-bin/koha/basket/basket.pl" method="get" name="bookbag_form" id="bookbag_form">
321
	<form action="/cgi-bin/koha/basket/basket.pl" method="get" name="bookbag_form" id="bookbag_form">
238
    [% PROCESS controls %]
322
    <a id="CheckAll" href="#">Select all</a>
323
    <a id="CheckNone" href="#">Clear all</a>
324
    | <b>Selected items :</b>
325
<a href="#" onclick="delSelRecords(); return false;">Remove</a>
326
327
[% IF ( loggedinusername ) %]
328
     | <a href="#" onclick="addSelToShelf(); return false;">Add to a list</a>
329
[% END %]
330
331
[% IF ( CAN_user_reserveforothers ) %]
332
     | <a href="#" onclick="placeHold(); return false;">Place hold</a>
333
[% END %]
334
335
[% IF CAN_user_tools_records_batchdel %]
336
    | <a href="#" onclick="batchDelete(); return false;">Batch delete</a>
337
[% END %]
338
339
[% END %]
239
[% END %]
340
240
341
</p>
342
    <table id="itemst">
241
    <table id="itemst">
343
	<thead><tr>
242
	<thead><tr>
344
        [% UNLESS ( print_basket ) %]<th class="NoSort">&nbsp;</th>[% END %]
243
        [% UNLESS ( print_basket ) %]<th class="NoSort">&nbsp;</th>[% END %]
Lines 350-359 function batchDelete(){ Link Here
350
        [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
249
        [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
351
                <tr>
250
                <tr>
352
            [% UNLESS ( print_basket ) %]<td>
251
            [% UNLESS ( print_basket ) %]<td>
353
                        <input type="checkbox" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked);" />
252
                        <input type="checkbox" class="select_record" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" />
354
253
355
                </td> [% END %]
254
                </td> [% END %]
356
            <td><a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">
255
            <td><a href="[% BIBLIO_RESULT.dest %]?biblionumber=[% BIBLIO_RESULT.biblionumber %]" class="open_title">
357
                        [% BIBLIO_RESULT.title |html %]
256
                        [% BIBLIO_RESULT.title |html %]
358
                    </a>
257
                    </a>
359
                        [% BIBLIO_RESULT.author %]
258
                        [% BIBLIO_RESULT.author %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/basket.js (-4 / +1 lines)
Lines 388-395 function updateBasket(updated_value,target) { Link Here
388
	var basketcount = updated_value;
388
	var basketcount = updated_value;
389
}
389
}
390
390
391
function openBiblio(dest,biblionumber) {
391
function openBiblio(openerURL) {
392
    openerURL=dest+"?biblionumber="+biblionumber;
393
    opener.document.location = openerURL;
392
    opener.document.location = openerURL;
394
    opener.focus();
393
    opener.focus();
395
}
394
}
Lines 443-447 $(document).ready(function(){ Link Here
443
	$("#cartmenulink").click(function(){ openBasket(); return false; });
442
	$("#cartmenulink").click(function(){ openBasket(); return false; });
444
	if(basketcount){ updateBasket(basketcount); }
443
	if(basketcount){ updateBasket(basketcount); }
445
});
444
});
446
447
(-)a/koha-tmpl/intranet-tmpl/prog/js/cart.js (-1 / +156 lines)
Line 0 Link Here
0
- 
1
2
function placeHold () {
3
    var checkedItems = $("input:checkbox:checked");
4
    if ($(checkedItems).size() === 0) {
5
        alert(MSG_NO_RECORD_SELECTED);
6
        return false;
7
    }
8
9
    var newloc;
10
11
    if ($(checkedItems).size() > 1) {
12
        var bibs = "";
13
        $(checkedItems).each(function() {
14
            var bib = $(this).val();
15
            bibs += bib + "/";
16
        });
17
18
        newloc = "/cgi-bin/koha/reserve/request.pl?biblionumbers=" + bibs + "&multi_hold=1";
19
    } else {
20
        var bib = checkedItems[0].value;
21
        newloc = "/cgi-bin/koha/reserve/request.pl?biblionumber=" + bib;
22
    }
23
24
    window.opener.location = newloc;
25
    window.close();
26
}
27
28
function batchDelete(){
29
    var checkedItems = $("input:checkbox:checked");
30
    if ($(checkedItems).size() === 0) {
31
        alert(MSG_NO_RECORD_SELECTED);
32
        return false;
33
    }
34
    var newloc;
35
36
    var bibs = "";
37
    checkedItems.each(function() {
38
        var bib = $(this).val();
39
        bibs += bib + "/";
40
    });
41
42
    newloc = "/cgi-bin/koha/tools/batch_delete_records.pl?op=list&type=biblio&bib_list=" + bibs;
43
44
    window.opener.location = newloc;
45
    window.close();
46
}
47
48
function batchModify(){
49
    var checkedItems = $("input:checkbox:checked");
50
    if ($(checkedItems).size() === 0) {
51
        alert(MSG_NO_RECORD_SELECTED);
52
        return false;
53
    }
54
    var newloc;
55
56
    var bibs = "";
57
    $(checkedItems).each(function() {
58
        var bib = $(this).val();
59
        bibs += bib + "/";
60
    });
61
    newloc = "/cgi-bin/koha/tools/batch_record_modification.pl?op=list&amp;bib_list=" + bibs + "&type=biblio";
62
63
    window.opener.location = newloc;
64
    window.close();
65
}
66
67
$(document).ready(function(){
68
    $("#items-popover").popover();
69
    $("#CheckAll").click(function(){
70
    var checked = [];
71
    $("#bookbag_form").checkCheckboxes("*", true).each(
72
        function() {
73
            selRecord(this.value,true);
74
        }
75
    );
76
        return false;
77
    });
78
    $("#CheckNone").click(function(){
79
    var checked = [];
80
    $("#bookbag_form").unCheckCheckboxes("*",true).each(
81
        function() {
82
            selRecord(this.value,false);
83
        }
84
    );
85
        return false;
86
    });
87
    $(".holdsep").text("| ");
88
    $(".hold").text(_("Place hold"));
89
    $("#downloadcartc").empty();
90
91
    $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
92
        "sDom": 't',
93
        "aoColumnDefs": [
94
            { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
95
            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
96
            { "sType": "callnumbers", "aTargets" : [ "callnumbers"] }
97
        ],
98
        "aaSorting": [[ 1, "asc" ]],
99
        "bPaginate": false
100
    }));
101
102
    $(".showdetails").on("click",function(e){
103
        e.preventDefault();
104
        if( $(this).hasClass("showmore") ){
105
            showMore();
106
        } else {
107
            showLess();
108
        }
109
    });
110
111
    $("#batch_modify").on("click",function(e){
112
        e.preventDefault();
113
        batchModify();
114
    });
115
    $("#batch_delete").on("click",function(e){
116
        e.preventDefault();
117
        batchDelete();
118
    });
119
120
    $("#remove_from_cart").on("click",function(e){
121
        e.preventDefault();
122
        delSelRecords();
123
    });
124
125
    $("#add_to_list").on("click",function(e){
126
        e.preventDefault();
127
        addSelToShelf();
128
    });
129
130
    $("#place_hold").on("click",function(e){
131
        e.preventDefault();
132
        placeHold();
133
    });
134
135
    $("#send_cart").on("click",function(e){
136
        e.preventDefault();
137
        sendBasket();
138
    });
139
140
    $("#print_cart").on("click",function(e){
141
        e.preventDefault();
142
        printBasket();
143
    });
144
145
    $("#empty_cart").on("click",function(e){
146
        e.preventDefault();
147
        delBasket('popup');
148
    });
149
    $(".open_title").on("click",function(e){
150
        e.preventDefault();
151
        openBiblio( this.href );
152
    });
153
    $(".select_record").on("change",function(){
154
        selRecord( this.value, this.checked );
155
    });
156
});

Return to bug 16477