From 200a468a9c4a75f48ef2fbe77af03c497347c79f Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 8 Jun 2018 10:24:19 +0200 Subject: [PATCH] Bug 12395: Add FK constraint and use patron-title.inc Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens --- .../Bug-12395-add-column-aqorders.created_by.sql | 1 + installer/data/mysql/kohastructure.sql | 1 + .../intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 7 +------ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/installer/data/mysql/atomicupdate/Bug-12395-add-column-aqorders.created_by.sql b/installer/data/mysql/atomicupdate/Bug-12395-add-column-aqorders.created_by.sql index 4d2a0fbf23..84a0f5d48b 100644 --- a/installer/data/mysql/atomicupdate/Bug-12395-add-column-aqorders.created_by.sql +++ b/installer/data/mysql/atomicupdate/Bug-12395-add-column-aqorders.created_by.sql @@ -1,2 +1,3 @@ ALTER TABLE aqorders ADD COLUMN created_by int(11) NULL DEFAULT NULL AFTER quantityreceived; +ALTER TABLE aqorders ADD CONSTRAINT aqorders_created_by FOREIGN KEY (created_by) REFERENCES borrowers (borrowernumber) ON DELETE SET NULL ON UPDATE CASCADE; UPDATE aqorders, aqbasket SET aqorders.created_by = aqbasket.authorisedby WHERE aqorders.basketno = aqbasket.basketno; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index c6f7f019d0..20b1a5716e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3202,6 +3202,7 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items KEY `budget_id` (`budget_id`), KEY `parent_ordernumber` (`parent_ordernumber`), KEY `orderstatus` (`orderstatus`), + CONSTRAINT aqorders_created_by FOREIGN KEY (created_by) REFERENCES borrowers (borrowernumber) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `aqorders_budget_id_fk` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `aqorders_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 48b39436a5..8bb78417fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -176,12 +176,7 @@
  • - [% IF creator and (creator.firstname or creator.surname) %] - [% creator.firstname %] - [% creator.surname %] - [% ELSE %] - No name - [% END %] + [% INCLUDE 'patron-title.inc' patron = creator %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt index 072e101959..6d525bff6c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt @@ -13,7 +13,7 @@
  • Ordered by: - [% creator.firstname %] [% creator.surname %] + [% INCLUDE 'patron-title.inc' patron = creator %]
  • Claims count: -- 2.39.5