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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-128 / +1 lines)
Lines 1-130 Link Here
1
	<script type="text/javascript">
2
	//<![CDATA[
3
	[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
4
	/* this function open a popup to search on z3950 server.  */
5
	function PopupZ3950() {
6
		var strQuery = GetZ3950Terms();
7
		if(strQuery){
8
			window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
9
		} 
10
	}
11
    function PopupZ3950Confirmed() {
12
        if (confirm(_("Please note that this external search could replace the current record."))){
13
            PopupZ3950();
14
        }
15
    }
16
17
	/* provide Z3950 search points */
18
	function GetZ3950Terms(){
19
		var strQuery="&frameworkcode=";
20
		[% FOREACH z3950_search_param IN z3950_search_params %]
21
            strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.value |uri %]";
22
		[% END %]
23
		return strQuery;
24
	}
25
	[% END %]
26
	function addToCart() { addRecord('[% biblionumber %]'); }
27
	function addToShelf() {	window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes');
28
	}
29
    function printBiblio() {window.print(); }
30
[% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
31
    function confirm_deletion() {
32
        var count = [% count %];
33
        var holdcount = [% holdcount %];
34
        var countorders = [% countorders %];
35
        var countdeletedorders = [% countdeletedorders %];
36
        var is_confirmed;
37
	if (count > 0){
38
            is_confirmed = alert( _("%s item(s) are attached to this record. You must delete all items before deleting this record.").format(count) );
39
         }
40
        else if (countorders > 0){
41
            [% IF ( CAN_user_acquisition_order_manage ) %]
42
                is_confirmed = confirm( _("Warning: This record is used in %s order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?").format(countorders) );
43
            [% ELSE %]
44
                is_confirmed = alert( _("%s order(s) are using this record. You need order managing permissions to delete this record.").format(countorders) );
45
            [% END %]
46
        }
47
        else if (countdeletedorders > 0){
48
             [% IF ( CAN_user_acquisition_order_manage ) %]
49
                 is_confirmed = confirm( _("%s deleted order(s) are using this record. Are you sure you want to delete this record?").format(countdeletedorders) );
50
             [% ELSE %]
51
                 is_confirmed = alert( _("%s deleted order(s) are using this record. You need order managing permissions to delete this record.").format(countdeletedorders) );
52
             [% END %]
53
        }
54
        else if ( holdcount > 0 ) {
55
            is_confirmed = confirm( _("%s holds(s) for this record. Are you sure you want to delete this record?").format(holdcount) );
56
        } else {
57
            is_confirmed = confirm(_("Are you sure you want to delete this record?"));
58
        }
59
        if (is_confirmed) {
60
                window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&amp;biblionumber=[% biblionumber %]";
61
	} else {
62
            return false;
63
	}
64
    }
65
[% END %]
66
67
[% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
68
    function confirm_items_deletion() {
69
        var count = [% count %];
70
        var holdcount = [% holdcount %];
71
72
        if ( holdcount > 0 ) {
73
            alert( _("%s hold(s) on this record. You must delete all holds before deleting all items.").format(holdcount) );
74
        } else if ( count > 0 ) {
75
            if( confirm( _("Are you sure you want to delete the %s attached items?").format(count) ) ) {
76
                window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&amp;biblionumber=[% biblionumber %]";
77
            } else {
78
                return false;
79
            }
80
        } else {
81
            alertNoItems();
82
            return false;
83
        }
84
    }
85
    function alertNoItems(){
86
        alert(_("This record has no items."));
87
    }
88
[% END %]
89
	 $(document).ready(function() {
90
        $("#z3950copy").click(function(){
91
            PopupZ3950();
92
            return false;
93
        });
94
        $("#deletebiblio").click(function(){
95
            confirm_deletion();
96
            return false;
97
        });
98
        $("#deleteallitems").click(function(){
99
            confirm_items_deletion();
100
            return false;
101
        });
102
        $("#printbiblio").click(function(){
103
            printBiblio();
104
            return false;
105
        });
106
        $("#addtocart").click(function(){
107
            addToCart();
108
            $(".btn-group").removeClass("open");
109
            return false;
110
        });
111
        $("#addtoshelf").click(function(){
112
            addToShelf();
113
            $(".btn-group").removeClass("open");
114
            return false;
115
        });
116
        $("#export").remove(); // Hide embedded export form if JS menus available
117
        $("#deletebiblio").tooltip();
118
        $("#batchedit-disabled,#batchdelete-disabled,#deleteallitems-disabled")
119
            .on("click",function(e){
120
                e.preventDefault();
121
                alertNoItems();
122
            })
123
            .tooltip();
124
	 });
125
	//]]>
126
	</script>
127
128
<div id="toolbar" class="btn-toolbar">
1
<div id="toolbar" class="btn-toolbar">
129
2
130
[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items ||
3
[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items ||
Lines 195-201 CAN_user_serials_create_subscription ) %] Link Here
195
                [% IF ( count ) %]
68
                [% IF ( count ) %]
196
                    <li class="disabled"><a id="deletebiblio" data-toggle="tooltip" data-placement="left" title="[% count %] item(s) are attached to this record. You must delete all items before deleting this record." href="#">Delete record</a></li>
69
                    <li class="disabled"><a id="deletebiblio" data-toggle="tooltip" data-placement="left" title="[% count %] item(s) are attached to this record. You must delete all items before deleting this record." href="#">Delete record</a></li>
197
                [% ELSE %]
70
                [% ELSE %]
198
                    <li><a id="deletebiblio" href="#">Delete record</a></li>
71
                    <li><a id="deletebiblio" data-order-manage="[% CAN_user_acquisition_order_manage %]" href="#">Delete record</a></li>
199
                [% END %]
72
                [% END %]
200
            [% END %]
73
            [% END %]
201
74
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc (+30 lines)
Line 0 Link Here
1
<script type="text/javascript">
2
    /* Strings for translation */
3
    var MSG_REPLACE_RECORD = _("Please note that this external search could replace the current record.");
4
    var MSG_DELETE_ALL_ITEMS = _("%s item(s) are attached to this record. You must delete all items before deleting this record.");
5
    var CONFIRM_USED_IN_ORDERS = _("Warning: This record is used in %s order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?");
6
    var MSG_USED_IN_ORDERS = _("%s order(s) are using this record. You need order managing permissions to delete this record.");
7
    var CONFIRM_IN_DELETED_ORDERS = _("%s deleted order(s) are using this record. Are you sure you want to delete this record?");
8
    var MSG_IN_DELTED_ORDERS = _("%s deleted order(s) are using this record. You need order managing permissions to delete this record.");
9
    var CONFIRM_DELETION_HOLDS = _("%s holds(s) for this record. Are you sure you want to delete this record?");
10
    var CONFIRM_RECORD_DELETION = _("Are you sure you want to delete this record?");
11
    var MSG_DELETE_ALL_HOLDS = _("%s hold(s) on this record. You must delete all holds before deleting all items.");
12
    var CONFIRM_DELETE_ITEMS = _("Are you sure you want to delete the %s attached items?");
13
    var MSG_NO_ITEMS = _("This record has no items.");
14
15
    /* Some required variables from the template */
16
    var biblionumber = [% biblionumber %];
17
    var count = [% count %];
18
    var holdcount = [% holdcount %];
19
    var countorders = [% countorders %];
20
    var countdeletedorders = [% countdeletedorders %];
21
22
    /* provide Z3950 search points */
23
    function GetZ3950Terms(){
24
        var strQuery="&frameworkcode=";
25
        [% FOREACH z3950_search_param IN z3950_search_params %]
26
            strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.value |uri %]";
27
        [% END %]
28
        return strQuery;
29
    }
30
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt (-14 / +15 lines)
Lines 1-23 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Catalog &rsaquo;
3
<title>Koha &rsaquo; Catalog &rsaquo;
3
  [% IF ( unknownbiblionumber ) %]
4
  [% IF ( unknownbiblionumber ) %]
4
    Unknown record
5
    Unknown record
5
  [% ELSE %]
6
  [% ELSE %]
6
    ISBD details for [% title | html %]
7
    ISBD details
7
  [% END %]
8
  [% END %]
8
</title>
9
</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'browser-strings.inc' %]
11
<!--[if lt IE 9]>
12
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
13
<![endif]-->
14
<script type="text/javascript" src="[% interface %]/js/browser.js"></script>
15
<script type="text/javascript">
16
//<![CDATA[
17
    var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
18
    browser.show();
19
//]]>
20
</script>
21
</head>
11
</head>
22
<body id="catalog_ISBDdetail" class="catalog">
12
<body id="catalog_ISBDdetail" class="catalog">
23
13
Lines 28-34 Link Here
28
  [% IF ( unknownbiblionumber ) %]
18
  [% IF ( unknownbiblionumber ) %]
29
    Unknown record
19
    Unknown record
30
  [% ELSE %]
20
  [% ELSE %]
31
    ISBD details for <i>[% biblionumber %]</i>
21
    ISBD details
32
  [% END %]
22
  [% END %]
33
</div>
23
</div>
34
24
Lines 55-59 Link Here
55
      </div>
45
      </div>
56
    </div>
46
    </div>
57
[% END %]
47
[% END %]
58
</div>
48
49
[% MACRO jsinclude BLOCK %]
50
    [% INCLUDE 'catalog-strings.inc' %]
51
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/catalog.js"></script>
52
    [% INCLUDE 'browser-strings.inc' %]
53
    <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
54
    <script type="text/javascript">
