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

(-)a/course_reserves/add_items.pl (-3 / +2 lines)
Lines 36-50 my $action = $cgi->param('action') || ''; Link Here
36
my $course_id = $cgi->param('course_id') || '';
36
my $course_id = $cgi->param('course_id') || '';
37
my $barcode   = $cgi->param('barcode')   || '';
37
my $barcode   = $cgi->param('barcode')   || '';
38
38
39
die('No course_id provided') unless ($course_id);
40
41
my $item = GetBiblioFromItemNumber( undef, $barcode );
39
my $item = GetBiblioFromItemNumber( undef, $barcode );
42
40
43
my $step = ( $action eq 'lookup' && $item ) ? '2' : '1';
41
my $step = ( $action eq 'lookup' && $item ) ? '2' : '1';
44
42
43
my $tmpl = ( $course_id ) ? "add_items-step$step.tt" : "invalid-course.tt";
45
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
44
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
46
    {
45
    {
47
        template_name   => "course_reserves/add_items-step$step.tmpl",
46
        template_name   => "course_reserves/$tmpl",
48
        query           => $cgi,
47
        query           => $cgi,
49
        type            => "intranet",
48
        type            => "intranet",
50
        authnotrequired => 0,
49
        authnotrequired => 0,
(-)a/course_reserves/course-details.pl (-3 / +2 lines)
Lines 36-44 my $course_id = $cgi->param('course_id'); Link Here
36
my $flagsrequired;
36
my $flagsrequired;
37
$flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' );
37
$flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' );
38
38
39
my $tmpl = ( $course_id ) ? "course-details.tt" : "invalid-course.tt";
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
    {
41
    {
41
        template_name   => "course_reserves/course-details.tmpl",
42
        template_name   => "course_reserves/$tmpl",
42
        query           => $cgi,
43
        query           => $cgi,
43
        type            => "intranet",
44
        type            => "intranet",
44
        authnotrequired => 0,
45
        authnotrequired => 0,
Lines 46-53 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
46
    }
47
    }
47
);
48
);
48
49
49
die("No course_id given") unless ($course_id);
50
51
if ( $action eq 'del_reserve' ) {
50
if ( $action eq 'del_reserve' ) {
52
    DelCourseReserve( cr_id => $cgi->param('cr_id') );
51
    DelCourseReserve( cr_id => $cgi->param('cr_id') );
53
}
52
}
(-)a/course_reserves/course-reserves.pl (-1 / +1 lines)
Lines 35-41 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
35
        query           => $cgi,
35
        query           => $cgi,
36
        type            => "intranet",
36
        type            => "intranet",
37
        authnotrequired => 0,
37
        authnotrequired => 0,
38
        flagsrequired   => {},
38
        flagsrequired   => { coursereserves => '*' },
39
    }
39
    }
40
);
40
);
41
41
(-)a/course_reserves/course.pl (-1 / +1 lines)
Lines 32-38 my $cgi = new CGI; Link Here
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {
34
    {
35
        template_name   => "course_reserves/course.tmpl",
35
        template_name   => "course_reserves/course.tt",
36
        query           => $cgi,
36
        query           => $cgi,
37
        type            => "intranet",
37
        type            => "intranet",
38
        authnotrequired => 0,
38
        authnotrequired => 0,
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js (+4 lines)
Lines 14-19 function _(s) { return s; } // dummy function for gettext Link Here
14
14
15
    $(".focus").focus();
15
    $(".focus").focus();
16
    $(".validated").validate();
16
    $(".validated").validate();
17
18
    $('.noEnterSubmit').keypress(function(e){
19
        if ( e.which == 13 ) return false;
20
    });
17
});
21
});
18
22
19
// http://jennifermadden.com/javascript/stringEnterKeyDetector.html
23
// http://jennifermadden.com/javascript/stringEnterKeyDetector.html
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt (-7 / +3 lines)
Lines 31-40 Link Here
31
                <script type="text/javascript">
31
                <script type="text/javascript">
32
                //<![CDATA[
32
                //<![CDATA[
33
                    $(document).ready(function(){
33
                    $(document).ready(function(){
34
                        addItemsButton     = new YAHOO.widget.Button("add_items");
35
                        editCourseButton   = new YAHOO.widget.Button("edit_course");
36
                        deleteCourseButton = new YAHOO.widget.Button("delete_course");
37
38
                        deleteCourseButton.on("click", confirmDelete );
34
                        deleteCourseButton.on("click", confirmDelete );
39
                    });
35
                    });
