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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt (-18 / +2 lines)
Lines 135-141 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
135
               </dl>
135
               </dl>
136
            </td>
136
            </td>
137
            [% END %]
137
            [% END %]
138
            <td>
138
            <td class="actions">
139
                <div class="btn-group dropup">
139
                <div class="btn-group dropup">
140
                    <a class="btn btn-default btn-xs dropdown-toggle" id="z3950preview[% breeding_loo.breedingid | uri %]" role="button" data-toggle="dropdown" href="#">
140
                    <a class="btn btn-default btn-xs dropdown-toggle" id="z3950preview[% breeding_loo.breedingid | uri %]" role="button" data-toggle="dropdown" href="#">
141
                        Preview <b class="caret"></b>
141
                        Preview <b class="caret"></b>
Lines 227-232 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
227
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
227
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
228
    [% INCLUDE 'datatables.inc' %]
228
    [% INCLUDE 'datatables.inc' %]
229
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
229
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
230
    [% Asset.js("js/z3950_search.js") | $raw %]
230
    <script>
231
    <script>
231
        $(document).ready(function(){
232
        $(document).ready(function(){
232
            var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
233
            var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
Lines 237-262 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
237
                "aaSorting": [[ 1, "asc" ]],
238
                "aaSorting": [[ 1, "asc" ]],
238
                "bPaginate": false
239
                "bPaginate": false
239
            }));
240
            }));
240
            /* Inline edit/delete links */
241
            $("td").click(function(event){
242
                var $tgt = $(event.target);
243
                var row = $(this).parent();
244
                $(".linktools").hide();
245
                $("tr").removeClass("selected");
246
                row.addClass("selected");
247
                if($tgt.is("a")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")){
248
                    //Don't show inline links for cells containing links of their own.
249
                } else {
250
                    var position = $(this).offset();
251
                    var top = position.top+5;
252
                    var left = position.left+5;
253
                    $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
254
                }
255
            });
256
        });
241
        });
257
    </script>
242
    </script>
258
    [% INCLUDE 'z3950_search.inc' %]
243
    [% INCLUDE 'z3950_search.inc' %]
259
    [% Asset.js("js/z3950_search.js") | $raw %]
260
[% END %]
244
[% END %]
261
245
262
[% INCLUDE 'intranet-bottom.inc' %]
246
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt (-41 / +1 lines)
Lines 170-189 Link Here
170
[% MACRO jsinclude BLOCK %]
170
[% MACRO jsinclude BLOCK %]
171
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
171
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
172
    [% INCLUDE 'datatables.inc' %]
172
    [% INCLUDE 'datatables.inc' %]
173
    [% Asset.js("js/z3950_search.js") | $raw %]
173
    <script>
174
    <script>
174
        $(document).ready(function(){
175
        $(document).ready(function(){
175
176
            $(".dropdown").on("hidden.bs.dropdown", function(){
177
                // Reset menu styles so that a click on the
178
                // original dropdown button toggle works correctly
179
                $(".dropdown").css("position","absolute");
180
                $(".dropdown-menu").css({
181
                    "top" : "100%",
182
                    "left" : "auto",
183
                    "right" : 0
184
                });
185
            });
186
187
            $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
176
            $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
188
                "sDom": 't',
177
                "sDom": 't',
189
                "aoColumnDefs": [
178
                "aoColumnDefs": [
Lines 192-229 Link Here
192
                "aaSorting": [[ 1, "asc" ]],
181
                "aaSorting": [[ 1, "asc" ]],
193
                "bPaginate": false
182
                "bPaginate": false
194
            }));
183
            }));
195
196
            /* Display actions menu anywhere the table is clicked */
197
            $("td").click(function(event){
198
                var tgt = $(event.target);
199
                var row = $(this).parent();
200
                var rowid = row.attr("id");
201
                $("tr").removeClass("highlighted-row");
202
                row.addClass("highlighted-row");
203
                $(".dropdown").removeClass("open");
204
                if(tgt.is("a")||tgt.is(":nth-child(8)")){
205
                    // Don't show inline links for cells containing links of their own.
206
                } else {
207
                    event.stopPropagation();
208
                    var dropdown = $(".dropdown", row);
209
                    dropdown.addClass("open");
210
                    var position = $(this).offset();
211
                    var top = position.top + 5;
212
                    var left = position.left + 5;
213
                    dropdown.css("position","unset");
214
                    $(".dropdown-menu", row).css({
215
                        "top" : top,
216
                        "left" : left,
217
                        "right" : "unset"
218
                    });
219
220
               }
221
            });
