* 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
* 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>
* 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>
* 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.
* 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>
* 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
* 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
* 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 !
* 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.
* 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.
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.
* 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>
* 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
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.
* 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.
* 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>
* 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>
* 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>
* 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
* 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>
* 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)
* 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.
* 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
* 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>
* 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>
* 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>
* 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.
* 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>
* 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
* 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
* 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
* 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
* 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>
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>
* 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
* 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
* 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 :)
* Refactoring for Simbrief not working #1005
* Style fixes
* Update tests for new briefing URL
* Check the OFP user
* Comment out user check temporarily
* 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>
* 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>
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>
* 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
* 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
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).