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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt (-40 / +40 lines)
Lines 1-51 Link Here
1
[% USE AuthorisedValues %]
1
[% USE AuthorisedValues %]
2
[% USE ItemTypes %]
2
[% USE ItemTypes %]
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; Course reserves &rsaquo; Course details for [% course.course_name %]</title>
6
<title>Koha &rsaquo; Course reserves &rsaquo; Course details for [% course.course_name %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
7
8
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
[% INCLUDE 'datatables.inc' %]
10
<script type="text/javascript">
11
//<![CDATA[
12
    $(document).ready(function(){
13
        $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, {
14
            "sPaginationType": "four_button",
15
            "aoColumnDefs": [
16
                { 'bSortable': false, 'aTargets': [ 'NoSort' ] },
17
                { 'sType': "anti-the", 'aTargets' : [ 'antithe'] }
18
            ]
19
        }));
20
21
        $(".delete_item").click(function(){
22
            return confirmDelete(_("Are you sure you want to remove this item from the course?"));
23
        });
24
25
        $("#delete_course").click(function(){
26
            [% SET count = course_reserves.size %]
27
            [% IF count == 1 %]
28
                return confirmDelete(_("Are you sure you want to delete this course? There is [% count %] attached item.") );
29
            [% ELSIF count > 1 %]
30
                return confirmDelete(_("Are you sure you want to delete this course? There are [% count %] attached items.") );
31
            [% ELSE %]
32
                return confirmDelete(_("Are you sure you want to delete this course?"));
33
            [% END %]
34
        });
35
        $(".disabled").tooltip().on("click", function(e){
36
            e.preventDefault();
37
            if( $(this).hasClass("checkedout") ){
38
                alert(_("This item cannot be removed. It is checked out"));
39
            }
40
            if( $(this).hasClass("itemlost") ) {
41
                alert(_("This item cannot be removed. It is lost"));
42
            }
43
        });
44
    });
45
46
//]]>
47
</script>
48
49
</head>
10
</head>
50
11
51
<body id="courses_course_details" class="course">
12
<body id="courses_course_details" class="course">
Lines 233-236 Link Here
233
        </div>
194
        </div>
234
    </div>
195
    </div>
235
196
197
[% MACRO jsinclude BLOCK %]
198
    [% INCLUDE 'datatables.inc' %]
199
    <script type="text/javascript">
200
        $(document).ready(function(){
201
            $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, {
202
                "sPaginationType": "four_button",
203
                "aoColumnDefs": [
204
                    { 'bSortable': false, 'aTargets': [ 'NoSort' ] },
205
                    { 'sType': "anti-the", 'aTargets' : [ 'antithe'] }
206
                ]
207
            }));
208
209
            $(".delete_item").click(function(){
210
                return confirmDelete(_("Are you sure you want to remove this item from the course?"));
211
            });
212
213
            $("#delete_course").click(function(){
214
                [% SET count = course_reserves.size %]
215
                [% IF count == 1 %]
216
                    return confirmDelete(_("Are you sure you want to delete this course? There is [% count %] attached item.") );
217
                [% ELSIF count > 1 %]
218
                    return confirmDelete(_("Are you sure you want to delete this course? There are [% count %] attached items.") );
219
                [% ELSE %]
220
                    return confirmDelete(_("Are you sure you want to delete this course?"));
221
                [% END %]
222
            });
223
            $(".disabled").tooltip().on("click", function(e){
224
                e.preventDefault();
225
                if( $(this).hasClass("checkedout") ){
226
                    alert(_("This item cannot be removed. It is checked out"));
227
                }
228
                if( $(this).hasClass("itemlost") ) {
229
                    alert(_("This item cannot be removed. It is lost"));
230
                }
231
            });
232
        });
233
    </script>
234
[% END %]
235
236
[% INCLUDE 'intranet-bottom.inc' %]
236
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt (-9 / +12 lines)
Lines 1-19 Link Here
1
[% USE AuthorisedValues %]
1
[% USE AuthorisedValues %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Course reserves</title>
4
<title>Koha &rsaquo; Course reserves</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
6
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" id="js">
9
$(document).ready(function() {
10
    $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, {
11
        "sPaginationType": "four_button"
12
    }));
13
});
14
</script>
15
16
</head>
8
</head>
9
17
<body id="courses_course_reserves" class="course">
10
<body id="courses_course_reserves" class="course">
18
11
19
[% INCLUDE 'header.inc' %]
12
[% INCLUDE 'header.inc' %]
Lines 106-110 $(document).ready(function() { Link Here
106
    </div>
99
    </div>
107
</div>
100
</div>
108
101
102
[% MACRO jsinclude BLOCK %]
103
    [% INCLUDE 'datatables.inc' %]
104
    <script type="text/javascript" id="js">
105
        $(document).ready(function() {
106
            $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, {
107
                "sPaginationType": "four_button"
108
            }));
109
        });
