Bugzilla – Attachment 12122 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
0001-Bug-8508-Holds-to-Pull-Library-dropdown-options-are-.patch (text/plain), 2.39 KB, created by
David Cook
on 2012-09-10 22:00:43 UTC
(
hide
)
Description:
Bug 8508 - Holds to Pull : Library dropdown options are erroneously concatenated by br tags
Filename:
MIME Type:
Creator:
David Cook
Created:
2012-09-10 22:00:43 UTC
Size:
2.39 KB
patch
obsolete
>From f32146e15a63ddcc7d0d4630729595dc003f28fd 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 >Content-Type: text/plain; charset="utf-8" > >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. >--- > .../prog/en/modules/circ/pendingreserves.tt | 27 ++++++++++++++++++++ > 1 files changed, 27 insertions(+), 0 deletions(-) > >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 458316c..88c2837 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >@@ -12,7 +12,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.7.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