Bugzilla – Attachment 56030 Details for
Bug 17386
Add opac notes for patron to self checkout screen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17386: Simplify code
Bug-17386-Simplify-code.patch (text/plain), 5.51 KB, created by
Jonathan Druart
on 2016-10-04 12:58:44 UTC
(
hide
)
Description:
Bug 17386: Simplify code
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-10-04 12:58:44 UTC
Size:
5.51 KB
patch
obsolete
>From 57de16c0074dca2ee2cdd6ae991ea0b6f717e63c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 4 Oct 2016 13:58:13 +0100 >Subject: [PATCH] Bug 17386: Simplify code > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../opac-tmpl/bootstrap/en/includes/opac-note.inc | 26 ++++++++++++---------- > .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 5 ++--- > .../opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 4 +--- > opac/opac-user.pl | 11 +-------- > opac/sco/sco-main.pl | 16 ++++--------- > 5 files changed, 22 insertions(+), 40 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc >index e5dff6c..e2b3d67 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc >@@ -1,13 +1,15 @@ >-<div class="alert alert-info"> >- <h3>Messages for you</h3> >- <ul> >- [% FOREACH message IN patron_messages %] >- <li> >- <strong>[% message.message %]</strong><br> >- <i>Written on [% message.message_date | $KohaDates %] by [% Branches.GetName(message.branchcode) %]</i> >- </li> >- [% END %] >+[% IF patron_messages.count OR opacnote %] >+ <div class="alert alert-info"> >+ <h3>Messages for you</h3> >+ <ul> >+ [% FOREACH message IN patron_messages %] >+ <li> >+ <strong>[% message.message %]</strong><br> >+ <i>Written on [% message.message_date | $KohaDates %] by [% Branches.GetName(message.branchcode) %]</i> >+ </li> >+ [% END %] > >- [% IF ( opacnote ) %]<li>[% opacnote %]</li>[% END %] >- </ul> >-</div> >+ [% IF ( opacnote ) %]<li>[% opacnote %]</li>[% END %] >+ </ul> >+ </div> >+[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 5a857f3..b7ac6f9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -40,9 +40,8 @@ Using this account is not recommended because some parts of Koha will not functi > </div> > [% END %] > >- [% IF ( bor_messages ) %] >- [% INCLUDE 'opac-note.inc' %] >- [% END %] >+ [% INCLUDE 'opac-note.inc' %] >+ > <h2>Hello, [% INCLUDE 'patron-title.inc' category_type = BORROWER_INFO.category_type firstname = BORROWER_INFO.firstname surname = BORROWER_INFO.surname othernames = BORROWER_INFO.othernames cardnumber = BORROWER_INFO.cardnumber %] > </h2> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index e3b5413..3e5d7f4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -166,9 +166,7 @@ > [% IF ( patronid ) %] > [% IF ( validuser ) %] > <div class="alert alert-info">You are logged in as [% borrowername %].</div> >- [% IF ( bor_messages ) %] >- [% INCLUDE 'opac-note.inc' %] >- [% END %] >+ [% INCLUDE 'opac-note.inc' %] > [% END %] > > [% IF ( nouser ) %] >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 7eb8749..0ac78de 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -308,16 +308,6 @@ my $patron_messages = Koha::Patron::Messages->search( > message_type => 'B', > } > ); >-if ( $patron_messages->count ) { >- $template->param( bor_messages => 1 ); >-} >- >-if ( $borr->{'opacnote'} ) { >- $template->param( >- bor_messages => 1, >- opacnote => $borr->{'opacnote'}, >- ); >-} > > if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') > || C4::Context->preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') ) >@@ -336,6 +326,7 @@ if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor' > $template->param( > borrower => $borr, > patron_messages => $patron_messages, >+ opacnote => $borr->{opacnote}, > patronupdate => $patronupdate, > OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"), > userview => 1, >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index 8d2a1ae..0a59d3b 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -257,18 +257,10 @@ if ($borrower->{cardnumber}) { > message_type => 'B', > } > ); >- if ( $patron_messages->count ) { >- $template->param( bor_messages => 1, >- patron_messages => $patron_messages, >- ); >- } >- >- if ( $borrower->{'opacnote'} ) { >- $template->param( >- bor_messages => 1, >- opacnote => $borrower->{'opacnote'}, >- ); >- } >+ $template->param( >+ patron_messages => $patron_messages, >+ opacnote => $borrower->{opacnote}, >+ ); > > my $inputfocus = ($return_only == 1) ? 'returnbook' : > ($confirm_required == 1) ? 'confirm' : 'barcode' ; >-- >2.8.1
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 17386
:
55963
|
55987
|
56029
| 56030