55
        var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
56
        browser.show();
57
    </script>
58
[% END %]
59
<!-- the main div is closed in intranet-bottom.inc -->
59
[% INCLUDE 'intranet-bottom.inc' %]
60
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (-24 / +24 lines)
Lines 1-3 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Catalog &rsaquo;
3
<title>Koha &rsaquo; Catalog &rsaquo;
3
  [% IF ( unknownbiblionumber ) %]
4
  [% IF ( unknownbiblionumber ) %]
Lines 7-37 Link Here
7
  [% END %]
8
  [% END %]
8
</title>
9
</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'browser-strings.inc' %]
11
<!--[if lt IE 9]>
12
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
13
<![endif]-->
14
<script type="text/javascript" src="[% interface %]/js/browser.js"></script>
15
<script type="text/javascript">
16
//<![CDATA[
17
    var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
18
    browser.show();
19
20
	 $(document).ready(function() {
21
        $('#bibliotabs').tabs();
22
        $("#Frameworks").on("change",function(){
23
            Changefwk(this);
24
        });
25
	 });
26
27
function Changefwk(FwkList) {
28
	var fwk = FwkList.options[FwkList.selectedIndex].value;
29
	window.location = "MARCdetail.pl?biblionumber=[% biblionumber %]&frameworkcode="+fwk;
30
}
31
32
//]]>
33
</script>
34
</head>
11
</head>
12
35
<body id="catalog_MARCdetail" class="catalog">
13
<body id="catalog_MARCdetail" class="catalog">
36
14
37
[% INCLUDE 'header.inc' %]
15
[% INCLUDE 'header.inc' %]
Lines 197-200 function Changefwk(FwkList) { Link Here
197
</div>
175
</div>
198
[% END %]
176
[% END %]
199
</div>
177
</div>
178
[% MACRO jsinclude BLOCK %]
179
    [% INCLUDE 'catalog-strings.inc' %]
180
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/catalog.js"></script>
181
    [% INCLUDE 'browser-strings.inc' %]
182
    <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
183
    <script type="text/javascript">
184
        var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
185
        browser.show();
186
187
         $(document).ready(function() {
188
            $('#bibliotabs').tabs();
189
            $("#Frameworks").on("change",function(){
190
                Changefwk(this);
191
            });
192
         });
193
194
        function Changefwk(FwkList) {
195
            var fwk = FwkList.options[FwkList.selectedIndex].value;
196
            window.location = "MARCdetail.pl?biblionumber=[% biblionumber %]&frameworkcode="+fwk;
197
        }
198
    </script>
199
[% END %]
200
[% INCLUDE 'intranet-bottom.inc' %]
200
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-20 / +32 lines)
Lines 1-27 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Catalog &rsaquo; Advanced search</title>
4
<title>Koha &rsaquo; Catalog &rsaquo; Advanced search</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
6
<script type="text/JavaScript" language="JavaScript">
7
	/**
8
	 *  Function add_field();
9
	 *  This function allows to display a new field to search.
10
	 */
11
	function add_field() {
12
	    var ButtonPlus = document.getElementById("ButtonPlus");
13
		var line = ButtonPlus.parentNode;
14
		var dad  = line.parentNode;
15
		dad.appendChild(line.cloneNode(true));
16
		line.removeChild(ButtonPlus);
17
	}
18
	$(document).ready(function() {
19
		$("input[name=q]:eq(0)").focus();
20
        $('#advsearches').tabs();
21
        $('#toolbar').fixFloat();
22
	});
23
</script>
24
</head>
6
</head>
7
25
<body id="catalog_advsearch" class="catalog">
8
<body id="catalog_advsearch" class="catalog">
26
[% INCLUDE 'header.inc' %]
9
[% INCLUDE 'header.inc' %]
27
[% INCLUDE 'adv-search.inc' %]
10
[% INCLUDE 'adv-search.inc' %]
Lines 253-259 Link Here
253
</fieldset>
236
</fieldset>
254
237
255
<fieldset id="select-libs">
238
<fieldset id="select-libs">
256
        <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop" onchange='if(this.value != ""){document.getElementById("categoryloop").disabled=true;} else {document.getElementById("categoryloop").disabled=false;}'>
239
        <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
257
        <option value="">All libraries</option>
240
        <option value="">All libraries</option>
258
        [%# FIXME Should not we filter the libraries displayed? %]
241
        [%# FIXME Should not we filter the libraries displayed? %]
259
        [% PROCESS options_for_libraries libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %]
242
        [% PROCESS options_for_libraries libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %]
Lines 286-289 Link Here
286
</form>
269
</form>
287
</div>
270
</div>
288
271
272
[% MACRO jsinclude BLOCK %]
273
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
274
    <script type="text/JavaScript">
275
        /**
276
         *  Function add_field();
277
         *  This function allows to display a new field to search.
278
         */
279
        function add_field() {
280
            var ButtonPlus = document.getElementById("ButtonPlus");
281
            var line = ButtonPlus.parentNode;
282
            var dad  = line.parentNode;
283
            dad.appendChild(line.cloneNode(true));
284
            line.removeChild(ButtonPlus);
285
        }
286
        $(document).ready(function() {
287
            $("input[name=q]:eq(0)").focus();
288
            $('#advsearches').tabs();
289
            $('#toolbar').fixFloat();
290
            $("#branchloop").on("change",function(){
291
                if( this.value != ""){
292
                    document.getElementById("categoryloop").disabled=true;
293
                } else {
294
                    document.getElementById("categoryloop").disabled=false;
295
                }
296
            });
297
        });
298
    </script>
299
[% END %]
300
289
[% INCLUDE 'intranet-bottom.inc' %]
301
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-310 / +296 lines)
Lines 23-30 Link Here
23
    [% END %]
23
    [% END %]
24
[% END %]
24
[% END %]
25
25
26
[% SET footerjs = 1 %]
26
[% INCLUDE 'doc-head-open.inc' %]
27
[% INCLUDE 'doc-head-open.inc' %]
27
[% INCLUDE 'greybox.inc' %]
28
<title>Koha &rsaquo; Catalog &rsaquo;
28
<title>Koha &rsaquo; Catalog &rsaquo;
29
  [% IF ( unknownbiblionumber ) %]
29
  [% IF ( unknownbiblionumber ) %]
30
    Unknown record
30
    Unknown record
Lines 32-347 Link Here
32
    Details for [% title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]
32
    Details for [% title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]
33
  [% END %]
33
  [% END %]
34
</title>
34
</title>
35
35
[% INCLUDE 'doc-head-close.inc' %]
36
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %]
37
    <script type="text/javascript" src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
38
[% END %]
39
40
[% INCLUDE 'doc-head-close.inc' %]<script type="text/JavaScript">
41
//<![CDATA[
42
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
43
function verify_images() {
44
    $("#bookcoverimg").each(function(i){
45
        $(this).find('img').each(function(i){
46
           if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) {
47
                w = this.width;
48
                h = this.height;
49
                if ((w == 1) || (h == 1)) {
50
                    $("#amazon-bookcoverimg").remove();
51
                    $(".yui-gb").attr("class","yui-g");
52
                } else if ((this.complete != null) && (!this.complete)) {
53
                    $("#amazon-bookcoverimg").remove();
54
                    $(".yui-gb").attr("class","yui-g");
55
                }
56
            }
57
        });
58
        if( $(this).find('img').length < 1 ) $(this).remove();
59
    });
60
	$("#editions img").each(function(i){
61
           if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) {
62
            w = this.width;
63
            h = this.height;
64
            if ((w == 1) || (h == 1)) {
65
                          this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
66
            } else if ((this.complete != null) && (!this.complete)) {
67
                             this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
68
            }
69
        }
70
        });
71
}
72
73
    function removeLocalImage(imagenumber) {
74
75
        $.ajax({
76
            url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + [% biblionumber %] + "&imagenumber=" + imagenumber,
77
            success: function(data) {
78
                $(data).each( function(i) {
79
                    if ( this.deleted == 1 ) {
80
                        $('#imagenumber-' + this.imagenumber).remove();
81
                    }
82
                    if ( $('ul.thumbnails > li').length == 0 ) {
83
                        showNoImageMessage();
84
                    }
85
                });
86
            },
87
            error: function(data) {
88
                alert(_("An error occurred on deleting this image"));
89
            }
90
        });
91
92
    }
93
94
    function showNoImageMessage() {
95
96
        var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
97
        no_images_msg = '<p>' + no_images_msg + '</p>';
98
    [% IF ( CAN_user_tools_upload_local_cover_images ) %]
99
        var please_upload = _("Please select the image file to upload. %sUpload%s").format(
100
            "<a class='btn btn-default btn-xs' href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&amp;filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ",
101
            "</a>");
102
        no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
103
    [% END %]
104
105
        $('#images').html(no_images_msg);
106
    }
107
108
    [% IF StaffDetailItemSelection %]
109
110
        function itemSelectionBuildDeleteLink(div) {
111
            var itemnumbers = new Array();
112
            $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
113
                itemnumbers.push($(this).val());
114
            });
115
            if (itemnumbers.length > 0) {
116
                  var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
117
                  url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
118
                  url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
119
                  $('a.itemselection_action_delete').attr('href', url);
120
            } else {
121
                return false;
122
            }
123
            return true
124
        }
125
126
        function itemSelectionBuildModifyLink(div) {
127
            var itemnumbers = new Array();
128
            $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
129
                itemnumbers.push($(this).val());
130
            });
