Browse Source

Bug 8215 - Add Course Reserves - QA Followup

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
new/bootstrap-opac
Kyle Hall 10 years ago
committed by Galen Charlton
parent
commit
1940d4871c
  1. 5
      course_reserves/add_items.pl
  2. 5
      course_reserves/course-details.pl
  3. 2
      course_reserves/course-reserves.pl
  4. 2
      course_reserves/course.pl
  5. 4
      koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js
  6. 10
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt
  7. 9
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt
  8. 1
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt
  9. 24
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/invalid-course.tt

5
course_reserves/add_items.pl

@ -36,15 +36,14 @@ my $action = $cgi->param('action') || '';
my $course_id = $cgi->param('course_id') || '';
my $barcode = $cgi->param('barcode') || '';
die('No course_id provided') unless ($course_id);
my $item = GetBiblioFromItemNumber( undef, $barcode );
my $step = ( $action eq 'lookup' && $item ) ? '2' : '1';
my $tmpl = ( $course_id ) ? "add_items-step$step.tt" : "invalid-course.tt";
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "course_reserves/add_items-step$step.tmpl",
template_name => "course_reserves/$tmpl",
query => $cgi,
type => "intranet",
authnotrequired => 0,

5
course_reserves/course-details.pl

@ -36,9 +36,10 @@ my $course_id = $cgi->param('course_id');
my $flagsrequired;
$flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' );
my $tmpl = ( $course_id ) ? "course-details.tt" : "invalid-course.tt";
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "course_reserves/course-details.tmpl",
template_name => "course_reserves/$tmpl",
query => $cgi,
type => "intranet",
authnotrequired => 0,
@ -46,8 +47,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
}
);
die("No course_id given") unless ($course_id);
if ( $action eq 'del_reserve' ) {
DelCourseReserve( cr_id => $cgi->param('cr_id') );
}

2
course_reserves/course-reserves.pl

@ -35,7 +35,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
query => $cgi,
type => "intranet",
authnotrequired => 0,
flagsrequired => {},
flagsrequired => { coursereserves => '*' },
}
);

2
course_reserves/course.pl

@ -32,7 +32,7 @@ my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "course_reserves/course.tmpl",
template_name => "course_reserves/course.tt",
query => $cgi,
type => "intranet",
authnotrequired => 0,

4
koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js

@ -14,6 +14,10 @@ function _(s) { return s; } // dummy function for gettext
$(".focus").focus();
$(".validated").validate();
$('.noEnterSubmit').keypress(function(e){
if ( e.which == 13 ) return false;
});
});
// http://jennifermadden.com/javascript/stringEnterKeyDetector.html

10
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt

@ -31,10 +31,6 @@
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
addItemsButton = new YAHOO.widget.Button("add_items");
editCourseButton = new YAHOO.widget.Button("edit_course");
deleteCourseButton = new YAHOO.widget.Button("delete_course");
deleteCourseButton.on("click", confirmDelete );
});
@ -47,9 +43,9 @@
//]]>
</script>
<ul class="toolbar">
[% 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 %]
[% 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 %]
[% 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 %]
[% 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 %]
[% 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 %]
[% 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 %]
</ul>
</div><!-- /toolbar -->

9
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt

@ -33,16 +33,9 @@
<div class="yui-g">
<div id="toolbar">
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
newCourseButton = new YAHOO.widget.Button("new_course");
});
//]]>
</script>
<ul class="toolbar">
[% IF ( CAN_user_coursereserves_manage_courses ) %]
<li><a id="new_course" href="/cgi-bin/koha/course_reserves/course.pl">New course</a></li>
<li><a class="btn" id="new_course" href="/cgi-bin/koha/course_reserves/course.pl">New course</a></li>
[% END %]
</ul>
</div><!-- /toolbar -->

1
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt

@ -141,7 +141,6 @@ function RemoveInstructor( cardnumber ) {
[% END %]
</li>
<!-- TODO: Add Instructors -->
<li>
<label for="instructors">Instructors:</label>

24
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/invalid-course.tt

@ -0,0 +1,24 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Course reserves</title>
[% INCLUDE 'doc-head-close.inc' %]
<body id="lists_shelves" class="lists">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<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>
<div id="doc2" class="yui-t7">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g">
<p>Invalid course!</p>
</div>
</div>
</div>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]
Loading…
Cancel
Save