Bugzilla – Attachment 15358 Details for
Bug 8508
Holds to Pull : Library dropdown options are erroneously concatenated by br tags
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8508 - Holds to Pull : Library dropdown options are erroneously concatenated by br tags
Bug-8508---Holds-to-Pull--Library-dropdown-options.patch (text/plain), 2.38 KB, created by
Jonathan Druart
on 2013-02-15 12:43:20 UTC
(
hide
)
Description:
Bug 8508 - Holds to Pull : Library dropdown options are erroneously concatenated by br tags
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-02-15 12:43:20 UTC
Size:
2.38 KB
patch
obsolete
>From 43a38de39e705319525446307890dec9c8f26699 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 11 Sep 2012 07:18:54 +1000 >Subject: [PATCH] Bug 8508 - Holds to Pull : Library dropdown options are > erroneously concatenated by br tags > >This patch introduces a new javascript function that breaks apart option >strings that are erroneously concatenated by br tags. The split strings >are then checked against non-concatenated option strings, and pushed into >the option array if there is no duplication. > >This function is nestled into the JQuery datatable function for populating >the drop-down menu. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/circ/pendingreserves.tt | 27 ++++++++++++++++++++ > 1 file changed, 27 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >index 0b832dc..c0f1d66 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >@@ -15,7 +15,34 @@ $(document).ready(function() { > var holdst = $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, { > })); > holdst.fnAddFilters("filter"); >+ [%# add separateData function to cleanse jQuery select lists by breaking apart strings glued with BR tags and then de-duplicating any repeated library codes %] >+ function separateData ( ColumnData ){ >+ var cD = ColumnData; >+ var new_array = new Array(); >+ for ( j=0 ; j<cD.length ; j++ ) { >+ var strMatch = cD[j].match(/<br>/gi); >+ if (strMatch) { >+ var split_array = cD[j].split(/<br>/gi); >+ for ( k=0 ; k<split_array.length ; k++ ){ >+ var check_array = $.inArray(split_array[k], new_array); >+ if (check_array == -1) { >+ new_array.push(split_array[k]); >+ } >+ } >+ } >+ else { >+ var check_array = $.inArray(cD[j], new_array); >+ if (check_array == -1) { >+ new_array.push(cD[j]); >+ } >+ } >+ } >+ new_array.sort(); >+ return new_array; >+ } >+ [%# add SeparateData function into createSelect function, so that it does the createSelect on clean data %] > function createSelect( data ) { >+ data = separateData(data); > var r='<select style="width:99%"><option value="">None</option>', i, len=data.length; > for ( i=0 ; i<len ; i++ ) { > r += '<option value="'+data[i]+'">'+data[i]+'</option>'; >-- >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 8508
:
12122
|
12175
|
12184
|
12227
|
15358
|
15359
|
16835
|
16836
|
16837