131
            if (itemnumbers.length > 0) {
132
                  var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
133
                  url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
134
                  url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
135
                  $('a.itemselection_action_modify').attr('href', url);
136
            } else {
137
                return false;
138
            }
139
            return true;
140
        }
141
142
        function itemSelectionBuildActionLinks(tab) {
143
            var div = $("#" + tab);
144
          var delete_link_ok = itemSelectionBuildDeleteLink(div);
145
          var modify_link_ok = itemSelectionBuildModifyLink(div);
146
          if (modify_link_ok || delete_link_ok) {
147
            $('.itemselection_actions', div).show();
148
          } else {
149
            $('.itemselection_actions', div).hide();
150
          }
151
        }
152
153
        $(document).ready(function() {
154
155
          $('table.items_table').each(function() {
156
            var div = $(this).parent().attr("id");
157
            itemSelectionBuildActionLinks(div);
158
          });
159
160
          $("input[name='itemnumber'][type='checkbox']").change(function() {
161
            var div = $(this).parents('table').parent().parent().attr("id");
162
            itemSelectionBuildActionLinks(div);
163
          });
164
165
            $(".SelectAll").on("click",function(e){
166
                e.preventDefault();
167
                var tab = $(this).data("tab");
168
                $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
169
                itemSelectionBuildActionLinks(tab);
170
            });
171
172
            $(".ClearAll").on("click",function(e){
173
                e.preventDefault();
174
                var tab = $(this).data("tab");
175
                $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
176
                itemSelectionBuildActionLinks(tab);
177
            });
178
179
        });
180
    [% END %]
181
182
    $(document).ready(function() {
183
        $('#bibliodetails').tabs();
184
        [% IF count == 0 %]
185
            $('#bibliodetails').tabs("option", "active", 3);
186
        [% END %]
187
        $('#search-form').focus();
188
        $('.thumbnails > li > a > span.remove').click(function() {
189
            var result = confirm(_("Are you sure you want to delete this cover image?"));
190
191
            if ( result == true ) {
192
                var imagenumber = $(this).parent().parent().attr('id').split('-')[1];
193
                removeLocalImage(imagenumber);
194
            }
195
196
            return false;
197
        });
198
    [%# inject no images message %]
199
    [% IF ( LocalCoverImages && ! localimages.0 ) %]
200
        showNoImageMessage();
201
    [% END %]
202
    [% IF LocalCoverImages %]
203
        KOHA.LocalCover.GetCoverFromBibnumber(true);
204
    [% END %]
205
        $("body").on("click",".previewMARC", function(e){
206
            e.preventDefault();
207
            var page = $(this).attr("href");
208
            $("#marcPreview .modal-body").load(page + " table");
209
            $('#marcPreview').modal({show:true});
210
        });
211
        $("#marcPreview").on("hidden", function(){
212
            $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
213
        });
214
     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %]
215
         novSelect.loadContentForQuery(
216
             {
217
                 ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]',
218
                 ISBN : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]',
219
                 version : '2.1'
220
             },
221
             '[% Koha.Preference('NovelistSelectProfile') %]',
222
             '[% Koha.Preference('NovelistSelectPassword') %]',
223
             function(d){
224
                 if ( d.length > 0 ){ //If no content
225
                     $(".NovelistSelect").show();
226
                 }
227
             });
228
     [% END %]
229
230
    });
231
232
     [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
233
        verify_images();
234
     });[% END %]
235
//]]>
236
</script>
237
<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" />
238
[% INCLUDE 'datatables.inc' %]
239
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
240
[% INCLUDE 'browser-strings.inc' %]
241
<!--[if lt IE 9]>
242
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
243
<![endif]-->
244
<script type="text/javascript" src="[% interface %]/js/browser.js"></script>
245
<script type="text/javascript">
246
//<![CDATA[
247
    var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
248
    browser.show();
249
250
    function activate_filters(id) {
251
        var table = $("#" + id + " table");
252
        if (table.length == 1) {
253
            filters_row = table.find('thead tr.filters_row');
254
255
                var aoColumns = [];
256
                filters_row.find('th').each(function() {
257
                    if(this.className === "NoSort"){
258
                        aoColumns.push(null);
259
                    } else {
260
                        aoColumns.push('text');
261
                    }
262
                });
263
264
            if (table.find('thead tr.columnFilter').length == 0) {
265
                table.dataTable().columnFilter({
266
                    'sPlaceHolder': 'head:after'
267
                    ,   'aoColumns': aoColumns
268
                });
269
                filters_row.addClass('columnFilter');
270
            }
271
            filters_row.show();
272
        }
273
274
        $('#' + id + '_activate_filters')
275
            .html('<i class="fa fa-filter"></i> ' + _("Deactivate filters") )
276
            .unbind('click')
277
            .click(function() {
278
                deactivate_filters(id);
279
                return false;
280
            });
281
    }
282
283
    function deactivate_filters(id) {
284
        filters_row = $("#" + id + " table").find('thead tr.filters_row');
285
286
        filters_row.find('input[type="text"]')
287
            .val('')            // Empty filter text boxes
288
            .trigger('keyup')   // Filter (display all rows)
289
            .trigger('blur');   // Reset value to the column name
290
        filters_row.hide();
291
292
        $('#' + id + '_activate_filters')
293
            .html('<i class="fa fa-filter"></i> ' + _("Activate filters") )
294
            .unbind('click')
295
            .click(function() {
296
                activate_filters(id);
297
                return false;
298
            });
299
    }
300
301
    $(document).ready(function() {
302
        var ids = ['holdings', 'otherholdings'];
303
        for (var i in ids) {
304
            var id = ids[i];
305
            var table = $('#' + id + ' table');
306
307
            // Duplicate the table header row for columnFilter
308
            thead_row = table.find('thead tr');
309
            clone = thead_row.clone().addClass('filters_row');
310
            clone.find("th.NoSort").html('');
311
            thead_row.before(clone);
312
313
            // Enable sorting
314
            table.dataTable($.extend(true, {}, dataTablesDefaults, {
315
                'sDom': 't',
316
                'bPaginate': false,
317
                'bAutoWidth': false,
318
                "aoColumnDefs": [
319
                    { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
320
                ]
321
            }));
322
323
            // Show a link to activate filtering
324
            link = $('<a>')
325
                .attr('href', '#')
326
                .attr('id', id + '_activate_filters');
327
            $("." + id + "_table_controls").prepend(link);
328
            deactivate_filters(id);
329
        }
330
        [% IF Koha.Preference('AcquisitionDetails') %]
331
            $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
332
                'sDom': 't',
333
                'bPaginate': false,
334
                'bAutoWidth': false,
335
                "aaSorting": [[ 4, "desc" ]],
336
                "aoColumnDefs": [
337
                    { "aTargets": "title-string", "sType": "title-string" }
338
                ]
339
            }));
340
341
        [% END %]
342
    });
343
//]]>
344
</script>
345
</head>
37
</head>
346
38
347
<body id="catalog_detail" class="catalog">
39
<body id="catalog_detail" class="catalog">
Lines 1154-1157 function verify_images() { Link Here
1154
[% END %]
846
[% END %]
1155
</div>
847
</div>
1156
848
849
[% MACRO jsinclude BLOCK %]
850
    [% INCLUDE 'catalog-strings.inc' %]
851
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/catalog.js"></script>
852
    [% INCLUDE 'greybox.inc' %]
853
    <script type="text/javascript">
854
        // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
855
        function verify_images() {
856
            $("#bookcoverimg").each(function(i){
857
                $(this).find('img').each(function(i){
858
                   if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) {
859
                        w = this.width;
860
                        h = this.height;
861
                        if ((w == 1) || (h == 1)) {
862
                            $("#amazon-bookcoverimg").remove();
863
                            $(".yui-gb").attr("class","yui-g");
864
                        } else if ((this.complete != null) && (!this.complete)) {
865
                            $("#amazon-bookcoverimg").remove();
866
                            $(".yui-gb").attr("class","yui-g");
867
                        }
868
                    }
869
                });
870
                if( $(this).find('img').length < 1 ) $(this).remove();
871
            });
872
            $("#editions img").each(function(i){
873
                if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) {
874
                    w = this.width;
875
                    h = this.height;
876
                    if ((w == 1) || (h == 1)) {
877
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
878
                    } else if ((this.complete != null) && (!this.complete)) {
879
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
880
                    }
881
                }
882
            });
883
        }
884
885
        function removeLocalImage(imagenumber) {
886
            $.ajax({
887
                url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + biblionumber + "&imagenumber=" + imagenumber,
888
                success: function(data) {
889
                    $(data).each( function(i) {
890
                        if ( this.deleted == 1 ) {
891
                            $('#imagenumber-' + this.imagenumber).remove();
892
                        }
893
                        if ( $('ul.thumbnails > li').length == 0 ) {
894
                            showNoImageMessage();
895
                        }
896
                    });
897
                },
898
                error: function(data) {
899
                    alert(_("An error occurred on deleting this image"));
900
                }
901
            });
902
        }
903
904
        function showNoImageMessage() {
905
            var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
906
            no_images_msg = '<p>' + no_images_msg + '</p>';
907
            [% IF ( CAN_user_tools_upload_local_cover_images ) %]
908
                var please_upload = _("Please select the image file to upload. %sUpload%s").format("<a class='btn btn-default btn-xs' href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=" + biblionumber + "&amp;filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ","</a>");
909
                no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
910
            [% END %]
911
            $('#images').html(no_images_msg);
912
        }
