@@ -, +, @@ -MAIN log in ( auth.tt ) -AFTER log in- -CircSideBar- -Set library page- --- C4/Auth.pm | 4 ++-- .../data/mysql/mandatory/userpermissions.sql | 1 + .../intranet-tmpl/prog/en/includes/circ-nav.inc | 2 +- .../intranet-tmpl/prog/en/includes/header.inc | 2 +- .../prog/en/includes/permissions.inc | 5 +++++ .../prog/en/modules/circ/circulation-home.tt | 16 +++++++++------- .../prog/en/modules/circ/set-library.tt | 5 ++--- 7 files changed, 21 insertions(+), 14 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -1191,10 +1191,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 @@ -37,6 +37,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 3, 'manage_keyboard_shortcuts', 'Manage keyboard shortcuts for the advanced cataloging editor'), ( 3, 'manage_smtp_servers', 'Manage SMTP servers configuration'), ( 3, 'manage_background_jobs', 'Manage background jobs'), + ( 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 @@ -15,7 +15,7 @@ [% IF !Koha.Preference('IndependentBranchesTransfers') || CAN_user_superlibrarian %]
  • Transfer
  • [% END %] - [% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %] + [% 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 @@ -149,7 +149,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 @@ -42,13 +42,15 @@ Renew
  • [% UNLESS IndependentBranches %] -
  • - [% IF Koha.Preference('UseCirculationDesks') %] - Set library and desk - [% ELSE %] - Set library - [% END %] -
  • + [% IF ( CAN_user_parameters_select_loggedin_library ) %] +
  • + [% IF Koha.Preference('UseCirculationDesks') %] + Set library and desk + [% ELSE %] + Set library + [% END %] +
  • + [% 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 @@ -39,7 +39,6 @@
    - [% IF Koha.Preference('CircSidebar') %]

    Set library

    @@ -81,13 +80,13 @@ Updated:
      [% ELSE %]
      -[% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %] +[% IF ( CAN_user_parameters_select_loggedin_library ) %]
      Set library
      --