110
    </script>
111
[% END %]
109
112
110
[% INCLUDE 'intranet-bottom.inc' %]
113
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt (-55 / +51 lines)
Lines 1-60 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Course reserves &rsaquo; [% IF course_name %] Edit [% course_name %] [% ELSE %] New course [% END %]</title>
3
<title>Koha &rsaquo; Course reserves &rsaquo; [% IF course_name %] Edit [% course_name %] [% ELSE %] New course [% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
5
[% IF ( departments ) %]
6
7
    <script type="text/javascript">
8
    //<![CDATA[
9
    $(document).ready(function(){
10
        $( "#find_instructor" ).autocomplete({
11
            source: "/cgi-bin/koha/circ/ysearch.pl",
12
            minLength: 3,
13
            select: function( event, ui ) {
14
                AddInstructor( ui.item.surname + ", " + ui.item.firstname, ui.item.cardnumber );
15
                return false;
16
            }
17
        })
18
        .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
19
            return $( "<li></li>" )
20
            .data( "ui-autocomplete-item", item )
21
            .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
22
            .appendTo( ul );
23
        };
24
25
        if ( ! $('#instructors').html() ) {
26
            $('#course_instructors').hide();
27
        }
28
29
        $("body").on("click",".removeInstructor",function(e){
30
            e.preventDefault();
31
            var divid = $(this).parent().attr("id");
32
            var cardnumber = divid.replace("borrower_","");
33
            RemoveInstructor(cardnumber);
34
        });
35
    });
36
37
    function AddInstructor( name, cardnumber ) {
38
        div = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='#' class='removeInstructor'> " + _("Remove")+ " </a> ) <input type='hidden' name='instructors' value='" + cardnumber + "' /></div>";
39
        $('#instructors').append( div );
40
41
        $('#find_instructor').val('').focus();
42
        $('#course_instructors').show();
43
    }
44
45
    function RemoveInstructor( cardnumber ) {
46
        $( '#borrower_' + cardnumber ).remove();
47
48
        if ( ! $('#instructors').html() ) {
49
            $('#course_instructors').hide( 800 );
50
        }
51
    }
52
53
    //]]>
54
    </script>
55
56
[% END %]
57
58
</head>
5
</head>
59
6
60
<body id="courses_course" class="course">
7
<body id="courses_course" class="course">
Lines 188-191 Link Here
188
135
189
[% END %]
136
[% END %]
190
137
138
[% IF ( departments ) %]
139
    [% MACRO jsinclude BLOCK %]
140
        <script type="text/javascript">
141
            $(document).ready(function(){
142
                $( "#find_instructor" ).autocomplete({
143
                    source: "/cgi-bin/koha/circ/ysearch.pl",
144
                    minLength: 3,
145
                    select: function( event, ui ) {
146
                        AddInstructor( ui.item.surname + ", " + ui.item.firstname, ui.item.cardnumber );
147
                        return false;
148
                    }
149
                })
150
                .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
151
                    return $( "<li></li>" )
152
                    .data( "ui-autocomplete-item", item )
153
                    .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
154
                    .appendTo( ul );
155
                };
156
157
                if ( ! $('#instructors').html() ) {
158
                    $('#course_instructors').hide();
159
                }
160
161
                $("body").on("click",".removeInstructor",function(e){
162
                    e.preventDefault();
163
                    var divid = $(this).parent().attr("id");
164
                    var cardnumber = divid.replace("borrower_","");
165
                    RemoveInstructor(cardnumber);
166
                });
167
            });
168
169
            function AddInstructor( name, cardnumber ) {
170
                div = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='#' class='removeInstructor'> " + _("Remove")+ " </a> ) <input type='hidden' name='instructors' value='" + cardnumber + "' /></div>";
171
                $('#instructors').append( div );
172
173
                $('#find_instructor').val('').focus();
174
                $('#course_instructors').show();
175
            }
176
177
            function RemoveInstructor( cardnumber ) {
178
                $( '#borrower_' + cardnumber ).remove();
179
180
                if ( ! $('#instructors').html() ) {
181
                    $('#course_instructors').hide( 800 );
182
                }
183
            }
184
        </script>
185
    [% END %]
186
[% END %]
187
191
[% INCLUDE 'intranet-bottom.inc' %]
188
[% INCLUDE 'intranet-bottom.inc' %]
192
- 

Return to bug 19628