222
223
        });
184
        });
224
    </script>
185
    </script>
225
    [% INCLUDE 'z3950_search.inc' %]
186
    [% INCLUDE 'z3950_search.inc' %]
226
    [% Asset.js("js/z3950_search.js") | $raw %]
227
[% END %]
187
[% END %]
228
188
229
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
189
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt (-40 / +1 lines)
Lines 154-160 Link Here
154
                                                   </dl>
154
                                                   </dl>
155
                                                </td>
155
                                                </td>
156
                                            [% END %]
156
                                            [% END %]
157
                                            <td>
157
                                            <td class="actions">
158
                                                <div class="btn-group dropup">
158
                                                <div class="btn-group dropup">
159
                                                    <a class="btn btn-default btn-xs dropdown-toggle" id="cataloguesearchactions[% breeding_loo.breedingid | html %]" role="button" data-toggle="dropdown" href="#">
159
                                                    <a class="btn btn-default btn-xs dropdown-toggle" id="cataloguesearchactions[% breeding_loo.breedingid | html %]" role="button" data-toggle="dropdown" href="#">
160
                                                      Actions <b class="caret"></b>
160
                                                      Actions <b class="caret"></b>
Lines 242-259 Link Here
242
    [% INCLUDE 'columns_settings.inc' %]
242
    [% INCLUDE 'columns_settings.inc' %]
243
    <script>
243
    <script>
244
        $(document).ready(function(){
244
        $(document).ready(function(){
245
246
            $(".dropdown").on("hidden.bs.dropdown", function(){
247
                // Reset menu styles so that a click on the
248
                // original dropdown button toggle works correctly
249
                $(".dropdown").css("position","absolute");
250
                $(".dropdown-menu").css({
251
                    "top" : "100%",
252
                    "left" : "auto",
253
                    "right" : 0
254
                });
255
            });
256
257
            var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'z3950_search', 'resultst', 'json' ) | $raw %];
245
            var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'z3950_search', 'resultst', 'json' ) | $raw %];
258
            var thetable = KohaTable("resultst", {
246
            var thetable = KohaTable("resultst", {
259
                "aoColumnDefs": [
247
                "aoColumnDefs": [
Lines 263-295 Link Here
263
                "aaSorting": [[ 1, "asc" ]],
251
                "aaSorting": [[ 1, "asc" ]],
264
                "bPaginate": false
252
                "bPaginate": false
265
            }, columns_settings );
253
            }, columns_settings );
266
267
268
            /* Display actions menu anywhere the table is clicked */
269
            $("td").click(function(event){
270
                var tgt = $(event.target);
271
                var row = $(this).parent();
272
                var rowid = row.attr("id");
273
                $("tr").removeClass("highlighted-row");
274
                row.addClass("highlighted-row");
275
                $(".dropdown").removeClass("open");
276
                if(tgt.is("a")||tgt.is(":nth-child(8)")){
277
                    // Don't show inline links for cells containing links of their own.
278
                } else {
279
                    event.stopPropagation();
280
                    var dropdown = $(".dropdown", row);
281
                    dropdown.addClass("open");
282
                    var position = $(this).offset();
283
                    var top = position.top + 5;
284
                    var left = position.left + 5;
285
                    dropdown.css("position","unset");
286
                    $(".dropdown-menu", row).css({
287
                        "top" : top,
288
                        "left" : left,
289
                        "right" : "unset"
290
                    });
291
               }
292
            });
293
        });
254
        });
294
255
295
        function columnsInit(){
256
        function columnsInit(){
(-)a/koha-tmpl/intranet-tmpl/prog/js/z3950_search.js (-10 / +49 lines)
Lines 21-32 $( document ).ready( function() { Link Here
21
        $( ".checkboxed" ).unCheckCheckboxes();
21
        $( ".checkboxed" ).unCheckCheckboxes();
22
        return false;
22
        return false;
23
    });
23
    });
24
    $( "#close_menu" ).on( "click", function(e) {
24
25
        e.preventDefault();
26
        $( ".linktools" ).hide();
27
        $( "tr" ).removeClass( "selected" );
28
        return false;
29
    });
