From 93a195af9b4b902de4ee593e5341b244c579bd51 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 https://bugs.koha-community.org/show_bug.cgi?id=20797 --- .../bug_20772-add-price_paid_column_to_illrequests.perl | 2 +- .../bug_20772-add-readonly-flag-to-illrequestattributes.perl | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 10 +++++----- koha-tmpl/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 5d32fb7..f720792 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 ab64c15..7707bc5 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 0d1ec14..9dd1326 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 @@ -441,7 +441,7 @@
  • - [% request.cost || 'N/A' | html %] + [% IF request.cost %][% request.cost | html %][% ELSE %]N/A[% END %]
  • @@ -514,7 +514,7 @@
    Order ID: - [% request.orderid || "N/A" | html %] + [% IF request.orderid %][% request.orderid | html %][% ELSE %]N/A[% END %]
    Patron: @@ -526,7 +526,7 @@
    Bibliographic record ID: - [% request.biblio_id || "N/A" | html %] + [% IF request.biblio_id %][% request.biblio_id | html %][% ELSE %]N/A[% END %]
    Library: @@ -546,11 +546,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 838f827..c44f419 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.1.4