913
914
        [% IF StaffDetailItemSelection %]
915
            function itemSelectionBuildDeleteLink(div) {
916
                var itemnumbers = new Array();
917
                $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
918
                    itemnumbers.push($(this).val());
919
                });
920
                if (itemnumbers.length > 0) {
921
                    var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
922
                    url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
923
                    url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
924
                    $('a.itemselection_action_delete').attr('href', url);
925
                } else {
926
                    return false;
927
                }
928
                return true
929
            }
930
931
            function itemSelectionBuildModifyLink(div) {
932
                var itemnumbers = new Array();
933
                $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
934
                    itemnumbers.push($(this).val());
935
                });
936
                if (itemnumbers.length > 0) {
937
                    var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
938
                    url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
939
                    url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
940
                    $('a.itemselection_action_modify').attr('href', url);
941
                } else {
942
                    return false;
943
                }
944
                return true;
945
            }
946
947
            function itemSelectionBuildActionLinks(tab) {
948
                var div = $("#" + tab);
949
                var delete_link_ok = itemSelectionBuildDeleteLink(div);
950
                var modify_link_ok = itemSelectionBuildModifyLink(div);
951
                if (modify_link_ok || delete_link_ok) {
952
                    $('.itemselection_actions', div).show();
953
                } else {
954
                    $('.itemselection_actions', div).hide();
955
                }
956
            }
957
958
            $(document).ready(function() {
959
                $('table.items_table').each(function() {
960
                    var div = $(this).parent().attr("id");
961
                    itemSelectionBuildActionLinks(div);
962
                });
963
964
                $("input[name='itemnumber'][type='checkbox']").change(function() {
965
                    var div = $(this).parents('table').parent().parent().attr("id");
966
                    itemSelectionBuildActionLinks(div);
967
                });
968
969
                $(".SelectAll").on("click",function(e){
970
                    e.preventDefault();
971
                    var tab = $(this).data("tab");
972
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
973
                    itemSelectionBuildActionLinks(tab);
974
                });
975
976
                $(".ClearAll").on("click",function(e){
977
                    e.preventDefault();
978
                    var tab = $(this).data("tab");
979
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
980
                    itemSelectionBuildActionLinks(tab);
981
                });
982
            });
983
        [% END %]
984
985
        $(document).ready(function() {
986
            $('#bibliodetails').tabs();
987
            [% IF count == 0 %]
988
                $('#bibliodetails').tabs("option", "active", 3);
989
            [% END %]
990
            $('#search-form').focus();
991
            $('.thumbnails > li > a > span.remove').click(function() {
992
                var result = confirm(_("Are you sure you want to delete this cover image?"));
993
994
                if ( result == true ) {
995
                    var imagenumber = $(this).parent().parent().attr('id').split('-')[1];
996
                    removeLocalImage(imagenumber);
997
                }
998
999
                return false;
1000
            });
1001
            [%# inject no images message %]
1002
            [% IF ( LocalCoverImages && ! localimages.0 ) %]
1003
                showNoImageMessage();
1004
            [% END %]
1005
            [% IF LocalCoverImages %]
1006
                KOHA.LocalCover.GetCoverFromBibnumber(true);
1007
            [% END %]
1008
            $("body").on("click",".previewMARC", function(e){
1009
                e.preventDefault();
1010
                var page = $(this).attr("href");
1011
                $("#marcPreview .modal-body").load(page + " table");
1012
                $('#marcPreview').modal({show:true});
1013
            });
1014
            $("#marcPreview").on("hidden", function(){
1015
                $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
1016
            });
1017
            [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %]
1018
                novSelect.loadContentForQuery({
1019
                    ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]',
1020
                    ISBN : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]',
1021
                    version : '2.1'
1022
                },
1023
                '[% Koha.Preference('NovelistSelectProfile') %]',
1024
                '[% Koha.Preference('NovelistSelectPassword') %]',
1025
                function(d){
1026
                    if ( d.length > 0 ){ //If no content
1027
                        $(".NovelistSelect").show();
1028
                    }
1029
                 });
1030
             [% END %]
1031
1032
        });
1033
1034
        [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
1035
            verify_images();
1036
        });[% END %]
1037
    </script>
1038
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %]
1039
        <script type="text/javascript" src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1040
    [% END %]
1041
    [% INCLUDE 'datatables.inc' %]
1042
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
1043
    [% INCLUDE 'browser-strings.inc' %]
1044
    <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
1045
    <script type="text/javascript">
1046
        var browser = KOHA.browser('[% searchid %]', parseInt(biblionumber, 10));
1047
        browser.show();
1048
1049
        function activate_filters(id) {
1050
            var table = $("#" + id + " table");
1051
            if (table.length == 1) {
1052
                filters_row = table.find('thead tr.filters_row');
1053
1054
                var aoColumns = [];
1055
                filters_row.find('th').each(function() {
1056
                    if(this.className === "NoSort"){
1057
                        aoColumns.push(null);
1058
                    } else {
1059
                        aoColumns.push('text');
1060
                    }
1061
                });
1062
1063
                if (table.find('thead tr.columnFilter').length == 0) {
1064
                    table.dataTable().columnFilter({
1065
                        'sPlaceHolder': 'head:after'
1066
                        ,   'aoColumns': aoColumns
1067
                    });
1068
                    filters_row.addClass('columnFilter');
1069
                }
1070
                filters_row.show();
1071
            }
1072
1073
            $('#' + id + '_activate_filters')
1074
                .html('<i class="fa fa-filter"></i> ' + _("Deactivate filters") )
1075
                .unbind('click')
1076
                .click(function() {
1077
                    deactivate_filters(id);
1078
                    return false;
1079
                });
1080
        }
1081
1082
        function deactivate_filters(id) {
1083
            filters_row = $("#" + id + " table").find('thead tr.filters_row');
1084
1085
            filters_row.find('input[type="text"]')
1086
                .val('')            // Empty filter text boxes
1087
                .trigger('keyup')   // Filter (display all rows)
1088
                .trigger('blur');   // Reset value to the column name
1089
            filters_row.hide();
1090
1091
            $('#' + id + '_activate_filters')
1092
                .html('<i class="fa fa-filter"></i> ' + _("Activate filters") )
1093
                .unbind('click')
1094
                .click(function() {
1095
                    activate_filters(id);
1096
                    return false;
1097
                });
1098
        }
1099
1100
        $(document).ready(function() {
1101
            var ids = ['holdings', 'otherholdings'];
1102
            for (var i in ids) {
1103
                var id = ids[i];
1104
                var table = $('#' + id + ' table');
1105
1106
                // Duplicate the table header row for columnFilter
1107
                thead_row = table.find('thead tr');
1108
                clone = thead_row.clone().addClass('filters_row');
1109
                clone.find("th.NoSort").html('');
1110
                thead_row.before(clone);
1111
1112
                // Enable sorting
1113
                table.dataTable($.extend(true, {}, dataTablesDefaults, {
1114
                    'sDom': 't',
1115
                    'bPaginate': false,
1116
                    'bAutoWidth': false,
1117
                    "aoColumnDefs": [
1118
                        { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
1119
                    ]
1120
                }));
1121
1122
                // Show a link to activate filtering
1123
                link = $('<a>')
1124
                    .attr('href', '#')
1125
                    .attr('id', id + '_activate_filters');
1126
                $("." + id + "_table_controls").prepend(link);
1127
                deactivate_filters(id);
1128
            }
1129
            [% IF Koha.Preference('AcquisitionDetails') %]
1130
                $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
1131
                    'sDom': 't',
1132
                    'bPaginate': false,
1133
                    'bAutoWidth': false,
1134
                    "aaSorting": [[ 4, "desc" ]],
1135
                    "aoColumnDefs": [
1136
                        { "aTargets": "title-string", "sType": "title-string" }
1137
                    ]
1138
                }));
1139
            [% END %]
1140
        });
1141
    </script>
1142
[% END %]
1157
[% INCLUDE 'intranet-bottom.inc' %]
1143
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt (-19 / +23 lines)
Lines 1-26 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Catalog &rsaquo; Details for [% biblio.title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %]</title>
3
<title>Koha &rsaquo; Catalog &rsaquo; Details for [% biblio.title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% IF ( LocalCoverImages == 1 ) %]
5
[% IF ( LocalCoverImages == 1 ) %]
5
<script type="text/JavaScript">
6
//<![CDATA[
7
8
$(document).ready(function(){
9
    showCover([% imagenumber %]);
10
    $(".show_cover").on("click",function(e){
11
        e.preventDefault();
12
        var coverimg = $(this).data("coverimg");
13
        showCover(coverimg);
14
    });
15
});
16
17
function showCover(img) {
18
    $('.thumbnail').attr('class', 'thumbnail');
19
    $('#largeCoverImg').attr('src', '/cgi-bin/koha/catalogue/image.pl?imagenumber=' + img);
20
    $('#' + img + '.thumbnail').attr('class', 'thumbnail selected');
21
}
22
//]]>
23
</script>
24
<style type="text/css">
6
<style type="text/css">
25
#largeCoverImg {
7
#largeCoverImg {
26
    border : 1px solid #CCCCCC;
8
    border : 1px solid #CCCCCC;
