Bugzilla – Attachment 82093 Details for
Bug 18530
Remove event attributes from patron clubs templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18530: Remove event attributes from patron clubs templates
Bug-18530-Remove-event-attributes-from-patron-club.patch (text/plain), 7.58 KB, created by
Owen Leonard
on 2018-11-08 15:29:20 UTC
(
hide
)
Description:
Bug 18530: Remove event attributes from patron clubs templates
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-11-08 15:29:20 UTC
Size:
7.58 KB
patch
obsolete
>From 37d3a7ceb9dba24881c91e4350d80dfa132ee9df Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 8 Nov 2018 15:13:20 +0000 >Subject: [PATCH] Bug 18530: Remove event attributes from patron clubs > templates > >This patch removes event attributes like "onclick" from patron clubs >templates in favor of putting these event handlers in the JavaScript. > >To test, apply the patch and go to Tools -> Patron clubs. > > - Test deletion of both club templates and clubs. Deletion confirmation > dialogs should work as expected, both for OK and Cancel. > - Open a patron record for checkout. > - Test enrolling and un-enrolling the patron. > - Test the same process from the patron detail page. >--- > .../prog/en/modules/clubs/patron-clubs-tab.tt | 33 --------- > .../prog/en/modules/clubs/patron-enroll.tt | 30 -------- > koha-tmpl/intranet-tmpl/prog/js/members.js | 80 ---------------------- > .../intranet-tmpl/prog/js/pages/circulation.js | 2 +- > 4 files changed, 1 insertion(+), 144 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >index b6a8e7a..ad65078 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >@@ -61,36 +61,3 @@ > </tbody> > </table> > [% END %] >- >-[% IF CAN_user_clubs_enroll %] >- <script> >- function loadEnrollmentForm( id ) { >- $("body").css("cursor", "progress"); >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=[% borrowernumber | html %]&id=' + id, function() { >- $("body").css("cursor", "default"); >- }); >- >- return false; >- } >- >- function cancelEnrollment( id ) { >- $("body").css("cursor", "progress"); >- $.ajax({ >- type: "POST", >- url: '/cgi-bin/koha/svc/club/cancel_enrollment', >- data: { id: id }, >- success: function( data ) { >- if ( data.success ) { >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber | html %]', function() { >- $("body").css("cursor", "default"); >- }); >- } else { >- alert(_("Unable to cancel enrollment!")); >- } >- }, >- dataType: 'json' >- }); >- return false; >- } >- </script> >-[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt >index 95a7d8b..86a1f13 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt >@@ -35,33 +35,3 @@ > </fieldset> > </form> > </div> >- >-<script> >-function addEnrollment() { >- $("body").css("cursor", "progress"); >- $.ajax({ >- type: "POST", >- url: '/cgi-bin/koha/svc/club/enroll', >- data: $( "#patron-enrollment-form" ).serialize(), >- success: function( data ) { >- if ( data.success ) { >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber | html %]&id=[% club.id | html %]', function() { >- $("body").css("cursor", "default"); >- }); >- } else { >- alert(_("Unable to create enrollment!")); >- } >- }, >- dataType: 'json' >- }); >- return false; >-} >- >-function showClubs() { >- $("body").css("cursor", "progress"); >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber | html %]&id=[% club.id | html %]', function() { >- $("body").css("cursor", "default"); >- }); >-} >-</script> >- >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index f50b760..e586e60 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -364,84 +364,4 @@ $(document).ready(function(){ > "right": "1%", > "width": "150px", > } ); >- // Patron clubs >- $("body").on("click", ".cancel_enrollment", function(e){ >- e.preventDefault(); >- var id = $(this).data("id"); >- cancelEnrollment( id ); >- }); >- $("body").on("click", ".add_enrollment", function(e){ >- e.preventDefault(); >- var id = $(this).data("id"); >- loadEnrollmentForm( id ); >- }); >- $("body").on("click", ".add_enrollment", function(e){ >- e.preventDefault(); >- var club_id = $(this).data("club_id"); >- var borrowernumber = $(this).data("borrowernumber"); >- addEnrollment( borrowernumber, club_id ); >- }); >- $("body").on("click", ".cancel_add_enrollment", function(e){ >- e.preventDefault(); >- var club_id = $(this).data("club_id"); >- var borrowernumber = $(this).data("borrowernumber"); >- showClubs( borrowernumber, club_id ); >- }); > }); >- >-// Patron clubs tab, circulation.pl and moremember.pl >-function loadEnrollmentForm( id ) { >- $("body").css("cursor", "progress"); >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=' + borrowernumber + '&id=' + id, function() { >- $("body").css("cursor", "default"); >- }); >- >- return false; >-} >- >-function cancelEnrollment( id ) { >- $("body").css("cursor", "progress"); >- $.ajax({ >- type: "POST", >- url: '/cgi-bin/koha/svc/club/cancel_enrollment', >- data: { id: id }, >- success: function( data ) { >- if ( data.success ) { >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=' + borrowernumber, function() { >- $("body").css("cursor", "default"); >- }); >- } else { >- alert( MSG_CANT_CANCEL_ENROLLMENT ); >- } >- }, >- dataType: 'json' >- }); >- return false; >-} >- >-function addEnrollment( borrowernumber, club_id ) { >- $("body").css("cursor", "progress"); >- $.ajax({ >- type: "POST", >- url: '/cgi-bin/koha/svc/club/enroll', >- data: $( "#patron-enrollment-form" ).serialize(), >- success: function( data ) { >- if ( data.success ) { >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=' + borrowernumber + '&id=' + club_id, function() { >- $("body").css("cursor", "default"); >- }); >- } else { >- alert(_("Unable to create enrollment!")); >- } >- }, >- dataType: 'json' >- }); >- return false; >-} >- >-function showClubs( borrowernumber, club_id ) { >- $("body").css("cursor", "progress"); >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=' + borrowernumber + '&id=' + club_id, function() { >- $("body").css("cursor", "default"); >- }); >-} >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js b/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js >index 6167e66..372be71 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js >@@ -154,7 +154,7 @@ function export_checkouts(format) { > $("#dont_export_item").val(1); > } > >- document.getElementByclub_Id("output_format").value = format; >+ document.getElementById("output_format").value = format; > document.issues.submit(); > } > >-- >2.1.4
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 18530
:
82093
|
82100
|
82332
|
83771