+ ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ { template_name => "serials/result.tmpl",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {catalogue => 1, serials => '*'},
+ debug => 1,
+ }
+ );
+
+ # add the itemtype limit if applicable
+ my $itemtypelimit = $input->param('itemtypelimit');
+ if ( $itemtypelimit ) {
+ my $QParser;
+ $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser'));
+ my $op;
+ if ($QParser) {
+ $op = '&&';
+ } else {
+ $op = 'and';
+ }
+ if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
+ $query .= " $op $itype_or_itemtype:$itemtypelimit";
+ } else {
+ $query .= " $op $advanced_search_types:$itemtypelimit";
+ }
+ }
+ $debug && warn $query;