Bug 12395: Add FK constraint and use patron-title.inc
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 8 Jun 2018 08:24:19 +0000 (10:24 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 6 Jul 2018 14:01:51 +0000 (14:01 +0000)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

installer/data/mysql/atomicupdate/Bug-12395-add-column-aqorders.created_by.sql
installer/data/mysql/kohastructure.sql
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt

index 4d2a0fb..84a0f5d 100644 (file)
@@ -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;
index c6f7f01..20b1a57 100644 (file)
@@ -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,
index 48b3943..8bb7841 100644 (file)
        <li>
         <label for="creator">Ordered by: </label>
         <span>
-          [% IF creator and (creator.firstname or creator.surname) %]
-            [% creator.firstname %]
-            [% creator.surname %]
-          [% ELSE %]
-            No name
-          [% END %]
+            [% INCLUDE 'patron-title.inc' patron = creator %]
         </span>
        </li>
        <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
index 072e101..6d525bf 100644 (file)
@@ -13,7 +13,7 @@
                     </li>
                     <li>
                         <span class="label">Ordered by: </span>
-                        [% creator.firstname %] [% creator.surname %]
+                        [% INCLUDE 'patron-title.inc' patron = creator %]
                     </li>
                     <li>
                         <span class="label">Claims count: </span>