Browse Source

Bug 8215 - Course Reserves

Adds a course reserves system for academic libraries.

The course reserves system allows libraries to create courses
and put items on reserves for those courses.

Each item with at least one reserve can have some of its attributes
modified while it is on reserve for at least one active course.
These attributes include item type, collection code, shelving location,
and holding library. If there are no active courses with this item
on reserve, it's attributes will revert to the original attributes
it had before going on reserve.

Test Plan:
  1) Create new authorised value categories DEPARTMENT and TERM
  2) Create a new course, add instructors to that course.
  3) Reserve items for that course, verify item attributes have changed.
  4) Disable course, verify item attributes have reverted.
  5) Enable course again, verify item attributes again.
  6) Delete course, verify item attributes again.
  7) Create two new courses, add the same item(s) to both courses.
  8) Disable one course, verify item attributes have not reverted.
  9) Disable both courses, verify item attributes have reverted.
 10) Enable one course, verify item attributes are again set to the
     new values.
 11) Edit reserve item attributes, verify.
 12) Disable all courses, edit reserve item attributes, verify
     the item itself still has its original attributes, verify
     the reserve item attributes have been updated.
 13) Verify the ability to remove instructors from a course.
 14) Verify new permissions, top level coursereserves, with
     subpermissions add_reserves and delete_reserves.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Corinne Bulac <corinne.hayet@bulac.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

http://bugs.koha-community.org/show_bug.cgi?id=8125
new/bootstrap-opac
Kyle Hall 11 years ago
committed by Galen Charlton
parent
commit
be869ab279
  1. 2
      C4/Auth.pm
  2. 1122
      C4/CourseReserves.pm
  3. 22
      C4/Koha.pm
  4. 34
      Koha/Template/Plugin/AuthorisedValues.pm
  5. 37
      Koha/Template/Plugin/Branches.pm
  6. 38
      Koha/Template/Plugin/ItemTypes.pm
  7. 1
      Makefile.PL
  8. 2
      admin/authorised_values.pl
  9. 5
      catalogue/detail.pl
  10. 97
      course_reserves/add_items.pl
  11. 67
      course_reserves/course-details.pl
  12. 54
      course_reserves/course-reserves.pl
  13. 55
      course_reserves/course.pl
  14. 72
      course_reserves/mod_course.pl
  15. 1
      installer/data/mysql/de-DE/mandatory/userflags.sql
  16. 3
      installer/data/mysql/de-DE/mandatory/userpermissions.sql
  17. 3
      installer/data/mysql/en/mandatory/userflags.sql
  18. 3
      installer/data/mysql/en/mandatory/userpermissions.sql
  19. 1
      installer/data/mysql/es-ES/mandatory/userflags.sql
  20. 3
      installer/data/mysql/es-ES/mandatory/userpermissions.sql
  21. 1
      installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql
  22. 4
      installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql
  23. 3
      installer/data/mysql/it-IT/necessari/userflags.sql
  24. 3
      installer/data/mysql/it-IT/necessari/userpermissions.sql
  25. 102
      installer/data/mysql/kohastructure.sql
  26. 1
      installer/data/mysql/nb-NO/1-Obligatorisk/userflags.sql
  27. 3
      installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql
  28. 1
      installer/data/mysql/pl-PL/mandatory/userflags.sql
  29. 3
      installer/data/mysql/pl-PL/mandatory/userpermissions.sql
  30. 4
      installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql
  31. 1
      installer/data/mysql/sysprefs.sql
  32. 4
      installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql
  33. 91
      installer/data/mysql/updatedatabase.pl
  34. 2
      koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
  35. 3
      koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
  36. 7
      koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js
  37. 7
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
  38. 34
      koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
  39. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
  40. 63
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt
  41. 133
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt
  42. 185
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt
  43. 119
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt
  44. 205
      koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt
  45. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt
  46. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt
  47. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
  48. 1
      koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc
  49. 1
      koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
  50. 63
      koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt
  51. 62
      koha-tmpl/opac-tmpl/prog/en/modules/opac-course-reserves.tt
  52. 31
      koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
  53. 60
      opac/opac-course-details.pl
  54. 51
      opac/opac-course-reserves.pl
  55. 7
      opac/opac-detail.pl
  56. 88
      t/db_dependent/CourseReserves.t

2
C4/Auth.pm

