Small tweaks to table

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2025-04-08 15:30:07 +01:00
parent 34f8f50a4a
commit 548ae49c69
4 changed files with 11 additions and 5 deletions

View file

@ -38,8 +38,10 @@ class TestLocationsFMCS extends Command
$mismatched = Helper::test_locations_fmcs(true, $location_id); $mismatched = Helper::test_locations_fmcs(true, $location_id);
$this->warn(trans_choice('admin/settings/message.location_scoping.mismatch', count($mismatched))); $this->warn(trans_choice('admin/settings/message.location_scoping.mismatch', count($mismatched)));
$this->newLine();
$this->info('Edit your locations to associate them with the correct company.');
$header = ['Item Type', 'Item ID', 'Item Company ID', 'Location Company ID']; $header = ['Type', 'Name', 'ID', 'Item Company', 'Company ID', 'Item Location', 'Location Company ID'];
sort($mismatched); sort($mismatched);
$this->table($header, $mismatched); $this->table($header, $mismatched);

View file

@ -1597,9 +1597,12 @@ class Helper
if ($item && $item->company_id != $location_company) { if ($item && $item->company_id != $location_company) {
$mismatched[] = [ $mismatched[] = [
class_basename(get_class($item)), class_basename(get_class($item)),
$item->name,
$item->id, $item->id,
$item->company_id, $item->company->name ?? null,
$location_company ?? 'null', $item->company_id ?? null,
$item->location->name ?? null,
$location_company ?? null,
]; ];
} }

View file

@ -327,7 +327,7 @@ class SettingsController extends Controller
if ($old_locations_fmcs == '0' && $setting->scope_locations_fmcs == '1') { if ($old_locations_fmcs == '0' && $setting->scope_locations_fmcs == '1') {
$mismatched = Helper::test_locations_fmcs(false); $mismatched = Helper::test_locations_fmcs(false);
if (count($mismatched) != 0) { if (count($mismatched) != 0) {
return redirect()->back()->withInput()->with('error', trans_choice('admin/settings/message.location_scoping.mismatch', count($mismatched))); return redirect()->back()->withInput()->with('error', trans_choice('admin/settings/message.location_scoping.mismatch', count($mismatched)).' '.trans('admin/settings/message.location_scoping.not_saved'));
} }
} }

View file

@ -53,7 +53,8 @@ return [
], ],
'location_scoping' => [ 'location_scoping' => [
'mismatch' => 'There is 1 item in the database that need your attention before you can enable location scoping. Your settings were not saved.| There are :count items in the database that need your attention before you can enable location scoping. Your settings were not saved.', 'not_saved' => 'Your settings were not saved.',
'mismatch' => 'There is 1 item in the database that need your attention before you can enable location scoping.|There are :count items in the database that need your attention before you can enable location scoping.',
], ],
]; ];