Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3870932a85 | ||
|
|
8c2513eb3d | ||
|
|
2dbd58e59e | ||
|
|
bf77f7dd96 | ||
|
|
5a570989de | ||
|
|
6b3207377a | ||
|
|
ac1d5e1555 | ||
|
|
0d45fc287b | ||
|
|
4911f6799d |
@@ -186,13 +186,13 @@ class AwardController extends Controller
|
||||
{
|
||||
$award = $this->awardRepository->findWithoutFail($id);
|
||||
if (empty($award)) {
|
||||
Flash::error('Fare not found');
|
||||
Flash::error('Award not found');
|
||||
|
||||
return redirect(route('admin.awards.index'));
|
||||
}
|
||||
|
||||
$this->awardRepository->delete($id);
|
||||
Flash::success('Fare deleted successfully.');
|
||||
Flash::success('Award deleted successfully.');
|
||||
|
||||
return redirect(route('admin.awards.index'));
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class ProfileController extends Controller
|
||||
{
|
||||
// Is the ACARS module enabled?
|
||||
$acars_enabled = false;
|
||||
$acars = Module::find('VMSACARS');
|
||||
$acars = Module::find('VMSAcars');
|
||||
if ($acars) {
|
||||
$acars_enabled = $acars->isEnabled();
|
||||
}
|
||||
@@ -95,6 +95,7 @@ class ProfileController extends Controller
|
||||
'user' => $user,
|
||||
'userFields' => $userFields,
|
||||
'airports' => $airports,
|
||||
'acars' => $this->acarsEnabled(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -121,7 +122,7 @@ class ProfileController extends Controller
|
||||
|
||||
$airlines = $this->airlineRepo->selectBoxList();
|
||||
$airports = $this->airportRepo->selectBoxList(false, setting('pilots.home_hubs_only'));
|
||||
$userFields = $this->userRepo->getUserFields($user, false);
|
||||
$userFields = $this->userRepo->getUserFields($user, true);
|
||||
|
||||
return view('profile.edit', [
|
||||
'user' => $user,
|
||||
|
||||
@@ -109,6 +109,11 @@ class SimBriefController
|
||||
|
||||
$loadmax = $lfactor + $lfactorv;
|
||||
$loadmax = $loadmax > 100 ? 100 : $loadmax;
|
||||
// Failsafe for admins not defining load values for their flights
|
||||
// and also leave the general settings empty, set loadmax to 100
|
||||
if ($loadmax === 0) {
|
||||
$loadmax = 100;
|
||||
}
|
||||
|
||||
// Show the main simbrief form
|
||||
return view('flights.simbrief_form', [
|
||||
|
||||
@@ -27,6 +27,7 @@ class Pirep extends Resource
|
||||
{
|
||||
$res = parent::toArray($request);
|
||||
$res['ident'] = $this->ident;
|
||||
$res['phase'] = $this->status;
|
||||
$res['status_text'] = PirepStatus::label($this->status);
|
||||
|
||||
// Set these to the response units
|
||||
|
||||
@@ -101,7 +101,7 @@ class AirportService extends Service
|
||||
}
|
||||
|
||||
// Don't lookup the airport, so just add in something generic
|
||||
if (!setting('general.auto_airport_lookup', false)) {
|
||||
if (!setting('general.auto_airport_lookup')) {
|
||||
$airport = new Airport([
|
||||
'id' => $icao,
|
||||
'icao' => $icao,
|
||||
|
||||
@@ -51,13 +51,8 @@ class FlightImporter extends ImportExport
|
||||
'fields' => 'nullable',
|
||||
];
|
||||
|
||||
/** @var AirportService */
|
||||
private $airportSvc;
|
||||
|
||||
/** @var FareService */
|
||||
private $fareSvc;
|
||||
|
||||
/** @var FlightService */
|
||||
private $flightSvc;
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,7 +118,11 @@ class ImportService extends Service
|
||||
// turn it into a collection and run some filtering
|
||||
$row = collect($row)->map(function ($val, $index) {
|
||||
$val = trim($val);
|
||||
return empty($val) ? null : $val;
|
||||
if ($val === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
return $val;
|
||||
})->toArray();
|
||||
|
||||
// Try to validate
|
||||
|
||||
@@ -11,7 +11,8 @@ use App\Services\AirportService;
|
||||
class Weather extends Widget
|
||||
{
|
||||
protected $config = [
|
||||
'icao' => null,
|
||||
'icao' => null,
|
||||
'raw_only' => null,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
+5
-17
@@ -131,22 +131,10 @@ return [
|
||||
'Yaml' => Symfony\Component\Yaml\Yaml::class,
|
||||
|
||||
// ENUMS
|
||||
'AcarsType' => App\Models\Enums\AcarsType::class,
|
||||
'ActiveState' => App\Models\Enums\ActiveState::class,
|
||||
'AircraftState' => App\Models\Enums\AircraftState::class,
|
||||
'AircraftStatus' => App\Models\Enums\AircraftStatus::class,
|
||||
'Days' => App\Models\Enums\Days::class,
|
||||
'ExpenseType' => App\Models\Enums\ExpenseType::class,
|
||||
'FareType' => App\Models\Enums\FareType::class,
|
||||
'FlightType' => App\Models\Enums\FlightType::class,
|
||||
'FuelType' => App\Models\Enums\FuelType::class,
|
||||
'JournalType' => App\Models\Enums\JournalType::class,
|
||||
'NavaidType' => App\Models\Enums\NavaidType::class,
|
||||
'PageType' => App\Models\Enums\PageType::class,
|
||||
'PirepFieldSource' => App\Models\Enums\PirepFieldSource::class,
|
||||
'PirepSource' => App\Models\Enums\PirepSource::class,
|
||||
'PirepState' => App\Models\Enums\PirepState::class,
|
||||
'PirepStatus' => App\Models\Enums\PirepStatus::class,
|
||||
'UserState' => App\Models\Enums\UserState::class,
|
||||
'ActiveState' => App\Models\Enums\ActiveState::class,
|
||||
'UserState' => App\Models\Enums\UserState::class,
|
||||
'PirepSource' => App\Models\Enums\PirepSource::class,
|
||||
'PirepState' => App\Models\Enums\PirepState::class,
|
||||
'PirepStatus' => App\Models\Enums\PirepStatus::class,
|
||||
],
|
||||
];
|
||||
|
||||
@@ -42,7 +42,7 @@ class PilotHoursAwards extends Award
|
||||
*/
|
||||
public function check($flight_minutes = null): bool
|
||||
{
|
||||
if (!is_int($flight_minutes)) {
|
||||
if (!is_numeric($flight_minutes)) {
|
||||
Log::error('PilotHourAwards: Flight time "'.$flight_minutes.'" is not a valid flight time');
|
||||
return false;
|
||||
}
|
||||
|
||||
Generated
+3
-8
@@ -1983,11 +1983,6 @@
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-sass/-/bootstrap-sass-3.4.1.tgz",
|
||||
"integrity": "sha512-p5rxsK/IyEDQm2CwiHxxUi0MZZtvVFbhWmyMOt4lLkA4bujDA1TGoKT0i1FKIWiugAdP+kK8T5KMDFIKQCLYIA=="
|
||||
},
|
||||
"bootstrap3": {
|
||||
"version": "npm:bootstrap@3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.4.1.tgz",
|
||||
"integrity": "sha512-yN5oZVmRCwe5aKwzRj6736nSmKDX7pLYwsXiCj/EYmo16hODaBiT4En5btW/jhBF/seV+XMx3aYwukYC3A49DA=="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
@@ -5881,9 +5876,9 @@
|
||||
}
|
||||
},
|
||||
"marked": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-1.2.2.tgz",
|
||||
"integrity": "sha512-5jjKHVl/FPo0Z6ocP3zYhKiJLzkwJAw4CZoLjv57FkvbUuwOX4LIBBGGcXjAY6ATcd1q9B8UTj5T9Umauj0QYQ=="
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-2.0.0.tgz",
|
||||
"integrity": "sha512-NqRSh2+LlN2NInpqTQnS614Y/3NkVMFFU6sJlRFEpxJ/LHuK/qJECH7/fXZjk4VZstPW/Pevjil/VtSONsLc7Q=="
|
||||
},
|
||||
"md5": {
|
||||
"version": "2.3.0",
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
"leaflet-rotatedmarker": "^0.2.0",
|
||||
"leaflet.geodesic": "^2.5.2",
|
||||
"lodash": ">=4.17.19",
|
||||
"marked": "^1.2.2",
|
||||
"marked": "^2.0.0",
|
||||
"minimist": "^1.2.2",
|
||||
"moment": "^2.29.1",
|
||||
"paper-dashboard": "^1.1.0",
|
||||
|
||||
@@ -130,3 +130,11 @@
|
||||
border-radius: 5px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
/*
|
||||
* fix the dropdown menu on mobile view
|
||||
*/
|
||||
.dropdown-menu:not(.show) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,11 +133,11 @@
|
||||
<div class="text-right">
|
||||
@if (isset($acars) && $acars === true)
|
||||
<a href="{{ route('frontend.profile.acars') }}" class="btn btn-primary"
|
||||
onclick="alert('Save to \'My Documents/phpVMS\'')">ACARS Config</a>
|
||||
onclick="alert('Copy or Save to \'My Documents/phpVMS\'')">ACARS Config</a>
|
||||
|
||||
@endif
|
||||
<a href="{{ route('frontend.profile.regen_apikey') }}" class="btn btn-warning"
|
||||
onclick="return confirm({{ __('Are you sure? This will reset your API key.') }})">@lang('profile.newapikey')</a>
|
||||
onclick="return confirm('Are you sure? This will reset your API key!')">@lang('profile.newapikey')</a>
|
||||
|
||||
<a href="{{ route('frontend.profile.edit', [$user->id]) }}"
|
||||
class="btn btn-primary">@lang('common.edit')</a>
|
||||
@@ -171,7 +171,7 @@
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-full-width">
|
||||
@foreach($userFields as $field)
|
||||
@if($field->public === true)
|
||||
@if(!$field->private)
|
||||
<tr>
|
||||
<td>{{ $field->name }}</td>
|
||||
<td>{{ $field->value }}</td>
|
||||
|
||||
+2
-20
@@ -467,11 +467,6 @@ class ImporterTest extends TestCase
|
||||
*/
|
||||
public function testFlightImporter(): void
|
||||
{
|
||||
$this->updateSetting('general.auto_airport_lookup', false);
|
||||
|
||||
factory(Airport::class)->create(['icao' => 'KAUS']);
|
||||
factory(Airport::class)->create(['icao' => 'KJFK']);
|
||||
|
||||
[$airline, $subfleet] = $this->insertFlightsScaffoldData();
|
||||
|
||||
$file_path = base_path('tests/data/flights.csv');
|
||||
@@ -536,19 +531,6 @@ class ImporterTest extends TestCase
|
||||
// Check the subfleets
|
||||
$subfleets = $flight->subfleets;
|
||||
$this->assertCount(1, $subfleets);
|
||||
|
||||
// Reimport, see that data updates
|
||||
$file_path = base_path('tests/data/flights-update.csv');
|
||||
$status = $this->importSvc->importFlights($file_path);
|
||||
|
||||
$flight = Flight::where([
|
||||
'airline_id' => $airline->id,
|
||||
'flight_number' => '1972',
|
||||
])->first();
|
||||
|
||||
$this->assertCount(1, $status['success']);
|
||||
$this->assertEquals('12:00 CST', $flight->dpt_time);
|
||||
$this->assertEquals('18:35 EST', $flight->arr_time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -652,8 +634,8 @@ class ImporterTest extends TestCase
|
||||
$this->assertEquals(true, $airport->hub);
|
||||
$this->assertEquals('30.1945', $airport->lat);
|
||||
$this->assertEquals('-97.6699', $airport->lon);
|
||||
$this->assertEquals(250, $airport->ground_handling_cost);
|
||||
$this->assertEquals(0.8, $airport->fuel_jeta_cost); // should be updated
|
||||
$this->assertEquals(0.0, $airport->ground_handling_cost);
|
||||
$this->assertEquals(setting('airports.default_jet_a_fuel_cost'), $airport->fuel_jeta_cost);
|
||||
|
||||
// See if it imported
|
||||
$airport = Airport::where([
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
icao,iata,name,location,country,timezone,hub,lat,lon,ground_handling_cost,fuel_100ll_cost,fuel_jeta_cost,fuel_mogas_cost
|
||||
KAUS,AUS,Austin-Bergstrom,"Austin, Texas, USA", United States,America/Chicago,1,30.1945,-97.6699,250,0.8,0.8,0.8
|
||||
KSFO,SFO,San Francisco,"San Francisco, California, USA", United States,America/California,1,30.1945,-97.6699,,,0.9,
|
||||
KJFK,JFK,Kennedy,"Queens, New York, USA", United States,America/New_York,0,30.1945,abcd,150,,0.8,
|
||||
icao,iata,name,location,country,timezone,hub,lat,lon,ground_handling_cost,fuel_100ll_cost,fuel_jeta_cost,fuel_mogas_cost
|
||||
KAUS,AUS,Austin-Bergstrom,"Austin, Texas, USA", United States,America/Chicago,1,30.1945,-97.6699,0,,,
|
||||
KSFO,SFO,San Francisco,"San Francisco, California, USA", United States,America/California,1,30.1945,-97.6699,,,0.9,
|
||||
KJFK,JFK,Kennedy,"Queens, New York, USA", United States,America/New_York,0,30.1945,abcd,150,,0.8,
|
||||
|
||||
|
@@ -1,2 +0,0 @@
|
||||
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,pilot_pay,route,notes,active,subfleets,fares,fields
|
||||
VMS,1972, ,,KAUS,KJFK,KLGA,15,12:00 CST,18:35 EST,350,1477,207,J,85,0,100, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
||||
|
Reference in New Issue
Block a user