Bugzilla – Attachment 72179 Details for
Bug 15492
Stand alone self check-in tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15492: New sysprefs and permissions
Bug-15492-New-sysprefs-and-permissions.patch (text/plain), 11.29 KB, created by
Josef Moravec
on 2018-02-25 08:53:44 UTC
(
hide
)
Description:
Bug 15492: New sysprefs and permissions
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-02-25 08:53:44 UTC
Size:
11.29 KB
patch
obsolete
>From 1a99d6a9c149a2eb68339a80fde8c93d2ccc2749 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 27 Dec 2017 12:24:36 -0300 >Subject: [PATCH] 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> >--- > installer/data/mysql/atomicupdate/bug_15492.perl | 62 +++++++++++++++++++++- > installer/data/mysql/sysprefs.sql | 4 ++ > installer/data/mysql/userflags.sql | 3 +- > installer/data/mysql/userpermissions.sql | 5 +- > .../intranet-tmpl/prog/en/includes/permissions.inc | 9 ++-- > .../en/modules/admin/preferences/circulation.pref | 20 +++++++ > 6 files changed, 95 insertions(+), 8 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_15492.perl b/installer/data/mysql/atomicupdate/bug_15492.perl >index f467807..54d37bc 100644 >--- a/installer/data/mysql/atomicupdate/bug_15492.perl >+++ b/installer/data/mysql/atomicupdate/bug_15492.perl >@@ -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"; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index c6cdcd0..6f03f66 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -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'), >diff --git a/installer/data/mysql/userflags.sql b/installer/data/mysql/userflags.sql >index 854e882..3e8f5dc 100644 >--- a/installer/data/mysql/userflags.sql >+++ b/installer/data/mysql/userflags.sql >@@ -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) > ; >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index 52adbce..2ea387e 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -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') > ; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 7dde923..78f4995 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -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 -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index c04eda5..02940df 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -785,11 +785,31 @@ Circulation: > 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:" >-- >2.1.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 15492
:
69165
|
69166
|
69167
|
69168
|
69179
|
69664
|
69665
|
70073
|
70074
|
70075
|
70173
|
70174
|
70175
|
70176
|
70177
|
70178
|
70179
|
72053
|
72054
|
72055
|
72056
|
72057
|
72058
|
72059
|
72060
|
72176
|
72177
|
72178
| 72179 |
72180
|
72181
|
72182
|
72183
|
73097