Bugzilla – Attachment 126994 Details for
Bug 29075
OPAC info should not be displayed in libraries table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29075: 'OPAC info' removed in branches.pl
Bug-29075-OPAC-info-removed-in-branchespl.patch (text/plain), 9.06 KB, created by
Jérémy Breuillard
on 2021-10-27 13:16:17 UTC
(
hide
)
Description:
Bug 29075: 'OPAC info' removed in branches.pl
Filename:
MIME Type:
Creator:
Jérémy Breuillard
Created:
2021-10-27 13:16:17 UTC
Size:
9.06 KB
patch
obsolete
>From ee9d20a0b2fe5a6d2cf4c8d50d04e9670cf5d9ed Mon Sep 17 00:00:00 2001 >From: jeremy breuillard <jeremy.breuillard@biblibre.com> >Date: Wed, 27 Oct 2021 12:41:36 +0000 >Subject: [PATCH] Bug 29075: 'OPAC info' removed in branches.pl >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >In Administration ⺠Libraries, we see content of OPAC info as >escaped HTML. >This content may be long and seeing HTML tags is strange. > >We should not show it in this table. >Or maybe create a modal preview of it (not escaped HTML). > >To test : >1) Home > Administration > Libraries >2) In 'Address' column notice the 'OPAC info' field (if this one is filled) with visible HTML tags >3) Apply patch >4) Repeat 1) and 'OPAC info' field should be gone >--- > .../prog/en/modules/admin/branches.tt | 1 - > .../prog/en/modules/intranet-main.tt | 41 ++++++++++++++++++- > mainpage.pl | 21 ++++++++++ > 3 files changed, 60 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >index 6ce5842..22e4c8f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >@@ -385,7 +385,6 @@ Libraries › Administration › Koha > if ( row.fax != null ) library_info.push(_("Fax: ") + row.fax.escapeHtml()); > if ( row.email != null ) library_info.push('<a href="mailto:'+encodeURIComponent(row.email)+'">'+row.email.escapeHtml()+'</a>'); > if ( row.url != null ) library_info.push('<a href="'+encodeURIComponent(row.url)+'">'+row.url.escapeHtml()+'</a>'); >- if ( row.opac_info != null ) library_info.push(_("OPAC Info") + ': <div>'+row.opac_info.escapeHtml()+'</div>'); > if ( row.notes != null ) library_info.push(_("Notes")+': '+row.notes.escapeHtml()); > return library_info.join('<br/>'); > }, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index b97e4d4..3b5df77 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -13,6 +13,7 @@ > [% INCLUDE 'header.inc' %] > [% INCLUDE 'home-search.inc' %] > >+ > <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> > <ol> > <li> >@@ -165,7 +166,7 @@ > <div class="row"> > <div class="col-sm-12"> > [%# Following statement must be in one line for translatability %] >- [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && pendingsuggestions ) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) %] >+ [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && pendingsuggestions ) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || patrons.size > 0 || selfRegisteredPatrons > 0 %] > <div id="area-pending"> > [% IF pending_article_requests %] > <div class="pending-info" id="article_requests_pending"> >@@ -182,6 +183,7 @@ > <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED"> > <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% pendingsuggestions | html %]</span> > </a> >+ > [% IF (all_pendingsuggestions > 0) %] > / > <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED"> >@@ -191,7 +193,7 @@ > </div> > [% END %] > >- [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) %] >+ [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) %] > <div class="pending-info" id="comments_pending"> > <a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments pending approval</a>: > <span class="pending-number-link">[% pendingcomments | html %]</span> >@@ -233,7 +235,34 @@ > <span class="pending-number-link">[% pending_problem_reports.count | html %]</span> > </div> > [% END %] >+ >+ [% IF selfRegisteredPatrons.size > 0 %] >+ <div class="pending-info"> >+ >+ Pre-registered patron(s) from: >+ >+ <form action ="/cgi-bin/koha/members/member.pl" method="post"> >+ <input type="hidden" name="categorycode_filter" value="[% PatronSelfRegistrationDefaultCategory %]"> >+ <a class="pre-registration-link pending-number-link pre-registration-link-all" href="#">All libraries: [% selfRegisteredPatrons.size %]</a> >+ </form> >+ [% END %] >+ >+ [% IF branch %] >+ >+ [% IF pre_insc.size >= 1 %] >+ >+ <form action="/cgi-bin/koha/members/member.pl" method="post"> >+ <input type="hidden" name="branchcode_filter" value="[% branch %]"> >+ <input type="hidden" name="categorycode_filter" value="[% PatronSelfRegistrationDefaultCategory %]"> >+ <span>/</span> >+ <a class="pre-registration-link pending-number-link pre-registration-link-branch" href="#">[% Branches.GetLoggedInBranchname | html %]: [% pre_insc.size %]</a> >+ </form> >+ >+ [% END %] >+ >+ </div> > >+ [% END %] > </div> > > [% END %] >@@ -268,6 +297,14 @@ > }); > //]]> > </script> >+ <script> >+ $(document).ready(function(){ >+ $(".pre-registration-link").on("click", function(){ >+ this.closest("form").submit(); >+ }) >+ }); >+ </script> >+ > [% END %] > <!-- the main div is closed in intranet-bottom.inc --> > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/mainpage.pl b/mainpage.pl >index ab7089c..75e4a10 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -33,6 +33,9 @@ use Koha::ArticleRequests; > use Koha::ProblemReports; > use Koha::Quotes; > use Koha::Suggestions; >+use Template::Stash; >+ >+use Data::Dumper; > > my $query = CGI->new; > >@@ -99,6 +102,24 @@ my $pending_article_requests = Koha::ArticleRequests->search_limited( > )->count; > my $pending_problem_reports = Koha::ProblemReports->search({ status => 'New' }); > >+ >+my $PatronSelfRegistrationDefaultCategory = C4::Context->preference('PatronSelfRegistrationDefaultCategory'); >+if ($PatronSelfRegistrationDefaultCategory) { >+ my @selfRegisteredPatrons = Koha::Patrons->search({ categorycode => $PatronSelfRegistrationDefaultCategory }); >+ my $homebranch = C4::Context->userenv->{'branch'}; >+ my @pre_insc = Koha::Patrons->search({ categorycode => $PatronSelfRegistrationDefaultCategory, branchcode => $homebranch }); >+ >+ $template->param( >+ selfRegisteredPatrons => \@selfRegisteredPatrons, >+ PatronSelfRegistrationDefaultCategory => $PatronSelfRegistrationDefaultCategory, >+ branch => $homebranch, >+ pre_insc => \@pre_insc, >+ >+ ); >+} >+ >+ >+ > $template->param( > pendingcomments => $pendingcomments, > pendingtags => $pendingtags, >-- >2.25.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 29075
:
126975
|
126987
|
126994
|
126996
|
127072
|
127127