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 [% title |html %]</title>
6
<title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% 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 (-236 / +238 lines)
Lines 157-402 Link Here
157
157
158
[%# Page starts here %]
158
[%# Page starts here %]
159
159
160
[% SET footerjs = 1 %]
160
[% INCLUDE 'doc-head-open.inc' %]
161
[% INCLUDE 'doc-head-open.inc' %]
161
  <title>Koha &rsaquo; Catalog &rsaquo; Item search</title>
162
  <title>Koha &rsaquo; Catalog &rsaquo; Item search</title>
162
  [% INCLUDE 'doc-head-close.inc' %]
163
  [% INCLUDE 'doc-head-close.inc' %]
163
  <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
164
  [% INCLUDE 'datatables.inc' %]
165
  <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
166
  <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
167
  <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/itemsearchform.css" />
164
  <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/itemsearchform.css" />
168
  <script type="text/javascript">
165
  <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
169
    //<![CDATA[
170
    var authorised_values = [% authorised_values_json %];
171
172
    function loadAuthorisedValuesSelect(select) {
173
      var selected = select.find('option:selected');
174
      var category = selected.data('authorised-values-category');
175
      var form_field_value = select.siblings('.form-field-value');
176
      if (category && category in authorised_values) {
177
        var values = authorised_values[category];
178
        var html = '<select name="q" class="form-field-value">\n';
179
        for (i in values) {
180
          var value = values[i];
181
          html += '<option value="' + value.authorised_value + '">' + value.lib + '</option>\n';
182
        }
183
        html += '</select>\n';
184
        var new_form_field_value = $(html);
185
        new_form_field_value.val(form_field_value.val());
186
        form_field_value.replaceWith(new_form_field_value);
187
      } else {
188
        if (form_field_value.prop('tagName').toLowerCase() == 'select') {
189
          html = '<input name="q" type="text" class="form-field-value" />';
190
          var new_form_field_value = $(html);
191
          form_field_value.replaceWith(new_form_field_value);
192
        }
193
      }
194
    }
195
196
    function addNewField() {
197
      var form_field = $('div.form-field-select-text').last();
198
      var copy = form_field.clone(true);
199
      copy.find('input,select').not('[type="hidden"]').each(function() {
200
        $(this).val('');
201
      });
202
      copy.find('.form-field-conjunction').prop('disabled', false);
203
      form_field.after(copy);
204
      copy.find('select.form-field-column').change();
205
    }
206
207
    function submitForm($form) {
208
      var tr = ''
209
        + '    <tr>'
210
        + '      <th>' + _("Title") + '</th>'
211
        + '      <th>' + _("Publication date") + '</th>'
212
        + '      <th>' + _("Publisher") + '</th>'
213
        + '      <th>' + _("Collection") + '</th>'
214
        + '      <th>' + _("Barcode") + '</th>'
215
        + '      <th>' + _("Call number") + '</th>'
216
        + '      <th>' + _("Home library") + '</th>'
217
        + '      <th>' + _("Current location") + '</th>'
218
        + '      <th>' + _("Shelving location") + '</th>'
219
        + '      <th>' + _("Inventory number") + '</th>'
220
        + '      <th>' + _("Status") + '</th>'
221
        + '      <th>' + _("Checkouts") + '</th>'
222
        + '      <th></th>'
223
        + '    </tr>'
224
      var table = ''
225
        + '<table id="results">'
226
        + '  <thead>' + tr + tr + '</thead>'
227
        + '  <tbody></tbody>'
228
        + '</table>';
229
230
      var advSearchLink = $('<a>')
231
        .attr('href', '/cgi-bin/koha/catalogue/search.pl')
232
        .html(_("Go to advanced search"));
233
      var editSearchLink = $('<a>')
234
        .attr('href', '#')
235
        .html(_("Edit search"))
236
        .addClass('btn btn-default btn-xs')
237
        .on('click', function(e) {
238
          e.preventDefault();
239
          $('#item-search-block').show();
240
        });
241
242
      var csvExportLink = $('<a>')
243
        .attr('href', '#')
244
        .html(_("Export results to CSV"))
245
        .addClass('btn btn-default btn-xs')
246
        .on('click', function(e) {
247
          e.preventDefault();
248
          $('#format-csv').prop('checked', true);
249
          $('#itemsearchform').submit();
250
          $('#format-html').prop('checked', true);
251
        });
252
      var barcodesExportLink = $('<a>')
253
        .attr('href', '#')
254
        .html(_("Export results to barcodes file"))
255
        .addClass('btn btn-default btn-xs')
256
        .on('click', function(e) {
257
          e.preventDefault();
258
          $('#format-barcodes').prop('checked', true);
259
          $('#itemsearchform').submit();
260
          $('#format-html').prop('checked', true);
261
        });
262
263
      var editSearchAndExportLinks = $('<p>')
264
        .append(editSearchLink)
265
        .append(' | ')
266
        .append(csvExportLink)
267
        .append(' ')
268
        .append(barcodesExportLink);
269
270
      var results_heading = $('<div>').addClass('results-heading')
271
        .append("<h1>" + _("Item search results") + "</h1>")
272
        .append($('<p>').append(advSearchLink))
273
        .append(editSearchAndExportLinks);
274
      $('#results-wrapper').empty()
275
        .append(results_heading)
276
        .append(table);
277
278
      var params = [];
279
      $form.find('select').not(':disabled').find('option:selected').each(function () {
280
        var name = $(this).parents('select').first().attr('name');
281
        var value = $(this).val();
282
        params.push({ 'name': name, 'value': value });
283
      });
284
      $form.find('input[type="text"],input[type="hidden"]').not(':disabled').each(function () {
285
        params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
286
      });
287
      $form.find('input[type="radio"]:checked').each(function() {
288
        params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
289
      });
290
291
      $('#results').dataTable($.extend(true, {}, dataTablesDefaults, {
292
        'bDestroy': true,
293
        'bServerSide': true,
294
        'bProcessing': true,
295
        'sAjaxSource': '/cgi-bin/koha/catalogue/itemsearch.pl',
296
        'fnServerData': function(sSource, aoData, fnCallback) {
297
          aoData.push( { 'name': 'format', 'value': 'json' } );
298
          for (i in params) {
299
            aoData.push(params[i]);
300
          }
301
          $.ajax({
302
              'dataType': 'json',
303
              'type': 'POST',
304
              'url': sSource,
305
              'data': aoData,
306
              'success': function(json){
307
                  fnCallback(json);
308
              }
309
          });
310
        },
311
        'sDom': '<"top pager"ilp>t<"bottom pager"ip>r',
312
        'aoColumns': [
313
          { 'sName': 'title' },
314
          { 'sName': 'publicationyear' },
315
          { 'sName': 'publishercode' },
316
          { 'sName': 'collectiontitle' },
317
          { 'sName': 'barcode' },
318
          { 'sName': 'itemcallnumber' },
319
          { 'sName': 'homebranch' },
320
          { 'sName': 'holdingbranch' },
321
          { 'sName': 'location' },
322
          { 'sName': 'stocknumber' },
323
          { 'sName': 'notforloan' },
324
          { 'sName': 'issues' },
325
          { 'sName': 'checkbox', 'bSortable': false }
326
        ],
327
        "sPaginationType": "full_numbers"
328
      })).columnFilter({
329
        'sPlaceHolder': 'head:after',
330
        'aoColumns': [
331
          { 'type': 'text' },
332
          { 'type': 'text' },
333
          { 'type': 'text' },
334
          { 'type': 'text' },
335
          { 'type': 'text' },
336
          { 'type': 'text' },
337
          { 'type': 'select', 'values': [% branches.json %] },
338
          { 'type': 'select', 'values': [% branches.json %] },
339
          [% IF locations.size %]
340
              { 'type': 'select', 'values': [% locations.json %] },
341
          [% ELSE %]
342
              null,
343
          [% END %]
344
          { 'type': 'text' },
345
          [% IF notforloans.size %]
346
              { 'type': 'select', 'values': [% notforloans.json %] },
347
          [% ELSE %]
348
              null,
349
          [% END %]
350
          { 'type': 'text' },
351
          null
352
        ]
353
      });
354
    }
355
356
    $(document).ready(function () {
357
      $('#toolbar').fixFloat();
358
      // Add the "New field" link.
359
      var form_field = $('div.form-field-select-text').last()
360
      var NEW_FIELD = _("New field");
361
      var button_field_new = $('<a href="#" class="button-field-new" title="Add a new field">' + NEW_FIELD + '</a>');
362
      button_field_new.click(function() {
363
        addNewField();
364
        return false;
365
      });
366
      form_field.after(button_field_new);
367
368
      // If a field is linked to an authorised values list, display the list.
369
      $('div.form-field-select-text select').change(function() {
370
        loadAuthorisedValuesSelect($(this));
371
      }).change();
372
373
      // Prevent user to select the 'All ...' option with other options.
374
      $('div.form-field-select').each(function() {
375
        $(this).find('select').filter(':last').change(function() {
376
          values = $(this).val();
377
          if (values.length > 1) {
378
            var idx = $.inArray('', values);
379
            if (idx != -1) {
380
              values.splice(idx, 1);
381
              $(this).val(values);
382
            }
383
          }
384
        });
385
      });
386
387
      $('#itemsearchform').submit(function() {
388
        var searchform = $(this);
389
        var format = searchform.find('input[name="format"]:checked').val();
390
        if (format == 'html') {
391
          submitForm(searchform);
392
          $("#item-search-block").hide();
393
          return false;
394
        }
395
      });
396
    });
397
    //]]>
398
  </script>
399
</head>
166
</head>
167
400
<body id="catalog_itemsearch" class="catalog">
168
<body id="catalog_itemsearch" class="catalog">
401
  [% INCLUDE 'header.inc' %]
169
  [% INCLUDE 'header.inc' %]
402
  [% INCLUDE 'home-search.inc' %]
170
  [% INCLUDE 'home-search.inc' %]
Lines 510-513 Link Here
510
  <div id="doc3" class="yui-t7">
278
  <div id="doc3" class="yui-t7">
511
      <div id="results-wrapper"></div>
279
      <div id="results-wrapper"></div>
512
280
513
    [% INCLUDE 'intranet-bottom.inc' %]
281
[% MACRO jsinclude BLOCK %]
282
    [% INCLUDE 'datatables.inc' %]
283
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
284
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
285
    <script type="text/javascript">
286
        var authorised_values = [% authorised_values_json %];
287
288
        function loadAuthorisedValuesSelect(select) {
289
            var selected = select.find('option:selected');
290
            var category = selected.data('authorised-values-category');
291
            var form_field_value = select.siblings('.form-field-value');
292
            if (category && category in authorised_values) {
293
                var values = authorised_values[category];
294
                var html = '<select name="q" class="form-field-value">\n';
295
                for (i in values) {
296
                    var value = values[i];
297
                    html += '<option value="' + value.authorised_value + '">' + value.lib + '</option>\n';
298
                }
299
                html += '</select>\n';
300
                var new_form_field_value = $(html);
301
                new_form_field_value.val(form_field_value.val());
302
                form_field_value.replaceWith(new_form_field_value);
303
            } else {
304
                if (form_field_value.prop('tagName').toLowerCase() == 'select') {
305
                    html = '<input name="q" type="text" class="form-field-value" />';
306
                    var new_form_field_value = $(html);
307
                    form_field_value.replaceWith(new_form_field_value);
308
                }
309
            }
310
        }
311
312
        function addNewField() {
313
            var form_field = $('div.form-field-select-text').last();
314
            var copy = form_field.clone(true);
315
            copy.find('input,select').not('[type="hidden"]').each(function() {
316
                $(this).val('');
317
            });
318
            copy.find('.form-field-conjunction').prop('disabled', false);
319
            form_field.after(copy);
320
            copy.find('select.form-field-column').change();
321
        }
322
323
        function submitForm($form) {
324
            var tr = ''
325
                + '    <tr>'
326
                + '      <th>' + _("Title") + '</th>'
327
                + '      <th>' + _("Publication date") + '</th>'
328
                + '      <th>' + _("Publisher") + '</th>'
329
                + '      <th>' + _("Collection") + '</th>'
330
                + '      <th>' + _("Barcode") + '</th>'
331
                + '      <th>' + _("Call number") + '</th>'
332
                + '      <th>' + _("Home library") + '</th>'
333
                + '      <th>' + _("Current location") + '</th>'
334
                + '      <th>' + _("Shelving location") + '</th>'
335
                + '      <th>' + _("Inventory number") + '</th>'
336
                + '      <th>' + _("Status") + '</th>'
337
                + '      <th>' + _("Checkouts") + '</th>'
338
                + '      <th></th>'
339
                + '    </tr>'
340
            var table = ''
341
                + '<table id="results">'
342
                + '  <thead>' + tr + tr + '</thead>'
343
                + '  <tbody></tbody>'
344
                + '</table>';
345
346
            var advSearchLink = $('<a>')
347
                .attr('href', '/cgi-bin/koha/catalogue/search.pl')
348
                .html(_("Go to advanced search"));
349
            var editSearchLink = $('<a>')
350
                .attr('href', '#')
351
                .html(_("Edit search"))
352
                .addClass('btn btn-default btn-xs')
353
                .on('click', function(e) {
354
                    e.preventDefault();
355
                    $('#item-search-block').show();
356
                });
357
358
            var csvExportLink = $('<a>')
359
                .attr('href', '#')
360
                .html(_("Export results to CSV"))
361
                .addClass('btn btn-default btn-xs')
362
                .on('click', function(e) {
363
                    e.preventDefault();
364
                    $('#format-csv').prop('checked', true);
365
                    $('#itemsearchform').submit();
366
                    $('#format-html').prop('checked', true);
367
                });
368
            var barcodesExportLink = $('<a>')
369
                .attr('href', '#')
370
                .html(_("Export results to barcodes file"))
371
                .addClass('btn btn-default btn-xs')
372
                .on('click', function(e) {
373
                    e.preventDefault();
374
                    $('#format-barcodes').prop('checked', true);
375
                    $('#itemsearchform').submit();
376
                    $('#format-html').prop('checked', true);
377
              });
378
379
            var editSearchAndExportLinks = $('<p>')
380
                .append(editSearchLink)
381
                .append(' | ')
382
                .append(csvExportLink)
383
                .append(' ')
384
                .append(barcodesExportLink);
385
386
            var results_heading = $('<div>').addClass('results-heading')
387
                .append("<h1>" + _("Item search results") + "</h1>")
388
                .append($('<p>').append(advSearchLink))
389
                .append(editSearchAndExportLinks);
390
            $('#results-wrapper').empty()
391
                .append(results_heading)
392
                .append(table);
393
394
            var params = [];
395
            $form.find('select').not(':disabled').find('option:selected').each(function () {
396
                var name = $(this).parents('select').first().attr('name');
397
                var value = $(this).val();
398
                params.push({ 'name': name, 'value': value });
399
            });
400
            $form.find('input[type="text"],input[type="hidden"]').not(':disabled').each(function () {
401
                params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
402
            });
403
            $form.find('input[type="radio"]:checked').each(function() {
404
                params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
405
            });
406
407
            $('#results').dataTable($.extend(true, {}, dataTablesDefaults, {
408
                'bDestroy': true,
409
                'bServerSide': true,
410
                'bProcessing': true,
411
                'sAjaxSource': '/cgi-bin/koha/catalogue/itemsearch.pl',
412
                'fnServerData': function(sSource, aoData, fnCallback) {
413
                    aoData.push( { 'name': 'format', 'value': 'json' } );
414
                    for (i in params) {
415
                        aoData.push(params[i]);
416
                    }
417
                    $.ajax({
418
                        'dataType': 'json',
419
                        'type': 'POST',
420
                        'url': sSource,
421
                        'data': aoData,
422
                        'success': function(json){
423
                            fnCallback(json);
424
                        }
425
                    });
426
                },
427
                'sDom': '<"top pager"ilp>t<"bottom pager"ip>r',
428
                'aoColumns': [
429
                    { 'sName': 'title' },
430
                    { 'sName': 'publicationyear' },
431
                    { 'sName': 'publishercode' },
432
                    { 'sName': 'collectiontitle' },
433
                    { 'sName': 'barcode' },
434
                    { 'sName': 'itemcallnumber' },
435
                    { 'sName': 'homebranch' },
436
                    { 'sName': 'holdingbranch' },
437
                    { 'sName': 'location' },
438
                    { 'sName': 'stocknumber' },
439
                    { 'sName': 'notforloan' },
440
                    { 'sName': 'issues' },
441
                    { 'sName': 'checkbox', 'bSortable': false }
442
                ],
443
                "sPaginationType": "full_numbers"
444
            })).columnFilter({
445
                'sPlaceHolder': 'head:after',
446
                'aoColumns': [
447
                    { 'type': 'text' },
448
                    { 'type': 'text' },
449
                    { 'type': 'text' },
450
                    { 'type': 'text' },
451
                    { 'type': 'text' },
452
                    { 'type': 'text' },
453
                    { 'type': 'select', 'values': [% branches.json %] },
454
                    { 'type': 'select', 'values': [% branches.json %] },
455
                    [% IF locations.size %]
456
                        { 'type': 'select', 'values': [% locations.json %] },
457
                    [% ELSE %]
458
                        null,
459
                    [% END %]
460
                    { 'type': 'text' },
461
                    [% IF notforloans.size %]
462
                        { 'type': 'select', 'values': [% notforloans.json %] },
463
                    [% ELSE %]
464
                        null,
465
                    [% END %]
466
                    { 'type': 'text' },
467
                    null
468
                ]
469
            });
470
        }
471
472
        $(document).ready(function () {
473
            $('#toolbar').fixFloat();
474
            // Add the "New field" link.
475
            var form_field = $('div.form-field-select-text').last()
476
            var NEW_FIELD = _("New field");
477
            var button_field_new = $('<a href="#" class="button-field-new">' + NEW_FIELD + '</a>');
478
            button_field_new.click(function() {
479
                addNewField();
480
                return false;
481
            });
482
            form_field.after(button_field_new);
483
484
            // If a field is linked to an authorised values list, display the list.
485
            $('div.form-field-select-text select').change(function() {
486
                loadAuthorisedValuesSelect($(this));
487
            }).change();
488
489
            // Prevent user to select the 'All ...' option with other options.
490
            $('div.form-field-select').each(function() {
491
                $(this).find('select').filter(':last').change(function() {
492
                    values = $(this).val();
493
                    if (values.length > 1) {
494
                        var idx = $.inArray('', values);
495
                        if (idx != -1) {
496
                            values.splice(idx, 1);
497
                            $(this).val(values);
498
                        }
499
                    }
500
                });
501
                $('#itemsearchform').submit(function() {
502
                  var searchform = $(this);
503
                  var format = searchform.find('input[name="format"]:checked').val();
504
                  if (format == 'html') {
505
                    submitForm(searchform);
506
                    $("#item-search-block").hide();
507
                    return false;
508
                  }
509
                });
510
            });
511
        });
512
    </script>
513
[% END %]
514
515
[% 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