1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00

Merge pull request #5095 from turbo124/v5-stable

v5.1.19
This commit is contained in:
David Bomba 2021-03-10 21:07:08 +11:00 committed by GitHub
commit f0dc32db97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 16178 additions and 15976 deletions

View File

@ -1 +1 @@
5.1.18
5.1.19

View File

@ -376,6 +376,8 @@ class CreditController extends BaseController
$credit = $this->credit_repository->save($request->all(), $credit);
$credit->service()->deletePdf();
event(new CreditWasUpdated($credit, $credit->company, Ninja::eventVars()));
return $this->itemResponse($credit);

View File

@ -387,6 +387,8 @@ class QuoteController extends BaseController
$quote = $this->quote_repo->save($request->all(), $quote);
$quote->service()->deletePdf();
event(new QuoteWasUpdated($quote, $quote->company, Ninja::eventVars()));
return $this->itemResponse($quote);

View File

@ -374,6 +374,8 @@ class RecurringInvoiceController extends BaseController
$recurring_invoice = $this->recurring_invoice_repo->save($request->all(), $recurring_invoice);
$recurring_invoice->service()->deletePdf()->save();
return $this->itemResponse($recurring_invoice);
}

View File

@ -209,6 +209,8 @@ class UserController extends BaseController
$ct = CreateCompanyToken::dispatchNow($company, $user, $user_agent);
nlog("in the store method of the usercontroller class");
event(new UserWasCreated($user, auth()->user(), $company, Ninja::eventVars()));
return $this->itemResponse($user->fresh());
@ -626,7 +628,7 @@ class UserController extends BaseController
}
/**
* Detach an existing user to a company.
* Invite an existing user to a company.
*
* @OA\Post(
* path="/api/v1/users/{user}/invite",
@ -682,4 +684,59 @@ class UserController extends BaseController
}
/**
* Invite an existing user to a company.
*
* @OA\Post(
* path="/api/v1/users/{user}/reconfirm",
* operationId="inviteUserReconfirm",
* tags={"users"},
* summary="Reconfirm an existing user to a company",
* description="Reconfirm an existing user from a company",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Parameter(
* name="user",
* in="path",
* description="The user hashed_id",
* example="FD767dfd7",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
* @OA\Response(
* response=200,
* description="Success response",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
* @param ReconfirmUserRequest $request
* @param User $user
* @return \Illuminate\Http\JsonResponse
*/
public function reconfirm(ReconfirmUserRequest $request, User $user)
{
$user->service()->invite($user->company());
return response()->json(['message' => ctrans('texts.confirmation_resent')], 200);
}
}

View File

@ -54,6 +54,10 @@ class StoreDesignRequest extends Request
$input['design']['footer'] = '';
}
if (! array_key_exists('header', $input['design']) || is_null($input['design']['header'])) {
$input['design']['header'] = '';
}
$this->replace($input);
}
}

View File

@ -53,6 +53,10 @@ class UpdateDesignRequest extends Request
$input['design']['footer'] = '';
}
if (! array_key_exists('header', $input['design']) || is_null($input['design']['header'])) {
$input['design']['header'] = '';
}
$this->replace($input);
}
}

View File

@ -23,6 +23,6 @@ class ReconfirmUserRequest extends Request
*/
public function authorize() : bool
{
return auth()->user()->isAdmin();
return auth()->user()->id == $this->user->id;
}
}

View File

@ -96,22 +96,6 @@ class CreateAccount
//todo implement SLACK notifications
//$sp035a66->notification(new NewAccountCreated($spaa9f78, $sp035a66))->ninja();
// $nmo = new NinjaMailerObject;
// $nmo->mailable = new NinjaMailer((new AccountCreatedObject($spaa9f78, $sp035a66))->build());
// $nmo->company = $sp035a66;
// $nmo->to_user = $spaa9f78;
// $nmo->settings = $sp035a66->settings;
$nmo = new NinjaMailerObject;
$nmo->mailable = new NinjaMailer((new VerifyUserObject($spaa9f78, $sp035a66))->build());
$nmo->company = $sp035a66;
$nmo->to_user = $spaa9f78;
$nmo->settings = $sp035a66->settings;
NinjaMailerJob::dispatch($nmo);
// NinjaMailerJob::dispatchNow($nmo);
VersionCheck::dispatchNow();
LightLogs::create(new AnalyticsAccountCreated())

