M3 Security Fixes for scan command pass 33 major code smell fixes and style fixes

This commit is contained in:
Mark Gregory
2026-09-17 11:34:41 +01:00
parent 0a05f05843
commit 0c445f89af
69 changed files with 1786 additions and 1752 deletions
@@ -34,7 +34,7 @@ class userPickingStats4 extends Controller
// Get Users from ICM428M
$co = '';
$whs = '';
$ICM428M = [];
$iCM428M = [];
$schema = Schema::connection(config('m3.connection', 'pgsql'));
if ($schema->hasTable('icm428m')) {
$profile = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
@@ -44,7 +44,7 @@ class userPickingStats4 extends Controller
$co = $profile->R428CO ?? '';
$whs = $profile->R428WH ?? '';
$ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
$iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->selectRaw("R428US as userprf, (trim(R428FIRST) || ' ' || trim(R428FAMILY)) as name, R428EMPCDE as empno")
->where('R428STS', 'A')->where('R428EMPCDE', '!=', 0)
->where('R428CO', $co)->where('R428WH', $whs)->get()->all();
@@ -53,7 +53,7 @@ class userPickingStats4 extends Controller
$user_array = [];
// while($row = odbc_fetch_object($result)) {
$x = 0;
foreach ($ICM428M as $key => $row) {
foreach ($iCM428M as $key => $row) {
$user_array[$x]['userprf'] = trim($row->USERPRF);
$user_array[$x]['name'] = trim($row->NAME);
$user_array[$x]['empno'] = $row->EMPNO;
@@ -92,7 +92,6 @@ class userPickingStats4 extends Controller
and oppno in ($payrollCodes)
group by oppno";
$lbpf1 = $schema->hasTable('lbpf')
? DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt)
: [];
@@ -110,8 +109,6 @@ class userPickingStats4 extends Controller
$statistic4 = [];
}
// initialize arrays
$monitor_array = $totals_array = $perf_array = [];
$totals_array['value'] = 0;
@@ -121,7 +118,6 @@ class userPickingStats4 extends Controller
$totals_array['entries'] = 0;
$diff = 0;
foreach ($lbpf1 as $key => $val) {
$monitor_array[$val->OPPNO]['tot_hours'] = $val->HRS;
// Initialize these variables in case not existant in statistic4
@@ -294,7 +290,6 @@ class userPickingStats4 extends Controller
$no_data = 'Y';
}
return view(
'm3::liberty-theme.pages.userPickingStats4',
compact('statistic4', 'starting', 'user', 'user_array', 'monitor_array', 'totals_array', 'perf_array', 'request', 'no_data'),