@@ -, +, @@
-MAIN log in ( auth.tt )
-AFTER log in-
-CircSideBar-
-Set library page-
---
C4/Auth.pm | 4 ++--
.../data/mysql/mandatory/userpermissions.sql | 1 +
.../prog/en/includes/circ-nav.inc | 18 ++++++--------
.../intranet-tmpl/prog/en/includes/header.inc | 2 +-
.../prog/en/includes/permissions.inc | 5 ++++
.../prog/en/modules/circ/circulation-home.tt | 8 ++++++-
.../prog/en/modules/circ/set-library.tt | 24 ++++++++++++++-----
7 files changed, 41 insertions(+), 21 deletions(-)
--- a/C4/Auth.pm
+++ a/C4/Auth.pm
@@ -1147,10 +1147,10 @@ sub checkauth {
my $ip = $ENV{'REMOTE_ADDR'};
# if they specify at login, use that
- if ( $query->param('branch') ) {
+ if ( $query->param('branch') && ( haspermission($userid, { parameters => 'select_loggedin_library' }) || $flags->{superlibrarian}) ) {
$branchcode = $query->param('branch');
my $library = Koha::Libraries->find($branchcode);
- $branchname = $library? $library->branchname: '';
+ $branchname = $library ? $library->branchname: '';
}
if ( $query->param('desk_id') ) {
$desk_id = $query->param('desk_id');
--- a/installer/data/mysql/mandatory/userpermissions.sql
+++ a/installer/data/mysql/mandatory/userpermissions.sql
@@ -40,6 +40,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
( 3, 'manage_smtp_servers', 'Manage SMTP servers configuration'),
( 3, 'manage_background_jobs', 'Manage background jobs'),
( 3, 'manage_curbside_pickups', 'Manage curbside pickups'),
+ ( 3, 'select_loggedin_library' , 'Allow user to change logged in library'),
( 4, 'delete_borrowers', 'Delete patrons'),
( 4, 'edit_borrowers', 'Add, modify and view patron information'),
( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc
@@ -5,17 +5,13 @@
Circulation
- -
- Check out
-
- -
- Check in
-
- -
- Renew
-
- [% UNLESS IndependentBranches %]
- -
+
- Check out
+ - Check in
+ - Renew
+ [% IF !Koha.Preference('IndependentBranchesTransfers') || CAN_user_superlibrarian %]
+ - Transfer
+ [% END %]
+ [% IF ( CAN_user_parameters_select_loggedin_library ) %]
[% IF Koha.Preference('UseCirculationDesks') %]
Set library and desk
[% ELSE %]
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
@@ -154,7 +154,7 @@
[% END %]
- [% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %]
+ [% IF ( CAN_user_parameters_select_loggedin_library ) %]
-
[% IF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
@@ -118,6 +118,11 @@
Manage account debit and credit types
([% name | html %])
+ [%- CASE 'select_loggedin_library' -%]
+
+ Allow user to change logged in library
+
+ ([% name | html %])
[%- CASE 'manage_circ_rules' -%]
Manage circulation rules
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt
@@ -44,7 +44,7 @@
-
Renew
- [% UNLESS IndependentBranches %]
+ [% IF ( CAN_user_parameters_select_loggedin_library ) %]
-
[% IF Koha.Preference('UseCirculationDesks') %]
Set library and desk
@@ -52,6 +52,12 @@
Set library
[% END %]
+ [% ELSE %]
+ -
+ [% IF Koha.Preference('UseCirculationDesks') %]
+ Set desk
+ [% END %]
+
[% END %]
[% IF ( fast_cataloging ) %]
[% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt
@@ -22,6 +22,19 @@
[% END %]
[% WRAPPER 'sub-header.inc' %]
+[% SET page_title = "" %]
+[% IF ( CAN_user_parameters_select_loggedin_library ) %]
+ [% IF Koha.Preference('UseCirculationDesks') %]
+ [% page_title = "Set library and desk" %]
+ [% ELSE %]
+ [% page_title = "Set library" %]
+ [% END %]
+[% ELSE %]
+ [% IF Koha.Preference('UseCirculationDesks') %]
+ [% page_title = "Set desk"%]
+ [% END %]
+[% END %]
+
@@ -42,13 +55,12 @@
-
[% IF Koha.Preference('CircSidebar') %]
-
Set library
+
[% page_title | html%]
[% ELSE %]
-
Set library
+
[% page_title | html %]
[% END %]
@@ -84,13 +96,13 @@ Updated: