Bugzilla – Attachment 39088 Details for
Bug 6379
Remove link from unapproved and rejected tags in the OPAC's "My tags" table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 6379: Remove link from unapproved tags
SIGNED-OFF-Bug-6379-Remove-link-from-unapproved-ta.patch (text/plain), 4.01 KB, created by
Bernardo Gonzalez Kriegel
on 2015-05-12 15:01:03 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 6379: Remove link from unapproved tags
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-05-12 15:01:03 UTC
Size:
4.01 KB
patch
obsolete
>From bf2a2aff580a4c96efef0e2e7c9add75ea48c745 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 25 Mar 2015 13:44:25 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 6379: Remove link from unapproved tags > >At the OPAC, if the tag is not approved, the tag's link did not return >any result. > >This patch removes the link. >Test plan: >1/ Set TagsModeration to 'Require' >2/ Create tags at the OPAC >3/ Approve a couple >4/ Confirm that unapproved tags does not have links. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >works as described, no errors > >For the (approved) link to work I need to install YAML::XS >--- > .../opac-tmpl/bootstrap/en/modules/opac-tags.tt | 9 +++++-- > opac/opac-tags.pl | 26 +++++++++++--------- > 2 files changed, 21 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt >index b9a7072..14c5f32 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt >@@ -121,8 +121,13 @@ > <tr> > <td class="tagterm"> > <span class="tdlabel">Tag:</span> >- <a href="/cgi-bin/koha/opac-search.pl?tag=[% MY_TAG.term |url %]&q=[% MY_TAG.term |url %]"> >- [% MY_TAG.term |html %]</a></td> >+ [% IF MY_TAG.approved == 1 %] >+ <a href="/cgi-bin/koha/opac-search.pl?tag=[% MY_TAG.term |url %]&q=[% MY_TAG.term |url %]">[% MY_TAG.term |html %]</a> >+ [% ELSE %] >+ [% MY_TAG.term |html %] (not approved) >+ [% END %] >+ </td> >+ > <td> > [% IF ( MY_TAG.XSLTBloc ) %] > [% MY_TAG.XSLTBloc %] >diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl >index f41fae7..19994d1 100755 >--- a/opac/opac-tags.pl >+++ b/opac/opac-tags.pl >@@ -226,20 +226,22 @@ my $results = []; > my $my_tags = []; > > if ($loggedinuser) { >- $my_tags = get_tag_rows({borrowernumber=>$loggedinuser}); >- foreach (@$my_tags) { >- my $biblio = GetBiblioData($_->{biblionumber}); >- my $record = &GetMarcBiblio( $_->{biblionumber} ); >- $_->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $_->{biblionumber} ) ); >- $_->{title} = $biblio->{title}; >- $_->{author} = $biblio->{author}; >+ $my_tags = get_tag_rows({borrowernumber=>$loggedinuser}); >+ my $my_approved_tags = get_approval_rows({borrowernumber => $loggedinuser, approved => 1}); >+ foreach my $tag (@$my_tags) { >+ my $biblio = GetBiblioData($tag->{biblionumber}); >+ my $record = &GetMarcBiblio( $tag->{biblionumber} ); >+ $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) ); >+ $tag->{title} = $biblio->{title}; >+ $tag->{author} = $biblio->{author}; > if (C4::Context->preference("OPACXSLTResultsDisplay")) { >- $_->{XSLTBloc} = XSLTParse4Display($_->{biblionumber}, $record, "OPACXSLTResultsDisplay"); >+ $tag->{XSLTBloc} = XSLTParse4Display($tag->{biblionumber}, $record, "OPACXSLTResultsDisplay"); > } >- my $date = $_->{date_created} || ''; >- $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/; >- $_->{time_created_display} = $1; >- } >+ my $date = $tag->{date_created} || ''; >+ $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/; >+ $tag->{time_created_display} = $1; >+ $tag->{approved} = ( grep { $_->{term} eq $tag->{term} and $_->{approved} } @$my_approved_tags ); >+ } > } > > $template->param(tagsview => 1); >-- >1.7.9.5
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 6379
:
5266
|
37211
|
37222
|
37259
|
39088
|
40915
|
43084
|
43085