Bug 21501: Remove dead code from course reserves module
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 5 Oct 2018 13:18:59 +0000 (15:18 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 2 Nov 2018 10:37:45 +0000 (10:37 +0000)
search_on parameter is not used in any templates so course-reserves.pl
can be simplified a bit

Test plan:
1. Go to course reserves module and verify that it is still working
2. `git grep search_on` should return nothing

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
course_reserves/course-reserves.pl
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt

index ca66696..0a07d4f 100755 (executable)
@@ -39,16 +39,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $search_on = $cgi->param('search_on');
-my %params;
-if ($search_on) {
-    $params{'course_name'} = "%$search_on%";
-}
-
-my $courses = GetCourses(%params);
-if ( $search_on && @$courses == 1 ) {
-    print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=" . $courses->[0]->{'course_id'});
-} else {
-    $template->param( courses => $courses );
-    output_html_with_http_headers $cgi, $cookie, $template->output;
-}
+my $courses = GetCourses();
+$template->param( courses => $courses );
+output_html_with_http_headers $cgi, $cookie, $template->output;
index a747b9e..32ca565 100644 (file)
                     </div><!-- /toolbar -->
                     [% END %]
 
-                    <!--
-                    <div id="search-toolbar">
-                        <script type="text/javascript">
-                        //<![CDATA[
-                            function submitSearchForm(p_oEvent){
-                                $('#search_courses_form').submit();
-                            }
-
-                            $(document).ready(function(){
-                                newCourseButton = new YAHOO.widget.Button("search_courses");
-                                newCourseButton.on("click", submitSearchForm );
-                            });
-                        //]]>
-                        </script>
-                        <ul class="toolbar">
-                            <li><form id="search_courses_form"><input type="text" name="search_on" id="search_on"></form></li>
-                            <li><a id="search_courses">Search courses</a></li>
-                        </ul>
-                    </div>
-                    -->
-
                     <h1>Courses</h1>
                     <table id="course_reserves_table">
                         <thead>