From: Sven Schöling Date: Wed, 21 Oct 2009 14:43:10 +0000 (+0200) Subject: rp strict X-Git-Tag: release-2.6.1beta1~202 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=11461ccecbd3b4f054f52f979c26145642539e8c;p=kivitendo-erp.git rp strict Vorsicht. Coding Standard in diesem Modul ist extrem schlecht. Mit Fehlern zu rechnen. --- diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 41148c8e8..62abf6683 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -47,6 +47,11 @@ require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/reportgenerator.pl"; +# note: this file was particularly hard to strictify. +# alot of the vars are passed carelessly between invocations +# should there be any missing vars, declare them globally +use strict; + 1; # end of main @@ -106,19 +111,30 @@ my $rp_access_map = { 'balance_sheet' => 'report', }; +# subs use these pretty freely, so declare them here +our (%column_data, @column_index); +our ($subtotalnetamount, $subtotaltax, $subtotal); + sub check_rp_access { + my $form = $main::form; + my $right = $rp_access_map->{$form->{report}}; $right ||= 'DOES_NOT_EXIST'; - $auth->assert($right); + $main::auth->assert($right); } sub report { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); check_rp_access(); - %title = ('balance_sheet' => 'Balance Sheet', + my $form = $main::form; + my %myconfig = %main::myconfig; + my $locale = $main::locale; + + my %title = ( + 'balance_sheet' => 'Balance Sheet', 'income_statement' => 'Income Statement', 'trial_balance' => 'Trial Balance', 'ar_aging' => 'AR Aging', @@ -130,14 +146,15 @@ sub report { 'receipts' => 'Receipts', 'payments' => 'Payments', 'projects' => 'Project Transactions', - 'bwa' => 'Betriebswirtschaftliche Auswertung',); + 'bwa' => 'Betriebswirtschaftliche Auswertung', + ); $form->{title} = $locale->text($title{ $form->{report} }); - $accrual = ($eur) ? "" : "checked"; - $cash = ($eur) ? "checked" : ""; + my $accrual = ($main::eur) ? "" : "checked"; + my $cash = ($main::eur) ? "checked" : ""; - $year = (localtime)[5] + 1900; + my $year = (localtime)[5] + 1900; # get departments $form->all_departments(\%myconfig); @@ -146,7 +163,7 @@ sub report { map { $form->{selectdepartment} .= "