From 925f4ca1da780255163231a9d90cfe2e5424b943 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Fri, 5 Oct 2018 11:56:31 +0100 Subject: [PATCH] Bug 20772: (follow-up) Fix DB updates and templates Carry out changes requested in commenbt #27 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- ...bug_20772-add-price_paid_column_to_illrequests.perl | 2 +- ...0772-add-readonly-flag-to-illrequestattributes.perl | 2 +- .../intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 10 +++++----- .../opac-tmpl/bootstrap/en/modules/opac-illrequests.tt | 10 +++++++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl b/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl index 5d32fb7914..f7207926ab 100644 --- a/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl +++ b/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl @@ -2,7 +2,7 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { if( !column_exists( 'illrequests', 'price_paid' ) ) { - $dbh->do( "ALTER TABLE illrequests ADD COLUMN price_paid varchar(20) DEFAULT NULL" ); + $dbh->do( "ALTER TABLE illrequests ADD COLUMN price_paid varchar(20) DEFAULT NULL AFTER 'cost'" ); } SetVersion( $DBversion ); diff --git a/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl b/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl index ab64c158be..7707bc55e8 100644 --- a/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl +++ b/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl @@ -2,7 +2,7 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { if( !column_exists( 'illrequestattributes', 'readonly' ) ) { - $dbh->do( "ALTER TABLE illrequestattributes ADD COLUMN readonly tinyint(1) NOT NULL DEFAULT 1" ); + $dbh->do( "ALTER TABLE illrequestattributes ADD COLUMN readonly tinyint(1) NOT NULL DEFAULT 1 AFTER 'value'" ); $dbh->do( "UPDATE illrequestattributes SET readonly = 1" ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 74d748a396..8b9ac8a52b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -429,7 +429,7 @@
  • - [% request.cost || 'N/A' | html %] + [% IF request.cost %][% request.cost | html %][% ELSE %]N/A[% END %]
  • @@ -502,7 +502,7 @@
    Order ID: - [% request.orderid || "N/A" | html %] + [% IF request.orderid %][% request.orderid | html %][% ELSE %]N/A[% END %]
    Patron: @@ -514,7 +514,7 @@
    Bibliographic record ID: - [% request.biblio_id || "N/A" | html %] + [% IF request.biblio_id %][% request.biblio_id | html %][% ELSE %]N/A[% END %]
    Library: @@ -534,11 +534,11 @@
    Cost: - [% request.cost || "N/A" | html %] + [% IF request.cost %][% request.cost | html %][% ELSE %]N/A[% END %]
    Price paid: - [% request.price_paid || "N/A" %] + [% IF request.price_paid %][% request.price_paid | html %][% ELSE %]N/A[% END %]
    Request number: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt index 838f827951..c44f4199a1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt @@ -125,8 +125,12 @@ [% FOREACH request IN requests %] [% status = request.status | html %] - [% request.metadata.Author || 'N/A' | html %] - [% request.metadata.Title || 'N/A' | html %] + + [% IF request.metadata.Author %][% request.metadata.Author | html %][% ELSE %]N/A[% END %] + + + [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]N/A[% END %] + [% request.backend | html %] [% request.medium | html %] [% request.capabilities.$status.name | html %] @@ -192,7 +196,7 @@ [% FOREACH meta IN request.metadata %]
    [% meta.key | html %]: - [% meta.value || 'N/A' | html %] + [% IF meta.value %][% meta.value | html %][% ELSE %]N/A[% END %]
    [% END %]
    -- 2.39.5