30
    $( ".submit" ).on( "click", function() {
25
    $( ".submit" ).on( "click", function() {
31
        $( "body" ).css( "cursor", "wait" );
26
        $( "body" ).css( "cursor", "wait" );
32
    });
27
    });
Lines 56-62 $( document ).ready( function() { Link Here
56
            return true;
51
            return true;
57
        }
52
        }
58
    });
53
    });
59
    $( ".previewMARC" ).on( "click", function(e) {
54
55
    /* Display actions menu anywhere the table is clicked */
56
    /* Note: The templates where this is included must have a search results
57
       table with the id "resultst" and "action" table cells with the class "actions" */
58
    $("#resultst").on("click", "td", function(event){
59
        var tgt = $(event.target);
60
        var row = $(this).parent();
61
        /* Remove highlight from all rows and add to the clicked row */
62
        $("tr").removeClass("highlighted-row");
63
        row.addClass("highlighted-row");
64
        /* Remove any menus created on the fly for other rows */
65
        $(".btn-wrapper").remove();
66
67
        if( tgt.is("a") || tgt.hasClass("actions") ){
68
            /* Don't show inline links for cells containing links of their own. */
69
        } else {
70
            event.stopPropagation();
71
            /* Remove the "open" class from all dropup menus in case one is open */
72
            $(".dropup").removeClass("open");
73
            /* Create a clone of the Bootstrap dropup menu in the "Actions" column */
74
            var menu_clone = $(".dropdown-menu", row)
75
                .clone()
76
                .addClass("menu-clone")
77
                .css({
78
                    "display" : "block",
79
                    "position" : "absolute",
80
                    "top" : "auto",
81
                    "bottom" : "100%",
82
                    "right" : "auto",
83
                    "left" : "0",
84
                });
85
            /* Append the menu clone to the table cell which was clicked.
86
                The menu must first be wrapped in a block-level div to clear
87
                the table cell's text contents and then a relative-positioned
88
                div to allow the menu to be positioned correctly */
89
            tgt.append(
90
                $('<div/>', {'class': 'btn-wrapper'}).append(
91
                    $('<div/>', {'class': 'btn-group'}).append(
92
                        menu_clone
93
                    )
94
                )
95
            );
96
        }
97
    });
98
99
    $( "#resultst" ).on("click", ".previewMARC", function(e) {
60
        e.preventDefault();
100
        e.preventDefault();
61
        var ltitle = $( this ).text();
101
        var ltitle = $( this ).text();
62
        var page = $( this ).attr( "href" );
102
        var page = $( this ).attr( "href" );
Lines 68-74 $( document ).ready( function() { Link Here
68
        $( "#marcPreviewLabel" ).html( "" );
108
        $( "#marcPreviewLabel" ).html( "" );
69
        $( "#marcPreview .modal-body" ).html( "<div id='loading'><img src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' /> " + MSG_LOADING + "</div>" );
109
        $( "#marcPreview .modal-body" ).html( "<div id='loading'><img src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' /> " + MSG_LOADING + "</div>" );
70
    });
110
    });
71
    $( ".previewData" ).on( "click", function(e) {
111
    $( "#resultst" ).on("click", ".previewData", function(e) {
72
        e.preventDefault();
112
        e.preventDefault();
73
        var ltitle = $( this ).text();
113
        var ltitle = $( this ).text();
74
        var page = $( this ).attr( "href" );
114
        var page = $( this ).attr( "href" );
Lines 80-86 $( document ).ready( function() { Link Here
80
        $( "#dataPreviewLabel" ).html( "" );
120
        $( "#dataPreviewLabel" ).html( "" );
81
        $( "#dataPreview .modal-body" ).html( "<div id='loading'><img src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' /> " + MSG_LOADING + "</div>" );
121
        $( "#dataPreview .modal-body" ).html( "<div id='loading'><img src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' /> " + MSG_LOADING + "</div>" );
82
    });
122
    });
83
    $( ".import_record" ).on( "click", function(e) {
123
    $( "#resultst" ).on("click", ".import_record", function(e) {
84
        e.preventDefault();
124
        e.preventDefault();
85
        var data_breedingid = $( this ).data( "breedingid" );
125
        var data_breedingid = $( this ).data( "breedingid" );
86
        var data_headingcode = $( this ).data( "heading_code" );
126
        var data_headingcode = $( this ).data( "heading_code" );
87
- 

Return to bug 25702