40
36
Lines 47-55 Link Here
47
                //]]>
43
                //]]>
48
                </script>
44
                </script>
49
                <ul class="toolbar">
45
                <ul class="toolbar">
50
                    [% IF CAN_user_coursereserves_add_reserves %]<li><a id="add_items" href="/cgi-bin/koha/course_reserves/add_items.pl?course_id=[% course.course_id %]">Add reserves</a></li>[% END %]
46
                    [% IF CAN_user_coursereserves_add_reserves %]<li><a class="btn" id="add_items" href="/cgi-bin/koha/course_reserves/add_items.pl?course_id=[% course.course_id %]">Add reserves</a></li>[% END %]
51
                    [% IF ( CAN_user_coursereserves_manage_courses ) %]<li><a id="edit_course" href="/cgi-bin/koha/course_reserves/course.pl?course_id=[% course.course_id %]">Edit course</a></li>[% END %]
47
                    [% IF ( CAN_user_coursereserves_manage_courses ) %]<li><a class="btn" id="edit_course" href="/cgi-bin/koha/course_reserves/course.pl?course_id=[% course.course_id %]">Edit course</a></li>[% END %]
52
                    [% IF ( CAN_user_coursereserves_manage_courses ) %]<li><a id="delete_course" href="/cgi-bin/koha/course_reserves/mod_course.pl?course_id=[% course.course_id %]&action=del">Delete course</a></li>[% END %]
48
                    [% IF ( CAN_user_coursereserves_manage_courses ) %]<li><a class="btn" id="delete_course" href="/cgi-bin/koha/course_reserves/mod_course.pl?course_id=[% course.course_id %]&action=del">Delete course</a></li>[% END %]
53
                </ul>
49
                </ul>
54
            </div><!-- /toolbar -->
50
            </div><!-- /toolbar -->
55
51
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt (-8 / +1 lines)
Lines 33-48 Link Here
33
                <div class="yui-g">
33
                <div class="yui-g">
34
34
35
                    <div id="toolbar">
35
                    <div id="toolbar">
36
                        <script type="text/javascript">
37
                        //<![CDATA[
38
                            $(document).ready(function(){
39
                                newCourseButton = new YAHOO.widget.Button("new_course");
40
                            });
41
                        //]]>
42
                        </script>
43
                        <ul class="toolbar">
36
                        <ul class="toolbar">
44
                            [% IF ( CAN_user_coursereserves_manage_courses ) %]
37
                            [% IF ( CAN_user_coursereserves_manage_courses ) %]
45
                            <li><a id="new_course" href="/cgi-bin/koha/course_reserves/course.pl">New course</a></li>
38
                            <li><a class="btn" id="new_course" href="/cgi-bin/koha/course_reserves/course.pl">New course</a></li>
46
                            [% END %]
39
                            [% END %]
47
                        </ul>
40
                        </ul>
48
                    </div><!-- /toolbar -->
41
                    </div><!-- /toolbar -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt (-1 lines)
Lines 141-147 function RemoveInstructor( cardnumber ) { Link Here
141
                                        [% END %]
141
                                        [% END %]
142
                                    </li>
142
                                    </li>
143
143
144
                                    <!-- TODO: Add Instructors -->
145
                                    <li>
144
                                    <li>
146
                                        <label for="instructors">Instructors:</label>
145
                                        <label for="instructors">Instructors:</label>
147
146
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/invalid-course.tt (-1 / +24 lines)
Line 0 Link Here
0
- 
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Course reserves</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
<body id="lists_shelves" class="lists">
5
6
[% INCLUDE 'header.inc' %]
7
[% INCLUDE 'cat-search.inc' %]
8
9
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a></div>
10
11
<div id="doc2" class="yui-t7">
12
    <div id="bd">
13
        <div id="yui-main">
14
            <div class="yui-b">
15
                <div class="yui-g">
16
                    <p>Invalid course!</p>
17
                </div>
18
            </div>
19
        </div>
20
    </div>
21
</div>
22
23
24
[% INCLUDE 'intranet-bottom.inc' %]

Return to bug 8215