Compare commits

...

677 Commits

Author SHA1 Message Date
B.Fatih KOZ
ced2012578 Update simbrief_briefing.blade.php (#1497)
Change in blade forms to SimBrief provided direct links.
2022-11-30 07:47:10 -06:00
fagidutt
00918f54aa Fix division by Zero in pireps/show.blade.php (#1493)
* Fix division by Zero in pireps/show.blade.php

Division by Zero caused by possible null distance fixed by adding check.

* Update show.blade.php

* Update show.blade.php

* Update show.blade.php

Final form :)
2022-11-03 12:11:57 -04:00
Nabeel S
41bd325f9a Revert "Bug fix #1414 (#1487)" (#1492)
This reverts commit b4311b861f.
2022-10-30 22:58:26 -04:00
Yash Govekar
b4311b861f Bug fix #1414 (#1487)
* Update module migrate command to avoid errors.

* Fixed issue #1414
2022-10-24 11:11:00 -04:00
B.Fatih KOZ
2f9e8583f2 Flight Visibility Visuals (#1485)
Added "visible" field display and form checkbox to control it easily from admin side (instead of going through database)
2022-10-14 13:27:46 -04:00
John Cheng
2155979eb9 Patch currency subunit conversion (#1484)
* added parentheses around the conversion

* updated finance test

updated the following test:
- journal operations

fixed the following tests:
- pirep finances
- pirep finances specific expense
- pirep finances expenses multi airline
2022-10-09 08:13:11 -05:00
Toni Vicente
f30a3bc1ef fix typo lang es-es (#1480) 2022-08-30 09:42:50 -04:00
B.Fatih KOZ
3461672f10 Fixes (#1481)
Fare Service : Return the note, do not force it to an empty string

Airport Importer : Make IATA nullable (as in the model)
2022-08-29 15:39:58 -04:00
B.Fatih KOZ
b4d5114ea2 Apply color customization (#1479) 2022-08-29 12:43:50 -04:00
Nabeel S
231e54ea5e Map color options (#1478)
* Add colors to the maps options

* Update assets build
2022-08-22 14:05:19 -04:00
B.Fatih KOZ
b1ae0240be Roles Update (#1474)
Adds member count to roles\index and member list to roles\edit pages.

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2022-08-21 10:59:19 -04:00
B.Fatih KOZ
64e470abec Add Radio Callsign To Airlines (#1475)
Adds a new db field for radio telephony callsign for airlines.

Also adds necessary field to admin template.
2022-08-21 10:48:18 -04:00
Nabeel S
695ab3a90d Dependency updates (#1473)
* Update PHP dependencies

* Update NPM modules

* Fix dependency versions
2022-08-15 12:55:36 -04:00
B.Fatih KOZ
0e1b55c6d7 Add baggage weight to acdata (#1464)
Follow up for improved SimBrief API, sending separate pax and bag weights is possible now.

Core v7 already had them separated ;)

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2022-08-15 11:32:52 -04:00
B.Fatih KOZ
ba5b4e23c7 Fix dead links (#1455)
* Fix dead links

Fixed one dead link, removed another one and changed load factor and variance fields to accept only numbers between 0-100.

* Update fields.blade.php

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2022-08-15 11:26:34 -04:00
B.Fatih KOZ
ef38d39ec4 Add "Notes" to Airports (#1467)
* Notes for Airports

Adds capability of having notes/remarks for airports, includes

* New database field
* Airport Model change
* CSV Import/Export capability for notes
* Admin Airports list page change
* Admin Airports edit page change
* Default Template Airport show page change

* Update Airport Tests

* Add the new field to source csv
* Check if the import works

* Update AirportFactory.php

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2022-08-15 11:23:39 -04:00
B.Fatih KOZ
ccebc69be2 Add ability to export members of a subfleet only (#1471)
* Export Subfleet Members

* Style Fix

* Fix php-cs style complaints

* Disable php-cs-fixer and fix styles
2022-08-15 10:45:10 -04:00
Jordan Havard
6becc6de63 Fix docker dev links (#1470)
Updated `docker-compose.local.yml` to `docker-compose.dev.yml` to reflect the correct docker files
2022-08-15 09:43:50 -04:00
Nabeel Shahzad
ca1cd01f3d Style fixes 2022-03-28 13:55:42 -04:00
Nabeel Shahzad
e2226b7400 Make sure fare is set to active 2022-03-28 13:23:27 -04:00
Nabeel Shahzad
991f661144 Don't map local env to dev so dev seeds won't run 2022-03-24 16:55:21 -04:00
Nabeel Shahzad
d1b7905e95 StyleCI fix 2022-03-18 16:57:48 -04:00
Nabeel Shahzad
ca8d96d2b6 Check for null/0 value on progress percent 2022-03-18 16:43:34 -04:00
Nabeel S
12848091a2 Laravel 9 Update (#1413)
Update to Laravel 9 and PHP 8+

Co-authored-by: B.Fatih KOZ <fatih.koz@gmail.com>
2022-03-14 11:45:18 -04:00
B.Fatih KOZ
00bf18c225 Fix Cron Deleting Paused Pireps (#1434) 2022-03-07 09:55:30 -05:00
Toni Vicente
b81dd97822 Changed es directory es by es-es (#1421)
This structure will allow for other variants derived from the Spanish of Spain.

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2022-02-28 13:34:01 -05:00
B.Fatih KOZ
7a40a9d128 Add DRAFT state in conditional check (#1422)
Add DRAFT state in conditional check
2022-02-28 09:52:57 -05:00
B.Fatih KOZ
9d368e8efa Allow bids on same flight by multiple users
Dash out unnecessary check, let multiple users to bid on same flight according to settings.
2022-02-25 14:40:53 -05:00
Toni Vicente
219a7cf6f9 fixed incorrect translation & Make TOC only readeable (#1408)
* fixed incorrect translation

Bloque de combustible -> Combustible en calzos

* Make TOC only redeable

make toc only readable for the user
2022-02-22 09:35:21 -05:00
Nabeel Shahzad
54bc5ccb30 Update example cron path to point to bin/cron 2022-02-21 10:36:54 -05:00
Nabeel Shahzad
648659aea5 Check if PIREP doesn't exist before cancelling 2022-02-16 19:13:47 -05:00
B.Fatih KOZ
08f82f8a2e Admin and Discord Notification Improvements (#1407)
* Backend changes

Sorting for : Airlines, Subfleets, Type Ratings and exported Flights

Blade : Added WYSIWYG editor to flight remarks/notes field

Notifications :

Mails > Added enabled/disabled settings for mails. Discord > Dashed out PirepPreFiled, re-enabled PirepStatusChanged with reduced messages

* Update PirepStatusChanged.php

* Update NotificationEventsHandler.php

* in_array fix

* Fix Discord Notifications

* Discord Notifications

Removed the pirep url from message as it is mostly private at phpvms side.

Also removed the Flight Ident from fields 'cause it is being used in the title.

Added the user avatar as thumbnail, and pirep filed message uses the airline logo as the main image.

Even though the outgoing pirep status messages are reduced, it is still possible to enable/disable them from admin settings.

Pirep Filed is always being sent (if the webhook is defined)

* StyleFix
2022-02-14 16:24:22 -05:00
Nabeel Shahzad
60cec870f6 Add aircraft ident to API response 2022-02-14 12:53:12 -05:00
Nabeel S
78fd8367a1 Add separate cron runner that doesn't use proc_open (#1405)
* Add alternative to using the artisan schedule runner

* StyleCI fixes

* Add additional cron time periods

* Style fixes

* Typo

* Update the web cron to use the new system

* Write out JSON for which tasks were run

* Rename cron.php to just cron
2022-02-11 16:24:06 -05:00
B.Fatih KOZ
607ea6f5e5 Add Notes to Users (#1406)
* Fix migration

Add Notes

* Migration to add mediumtext field
* Model update
* Admin blade update

* Hide notes by default

* Fix fields layout
2022-02-11 15:58:16 -05:00
Nabeel Shahzad
9e080d544a Fix Discord webhook URLs 2022-02-09 13:20:57 -05:00
Nabeel S
cb38f2ad90 Refactor broadcast notifications (#1402)
* Refactor broadcast notifications

* StyleCI fixes

* Fix the planned_distance accidental changes
2022-02-08 15:07:02 -05:00
Nabeel S
6cfbd91328 Update package versions (#1399)
* Update dependencies

* Symfony components downgrade

* Restrict symfony versions with meta package

* Downgrade valuestore

* Symfony versions

* More downgrades

* Package versions

* Package versions
2022-02-08 11:12:39 -05:00
B.Fatih KOZ
9253d39848 Custom Code for Pilot IDents (#1398)
* Custom Code for Pilot IDents

Adds a new setting to customize the ident or to use a fixed icao code in a multi airline environment.

If settings is null/empty, airline icao will be used as like before.

* StyleFix
2022-02-07 17:47:57 -05:00
arthurpar06
737b2f137f Fix French translations (#1394)
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2022-02-07 16:15:25 -05:00
B.Fatih KOZ
c518175244 Update User Model (#1396)
Current GDPR compliant Private Name attribute is not compatible with multi byte strings, and when encountered it fails and returns an empty string for the name_private attribute.

`substr($last_name, 0, 1)` or just `$last_name[0]` is not multi byte compatible, therefore only solution is to use `mb_substr`.

It also supports encoding definitions like `mb_substr($last_name, 0, 1, 'UTF-8')`

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2022-02-07 16:10:58 -05:00
B.Fatih KOZ
08624042f2 Make name and e-mail based searches with like for easier administration. (#1397)
* Update UserRepository.php

Make `name` and `e-mail` based searches with `like` for easier administration and search.

* Update search.blade.php

Remove old dashed out code

* Update index.blade.php

Add proper state selections
2022-02-07 16:02:17 -05:00
B.Fatih KOZ
94735103aa French Translation (#1392)
Author: Jacques M.
( Jbaltazar67 from phpVMS Forum/Discord )
2022-02-04 15:39:10 -05:00
Nabeel Shahzad
e4782c40f3 Fix tests 2022-02-04 15:03:05 -05:00
Nabeel Shahzad
670cb5d811 Check for bid existing or not 2022-02-04 14:21:59 -05:00
Nabeel Shahzad
88ffee16be Remove PII from debug info for user 2022-02-04 14:17:07 -05:00
Nabeel Shahzad
cc5a6db427 Nullable return type 2022-02-04 14:15:42 -05:00
Nabeel Shahzad
74a1b4d753 Add subfleet data when single bid is retrieved 2022-02-04 14:13:40 -05:00
Nabeel S
8a94d8db7b Add LGA flight 2022-01-29 14:49:38 -05:00
Nabeel S
c2cc067329 ICAO typo for sample data 2022-01-28 16:35:24 -05:00
Nabeel Shahzad
723f66a382 More data updates 2022-01-27 13:30:49 -05:00
Nabeel Shahzad
27be992395 Update seeds for a shorter test flight 2022-01-27 12:14:28 -05:00
Sam
6160d57790 Fix docker image name (#1382)
closes #1381
2022-01-11 09:46:53 -05:00
B.Fatih KOZ
7fabd57e13 Fix flight and subfleet import with edited fares (#1379)
* Fix fare import

* StyleFix
2022-01-11 08:17:32 -05:00
B.Fatih KOZ
09453becf8 Award Checks Update (#1376)
Add active/passive check for awards and update the handler to pass only active ones to the process when needed.
2022-01-10 15:49:50 -05:00
B.Fatih KOZ
023313c681 Check settings and filter aircraft list if needed (#1377)
Check settings and filter aircraft list if needed.
2022-01-10 13:29:30 -05:00
B.Fatih KOZ
d3b7d25abd Add ability to export flights of an airline only(#1375)
* Airline Flight Export

Add ability to export flights of an airline only

* StyleFix
2022-01-10 09:27:40 -05:00
B.Fatih KOZ
7799867302 Fix Weather Widget blade (#1372)
Old blade was failing due to missing items in a metar like below

`SVMC 031703Z AUTO NIL`
2022-01-04 14:51:39 -05:00
B.Fatih KOZ
fd7c1b8314 Update RegisterController.php (#1373)
Get only active and displayed UserFields.
2022-01-04 14:29:41 -05:00
B.Fatih KOZ
c12cf0964a Fix setting name (#1371) 2021-12-14 18:10:39 -05:00
Nabeel S
2202d5bf99 Setting for how often the live map updates #1369 (#1370) 2021-12-14 12:48:21 -05:00
B.Fatih KOZ
064682b71f Type Rating update (#1366)
* Update Typerating.php

Add `'active'` to fillable

* Update fields.blade.php

Fixed grid, positioning of checkbox label and removed extra row
2021-12-08 12:40:10 -05:00
Nabeel Shahzad
3c9d419ebb Clarify logs for pirep cancel/updates 2021-12-07 13:24:18 -05:00
Nabeel S
a3f110c0c0 Add PHP 8.1 to shims and build (#1365)
* Add PHP 8.1 to shims and build

* Lock psr/container version

* Lock psr version

* Restrict symfony component versions

* Downgrade event-dispatcher-contracts

* Update more package versions

* php-cs fixes

* style fix

* cs-fixer file fix

* Exclude resources dir from cs fixer

* Ignore cs fixer env check

* Update league/csv
2021-12-03 09:23:59 -05:00
B.Fatih KOZ
c45d52dffa Aircraft level Hub definitions (#1363)
* Aircraft level Hub definitions

* Add ability to define a hub for an aircraft apart from its subfleet.

* Update csv import/export capability for hub_id field

* Fix importertest source csv

* Fix source csv for updating too

* Update aircraft_empty_cols.csv

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-11-30 14:54:29 -05:00
B.Fatih KOZ
4d21ca0982 Update RegisterController.php (#1358)
Only active fields should be passed to view during registration.

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-11-30 14:40:18 -05:00
B.Fatih KOZ
52e716d6ee Type Ratings | New Feature (#1360)
* Type Ratings

Adding "Type Rating" definition and assignment possibility to v7 core.

* Update ProfileController.php

* StyleFix 1

* Update settings.yml

Change description text as requested
2021-11-30 14:36:17 -05:00
B.Fatih KOZ
66d83c0ce6 Add flight_time to searchable fields (#1356) 2021-11-18 15:05:04 -05:00
B.Fatih KOZ
4ea8357952 Fix SimBrief Controller | flight relationships (#1350)
* Update SimBriefController.php

Fix the fares relationship which was causing trouble when a flight had assigned fares

* Fix model name used in relationship

`Simbrief` should be `SimBrief`
2021-11-16 16:26:43 -05:00
B.Fatih KOZ
b9c29fbe08 More $pirep->ident usage fixes (#1353)
* Fix idents with double code

* Fix ident usage

* Fix ident usage

* Fix ident usage
2021-11-16 11:39:47 -05:00
B.Fatih KOZ
4e7149a51c Fix Admin pirep card | $pirep->ident usage (#1349)
Removed `$pirep->airline->code`

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-11-09 09:55:58 -05:00
B.Fatih KOZ
4c60e5da69 Eager loading update for frontend controllers and widgets (#1348)
* Update AirportController.php

Eager load `files`

* Update DashboardController.php

 Eager load `journal` for user , and `aircraft, arr_airport, comments, dpt_airport` for last_pirep.

* Update FlightController.php

Eager load + `alt_airport, subfleets` (with their airlines) for flights and `current_airport` for user 
(though current_airport can be removed and we can base the in blade checks on `$user->curr_airport_id` to reduce db reads and model loading)

* Update HomeController.php

Eager load `home_airport` for users

* Update PirepController.php

Eager load `airline, aircraft, fares, transactions, dpt_airport, arr_airport, comments, simbrief, user with rank` for pirep details

* Update ProfileController.php

Eager load `airline, awards, current_airport, fields.field, home_airport, last_pirep, rank` for user

* Update UserController.php

Eager load `airline, current_airport, fields.field, home_airport, rank` for users and count `awards`

* Update AirportController.php

* Update DashboardController.php

* Update PirepController.php

* Update ProfileController.php

* Update LatestNews.php

Eager load `user` for news

* Update LatestPilots.php

Eager load `home_airport` for latest users

* StyleFix 1

* StlyeFix 1.5

* Update SimBriefController.php

Eager load airline with flight

* Update SimBriefController.php

* Update SimBriefController.php
2021-11-09 09:51:02 -05:00
B.Fatih KOZ
2dbe19fdcc Fix pirep->ident usage issues (#1347)
* Update table.blade.php

* Update show.blade.php

* Update pirep_card.blade.php

* Update latest_pireps.blade.php

* Update ProfileController.php

Removed non used airports, added necessary relationships for eager loading.

Also removed `fields` 'cause it is already being loaded when `fields.field` is used. No need to query it twice.

* Update ProfileController.php
2021-11-08 16:08:19 -05:00
B.Fatih KOZ
358f0b663e Fix Aircraft Model | Add trait for relationship (#1345)
* Add trait for relationship

* StlyeFix
2021-11-03 12:51:34 -04:00
B.Fatih KOZ
9146c4a68f Update UserFieldValue Model (#1344)
* Add `name` attribute

* Pre-StyleFix

* Update UserFieldValue.php

* Used optional()

* Update Pirep.php

* Update Flight.php

* Update User.php
2021-11-03 08:46:07 -04:00
B.Fatih KOZ
addfa68016 Add Aircraft > Simbrief relationship (#1343) 2021-11-02 10:54:36 -04:00
B.Fatih KOZ
571768b39d Match Flight and Pirep ident attributes (#1342)
* Flight ident change

* Pirep ident change

* Update Pirep.php
2021-11-02 09:23:52 -04:00
B.Fatih KOZ
9956929df7 Add callsign to flight search (#1341)
Make callsign searchable

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-11-02 09:00:29 -04:00
B.Fatih KOZ
f498ad3bba Airline <> Aircraft Relationships (#1338)
* Aircraft relationship

* Airline relationship

* Flight and Pirep Relationships

* Style and logic fix
2021-11-02 08:40:50 -04:00
Toni Vicente
471464272f Improve ES translations (#1340)
Fix spells and better words in context
2021-10-31 16:19:16 -04:00
Nabeel S
85703e1aff Update composer dependencies (#1337) 2021-10-25 11:38:32 -04:00
B.Fatih KOZ
930d4cfa08 Update Aircraft Model (Landing Time Attribute) (#1336)
* Update Aircraft.php

Return `landing_time` attribute in Carbon format if it is not empty

* StyleFix
2021-10-25 10:11:52 -04:00
B.Fatih KOZ
91d68308aa Fix translations (#1335)
* English

* German

* Italian

* Portuguese
2021-10-22 13:27:14 -04:00
B.Fatih KOZ
4eca1f671f Fix WX Widget row (#1334)
* Fix WX Widget row

* Change degree symbol to html
2021-10-22 10:31:24 -04:00
Toni Vicente
1e7e8cc5e5 Temperature (#1332)
Add temp "es" string
@lang temp to widget wheather blade
2021-10-21 12:28:58 -04:00
B.Fatih KOZ
c65b5c1b05 Fix logical operator | Admin -> Pireps (#1331)
Reject button was not showing up for pending pireps due to usage of `@elseif`. Now both Accept and Reject buttons should be visible for pending pireps.
2021-10-18 10:13:32 -04:00
B.Fatih KOZ
87886f2419 Fix Admin / Flight Search (Blade) (#1325) 2021-10-01 08:50:22 -04:00
B.Fatih KOZ
9a28cf22ff Add Custom Fares (#1323)
* Update EventServiceProvider.php

Add FareListener

* Create Fares.php

* Create FareListener.php

* Update ExpenseListener.php

* Update PirepFinanceService.php

Add listener for the fares, process them like the custom expenses and apply if there are any returned
2021-09-30 11:10:05 -04:00
B.Fatih KOZ
7a29630f57 Admin blade improvements (#1321)
* Update search.blade.php

Used select2 for airports, fixed grid layout

* Update actions.blade.php

Fixed button placing

* Update pirep_card.blade.php

Added user id before the name, made name optional so if page hits an hard deleted user's pirep it will not fail. Also improved the flight level check.
2021-09-29 10:37:05 -04:00
Nabeel S
0b27635fcb Docker/compose updates (#1280)
* Docker/compose updates

* Fix container name

* Add zip to the ext install

* Don't mount the env.php file

* Use newer "docker compose" command

* Install composer

* Remove chown
2021-09-29 10:14:46 -04:00
B.Fatih KOZ
f3b032e56b Add airline_id to created subfleet/subfleets during flight import. (#1320)
Add airline_id to created subfleet/subfleets during flight import.
2021-09-28 20:17:12 -04:00
B.Fatih KOZ
f99af4cfc3 Fix logical operator (#1318)
That `if` should return `true` when both conditions are met (pirep not accepted and not rejected yet), so **AND** must be used there ;) Sorry for the trouble.

Now it works and listens more carefully.
2021-09-23 17:07:38 -04:00
B.Fatih KOZ
14e33574fc Default PirepState logic and location change (#1317)
* Update PirepService.php

Moved `$default_state` logic below `PirepFiled` event, so admins can have some flexibility to define their own default states by listening that event.

Any ideas ?

Hopefully closes #1312

* Update PirepService.php

Added the missing `$pirep->refresh();`
2021-09-23 15:04:24 -04:00
B.Fatih KOZ
bd892f5407 Fix Admin/Subfleet Edit (#1315)
As like the db and model, admins should be able to not choosing a hub for their fleets here.
2021-09-21 13:29:47 -04:00
B.Fatih KOZ
96e63f1572 Make hub_id optional in subfleet import (#1314)
`hub_id` is not a mandatory field (both in model and database), so it should be `nullable` here too.
2021-09-21 09:14:36 -04:00
B.Fatih KOZ
a0309b6303 Maintenance Status for Aircraft (#1311)
* Update AircraftStatus.php

* EN

* DE

* ES

* IT

* PT-BR
2021-09-16 15:15:50 -04:00
B.Fatih KOZ
e13a019a40 Flight Type Translations (#1306)
* Flights EN

* Flights DE

* Flights ES

* Flights IT

* Flights PT-BR
2021-09-10 08:17:19 -04:00
B.Fatih KOZ
91f928ecf4 Add missing base fare values from template (#1302)
Add missing base fare values

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-09-08 12:22:17 -04:00
Nabeel Shahzad
226ae6d109 Style fixes 2021-09-08 10:51:04 -04:00
lesmar54
90d1708aab Fixes to CSV import Exports (#1299)
* Update SubfleetImporter.php

Correction to the import to include Simbrief Code

* Update SubfleetImporter.php

Added in the missing fields HUB-ID and SIMBrief as these are input on the main screen

* Update AircraftImporter.php

Part of the missing data fields in csv import export

* Update FlightImporter.php

Part of the missing fields in csv import and export

* Update AircraftImporter.php

* Update FlightImporter.php

* Update aircraft.csv

Test data amended as part of the missing csv fields

* Update subfleets.csv

Part of the fix for missing fields in csv files used for import/export

* Update flights.csv

* Update FlightImporter.php

* Update subfleets.csv

Removed unused fields

* Update FlightImporter.php

* Update FlightImporter.php

* Update FlightImporter.php

* amended for new csv file layouts
2021-09-08 09:50:34 -04:00
B.Fatih KOZ
6eef246b6a Improve Map features (GeoJson) (#1290)
* Update GeoService.php

Replace double name usage with more valuable info

* Update GeoService.php

Changed `GS` with `Spd` 'cause it may be IAS or GS according to the phase of the flight.

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-08-30 13:00:27 -04:00
B.Fatih KOZ
fc8ca69729 Fix Private Profile fields not being editable (#1289)
* Update ProfileController.php

* Update UserRepository.php

* Update UserRepository.php

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-08-30 12:55:33 -04:00
B.Fatih KOZ
57277c558d Fix Fare not properly set in controller (#1291)
* Update FareService.php

* Update PirepController.php

Move the logic to controller as requested

* Update FareService.php

Reverting back the service changes as requested

* StyleFix
2021-08-30 12:50:04 -04:00
B.Fatih KOZ
b0f52ed1d0 Remove SimBrief with Bid (#1283)
* Update BidService.php

* Update BidService.php

Delete directly ;)
2021-08-13 14:39:18 -04:00
Khendal
d64e674c21 Update pirep_card.blade.php (#1282)
Added Pilot name in card to know who have submitted the pirep.
2021-08-13 11:51:52 -04:00
B.Fatih KOZ
40c911ff17 Add web middleware to laravel-widgets (#1281)
Title says it all ... Added web middleware to laravel-widgets config so the widget auto-reload / auto-refresh options can work with full functionality.
2021-08-12 08:40:41 -04:00
B.Fatih KOZ
b6abe8dd5b Bid check for flights/show (#1278)
* Update FlightController.php

Add missing $bid to flight/show so when needed Load In Acars button can be placed there too.

* Update show.blade.php

Add Load In Acars button to flight details page (flights/show.blade.php)
2021-08-10 13:23:43 -04:00
Nabeel Shahzad
54c3c8f346 Fix user id check in template 2021-08-09 18:12:48 -04:00
Nabeel S
c250fce84b Cast the user ID to int in the sb model (#1277) 2021-08-09 13:54:40 -04:00
Nabeel S
4125cdd373 Launch ACARS link on the simbrief page #1272 (#1276) 2021-08-09 12:01:27 -04:00
Nabeel S
6eb883de73 Dependency updates (#1274)
* Dependency updates

* Downgrade league/commonmark to 1.6
2021-08-08 11:48:45 -04:00
Nabeel Shahzad
49528c9644 Remove tar-to-zip dep 2021-08-07 12:58:31 -04:00
Nabeel Shahzad
4475813a12 remove dotfiles again 2021-08-07 12:51:13 -04:00
Nabeel Shahzad
681e39650b Try to fix dots in tar 2021-08-07 12:24:15 -04:00
Nabeel Shahzad
bbbe8a8bd3 remove base dir 2021-08-07 12:16:16 -04:00
Nabeel Shahzad
0acab21712 Fix cd 2021-08-07 11:54:33 -04:00
Nabeel Shahzad
a17840d690 Another zip fix attempt 2021-08-07 11:46:43 -04:00
Nabeel Shahzad
fe87f21599 Restrict zip to current dir 2021-08-07 11:37:26 -04:00
Nabeel Shahzad
2756c34702 Try fixing zip 2021-08-07 11:34:06 -04:00
Nabeel S
564f9ec06e Add ability to launch acars for flight/bid #1272 (#1273)
* Add ability to launch acars for flight/bid #1272

* Check for module active/inactive status

* Just some formatting
2021-08-06 14:53:04 -04:00
Nabeel S
95e1df619e Trap exception/check for module existing on disk #1211 (#1271)
* Trap exception/check for module existing on disk #1211

* Style fixes
2021-08-06 13:30:24 -04:00
B.Fatih KOZ
4a04d73d08 Update DownloadController.php (#1267)
* Update DownloadController.php

* StyleFix

* Another StyleFix !

* Update DownloadController.php

* Last StyleFix and Update

* Apply StyleCI fix

Co-authored-by: Nabeel Shahzad <nabeel@nabeel.sh>
2021-08-02 14:43:38 -04:00
Nabeel S
88a8ffe48a Check for blank values on import and omit them (#1266)
* Check for blank values on import and omit them

* Add paused status to the pirep changed
2021-07-22 15:56:03 -04:00
Nabeel Shahzad
78d3c6b577 Fix where for paused 2021-07-22 12:47:55 -04:00
Nabeel S
f42a41286d Add a 'paused' state (#1265)
* Add a 'paused' state

* Check paused status
2021-07-22 11:59:52 -04:00
Nabeel S
f8ded4e410 Update dependencies (#1262)
* Update dependencies

* Rebuild assets with updated deps
2021-07-21 10:43:36 -04:00
B.Fatih KOZ
6304f3cab4 Fix PirepService (#1261)
`$fv['name']` should be used instead of `$fv->name` due to the nature of source data.

Fixes #1260
2021-07-16 13:24:31 -04:00
Nabeel Shahzad
4eb73ab5f3 Update 3rd party services config 2021-07-13 14:38:42 -04:00
Nabeel Shahzad
2af72d137d Have emails go into the logs by default, make note to users to change that #1259 2021-07-12 17:18:28 -04:00
Nabeel Shahzad
f68e068f87 Use MAIL_MAILER #1259 2021-07-12 13:50:36 -04:00
Nabeel Shahzad
89f9706520 Include all dotfiles in zip 2021-07-12 12:47:24 -04:00
Nabeel Shahzad
cde6fb314b Add footer requirement into license explicitly 2021-06-20 09:07:13 -04:00
Nabeel Shahzad
1a944f320c Make the license extra clear 2021-06-19 15:58:56 -04:00
Nabeel Shahzad
d7ad2bdd11 Fix PIREP rejected message #1246 2021-06-18 13:21:59 -04:00
Nabeel Shahzad
24fca650f8 Use old notification handler for admin notifications 2021-06-18 11:33:02 -04:00
Nabeel S
35359b8646 Create endpoint to load bid by ID (#1248)
* Create endpoint to load bid by ID

* Fix endpoint
2021-06-17 19:42:56 -04:00
B.Fatih KOZ
b6a2fe405d Update AcarsRepository (#1245)
* Update AcarsRepository.php

Use `where` instead of `whereDate` , as you know whereDate only checks the date, it skips the time part completely, thus not providing correct live pireps collection.

* Switch from created_at to updated_at

Also remove the UTC conversion 'cause `updated_at` field is not being populated with UTC values.
2021-06-14 07:05:28 -04:00
Nabeel Shahzad
bd9c429cfc Don't force status to airborne 2021-06-13 15:28:57 -04:00
Nabeel Shahzad
b18f1bbe6c Fix paginate on airlines 2021-06-11 09:40:42 -04:00
Andrew Roberts
a5a21fb2fd Fix missing colon on ./vendor volume (#1243)
docker up throwing error due to missing colon on the ./vendor folder
2021-06-11 08:46:37 -04:00
Nabeel Shahzad
845514da2c Fix tests 2021-06-10 13:13:09 -04:00
Nabeel Shahzad
531489bfde Remove pagination from getting airlines 2021-06-10 12:41:23 -04:00
Nabeel Shahzad
601a17e1e6 Blank out links for ACARS 2021-06-10 11:08:25 -04:00
Nabeel Shahzad
3be8b1c4b9 undo links 2021-06-10 10:09:28 -04:00
Nabeel Shahzad
b4e33bb37e Update akaunting money library 2021-06-10 09:08:41 -04:00
Nabeel Shahzad
a8e6f1191b Fix the missing links array 2021-06-10 08:46:56 -04:00
Nabeel Shahzad
3a0140c2d0 Don't use backup for cache key on dependencies 2021-06-09 16:29:57 -04:00
Nabeel Shahzad
547b159570 Zip file generation 2021-06-09 16:22:25 -04:00
Nabeel Shahzad
cab5c03c0b Generate zip file differently 2021-06-09 16:17:06 -04:00
B.Fatih KOZ
777a696b35 Use Profile Route for Author URL (Discord Messages) (#1227)
* Update PirepStatusChanged.php

Use profile route for author url instead of pirep

* Update PirepSubmitted.php

Use profile route for author url instead of pirep

* Update PirepPrefiled.php

Use profile route for author instead of pirep

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-06-09 11:43:08 -04:00
B.Fatih KOZ
90344fb6e6 Simbrief Edit & Download Latest OFP (#1228)
* SimBrief OFP Edit

Changes aim to have ability of editing generated SimBrief Flight Plans and re-downloading.

* Move url to config

* Blade update and $uri change

* Update simbrief_form.blade.php

Used `$flight->id` along with `$user->ident` to have a more unique static id value. No details given for that fields uniqueness requirements, this will be ok I think though. 
Also we are passing user's simbrief userid with api to find the flight plan, both combined, no chance to get another users plan and/or any other plan of same user.

* Update SimBriefController.php

Move `static_id` to controller

* Update simbrief_form.blade.php

Read `static_id` from controller

* StyleFix

* Update phpvms.php

* Update SimBriefService.php

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-06-09 11:38:14 -04:00
Nabeel S
7481dab012 Remove extraneous data from API response; force API to en (#1241)
* Remove extraneous data from API response; force API to en

* Style fixes

* Remove

* Fix the meta block

* Style fixes
2021-06-09 11:20:25 -04:00
Nabeel Shahzad
dead1cfd0f Style fixes 2021-06-08 17:49:42 -04:00
Nabeel Shahzad
544462f420 Fix environment mapping 2021-06-08 17:46:15 -04:00
B.Fatih KOZ
a31201dfd3 Fix secstohhmm typecast for PHP 8 (#1230)
* Update helpers.php

Looks like php8 is not liking numeric strings as we like them.

Fixes #1229

* StyleFix

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-06-08 11:00:18 -04:00
Andrew Roberts
9d336c1140 Fix typo (#1234) 2021-06-08 10:45:17 -04:00
Nabeel S
96d33c11c8 Fix data not showing up for live map (#1223)
* Fix data not showing up for live map

* StyleCI fixes
2021-06-04 16:57:27 -04:00
Robin
48cada2053 Fixed German Translation (#1222)
* New Language: German

* Update German K

* Fixed German Translation

Co-authored-by: derrobin154 <derrobin154@gmail.com>
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-06-04 16:53:11 -04:00
Nabeel Shahzad
2a05013f66 Discord: Only add fields and footer if they're not empty 2021-06-04 15:16:36 -04:00
Nabeel Shahzad
4267648da5 Fields/fares not being saved properly 2021-06-04 15:06:19 -04:00
Nabeel Shahzad
5ada327236 Log request/response for Discord 2021-06-04 13:57:16 -04:00
Nabeel S
82825ef77b Add setting for recording IP address (#1221)
* Add setting for recording IP address

* Record IP on registration
2021-06-04 13:20:33 -04:00
Nabeel S
db532e0f16 Remove the IP address from being recorded (#1220) 2021-06-04 12:10:40 -04:00
Nabeel S
9b2e466b7e Discord notifications for PIREP and News events #433 (#1215)
* Discord notifications for events #433

* Style fixes

* Check for blank webhook urls and disable

* Cleanup items after review

* Changes and fixes

* Style fixes

* Don't load env for testing

* Fix status text

* Refactor saving fields/fares so events get the latest data

* Cleanup

* Style fixes
2021-06-04 10:51:59 -04:00
B.Fatih KOZ
17447c6903 Block aircraft with Simbrief (#1213)
* Block Aircraft with SimBrief

Changes aim to have the ability to block an aircraft's usage if it is used to generate a SimBrief OFP.

Unused/Expired briefings will be deleted by cron like before but will now be checked by HourlyCron, so admins can define more precise restrictions for them (and the blockage period of their aircraft)

Owner of the SimBrief OFP will be able to start a flight with acars using that particular aircraft, but pilots will get an Aircraft Not Available error (similar to Aircraft State check)

To prevent SimBrief OFP packs being marked as expired/unused, during pirep prefile, pirep_id will be saved to SimBrief model along with flight_id.

And when a flight is finished (pirep file), flight_id will be removed from SimBrief model as before. Only pirep_id will remain and aircraft will be available for another OFP generation.

* Update PirepController

In case a pirep is being saved/submitted with manual entry (but the va is using simbrief effectively) same logic should be applied during save/submit button selection.
Save will act like a pirep prefile , Submit will be pirep file.

* Manual Pirep Checks

Manual pireps, prefiled from a generated simbrief should be checked too. Also pirep.show blade's submit button should provide the same simbrief checks.

* Update PirepService.php

* Change settings and move sb cron to hourly

* StyleFix (SimBriefService)

* Another StyleFix (SimBriefService)

* Update SimBriefController

Removed null check of pirep_id for aircraft list generation to prevent live flights' aircraft being listed for another ofp generation.
( Active acars flights will have both flight_id and pirep_id at simbrief table)

* Update PirepService.php

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-06-03 16:17:16 -04:00
B.Fatih KOZ
ad86e996d7 Fix Aircraft Dropdown Grouping (#1216)
* Update PirepController

Frontend : Use `$subfleet->type`  instead of `name` for grouping aircraft list.

* Update PirepController (Admin)

Use `$subfleet->type` instead of `name` here too , for grouping aircraft list according to their subfleets.

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-06-03 14:41:31 -04:00
Robin
5a5fd02dac New Language: German (#1218)
* New Language: German

* Update German K

Co-authored-by: derrobin154 <derrobin154@gmail.com>
2021-06-03 11:46:32 -04:00
Nabeel Shahzad
97f095e4e9 Set default env name to "production" and debug to false 2021-05-29 18:13:36 -04:00
Jesper Falk
a2f91b6754 Add GD PHP Extension for docker container (#1212) 2021-05-28 08:48:52 -04:00
Nabeel Shahzad
a9e5554dea Trap migration error for modules if they don't exist 2021-05-27 16:14:13 -04:00
B.Fatih KOZ
5b10dca868 Fix SimBriefService (#1209)
* Fix removeExpiredEntires()

* Fix SimBriefTest

No need to add `'pirep_id' => ''` , just let it be `null` (like the core code does) and no need to convert Carbon to DateTimeString.
2021-05-27 09:27:38 -04:00
B.Fatih KOZ
11cebb3e6e Show only used Flight Types at Flight Search (#1207)
* Update Flight Controller

Show only used flight types in the search form instead of all IATA Flight Types.

* PrePR StyleFix

* StyleFix

* Use Model instead of DB

Also used the same $where array

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-05-25 16:14:42 -04:00
B.Fatih KOZ
96c17d33bc Add ability to search Flights by Code (#1205)
* Edit Search Form

Add ability to search via flight/route code (technically it was possible but the field was not present in the blade)

* Add Code (EN)

* Add Code (ES)

* Add Code (IT)

* Add Code (PT-BR)

* FlightCode => Code

* FlightCode => Code

* FlightCode => Code

* FlightCode => Code

* FlightCode => Code
2021-05-25 15:33:02 -04:00
Nabeel Shahzad
9abc892698 Update README 2021-05-25 15:11:09 -04:00
Nabeel Shahzad
67a51da220 Cleanup the docker-compose for local testing 2021-05-25 15:07:04 -04:00
Nabeel Shahzad
7e586a273a File/dir ownership in container 2021-05-25 13:37:53 -04:00
Nabeel Shahzad
8a591c11a5 Fix docker-compose for use non-locally 2021-05-25 13:14:08 -04:00
B.Fatih KOZ
728b033675 Fix Admin: UserController and Flight Edit (#1204)
* Fix Admin / UserController

Use Role Repository and `selectBoxList` method instead of the model itself.

* Fix Flight Fields

Added empty/blank option for clearing out the days when needed

* StyleFix
2021-05-24 19:13:44 -04:00
B.Fatih KOZ
68a6ed24cb Fix Flight Importer (#1202)
* Handle Route and Level fields too during import.
* Also removed the check for `visible => true` from `firstorNew` 'cause va admin may be importing to update not visible flights too.
  (by default all new flights are visible, so no affect on new flights)

Closes #1201
2021-05-24 15:19:06 -04:00
Nabeel S
7d8a34645e Add --force flag to migrations (#1203) 2021-05-24 10:58:10 -04:00
B.Fatih KOZ
4985da991b Remove Scripts (#1200)
* Remove Scripts

Remove scripts from create blade which are designed for edit blade in the first place (thus looking for flight object and its properties). 
No need to have an eyecandy date picker or a days selector, previous working version of create.blade was more than enough to manually add fights.

* Add placeholder for date fields
2021-05-23 20:47:15 -04:00
Nabeel Shahzad
c94358350a Add queue worker setting so those aren't run in cron if there's a worker 2021-05-21 12:31:32 -04:00
Nabeel S
d3ec0f4de3 5 char ICAO support #1052 (#1198) 2021-05-21 10:52:47 -04:00
Nabeel S
ede5b74383 Make fuel_used an optional field in PIREP file (#1197) 2021-05-21 10:02:07 -04:00
Nabeel S
e7bbd6cccb Use queues for notifications #1154 (#1174)
* Use queues for notifications #1154

* Styles

* Update defaults

* Include queueworker
2021-05-20 11:54:07 -04:00
Nabeel S
edcea258ce Remove the autoupdater #1133 (#1195)
* Remove the autoupdater #1133

* Remove self-updater package

* Package still needed :|
2021-05-20 11:37:27 -04:00
Nabeel Shahzad
5adc0b4072 Remove unused import 2021-05-20 09:20:12 -04:00
Nabeel Shahzad
fe7120e21a Add PHP 7.4 polyfill 2021-05-20 08:55:55 -04:00
B.Fatih KOZ
30be7c245c Fix Advanced Fuel Calculations (#1190)
* Fix Advanced Fuel Calculations

Current code works fine with a fresh submitted pirep but when a re-calculation is needed, fuel amount will not be correct if the aircraft was flown later on.
Commit provides fix for such re-calculation scenarios.

* StyleFix for the Comment Line !
2021-05-19 19:01:33 -04:00
Nabeel S
7cb9ae4ec3 intl dependency/polyfill updates (#1194) 2021-05-19 13:57:28 -04:00
Olli
6f1a5f1dc2 Update Flight Controller to fix an issue (#1192)
Closes #1180 and #1156. But now the script isn't beeing loaded

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-05-19 13:42:40 -04:00
Nabeel Shahzad
e3c3c81d19 Include missing scripts in flight create 2021-05-19 13:33:13 -04:00
Nabeel S
352f1ee9f8 Days::in should use in_mask; tests coverage #1180 (#1193) 2021-05-19 11:20:50 -04:00
Nabeel Shahzad
dff4273c72 Force empty to be 0 for in_mask #1180 2021-05-19 10:22:15 -04:00
Nabeel S
77a4acb569 Update dependencies (#1188) 2021-05-14 13:02:47 -04:00
B.Fatih KOZ
ff6827b368 Fix Installer Completed Blade (#1185)
We do not have a config.php anymore, page should refer to env.php for base level configuration.
2021-05-14 12:31:24 -04:00
B.Fatih KOZ
594d0eb222 Check Aircraft Availability (#1177)
* Check Aircraft Availability before Prefile

Check if the aircraft is available for flight (State : Parked / On Ground). If not throw new exception AircraftNotAvailable

* Add Exception

AircraftNotAvailable exception, used by PirepService during prefile checks.
2021-05-13 15:26:53 -04:00
Nabeel S
ee61de62fa Update to PHP 8 (#1118)
* Update to PHP 8

* Update composer file

* Remove PHP 8 incompatible library

* Remove PHP 8 incompatible library
2021-05-11 18:46:21 -04:00
B.Fatih KOZ
f2be14402f PirepCancelled Event (Cron Expired Pirep Deletion) (#1178)
* PirepCancelled Event (Cron Expired Pirep Deletion)

While deleting frozen in progress pireps we should at least send a PirepCancelled event for those who are listening.

(or we may have a new PirepDeleted event to be issued in such cases, I think PirepCancelled is enough though)

* StyleFix

* Another StyleFix

* Missing Log

Of course it will not be possible to write log entries without the Log itself.
2021-05-09 18:30:50 -04:00
B.Fatih KOZ
a186bfae2a Fix AirportController (Frontend) (#1176)
1. Inbound and Outbound flights were displaying all flights (active and inactive) , fixed to fetch only active flights.
2. Flash message and redirect to Dashboard was not working, instead we were getting 404 Not Found error.
2021-05-08 15:42:18 -04:00
Nabeel S
6e6ba85080 Fix for duplicated/wrong expenses being applied #915 (#1173)
* Fix for duplicated/wrong expenses being applied #915

* Style fixes
2021-05-06 12:42:56 -04:00
B.Fatih KOZ
d2272e32a6 100LL and MOGAS Fuel Cost (#1172)
* Add defaults for 100LL and MOGAS prices

Add missing defaults for 100LL and MOGAS Fuel prices.

* Calculate Fuel Cost according to Fuel Type

Calculate pirep fuel costs according to aircraft (subfleet) fuel type, use JetA as fail safe default.

* Fix for Failing AwardTest

At least attempting to fix

* Fix fuel types logic

* Style

* Invert the logic

Co-authored-by: Nabeel Shahzad <nabeel@nabeel.sh>
2021-05-06 08:16:33 -04:00
Nabeel S
b6c0946795 Delete users without PIREPS; pilot leave fix (#1171)
* Delete users without PIREPS; pilot leave fix

* Style fixes
2021-05-05 09:56:28 -04:00
Andrew Roberts
fca04e6b0c Allow session lifetime to be set in env variables (#1170)
* Allow session lifetime to be set in env variables

Currently the session live time defaults to 2 hours, adding an env variable will allow us to change this on a per site basis

* Add whitespace for consistency
2021-05-05 08:51:18 -04:00
Andrew Roberts
5094fce4b0 Disable autocomplete on admin email field (#1169)
* Disable autocomplete on admin email field

Fixes #1165

* Disable autocomplete on admin name and password

For sake of completeness and due to some over zealous autocompleters, also disable it on name and password fields
2021-05-04 13:26:16 -04:00
Nabeel S
fe0ef60b6c Block refiling of PIREPs (#1167)
* Block refiling of PIREPs

* Style fixes

* Package updates
2021-05-03 10:00:10 -04:00
B.Fatih KOZ
5094375e13 Fixes For GDPR/Deleted Users (#1164)
* Fix DeletedUsers being displayed at Homepage

Deleted users should not be displayed at homepage / newest pilots list. PR fixes that problem.

* Do Not Display Deleted Users with LatestPireps

As the main page, Latest Pilots widget should not display GDPR/Soft deleted users too.

* StyleFix
2021-05-03 08:46:21 -04:00
Nabeel Shahzad
ec6cb42bfd User guard for null 2021-04-23 13:47:54 -04:00
Nabeel S
14d0e99a37 Delete the user in a GDPR compatible way (#1151)
* Delete the user in a GDPR compatible way

* Block user from calls

* Style fix
2021-04-23 10:33:13 -04:00
B.Fatih KOZ
f8c7bc31f5 Add Airline ICAO to Subfleet selectBoxList (#1153)
* Add Airline ICAO to Subfleet selectBoxList

Subfleet dropdown at flight search will look like `Boeing B737-800 WL | THY`

* StyleFix
2021-04-23 09:44:37 -04:00
Nabeel Shahzad
2545328233 Fix APP_URL being called SITE_URL 2021-04-20 23:28:57 -04:00
Russell West
61739ce266 Pirep delete confirmation (#1143)
* adds 100ll option to airport admin

* Adds mogas field too

* adds basic confirmation when deleting pirep
2021-04-15 08:39:42 -04:00
Nabeel S
bffc4f911c Add tests for the cron jobs (#1141) 2021-04-14 08:37:48 -04:00
Nabeel Shahzad
d18925f473 Add tests for 0 results METAR 2021-04-14 06:45:35 -04:00
Russell West
f5e83461a3 adds 100ll option to airport admin (#1138)
* adds 100ll option to airport admin

* Adds mogas field too

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-04-13 12:03:03 -04:00
Nabeel S
bfddb2c84d Make sure all dates are in UTC (#1139) 2021-04-13 09:25:38 -04:00
B.Fatih KOZ
7e9eb08135 Use where iso whereTime (#1137)
Using whereTime may present a problem for flights conducted during utc midnight and some active/live flights may be deleted with whereTime.

Scenario;

now = today-01:00  utc
setting = 2 hours
date = yesterday-23:00 utc

Any live pireps will/may be deleted with whereTime 'cause their last updated TIME will be maximum 00:59 which is smaller than 23:00.
2021-04-13 09:08:50 -04:00
B.Fatih KOZ
3d55336823 Fix default value for Captcha setting (#1136) 2021-04-12 16:55:38 -04:00
Nabeel Shahzad
68ed2355ad Add GRAVATAR_DEFAULT_AVATAR to config 2021-04-11 18:42:51 -04:00
Nabeel S
fdab4ee530 Fix email for news not going out (#1131) 2021-04-11 14:32:58 -04:00
Nabeel Shahzad
648e7a261d Add APP_NAME to env stub 2021-04-11 13:46:52 -04:00
Nabeel Shahzad
9cb0a0cf36 Change the default driver to use mail 2021-04-11 12:36:37 -04:00
B.Fatih KOZ
2c8372d484 Read Captcha Settings From ENV (#1130)
* Read Captcha Settings From ENV

* Update captcha.php
2021-04-11 11:35:14 -04:00
Nabeel Shahzad
498d5bfaf0 Slugify cache prefix and quote it in the env 2021-04-10 21:13:34 -04:00
Nabeel Shahzad
2202c5b479 Change default env to prod for fresh install 2021-04-10 18:00:03 -04:00
Nabeel S
ac64a5db75 Migrate all configs into the env.php file #1075 (#1128)
* Migrate all configs into the env.php file #1075

* Style fixes

* Fix config names in CreateConfig

* Fix installer/installer error messages
2021-04-10 17:19:45 -04:00
B.Fatih KOZ
6c3992e781 Fix for Hourly Crons (#1127)
* Fix for Hourly Cron

We should be using whereTime instead of whereDate

https://laravel.com/docs/8.x/queries#additional-where-clauses
`The whereDate method may be used to compare a column's value against a date`

* Fix for RemoveExpiredBids

I used where to do check 'cause people may set 48 hours to remove a bid, thus neither whereDate nor whereTime will give a correct results.

* Fix for DeletePireps

I used where to do check 'cause people may set 48 hours to delete cancelled or rejected pireps, thus neither whereDate nor whereTime will give a correct results.
2021-04-09 19:15:22 -04:00
B.Fatih KOZ
344edde0fb Alphanumeric Callsign For Flights (#1124)
* Alphanumeric Callsign For Flights

PR adds ability to define alphanumeric callsigns to flights, display them and use them during SimBrief OFP generation (if pilot ident as callsign option is not enabled)

Translations for en/es/it/pt-br added.

* Change db table name

* Change db column name, fix rules

* Change db column name

* Another db column name change

* Just another one more

* Last one from anumeric_callsign to callsign

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-04-05 18:00:50 -04:00
Maximiliano Fallico
7502c053bf Show Airline logo / icao to subfleets table (#1121)
Will show the subfleet airline logo or icao in the admin flight create page table.

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-04-05 17:05:28 -04:00
Maximiliano Fallico
dbfaed0ecc Adds Airline Icao to Subfleet Select in Flight Create (#1123)
* Adds Airline Icao to Subfleet Select in Flight Create

* Fix Style

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-04-05 16:55:50 -04:00
Maximiliano Fallico
ff255c999b Add "View Pirep" In pirep cards (#1122)
Will show it in a new blank page in order to view pirep flight map.,

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-04-05 16:43:51 -04:00
Nabeel Shahzad
8c065a44cf Set default theme as "null" value 2021-04-03 10:25:02 -04:00
Nabeel Shahzad
8e9ba3b922 Fix styling that somehow slipped through 2021-04-01 17:33:57 -04:00
Nabeel Shahzad
677d30883f Check if flash messages are strings 2021-04-01 17:31:53 -04:00
Nabeel Shahzad
ede71e6927 Fix the PIREP edit permissions 2021-04-01 09:54:01 -04:00
Andrew Roberts
3f84f84309 Fix issue with being unable to save pirep edits (#1116)
Fixes issue being unable to save pirep edits from the admin section due to incorrect variable being used
2021-03-31 11:03:01 -04:00
exciler
50e8f2e52b Fetch timezone on airport lookup (#1103)
Co-authored-by: Andreas Palm <ap@ewsp.de>
2021-03-29 17:10:00 -04:00
Nabeel S
96fff0248d Save airport timezone (#1112)
* Fix airport timezone lookup

* Save timezone to the airport when importing
2021-03-29 15:49:34 -04:00
Nabeel S
9c4aced837 Move the prefile event and add a new error exception (#1111)
* Move the prefile event and add a new error exception

* Remove extra import

* Add empty handler for testing

* Fix styling

* Fix styleci
2021-03-29 14:53:35 -04:00
exciler
ed146b2c70 replace windows backslashes by slashes before path mapping (#1107)
Co-authored-by: Andreas Palm <ap@ewsp.de>
2021-03-28 18:15:56 -04:00
exciler
1e320835c2 fix map-info-box display (#1104)
* fix map-info-box display

* Check user on PIREP show/edit/update/submit

* add missing use

* refactoring according to comments; use UpdatePirepRequest for authorization and make user available to view

Co-authored-by: Andreas Palm <ap@ewsp.de>
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-03-28 09:57:16 -04:00
exciler
d4c301a36c Remove remove_bid_after_accept setting (#1100)
* Remove "Remove bid on accept" setting and remove bids after PIREP was filed

fixes #1039

* Add migration to remove setting from database

* fix migration naming and remove obsolete code

Co-authored-by: Andreas Palm <ap@ewsp.de>
2021-03-27 08:33:21 -04:00
B.Fatih KOZ
c2b0b69eb2 Change LatestPireps Widget Sort Order (#1099)
* Change LatestPireps Widget Sort Order

Latest pireps should be ordered by `submitted_at` instead of `created_at` . 

Pirep may be created even a day before others (with the pause/resume ability we have in acars) but it gets submitted once when the flight is ended, thus I think it should be our reference to sort them in proper order.

* Trying to Pass UnitTest
2021-03-25 09:51:16 -04:00
Nabeel Shahzad
43c33adcfe Unit rounding 2021-03-25 08:59:45 -04:00
exciler
be6332936f When importing flights, set subfleet name only if subfleet has been created (#1095)
* when importing flights, set subfleet name only if subfleet has been created, do not update existing subfleets

* add tests for flights import regarding subfleets

Co-authored-by: Andreas Palm <ap@ewsp.de>
2021-03-23 08:50:19 -04:00
B.Fatih KOZ
8f38fc2dec Urgent Fix For SimBriefControlled (#1094)
Added missing Enums
2021-03-22 11:40:21 -04:00
B.Fatih KOZ
65015cbce2 Move SimBrief aircraft selection to Controller (#1093)
* Move SimBrief aircraft selection to Controller

Instead of passing subfleets to blade (and doing two foreach loops and ifs to populate the dropdown), we are building a proper aircraft list here.

Did not removed $subfleets from data being passed to blade on purpose, it may be removed later on.

* Style Fix

* Update aircraft selection blade to use $aircrafts

* Order generated Aircrafts collection

First ICAO then Registration

* Add privatized name setting for simbrief

To prevent possible privacy issues according to latest regulations.

* Add privatized name to SimBrief form

It is controlled with a setting, if not enabled we will not pass any names to SimBrief via API (this will result users SimBrief membership name being used at the OFP as before)
2021-03-22 10:55:33 -04:00
B.Fatih KOZ
3cc5ca2c32 DownloadController Improvements (#1091)
* DownloadController Improvements

Added multiple airline support to both Aircraft and Subfleet downloads, if the user has more than one active airline downloads will display the airline name before the object name. Also sorted the returned results to have a better look at the blade.

* Trying to pass broken UnitTest

Please do fix the UnitTest, this pr has nothing to do with units but still being tested with it and failing.
2021-03-21 09:33:04 -04:00
Maximiliano Fallico
30e88ac6bc Aircraft at departure airport restrictions (#1090)
* Update simbrief_aircraft.blade.php

If resrict airplane at location settings is enabled, Show only  aircraft at the departure location of the flight. Kingly made by @FatihKoz at my ocd request.

* Update simbrief_aircraft.blade.php
2021-03-20 20:03:24 -04:00
Nabeel Shahzad
61ee4254fc Style fix 2021-03-20 17:41:07 -04:00
Nabeel Shahzad
f9f0ee826d Fill the flight subfleets even if there's a simbrief 2021-03-20 17:28:54 -04:00
Nabeel Shahzad
4394487392 Add missing aircraft_id to sample data 2021-03-19 18:47:02 -04:00
Nabeel S
1287766a46 Fix aircraft retrieval for Simbrief (#1089)
* Fix full aircraft retrieval for simbriefs

* F off StyleCI
2021-03-19 18:25:19 -04:00
Nabeel Shahzad
11824c9f8b Flight search error 2021-03-19 16:59:39 -04:00
B.Fatih KOZ
bbd02bf5c7 Fix For GH Costs (#1088)
* Fix For GH Costs.

PR aims to fix the problem where Airport GH cost is not defined but recored to db as 0.00 or 0 (default value for airports table)
In such cases settings/default apt gh cost will be used.

* Updated logic for JetA1 cost check

* Remove default costs being used during import
2021-03-19 16:42:36 -04:00
exciler
9bb192b97f Add disable activity check option on certain roles #1078 (#1087)
* Add boolean field "disable activity checks" to role, check for this field inside PilotLeave-Check, add tests

* fix checkbox on form

* CS fixes

* CS fixes again :-)

Co-authored-by: Andreas Palm <ap@ewsp.de>
2021-03-19 13:09:29 -04:00
exciler
2cede04b1e Optimize view paths for module views in theme folder (#1081)
* override \Igaster\LaravelTheme\themeViewFinder as a workaround until PR#133 in igaster/laravel-theme is merged

* fixup code style

* further code style fix

Co-authored-by: Andreas Palm <ap@ewsp.de>
2021-03-19 09:22:03 -04:00
B.Fatih KOZ
7072428218 Fix Finance Memo (Ground Handling) (#1083)
PR fixes issue #1082
2021-03-18 20:04:13 -04:00
B.Fatih KOZ
1d83b85d8b Fix for Fuel and Ground Handling Costs (#1050)
* Fix for Fuel and Ground Handling Costs

PR aims to fix issue #1048  and implements the feature request #1049 

If no fuel cost is defined for departure airport, settings / airport fuel price will be used.
If no ground handling cost is defined for airports, settings / airport ground handling cost will be used.

Ground handling prices of both departure and arrival airport will be used for calculations.

* Resolve conflict with latest dev

PR will still fail checks due to double ground handling fares and will work on it to have two records at transactions for dep/arr

* Remove Double GH Costs / Fix The Bug Only

Removed double GH costs for now, pr aims only fixing the current issue (general settings not being read for fuel and ground handling costs)

* Add departure and arrival airports to ground handling

* Style fix

* Fix tests

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
Co-authored-by: Nabeel Shahzad <nabeel@nabeel.sh>
2021-03-18 11:32:40 -04:00
Nabeel S
63eef59060 Fix null visibility in METAR (#1079)
* Fix null visibility in METAR

* Report the text in units from the METAR
2021-03-17 17:40:45 -04:00
B.Fatih KOZ
0152ff6045 Update pireps/show.blade (#1080)
Added score and landing rate to right sidebar, sorted the pirep logs in asc order to make it easy to read.
2021-03-17 16:43:36 -04:00
B.Fatih KOZ
e45bd66388 Fix Metar Decoding / Wind check for Wind Chill (#1072)
* Fix Metar Decoding / Wind check for Wind Chill

PR aims to fix the bug #1071 by checking both the wind speed and it's value for starting Wind Chill calculation.
2021-03-15 10:41:05 -04:00
exciler
b9e7a2efc9 Add unit conversion handling for block_fuel like for fuel_used (#1076)
* Add unit conversion handling for block_fuel like for fuel_used, add further checks in PIREPTest->testUnitFields

* Remove accidentially added "use"

Co-authored-by: Andreas Palm <ap@ewsp.de>
2021-03-15 08:30:14 -04:00
Nabeel Shahzad
73f88fce0c Fix permissions with modules 2021-03-13 18:31:09 -05:00
Nabeel S
e70ee5aa6f Add web cron ability #821 (#1073)
* Use database for kvp storage

* Read kvpstore

* Add web cron ability through API #821

* Style fixes

* Fix text
2021-03-09 11:36:56 -05:00
nabeelio
f1c54bcc7c Add Postmark package #1067 2021-03-08 11:35:11 -05:00
nabeelio
d94d754961 Block user if they're not active #1066 2021-03-08 11:24:09 -05:00
nabeelio
9abfbd6c8c Remove unneeded import #1066 2021-03-08 11:21:55 -05:00
nabeelio
97fc1dd43d Don't block API logins #1066 2021-03-08 11:19:31 -05:00
Nabeel Shahzad
edc37f40fa Show either create/view simbrief button, not both 2021-03-06 16:48:50 -05:00
Nabeel S
950c7788be Restrict Simbrief to user who generated it (#1064)
* Restrict simbrief to user

* Style fixes

* Add tests

* Style fix
2021-03-06 13:49:42 -05:00
nabeelio
b3af50ac5a Add ignored solution provider 2021-03-05 08:00:34 -05:00
nabeelio
8a9b68d9ec Disable ignition runnable solutions 2021-03-05 07:59:50 -05:00
nabeelio
70a4cf9f90 Remove the laravel-backup library 2021-03-05 07:33:42 -05:00
Nabeel Shahzad
c3465851b2 Rename backups folder 2021-03-05 06:24:23 -05:00
Nabeel Shahzad
b13c4df338 laravel-backup changes 2021-03-05 06:00:36 -05:00
Nabeel Shahzad
c736a9b639 Disable encryption by default for backups 2021-03-05 05:44:04 -05:00
nabeelio
d2e1004e08 Undo composer downgrades 2021-03-04 17:17:39 -05:00
Nabeel S
3800c01d94 Update to Laravel 8 (#1058)
* Update Laravel and other dependencies

* Composer version in CI

* Remove the PHP exit from env file

* Add PHP 8 to testing matrix

* Update doctrine

* Update doctrine

* Update faker lib

* Rewrite TLD check to remove deprecated library

* Update version lib

* Remove PHP 8 for now

* Style fixes
2021-03-04 17:08:51 -05:00
Nabeel S
922e754c9e Check for valid reference object in recurring finance (#1056) 2021-03-02 16:19:54 -05:00
Nabeel S
936cd2efd3 Implement PIREP deletion #1014 (#1055)
* Implement PIREP deletion #1014

* Style fixes

* Add delete button to PIREP listing page

* Remove extra import
2021-03-02 15:43:34 -05:00
Nabeel S
e22d6d5996 Refactoring Simbrief fares and aircraft (#1054)
* Refactoring simbrief fares and aircraft

* Hide user full name/email

* Sort PIREP fields desc; fix cargo counts

* Change the sorting

* Extra logs

* Fix tests

* Return fare information through the API

* Style fixes

* Test fix

* Another test fix

* More fixes

* Set aircraft and fares in prefile

* Formatting
2021-03-02 12:29:04 -05:00
B.Fatih KOZ
efcb7e8895 Fix Advanced Fuel Calculations (#1053)
Due to an error on the settings check advanced fuel calculations was not working and defaulting to fuel used always.
2021-03-01 15:03:27 -05:00
Nabeel S
43fbe9e943 Update composer dependencies (#1047) 2021-02-26 12:23:50 -05:00
nabeelio
8fc0aec800 Set cache driver to array for tests 2021-02-25 13:50:37 -05:00
Nabeel Shahzad
bb84fa82a4 Default to file storage for sesions 2021-02-24 13:37:46 -05:00
B.Fatih KOZ
4fe323a763 Advanced Fuel Calculations (#1044)
* Advanced Fuel Calculations

PR aims to have realistic fuel debit calculations as in the real ops. When enabled, remaining fuel amounts from previous flight will be reduced from block fuel and airline will only pay for uplifted fuel amount.

If onboard fuel is enough for the flight or exceeds the required amount no fuel debit will be issued.

If this is the first flight of the aircraft or the tanks are dry, full block fuel will be treated as uplifted.

Disabled / uses current default (fuel_used will be debited)

Aircraft table also will hold the fuel_onboard value (not needed for calculations, just saving for displaying purposes)

* Style Fix

* Another Style Fix

Love StyleCi

* Fix Settings

Moved new setting under other pirep settings

* Fix Setting Check

* Fix EOF settings.yml

* Fix Settings
2021-02-24 12:22:52 -05:00
B.Fatih KOZ
e3b4a0ed2e SimBrief integration enhancements (#1045)
* SimBrief Integration Update

* Added SimBrief Type field to subfleets, can be used to assign simbrief airframes to subfleets and fix non existing or wrong types. If not used simbrief form will use aircraft's icao type code

* Added Passenger and Baggage weights to settings

* Added setting for using PhpVms Pilot/User  Ident as simbrief atc callsign

* SimBrief form code cleaned up a bit and improved. Now form supports both cargo and passenger fares to be used at the same time.

Generated passenger baggage weight will be reduced from aircraft's cargo capacity and remaining amount will be used for random cargo generation.

Also multiple cargo fares or any mix is possible now (like only cargo, only passenger, multiple cargo and passenger fares)

* StyleFix (SimBrief Controller)

* Fix Callsign Setting Check

* Code Cleanup

Reduced loops and removed if's in loops, getting fares from aircraft instead of flight/subfleets.

No need to go through getReconciledFaresForFlight anymore. Aircraft provides all fare info we need.

Removed unnecessary html elements, added some comments.

* Update Simbrief Controller

Fixed setting checks.

Removed non used $subfleet and from main form and $aircraft from aircraft selection form blade.

Added/fixed comments.

* StyleFix for Controller
2021-02-24 09:32:29 -05:00
Nabeel Shahzad
a4c431d39f Set missing value from default 2021-02-23 11:25:06 -05:00
Nabeel Shahzad
a52e0410a7 Force default to the value when syncing settings 2021-02-23 11:23:40 -05:00
B.Fatih KOZ
baf63361a0 Fix findUsersOnleave Function (#1042)
Query was checking status field instead of state field to find active users.
2021-02-22 11:23:50 -05:00
B.Fatih KOZ
b4d5c0fbcd Weather METAR/TAF enhancements (#964)
* Update AviationWeather.php

Added the ability to fetch latest TAF report of given icao from ADDS/NOAA

* Update Weather.php

Used updated Metar\AviationWeather service to improve the widget ability and provide raw TAF data for the view

* Style Fix 1

* Update weather.blade.php

Updated blade to match updated Metar\AviationWeather service and the Weather widget controller.

Also fixed the order of temp - dewpoint - humidity - visibility display according to aviation usage.

Widget now displays raw TAF data just below raw METAR data.

* Update Metar inferface and wrap TAF retrieval in cache

* Styles fix

* Add call to getTaf. Don't call AviationWeather directly

* Fix cache lookup strings

* Fix recursion error

* Update weather.blade.php

Used latest weather.blade , added $taf['raw'] after raw metar.

* Compatibility Update

Updated the widget controller to match latest dev (added raw_only to config)

* Update Weather Widget Blade

Made the widget blade compatible with the TAF reports, widget will display raw metar and taf after the decoder, if no metar or taf recieved it will be displayed in its own row. Also added the new option of raw_only to blade, if it is true, metar decoding will be skipped and only raw values will be displayed. ( Useful when displaying multiple wx widgets at the same page for departure, destination and alternate etc )

Co-authored-by: Nabeel Shahzad <nshahzad@live.com>
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-02-19 12:45:39 -05:00
B.Fatih KOZ
6b7eab05e2 Assign subfleets from ranks when there are no subfleets on a flight
If no subfleets are assigned to a flight, vmsacars was not allowing the flight to be loaded and used 'cause the subfleets was returning null. With this pr, users will be able to use the aircrafts which they have access to by their ranks. ( Same logic was used in SimBrief Controller to populate the aircraft list for flight plan generation )

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-02-19 08:20:17 -05:00
Jannis D
4c8e31ac6f Update installer.php (#1038)
Co-authored-by: Jannis D <Mail@JannisD.de>
2021-02-19 08:13:08 -05:00
B.Fatih KOZ
fe41e61c02 Fix for SimBrief VATSIM Prefile errors (#1037)
Speed is now checked and leading zero is removed, also changed the initial altitude to full feet value like 23000 instead of just 230.
2021-02-18 18:02:33 -05:00
Nabeel Shahzad
bd85a04530 Fix internal event for ON_LEAVE 2021-02-17 18:57:16 -05:00
Nabeel S
cbb7d6e274 Fix pilot leave calculation #1022 (#1035)
* Fix pilot leave calculation #1022

* Remove unused imports

* Add logging where fares are being saved
2021-02-17 18:54:18 -05:00
Nabeel Shahzad
8907527872 Remove invalid bids #1034 2021-02-17 18:03:07 -05:00
Nabeel Shahzad
942c060c99 Added opcache package 2021-02-17 14:44:41 -05:00
Nabeel Shahzad
68a9421445 Shrink backup sizes 2021-02-17 14:38:47 -05:00
Nabeel Shahzad
4e652c91ae Account for localhost/testing sites in domain checks 2021-02-13 15:59:19 -05:00
Nabeel Shahzad
a6f62045c4 Extend cron check for 12 hours 2021-02-13 15:17:16 -05:00
Nabeel Shahzad
3f3b63da6f Fix session database configuration 2021-02-12 11:43:00 -05:00
Nabeel Shahzad
dd7812e5c5 Undo primary idx change 2021-02-11 08:57:43 -05:00
Nabeel S
447d02bd4f Update the sessions table (#1030)
* Update the sessions table

* Add index on user_id
2021-02-11 08:50:49 -05:00
Nabeel Shahzad
be9b698f14 Merge branch 'dev' of https://github.com/nabeelio/phpvms into dev 2021-02-10 15:47:42 -05:00
Nabeel S
d110c2d951 ACARS table vs int to double (#1028)
* mail config - "driver" to "default"

* Change VS type from int to double

* Migration fix

* Fix type
2021-02-10 13:39:40 -05:00
Nabeel Shahzad
4d20998368 mail config - "driver" to "default" 2021-02-10 13:18:02 -05:00
Nabeel Shahzad
4a20b41b25 Rename driver to default in mail config 2021-02-10 13:15:18 -05:00
Olli
8c2513eb3d Update style.css for better mobile experience (#1018)
This edit hides the dropdown menu while being closed on mobile view
2021-02-05 08:38:32 -05:00
Nabeel Shahzad
2dbd58e59e Merge branch 'dev' of https://github.com/nabeelio/phpvms into dev 2021-02-04 14:54:20 -05:00
Nabeel Shahzad
bf77f7dd96 Add 'phase' as response output, deprecate "status" 2021-02-04 14:54:16 -05:00
B.Fatih KOZ
5a570989de Failsafe for SimBrief random pax generation (#1015)
* Failsafe for SimBrief random pax generation

PR fixes the problem for 0 load generation where va admins do not set load factor and variance values for their flights and also leave the general settings empty. In such cases, both loadmin and loadmax was returning 0 , resulting zero load.

Thanks @macofallico for figuring this out.

* StyleFix
2021-02-01 15:27:22 -05:00
B.Fatih KOZ
6b3207377a Fix Profile Fields (#1013)
* Fix Profile Fields

PR fixes two issues ;

1. Profile Fields not showing up on user profile
2. Profile Fields not showing up on user.profile.edit

Profile.index was looking for "public" to be true, while controller was sending "private" and it was not boolean.

Also profile controller was not sending the fields to the blade. Both fixed and working now

* Update index.blade.php
2021-01-28 08:31:29 -05:00
B.Fatih KOZ
ac1d5e1555 Fix PilotHoursAwards (#1011)
!is_int was causing the check always return false even when user enters a proper value like 6000 or 30000 in admin/award settings.

We should use !is_numeric instead to see if it is a valid numeric value.
2021-01-26 19:48:43 -05:00
B.Fatih KOZ
0d45fc287b AwardController text correction (#1010)
Fixed the flash message texts
2021-01-26 16:31:54 -05:00
B.Fatih KOZ
4911f6799d Fix for ACARS config download button not working #919 (#1009)
* Fix For Acars Config Download Button No Working Bug #919

PR fixes the Acars Config Download button not showing up at user profile.

Also fixes the problem where Generate New Api Key button not following user selections and generating a new key even if user clicks cancel.

* Style Fix for ? and !

Fix the typo :)
2021-01-25 16:04:43 -05:00
Nabeel Shahzad
5821067231 Default settings to false 2021-01-25 07:06:27 -05:00
Nabeel S
fc7ad7eb6a Simbrief attachment not working #1005 (#1006)
* Refactoring for Simbrief not working #1005

* Style fixes

* Update tests for new briefing URL

* Check the OFP user

* Comment out user check temporarily
2021-01-25 06:54:17 -05:00
Nabeel S
101b3261f5 Move loadmin/max into the controller (#1003) 2021-01-22 09:02:15 -05:00
Nabeel Shahzad
fb0027b140 Update Discord message 2021-01-22 08:38:54 -05:00
Nabeel Shahzad
066702e490 Switch to http until I can get the certificates sorted 2021-01-22 08:30:25 -05:00
Nabeel Shahzad
b4e0515405 Add tar/zip reference to Discord build message 2021-01-22 08:29:22 -05:00
B.Fatih KOZ
f5ca8ce6e3 Fix For Load Factor and Variance Bug (#1002)
PR fixes the issue where load factor and variance being reported 0 to simbrief form, where user does not provide any values for each and wants to use general settings per flight.

Quick fix for issue #1001
2021-01-22 08:14:34 -05:00
Nabeel Shahzad
7e9196c7e6 Check if simbrief is valid 2021-01-21 11:57:44 -05:00
Nabeel S
a2916bf536 Cleanup visible flight logic (#1000)
* Cleanup visible flight logic

* Add transfer_time to API response
2021-01-21 11:11:11 -05:00
Nabeel Shahzad
0578f98b58 Force flight to visible before day checks 2021-01-21 10:57:51 -05:00
Nabeel Shahzad
2e0f0b00ef Ensure simbrief id is assigned 2021-01-21 09:21:39 -05:00
Daniel Ortez
d5d9010134 Fix error in webpack file (#994) 2021-01-20 09:24:27 -05:00
Nabeel Shahzad
bd8e13e78f Cleanup Simbrief Briefing pages 2021-01-17 21:52:22 -05:00
Nabeel Shahzad
c4dee07b7f Cleanup flight search code 2021-01-17 21:25:44 -05:00
dependabot[bot]
f8a44d8c6d Bump ini from 1.3.5 to 1.3.8 (#955)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-01-17 16:01:04 -05:00
B.Fatih KOZ
617cea5df7 SimBrief Planning System Update (#991)
* SimBrief Planning System Update

Replaces outdated old pr.

Same improvements apply to both controller and simbrief_form.blade.

* Style Fix for SimBrief.Controller

* strict equals fix and some comments

changed equals to strict equals and put in some comments about the loadarray and manualrmk generation.

* Formatting/separate out secstohhmm

* Formatting

* Removed duplicates

We have the $wakecat, $equipment and $transponder in the controller, removed them from the blade.

Fixed a harmless typo in the IVAO Prefile DEPTIME line

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
Co-authored-by: Nabeel Shahzad <nabeel@nabeel.sh>
2021-01-17 15:59:32 -05:00
B.Fatih KOZ
3a99fe9e0e SimBrief Briefing Display Fix (#992)
Fixed Estimate Enroute Time (EET) display (it was using Scheduled Enroute Time)
2021-01-17 14:26:03 -05:00
B.Fatih KOZ
a952071cb4 Subfleet Hubs / Base Airports (#978)
* Update SubFleet Model

Add hub_id for storing subfleet's main base/hub airport, define a relationship with airport model to get details of the base/hub airport when needed.

* Update Admin / SubFleetController

Added the ability to read and pass hub airports to admin view for create/edit options.

* Update Admin/SubFleets.fields.blade

Added the dropdown for adding/editing main base/hub of a subfleet.

* Add migration for the hub_id column

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
Co-authored-by: Nabeel Shahzad <nshahzad@live.com>
2021-01-17 12:43:06 -05:00
dependabot[bot]
157e0d830c Bump axios from 0.18.1 to 0.21.1 (#979)
Bumps [axios](https://github.com/axios/axios) from 0.18.1 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.18.1...v0.21.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-01-17 12:27:54 -05:00
B.Fatih KOZ
a5b83185f5 Search Flights By Flight Type (#987)
Flight Controller : Added flight_type to return

Flight Repository : Made flight_type searchable and added its where criteria

Flight.Search.Blade : Added the flight types in a reasonable order as a dropdown (like schedule pax,charter pax,cargo,others)

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-01-17 12:23:23 -05:00
Maximiliano Fallico
29ff0758a7 Add filter/search by airline in admin (#990)
Add filter/search by Airline
2021-01-17 11:59:34 -05:00
Nabeel Shahzad
be74d99ae8 Run on pull request 2021-01-17 11:54:46 -05:00
Nabeel Shahzad
53de2e3229 Only run workflows on main repo 2021-01-17 11:52:49 -05:00
Nabeel S
80a90c6e3c Fix github badge 2021-01-16 22:15:32 -05:00
Nabeel S
854ed9b92c Remove travis-ci badge 2021-01-16 22:14:28 -05:00
Nabeel S
46b17b5c04 Use GitHub actions (#989) 2021-01-16 20:25:58 -05:00
Andrew Roberts
0068b1215a Remove existing fares when importing (#988)
Delete all existing fares and overwrite with new import when Delete Existing Data is checked/true.
2021-01-16 13:09:56 -05:00
B.Fatih KOZ
984c1e0cec SimBrief : Generate New Briefing (#986)
* Add SB Briefing Removal Route

Route will be called from simbrief.briefing.blade

* SimBrief Controller and Briefing Blade Update

Added the remove function to controller, which removes the simbrief ofp if no pirep_id is present, else it just nulls the flight_id for to be able to create a new SB pack

Also added the button to blade for it to work

* Style Fix

love styleci
2021-01-15 17:36:46 -05:00
Daniel Ortez
ad8b8e8945 Fix for deleting flights when importing (#984) 2021-01-14 07:07:35 -05:00
B.Fatih KOZ
2b0056b7c5 Added the ability to enable/disable flight table display below the map (#983)
* LiveMap Widget Upgrade

Added the ability to enable/disable flight table display below the map.

Default is on

* Update LiveMap.php

* Update LiveMap.php

* Update live_map.blade.php
2021-01-12 08:24:50 -05:00
B.Fatih KOZ
319a9fc8e1 Weather widget additions/fixes (#981)
Fixed the problem where values are not displayed when the reported wind,temp and dewpoint are 0 (zero).
Fixed the hPa number formatting, there is no need to add 2 more digits to it, it is a plain 4 digit value always (like 1013 or 1024, it is never reported nor used as 1013,58 or 1024,35 etc).
Corrected the display order, as it should be read (or say decoded).
Also added decoded Current and Recent Weather Situations, RVR and Runway Condition reports.

RVR report needs improvement in the Support / Metar.php too, it only reports nmi as the distance as far as i saw but it should be able to report meters too.
2021-01-07 09:09:05 -05:00
B.Fatih KOZ
a037597a21 Airline > Subfleet Relationship (#970) 2021-01-03 08:05:48 -05:00
Andrew Roberts
4026fe9149 Fix location of configservice (#977)
Pointing to wrong location of file which is throwing errors as a result
2021-01-03 07:39:02 -05:00
B.Fatih KOZ
18e1d63760 Update User.php (#968)
We should be able to send the private name with the api too.
2020-12-23 11:27:01 -05:00
Nabeel S
4bda494c6b Add helpers kvp() and kvp_save() (#966) 2020-12-21 11:30:44 -05:00
B.Fatih KOZ
a5513b6fbb Fixes for reported pressure in METAR parsing (#965)
* Update Metar.php

The reported pressure was always being assigned as hPa thus resulting display and conversion errors when the reported pressure was inHg.

Also the VFR/IFR (VMC/IMC) determination was using minimum 5 nmi and 3000 ft cloud base, it must be 5 km and 3000 ft.

With this state, this PR should fix issue #948 and partly fixes issue #963

* MetarTest Fix for inHg/hPa
2020-12-21 10:53:50 -05:00
B.Fatih KOZ
e4972eaae3 Download screen enhancements
Changed the group name according to its category , aircrafts will show icao type and registration , airports will be displayed with their icao codes names and countries. Rest will be showed with their names (exp airlines)

This will result a much better look on the downloads page for end users while looking for a specific type's files (like a repaint for a B738).
2020-12-18 14:34:05 -05:00
Nabeel Shahzad
e95e61d4b4 Fix tests #807 2020-12-07 10:19:43 -05:00
Nabeel Shahzad
f92912dff4 Fix test 2020-12-07 09:50:00 -05:00
Nabeel Shahzad
f62c607138 Change fuel calculation to fuel used #807 2020-12-07 09:46:07 -05:00
B.Fatih KOZ
d1a3155653 Fixed EET and ENDURANCE values at IVAO & VATSIM prefile (#954)
Fixed wrong EET and ENDURANCE values at IVAO & VATSIM prefile forms with a php function converting seconds to HHmm format. 

Also added View Route At SkyVector link (uses auto zoom to fpl route on High Enroute Charts) , thx Maco for his idea and original link.
2020-12-06 17:18:55 -05:00
B.Fatih KOZ
883e8786e0 Formatting on admin pirep page #952
* Fix For Issue #952 / Admin Pirep Display

Removed unnecessary div tags to fix the broken display problem, defined the div class with a php code

* Fix and Update for Admin Pirep Index

Fixed the page width problem and search error , added the ability to also search for Rejected and Accepted pireps.
2020-12-05 20:27:03 -05:00
B.Fatih KOZ
fb44b73f44 Fix METAR decoding (text correction only) (#950)
* Update Metar Decoding (Text Correction Only)

SKC means Sky Clear or Clear Skies.

Rest is ok

* Update MetarTest.php
2020-12-04 12:47:42 -05:00
B.Fatih KOZ
7379e93c46 Update simbrief_briefing.blade.php (#944)
1. Added ATC Prefile options for IVAO and VATSIM
2. Added TAF reports for Orig, Dest and Altn airports. (Technically TAF reports are required for flights more than 1 hour, so we need to see them on the briefing page too)
3. Adjusted the height of OFP division to match the page with the WX section changes
2020-12-04 11:20:12 -05:00
B.Fatih KOZ
d4bb5605de Update search.blade.php (#943)
Added the ability to select and search an airline's flights. Will be usefull in multiple airline installations/configs.

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2020-12-04 11:12:41 -05:00
B.Fatih KOZ
8ecc096bf7 Update Latest Pireps Widget (#945)
Added flight number, used aircraft registration (and icao type) instead of name
2020-12-04 11:04:47 -05:00
Nabeel S
6b5cf38224 Calculate percentage properly instead of adding to the base value #925 (#942)
* Calculate percentage properly instead of adding to the base value #925
2020-11-26 16:44:57 -05:00
Nabeel S
2ecf366670 Add missing columns from subfleet export #926 (#941) 2020-11-26 13:34:04 -05:00
Nabeel Shahzad
a7981c0a87 Redirect to the subfleet aircraft list on save #932 2020-11-26 13:15:56 -05:00
Nabeel Shahzad
9cf07c47c7 Fix notifications error for collect() #937 2020-11-26 13:08:32 -05:00
Nabeel S
8f4219bc95 Download path size too small; fix migrations #935 (#940) 2020-11-26 13:03:59 -05:00
Nabeel Shahzad
eae345efa7 Fix dropping of unique index when table prefix is present #934 2020-11-26 12:27:26 -05:00
Nabeel Shahzad
be15426b5b Fix public path in application bootstrap #887 2020-11-23 13:39:26 -05:00
Nabeel Shahzad
7e4c652330 Log for avatar upload 2020-11-22 09:59:09 -05:00
Nabeel S
ced2c150b7 Change the body size to medium text #920 (#930)
Change the body size to medium text (16MB) #920
2020-11-20 12:00:37 -05:00
Nabeel Shahzad
a2de532f72 Merge branch 'dev' of https://github.com/nabeelio/phpvms into dev 2020-11-02 11:57:27 -05:00
Nabeel Shahzad
a52d844719 Set flight_id to be fillable 2020-11-02 11:57:25 -05:00
Timothy Sturm
fd814bc79e * Fixed broken links on README
* Fixed broken links on README

* Misc. edits to markdown formatting, Title Grammer, and Stylizing the phpVMS brand.
2020-10-31 18:43:00 -04:00
Nabeel Shahzad
0fa00206ce Make sure stdclass is returned in flight fields 2020-10-29 12:38:40 -04:00
Nabeel Shahzad
a58237b04b Allow flight_id to be nullable 2020-10-27 21:47:19 -04:00
Nabeel S
dc7efc981c Refactor fares inheritance #905 (#906) 2020-10-27 18:46:15 -04:00
Yash Govekar
060bebf8fe Accept Pirep button not changing row inline #598 (#880) 2020-10-26 10:18:00 -04:00
Nabeel Shahzad
aaaf2e7c00 Make sure capacity is an integer 2020-10-24 16:04:09 -04:00
Nabeel S
1be68d1e63 Flight/Subfleet fares not returning in API #899 (#900)
Make sure proper fares are returned from the API #899
2020-10-24 15:11:08 -04:00
Nabeel Shahzad
b83f7dcac8 Updated seed data for dev 2020-10-24 09:26:14 -04:00
Nabeel S
c5de2fd8b1 Fix for base map/providers #895 (#897) 2020-10-23 08:08:41 -04:00
Nabeel S
b85d0e6a3e Expose Leaflet base options to templates #895 (#896) 2020-10-23 07:35:44 -04:00
Nabeel S
b37bd2cd7b Change award events handler to subscription #888 (#894) 2020-10-23 07:28:22 -04:00
Nabeel S
584d37f230 FlightRouteAwards - fix if last pirep is empty/other error conditions (#886) 2020-10-22 16:25:52 -04:00
Nabeel Shahzad
1c9d1c1733 Extra logs/skip module seed pending 2020-10-21 14:12:38 -04:00
Nabeel S
cd18442207 Fixes for installer/modules race condition (#883) 2020-10-21 13:28:54 -04:00
Yash Govekar
716ba38b6d Default values for automatically added airports #829 (#878) 2020-10-20 15:25:13 -04:00
Yash Govekar
c0514b381b Fixed exporting expenses (#877) 2020-10-19 15:22:06 -04:00
Yash Govekar
5803487d51 Installing and managing modules from admin panel (#847) 2020-10-19 10:10:28 -04:00
Snyk bot
ca220f1cdf fix: package.json & package-lock.json to reduce vulnerabilities (#873)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-AJV-584908
- https://snyk.io/vuln/SNYK-JS-JQUERY-565129
- https://snyk.io/vuln/SNYK-JS-JQUERY-567880
- https://snyk.io/vuln/SNYK-JS-SELECT2-456562
- https://snyk.io/vuln/SNYK-JS-SOCKJS-575261
- https://snyk.io/vuln/SNYK-JS-WEBPACKDEVSERVER-72405
- https://snyk.io/vuln/SNYK-JS-YARGSPARSER-560381
- https://snyk.io/vuln/npm:mem:20180117
2020-10-16 11:01:24 -04:00
Nabeel Shahzad
75a0a4c87a Update FareService.php 2020-10-13 18:12:52 -04:00
Nabeel Shahzad
3b6800077f Preload fares with PIREP 2020-10-13 18:12:14 -04:00
Nabeel Shahzad
bf878a98a4 Extra logging around fares 2020-10-13 18:10:31 -04:00
DaGeek
d001704880 Adding a new AwardClass for Flight Time (#869)
Adding a new AwardClass for Flight Time
2020-10-13 17:07:12 -04:00
DaGeek
5371989921 Cosmetic Fix to display Award Images in Admin View (#870)
Fix to correctly display the Award image in the admin UI
2020-10-13 15:41:16 -04:00
DaGeek
6c553569bf Create FlightRouteAwards.php (#865)
Award - FlightRoute- this allows the Admins to create an Award that will be granted if a Pilot completes a flight with a defined Departure and Arrival Airport
2020-10-12 18:54:42 -04:00
Nabeel Shahzad
9eb7dd6913 Update doc links 2020-10-12 15:15:05 -04:00
Nabeel S
dc007f6d9e Bids are missing subfleets in API response #867 (#868)
Bids are missing subfleets in API response #867
2020-10-12 12:49:11 -04:00
Nabeel S
193fbd369d Show awards on user profile #703 (#866) 2020-10-11 16:06:09 -04:00
Botric
151f188886 Update pirep_card.blade.php (#857)
Update pirep_card.blade.php
2020-10-10 15:24:28 -04:00
Nabeel S
69d89511be Inherited value can't be removed #811 (#863)
Inherited value can't be removed #811
2020-10-10 15:24:10 -04:00
Nabeel S
48087fb05f Metar: TEMPO and trend causing issue with values being overwritten (#862)
Metar: TEMPO and trend causing issue with values being overwritten
2020-10-10 14:55:12 -04:00
Nabeel S
c702b01a87 Add tests that rank shouldn't auto change (#840) 2020-10-10 14:50:00 -04:00
DaGeek
0a5194b92e Small Cosmetic Change to Rank & Home Airport Display (#852)
Cosmetic Change to Rank & Home Airport Display
2020-10-09 17:45:16 -04:00
Nabeel Shahzad
24aca506fc Update UserController.php 2020-10-06 19:26:52 -04:00
Nabeel Shahzad
365e33f5f8 Redirect show() to edit() 2020-10-06 19:10:42 -04:00
Nabeel Shahzad
7a75e0f5ad Fix missing $countries 2020-10-06 18:52:34 -04:00
Botric
93da2ca061 Cosmetic change to standardise boxes on profile (#853) 2020-10-04 12:48:12 -04:00
vgpastor
5363e4aa0f Add API Key visual protection (#851)
Add API Key visual protection
2020-10-03 11:13:28 -04:00
Nabeel S
95a40d3565 Make sure proper subfleets are returned as part of the user profile #848 (#849)
* Make sure proper subfleets are returned as part of the user profile #848

* Formatting
2020-09-30 12:58:45 -04:00
Nabeel S
98aa362935 Fix subfleets not returning proper fare counts #831 (#846)
Fix subfleets not returning proper fare counts #831
2020-09-29 13:21:24 -04:00
Yash Govekar
b6603bd178 Updated Route Service Provider that was mismatching API and ADMIN Section (#845) 2020-09-29 13:09:00 -04:00
Yash Govekar
2c539d349d Fix controller namespace in module generation #714
Updated Module Files
2020-09-28 16:04:51 -04:00
Nabeel Shahzad
5df28eb027 Fix module main service provider name 2020-09-27 12:13:24 -04:00
yashris
0dbf8b8652 Public JS files Updated! (#839) 2020-09-27 09:03:46 -04:00
yashris
5856f88a0c Updated index.js inside Map folder (#837) 2020-09-24 09:56:52 -04:00
Nabeel Shahzad
5f9b9399e9 Use $current_airport 2020-09-23 14:39:10 -04:00
Nabeel S
77fe6679ce Update module generation #714 (#716)
* Update module generation #714

* Fix method signatures

* Fix paths within stubs, use single provider.stub file

* Add separate index controller

* Update module generation #714

* Fix method signatures

* Fix paths within stubs, use single provider.stub file

* Update module generation

Disable/lower the cache time as found as a workaround in https://github.com/nWidart/laravel-modules/issues/995

* Update editorconfig for line endings

* Formatting

* Formatting
2020-09-20 19:10:52 -04:00
Nabeel Shahzad
435fa32663 Fix aircraft field name #824 2020-09-15 15:41:53 -04:00
Nabeel Shahzad
78ca06e9dc Add optional() around aircraft info #824 2020-09-14 16:17:03 -04:00
Nabeel Shahzad
2dd3dd5814 Make sure we're getting only active expenses 2020-09-12 15:17:10 -04:00
Nabeel Shahzad
ac7a5a65e5 Update cron path 2020-09-11 16:57:50 -04:00
Nabeel Shahzad
c5ab0978db Force visible flag to true for imports #818 2020-09-11 09:18:27 -04:00
dependabot[bot]
8398d94c0a Bump js-yaml from 3.11.0 to 3.13.1 (#810)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.11.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.11.0...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-10 17:06:01 -04:00
Nabeel S
1db3295213 Disable autocomplete in admin forms #816 (#817) 2020-09-10 16:42:11 -04:00
Nabeel Shahzad
5dcbd01c00 Update links to some docs 2020-09-04 14:08:14 -04:00
Nabeel Shahzad
c6d12802a4 Fix link to assets docs 2020-09-04 13:32:39 -04:00
Nabeel Shahzad
07de33605b Switch toolchain from yarn to npm 2020-09-04 13:28:17 -04:00
Nabeel Shahzad
ec9ef9c1c2 Add notes to refer to docs when modifying the JS files 2020-09-04 11:50:05 -04:00
Nabeel Shahzad
23962a1abb Add fileinfo ext to requirements #735
closes #735
2020-09-04 11:28:33 -04:00
Nabeel Shahzad
9a735d2935 Update language for subfleet fare 2020-09-04 10:09:53 -04:00
Nabeel Shahzad
51004b143c Fix validator type for aircraft #805 2020-09-03 15:14:26 -04:00
Nabeel S
50a0b89caa Add MTOW and ZFW to aircraft editor #775 (#805)
Add MTOW and ZFW to aircraft editor #775
2020-09-03 13:29:24 -04:00
Nabeel S
e99c22b007 Notifications fixes (#804)
* Emails not sending #795 #722

* Fix for news items not being sent; refactor some events; check for opt-in #722

* Formatting

* Remove extra parameter
2020-09-03 12:50:42 -04:00
Nabeel Shahzad
55fa01478d Fix path for bootstrap file #798 2020-09-02 18:52:52 -04:00
Nabeel Shahzad
552196ce57 Fix root detection #798 2020-09-02 18:47:38 -04:00
Nabeel S
7aa089bd88 Update Laravel/composer dependencies (#803) 2020-09-02 18:15:05 -04:00
Nabeel S
1e4b0d629a Detect the phpvms folder one root level above #798 (#799) 2020-09-01 10:38:45 -04:00
Timothy Sturm
febfff5f12 Update MailChannel.php (#793)
Update from email #792
2020-08-21 15:54:26 -04:00
Nabeel S
cdf7b13b5b Allow any airport to be flown from #783 (#788)
Allow any airport to be flown from #783
2020-08-17 17:06:02 -04:00
Nabeel S
51186bed7c Fix for aircraft not being detected at departure airport #781 (#789)
Aircraft not being checked/detected at departure airport #781
2020-08-17 16:44:31 -04:00
Nabeel Shahzad
ac1dc49377 Replace IP in test 2020-08-15 13:54:01 -04:00
Nabeel Shahzad
be72571185 Check if the root domain is an IP address 2020-08-15 13:50:58 -04:00
Nabeel Shahzad
d3e6d2c49a Add extra logging for user not being at proper airport 2020-08-14 10:26:21 -04:00
Nabeel S
4fa58cec5a Fix clear cache errors with duplicate route names #759 (#787) 2020-08-13 17:53:30 -04:00
Nabeel S
27316f96e8 Fix missing user fields #785 (#786) 2020-08-13 17:44:41 -04:00
Nabeel Shahzad
e5ed66b372 Fix attribute type for PIREP status 2020-08-12 22:02:20 -04:00
Nabeel Shahzad
ee6982f558 Build fix/StyleCI 2020-08-12 14:46:08 -04:00
Nabeel Shahzad
4f46e75515 Check for active flag for user fields in registration 2020-08-12 14:39:00 -04:00
dependabot[bot]
3ac03d9716 Bump elliptic from 6.5.2 to 6.5.3 (#780)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2020-08-12 09:26:22 -04:00
Nabeel Shahzad
ace7c42557 Fix typo for unique email check 2020-08-12 09:06:18 -04:00
Nabeel S
3ebf4f2924 Custom user fields #711 (#772)
Custom user fields during registration and profile edit #711
2020-08-11 17:48:51 -04:00
dependabot[bot]
3739cc8e91 Bump lodash from 4.17.15 to 4.17.19 (#770)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-11 17:48:16 -04:00
Nabeel S
bbb5f1d13c Check for null values when checking pilot ID #760 (#768) 2020-07-14 22:02:35 -04:00
Nabeel S
64e4c91e7e Check public pages for authorization #761 2020-07-10 13:11:38 -04:00
Nabeel S
3e2b1fe42b Add spacing to fare labels #763 (#766) 2020-07-10 09:51:33 -04:00
Nabeel S
420bd7e4ae Add ability to use a link instead of a page #750 (#757)
Add ability to use a link instead of a page #750
2020-06-11 08:27:38 -04:00
Nabeel S
e4b1c238f3 Add ACARS update event #755 (#756) 2020-06-09 09:10:40 -04:00
Nabeel S
57e91027c8 Fix the search route for pending PIREPs #752 (#754) 2020-06-08 09:55:57 -04:00
dependabot[bot]
475ad3a66d Bump websocket-extensions from 0.1.3 to 0.1.4 (#753)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-08 08:56:31 -04:00
Nabeel S
340f52112d Fix public pages not showing properly #708 (#749) 2020-06-05 12:49:22 -04:00
Nabeel Shahzad
c6482bd160 Add last_pirep test 2020-06-05 09:19:18 -04:00
Nabeel Shahzad
df15053b75 Remove trailing comma 2020-06-04 14:05:51 -04:00
Nabeel S
04b8be1649 Add show_datetime_format(); optional default timezone parameter #741 (#746) 2020-06-04 11:34:30 -04:00
Nabeel S
3d211535f7 Remove Google Analytics #728 (#745)
* Remove Google Analytics #728

* Remove config file

* Don't set the vacentral url
2020-06-04 10:36:55 -04:00
Nabeel S
c1408cb8fe Fleet properties not saving #731 (#744) 2020-06-04 08:39:20 -04:00
Nabeel S
519ae600d5 Fix METAR invalid parameter #738 (#743) 2020-06-04 06:30:35 -04:00
Nabeel S
82bae9cc74 Update the flash messages #739 (#742) 2020-06-04 06:11:57 -04:00
Nabeel S
3a07e34259 Add pt-br language #736 (#737)
Add pt-br language #736
2020-06-02 09:10:26 -04:00
Nabeel S
89ca0b49a2 Merge pull request #730 from nabeelio/729-Multi-Expenses
All airports' expenses being applied to PIREP #729
2020-05-26 19:39:29 -04:00
Nabeel Shahzad
5b16c88bcb Fix for all airport expenses being applied #729 2020-05-26 19:13:15 -04:00
Nabeel S
c67e45e98e Merge pull request #727 from nabeelio/724-Db-Memory-Syntax-Error
Fix params for launching process #724
2020-05-23 13:02:34 -04:00
Nabeel Shahzad
688be6f75a Fix params for launching process #724 2020-05-23 12:53:39 -04:00
Nabeel S
8527b39fe2 Merge pull request #725 from nabeelio/718-Airline-Active
Check for airline being active; fix tests for L7 #718
2020-05-23 11:55:26 -04:00
Nabeel Shahzad
a443908bed Frontend flight controller for active airlines 2020-05-23 11:48:48 -04:00
Nabeel Shahzad
c46fc9171c Check for airline being active; fix tests for L7 #718 2020-05-23 11:45:07 -04:00
Nabeel S
71c09aaeb1 Merge pull request #721 from nabeelio/715-Error-Page-Skins
Use theme in error handlers #715
2020-05-23 09:18:07 -04:00
Nabeel Shahzad
5046d26032 Explicitly set theme in error handler, refactor middleware #715 2020-05-23 09:05:38 -04:00
Nabeel S
4cd7eef937 Merge pull request #720 from nabeelio/719-Login-On-Leave
Allow on-leave user to login
2020-05-23 07:47:10 -04:00
Nabeel Shahzad
f17cd15b01 Allow on-leave user to login; show alert message and ensure status is updated #719 2020-05-23 07:20:55 -04:00
Nabeel S
5f8053226e Merge pull request #717 from nabeelio/715-Theme
Apply theme globally; add mail templates into theme folder #715
2020-05-22 21:49:22 -04:00
Nabeel Shahzad
09cd7adb6b Apply theme globally; add mail templates into theme folder #715 2020-05-22 19:00:54 -04:00
Nabeel S
fb7d988032 Merge pull request #712 from nabeelio/707-Module-Enable
Make sure the Updater module is enabled #707
2020-05-21 22:44:59 -04:00
Nabeel Shahzad
eb90d08761 Make sure the Updater module is enabled #707 2020-05-21 22:12:09 -04:00
Nabeel S
1ebb181c36 Merge pull request #710 from nabeelio/707-Update-Error
Auto-Update fixes #707
2020-05-21 12:28:52 -04:00
Nabeel Shahzad
975ee9b88e Fix for update showing available when one isn't #707 2020-05-21 11:50:13 -04:00
Nabeel S
52379c3789 Merge pull request #705 from nabeelio/704-Acars-Map-Center
Fix error with map centering on invalid layers #704
2020-05-19 18:47:27 -04:00
Nabeel Shahzad
bcf7acf957 Fix error with map centering on invalid layers #704 2020-05-19 18:07:38 -04:00
Nabeel S
3b1936e110 Merge pull request #699 from nabeelio/698-Login-Pilot-Id
Enable logins using pilot ID #698
2020-05-16 11:59:03 -04:00
Nabeel Shahzad
b9aeda1cba Enable logins using pilot ID #698 2020-05-16 11:52:05 -04:00
Nabeel S
00505a1607 Merge pull request #697 from nabeelio/673-Laravel-7
Laravel 7 support #673
2020-05-16 09:37:36 -04:00
Nabeel Shahzad
6ebbe0209e Formatting 2020-05-15 18:38:43 -04:00
Nabeel Shahzad
5754103a17 Bump minimum PHP version to 7.3 2020-05-15 18:22:24 -04:00
Nabeel Shahzad
6078163d75 Initial pass at Laravel 7 support #673 2020-05-15 18:20:23 -04:00
Nabeel S
885e1d599e Merge pull request #696 from nabeelio/693-Public-Folder-Permissions
Installer: Use absolute paths for permissions check #693
2020-05-15 15:56:07 -04:00
Nabeel Shahzad
876457af71 Use absolute paths for permissions check #693 2020-05-15 15:45:54 -04:00
Nabeel S
8c75bd098e Merge pull request #695 from sebiecker/dev
Update Permissions Seed
2020-05-15 12:21:30 -04:00
Sebastian Ecker
585c9578e8 Update Permissions Seed
Aircraft is missing in Permissions Seed
2020-05-15 17:51:41 +02:00
Nabeel S
78ee1a9769 Merge pull request #690 from nabeelio/7.0.0-beta.4
7.0.0-beta.4
2020-05-09 12:31:35 -04:00
Nabeel Shahzad
7cd01a24d6 Update CHANGELOG 2020-05-09 12:24:23 -04:00
Nabeel Shahzad
d5ea0952f5 Merge branch '7.0.0-beta.4' into dev 2020-05-09 11:57:23 -04:00
Nabeel S
1054d53826 Emails/notifications not sending #675 (#686)
* Add test call to test notification #675

* Fix queue driver with emails not sending; formatting #675
2020-05-09 11:31:25 -04:00
foo barf
69fb5a537e typo in dependency on 'leaflet.geodesic' (#687) 2020-05-09 10:37:58 -04:00
Nabeel S
5b771be653 Fix flight hours field #683 (#684) 2020-05-05 14:36:14 -04:00
Nabeel S
9135337186 Blank/null IATA code isn't unique when added #679 (#681) 2020-05-03 18:23:46 -04:00
Nabeel S
95608dbb79 Merge pull request #682 from nabeelio/680-METAR-Parse-Error
METAR: KM as unit in visibility #680
2020-05-03 11:48:42 -04:00
Nabeel Shahzad
a8fb8e93c8 METAR: KM as unit in visibility #680 2020-05-03 11:08:06 -04:00
Nabeel S
2ea18ae1c6 Fix airline creation logic in installer #677 (#678) 2020-05-02 15:09:27 -04:00
Nabeel S
99f4f3b3d8 Change currency from settings #671 (#672) 2020-04-26 11:55:20 -04:00
Nabeel S
03cfc648b0 Create journal when new airline is created #667 (#670) 2020-04-26 10:31:58 -04:00
Nabeel S
866d95c945 Check for SB being avail before filing #668 (#669) 2020-04-26 10:23:42 -04:00
Nabeel Shahzad
b21201c122 Fix test 2020-04-15 15:16:54 -04:00
Nabeel Shahzad
209b2790b6 Fix URL to briefing 2020-04-15 15:12:57 -04:00
Nabeel Shahzad
90a0a8cfee Add mock SB API key 2020-04-15 10:28:21 -04:00
Nabeel S
8e97a7cc5c Load Simbrief and flight data when getting bids #664 (#665) 2020-04-15 10:11:06 -04:00
Nabeel S
b1bdd40da7 Fix pilots page now showing up #655 (#660) 2020-04-06 18:12:55 -04:00
Nabeel S
40a94cb9ad Add privatized version of name #656 (#658) 2020-04-06 12:03:19 -04:00
Nabeel Shahzad
3c0cd34071 Trim list_to_assoc items 2020-04-02 17:54:40 -04:00
Nabeel S
261984ee90 Fix PirepComment response; 201 to 200 (#654) 2020-04-01 01:05:09 -04:00
Nabeel Shahzad
e8037c7d69 Return full PIREP when updating 2020-03-31 23:42:33 -04:00
Nabeel Shahzad
6f05dd6c86 Add full user response to PIREP API call 2020-03-31 23:32:50 -04:00
Nabeel Shahzad
072d5f76bb Formatting for StyleCI 2020-03-31 17:34:10 -04:00
Nabeel Shahzad
d1d243ef06 Update response objects 2020-03-31 17:26:55 -04:00
Nabeel S
819d3bcb47 Upgrade packages with security alerts (#653) 2020-03-31 12:36:33 -04:00
Nabeel S
60f378f584 Add Simbrief entries as sample data for load #651 (#652) 2020-03-31 12:32:11 -04:00
Nabeel Shahzad
6978fbf2e0 Fix API tests 2020-03-29 15:35:40 -04:00
Nabeel Shahzad
11b1c2b763 Fix tests for API 2020-03-29 15:19:23 -04:00
Nabeel Shahzad
655ac66b52 Formatting 2020-03-29 15:05:56 -04:00
Nabeel Shahzad
e9b30fbe30 Make sure user and acars data is sent from API 2020-03-29 13:33:14 -04:00
Nabeel S
82b873c071 Domain detection failing for .co.uk, etc #647 (#648)
* Fix domain name detection #647

* Ignore page links check if no DB configured #641
2020-03-28 19:07:46 -04:00
Nabeel S
3e7d5f6195 Use theme check in all frontend routes #638 (#645) 2020-03-28 14:45:25 -04:00
Nabeel Shahzad
ba0ae05c2a Make icon column nullable #641 2020-03-28 14:01:53 -04:00
Nabeel S
45873431e4 Add public/private pages #641 (#644)
* Add public/private pages #641

* Cleanup the form requests
2020-03-28 13:03:52 -04:00
Nabeel S
4a3ec38919 Option for SB only on bids; add the new file type #642 (#643)
Option for SB only on bids; add the new file type #642
2020-03-27 11:49:19 -04:00
Nabeel S
f3fe3a56ba Don't return bids by default, fix user flight column #639 (#640)
Fix the user api response, don't return bids by default, fix flights column #639
2020-03-25 18:04:26 -04:00
Nabeel Shahzad
88e8ea6ed1 Add total flights 2020-03-25 17:02:48 -04:00
Nabeel Shahzad
cce575c1a6 Fix avatar/gravatar call throwing error 2020-03-25 10:58:03 -04:00
Nabeel Shahzad
eafea01e22 Fix gravatar url check 2020-03-24 18:54:04 -04:00
Nabeel Shahzad
62cea3eb0c Load the user airline/bid ahead of time; SB XML name fix 2020-03-24 16:17:28 -04:00
Nabeel Shahzad
3f7a7d0f2e Remove empty fields from user return, add avatar 2020-03-24 15:53:59 -04:00
Nabeel S
877d5a5479 Account for admin role, don't error out on null rows #632 (#637) 2020-03-23 11:50:15 -04:00
Nabeel S
9e5386264f SimBrief integration #405 (#635)
* SimBrief integration #405

* Add briefing as API response; add acars_xml field #405
2020-03-23 09:31:35 -04:00
Nabeel Shahzad
04b9e37e1d Fix formatting 2020-03-09 16:40:06 -04:00
Nabeel Shahzad
8998dabb3d Drop the unique index from subfleets.type #628 2020-03-09 16:39:07 -04:00
Nabeel Shahzad
e458a761d3 Include airline name in subfleet name #628 2020-03-09 16:20:04 -04:00
Nabeel Shahzad
3443f6b31e Check for empty on airline id #628 2020-03-09 16:06:54 -04:00
Nabeel S
2a03d53b3f Fix airline mapping for aircraft #628 (#633) 2020-03-09 15:06:36 -04:00
Nabeel S
412919fe21 Account ICAO for subfleet, airline/location if columns exist #628 (#632) 2020-03-09 13:40:10 -04:00
Nabeel S
80b20a8b25 Increase ID column size; seed ID generator with uniqid() #630 (#631) 2020-03-09 13:16:10 -04:00
Nabeel S
2c238763cb Disable using apc/opcache by default if found #625 (#629) 2020-03-09 13:08:07 -04:00
Nabeel S
2846a78d2a Fix saving of fare #621 (#624) 2020-03-06 16:54:53 -05:00
Nabeel S
632c5782de Add fare type for pax/cargo/mixed flights #621 (#623) 2020-03-06 15:10:03 -05:00
Nabeel S
9f3ddd5dbd Add fixed pilot pay for a flight #487 (#622) 2020-03-06 11:36:02 -05:00
Nabeel S
16c977c769 Add load_factor and load_factor_variance to flights #352 (#620) 2020-03-05 20:19:12 -05:00
Nabeel S
9ed2e3f9f4 API: Flight fields are an array when empty #618 (#619)
* Ensure 'fields' field is return as an object for flights #618
* Eager loading for flight fields
2020-03-04 18:14:03 -05:00
Nabeel S
174b602d7c Remove the flight fields link from admin #614 (#615)
* Remove the flight fields link from admin #614

* Change flight_field_value col to be nullable

* Fix updater design
2020-03-04 09:49:51 -05:00
Nabeel Shahzad
b1e745844a Restore theme db lookup 2020-03-04 08:54:55 -05:00
Nabeel S
89481b5fa1 HTTP/HTTPS mixed content errors #612 (#613)
* Configure TrustProxies middleware
* Add trusted proxies to deps
* Replace jquery request with axios request code
* Trust current user IP for forwarded headers
* Update dependencies
* Downgrade self-updater package for PHP 7.2
2020-03-03 10:20:13 -05:00
Nabeel Shahzad
dcf9f48364 Add ID column to fare #608 2020-03-02 17:38:48 -05:00
Nabeel Shahzad
f1902a5faa Fix setting repo resolution 2020-03-02 16:21:53 -05:00
Nabeel Shahzad
3cd6c8ee82 Fix cost/code field #608 2020-03-02 16:08:58 -05:00
Nabeel Shahzad
83a0007b7d Return response from middleware 2020-03-02 15:58:53 -05:00
Nabeel S
b78c1b935e Include fare information in subfleet response #608 (#609) 2020-03-02 15:36:01 -05:00
Nabeel Shahzad
fa89416e5b Fix docs/comments 2020-03-02 10:50:39 -05:00
Nabeel S
4a14e83c88 Performance improvements #602 (#607)
* Update gitignore

* Save theme to the session to avoid a lookup #602

* Formatting

* Move routes into main service provider

* Move Observers into their own service provider
2020-03-01 15:51:00 -05:00
Nabeel S
21e2e48a6e Center on active flights #605 (#606) 2020-03-01 12:41:09 -05:00
Nabeel Shahzad
a040e288de Merge branch 'dev' of github.com:nabeelio/phpvms into dev 2020-03-01 11:18:39 -05:00
Nabeel S
f78d065858 Aircraft status field blank causes error #603 (#604)
* Update composer lock file

* Require aircraft status #603
2020-03-01 11:18:23 -05:00
Nabeel Shahzad
660c5303cb Update composer lock file 2020-02-29 22:21:03 -05:00
Nabeel S
ea9ee985e8 METAR parsing infinite loop bugfix #599 (#600)
METAR parsing infinite loop bugfix #599
2020-02-28 22:50:41 -05:00
Nabeel S
b0f122a301 Table prefixes not being added to indexes (#597)
* Enabled prefixes on any created indexes (multi-site install in single db)

* Formatting

* Check if enum label is looking for a translation

* Return value

* Fix view namespace across modules
2020-02-28 18:56:01 -05:00
Nabeel S
2f40f4737c Installer fixes, remove bcmath, fix design (#596)
* Installer cleanup

* Installer design fixes
2020-02-28 18:00:56 -05:00
Nabeel S
7e742518bc Module/plugin installation working #593 (#594)
* Remove the Sample module

* 593-Fix-Modules-From-Composer

* Fix pre/post install scripts in composer #593

* Formatting
2020-02-28 16:06:45 -05:00
Nabeel S
dbaac04eea Remove airport length restrictions #590 (#592) 2020-02-27 11:37:05 -05:00
Nabeel S
f2b216c404 Remove 4 char restriction from ICAO; use decimal type for lat/lon #590 (#591)
* Remove 4 char restriction from ICAO; use decimal type for lat/lon #590

* Reorder imports
2020-02-26 17:06:39 -05:00
Nabeel S
14aacdfb75 Import expense and ledger entries #443 (#588)
* Fix rank importing with PIREP pay #443

* Import ledger information #443

* Uncomment out testing importers

* Import expense log and settings #443

* Formatting
2020-02-25 14:45:23 -05:00
Nabeel S
07a75de0bf Recalcuate aircraft stats in nightly cron and importer #585 #443 (#587) 2020-02-24 19:35:28 -05:00
Nabeel S
30786b7b27 Set the payrate for the ranks #443 (#586) 2020-02-24 17:52:49 -05:00
Nabeel S
11bbcd1df7 User country mapping; ignore unused groups #443 (#584)
* Fix the user country import #443

* Ignore the old "core" groups because they're unused #443

* Properly sync roles and individual permissions #443
2020-02-24 15:12:36 -05:00
Nabeel Shahzad
342fe31ceb Move full version check below the version write 2020-02-23 21:15:44 -05:00
Nabeel Shahzad
c6f46ee4cb Debug output for version 2020-02-23 21:08:59 -05:00
Nabeel Shahzad
574768262d Include full build id 2020-02-23 20:59:09 -05:00
Nabeel Shahzad
24e2576645 Write out full version to log 2020-02-23 20:49:11 -05:00
Nabeel S
dfbaa1afd3 Fix rowmapper generator, check for fields, map users #443 (#583)
* Fix rowmapper generator, check for fields, map users #443

* Formatting

* Remove value store at the end of the import

* Update the notes for the importer about users

* Uncomment importers disabled during testing
2020-02-23 19:48:28 -05:00
Nabeel S
a1d6fa17ad Respect home hubs setting for registration #580 (#581)
Respect home hubs setting for registration #580
2020-02-23 17:21:26 -05:00
Nabeel S
b34dc4868e Change fuel used to optional #512 (#582) 2020-02-23 16:01:09 -05:00
Nabeel S
0e13905098 Upstream null version; build version tags not being saved properly #575 (#578)
* Check for null version from upstream #575

* Fix for pre-release version numbering

* Move popup to right

* Split get/generate build ID #575
2020-02-23 12:23:19 -05:00
Nabeel S
b9fe8bf738 Fix edit pilot error #576 (#577) 2020-02-23 09:56:43 -05:00
Nabeel S
9ed07da9c3 Upsert on ACARS positions #572 (#573) 2020-02-22 16:03:01 -05:00
Nabeel S
6e87f7804c Fix the namespace path on updater templates #570 (#571) 2020-02-21 20:36:27 -05:00
Nabeel S
cc23c32db7 Route not found error for Pirep::resource() call #559 (#565) 2020-02-20 12:42:22 -05:00
Nabeel S
0297ec3746 Add bcmath to the required extensions list #558 (#564) 2020-02-20 11:36:47 -05:00
Nabeel S
da575932a7 Add extra check for being set #560 (#563) 2020-02-20 11:36:26 -05:00
Nabeel S
c0fbc7d491 Missing on bids page #561 (#562) 2020-02-20 10:49:15 -05:00
Nabeel S
0060f794ae Refresh theme cache on settings page load #554 (#557) 2020-02-18 17:10:31 -05:00
Nabeel S
9304daea7a Add the argc_argv flag for the cgi exec #553 (#556) 2020-02-18 17:01:00 -05:00
Nabeel S
8300a69ad5 Fix migrations when table prefix is involved #442 (#555)
* Fix migrations when table prefix is involved #442

* Formatting
2020-02-18 08:23:32 -05:00
Nabeel S
2d36376e29 Add logo to the flights page if its set #417 (#550) 2020-02-14 18:54:05 -05:00
Nabeel S
77f2138a1c Add Google Analytics tracking ID to settings and to main template #382 (#551) 2020-02-12 18:28:11 -05:00
Nabeel S
b9993b9c23 Set expenses on specific flight types #348 (#549)
* Set expenses on specific flight types #348

* Formatting

* Use strict check for in_array
2020-02-12 10:40:52 -05:00
Nabeel Shahzad
f16af4d9b1 Remove extraneous flight time text 2020-02-11 13:59:42 -05:00
Nabeel S
f392bf1cb8 Add additional events for PIREP states #436 (#548) 2020-02-11 13:56:20 -05:00
Nabeel Shahzad
39159e2c2e Travis check condition flipped 2020-02-11 13:25:54 -05:00
Nabeel Shahzad
018f6b62f6 Fix mv command 2020-02-11 13:23:43 -05:00
Nabeel Shahzad
4229366585 Specify file paths 2020-02-11 13:17:56 -05:00
Nabeel Shahzad
9fa395a061 Fix directory for tar file 2020-02-11 13:11:22 -05:00
Nabeel Shahzad
8b417ce1a8 Travis fix 2020-02-11 13:04:15 -05:00
Nabeel Shahzad
1d53497424 Fix cleanup tag 2020-02-11 12:39:21 -05:00
Nabeel Shahzad
07917f4ed2 Enable PHP 7.2/7.3 version 2020-02-11 12:33:21 -05:00
Nabeel S
b36a3009dd Cleanup Utils #467 (#547)
* Remove Utils Facade
2020-02-11 12:32:41 -05:00
Nabeel S
be6c164f03 Add checkbox to clear previous data when importing #490 (#546)
* Add checkbox to clear previous data when importing #490
2020-02-11 10:51:18 -05:00
Nabeel S
99118daad9 Auto update #449 (#545)
* Add custom repository type for updates

* Direct to self update module

* Formatting
2020-02-10 17:47:46 -05:00
Nabeel Shahzad
3fcd378f91 Remove subfolder when building the tar 2020-02-10 15:10:06 -05:00
Nabeel Shahzad
6c0d0e08e3 Zip package upload 2020-02-10 13:01:13 -05:00
Nabeel Shahzad
d234a0beb2 Update required runtime 2020-02-10 12:57:39 -05:00
Nabeel Shahzad
7a0e5f0ef4 Zip file creation fix 2020-02-10 12:54:59 -05:00
Jorge Cabal
2e1bcc1d7a Spanish files translation (#542)
Co-authored-by: Jorge Cabal <jcabala14>
2020-02-10 12:50:54 -05:00
Nabeel S
6b79ad7e58 Auto-update functionality #449 (#544)
* Convert tar to zip file for updater

* Add update section to maintenance
2020-02-10 12:39:59 -05:00
Nabeel S
90e1b3317d Distro zip file from tar file #449 (#543)
* Create zip file from tar file

* Formatting
2020-02-10 10:40:42 -05:00
Nabeel S
073e48c396 7.0.0-beta3 Release (#541)
* 391 Notification refactorings (#441)

* Refactor notifications to allow easier plugins

* Notification refactoring

* Formatting

* Move news to NewsService; cleanup of events

* More refactoring; added send email out for news item and the template

* Formatting

* Formatting

* Fix missing newsRepo (#445)

* Refactor and add importer to Installer module #443 (#444)

* Refactor and add importer to Installer module #443

* Refactor for finances to use in import

* Import groups into roles

* Formatting

* Formatting

* Add interface in installer for import

* Notes about importing

* Check for installer folder

* Formatting

* Fix pirep->user mapping

* Unused import

* Formatting

* Replace importer with AJAX powered; better error handling #443 (#447)

* Replace importer with AJAX powered; better error handling #443

* Formatting

* Fix command line importer

* Remove bootstrap cache (#448)

* Cleanup the bootstrap/cache directory when packaging

* Fix removal of bootstrap cache

* Formatting

* Stricter checks on ACARS API data (#451)

* Stricter checks on ACARS API data

* More checks

* Fix for flight_number check forcing to exist

* Allow nullable on flight_id

* Avoid proc_open use #455 (#456)

* Use PhpExecutableFinder() closes #457 #458 (#460)

* Use DateTimeZone instead of int for creating datetime

closes #461

* Fix CSV imports giving Storage class not found #454 (#462)

* Fix CSV imports giving Storage class not found #454

* Update yarn files for security alert

* Add PHP 7.4 support (#464)

* Add PHP 7.4 to build matrix

* DB fix

* YAML parser fix in test data

* Show versions

* Package updates

* Track used ICAOs

* 7.4 METAR parsing fix

* METAR parser fix

* Formatting

* Add meters to response units

* Call instance for unit conversion

* Return value

* Catch exception for unknown quantity

* Comment fix

* Formatting

* METAR parsing fixes on PHP 7.4

* Package updates

* More random airport ID

* More random airport ID

* Properly disable toolbar

* Semver written out to version file

* Use dev as default identifier

* Fix BindingResolutionError when debug toolbar isn't present (#465)

* Fix BindingResolutionError when debug toolbar isn't present

* Formatting

* Split the importer module out from the installer module (#468)

* Split the importer module out from the installer module

* Cleanup of unused imports

* Move updater into separate module #453

* Remove unused imports/formatting

* Disable the install and importer modules at the end of the setup

* Unused imports; update IJ style

* test explicit stage for php+mysql

* add more to matrix

* Add different MariaDB versions

* undo

* Cleanup Model doc

* Pilots cannot use the dashboard or flights without admin rights (#481)

* Use auth middleware instead of specific groups for logged in state

* Auth check for admin access

* Check user admin access for updates

* Formatting

* Allow nullable field and calculate distance if nulled for flight import #478 (#482)

* Check for no roles being attached #480 (#483)

* Return the flight fares if there are no subfleet fares #488 (#489)

* Return the flight fares if there are no subfleet fares #488

* Formatting

* Formatting

* Account for units when entering fuel amounts #493

* Search for ICAO not working properly (#496)

* /flights and /flights/search direct to the same endpoint

* Properly set the distance/planned_distance on save (#497)

* 491 Installation Error (#495)

* Disable CSRF token

* Add error handling around looking up the theme and set a default

* Note about logs in issue template

* Formatting

* Fix GeoService errors when viewing PIREP #498 (#499)

* Add new command to export a specific PIREP for debugging (#501)

* Set a default model value for airports on PIREP (#500)

* Set a default model value for airports on PIREP

* Fix airport icao reference

* Default airport models

* Catch broader exception writing out config files #491

* style

* Add reference to docs on doc site (#502)

* Properly create/update rows importing #486 (#503)

* Add base Dockerfile for Dockerhub builds (#504)

* New subfleet not being attached to an airline on import #479 (#505)

* Fix subfleet not being attached to an airline on creation in import #479

* Call airline name with optional() around subfleet

* Minor cleanup

* Search flights by subfleet #484 (#506)

* API level search of flights #484

* Add Subfleet to flights page for search

* Make the fuel used optional (#512)

* Add make to Docker container

* Add getRootDomain() to Utils (#514)

* Show admin dropdown for admin-access ability (#515)

* Show admin dropdown for admin-access ability closes #509

* Formatting

* Check user permissions on the routes #508 (#516)

* Check user permissions on the routes #508

* Formatting

* Return default value on exception for setting()

* Correct text for no subfleets #507 (#518)

* Add a public_url() helper #513 (#519)

* Reduce number of queries for update check (#520)

* Try to clear caches before updating (#522)

* Try to clear caches before updating

* Add clear-compiled to maintenance cache list

* Formatting

* Set PIREPs page to public (#526)

Set PIREPs page to public

* Fix live and route map errors #527 (#528)

* Add menu bar for mobile (#529)

* Format all blade templates to 2 spaces #530 (#531)

* Fix PIREP edit endpoint closes #533 (#534)

* Fix import during flight cron #532 (#535)

* PIREPS resource except for show (#536)

* Use optional() around the airport fields (#537)

* Use optional() around the airport fields

* Add null-coalesce around full_name

* Add link to download ACARS config from profile (#539)

* Add link to download ACARS config from profile

* Formatting

* Update xml config file template (#540)
2020-02-08 13:29:34 -05:00
Nabeel S
989e86ecd3 Update xml config file template (#540) 2020-02-07 21:25:59 -05:00
Nabeel S
dd9fbdb6f1 Add link to download ACARS config from profile (#539)
* Add link to download ACARS config from profile

* Formatting
2020-02-07 13:29:43 -05:00
Nabeel S
94cfbd4748 Use optional() around the airport fields (#537)
* Use optional() around the airport fields

* Add null-coalesce around full_name
2020-02-03 12:23:58 -05:00
Nabeel S
5e4a003a92 PIREPS resource except for show (#536) 2020-02-01 14:14:37 -05:00
Nabeel S
893e28eb3a Fix import during flight cron #532 (#535) 2020-02-01 13:54:30 -05:00
Nabeel S
8cde3c93b0 Fix PIREP edit endpoint closes #533 (#534) 2020-02-01 13:37:40 -05:00
Nabeel S
59d09c0cec Format all blade templates to 2 spaces #530 (#531) 2020-02-01 13:05:56 -05:00
Nabeel S
06b47d97e0 Add menu bar for mobile (#529) 2020-01-31 14:32:43 -05:00
Nabeel S
03184db2fe Fix live and route map errors #527 (#528) 2020-01-31 13:57:21 -05:00
Nabeel S
45b8d737e4 Set PIREPs page to public (#526)
Set PIREPs page to public
2020-01-31 09:35:33 -05:00
Nabeel S
51b50972c8 Try to clear caches before updating (#522)
* Try to clear caches before updating

* Add clear-compiled to maintenance cache list

* Formatting
2020-01-30 14:59:48 -05:00
Nabeel S
3c1b433c29 Reduce number of queries for update check (#520) 2020-01-30 12:44:59 -05:00
Nabeel S
f0719d4d8d Add a public_url() helper #513 (#519) 2020-01-30 11:06:51 -05:00
Nabeel S
f5bc087f38 Correct text for no subfleets #507 (#518) 2020-01-30 11:04:22 -05:00
Nabeel S
02b16d5e57 Return default value on exception for setting() 2020-01-30 10:54:51 -05:00
Nabeel S
63b574181a Check user permissions on the routes #508 (#516)
* Check user permissions on the routes #508

* Formatting
2020-01-30 09:23:31 -05:00
Nabeel S
ff913e5304 Show admin dropdown for admin-access ability (#515)
* Show admin dropdown for admin-access ability closes #509

* Formatting
2020-01-30 09:00:41 -05:00
Nabeel S
e431f75ad4 Add getRootDomain() to Utils (#514) 2020-01-28 12:42:46 -05:00
Nabeel Shahzad
819ebece6d Add make to Docker container 2020-01-28 10:12:40 -05:00
Nabeel S
df832088d5 Make the fuel used optional (#512) 2020-01-22 10:33:10 -05:00
Nabeel S
2415caab54 Search flights by subfleet #484 (#506)
* API level search of flights #484

* Add Subfleet to flights page for search
2020-01-16 17:36:03 -05:00
Nabeel S
d03a77bd4b New subfleet not being attached to an airline on import #479 (#505)
* Fix subfleet not being attached to an airline on creation in import #479

* Call airline name with optional() around subfleet

* Minor cleanup
2020-01-16 14:23:23 -05:00
Nabeel S
6fcbd603ba Add base Dockerfile for Dockerhub builds (#504) 2020-01-16 11:49:22 -05:00
Nabeel S
c2f7c5e421 Properly create/update rows importing #486 (#503) 2020-01-16 10:40:42 -05:00
Nabeel S
fa01c61677 Add reference to docs on doc site (#502) 2020-01-16 09:49:28 -05:00
Nabeel Shahzad
b7b0ac0a73 style 2020-01-15 13:59:02 -05:00
Nabeel Shahzad
bf24ffb1ba Catch broader exception writing out config files #491 2020-01-15 13:57:56 -05:00
Nabeel S
831b72fb2b Set a default model value for airports on PIREP (#500)
* Set a default model value for airports on PIREP

* Fix airport icao reference

* Default airport models
2020-01-15 13:00:58 -05:00
Nabeel S
de8046288b Add new command to export a specific PIREP for debugging (#501) 2020-01-15 11:50:42 -05:00
Nabeel S
7d07008871 Fix GeoService errors when viewing PIREP #498 (#499) 2020-01-15 09:09:58 -05:00
Nabeel S
d4da0a6d6a 491 Installation Error (#495)
* Disable CSRF token

* Add error handling around looking up the theme and set a default

* Note about logs in issue template

* Formatting
2020-01-14 13:55:24 -05:00
Nabeel S
aafc9680bf Properly set the distance/planned_distance on save (#497) 2020-01-14 13:45:22 -05:00
Nabeel Shahzad
9aded3a552 /flights and /flights/search direct to the same endpoint 2020-01-10 10:17:11 -05:00
Nabeel S
03284959d6 Search for ICAO not working properly (#496) 2020-01-10 09:41:32 -05:00
Nabeel Shahzad
4844692bd9 Account for units when entering fuel amounts #493 2020-01-09 07:34:05 -05:00
Nabeel S
74052e4542 Return the flight fares if there are no subfleet fares #488 (#489)
* Return the flight fares if there are no subfleet fares #488

* Formatting

* Formatting
2020-01-06 13:44:43 -05:00
Nabeel S
282cb4be95 Check for no roles being attached #480 (#483) 2019-12-26 09:42:03 +05:00
Nabeel S
4f4d0c266a Allow nullable field and calculate distance if nulled for flight import #478 (#482) 2019-12-25 17:16:34 +05:00
Nabeel S
17637c32d4 Pilots cannot use the dashboard or flights without admin rights (#481)
* Use auth middleware instead of specific groups for logged in state

* Auth check for admin access

* Check user admin access for updates

* Formatting
2019-12-25 13:31:09 +05:00
Nabeel Shahzad
66a1192739 Cleanup Model doc 2019-12-22 09:46:41 +05:00
Nabeel S
e862537a20 Split the importer module out from the installer module (#468)
* Split the importer module out from the installer module

* Cleanup of unused imports

* Move updater into separate module #453

* Remove unused imports/formatting

* Disable the install and importer modules at the end of the setup

* Unused imports; update IJ style

* test explicit stage for php+mysql

* add more to matrix

* Add different MariaDB versions

* undo
2019-12-12 15:07:35 -05:00
Nabeel S
a58bca390b Fix BindingResolutionError when debug toolbar isn't present (#465)
* Fix BindingResolutionError when debug toolbar isn't present

* Formatting
2019-12-11 15:12:31 -05:00
Nabeel S
e6d38f9338 Add PHP 7.4 support (#464)
* Add PHP 7.4 to build matrix

* DB fix

* YAML parser fix in test data

* Show versions

* Package updates

* Track used ICAOs

* 7.4 METAR parsing fix

* METAR parser fix

* Formatting

* Add meters to response units

* Call instance for unit conversion

* Return value

* Catch exception for unknown quantity

* Comment fix

* Formatting

* METAR parsing fixes on PHP 7.4

* Package updates

* More random airport ID

* More random airport ID

* Properly disable toolbar

* Semver written out to version file

* Use dev as default identifier
2019-12-11 12:57:18 -05:00
Nabeel S
1f65b744a0 Fix CSV imports giving Storage class not found #454 (#462)
* Fix CSV imports giving Storage class not found #454

* Update yarn files for security alert
2019-12-10 13:53:55 -05:00
Nabeel S
d9a1e6aba7 Use DateTimeZone instead of int for creating datetime
closes #461
2019-12-09 22:11:20 -05:00
Nabeel S
8cb0021b9f Use PhpExecutableFinder() closes #457 #458 (#460) 2019-12-09 15:26:30 -05:00
Nabeel S
8042c4ffc1 Avoid proc_open use #455 (#456) 2019-12-05 14:17:36 -05:00
Nabeel Shahzad
cc8662445c Allow nullable on flight_id 2019-12-03 15:52:00 -05:00
Nabeel Shahzad
64a04f70a3 Fix for flight_number check forcing to exist 2019-12-03 15:45:18 -05:00
Nabeel S
b06287da23 Stricter checks on ACARS API data (#451)
* Stricter checks on ACARS API data

* More checks
2019-12-02 18:27:58 -05:00
Nabeel S
83821d1e04 Remove bootstrap cache (#448)
* Cleanup the bootstrap/cache directory when packaging

* Fix removal of bootstrap cache

* Formatting
2019-12-02 10:29:16 -05:00
Nabeel S
68eff40753 Replace importer with AJAX powered; better error handling #443 (#447)
* Replace importer with AJAX powered; better error handling #443

* Formatting

* Fix command line importer
2019-12-02 09:57:35 -05:00
Nabeel S
50dc79bc8d Refactor and add importer to Installer module #443 (#444)
* Refactor and add importer to Installer module #443

* Refactor for finances to use in import

* Import groups into roles

* Formatting

* Formatting

* Add interface in installer for import

* Notes about importing

* Check for installer folder

* Formatting

* Fix pirep->user mapping

* Unused import

* Formatting
2019-11-27 09:19:20 -05:00
Nabeel S
f95a3f336b Fix missing newsRepo (#445) 2019-11-23 12:58:48 -05:00
Nabeel S
ea3ab21beb 391 Notification refactorings (#441)
* Refactor notifications to allow easier plugins

* Notification refactoring

* Formatting

* Move news to NewsService; cleanup of events

* More refactoring; added send email out for news item and the template

* Formatting

* Formatting
2019-11-20 10:16:01 -05:00
3950 changed files with 121406 additions and 29610 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
vendor

View File

@@ -1,6 +1,10 @@
#
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.js]
indent_style = space
indent_size = 2
@@ -23,4 +27,4 @@ indent_style = tab
# Matches the exact files either package.json or .travis.yml
[{package.json, .travis.yml}]
indent_style = space
indent_size = 2
indent_size = 2

View File

@@ -8,7 +8,7 @@ assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
A clear and concise description of what the bug is. Please upload the Laravel logs as well from `storage/logs/laravel.log` (or the file with the correct date)
**Version**
Please enter the version

102
.github/scripts/build.sh vendored Normal file
View File

@@ -0,0 +1,102 @@
#!/usr/bin/env bash
echo "Version: ${VERSION}"
echo "Full Version: ${FULL_VERSION}"
echo "Package name: ${TAR_NAME}"
echo "Current directory: ${BASE_DIR}"
echo "Cleaning files"
# Leftover individual files to delete
declare -a remove_files=(
.git
.github
.sass-cache
.idea
.travis
docker
node_modules
vendor/willdurand/geocoder/tests
_ide_helper.php
.env
.dockerignore
.dpl
.editorconfig
.eslintignore
.eslintrc
.php_cs
.php_cs.cache
.php-cs-fixer.php
.phpstorm.meta.php
.styleci.yml
.phpunit.result.cache
env.php
intellij_style.xml
config.php
docker-compose.yml
docker-compose.local.yml
Makefile
phpcs.xml
phpunit.xml
phpvms.iml
Procfile
phpstan.neon
symfony.lock
composer.phar
)
for file in "${remove_files[@]}"; do
rm -rf $file
done
find ./vendor -type d -name ".git" -print0 | xargs rm -rf
find . -type d -name "sass-cache" -print0 | xargs rm -rf
# clear any app specific stuff that might have been loaded in
find bootstrap/cache -mindepth 1 -maxdepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/app -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name public -not -name import -print0 -exec rm -rf {} +
find storage/app/public -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name avatars -not -name uploads -print0 -exec rm -rf {} +
find storage/app/public/avatars -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/app/public/uploads -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/debugbar -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/docker -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/cache -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/sessions -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/views -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/logs -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
mkdir -p storage/app/public/avatars
mkdir -p storage/app/public/uploads
mkdir -p storage/framework/cache
mkdir -p storage/framework/sessions
mkdir -p storage/framework/views
cd /tmp
echo "Current directory contents"
ls -al $BASE_DIR
echo "Parent directory contents"
ls -al $BASE_DIR/../
echo "Calling find"
find $BASE_DIR/../ -type d -maxdepth 2
tar -czf $TAR_NAME -C $BASE_DIR --xform 's:^\./::' . [--show-transformed-names|--show-stored-names]
sha256sum $TAR_NAME >"$TAR_NAME.sha256"
cd $BASE_DIR;
zip -r $ZIP_NAME ./
sha256sum $ZIP_NAME >"$ZIP_NAME.sha256"
mv $ZIP_NAME /tmp
mv "$ZIP_NAME.sha256" /tmp
ls -al /tmp
echo "Moving to dist"
mkdir -p $BASE_DIR/dist
cd $BASE_DIR/dist
mv "/tmp/$TAR_NAME" "/tmp/$ZIP_NAME" "/tmp/$TAR_NAME.sha256" "/tmp/$ZIP_NAME.sha256" .

View File

@@ -1,7 +1,3 @@
<?php
exit();
?>
APP_ENV="dev"
APP_KEY="base64:zdgcDqu9PM8uGWCtMxd74ZqdGJIrnw812oRMmwDF6KY="
APP_URL="http://localhost"
@@ -12,7 +8,7 @@ APP_LOCALE="en"
PHPVMS_INSTALLED="true"
APP_LOG="daily"
APP_LOG_LEVEL="debug"
LOG_LEVEL="debug"
APP_LOG_MAX_FILES="3"
DB_CONNECTION="mysql"

View File

@@ -21,9 +21,9 @@
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<listeners>
<!--<listeners>
<listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
</listeners>
</listeners>-->
<php>
<ini name="error_reporting" value="E_ALL"/>
<ini name="display_errors" value="On"/>

36
.github/scripts/version.sh vendored Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
if test "$GIT_TAG_NAME"; then
export VERSION=$GIT_TAG_NAME
# Pass in the tag as the version to write out
php artisan phpvms:version --write --write-full-version "${VERSION}"
export FULL_VERSION=$(php artisan phpvms:version)
else
export BRANCH=${GITHUB_REF##*/}
echo "On branch $BRANCH"
# Write the version out but place the branch ID in there
# This is only for the dev branch
export BASE_VERSION=$(php artisan phpvms:version --base-only)
# This now includes the pre-release version, so "-dev" by default
export VERSION=${BASE_VERSION}
# Don't pass in a version here, just write out the latest hash
php artisan phpvms:version --write "${VERSION}"
export FULL_VERSION=$(php artisan phpvms:version)
fi
export FILE_NAME="phpvms-${VERSION}"
export TAR_NAME="$FILE_NAME.tar.gz"
export ZIP_NAME="$FILE_NAME.zip"
export BASE_DIR=`pwd`
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#environment-files
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV
echo "TAR_NAME=${TAR_NAME}" >> $GITHUB_ENV
echo "ZIP_NAME=${ZIP_NAME}" >> $GITHUB_ENV
echo "BASE_DIR=${BASE_DIR}" >> $GITHUB_ENV
echo "DISCORD_MSG=Version ${FULL_VERSION} is available, download: [zip](http://downloads.phpvms.net/$ZIP_NAME) | [tar](http://downloads.phpvms.net/$TAR_NAME)" >> $GITHUB_ENV

248
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,248 @@
name: 'Build'
on: ['push', 'pull_request', 'workflow_dispatch', 'release']
jobs:
build:
runs-on: ubuntu-20.04
if: github.repository == 'nabeelio/phpvms'
strategy:
fail-fast: true
matrix:
php-versions: ['8.0', '8.1']
name: PHP ${{ matrix.php-versions }}
env:
extensions: intl, pcov, mbstring
key: cache-v1
steps:
- name: Checkout
uses: actions/checkout@v2
# Configure Caching
- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# Configure PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
ini-values: post_max_size=256M, short_open_tag=On
coverage: xdebug
tools: php-cs-fixer, phpunit
- name: Shutdown Ubuntu MySQL
run: sudo service mysql stop
- name: Install MariaDB
uses: getong/mariadb-action@v1.1
with:
character set server: 'utf8'
collation server: 'utf8_general_ci'
mysql database: 'phpvms'
mysql root password: ''
mysql user: ''
mysql password: ''
- name: Configure Environment
run: |
php --version
mysql --version
sleep 15
# Downgrade composer version to 1.x
composer install --dev --no-interaction --verbose
cp .github/scripts/env.php env.php
cp .github/scripts/phpunit.xml phpunit.xml
php artisan database:create --reset
php artisan migrate:refresh --seed
- name: Run Tests
run: |
export PHP_CS_FIXER_IGNORE_ENV=1
#vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --dry-run --diff --using-cache=no
vendor/bin/phpunit --debug --verbose
# This runs after all of the tests, run have run. Creates a cleaned up version of the
# distro, and then creates the artifact to push up to S3 or wherever
artifacts:
name: 'Create dev build'
needs: build
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- uses: olegtarasov/get-tag@v2.1
id: tagName
# Configure Caching
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
# Dependencies
- name: 'Install Release Dependencies'
run: |
rm -rf vendor
composer install --no-dev --prefer-dist --no-interaction --verbose
sudo chmod +x ./.github/scripts/*
- name: Get version
run: .github/scripts/version.sh
- name: Build Distro
run: .github/scripts/build.sh
- name: Upload S3
uses: shallwefootball/s3-upload-action@v1.1.3
with:
aws_key_id: ${{ secrets.S3_BUILD_ARTIFACTS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.S3_BUILD_ARTIFACTS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ secrets.S3_BUCKET_NAME }}
source_dir: 'dist'
destination_dir: ''
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.0
with:
# DISCORD_MSG is defined in versions.sh
args: '{{ DISCORD_MSG }}'
# This runs after all of the tests, run have run. Creates a cleaned up version of the
# distro, and then creates the artifact to push up to S3 or wherever
# https://github.com/actions/create-release
release:
name: 'Create Release'
needs: build
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
- uses: olegtarasov/get-tag@v2.1
id: tagName
# Configure Caching
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
# Dependencies
- name: 'Install Release Dependencies'
run: |
rm -rf vendor
composer install --no-dev --prefer-dist --no-interaction --verbose
sudo chmod +x ./.github/scripts/*
- name: Get version
run: .github/scripts/version.sh
- name: Build Distro
run: .github/scripts/build.sh
- name: Upload S3
uses: shallwefootball/s3-upload-action@v1.1.3
with:
aws_key_id: ${{ secrets.S3_BUILD_ARTIFACTS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.S3_BUILD_ARTIFACTS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ secrets.S3_BUCKET_NAME }}
source_dir: 'dist'
destination_dir: ''
- name: Checkout code
uses: actions/checkout@v2
- name: Get version
run: .github/scripts/version.sh
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
# Upload the tar file to the release
- name: Upload Tar Asset
id: upload-tar-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/{{TAR_NAME}}
asset_name: '{{ TAR_NAME }}'
asset_content_type: application/gzip
# upload the zip file to the release
- name: Upload Zip Asset
id: upload-zip-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/{{ZIP_NAME}}
asset_name: '{{ ZIP_NAME }}'
asset_content_type: application/zip
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.0
with:
# DISCORD_MSG is defined in versions.sh
args: '{{ DISCORD_MSG }}'

14
.gitignore vendored
View File

@@ -22,6 +22,7 @@ storage/*.sqlite
.env.*.php
.env.php
.env
.env.*
.env.bak
env.php
.env.generated
@@ -29,6 +30,7 @@ env.php
#Homestead.yaml
Homestead.json
LocalValetDriver.php
docker-compose-profiler.yml
# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
.rocketeer/
@@ -73,4 +75,16 @@ error_log
.sass-cache
.DS_Store
/config.php
/config.bak.php
/VERSION
sync.sh
###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###
###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

View File

@@ -28,6 +28,8 @@ RedirectMatch 403 ^/composer.phar
RedirectMatch 403 ^/env.php.*?$
RedirectMatch 403 ^/env.php
RedirectMatch 403 ^/env.php$
RedirectMatch 403 ^/config.php$
RedirectMatch 403 ^/config.bak.php$
RedirectMatch 403 ^/Makefile
RedirectMatch 403 ^/package.json
RedirectMatch 403 ^/package-lock.json

69
.php-cs-fixer.php Normal file
View File

@@ -0,0 +1,69 @@
<?php
declare(strict_types=1);
/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <fabien@symfony.com>
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
$header = <<<'EOF'
This file is part of PHP CS Fixer.
(c) Fabien Potencier <fabien@symfony.com>
Dariusz Rumiński <dariusz.ruminski@gmail.com>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
$finder = PhpCsFixer\Finder::create()
->ignoreVCSIgnored(true)
->exclude('tests/data')
->exclude('storage')
->exclude('resources')
->in(__DIR__)
->append([
__DIR__.'/dev-tools/doc.php',
// __DIR__.'/php-cs-fixer', disabled, as we want to be able to run bootstrap file even on lower PHP version, to show nice message
__FILE__,
])
;
$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'strict_param' => true,
'no_php4_constructor' => true,
'no_extra_blank_lines' => true,
'no_superfluous_elseif' => true,
'single_line_comment_style' => false,
'simple_to_complex_string_variable' => true,
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'operators' => [
'=>' => 'align_single_space_minimal'
]
],
/*
'blank_line_before_statement' => [
'statements' => [
'declare',
'for',
'return',
'throw',
'try',
],
],
*/
])
->setFinder($finder);
return $config;

37
.php_cs
View File

@@ -1,37 +0,0 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in('app')
->in('config');
return PhpCsFixer\Config::create()
->setHideProgress(true)
->setUsingCache(false)
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'strict_param' => true,
'no_php4_constructor' => true,
'no_extra_blank_lines' => true,
'no_superfluous_elseif' => true,
'single_line_comment_style' => false,
'simple_to_complex_string_variable' => true,
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'align_double_arrow' => true,
],
/*
'blank_line_before_statement' => [
'statements' => [
'declare',
'for',
'return',
'throw',
'try',
],
],
*/
])
->setFinder($finder);

View File

@@ -1,81 +0,0 @@
#
# Travis CI config file
#
language: php
php:
- '7.2'
- '7.3'
matrix:
include:
- php: '7.2'
- php: '7.3'
fast_finish: true
cache:
# Cache lives for 10 min
# Default of 3m might not be long enough for all the runs
timeout: 600
directories:
- "$HOME/.composer/cache"
- "$HOME/.npm"
services:
- mysql
install:
- composer install --dev --no-interaction --verbose
- cp .travis/env.travis.php env.php
- cp .travis/phpunit.travis.xml phpunit.xml
before_script:
- php artisan database:create --reset
- php artisan migrate:refresh --seed
script:
- vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --diff --using-cache=no
- vendor/bin/phpunit --debug --verbose
after_failure:
- cat storage/logs/*.log
jobs:
include:
# Just packages up a release
- stage: package
script: skip
before_deploy:
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
# Configure the conditional deployment
# https://docs.travis-ci.com/user/deployment/#examples-of-conditional-deployment
deploy:
- provider: script
skip_cleanup: true
script: ./.travis/deploy_script.sh
on:
all_branches: true
repo: nabeelio/phpvms
php: '7.2'
tags: false
# RELEASE STAGE
# Only runs when there's a tag applied to this release (tag should be the version)
# This uses Github Releases and posts it there (provider: releases)
# https://docs.travis-ci.com/user/deployment/releases
- stage: release
script: skip
before_deploy:
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
- ./.travis/deploy_script.sh
deploy:
provider: releases
skip_cleanup: true
api_key: $GITHUB_TOKEN
file_glob: true
file: build/*
on:
tags: true
repo: nabeelio/phpvms
php: '7.2'

View File

@@ -1,140 +0,0 @@
#!/usr/bin/env bash
if [ "$TRAVIS" = "true" ]; then
cd $TRAVIS_BUILD_DIR
if test "$TRAVIS_TAG"; then
PKG_NAME=$TRAVIS_TAG
else
echo "On branch $TRAVIS_BRANCH"
if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "dev" ]; then
echo "Not on valid branch, exiting"
exit 0;
fi;
BASE_VERSION=$(php artisan phpvms:version --base-only)
PKG_NAME=${BASE_VERSION}-${TRAVIS_BRANCH}
fi
FILE_NAME="phpvms-$PKG_NAME"
TAR_NAME="$FILE_NAME.tar.gz"
echo "Writing $TAR_NAME"
php artisan phpvms:version --write > VERSION
VERSION=$(cat VERSION)
echo "Version: $VERSION"
echo "Cleaning files"
rm -rf vendor
composer install --no-dev --prefer-dist --no-interaction --verbose
# Clean up the dependencies to remove some of the dev packages
# declare -a remove_packages=(
# 'barryvdh/laravel-ide-helper'
# 'bpocallaghan/generators'
# 'codedungeon/phpunit-result-printer'
# 'fzaninotto/faker'
# 'nikic/php-parser'
# 'phpstan/phpstan'
# 'phpunit/phpunit',
# 'weebly/phpstan-laravel'
# )
#
# for pkg in "${remove_packages[@]}"
# do
# composer --optimize-autoloader --no-interaction remove $pkg
# done
# Leftover individual files to delete
declare -a remove_files=(
.git
.github
.sass-cache
.idea
.travis
docker
tests
_ide_helper.php
.dpl
.editorconfig
.eslintignore
.eslintrc
.php_cs
.php_cs.cache
.phpstorm.meta.php
.styleci.yml
.phpunit.result.cache
env.php
intellij_style.xml
config.php
docker-compose.yml
Makefile
phpcs.xml
phpunit.xml
phpvms.iml
Procfile
phpstan.neon
node_modules
composer.phar
vendor/willdurand/geocoder/tests
)
for file in "${remove_files[@]}"
do
rm -rf $file
done
find ./vendor -type d -name ".git" -print0 | xargs rm -rf
find . -type d -name "sass-cache" -print0 | xargs rm -rf
# clear any app specific stuff that might have been loaded in
find storage/app -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name public -not -name import -print0 -exec rm -rf {} +
find storage/app/public -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name avatars -not -name uploads -print0 -exec rm -rf {} +
find storage/app/public/avatars -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/app/public/uploads -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/debugbar -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/docker -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/cache -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/sessions -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/views -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/logs -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
mkdir -p storage/app/public/avatars
mkdir -p storage/app/public/uploads
mkdir -p storage/framework/cache
mkdir -p storage/framework/sessions
mkdir -p storage/framework/views
# Regenerate the autoloader and classes
composer dump-autoload
make clean
echo "Creating Tarball"
cd /tmp
tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms
sha256sum $TAR_NAME > "$TAR_NAME.sha256"
echo "Uploading to S3"
mkdir -p $TRAVIS_BUILD_DIR/build
cd $TRAVIS_BUILD_DIR/build
mv "/tmp/$TAR_NAME" "/tmp/$TAR_NAME.sha256" .
artifacts upload --target-paths "/" $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256
# Upload the version for a tagged release. Move to a version file in different
# tags. Within phpVMS, we have an option of which version to track in the admin
if test "$TRAVIS_TAG"; then
echo "Uploading release version file"
cp "$TRAVIS_BUILD_DIR/VERSION" release_version
artifacts upload --target-paths "/" release_version
else
echo "Uploading ${TRAVIS_BRANCH}_version file"
cp $TRAVIS_BUILD_DIR/VERSION ${TRAVIS_BRANCH}_version
artifacts upload --target-paths "/" ${TRAVIS_BRANCH}_version
fi
curl -X POST --data "{\"content\": \"A new build is available at http://downloads.phpvms.net/$TAR_NAME ($VERSION)\"}" -H "Content-Type: application/json" $DISCORD_WEBHOOK_URL
fi

View File

@@ -1,9 +1,706 @@
## Beta 2 (7.0.0-beta.2)
# Changelog
- Switching to semver
- PHP 7.2 minimum
- Lots of fixes, view the [Github Milestone](https://github.com/nabeelio/phpvms/milestone/2?closed=1) for details
## [7.0.0-beta.4](https://github.com/nabeelio/phpvms/tree/7.0.0-beta.4) (2020-05-09)
## Beta 1 (v7.0.0-beta)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/7.0.0-beta.3...7.0.0-beta.4)
- Initial Release
**Implemented enhancements:**
- Move currency selection to admin settings [\#671](https://github.com/nabeelio/phpvms/issues/671)
- Center live map to custom location [\#661](https://github.com/nabeelio/phpvms/issues/661)
- Pilot Names - Pilots ID [\#656](https://github.com/nabeelio/phpvms/issues/656)
- Simbrief sample data [\#651](https://github.com/nabeelio/phpvms/issues/651)
- Simbrief only available for bids [\#642](https://github.com/nabeelio/phpvms/issues/642)
- PIREP prefile download [\#634](https://github.com/nabeelio/phpvms/issues/634)
- Importer - group imported aircraft by type [\#628](https://github.com/nabeelio/phpvms/issues/628)
- API: When looking up flight, return the load factor [\#611](https://github.com/nabeelio/phpvms/issues/611)
- API: On prefile, return required fields [\#610](https://github.com/nabeelio/phpvms/issues/610)
- Center on active flights [\#605](https://github.com/nabeelio/phpvms/issues/605)
- Profiling/performance improvments [\#602](https://github.com/nabeelio/phpvms/issues/602)
- Aircraft stats resync [\#585](https://github.com/nabeelio/phpvms/issues/585)
- Cron Job [\#553](https://github.com/nabeelio/phpvms/issues/553)
- Importing a CSV with additional airports clears all previous airports [\#490](https://github.com/nabeelio/phpvms/issues/490)
- Use continuation token instead of page/offset [\#469](https://github.com/nabeelio/phpvms/issues/469)
- Combine the Util classes in Facade and Support [\#467](https://github.com/nabeelio/phpvms/issues/467)
- ACARS/Live flight events [\#436](https://github.com/nabeelio/phpvms/issues/436)
- Allow logo upload for airline [\#417](https://github.com/nabeelio/phpvms/issues/417)
- Google Analytics Settings [\#382](https://github.com/nabeelio/phpvms/issues/382)
- Let update only be run if logged in/admin [\#372](https://github.com/nabeelio/phpvms/issues/372)
- Airport Lookup - possible additions [\#364](https://github.com/nabeelio/phpvms/issues/364)
- Set flight type for expenses for flight [\#348](https://github.com/nabeelio/phpvms/issues/348)
- Extend search schedule options [\#297](https://github.com/nabeelio/phpvms/issues/297)
- Change currency from settings \#671 [\#672](https://github.com/nabeelio/phpvms/pull/672)
- Add privatized version of name \#656 [\#658](https://github.com/nabeelio/phpvms/pull/658)
- Add Simbrief entries as sample data for load \#651 [\#652](https://github.com/nabeelio/phpvms/pull/652)
- Option for SB only on bids; add the new file type \#642 [\#643](https://github.com/nabeelio/phpvms/pull/643)
- Account ICAO for subfleet, airline/location if columns exist \#628 [\#632](https://github.com/nabeelio/phpvms/pull/632)
- Performance improvements \#602 [\#607](https://github.com/nabeelio/phpvms/pull/607)
- Center on active flights \#605 [\#606](https://github.com/nabeelio/phpvms/pull/606)
- Installer fixes, remove bcmath, fix design [\#596](https://github.com/nabeelio/phpvms/pull/596)
- Remove airport length restrictions \#590 [\#592](https://github.com/nabeelio/phpvms/pull/592)
- Remove 4 char restriction from ICAO; use decimal type for lat/lon \#590 [\#591](https://github.com/nabeelio/phpvms/pull/591)
- Recalcuate aircraft stats in nightly cron and importer \#585 \#443 [\#587](https://github.com/nabeelio/phpvms/pull/587)
- \(Importer\) Set the pay rate for the ranks \#443 [\#586](https://github.com/nabeelio/phpvms/pull/586)
- Fix rowmapper generator, check for fields, map users \#443 [\#583](https://github.com/nabeelio/phpvms/pull/583)
- Add bcmath to the required extensions list \#558 [\#564](https://github.com/nabeelio/phpvms/pull/564)
- Add the argc\_argv flag for the cgi exec \#553 [\#556](https://github.com/nabeelio/phpvms/pull/556)
- Add logo to the flights page if its set \#417 [\#550](https://github.com/nabeelio/phpvms/pull/550)
- Add additional events for PIREP states \#436 [\#548](https://github.com/nabeelio/phpvms/pull/548)
- Cleanup Utils \#467 [\#547](https://github.com/nabeelio/phpvms/pull/547)
- Add checkbox to clear previous data when importing \#490 [\#546](https://github.com/nabeelio/phpvms/pull/546)
- Distro zip file from tar file \#449 [\#543](https://github.com/nabeelio/phpvms/pull/543)
- Spanish files translation [\#542](https://github.com/nabeelio/phpvms/pull/542)
- Add link to download ACARS config from profile [\#539](https://github.com/nabeelio/phpvms/pull/539)
- Format all blade templates to 2 spaces \#530 [\#531](https://github.com/nabeelio/phpvms/pull/531)
- Add menu bar for mobile [\#529](https://github.com/nabeelio/phpvms/pull/529)
- Fix live and route map errors \#527 [\#528](https://github.com/nabeelio/phpvms/pull/528)
- Set PIREPs page to public [\#526](https://github.com/nabeelio/phpvms/pull/526)
- Try to clear caches before updating [\#522](https://github.com/nabeelio/phpvms/pull/522)
- Reduce number of queries for update check [\#520](https://github.com/nabeelio/phpvms/pull/520)
- Add getRootDomain\(\) to Utils [\#514](https://github.com/nabeelio/phpvms/pull/514)
- Search flights by subfleet \#484 [\#506](https://github.com/nabeelio/phpvms/pull/506)
- Add base Dockerfile for Dockerhub upload [\#504](https://github.com/nabeelio/phpvms/pull/504)
- Add reference to docs on doc site [\#502](https://github.com/nabeelio/phpvms/pull/502)
- Add new command to export a specific PIREP for debugging [\#501](https://github.com/nabeelio/phpvms/pull/501)
- Flight search for departure/arrival airports not using column names [\#496](https://github.com/nabeelio/phpvms/pull/496)
- Split the importer module out from the installer module [\#468](https://github.com/nabeelio/phpvms/pull/468)
**Fixed bugs:**
- Aircraft hours not counting [\#683](https://github.com/nabeelio/phpvms/issues/683)
- Error creating first user/airline [\#677](https://github.com/nabeelio/phpvms/issues/677)
- submitting PIREP: Page Not Found [\#676](https://github.com/nabeelio/phpvms/issues/676)
- Filing manual report causes SimBrief Error [\#668](https://github.com/nabeelio/phpvms/issues/668)
- Error on finance page in admin [\#667](https://github.com/nabeelio/phpvms/issues/667)
- API: User bids aren't loading SimBrief data for flight [\#664](https://github.com/nabeelio/phpvms/issues/664)
- .: Links to pilot profiles :. [\#655](https://github.com/nabeelio/phpvms/issues/655)
- Some domains \(ex, .co.uk\) not properly parsed [\#647](https://github.com/nabeelio/phpvms/issues/647)
- API: Load bids through the bids.flight fields, not the flights field on the user [\#639](https://github.com/nabeelio/phpvms/issues/639)
- Login page not using theme [\#638](https://github.com/nabeelio/phpvms/issues/638)
- CSV import error says "csv not found" [\#636](https://github.com/nabeelio/phpvms/issues/636)
- Importer - schedules not importing properly [\#630](https://github.com/nabeelio/phpvms/issues/630)
- Disable using of php opcache [\#625](https://github.com/nabeelio/phpvms/issues/625)
- API: Flight fields are an array when empty [\#618](https://github.com/nabeelio/phpvms/issues/618)
- "Pending Pireps" in admin is blank [\#616](https://github.com/nabeelio/phpvms/issues/616)
- Flight fields show all fields, not custom added ones [\#614](https://github.com/nabeelio/phpvms/issues/614)
- Mixed content causes error [\#612](https://github.com/nabeelio/phpvms/issues/612)
- Fares not appearing in API response for user/subfleets [\#608](https://github.com/nabeelio/phpvms/issues/608)
- Not selecting active for aircraft shows nullable error [\#603](https://github.com/nabeelio/phpvms/issues/603)
- Airports page repeats airport name \(infinite loop\) [\#599](https://github.com/nabeelio/phpvms/issues/599)
- Calculate Distance button not working [\#595](https://github.com/nabeelio/phpvms/issues/595)
- Support Seaports with 3 letter IATA/ID codes [\#590](https://github.com/nabeelio/phpvms/issues/590)
- Hubs only show for registration [\#580](https://github.com/nabeelio/phpvms/issues/580)
- Error when updating user in admin [\#576](https://github.com/nabeelio/phpvms/issues/576)
- Updater not working because Source repository \[github\] is not defined [\#575](https://github.com/nabeelio/phpvms/issues/575)
- Flights Page Search Subfleet Column [\#574](https://github.com/nabeelio/phpvms/issues/574)
- Duplicate key entry for ACARS data [\#572](https://github.com/nabeelio/phpvms/issues/572)
- No hint path defined for updater [\#570](https://github.com/nabeelio/phpvms/issues/570)
- My Bids Page Error [\#561](https://github.com/nabeelio/phpvms/issues/561)
- I can't change Current Theme [\#554](https://github.com/nabeelio/phpvms/issues/554)
- Pilots cannot use the dashboard or flights without admin rights [\#480](https://github.com/nabeelio/phpvms/issues/480)
- Database prefix not being applied [\#442](https://github.com/nabeelio/phpvms/issues/442)
- Install not working [\#411](https://github.com/nabeelio/phpvms/issues/411)
- typo in dependency on 'leaflet.geodesic' [\#687](https://github.com/nabeelio/phpvms/pull/687)
- Emails/notifications not sending \#675 [\#686](https://github.com/nabeelio/phpvms/pull/686)
- Aircraft hours not showing/incrementing \#683 [\#684](https://github.com/nabeelio/phpvms/pull/684)
- METAR: KM as unit in visibility \#680 [\#682](https://github.com/nabeelio/phpvms/pull/682)
- Blank/null IATA code isn't unique when added \#679 [\#681](https://github.com/nabeelio/phpvms/pull/681)
- Fix airline creation in installer \#677 [\#678](https://github.com/nabeelio/phpvms/pull/678)
- Journal not created when airline is created \#667 [\#670](https://github.com/nabeelio/phpvms/pull/670)
- Check for SB being avail before filing \#668 [\#669](https://github.com/nabeelio/phpvms/pull/669)
- Load Simbrief and flight data when getting bids \#664 [\#665](https://github.com/nabeelio/phpvms/pull/665)
- Fix pilots page not showing up \#655 [\#660](https://github.com/nabeelio/phpvms/pull/660)
- Fix PirepComment response; 201 to 200 [\#654](https://github.com/nabeelio/phpvms/pull/654)
- Domain detection failing for .co.uk, etc \#647 [\#648](https://github.com/nabeelio/phpvms/pull/648)
- Auth routes not using themes \#638 [\#645](https://github.com/nabeelio/phpvms/pull/645)
- Don't return bids by default, fix user flight column \#639 [\#640](https://github.com/nabeelio/phpvms/pull/640)
- Account for admin role, don't error out on null rows \#632 [\#637](https://github.com/nabeelio/phpvms/pull/637)
- Fix airline mapping for aircraft \#628 [\#633](https://github.com/nabeelio/phpvms/pull/633)
- Increase ID column size; seed ID generator with uniqid\(\) \#630 [\#631](https://github.com/nabeelio/phpvms/pull/631)
- Disable using apc/opcache by default if found \#625 [\#629](https://github.com/nabeelio/phpvms/pull/629)
- Fix saving of fare \#621 [\#624](https://github.com/nabeelio/phpvms/pull/624)
- API: Flight fields are an array when empty \#618 [\#619](https://github.com/nabeelio/phpvms/pull/619)
- Remove the flight fields link from admin \#614 [\#615](https://github.com/nabeelio/phpvms/pull/615)
- HTTP/HTTPS mixed content errors \#612 [\#613](https://github.com/nabeelio/phpvms/pull/613)
- Fare information not included in subfleet response \#608 [\#609](https://github.com/nabeelio/phpvms/pull/609)
- Aircraft status field blank causes error \#603 [\#604](https://github.com/nabeelio/phpvms/pull/604)
- METAR parsing infinite loop bugfix \#599 [\#600](https://github.com/nabeelio/phpvms/pull/600)
- Table prefixes not being added to indexes [\#597](https://github.com/nabeelio/phpvms/pull/597)
- Import expense and ledger entries \#443 [\#588](https://github.com/nabeelio/phpvms/pull/588)
- User country mapping; ignore unused groups \#443 [\#584](https://github.com/nabeelio/phpvms/pull/584)
- Change fuel used to optional \#512 [\#582](https://github.com/nabeelio/phpvms/pull/582)
- Respect home hubs setting for registration \#580 [\#581](https://github.com/nabeelio/phpvms/pull/581)
- Upstream null version; build version tags not being saved properly \#575 [\#578](https://github.com/nabeelio/phpvms/pull/578)
- Fix edit pilot error \(Facade\Utils missing\) \#576 [\#577](https://github.com/nabeelio/phpvms/pull/577)
- Upsert on ACARS positions \#572 [\#573](https://github.com/nabeelio/phpvms/pull/573)
- Fix the namespace path on updater templates \#570 [\#571](https://github.com/nabeelio/phpvms/pull/571)
- Route not found error for Pirep::resource\(\) call \#559 [\#565](https://github.com/nabeelio/phpvms/pull/565)
- Add extra check for $acars being set \#560 [\#563](https://github.com/nabeelio/phpvms/pull/563)
- Missing $subfleet error on bids page \#561 [\#562](https://github.com/nabeelio/phpvms/pull/562)
- Refresh theme cache on settings page load \#554 [\#557](https://github.com/nabeelio/phpvms/pull/557)
- Fix migrations when table prefix is involved \#442 [\#555](https://github.com/nabeelio/phpvms/pull/555)
- Use optional\(\) around the airport fields [\#537](https://github.com/nabeelio/phpvms/pull/537)
- PIREPS resource except for show [\#536](https://github.com/nabeelio/phpvms/pull/536)
- Fix import during flight cron \#532 [\#535](https://github.com/nabeelio/phpvms/pull/535)
- Fix PIREP edit endpoint [\#534](https://github.com/nabeelio/phpvms/pull/534)
- Add a public\_url\(\) helper \#513 [\#519](https://github.com/nabeelio/phpvms/pull/519)
- Correct text for no subfleets \#507 [\#518](https://github.com/nabeelio/phpvms/pull/518)
- Error page not showing when database isn't configured [\#517](https://github.com/nabeelio/phpvms/pull/517)
- Check user permissions on the routes \#508 [\#516](https://github.com/nabeelio/phpvms/pull/516)
- Show admin dropdown for admin-access ability [\#515](https://github.com/nabeelio/phpvms/pull/515)
- New subfleet not being attached to an airline on import \#479 [\#505](https://github.com/nabeelio/phpvms/pull/505)
- Importing not updating existing items \#486 [\#503](https://github.com/nabeelio/phpvms/pull/503)
- Set a default model value for airports on PIREP [\#500](https://github.com/nabeelio/phpvms/pull/500)
- Fix GeoService errors when viewing PIREP \#498 [\#499](https://github.com/nabeelio/phpvms/pull/499)
- Properly set the distance/planned\_distance [\#497](https://github.com/nabeelio/phpvms/pull/497)
- 491 Installation Error [\#495](https://github.com/nabeelio/phpvms/pull/495)
- Return the flight fares if there are no subfleet fares \#488 [\#489](https://github.com/nabeelio/phpvms/pull/489)
- Error if there are no roles when editing a user \#480 [\#483](https://github.com/nabeelio/phpvms/pull/483)
- Allow nullable field and calculate distance if nulled [\#482](https://github.com/nabeelio/phpvms/pull/482)
- Pilots cannot use the dashboard or flights without admin rights [\#481](https://github.com/nabeelio/phpvms/pull/481)
- Fix BindingResolutionError when debug toolbar isn't present [\#465](https://github.com/nabeelio/phpvms/pull/465)
- Fix CSV imports giving Storage class not found \#454 [\#462](https://github.com/nabeelio/phpvms/pull/462)
- Use PhpExecutableFinder\(\) closes \#457 \#458 [\#460](https://github.com/nabeelio/phpvms/pull/460)
- Avoid proc\_open use \#455 [\#456](https://github.com/nabeelio/phpvms/pull/456)
- Stricter checks on ACARS API data [\#451](https://github.com/nabeelio/phpvms/pull/451)
- Remove bootstrap cache [\#448](https://github.com/nabeelio/phpvms/pull/448)
**Closed issues:**
- Dashboard error when METAR visibility in KM [\#680](https://github.com/nabeelio/phpvms/issues/680)
- Error adding multiple airlines without IATA codes [\#679](https://github.com/nabeelio/phpvms/issues/679)
- Pages [\#641](https://github.com/nabeelio/phpvms/issues/641)
- Create a "fare type" for cargo [\#621](https://github.com/nabeelio/phpvms/issues/621)
- Split Sample module out into separate repo [\#593](https://github.com/nabeelio/phpvms/issues/593)
- No way to add files to fleet [\#567](https://github.com/nabeelio/phpvms/issues/567)
- Map Center Coords [\#566](https://github.com/nabeelio/phpvms/issues/566)
- Pilot Profile Page Error [\#560](https://github.com/nabeelio/phpvms/issues/560)
- File New Pirep [\#559](https://github.com/nabeelio/phpvms/issues/559)
- I can't add new flight [\#558](https://github.com/nabeelio/phpvms/issues/558)
- Pilot Pay route modifier [\#487](https://github.com/nabeelio/phpvms/issues/487)
- Auto-update [\#449](https://github.com/nabeelio/phpvms/issues/449)
- Setting to not automatically calculate distances [\#446](https://github.com/nabeelio/phpvms/issues/446)
- Classic importer [\#443](https://github.com/nabeelio/phpvms/issues/443)
- SimBrief integration - pirep prefile [\#405](https://github.com/nabeelio/phpvms/issues/405)
- PIREP rejection doesn't move pilot back to previous airport [\#392](https://github.com/nabeelio/phpvms/issues/392)
- Load Factor for flights [\#352](https://github.com/nabeelio/phpvms/issues/352)
**Merged pull requests:**
- Upgrade packages with security alerts [\#653](https://github.com/nabeelio/phpvms/pull/653)
- Add public/private pages \#641 [\#644](https://github.com/nabeelio/phpvms/pull/644)
- SimBrief integration \#405 [\#635](https://github.com/nabeelio/phpvms/pull/635)
- Add fare type for pax/cargo/mixed flights \#621 [\#623](https://github.com/nabeelio/phpvms/pull/623)
- Add fixed pilot pay for a flight \#487 [\#622](https://github.com/nabeelio/phpvms/pull/622)
- Add load factor and variance to flights \#352 [\#620](https://github.com/nabeelio/phpvms/pull/620)
- Module/plugin installation working \#593 [\#594](https://github.com/nabeelio/phpvms/pull/594)
- Add Google Analytics tracking ID to settings and to main template \#382 [\#551](https://github.com/nabeelio/phpvms/pull/551)
- Set expenses on specific flight types \#348 [\#549](https://github.com/nabeelio/phpvms/pull/549)
- Auto update \#449 [\#545](https://github.com/nabeelio/phpvms/pull/545)
- Auto-update functionality \#449 [\#544](https://github.com/nabeelio/phpvms/pull/544)
- ACARS XML config file download [\#540](https://github.com/nabeelio/phpvms/pull/540)
- Make the fuel used optional [\#512](https://github.com/nabeelio/phpvms/pull/512)
- Add PHP 7.4 support [\#464](https://github.com/nabeelio/phpvms/pull/464)
- Replace importer with AJAX powered; better error handling \#443 [\#447](https://github.com/nabeelio/phpvms/pull/447)
- Fix missing newsRepo variable [\#445](https://github.com/nabeelio/phpvms/pull/445)
- Refactor and add importer to Installer module \#443 [\#444](https://github.com/nabeelio/phpvms/pull/444)
- 391 Notification refactorings [\#441](https://github.com/nabeelio/phpvms/pull/441)
## [7.0.0-beta.3](https://github.com/nabeelio/phpvms/tree/7.0.0-beta.3) (2020-02-08)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/7.0.0-beta.2...7.0.0-beta.3)
**Implemented enhancements:**
- Fix formatting in blade files [\#530](https://github.com/nabeelio/phpvms/issues/530)
- Make PIREP view page public [\#525](https://github.com/nabeelio/phpvms/issues/525)
- Fix map line colors [\#523](https://github.com/nabeelio/phpvms/issues/523)
- Null-able fuel values on PIREP [\#510](https://github.com/nabeelio/phpvms/issues/510)
- include subfleet in search options [\#484](https://github.com/nabeelio/phpvms/issues/484)
- PHP 7.4 in Travis [\#463](https://github.com/nabeelio/phpvms/issues/463)
- Move cron problem report to main page [\#458](https://github.com/nabeelio/phpvms/issues/458)
**Fixed bugs:**
- Method GET for /pireps/\<id\>/edit not supported [\#533](https://github.com/nabeelio/phpvms/issues/533)
- Cron error for removing expired flights [\#532](https://github.com/nabeelio/phpvms/issues/532)
- Live map marker click not working [\#527](https://github.com/nabeelio/phpvms/issues/527)
- Redirect to installer properly [\#513](https://github.com/nabeelio/phpvms/issues/513)
- Admin panel link not shown for users in role group [\#509](https://github.com/nabeelio/phpvms/issues/509)
- Users without "admin" role can modify roles [\#508](https://github.com/nabeelio/phpvms/issues/508)
- Edit flights page - text error [\#507](https://github.com/nabeelio/phpvms/issues/507)
- Installation error with external databases [\#494](https://github.com/nabeelio/phpvms/issues/494)
- Pirep not in KG [\#493](https://github.com/nabeelio/phpvms/issues/493)
- Installation Error step2 [\#491](https://github.com/nabeelio/phpvms/issues/491)
- Fares assigned to flights not working/overwritten by Subfleet [\#488](https://github.com/nabeelio/phpvms/issues/488)
- Status not changing when importing CSV for aircraft [\#486](https://github.com/nabeelio/phpvms/issues/486)
- Default Theme unusable on Mobile [\#485](https://github.com/nabeelio/phpvms/issues/485)
- Fatal Error in subfleet page when importing routes with new aircraft [\#479](https://github.com/nabeelio/phpvms/issues/479)
- Flights CSV import fails if no distance stipulated [\#478](https://github.com/nabeelio/phpvms/issues/478)
- Subfleet CSV import [\#476](https://github.com/nabeelio/phpvms/issues/476)
- Cron - DateTime::construct\(\) expects parameter 2 to be DateTimeZone, int given [\#461](https://github.com/nabeelio/phpvms/issues/461)
- if PHP\_CLI not found in cron maintenance, put generic `php` exec there [\#457](https://github.com/nabeelio/phpvms/issues/457)
- Importing schedule bug [\#454](https://github.com/nabeelio/phpvms/issues/454)
- The updater/installer should clear all caches [\#408](https://github.com/nabeelio/phpvms/issues/408)
**Closed issues:**
- Error 500 when trying to access Dashboard. [\#498](https://github.com/nabeelio/phpvms/issues/498)
- Import multiple aircraft of different subtypes in one sheet [\#477](https://github.com/nabeelio/phpvms/issues/477)
- Split out installer/importer from updater [\#453](https://github.com/nabeelio/phpvms/issues/453)
- ACARS update fields can be nulled [\#450](https://github.com/nabeelio/phpvms/issues/450)
- Retryable HTTP client [\#430](https://github.com/nabeelio/phpvms/issues/430)
- Pireps page: 'Pending' doesn't show pending PIREPs [\#427](https://github.com/nabeelio/phpvms/issues/427)
- Email when news sent out [\#391](https://github.com/nabeelio/phpvms/issues/391)
- Save cron last run time [\#386](https://github.com/nabeelio/phpvms/issues/386)
**Merged pull requests:**
- 7.0.0-beta3 Release [\#541](https://github.com/nabeelio/phpvms/pull/541)
## [7.0.0-beta.2](https://github.com/nabeelio/phpvms/tree/7.0.0-beta.2) (2019-11-19)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/v7.0.0-beta...7.0.0-beta.2)
**Implemented enhancements:**
- CSS Love needed for the Flights Page [\#418](https://github.com/nabeelio/phpvms/issues/418)
- Add Subfleet, Custom Fields and Fares during initial schedule entry [\#410](https://github.com/nabeelio/phpvms/issues/410)
- PIREP from flight/bid; orig: Bid not removed after flight accepted [\#406](https://github.com/nabeelio/phpvms/issues/406)
- Auto airport lookup [\#404](https://github.com/nabeelio/phpvms/issues/404)
- API Changes [\#389](https://github.com/nabeelio/phpvms/issues/389)
- "Maintenance" section in admin [\#376](https://github.com/nabeelio/phpvms/issues/376)
- Auto-calculate Distance on Add Flight page [\#355](https://github.com/nabeelio/phpvms/issues/355)
- Change PIREP fuel field type [\#340](https://github.com/nabeelio/phpvms/issues/340)
- Fuel in pireps [\#295](https://github.com/nabeelio/phpvms/issues/295)
- Add field to set aircraft location [\#277](https://github.com/nabeelio/phpvms/issues/277)
- Suggestion: edit pilot ID [\#265](https://github.com/nabeelio/phpvms/issues/265)
- Combine subfleet and aircraft export [\#233](https://github.com/nabeelio/phpvms/issues/233)
- Allow URL for downloads [\#229](https://github.com/nabeelio/phpvms/issues/229)
- Move settings into database seeder [\#224](https://github.com/nabeelio/phpvms/issues/224)
- Allow specifying transfer hours on registration [\#129](https://github.com/nabeelio/phpvms/issues/129)
- Backend changes separating id from pilot\_id [\#324](https://github.com/nabeelio/phpvms/pull/324)
**Fixed bugs:**
- Flight ID's and Airport ICAO's not clickable on airport page [\#419](https://github.com/nabeelio/phpvms/issues/419)
- Distance lookup needs bcmath extension [\#407](https://github.com/nabeelio/phpvms/issues/407)
- Missing flight level field on frontend [\#401](https://github.com/nabeelio/phpvms/issues/401)
- Set distance to 0 if no value [\#400](https://github.com/nabeelio/phpvms/issues/400)
- Upload livery via admin [\#398](https://github.com/nabeelio/phpvms/issues/398)
- Block deleting airline if there are assets associated with it [\#367](https://github.com/nabeelio/phpvms/issues/367)
- Cron not calculating number of flights [\#357](https://github.com/nabeelio/phpvms/issues/357)
- Error Seeing data of pilot profile [\#351](https://github.com/nabeelio/phpvms/issues/351)
- Fresh install doesn't create rank [\#346](https://github.com/nabeelio/phpvms/issues/346)
- Fuel cost only allows whole numbers for price [\#342](https://github.com/nabeelio/phpvms/issues/342)
- API calls in subfolder going to root domain [\#339](https://github.com/nabeelio/phpvms/issues/339)
- Errors versión 7.0.0 \(compilación 181025-6f7735\) [\#332](https://github.com/nabeelio/phpvms/issues/332)
- Error on Install [\#303](https://github.com/nabeelio/phpvms/issues/303)
- Having a "Error 505" when trying to install PHPVMS [\#302](https://github.com/nabeelio/phpvms/issues/302)
- Error when viewing profile or trying to add flights [\#291](https://github.com/nabeelio/phpvms/issues/291)
- "Hubs as home airport" doesn't work [\#288](https://github.com/nabeelio/phpvms/issues/288)
- Undocumented Extension Required - PHP 7.2 GMP [\#285](https://github.com/nabeelio/phpvms/issues/285)
- ErrorException Trying to get property 'name' of non-object [\#281](https://github.com/nabeelio/phpvms/issues/281)
**Closed issues:**
- Add settings.yaml changes to update available check [\#437](https://github.com/nabeelio/phpvms/issues/437)
- Write current version to DB [\#428](https://github.com/nabeelio/phpvms/issues/428)
- Message for configuring cron [\#424](https://github.com/nabeelio/phpvms/issues/424)
- Opt in for telemetry on install [\#415](https://github.com/nabeelio/phpvms/issues/415)
- Error when saving a PIREP without filling some fields and attempting to edit it [\#414](https://github.com/nabeelio/phpvms/issues/414)
- Update htaccess file [\#412](https://github.com/nabeelio/phpvms/issues/412)
- Allow typing in drop down menus [\#409](https://github.com/nabeelio/phpvms/issues/409)
- Malformed email error on file [\#402](https://github.com/nabeelio/phpvms/issues/402)
- Residual design issues from Bootstrap update [\#397](https://github.com/nabeelio/phpvms/issues/397)
- Don't allow PIREP cancel if not in PENDING phase [\#395](https://github.com/nabeelio/phpvms/issues/395)
- Pageable Criteria [\#390](https://github.com/nabeelio/phpvms/issues/390)
- Update CSS Libraries [\#387](https://github.com/nabeelio/phpvms/issues/387)
- Laravel 6 [\#384](https://github.com/nabeelio/phpvms/issues/384)
- Profile menu dropdown [\#383](https://github.com/nabeelio/phpvms/issues/383)
- Update vaCentral Library [\#380](https://github.com/nabeelio/phpvms/issues/380)
- Implement Laravel 5.7 Notifications [\#378](https://github.com/nabeelio/phpvms/issues/378)
- Generate random cache prefix on install [\#374](https://github.com/nabeelio/phpvms/issues/374)
- Move transaction/journal code out of controller [\#370](https://github.com/nabeelio/phpvms/issues/370)
- Add Contract for Airport information lookup [\#363](https://github.com/nabeelio/phpvms/issues/363)
- RFC7807 - Standardize API error messages [\#361](https://github.com/nabeelio/phpvms/issues/361)
- Imposible delete bid [\#360](https://github.com/nabeelio/phpvms/issues/360)
- Change theme from settings [\#359](https://github.com/nabeelio/phpvms/issues/359)
- Integration with PACX \[Feature\] [\#338](https://github.com/nabeelio/phpvms/issues/338)
- Why don't you create a free ACARS for PHPVMS7 testing? [\#336](https://github.com/nabeelio/phpvms/issues/336)
- Error add Roles [\#334](https://github.com/nabeelio/phpvms/issues/334)
- Error during installation [\#333](https://github.com/nabeelio/phpvms/issues/333)
- spatie - laravel-backup [\#330](https://github.com/nabeelio/phpvms/issues/330)
- Refactor data seeding [\#329](https://github.com/nabeelio/phpvms/issues/329)
- Notify/download latest version file as part of cron [\#327](https://github.com/nabeelio/phpvms/issues/327)
- Notify if migration/updates are pending [\#326](https://github.com/nabeelio/phpvms/issues/326)
- PIREP ID change [\#318](https://github.com/nabeelio/phpvms/issues/318)
- Missing folders on install [\#316](https://github.com/nabeelio/phpvms/issues/316)
- Pull in VMACars plugin [\#315](https://github.com/nabeelio/phpvms/issues/315)
- Account for fuel in the finances [\#313](https://github.com/nabeelio/phpvms/issues/313)
- Show module in the external website [\#310](https://github.com/nabeelio/phpvms/issues/310)
- Profile picture distorted [\#309](https://github.com/nabeelio/phpvms/issues/309)
- Implement cachable in models [\#307](https://github.com/nabeelio/phpvms/issues/307)
- update [\#305](https://github.com/nabeelio/phpvms/issues/305)
- Error with installer - Permission denied [\#298](https://github.com/nabeelio/phpvms/issues/298)
- No Staff Groups/ Authorised Permissions [\#296](https://github.com/nabeelio/phpvms/issues/296)
- .css and .js 404 [\#294](https://github.com/nabeelio/phpvms/issues/294)
- Error on Install [\#292](https://github.com/nabeelio/phpvms/issues/292)
- Ability to change interval of cron jobs [\#289](https://github.com/nabeelio/phpvms/issues/289)
- ACARS api add response [\#287](https://github.com/nabeelio/phpvms/issues/287)
- No bids returned in json [\#286](https://github.com/nabeelio/phpvms/issues/286)
- Importing \*.csv with special characters [\#282](https://github.com/nabeelio/phpvms/issues/282)
- laravel-theme doesn't seem to be respecting the theme.json extends [\#279](https://github.com/nabeelio/phpvms/issues/279)
- Flight for current location not being restricted [\#263](https://github.com/nabeelio/phpvms/issues/263)
- Self diagnosis [\#253](https://github.com/nabeelio/phpvms/issues/253)
- Add /api/pireps/validate endpoint [\#247](https://github.com/nabeelio/phpvms/issues/247)
- Cosmetic issues [\#245](https://github.com/nabeelio/phpvms/issues/245)
- GDPR Compliance [\#244](https://github.com/nabeelio/phpvms/issues/244)
- Read all settings into the page session [\#243](https://github.com/nabeelio/phpvms/issues/243)
- Open Airspace [\#241](https://github.com/nabeelio/phpvms/issues/241)
- Option to cancel PIREP [\#238](https://github.com/nabeelio/phpvms/issues/238)
- Navdata sources [\#231](https://github.com/nabeelio/phpvms/issues/231)
- Refactor export, use streamed response [\#227](https://github.com/nabeelio/phpvms/issues/227)
- Add expense multiplier to subfleet [\#206](https://github.com/nabeelio/phpvms/issues/206)
- Expenses [\#136](https://github.com/nabeelio/phpvms/issues/136)
- Finances [\#130](https://github.com/nabeelio/phpvms/issues/130)
- phpVMS Classic Importer [\#114](https://github.com/nabeelio/phpvms/issues/114)
- Setup cron tasks [\#95](https://github.com/nabeelio/phpvms/issues/95)
- Warning in admin if Installer module is still present [\#77](https://github.com/nabeelio/phpvms/issues/77)
- flight planning [\#60](https://github.com/nabeelio/phpvms/issues/60)
**Merged pull requests:**
- Merge 7.0.0-beta.2 to master [\#440](https://github.com/nabeelio/phpvms/pull/440)
- Refactor the upgrade pending check to see if there are settings/permi… [\#438](https://github.com/nabeelio/phpvms/pull/438)
- Fixes [\#435](https://github.com/nabeelio/phpvms/pull/435)
- \#406 Refactor bids [\#432](https://github.com/nabeelio/phpvms/pull/432)
- fixes for issue \#419 [\#429](https://github.com/nabeelio/phpvms/pull/429)
- Wrap values in travis env [\#426](https://github.com/nabeelio/phpvms/pull/426)
- Show a message about setting up the cron and if there was an error ru… [\#425](https://github.com/nabeelio/phpvms/pull/425)
- 359 Select theme in settings [\#423](https://github.com/nabeelio/phpvms/pull/423)
- Fix blank aircraft field causing error closes \#414 [\#422](https://github.com/nabeelio/phpvms/pull/422)
- Bundle CSS changes [\#421](https://github.com/nabeelio/phpvms/pull/421)
- Some minor CSS fixes as discussed on Discord [\#420](https://github.com/nabeelio/phpvms/pull/420)
- Move telemetry option into settings; checkbox in install refs \#415 [\#416](https://github.com/nabeelio/phpvms/pull/416)
- Issue fixes [\#413](https://github.com/nabeelio/phpvms/pull/413)
- Catch error messages in notifying [\#403](https://github.com/nabeelio/phpvms/pull/403)
- Design and file upload issues [\#399](https://github.com/nabeelio/phpvms/pull/399)
- Don't allow cancels from certain states [\#396](https://github.com/nabeelio/phpvms/pull/396)
- Fix map checkout call [\#394](https://github.com/nabeelio/phpvms/pull/394)
- 389 API Changes [\#393](https://github.com/nabeelio/phpvms/pull/393)
- CSS Libraries and style updates [\#388](https://github.com/nabeelio/phpvms/pull/388)
- 384 Laravel 6 changes [\#385](https://github.com/nabeelio/phpvms/pull/385)
- 380 vacentral library [\#381](https://github.com/nabeelio/phpvms/pull/381)
- Use Notification/Notifiable [\#379](https://github.com/nabeelio/phpvms/pull/379)
- Add maintenance section to admin, clear caches \#376 [\#377](https://github.com/nabeelio/phpvms/pull/377)
- Refactor all JS API calls \#360 [\#375](https://github.com/nabeelio/phpvms/pull/375)
- Set the baseURL for ajax requests [\#373](https://github.com/nabeelio/phpvms/pull/373)
- Move airline transaction code into service layer [\#371](https://github.com/nabeelio/phpvms/pull/371)
- 229 url for downloads [\#369](https://github.com/nabeelio/phpvms/pull/369)
- \#355 Calculate distance button [\#366](https://github.com/nabeelio/phpvms/pull/366)
- Add Contract interface for airport lookup functionality [\#365](https://github.com/nabeelio/phpvms/pull/365)
- Refactor error handling internally to follow RFC7807 [\#362](https://github.com/nabeelio/phpvms/pull/362)
- Additional logging for the stats recalculation [\#358](https://github.com/nabeelio/phpvms/pull/358)
- Add missing expiry time for PIREP API [\#356](https://github.com/nabeelio/phpvms/pull/356)
- Fix/metar reading [\#354](https://github.com/nabeelio/phpvms/pull/354)
- Fix/metar reading [\#353](https://github.com/nabeelio/phpvms/pull/353)
- Add setting to include transfer hours in calculations [\#350](https://github.com/nabeelio/phpvms/pull/350)
- Remove ext-cal from requirements list [\#349](https://github.com/nabeelio/phpvms/pull/349)
- Multiple ticket crash fixes [\#347](https://github.com/nabeelio/phpvms/pull/347)
- Issue/327 versioning [\#345](https://github.com/nabeelio/phpvms/pull/345)
- Update issue templates [\#344](https://github.com/nabeelio/phpvms/pull/344)
- Add step fields to enable decimal points on fields \#342 [\#343](https://github.com/nabeelio/phpvms/pull/343)
- Issue fixes [\#341](https://github.com/nabeelio/phpvms/pull/341)
- Issue/329 refactor seeding [\#337](https://github.com/nabeelio/phpvms/pull/337)
- Fix issue where user stats aren't incremented on PIREP auto accept [\#335](https://github.com/nabeelio/phpvms/pull/335)
- Account for fuel in the finance calculations \#313 [\#331](https://github.com/nabeelio/phpvms/pull/331)
- Middleware to detect is update is pending; move Routes into HTTP [\#328](https://github.com/nabeelio/phpvms/pull/328)
- Change exporter to use utf-8 close \#282 [\#325](https://github.com/nabeelio/phpvms/pull/325)
- Rename Interfaces to Contracts to better match Laravel conventions [\#323](https://github.com/nabeelio/phpvms/pull/323)
- Cleanup SI Unit classes; METAR fixes [\#322](https://github.com/nabeelio/phpvms/pull/322)
- Bump lodash from 4.17.11 to 4.17.13 [\#321](https://github.com/nabeelio/phpvms/pull/321)
- Update composer library versions [\#320](https://github.com/nabeelio/phpvms/pull/320)
- Add missing folders under storage/public \#316 [\#319](https://github.com/nabeelio/phpvms/pull/319)
- Add interface to additional roles/permissions \#296 [\#314](https://github.com/nabeelio/phpvms/pull/314)
- Fix pax count fields; add fuel used field \#295 [\#312](https://github.com/nabeelio/phpvms/pull/312)
- Apply fixes from StyleCI [\#311](https://github.com/nabeelio/phpvms/pull/311)
- Laravel 5.8 Update [\#308](https://github.com/nabeelio/phpvms/pull/308)
- Add more search criteria/dev environment via docker-compose \#297 [\#306](https://github.com/nabeelio/phpvms/pull/306)
- Add gmp to requirements in install \#285 [\#301](https://github.com/nabeelio/phpvms/pull/301)
- Revert "Update issue templates" [\#300](https://github.com/nabeelio/phpvms/pull/300)
- Update issue templates [\#299](https://github.com/nabeelio/phpvms/pull/299)
## [v7.0.0-beta](https://github.com/nabeelio/phpvms/tree/v7.0.0-beta) (2018-10-25)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/v7.0.0-alpha2...v7.0.0-beta)
**Implemented enhancements:**
- Follow flight checkbox on live map [\#246](https://github.com/nabeelio/phpvms/issues/246)
- PIREP restrictions based on settings [\#221](https://github.com/nabeelio/phpvms/issues/221)
- Save PIREP as draft [\#220](https://github.com/nabeelio/phpvms/issues/220)
- Shorten fields on flights table [\#205](https://github.com/nabeelio/phpvms/issues/205)
- Show bids in profile [\#203](https://github.com/nabeelio/phpvms/issues/203)
- Don't change rank if current rank is higher than the one found [\#196](https://github.com/nabeelio/phpvms/issues/196)
- pagination sizes [\#162](https://github.com/nabeelio/phpvms/issues/162)
- Allow overriding templates [\#161](https://github.com/nabeelio/phpvms/issues/161)
- Replace old pjax library with newer one [\#133](https://github.com/nabeelio/phpvms/issues/133)
- Awards [\#113](https://github.com/nabeelio/phpvms/issues/113)
- Setting to restrict airport selection to hubs [\#104](https://github.com/nabeelio/phpvms/issues/104)
- Pilot leave status [\#96](https://github.com/nabeelio/phpvms/issues/96)
- schedule import [\#15](https://github.com/nabeelio/phpvms/issues/15)
**Fixed bugs:**
- Error saving PIREP [\#252](https://github.com/nabeelio/phpvms/issues/252)
- Updater with modules not working [\#249](https://github.com/nabeelio/phpvms/issues/249)
- User registration country and timezone not saving [\#223](https://github.com/nabeelio/phpvms/issues/223)
- Importer inserts invalid data on empty columns/rows [\#222](https://github.com/nabeelio/phpvms/issues/222)
- Import/export - missing fields [\#219](https://github.com/nabeelio/phpvms/issues/219)
- Country flag not showing on user list [\#218](https://github.com/nabeelio/phpvms/issues/218)
- fares/subfleet unique field blocks saving [\#214](https://github.com/nabeelio/phpvms/issues/214)
- module navigation not working \(admin\) [\#201](https://github.com/nabeelio/phpvms/issues/201)
- Bid not removed when pirep if filled [\#200](https://github.com/nabeelio/phpvms/issues/200)
- Not saving Flight Time [\#199](https://github.com/nabeelio/phpvms/issues/199)
**Closed issues:**
- SettingsController/Repo are saving as "on" instead of 1/true [\#272](https://github.com/nabeelio/phpvms/issues/272)
- Auto Accept New Pilot isn't working [\#269](https://github.com/nabeelio/phpvms/issues/269)
- Suggestion: button to copy aircraft [\#267](https://github.com/nabeelio/phpvms/issues/267)
- Combine aircraft and subfleet import/export into one [\#256](https://github.com/nabeelio/phpvms/issues/256)
- cron - recalculate hours [\#254](https://github.com/nabeelio/phpvms/issues/254)
- Install Directory is missing from git repo [\#251](https://github.com/nabeelio/phpvms/issues/251)
- Warning: require\(C:\xampp\Virtual Airline Website\bootstrap/../vendor/autoload.php\): failed to open stream: No such file or directory in C:\xampp\Virtual Airline Website\bootstrap\autoload.php on line 17 [\#248](https://github.com/nabeelio/phpvms/issues/248)
- Settings [\#239](https://github.com/nabeelio/phpvms/issues/239)
- HTTP caching [\#237](https://github.com/nabeelio/phpvms/issues/237)
- Module artisan command bug [\#234](https://github.com/nabeelio/phpvms/issues/234)
- Add /api/news [\#232](https://github.com/nabeelio/phpvms/issues/232)
- Start date/end date, along with day of week options [\#230](https://github.com/nabeelio/phpvms/issues/230)
- Replace weather lookup [\#228](https://github.com/nabeelio/phpvms/issues/228)
- File/avatar uploads [\#226](https://github.com/nabeelio/phpvms/issues/226)
- Change fleet page to load subfleets first [\#217](https://github.com/nabeelio/phpvms/issues/217)
- Add sort options [\#216](https://github.com/nabeelio/phpvms/issues/216)
- Auto loader on Line 17 [\#215](https://github.com/nabeelio/phpvms/issues/215)
- Add flight fields [\#213](https://github.com/nabeelio/phpvms/issues/213)
- Recaptcha in registration [\#212](https://github.com/nabeelio/phpvms/issues/212)
- Browser tests [\#211](https://github.com/nabeelio/phpvms/issues/211)
- Axios HTTP library [\#210](https://github.com/nabeelio/phpvms/issues/210)
- Replace skinning with laravel-theme [\#209](https://github.com/nabeelio/phpvms/issues/209)
- Refactor getting expenses in FinanceData [\#208](https://github.com/nabeelio/phpvms/issues/208)
- Change all money to hold in cents, not dollars [\#204](https://github.com/nabeelio/phpvms/issues/204)
- Pilot pay - rank base and subfleet multiplier [\#197](https://github.com/nabeelio/phpvms/issues/197)
- Flight schedule importer/exporter [\#194](https://github.com/nabeelio/phpvms/issues/194)
- use find/replace in bootstrapWith\(\) call [\#163](https://github.com/nabeelio/phpvms/issues/163)
- Awards [\#155](https://github.com/nabeelio/phpvms/issues/155)
- System Changes/Additions [\#135](https://github.com/nabeelio/phpvms/issues/135)
- Airport & Aircraft Changes [\#134](https://github.com/nabeelio/phpvms/issues/134)
- Handle flight specific fares & multipliers [\#125](https://github.com/nabeelio/phpvms/issues/125)
- Flight set day of week [\#122](https://github.com/nabeelio/phpvms/issues/122)
- Airport page [\#85](https://github.com/nabeelio/phpvms/issues/85)
- Bulk upload charts to airport [\#84](https://github.com/nabeelio/phpvms/issues/84)
- Pull some values from existing .env file [\#79](https://github.com/nabeelio/phpvms/issues/79)
- METAR Information [\#61](https://github.com/nabeelio/phpvms/issues/61)
- flights page [\#57](https://github.com/nabeelio/phpvms/issues/57)
- fuel costs to airports and fuel type on subfleet [\#41](https://github.com/nabeelio/phpvms/issues/41)
- generate aircraft hex code on create [\#33](https://github.com/nabeelio/phpvms/issues/33)
**Merged pull requests:**
- More acceptable translation to opt-in \(es\) [\#284](https://github.com/nabeelio/phpvms/pull/284)
- Fix 404s to requirements/setup in README.md [\#283](https://github.com/nabeelio/phpvms/pull/283)
- Hide expired live flight from live map and remove from DB [\#280](https://github.com/nabeelio/phpvms/pull/280)
- \[WIP\] Laravel 5.7 Update [\#278](https://github.com/nabeelio/phpvms/pull/278)
- Make admin input outline darker [\#276](https://github.com/nabeelio/phpvms/pull/276)
- capture & display pilot transfer hours [\#275](https://github.com/nabeelio/phpvms/pull/275)
- Optimize query with eager loading [\#274](https://github.com/nabeelio/phpvms/pull/274)
- Fix SettingsController saving boolean value as 'on' [\#273](https://github.com/nabeelio/phpvms/pull/273)
- Hide inactive pilot from pilot list page [\#271](https://github.com/nabeelio/phpvms/pull/271)
- Fix flight search restriction [\#270](https://github.com/nabeelio/phpvms/pull/270)
- Apply fixes from StyleCI [\#268](https://github.com/nabeelio/phpvms/pull/268)
- Fix METAR issue [\#264](https://github.com/nabeelio/phpvms/pull/264)
- Apply fixes from StyleCI [\#262](https://github.com/nabeelio/phpvms/pull/262)
- Apply fixes from StyleCI [\#261](https://github.com/nabeelio/phpvms/pull/261)
- Enable eager loading [\#259](https://github.com/nabeelio/phpvms/pull/259)
- Implement cron to remove expired bids [\#258](https://github.com/nabeelio/phpvms/pull/258)
- Fix timezone list HTML Escaped [\#257](https://github.com/nabeelio/phpvms/pull/257)
- Update 07/13/2018 es-translations [\#255](https://github.com/nabeelio/phpvms/pull/255)
- ES translation [\#250](https://github.com/nabeelio/phpvms/pull/250)
- flights filtered per va [\#242](https://github.com/nabeelio/phpvms/pull/242)
- Avatar Issue [\#236](https://github.com/nabeelio/phpvms/pull/236)
- Install bug [\#235](https://github.com/nabeelio/phpvms/pull/235)
## [v7.0.0-alpha2](https://github.com/nabeelio/phpvms/tree/v7.0.0-alpha2) (2018-02-23)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/v7.0.0-alpha1...v7.0.0-alpha2)
**Implemented enhancements:**
- Get user PIREPs [\#192](https://github.com/nabeelio/phpvms/issues/192)
- Use time conversion class [\#190](https://github.com/nabeelio/phpvms/issues/190)
- Require inputs in Imperial units [\#189](https://github.com/nabeelio/phpvms/issues/189)
- Make planned\_distance in prefile optional [\#185](https://github.com/nabeelio/phpvms/issues/185)
- If there's no /pirep/route calls, when it's filed, write the route [\#184](https://github.com/nabeelio/phpvms/issues/184)
- Create a /api/flight/{id}/route call [\#183](https://github.com/nabeelio/phpvms/issues/183)
- Make all APIs behind auth [\#173](https://github.com/nabeelio/phpvms/issues/173)
- Add bid [\#172](https://github.com/nabeelio/phpvms/issues/172)
- Setting for only showing aircraft that are at the departure airport [\#171](https://github.com/nabeelio/phpvms/issues/171)
- Font for input [\#169](https://github.com/nabeelio/phpvms/issues/169)
- Read default value from settings table [\#106](https://github.com/nabeelio/phpvms/issues/106)
**Fixed bugs:**
- Volume units to lbs/kg, not gal/liter [\#193](https://github.com/nabeelio/phpvms/issues/193)
- Add country to airline missing [\#191](https://github.com/nabeelio/phpvms/issues/191)
- SKIN\_NAME missing on error pages [\#187](https://github.com/nabeelio/phpvms/issues/187)
- Airport timezone not being saved [\#182](https://github.com/nabeelio/phpvms/issues/182)
- Rank checkboxes not being saved [\#181](https://github.com/nabeelio/phpvms/issues/181)
- Make sure cancelled PIREPs don't show [\#180](https://github.com/nabeelio/phpvms/issues/180)
- Ignore cancelled PIREPs in duplicate check [\#179](https://github.com/nabeelio/phpvms/issues/179)
- Make sure all fields are returned in PIREP object [\#178](https://github.com/nabeelio/phpvms/issues/178)
- autopopulate SOURCE field in ACARS [\#177](https://github.com/nabeelio/phpvms/issues/177)
- Make sure pireps.restrict\_aircraft\_to\_rank is respected [\#170](https://github.com/nabeelio/phpvms/issues/170)
- Don't change rank if current rank is non-auto promoting [\#168](https://github.com/nabeelio/phpvms/issues/168)
- PIREP hours can't be changed [\#167](https://github.com/nabeelio/phpvms/issues/167)
- Changing a flight status does not save [\#150](https://github.com/nabeelio/phpvms/issues/150)
- Additional PIREP fields don't save correctly [\#146](https://github.com/nabeelio/phpvms/issues/146)
**Closed issues:**
- Cleanup icons [\#195](https://github.com/nabeelio/phpvms/issues/195)
- remove raw\_data field from pirep table [\#188](https://github.com/nabeelio/phpvms/issues/188)
- Remove Resource::withoutWrapping\(\) to follow jsonapi spec [\#186](https://github.com/nabeelio/phpvms/issues/186)
- Add an `artisan phpvms:dev-install` command [\#176](https://github.com/nabeelio/phpvms/issues/176)
- Pagination settings [\#175](https://github.com/nabeelio/phpvms/issues/175)
- Implement setting for flights at pilot's current airport [\#174](https://github.com/nabeelio/phpvms/issues/174)
- Minimum PHP supported version to 7.1 [\#166](https://github.com/nabeelio/phpvms/issues/166)
- Update to Laravel 5.6 [\#165](https://github.com/nabeelio/phpvms/issues/165)
- Updater [\#164](https://github.com/nabeelio/phpvms/issues/164)
- Allow adding rank in subfleet page [\#160](https://github.com/nabeelio/phpvms/issues/160)
- Docs [\#153](https://github.com/nabeelio/phpvms/issues/153)
## [v7.0.0-alpha1](https://github.com/nabeelio/phpvms/tree/v7.0.0-alpha1) (2018-02-04)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/f158c11dea7c0a4af27c93382333b67fdc531e3a...v7.0.0-alpha1)
**Implemented enhancements:**
- Widgetized components [\#127](https://github.com/nabeelio/phpvms/issues/127)
- Set aircraft location on landing [\#112](https://github.com/nabeelio/phpvms/issues/112)
- save user IP on login [\#110](https://github.com/nabeelio/phpvms/issues/110)
- When rejecting PIREP, add a comment/reason [\#107](https://github.com/nabeelio/phpvms/issues/107)
- Check for duplicate PIREPs and add setting [\#105](https://github.com/nabeelio/phpvms/issues/105)
- create vendor.js with webpack [\#91](https://github.com/nabeelio/phpvms/issues/91)
- move from bower to webpack [\#90](https://github.com/nabeelio/phpvms/issues/90)
- Pilots list and profile [\#82](https://github.com/nabeelio/phpvms/issues/82)
- pirep auto-accept for certain rankings [\#24](https://github.com/nabeelio/phpvms/issues/24)
- Investigate removing the Repository pattern to simplify [\#6](https://github.com/nabeelio/phpvms/issues/6)
**Fixed bugs:**
- Error when sending /api/pireps/prefile [\#149](https://github.com/nabeelio/phpvms/issues/149)
- Extra numbers on flights page [\#148](https://github.com/nabeelio/phpvms/issues/148)
- Unable to select any aircraft from fleet on file PIREP page [\#147](https://github.com/nabeelio/phpvms/issues/147)
- Error thrown when editing a saved flight [\#145](https://github.com/nabeelio/phpvms/issues/145)
- When you delete flight from admin, filed pirep will throw error [\#144](https://github.com/nabeelio/phpvms/issues/144)
- Avoid calling MySQL executable for creating database [\#132](https://github.com/nabeelio/phpvms/issues/132)
- Aircraft can be added without specifying a subfleet [\#128](https://github.com/nabeelio/phpvms/issues/128)
- Non error flash messages not showing [\#126](https://github.com/nabeelio/phpvms/issues/126)
- Removing subfleet from flight [\#124](https://github.com/nabeelio/phpvms/issues/124)
- User still has API access if they're not ACTIVE [\#119](https://github.com/nabeelio/phpvms/issues/119)
- Delete bids when flight is deleted [\#103](https://github.com/nabeelio/phpvms/issues/103)
- JSON error messages [\#92](https://github.com/nabeelio/phpvms/issues/92)
- add subfleet to flight broken [\#88](https://github.com/nabeelio/phpvms/issues/88)
- logout functionality not working from frontpage [\#26](https://github.com/nabeelio/phpvms/issues/26)
**Closed issues:**
- `fuel\_used` in pirep/file [\#159](https://github.com/nabeelio/phpvms/issues/159)
- Add additional fields for PIREP and flights [\#158](https://github.com/nabeelio/phpvms/issues/158)
- Stub file [\#157](https://github.com/nabeelio/phpvms/issues/157)
- Add config.php in root on install [\#156](https://github.com/nabeelio/phpvms/issues/156)
- New registrations are auto-accepted and put as active [\#151](https://github.com/nabeelio/phpvms/issues/151)
- new version alert [\#143](https://github.com/nabeelio/phpvms/issues/143)
- Footer copyright text [\#142](https://github.com/nabeelio/phpvms/issues/142)
- Version build number to use string/assigned date [\#141](https://github.com/nabeelio/phpvms/issues/141)
- Handle duplicate flight number [\#139](https://github.com/nabeelio/phpvms/issues/139)
- Restrict shown aircraft to user's rank [\#138](https://github.com/nabeelio/phpvms/issues/138)
- Docs [\#137](https://github.com/nabeelio/phpvms/issues/137)
- Checksum for tarball [\#123](https://github.com/nabeelio/phpvms/issues/123)
- API Items need [\#120](https://github.com/nabeelio/phpvms/issues/120)
- ACARS API [\#118](https://github.com/nabeelio/phpvms/issues/118)
- List of cron jobs required [\#117](https://github.com/nabeelio/phpvms/issues/117)
- Add create/edit fields for columns [\#111](https://github.com/nabeelio/phpvms/issues/111)
- Add PIREP cancel endpoint and cleanup job [\#109](https://github.com/nabeelio/phpvms/issues/109)
- ACARS table should save the route [\#102](https://github.com/nabeelio/phpvms/issues/102)
- /api/fleet and /api/user/fleet [\#101](https://github.com/nabeelio/phpvms/issues/101)
- Assign subfleets to ranks [\#100](https://github.com/nabeelio/phpvms/issues/100)
- show dates/times in proper timezone [\#97](https://github.com/nabeelio/phpvms/issues/97)
- editable fields not working [\#94](https://github.com/nabeelio/phpvms/issues/94)
- Settings page needs to be completed [\#93](https://github.com/nabeelio/phpvms/issues/93)
- Airport page pagination & search [\#87](https://github.com/nabeelio/phpvms/issues/87)
- Mark airport as hub [\#86](https://github.com/nabeelio/phpvms/issues/86)
- Terms and Conditions & COPPA during registration [\#81](https://github.com/nabeelio/phpvms/issues/81)
- Look at alternative to Entrust [\#78](https://github.com/nabeelio/phpvms/issues/78)
- Check if .env file exists in installer [\#76](https://github.com/nabeelio/phpvms/issues/76)
- upload travis artifact to phpvms ftp as "latest.zip" [\#75](https://github.com/nabeelio/phpvms/issues/75)
- Track hours on airframes [\#73](https://github.com/nabeelio/phpvms/issues/73)
- PIREP accept/reject in admin should call PIREP service [\#72](https://github.com/nabeelio/phpvms/issues/72)
- Error with MySQL syntax when creating database. [\#71](https://github.com/nabeelio/phpvms/issues/71)
- pirep comments [\#70](https://github.com/nabeelio/phpvms/issues/70)
- findWithoutFail Method does not exist [\#69](https://github.com/nabeelio/phpvms/issues/69)
- Commit error 403 [\#67](https://github.com/nabeelio/phpvms/issues/67)
- Keep Showing 404.... [\#66](https://github.com/nabeelio/phpvms/issues/66)
- wrap migrate command [\#65](https://github.com/nabeelio/phpvms/issues/65)
- Create 404 page [\#63](https://github.com/nabeelio/phpvms/issues/63)
- link to admin in nav if you have permissions [\#62](https://github.com/nabeelio/phpvms/issues/62)
- Error while creating database [\#56](https://github.com/nabeelio/phpvms/issues/56)
- shared hosting stuff [\#55](https://github.com/nabeelio/phpvms/issues/55)
- gravatar url for profile [\#54](https://github.com/nabeelio/phpvms/issues/54)
- news and notams module [\#52](https://github.com/nabeelio/phpvms/issues/52)
- try atoum vs phpunit [\#51](https://github.com/nabeelio/phpvms/issues/51)
- Cache Airports calls [\#49](https://github.com/nabeelio/phpvms/issues/49)
- add custom fields table for flights [\#48](https://github.com/nabeelio/phpvms/issues/48)
- Events system [\#43](https://github.com/nabeelio/phpvms/issues/43)
- add fuel costs types to the airports table [\#40](https://github.com/nabeelio/phpvms/issues/40)
- adjust "created" date for airline [\#39](https://github.com/nabeelio/phpvms/issues/39)
- add gross\_weight to PIREPs [\#38](https://github.com/nabeelio/phpvms/issues/38)
- subfleet to flight pivot values [\#37](https://github.com/nabeelio/phpvms/issues/37)
- API authentication/middleware [\#36](https://github.com/nabeelio/phpvms/issues/36)
- REST API [\#35](https://github.com/nabeelio/phpvms/issues/35)
- use uuids on a few tables [\#34](https://github.com/nabeelio/phpvms/issues/34)
- subfleet \(ranks, expenses\) [\#32](https://github.com/nabeelio/phpvms/issues/32)
- How to install this? [\#31](https://github.com/nabeelio/phpvms/issues/31)
- experiment with changing PDO mode [\#30](https://github.com/nabeelio/phpvms/issues/30)
- forgot password [\#27](https://github.com/nabeelio/phpvms/issues/27)
- rankings [\#23](https://github.com/nabeelio/phpvms/issues/23)
- module system [\#22](https://github.com/nabeelio/phpvms/issues/22)
- pireps [\#21](https://github.com/nabeelio/phpvms/issues/21)
- admin user management [\#20](https://github.com/nabeelio/phpvms/issues/20)
- modify DatabaseSeeder to look at env [\#19](https://github.com/nabeelio/phpvms/issues/19)
- look at flarum method of install [\#18](https://github.com/nabeelio/phpvms/issues/18)
- navdata ingestion [\#17](https://github.com/nabeelio/phpvms/issues/17)
- settings panel [\#16](https://github.com/nabeelio/phpvms/issues/16)
- routing and scheduling [\#14](https://github.com/nabeelio/phpvms/issues/14)
- airport details page [\#13](https://github.com/nabeelio/phpvms/issues/13)
- currency format config [\#12](https://github.com/nabeelio/phpvms/issues/12)
- aircraft details page [\#11](https://github.com/nabeelio/phpvms/issues/11)
- user dashboard and profile pages [\#10](https://github.com/nabeelio/phpvms/issues/10)
- admin panel work [\#9](https://github.com/nabeelio/phpvms/issues/9)
- theme/skins engine [\#8](https://github.com/nabeelio/phpvms/issues/8)
- Integrate roles and permissions [\#7](https://github.com/nabeelio/phpvms/issues/7)
- rebuild tables [\#5](https://github.com/nabeelio/phpvms/issues/5)
- front-end template [\#4](https://github.com/nabeelio/phpvms/issues/4)
- Laravel 5.4 [\#3](https://github.com/nabeelio/phpvms/issues/3)
- look up role-based permissions [\#2](https://github.com/nabeelio/phpvms/issues/2)
- installer [\#1](https://github.com/nabeelio/phpvms/issues/1)
**Merged pull requests:**
- Fixed a few field entries [\#116](https://github.com/nabeelio/phpvms/pull/116)
- Remove unique email entry [\#115](https://github.com/nabeelio/phpvms/pull/115)
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

35
Dockerfile Normal file
View File

@@ -0,0 +1,35 @@
FROM php:8.1-fpm-alpine3.15
WORKDIR /var/www/
# Setup composer
COPY --from=composer:2.2.7 /usr/bin/composer /usr/local/bin/composer
RUN apk add gmp-dev icu-dev zlib-dev libpng-dev libzip-dev zip
# Copy any config files in
COPY resources/docker/php/ext-opcache.ini $PHP_INI_DIR/conf.d/
COPY resources/docker/php/www.conf /usr/local/etc/php-fpm.d/www.conf
RUN docker-php-ext-install \
calendar \
intl \
pdo_mysql \
gd \
gmp \
bcmath \
opcache \
zip && \
docker-php-ext-enable pdo_mysql opcache bcmath zip intl
COPY . /var/www/
RUN composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
#RUN chown -R www-data:www-data /var/www
EXPOSE 9000

View File

@@ -1,5 +1,3 @@
BSD 3-Clause License
Copyright (c) 2017, phpvms - http://www.phpvms.net
All rights reserved.
@@ -17,6 +15,9 @@ modification, are permitted provided that the following conditions are met:
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
* A "powered by phpvms" is required in page footers, unless the license has
purchased to omit it.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

View File

@@ -19,7 +19,7 @@ clean:
@php artisan view:clear
@find bootstrap/cache -type f -not -name '.gitignore' -print0 | xargs -0 rm -rf
@find storage/framework/cache/ -mindepth 1 -not -name '.gitignore' -print0 | xargs -0 rm -rf
@find storage/framework/cache/ -mindepth 1 -type f -not -name '.gitignore' -print0 | xargs -0 rm -rf
@find storage/framework/sessions/ -mindepth 1 -type f -not -name '.gitignore' -print0 | xargs -0 rm -rf
@find storage/framework/views/ -mindepth 1 -not -name '.gitignore' -print0 | xargs -0 rm -rf
@@ -43,7 +43,7 @@ build:
# This is to build all the stylesheets, etc
.PHONY: build-assets
build-assets:
yarn run production
npm run production
.PHONY: install
install: build
@@ -75,16 +75,12 @@ tests: test
.PHONY: test
test:
#php artisan database:create --reset
vendor/bin/phpunit --debug --verbose
@#php artisan database:create --reset
@vendor/bin/phpunit --verbose
.PHONY: phpcs
phpcs:
@vendor/bin/php-cs-fixer fix --config=.php_cs -v --diff --dry-run
#.PHONY: phpstan
#phpstan:
# vendor/bin/phpstan analyse -c phpstan.neon -v --level 2 app
@PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --dry-run --diff --using-cache=no
.PHONY: replay-acars
replay-acars:
@@ -95,11 +91,6 @@ replay-acars:
sass-watch:
sass --watch public/assets/admin/sass/paper-dashboard.scss:public/assets/admin/css/paper-dashboard.css
.PHONY: schema
schema:
#php artisan infyom:scaffold Aircraft --fieldsFile=database/schema/aircraft.json
echo ""
.PHONY: deploy-package
deploy-package:
./.travis/deploy_script.sh
@@ -109,17 +100,9 @@ reset-installer:
@php artisan database:create --reset
@php artisan migrate:refresh --seed
.PHONY: docker
docker:
@mkdir -p $(CURR_PATH)/tmp/mysql
-docker rm -f phpvms
docker build -t phpvms .
docker run --name=phpvms \
-v $(CURR_PATH):/var/www/ \
-v $(CURR_PATH)/tmp/mysql:/var/lib/mysql \
-p 8080:80 \
phpvms
.PHONY: docker-test
docker-test:
@docker compose -f docker-compose.dev.yml up
.PHONY: docker-clean
docker-clean:

View File

@@ -1,20 +1,17 @@
# phpvms <sup>7</sup>
# phpVMS <sup>7</sup>
[![Build Status](https://travis-ci.org/nabeelio/phpvms.svg)](https://travis-ci.org/nabeelio/phpvms) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d668bebb0a3c46bda381af16ce3d9450)](https://www.codacy.com/app/nabeelio/phpvms?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=nabeelio/phpvms&amp;utm_campaign=Badge_Grade) [![Latest Stable Version](https://poser.pugx.org/nabeel/phpvms/v/stable)](https://packagist.org/packages/nabeel/phpvms) ![StyleCI](https://github.styleci.io/repos/93688482/shield?branch=dev) [![License](https://poser.pugx.org/nabeel/phpvms/license)](https://packagist.org/packages/nabeel/phpvms)
[![Build](https://github.com/nabeelio/phpvms/workflows/Build/badge.svg?branch=dev)](https://github.com/nabeelio/phpvms/actions) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d668bebb0a3c46bda381af16ce3d9450)](https://www.codacy.com/app/nabeelio/phpvms?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=nabeelio/phpvms&amp;utm_campaign=Badge_Grade) [![Latest Stable Version](https://poser.pugx.org/nabeel/phpvms/v/stable)](https://packagist.org/packages/nabeel/phpvms) ![StyleCI](https://github.styleci.io/repos/93688482/shield?branch=dev) [![License](https://poser.pugx.org/nabeel/phpvms/license)](https://packagist.org/packages/nabeel/phpvms)
The next phpvms version built on the laravel framework. work in progress. The latest documentation, with installation instructions is available
[on the phpVMS documentation](http://docs.phpvms.net/) page.
The next phpvms version built on the laravel framework. work in progress. The latest documentation, with installation instructions is available [on the phpVMS documentation](https://docs.phpvms.net/) page.
# installation
## Installation
A full distribution, with all of the composer dependencies, is available at this
[GitHub Releases](https://github.com/nabeelio/phpvms/releases) link.
### Requirements
## Requirements
- PHP 7.1+, extensions:
- PHP 8.0+, extensions:
- cURL
- JSON
- mbstring
@@ -24,24 +21,25 @@ A full distribution, with all of the composer dependencies, is available at this
- Database:
- MySQL 5.5+ (or MySQL variant, including MariaDB and Percona)
[View more details on requirements](http://docs.phpvms.net/setup/requirements)
[View more details on requirements](https://docs.phpvms.net/requirements)
## Installer
### Installer
1. Upload to your server
1. Visit the site, and follow the link to the installer
[View installation details](http://docs.phpvms.net/setup/installation)
[View installation details](https://docs.phpvms.net/installation/installation)
# development environment
## Development Environment with Docker
A full development environment can be brought up using Docker:
A full development environment can be brought up using Docker, without having to install composer/npm locally
```bash
composer install
yarn install
docker-compose build
docker-compose up
make docker-test
# **OR** with docker-compose directly
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
```
Then go to `http://localhost`. If you're using dnsmasq, the `app` container is listening on `phpvms.test`, or you can add to your `/etc/hosts` file:
@@ -50,7 +48,9 @@ Then go to `http://localhost`. If you're using dnsmasq, the `app` container is l
127.0.0.1 phpvms.test
```
## Building JS/CSS assets
The `docker-compose.local.yml` overrides the `app` section in `docker-compose.yml`. The standard `docker-compose.yml` can be used if you want to deploy from the image, or as a template for your own Dockerized deployments.
### Building JS/CSS assets
Yarn is required, run:

View File

@@ -5,13 +5,11 @@ namespace App\Bootstrap;
use Illuminate\Contracts\Config\Repository as RepositoryContract;
use Illuminate\Contracts\Foundation\Application;
/**
* Class LoadConfiguration
*/
class LoadConfiguration extends \Illuminate\Foundation\Bootstrap\LoadConfiguration
{
/**
* Load the configuration items from all of the files.
* Load the configuration items from all of the files. This reads the config.php from
* that's sitting in the root, and then recursively merges it with the current configs
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Contracts\Config\Repository $repository

View File

@@ -3,7 +3,7 @@
namespace App\Console\Commands;
use App\Contracts\Command;
use App\Facades\Utils;
use App\Support\Units\Time;
use GuzzleHttp\Client;
use Illuminate\Database\Eloquent\Collection;
@@ -17,25 +17,25 @@ class AcarsReplay extends Command
*
* @var string
*/
protected $apiKey = 'testadminapikey';
protected string $apiKey = 'testadminapikey';
/**
* For automatic updates, how many seconds to sleep between updates
*
* @var int
*/
protected $sleepTime = 10;
protected int $sleepTime = 10;
/**
* @var array key == update[callsign]
* value == PIREP ID
*/
protected $pirepList = [];
protected array $pirepList = [];
/**
* @var Client
*/
protected $httpClient;
protected Client $httpClient;
/**
* Return an instance of an HTTP client all ready to post
@@ -64,7 +64,7 @@ class AcarsReplay extends Command
protected function startPirep($flight): string
{
// convert the planned flight time to be completely in minutes
$pft = Utils::hoursToMinutes(
$pft = Time::hoursToMinutes(
$flight->planned_hrsenroute,
$flight->planned_minenroute
);

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Console\Commands;
use App\Contracts\Command;
use Nwidart\Modules\Facades\Module;
class ClearCaches extends Command
{
protected $signature = 'phpvms:caches';
protected $description = 'Clear all caches';
/**
* {@inheritdoc}
*/
public function handle()
{
self::clearCaches();
}
public static function clearCaches()
{
self::clearBootstrapCache();
self::clearModuleCache();
}
/**
* Clear the bootstrap/cache dir
*/
private static function clearBootstrapCache()
{
}
/**
* Rescan for new modules
*/
private static function clearModuleCache()
{
Module::scan();
}
}

View File

@@ -0,0 +1,95 @@
<?php
namespace App\Console\Commands;
use App\Contracts\Command;
use App\Services\Installer\ConfigService;
use App\Services\Installer\SeederService;
use DatabaseSeeder;
use Illuminate\Support\Facades\App;
/**
* Create the config files
*/
class CreateConfigs extends Command
{
protected $signature = 'phpvms:config {db_host} {db_name} {db_user} {db_pass}';
protected $description = 'Create the config files';
private DatabaseSeeder $databaseSeeder;
private SeederService $seederSvc;
public function __construct(DatabaseSeeder $databaseSeeder, SeederService $seederSvc)
{
parent::__construct();
$this->databaseSeeder = $databaseSeeder;
$this->seederSvc = $seederSvc;
}
/**
* Run dev related commands
*
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
*/
public function handle()
{
$this->writeConfigs();
// Reload the configuration
App::boot();
$this->info('Recreating database');
$this->call('database:create', [
'--reset' => true,
]);
$this->info('Running migrations');
$this->call('migrate:fresh', [
'--seed' => true,
]);
$this->seederSvc->syncAllSeeds();
$this->info('Done!');
}
/**
* Rewrite the configuration files
*
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
*/
protected function writeConfigs()
{
/** @var ConfigService $cfgSvc */
$cfgSvc = app(ConfigService::class);
$this->info('Removing the old config files');
// Remove the old files
$config_file = base_path('config.php');
if (file_exists($config_file)) {
unlink($config_file);
}
$env_file = base_path('env.php');
if (file_exists($env_file)) {
unlink($env_file);
}
//{name} {db_host} {db_name} {db_user} {db_pass}
$this->info('Regenerating the config files');
$cfgSvc->createConfigFiles([
'APP_ENV' => 'dev',
'SITE_NAME' => $this->argument('name'),
'DB_CONNECTION' => 'mysql',
'DB_HOST' => $this->argument('db_host'),
'DB_DATABASE' => $this->argument('db_name'),
'DB_USERNAME' => $this->argument('db_user'),
'DB_PASSWORD' => $this->argument('db_pass'),
]);
$this->info('Config files generated!');
}
}

View File

@@ -2,15 +2,20 @@
namespace App\Console\Commands;
use App\Console\Services\Database;
use App\Contracts\Command;
use Illuminate\Support\Facades\Log;
use Tivie\OS\Detector;
class CreateDatabase extends Command
{
protected $signature = 'database:create {--reset} {--conn=?}';
protected $signature = 'database:create {--reset} {--migrate} {--conn=?}';
protected $description = 'Create a database';
protected $os;
/**
* @var Detector
*/
protected Detector $os;
/**
* CreateDatabase constructor.
@@ -36,8 +41,7 @@ class CreateDatabase extends Command
$user = config($dbkey.'username');
$pass = config($dbkey.'password');
$dbSvc = new \App\Console\Services\Database();
$dbSvc = new Database();
$dsn = $dbSvc->createDsn($host, $port);
Log::info('Connection string: '.$dsn);
@@ -79,21 +83,29 @@ class CreateDatabase extends Command
*/
protected function create_sqlite($dbkey)
{
$dbPath = config($dbkey.'database');
// Skip if running in memory
if ($dbPath === ':memory:') {
return;
}
$exec = 'sqlite3';
if ($this->os->isWindowsLike()) {
$exec = 'sqlite3.exe';
}
if ($this->option('reset') === true) {
$cmd = ['rm', '-rf', config($dbkey.'database')];
$this->runCommand($cmd);
if (file_exists($dbPath)) {
unlink(config($dbkey.'database'));
}
}
if (!file_exists(config($dbkey.'database'))) {
if (!file_exists($dbPath)) {
$cmd = [
$exec,
config($dbkey.'database'),
'""',
$dbPath,
'".exit"',
];
$this->runCommand($cmd);

View File

@@ -7,6 +7,7 @@ use App\Models\Acars;
use App\Models\Airline;
use App\Models\Pirep;
use App\Models\User;
use App\Notifications\Messages\UserRegistered;
use App\Repositories\AcarsRepository;
use App\Services\AirportService;
use App\Services\AwardService;
@@ -23,7 +24,8 @@ class DevCommands extends Command
{
protected $signature = 'phpvms {cmd} {param?}';
protected $description = 'Developer commands';
protected $dbSvc;
protected DatabaseService $dbSvc;
/**
* DevCommands constructor.
@@ -60,6 +62,7 @@ class DevCommands extends Command
'metar' => 'getMetar',
'recalculate-stats' => 'recalculateStats',
'reset-install' => 'resetInstall',
'new-user-email' => 'newUserEmail',
'xml-to-yaml' => 'xmlToYaml',
];
@@ -290,6 +293,16 @@ class DevCommands extends Command
$this->info('Done!');
}
/**
* Test sending a user a registered email
*/
protected function newUserEmail()
{
$user_id = $this->argument('param');
$user = User::find($user_id);
$user->notify(new UserRegistered($user));
}
public function liveFlights(): void
{
$acarsRepo = app(AcarsRepository::class);

View File

@@ -3,7 +3,7 @@
namespace App\Console\Commands;
use App\Contracts\Command;
use Modules\Installer\Services\ConfigService;
use App\Services\Installer\ConfigService;
/**
* Create a fresh development install
@@ -13,7 +13,7 @@ class DevInstall extends Command
protected $signature = 'phpvms:dev-install {--reset-db} {--reset-configs}';
protected $description = 'Run a developer install and run the sample migration';
private $databaseSeeder;
private \DatabaseSeeder $databaseSeeder;
public function __construct(\DatabaseSeeder $databaseSeeder)
{
@@ -79,9 +79,9 @@ class DevInstall extends Command
$this->info('Regenerating the config files');
$cfgSvc->createConfigFiles([
'APP_ENV' => 'dev',
'SITE_NAME' => 'phpvms test',
'DB_CONN' => 'sqlite',
'APP_ENV' => 'dev',
'SITE_NAME' => 'phpvms test',
'DB_CONNECTION' => 'sqlite',
]);
$this->info('Config files generated!');

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Console\Commands;
use App;
use App\Contracts\Command;
class EmailTest extends Command
{
protected $signature = 'phpvms:email-test';
protected $description = 'Send a test notification to admins';
/**
* Run dev related commands
*
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
*/
public function handle()
{
/** @var App\Notifications\NotificationEventsHandler $eventHandler */
$eventHandler = app(App\Notifications\NotificationEventsHandler::class);
$news = new App\Models\News();
$news->user_id = 1;
$news->subject = 'Test News';
$news->body = 'Test Body';
$news->save();
$newsEvent = new App\Events\NewsAdded($news);
$eventHandler->onNewsAdded($newsEvent);
}
}

View File

@@ -10,7 +10,7 @@ class ImportCsv extends Command
protected $signature = 'phpvms:csv-import {type} {file}';
protected $description = 'Import from a CSV file';
private $importer;
private ImportService $importer;
/**
* Import constructor.

View File

@@ -3,8 +3,10 @@
namespace App\Console\Commands;
use App\Contracts\Command;
use App\Services\ImporterService;
use Illuminate\Support\Facades\Log;
class ImportFromClassic extends Command
class ImportFromClassicCommand extends Command
{
protected $signature = 'phpvms:importer {db_host} {db_name} {db_user} {db_pass?} {table_prefix=phpvms_}';
protected $description = 'Import from an older version of phpVMS';
@@ -14,7 +16,7 @@ class ImportFromClassic extends Command
*/
public function handle()
{
$db_creds = [
$creds = [
'host' => $this->argument('db_host'),
'name' => $this->argument('db_name'),
'user' => $this->argument('db_user'),
@@ -22,7 +24,17 @@ class ImportFromClassic extends Command
'table_prefix' => $this->argument('table_prefix'),
];
$importerSvc = new \App\Console\Services\Importer($db_creds);
$importerSvc->run();
$importerSvc = new ImporterService();
$importerSvc->saveCredentials($creds);
$manifest = $importerSvc->generateImportManifest();
foreach ($manifest as $record) {
try {
$importerSvc->run($record['importer'], $record['start']);
} catch (\Exception $e) {
Log::error($e->getMessage());
}
}
}
}

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Console\Commands;
use App\Contracts\Command;
use Illuminate\Support\Facades\DB;
use Symfony\Component\Yaml\Yaml;
class PirepExport extends Command
{
protected $signature = 'phpvms:pirep-export {id}';
protected $description = 'PIREP table export';
/**
* Run dev related commands
*/
public function handle()
{
$pirep_id = $this->argument('id');
if (empty($pirep_id)) {
$this->error('No PIREP ID specified');
exit();
}
// List the tables to export and the column name for the pirep id
$tables = [
'pireps' => 'id',
'acars' => 'pirep_id',
'pirep_comments' => 'pirep_id',
'pirep_fares' => 'pirep_id',
'pirep_field_values' => 'pirep_id',
'expenses' => 'ref_model_id',
'journal_transactions' => 'ref_model_id',
];
$export_tables = [];
foreach ($tables as $table => $key) {
$export_tables[$table] = [];
$rows = DB::table($table)
->where($key, '=', $pirep_id)
->get();
foreach ($rows as $row) {
$export_tables[$table][] = (array) $row;
}
}
$yaml = Yaml::dump($export_tables, 4, 2);
echo $yaml;
}
}

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Console\Commands;
use App;
use App\Contracts\Command;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
class ProcessQueue extends Command
{
protected $signature = 'queue:cron';
protected $description = 'Process the queue from a cron job';
/**
* Run the queue tasks
*/
public function handle()
{
Artisan::call('queue:work', [
//'--sansdaemon' => null,
'--stop-when-empty' => null,
]);
$jobOutput = trim(Artisan::output());
if (!empty($jobOutput)) {
Log::info($jobOutput);
}
///** @var App\Support\WorkCommand $queueWorker */
//$queueWorker = new App\Support\WorkCommand(app('queue.worker'), app('cache.store'));
//$queueWorker->setInput($queueWorker->createInputFromArguments([]));
//$queueWorker->handle();
/*$output = $this->call('queue:work', [
'--stop-when-empty' => null,
]);
Log::info($output);*/
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Console\Commands;
use App\Contracts\Command;
use App\Services\Installer\ConfigService;
/**
* Command to rewrite the config files
*/
class RewriteConfigs extends Command
{
protected $signature = 'phpvms:rewrite-configs';
protected $description = 'Rewrite the config files';
/**
* Run dev related commands
*/
public function handle()
{
/** @var ConfigService $configSvc */
$configSvc = app(ConfigService::class);
$configSvc->rewriteConfigFiles();
}
}

View File

@@ -8,7 +8,11 @@ use GuzzleHttp\Client;
class TestApi extends Command
{
protected $signature = 'phpvms:test-api {apikey} {url}';
protected $httpClient;
/**
* @var Client
*/
protected Client $httpClient;
/**
* Run dev related commands

View File

@@ -8,10 +8,16 @@ use Symfony\Component\Yaml\Yaml;
class Version extends Command
{
protected $signature = 'phpvms:version {--write} {--base-only}';
protected $signature = 'phpvms:version {--write} {--base-only} {--write-full-version} {version?}';
private $versionSvc;
/**
* @var VersionService
*/
private VersionService $versionSvc;
/**
* @param VersionService $versionSvc
*/
public function __construct(VersionService $versionSvc)
{
parent::__construct();
@@ -26,17 +32,40 @@ class Version extends Command
*/
public function handle()
{
// Write the updated build number out to the file
if ($this->option('write')) {
// Write the updated build number out to the file
$version_file = config_path('version.yml');
$cfg = Yaml::parse(file_get_contents($version_file));
$build_number = $this->versionSvc->getBuildId($cfg);
// If a version is being passed in, the update the build, etc data against this
if ($this->argument('version')) {
$version = \SemVer\SemVer\Version::fromString($this->argument('version'));
if ($this->option('write-full-version')) {
$cfg['current']['major'] = $version->getMajor();
$cfg['current']['minor'] = $version->getMinor();
$cfg['current']['patch'] = $version->getPatch();
}
$prerelease = $version->getPreRelease();
if (strpos($prerelease, '.') !== false) {
$prerelease = explode('.', $prerelease);
$cfg['current']['prerelease'] = $prerelease[0];
$cfg['current']['buildmetadata'] = $prerelease[1];
} else {
$cfg['current']['prerelease'] = $prerelease;
}
}
// Always write out the build ID/build number which is the commit hash
$build_number = $this->versionSvc->generateBuildId($cfg);
$cfg['current']['commit'] = $build_number;
$cfg['build']['number'] = $build_number;
file_put_contents($version_file, Yaml::dump($cfg, 4, 2));
}
$version = $this->versionSvc->getCurrentVersion(!$this->option('base-only'));
$incl_build = empty($this->option('base-only')) ? true : false;
$version = $this->versionSvc->getCurrentVersion($incl_build);
echo $version."\n";
}
}

View File

@@ -3,7 +3,7 @@
namespace App\Console\Commands;
use App\Contracts\Command;
use DB;
use Illuminate\Support\Facades\DB;
use Symfony\Component\Yaml\Yaml;
/**
@@ -25,6 +25,20 @@ class YamlExport extends Command
exit();
}
// A "preset" for exporting the base set of data
if ($tables[0] === 'base') {
$tables = [
'airlines',
'aircraft',
'subfleets',
'subfleet_fare',
'subfleet_rank',
'bids',
'fares',
'flights',
];
}
$export_tables = [];
foreach ($tables as $table) {
$export_tables[$table] = [];

View File

@@ -12,7 +12,11 @@ class YamlImport extends Command
{
protected $signature = 'phpvms:yaml-import {files*}';
protected $description = 'Developer commands';
protected $dbSvc;
/**
* @var DatabaseService
*/
protected DatabaseService $dbSvc;
/**
* YamlImport constructor.

90
app/Console/Cron.php Normal file
View File

@@ -0,0 +1,90 @@
<?php
/**
* This runs any of the cron tasks that are set to run according to the Laravel schedule
*/
namespace App\Console;
use App\Console\Cron\FifteenMinute;
use App\Console\Cron\FiveMinute;
use App\Console\Cron\Hourly;
use App\Console\Cron\JobQueue;
use App\Console\Cron\Monthly;
use App\Console\Cron\Nightly;
use App\Console\Cron\ThirtyMinute;
use App\Console\Cron\Weekly;
use App\Contracts\Command;
use Illuminate\Console\Scheduling\Schedule;
class Cron
{
/** @var Schedule */
private $scheduler;
/**
* @var string[] The cron tasks which get called/run
*/
private $cronTasks = [
JobQueue::class,
FiveMinute::class,
FifteenMinute::class,
ThirtyMinute::class,
Hourly::class,
Nightly::class,
Weekly::class,
Monthly::class,
];
/**
* @var array Stores the instantiated cron tasks
*/
private $cronRunners = [];
/**
* @param Schedule $scheduler
*/
public function __construct(Schedule $scheduler)
{
$this->scheduler = $scheduler;
foreach ($this->cronTasks as $task) {
/** @var Command $cronTask */
$cronTask = app($task);
$signature = $cronTask->getSignature();
if (empty($signature)) {
continue;
}
$this->cronRunners[$signature] = $cronTask;
}
}
/**
* Try to figure out which commands are supposed to run right now
*
* @return array string of tasks that were run
*/
public function run(): array
{
$events = $this->scheduler->dueEvents(app());
if (empty($events)) {
return [];
}
$run = [];
/** @var \Illuminate\Console\Scheduling\Event $event */
foreach ($events as $event) {
foreach ($this->cronRunners as $signature => $task) {
if (!str_contains($event->command, $signature)) {
continue;
}
$task->callEvent();
$run[] = $signature;
}
}
return $run;
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Console\Cron;
use App\Contracts\CronCommand;
use App\Events\CronFifteenMinute;
/**
* The actual cron tasks are in app/Cron
*/
class FifteenMinute extends CronCommand
{
protected $signature = 'cron:fifteen';
protected $description = 'Run the 15 minute cron tasks';
protected $schedule;
public function handle(): void
{
$this->callEvent();
}
public function callEvent()
{
event(new CronFifteenMinute());
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Console\Cron;
use App\Contracts\CronCommand;
use App\Events\CronFiveMinute;
/**
* This just calls the CronNightly event, so all of the
* listeners, etc can just be called to run those tasks
*
* The actual cron tasks are in app/Cron
*/
class FiveMinute extends CronCommand
{
protected $signature = 'cron:five';
protected $description = 'Run the 5 minute cron tasks';
protected $schedule;
public function handle(): void
{
$this->callEvent();
}
public function callEvent()
{
event(new CronFiveMinute());
}
}

View File

@@ -2,14 +2,14 @@
namespace App\Console\Cron;
use App\Contracts\Command;
use App\Contracts\CronCommand;
use App\Events\CronHourly;
/**
* This just calls the CronHourly event, so all of the
* listeners, etc can just be called to run those tasks
*/
class Hourly extends Command
class Hourly extends CronCommand
{
protected $signature = 'cron:hourly';
protected $description = 'Run the hourly cron tasks';
@@ -17,7 +17,11 @@ class Hourly extends Command
public function handle(): void
{
$this->redirectLoggingToFile('cron');
$this->callEvent();
}
public function callEvent()
{
event(new CronHourly());
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Console\Cron;
use App\Contracts\CronCommand;
use Illuminate\Support\Facades\Artisan;
/**
* This just calls the CronHourly event, so all of the
* listeners, etc can just be called to run those tasks
*/
class JobQueue extends CronCommand
{
protected $signature = 'cron:queue';
protected $description = 'Run the cron queue tasks';
protected $schedule;
public function handle(): void
{
$this->callEvent();
$queueOutput = trim(Artisan::output());
if (!empty($queueOutput)) {
$this->info($queueOutput);
}
}
public function callEvent()
{
Artisan::call('queue:cron');
}
}

View File

@@ -2,7 +2,7 @@
namespace App\Console\Cron;
use App\Contracts\Command;
use App\Contracts\CronCommand;
use App\Events\CronMonthly;
/**
@@ -11,7 +11,7 @@ use App\Events\CronMonthly;
*
* The actual cron tasks are in app/Cron
*/
class Monthly extends Command
class Monthly extends CronCommand
{
protected $signature = 'cron:monthly';
protected $description = 'Run the monthly cron tasks';
@@ -19,7 +19,11 @@ class Monthly extends Command
public function handle(): void
{
$this->redirectLoggingToFile('cron');
$this->callEvent();
}
public function callEvent()
{
event(new CronMonthly());
}
}

View File

@@ -2,7 +2,7 @@
namespace App\Console\Cron;
use App\Contracts\Command;
use App\Contracts\CronCommand;
use App\Events\CronNightly;
/**
@@ -11,7 +11,7 @@ use App\Events\CronNightly;
*
* The actual cron tasks are in app/Cron
*/
class Nightly extends Command
class Nightly extends CronCommand
{
protected $signature = 'cron:nightly';
protected $description = 'Run the nightly cron tasks';
@@ -19,7 +19,11 @@ class Nightly extends Command
public function handle(): void
{
$this->redirectLoggingToFile('cron');
$this->callEvent();
}
public function callEvent()
{
event(new CronNightly());
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Console\Cron;
use App\Contracts\CronCommand;
use App\Events\CronThirtyMinute;
/**
* The actual cron tasks are in app/Cron
*/
class ThirtyMinute extends CronCommand
{
protected $signature = 'cron:thirty';
protected $description = 'Run the 30 minute cron tasks';
protected $schedule;
public function handle(): void
{
$this->callEvent();
}
public function callEvent()
{
event(new CronThirtyMinute());
}
}

View File

@@ -2,7 +2,7 @@
namespace App\Console\Cron;
use App\Contracts\Command;
use App\Contracts\CronCommand;
use App\Events\CronWeekly;
/**
@@ -11,7 +11,7 @@ use App\Events\CronWeekly;
*
* The actual cron tasks are in app/Cron
*/
class Weekly extends Command
class Weekly extends CronCommand
{
protected $signature = 'cron:weekly';
protected $description = 'Run the weekly cron tasks';
@@ -19,7 +19,11 @@ class Weekly extends Command
public function handle(): void
{
$this->redirectLoggingToFile('cron');
$this->callEvent();
}
public function callEvent()
{
event(new CronWeekly());
}
}

View File

@@ -2,9 +2,13 @@
namespace App\Console;
use App\Console\Cron\FifteenMinute;
use App\Console\Cron\FiveMinute;
use App\Console\Cron\Hourly;
use App\Console\Cron\JobQueue;
use App\Console\Cron\Monthly;
use App\Console\Cron\Nightly;
use App\Console\Cron\ThirtyMinute;
use App\Console\Cron\Weekly;
use App\Services\CronService;
use Illuminate\Console\Scheduling\Schedule;
@@ -13,7 +17,11 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
* Define the application's command schedule. How this works... according to the command
* time, an event gets send out with the appropriate time (e.g, hourly sends an hourly event)
*
* Then the CronServiceProvider has the list of cronjobs which then run according to the events
* and then calls those at the proper times.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*
@@ -21,16 +29,32 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
// If not using the queue worker then run those via cron
if (!config('queue.worker', false)) {
$schedule->command(JobQueue::class)
->everyMinute()
->withoutOverlapping();
}
/*
* NOTE: IF MORE TASKS ARE ADDED, THEY ALSO MUST BE ADDED TO THE CRON.PHP
*/
$schedule->command(FiveMinute::class)->everyFiveMinutes();
$schedule->command(FifteenMinute::class)->everyFifteenMinutes();
$schedule->command(ThirtyMinute::class)->everyThirtyMinutes();
$schedule->command(Nightly::class)->dailyAt('01:00');
$schedule->command(Hourly::class)->hourly();
$schedule->command(Weekly::class)->weeklyOn(0);
$schedule->command(Monthly::class)->monthlyOn(1);
$schedule->command(Hourly::class)->hourly();
// When spatie-backups runs
$schedule->command('backup:clean')->daily()->at('01:00');
$schedule->command('backup:run')->daily()->at('02:00');
/*if (config('backup.backup.enabled', false) === true) {
$schedule->command('backup:clean')->daily()->at('01:00');
$schedule->command('backup:run')->daily()->at('02:00');
}*/
// Update the last time the cron was run
/** @var CronService $cronSvc */
$cronSvc = app(CronService::class);
$cronSvc->updateLastRunTime();
}
@@ -42,7 +66,6 @@ class Kernel extends ConsoleKernel
*/
protected function commands(): void
{
require app_path('Http/Routes/console.php');
$this->load(__DIR__.'/Commands');
$this->load(__DIR__.'/Cron');
}

View File

@@ -1,704 +0,0 @@
<?php
namespace App\Console\Services;
use App\Facades\Utils;
use App\Models\Aircraft;
use App\Models\Airline;
use App\Models\Airport;
use App\Models\Enums\FlightType;
use App\Models\Enums\PirepSource;
use App\Models\Enums\UserState;
use App\Models\Flight;
use App\Models\Pirep;
use App\Models\Rank;
use App\Models\Subfleet;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use PDO;
use PDOException;
use Symfony\Component\Console\Output\ConsoleOutput;
/**
* Class Importer
* TODO: Batch import
*/
class Importer
{
/**
* Hold references
*/
private $mappedEntities = [];
/**
* Hold the PDO connection to the old database
*
* @var
*/
private $conn;
/**
* @var array
*/
private $creds;
/**
* Hold the instance of the console logger
*
* @var
*/
private $log;
/**
* CONSTANTS
*/
public const BATCH_READ_ROWS = 300;
public const SUBFLEET_NAME = 'Imported Aircraft';
/**
* Importer constructor.
*
* @param $db_creds
*/
public function __construct($db_creds)
{
// Setup the logger
$this->log = new ConsoleOutput();
// The db credentials
$this->creds = array_merge([
'host' => '127.0.0.1',
'port' => 3306,
'name' => '',
'user' => '',
'pass' => '',
'table_prefix' => '',
], $db_creds);
}
/**
* @return int|void
*/
public function run()
{
$this->reconnect();
// Import all the different parts
$this->importRanks();
$this->importAirlines();
$this->importAircraft();
$this->importAirports();
$this->importUsers();
$this->importFlights();
$this->importPireps();
// Finish up
$this->findLastPireps();
$this->recalculateRanks();
}
/**
* Reconnect to the old phpVMS DB using PDO
*/
protected function reconnect()
{
$dsn = 'mysql:'.implode(';', [
'host='.$this->creds['host'],
'port='.$this->creds['port'],
'dbname='.$this->creds['name'],
]);
$this->info('Connection string: '.$dsn);
try {
$this->conn = new PDO($dsn, $this->creds['user'], $this->creds['pass']);
$this->conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
} catch (\PDOException $e) {
$this->error($e);
exit();
}
}
/**
* @param $message
*/
protected function comment($message)
{
$this->log->writeln('<comment>'.$message.'</comment>');
}
/**
* @param $message
*/
protected function error($message)
{
$this->log->writeln('<error>'.$message.'</error>');
}
/**
* @param string|array $message
*/
protected function info($message)
{
if (\is_array($message)) {
/* @noinspection ForgottenDebugOutputInspection */
print_r($message);
} else {
$this->log->writeln('<info>'.$message.'</info>');
}
}
/**
* Return the table name with the prefix
*
* @param $table
*
* @return string
*/
protected function tableName($table)
{
if ($this->creds['table_prefix'] !== false) {
return $this->creds['table_prefix'].$table;
}
return $table;
}
/**
* @param \Illuminate\Database\Eloquent\Model $model
*
* @return bool
*/
protected function saveModel($model)
{
try {
$model->save();
return true;
} catch (QueryException $e) {
if ($e->getCode() !== '23000') {
$this->error($e);
}
return false;
}
}
/**
* Create a new mapping between an old ID and the new one
*
* @param $entity
* @param $old_id
* @param $new_id
*/
protected function addMapping($entity, $old_id, $new_id)
{
if (!array_key_exists($entity, $this->mappedEntities)) {
$this->mappedEntities[$entity] = [];
}
$this->mappedEntities[$entity][$old_id] = $new_id;
}
/**
* Return the ID for a mapping
*
* @param $entity
* @param $old_id
*
* @return bool
*/
protected function getMapping($entity, $old_id)
{
if (!array_key_exists($entity, $this->mappedEntities)) {
return 0;
}
$entity = $this->mappedEntities[$entity];
if (array_key_exists($old_id, $entity)) {
return $entity[$old_id];
}
return 0;
}
/**
* @param $date
*
* @return Carbon
*/
protected function parseDate($date)
{
$carbon = Carbon::parse($date);
return $carbon;
}
/**
* Take a decimal duration and convert it to minutes
*
* @param $duration
*
* @return float|int
*/
protected function convertDuration($duration)
{
if (strpos($duration, '.') !== false) {
$delim = '.';
} elseif (strpos($duration, ':')) {
$delim = ':';
} else {
// no delimiter, assume it's just a straight hour
return (int) $duration * 60;
}
$hm = explode($delim, $duration);
$hours = (int) $hm[0] * 60;
$mins = (int) $hm[1];
return $hours + $mins;
}
/**
* @param $table
*
* @return mixed
*/
protected function getTotalRows($table)
{
$table = $this->tableName($table);
$sql = 'SELECT COUNT(*) FROM '.$table;
$rows = $this->conn->query($sql)->fetchColumn();
$this->info('Found '.$rows.' rows in '.$table);
return (int) $rows;
}
/**
* Read all the rows in a table, but read them in a batched manner
*
* @param string $table The name of the table
* @param null $read_rows Number of rows to read
*
* @return \Generator
*/
protected function readRows($table, $read_rows = null)
{
// Set the table prefix if it has been entered
$this->tableName($table);
$offset = 0;
if ($read_rows === null) {
$read_rows = self::BATCH_READ_ROWS;
}
$total_rows = $this->getTotalRows($table);
while ($offset < $total_rows) {
$rows_to_read = $offset + $read_rows;
if ($rows_to_read > $total_rows) {
$rows_to_read = $total_rows;
}
$this->info('Reading '.$offset.' to '.$rows_to_read.' of '.$total_rows);
$sql = 'SELECT * FROM '.$this->tableName($table)
.' LIMIT '.self::BATCH_READ_ROWS.' OFFSET '.$offset;
try {
foreach ($this->conn->query($sql) as $row) {
yield $row;
}
} catch (PDOException $e) {
// Without incrementing the offset, it should re-run the same query
$this->error($e);
if (strpos($e->getMessage(), 'server has gone away') !== false) {
$this->reconnect();
continue;
}
}
$offset += self::BATCH_READ_ROWS;
}
}
/**
* Return the subfleet
*
* @return mixed
*/
protected function getSubfleet()
{
$airline = Airline::first();
$subfleet = Subfleet::firstOrCreate(
['airline_id' => $airline->id, 'name' => self::SUBFLEET_NAME],
['type' => 'PHPVMS']
);
return $subfleet;
}
/**
* All the individual importers, done on a per-table basis
* Some tables get saved locally for tables that use FK refs
*/
/**
* Import all of the ranks
*/
protected function importRanks()
{
$this->comment('--- RANK IMPORT ---');
$count = 0;
foreach ($this->readRows('ranks') as $row) {
$rank = Rank::firstOrCreate(
['name' => $row->rank],
['image_url' => $row->rankimage, 'hours' => $row->minhours]
);
$this->addMapping('ranks', $row->rankid, $rank->id);
$this->addMapping('ranks', $row->rank, $rank->id);
if ($rank->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' ranks');
}
/**
* Import all of the airlines. Save them all in the private var $airlines
* They're used to lookup from other reference tables
*/
protected function importAirlines()
{
$this->comment('--- AIRLINE IMPORT ---');
$count = 0;
foreach ($this->readRows('airlines') as $row) {
$airline = Airline::firstOrCreate(
['icao' => $row->code],
['iata' => $row->code, 'name' => $row->name, 'active' => $row->enabled]
);
$this->addMapping('airlines', $row->id, $airline->id);
$this->addMapping('airlines', $row->code, $airline->id);
if ($airline->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' airlines');
}
/**
* Imported the aircraft
*/
protected function importAircraft()
{
$this->comment('--- AIRCRAFT IMPORT ---');
$subfleet = $this->getSubfleet();
$this->info('Subfleet ID is '.$subfleet->id);
$count = 0;
foreach ($this->readRows('aircraft') as $row) {
$aircraft = Aircraft::firstOrCreate(
['name' => $row->fullname, 'registration' => $row->registration],
['icao' => $row->icao,
'subfleet_id' => $subfleet->id,
'active' => $row->enabled,
]
);
$this->addMapping('aircraft', $row->id, $aircraft->id);
if ($aircraft->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' aircraft');
}
/**
* Import all of the airports
*/
protected function importAirports()
{
$this->comment('--- AIRPORT IMPORT ---');
$count = 0;
foreach ($this->readRows('airports') as $row) {
$attrs = [
'id' => trim($row->icao),
'icao' => trim($row->icao),
'name' => $row->name,
'country' => $row->country,
'lat' => $row->lat,
'lon' => $row->lng,
'hub' => $row->hub,
];
$airport = Airport::updateOrCreate(
['id' => $attrs['id']],
$attrs
);
if ($airport->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' airports');
}
/**
* Import the flights and schedules
*/
protected function importFlights()
{
$this->comment('--- FLIGHT SCHEDULE IMPORT ---');
$count = 0;
foreach ($this->readRows('schedules') as $row) {
$airline_id = $this->getMapping('airlines', $row->code);
$flight_num = trim($row->flightnum);
$attrs = [
'dpt_airport_id' => $row->depicao,
'arr_airport_id' => $row->arricao,
'route' => $row->route ?: '',
'distance' => round($row->distance ?: 0, 2),
'level' => $row->flightlevel ?: 0,
'dpt_time' => $row->deptime ?: '',
'arr_time' => $row->arrtime ?: '',
'flight_time' => $this->convertDuration($row->flighttime) ?: '',
'notes' => $row->notes ?: '',
'active' => $row->enabled ?: true,
];
try {
$flight = Flight::updateOrCreate(
['airline_id' => $airline_id, 'flight_number' => $flight_num],
$attrs
);
} catch (\Exception $e) {
//$this->error($e);
}
$this->addMapping('flights', $row->id, $flight->id);
// TODO: deserialize route_details into ACARS table
if ($flight->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' flights');
}
/**
* Import all of the PIREPs
*/
protected function importPireps()
{
$this->comment('--- PIREP IMPORT ---');
$count = 0;
foreach ($this->readRows('pireps') as $row) {
$pirep_id = $row->pirepid;
$user_id = $this->getMapping('users', $row->pilotid);
$airline_id = $this->getMapping('airlines', $row->code);
$aircraft_id = $this->getMapping('aircraft', $row->aircraft);
$attrs = [
//'id' => $pirep_id,
'user_id' => $user_id,
'airline_id' => $airline_id,
'aircraft_id' => $aircraft_id,
'flight_number' => $row->flightnum ?: '',
'dpt_airport_id' => $row->depicao,
'arr_airport_id' => $row->arricao,
'block_fuel' => $row->fuelused,
'route' => $row->route ?: '',
'source_name' => $row->source,
'created_at' => $this->parseDate($row->submitdate),
'updated_at' => $this->parseDate($row->modifieddate),
];
// Set the distance
$distance = round($row->distance ?: 0, 2);
$attrs['distance'] = $distance;
$attrs['planned_distance'] = $distance;
// Set the flight time properly
$duration = $this->convertDuration($row->flighttime_stamp);
$attrs['flight_time'] = $duration;
$attrs['planned_flight_time'] = $duration;
// Set how it was filed
if (strtoupper($row->source) === 'MANUAL') {
$attrs['source'] = PirepSource::MANUAL;
} else {
$attrs['source'] = PirepSource::ACARS;
}
// Set the flight type
$row->flighttype = strtoupper($row->flighttype);
if ($row->flighttype === 'P') {
$attrs['flight_type'] = FlightType::SCHED_PAX;
} elseif ($row->flighttype === 'C') {
$attrs['flight_type'] = FlightType::SCHED_CARGO;
} else {
$attrs['flight_type'] = FlightType::CHARTER_PAX_ONLY;
}
// Set the flight level of the PIREP is set
if (property_exists($row, 'flightlevel')) {
$attrs['level'] = $row->flightlevel;
} else {
$attrs['level'] = 0;
}
$pirep = Pirep::updateOrCreate(
['id' => $pirep_id],
$attrs
);
$source = strtoupper($row->source);
if ($source === 'SMARTCARS') {
// TODO: Parse smartcars log into the acars table
} elseif ($source === 'KACARS') {
// TODO: Parse kACARS log into acars table
} elseif ($source === 'XACARS') {
// TODO: Parse XACARS log into acars table
}
// TODO: Add extra fields in as PIREP fields
$this->addMapping('pireps', $row->pirepid, $pirep->id);
if ($pirep->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' pireps');
}
protected function importUsers()
{
$this->comment('--- USER IMPORT ---');
$count = 0;
foreach ($this->readRows('pilots', 50) as $row) {
// TODO: What to do about pilot ids
$name = $row->firstname.' '.$row->lastname;
$airline_id = $this->getMapping('airlines', $row->code);
$rank_id = $this->getMapping('ranks', $row->rank);
$state = $this->getUserState($row->retired);
$new_password = Str::random(60);
$attrs = [
'name' => $name,
'password' => Hash::make($new_password),
'api_key' => Utils::generateApiKey(),
'airline_id' => $airline_id,
'rank_id' => $rank_id,
'home_airport_id' => $row->hub,
'curr_airport_id' => $row->hub,
'flights' => (int) $row->totalflights,
'flight_time' => Utils::hoursToMinutes($row->totalhours),
'state' => $state,
'created_at' => $this->parseDate($row->joindate),
];
$user = User::updateOrCreate(
['email' => $row->email],
$attrs
);
$this->addMapping('users', $row->pilotid, $user->id);
if ($user->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' users');
}
/**
* Go through and set the last PIREP ID for the users
*/
protected function findLastPireps()
{
}
/**
* Recalculate all of the user ranks
*/
protected function recalculateRanks()
{
/*$this->comment('--- RECALCULATING RANKS ---');*/
}
/**
* Get the user's new state from their original state
*
* @param $state
*
* @return int
*/
protected function getUserState($state)
{
// TODO: This state might differ between simpilot and classic version
$state = (int) $state;
// Declare array of classic states
$phpvms_classic_states = [
'ACTIVE' => 0,
'INACTIVE' => 1,
'BANNED' => 2,
'ON_LEAVE' => 3,
];
// Decide which state they will be in accordance with v7
if ($state === $phpvms_classic_states['ACTIVE']) {
return UserState::ACTIVE;
}
if ($state === $phpvms_classic_states['INACTIVE']) {
// TODO: Make an inactive state?
return UserState::REJECTED;
}
if ($state === $phpvms_classic_states['BANNED']) {
return UserState::SUSPENDED;
}
if ($state === $phpvms_classic_states['ON_LEAVE']) {
return UserState::ON_LEAVE;
}
$this->error('Unknown status: '.$state);
return UserState::ACTIVE;
}
}

View File

@@ -2,11 +2,12 @@
namespace App\Contracts;
use App\Facades\Utils;
use App\Models\Award as AwardModel;
use App\Models\User;
use App\Models\UserAward;
use Log;
use App\Support\Utils;
use Exception;
use Illuminate\Support\Facades\Log;
/**
* Base class for the Awards, you need to extend this, and implement:
@@ -35,15 +36,12 @@ abstract class Award
* You don't really need to mess with anything below here
*/
protected $award;
protected $user;
/** @var \App\Models\Award|null */
protected ?AwardModel $award;
/** @var \App\Models\User|null */
protected ?User $user;
/**
* AwardInterface constructor.
*
* @param AwardModel $award
* @param User $user
*/
public function __construct(AwardModel $award = null, User $user = null)
{
$this->award = $award;
@@ -71,9 +69,9 @@ abstract class Award
/**
* Add the award to this user, if they don't already have it
*
* @return bool|UserAward
* @return bool|UserAward|null
*/
final protected function addAward()
protected function addAward(): bool|UserAward|null
{
$w = [
'user_id' => $this->user->id,
@@ -90,7 +88,7 @@ abstract class Award
try {
$award->save();
} catch (\Exception $e) {
} catch (Exception $e) {
Log::error(
'Error saving award: '.$e->getMessage(),
$e->getTrace()

View File

@@ -3,6 +3,7 @@
namespace App\Contracts;
use Illuminate\Support\Facades\Log;
use function is_array;
use Symfony\Component\Process\Process;
/**
@@ -23,9 +24,19 @@ abstract class Command extends \Illuminate\Console\Command
parent::__construct();
// Running in the console but not in the tests
if (app()->runningInConsole() && env('APP_ENV') !== 'testing') {
/*if (app()->runningInConsole() && env('APP_ENV') !== 'testing') {
$this->redirectLoggingToFile('stdout');
}
}*/
}
/**
* Return the signature of the command
*
* @return string
*/
public function getSignature(): string
{
return $this->signature;
}
/**
@@ -82,9 +93,9 @@ abstract class Command extends \Illuminate\Console\Command
}
/**
* @param $cmd
* @param bool $return
* @param mixed $verbose
* @param array|string $cmd
* @param bool $return
* @param mixed $verbose
*
* @throws \Symfony\Component\Process\Exception\RuntimeException
* @throws \Symfony\Component\Process\Exception\LogicException
@@ -93,16 +104,16 @@ abstract class Command extends \Illuminate\Console\Command
*/
public function runCommand($cmd, $return = false, $verbose = true): string
{
if (\is_array($cmd)) {
if (is_array($cmd)) {
$cmd = implode(' ', $cmd);
}
if ($verbose) {
$this->info('Running "'.$cmd.'"');
$this->info('Running '.$cmd);
}
$val = '';
$process = new Process($cmd);
$process = Process::fromShellCommandline($cmd);
$process->run(function ($type, $buffer) use ($return, &$val) {
if ($return) {
$val .= $buffer;

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Contracts;
use Illuminate\View\View;
abstract class Composer
{
abstract public function compose(View $view);
}

View File

@@ -6,13 +6,16 @@ use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\Request;
use Laracasts\Flash\Flash;
/**
* Class Controller
*/
abstract class Controller extends \Illuminate\Routing\Controller
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
/**
* Write a error to the flash and redirect the user to a route
@@ -24,7 +27,7 @@ abstract class Controller extends \Illuminate\Routing\Controller
*/
public function flashError($message, $route)
{
flash()->error($message);
Flash::error($message);
return redirect(route($route))->withInput();
}
@@ -81,19 +84,21 @@ abstract class Controller extends \Illuminate\Routing\Controller
*
* @param $message
* @param null|mixed $count
* @param mixed $attrs
*
* @return \Illuminate\Http\JsonResponse
*/
public function message($message, $count = null)
public function message($message, $count = null, $attrs = [])
{
$attrs = [
$ret = [
'message' => $message,
'attrs' => $attrs,
];
if ($count !== null) {
$attrs['count'] = $count;
$ret['count'] = $count;
}
return response()->json($attrs);
return response()->json($ret);
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Contracts;
abstract class CronCommand extends Command
{
/**
* @return mixed
*/
abstract public function callEvent();
/**
* Adjust the logging depending on where we're running from
*/
public function __construct()
{
parent::__construct();
$this->redirectLoggingToFile('cron');
}
}

View File

@@ -7,14 +7,14 @@ namespace App\Contracts;
*/
abstract class Enum
{
protected static $cache = [];
protected static $codes = [];
protected static $labels = [];
protected static array $cache = [];
protected static array $codes = [];
protected static array $labels = [];
/**
* @var int
*/
protected $value;
protected int $value;
/**
* Create an instance of this Enum
@@ -29,9 +29,9 @@ abstract class Enum
/**
* Return the value that's been set if this is an instance
*
* @return mixed
* @return int|null
*/
final public function getValue()
final public function getValue(): ?int
{
return $this->value;
}
@@ -41,13 +41,20 @@ abstract class Enum
*
* @param $value
*
* @return mixed
* @return string
*/
final public static function label($value)
final public static function label($value): string
{
if (isset(static::$labels[$value])) {
return trans(static::$labels[$value]);
$val = static::$labels[$value];
if (strpos($val, '.') !== false) {
return trans($val);
}
return $val;
}
return $value;
}
/**
@@ -82,11 +89,11 @@ abstract class Enum
*
* @return false|int|string
*/
public static function convertToCode($value)
public static function convertToCode($value): bool|int|string|null
{
$value = (int) $value;
if (!array_key_exists($value, static::$codes)) {
return;
return null;
}
return static::$codes[$value];

12
app/Contracts/Event.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
namespace App\Contracts;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class Event
{
use Dispatchable;
use SerializesModels;
}

View File

@@ -0,0 +1,9 @@
<?php
namespace App\Contracts;
use Illuminate\Database\Eloquent\Factories\Factory as EloquentFactory;
abstract class Factory extends EloquentFactory
{
}

View File

@@ -2,15 +2,16 @@
namespace App\Contracts;
/**
* Class FormRequest
*/
use Illuminate\Validation\Rule;
class FormRequest extends \Illuminate\Foundation\Http\FormRequest
{
/**
* Authorized by default
*
* @return bool
*/
public function authorize()
public function authorize(): bool
{
return true;
}
@@ -18,8 +19,22 @@ class FormRequest extends \Illuminate\Foundation\Http\FormRequest
/**
* @return array
*/
public function rules()
public function rules(): array
{
return [];
}
/**
* Set a given column as being unique
*
* @param $table
*
* @return array
*/
public function unique($table)
{
return [
Rule::unique($table)->ignore($this->id, 'id'),
];
}
}

View File

@@ -3,9 +3,9 @@
namespace App\Contracts;
use App\Models\Airline;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\ValidationException;
use Log;
use Validator;
/**
* Common functionality used across all of the importers
@@ -51,9 +51,9 @@ class ImportExport
*
* @param $code
*
* @return \Illuminate\Database\Eloquent\Model
* @return Airline
*/
public function getAirline($code)
public function getAirline($code): Airline
{
$airline = Airline::firstOrCreate([
'icao' => $code,
@@ -166,10 +166,36 @@ class ImportExport
return [];
}
if (strpos($split_values[0], '?') !== false) {
// This contains the query string, which turns it into a multi-level array
$query_str = explode('?', $split_values[0]);
$parent = trim($query_str[0]);
$children = [];
$kvp = explode('&', trim($query_str[1]));
foreach ($kvp as $items) {
if (!$items) {
continue;
}
$this->kvpToArray($items, $children);
}
$ret[$parent] = $children;
return $ret;
}
// This is not a query string, return it back untouched
return [$split_values[0]];
}
foreach ($split_values as $value) {
$value = trim($value);
if ($value === '') {
continue;
}
// This isn't in the query string format, so it's
// just a straight key-value pair set
if (strpos($value, '?') === false) {

View File

@@ -2,9 +2,21 @@
namespace App\Contracts;
/**
* Class Listener
*/
use Illuminate\Contracts\Events\Dispatcher;
abstract class Listener
{
public static $callbacks = [];
/**
* Sets up any callbacks that are defined in the child class
*
* @param $events
*/
public function subscribe(Dispatcher $events): void
{
foreach (static::$callbacks as $klass => $cb) {
$events->listen($klass, static::class.'@'.$cb);
}
}
}

View File

@@ -12,13 +12,24 @@ abstract class Metar
{
/**
* Implement retrieving the METAR - return the METAR string. Needs to be protected,
* since this shouldn't be directly called. Call `get_metar($icao)` instead
* since this shouldn't be directly called. Call `metar($icao)`. If not implemented,
* return a blank string
*
* @param $icao
*
* @return mixed
*/
abstract protected function metar($icao): string;
abstract protected function get_metar($icao): string;
/**
* Implement retrieving the TAF - return the string. Call `taf($icao)`. If not implemented,
* return a blank string
*
* @param $icao
*
* @return mixed
*/
abstract protected function get_taf($icao): string;
/**
* Download the METAR, wrap in caching
@@ -27,9 +38,9 @@ abstract class Metar
*
* @return string
*/
public function get_metar($icao): string
public function metar($icao): string
{
$cache = config('cache.keys.WEATHER_LOOKUP');
$cache = config('cache.keys.METAR_WEATHER_LOOKUP');
$key = $cache['key'].$icao;
if (Cache::has($key)) {
@@ -40,7 +51,7 @@ abstract class Metar
}
try {
$raw_metar = $this->metar($icao);
$raw_metar = $this->get_metar($icao);
} catch (\Exception $e) {
Log::error('Error getting METAR: '.$e->getMessage(), $e->getTrace());
return '';
@@ -52,4 +63,37 @@ abstract class Metar
return $raw_metar;
}
/**
* Download the TAF, wrap in caching
*
* @param $icao
*
* @return string
*/
public function taf($icao): string
{
$cache = config('cache.keys.TAF_WEATHER_LOOKUP');
$key = $cache['key'].$icao;
if (Cache::has($key)) {
$taf = Cache::get($key);
if ($taf !== '') {
return $taf;
}
}
try {
$taf = $this->get_taf($icao);
} catch (\Exception $e) {
Log::error('Error getting TAF: '.$e->getMessage(), $e->getTrace());
return '';
}
if ($taf !== '') {
Cache::put($key, $taf, $cache['time']);
}
return $taf;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Contracts;
use Closure;
use Illuminate\Http\Request;
interface Middleware
{
public function handle(Request $request, Closure $next);
}

View File

@@ -2,7 +2,12 @@
namespace App\Contracts;
use DB;
use App\Support\Database;
use Exception;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\ValidationException;
/**
* Class Migration
@@ -23,6 +28,45 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
{
}
/**
* Add a module and enable it
*
* @param array $attrs
*/
public function addModule(array $attrs)
{
$module = array_merge([
'enabled' => true,
'created_at' => DB::raw('NOW()'),
'updated_at' => DB::raw('NOW()'),
], $attrs);
try {
DB::table('modules')->insert($module);
} catch (Exception $e) {
// setting already exists, just ignore it
if ($e->getCode() === 23000) {
return;
}
}
}
/**
* Seed a YAML file into the database
*
* @param string $file Full path to yml file to seed
*/
public function seedFile($file): void
{
try {
$path = base_path($file);
Database::seed_from_yaml_file($path, false);
} catch (Exception $e) {
Log::error('Unable to load '.$file.' file');
Log::error($e);
}
}
/**
* Add rows to a table
*
@@ -34,7 +78,7 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
foreach ($rows as $row) {
try {
DB::table($table)->insert($row);
} catch (\Exception $e) {
} catch (Exception $e) {
// setting already exists, just ignore it
if ($e->getCode() === 23000) {
continue;
@@ -42,4 +86,22 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
}
}
}
/**
* Add an award from the migrations (for example, if you're adding an award module)
*
* @param array $award See \App\Models\Awardv
*
* @throws \Illuminate\Validation\ValidationException
*/
public function addAward(array $award)
{
$validator = Validator::make($award, \App\Models\Award::$rules);
if ($validator->fails()) {
throw new ValidationException($validator);
}
$awardModel = new \App\Models\Award($award);
$awardModel->save();
}
}

View File

@@ -3,21 +3,20 @@
namespace App\Contracts;
/**
* Class Model
*
* @property mixed $id
* @property bool $skip_mutator
*
* @method static where(array $array)
* @mixin \Illuminate\Database\Eloquent\Builder
*/
abstract class Model extends \Illuminate\Database\Eloquent\Model
{
public const ID_MAX_LENGTH = 12;
/**
* Max length of ID for string columns
*/
public const ID_MAX_LENGTH = 16;
/**
* For the factories, skip the mutators. Only apply to one instance
*
* @var bool
*/
public $skip_mutator = false;
}

View File

@@ -0,0 +1,49 @@
<?php
namespace App\Contracts\Modules;
/**
* Base class for module service providers
* Add-on module service providers must extend this class. Docs on Service Providers:
* https://laravel.com/docs/7.x/providers
*
* For a sample service provider, view the sample module one:
* https://github.com/nabeelio/phpvms-module/blob/master/Providers/SampleServiceProvider.php
*/
abstract class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
/**
* A boot method is required, even if it doesn't do anything.
* https://laravel.com/docs/7.x/providers#the-boot-method
*
* This is normally where you'd register the routes or other startup tasks for your module
*/
public function boot(): void
{
}
/**
* This is required to register the links in either the public or admin toolbar
* For example, adding a frontend link:
*
* $this->moduleSvc->addFrontendLink('Sample', '/sample', '', $logged_in=true);
*
* Or an admin link:
*
* $this->moduleSvc->addAdminLink('Sample', '/admin/sample');
*/
public function registerLinks(): void
{
}
/**
* Deferred providers:
* https://laravel.com/docs/7.x/providers#deferred-providers
*
* @return array
*/
public function provides(): array
{
return [];
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Contracts;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
class Notification extends \Illuminate\Notifications\Notification implements ShouldQueue
{
use Queueable;
public $channels = [];
public $requires_opt_in = false;
public function __construct()
{
// Look in the notifications.channels config and see where this particular
// notification can go. Map it to $channels
/*$klass = static::class;
$notif_config = config('notifications.channels', []);
if (!array_key_exists($klass, $notif_config)) {
Log::error('Notification type '.$klass.' missing from notifications config, defaulting to mail');
return;
}
$this->channels = $notif_config[$klass];*/
}
}

View File

@@ -2,9 +2,15 @@
namespace App\Contracts;
use Exception;
use Illuminate\Validation\Validator;
use function is_array;
use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Exceptions\RepositoryException;
/**
* @mixin BaseRepository
*/
abstract class Repository extends BaseRepository
{
/**
@@ -17,8 +23,8 @@ abstract class Repository extends BaseRepository
{
try {
return $this->find($id, $columns);
} catch (\Exception $e) {
return;
} catch (Exception $e) {
return null;
}
}
@@ -29,11 +35,7 @@ abstract class Repository extends BaseRepository
*/
public function validate($values)
{
$validator = Validator::make(
$values,
$this->model()->rules
);
$validator = Validator::make($values, $this->model()->rules);
if ($validator->fails()) {
return $validator->messages();
}
@@ -47,6 +49,8 @@ abstract class Repository extends BaseRepository
* @param int $count
* @param string $sort_by created_at (default) or updated_at
*
* @throws RepositoryException
*
* @return mixed
*/
public function recent($count = null, $sort_by = 'created_at')
@@ -68,7 +72,7 @@ abstract class Repository extends BaseRepository
return $this->scopeQuery(function ($query) use ($where, $sort_by, $order_by) {
$q = $query->where($where);
// See if there are multi-column sorts
if (\is_array($sort_by)) {
if (is_array($sort_by)) {
foreach ($sort_by as $key => $sort) {
$q = $q->orderBy($key, $sort);
}
@@ -95,7 +99,7 @@ abstract class Repository extends BaseRepository
return $this->scopeQuery(function ($query) use ($col, $values, $sort_by, $order_by) {
$q = $query->whereNotIn($col, $values);
// See if there are multi-column sorts
if (\is_array($sort_by)) {
if (is_array($sort_by)) {
foreach ($sort_by as $key => $sort) {
$q = $q->orderBy($key, $sort);
}
@@ -115,7 +119,7 @@ abstract class Repository extends BaseRepository
* @param array $columns
* @param string $method
*
* @throws \Prettus\Repository\Exceptions\RepositoryException
* @throws RepositoryException
*
* @return mixed
*/
@@ -129,7 +133,10 @@ abstract class Repository extends BaseRepository
$page = (int) request()->query('page', 1);
$results = $this->model->{$method}($limit, $columns, 'page', $page);
$results->appends(app('request')->query());
$qs = request()->except(['page', 'user']);
$results->appends($qs);
$this->resetModel();
return $this->parserResult($results);

View File

@@ -0,0 +1,56 @@
<?php
namespace App\Contracts;
use App\Support\Resources\CustomAnonymousResourceCollection;
use App\Support\Resources\CustomPaginatedResourceResponse;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Pagination\AbstractPaginator;
/**
* Base class for a resource/response
*/
class Resource extends JsonResource
{
/**
* Iterate through the list of $fields and check if they're a "Unit"
* If they are, then add the response
*
* @param $response
* @param array $fields
*/
public function checkUnitFields(&$response, array $fields): void
{
foreach ($fields as $f) {
if ($this->{$f} instanceof Unit) {
$response[$f] = $this->{$f}->getResponseUnits();
} else {
$response[$f] = $this->{$f};
}
}
}
/**
* Customize the response to exclude all the extra data that isn't used. Based on:
* https://gist.github.com/derekphilipau/4be52164a69ce487dcd0673656d280da
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\JsonResponse
*/
public function toResponse($request)
{
return $this->resource instanceof AbstractPaginator
? (new CustomPaginatedResourceResponse($this))->toResponse($request)
: parent::toResponse($request);
}
public static function collection($resource)
{
return tap(new CustomAnonymousResourceCollection($resource, static::class), function ($collection) {
if (property_exists(static::class, 'preserveKeys')) {
$collection->preserveKeys = (new static([]))->preserveKeys === true;
}
});
}
}

View File

@@ -5,52 +5,94 @@ namespace App\Contracts;
use ArrayAccess;
/**
* Class Unit
*
* @property mixed $instance
* @property string $unit
* @property array $units
* Abstract unit wrapper
*/
class Unit implements ArrayAccess
{
/**
* The unit this is kept as
* The localized unit the user wants it displayed in
*/
public $unit;
public string $localUnit;
/**
* All of the units of this class
* The unit that this value is stored in locally
*/
public $units;
public string $internalUnit;
/**
* All of the units of this class which are reported in an API response
*/
public array $units;
/**
* Holds an instance of the PhpUnit type
*/
protected $instance;
protected mixed $instance;
/**
* Units that are included as part of the REST response
*/
public $responseUnits = [];
public array $responseUnits = [];
/**
* @return mixed
* Factory method for creating a new unit type
*
* @param mixed $value
* @param string $unit
*
* @throws \Exception
*
* @return Unit
*/
public function value()
public static function make(mixed $value, string $unit): self
{
return $this->__toString();
if ($value instanceof self) {
return $value;
}
return new static($value, $unit);
}
/**
* Return the value in an internal format
*
* @param int|null $round Optional value to round to
*
* @return float|null
*/
public function internal(?int $round = null): ?float
{
return $this->toUnit($this->internalUnit, $round);
}
/**
* Return the value in the localized format
*
* @param int|null $round Optional value to round to
*
* @return float|null
*/
public function local(?int $round = null): ?float
{
return $this->toUnit($this->localUnit, $round);
}
/**
* Just call toUnit() on the PhpUnitOfMeasure instance
*
* @param string $unit
* @param string $unit
* @param int|null $round Optional value to round to
*
* @return mixed
* @return float|null
*/
public function toUnit($unit)
public function toUnit(string $unit, ?int $round = null): ?float
{
return $this->instance->toUnit($unit);
$val = $this->instance->toUnit($unit);
if ($round === null) {
return $val;
}
return round($val, $round);
}
/**
@@ -60,7 +102,7 @@ class Unit implements ArrayAccess
{
$response = [];
foreach ($this->responseUnits as $unit) {
$response[$unit] = $this[$unit];
$response[$unit] = round($this->instance->toUnit($unit), 2);
}
return $response;
@@ -73,21 +115,26 @@ class Unit implements ArrayAccess
*
* @return bool
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return array_key_exists($offset, $this->units);
return $this->offsetGet($offset) !== null;
}
/**
* Implements ArrayAccess
*
* @param $offset
* @param $unit
*
* @return mixed
* @return float|null
*/
public function offsetGet($offset)
public function offsetGet($unit): ?float
{
return round($this->instance->toUnit($offset), 2);
$value = $this->instance->toUnit($unit);
if (!$value) {
return null;
}
return round($value, 2);
}
/**
@@ -116,6 +163,6 @@ class Unit implements ArrayAccess
*/
public function __toString()
{
return (string) $this->units[$this->unit];
return (string) $this->offsetGet($this->localUnit);
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Cron\Hourly;
use App\Contracts\Listener;
use App\Events\CronHourly;
use App\Services\SimBriefService;
use Illuminate\Support\Facades\Log;
/**
* Clear any expired SimBrief flight briefs that aren't attached to a PIREP
*/
class ClearExpiredSimbrief extends Listener
{
private SimBriefService $simbriefSvc;
public function __construct(SimBriefService $simbriefSvc)
{
$this->simbriefSvc = $simbriefSvc;
}
/**
* @param CronHourly $event
*/
public function handle(CronHourly $event): void
{
Log::info('Hourly: Removing expired Simbrief entries');
$this->simbriefSvc->removeExpiredEntries();
}
}

View File

@@ -0,0 +1,56 @@
<?php
namespace App\Cron\Hourly;
use App\Contracts\Listener;
use App\Events\CronHourly;
use App\Models\Enums\PirepState;
use App\Models\Enums\PirepStatus;
use App\Models\Pirep;
use App\Services\PirepService;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
/**
* Remove cancelled/deleted PIREPs. Look for PIREPs that were created before the setting time
* (e.g, 12 hours ago) and are marked with the
*/
class DeletePireps extends Listener
{
/**
* Delete old rejected PIREPs
*
* @param CronHourly $event
*
* @throws \Exception
*/
public function handle(CronHourly $event): void
{
$this->deletePireps(setting('pireps.delete_rejected_hours'), PirepState::REJECTED);
$this->deletePireps(setting('pireps.delete_cancelled_hours'), PirepState::CANCELLED);
}
/**
* Look for and delete PIREPs which match the criteria
*
* @param int $expire_time_hours The time in hours to look for PIREPs
* @param int $state The PirepState enum value
*/
protected function deletePireps(int $expire_time_hours, int $state)
{
$dt = Carbon::now('UTC')->subHours($expire_time_hours);
$pireps = Pirep::where('created_at', '<', $dt)
->where(['state' => $state])
->where('status', '<>', PirepStatus::PAUSED)
->get();
/** @var PirepService $pirepSvc */
$pirepSvc = app(PirepService::class);
/** @var Pirep $pirep */
foreach ($pireps as $pirep) {
Log::info('Cron: Deleting PIREP id='.$pirep->id.', state='.PirepState::label($state));
$pirepSvc->delete($pirep);
}
}
}

View File

@@ -25,7 +25,7 @@ class RemoveExpiredBids extends Listener
return;
}
$date = Carbon::now()->subHours(setting('bids.expire_time'));
Bid::whereDate('created_at', '<', $date)->delete();
$date = Carbon::now('UTC')->subHours(setting('bids.expire_time'));
Bid::where('created_at', '<', $date)->delete();
}
}

View File

@@ -4,8 +4,12 @@ namespace App\Cron\Hourly;
use App\Contracts\Listener;
use App\Events\CronHourly;
use App\Events\PirepCancelled;
use App\Models\Enums\PirepState;
use App\Models\Enums\PirepStatus;
use App\Models\Pirep;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
/**
* Remove expired live flights
@@ -13,7 +17,7 @@ use Carbon\Carbon;
class RemoveExpiredLiveFlights extends Listener
{
/**
* Remove expired live flights
* Remove expired live flights that haven't had an update in the live time
*
* @param CronHourly $event
*
@@ -25,9 +29,16 @@ class RemoveExpiredLiveFlights extends Listener
return;
}
$date = Carbon::now()->subHours(setting('acars.live_time'));
Pirep::whereDate('created_at', '<', $date)
$date = Carbon::now('UTC')->subHours(setting('acars.live_time'));
$pireps = Pirep::where('updated_at', '<', $date)
->where('state', PirepState::IN_PROGRESS)
->delete();
->where('status', '<>', PirepStatus::PAUSED)
->get();
foreach ($pireps as $pirep) {
event(new PirepCancelled($pirep));
Log::info('Cron: Deleting Expired Live PIREP id='.$pirep->id.', state='.PirepState::label($pirep->state));
$pirep->delete();
}
}
}

View File

@@ -6,13 +6,14 @@ use App\Contracts\Listener;
use App\Events\CronMonthly;
use App\Models\Enums\ExpenseType;
use App\Services\Finance\RecurringFinanceService;
use Illuminate\Support\Facades\Log;
/**
* Go through and apply any finances that are daily
*/
class ApplyExpenses extends Listener
{
private $financeSvc;
private RecurringFinanceService $financeSvc;
/**
* ApplyExpenses constructor.
@@ -35,6 +36,7 @@ class ApplyExpenses extends Listener
*/
public function handle(CronMonthly $event): void
{
Log::info('Monthly: Applying monthly expenses');
$this->financeSvc->processExpenses(ExpenseType::MONTHLY);
}
}

View File

@@ -6,13 +6,14 @@ use App\Contracts\Listener;
use App\Events\CronNightly;
use App\Models\Enums\ExpenseType;
use App\Services\Finance\RecurringFinanceService;
use Illuminate\Support\Facades\Log;
/**
* Go through and apply any finances that are daily
*/
class ApplyExpenses extends Listener
{
private $financeSvc;
private RecurringFinanceService $financeSvc;
/**
* ApplyExpenses constructor.
@@ -35,6 +36,7 @@ class ApplyExpenses extends Listener
*/
public function handle(CronNightly $event): void
{
Log::info('Nightly: Applying daily expenses');
$this->financeSvc->processExpenses(ExpenseType::DAILY);
}
}

View File

@@ -5,13 +5,11 @@ namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly;
use App\Services\VersionService;
use Illuminate\Support\Facades\Log;
/**
* Determine if any pilots should be set to ON LEAVE status
*/
class NewVersionCheck extends Listener
{
private $versionSvc;
private VersionService $versionSvc;
/**
* @param VersionService $versionSvc
@@ -28,6 +26,7 @@ class NewVersionCheck extends Listener
*/
public function handle(CronNightly $event): void
{
Log::info('Nightly: Checking for new version');
$this->versionSvc->isNewVersionAvailable();
}
}

View File

@@ -4,20 +4,20 @@ namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly;
use App\Models\Enums\UserState;
use App\Models\User;
use App\Services\UserService;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
/**
* Determine if any pilots should be set to ON LEAVE status
*/
class PilotLeave extends Listener
{
private $userSvc;
private UserService $userSvc;
/**
* PilotLeave constructor.
*
* @param UserService $userSvc
*/
public function __construct(UserService $userSvc)
{
@@ -34,13 +34,9 @@ class PilotLeave extends Listener
*/
public function handle(CronNightly $event): void
{
if (setting('pilots.auto_leave_days') === 0) {
return;
}
$date = Carbon::now()->subDay(setting('pilots.auto_leave_days'));
$users = User::where('status', UserState::ACTIVE)
->whereDate('updated_at', '<', $date);
Log::info('Cron: Running pilot leave check');
$users = $this->userSvc->findUsersOnLeave();
Log::info('Found '.count($users).' users on leave');
foreach ($users as $user) {
Log::info('Setting user '.$user->ident.' to ON LEAVE status');

View File

@@ -6,14 +6,14 @@ use App\Contracts\Listener;
use App\Events\CronNightly;
use App\Models\Journal;
use App\Repositories\JournalRepository;
use Log;
use Illuminate\Support\Facades\Log;
/**
* This recalculates the balances on all of the journals
*/
class RecalculateBalances extends Listener
{
private $journalRepo;
private JournalRepository $journalRepo;
/**
* Nightly constructor.
@@ -35,7 +35,7 @@ class RecalculateBalances extends Listener
*/
public function handle(CronNightly $event): void
{
Log::info('Recalculating balances');
Log::info('Nightly: Recalculating balances');
$journals = Journal::all();
foreach ($journals as $journal) {

View File

@@ -4,6 +4,7 @@ namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly;
use App\Services\AircraftService;
use App\Services\UserService;
use Illuminate\Support\Facades\Log;
@@ -12,11 +13,13 @@ use Illuminate\Support\Facades\Log;
*/
class RecalculateStats extends Listener
{
private $userSvc;
private AircraftService $aircraftSvc;
private UserService $userSvc;
public function __construct(UserService $userService)
public function __construct(AircraftService $aircraftSvc, UserService $userSvc)
{
$this->userSvc = $userService;
$this->aircraftSvc = $aircraftSvc;
$this->userSvc = $userSvc;
}
/**
@@ -29,10 +32,10 @@ class RecalculateStats extends Listener
*/
public function handle(CronNightly $event): void
{
Log::info('Recalculating balances');
Log::info('Nightly: Recalculating user stats');
$this->userSvc->recalculateAllUserStats();
Log::info('Done recalculating stats');
Log::info('Nightly: Recalcuating aircraft status');
$this->aircraftSvc->recalculateStats();
}
}

View File

@@ -19,6 +19,8 @@ class SetActiveFlights extends Listener
*/
public function handle(CronNightly $event): void
{
Log::info('Nightly: Setting active flights');
$this->checkFlights();
}
@@ -42,23 +44,18 @@ class SetActiveFlights extends Listener
continue;
}
// Set to visible by default
$flight->visible = true;
// dates aren't set, so just save if there were any changes above
// and move onto the next one
if ($flight->start_date === null || $flight->end_date === null) {
if ($flight->days !== null && $flight->days > 0) {
$visible = Days::isToday($flight->days);
if ($flight->visible !== $visible) {
Log::info('Flight '.$flight->ident.' to '.($visible ? 'shown' : 'hidden'));
$flight->visible = $visible;
if ($visible === false) {
Log::info('Today='.date('N').', start=no, mask='.$flight->days.', in='
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
}
$flight->visible = Days::isToday($flight->days);
if (!$flight->visible) {
Log::info('Today='.date('N').', start=no, mask='.$flight->days.', in='
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
}
} else {
Log::info('Toggling flight '.$flight->ident.' to visible');
$flight->visible = true;
}
$flight->save();
@@ -71,20 +68,11 @@ class SetActiveFlights extends Listener
// and then make sure if days of the week are specified, check that too
if ($today->gte($flight->start_date) && $today->lte($flight->end_date)) {
if ($flight->days !== null && $flight->days > 0) {
$visible = Days::isToday($flight->days);
if ($flight->visible !== $visible) {
Log::info('Toggling flight '.$flight->ident.' to '.($visible ? 'shown' : 'hidden').'');
$flight->visible = $visible;
if ($visible === false) {
Log::info('Today='.date('N').', start='.$flight->start_date
.', end='.$flight->end_date.', mask='.$flight->days.', in='
$flight->visible = Days::isToday($flight->days);
if (!$flight->visible) {
Log::info('Today='.date('N').', start=no, mask='.$flight->days.', in='
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
}
}
} else {
Log::info('Toggling flight '.$flight->ident.' to visible');
$flight->visible = true;
}
} else {
$flight->visible = false;

View File

@@ -1,23 +1,43 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\Acars::class, function (Faker $faker) {
return [
'id' => null,
'pirep_id' => null,
'log' => $faker->text(100),
'lat' => $faker->latitude,
'lon' => $faker->longitude,
'distance' => $faker->randomFloat(2, 0, 6000),
'heading' => $faker->numberBetween(0, 359),
'altitude' => $faker->numberBetween(20, 400),
'vs' => $faker->numberBetween(-5000, 5000),
'gs' => $faker->numberBetween(300, 500),
'transponder' => $faker->numberBetween(200, 9999),
'autopilot' => $faker->text(10),
'fuel' => $faker->randomFloat(2, 100, 1000),
'fuel_flow' => $faker->randomFloat(2, 100, 1000),
'sim_time' => $faker->dateTime('now', 'UTC'),
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Acars;
use DateTime;
class AcarsFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Acars::class;
/**
* @return array <string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'pirep_id' => null,
'log' => $this->faker->text(100),
'lat' => $this->faker->latitude,
'lon' => $this->faker->longitude,
'distance' => $this->faker->randomFloat(2, 0, 6000),
'heading' => $this->faker->numberBetween(0, 359),
'altitude' => $this->faker->numberBetween(20, 400),
'vs' => $this->faker->numberBetween(-5000, 5000),
'gs' => $this->faker->numberBetween(300, 500),
'transponder' => $this->faker->numberBetween(200, 9999),
'autopilot' => $this->faker->text(10),
'fuel' => $this->faker->randomFloat(2, 100, 1000),
'fuel_flow' => $this->faker->randomFloat(2, 100, 1000),
'sim_time' => $this->faker->dateTime('now', 'UTC')->format(DateTime::ATOM),
];
}
}

View File

@@ -1,27 +1,51 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\Aircraft::class, function (Faker $faker) {
return [
'id' => null,
'subfleet_id' => function () {
return factory(App\Models\Subfleet::class)->create()->id;
},
'airport_id' => function () {
return factory(App\Models\Airport::class)->create()->id;
},
'iata' => $faker->unique()->text(5),
'icao' => $faker->unique()->text(5),
'name' => $faker->text(50),
'registration' => $faker->unique()->text(10),
'hex_code' => \App\Support\ICAO::createHexCode(),
'zfw' => $faker->randomFloat(2, 0, 50000),
'status' => \App\Models\Enums\AircraftStatus::ACTIVE,
'state' => \App\Models\Enums\AircraftState::PARKED,
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
'updated_at' => function (array $pirep) {
return $pirep['created_at'];
},
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Aircraft;
use App\Models\Airport;
use App\Models\Enums\AircraftState;
use App\Models\Enums\AircraftStatus;
use App\Models\Subfleet;
use App\Support\ICAO;
use DateTime;
class AircraftFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Aircraft::class;
/**
* Define the model's default state.
*
* @throws \Exception
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'subfleet_id' => fn () => Subfleet::factory()->create()->id,
'airport_id' => fn () => Airport::factory()->create()->id,
'iata' => $this->faker->unique()->text(5),
'icao' => $this->faker->unique()->text(5),
'name' => $this->faker->text(50),
'registration' => $this->faker->unique()->text(10),
'hex_code' => ICAO::createHexCode(),
'mtow' => $this->faker->randomFloat(2, 0, 50000),
'zfw' => $this->faker->randomFloat(2, 0, 50000),
'status' => AircraftStatus::ACTIVE,
'state' => AircraftState::PARKED,
'created_at' => $this->faker->dateTimeBetween('-1 week')->format(DateTime::ATOM),
'updated_at' => fn (array $pirep) => $pirep['created_at'],
];
}
}

View File

@@ -1,25 +1,41 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Airline;
use Hashids\Hashids;
/*
* Add any number of airports. Don't really care if they're real or not
*/
$factory->define(App\Models\Airline::class, function (Faker $faker) {
return [
'id' => null,
'icao' => function (array $apt) use ($faker) {
$hashids = new Hashids(microtime(), 5);
$mt = str_replace('.', '', microtime(true));
class AirlineFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Airline::class;
return $hashids->encode($mt);
},
'iata' => function (array $apt) {
return $apt['icao'];
},
'name' => $faker->sentence(3),
'country' => $faker->country,
'active' => 1,
];
});
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'icao' => function (array $apt): string {
$hashids = new Hashids(microtime(), 5);
$mt = str_replace('.', '', microtime(true));
return $hashids->encode($mt);
},
'iata' => fn (array $apt) => $apt['icao'],
'name' => $this->faker->sentence(3),
'country' => $this->faker->country,
'active' => 1,
];
}
}

View File

@@ -1,17 +1,36 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
/*
* Create an ICAO for use in the factory.
*/
if (!function_exists('createFactoryICAO')) {
function createFactoryICAO(): string
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Airport;
class AirportFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Airport::class;
protected array $usedIcaos = [];
/**
* Generate a fake ICAO
*
* @throws \Exception
*
* @return string
*/
protected function createFactoryICAO(): string
{
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$max = strlen($characters) - 1;
$string = '';
for ($i = 0; $i < 4; $i++) {
for ($i = 0; $i < 5; $i++) {
try {
$string .= $characters[random_int(0, $max)];
} catch (Exception $e) {
@@ -20,36 +39,35 @@ if (!function_exists('createFactoryICAO')) {
return $string;
}
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => function () {
do {
$airport = $this->createFactoryICAO();
} while (in_array($airport, $this->usedIcaos, true));
return $airport;
},
'icao' => fn (array $apt) => $apt['id'],
'iata' => fn (array $apt) => $apt['id'],
'name' => $this->faker->sentence(3),
'country' => $this->faker->country,
'timezone' => $this->faker->timezone,
'lat' => $this->faker->latitude,
'lon' => $this->faker->longitude,
'hub' => false,
'notes' => null,
'ground_handling_cost' => $this->faker->randomFloat(2, 0, 500),
'fuel_100ll_cost' => $this->faker->randomFloat(2, 1, 10),
'fuel_jeta_cost' => $this->faker->randomFloat(2, 1, 10),
'fuel_mogas_cost' => $this->faker->randomFloat(2, 1, 10),
];
}
}
/*
* Add any number of airports. Don't really care if they're real or not
*/
$factory->define(App\Models\Airport::class, function (Faker $faker) {
$used = [];
return [
'id' => function () use ($used) {
do {
$string = createFactoryICAO();
} while (in_array($string, $used, true));
return $string;
},
'icao' => function (array $apt) {
return $apt['id'];
},
'iata' => function (array $apt) {
return $apt['id'];
},
'name' => $faker->sentence(3),
'country' => $faker->country,
'timezone' => $faker->timezone,
'lat' => $faker->latitude,
'lon' => $faker->longitude,
'hub' => false,
'ground_handling_cost' => $faker->randomFloat(2, 0, 500),
'fuel_100ll_cost' => $faker->randomFloat(2, 1, 10),
'fuel_jeta_cost' => $faker->randomFloat(2, 1, 10),
'fuel_mogas_cost' => $faker->randomFloat(2, 1, 10),
];
});

View File

@@ -0,0 +1,34 @@
<?php
/** @noinspection PhpIllegalPsrClassPathInspection */
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Award;
class AwardFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Award::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'name' => $this->faker->name,
'description' => $this->faker->text(10),
'ref_model' => null,
'ref_model_params' => null,
];
}
}

View File

@@ -1,13 +0,0 @@
<?php
use Faker\Generator as Faker;
$factory->define(App\Models\Award::class, function (Faker $faker) {
return [
'id' => null,
'name' => $faker->name,
'description' => $faker->text(10),
'ref_model' => null,
'ref_model_params' => null,
];
});

View File

@@ -1,18 +1,39 @@
<?php
use App\Models\Enums\ExpenseType;
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\Expense::class, function (Faker $faker) {
return [
'id' => null,
'airline_id' => null,
'name' => $faker->text(20),
'amount' => $faker->randomFloat(2, 100, 1000),
'type' => ExpenseType::FLIGHT,
'multiplier' => false,
'ref_model' => \App\Models\Expense::class,
'ref_model_id' => null,
'active' => true,
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Enums\ExpenseType;
use App\Models\Expense;
class ExpenseFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Expense::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'airline_id' => null,
'name' => $this->faker->text(20),
'amount' => $this->faker->randomFloat(2, 100, 1000),
'type' => ExpenseType::FLIGHT,
'multiplier' => false,
'ref_model' => \App\Models\Expense::class,
'ref_model_id' => null,
'active' => true,
];
}
}

View File

@@ -1,16 +1,35 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\Fare::class, function (Faker $faker) {
return [
'id' => null,
'code' => $faker->unique()->text(50),
'name' => $faker->text(50),
'price' => $faker->randomFloat(2, 100, 1000),
'cost' => function (array $fare) {
return round($fare['price'] / 2);
},
'capacity' => $faker->randomFloat(0, 20, 500),
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Fare;
class FareFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Fare::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'code' => $this->faker->unique()->text(50),
'name' => $this->faker->text(50),
'price' => $this->faker->randomFloat(2, 100, 1000),
'cost' => fn (array $fare) => round($fare['price'] / 2),
'capacity' => $this->faker->randomFloat(0, 20, 500),
];
}
}

View File

@@ -1,42 +1,58 @@
<?php
/**
* Create flights
*/
use Faker\Generator as Faker;
$factory->define(App\Models\Flight::class, function (Faker $faker) {
return [
'id' => $faker->unique()->numberBetween(10, 10000000),
'airline_id' => function () {
return factory(App\Models\Airline::class)->create()->id;
},
'flight_number' => $faker->unique()->numberBetween(10, 1000000),
'route_code' => $faker->randomElement(['', $faker->text(5)]),
'route_leg' => $faker->randomElement(['', $faker->numberBetween(0, 1000)]),
'dpt_airport_id' => function () {
return factory(App\Models\Airport::class)->create()->id;
},
'arr_airport_id' => function () {
return factory(App\Models\Airport::class)->create()->id;
},
'alt_airport_id' => function () {
return factory(App\Models\Airport::class)->create()->id;
},
'distance' => $faker->numberBetween(1, 1000),
'route' => null,
'level' => 0,
'dpt_time' => $faker->time(),
'arr_time' => $faker->time(),
'flight_time' => $faker->numberBetween(60, 360),
'has_bid' => false,
'active' => true,
'visible' => true,
'days' => 0,
'start_date' => null,
'end_date' => null,
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
'updated_at' => static function (array $flight) {
return $flight['created_at'];
},
];
});
/** @noinspection PhpIllegalPsrClassPathInspection */
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Flight;
use DateTime;
class FlightFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Flight::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => $this->faker->unique()->numberBetween(10, 10000000),
'airline_id' => fn () => \App\Models\Airline::factory()->create()->id,
'flight_number' => $this->faker->unique()->numberBetween(10, 1000000),
'route_code' => $this->faker->randomElement(['', $this->faker->text(5)]),
'route_leg' => $this->faker->randomElement(
['', $this->faker->numberBetween(0, 1000)]
),
'dpt_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'arr_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'alt_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'distance' => $this->faker->numberBetween(1, 1000),
'route' => null,
'level' => 0,
'dpt_time' => $this->faker->time(),
'arr_time' => $this->faker->time(),
'flight_time' => $this->faker->numberBetween(60, 360),
'load_factor' => $this->faker->randomElement([15, 20, 50, 90, 100]),
'load_factor_variance' => $this->faker->randomElement([15, 20, 50, 90, 100]),
'has_bid' => false,
'active' => true,
'visible' => true,
'days' => 0,
'start_date' => null,
'end_date' => null,
'created_at' => $this->faker->dateTimeBetween('-1 week')->format(
DateTime::ATOM
),
'updated_at' => static fn (array $flight) => $flight['created_at'],
];
}
}

View File

@@ -1,9 +1,30 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\Journal::class, function (Faker $faker) {
return [
'currency' => 'USD',
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Journal;
class JournalFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Journal::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'currency' => 'USD',
];
}
}

View File

@@ -1,17 +1,39 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\JournalTransactions::class, function (Faker $faker) {
return [
'transaction_group' => \Ramsey\Uuid\Uuid::uuid4()->toString(),
'journal_id' => function () {
return factory(App\Models\Journal::class)->create()->id;
},
'credit' => $faker->numberBetween(100, 10000),
'debit' => $faker->numberBetween(100, 10000),
'currency' => 'USD',
'memo' => $faker->sentence(6),
'post_date' => \Carbon\Carbon::now(),
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Journal;
use App\Models\JournalTransaction;
use Carbon\Carbon;
use Ramsey\Uuid\Uuid;
class JournalTransactionsFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = JournalTransaction::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'transaction_group' => Uuid::uuid4()->toString(),
'journal_id' => fn () => Journal::factory()->create()->id,
'credit' => $this->faker->numberBetween(100, 10000),
'debit' => $this->faker->numberBetween(100, 10000),
'currency' => 'USD',
'memo' => $this->faker->sentence(6),
'post_date' => Carbon::now('UTC')->toDateTimeString(),
];
}
}

View File

@@ -1,15 +1,36 @@
<?php
use App\Models\Enums\NavaidType;
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\Navdata::class, function (Faker $faker) {
return [
'id' => str_replace(' ', '', str_replace('.', '', $faker->unique()->text(5))),
'name' => str_replace('.', '', $faker->unique()->word),
'type' => $faker->randomElement([NavaidType::VOR, NavaidType::NDB]),
'lat' => $faker->latitude,
'lon' => $faker->longitude,
'freq' => $faker->randomFloat(2, 100, 1000),
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Enums\NavaidType;
use App\Models\Navdata;
class NavdataFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Navdata::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => str_replace(' ', '', str_replace('.', '', $this->faker->unique()->text(5))),
'name' => str_replace('.', '', $this->faker->unique()->word),
'type' => $this->faker->randomElement([NavaidType::VOR, NavaidType::NDB]),
'lat' => $this->faker->latitude,
'lon' => $this->faker->longitude,
'freq' => $this->faker->randomFloat(2, 100, 1000),
];
}
}

View File

@@ -1,14 +1,33 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\News::class, function (Faker $faker) {
return [
'id' => null,
'user_id' => function () {
return factory(App\Models\User::class)->create()->id;
},
'subject' => $faker->text(),
'body' => $faker->sentence,
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\News;
class NewsFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = News::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'user_id' => fn () => \App\Models\User::factory()->create()->id,
'subject' => $this->faker->text(),
'body' => $this->faker->sentence,
];
}
}

View File

@@ -1,69 +1,74 @@
<?php
/** @noinspection PhpIllegalPsrClassPathInspection */
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Airline;
use App\Models\Enums\PirepSource;
use App\Models\Enums\PirepState;
use App\Models\Enums\PirepStatus;
use App\Models\Flight;
use App\Models\Pirep;
use Carbon\Carbon;
use Faker\Generator as Faker;
/*
* Create a new PIREP
*/
$factory->define(App\Models\Pirep::class, function (Faker $faker) {
$airline = factory(App\Models\Airline::class)->create();
$flight = factory(App\Models\Flight::class)->create([
'airline_id' => $airline->id,
]);
class PirepFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Pirep::class;
return [
'id' => $faker->unique()->numberBetween(10, 10000000),
'airline_id' => function () use ($airline) {
return $airline->id;
},
'user_id' => function () {
return factory(App\Models\User::class)->create()->id;
},
'aircraft_id' => function () {
return factory(App\Models\Aircraft::class)->create()->id;
},
'flight_id' => function () use ($flight) {
return $flight->id;
},
'flight_number' => function () use ($flight) {
return $flight->flight_number;
},
'route_code' => null,
'route_leg' => null,
'dpt_airport_id' => function () use ($flight) {
return $flight->dpt_airport_id;
},
'arr_airport_id' => function () use ($flight) {
return $flight->arr_airport_id;
},
'level' => $faker->numberBetween(20, 400),
'distance' => $faker->randomFloat(2, 0, 6000),
'planned_distance' => $faker->randomFloat(2, 0, 6000),
'flight_time' => $faker->numberBetween(60, 360),
'planned_flight_time' => $faker->numberBetween(60, 360),
'zfw' => $faker->randomFloat(2),
'block_fuel' => $faker->randomFloat(2, 0, 1000),
'fuel_used' => function (array $pirep) {
return round($pirep['block_fuel'] * .9, 2); // 90% of the fuel loaded was used
},
'block_on_time' => Carbon::now('UTC'),
'block_off_time' => function (array $pirep) {
return $pirep['block_on_time']->subMinutes($pirep['flight_time']);
},
'route' => $faker->text(200),
'notes' => $faker->text(200),
'source' => $faker->randomElement([PirepSource::MANUAL, PirepSource::ACARS]),
'source_name' => 'TestFactory',
'state' => PirepState::PENDING,
'status' => PirepStatus::SCHEDULED,
'submitted_at' => Carbon::now('UTC')->toDateTimeString(),
'created_at' => Carbon::now('UTC')->toDateTimeString(),
'updated_at' => function (array $pirep) {
return $pirep['created_at'];
},
];
});
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
/** @var Airline $airline */
$airline = Airline::factory()->create();
/** @var Flight $flight */
$flight = Flight::factory()->create(['airline_id' => $airline->id]);
return [
'id' => $this->faker->unique()->numberBetween(10, 10000000),
'airline_id' => fn () => $airline->id,
'user_id' => fn () => \App\Models\User::factory()->create()->id,
'aircraft_id' => fn () => \App\Models\Aircraft::factory()->create()->id,
'flight_id' => fn () => $flight->id,
'flight_number' => fn () => $flight->flight_number,
'route_code' => null,
'route_leg' => null,
'dpt_airport_id' => fn () => $flight->dpt_airport_id,
'arr_airport_id' => fn () => $flight->arr_airport_id,
'level' => $this->faker->numberBetween(20, 400),
'distance' => $this->faker->randomFloat(2, 0, 6000),
'planned_distance' => $this->faker->randomFloat(2, 0, 6000),
'flight_time' => $this->faker->numberBetween(60, 360),
'planned_flight_time' => $this->faker->numberBetween(60, 360),
'zfw' => $this->faker->randomFloat(2),
'block_fuel' => $this->faker->randomFloat(2, 0, 1000),
'fuel_used' => fn (array $pirep) => round($pirep['block_fuel'] * .9, 2),
'block_on_time' => Carbon::now('UTC'),
'block_off_time' => fn (array $pirep) => $pirep['block_on_time']->subMinutes(
$pirep['flight_time']
),
'route' => $this->faker->text(200),
'notes' => $this->faker->text(200),
'source' => $this->faker->randomElement(
[PirepSource::MANUAL, PirepSource::ACARS]
),
'source_name' => 'TestFactory',
'state' => PirepState::PENDING,
'status' => PirepStatus::SCHEDULED,
'submitted_at' => Carbon::now('UTC')->toDateTimeString(),
'created_at' => Carbon::now('UTC')->toDateTimeString(),
'updated_at' => fn (array $pirep) => $pirep['created_at'],
];
}
}

View File

@@ -1,23 +1,37 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
/*
* id: 2
name: Junior First Officer
hours: 10
auto_approve_acars: 1
auto_approve_manual: 1
*/
$factory->define(App\Models\Rank::class, function (Faker $faker) {
return [
'id' => null,
'name' => $faker->unique()->text(50),
'hours' => $faker->numberBetween(10, 50),
'acars_base_pay_rate' => $faker->numberBetween(10, 100),
'manual_base_pay_rate' => $faker->numberBetween(10, 100),
'auto_approve_acars' => 0,
'auto_approve_manual' => 0,
'auto_promote' => 0,
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Rank;
class RankFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Rank::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'name' => $this->faker->unique()->text(50),
'hours' => $this->faker->numberBetween(10, 50),
'acars_base_pay_rate' => $this->faker->numberBetween(10, 100),
'manual_base_pay_rate' => $this->faker->numberBetween(10, 100),
'auto_approve_acars' => 0,
'auto_approve_manual' => 0,
'auto_promote' => 0,
];
}
}

View File

@@ -0,0 +1,34 @@
<?php
/** @noinspection PhpIllegalPsrClassPathInspection */
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Role;
class RoleFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Role::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'name' => $this->faker->name,
'display_name' => $this->faker->name,
'read_only' => false,
'disable_activity_checks' => $this->faker->boolean(),
];
}
}

View File

@@ -0,0 +1,38 @@
<?php
/** @noinspection PhpIllegalPsrClassPathInspection */
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\SimBrief;
use Carbon\Carbon;
class SimBriefFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = SimBrief::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
'id' => $this->faker->unique()->numberBetween(10, 10000000),
'user_id' => null,
'flight_id' => null,
'pirep_id' => null,
'acars_xml' => '',
'ofp_xml' => '',
'created_at' => Carbon::now('UTC')->toDateTimeString(),
'updated_at' => fn (array $sb) => $sb['created_at'],
];
}
}

View File

@@ -1,15 +1,34 @@
<?php
use Faker\Generator as Faker;
/** @noinspection PhpIllegalPsrClassPathInspection */
$factory->define(App\Models\Subfleet::class, function (Faker $faker) {
return [
'id' => null,
'airline_id' => function () {
return factory(App\Models\Airline::class)->create()->id;
},
'name' => $faker->unique()->text(50),
'type' => $faker->unique()->text(7),
'ground_handling_multiplier' => $faker->numberBetween(50, 200),
];
});
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Subfleet;
class SubfleetFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Subfleet::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'id' => null,
'airline_id' => fn () => \App\Models\Airline::factory()->create()->id,
'name' => $this->faker->unique()->text(50),
'type' => $this->faker->unique()->text(7),
'ground_handling_multiplier' => $this->faker->numberBetween(50, 200),
];
}
}

View File

@@ -1,26 +1,54 @@
<?php
/** @noinspection PhpIllegalPsrClassPathInspection */
namespace App\Database\Factories;
use App\Contracts\Factory;
use App\Models\Airline;
use App\Models\Enums\UserState;
use Faker\Generator as Faker;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
$factory->define(App\Models\User::class, function (Faker $faker) {
static $password;
class UserFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = User::class;
return [
'id' => null,
'pilot_id' => 0,
'name' => $faker->name,
'email' => $faker->safeEmail,
'password' => $password ?: $password = Hash::make('secret'),
'api_key' => $faker->sha1,
'airline_id' => function () {
return factory(App\Models\Airline::class)->create()->id;
},
'rank_id' => 1,
'flights' => $faker->numberBetween(0, 1000),
'flight_time' => $faker->numberBetween(0, 10000),
'transfer_time' => $faker->numberBetween(0, 10000),
'state' => UserState::ACTIVE,
'remember_token' => $faker->unique()->text(5),
];
});
/**
* @var string
*/
private static string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
if (empty(self::$password)) {
self::$password = Hash::make('secret');
}
return [
'id' => null,
'pilot_id' => null,
'name' => $this->faker->name,
'email' => $this->faker->safeEmail,
'password' => self::$password,
'api_key' => $this->faker->sha1,
'airline_id' => fn () => Airline::factory()->create()->id,
'rank_id' => 1,
'flights' => $this->faker->numberBetween(0, 1000),
'flight_time' => $this->faker->numberBetween(0, 10000),
'transfer_time' => $this->faker->numberBetween(0, 10000),
'state' => UserState::ACTIVE,
'remember_token' => $this->faker->unique()->text(5),
];
}
}

View File

@@ -4,8 +4,7 @@ use App\Contracts\Migration;
use App\Services\Installer\SeederService;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsTable extends Migration
{
return new class() extends Migration {
private $seederSvc;
public function __construct()
@@ -50,4 +49,4 @@ class CreateSettingsTable extends Migration
{
Schema::dropIfExists('settings');
}
}
};

Some files were not shown because too many files have changed in this diff Show More