//;
-$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;
diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl
index a461a1bbba..4a3eb49ce6 100755
--- a/acqui/neworderempty.pl
+++ b/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) {
diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js
index 2efeba0e92..028dae437d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js
+++ b/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;
}
}
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
index 7a7e72a574..71ae462622 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
+++ b/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 %]
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
index 566318fa9b..0195dd8928 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
+++ b/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 %]
+