Bugzilla – Attachment 51986 Details for
Bug 16494
Remove the use of "onclick" from some patron pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16494 - Remove the use of "onclick" from some patron pages
Bug-16494---Remove-the-use-of-onclick-from-some-pa.patch (text/plain), 12.08 KB, created by
PTFS Europe Sandboxes
on 2016-06-03 10:58:37 UTC
(
hide
)
Description:
Bug 16494 - Remove the use of "onclick" from some patron pages
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2016-06-03 10:58:37 UTC
Size:
12.08 KB
patch
obsolete
>From 911d98ad32e710f1b45f78465dc992723ed6fed6 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 10 May 2016 14:56:14 -0400 >Subject: [PATCH] Bug 16494 - Remove the use of "onclick" from some patron > pages > >This patch removes the use of "onclick" attributes from some patron >pages. > >To test, apply the patch and: > >- In Patrons, perform any search which will return multiple results. > Confirm that the "select all" and "clear all" links work as expected. > Font Awesome icons have been added to these links. > > In the left-hand sidebar, change any of the filters and click the > "Clear" button. The form (and your search results) should reset. > >- Open the 'Set permissions' page for any patron. Checking any > permission with sub-permissions should correctly expand the tree and > select all sub-permissions. The reverse should also work. > > Also changed in this file: The "Inconsistency detected" alert has been > reformatted to make it translatable. > >- View the detail page for a patron with one or more restrictions. > Clicking the "View restrictions" link at the top of the page should > jump you to and activate the restrictions tab. > >- View the 'Notices' tab for a patron who has been sent one or more > notices. Click any notice title to expand the notice. Clicking the > "resend" button should resend the notice. > >- Create a new patron with the same first and last name as an existing > patron. This should trigger a duplicate warning message. Click the > "View existing record" link to trigger a pop-up window with a patron > detail brief view. > > In this window an "email" class has been added to the primary and > secondary email lines so that long email addresses don't overlap the > second column of data. > > Confirm that clicking the "close" button in this window closes the > window. The changes to staff-global.css are included in this patch to > prevent the close button from having an incorrect color change on > hover. > >Signed-off-by: FILIPPOS KOLOVOS <f.kolovos@gmail.com> >--- > koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 6 ++++- > .../prog/en/modules/members/member-flags.tt | 23 +++++++++++++------- > .../prog/en/modules/members/member.tt | 18 ++++++++++++--- > .../prog/en/modules/members/moremember-brief.tt | 6 ++--- > .../prog/en/modules/members/moremember.tt | 5 ++++- > .../prog/en/modules/members/notices.tt | 4 +++- > 6 files changed, 45 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >index 7a594b1..fce26c7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >@@ -2427,12 +2427,16 @@ a.disabled { > } > > .close:hover { >- color: #538200; >+ color: inherit; > filter: inherit; > font-size: inherit; > opacity: inherit; > } > >+a.close:hover { >+ color: #538200; >+} >+ > /* Redefine a new style for Bootstrap's class "close" since we use that already */ > /* Use <a class="closebtn" href="#">×</a> */ > .alert .closebtn{position:relative;top:-2px;right:-21px;line-height:20px;} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >index d9d95af..039c8ec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >@@ -12,7 +12,7 @@ > // Enforce Superlibrarian Privilege Mutual Exclusivity > if($('input[id="flag-0"]:checked').length){ > if ($('input[name="flag"]:checked').length > 1){ >- alert('Inconsistency Detected!\n\nThe superlibrarian privilege is mutually exclusive of other privileges, as it includes them all.\n\nThis patron\'s privileges will now be reset to include only superlibrarian.'); >+ alert(_("Inconsistency detected! The superlibrarian privilege is mutually exclusive of other privileges, as it includes them all. This patron's privileges will now be reset to include only superlibrarian.")); > } > > $('input[name="flag"]').each(function() { >@@ -39,10 +39,17 @@ > } > }); > >+ $(".flag").on("change",function(){ >+ if( $(this).hasClass("parent") ){ >+ toggleChildren(this); >+ } else { >+ toggleParent(this); >+ } >+ }); >+ > }); >-</script> >-<!-- manage checking/unchecking parent permissions --> >-<script type="text/javascript"> >+ >+ // manage checking/unchecking parent permissions > var originalChildStates = {}; /* keep track of subpermission checkbox values > so that user can recover from accidentally > toggling a parent/module permission */ >@@ -127,9 +134,9 @@ > <li> > [% END %] > [% IF ( loo.checked ) %] >- <input type="checkbox" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" onclick="toggleChildren(this)" /> >+ <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" /> > [% ELSE %] >- <input type="checkbox" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" onclick="toggleChildren(this)" /> >+ <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" /> > [% END %] > <label class="permissioncode" for="flag-[% loo.bit %]">[% loo.flag %]</label> > <span class="permissiondesc">[% PROCESS main_permissions name=loo.flag %]</span> >@@ -138,9 +145,9 @@ > [% FOREACH sub_perm_loo IN loo.sub_perm_loop %] > <li> > [% IF ( sub_perm_loo.checked ) %] >- <input type="checkbox" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" checked="checked" onclick="toggleParent(this)" /> >+ <input type="checkbox" class="flag child" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" checked="checked" /> > [% ELSE %] >- <input type="checkbox" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" onclick="toggleParent(this)" /> >+ <input type="checkbox" class="flag child" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" /> > [% END %] > <label class="permissioncode" for="[% sub_perm_loo.id %]">[% sub_perm_loo.code %]</label> > <span class="permissiondesc">[% PROCESS sub_permissions name=sub_perm_loo.code %]</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >index 0bb4bfa..06fbc75 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -97,6 +97,18 @@ $(document).ready(function() { > e.preventDefault(); > filterByFirstLetterSurname($(this).text()); > }); >+ $("#select_all").on("click",function(e){ >+ e.preventDefault(); >+ $(".selection").prop("checked", true); >+ }); >+ $("#clear_all").on("click",function(e){ >+ e.preventDefault(); >+ $(".selection").prop("checked", false); >+ }); >+ $("#clear_search").on("click",function(e){ >+ e.preventDefault(); >+ clearFilters(true); >+ }); > }); > > var dtMemberResults; >@@ -354,9 +366,9 @@ function filterByFirstLetterSurname(letter) { > [% IF CAN_user_tools_manage_patron_lists %] > <div id="searchheader"> > <div> >- <a href="javascript:void(0)" onclick="$('.selection').prop('checked', true)">Select all</a> >+ <a href="#" id="select_all"><i class="fa fa-check"></i> Select all</a> > | >- <a href="javascript:void(0)" onclick="$('.selection').prop('checked', false)">Clear all</a> >+ <a href="#" id="clear_all"><i class="fa fa-remove"></i> Clear all</a> > | > <span> > <label for="add_to_patron_list">Add selected patrons to:</label> >@@ -515,7 +527,7 @@ function filterByFirstLetterSurname(letter) { > </ol> > <fieldset class="action"> > <input type="submit" value="Search" /> >- <input type="button" value="Clear" onclick="clearFilters(true);" /> >+ <input type="button" value="Clear" id="clear_search" /> > </fieldset> > </fieldset> > </form> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt >index 34367d8..33061fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt >@@ -44,8 +44,8 @@ > [% END %] > [% IF ( fax ) %]<li><span class="label">Fax: </span>[% fax %]</li>[% END %] > [% UNLESS ( I ) %] >- [% IF ( email ) %]<li><span class="label">Primary email:</span><a href="mailto:[% email %]">[% email %]</a></li>[% END %] >- [% IF ( emailpro ) %]<li><span class="label">Secondary email: </span><a href="mailto:[% emailpro %]">[% emailpro %]</a></li>[% END %] >+ [% IF ( email ) %]<li class="email"><span class="label">Primary email:</span><a href="mailto:[% email %]">[% email %]</a></li>[% END %] >+ [% IF ( emailpro ) %]<li class="email"><span class="label">Secondary email: </span><a href="mailto:[% emailpro %]">[% emailpro %]</a></li>[% END %] > [% END %] > <li><span class="label">Initials: </span>[% initials %]</li> > <li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %]</li> >@@ -86,7 +86,7 @@ > </ol> > </div> > </div> >- <fieldset class="action"><input type="button" class="submit" value="Close window" onclick="window.close();" /></fieldset> >+ <fieldset class="action"><input type="button" class="close" value="Close window" /></fieldset> > </div> > </div> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index b775673..c9634c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -90,6 +90,9 @@ $(document).ready(function() { > hour: 23, > minute: 59 > }); >+ $("#view_restrictions").on("click",function(){ >+ $('#debarments-tab-link').click(); >+ }); > }); > function uncheck_sibling(me){ > nodename=me.getAttribute("name"); >@@ -189,7 +192,7 @@ function validate1(date) { > [% IF ( debarredcomment ) %] > with the explanation: <i>[% debarredcomment | html_line_break %]</i> > [% END %] >- <a href="#reldebarments" onclick="$('#debarments-tab-link').click()">View restrictions</a> >+ <a href="#reldebarments" id="view_restrictions">View restrictions</a> > </li> > [% END %] > [% IF ( gonenoaddress ) %]<li class="blocker">Patron's address is in doubt.</li>[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >index dbe5713..a771b7e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >@@ -80,7 +80,9 @@ > <input type="hidden" name="op" value="resend_notice" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id %]" /> >- <a href="#" onclick="$(this).closest('form').submit();return false;" title="Attempt to resend the notice">Resend</a> >+ <fieldset class="action"> >+ <button class="btn btn-mini" type="submit">Resend</button> >+ </fieldset> > </form> > </div> > [% END %] >-- >1.7.10.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 16494
:
51419
|
51986
|
52644