From e4e11994ab1fd8fe42973db303d93356378ca474 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 30 Sep 2013 16:15:34 +0200 Subject: [PATCH] Bug 10863: Rename lift_restriction with manage_restrictions The pref manage_restrictions now takes into account "Lost card" and "Gone no address" restrictions. Test plan: - log in with a user with manage_restrictions permission - verify you can set/unset restrictions when editing a patron - log in with a user without manage_restrictions permission - verify you cannot set/unset restrictions when editing a patron --- .../data/mysql/de-DE/mandatory/userpermissions.sql | 2 +- .../data/mysql/en/mandatory/userpermissions.sql | 2 +- .../data/mysql/es-ES/mandatory/userpermissions.sql | 2 +- .../mysql/fr-FR/1-Obligatoire/userpermissions.sql | 2 +- .../data/mysql/it-IT/necessari/userpermissions.sql | 2 +- .../mysql/nb-NO/1-Obligatorisk/userpermissions.sql | 2 +- .../data/mysql/pl-PL/mandatory/userpermissions.sql | 2 +- .../ru-RU/mandatory/permissions_and_user_flags.sql | 2 +- .../uk-UA/mandatory/permissions_and_user_flags.sql | 2 +- installer/data/mysql/updatedatabase.pl | 6 +++--- .../prog/en/modules/circ/circulation.tt | 2 +- .../prog/en/modules/members/memberentrygen.tt | 18 ++++++++++++++---- .../prog/en/modules/members/moremember.tt | 2 +- 13 files changed, 28 insertions(+), 18 deletions(-) diff --git a/installer/data/mysql/de-DE/mandatory/userpermissions.sql b/installer/data/mysql/de-DE/mandatory/userpermissions.sql index 9276ac7..87db2c3 100644 --- a/installer/data/mysql/de-DE/mandatory/userpermissions.sql +++ b/installer/data/mysql/de-DE/mandatory/userpermissions.sql @@ -3,7 +3,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Vormerksperren übergehen'), ( 1, 'overdues_report', 'Überfälligkeiten-Report ausführen'), ( 1, 'force_checkout', 'Ausleihsperren übergehen'), - ( 1, 'lift_restriction', 'Kontosperre "Gesperrt" aufheben'), + ( 1, 'manage_restrictions', 'Kontosperre "Gesperrt" aufheben'), ( 3, 'parameters_remaining_permissions', 'Übrige Administrationsberechtigungen'), ( 3, 'manage_circ_rules', 'Ausleihkonditionen verwalten'), ( 6, 'place_holds', 'Vormerkungen für Benutzer setzen'), diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql index cf0eb54..5509771 100644 --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ b/installer/data/mysql/en/mandatory/userpermissions.sql @@ -3,7 +3,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Override blocked renewals'), ( 1, 'overdues_report', 'Execute overdue items report'), ( 1, 'force_checkout', 'Force checkout if a limitation exists'), - ( 1, 'lift_restriction', 'Lift restriction for restricted accounts'), + ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'), ( 3, 'manage_circ_rules', 'manage circulation rules'), ( 6, 'place_holds', 'Place holds for patrons'), diff --git a/installer/data/mysql/es-ES/mandatory/userpermissions.sql b/installer/data/mysql/es-ES/mandatory/userpermissions.sql index cf0eb54..5509771 100644 --- a/installer/data/mysql/es-ES/mandatory/userpermissions.sql +++ b/installer/data/mysql/es-ES/mandatory/userpermissions.sql @@ -3,7 +3,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Override blocked renewals'), ( 1, 'overdues_report', 'Execute overdue items report'), ( 1, 'force_checkout', 'Force checkout if a limitation exists'), - ( 1, 'lift_restriction', 'Lift restriction for restricted accounts'), + ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'), ( 3, 'manage_circ_rules', 'manage circulation rules'), ( 6, 'place_holds', 'Place holds for patrons'), diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql index acd8436..6a76d5b 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql @@ -3,7 +3,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Outrepasser les limites de renouvellement'), ( 1, 'overdues_report', 'Executer le rapport de retards'), ( 1, 'force_checkout', 'Forcer le prêt si une limitation existe'), - ( 1, 'lift_restriction', 'Lever la suspenssion d\'un utilisateur suspendu'), + ( 1, 'manage_restrictions', 'Gérer les suspensions d\'un utilisateur'), ( 3, 'parameters_remaining_permissions', 'Paramètres du système restants'), ( 3, 'manage_circ_rules', 'Gestion des règles de circulation'), ( 6, 'place_holds', 'Réserver pour des adhérents'), diff --git a/installer/data/mysql/it-IT/necessari/userpermissions.sql b/installer/data/mysql/it-IT/necessari/userpermissions.sql index bff76ac..3bf7d65 100644 --- a/installer/data/mysql/it-IT/necessari/userpermissions.sql +++ b/installer/data/mysql/it-IT/necessari/userpermissions.sql @@ -5,7 +5,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Sblocca i rinnovi bloccati'), ( 1, 'overdues_report', 'Execute overdue items report'), ( 1, 'force_checkout', 'Force checkout if a limitation exists'), - ( 1, 'lift_restriction', 'Lift restriction for restricted accounts'), + ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), ( 3, 'parameters_remaining_permissions', 'Permessi rimanenti'), ( 3, 'manage_circ_rules', 'Gestisci regole circolazione'), ( 6, 'place_holds', 'Fai prenotazioni per gli utenti'), diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql index 88051d3..ecf39f1 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql @@ -23,7 +23,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Overstyre blokkerte fornyinger'), ( 1, 'overdues_report', 'Execute overdue items report'), ( 1, 'force_checkout', 'Force checkout if a limitation exists'), - ( 1, 'lift_restriction', 'Lift restriction for restricted accounts'), + ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), ( 3, 'parameters_remaining_permissions', 'Øvrige rettigheter knyttet til systempreferanser'), ( 3, 'manage_circ_rules', 'Endre sirkulasjonsregler'), ( 6, 'place_holds', 'Foreta reservering for lånere'), diff --git a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql index c7595f5..c1431bb 100644 --- a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql +++ b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql @@ -3,7 +3,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Override blocked renewals'), ( 1, 'overdues_report', 'Execute overdue items report'), ( 1, 'force_checkout', 'Force checkout if a limitation exists'), - ( 1, 'lift_restriction', 'Lift restriction for restricted accounts'), + ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'), ( 3, 'manage_circ_rules', 'manage circulation rules'), ( 6, 'place_holds', 'Place holds for patrons'), diff --git a/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql b/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql index d315f52..b754c46 100644 --- a/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql +++ b/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql @@ -29,7 +29,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Override blocked renewals'), ( 1, 'overdues_report', 'Execute overdue items report'), ( 1, 'force_checkout', 'Force checkout if a limitation exists'), - ( 1, 'lift_restriction', 'Lift restriction for restricted accounts'), + ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'), ( 3, 'manage_circ_rules', 'manage circulation rules'), ( 6, 'place_holds', 'Place holds for patrons'), diff --git a/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql b/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql index 2dc23a0..8caf716 100644 --- a/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql +++ b/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql @@ -29,7 +29,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Override blocked renewals'), ( 1, 'overdues_report', 'Execute overdue items report'), ( 1, 'force_checkout', 'Force checkout if a limitation exists'), - ( 1, 'lift_restriction', 'Lift restriction for restricted accounts'), + ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'), ( 3, 'manage_circ_rules', 'manage circulation rules'), ( 6, 'place_holds', 'Place holds for patrons'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 87a2d9d..a2e7506 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7161,7 +7161,7 @@ if ( CheckVersion($DBversion) ) { INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'force_checkout', 'Force checkout if a limitation exists') }); $dbh->do(q{ - INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'lift_restriction', 'Lift restriction for restricted accounts') + INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'manage_restrictions', 'Lift restriction for restricted accounts') }); $dbh->do(q{ INSERT INTO user_permissions (borrowernumber, module_bit, code) @@ -7172,13 +7172,13 @@ if ( CheckVersion($DBversion) ) { }); $dbh->do(q{ INSERT INTO user_permissions (borrowernumber, module_bit, code) - SELECT user_permissions.borrowernumber, 1, 'lift_restriction' + SELECT user_permissions.borrowernumber, 1, 'manage_restrictions' FROM user_permissions LEFT JOIN borrowers USING(borrowernumber) WHERE borrowers.flags & (1 << 1) }); - print "Upgrade to $DBversion done (Bug 10863 - Add permission force_checkout and lift_restriction)\n"; + print "Upgrade to $DBversion done (Bug 10863 - Add permission force_checkout and manage_restrictions)\n"; SetVersion($DBversion); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 46786ae..91ca0da 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -583,7 +583,7 @@ No patron matched [% message %] [% IF ( userdebarred ) %]
  • Restricted: Patron's account is restricted [% IF (userdebarreddate ) %] until [% userdebarreddate %] [% END %] [% IF (debarredcomment ) %] with the comment "[% debarredcomment %]"[% END %] - [% IF CAN_user_circulate_lift_restriction %] + [% IF CAN_user_circulate_manage_restrictions %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 08ab4b4..2d31d89 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1145,6 +1145,7 @@ [% IF ( flagloo.key == 'debarred' ) %]Restricted:[% END %] [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %] + [% IF CAN_user_circulate_manage_restrictions %] [% IF ( flagloo.yes ) %] @@ -1157,12 +1158,15 @@ [% ELSE %] [% END %] + [% ELSE %] + [% IF flagloo.yes %]Yes[% ELSE %]No[% END %] + [% END %]
  • [% END %]
  • - [% IF CAN_user_circulate_lift_restriction %] + [% IF CAN_user_circulate_manage_restrictions %] [% IF ( debarred ) %] @@ -1179,15 +1183,21 @@ (optional) [% ELSE %] [% IF ( debarred ) %] - Yes, until [% datedebarred %] + Yes[% IF datedebarred %], until [% datedebarred %][% END %] [% ELSE %] No [% END %] [% END %]
  • - - + [% IF CAN_user_circulate_manage_restrictions || debarredcomment %] + + [% IF CAN_user_circulate_manage_restrictions %] + + [% ELSE %] + [% debarredcomment %] + [% END %] + [% END %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 5eb37c1..3e9a672 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -194,7 +194,7 @@ function validate1(date) {