Bugzilla – Attachment 26016 Details for
Bug 9366
On cataloguing each user can easily display tags or not
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9366: On cataloguing each user can easily display tags or not
Bug-9366-On-cataloguing-each-user-can-easily-displ.patch (text/plain), 10.33 KB, created by
Biblibre Sandboxes
on 2014-03-10 15:05:48 UTC
(
hide
)
Description:
Bug 9366: On cataloguing each user can easily display tags or not
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2014-03-10 15:05:48 UTC
Size:
10.33 KB
patch
obsolete
>From 8d35a2e13c4bc297e9362a5bea6fd527bc882002 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 8 Jan 2013 14:49:24 +0100 >Subject: [PATCH] Bug 9366: On cataloguing each user can easily display tags or not > >If the syspref hide_marc is set to "don't display", tags are not shown >by default. >This patch adds a checkbox to hide/show tags directly on the >cataloguing page. The value is stored in a cookie. > >Test plan: >Enable/disable the sysprefs hide_marc and advancedMARCeditor in order to >check if the display is according with what the user want. >Reload the page and verify the value is kept. >The first value of the cookie is retrieved from the hide_marc pref. > >Bonus: >This patch removes the link "Show MARCtag documentation links" if the >syspref advancedMARCeditor is enabled. > >Signed-off-by: Joel Aloi <aloi54@live.fr> >--- > .../prog/en/modules/cataloguing/addbiblio.tt | 108 ++++++++++++-------- > 1 files changed, 67 insertions(+), 41 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index cbe0a39..286e8b7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Cataloging › [% IF ( biblionumber ) %]Editing [% title |html %] (Record number [% biblionumber %])[% ELSE %]Add MARC record[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -42,6 +43,32 @@ > hideMARCdocLinks(); > } > }); >+ >+ /* check cookie to hide/show marc tags*/ >+ var marctags_cookie = $.cookie("marctags_[% borrowernumber %]"); >+ if( marctags_cookie == 'false'){ >+ hideMARCTagLinks(); >+ $("#marcTagsSelect").removeAttr('checked'); >+ } else if( marctags_cookie == 'true'){ >+ showMARCTagLinks(); >+ $("#marcTagsSelect").attr('checked', 'checked'); >+ } else { >+ [% UNLESS Koha.Preference("hide_marc") %] >+ showMARCTagLinks(); >+ $("#marcTagsSelect").attr('checked', 'checked'); >+ [% ELSE %] >+ hideMARCTagLinks(); >+ $("#marcTagsSelect").removeAttr('checked'); >+ [% END %] >+ } >+ $("#marcTagsSelect").click(function(){ >+ if($(this).attr("checked")){ >+ showMARCTagLinks(); >+ } else { >+ hideMARCTagLinks(); >+ } >+ }); >+ > $("#z3950search").click(function(){ > if (confirm(_("Please note that this Z39.50 search could replace the current record."))){ > PopupZ3950(); >@@ -73,8 +100,7 @@ > redirect("just_save", tab); > return false; > }); >- >- }); >+ }); > > function redirect(dest){ > $("#redirect").attr("value",dest); >@@ -147,7 +173,7 @@ function _UNIMARCFieldDoc(field) { > } > > /* >- * Functions to hide/show marc docs links >+ * Functions to hide/show marc docs and tags links > */ > function hideMARCdocLinks() { > $(".marcdocs").hide(); >@@ -159,6 +185,32 @@ function showMARCdocLinks() { > $.cookie("marcdocs_[% borrowernumber %]",'true', { path: "/", expires: 365 }); > } > >+function hideMARCTagLinks() { >+ $(".tagnum").hide(); >+ $(".subfieldcode").hide(); >+ $.cookie("marctags_[% borrowernumber %]",'false', { path: "/", expires: 365 }); >+} >+function showMARCTagLinks() { >+ $(".tagnum").show(); >+ $(".subfieldcode").show(); >+ $.cookie("marctags_[% borrowernumber %]",'true', { path: "/", expires: 365 }); >+} >+ [% IF hide_marc %] >+ var hide = false; >+ [% ELSE %] >+ var hide = true; >+ [% END %] >+ $("#show_tags").change( function(){ >+ if ( $(this).is(':checked') ) { >+ $(".tagnum").show(); >+ $(".subfieldcode").show(); >+ } else { >+ } >+ } ); >+ $("#show_tags").attr("checked", !hide) >+ $("#show_tags").change(); >+ >+ > /** > * check if mandatory subfields are written > */ >@@ -339,8 +391,11 @@ function Changefwk(FwkList) { > [% END %] > </h1> > >-[% IF marcflavour != 'NORMARC' %] >-<div><input type="checkbox" name="marcDocsSelect" id="marcDocsSelect" checked="true" /> Show MARC tag documentation links<br/></div> >+[% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] >+<div> >+ <label><input type="checkbox" name="marcDocsSelect" id="marcDocsSelect" checked="true" /> Show MARC tag documentation links</label> >+ <label><input type="checkbox" name="marcTagsSelect" id="marcTagsSelect" style="margin-left: 5px;" /> Show tags</label> >+</div> > [% END %] > > [% UNLESS ( number ) %] >@@ -437,8 +492,8 @@ function Changefwk(FwkList) { > [% frameworkcodeloo.frameworktext %] > </option> > [% END %] >- </select> >-</div> >+ </select> >+ </div> > </div> > > [% IF ( popup ) %] >@@ -464,13 +519,11 @@ function Changefwk(FwkList) { > [% IF ( innerloo.tag ) %] > <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> > <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> >- [% UNLESS hide_marc %] > [% IF advancedMARCEditor %] > <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a> > [% ELSE %] >- <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %] >+ <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span> > [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]'); return false;"> ?</a>[% END %] >- </span> > [% END %] > [% IF ( innerloo.fixedfield ) %] > <input type="text" >@@ -505,34 +558,13 @@ function Changefwk(FwkList) { > maxlength="1" > value="[% innerloo.indicator2 %]" /> > [% END %] - >- [% ELSE %] >- [% IF ( innerloo.fixedfield ) %] >- <input type="hidden" >- tabindex="1" >- name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" >- value="[% innerloo.indicator1 %]" /> >- <input type="hidden" >- tabindex="1" >- name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" >- value="[% innerloo.indicator2 %]" /> >- [% ELSE %] >- <input type="hidden" >- tabindex="1" >- name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" >- value="[% innerloo.indicator1 %]" /> >- <input type="hidden" >- tabindex="1" >- name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" >- value="[% innerloo.indicator2 %]" /> >- [% END %] >- [% END %] > > [% UNLESS advancedMARCEditor %] > <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a> > [% END %] > <span class="field_controls"> > [% IF ( innerloo.repeatable ) %] >- <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag"> >+ <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','0','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag"> > <img src="[% interface %]/[% theme %]/img/repeat-tag.png" alt="Repeat this Tag" /> > </a> > [% END %] >@@ -546,14 +578,13 @@ function Changefwk(FwkList) { > [% FOREACH subfield_loo IN innerloo.subfield_loop %] > <!-- One line on the marc editor --> > <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]"> >- >+ > [% UNLESS advancedMARCEditor %] > [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield"> > [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield"> > [% END %] > [% END %] >- >- [% UNLESS hide_marc %] >+ > <span class="subfieldcode"> > [% IF ( subfield_loo.fixedfield ) %] > <img class="buttonUp" style="display:none;" src="[% interface %]/[% theme %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" /> >@@ -570,12 +601,7 @@ function Changefwk(FwkList) { > class="flat" > tabindex="0" /> > </span> >- [% ELSE %] >- <input type="hidden" >- name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" >- value="[% subfield_loo.subfield %]" /> >- [% END %] >- >+ > [% UNLESS advancedMARCEditor %] > [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %] > [% subfield_loo.marc_lib_plain %] >-- >1.7.2.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 9366
:
14469
|
14470
|
14526
|
14527
|
15490
|
15491
|
16107
|
16108
|
16109
|
16978
|
16979
|
18868
|
18869
|
25821
|
26016
|
26327