@@ -, +, @@
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 | 29 +++++++++++++
.../prog/en/modules/circ/circulation.tt | 45 +++++++++++++++++---
.../prog/en/modules/members/memberentrygen.tt | 41 ++++++++++--------
5 files changed, 95 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
@@ -7139,6 +7139,35 @@ 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 10863 - 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
@@ -185,11 +185,19 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
-
Please confirm checkout
+[% IF CAN_user_circulate_force_checkout %]
+
Please confirm checkout
+[% ELSE %]
+
Cannot checkout
+[% END %]
[%IF ( AGE_RESTRICTION ) %]
-
Age restriction [% AGE_RESTRICTION %]. Check out anyway?
+
Age restriction [% AGE_RESTRICTION %].
+ [% IF CAN_user_circulate_force_checkout %]
+ Check out anyway?
+ [% END %]
+
[% END %]
[% IF ( DEBT ) %]
@@ -209,7 +217,11 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
[% END %]
[% IF ( ISSUED_TO_ANOTHER ) %]
-
Item [% getTitleMessageIteminfo %] ([% getBarcodeMessageIteminfo %]) is checked out to [% issued_firstname %] [% issued_surname %] ([% issued_cardnumber %]). Check in and check out?
+
Item [% getTitleMessageIteminfo %] ([% getBarcodeMessageIteminfo %]) is checked out to [% issued_firstname %] [% issued_surname %] ([% issued_cardnumber %]).
+ [% IF CAN_user_circulate_force_checkout %]
+ Check in and check out?
+ [% END %]
+
[% END %]
[% IF ( TOO_MANY ) %]
@@ -232,20 +244,34 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
[% item_notforloan_lib = KohaAuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
Item is normally not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib %])[% END %].
[% END %]
+ [% IF CAN_user_circulate_force_checkout %]
Check out anyway?
+ [% END %]
[% END %]
[% IF ( USERBLOCKEDOVERDUE ) %]
-
Patron has [% USERBLOCKEDOVERDUE %] overdue item(s). Check out anyway?
+
Patron has [% USERBLOCKEDOVERDUE %] overdue item(s).
+ [% IF CAN_user_circulate_force_checkout %]
+ Check out anyway?
+ [% END %]
+
[% END %]
[% IF ( ITEM_LOST ) %]
-
This item has been lost with a status of "[% ITEM_LOST %]". Check out anyway?
+
This item has been lost with a status of "[% ITEM_LOST %]".
+ [% IF CAN_user_circulate_force_checkout %]
+ Check out anyway?
+ [% END %]
+
[% END %]
[% IF HIGHHOLDS %]
-
High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?
+
High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]).
+ [% IF CAN_user_circulate_force_checkout %]
+ Check out anyway?
+ [% END %]
+
[% END %]
@@ -256,6 +282,8 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
});
[% END %]
+
+[% IF CAN_user_circulate_force_checkout %]
+[% END %]
[% END %]
@@ -481,7 +510,7 @@ No patron matched [% message %]
Enter item barcode:
- [% IF ( NEEDSCONFIRMATION ) %]
+ [% IF NEEDSCONFIRMATION %]
[% ELSE %]
@@ -558,12 +587,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 %]