Bugzilla – Attachment 3623 Details for
Bug 5546
Ability to hide MARC documentation links
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Purge initial file
0001-Bug-5546-Javascript-driven-ability-to-hide-MARC-docu.patch (text/plain), 4.95 KB, created by
Jonathan Druart
on 2011-04-04 13:03:38 UTC
(
hide
)
Description:
Purge initial file
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2011-04-04 13:03:38 UTC
Size:
4.95 KB
patch
obsolete
>From 2f69537d01444b1490fb0a5b7cb0f8402c3117bd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 1 Mar 2011 11:09:58 -0300 >Subject: [PATCH] [Bug 5546] Javascript driven ability to hide MARC documentation links >Content-Type: text/plain; charset="utf-8" > >--- > cataloguing/addbiblio.pl | 3 + > .../prog/en/includes/doc-head-close.inc | 1 + > .../en/lib/jquery/plugins/jquery.cookie.min.js | 1 + > .../prog/en/modules/cataloguing/addbiblio.tmpl | 59 ++++++++++++++++++- > 4 files changed, 60 insertions(+), 4 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index da58166..b1f63dd 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -1023,10 +1023,13 @@ $template->param( title => $record->title() ) if ( $record ne "-1" ); > if (C4::Context->preference("marcflavour") eq "MARC21"){ > $template->param(MARC21 => 1); > } >+ >+ > $template->param( > popup => $mode, > frameworkcode => $frameworkcode, > itemtype => $frameworkcode, >+ borrowernumber => $loggedinuser > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl >index be98543..8692faa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl >@@ -26,9 +26,20 @@ > fields_in_use[field_id] = 1; > } > }); >- }); >- >- $('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); }); >+ /* check cookie to hide/show marcdocs*/ >+ if($.cookie("marcdocs_<!-- TMPL_VAR NAME="borrowernumber" -->") == 'false'){ >+ hideMARCdocLinks(); >+ $("#marcDocsSelect").attr('checked',false); >+ } else { >+ /* reset cookie expire date */ >+ $.cookie("marcdocs_<!-- TMPL_VAR NAME="borrowernumber" -->",'true', >+ { path: "/", expires: 365 }); >+ } >+ >+ }); >+ >+ $('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); }); >+ > > function confirmnotdup(redirect){ > $("#confirm_not_duplicate").attr("value","1"); >@@ -101,6 +112,45 @@ function _UNIMARCFieldDoc(field, blocknumber) { > } > } > >+/* >+ * Functions to load/unload css from the head element >+ */ >+function loadCSS(id,cssDef) { >+ >+ var cssElem=document.createElement("style"); >+ cssElem.setAttribute("type", "text/css"); >+ cssElem.setAttribute("id", id); >+ cssElem.innerHTML = cssDef; >+ >+ document.getElementsByTagName("head")[0].appendChild(cssElem); >+} >+ >+function unloadCSS(id) { >+ var elem = document.getElementById(id); >+ elem.parentNode.removeChild(elem); >+} >+ >+/* >+ * Functions to hide/show marc docs links >+ */ >+function hideMARCdocLinks() { >+ loadCSS("marcDocsCSS",".marcdocs{display: none;}"); >+ $.cookie("marcdocs_<!-- TMPL_VAR NAME="borrowernumber" -->",'false', { path: "/", expires: 365 }); >+} >+ >+function showMARCdocLinks() { >+ unloadCSS("marcDocsCSS"); >+ $.cookie("marcdocs_<!-- TMPL_VAR NAME="borrowernumber" -->",'true', { path: "/", expires: 365 }); >+} >+ >+function toggleMARCDocs(checked) { >+ if (checked) { >+ showMARCdocLinks(); >+ } else { >+ hideMARCdocLinks(); >+ } >+} >+ > /** > * check if mandatory subfields are written > */ >@@ -641,6 +691,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? > > > <h1><!-- TMPL_IF NAME="biblionumber" -->Editing <em><!-- TMPL_VAR NAME="title" escape="html" --></em> (Record Number <!-- TMPL_VAR name="biblionumber" -->)</h1><!-- TMPL_ELSE -->Add MARC Record</h1><!-- /TMPL_IF --> >+<div><input type="checkbox" name="marcDocsSelect" id="marcDocsSelect" checked="true" onclick="toggleMARCDocs(this.checked)"/> Show MARC tag documentation links<br/></div> > > <!-- TMPL_UNLESS name="number" --> > <!-- show duplicate warning on tab 0 only --> >@@ -786,7 +837,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? > <!-- TMPL_IF NAME="advancedMARCEditor" --> > <a href="#" tabindex="1" class="tagnum" title="<!-- TMPL_VAR NAME="tag_lib"--> - Click to Expand this Tag" onclick="ExpandField('tag_<!-- TMPL_VAR NAME="tag"-->_<!-- TMPL_VAR NAME='index' --><!-- TMPL_VAR NAME="random" -->'); return false;"><!-- TMPL_VAR NAME="tag" --></a> > <!-- TMPL_ELSE --> >- <span class="tagnum" title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --><a >+ <span class="tagnum" title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --><a class="marcdocs" > onclick="PopupMARCFieldDoc('<!-- TMPL_VAR NAME="tag" -->', <!-- TMPL_VAR NAME="number" -->); return false;"> ?</a></span> > <!-- /TMPL_IF --> > <!-- TMPL_IF NAME="fixedfield" --> >-- >1.7.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 5546
:
2911
|
2922
|
3230
|
3275
| 3623