Bug 15492: New sysprefs and permissions

In order to make this module unrelated to the SCO module, this
patch introduces the following sysprefs:

- SelfCheckInMainUserBlock
- SelfCheckInModuleUserID
- SelfCheckInTimeout
- SelfCheckInUserCSS
- SelfCheckInUserJS

It also adds a new user flag and sub-permission:

- self_check => self_checkin_module

and moves the circulate => self_checkout permission into

- self_check => self_checkout_module

Descriptions are adjusted accordingly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Tomas Cohen Arazi 2017-12-27 12:24:36 -03:00 committed by Jonathan Druart
parent 8c5fa90668
commit 92b29b88c2
6 changed files with 95 additions and 8 deletions

View File

@ -1,10 +1,68 @@
$DBversion = 'XXX';
if( CheckVersion( $DBversion ) ) {
$dbh->do(q|
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
VALUES ('SelfCheckInMainUserBlock', '', '70|10', 'Add a block of HTML that will display on the self check-in screen.', 'Textarea');
});
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
VALUES ('SelfCheckInModule', 0, NULL, 'Enable the standalone self-checkin module.', 'YesNo');
|);
});
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
VALUES ('SelfCheckInModuleUserID', NULL, NULL, 'Patron ID (borrowernumber) to be allowed on the self-checkin module.', 'Integer');
});
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
VALUES ('SelfCheckInTimeout', 120, NULL, 'Define the number of seconds before the self check-in module times out.', 'Integer');
});
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
VALUES ('SelfCheckInUserCSS', '', NULL, 'Add CSS to be included in the self check-in module in an embedded <style> tag.', 'free');
});
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
VALUES ('SelfCheckInUserJS', '', NULL, 'Define custom javascript for inclusion in the self check-in module.', 'free');
});
# Add new userflag for self check
$dbh->do(q{
INSERT IGNORE INTO userflags (bit,flag,flagdesc,defaulton) VALUES
(23,'self_check','Self check modules',0);
});
# Add self check-in module subpermission
$dbh->do(q{
INSERT IGNORE INTO permissions (module_bit,code,description)
VALUES (23, 'self_checkin_module', 'Log into the self check-in module');
});
# Add self check-in module subpermission
$dbh->do(q{
INSERT IGNORE INTO permissions (module_bit,code,description)
VALUES (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID');
});
# Update patrons with self_checkout permission
# IMPORTANT: Needs to happen before removing the old subpermission
$dbh->do(q{
UPDATE user_permissions
SET module_bit = 23,
code = 'self_checkout_module'
WHERE module_bit = 1 AND code = 'self_checkout';
});
# Remove old self_checkout permission
$dbh->do(q{
DELETE IGNORE FROM permissions
WHERE code='self_checkout';
});
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 15492: Add a standalone self-checkin module)\n";

View File

@ -482,7 +482,11 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'),
('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'),
('SelfCheckHelpMessage','','70|10','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','Textarea'),
('SelfCheckInMainUserBlock','','70|10','Add a block of HTML that will display on the self check-in screen.','Textarea'),
('SelfCheckInModule', 0, NULL, 'Enable the standalone self-checkin module.', 'YesNo'),
('SelfCheckInTimeout','120','','Define the number of seconds before the self check-in module times out.','Integer'),
('SelfCheckInUserCSS','',NULL,'Add CSS to be included in the self check-in module in an embedded <style> tag.','free'),
('SelfCheckInUserJS','',NULL,'Define custom javascript for inclusion in the self check-in module.','free'),
('SelfCheckoutByLogin','1',NULL,'Have patrons login into the web-based self checkout system with their username/password or their cardnumber','YesNo'),
('SelfCheckReceiptPrompt','1','NULL','If ON, print receipt dialog pops up when self checkout is finished','YesNo'),
('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'),

View File