Lines 105-108 img.thumbnail { Link Here
105
[% INCLUDE 'biblio-view-menu.inc' %]
87
[% INCLUDE 'biblio-view-menu.inc' %]
106
</div>
88
</div>
107
</div>
89
</div>
90
91
[% MACRO jsinclude BLOCK %]
92
    [% INCLUDE 'catalog-strings.inc' %]
93
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/catalog.js"></script>
94
    <script type="text/javascript">
95
        $(document).ready(function(){
96
            showCover([% imagenumber %]);
97
            $(".show_cover").on("click",function(e){
98
                e.preventDefault();
99
                var coverimg = $(this).data("coverimg");
100
                showCover(coverimg);
101
            });
102
        });
103
104
        function showCover(img) {
105
            $('.thumbnail').attr('class', 'thumbnail');
106
            $('#largeCoverImg').attr('src', '/cgi-bin/koha/catalogue/image.pl?imagenumber=' + img);
107
            $('#' + img + '.thumbnail').attr('class', 'thumbnail selected');
108
        }
109
    </script>
110
[% END %]
111
108
[% INCLUDE 'intranet-bottom.inc' %]
112
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt (-12 / +18 lines)
Lines 1-23 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% biblio.title |html %]</title>
6
<title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% biblio.title |html %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
7
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/datatables.css" />
8
[% INCLUDE 'datatables.inc' %]
9
<script type="text/javascript" id="js">
10
$(document).ready(function() {
11
    $("#table_issues").dataTable($.extend(true, {}, dataTablesDefaults, {
12
        "aoColumnDefs": [
13
            { "sType": "title-string", "aTargets" : [ "title-string" ] }
14
        ],
15
        "aaSorting": [[ 4, "desc" ]],
16
        "sPaginationType": "full_numbers"
17
    }));
18
}); </script>
19
20
</head>
9
</head>
10
21
<body id="catalog_issuehistory" class="catalog">
11
<body id="catalog_issuehistory" class="catalog">
22
12
23
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'header.inc' %]
Lines 103-106 $(document).ready(function() { Link Here
103
[% INCLUDE 'biblio-view-menu.inc' %]
93
[% INCLUDE 'biblio-view-menu.inc' %]
104
</div>
94
</div>
105
</div>
95
</div>
96
97
[% MACRO jsinclude BLOCK %]
98
[% INCLUDE 'datatables.inc' %]
99
    <script type="text/javascript" id="js">
100
        $(document).ready(function() {
101
            $("#table_issues").dataTable($.extend(true, {}, dataTablesDefaults, {
102
                "aoColumnDefs": [
103
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
104
                ],
105
                "aaSorting": [[ 4, "desc" ]],
106
                "sPaginationType": "full_numbers"
107
            }));
108
        });
109
    </script>
110
[% END %]
111
106
[% INCLUDE 'intranet-bottom.inc' %]
112
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt (-237 / +239 lines)
Lines 98-344 Link Here
98
98
99
[%# Page starts here %]
99
[%# Page starts here %]
100
100
101
[% SET footerjs = 1 %]
101
[% INCLUDE 'doc-head-open.inc' %]
102
[% INCLUDE 'doc-head-open.inc' %]
102
  <title>Koha &rsaquo; Catalog &rsaquo; Item search</title>
103
  <title>Koha &rsaquo; Catalog &rsaquo; Item search</title>
103
  [% INCLUDE 'doc-head-close.inc' %]
104
  [% INCLUDE 'doc-head-close.inc' %]
104
  <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
105
  [% INCLUDE 'datatables.inc' %]
106
  <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
107
  <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
108
  <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/itemsearchform.css" />
105
  <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/itemsearchform.css" />
109
  <script type="text/javascript">
106
  <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
110
    //<![CDATA[
111
    var authorised_values = [% authorised_values_json %];
112
113
    function loadAuthorisedValuesSelect(select) {
114
      var selected = select.find('option:selected');
115
      var category = selected.data('authorised-values-category');
116
      var form_field_value = select.siblings('.form-field-value');
117
      if (category && category in authorised_values) {
118
        var values = authorised_values[category];
119
        var html = '<select name="q" class="form-field-value">\n';
120
        for (i in values) {
121
          var value = values[i];
122
          html += '<option value="' + value.authorised_value + '">' + value.lib + '</option>\n';
123
        }
124
        html += '</select>\n';
125
        var new_form_field_value = $(html);
126
        new_form_field_value.val(form_field_value.val());
127
        form_field_value.replaceWith(new_form_field_value);
128
      } else {
129
        if (form_field_value.prop('tagName').toLowerCase() == 'select') {
130
          html = '<input name="q" type="text" class="form-field-value" />';
131
          var new_form_field_value = $(html);
132
          form_field_value.replaceWith(new_form_field_value);
133
        }
134
      }
135
    }
136
137
    function addNewField( link ) {
138
      var form_field = $('div.form-field-select-text').last();
139
      var copy = form_field.clone(true);
140
      copy.find('input,select').not('[type="hidden"]').each(function() {
141
        $(this).val('');
142
      });
143
      copy.find('.form-field-conjunction').prop('disabled', false);
144
      form_field.after(copy);
145
      link.remove();
146
      copy.find('select.form-field-column').change();
147
    }
148
149
    function submitForm($form) {
150
      var tr = ''
151
        + '    <tr>'
152
        + '      <th>' + _("Title") + '</th>'
153
        + '      <th>' + _("Publication date") + '</th>'
154
        + '      <th>' + _("Publisher") + '</th>'
155
        + '      <th>' + _("Collection") + '</th>'
156
        + '      <th>' + _("Barcode") + '</th>'
157
        + '      <th>' + _("Call number") + '</th>'
158
        + '      <th>' + _("Home library") + '</th>'
159
        + '      <th>' + _("Current location") + '</th>'
160
        + '      <th>' + _("Shelving location") + '</th>'
161
        + '      <th>' + _("Inventory number") + '</th>'
162
        + '      <th>' + _("Status") + '</th>'
163
        + '      <th>' + _("Checkouts") + '</th>'
164
        + '      <th></th>'
165
        + '    </tr>'
166
      var table = ''
167
        + '<table id="results">'
168
        + '  <thead>' + tr + tr + '</thead>'
169
        + '  <tbody></tbody>'
170
        + '</table>';
171
172
      var advSearchLink = $('<a>')
173
        .attr('href', '/cgi-bin/koha/catalogue/search.pl')
174
        .html(_("Go to advanced search"));
175
      var editSearchLink = $('<a>')
176
        .attr('href', '#')
177
        .html(_("Edit search"))
178
        .addClass('btn btn-default btn-xs')
179
        .on('click', function(e) {
180
          e.preventDefault();
181
          $('#item-search-block').show();
182
        });
183
184
      var csvExportLink = $('<a>')
185
        .attr('href', '#')
186
        .html(_("Export results to CSV"))
187
        .addClass('btn btn-default btn-xs')
188
        .on('click', function(e) {
189
          e.preventDefault();
190
          $('#format-csv').prop('checked', true);
191
          $('#itemsearchform').submit();
192
          $('#format-html').prop('checked', true);
193
        });
194
      var barcodesExportLink = $('<a>')
195
        .attr('href', '#')
196
        .html(_("Export results to barcodes file"))
197
        .addClass('btn btn-default btn-xs')
198
        .on('click', function(e) {
199
          e.preventDefault();
200
          $('#format-barcodes').prop('checked', true);
201
          $('#itemsearchform').submit();
202
          $('#format-html').prop('checked', true);
203
        });
204
205
      var editSearchAndExportLinks = $('<p>')
206
        .append(editSearchLink)
207
        .append(' | ')
208
        .append(csvExportLink)
209
        .append(' ')
210
        .append(barcodesExportLink);
211
212
      var results_heading = $('<div>').addClass('results-heading')
213
        .append("<h1>" + _("Item search results") + "</h1>")
214
        .append($('<p>').append(advSearchLink))
215
        .append(editSearchAndExportLinks);
216
      $('#results-wrapper').empty()
217
        .append(results_heading)
218
        .append(table);
219
220
      var params = [];
221
      $form.find('select').not(':disabled').find('option:selected').each(function () {
222
        var name = $(this).parents('select').first().attr('name');
223
        var value = $(this).val();
224
        params.push({ 'name': name, 'value': value });
225
      });
226
      $form.find('input[type="text"],input[type="hidden"]').not(':disabled').each(function () {
227
        params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
228
      });
229
      $form.find('input[type="radio"]:checked').each(function() {
230
        params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
231
      });
232
233
      $('#results').dataTable($.extend(true, {}, dataTablesDefaults, {
234
        'bDestroy': true,
235
        'bServerSide': true,
236
        'bProcessing': true,
237
        'sAjaxSource': '/cgi-bin/koha/catalogue/itemsearch.pl',
238
        'fnServerData': function(sSource, aoData, fnCallback) {
239
          aoData.push( { 'name': 'format', 'value': 'json' } );
240
          for (i in params) {
241
            aoData.push(params[i]);
242
          }
243
          $.ajax({
244
              'dataType': 'json',
245
              'type': 'POST',
246
              'url': sSource,
247
              'data': aoData,
248
              'success': function(json){
249
                  fnCallback(json);
250
              }
251
          });
252
        },
253
        'sDom': '<"top pager"ilp>t<"bottom pager"ip>r',
254
        'aoColumns': [
255
          { 'sName': 'title' },
256
          { 'sName': 'publicationyear' },
257
          { 'sName': 'publishercode' },
258
          { 'sName': 'ccode' },
259
          { 'sName': 'barcode' },
260
          { 'sName': 'itemcallnumber' },
261
          { 'sName': 'homebranch' },
262
          { 'sName': 'holdingbranch' },
263
          { 'sName': 'location' },
264
          { 'sName': 'stocknumber' },
265
          { 'sName': 'notforloan' },
266
          { 'sName': 'issues' },
267
          { 'sName': 'checkbox', 'bSortable': false }
268
        ],
269
        "sPaginationType": "full_numbers"
270
      })).columnFilter({
271
        'sPlaceHolder': 'head:after',
272
        'aoColumns': [
273
          { 'type': 'text' },
274
          { 'type': 'text' },
275
          { 'type': 'text' },
276
          { 'type': 'select', 'values': [% ccodes.json %] },
277
          { 'type': 'text' },
278
          { 'type': 'text' },
279
          { 'type': 'select', 'values': [% branches.json %] },
280
          { 'type': 'select', 'values': [% branches.json %] },
281
          [% IF locations.size %]
282
              { 'type': 'select', 'values': [% locations.json %] },
283
          [% ELSE %]
284
              null,
285
          [% END %]
286
          { 'type': 'text' },
287
          [% IF notforloans.size %]
288
              { 'type': 'select', 'values': [% notforloans.json %] },
289
          [% ELSE %]
290
              null,
291
          [% END %]
292
          { 'type': 'text' },
293
          null
294
        ]
295
      });
296
    }
297
298
    $(document).ready(function () {
299
      $('#toolbar').fixFloat();
300
      // Add the "New field" link.
301
      var form_field = $('div.form-field-select-text').last()
302
      var NEW_FIELD = _("New field");
303
      var button_field_new = $('<a href="#" class="button-field-new" title="Add a new field"><i class="fa fa-plus"></i> ' + NEW_FIELD + '</a>');
304
      button_field_new.click(function(e) {
305
          e.preventDefault();
306
          addNewField( $(this) );
307
      });
308
      form_field.append(button_field_new);
309
310
      // If a field is linked to an authorised values list, display the list.
311
      $('div.form-field-select-text select').change(function() {
312
        loadAuthorisedValuesSelect($(this));
313
      }).change();
314
315
      // Prevent user to select the 'All ...' option with other options.
316
      $('div.form-field-select').each(function() {
317
        $(this).find('select').filter(':last').change(function() {
318
          values = $(this).val();
319
          if (values.length > 1) {
320
            var idx = $.inArray('', values);
321
            if (idx != -1) {
322
              values.splice(idx, 1);
323
              $(this).val(values);
324
            }
325
          }
326
        });
327
      });
328
329
      $('#itemsearchform').submit(function() {
330
        var searchform = $(this);
331
        var format = searchform.find('input[name="format"]:checked').val();
332
        if (format == 'html') {
333
          submitForm(searchform);
334
          $("#item-search-block").hide();
335
          return false;
336
        }
337
      });
338
    });
339
    //]]>
340
  </script>
341
</head>
107
</head>
108
342
<body id="catalog_itemsearch" class="catalog">
109
<body id="catalog_itemsearch" class="catalog">
343
  [% INCLUDE 'header.inc' %]
110
  [% INCLUDE 'header.inc' %]
344
  [% INCLUDE 'home-search.inc' %]
111
  [% INCLUDE 'home-search.inc' %]
Lines 426-429 Link Here
426
  <div id="doc3" class="yui-t7">
193
  <div id="doc3" class="yui-t7">
427
      <div id="results-wrapper"></div>
194
      <div id="results-wrapper"></div>
428
195
429
    [% INCLUDE 'intranet-bottom.inc' %]
196
[% MACRO jsinclude BLOCK %]
197
    [% INCLUDE 'datatables.inc' %]
198
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
199
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
200
    <script type="text/javascript">
201
        var authorised_values = [% authorised_values_json %];
202
203
        function loadAuthorisedValuesSelect(select) {
204
            var selected = select.find('option:selected');
205
            var category = selected.data('authorised-values-category');
206
            var form_field_value = select.siblings('.form-field-value');
207
            if (category && category in authorised_values) {
208
                var values = authorised_values[category];
209
                var html = '<select name="q" class="form-field-value">\n';
210
                for (i in values) {
211
                    var value = values[i];
212
                    html += '<option value="' + value.authorised_value + '">' + value.lib + '</option>\n';
213
                }
214
                html += '</select>\n';
215
                var new_form_field_value = $(html);
216
                new_form_field_value.val(form_field_value.val());
217
                form_field_value.replaceWith(new_form_field_value);
218
            } else {
219
                if (form_field_value.prop('tagName').toLowerCase() == 'select') {
220
                    html = '<input name="q" type="text" class="form-field-value" />';
221
                    var new_form_field_value = $(html);
222
                    form_field_value.replaceWith(new_form_field_value);
223
                }
224
            }
225
        }
226
227
    function addNewField( link ) {
228
            var form_field = $('div.form-field-select-text').last();
229
            var copy = form_field.clone(true);
230
            copy.find('input,select').not('[type="hidden"]').each(function() {
231
                $(this).val('');
232
            });
233
            copy.find('.form-field-conjunction').prop('disabled', false);
234
            form_field.after(copy);
235
      link.remove();
236
            copy.find('select.form-field-column').change();
237
        }
238
239
        function submitForm($form) {
240
            var tr = ''
241
                + '    <tr>'
242
                + '      <th>' + _("Title") + '</th>'
243
                + '      <th>' + _("Publication date") + '</th>'
244
                + '      <th>' + _("Publisher") + '</th>'
245
                + '      <th>' + _("Collection") + '</th>'
246
                + '      <th>' + _("Barcode") + '</th>'
247
                + '      <th>' + _("Call number") + '</th>'
248
                + '      <th>' + _("Home library") + '</th>'
249
                + '      <th>' + _("Current location") + '</th>'
250
                + '      <th>' + _("Shelving location") + '</th>'
251
                + '      <th>' + _("Inventory number") + '</th>'
252
                + '      <th>' + _("Status") + '</th>'
253
                + '      <th>' + _("Checkouts") + '</th>'
254
                + '      <th></th>'
255
                + '    </tr>'
256
            var table = ''
257
                + '<table id="results">'
258
                + '  <thead>' + tr + tr + '</thead>'
259
                + '  <tbody></tbody>'
260
                + '</table>';
261
262
            var advSearchLink = $('<a>')
263
                .attr('href', '/cgi-bin/koha/catalogue/search.pl')
264
                .html(_("Go to advanced search"));
265
            var editSearchLink = $('<a>')
266
                .attr('href', '#')
267
                .html(_("Edit search"))
268
                .addClass('btn btn-default btn-xs')
269
                .on('click', function(e) {
270
                    e.preventDefault();
271
                    $('#item-search-block').show();
272
                });
273
274
            var csvExportLink = $('<a>')
275
                .attr('href', '#')
276
                .html(_("Export results to CSV"))
277
                .addClass('btn btn-default btn-xs')
278
                .on('click', function(e) {
279
                    e.preventDefault();
280
                    $('#format-csv').prop('checked', true);
281
                    $('#itemsearchform').submit();
282
                    $('#format-html').prop('checked', true);
283
                });
284
            var barcodesExportLink = $('<a>')
285
                .attr('href', '#')
286
                .html(_("Export results to barcodes file"))
287
                .addClass('btn btn-default btn-xs')
288
                .on('click', function(e) {
289
                    e.preventDefault();
290
                    $('#format-barcodes').prop('checked', true);
291
                    $('#itemsearchform').submit();
292
                    $('#format-html').prop('checked', true);
293
              });
294
295
            var editSearchAndExportLinks = $('<p>')
296
                .append(editSearchLink)
297
                .append(' | ')
298
                .append(csvExportLink)
299
                .append(' ')
300
                .append(barcodesExportLink);
301
302
            var results_heading = $('<div>').addClass('results-heading')
303
                .append("<h1>" + _("Item search results") + "</h1>")
304
                .append($('<p>').append(advSearchLink))
305
                .append(editSearchAndExportLinks);
306
            $('#results-wrapper').empty()
307
                .append(results_heading)
308
                .append(table);
309
310
            var params = [];
311
            $form.find('select').not(':disabled').find('option:selected').each(function () {
312
                var name = $(this).parents('select').first().attr('name');
313
                var value = $(this).val();
314
                params.push({ 'name': name, 'value': value });
315
            });
316
            $form.find('input[type="text"],input[type="hidden"]').not(':disabled').each(function () {
317
                params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
318
            });
319
            $form.find('input[type="radio"]:checked').each(function() {
320
                params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
321
            });
322
323
            $('#results').dataTable($.extend(true, {}, dataTablesDefaults, {
324
                'bDestroy': true,
325
                'bServerSide': true,
326
                'bProcessing': true,
327
                'sAjaxSource': '/cgi-bin/koha/catalogue/itemsearch.pl',
328
                'fnServerData': function(sSource, aoData, fnCallback) {
329
                    aoData.push( { 'name': 'format', 'value': 'json' } );
330
                    for (i in params) {
331
                        aoData.push(params[i]);
332
                    }
333
                    $.ajax({
334
                        'dataType': 'json',
335
                        'type': 'POST',
336
                        'url': sSource,
337
                        'data': aoData,
338
                        'success': function(json){
339
                            fnCallback(json);
340
                        }
341
                    });
342
                },
343
                'sDom': '<"top pager"ilp>t<"bottom pager"ip>r',
344
                'aoColumns': [
345
                    { 'sName': 'title' },
346
                    { 'sName': 'publicationyear' },
347
                    { 'sName': 'publishercode' },
348
          { 'sName': 'ccode' },
349
                    { 'sName': 'barcode' },
350
                    { 'sName': 'itemcallnumber' },
351
                    { 'sName': 'homebranch' },
352
                    { 'sName': 'holdingbranch' },
353
                    { 'sName': 'location' },
354
                    { 'sName': 'stocknumber' },
355
                    { 'sName': 'notforloan' },
356
                    { 'sName': 'issues' },
357
                    { 'sName': 'checkbox', 'bSortable': false }
358
                ],
359
                "sPaginationType": "full_numbers"
360
            })).columnFilter({
361
                'sPlaceHolder': 'head:after',
362
                'aoColumns': [
363
                    { 'type': 'text' },
364
                    { 'type': 'text' },
365
                    { 'type': 'text' },
366
          { 'type': 'select', 'values': [% ccodes.json %] },
367
                    { 'type': 'text' },
368
                    { 'type': 'text' },
369
                    { 'type': 'select', 'values': [% branches.json %] },
370
                    { 'type': 'select', 'values': [% branches.json %] },
371
                    [% IF locations.size %]
372
                        { 'type': 'select', 'values': [% locations.json %] },
373
                    [% ELSE %]
374
                        null,
375
                    [% END %]
376
                    { 'type': 'text' },
377
                    [% IF notforloans.size %]
378
                        { 'type': 'select', 'values': [% notforloans.json %] },
379
                    [% ELSE %]
380
                        null,
381
                    [% END %]
382
                    { 'type': 'text' },
383
                    null
384
                ]
385
            });
386
        }
387
388
        $(document).ready(function () {
389
            $('#toolbar').fixFloat();
390
            // Add the "New field" link.
391
            var form_field = $('div.form-field-select-text').last()
392
            var NEW_FIELD = _("New field");
393
      var button_field_new = $('<a href="#" class="button-field-new" title="Add a new field"><i class="fa fa-plus"></i> ' + NEW_FIELD + '</a>');
394
      button_field_new.click(function(e) {
395
          e.preventDefault();
396
          addNewField( $(this) );
397
            });
398
      form_field.append(button_field_new);
399
400
            // If a field is linked to an authorised values list, display the list.
401
            $('div.form-field-select-text select').change(function() {
402
                loadAuthorisedValuesSelect($(this));
403
            }).change();
404
405
            // Prevent user to select the 'All ...' option with other options.
406
            $('div.form-field-select').each(function() {
407
                $(this).find('select').filter(':last').change(function() {
408
                    values = $(this).val();
409
                    if (values.length > 1) {
410
                        var idx = $.inArray('', values);
411
                        if (idx != -1) {
412
                            values.splice(idx, 1);
413
                            $(this).val(values);
414
                        }
415
                    }
416
                });
417
                $('#itemsearchform').submit(function() {
418
                  var searchform = $(this);
419
                  var format = searchform.find('input[name="format"]:checked').val();
420
                  if (format == 'html') {
421
                    submitForm(searchform);
422
                    $("#item-search-block").hide();
423
                    return false;
424
                  }
425
                });
426
            });
427
        });
428
    </script>
429
[% END %]
430
431
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt (-23 / +26 lines)
Lines 1-3 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
3
3
<title>Koha &rsaquo; Catalog &rsaquo;
4
<title>Koha &rsaquo; Catalog &rsaquo;
Lines 9-36 Link Here
9
</title>
10
</title>
10
11
11
	[% INCLUDE 'doc-head-close.inc' %]
12
	[% INCLUDE 'doc-head-close.inc' %]
12
13
    [% INCLUDE 'browser-strings.inc' %]
14
    <!--[if lt IE 9]>
15
    <script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
16
    <![endif]-->
17
    <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
18
	<script type="text/javascript">
19
	//<![CDATA[
20
        var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
21
        browser.show();
22
        $(document).ready(function() {
23
            $("#Frameworks").on("change",function(){
24
                Changefwk(this);
25
            });
26
        });
27
		function Changefwk(FwkList)
28
		{
29
			var fwk = FwkList.options[FwkList.selectedIndex].value;
30
			window.location = "labeledMARCdetail.pl?biblionumber=[% biblionumber %]&frameworkcode="+fwk;
31
		}
32
	//]]>
33
	</script>
34
</head>
13
</head>
35
14
36
<body id="catlaog_labeledMARCdetail" class="catalog">
15
<body id="catlaog_labeledMARCdetail" class="catalog">
Lines 94-97 Link Here
94
		</div>
73
		</div>
95
	[% END %]
74
	[% END %]
96
	</div>
75
	</div>
97
	[% INCLUDE 'intranet-bottom.inc' %]
76
77
[% MACRO jsinclude BLOCK %]
78
    [% INCLUDE 'catalog-strings.inc' %]
79
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/catalog.js"></script>
80
    [% INCLUDE 'browser-strings.inc' %]
81
    <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
82
    <script type="text/javascript">
83
    //<![CDATA[
84
        var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
85
        browser.show();
86
        $(document).ready(function() {
87
            $("#Frameworks").on("change",function(){
88
                Changefwk(this);
89
            });
90
        });
91
        function Changefwk(FwkList)
92
        {
93
            var fwk = FwkList.options[FwkList.selectedIndex].value;
94
            window.location = "labeledMARCdetail.pl?biblionumber=[% biblionumber %]&frameworkcode="+fwk;
95
        }
96
    //]]>
97
    </script>
98
[% END %]
99
100
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-11 / +11 lines)
Lines 1-20 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
5
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<style type="text/css">h3{padding-top: 1em; border-top: 2px solid #CCCCCC;}#exportLabelexportModal_{border-top: 0px;}</style>
7
<style type="text/css">h3{padding-top: 1em; border-top: 2px solid #CCCCCC;}#exportLabelexportModal_{border-top: 0px;}</style>
7
[% INCLUDE 'browser-strings.inc' %]
8
<!--[if lt IE 9]>
9
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
10
<![endif]-->
11
<script type="text/javascript" src="[% interface %]/js/browser.js"></script>
12
<script type="text/javascript">
13
//<![CDATA[
14
    var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
15
    browser.show();
16
//]]>
17
</script>
18
</head>
8
</head>
19
<body id="catalog_moredetail" class="catalog">
9
<body id="catalog_moredetail" class="catalog">
20
[% USE KohaDates %]
10
[% USE KohaDates %]
Lines 282-285 Link Here
282
[% INCLUDE 'biblio-view-menu.inc' %]
272
[% INCLUDE 'biblio-view-menu.inc' %]
283
</div>
273
</div>
284
</div>
274
</div>
275
[% MACRO jsinclude BLOCK %]
276
    [% INCLUDE 'catalog-strings.inc' %]
277
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/catalog.js"></script>
278
    [% INCLUDE 'browser-strings.inc' %]
279
    <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
280
    <script type="text/javascript">
281
        var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
282
        browser.show();
283
    </script>
284
[% END %]
285
[% INCLUDE 'intranet-bottom.inc' %]
285
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt (-107 / +111 lines)
Lines 1-117 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% USE Koha %]
3
[% USE Koha %]
3
[% USE KohaDates %]
4
[% USE KohaDates %]
4
<title>Koha &rsaquo; Catalog &rsaquo; Search history</title>
5
<title>Koha &rsaquo; Catalog &rsaquo; Search history</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
[% INCLUDE 'datatables.inc' %]
8
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9
<script type="text/javascript">
10
//<![CDATA[
11
$(document).ready(function() {
12
    // We show table ordered by descending dates by default
13
    // (so that the more recent query is shown first)
14
    $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
15
        "aaSorting": [[ 1, "desc" ]],
16
        "aoColumnDefs": [
17
            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
18
            { "aTargets": [ 1 ], "sType": "title-string" },
19
        ],
20
        "sPaginationType": "full_numbers"
21
    }));
22
23
    $('#tabs').tabs();
24
25
    // DataTables removes hidden rows from the DOM, so we can't expect a
26
    // "regular" submit to work and we need to build another form containing
27
    // all form elements, and then submit this form.
28
    $('#tabs form').submit(function(e) {
29
        e.preventDefault();
30
31
        var form = $(this);
32
        var table = form.find('table').dataTable();
33
34
        var new_form = $('<form>')
35
            .attr('action', form.attr('action'))
36
            .attr('method', form.attr('method'));
37
        form.find('input[type="hidden"]')
38
            .add(table.$('input:checkbox:checked'))
39
            .each(function() {
40
                var input = $('<input type="hidden">')
41
                    .attr('name', $(this).attr('name'))
42
                    .attr('value', $(this).attr('value'));
43
                new_form.append(input);
44
            });
45
        $(document.body).append(new_form);
46
        new_form.submit();
47
    });
48
49
    $(".CheckNone").click(function(e){
50
        e.preventDefault();
51
        var form = $(this).parents("form").first();
52
        form.find('table input[type="checkbox"]').prop('checked', false);
53
        enableCheckboxActions(form);
54
    });
55
    $(".CheckAll").click(function(e){
56
        e.preventDefault();
57
        var form = $(this).parents("form").first();
58
        form.find('table input[type="checkbox"]').prop('checked', true);
59
        enableCheckboxActions(form);
60
    });
61
62
    $('#tabs table').on('click', 'input:checkbox', function() {
63
        var form = $(this).parents("form").first();
64
        enableCheckboxActions(form);
65
    });
66
67
    $(".action_delete").click(function(e){
68
        e.preventDefault();
69
        var form = $(this).parents("form").first();
70
        var table = form.find('table').dataTable();
71
        var ids = table.$("input:checkbox:checked");
72
        if ( $(ids).length < 1 ) {
73
            return false;
74
        }
75
76
        var msg;
77
        if (ids.length == 1) {
78
          msg = _("Are you sure you want to delete the selected search history entry?");
79
        } else {
80
          msg = _("Are you sure you want to delete the %s selected search history entries?").format(ids.length);
81
        }
82
83
        if ( confirm(msg) ) {
84
            form.submit();
85
        }
86
        return false;
87
    });
88
89
    $('#tabs form').each(function() {
90
        enableCheckboxActions($(this));
91
    });
92
});
93
94
function enableCheckboxActions(form){
95
    // Enable/disable controls if checkboxes are checked
96
    var table = form.find('table').dataTable();
97
    var checked_count = table.$("input:checkbox:checked").length;
98
    if (checked_count) {
99
      if (checked_count == 1) {
100
        form.find(".selections").html(_("With selected search: "));
101
      } else {
102
        form.find(".selections").html(_("With %s selected searches: ").format(checked_count));
103
      }
104
      form.find(".selections-toolbar .links a").removeClass("disabled");
105
    } else {
106
      form.find(".selections").html(_("Select searches to: "));
107
      form.find(".selections-toolbar .links a").addClass("disabled");
108
    }
109
}
110
111
//]]>
112
113
</script>
114
</head>
8
</head>
9
115
<body id="catalogue_search-history" class="catalogue">
10
<body id="catalogue_search-history" class="catalogue">
116
11
117
[% INCLUDE 'header.inc' %]
12
[% INCLUDE 'header.inc' %]
Lines 295-298 function enableCheckboxActions(form){ Link Here
295
    </div>
190
    </div>
296
  </div>
191
  </div>
297
</div>
192
</div>
193
194
[% MACRO jsinclude BLOCK %]
195
    [% INCLUDE 'datatables.inc' %]
196
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
197
    <script type="text/javascript">
198
    //<![CDATA[
199
    $(document).ready(function() {
200
        // We show table ordered by descending dates by default
201
        // (so that the more recent query is shown first)
202
        $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
203
            "aaSorting": [[ 1, "desc" ]],
204
            "aoColumnDefs": [
205
                { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
206
                { "aTargets": [ 1 ], "sType": "title-string" },
207
            ],
208
            "sPaginationType": "full_numbers"
209
        }));
210
211
        $('#tabs').tabs();
212
213
        // DataTables removes hidden rows from the DOM, so we can't expect a
214
        // "regular" submit to work and we need to build another form containing
215
        // all form elements, and then submit this form.
216
        $('#tabs form').submit(function(e) {
217
            e.preventDefault();
218
219
            var form = $(this);
220
            var table = form.find('table').dataTable();
221
222
            var new_form = $('<form>')
223
                .attr('action', form.attr('action'))
224
                .attr('method', form.attr('method'));
225
            form.find('input[type="hidden"]')
226
                .add(table.$('input:checkbox:checked'))
227
                .each(function() {
228
                    var input = $('<input type="hidden">')
229
                        .attr('name', $(this).attr('name'))
230
                        .attr('value', $(this).attr('value'));
231
                    new_form.append(input);
232
                });
233
            $(document.body).append(new_form);
234
            new_form.submit();
235
        });
236
237
        $(".CheckNone").click(function(e){
238
            e.preventDefault();
239
            var form = $(this).parents("form").first();
240
            form.find('table input[type="checkbox"]').prop('checked', false);
241
            enableCheckboxActions(form);
242
        });
243
        $(".CheckAll").click(function(e){
244
            e.preventDefault();
245
            var form = $(this).parents("form").first();
246
            form.find('table input[type="checkbox"]').prop('checked', true);
247
            enableCheckboxActions(form);
248
        });
249
250
        $('#tabs table').on('click', 'input:checkbox', function() {
251
            var form = $(this).parents("form").first();
252
            enableCheckboxActions(form);
253
        });
254
255
        $(".action_delete").click(function(e){
256
            e.preventDefault();
257
            var form = $(this).parents("form").first();
258
            var table = form.find('table').dataTable();
259
            var ids = table.$("input:checkbox:checked");
260
            if ( $(ids).length < 1 ) {
261
                return false;
262
            }
263
264
            var msg;
265
            if (ids.length == 1) {
266
              msg = _("Are you sure you want to delete the selected search history entry?");
267
            } else {
268
              msg = _("Are you sure you want to delete the %s selected search history entries?").format(ids.length);
269
            }
270
271
            if ( confirm(msg) ) {
272
                form.submit();
273
            }
274
            return false;
275
        });
276
277
        $('#tabs form').each(function() {
278
            enableCheckboxActions($(this));
279
        });
280
    });
