Bugzilla – Attachment 26917 Details for
Bug 11885
Inconsistent HTML in MARC Details
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 11885 - Inconsistent HTML in MARC Details
SIGNED-OFF-Bug-11885---Inconsistent-HTML-in-MARC-D.patch (text/plain), 22.46 KB, created by
Bernardo Gonzalez Kriegel
on 2014-04-09 11:40:57 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11885 - Inconsistent HTML in MARC Details
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-04-09 11:40:57 UTC
Size:
22.46 KB
patch
obsolete
>From 4709fc718437fae7472339f5f237fc84d8084336 Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@pttk.fi> >Date: Tue, 4 Mar 2014 08:57:11 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 11885 - Inconsistent HTML in MARC Details > >In Catalog > MARC Details, the HTML in the different tabs is slightly >inconsistent and doesn't differentiate different elements, making CSS >styling complicated or impossible: > >* tab 0 has <p class="subfield_line"> whereas all the other tabs > have just <p> > >* all other tabs wrap the subfield character in <b> tags, except > for tab 0 > >* the MARC tag title is a single div with the tag, the indicators > and the field description. > >Attached patch folds all the tab outputs into a single TT BLOCK, >which is then reused. It also marks the separate parts of the tag >title in their own spans. >The output should be nearly identical to previous behaviour, minus >a dash from the tag title descriptions - it was used to separate >the tag from the description. The description can now be styled >separately from the tag itself, so the dash can be added with CSS, >if necessary. > >Revised test: >1) Find a biblio >2) Edit the record so that there is something in every tab (0-9). >3) Save and then click 'MARC' in the left pane to view the > MARC details. >4) Note the contents of each tab. >5) Apply patch >6) Compare the MARC details output to what was noted. Should > be the same, minus a dash in each of the tag title descriptions. > >http://bugs.koha-community.org/show_bug.cgi?id=11885 > >Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi> >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > catalogue/MARCdetail.pl | 12 +- > .../prog/en/modules/catalogue/MARCdetail.tt | 339 +++----------------- > 2 files changed, 54 insertions(+), 297 deletions(-) > >diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl >index f8e4095..3c7b276 100755 >--- a/catalogue/MARCdetail.pl >+++ b/catalogue/MARCdetail.pl >@@ -149,7 +149,8 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { > $subfield_data{marc_tag} = '000'; > push( @subfields_data, \%subfield_data ); > my %tag_data; >- $tag_data{tag} = '000 -' . $tagslib->{'000'}->{lib}; >+ $tag_data{tag} = '000'; >+ $tag_data{tag_desc} = $tagslib->{'000'}->{lib}; > my @tmp = @subfields_data; > $tag_data{subfield} = \@tmp; > push( @loop_data, \%tag_data ); >@@ -236,12 +237,9 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { > $tag_data{tag} = $tagslib->{ $fields[$x_i]->tag() }->{lib}; > } > else { >- $tag_data{tag} = >- $fields[$x_i]->tag() >- . ' ' >- . C4::Koha::display_marc_indicators($fields[$x_i]) >- . ' - ' >- . $tagslib->{ $fields[$x_i]->tag() }->{lib}; >+ $tag_data{tag} = $fields[$x_i]->tag(); >+ $tag_data{tag_ind} = C4::Koha::display_marc_indicators($fields[$x_i]); >+ $tag_data{tag_desc} = $tagslib->{ $fields[$x_i]->tag() }->{lib}; > } > } > my @tmp = @subfields_data; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >index fd78eeb..69c1463 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >@@ -69,6 +69,45 @@ function Changefwk(FwkList) { > <span class="Z3988" title="[% ocoins %]"></span> > [% END %] > >+ >+[% BLOCK show_tab_html %] >+ <div id="[% tab_id %]"> >+ [% FOREACH tab0X IN tab_data %] >+ [% IF ( tab0X.tag ) %] >+ <div class="tag"> >+ <div class="tag_title"> >+ <span class="tag_num">[% tab0X.tag %]</span> >+ [% IF ( tab0X.tag_ind ) %] >+ <span class="tag_ind1">[% tab0X.tag_ind.substr(0, 1) %]</span> >+ <span class="tag_ind2">[% tab0X.tag_ind.substr(1, 1) %]</span> >+ [% END %] >+ [% IF (tab0X.tag_desc) %]<span class="tag_desc">[% tab0X.tag_desc %]</span>[% END %] >+ </div> >+ [% ELSE %] >+ <div class="tag"> >+ [% END %] >+ [% FOREACH subfiel IN tab0X.subfield %] >+ <p class="subfield_line"> >+ <span class="subfield-label"> >+ [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] >+ <span class="desc" title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >+ [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >+ [% IF ( subfiel.link ) %] >+ <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >+ <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >+ </a> >+ [% END %] >+ [% IF ( subfiel.authority ) %] >+ <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >+ [% END %] >+ </p> >+ [% END %] >+ </div> <!-- class='tag' --> >+ [% END %] >+ </div> >+[% END %] >+ >+ > <div id="bibliotabs" class="toptabs numbered"> > <ul> > [% IF ( tab0XX ) %] >@@ -105,305 +144,25 @@ function Changefwk(FwkList) { > <li><a href="#tab10XX">Item(s)</a></li> > [% END %] > </ul> >- <div id="tab0XX"> >- [% FOREACH tab0X IN tab0XX %] >- [% IF ( tab0X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab0X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab0X.subfield %] >- <p class="subfield_line"> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> <!-- class='tag' --> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab0XX" tab_data=tab0XX %] > >- <div id="tab1XX"> >- [% FOREACH tab1X IN tab1XX %] >- [% IF ( tab1X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab1X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab1X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab1XX" tab_data=tab1XX %] > >- <div id="tab2XX"> >- [% FOREACH tab2X IN tab2XX %] >- [% IF ( tab2X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab2X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab2X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab2XX" tab_data=tab2XX %] > >- <div id="tab3XX"> >- [% FOREACH tab3X IN tab3XX %] >- [% IF ( tab3X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab3X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab3X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab3XX" tab_data=tab3XX %] > >- <div id="tab4XX"> >- [% FOREACH tab4X IN tab4XX %] >- [% IF ( tab4X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab4X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab4X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab4XX" tab_data=tab4XX %] > >- <div id="tab5XX"> >- [% FOREACH tab5X IN tab5XX %] >- [% IF ( tab5X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab5X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab5X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab5XX" tab_data=tab5XX %] > >- <div id="tab6XX"> >- [% FOREACH tab6X IN tab6XX %] >- [% IF ( tab6X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab6X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab6X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab6XX" tab_data=tab6XX %] > >- <div id="tab7XX"> >- [% FOREACH tab7X IN tab7XX %] >- [% IF ( tab7X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab7X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab7X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab7XX" tab_data=tab7XX %] > >- <div id="tab8XX"> >- [% FOREACH tab8X IN tab8XX %] >- [% IF ( tab8X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab8X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab8X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab8XX" tab_data=tab8XX %] > >- <div id="tab9XX"> >- [% FOREACH tab9X IN tab9XX %] >- [% IF ( tab9X.tag ) %] >- <div class="tag"> >- <div class="tag_title"> >- [% tab9X.tag %] >- </div> >- [% ELSE %] >- <div class="tag"> >- [% END %] >- [% FOREACH subfiel IN tab9X.subfield %] >- <p> >- <span class="subfield-label"> >- [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %] >- <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></span> >- [% IF ( subfiel.is_url ) %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value |html %]</a>[% ELSE %][% subfiel.marc_value |html %][% END %] >- [% IF ( subfiel.link ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&idx=[% subfiel.link %],phr&type=intranet&q=[% subfiel.marc_value |url %]"> >- <img border="0" src="[% interface %]/[% theme %]/img/filefind.png" height="15" title="Search on [% subfiel.marc_value |html %]" alt="Search on [% subfiel.marc_value |html %]" /> >- </a> >- [% END %] >- [% IF ( subfiel.authority ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a> >- [% END %] >- </p> >- [% END %] >- </div> >- [% END %] >- </div> >+ [% PROCESS show_tab_html tab_id="tab9XX" tab_data=tab9XX %] > > [% IF ( tab10XX ) %] > <div id="tab10XX"> >-- >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 11885
:
25770
|
26462
|
26468
|
26469
|
26773
|
26853
|
26917
|
26918
|
26919
|
26992
|
26993
|
26994
|
26995