Bugzilla – Attachment 20083 Details for
Bug 7257
Add a link to remove an individual title from a list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7257 - Add a link to remove an individual title from a list
Bug-7257---Add-a-link-to-remove-an-individual-titl.patch (text/plain), 5.27 KB, created by
Owen Leonard
on 2013-08-02 18:45:24 UTC
(
hide
)
Description:
Bug 7257 - Add a link to remove an individual title from a list
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-08-02 18:45:24 UTC
Size:
5.27 KB
patch
obsolete
>From 8e93d8f83b3929d4c15b7a39369f8f07c7f13922 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 2 Aug 2013 14:25:37 -0400 >Subject: [PATCH] Bug 7257 - Add a link to remove an individual title from a > list >Content-Type: text/plain; charset="utf-8" > >It should be possible when viewing the contents of a list to click a >link to remove an individual title from the list without having to check >a checkbox and click another button. > >This patch adds a link to each list item to "Remove from this list." >The functionality is JavaScript-dependent, automatically checking the >appropriate checkbox and submitting the form to delete. > >To test, view a list for which you have delete permission. There should >be a "Remove from this list" link next to each item on the list. Test >delete functionality by: > >- Clicking the link and then clicking cancel. >- Clicking the link and confirming. >- Checking more than one checkbox and then clicking a single remove > link (only the one corresponding record should be removed). >- Checking one or more checkboxes and clicking the "Remove from list" > link at the top of the page. > >If JavaScript is disabled the links should not appear. > >There are now two delete confirmation messages: One if you're removing >only one item, another if you're removing more than one. This is true >whether you use the links or the checkboxes. >--- > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 14 +++++++++++- > .../opac-tmpl/prog/en/modules/opac-shelves.tt | 24 ++++++++++++++++++-- > 2 files changed, 35 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >index 6fd9a90..f6198d2 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -779,6 +779,7 @@ a.tag_add { > text-decoration : none; > padding-left : 33px; > } >+ > /* Search results place hold link */ > #placehold input.submit { > background-image: url("../../images/sprite.png"); /* Place hold */ >@@ -1491,7 +1492,8 @@ padding-left : .4em; > .actions a.addtocart, > .actions a.addtoshelf, > .actions a.addtolist, >-.actions a.tag_add { >+.actions a.tag_add, >+.actions a.removefromlist { > margin-left : 1em; > text-decoration : none; > } >@@ -1513,6 +1515,16 @@ padding-left : .4em; > display : none; > } > >+/* List contents remove from list link */ >+.removefromlist { >+ background-image : url("../../images/sprite.png"); /* Delete */ >+ background-position : -8px -690px; >+ background-repeat: no-repeat; >+ text-decoration : none; >+ padding-left : 15px; >+ display : none; >+} >+ > /* Search results rows save to lists */ > .actions a.addtoshelf { > background-image : url("../../images/sprite.png"); /* MARC view */ >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >index c9c0bca..4fe14db 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >@@ -7,6 +7,7 @@ > <script type="text/javascript"> > //<![CDATA[ > var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?"); >+var MSG_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?"); > var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?"); > > [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %] >@@ -152,10 +153,24 @@ $(function() { > }); > [% END %] > [% IF ( loggedinusername && allowremovingitems ) %] >+ var removeFromListLinks = $(".removefromlist"); >+ removeFromListLinks.show(); >+ // "remove from list" appearing on each line of the list output >+ removeFromListLinks.on("click",function(){ >+ $(".checkboxed").unCheckCheckboxes(); >+ var listitem = $("input[name="+this.id+"]"); >+ listitem.prop("checked",true); >+ $("#myform").submit(); >+ }); > $("#myform").submit(function(){ > var checkedBoxes = $(".checkboxed input:checkbox:checked"); >- if ($(checkedBoxes).size()) { >- return confirmDelete(MSG_REMOVE_FROM_LIST); >+ var numchecked = $(checkedBoxes).size(); >+ if (numchecked) { >+ if( numchecked > 1 ){ >+ return confirmDelete(MSG_REMOVE_FROM_LIST); >+ } else { >+ return confirmDelete(MSG_REMOVE_ONE_FROM_LIST); >+ } > } else { > alert(MSG_NO_RECORD_SELECTED); > return false; >@@ -473,6 +488,11 @@ $(document).ready(function() { > > [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]'); return false;">Save to another list</a> > [% END %][% END %][% END %] >+ >+ [% IF ( allowremovingitems ) %] >+ <a class="removefromlist" id="REM-[% itemsloo.biblionumber %]" href="#">Remove from this list</a> >+ [% END %] >+ > [% IF ( opacbookbag ) %] > [% IF ( itemsloo.incart ) %] > <a class="addtocart cart[% itemsloo.biblionumber %]" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">In your cart</a> <a class="cartRemove cartR[% itemsloo.biblionumber %]" href="#" onclick="delSingleRecord('[% itemsloo.biblionumber %]'); return false;">(remove)</a> >-- >1.7.9.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 7257
:
6382
|
20083
|
20141