diff --git a/VERSION.txt b/VERSION.txt index c1396d51fc9a..36841fda6a88 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.80 \ No newline at end of file +5.5.81 \ No newline at end of file diff --git a/_ide_helper.php b/_ide_helper.php index a14275a20cd5..26c323563f29 100644 --- a/_ide_helper.php +++ b/_ide_helper.php @@ -4,7 +4,7 @@ /** * A helper file for Laravel, to provide autocomplete information to your IDE - * Generated for Laravel 9.52.4. + * Generated for Laravel 9.52.0. * * This file should not be included in your code, only analyzed by your IDE! * @@ -4193,7 +4193,7 @@ */ public static function lock($name, $seconds = 0, $owner = null) { - /** @var \Illuminate\Cache\RedisStore $instance */ + /** @var \Illuminate\Cache\FileStore $instance */ return $instance->lock($name, $seconds, $owner); } /** @@ -4206,7 +4206,7 @@ */ public static function restoreLock($name, $owner) { - /** @var \Illuminate\Cache\RedisStore $instance */ + /** @var \Illuminate\Cache\FileStore $instance */ return $instance->restoreLock($name, $owner); } /** @@ -4217,65 +4217,30 @@ */ public static function flush() { - /** @var \Illuminate\Cache\RedisStore $instance */ + /** @var \Illuminate\Cache\FileStore $instance */ return $instance->flush(); } /** - * Get the Redis connection instance. + * Get the Filesystem instance. * - * @return \Illuminate\Redis\Connections\Connection + * @return \Illuminate\Filesystem\Filesystem * @static */ - public static function connection() + public static function getFilesystem() { - /** @var \Illuminate\Cache\RedisStore $instance */ - return $instance->connection(); + /** @var \Illuminate\Cache\FileStore $instance */ + return $instance->getFilesystem(); } /** - * Get the Redis connection instance that should be used to manage locks. + * Get the working directory of the cache. * - * @return \Illuminate\Redis\Connections\Connection + * @return string * @static */ - public static function lockConnection() + public static function getDirectory() { - /** @var \Illuminate\Cache\RedisStore $instance */ - return $instance->lockConnection(); - } - /** - * Specify the name of the connection that should be used to store data. - * - * @param string $connection - * @return void - * @static - */ - public static function setConnection($connection) - { - /** @var \Illuminate\Cache\RedisStore $instance */ - $instance->setConnection($connection); - } - /** - * Specify the name of the connection that should be used to manage locks. - * - * @param string $connection - * @return \Illuminate\Cache\RedisStore - * @static - */ - public static function setLockConnection($connection) - { - /** @var \Illuminate\Cache\RedisStore $instance */ - return $instance->setLockConnection($connection); - } - /** - * Get the Redis database instance. - * - * @return \Illuminate\Contracts\Redis\Factory - * @static - */ - public static function getRedis() - { - /** @var \Illuminate\Cache\RedisStore $instance */ - return $instance->getRedis(); + /** @var \Illuminate\Cache\FileStore $instance */ + return $instance->getDirectory(); } /** * Get the cache key prefix. @@ -4285,20 +4250,8 @@ */ public static function getPrefix() { - /** @var \Illuminate\Cache\RedisStore $instance */ + /** @var \Illuminate\Cache\FileStore $instance */ return $instance->getPrefix(); - } - /** - * Set the cache key prefix. - * - * @param string $prefix - * @return void - * @static - */ - public static function setPrefix($prefix) - { - /** @var \Illuminate\Cache\RedisStore $instance */ - $instance->setPrefix($prefix); } } @@ -9901,44 +9854,45 @@ return $instance->setConnectionName($name); } /** - * Migrate the delayed jobs that are ready to the regular queue. + * Release a reserved job back onto the queue after (n) seconds. * - * @param string $from - * @param string $to - * @param int $limit - * @return array + * @param string $queue + * @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job + * @param int $delay + * @return mixed * @static */ - public static function migrateExpiredJobs($from, $to) + public static function release($queue, $job, $delay) { - /** @var \Illuminate\Queue\RedisQueue $instance */ - return $instance->migrateExpiredJobs($from, $to); + /** @var \Illuminate\Queue\DatabaseQueue $instance */ + return $instance->release($queue, $job, $delay); } /** * Delete a reserved job from the queue. * * @param string $queue - * @param \Illuminate\Queue\Jobs\RedisJob $job + * @param string $id * @return void + * @throws \Throwable * @static */ - public static function deleteReserved($queue, $job) + public static function deleteReserved($queue, $id) { - /** @var \Illuminate\Queue\RedisQueue $instance */ - $instance->deleteReserved($queue, $job); + /** @var \Illuminate\Queue\DatabaseQueue $instance */ + $instance->deleteReserved($queue, $id); } /** * Delete a reserved job from the reserved queue and release it. * * @param string $queue - * @param \Illuminate\Queue\Jobs\RedisJob $job + * @param \Illuminate\Queue\Jobs\DatabaseJob $job * @param int $delay * @return void * @static */ public static function deleteAndRelease($queue, $job, $delay) { - /** @var \Illuminate\Queue\RedisQueue $instance */ + /** @var \Illuminate\Queue\DatabaseQueue $instance */ $instance->deleteAndRelease($queue, $job, $delay); } /** @@ -9950,7 +9904,7 @@ */ public static function clear($queue) { - /** @var \Illuminate\Queue\RedisQueue $instance */ + /** @var \Illuminate\Queue\DatabaseQueue $instance */ return $instance->clear($queue); } /** @@ -9962,30 +9916,19 @@ */ public static function getQueue($queue) { - /** @var \Illuminate\Queue\RedisQueue $instance */ + /** @var \Illuminate\Queue\DatabaseQueue $instance */ return $instance->getQueue($queue); } /** - * Get the connection for the queue. + * Get the underlying database instance. * - * @return \Illuminate\Redis\Connections\Connection + * @return \Illuminate\Database\Connection * @static */ - public static function getConnection() + public static function getDatabase() { - /** @var \Illuminate\Queue\RedisQueue $instance */ - return $instance->getConnection(); - } - /** - * Get the underlying Redis instance. - * - * @return \Illuminate\Contracts\Redis\Factory - * @static - */ - public static function getRedis() - { - /** @var \Illuminate\Queue\RedisQueue $instance */ - return $instance->getRedis(); + /** @var \Illuminate\Queue\DatabaseQueue $instance */ + return $instance->getDatabase(); } /** * Get the backoff for an object-based queue handler. @@ -9996,7 +9939,7 @@ */ public static function getJobBackoff($job) { //Method inherited from \Illuminate\Queue\Queue - /** @var \Illuminate\Queue\RedisQueue $instance */ + /** @var \Illuminate\Queue\DatabaseQueue $instance */ return $instance->getJobBackoff($job); } /** @@ -10008,7 +9951,7 @@ */ public static function getJobExpiration($job) { //Method inherited from \Illuminate\Queue\Queue - /** @var \Illuminate\Queue\RedisQueue $instance */ + /** @var \Illuminate\Queue\DatabaseQueue $instance */ return $instance->getJobExpiration($job); } /** @@ -10020,7 +9963,7 @@ */ public static function createPayloadUsing($callback) { //Method inherited from \Illuminate\Queue\Queue - \Illuminate\Queue\RedisQueue::createPayloadUsing($callback); + \Illuminate\Queue\DatabaseQueue::createPayloadUsing($callback); } /** * Get the container instance being used by the connection. @@ -10030,7 +9973,7 @@ */ public static function getContainer() { //Method inherited from \Illuminate\Queue\Queue - /** @var \Illuminate\Queue\RedisQueue $instance */ + /** @var \Illuminate\Queue\DatabaseQueue $instance */ return $instance->getContainer(); } /** @@ -10042,7 +9985,7 @@ */ public static function setContainer($container) { //Method inherited from \Illuminate\Queue\Queue - /** @var \Illuminate\Queue\RedisQueue $instance */ + /** @var \Illuminate\Queue\DatabaseQueue $instance */ $instance->setContainer($container); } @@ -10860,12 +10803,12 @@ * Clones a request and overrides some of its parameters. * * @return static - * @param array|null $query The GET parameters - * @param array|null $request The POST parameters - * @param array|null $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array|null $cookies The COOKIE parameters - * @param array|null $files The FILES parameters - * @param array|null $server The SERVER parameters + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters * @static */ public static function duplicate($query = null, $request = null, $attributes = null, $cookies = null, $files = null, $server = null) @@ -17854,6 +17797,25 @@ /** * * + * @method static void createSubscription(array|string $channels, \Closure $callback, string $method = 'subscribe') + * @method static \Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder funnel(string $name) + * @method static \Illuminate\Redis\Limiters\DurationLimiterBuilder throttle(string $name) + * @method static mixed client() + * @method static void subscribe(array|string $channels, \Closure $callback) + * @method static void psubscribe(array|string $channels, \Closure $callback) + * @method static mixed command(string $method, array $parameters = []) + * @method static void listen(\Closure $callback) + * @method static string|null getName() + * @method static \Illuminate\Redis\Connections\Connection setName(string $name) + * @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher() + * @method static void setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $events) + * @method static void unsetEventDispatcher() + * @method static void macro(string $name, object|callable $macro) + * @method static void mixin(object $mixin, bool $replace = true) + * @method static bool hasMacro(string $name) + * @method static void flushMacros() + * @method static mixed macroCall(string $method, array $parameters) + * @see \Illuminate\Redis\RedisManager */ class Redis { /** diff --git a/app/Export/CSV/PaymentExport.php b/app/Export/CSV/PaymentExport.php index 46f5a6308833..3e112ad05011 100644 --- a/app/Export/CSV/PaymentExport.php +++ b/app/Export/CSV/PaymentExport.php @@ -25,7 +25,7 @@ class PaymentExport extends BaseExport private $entity_transformer; - public $date_key = 'date'; + public string $date_key = 'date'; public array $entity_keys = [ 'amount' => 'amount', diff --git a/app/Http/ValidationRules/Project/ValidProjectForClient.php b/app/Http/ValidationRules/Project/ValidProjectForClient.php index 51271985b7db..f887961626f2 100644 --- a/app/Http/ValidationRules/Project/ValidProjectForClient.php +++ b/app/Http/ValidationRules/Project/ValidProjectForClient.php @@ -48,7 +48,7 @@ class ValidProjectForClient implements Rule // $this->input['project_id'] = $this->decodePrimaryKey($this->input['project_id']); // } - $project = Project::find($this->input['project_id']); + $project = Project::withTrashed()->find($this->input['project_id']); if (! $project) { $this->message = 'Project not found'; diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index da3e02d04da8..34ebd668c65e 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -584,6 +584,9 @@ class NinjaMailerJob implements ShouldQueue $guzzle = new \GuzzleHttp\Client(); $url = 'https://login.microsoftonline.com/common/oauth2/v2.0/token'; + if(!$user->oauth_user_refresh_token || $user->oauth_user_refresh_token == '') + return false; + $token = json_decode($guzzle->post($url, [ 'form_params' => [ 'client_id' => config('ninja.o365.client_id') , diff --git a/app/Jobs/Util/WebhookSingle.php b/app/Jobs/Util/WebhookSingle.php index dc4f8314c39c..7be0f0feeebb 100644 --- a/app/Jobs/Util/WebhookSingle.php +++ b/app/Jobs/Util/WebhookSingle.php @@ -78,7 +78,7 @@ class WebhookSingle implements ShouldQueue $subscription = Webhook::with('company')->find($this->subscription_id); if ($subscription) { - nlog("firing event ID {$subscription->event_id}"); + nlog("firing event ID {$subscription->event_id} company_id {$subscription->company_id}"); } if (!$subscription) { diff --git a/app/Listeners/Invoice/InvoiceFailedEmailNotification.php b/app/Listeners/Invoice/InvoiceFailedEmailNotification.php index 4817a9cd3d38..922d5df2e9c7 100644 --- a/app/Listeners/Invoice/InvoiceFailedEmailNotification.php +++ b/app/Listeners/Invoice/InvoiceFailedEmailNotification.php @@ -22,8 +22,6 @@ class InvoiceFailedEmailNotification { use UserNotifies; - public $delay = 7; - public function __construct() { } @@ -51,8 +49,8 @@ class InvoiceFailedEmailNotification unset($methods[$key]); $nmo = new NinjaMailerObject; - $nmo->mailable = new NinjaMailer((new EntityFailedSendObject($event->invitation, 'invoice', $event->template, $event->message))->build()); - $nmo->company = $invoice->company; + $nmo->mailable = new NinjaMailer((new EntityFailedSendObject($event->invitation->withoutRelations(), 'invoice', $event->template, $event->message))->build()); + $nmo->company = $invoice->company->withoutRelations(); $nmo->settings = $invoice->company->settings; $nmo->to_user = $user; diff --git a/config/ninja.php b/config/ninja.php index e1a501be4da2..2311eb140cd5 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.5.80', - 'app_tag' => '5.5.80', + 'app_version' => '5.5.81', + 'app_tag' => '5.5.81', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/database/seeders/RandomDataSeeder.php b/database/seeders/RandomDataSeeder.php index b65883110e52..2c520b181014 100644 --- a/database/seeders/RandomDataSeeder.php +++ b/database/seeders/RandomDataSeeder.php @@ -121,6 +121,8 @@ class RandomDataSeeder extends Seeder 'email' => 'user@example.com', ]); + $user->first_name = 'U'; + $user->last_name = 'ser'; $user->password = Hash::make('password'); $user->account_id = $account->id; $user->email_verified_at = now(); @@ -149,6 +151,8 @@ class RandomDataSeeder extends Seeder 'email' => 'permissions@example.com', ]); + $user->first_name = 'per'; + $user->last_name = 'missions'; $user->password = Hash::make('password'); $user->account_id = $account->id; $user->email_verified_at = now(); diff --git a/lang/en/texts.php b/lang/en/texts.php index c9ec4d4daa47..ff03778970f7 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5011,6 +5011,7 @@ $LANG = array( 'add_company_logo' => 'Add Logo', 'add_stripe' => 'Add Stripe', 'invalid_coupon' => 'Invalid Coupon', + 'no_assigned_tasks' => 'No billable tasks for this project', );