From e9aaa85fc73277bc0a03c76b275fe8366e0d986d Mon Sep 17 00:00:00 2001 From: arv187 Date: Thu, 28 Jun 2018 00:16:58 +0200 Subject: [PATCH 01/15] ES translation --- resources/lang/es/auth.php | 19 ++ resources/lang/es/installer_messages.php | 246 +++++++++++++++++++++++ resources/lang/es/pagination.php | 19 ++ resources/lang/es/passwords.php | 23 +++ resources/lang/es/system.php | 106 ++++++++++ resources/lang/es/validation.php | 120 +++++++++++ 6 files changed, 533 insertions(+) create mode 100644 resources/lang/es/auth.php create mode 100644 resources/lang/es/installer_messages.php create mode 100644 resources/lang/es/pagination.php create mode 100644 resources/lang/es/passwords.php create mode 100644 resources/lang/es/system.php create mode 100644 resources/lang/es/validation.php diff --git a/resources/lang/es/auth.php b/resources/lang/es/auth.php new file mode 100644 index 00000000..47bad3f1 --- /dev/null +++ b/resources/lang/es/auth.php @@ -0,0 +1,19 @@ + 'Estas credenciales no coinciden con nuestros registros.', + 'throttle' => 'Demasiados intentos de inicio de sesión. Por favor intente nuevamente en :seconds segundos.', + +]; diff --git a/resources/lang/es/installer_messages.php b/resources/lang/es/installer_messages.php new file mode 100644 index 00000000..45b4f56b --- /dev/null +++ b/resources/lang/es/installer_messages.php @@ -0,0 +1,246 @@ + 'Instalador de phpVMS', + 'next' => 'Siguiente', + 'back' => 'Anterior', + 'finish' => 'Instalar', + 'forms' => [ + 'errorTitle' => 'Ocurrieron los siguientes errores:', + ], + + /** + * + * Home page translations. + * + */ + 'welcome' => [ + 'templateTitle' => 'Bienvenido', + 'title' => 'Instalador de phpVMS', + 'message' => 'Instalación fácil y asistente de configuración.', + 'next' => 'Comprobar requisitios', + ], + + /** + * + * Requirements page translations. + * + */ + 'requirements' => [ + 'templateTitle' => 'Paso 1 | Requisitos del Servidor', + 'title' => 'Requisitos del servidor', + 'next' => 'Comprobar permisos', + ], + + /** + * + * Permissions page translations. + * + */ + 'permissions' => [ + 'templateTitle' => 'Paso 2 | Permisos', + 'title' => 'Permisos', + 'next' => 'Configurar entorno', + ], + + /** + * + * Environment page translations. + * + */ + 'environment' => [ + 'menu' => [ + 'templateTitle' => 'Paso 3 | Configuración de entorno', + 'title' => 'Configuraciones de entorno', + 'desc' => 'Seleccione cómo desea configurar las aplicaciones .env archivo.', + 'wizard-button' => 'Desde el asistente', + 'classic-button' => 'Editor de texto clásico', + ], + 'wizard' => [ + 'templateTitle' => 'Paso 3 | Configuraciones de entorno | Asistente guíado', + 'title' => 'Asistente .env guíado', + 'tabs' => [ + 'environment' => 'Entorno', + 'database' => 'Base de datos', + 'application' => 'Aplicación' + ], + 'form' => [ + 'name_required' => 'Un nombre de entorno es requerido.', + 'app_name_label' => 'Nombre de la aplicación', + 'app_name_placeholder' => 'Nombre de la aplicación', + 'app_environment_label' => 'Entorno de aplicación', + 'app_environment_label_local' => 'Local', + 'app_environment_label_developement' => 'Desarrollo', + 'app_environment_label_qa' => 'QA', + 'app_environment_label_production' => 'Producción', + 'app_environment_label_other' => 'Otra', + 'app_environment_placeholder_other' => 'Introduce tu entorno...', + 'app_debug_label' => 'Debug de aplicación', + 'app_debug_label_true' => 'Verdadero', + 'app_debug_label_false' => 'Falso', + 'app_log_level_label' => 'Nivel de LOG de la aplicación', + 'app_log_level_label_debug' => 'debug', + 'app_log_level_label_info' => 'info', + 'app_log_level_label_notice' => 'aviso', + 'app_log_level_label_warning' => 'advertencia', + 'app_log_level_label_error' => 'error', + 'app_log_level_label_critical' => 'critico', + 'app_log_level_label_alert' => 'alerta', + 'app_log_level_label_emergency' => 'emergencía', + 'app_url_label' => 'URL de la App', + 'app_url_placeholder' => 'URL App ', + 'db_connection_label' => 'Conexión base de datos', + 'db_connection_label_mysql' => 'mysql', + 'db_connection_label_sqlite' => 'sqlite', + 'db_connection_label_pgsql' => 'pgsql', + 'db_connection_label_sqlsrv' => 'sqlsrv', + 'db_host_label' => 'Database: Host', + 'db_host_placeholder' => 'Database: Host', + 'db_port_label' => 'Database: Puerto', + 'db_port_placeholder' => 'Database: Puerto', + 'db_name_label' => 'Database: Nombre', + 'db_name_placeholder' => 'Database: Nombre', + 'db_username_label' => 'Database: Nombre usuario', + 'db_username_placeholder' => 'Database: Nombre usuario', + 'db_password_label' => 'Database: Contraseña', + 'db_password_placeholder' => 'Database: Contraseña', + + 'app_tabs' => [ + 'more_info' => 'Más info', + 'broadcasting_title' => 'Broadcasting, Caching, Session, & Queue', + 'broadcasting_label' => 'Broadcast Driver', + 'broadcasting_placeholder' => 'Broadcast Driver', + 'cache_label' => 'Cache Driver', + 'cache_placeholder' => 'Cache Driver', + 'session_label' => 'Session Driver', + 'session_placeholder' => 'Session Driver', + 'queue_label' => 'Queue Driver', + 'queue_placeholder' => 'Queue Driver', + 'redis_label' => 'Redis Driver', + 'redis_host' => 'Redis Host', + 'redis_password' => 'Redis Password', + 'redis_port' => 'Redis Port', + + 'mail_label' => 'Mail', + 'mail_driver_label' => 'Mail Driver', + 'mail_driver_placeholder' => 'Mail Driver', + 'mail_host_label' => 'Mail Host', + 'mail_host_placeholder' => 'Mail Host', + 'mail_port_label' => 'Mail Port', + 'mail_port_placeholder' => 'Mail Port', + 'mail_username_label' => 'Mail Username', + 'mail_username_placeholder' => 'Mail Username', + 'mail_password_label' => 'Mail Password', + 'mail_password_placeholder' => 'Mail Password', + 'mail_encryption_label' => 'Mail Encryption', + 'mail_encryption_placeholder' => 'Mail Encryption', + + 'pusher_label' => 'Pusher', + 'pusher_app_id_label' => 'Pusher App Id', + 'pusher_app_id_palceholder' => 'Pusher App Id', + 'pusher_app_key_label' => 'Pusher App Key', + 'pusher_app_key_palceholder' => 'Pusher App Key', + 'pusher_app_secret_label' => 'Pusher App Secret', + 'pusher_app_secret_palceholder' => 'Pusher App Secret', + ], + 'buttons' => [ + 'setup_database' => 'Configurar base de datos', + 'setup_application' => 'Configurar aplicación', + 'install' => 'Instalar', + ], + ], + ], + 'classic' => [ + 'templateTitle' => 'Paso 3 | Configuración de entorno | Editor clásico', + 'title' => 'Editor de entorno cásico', + 'save' => 'Guardar .env', + 'back' => 'Usar el asistente de formulario', + 'install' => 'Guardar e instalar', + ], + 'success' => 'Tu archivo de configuración .env ha sido guardado.', + 'errors' => 'No se ha guardado el archivo .env , Crealo manualmente.', + ], + + 'install' => 'Instalar', + + /** + * + * Installed Log translations. + * + */ + 'installed' => [ + 'success_log_message' => 'Inslatador Laravel exitosamente creado en ', + ], + + /** + * + * Final page translations. + * + */ + 'final' => [ + 'title' => 'Instalación finalizada', + 'templateTitle' => 'Instalación finalizada', + 'finished' => 'La aplicación ha sido instalada exitosamente.', + 'migration' => 'Migración & salida de la consola:', + 'console' => 'Salida de la consola de la aplicación:', + 'log' => 'Instalación Log de entrada:', + 'env' => 'Final .env archivo:', + 'exit' => 'Clic aquí para salir', + ], + + /** + * + * Update specific translations + * + */ + 'updater' => [ + /** + * + * Shared translations. + * + */ + 'title' => 'Actualizador Laravel', + + /** + * + * Welcome page translations for update feature. + * + */ + 'welcome' => [ + 'title' => 'Bienvenido al actualizador', + 'message' => 'Bienvenido al asistente de actualización.', + ], + + /** + * + * Welcome page translations for update feature. + * + */ + 'overview' => [ + 'title' => 'Resumen', + 'message' => 'Hay 1 actualización.|Hay :number actualizaciones.', + 'install_updates' => "Instalar actualizaciones" + ], + + /** + * + * Final page translations. + * + */ + 'final' => [ + 'title' => 'Finalizado', + 'finished' => 'Aplicación/es actualizada/s con éxito.', + 'exit' => 'Clic aquí para salir', + ], + + 'log' => [ + 'success_message' => 'Inslatador Laravel exitosamente actualizado en ', + ], + ], +]; diff --git a/resources/lang/es/pagination.php b/resources/lang/es/pagination.php new file mode 100644 index 00000000..8993ea3f --- /dev/null +++ b/resources/lang/es/pagination.php @@ -0,0 +1,19 @@ + '« Anterior', + 'next' => 'Siguiente »', + +]; diff --git a/resources/lang/es/passwords.php b/resources/lang/es/passwords.php new file mode 100644 index 00000000..474bf9ee --- /dev/null +++ b/resources/lang/es/passwords.php @@ -0,0 +1,23 @@ + 'Las contraseñas deben tener al menos seis caracteres y coincidir con la confirmación.', + 'reset' => '¡Tu contraseña ha sido restablecida!', + 'sent' => '¡Le hemos enviado por correo electrónico el enlace de restablecimiento de contraseña!', + 'token' => 'Este token de restablecimiento de contraseña no es válido.', + 'user' => "No podemos encontrar un usuario con esa dirección de correo electrónico.", + +]; diff --git a/resources/lang/es/system.php b/resources/lang/es/system.php new file mode 100644 index 00000000..5173e5f1 --- /dev/null +++ b/resources/lang/es/system.php @@ -0,0 +1,106 @@ + [ + 'active' => 'Activo', + 'inactive' => 'Inactivo' + ], + + 'aircraft' => [ + 'status' => [ + 'active' => 'Activo', + 'stored' => 'Guardado', + 'retired' => 'Retirado', + 'scrapped' => 'Desguazado', + 'written' => 'Dado de baja', + ], + ], + + 'days' => [ + 'mon' => 'lunes', + 'tues' => 'martes', + 'wed' => 'miércoles', + 'thurs' => 'jueves', + 'fri' => 'viernes', + 'sat' => 'sábado', + 'sun' => 'domingo', + ], + + 'expenses' => [ + 'type' => [ + 'flight' => 'Por vuelo', + 'daily' => 'Diario', + 'monthly' => 'Mensual', + ], + ], + + 'flights' => [ + 'type' => [ + 'pass_scheduled' => 'Pasajero - Programado', + 'cargo_scheduled' => 'Carga - Programado', + 'charter_pass_only' => 'Charter - Pasajeros únicamente', + 'addtl_cargo_mail' => 'Carga/Correo adicional', + 'special_vip' => 'Vuelo VIP especial (Autoridad de Aviación Civil)', + 'pass_addtl' => 'Pasajero - Adicional', + 'charter_cargo' => 'Charter - Carga/Correo', + 'ambulance' => 'Vuelo ambulancia', + 'training_flight' => 'Vuelo de entrenamiento', + 'mail_service' => 'Servicio postal', + 'charter_special' => 'Charter con cargas especiales', + 'positioning' => 'Posicionamiento (Ferry/Entrega/Demo)', + 'technical_test' => 'Prueba técnica', + 'military' => 'Militar', + 'technical_stop' => 'Parada técnica', + ], + ], + + 'pireps' => [ + 'source' => [ + 'manual' => 'Manual', + 'acars' => 'ACARS', + ], + 'state' => [ + 'accepted' => 'Aceptado', + 'pending' => 'Pendiente', + 'rejected' => 'Rechazado', + 'in_progress' => 'En progreso', + 'cancelled' => 'Cancelado', + 'deleted' => 'Borrado', + 'draft' => 'Borrador', + ], + 'status' => [ + 'initialized' => 'Inicializado', + 'scheduled' => 'Programado', + 'boarding' => 'Embarcando', + 'ready_start' => 'Listo para empezar', + 'push_tow' => 'Pushback/remolcado', + 'departed' => 'Salió', + 'ready_deice' => 'Listo para deshielo', + 'deicing' => 'Deeshielo en progreso', + 'ground_ret' => 'Retorno a tierra', + 'taxi' => 'Taxi', + 'takeoff' => 'Despegue', + 'initial_clb' => 'Ascenso inicial', + 'enroute' => 'En ruta', + 'diverted' => 'Desviado', + 'approach' => 'En aproximación', + 'final_appr' => 'En aproximación final', + 'landing' => 'Aterrizando', + 'landed' => 'En tierra', + 'arrived' => 'Llegó', + 'cancelled' => 'Cancelado', + 'emerg_decent' => 'Descenso de emergencia', + ] + ], + + 'users' => [ + 'state' => [ + 'pending' => 'Pendiente', + 'active' => 'Activo', + 'rejected' => 'Rechazado', + 'on_leave' => 'De vacaciones', + 'suspended' => 'Suspendido', + ], + ], +]; diff --git a/resources/lang/es/validation.php b/resources/lang/es/validation.php new file mode 100644 index 00000000..8a5ab112 --- /dev/null +++ b/resources/lang/es/validation.php @@ -0,0 +1,120 @@ + 'El :attribute debe ser aceptado.', + 'active_url' => 'El :attribute No es una URL valida.', + 'after' => 'El :attribute debe ser una fecha después de :date.', + 'alpha' => 'El :attribute solo puede contener letras.', + 'alpha_dash' => 'El :attribute solo puede contener letras, números, y guiones.', + 'alpha_num' => 'El :attribute solo puede contener letras y números.', + 'array' => 'El :attribute debe ser un array.', + 'before' => 'El :attribute debe ser una fecha antes de :date.', + 'between' => [ + 'numeric' => 'El :attribute debe estar entre :min and :max.', + 'file' => 'El :attribute debe estar entre :min and :max kilobytes.', + 'string' => 'El :attribute debe estar entre :min and :max caracteres.', + 'array' => 'El :attribute debe estar entre :min and :max objetos.', + ], + 'boolean' => 'El :attribute campo debe ser verdadero o falso.', + 'confirmed' => 'El :attribute confirmación no coincide.', + 'date' => 'El :attribute no es una fecha valida.', + 'date_format' => 'El :attribute no coincide el formato :format.', + 'different' => 'El :attribute y :other deben ser diferentes.', + 'digits' => 'El :attribute debe ser :digits digitos.', + 'digits_between' => 'El :attribute debe estar entre :min and :max digitos.', + 'dimensions' => 'El :attribute tiene dimensiones de imagen no valida.', + 'distinct' => 'El :attribute campo tiene un valor duplicado.', + 'email' => 'El :attribute debe ser un email valido.', + 'exists' => 'El :attribute seleccionado es invalido.', + 'file' => 'El :attribute debe ser un archivo.', + 'filled' => 'El ":attribute" es requerido.', + 'image' => 'El :attribute debe ser una imagen.', + 'in' => 'El :attribute seleccionado es invalido.', + 'in_array' => 'El :attribute campo no existe en :other.', + 'integer' => 'El :attribute debe ser un integer.', + 'ip' => 'El :attribute debe ser una dirección IP valida.', + 'json' => 'El :attribute debe ser un string JSON valido.', + 'max' => [ + 'numeric' => 'El :attribute no puede ser mayor que :max.', + 'file' => 'El :attribute no puede ser mayor que :max kilobytes.', + 'string' => 'El :attribute no puede ser mayor que :max caracteres.', + 'array' => 'El :attribute no puede tener más de :max objetos.', + ], + 'mimes' => 'El :attribute must be a file of type: :values.', + 'min' => [ + 'numeric' => 'El :attribute debe tener al menos :min.', + 'file' => 'El :attribute debe tener al menos :min kilobytes.', + 'string' => 'El :attribute debe tener al menos :min caracteres.', + 'array' => 'El :attribute must have at least :min objetos.', + ], + 'not_in' => 'El :attribute seleccionado es invalido.', + 'numeric' => 'El :attribute debe ser un número.', + 'present' => 'El :attribute campo debe estar presente.', + 'regex' => 'El :attribute formato es invalido.', + 'required' => 'El ":attribute" campo es requerido.', + 'required_if' => 'El :attribute campo es requerido cuando :other es :value.', + 'required_unless' => 'El :attribute campo es requerido a no ser que :other esté en :values.', + 'required_with' => 'El :attribute campo es requerido cuando :values es presente.', + 'required_with_all' => 'El :attribute campo es requerido cuando :values es presente.', + 'required_without' => 'El :attribute campo es requerido cuando :values no esté presente.', + 'required_without_all' => 'El :attribute campo es requerido cuando none of :values are presente.', + 'same' => 'El :attribute y :other debe coincidir.', + 'size' => [ + 'numeric' => 'El :attribute debe ser :size.', + 'file' => 'El :attribute debe ser :size kilobytes.', + 'string' => 'El :attribute debe ser :size caracteres.', + 'array' => 'El :attribute debe contener :size objetos.', + ], + 'string' => 'El :attribute debe ser un string.', + 'timezone' => 'El :attribute debe ser una zona valida.', + 'unique' => 'El :attribute ha sido actualmente usado.', + 'url' => 'El :attribute es un formato invalido.', + + /** + * Custom Validation Language Lines + */ + + 'custom' => [ + 'airline_id' => [ + 'required' => 'Una aerolínea es requerida', + 'exists' => 'La aerolínea no existe', + ], + 'aircraft_id' => [ + 'required' => 'Una aeronave es requerido', + 'exists' => 'La aeronave no existe', + ], + 'arr_airport_id' => [ + 'required' => 'Un aeropuerto de llegada es requerido', + ], + 'dpt_airport_id' => [ + 'required' => 'Un aeropuerto de salida es requerido', + ], + 'flight_time' => [ + 'required' => 'Tiempo de vuelo, en minutos, es requerido', + 'integer' => 'Tiempo de vuelo, en minutos, es requerido', + ], + 'planned_flight_time' => [ + 'required' => 'Tiempo de vuelo, en minutos, es requerido', + 'integer' => 'Tiempo de vuelo, en minutos, es requerido', + ], + 'source_name' => [ + 'required' => 'Origen del PIREP es requerido', + ], + 'g-recaptcha-response' => [ + 'required' => 'Por favor verifica que no eres un robot.', + 'captcha' => '¡Error de CAPTCHA! intente de nuevo más tarde o póngase en contacto con el administrador del sitio.', + ], + ], + + /** + * Custom Validation Attributes + */ + + 'attributes' => [], + +]; From 7c414e54191c572d75761b33d591e8ea5967b3e7 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 5 Jul 2018 14:07:54 -0500 Subject: [PATCH 02/15] (API) Delete the PIREP route before it's posted again --- app/Http/Controllers/Api/PirepController.php | 6 ++++++ app/Services/PirepService.php | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/PirepController.php b/app/Http/Controllers/Api/PirepController.php index 95777f60..06765e42 100644 --- a/app/Http/Controllers/Api/PirepController.php +++ b/app/Http/Controllers/Api/PirepController.php @@ -497,6 +497,12 @@ class PirepController extends Controller Log::info('Posting ROUTE, PIREP: '.$id, $request->post()); + // Delete the route before posting a new one + Acars::where([ + 'pirep_id' => $id, + 'type' => AcarsType::ROUTE + ])->delete(); + $count = 0; $route = $request->post('route', []); foreach ($route as $position) { diff --git a/app/Services/PirepService.php b/app/Services/PirepService.php index 680bd4c7..31c7431a 100644 --- a/app/Services/PirepService.php +++ b/app/Services/PirepService.php @@ -95,6 +95,8 @@ class PirepService extends Service /** * Save the route into the ACARS table with AcarsType::ROUTE + * This attempts to create the route from the navdata and the route + * entered into the PIREP's route field * @param Pirep $pirep * @return Pirep * @throws \Exception @@ -114,7 +116,6 @@ class PirepService extends Service if (!filled($pirep->dpt_airport)) { Log::error('saveRoute: dpt_airport not found: '.$pirep->dpt_airport_id); - return $pirep; } From a1868075ed32861247a9c4cdaa519726bf2cc8e1 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 11 Jul 2018 08:06:07 -0500 Subject: [PATCH 03/15] update composer --- composer.lock | 274 +++++++++--------- .../views/admin/airports/script.blade.php | 11 +- 2 files changed, 153 insertions(+), 132 deletions(-) diff --git a/composer.lock b/composer.lock index a055fbf9..ffda970a 100644 --- a/composer.lock +++ b/composer.lock @@ -189,16 +189,16 @@ }, { "name": "cache/adapter-common", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-cache/adapter-common.git", - "reference": "f433e2496e1f351272e7985a5e908db86bc2db5c" + "reference": "6320bb5f5574cb88438059b59f8708da6b6f1d32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-cache/adapter-common/zipball/f433e2496e1f351272e7985a5e908db86bc2db5c", - "reference": "f433e2496e1f351272e7985a5e908db86bc2db5c", + "url": "https://api.github.com/repos/php-cache/adapter-common/zipball/6320bb5f5574cb88438059b59f8708da6b6f1d32", + "reference": "6320bb5f5574cb88438059b59f8708da6b6f1d32", "shasum": "" }, "require": { @@ -215,7 +215,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.1-dev" } }, "autoload": { @@ -223,7 +223,7 @@ "Cache\\Adapter\\Common\\": "" } }, - "notification-url": "http://packagist.org/downloads/", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -246,7 +246,7 @@ "psr-6", "tag" ], - "time": "2017-07-16T17:13:36+00:00" + "time": "2018-07-08T13:04:33+00:00" }, { "name": "cache/array-adapter", @@ -1448,16 +1448,16 @@ }, { "name": "laravel/framework", - "version": "v5.6.26", + "version": "v5.6.27", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "7047df295e77cecb6a2f84736a732af66cc6789c" + "reference": "2fe661f2444410a576aa40054ad9b7fe0bb5cee5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/7047df295e77cecb6a2f84736a732af66cc6789c", - "reference": "7047df295e77cecb6a2f84736a732af66cc6789c", + "url": "https://api.github.com/repos/laravel/framework/zipball/2fe661f2444410a576aa40054ad9b7fe0bb5cee5", + "reference": "2fe661f2444410a576aa40054ad9b7fe0bb5cee5", "shasum": "" }, "require": { @@ -1583,7 +1583,7 @@ "framework", "laravel" ], - "time": "2018-06-20T14:21:11+00:00" + "time": "2018-07-10T13:47:01+00:00" }, { "name": "laravelcollective/html", @@ -2215,16 +2215,16 @@ }, { "name": "nwidart/laravel-modules", - "version": "3.2.1", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/nWidart/laravel-modules.git", - "reference": "5250efef2505c47687ebe4c0368a4f0cd01c84ef" + "reference": "6e27f17ebf27c07bc6aeb83d5cc5a547cfa0c204" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/5250efef2505c47687ebe4c0368a4f0cd01c84ef", - "reference": "5250efef2505c47687ebe4c0368a4f0cd01c84ef", + "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/6e27f17ebf27c07bc6aeb83d5cc5a547cfa0c204", + "reference": "6e27f17ebf27c07bc6aeb83d5cc5a547cfa0c204", "shasum": "" }, "require": { @@ -2281,20 +2281,20 @@ "nwidart", "rad" ], - "time": "2018-04-16T17:35:14+00:00" + "time": "2018-06-21T17:40:05+00:00" }, { "name": "paragonie/random_compat", - "version": "v2.0.15", + "version": "v2.0.17", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09" + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/10bcb46e8f3d365170f6de9d05245aa066b81f09", - "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", "shasum": "" }, "require": { @@ -2330,7 +2330,7 @@ "pseudorandom", "random" ], - "time": "2018-06-08T15:26:40+00:00" + "time": "2018-07-04T16:31:37+00:00" }, { "name": "php-http/discovery", @@ -3267,16 +3267,16 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v6.0.2", + "version": "v6.1.1", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "412333372fb6c8ffb65496a2bbd7321af75733fc" + "reference": "aa899fef280b1c1aec8d5d4ac069af7f80c89a23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/412333372fb6c8ffb65496a2bbd7321af75733fc", - "reference": "412333372fb6c8ffb65496a2bbd7321af75733fc", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/aa899fef280b1c1aec8d5d4ac069af7f80c89a23", + "reference": "aa899fef280b1c1aec8d5d4ac069af7f80c89a23", "shasum": "" }, "require": { @@ -3287,10 +3287,14 @@ "mockery/mockery": "~0.9.1", "symfony/phpunit-bridge": "~3.3@dev" }, + "suggest": { + "ext-intl": "Needed to support internationalized email addresses", + "true/punycode": "Needed to support internationalized email addresses, if ext-intl is not installed" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -3298,7 +3302,7 @@ "lib/swift_required.php" ] }, - "notification-url": "http://packagist.org/downloads/", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3312,26 +3316,26 @@ } ], "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "http://swiftmailer.symfony.com", + "homepage": "https://swiftmailer.symfony.com", "keywords": [ "email", "mail", "mailer" ], - "time": "2017-09-30T22:39:41+00:00" + "time": "2018-07-04T11:12:44+00:00" }, { "name": "symfony/console", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "2d5d973bf9933d46802b01010bd25c800c87c242" + "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2d5d973bf9933d46802b01010bd25c800c87c242", - "reference": "2d5d973bf9933d46802b01010bd25c800c87c242", + "url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f", + "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f", "shasum": "" }, "require": { @@ -3386,11 +3390,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-30T07:26:09+00:00" + "time": "2018-05-31T10:17:53+00:00" }, { "name": "symfony/css-selector", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -3443,16 +3447,16 @@ }, { "name": "symfony/debug", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "449f8b00b28ab6e6912c3e6b920406143b27193b" + "reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/449f8b00b28ab6e6912c3e6b920406143b27193b", - "reference": "449f8b00b28ab6e6912c3e6b920406143b27193b", + "url": "https://api.github.com/repos/symfony/debug/zipball/dbe0fad88046a755dcf9379f2964c61a02f5ae3d", + "reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d", "shasum": "" }, "require": { @@ -3495,11 +3499,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-05-16T14:33:22+00:00" + "time": "2018-06-08T09:39:36+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -3556,7 +3560,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -3619,16 +3623,16 @@ }, { "name": "symfony/finder", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "087e2ee0d74464a4c6baac4e90417db7477dc238" + "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/087e2ee0d74464a4c6baac4e90417db7477dc238", - "reference": "087e2ee0d74464a4c6baac4e90417db7477dc238", + "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", + "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", "shasum": "" }, "require": { @@ -3664,20 +3668,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-05-16T14:33:22+00:00" + "time": "2018-06-19T21:38:16+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "a916c88390fb861ee21f12a92b107d51bb68af99" + "reference": "4f9c7cf962e635b0b26b14500ac046e07dbef7f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a916c88390fb861ee21f12a92b107d51bb68af99", - "reference": "a916c88390fb861ee21f12a92b107d51bb68af99", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/4f9c7cf962e635b0b26b14500ac046e07dbef7f3", + "reference": "4f9c7cf962e635b0b26b14500ac046e07dbef7f3", "shasum": "" }, "require": { @@ -3718,20 +3722,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-05-25T14:55:38+00:00" + "time": "2018-06-19T21:38:16+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90" + "reference": "29c094a1c4f8209b7e033f612cbbd69029e38955" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90", - "reference": "b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/29c094a1c4f8209b7e033f612cbbd69029e38955", + "reference": "29c094a1c4f8209b7e033f612cbbd69029e38955", "shasum": "" }, "require": { @@ -3739,13 +3743,13 @@ "psr/log": "~1.0", "symfony/debug": "~3.4|~4.0", "symfony/event-dispatcher": "~4.1", - "symfony/http-foundation": "~4.1", + "symfony/http-foundation": "^4.1.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/config": "<3.4", "symfony/dependency-injection": "<4.1", - "symfony/var-dumper": "<4.1", + "symfony/var-dumper": "<4.1.1", "twig/twig": "<1.34|<2.4,>=2" }, "provide": { @@ -3766,7 +3770,7 @@ "symfony/stopwatch": "~3.4|~4.0", "symfony/templating": "~3.4|~4.0", "symfony/translation": "~3.4|~4.0", - "symfony/var-dumper": "~4.1" + "symfony/var-dumper": "^4.1.1" }, "suggest": { "symfony/browser-kit": "", @@ -3805,11 +3809,11 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-05-30T12:52:34+00:00" + "time": "2018-06-25T13:06:45+00:00" }, { "name": "symfony/inflector", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/inflector.git", @@ -4036,16 +4040,16 @@ }, { "name": "symfony/process", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "73445bd33b0d337c060eef9652b94df72b6b3434" + "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/73445bd33b0d337c060eef9652b94df72b6b3434", - "reference": "73445bd33b0d337c060eef9652b94df72b6b3434", + "url": "https://api.github.com/repos/symfony/process/zipball/1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a", + "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a", "shasum": "" }, "require": { @@ -4081,11 +4085,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-30T07:26:09+00:00" + "time": "2018-05-31T10:17:53+00:00" }, { "name": "symfony/property-access", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", @@ -4152,16 +4156,16 @@ }, { "name": "symfony/routing", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "180b51c66d10f09e562c9ebc395b39aacb2cf8a2" + "reference": "b38b9797327b26ea2e4146a40e6e2dc9820a6932" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/180b51c66d10f09e562c9ebc395b39aacb2cf8a2", - "reference": "180b51c66d10f09e562c9ebc395b39aacb2cf8a2", + "url": "https://api.github.com/repos/symfony/routing/zipball/b38b9797327b26ea2e4146a40e6e2dc9820a6932", + "reference": "b38b9797327b26ea2e4146a40e6e2dc9820a6932", "shasum": "" }, "require": { @@ -4174,7 +4178,6 @@ }, "require-dev": { "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", "psr/log": "~1.0", "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", @@ -4226,20 +4229,20 @@ "uri", "url" ], - "time": "2018-05-30T07:26:09+00:00" + "time": "2018-06-19T21:38:16+00:00" }, { "name": "symfony/serializer", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "db427d70438645789ffce6048d61b3992118a33a" + "reference": "2ddc6ec084eba809aec92bf723e007bc3a8345c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/db427d70438645789ffce6048d61b3992118a33a", - "reference": "db427d70438645789ffce6048d61b3992118a33a", + "url": "https://api.github.com/repos/symfony/serializer/zipball/2ddc6ec084eba809aec92bf723e007bc3a8345c0", + "reference": "2ddc6ec084eba809aec92bf723e007bc3a8345c0", "shasum": "" }, "require": { @@ -4306,20 +4309,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-05-30T07:26:09+00:00" + "time": "2018-06-22T08:59:39+00:00" }, { "name": "symfony/translation", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a" + "reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/16328f5b217cebc8dd4adfe4aeeaa8c377581f5a", - "reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a", + "url": "https://api.github.com/repos/symfony/translation/zipball/b6d8164085ee0b6debcd1b7a131fd6f63bb04854", + "reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854", "shasum": "" }, "require": { @@ -4375,20 +4378,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-05-30T07:26:09+00:00" + "time": "2018-06-22T08:59:39+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "bc88ad53e825ebacc7b190bbd360781fce381c64" + "reference": "b2eebaec085d1f2cafbad7644733d494a3bbbc9b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/bc88ad53e825ebacc7b190bbd360781fce381c64", - "reference": "bc88ad53e825ebacc7b190bbd360781fce381c64", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/b2eebaec085d1f2cafbad7644733d494a3bbbc9b", + "reference": "b2eebaec085d1f2cafbad7644733d494a3bbbc9b", "shasum": "" }, "require": { @@ -4450,11 +4453,11 @@ "debug", "dump" ], - "time": "2018-04-29T07:56:09+00:00" + "time": "2018-06-23T12:23:56+00:00" }, { "name": "symfony/yaml", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -4763,28 +4766,28 @@ }, { "name": "vlucas/phpdotenv", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" + "reference": "6ae3e2e6494bb5e58c2decadafc3de7f1453f70a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/6ae3e2e6494bb5e58c2decadafc3de7f1453f70a", + "reference": "6ae3e2e6494bb5e58c2decadafc3de7f1453f70a", "shasum": "" }, "require": { "php": ">=5.3.9" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^4.8.35 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -4794,7 +4797,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause-Attribution" + "BSD-3-Clause" ], "authors": [ { @@ -4809,7 +4812,7 @@ "env", "environment" ], - "time": "2016-09-01T10:05:43+00:00" + "time": "2018-07-01T10:25:50+00:00" }, { "name": "waavi/sanitizer", @@ -5849,16 +5852,16 @@ }, { "name": "nette/di", - "version": "v2.4.12", + "version": "v2.4.13", "source": { "type": "git", "url": "https://github.com/nette/di.git", - "reference": "8e717aed2d182a26763be58c220eebaaa32917df" + "reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/8e717aed2d182a26763be58c220eebaaa32917df", - "reference": "8e717aed2d182a26763be58c220eebaaa32917df", + "url": "https://api.github.com/repos/nette/di/zipball/3f8f212b02d5c17feb97a7e0a39ab306f40c06ca", + "reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca", "shasum": "" }, "require": { @@ -5914,31 +5917,31 @@ "nette", "static" ], - "time": "2018-04-26T09:18:42+00:00" + "time": "2018-06-11T08:46:01+00:00" }, { "name": "nette/finder", - "version": "v2.4.1", + "version": "v2.4.2", "source": { "type": "git", "url": "https://github.com/nette/finder.git", - "reference": "4d43a66d072c57d585bf08a3ef68d3587f7e9547" + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/4d43a66d072c57d585bf08a3ef68d3587f7e9547", - "reference": "4d43a66d072c57d585bf08a3ef68d3587f7e9547", + "url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0", + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0", "shasum": "" }, "require": { - "nette/utils": "^2.4 || ~3.0.0", + "nette/utils": "~2.4", "php": ">=5.6.0" }, "conflict": { "nette/nette": "<2.2" }, "require-dev": { - "nette/tester": "^2.0", + "nette/tester": "~2.0", "tracy/tracy": "^2.3" }, "type": "library", @@ -5968,22 +5971,28 @@ "homepage": "https://nette.org/contributors" } ], - "description": "Nette Finder: Files Searching", + "description": "🔍 Nette Finder: find files and directories with an intuitive API.", "homepage": "https://nette.org", - "time": "2017-07-10T23:47:08+00:00" + "keywords": [ + "filesystem", + "glob", + "iterator", + "nette" + ], + "time": "2018-06-28T11:49:23+00:00" }, { "name": "nette/neon", - "version": "v2.4.2", + "version": "v2.4.3", "source": { "type": "git", "url": "https://github.com/nette/neon.git", - "reference": "9eacd50553b26b53a3977bfb2fea2166d4331622" + "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/9eacd50553b26b53a3977bfb2fea2166d4331622", - "reference": "9eacd50553b26b53a3977bfb2fea2166d4331622", + "url": "https://api.github.com/repos/nette/neon/zipball/5e72b1dd3e2d34f0863c5561139a19df6a1ef398", + "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398", "shasum": "" }, "require": { @@ -6022,9 +6031,16 @@ "homepage": "https://nette.org/contributors" } ], - "description": "Nette NEON: parser & generator for Nette Object Notation", + "description": "🍸 Nette NEON: encodes and decodes NEON file format.", "homepage": "http://ne-on.org", - "time": "2017-07-11T18:29:08+00:00" + "keywords": [ + "export", + "import", + "neon", + "nette", + "yaml" + ], + "time": "2018-03-21T12:12:21+00:00" }, { "name": "nette/php-generator", @@ -6090,16 +6106,16 @@ }, { "name": "nette/robot-loader", - "version": "v3.0.3", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/nette/robot-loader.git", - "reference": "92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a" + "reference": "3cf88781a05e0bf4618ae605361afcbaa4d5b392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a", - "reference": "92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a", + "url": "https://api.github.com/repos/nette/robot-loader/zipball/3cf88781a05e0bf4618ae605361afcbaa4d5b392", + "reference": "3cf88781a05e0bf4618ae605361afcbaa4d5b392", "shasum": "" }, "require": { @@ -6151,7 +6167,7 @@ "nette", "trait" ], - "time": "2017-09-26T13:42:21+00:00" + "time": "2018-06-22T09:34:04+00:00" }, { "name": "nette/utils", @@ -7023,16 +7039,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.2.4", + "version": "7.2.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "00bc0b93f0ff4f557e9ea766557fde96da9a03dd" + "reference": "400a3836ee549ae6f665323ac3f21e27eac7155f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/00bc0b93f0ff4f557e9ea766557fde96da9a03dd", - "reference": "00bc0b93f0ff4f557e9ea766557fde96da9a03dd", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/400a3836ee549ae6f665323ac3f21e27eac7155f", + "reference": "400a3836ee549ae6f665323ac3f21e27eac7155f", "shasum": "" }, "require": { @@ -7048,7 +7064,7 @@ "php": "^7.1", "phpspec/prophecy": "^1.7", "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.0", "sebastian/comparator": "^3.0", @@ -7103,7 +7119,7 @@ "testing", "xunit" ], - "time": "2018-06-05T03:40:05+00:00" + "time": "2018-06-21T13:13:39+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -7670,7 +7686,7 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", diff --git a/resources/views/admin/airports/script.blade.php b/resources/views/admin/airports/script.blade.php index 7cfc1079..6fb84f42 100644 --- a/resources/views/admin/airports/script.blade.php +++ b/resources/views/admin/airports/script.blade.php @@ -57,9 +57,14 @@ function phpvms_vacentral_airport_lookup(icao, callback) { url: '{{ url('/api/airports/') }}/' + icao + '/lookup', }; - axios(params).then(response => { - callback(response.data); - }); + axios(params) + .then(response => { + console.log(response); + callback(response.data); + }) + .error(err => { + console.log(err); + }); } $(document).ready(function() { From 5caecf9c5f872a69c47413785d098f8de83adba1 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 11 Jul 2018 08:07:58 -0500 Subject: [PATCH 04/15] update vacentral lib to fix airport lookup --- composer.json | 2 +- composer.lock | 14 +++++++------- resources/views/admin/airports/script.blade.php | 3 --- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 505b82f0..b5c882c2 100755 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "jmikola/geojson": "1.0.x", "laracasts/flash": "3.0.x", "arrilot/laravel-widgets": "3.9.x", - "nabeel/vacentral": "1.0.x", + "nabeel/vacentral": "^1.0", "league/iso3166": "2.1.x", "theiconic/php-ga-measurement-protocol": "2.7.x", "joshbrw/laravel-module-installer": "0.1.x", diff --git a/composer.lock b/composer.lock index ffda970a..c1c672fd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "cdbd47e5570d8787f6b54d22950466b7", + "content-hash": "65230ca9de4b86cf542d098549c08f60", "packages": [ { "name": "akaunting/money", @@ -2077,16 +2077,16 @@ }, { "name": "nabeel/vacentral", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/nabeelio/vacentral-library.git", - "reference": "35316106c8840c6ddacadcc0c80fdcc906482242" + "reference": "75dcd840e3d794b3c55c1f97d96f057fd84bf695" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nabeelio/vacentral-library/zipball/35316106c8840c6ddacadcc0c80fdcc906482242", - "reference": "35316106c8840c6ddacadcc0c80fdcc906482242", + "url": "https://api.github.com/repos/nabeelio/vacentral-library/zipball/75dcd840e3d794b3c55c1f97d96f057fd84bf695", + "reference": "75dcd840e3d794b3c55c1f97d96f057fd84bf695", "shasum": "" }, "require": { @@ -2103,11 +2103,11 @@ "VaCentral\\": "src/" } }, - "notification-url": "http://packagist.org/downloads/", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "time": "2018-02-05T17:20:06+00:00" + "time": "2018-07-11T13:02:24+00:00" }, { "name": "nesbot/carbon", diff --git a/resources/views/admin/airports/script.blade.php b/resources/views/admin/airports/script.blade.php index 6fb84f42..e181aea4 100644 --- a/resources/views/admin/airports/script.blade.php +++ b/resources/views/admin/airports/script.blade.php @@ -61,9 +61,6 @@ function phpvms_vacentral_airport_lookup(icao, callback) { .then(response => { console.log(response); callback(response.data); - }) - .error(err => { - console.log(err); }); } From 85615300e0b7cdc953c39775d74db10f55870741 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 11 Jul 2018 08:35:26 -0500 Subject: [PATCH 05/15] Wrap ifs --- resources/views/admin/pireps/fields.blade.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/views/admin/pireps/fields.blade.php b/resources/views/admin/pireps/fields.blade.php index dd1b67ca..2e733648 100644 --- a/resources/views/admin/pireps/fields.blade.php +++ b/resources/views/admin/pireps/fields.blade.php @@ -108,7 +108,8 @@
{{ Form::label('dpt_airport_id', 'Departure Airport:') }} @if($pirep->read_only) -

{{ $pirep->dpt_airport->id }} - {{ $pirep->dpt_airport->name }}

+

{{ $pirep->dpt_airport_id }}@if($pirep->dpt_airport->name) - {{ $pirep->dpt_airport->name }}@endif +

{{ Form::hidden('dpt_airport_id') }} @else {{ Form::select('dpt_airport_id', $airports_list, null, [ @@ -121,7 +122,8 @@
{{ Form::label('arr_airport_id', 'Arrival Airport:') }} @if($pirep->read_only) -

{{ $pirep->arr_airport->id }} - {{ $pirep->arr_airport->name }}

+

{{ $pirep->arr_airport->id }}@if($pirep->arr_airport->name) - {{ $pirep->arr_airport->name }}@endif +

{{ Form::hidden('arr_airport_id') }} @else {{ Form::select('arr_airport_id', $airports_list, null, ['class' => 'form-control select2']) }} From 9cc640b86671c3d0653c37b3e9f96aeeddc52442 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 21:20:10 -0500 Subject: [PATCH 06/15] Fix PIREP field and non-existant airport errors when editing PIREPs --- .../2017_06_28_195426_create_pirep_tables.php | 2 +- app/Database/seeds/sample.yml | 36 +++++++++++-------- .../Controllers/Admin/PirepController.php | 3 +- app/Http/Controllers/Api/PirepController.php | 3 +- .../Controllers/Frontend/PirepController.php | 6 +++- app/Models/Enums/PirepFieldSource.php | 15 ++++++++ app/Models/Pirep.php | 33 +++++++++++++++-- ...repFieldValues.php => PirepFieldValue.php} | 18 ++++++++-- app/Providers/AppServiceProvider.php | 4 +-- app/Services/PirepService.php | 6 ++-- public/assets/admin/css/admin.css | 4 +++ .../views/admin/pireps/field_values.blade.php | 10 ++++-- .../views/admin/pireps/pirep_card.blade.php | 4 +-- .../default/pireps/custom_fields.blade.php | 21 +++++++++++ .../layouts/default/pireps/fares.blade.php | 2 +- .../layouts/default/pireps/fields.blade.php | 22 +----------- .../layouts/default/pireps/table.blade.php | 12 +++---- tests/AcarsTest.php | 2 +- 18 files changed, 138 insertions(+), 65 deletions(-) create mode 100644 app/Models/Enums/PirepFieldSource.php rename app/Models/{PirepFieldValues.php => PirepFieldValue.php} (63%) create mode 100644 resources/views/layouts/default/pireps/custom_fields.blade.php diff --git a/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php b/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php index 66ad7b02..f32cba12 100644 --- a/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php +++ b/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php @@ -84,7 +84,7 @@ class CreatePirepTables extends Migration $table->string('name', 50); $table->string('slug', 50)->nullable(); $table->string('value')->nullable(); - $table->string('source')->nullable(); + $table->unsignedTinyInteger('source'); $table->timestamps(); $table->index('pirep_id'); diff --git a/app/Database/seeds/sample.yml b/app/Database/seeds/sample.yml index f07fe30e..ac4fe439 100644 --- a/app/Database/seeds/sample.yml +++ b/app/Database/seeds/sample.yml @@ -393,10 +393,10 @@ flights: updated_at: NOW flight_fields: - - name: Departure Gate - slug: departure-gate - - name: Arrival Gate - slug: arrival-gate + - name: Departure Terminal + slug: departure-terminal + - name: Arrival Terminal + slug: arrival-terminal flight_field_values: - id: 1 @@ -540,27 +540,33 @@ pirep_fares: pirep_fields: - id: 1 - name: departure gate - slug: departure-gate + name: departure terminal + slug: departure-terminal required: 1 - id: 2 - name: arrival gate - slug: arrival-gate + name: arrival terminal + slug: arrival-terminal required: 0 pirep_field_values: - id: 1 pirep_id: pirepid_1 - name: arrival gate - slug: arrival-gate + name: arrival terminal + slug: arrival-terminal value: 10 - source: manual + source: 0 - id: 2 pirep_id: pirepid_1 - name: departure gate - slug: departure-gate - value: B32 - source: manual + name: departure terminal + slug: departure-terminal + value: 4 + source: 0 + - id: 3 + pirep_id: pirepid_1 + name: Landing Rate + slug: landing-rate + value: -225.3 + source: 1 pirep_comments: - id: 1 diff --git a/app/Http/Controllers/Admin/PirepController.php b/app/Http/Controllers/Admin/PirepController.php index 7601d682..3f5188db 100644 --- a/app/Http/Controllers/Admin/PirepController.php +++ b/app/Http/Controllers/Admin/PirepController.php @@ -298,7 +298,8 @@ class PirepController extends Controller # set the custom fields foreach ($pirep->fields as $field) { - $pirep->{$field->slug} = $field->value; + $field_name = 'field_'.$field->slug; + $pirep->{$field_name} = $field->value; } # set the fares diff --git a/app/Http/Controllers/Api/PirepController.php b/app/Http/Controllers/Api/PirepController.php index 06765e42..8a46dc30 100644 --- a/app/Http/Controllers/Api/PirepController.php +++ b/app/Http/Controllers/Api/PirepController.php @@ -20,6 +20,7 @@ use App\Http\Resources\PirepFieldCollection; use App\Interfaces\Controller; use App\Models\Acars; use App\Models\Enums\AcarsType; +use App\Models\Enums\PirepFieldSource; use App\Models\Enums\PirepSource; use App\Models\Enums\PirepState; use App\Models\Enums\PirepStatus; @@ -122,7 +123,7 @@ class PirepController extends Controller $pirep_fields[] = [ 'name' => $field_name, 'value' => $field_value, - 'source' => $pirep->source, + 'source' => PirepFieldSource::ACARS, ]; } diff --git a/app/Http/Controllers/Frontend/PirepController.php b/app/Http/Controllers/Frontend/PirepController.php index c58b7729..e900ccb1 100644 --- a/app/Http/Controllers/Frontend/PirepController.php +++ b/app/Http/Controllers/Frontend/PirepController.php @@ -332,6 +332,9 @@ class PirepController extends Controller return redirect(route('frontend.pireps.index')); } + # Eager load the subfleet and fares under it + $pirep->aircraft->load('subfleet.fares'); + $time = new Time($pirep->flight_time); $pirep->hours = $time->hours; $pirep->minutes = $time->minutes; @@ -342,7 +345,8 @@ class PirepController extends Controller $field->slug = str_slug($field->name); } - $pirep->{$field->slug} = $field->value; + $field_name = 'field_'.$field->slug; + $pirep->{$field_name} = $field->value; } # set the fares diff --git a/app/Models/Enums/PirepFieldSource.php b/app/Models/Enums/PirepFieldSource.php new file mode 100644 index 00000000..cc7784f8 --- /dev/null +++ b/app/Models/Enums/PirepFieldSource.php @@ -0,0 +1,15 @@ +distance['nmi'] / $upper_bound) * 100, 0); } + /** + * Get the pirep_fields and then the pirep_field_values and + * merge them together. If a field value doesn't exist then add in a fake one + */ + public function getFieldsAttribute() + { + $custom_fields = PirepField::all(); + $field_values = PirepFieldValue::where('pirep_id', $this->id)->get(); + + # Merge the field values into $fields + foreach($custom_fields as $field) { + $has_value = $field_values->firstWhere('slug', $field->slug); + if(!$has_value) { + $field_values->push(new PirepFieldValue([ + 'pirep_id' => $this->id, + 'name' => $field->name, + 'slug' => $field->slug, + 'value' => '', + 'source' => PirepFieldSource::MANUAL + ])); + } + } + + return $field_values->sortBy('source'); + } + /** * Look up the flight, based on the PIREP flight info * @return Flight|null @@ -454,9 +481,9 @@ class Pirep extends Model return $this->hasMany(PirepFare::class, 'pirep_id'); } - public function fields() + public function field_values() { - return $this->hasMany(PirepFieldValues::class, 'pirep_id'); + return $this->hasMany(PirepFieldValue::class, 'pirep_id'); } public function pilot() diff --git a/app/Models/PirepFieldValues.php b/app/Models/PirepFieldValue.php similarity index 63% rename from app/Models/PirepFieldValues.php rename to app/Models/PirepFieldValue.php index 584944d8..02552058 100644 --- a/app/Models/PirepFieldValues.php +++ b/app/Models/PirepFieldValue.php @@ -3,12 +3,13 @@ namespace App\Models; use App\Interfaces\Model; +use App\Models\Enums\PirepFieldSource; /** - * Class PirepFieldValues + * Class PirepFieldValue * @package App\Models */ -class PirepFieldValues extends Model +class PirepFieldValue extends Model { public $table = 'pirep_field_values'; @@ -24,6 +25,19 @@ class PirepFieldValues extends Model 'name' => 'required', ]; + protected $casts = [ + 'source' => 'integer', + ]; + + /** + * If it was filled in from ACARS, then it's read only + * @return bool + */ + public function getReadOnlyAttribute() + { + return $this->source === PirepFieldSource::ACARS; + } + /** * @param $name */ diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ce371553..7bbe4a22 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -16,7 +16,7 @@ use App\Models\Observers\Sluggable; use App\Models\Observers\SettingObserver; use App\Models\Observers\SubfleetObserver; use App\Models\PirepField; -use App\Models\PirepFieldValues; +use App\Models\PirepFieldValue; use App\Models\Setting; use App\Models\Subfleet; use App\Repositories\SettingRepository; @@ -49,7 +49,7 @@ class AppServiceProvider extends ServiceProvider FlightFieldValue::observe(Sluggable::class); PirepField::observe(Sluggable::class); - PirepFieldValues::observe(Sluggable::class); + PirepFieldValue::observe(Sluggable::class); Setting::observe(SettingObserver::class); Subfleet::observe(SubfleetObserver::class); diff --git a/app/Services/PirepService.php b/app/Services/PirepService.php index 6b7e68fa..cbe2780e 100644 --- a/app/Services/PirepService.php +++ b/app/Services/PirepService.php @@ -17,7 +17,7 @@ use App\Models\Enums\PirepStatus; use App\Models\Enums\UserState; use App\Models\Navdata; use App\Models\Pirep; -use App\Models\PirepFieldValues; +use App\Models\PirepFieldValue; use App\Models\User; use App\Repositories\AcarsRepository; use App\Repositories\FlightRepository; @@ -152,7 +152,7 @@ class PirepService extends Service * Create a new PIREP with some given fields * * @param Pirep $pirep - * @param array [PirepFieldValues] $field_values + * @param array PirepFieldValue[] $field_values * * @return Pirep */ @@ -244,7 +244,7 @@ class PirepService extends Service public function updateCustomFields($pirep_id, array $field_values) { foreach ($field_values as $fv) { - PirepFieldValues::updateOrCreate( + PirepFieldValue::updateOrCreate( ['pirep_id' => $pirep_id, 'name' => $fv['name'] ], diff --git a/public/assets/admin/css/admin.css b/public/assets/admin/css/admin.css index e7ce00bd..dba05404 100644 --- a/public/assets/admin/css/admin.css +++ b/public/assets/admin/css/admin.css @@ -3,6 +3,10 @@ * */ +.form-container { + font-weight: normal; +} + .select2-container { margin-top: 2px; } diff --git a/resources/views/admin/pireps/field_values.blade.php b/resources/views/admin/pireps/field_values.blade.php index 17cdab55..06144b54 100644 --- a/resources/views/admin/pireps/field_values.blade.php +++ b/resources/views/admin/pireps/field_values.blade.php @@ -15,9 +15,13 @@
- {{ Form::text($field->slug, null, [ - 'class' => 'form-control' - ]) }} + @if(!$field->read_only) + {{ Form::text($field->slug, $field->value, [ + 'class' => 'form-control' + ]) }} + @else +

{{ $field->value }}

+ @endif

{{ $errors->first($field->slug) }}

diff --git a/resources/views/admin/pireps/pirep_card.blade.php b/resources/views/admin/pireps/pirep_card.blade.php index e0c9707c..9b587824 100644 --- a/resources/views/admin/pireps/pirep_card.blade.php +++ b/resources/views/admin/pireps/pirep_card.blade.php @@ -28,9 +28,9 @@
DEP  - {{ $pirep->dpt_airport->icao }}  + {{ $pirep->dpt_airport_id }}  ARR  - {{ $pirep->arr_airport->icao }}  + {{ $pirep->arr_airport_id }} 
diff --git a/resources/views/layouts/default/pireps/custom_fields.blade.php b/resources/views/layouts/default/pireps/custom_fields.blade.php new file mode 100644 index 00000000..32a97313 --- /dev/null +++ b/resources/views/layouts/default/pireps/custom_fields.blade.php @@ -0,0 +1,21 @@ + + + {{ $field->name }} + @if($field->required === true) + * + @endif + + +
+ @if(!$field->read_only) + {{ Form::text($field->slug, $field->value, [ + 'class' => 'form-control', + 'readonly' => (!empty($pirep) && $pirep->read_only), + ]) }} + @else + {{ $field->value }} + @endif +
+

{{ $errors->first($field->slug) }}

+ + diff --git a/resources/views/layouts/default/pireps/fares.blade.php b/resources/views/layouts/default/pireps/fares.blade.php index 5ee31199..a6c05575 100644 --- a/resources/views/layouts/default/pireps/fares.blade.php +++ b/resources/views/layouts/default/pireps/fares.blade.php @@ -4,7 +4,7 @@  {{ trans_choice('pireps.fare', 2) }}
- @foreach($aircraft->subfleet->fares as $fare) + @foreach($pirep->aircraft->subfleet->fares as $fare)
{{Form::label('fare_'.$fare->id, $fare->name.' ('.$fare->code.')')}} diff --git a/resources/views/layouts/default/pireps/fields.blade.php b/resources/views/layouts/default/pireps/fields.blade.php index 86a04376..652a5227 100644 --- a/resources/views/layouts/default/pireps/fields.blade.php +++ b/resources/views/layouts/default/pireps/fields.blade.php @@ -276,36 +276,16 @@ flight reports that have been filed. You've been warned!  {{ trans_choice('common.field', 2) }}
- {{-- Write out the custom fields, and label if they're required --}} - @foreach($pirep_fields as $field) - - - {{ $field->name }} - @if($field->required === true) - * - @endif - - -
- {{ Form::text($field->slug, null, [ - 'class' => 'form-control', - 'readonly' => (!empty($pirep) && $pirep->read_only), - ]) }} -
-

{{ $errors->first($field->slug) }}

- - - @endforeach + @each('pireps.custom_fields', $pirep->fields, 'field')
@include('pireps.fares')
-
diff --git a/resources/views/layouts/default/pireps/table.blade.php b/resources/views/layouts/default/pireps/table.blade.php index 2762c3ca..912dde44 100644 --- a/resources/views/layouts/default/pireps/table.blade.php +++ b/resources/views/layouts/default/pireps/table.blade.php @@ -22,16 +22,12 @@ $pirep->id]) }}">{{ $pirep->airline->code }}{{ $pirep->ident }} - {{ $pirep->dpt_airport->name }} - ({{$pirep->dpt_airport->icao}}) + @if($pirep->dpt_airport){{ $pirep->dpt_airport->name }}@endif + ({{$pirep->dpt_airport_id}}) - {{ $pirep->arr_airport->name }} - ({{$pirep->arr_airport->icao}}) + @if($pirep->arr_airport){{ $pirep->arr_airport->name }}@endif + ({{$pirep->arr_airport_id}}) @if($pirep->aircraft) diff --git a/tests/AcarsTest.php b/tests/AcarsTest.php index 90e611bb..bf185d10 100644 --- a/tests/AcarsTest.php +++ b/tests/AcarsTest.php @@ -226,7 +226,7 @@ class AcarsTest extends TestCase $this->assertEquals($fare->capacity, $saved_fare['count']); # Check saved fields - $saved_fields = \App\Models\PirepFieldValues::where('pirep_id', $pirep['id'])->get(); + $saved_fields = \App\Models\PirepFieldValue::where('pirep_id', $pirep['id'])->get(); $this->assertCount(1, $saved_fields); $field = $saved_fields->first(); From ad7aa7c8ce256bcfb82450a04062eff0afd24a2e Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 21:29:14 -0500 Subject: [PATCH 07/15] Missing flight log translation --- resources/lang/en/pireps.php | 1 + resources/lang/it/pireps.php | 1 + 2 files changed, 2 insertions(+) diff --git a/resources/lang/en/pireps.php b/resources/lang/en/pireps.php index dbc8e47c..2f537bdd 100644 --- a/resources/lang/en/pireps.php +++ b/resources/lang/en/pireps.php @@ -13,6 +13,7 @@ return [ 'pilotreport' => 'Pilot Report|Pilot Reports', 'arrived' => 'Arrived', 'source' => 'Source', + 'flightlog' => 'Flight Log', 'filedroute' => 'Filed Route', 'filedon' => 'Filed On', 'fare' => 'Fare|Fares', diff --git a/resources/lang/it/pireps.php b/resources/lang/it/pireps.php index 43a13ec6..dc4859a3 100644 --- a/resources/lang/it/pireps.php +++ b/resources/lang/it/pireps.php @@ -13,6 +13,7 @@ return [ 'fare' => 'Tariffa|Tariffe', 'class' => 'Classe', 'count' => 'Numero', + 'flightlog' => 'Flight Log', 'flighttime' => 'Tempo di volo', 'flightlevel' => 'Livello di Volo', 'fieldsreadonly' => 'Quando un PIREP viene sottoporre, alcuni cami entrano in modalità di sola lettura.', From 1b62cb71094c7157dc971bd7258b7dbdef1f5968 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 21:37:18 -0500 Subject: [PATCH 08/15] Fix extra brackets --- resources/views/layouts/default/pireps/pirep_card.blade.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/views/layouts/default/pireps/pirep_card.blade.php b/resources/views/layouts/default/pireps/pirep_card.blade.php index 943a94cf..750a62e4 100644 --- a/resources/views/layouts/default/pireps/pirep_card.blade.php +++ b/resources/views/layouts/default/pireps/pirep_card.blade.php @@ -3,9 +3,7 @@

- @lang('common.edit') }} + @lang('common.edit')

