prevent deletion of last category by type #304
This commit is contained in:
@ -37,6 +37,7 @@ return [
|
||||
'updates' => 'Update|Updates',
|
||||
'numbers' => 'Number|Numbers',
|
||||
'statuses' => 'Status|Statuses',
|
||||
'others' => 'Other|Others',
|
||||
|
||||
'dashboard' => 'Dashboard',
|
||||
'banking' => 'Banking',
|
||||
|
@ -14,6 +14,7 @@ return [
|
||||
'not_user_company' => 'Error: You are not allowed to manage this company!',
|
||||
'customer' => 'Error: User not created! :name already uses this email address.',
|
||||
'no_file' => 'Error: No file selected!',
|
||||
'last_category' => 'Error: Can not delete the last :type category!',
|
||||
],
|
||||
'warning' => [
|
||||
'deleted' => 'Warning: You are not allowed to delete <b>:name</b> because it has :text related.',
|
||||
|
@ -10,7 +10,7 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', ['expense' => 'Expense', 'income' => 'Income', 'item' => 'Item', 'other' => 'Other'], config('general.types')) }}
|
||||
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, config('general.types')) }}
|
||||
|
||||
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
|
||||
{!! Form::label('color', trans('general.color'), ['class' => 'control-label']) !!}
|
||||
|
@ -14,11 +14,11 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
@if ($category->id == $transfer_id)
|
||||
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', ['expense' => 'Expense', 'income' => 'Income', 'item' => 'Item', 'other' => 'Other'], null, ['required' => 'required', 'disabled' => 'disabled']) }}
|
||||
<input type="hidden" name="type" value="other" />
|
||||
@if ($type_disabled)
|
||||
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, null, ['required' => 'required', 'disabled' => 'disabled']) }}
|
||||
<input type="hidden" name="type" value="{{ $category->type }}" />
|
||||
@else
|
||||
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', ['expense' => 'Expense', 'income' => 'Income', 'item' => 'Item', 'other' => 'Other']) }}
|
||||
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types) }}
|
||||
@endif
|
||||
|
||||
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
|
||||
|
Reference in New Issue
Block a user