Bug 34859: Remove unnecessary params from reports-home.pl

This change removes unnecessary syspref template parameters
and tidies the code.

Test plan:
0. Apply the patch and koha-plack --reload kohadev
1. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=IntranetNav
2. Add the following and save:
<li><a href="#">Awesome</a></li>
3. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetstylesheet
4. Add the following and save:
http://bad
5. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetcolorstylesheet
6. Add the following and save:
http://bad2
7. Go to /cgi-bin/koha/reports/reports-home.pl
8. Note the "Awesome" link in the top navbar
9. Note in the console that there are two errors where http://bad
and http://bad2 can't be resolved

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
David Cook 2023-09-21 01:27:45 +00:00 committed by Tomas Cohen Arazi
parent c9ab718a39
commit 7382e305e1
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -17,23 +17,18 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>. # along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl; use Modern::Perl;
use CGI qw ( -utf8 ); use CGI qw ( -utf8 );
use C4::Auth qw( get_template_and_user ); use C4::Auth qw( get_template_and_user );
use C4::Output qw( output_html_with_http_headers ); use C4::Output qw( output_html_with_http_headers );
use C4::Context;
my $query = CGI->new; my $query = CGI->new;
my ($template, $loggedinuser, $cookie) my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
= get_template_and_user({template_name => "reports/reports-home.tt", {
query => $query, template_name => "reports/reports-home.tt",
type => "intranet", query => $query,
flagsrequired => {reports => '*'}, type => "intranet",
}); flagsrequired => { reports => '*' },
$template->param(intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), }
intranetstylesheet => C4::Context->preference("intranetstylesheet"), );
IntranetNav => C4::Context->preference("IntranetNav"),
);
output_html_with_http_headers $query, $cookie, $template->output; output_html_with_http_headers $query, $cookie, $template->output;