From 761c8453007a89b6ae600de7539fd3aba56542c9 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 21:47:27 -0500 Subject: [PATCH 09/15] Clean up some comments --- app/Models/Subfleet.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Models/Subfleet.php b/app/Models/Subfleet.php index a371a41a..3f0b280f 100644 --- a/app/Models/Subfleet.php +++ b/app/Models/Subfleet.php @@ -67,9 +67,6 @@ class Subfleet extends Model * Relationships */ - /** - * @return $this - */ public function aircraft() { return $this->hasMany(Aircraft::class, 'subfleet_id') From f6403819788a459d261745f45ea7fd1172b30424 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 22:21:39 -0500 Subject: [PATCH 10/15] Export extra fields for airports --- app/Services/ImportExport/AirportImporter.php | 26 +++++++++++-------- tests/data/airports.csv | 8 +++--- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/Services/ImportExport/AirportImporter.php b/app/Services/ImportExport/AirportImporter.php index d0ad25a4..3723ddab 100644 --- a/app/Services/ImportExport/AirportImporter.php +++ b/app/Services/ImportExport/AirportImporter.php @@ -18,15 +18,19 @@ class AirportImporter extends ImportExport * Should match the database fields, for the most part */ public static $columns = [ - 'icao' => 'required', - 'iata' => 'required', - 'name' => 'required', - 'location' => 'nullable', - 'country' => 'nullable', - 'timezone' => 'nullable', - 'hub' => 'nullable|boolean', - 'lat' => 'required|numeric', - 'lon' => 'required|numeric', + 'icao' => 'required', + 'iata' => 'required', + 'name' => 'required', + 'location' => 'nullable', + 'country' => 'nullable', + 'timezone' => 'nullable', + 'hub' => 'nullable|boolean', + 'lat' => 'required|numeric', + 'lon' => 'required|numeric', + 'ground_handling_cost' => 'nullable|float', + 'fuel_100ll_cost' => 'nullable|float', + 'fuel_jeta_cost' => 'nullable|float', + 'fuel_mogas_cost' => 'nullable|float', ]; /** @@ -41,12 +45,12 @@ class AirportImporter extends ImportExport $row['hub'] = get_truth_state($row['hub']); $airport = Airport::firstOrNew([ - 'id' => $row['icao'] + 'id' => $row['icao'] ], $row); try { $airport->save(); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->errorLog('Error in row '.$index.': '.$e->getMessage()); return false; } diff --git a/tests/data/airports.csv b/tests/data/airports.csv index 0a279223..72a31c72 100644 --- a/tests/data/airports.csv +++ b/tests/data/airports.csv @@ -1,4 +1,4 @@ -icao,iata,name,location,country,timezone,hub,lat,lon -KAUS,AUS,Austin-Bergstrom,"Austin, Texas, USA", United States,America/Chicago,1,30.1945,-97.6699 -KSFO,SFO,San Francisco,"San Francisco, California, USA", United States,America/California,"1",30.1945,-97.6699 -KJFK,JFK,Kennedy,"Queens, New York, USA", United States,America/New_York,0,30.1945,abcd +icao,iata,name,location,country,timezone,hub,lat,lon,ground_handling_cost,fuel_100ll_cost,fuel_jeta_cost,fuel_mogas_cost +KAUS,AUS,Austin-Bergstrom,"Austin, Texas, USA", United States,America/Chicago,1,30.1945,-97.6699,,,, +KSFO,SFO,San Francisco,"San Francisco, California, USA", United States,America/California,"1",30.1945,-97.6699,,,, +KJFK,JFK,Kennedy,"Queens, New York, USA", United States,America/New_York,0,30.1945,abcd,,,, From 4ca58ed7546200ccd019ca46c65ab896b2e11219 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 22:23:45 -0500 Subject: [PATCH 11/15] Extra logging for cron and add flight visible field --- app/Cron/Nightly/PilotLeave.php | 1 + app/Cron/Nightly/SetActiveFlights.php | 24 +++++++++++++++---- ...017_06_11_135707_create_airports_table.php | 4 ++-- ...2017_06_17_214650_create_flight_tables.php | 2 +- .../Controllers/Admin/AircraftController.php | 1 - app/Models/Flight.php | 4 +++- 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/app/Cron/Nightly/PilotLeave.php b/app/Cron/Nightly/PilotLeave.php index 7417b4b1..8128c69c 100644 --- a/app/Cron/Nightly/PilotLeave.php +++ b/app/Cron/Nightly/PilotLeave.php @@ -42,6 +42,7 @@ class PilotLeave extends Listener ->whereDate('updated_at', '<', $date); foreach($users as $user) { + Log::info('Setting user '.$user->ident.' to ON LEAVE status'); $this->userSvc->setStatusOnLeave($user); } } diff --git a/app/Cron/Nightly/SetActiveFlights.php b/app/Cron/Nightly/SetActiveFlights.php index e63906d9..c3387844 100644 --- a/app/Cron/Nightly/SetActiveFlights.php +++ b/app/Cron/Nightly/SetActiveFlights.php @@ -7,6 +7,8 @@ use App\Interfaces\Listener; use App\Models\Enums\Days; use App\Models\Flight; use Carbon\Carbon; +use Illuminate\Support\Facades\Log; +use Log; /** * Figure out what flights need to be active for today @@ -39,11 +41,19 @@ class SetActiveFlights extends Listener */ foreach($flights as $flight) { + if (!$flight->active) { + continue; + } + // 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 > 0) { - $flight->active = Days::isToday($flight->days); + $visible = Days::isToday($flight->days); + if($flight->visible !== $visible) { + Log::info('Marking flight '.$flight->ident.' to '.($visible ? 'visible' : 'invisible')); + $flight->visible = $visible; + } } $flight->save(); @@ -55,13 +65,17 @@ class SetActiveFlights extends Listener // Start/end date is set, so make sure today is valid for it to be alive // 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 > 0) { - $flight->active = Days::isToday($flight->days); + if ($flight->days === null || $flight->days > 0) { + $visible = Days::isToday($flight->days); + if($flight->visible !== $visible) { + Log::info('Toggling flight '.$flight->ident.' to '.($visible?'visible':'invisible')); + $flight->visible = true; + } } else { - $flight->active = true; + $flight->visible = true; } } else { - $flight->active = false; + $flight->visible = false; } $flight->save(); diff --git a/app/Database/migrations/2017_06_11_135707_create_airports_table.php b/app/Database/migrations/2017_06_11_135707_create_airports_table.php index 6670f4ac..cfa96a2d 100644 --- a/app/Database/migrations/2017_06_11_135707_create_airports_table.php +++ b/app/Database/migrations/2017_06_11_135707_create_airports_table.php @@ -16,12 +16,12 @@ class CreateAirportsTable extends Migration $table->string('country', 64)->nullable(); $table->string('timezone', 64)->nullable(); $table->boolean('hub')->default(false); + $table->float('lat', 7, 4)->nullable()->default(0.0); + $table->float('lon', 7, 4)->nullable()->default(0.0); $table->unsignedDecimal('ground_handling_cost')->nullable()->default(0); $table->unsignedDecimal('fuel_100ll_cost')->nullable()->default(0); $table->unsignedDecimal('fuel_jeta_cost')->nullable()->default(0); $table->unsignedDecimal('fuel_mogas_cost')->nullable()->default(0); - $table->float('lat', 7, 4)->nullable()->default(0.0); - $table->float('lon', 7, 4)->nullable()->default(0.0); $table->index('icao'); $table->index('iata'); diff --git a/app/Database/migrations/2017_06_17_214650_create_flight_tables.php b/app/Database/migrations/2017_06_17_214650_create_flight_tables.php index 1b5f3564..a3f8b7b1 100644 --- a/app/Database/migrations/2017_06_17_214650_create_flight_tables.php +++ b/app/Database/migrations/2017_06_17_214650_create_flight_tables.php @@ -36,7 +36,7 @@ class CreateFlightTables extends Migration $table->date('end_date')->nullable(); $table->boolean('has_bid')->default(false); $table->boolean('active')->default(true); - $table->boolean('flight_active')->default(true); // used by the cron + $table->boolean('visible')->default(true); // used by the cron $table->timestamps(); $table->primary('id'); diff --git a/app/Http/Controllers/Admin/AircraftController.php b/app/Http/Controllers/Admin/AircraftController.php index da461527..556fc30a 100644 --- a/app/Http/Controllers/Admin/AircraftController.php +++ b/app/Http/Controllers/Admin/AircraftController.php @@ -118,7 +118,6 @@ class AircraftController extends Controller if (empty($aircraft)) { Flash::error('Aircraft not found'); - return redirect(route('admin.aircraft.index')); } diff --git a/app/Models/Flight.php b/app/Models/Flight.php index 91699388..46bcaa3b 100644 --- a/app/Models/Flight.php +++ b/app/Models/Flight.php @@ -64,6 +64,7 @@ class Flight extends Model 'end_date', 'has_bid', 'active', + 'visible', ]; protected $casts = [ @@ -75,8 +76,9 @@ class Flight extends Model 'start_date' => 'date', 'end_date' => 'date', 'has_bid' => 'boolean', + 'route_leg' => 'integer', 'active' => 'boolean', - 'route_leg' => 'integer' + 'visible' => 'boolean', ]; public static $rules = [ From 0af85a3fff9221fba9c2fe1e7ae06ca33770e113 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 22:29:50 -0500 Subject: [PATCH 12/15] Only show flights if they're also marked as visible --- app/Cron/Nightly/SetActiveFlights.php | 9 +++++++-- app/Http/Controllers/Api/FlightController.php | 12 ++++++++++-- app/Http/Controllers/Frontend/FlightController.php | 4 +++- app/Repositories/FlightRepository.php | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/Cron/Nightly/SetActiveFlights.php b/app/Cron/Nightly/SetActiveFlights.php index c3387844..897a5c70 100644 --- a/app/Cron/Nightly/SetActiveFlights.php +++ b/app/Cron/Nightly/SetActiveFlights.php @@ -40,7 +40,6 @@ class SetActiveFlights extends Listener * @var Flight $flight */ foreach($flights as $flight) { - if (!$flight->active) { continue; } @@ -54,6 +53,9 @@ class SetActiveFlights extends Listener Log::info('Marking flight '.$flight->ident.' to '.($visible ? 'visible' : 'invisible')); $flight->visible = $visible; } + } else { + Log::info('Toggling flight '.$flight->ident.' to visible'); + $flight->visible = true; } $flight->save(); @@ -72,7 +74,10 @@ class SetActiveFlights extends Listener $flight->visible = true; } } else { - $flight->visible = true; + if ($flight->visible !== true) { + Log::info('Toggling flight '.$flight->ident.' to visible'); + $flight->visible = true; + } } } else { $flight->visible = false; diff --git a/app/Http/Controllers/Api/FlightController.php b/app/Http/Controllers/Api/FlightController.php index cfb8b119..4d156200 100644 --- a/app/Http/Controllers/Api/FlightController.php +++ b/app/Http/Controllers/Api/FlightController.php @@ -44,7 +44,11 @@ class FlightController extends Controller { $user = Auth::user(); - $where = ['active' => true]; + $where = [ + 'active' => true, + 'visible' => true, + ]; + if(setting('pilots.restrict_to_company')) { $where['airline_id'] = Auth::user()->airline_id; } @@ -84,7 +88,11 @@ class FlightController extends Controller $user = Auth::user(); try { - $where = ['active' => true]; + $where = [ + 'active' => true, + 'visible' => true, + ]; + if(setting('pilots.restrict_to_company')) { $where['airline_id'] = Auth::user()->airline_id; } diff --git a/app/Http/Controllers/Frontend/FlightController.php b/app/Http/Controllers/Frontend/FlightController.php index a974f3d7..04625446 100644 --- a/app/Http/Controllers/Frontend/FlightController.php +++ b/app/Http/Controllers/Frontend/FlightController.php @@ -52,8 +52,10 @@ class FlightController extends Controller public function index(Request $request) { $where = [ - 'active' => true, + 'active' => true, + 'visible' => true, ]; + if(setting('pilots.restrict_to_company')) { $where['airline_id'] = Auth::user()->airline_id; } diff --git a/app/Repositories/FlightRepository.php b/app/Repositories/FlightRepository.php index 350772c5..c9762514 100644 --- a/app/Repositories/FlightRepository.php +++ b/app/Repositories/FlightRepository.php @@ -71,7 +71,8 @@ class FlightRepository extends Repository implements CacheableInterface $where = []; if ($only_active === true) { - $where['active'] = $only_active; + $where['active'] = $only_active; + $where['visible'] = $only_active; } if ($request->filled('flight_id')) { From 1b51bc8c04dee22c7c826bce05f87c070b2323e7 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 22:32:56 -0500 Subject: [PATCH 13/15] Log error --- app/Cron/Nightly/SetActiveFlights.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Cron/Nightly/SetActiveFlights.php b/app/Cron/Nightly/SetActiveFlights.php index 897a5c70..0b635c98 100644 --- a/app/Cron/Nightly/SetActiveFlights.php +++ b/app/Cron/Nightly/SetActiveFlights.php @@ -8,7 +8,6 @@ use App\Models\Enums\Days; use App\Models\Flight; use Carbon\Carbon; use Illuminate\Support\Facades\Log; -use Log; /** * Figure out what flights need to be active for today From 91b1fd5dcada6d4f72d3a599403a34f1fab07e2b Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 22:36:13 -0500 Subject: [PATCH 14/15] Add "visible" field to factory --- app/Database/factories/FlightFactory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Database/factories/FlightFactory.php b/app/Database/factories/FlightFactory.php index 661ef89b..63b5e3bf 100644 --- a/app/Database/factories/FlightFactory.php +++ b/app/Database/factories/FlightFactory.php @@ -31,6 +31,7 @@ $factory->define(App\Models\Flight::class, function (Faker $faker) { 'flight_time' => $faker->numberBetween(60, 360), 'has_bid' => false, 'active' => true, + 'visible' => true, 'days' => 0, 'start_date' => null, 'end_date' => null, From 4596ddae58e3ff00b7f64ea0f3ec09a201179171 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 12 Jul 2018 22:40:39 -0500 Subject: [PATCH 15/15] Undo null check for flight --- app/Cron/Nightly/SetActiveFlights.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Cron/Nightly/SetActiveFlights.php b/app/Cron/Nightly/SetActiveFlights.php index 0b635c98..daadd9b6 100644 --- a/app/Cron/Nightly/SetActiveFlights.php +++ b/app/Cron/Nightly/SetActiveFlights.php @@ -66,7 +66,7 @@ class SetActiveFlights extends Listener // Start/end date is set, so make sure today is valid for it to be alive // 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) { + if ($flight->days > 0) { $visible = Days::isToday($flight->days); if($flight->visible !== $visible) { Log::info('Toggling flight '.$flight->ident.' to '.($visible?'visible':'invisible'));