Bugzilla – Attachment 21201 Details for
Bug 10863
Add 2 circulation permissions: force_checkout and lift_restriction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10863: Add 2 circulation permissions: force_checkout and lift_restriction
Bug-10863-Add-2-circulation-permissions-forcecheck.patch (text/plain), 12.53 KB, created by
Jonathan Druart
on 2013-09-18 12:47:07 UTC
(
hide
)
Description:
Bug 10863: Add 2 circulation permissions: force_checkout and lift_restriction
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-09-18 12:47:07 UTC
Size:
12.53 KB
patch
obsolete
>From 1e4f8fd6fc71cbd9d2881a90c121a5eeaec025eb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 5 Jun 2013 14:37:38 +0200 >Subject: [PATCH] Bug 10863: Add 2 circulation permissions: force_checkout and > lift_restriction > >This patch adds 2 circulation permissions: force_checkout and >lift_restriction. > >Both are added to existing patrons having circulation flags. > >force_checkout allows a librarian to force a checkout if a limitation >occurred. > >lift_restriction allows a librarian to lift a restriction for a patron. > >Test plan: >1/ Find a debarred patron and go on the checkout page. The "Lift >restriction" button should be present only if the logged librarian has >the lift_restriction permission. >2/ If the force_checkout permission is set, a librarian should be >allowed to check out in several cases: >- 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(-) > >diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql >index 4fa2a7a..cf0eb54 100644 >--- a/installer/data/mysql/en/mandatory/userpermissions.sql >+++ b/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'), >diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql >index 355ee27..acd8436 100644 >--- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql >+++ b/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'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 31f494a..4251772 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/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) >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 f19a8af..4125ae8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -327,11 +327,19 @@ function validate1(date) { > <div class="yui-g"> > > <div id="circ_needsconfirmation" class="dialog alert"> >-<h3>Please confirm checkout</h3> >+[% IF CAN_user_circulate_force_checkout %] >+ <h3>Please confirm checkout</h3> >+[% ELSE %] >+ <h3>Cannot checkout</h3> >+[% END %] > > <ul> > [%IF ( AGE_RESTRICTION ) %] >- <li>Age restriction [% AGE_RESTRICTION %]. Check out anyway?</li> >+ <li>Age restriction [% AGE_RESTRICTION %]. >+ [% IF CAN_user_circulate_force_checkout %] >+ Check out anyway? >+ [% END %] >+ </li> > [% END %] > > [% IF ( DEBT ) %] >@@ -351,7 +359,11 @@ function validate1(date) { > [% END %] > > [% IF ( ISSUED_TO_ANOTHER ) %] >- <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) is checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issued_borrowernumber %]">[% issued_firstname %] [% issued_surname %]</a> ([% issued_cardnumber %]). Check in and check out?</li> >+ <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) is checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issued_borrowernumber %]">[% issued_firstname %] [% issued_surname %]</a> ([% issued_cardnumber %]). >+ [% IF CAN_user_circulate_force_checkout %] >+ Check in and check out? >+ [% END %] >+ </li> > [% END %] > > [% IF ( TOO_MANY ) %] >@@ -374,20 +386,34 @@ function validate1(date) { > [% 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 %] > </li> > [% END %] > > [% IF ( USERBLOCKEDOVERDUE ) %] >- <li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s). Check out anyway?</li> >+ <li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s). >+ [% IF CAN_user_circulate_force_checkout %] >+ Check out anyway? >+ [% END %] >+ </li> > [% END %] > > [% IF ( ITEM_LOST ) %] >- <li>This item has been lost with a status of "[% ITEM_LOST %]". Check out anyway?</li> >+ <li>This item has been lost with a status of "[% ITEM_LOST %]". >+ [% IF CAN_user_circulate_force_checkout %] >+ Check out anyway? >+ [% END %] >+ </li> > [% END %] > > [% IF HIGHHOLDS %] >- <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li> >+ <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). >+ [% IF CAN_user_circulate_force_checkout %] >+ Check out anyway? >+ [% END %] >+ </li> > [% END %] > </ul> > >@@ -398,6 +424,8 @@ function validate1(date) { > }); > </script> > [% END %] >+ >+[% IF CAN_user_circulate_force_checkout %] > <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off"> > > [% IF ( RESERVED ) %] >@@ -447,6 +475,7 @@ function validate1(date) { > <input type="submit" class="deny" value="No, Don't Check Out (N)" accesskey="n" /> > [% END %] > </form> >+[% END %] > > </div></div> > [% END %] <!-- NEEDSCONFIRMATION --> >@@ -623,7 +652,7 @@ No patron matched <span class="ex">[% message %]</span> > > <div class="hint">Enter item barcode:</div> > >- [% IF ( NEEDSCONFIRMATION ) %] >+ [% IF NEEDSCONFIRMATION %] > <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" /> > [% ELSE %] > <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" /> >@@ -700,12 +729,14 @@ No patron matched <span class="ex">[% message %]</span> > [% IF ( userdebarred ) %] > <li class="blocker"> > <span class="circ-hlt"> Restricted:</span> Patron's account is restricted [% IF (userdebarreddate ) %] until [% userdebarreddate %] [% END %] [% IF (debarredcomment ) %] with the comment "[% debarredcomment %]"[% END %] >+ [% IF CAN_user_circulate_lift_restriction %] > <form class="inline compact" action="/cgi-bin/koha/members/setstatus.pl" method="post"> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="destination" value="circ" /> > <input type="hidden" name="cardnumber" value="[% cardnumber %]" /> > <input type="submit" value="Lift restriction" /> > </form> >+ [% END %] > </li>[% END %] > > [% IF ( odues ) %]<li>[% IF ( nonreturns ) %]<span class="circ-hlt">Overdues:</span> Patron has <span class="circ-hlt">ITEMS OVERDUE</span>. See highlighted items <a href="#checkouts">below</a>[% END %]</li> >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 2cb1bb3..e934da1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1160,23 +1160,30 @@ > > </li> > [% END %] >- <li> >- <label for="yesdebarred" class="radio">Restricted: </label> >- [% IF ( debarred ) %] >- <label for="yesdebarred">Yes </label> >- <input type="radio" id="yesdebarred" name="debarred" value="1" checked="checked"/> >- <label for="nodebarred">No </label> >- <input type="radio" id="nodebarred" name="debarred" value="0"/> >- [% ELSE %] >- <label for="yesdebarred">Yes </label> >- <input type="radio" id="yesdebarred" name="debarred" value="1" /> >- <label for="nodebarred">No </label> >- <input type="radio" id="nodebarred" name="debarred" value="0" checked="checked"/> >- [% END %] >- >- <span id="debarreduntil"><label for="datedebarred" class="inline">Until:</label> >- <input type="text" name="datedebarred" id="datedebarred" class="debarred datepicker [% focusAction %]" value="[% datedebarred %]" /> >- <span class="hint">(optional)</span> </span> >+ <li> >+ <label for="yesdebarred" class="radio">Restricted: </label> >+ [% IF CAN_user_circulate_lift_restriction %] >+ [% IF ( debarred ) %] >+ <label for="yesdebarred">Yes </label> >+ <input type="radio" id="yesdebarred" name="debarred" value="1" checked="checked"/> >+ <label for="nodebarred">No </label> >+ <input type="radio" id="nodebarred" name="debarred" value="0"/> >+ [% ELSE %] >+ <label for="yesdebarred">Yes </label> >+ <input type="radio" id="yesdebarred" name="debarred" value="1" /> >+ <label for="nodebarred">No </label> >+ <input type="radio" id="nodebarred" name="debarred" value="0" checked="checked"/> >+ [% END %] >+ <span id="debarreduntil"><label for="datedebarred" class="inline">Until:</label> >+ <input type="text" name="datedebarred" id="datedebarred" class="debarred datepicker [% focusAction %]" value="[% datedebarred %]" /> >+ <span class="hint">(optional)</span> </span> >+ [% ELSE %] >+ [% IF ( debarred ) %] >+ Yes, until [% datedebarred %] >+ [% ELSE %] >+ No >+ [% END %] >+ [% END %] > </li> > <li> > <label for="debarredcomment" class="radio">Comment:</label> >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10863
:
20948
|
20981
|
21042
|
21043
|
21201
|
21203
|
21204
|
21247
|
21248
|
21249
|
21542
|
21661
|
22717
|
23254
|
23540