281
282
    function enableCheckboxActions(form){
283
        // Enable/disable controls if checkboxes are checked
284
        var table = form.find('table').dataTable();
285
        var checked_count = table.$("input:checkbox:checked").length;
286
        if (checked_count) {
287
          if (checked_count == 1) {
288
            form.find(".selections").html(_("With selected search: "));
289
          } else {
290
            form.find(".selections").html(_("With %s selected searches: ").format(checked_count));
291
          }
292
          form.find(".selections-toolbar .links a").removeClass("disabled");
293
        } else {
294
          form.find(".selections").html(_("Select searches to: "));
295
          form.find(".selections-toolbar .links a").addClass("disabled");
296
        }
297
    }
298
299
    </script>
300
[% END %]
301
298
[% INCLUDE 'intranet-bottom.inc' %]
302
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/catalog.js (-1 / +112 lines)
Line 0 Link Here
0
- 
1
/* IF ( CAN_user_editcatalogue_edit_catalogue ) */
2
    /* this function open a popup to search on z3950 server.  */
3
    function PopupZ3950() {
4
        var strQuery = GetZ3950Terms();
5
        if(strQuery){
6
            window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=" + biblionumber + strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
7
        }
8
    }
9
    function PopupZ3950Confirmed() {
10
        if (confirm( MSG_REPLACE_RECORD )){
11
            PopupZ3950();
12
        }
13
    }
