View | Details | Raw Unified | Return to bug 24103
Collapse All | Expand All

(-)a/authorities/auth_finder.pl (+1 lines)
Lines 77-82 if ( $op eq "do_search" ) { Link Here
77
        \@marclist, \@and_or, \@excluding, \@operator,
77
        \@marclist, \@and_or, \@excluding, \@operator,
78
        \@value, $authtypecode, $orderby
78
        \@value, $authtypecode, $orderby
79
    );
79
    );
80
    $template->param( search_query => $search_query ) if C4::Context->preference('DumpSearchQueryTemplate');
80
    my $offset = $startfrom * $resultsperpage;
81
    my $offset = $startfrom * $resultsperpage;
81
    my ( $results, $total ) =
82
    my ( $results, $total ) =
82
        $searcher->search_auth_compat( $search_query, $offset,
83
        $searcher->search_auth_compat( $search_query, $offset,
(-)a/authorities/authorities-home.pl (+1 lines)
Lines 111-116 if ( $op eq "do_search" ) { Link Here
111
        }
111
        }
112
    );
112
    );
113
113
114
    $template->param( search_query => $search_query ) if C4::Context->preference('DumpSearchQueryTemplate');
114
    $template->param(
115
    $template->param(
115
        csrf_token => Koha::Token->new->generate_csrf({
116
        csrf_token => Koha::Token->new->generate_csrf({
116
            session_id => scalar $query->cookie('CGISESSID'),
117
            session_id => scalar $query->cookie('CGISESSID'),
(-)a/catalogue/search.pl (+2 lines)
Lines 493-498 my $searcher = Koha::SearchEngine::Search->new( Link Here
493
  = $builder->build_query_compat( \@operators, \@operands, \@indexes, \@limits,
493
  = $builder->build_query_compat( \@operators, \@operands, \@indexes, \@limits,
494
    \@sort_by, $scan, $lang, { weighted_fields => !$cgi->param('advsearch'), whole_record => $whole_record });
494
    \@sort_by, $scan, $lang, { weighted_fields => !$cgi->param('advsearch'), whole_record => $whole_record });
495
495
496
$template->param( search_query => $query ) if C4::Context->preference('DumpSearchQueryTemplate');
497
496
## parse the query_cgi string and put it into a form suitable for <input>s
498
## parse the query_cgi string and put it into a form suitable for <input>s
497
my @query_inputs;
499
my @query_inputs;
498
my $scan_index_to_use;
500
my $scan_index_to_use;
(-)a/cataloguing/addbooks.pl (+3 lines)
Lines 83-88 if ($query) { Link Here
83
        ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) =
83
        ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) =
84
          $builder->build_query_compat( undef, \@operands, undef, undef, undef, 0, $lang );
84
          $builder->build_query_compat( undef, \@operands, undef, undef, undef, 0, $lang );
85
    }
85
    }
86
87
    $template->param( search_query => $builtquery ) if C4::Context->preference('DumpSearchQueryTemplate');
88
86
    # find results
89
    # find results
87
    my ( $error, $marcresults, $total_hits ) = $searcher->simple_search_compat($builtquery, $results_per_page * ($page - 1), $results_per_page);
90
    my ( $error, $marcresults, $total_hits ) = $searcher->simple_search_compat($builtquery, $results_per_page * ($page - 1), $results_per_page);
88
91
(-)a/installer/data/mysql/atomicupdate/Bug_24103_add_DumpSearchQueryTemplate_syspref.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO `systempreferences` (variable,value,options,explanation,type)
5
        VALUES ('DumpSearchQueryTemplate',0,'','Add the search query being passed to the search engine into the template for debugging','YesNo')
6
    });
7
    SetVersion( $DBversion );
8
    print "Upgrade to $DBversion done (Bug XXXXX - add DumpSearchQueryTemplate syspref)\n";
9
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 160-165 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
160
('DisplayLibraryFacets',  'holding',  'home|holding|both',  'Defines which library facets to display.',  'Choice'),
160
('DisplayLibraryFacets',  'holding',  'home|holding|both',  'Defines which library facets to display.',  'Choice'),
161
('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'),
161
('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'),
162
('DisplayOPACiconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.','YesNo'),
162
('DisplayOPACiconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.','YesNo'),
163
('DumpSearchQueryTemplate',0,'','Add the search query being passed to the search engine into the template for debugging','YesNo'),
163
('DumpTemplateVarsIntranet',  '0', NULL ,  'If enabled, dump all Template Toolkit variable to a comment in the html source for the staff intranet.',  'YesNo'),
164
('DumpTemplateVarsIntranet',  '0', NULL ,  'If enabled, dump all Template Toolkit variable to a comment in the html source for the staff intranet.',  'YesNo'),
164
('DumpTemplateVarsOpac',  '0', NULL ,  'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.',  'YesNo'),
165
('DumpTemplateVarsOpac',  '0', NULL ,  'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.',  'YesNo'),
165
('EasyAnalyticalRecords','0','','If on, display in the catalogue screens tools to easily setup analytical record relationships','YesNo'),
166
('EasyAnalyticalRecords','0','','If on, display in the catalogue screens tools to easily setup analytical record relationships','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref (+6 lines)
Lines 91-93 Logging: Link Here
91
                  on: Do
91
                  on: Do
92
                  off: "Don't"
92
                  off: "Don't"
93
            - dump all Template Toolkit variable to a comment in the html source for the OPAC.
93
            - dump all Template Toolkit variable to a comment in the html source for the OPAC.
94
        -
95
            - pref: DumpSearchQueryTemplate
96
              choices:
97
                  on: Do
98
                  off: "Don't"
99
            - dump search query as a template parameter, requires DumpTemplateVars[interface] to be visible.
(-)a/opac/opac-search.pl (-1 / +2 lines)
Lines 572-577 if (C4::Context->preference('OpacSuppression')) { Link Here
572
    }
572
    }
573
);
573
);
574
574
575
$template->param( search_query => $query ) if C4::Context->preference('DumpSearchQueryTemplate');
576
575
sub _input_cgi_parse {
577
sub _input_cgi_parse {
576
    my @elements;
578
    my @elements;
577
    my $query_cgi = shift or return @elements;
579
    my $query_cgi = shift or return @elements;
578
- 

Return to bug 24103