1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
This commit is contained in:
David Bomba 2021-03-03 21:04:10 +11:00
parent c23b9b147d
commit bfbde2ba51
13 changed files with 14 additions and 88 deletions

View File

@ -1 +1 @@
5.1.13
5.1.14

View File

@ -614,8 +614,8 @@ class CompanySettings extends BaseSettings
'$invoice.po_number',
'$invoice.date',
'$invoice.due_date',
'$invoice.balance_due',
'$invoice.total',
'$invoice.balance_due',
],
'quote_details' => [
'$quote.number',

View File

@ -23,8 +23,7 @@ class OneTimeTokenController extends BaseController
{
private $contexts = [
'stripe_connect_test' => 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_J2FhIhcf9GT5BlWUNeQ1FhnZACaYZrOI&scope=read_write
',
'stripe_connect_test' => 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_J2FhIhcf9GT5BlWUNeQ1FhnZACaYZrOI&scope=read_write',
'stripe_connect' => 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_J2Fh2tZfMlaaItUfbUwBBx4JPss8jCz9&scope=read_write'
];
@ -93,7 +92,7 @@ class OneTimeTokenController extends BaseController
Auth::login($user, true);
Cache::forget($request->input('hash'));
// Cache::forget($request->input('hash'));
$this->sendTo($data['context']);

View File

@ -554,79 +554,6 @@ class UserController extends BaseController
return $this->listResponse(User::withTrashed()->whereIn('id', $return_user_collection));
}
/**
* Attach an existing user to a company.
*
* @OA\Post(
* path="/api/v1/users/{user}/attach_to_company",
* operationId="attachUser",
* tags={"users"},
* summary="Attach an existing user to a company",
* description="Attach an existing user to 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\RequestBody(
* description="The company user object",
* required=true,
* @OA\JsonContent(ref="#/components/schemas/CompanyUser"),
* ),
* @OA\Response(
* response=200,
* description="Returns the saved User object",
* @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\JsonContent(ref="#/components/schemas/CompanyUser"),
* ),
* @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 AttachCompanyUserRequest $request
* @param User $user
* @return Response|mixed
*/
public function attach(AttachCompanyUserRequest $request, User $user)
{
$company = auth()->user()->company();
$user->companies()->attach(
$company->id,
array_merge(
$request->all(),
[
'account_id' => $company->account->id,
'notifications' => CompanySettings::notificationDefaults(),
]
)
);
$ct = CreateCompanyToken::dispatchNow($company, $user, 'User token created by'.auth()->user()->present()->name());
return $this->itemResponse($user->fresh());
}
/**
* Detach an existing user to a company.
*

View File

@ -61,7 +61,6 @@ class AttachableUser implements Rule
->where('user_id', $user->id)
->where('account_id',$user->account_id)
->where('company_id', auth()->user()->company()->id)
->withTrashed()
->exists();
if($user_already_attached)

View File

@ -249,7 +249,7 @@ class HtmlEngine
$data['$client.balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
$data['$client_balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
$data['$paid_to_date'] = ['value' => Number::formatMoney($this->client->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')];
$data['$paid_to_date'] = ['value' => Number::formatMoney($this->entity->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')];
$data['$contact.full_name'] = ['value' => $this->contact->present()->name(), 'label' => ctrans('texts.name')];
$data['$contact.email'] = ['value' => $this->contact->email, 'label' => ctrans('texts.email')];

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.13',
'app_version' => '5.1.14',
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', false),

View File

@ -3968,8 +3968,8 @@ $LANG = array(
'list_of_recurring_invoices' => 'List of recurring invoices',
'details_of_recurring_invoice' => 'Here are some details about recurring invoice',
'cancellation' => 'Cancellation',
'about_cancellation' => 'In case you want to stop the recurring invoice,\n please click the request the cancellation.',
'cancellation_warning' => 'Warning! You are requesting a cancellation of this service.\n Your service may be cancelled with no further notification to you.',
'about_cancellation' => 'In case you want to stop the recurring invoice, please click the request the cancellation.',
'cancellation_warning' => 'Warning! You are requesting a cancellation of this service. Your service may be cancelled with no further notification to you.',
'cancellation_pending' => 'Cancellation pending, we\'ll be in touch!',
'list_of_payments' => 'List of payments',
'payment_details' => 'Details of the payment',

View File

@ -8,7 +8,7 @@
@section('body')
<div class="grid lg:grid-cols-3">
@if(!\App\Models\Account::first()->isPaid())
@if(\App\Models\Account::count() > 0 && !\App\Models\Account::first()->isPaid())
<div class="hidden lg:block col-span-1 bg-red-100 h-screen">
<img src="https://www.invoiceninja.com/wp-content/uploads/2018/04/bg-home2018b.jpg"
class="w-full h-screen object-cover"

View File

@ -3,7 +3,7 @@
@section('body')
<div class="grid lg:grid-cols-3">
@if(!\App\Models\Account::first()->isPaid())
@if(\App\Models\Account::count() > 0 && !\App\Models\Account::first()->isPaid())
<div class="hidden lg:block col-span-1 bg-red-100 h-screen">
<img src="https://www.invoiceninja.com/wp-content/uploads/2018/04/bg-home2018b.jpg"
class="w-full h-screen object-cover"

View File

@ -3,7 +3,7 @@
@section('body')
<div class="grid lg:grid-cols-3">
@if(!\App\Models\Account::first()->isPaid())
@if(\App\Models\Account::count() > 0 && !\App\Models\Account::first()->isPaid())
<div class="hidden lg:block col-span-1 bg-red-100 h-screen">
<img src="https://www.invoiceninja.com/wp-content/uploads/2018/04/bg-home2018b.jpg"
class="w-full h-screen object-cover"

View File

@ -161,7 +161,8 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::put('users/{user}', 'UserController@update')->middleware('password_protected');
Route::post('users', 'UserController@store')->middleware('password_protected');
//Route::post('users/{user}/attach_to_company', 'UserController@attach')->middleware('password_protected');
Route::delete('users/{user}/', 'UserController@detach')->middleware('password_protected');
Route::delete('users/{user}/detach_from_company', 'UserController@detach')->middleware('password_protected');
Route::post('users/bulk', 'UserController@bulk')->name('users.bulk')->middleware('password_protected');
Route::post('/user/{user}/reconfirm', 'UserController@reconfirm')->middleware('password_protected');

View File

@ -129,7 +129,7 @@ class UserTest extends TestCase
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
'X-API-PASSWORD' => 'ALongAndBriliantPassword',
])->delete('/api/v1/users/'.$this->encodePrimaryKey($user->id).'?include=company_user');
])->delete('/api/v1/users/'.$this->encodePrimaryKey($user->id).'/detach_from_company?include=company_user');
$response->assertStatus(200);