//;
-$budget_authvalue_dropbox =~ s/\<\/select\>$//;
-chomp $budget_authvalue_dropbox;
-
-$template->param( return => $budget_authvalue_dropbox );
+$template->param( 'return' => $ret_html );
output_html_with_http_headers $input, $cookie, $template->output;
--- a/acqui/neworderempty.pl
+++ a/acqui/neworderempty.pl
@@ -281,8 +281,6 @@ if ($budget) { # its a mod ..
}
} elsif(@{$budgets}){
$CGIsort1 = GetAuthvalueDropbox( @$budgets[0]->{'sort1_authcat'}, '' );
-}else{
- $CGIsort1 = GetAuthvalueDropbox( '', '' );
}
# if CGIsort is successfully fetched, the use it
@@ -300,8 +298,6 @@ if ($budget) {
}
} elsif(@{$budgets}) {
$CGIsort2 = GetAuthvalueDropbox( @$budgets[0]->{sort2_authcat}, '' );
-}else{
- $CGIsort2 = GetAuthvalueDropbox( '', '' );
}
if ($CGIsort2) {
--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js
+++ a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js
@@ -744,7 +744,7 @@ function fetchSortDropbox(f) {
for (i=1;i<=2;i++) {
- var sort_dropbox = document.getElementById('sort'+i);
+ var sort_zone = document.getElementById('sort'+i+'_zone');
var url = '../acqui/fetch_sort_dropbox.pl?sort='+i+'&budget_id='+budgetId;
var xmlhttp = null;
@@ -764,7 +764,13 @@ for (i=1;i<=2;i++) {
}
};
// rc = eval ( xmlhttp.responseText );
- sort_dropbox.innerHTML = xmlhttp.responseText;
+ var retRootType = xmlhttp.responseXML.firstChild.nodeName;
+ var existingInputs = sort_zone.getElementsByTagName('input');
+ if (existingInputs.length > 0 && retRootType == 'input') {
+ // when sort is already an input, do not override to preseve value
+ return;
+ }
+ sort_zone.innerHTML = xmlhttp.responseText;
}
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
@@ -188,7 +188,7 @@
The 2 following fields are available for your own usage. They can be useful for statistical purposes
-
+
[% IF CGIsort1 %]
-
- [% IF CGIsort2 %]
-
- [% ELSE %]
-
- [% END %]
+
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
@@ -508,7 +508,7 @@ $(document).ready(function()
The 2 following fields are available for your own usage. They can be useful for statistical purposes
-
+
[% IF CGIsort1 %]
[% FOREACH sort_opt IN CGIsort1 %]
@@ -520,13 +520,13 @@ $(document).ready(function()
[% END %]
[% ELSE %]
-
[% END %]
+
-
+
[% IF CGIsort2 %]
[% FOREACH sort_opt IN CGIsort2 %]
@@ -540,6 +540,7 @@ $(document).ready(function()
[% ELSE %]
[% END %]
+
--