View File

@ -82,8 +82,10 @@ class CreateUser
'settings' => null,
]);
if(!Ninja::isSelfHost())
if(!Ninja::isSelfHost()){
nlog("in the create user class");
event(new UserWasCreated($user, $user, $this->company, Ninja::eventVars()));
}
return $user;
}

View File

@ -59,7 +59,7 @@ class PaymentNotification implements ShouldQueue
foreach ($payment->company->company_users as $company_user) {
$user = $company_user->user;
$methods = $this->findUserEntityNotificationType($payment, $company_user, ['all_notifications']);
$methods = $this->findUserEntityNotificationType($payment, $company_user, ['payment_success_all', 'all_notifications']);
if (($key = array_search('mail', $methods)) !== false) {
unset($methods[$key]);
@ -69,19 +69,8 @@ class PaymentNotification implements ShouldQueue
NinjaMailerJob::dispatch($nmo);
}
// $notification = new NewPaymentNotification($payment, $payment->company);
// $notification->method = $methods;
// if ($user) {
// $user->notify($notification);
// }
}
/*Company Notifications*/
// if (isset($payment->company->slack_webhook_url)) {
// Notification::route('slack', $payment->company->slack_webhook_url)
// ->notify(new NewPaymentNotification($payment, $payment->company, true));
// }
/*Google Analytics Track Revenue*/
if (isset($payment->company->google_analytics_key)) {

View File

@ -46,7 +46,8 @@ class SendVerificationNotification implements ShouldQueue
*/
public function handle($event)
{
nlog("In Send Verification Notification");
MultiDB::setDB($event->company->db);
$event->user->service()->invite($event->company);

View File

@ -88,6 +88,8 @@ class CreditService
{
$this->credit = (new ApplyPayment($this->credit, $invoice, $amount, $payment))->run();
$this->deletePdf();
return $this;
}

View File

@ -44,6 +44,7 @@ class MarkSent
->setStatus(Credit::STATUS_SENT)
->applyNumber()
->adjustBalance($this->credit->amount)
->deletePdf()
->save();

View File

@ -43,6 +43,7 @@ class MarkSent
->service()
->setStatus(Quote::STATUS_SENT)
->applyNumber()
->deletePdf()
->save();
return $this->quote;

View File

@ -39,21 +39,6 @@ class QuoteService
return $this;
}
// public function markApproved()
// {
// $mark_approved = new MarkApproved($this->quote->client);
// $this->quote = $mark_approved->run($this->quote);
// if ($this->quote->client->getSetting('auto_convert_quote') == true) {
// $this->convert();
// }
// $this->markSent()
// ->createInvitations();
// return $this;
// }
public function convert() :self
{
if ($this->quote->invoice_id) {
@ -127,6 +112,7 @@ class QuoteService
->service()
->markSent()
->createInvitations()
->deletePdf()
->save();
}

View File

@ -65,7 +65,7 @@
"predis/predis": "^1.1",
"sentry/sentry-laravel": "^2",
"stripe/stripe-php": "^7.50",
"turbo124/beacon": "^1",
"turbo124/beacon": "^1.0",
"webpatser/laravel-countries": "dev-master#75992ad",
"wildbit/swiftmailer-postmark": "^3.3"
},

713
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', ''),
'app_version' => '5.1.18',
'app_version' => '5.1.19',
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', false),

View File

@ -30,7 +30,7 @@ const RESOURCES = {
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "3e722fd57a6db80ee119f0e2c230ccff",
"assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f",
"/": "23224b5e03519aaa87594403d54412cf",
"main.dart.js": "b47a232664791053223138fe8bf8322c",
"main.dart.js": "4f262274e979ed7c414d394fc5f0baea",
"version.json": "b7c8971e1ab5b627fd2a4317c52b843e",
"favicon.png": "dca91c54388f52eded692718d5a98b8b"
};

31301
public/main.dart.js vendored

File diff suppressed because one or more lines are too long

View File

@ -165,6 +165,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::post('users/bulk', 'UserController@bulk')->name('users.bulk')->middleware('password_protected');
Route::post('/users/{user}/invite', 'UserController@invite')->middleware('password_protected');
Route::post('/user/{user}/reconfirm', 'UserController@reconfirm');
Route::resource('webhooks', 'WebhookController');
Route::post('webhooks/bulk', 'WebhookController@bulk')->name('webhooks.bulk');