From: David Cook Date: Mon, 10 Sep 2012 21:18:54 +0000 (+1000) Subject: Bug 8508 - Holds to Pull : Library dropdown options are erroneously concatenated... X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;ds=sidebyside;h=6376ca3a26f4a7abfcc311c603cb4870d4b3f3c4;p=koha.git 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 Signed-off-by: Marcel de Rooy Signed-off-by: Jared Camins-Esakov --- 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 0b832dcc89..9bf2aa41ad 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/gi); + if (strMatch) { + var split_array = cD[j].split(/
/gi); + for ( k=0 ; k'+data[i]+'';