Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b60251e7b8 | ||
|
|
6eef246b6a | ||
|
|
fc8ca69729 | ||
|
|
57277c558d |
@@ -9,6 +9,7 @@ use App\Models\Enums\PirepSource;
|
||||
use App\Models\Enums\PirepState;
|
||||
use App\Models\Pirep;
|
||||
use App\Models\PirepComment;
|
||||
use App\Models\PirepFare;
|
||||
use App\Repositories\AircraftRepository;
|
||||
use App\Repositories\AirlineRepository;
|
||||
use App\Repositories\AirportRepository;
|
||||
@@ -151,10 +152,10 @@ class PirepController extends Controller
|
||||
$count = $request->input($field_name);
|
||||
}
|
||||
|
||||
$fares[] = [
|
||||
$fares[] = new PirepFare([
|
||||
'fare_id' => $fare->id,
|
||||
'count' => $count,
|
||||
];
|
||||
]);
|
||||
}
|
||||
|
||||
$this->fareSvc->saveForPirep($pirep, $fares);
|
||||
|
||||
@@ -123,7 +123,7 @@ class ProfileController extends Controller
|
||||
|
||||
$airlines = $this->airlineRepo->selectBoxList();
|
||||
$airports = $this->airportRepo->selectBoxList(false, setting('pilots.home_hubs_only'));
|
||||
$userFields = $this->userRepo->getUserFields($user, true);
|
||||
$userFields = $this->userRepo->getUserFields($user);
|
||||
|
||||
return view('profile.edit', [
|
||||
'user' => $user,
|
||||
|
||||
@@ -36,9 +36,14 @@ class UserRepository extends Repository
|
||||
*
|
||||
* @return \App\Models\UserField[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection
|
||||
*/
|
||||
public function getUserFields(User $user, $only_public_fields = true): Collection
|
||||
public function getUserFields(User $user, $only_public_fields = null): Collection
|
||||
{
|
||||
$fields = UserField::where(['private' => !$only_public_fields])->get();
|
||||
if (is_bool($only_public_fields)) {
|
||||
$fields = UserField::where(['private' => !$only_public_fields])->get();
|
||||
} else {
|
||||
$fields = UserField::get();
|
||||
}
|
||||
|
||||
return $fields->map(function ($field, $_) use ($user) {
|
||||
foreach ($user->fields as $userFieldValue) {
|
||||
if ($userFieldValue->field->slug === $field->slug) {
|
||||
|
||||
@@ -309,7 +309,7 @@ class GeoService extends Service
|
||||
foreach ($all_route_points as $point) {
|
||||
$route->addPoint($point->lat, $point->lon, [
|
||||
'name' => $point->name,
|
||||
'popup' => $point->name.' ('.$point->name.')',
|
||||
'popup' => $point->name.' ('.$point->lat.', '.$point->lon.')',
|
||||
'icon' => '',
|
||||
]);
|
||||
}
|
||||
@@ -351,7 +351,7 @@ class GeoService extends Service
|
||||
foreach ($planned_route as $point) {
|
||||
$planned->addPoint($point->lat, $point->lon, [
|
||||
'name' => $point->name,
|
||||
'popup' => $point->name.' ('.$point->name.')',
|
||||
'popup' => $point->name.' ('.$point->lat.', '.$point->lon.')',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ class GeoService extends Service
|
||||
$actual->addPoint($point->lat, $point->lon, [
|
||||
'pirep_id' => $pirep->id,
|
||||
'name' => $point->altitude,
|
||||
'popup' => 'GS: '.$point->gs.'<br />Alt: '.$point->altitude,
|
||||
'popup' => 'Spd: '.$point->gs.' kts<br />Alt: '.$point->altitude.' ft<br />Pos: '.$point->lat.', '.$point->lon,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Generated
+10
-10
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "phpvms",
|
||||
"name": "npm-proj-1630891903110-0.06417380357287183uaTTYD",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
@@ -8,7 +8,7 @@
|
||||
"@turf/center": "^6.0.1",
|
||||
"acorn": "^7.4.1",
|
||||
"animate.css": "~3.6",
|
||||
"axios": "^0.21.1",
|
||||
"axios": "^0.21.3",
|
||||
"bootstrap": "~4.3",
|
||||
"bootstrap-sass": "^3.4.1",
|
||||
"bootstrap3": "npm:bootstrap@~3.4",
|
||||
@@ -2366,11 +2366,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "0.21.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
|
||||
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
||||
"version": "0.21.3",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz",
|
||||
"integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.10.0"
|
||||
"follow-redirects": "^1.14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/axobject-query": {
|
||||
@@ -15927,11 +15927,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.21.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
|
||||
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
||||
"version": "0.21.3",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz",
|
||||
"integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.10.0"
|
||||
"follow-redirects": "^1.14.0"
|
||||
}
|
||||
},
|
||||
"axobject-query": {
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
"@turf/center": "^6.0.1",
|
||||
"acorn": "^7.4.1",
|
||||
"animate.css": "~3.6",
|
||||
"axios": "^0.21.1",
|
||||
"axios": "^0.21.3",
|
||||
"bootstrap": "~4.3",
|
||||
"bootstrap-sass": "^3.4.1",
|
||||
"bootstrap3": "npm:bootstrap@~3.4",
|
||||
|
||||
Reference in New Issue
Block a user