Bugzilla – Attachment 100780 Details for
Bug 17268
Advanced cataloging editor - rancor - macros are lost when browser storage cleared
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17268: Add macros table and permissions
Bug-17268-Add-macros-table-and-permissions.patch (text/plain), 5.49 KB, created by
Andrew Fuerste-Henry
on 2020-03-16 17:14:58 UTC
(
hide
)
Description:
Bug 17268: Add macros table and permissions
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2020-03-16 17:14:58 UTC
Size:
5.49 KB
patch
obsolete
>From 00d2e3d7c521454529e243262aeedd92b66bb966 Mon Sep 17 00:00:00 2001 >From: Nick <nick@bywatersolutions.com> >Date: Wed, 2 Oct 2019 13:28:39 +0000 >Subject: [PATCH] Bug 17268: Add macros table and permissions > >Bug 17268: Change public to shared > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >--- > .../atomicupdate/bug_17268_add_macros_table.perl | 27 ++++++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 15 ++++++++++++ > installer/data/mysql/userpermissions.sql | 2 ++ > .../intranet-tmpl/prog/en/includes/permissions.inc | 10 ++++++++ > 4 files changed, 54 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_17268_add_macros_table.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_17268_add_macros_table.perl b/installer/data/mysql/atomicupdate/bug_17268_add_macros_table.perl >new file mode 100644 >index 0000000000..04b9728e19 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_17268_add_macros_table.perl >@@ -0,0 +1,27 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ unless ( TableExists('advanced_editor_macros') ) { >+ $dbh->do(q| >+ CREATE TABLE advanced_editor_macros ( >+ id INT(11) NOT NULL AUTO_INCREMENT, >+ name varchar(80) NOT NULL, >+ macro longtext NULL, >+ borrowernumber INT(11) default NULL, >+ shared TINYINT(1) default 0, >+ PRIMARY KEY (id), >+ CONSTRAINT borrower_macro_fk FOREIGN KEY ( borrowernumber ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;| >+ ); >+ } >+ $dbh->do(q| >+ INSERT IGNORE INTO permissions (module_bit, code, description) >+ VALUES (9, 'create_shared_macros', 'Create public macros') >+ |); >+ $dbh->do(q| >+ INSERT IGNORE INTO permissions (module_bit, code, description) >+ VALUES (9, 'delete_shared_macros', 'Delete public macros') >+ |); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 17682 - Add macros db table and permissions)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 0f092725b5..0f4f2a7f83 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4418,6 +4418,21 @@ CREATE TABLE return_claims ( > CONSTRAINT `rc_resolved_by_ibfk` FOREIGN KEY (`resolved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > >+-- >+-- Table structure for table advanced_editor_macros >+-- >+ >+DROP TABLE IF EXISTS advanced_editor_macros; >+CREATE TABLE advanced_editor_macros ( >+ id INT(11) NOT NULL AUTO_INCREMENT, -- Unique ID of the macro >+ name varchar(80) NOT NULL, -- Name of the macro >+ macro longtext NULL, -- The macro code itself >+ borrowernumber INT(11) default NULL, -- ID of the borrower who created this macro >+ shared TINYINT(1) default 0, -- Bit to define if shared or private macro >+ PRIMARY KEY (id), >+ CONSTRAINT borrower_macro_fk FOREIGN KEY ( borrowernumber ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ > /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; > /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; > /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index a6bc545449..454394b139 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -41,6 +41,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), > ( 9, 'fast_cataloging', 'Fast cataloging'), > ( 9, 'advanced_editor', 'Use the advanced cataloging editor (requires edit_catalogue)'), >+ ( 9, 'create_shared_macros', 'Create shared macros'), >+ ( 9, 'delete_shared_macros', 'Delete shared macros'), > ( 9, 'edit_items', 'Edit items'), > ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), > ( 9, 'delete_all_items', 'Delete all items at once'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index d431acdc3c..d8af4e2bbb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -287,6 +287,16 @@ > Use the advanced cataloging editor (requires edit_catalogue) > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'create_shared_macros' -%] >+ <span class="sub_permission create_shared_macros_subpermission"> >+ Create shared macros (requires advanced_editor) >+ </span> >+ <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'delete_shared_macros' -%] >+ <span class="sub_permission delete_shared_macros_subpermission"> >+ Delete shared macros (requires advanced_editor) >+ </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'edit_items' -%] > <span class="sub_permission edit_items_subpermission"> > Edit items >-- >2.11.0
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 17268
:
93474
|
95948
|
96616
|
96617
|
96618
|
96757
|
96758
|
96759
|
96760
|
100559
|
100560
|
100561
|
100562
|
100563
|
100564
|
100565
|
100569
|
100570
|
100571
|
100572
|
100573
|
100574
|
100575
|
100584
|
100604
|
100758
|
100759
|
100760
|
100761
|
100762
|
100763
|
100766
|
100767
|
100768
|
100769
|
100770
|
100771
|
100772
|
100773
|
100774
|
100775
|
100776
|
100777
|
100780
|
100781
|
100782
|
100783
|
100784
|
100785
|
100983
|
100984
|
100985
|
100986
|
100987
|
100988
|
101980
|
103507
|
103508
|
103509
|
103510
|
103511
|
103512
|
103513
|
103514
|
104144
|
104145
|
104146
|
104147
|
104148
|
104149
|
104150
|
104151
|
104152
|
104153