diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl
index bd25081c0d..a8134712f4 100755
--- a/catalogue/itemsearch.pl
+++ b/catalogue/itemsearch.pl
@@ -90,6 +90,8 @@ if (defined $format and $format eq 'json') {
} elsif (defined $format and $format eq 'barcodes') {
# Retrieve all results
$cgi->param('rows', 0);
+} elsif (defined $format and $format eq 'shareable') {
+ # get the item search parameters from the url and fill form
} elsif (defined $format) {
die "Unsupported format $format";
}
@@ -119,7 +121,7 @@ if ( Koha::MarcSubfieldStructures->search( { frameworkcode => '', kohafield => '
$template->param( has_new_status => 1 );
}
-if ( defined $format ) {
+if ( defined $format and $format ne 'shareable') {
# Parameters given, it's a search
my $filter = {
@@ -351,6 +353,7 @@ $template->param(
damageds => \@damageds,
items_search_fields => \@items_search_fields,
authorised_values_json => to_json($authorised_values),
+ query => $cgi,
);
output_html_with_http_headers $cgi, $cookie, $template->output;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
index c0909122f4..34cdb5d2ee 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
@@ -37,30 +37,59 @@
[% END %]
[% BLOCK form_field_select_option %]
-
+ [% IF query.param('f').$i == value || query.param('f') == value %]
+
+ [% ELSE %]
+
+ [% END %]
[% END %]
[% BLOCK form_field_select_text %]
+ [% SET i = loop.index %]
-
+ [% IF loop.first || !query.param('f') %]
+
+ [% ELSE %]
+ [% SET j = i - 1 %]
+
+ [% END %]
- [% IF params.exists('op') %]
-
- [% ELSE %]
-
- [% END %]
-
+
+
[% END %]
@@ -210,16 +233,34 @@
[% END %]
-
+ [% IF query.param('onloan') == '' %]
+
+ [% ELSE %]
+
+ [% END %]
-
+ [% IF query.param('onloan') == 'IS NOT NULL' %]
+
+ [% ELSE %]
+
+ [% END %]
-
+ [% IF query.param('onloan') == 'IS NULL' %]
+
+ [% ELSE %]
+
+ [% END %]