Bugzilla – Attachment 149492 Details for
Bug 33104
Add vendor interfaces
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33104: DB changes
Bug-33104-DB-changes.patch (text/plain), 6.96 KB, created by
Katrin Fischer
on 2023-04-11 21:13:19 UTC
(
hide
)
Description:
Bug 33104: DB changes
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-04-11 21:13:19 UTC
Size:
6.96 KB
patch
obsolete
>From c484e3f47442ac2ca09529acd46d3aa34c7ca958 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 1 Mar 2023 15:18:17 +0100 >Subject: [PATCH] Bug 33104: DB changes > >Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> >--- > .../data/mysql/atomicupdate/bug_33104.pl | 42 +++++++++++++++++++ > .../data/mysql/en/mandatory/auth_values.yml | 12 ++++++ > installer/data/mysql/kohastructure.sql | 22 ++++++++++ > .../data/mysql/mandatory/auth_val_cat.sql | 3 +- > .../en/modules/admin/authorised_values.tt | 2 + > 5 files changed, 80 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_33104.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_33104.pl b/installer/data/mysql/atomicupdate/bug_33104.pl >new file mode 100755 >index 0000000000..0fb650ca02 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_33104.pl >@@ -0,0 +1,42 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "33104", >+ description => "Add vendor interfaces", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ unless ( TableExists('aqbookseller_interfaces') ) { >+ $dbh->do(q{ >+ CREATE TABLE `aqbookseller_interfaces` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha', >+ `vendor_id` int(11) NOT NULL COMMENT 'link to the vendor', >+ `type` varchar(80) DEFAULT NULL COMMENT "type of the interface, authorised value VENDOR_INTERFACE_TYPE", >+ `name` varchar(255) NOT NULL COMMENT 'name of the interface', >+ `uri` mediumtext DEFAULT NULL COMMENT 'uri of the interface', >+ `login` varchar(255) DEFAULT NULL COMMENT 'login', >+ `password` mediumtext DEFAULT NULL COMMENT 'hashed password', >+ `account_email` mediumtext DEFAULT NULL COMMENT 'account email', >+ `notes` longtext DEFAULT NULL COMMENT 'notes', >+ PRIMARY KEY (`id`), >+ CONSTRAINT `aqbookseller_interfaces_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ }); >+ say $out "Added new table 'aqbookseller_interfaces'"; >+ } >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO authorised_value_categories (category_name, is_system) >+ VALUES >+ ('VENDOR_INTERFACE_TYPE', 1) >+ }); >+ $dbh->do(q{ >+ INSERT IGNORE INTO authorised_values (category, authorised_value, lib) >+ VALUES >+ ('VENDOR_INTERFACE_TYPE', 'ADMIN', 'Admin'), >+ ('VENDOR_INTERFACE_TYPE', 'ORDERS', 'Orders'), >+ ('VENDOR_INTERFACE_TYPE', 'REPORTS', 'Reports') >+ }); >+ say $out "Added new authorised value category 'VENDOR_INTERFACE_TYPE'"; >+ }, >+}; >diff --git a/installer/data/mysql/en/mandatory/auth_values.yml b/installer/data/mysql/en/mandatory/auth_values.yml >index 5bfea57674..431d2df76c 100644 >--- a/installer/data/mysql/en/mandatory/auth_values.yml >+++ b/installer/data/mysql/en/mandatory/auth_values.yml >@@ -258,6 +258,18 @@ tables: > authorised_value: "audiobook" > lib: "Audiobook" > >+ - category: "VENDOR_INTERFACE_TYPE" >+ authorised_value: "ADMIN" >+ lib: "Admin" >+ >+ - category: "VENDOR_INTERFACE_TYPE" >+ authorised_value: "ORDERS" >+ lib: "Orders" >+ >+ - category: "VENDOR_INTERFACE_TYPE" >+ authorised_value: "REPORTS" >+ lib: "Reports" >+ > # Country codes > - authorised_values: > translatable: [ lib, lib_opac ] >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 4651cf9de5..e4d7060ae7 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -440,6 +440,28 @@ CREATE TABLE `aqbookseller_aliases` ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >+-- >+-- Table structure for table `aqbookseller_interfaces` >+-- >+ >+DROP TABLE IF EXISTS `aqbookseller_interfaces`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8 */; >+CREATE TABLE `aqbookseller_interfaces` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha', >+ `vendor_id` int(11) NOT NULL COMMENT 'link to the vendor', >+ `type` varchar(80) DEFAULT NULL COMMENT "type of the interface, authorised value VENDOR_INTERFACE_TYPE", >+ `name` varchar(255) NOT NULL COMMENT 'name of the interface', >+ `uri` mediumtext DEFAULT NULL COMMENT 'uri of the interface', >+ `login` varchar(255) DEFAULT NULL COMMENT 'login', >+ `password` mediumtext DEFAULT NULL COMMENT 'hashed password', >+ `account_email` mediumtext DEFAULT NULL COMMENT 'account email', >+ `notes` longtext DEFAULT NULL COMMENT 'notes', >+ PRIMARY KEY (`id`), >+ CONSTRAINT `aqbookseller_interfaces_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+/*!40101 SET character_set_client = @saved_cs_client */; >+ > -- > -- Table structure for table `aqbudgetborrowers` > -- >diff --git a/installer/data/mysql/mandatory/auth_val_cat.sql b/installer/data/mysql/mandatory/auth_val_cat.sql >index 90a97678b7..088017de93 100644 >--- a/installer/data/mysql/mandatory/auth_val_cat.sql >+++ b/installer/data/mysql/mandatory/auth_val_cat.sql >@@ -20,7 +20,8 @@ INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) > ('HOLD_CANCELLATION', 0), > ('ROADTYPE', 0), > ('AR_CANCELLATION', 0), >- ('VENDOR_TYPE', 1); >+ ('VENDOR_TYPE', 1), >+ ('VENDOR_INTERFACE_TYPE', 1); > > INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) > VALUES >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >index 9a26c45a94..0eb469f199 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >@@ -587,6 +587,8 @@ > <p>Categories to be assigned to file uploads. Without a category an upload is considered temporary and may be removed during automated cleanup.</p> > [% CASE 'VENDOR_TYPE' %] > <p>Values that can be entered to fill in the 'Vendor type' field in the acquisitions module, that can be used for statistical purposes</p> >+ [% CASE 'VENDOR_INTERFACE_TYPE' %] >+ <p>Values that can be entered to fill in the 'Vendor interface type' field in the acquisitions module</p> > [% CASE 'WITHDRAWN' %] > <p>Description of a withdrawn item (appears when adding or editing an item)</p> > [% CASE 'YES_NO' %] >-- >2.30.2
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 33104
:
147632
|
147633
|
147634
|
147635
|
147636
|
147637
|
147638
|
147639
|
148459
|
148460
|
148461
|
148462
|
148463
|
148464
|
148465
|
148466
|
148473
|
148474
|
148475
|
148476
|
148477
|
148478
|
148479
|
148480
|
149375
|
149420
|
149421
|
149422
|
149431
| 149492 |
149493
|
149494
|
149495
|
149496
|
149497
|
149498
|
149499
|
149500
|
149501
|
149502
|
149503
|
149631
|
149632