14
/* END IF( CAN_user_editcatalogue_edit_catalogue ) */
15
16
function addToCart() { addRecord( biblionumber ); }
17
function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=' + biblionumber,'Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes');
18
}
19
function printBiblio() {window.print(); }
20
21
/* IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) */
22
23
function confirm_deletion() {
24
    var order_manage_permission = $(this).data("order-manage");
25
    var is_confirmed;
26
    if (count > 0){
27
        is_confirmed = alert( MSG_DELETE_ALL_ITEMS.format(count) );
28
    } else if (countorders > 0){
29
        if( order_manage_permission ){
30
            is_confirmed = confirm( CONFIRM_RECORD_USED_IN_ORDERS.format(countorders) );
31
        } else {
32
            is_confirmed = alert( MSG_RECORD_USED_IN_ORDERS.format(countorders) );
33
        }
34
    } else if (countdeletedorders > 0){
35
        if( order_manage_permission ){
36
            is_confirmed = confirm( CONFIRM_IN_DELETED_ORDERS.format(countdeletedorders) );
37
        } else {
38
            is_confirmed = alert( MSG_IN_DELTED_ORDERS.format(countdeletedorders) );
39
        }
40
    } else if ( holdcount > 0 ) {
41
        is_confirmed = confirm( CONFIRM_DELETION_HOLDS.format(holdcount) );
42
    } else {
43
        is_confirmed = confirm( CONFIRM_RECORD_DELETION );
44
    }
45
    if (is_confirmed) {
46
        window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&amp;biblionumber=" + biblionumber;
47
    } else {
48
        return false;
49
    }
50
}
51
52
/* END IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) */
53
54
/* IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) */
55
56
function confirm_items_deletion() {
57
    if ( holdcount > 0 ) {
58
        alert( MSG_DELETE_ALL_HOLDS.format(holdcount) );
59
    } else if ( count > 0 ) {
60
        if( confirm( CONFIRM_DELETE_ITEMS.format(count) ) ) {
61
            window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&amp;biblionumber=" + biblionumber;
62
        } else {
63
            return false;
64
        }
65
    } else {
66
        alertNoItems();
67
        return false;
68
    }
69
}
70
71
function alertNoItems(){
72
    alert( MSG_NO_ITEMS );
73
}
74
75
/* END IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) */
76
77
$(document).ready(function() {
78
    $("#z3950copy").click(function(){
79
        PopupZ3950();
80
        return false;
81
    });
82
    $("#deletebiblio").click(function(){
83
        confirm_deletion();
84
        return false;
85
    });
86
    $("#deleteallitems").click(function(){
87
        confirm_items_deletion();
88
        return false;
89
    });
90
    $("#printbiblio").click(function(){
91
        printBiblio();
92
        return false;
93
    });
94
    $("#addtocart").click(function(){
95
        addToCart();
96
        $(".btn-group").removeClass("open");
97
        return false;
98
    });
99
    $("#addtoshelf").click(function(){
100
        addToShelf();
101
        $(".btn-group").removeClass("open");
102
        return false;
103
    });
104
    $("#export").remove(); // Hide embedded export form if JS menus available
105
    $("#deletebiblio").tooltip();
106
    $("#batchedit-disabled,#batchdelete-disabled,#deleteallitems-disabled")
107
        .on("click",function(e){
108
            e.preventDefault();
109
            alertNoItems();
110
        })
111
        .tooltip();
112
 });

Return to bug 17893