@ -203,6 +203,7 @@ sub get_template_and_user {
$template->param( CAN_user_reports => 1 );
$template->param( CAN_user_staffaccess => 1 );
$template->param( CAN_user_plugins => 1 );
$template->param( CAN_user_coursereserves => 1 );
foreach my $module (keys %$all_perms) {
foreach my $subperm (keys %{ $all_perms->{$module} }) {
$template->param( "CAN_user_${module}_${subperm}" => 1 );
@ -327,6 +328,7 @@ sub get_template_and_user {
noItemTypeImages => C4::Context->preference("noItemTypeImages"),
marcflavour => C4::Context->preference("marcflavour"),
persona => C4::Context->preference("persona"),
UseCourseReserves => C4::Context->preference("UseCourseReserves"),
);
if ( $in->{'type'} eq "intranet" ) {
$template->param(

1122
C4/CourseReserves.pm

File diff suppressed because it is too large

22
C4/Koha.pm

@ -206,10 +206,15 @@ sub GetSupportList{
}
=head2 GetItemTypes
$itemtypes = &GetItemTypes();
$itemtypes = &GetItemTypes( style => $style );
Returns information about existing itemtypes.
Params:
style: either 'array' or 'hash', defaults to 'hash'.
'array' returns an arrayref,
'hash' return a hashref with the itemtype value as the key
build a HTML select with the following code :
=head3 in PERL SCRIPT
@ -242,6 +247,8 @@ build a HTML select with the following code :
=cut
sub GetItemTypes {
my ( %params ) = @_;
my $style = defined( $params{'style'} ) ? $params{'style'} : 'hash';
# returns a reference to a hash of references to itemtypes...
my %itemtypes;
@ -252,10 +259,15 @@ sub GetItemTypes {
|;
my $sth = $dbh->prepare($query);
$sth->execute;
while ( my $IT = $sth->fetchrow_hashref ) {
$itemtypes{ $IT->{'itemtype'} } = $IT;
if ( $style eq 'hash' ) {
while ( my $IT = $sth->fetchrow_hashref ) {
$itemtypes{ $IT->{'itemtype'} } = $IT;
}
return ( \%itemtypes );
} else {
return $sth->fetchall_arrayref({});
}
return ( \%itemtypes );
}
sub get_itemtypeinfos_of {
@ -1130,7 +1142,7 @@ sub IsAuthorisedValueCategory {
=head2 GetAuthorisedValueByCode
$authhorised_value = GetAuthorisedValueByCode( $category, $authvalcode );
$authorised_value = GetAuthorisedValueByCode( $category, $authvalcode, $opac );
Return the lib attribute from authorised_values from the row identified
by the passed category and code

34
Koha/Template/Plugin/AuthorisedValues.pm

@ -0,0 +1,34 @@
package Koha::Template::Plugin::AuthorisedValues;
# Copyright ByWater Solutions 2012
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use Template::Plugin;
use base qw( Template::Plugin );
use Encode qw{encode decode};
use C4::Koha;
sub GetByCode {
my ( $self, $category, $code, $opac ) = @_;
return encode('UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) );
}
1;

37
Koha/Template/Plugin/Branches.pm

@ -0,0 +1,37 @@
package Koha::Template::Plugin::Branches;
# Copyright ByWater Solutions 2012
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use Template::Plugin;
use base qw( Template::Plugin );
use C4::Koha;
sub GetName {
my ( $self, $branchcode ) = @_;
my $query = "SELECT branchname FROM branches WHERE branchcode = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($branchcode);
my $b = $sth->fetchrow_hashref();
return $b->{'branchname'};
}
1;

38
Koha/Template/Plugin/ItemTypes.pm

@ -0,0 +1,38 @@
package Koha::Template::Plugin::ItemTypes;
# Copyright ByWater Solutions 2012
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use Template::Plugin;
use base qw( Template::Plugin );
use C4::Koha;
sub GetDescription {
my ( $self, $itemtype ) = @_;
my $query = "SELECT description FROM itemtypes WHERE itemtype = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($itemtype);
my $d = $sth->fetchrow_hashref();
return $d->{'description'};
}
1;

1
Makefile.PL

@ -265,6 +265,7 @@ my $target_map = {
'./changelanguage.pl' => 'INTRANET_CGI_DIR',
'./check_sysprefs.pl' => 'NONE',
'./circ' => 'INTRANET_CGI_DIR',
'./course_reserves' => 'INTRANET_CGI_DIR',
'./offline_circ' => 'INTRANET_CGI_DIR',
'./edithelp.pl' => 'INTRANET_CGI_DIR',
'./etc' => { target => 'KOHA_CONF_DIR', trimdir => -1 },

2
admin/authorised_values.pl

@ -247,7 +247,7 @@ sub default_form {
}
# push koha system categories
foreach (qw(Asort1 Asort2 Bsort1 Bsort2 SUGGEST DAMAGED LOST REPORT_GROUP REPORT_SUBGROUP)) {
foreach (qw(Asort1 Asort2 Bsort1 Bsort2 SUGGEST DAMAGED LOST REPORT_GROUP REPORT_SUBGROUP DEPARTMENT TERM)) {
push @category_list, $_ unless $categories{$_};
}

5
catalogue/detail.pl

@ -41,6 +41,7 @@ use C4::XSLT;
use C4::Images;
use Koha::DateUtils;
use C4::HTML5Media;
use C4::CourseReserves;
# use Smart::Comments;
@ -269,6 +270,10 @@ foreach my $item (@items) {
$materials_flag = 1;
}
if ( C4::Context->preference('UseCourseReserves') ) {
$item->{'course_reserves'} = GetItemReservesInfo( itemnumber => $item->{'itemnumber'} );
}
if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
and C4::Context->preference('SeparateHoldings')) {
if ($itembranchcode and $itembranchcode eq $currentbranch) {

97
course_reserves/add_items.pl

@ -0,0 +1,97 @@
#!/usr/bin/perl
#
# Copyright 2012 Bywater Solutions
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Koha;
use C4::Biblio;
use C4::Branch;
use C4::CourseReserves;
my $cgi = new CGI;
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 ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "course_reserves/add_items-step$step.tmpl",
query => $cgi,
type => "intranet",
authnotrequired => 0,
flagsrequired => { coursereserves => 'add_reserves' },
}
);
$template->param( ERROR_BARCODE_NOT_FOUND => $barcode )
unless ( $barcode && $item && $action eq 'lookup' );
$template->param( course => GetCourse($course_id) );
if ( $action eq 'lookup' ) {
my $course_item = GetCourseItem( itemnumber => $item->{'itemnumber'} );
my $course_reserve = ($course_item)
? GetCourseReserve(
course_id => $course_id,
ci_id => $course_item->{'ci_id'}
)
: undef;
$template->param(
item => $item,
course_item => $course_item,
course_reserve => $course_reserve,
ccodes => GetAuthorisedValues('CCODE'),
locations => GetAuthorisedValues('LOC'),
itypes => GetItemTypes( style => 'array' ),
branches => GetBranchesLoop(),
);
}
elsif ( $action eq 'add' ) {
my $ci_id = ModCourseItem(
itemnumber => $cgi->param('itemnumber'),
itype => $cgi->param('itype'),
ccode => $cgi->param('ccode'),
holdingbranch => $cgi->param('holdingbranch'),
location => $cgi->param('location'),
);
my $cr_id = ModCourseReserve(
course_id => $course_id,
ci_id => $ci_id,
staff_note => $cgi->param('staff_note'),
public_note => $cgi->param('public_note'),
);
}
output_html_with_http_headers $cgi, $cookie, $template->output;

67
course_reserves/course-details.pl

@ -0,0 +1,67 @@
#!/usr/bin/perl
#
# Copyright 2012 Bywater Solutions
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Koha;
use C4::CourseReserves;
my $cgi = new CGI;
my $action = $cgi->param('action') || '';
my $course_id = $cgi->param('course_id');
my $flagsrequired;
$flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' );
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "course_reserves/course-details.tmpl",
query => $cgi,
type => "intranet",
authnotrequired => 0,
flagsrequired => $flagsrequired,
}
);
die("No course_id given") unless ($course_id);
if ( $action eq 'del_reserve' ) {
DelCourseReserve( cr_id => $cgi->param('cr_id') );
}
my $course = GetCourse($course_id);
my $course_reserves = GetCourseReserves(
course_id => $course_id,
include_items => 1,
include_courses => 1
);
$template->param(
course => $course,
course_reserves => $course_reserves,
);
output_html_with_http_headers $cgi, $cookie, $template->output;

54
course_reserves/course-reserves.pl

@ -0,0 +1,54 @@
#!/usr/bin/perl
#
# Copyright 2012 Bywater Solutions
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use CGI;
use C4::Auth;
use C4::Output;
use C4::CourseReserves;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "course_reserves/course-reserves.tmpl",
query => $cgi,
type => "intranet",
authnotrequired => 0,
flagsrequired => {},
}
);
my $search_on = $cgi->param('search_on');
my %params;
if ($search_on) {
$params{'course_name'} = "%$search_on%";
}
my $courses = GetCourses(%params);
if ( $search_on && @$courses == 1 ) {
print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=" . $courses->[0]->{'course_id'});
} else {
$template->param( courses => $courses );
output_html_with_http_headers $cgi, $cookie, $template->output;
}

55
course_reserves/course.pl

@ -0,0 +1,55 @@
#!/usr/bin/perl
#
# Copyright 2012 Bywater Solutions
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Koha;
use C4::CourseReserves;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "course_reserves/course.tmpl",
query => $cgi,
type => "intranet",
authnotrequired => 0,
flagsrequired => { coursereserves => 'manage_courses' },
}
);
my $course_id = $cgi->param('course_id');
if ($course_id) {
my $course = GetCourse($course_id);
$template->param(%$course);
}
$template->param(
departments => GetAuthorisedValues('DEPARTMENT'),
terms => GetAuthorisedValues('TERM'),
);
output_html_with_http_headers $cgi, $cookie, $template->output;

72
course_reserves/mod_course.pl

@ -0,0 +1,72 @@
#!/usr/bin/perl
# Copyright 2012 ByWater Solutions
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use CGI;
use C4::Output;
use C4::Reserves;
use C4::Auth;
use C4::CourseReserves;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "about.tmpl",
query => $cgi,
type => "intranet",
authnotrequired => 0,
flagsrequired => { coursereserves => 'manage_courses' },
}
);
my $action = $cgi->param('action');
if ( $action eq 'del' ) {
DelCourse( $cgi->param('course_id') );
print $cgi->redirect("/cgi-bin/koha/course_reserves/course-reserves.pl");
}
else {
my %params;
$params{'course_id'} = $cgi->param('course_id')
if ( $cgi->param('course_id') );
$params{'department'} = $cgi->param('department');
$params{'course_number'} = $cgi->param('course_number');
$params{'section'} = $cgi->param('section');
$params{'course_name'} = $cgi->param('course_name');
$params{'term'} = $cgi->param('term');
$params{'staff_note'} = $cgi->param('staff_note');
$params{'public_note'} = $cgi->param('public_note');
$params{'students_count'} = $cgi->param('students_count');
$params{'enabled'} = ( $cgi->param('enabled') eq 'on' ) ? 'yes' : 'no';
my $course_id = ModCourse(%params);
my @instructors = $cgi->param('instructors');
ModCourseInstructors(
mode => 'replace',
cardnumbers => \@instructors,
course_id => $course_id
);
print $cgi->redirect(
"/cgi-bin/koha/course_reserves/course-details.pl?course_id=$course_id");
}

1
installer/data/mysql/de-DE/mandatory/userflags.sql

@ -15,4 +15,5 @@ INSERT INTO `userflags` VALUES(14,'editauthorities','Normdaten ändern',0);
INSERT INTO `userflags` VALUES(15,'serials','Zugriff auf Abonnementverwaltung/Zeitschriftenmodul',0);
INSERT INTO `userflags` VALUES(16,'reports','Zugriff auf Reportmodul',0);
INSERT INTO `userflags` VALUES(17,'staffaccess','Berechtigungen/Logins für Bibliotheksmitarbeiter vergeben',0);
INSERT INTO `userflags` VALUES(18,'coursereserves','Course Reserves',0);
INSERT INTO `userflags` VALUES(19,'plugins', 'Koha Plugins', '0');

3
installer/data/mysql/de-DE/mandatory/userpermissions.sql

@ -53,6 +53,9 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Umlauflisten verwalten'),
(16, 'execute_reports', 'SQL-Reports ausführen'),
(16, 'create_reports', 'SQL-Reports erstellen'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Plugins verwealten (installieren/deinstallieren)'),
(19, 'tool', 'Werkzeug-Plugins verwenden'),
(19, 'report', 'Report-Plugins verwenden'),

3
installer/data/mysql/en/mandatory/userflags.sql

@ -15,4 +15,5 @@ INSERT INTO `userflags` VALUES(14,'editauthorities','Edit Authorities',0);
INSERT INTO `userflags` VALUES(15,'serials','Manage serial subscriptions',0);
INSERT INTO `userflags` VALUES(16,'reports','Allow access to the reports module',0);
INSERT INTO `userflags` VALUES(17,'staffaccess','Allow staff members to modify permissions for other staff members',0);
INSERT INTO `userflags` VALUES(19, 'plugins', 'Koha plugins', '0');
INSERT INTO `userflags` VALUES(18,'coursereserves','Course Reserves',0);
INSERT INTO `userflags` VALUES(19, 'plugins', 'Koha plugins', '0');

3
installer/data/mysql/en/mandatory/userpermissions.sql

@ -53,6 +53,9 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Routing'),
(16, 'execute_reports', 'Execute SQL reports'),
(16, 'create_reports', 'Create SQL Reports'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Manage plugins ( install / uninstall )'),
(19, 'tool', 'Use tool plugins'),
(19, 'report', 'Use report plugins'),

1
installer/data/mysql/es-ES/mandatory/userflags.sql

@ -15,4 +15,5 @@ INSERT INTO `userflags` VALUES(14,'editauthorities','Allow to edit authorities',
INSERT INTO `userflags` VALUES(15,'serials','Allow to manage serials subscriptions',0);
INSERT INTO `userflags` VALUES(16,'reports','Allow to access to the reports module',0);
INSERT INTO `userflags` VALUES(17,'staffaccess','Modify login / permissions for staff users',0);
INSERT INTO `userflags` VALUES(18,'coursereserves','Course Reserves',0);
INSERT INTO `userflags` VALUES(19, 'plugins', 'Koha plugins', '0');

3
installer/data/mysql/es-ES/mandatory/userpermissions.sql

@ -53,6 +53,9 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Routing'),
(16, 'execute_reports', 'Execute SQL reports'),
(16, 'create_reports', 'Create SQL Reports'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Manage plugins ( install / uninstall )'),
(19, 'tool', 'Use tool plugins'),
(19, 'report', 'Use report plugins'),

1
installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql

@ -16,4 +16,5 @@ INSERT INTO `userflags` VALUES(13,'tools','Outils (export, import, impression de
INSERT INTO `userflags` VALUES(14,'editauthorities','Gestion des autorités',0);
INSERT INTO `userflags` VALUES(15,'serials','Gestion du module périodique',0);
INSERT INTO `userflags` VALUES(16,'reports','Accès aux statistiques',0);
INSERT INTO `userflags` VALUES(18,'coursereserves','Course Reserves',0);
INSERT INTO `userflags` VALUES(19, 'plugins', 'Koha plugins', '0');

4
installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql

@ -53,9 +53,11 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Mettre en circulation'),
(16, 'execute_reports', 'Lancer les rapports SQL'),
(16, 'create_reports', 'Créer les rapports SQL Reports'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Manage plugins ( install / uninstall )'),
(19, 'tool', 'Use tool plugins'),
(19, 'report', 'Use report plugins'),
(19, 'configure', 'Configure plugins')
;

3
installer/data/mysql/it-IT/necessari/userflags.sql

@ -17,6 +17,7 @@ INSERT INTO `userflags` VALUES(14,'editauthorities','autorizza la modifica delle
INSERT INTO `userflags` VALUES(15,'serials','autorizza la gestione degli abbonamenti ai periodici',0);
INSERT INTO `userflags` VALUES(16,'reports','autorizza accesso al modulo dei reports',0);
INSERT INTO `userflags` VALUES(17,'staffaccess','modifica la login o i permessi degli staff users',0);
INSERT INTO `userflags` VALUES(18,'coursereserves','Course Reserves',0);
INSERT INTO `userflags` VALUES(19, 'plugins', 'Koha plugins', '0');
SET FOREIGN_KEY_CHECKS=1;
SET FOREIGN_KEY_CHECKS=1;

3
installer/data/mysql/it-IT/necessari/userpermissions.sql

@ -55,6 +55,9 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Crea/Manipola liste di distribuzione dei fascicoli ( routing list)'),
(16, 'execute_reports', 'Esegui reports SQL'),
(16, 'create_reports', 'Crea reports SQL'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Manage plugins ( install / uninstall )'),
(19, 'tool', 'Use tool plugins'),
(19, 'report', 'Use report plugins'),

102
installer/data/mysql/kohastructure.sql

@ -468,6 +468,108 @@ CREATE TABLE collections_tracking (
PRIMARY KEY (ctId)
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8;
--
-- Table structure for table `courses`
--
-- The courses table stores the courses created for the
-- course reserves feature.
DROP TABLE IF EXISTS courses;
CREATE TABLE `courses` (
`course_id` int(11) NOT NULL AUTO_INCREMENT,
`department` varchar(20) DEFAULT NULL, -- Stores the authorised value DEPT
`course_number` varchar(255) DEFAULT NULL, -- An arbitrary field meant to store the "course number" assigned to a course
`section` varchar(255) DEFAULT NULL, -- Also arbitrary, but for the 'section' of a course.
`course_name` varchar(255) DEFAULT NULL,
`term` varchar(20) DEFAULT NULL, -- Stores the authorised value TERM
`staff_note` mediumtext,
`public_note` mediumtext,
`students_count` varchar(20) DEFAULT NULL, -- Meant to be just an estimate of how many students will be taking this course/section
`enabled` enum('yes','no') NOT NULL DEFAULT 'yes', -- Determines whether the course is active
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `course_instructors`
--
-- The course instructors table links Koha borrowers to the
-- courses they are teaching. Many instructors can teach many
-- courses. course_instructors is just a many-to-many join table.
DROP TABLE IF EXISTS course_instructors;
CREATE TABLE `course_instructors` (
`course_id` int(11) NOT NULL,
`borrowernumber` int(11) NOT NULL,
PRIMARY KEY (`course_id`,`borrowernumber`),
KEY `borrowernumber` (`borrowernumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Constraints for table `course_instructors`
--
ALTER TABLE `course_instructors`
ADD CONSTRAINT `course_instructors_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`),
ADD CONSTRAINT `course_instructors_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Table structure for table `course_items`
--
-- If an item is placed on course reserve for one or more courses
-- it will have an entry in this table. No matter how many courses an item
-- is part of, it will only have one row in this table.
DROP TABLE IF EXISTS course_items;
CREATE TABLE `course_items` (
`ci_id` int(11) NOT NULL AUTO_INCREMENT,
`itemnumber` int(11) NOT NULL, -- items.itemnumber for the item on reserve
`itype` varchar(10) DEFAULT NULL, -- an optional new itemtype for the item to have while on reserve
`ccode` varchar(10) DEFAULT NULL, -- an optional new category code for the item to have while on reserve
`holdingbranch` varchar(10) DEFAULT NULL, -- an optional new holding branch for the item to have while on reserve
`location` varchar(80) DEFAULT NULL, -- an optional new shelving location for the item to have while on reseve
`enabled` enum('yes','no') NOT NULL DEFAULT 'no', -- If at least one enabled course has this item on reseve, this field will be 'yes', otherwise it will be 'no'
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`ci_id`),
UNIQUE KEY `itemnumber` (`itemnumber`),
KEY `holdingbranch` (`holdingbranch`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Constraints for table `course_items`
--
ALTER TABLE `course_items`
ADD CONSTRAINT `course_items_ibfk_2` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `course_items_ibfk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Table structure for table `course_reserves`
--
-- This table connects an item placed on course reserve to a course it is on reserve for.
-- There will be a row in this table for each course an item is on reserve for.
DROP TABLE IF EXISTS course_reserves;
CREATE TABLE `course_reserves` (
`cr_id` int(11) NOT NULL AUTO_INCREMENT,
`course_id` int(11) NOT NULL, -- Foreign key to the courses table
`ci_id` int(11) NOT NULL, -- Foreign key to the course_items table
`staff_note` mediumtext, -- Staff only note
`public_note` mediumtext, -- Public, OPAC visible note
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`cr_id`),
UNIQUE KEY `pseudo_key` (`course_id`,`ci_id`),
KEY `course_id` (`course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Constraints for table `course_reserves`
--
ALTER TABLE `course_reserves`
ADD CONSTRAINT `course_reserves_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`);
--
-- Table structure for table `branch_borrower_circ_rules`
--

1
installer/data/mysql/nb-NO/1-Obligatorisk/userflags.sql

@ -36,4 +36,5 @@ INSERT INTO `userflags` VALUES(14,'editauthorities','Tilgang til å endre autori
INSERT INTO `userflags` VALUES(15,'serials','Tilgang til å endre abonnementer',0);
INSERT INTO `userflags` VALUES(16,'reports','Tilgang til rapportmodulen',0);
INSERT INTO `userflags` VALUES(17,'staffaccess','Endre innlogging og rettigheter for bibliotekansatte',0);
INSERT INTO `userflags` VALUES(18,'coursereserves','Course Reserves',0);
INSERT INTO `userflags` VALUES(19, 'plugins', 'Koha plugins', '0');

3
installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql

@ -73,6 +73,9 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Sirkulasjon'),
(16, 'execute_reports', 'Kjøre SQL-rapporter'),
(16, 'create_reports', 'Opprette SQL-rapporter'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Manage plugins ( install / uninstall )'),
(19, 'tool', 'Use tool plugins'),
(19, 'report', 'Use report plugins'),

1
installer/data/mysql/pl-PL/mandatory/userflags.sql

@ -15,4 +15,5 @@ INSERT INTO `userflags` VALUES(14,'editauthorities','Allow to edit authorities',
INSERT INTO `userflags` VALUES(15,'serials','Allow to manage serials subscriptions',0);
INSERT INTO `userflags` VALUES(16,'reports','Allow to access to the reports module',0);
INSERT INTO `userflags` VALUES(17,'staffaccess','Modify login / permissions for staff users',0);
INSERT INTO `userflags` VALUES(18,'coursereserves','Course Reserves',0);
INSERT INTO `userflags` VALUES(19, 'plugins', 'Koha plugins', '0');

3
installer/data/mysql/pl-PL/mandatory/userpermissions.sql

@ -54,6 +54,9 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Routing'),
(16, 'execute_reports', 'Execute SQL reports'),
(16, 'create_reports', 'Create SQL Reports'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Manage plugins ( install / uninstall )'),
(19, 'tool', 'Use tool plugins'),
(19, 'report', 'Use report plugins'),

4
installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql

@ -18,6 +18,7 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES
(15,'serials', 'Разрешение на управление подпиской периодических изданий',0),
(16,'reports', 'Разрешение на доступ к модулю отчетов',0),
(17,'staffaccess', 'Смена имени(логина)/привилегий для работников библиотеки',0),
(18,'coursereserves', 'Course Reserves',0),
(19,'plugins', 'Koha plugins', '0')
;
@ -78,6 +79,9 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Routing'),
(16, 'execute_reports', 'Execute SQL reports'),
(16, 'create_reports', 'Create SQL Reports'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Manage plugins ( install / uninstall )'),
(19, 'tool', 'Use tool plugins'),
(19, 'report', 'Use report plugins'),

1
installer/data/mysql/sysprefs.sql

@ -424,3 +424,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UniqueItemFields', 'barcode', 'Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table', '', 'Free');
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');

4
installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql

@ -18,6 +18,7 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES
(15,'serials', 'Дозвіл на керування підпискою періодичних видань',0),
(16,'reports', 'Дозвіл на доступ до модуля звітів',0),
(17,'staffaccess', 'Зміна імені(логіну)/привілеїв для працівників бібліотеки',0),
(18,'coursereserves', 'Course Reserves',0),
(19,'plugins', 'Koha plugins', '0')
;
@ -78,6 +79,9 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(15, 'routing', 'Routing'),
(16, 'execute_reports', 'Execute SQL reports'),
(16, 'create_reports', 'Create SQL Reports'),
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves'),
(19, 'manage', 'Manage plugins ( install / uninstall )'),
(19, 'tool', 'Use tool plugins'),
(19, 'report', 'Use report plugins'),

91
installer/data/mysql/updatedatabase.pl

@ -5801,7 +5801,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
SetVersion($DBversion);
}
$DBversion = "3.09.00.047";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
# to preserve default behaviour as best as possible, set this new preference differently depending on whether IndependantBranches is set or not
@ -6846,6 +6845,96 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
$DBversion = "3.13.00.XXX";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('UseCourseReserves', '0', NULL, 'Enable the course reserves feature.', 'YesNo')");
$dbh->do("INSERT INTO userflags (bit,flag,flagdesc,defaulton) VALUES ('18','coursereserves','Course Reserves','0')");
$dbh->do("
CREATE TABLE `courses` (
`course_id` int(11) NOT NULL AUTO_INCREMENT,
`department` varchar(20) DEFAULT NULL,
`course_number` varchar(255) DEFAULT NULL,
`section` varchar(255) DEFAULT NULL,
`course_name` varchar(255) DEFAULT NULL,
`term` varchar(20) DEFAULT NULL,
`staff_note` mediumtext,
`public_note` mediumtext,
`students_count` varchar(20) DEFAULT NULL,
`enabled` enum('yes','no') NOT NULL DEFAULT 'yes',
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$dbh->do("
CREATE TABLE `course_instructors` (
`course_id` int(11) NOT NULL,
`borrowernumber` int(11) NOT NULL,
PRIMARY KEY (`course_id`,`borrowernumber`),
KEY `borrowernumber` (`borrowernumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$dbh->do("
ALTER TABLE `course_instructors`
ADD CONSTRAINT `course_instructors_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`),
ADD CONSTRAINT `course_instructors_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE;
");
$dbh->do("
CREATE TABLE `course_items` (
`ci_id` int(11) NOT NULL AUTO_INCREMENT,
`itemnumber` int(11) NOT NULL,
`itype` varchar(10) DEFAULT NULL,
`ccode` varchar(10) DEFAULT NULL,
`holdingbranch` varchar(10) DEFAULT NULL,
`location` varchar(80) DEFAULT NULL,
`enabled` enum('yes','no') NOT NULL DEFAULT 'no',
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`ci_id`),
UNIQUE KEY `itemnumber` (`itemnumber`),
KEY `holdingbranch` (`holdingbranch`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$dbh->do("
ALTER TABLE `course_items`
ADD CONSTRAINT `course_items_ibfk_2` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `course_items_ibfk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE;
");
$dbh->do("
CREATE TABLE `course_reserves` (
`cr_id` int(11) NOT NULL AUTO_INCREMENT,
`course_id` int(11) NOT NULL,
`ci_id` int(11) NOT NULL,
`staff_note` mediumtext,
`public_note` mediumtext,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`cr_id`),
UNIQUE KEY `pseudo_key` (`course_id`,`ci_id`),
KEY `course_id` (`course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$dbh->do("
ALTER TABLE `course_reserves`
ADD CONSTRAINT `course_reserves_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`);
");
$dbh->do("
INSERT INTO permissions (module_bit, code, description) VALUES
(18, 'manage_courses', 'Add, edit and delete courses'),
(18, 'add_reserves', 'Add course reserves'),
(18, 'delete_reserves', 'Remove course reserves')
;
");
print "Upgrade to $DBversion done (Add Course Reserves ( system preference UseCourseReserves ))\n";
SetVersion($DBversion);
}
=head1 FUNCTIONS
=head2 TableExists($table)

2
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css

@ -754,7 +754,7 @@ fieldset.rows .inputnote {
visibility:visible; /* you propably don't need to change this one */
display:block;
}
#newbiblio a, #addchild a, #newentry a, #newshelf a, #newmenuc .first-child, #newsupplier .first-child, #newlabel a, #newtemplate a, #newlabelbatch a, #newpatroncardbatch a, #newprofile a, #newsubscription a, #newdictionary a, #newbasket a, #newrootbudget-button, #budgets_menuc .first-child {
#new_course a, #newbiblio a, #addchild a, #newentry a, #newshelf a, #newmenuc .first-child, #newsupplier .first-child, #newlabel a, #newtemplate a, #newlabelbatch a, #newpatroncardbatch a, #newprofile a, #newsubscription a, #newdictionary a, #newbasket a, #newrootbudget-button, #budgets_menuc .first-child {
padding-left : 34px;
background-image: url("../../img/toolbar-new.gif");
background-position : center left;

3
koha-tmpl/intranet-tmpl/prog/en/includes/header.inc

@ -24,6 +24,9 @@
[% IF ( CAN_user_serials ) %]
<li><a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a></li>
[% END %]
[% IF ( CAN_user_coursereserves ) %]
<li><a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course Reserves</a></li>
[% END %]
[% IF ( CAN_user_reports ) %]
<li><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></li>
[% END %]

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

@ -5,16 +5,17 @@ function _(s) { return s; } // dummy function for gettext
$(document).ready(function() {
$('#header_search').tabs().bind('tabsshow', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); });
$(".close").click(function(){ window.close(); });
$(".close").click(function(){ window.close(); });
if($("#header_search #checkin_search").length > 0){ $(document).bind('keydown','Alt+r',function (){ $("#header_search").tabs("select","#checkin_search"); $("#ret_barcode").focus(); }); } else { $(document).bind('keydown','Alt+r',function (){ location.href="/cgi-bin/koha/circ/returns.pl"; }); }
if($("#header_search #circ_search").length > 0){ $(document).bind('keydown','Alt+u',function (){ $("#header_search").tabs("select","#circ_search"); $("#findborrower").focus(); }); } else { $(document).bind('keydown','Alt+u',function(){ location.href="/cgi-bin/koha/circ/circulation.pl"; }); }
if($("#header_search #catalog_search").length > 0){ $(document).bind('keydown','Alt+q',function (){ $("#header_search").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { $(document).bind('keydown','Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); }
$(".focus").focus();
$(".validated").validate();
});
// http://jennifermadden.com/javascript/stringEnterKeyDetector.html
function checkEnter(e){ //e is event object passed from function invocation
var characterCode; // literal character code will be stored in this variable

7
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref

@ -543,3 +543,10 @@ Circulation:
- and this password
- pref: AutoSelfCheckPass
- .
Course Reserves:
-
- pref: UseCourseReserves
choices:
yes: Use
no: "Don't use"
- course reserves

34
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

@ -1,3 +1,18 @@
[% USE AuthorisedValues %]
[% ShowCourseReserves = 0 %]
[% IF UseCourseReserves %]
[% FOREACH item IN itemloop %]
[% IF item.course_reserves %]
[% FOREACH r IN item.course_reserves %]
[% IF r.course.enabled == 'yes' %]
[% ShowCourseReserves = 1 %]
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
[% INCLUDE 'doc-head-open.inc' %]
[% INCLUDE 'greybox.inc' %]
<title>Koha &rsaquo; Catalog &rsaquo;
@ -370,6 +385,7 @@ function verify_images() {
[% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
[% IF ( hostrecords ) %]<th>Host records</th>[% END %]
[% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
[% IF ( ShowCourseReserves ) %]<th>Course Reserves</th>[% END %]
</tr>
</thead>
<tbody>
@ -520,6 +536,24 @@ function verify_images() {
<td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&amp;hostitemnumber=[% item.itemnumber %]">Create analytics</a></td>
[% END %]
[% IF ShowCourseReserves %]
<td>
[% IF item.course_reserves %]
[% FOREACH r IN item.course_reserves %]
[% IF r.course.enabled == 'yes' %]
<p>
<a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id %]">
[% r.course.course_name %]
<!--[% IF r.course.course_number %] [% r.course.course_number %] [% END %]-->
[% IF r.course.section %] [% r.course.section %] [% END %]
[% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %]
</a>
</p>
[% END %]
[% END %]
[% END %]
</td>
[% END %]
</tr>
[% END %]
</tbody>

2
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt

@ -10,7 +10,7 @@ $(document).ready(function(){
window.close();
[% END %]
[% END %]
$("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
$("fieldset.rows input").addClass("noEnterSubmit");
/* Inline edit/delete links */
var biblionumber = $("input[name='biblionumber']").attr("value");
$("tr.editable td").click(function(event){

63
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt

@ -0,0 +1,63 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Course reserves &rsaquo; Add items</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#barcode').focus();
});
//]]>
</script>
<body>
[% 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> &rsaquo; Add reserves for <i><a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id %]">[% course.course_name %]</a></i></div>
<div id="doc2" class="yui-t7">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g">
<div class="yui-u first">
[% IF ERROR_BARCODE_NOT_FOUND %]
<div class="error">No item found for barcode [% ERROR_BARCODE_NOT_FOUND %]</div>
[% END %]
<form method="post" action="/cgi-bin/koha/course_reserves/add_items.pl">
<input type="hidden" name="course_id" value="[% course.course_id %]" />
<input type="hidden" name="action" value="lookup" />
<fieldset class="rows">
<legend>Add items: scan barcode</legend>
<p>
<li>
<label class="required" for="barcode">Item barcode:</label>
<input id="barcode" name="barcode" type="text" />
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" value="Submit" class="submit" />
<a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id %]" class="cancel">Cancel</a>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]

133
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt

@ -0,0 +1,133 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Course reserves &rsaquo; Add items</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#submit').focus();
});
//]]>
</script>
</head>
<body>
[% 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> &rsaquo; Reserve <i><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]">[% item.title %]</a></i> for <i><a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id %]">[% course.course_name %]</a></i></div>
<div id="doc2" class="yui-t7">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g">
<div class="yui-u first">
[% IF course_reserve %]<div class="warn" id="already_on_reserve_this">This course already has this item on reserve.<div>[% END %]
[% IF course_item %]<div class="warn" id="already_on_reserve">Number of courses reserving this item: [% course_item.course_reserves.size %]<div>[% END %]
<form method="post" action="/cgi-bin/koha/course_reserves/add_items.pl">
<input type="hidden" name="course_id" value="[% course.course_id %]" />
<input type="hidden" name="action" value="add" />
<fieldset class="rows">
<legend>Add <i>[% item.title %]</i> to <i>[% course.course_name %]</i></legend>
<ol>
<li>
<label for="barcode">Barcode:</label>
<span id="barcode">[% item.barcode %]</span>
<input type="hidden" name="itemnumber" value="[% item.itemnumber %]" />
</li>
[% IF item_level_itypes %]
<li>
<label class="required" for="itype">Item Type:</label>
<select id="itype" name="itype">
<option value="">LEAVE UNCHANGED</option>
[% FOREACH it IN itypes %]
[% IF course_item.itype && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %]
<option value="[% it.itemtype %]" selected="selected">[% it.description %]</option>
[% ELSE %]
<option value="[% it.itemtype %]">[% it.description %]</option>
[% END %]
[% END %]
</select>
</li>
[% END %]
<li>
<label class="required" for="ccode">Collection Code:</label>
<select id="ccode" name="ccode">
<option value="">LEAVE UNCHANGED</option>
[% FOREACH c IN ccodes %]
[% IF course_item.ccode && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %]
<option value="[% c.authorised_value %]" selected="selected">[% c.lib %]</option>
[% ELSE %]
<option value="[% c.authorised_value %]">[% c.lib %]</option>
[% END %]
[% END %]
</select>
</li>
<li>
<label class="required" for="location">Shelving Location:</label>
<select id="location" name="location">
<option value="">LEAVE UNCHANGED</option>
[% FOREACH s IN locations %]
[% IF course_item.location && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %]
<option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
[% ELSE %]
<option value="[% s.authorised_value %]">[% s.lib %]</option>
[% END %]
[% END %]
</select>
</li>
<li>
<label class="required" for="holdingbranch">Holding Library:</label>
<select id="holdingbranch" name="holdingbranch">
<option value="">LEAVE UNCHANGED</option>
[% FOREACH b IN branches %]
[% IF course_item.holdingbranch && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %]
<option value="[% b.value %]" selected="selected">[% b.branchname %]</option>
[% ELSE %]
<option value="[% b.value %]">[% b.branchname %]</option>
[% END %]
[% END %]
</select>
</li>
<li>
<label for="staff_note">Staff note:</label>
<textarea name="staff_note" id="staff_note">[% course_reserve.staff_note %]</textarea>
</li>
<li>
<label for="public_note">Public note:</label>
<textarea name="public_note" id="public_note">[% course_reserve.public_note %]</textarea>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" id="submit" value="Save" class="submit" />
<a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id %]" class="cancel">Cancel</a>
</fieldset>
</div>
</div>
</div>
</div>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]

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

@ -0,0 +1,185 @@
[% USE AuthorisedValues %]
[% USE ItemTypes %]
[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Course reserves &rsaquo; New course</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
//<![CDATA[
function confirmItemDelete(){
return confirm( _('Are you sure you want to delete this item?');
}
//]]>
</script>
</head>
<body>