Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Cüneyt Şentürk 2020-02-13 16:37:38 +03:00
commit 311139df10
7 changed files with 13 additions and 5 deletions

View File

@ -89,6 +89,13 @@ class UpdateCompany extends Job
*/
public function authorize()
{
// Can't disable active company
if (($this->request->get('enabled', 1) == 0) && ($this->company->id == session('company_id'))) {
$message = trans('companies.error.disable_active');
throw new \Exception($message);
}
// Check if user can access company
if (!$this->isUserCompany($this->company->id)) {
$message = trans('companies.error.not_user_company');

View File

@ -8,6 +8,7 @@ return [
'error' => [
'not_user_company' => 'Error: You are not allowed to change this company!',
'delete_active' => 'Error: Can not delete the active company. Please, switch to another first!',
'disable_active' => 'Error: Can not disable the active company. Please, switch to another first!',
],
];

View File

@ -128,7 +128,6 @@ return [
'disable' => 'Disable',
'select_all' => 'Select All',
'unselect_all' => 'Unselect All',
'go_to' => 'Go to :name',
'created_date' => 'Created Date',
'period' => 'Period',
'frequency' => 'Frequency',
@ -152,6 +151,7 @@ return [
'no_data' => 'No data',
'no_matching_data' => 'No matching data',
'clear_cache' => 'Clear Cache',
'go_to_dashboard' => 'Go to dashboard',
'card' => [
'name' => 'Name on Card',

View File

@ -12,7 +12,7 @@
@php $landing_page = user() ? route(user()->landing_page) : route('login'); @endphp
<a href="{{ $landing_page }}" class="btn btn-success header-button-top"><span class="fa fa-tachometer-alt"></span> &nbsp;{{ trans('general.go_to', ['name' => trans_choice('general.dashboards', 1)]) }}</a>
<a href="{{ $landing_page }}" class="btn btn-success header-button-top"><span class="fa fa-tachometer-alt"></span> &nbsp;{{ trans('general.go_to_dashboard') }}</a>
</div>
</div>
@endsection

View File

@ -12,7 +12,7 @@
@php $landing_page = user() ? route(user()->landing_page) : route('login'); @endphp
<a href="{{ $landing_page }}" class="btn btn-success header-button-top"><span class="fa fa-tachometer-alt"></span> &nbsp;{{ trans('general.go_to', ['name' => trans_choice('general.dashboards', 1)]) }}</a>
<a href="{{ $landing_page }}" class="btn btn-success header-button-top"><span class="fa fa-tachometer-alt"></span> &nbsp;{{ trans('general.go_to_dashboard') }}</a>
</div>
</div>
@endsection

View File

@ -12,7 +12,7 @@
@php $landing_page = user() ? route(user()->landing_page) : route('login'); @endphp
<a href="{{ $landing_page }}" class="btn btn-success header-button-top"><span class="fa fa-tachometer-alt"></span> &nbsp;{{ trans('general.go_to', ['name' => trans_choice('general.dashboards', 1)]) }}</a>
<a href="{{ $landing_page }}" class="btn btn-success header-button-top"><span class="fa fa-tachometer-alt"></span> &nbsp;{{ trans('general.go_to_dashboard') }}</a>
</div>
</div>
@endsection

View File

@ -58,7 +58,7 @@
<div class="col-sm-6 text-right">
<a href="{{ url('/') }}" id="wizard-skip" class="btn btn-icon btn-success header-button-top">
<span class="btn-inner--icon"><i class="fa fa-tachometer-alt"></i></span>
<span class="btn-inner--text">{{ trans('general.go_to', ['name' => trans_choice('general.dashboards', 1)]) }}</span>
<span class="btn-inner--text">{{ trans('general.go_to_dashboard') }}</span>
</a>
</div>
</div>