@@ -, +, @@ lift_restriction - age restriction - the item is issued to another patron - the item is not for loan - the patron has overdue items - the item is lost - the item is a high demand item - the item is reserved - another case ? --- .../data/mysql/en/mandatory/userpermissions.sql | 2 + .../mysql/fr-FR/1-Obligatoire/userpermissions.sql | 2 + installer/data/mysql/updatedatabase.pl | 30 +++++++++++++ .../prog/en/modules/circ/circulation.tt | 45 +++++++++++++++++--- .../prog/en/modules/members/memberentrygen.tt | 41 ++++++++++-------- 5 files changed, 96 insertions(+), 24 deletions(-) --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ a/installer/data/mysql/en/mandatory/userpermissions.sql @@ -2,6 +2,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions'), ( 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'), ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'), ( 3, 'manage_circ_rules', 'manage circulation rules'), ( 6, 'place_holds', 'Place holds for patrons'), --- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql +++ a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql @@ -2,6 +2,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'circulate_remaining_permissions', 'Fonctions de circulation restantes'), ( 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'), ( 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'), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -7104,6 +7104,36 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } + + + +$DBversion = "3.13.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + 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') + }); + $dbh->do(q{ + INSERT INTO user_permissions (borrowernumber, module_bit, code) + SELECT user_permissions.borrowernumber, 1, 'force_checkout' + FROM user_permissions + LEFT JOIN borrowers USING(borrowernumber) + WHERE borrowers.flags & (1 << 1) + }); + $dbh->do(q{ + INSERT INTO user_permissions (borrowernumber, module_bit, code) + SELECT user_permissions.borrowernumber, 1, 'lift_restriction' + FROM user_permissions + LEFT JOIN borrowers USING(borrowernumber) + WHERE borrowers.flags & (1 << 1) + }); + + print "Upgrade to $DBversion done (Bug XXXXX - Add permission force_checkout and lift_restriction)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -327,11 +327,19 @@ function validate1(date) {
-

Please confirm checkout

+[% IF CAN_user_circulate_force_checkout %] +

Please confirm checkout

+[% ELSE %] +

Cannot checkout

+[% END %] @@ -398,6 +424,8 @@ function validate1(date) { }); [% END %] + +[% IF CAN_user_circulate_force_checkout %]
[% IF ( RESERVED ) %] @@ -447,6 +475,7 @@ function validate1(date) { [% END %]
+[% END %]
[% END %] @@ -623,7 +652,7 @@ No patron matched [% message %]
Enter item barcode:
- [% IF ( NEEDSCONFIRMATION ) %] + [% IF NEEDSCONFIRMATION %] [% ELSE %] @@ -700,12 +729,14 @@ 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 %]
    + [% END %]
  • [% END %] [% IF ( odues ) %]
  • [% IF ( nonreturns ) %]Overdues: Patron has ITEMS OVERDUE. See highlighted items below[% END %]
  • --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1160,23 +1160,30 @@ [% END %] -
  • - - [% IF ( debarred ) %] - - - - - [% ELSE %] - - - - - [% END %] - - - - (optional) +
  • + + [% IF CAN_user_circulate_lift_restriction %] + [% IF ( debarred ) %] + + + + + [% ELSE %] + + + + + [% END %] + + + (optional) + [% ELSE %] + [% IF ( debarred ) %] + Yes, until [% datedebarred %] + [% ELSE %] + No + [% END %] + [% END %]
  • --