Bugzilla – Attachment 97950 Details for
Bug 23947
Phase out jquery.cookie.js: Authority merge
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23947: Phase out jquery.cookie.js: Authority merge
Bug-23947-Phase-out-jquerycookiejs-Authority-merge.patch (text/plain), 3.05 KB, created by
David Nind
on 2020-01-26 06:34:52 UTC
(
hide
)
Description:
Bug 23947: Phase out jquery.cookie.js: Authority merge
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-01-26 06:34:52 UTC
Size:
3.05 KB
patch
obsolete
>From 4219f2865f3cb2435dc7e84d3f2ec34be13c67ec Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 1 Nov 2019 18:15:53 +0000 >Subject: [PATCH] Bug 23947: Phase out jquery.cookie.js: Authority merge > >This patch updates the JavaScript which sets cookies during the >authority merge process so that it uses the new js-cookie library. > >To test, apply the patch and perform a search in the authority module >which will return multiple results. > > - Select "Merge" from the Actions menu next to any result. > - A message should appear at the top of the page: "Merging with > authority: <title>". > - Click "Cancel merge." The message should disappear. > - Select a record to merge again. > - Select another record. > - The page should redirect to the authority merge page. > >Signed-off-by: David Nind <david@davidnind.com> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >index 7109dc94ca..f2966019cf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >@@ -1,29 +1,29 @@ > <script> > > function mergeAuth(authid, summary) { >- var alreadySelected = $.cookie('auth_to_merge'); >+ var alreadySelected = Cookies.get('auth_to_merge'); > if (alreadySelected !== undefined) { > alreadySelected = JSON.parse(alreadySelected); >- $.cookie('auth_to_merge', '', { 'path': '/', 'expires': -1 }); >+ Cookies.remove('auth_to_merge'); > var refstring = ""; > if (typeof alreadySelected.mergereference !== 'undefined') { > refstring = "&mergereference=" + alreadySelected.mergereference; > } > window.location.href = "/cgi-bin/koha/authorities/merge.pl?authid=" + authid + "&authid=" + alreadySelected.authid + refstring; > } else { >- $.cookie('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/' }); >+ Cookies.set('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/' }); > showMergingInProgress(); > } > } > > function showMergingInProgress() { >- var alreadySelected = $.cookie('auth_to_merge'); >+ var alreadySelected = Cookies.get('auth_to_merge'); > if (alreadySelected !== undefined) { > alreadySelected = JSON.parse(alreadySelected); > $('#merge_in_progress').html(_("Merging with authority: ") + "<a href='detail.pl?authid=" + alreadySelected.authid + "'><span class='authorizedheading'>" + alreadySelected.summary + "</span> (" + alreadySelected.authid + ")</a> <a href='#' id='cancel_merge'>" + _("Cancel merge") + "</a>"); > $('#cancel_merge').click(function(event) { > event.preventDefault(); >- $.cookie('auth_to_merge', '', { 'path': '/', 'expires': -1 }); >+ Cookies.remove('auth_to_merge'); > $('#merge_in_progress').empty(); > }); > } else { >-- >2.11.0
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 23947
:
94956
|
97950
|
98052