@ -19,5 +19,6 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES
(19, 'plugins', 'Koha plugins', '0'),
(20, 'lists', 'Lists', 0),
(21, 'clubs', 'Patron clubs', '0'),
(22,'ill','The Interlibrary Loans Module',0)
(22,'ill','The Interlibrary Loans Module',0),
(23,'self_check','Self check modules',0)
;

View File

@ -4,7 +4,6 @@ INSERT INTO permissions (module_bit, code, description) VALUES
( 1, 'overdues_report', 'Execute overdue items report'),
( 1, 'force_checkout', 'Force checkout if a limitation exists'),
( 1, 'manage_restrictions', 'Manage restrictions for accounts'),
( 1, 'self_checkout', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID'),
( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
( 3, 'manage_circ_rules', 'Manage circulation rules'),
( 4, 'edit_borrowers', 'Add, modify and view patron information'),
@ -83,5 +82,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(20, 'delete_public_lists', 'Delete public lists'),
(21, 'edit_templates', 'Create and update club templates'),
(21, 'edit_clubs', 'Create and update clubs'),
(21, 'enroll', 'Enroll patrons in clubs')
(21, 'enroll', 'Enroll patrons in clubs'),
(23, 'self_checkin_module', 'Log into the self check-in module'),
(23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID')
;

View File

@ -21,17 +21,17 @@
[%- CASE 'lists' -%]<span>Lists</span>
[%- CASE 'clubs' -%]<span>Patron clubs</span>
[%- CASE 'ill' -%]<span>Create and modify Interlibrary loan requests</span>
[%- CASE 'self_check' -%]<span>Self check modules</span>
[%- END -%]
[%- END -%]
[%- BLOCK sub_permissions -%]
[% SWITCH name %]
[% SWITCH name %]
[%- CASE 'circulate_remaining_permissions' -%]<span>Remaining circulation permissions</span>
[%- CASE 'force_checkout' -%]<span>Force checkout if a limitation exists</span>
[%- CASE 'manage_restrictions' -%]<span>Manage restrictions for accounts</span>
[%- CASE 'overdues_report' -%]<span>Execute overdue items report</span>
[%- CASE 'override_renewals' -%]<span>Override blocked renewals</span>
[%- CASE 'self_checkout' -%]<span>Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID</span>
[%- CASE 'manage_circ_rules' -%]<span>manage circulation rules</span>
[%- CASE 'parameters_remaining_permissions' -%]<span>Remaining system parameters permissions</span>
[%- CASE 'edit_borrowers' -%]<span>Add, modify and view patron information</span>
@ -111,5 +111,8 @@
[%- CASE 'edit_templates' -%]<span>Create and edit club templates</span>
[%- CASE 'enroll' -%]<span>Enroll patrons in clubs</span>
[%- CASE 'edi_manage' -%]<span>Manage EDIFACT transmissions</span>
[%- END -%]
[%# self_check %]
[%- CASE 'self_checkin_module' -%]<span>Log into the self check-in module. Note: this permission prevents the patron from using any other OPAC functionality</span>
[%- CASE 'self_checkout_module' -%]<span>Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID</span>
[%- END -%]
[%- END -%]

View File

@ -784,12 +784,32 @@ Circulation:
type: textarea
class: code
Self check-in module:
-
- "Include the following HTML on the self check-in screen:"
- pref: SelfCheckInMainUserBlock
type: textarea
class: code
-
- pref: SelfCheckInModule
choices:
yes: Enable
no: "Don't enable"
- "the standalone self check-in module (available at: /cgi-bin/koha/sci/sci-main.pl)"
-
- "Reset the current self check-in screen after"
- pref: SelfCheckInTimeout
class: integer
- seconds.
-
- "Include the following CSS on all the self check-in screens:"
- pref: SelfCheckInUserCSS
type: textarea
class: code
-
- "Include the following JavaScript on all the self check-in screens:"
- pref: SelfCheckInUserJS
type: textarea
class: code
Self Checkout:
-
- "Include the following JavaScript on all pages in the web-based self checkout:"