lang files finally finished

This commit is contained in:
ilmedova 2022-11-08 19:07:12 +05:00
parent a750e1e209
commit 0bb9522a64
6 changed files with 173 additions and 98 deletions

View File

@ -32,7 +32,7 @@ public function import(Request $request){
$contract['Note'] = $item['Note'];
$contract['Remark'] = $item['Remark'];
$record = Contract::where('InputNumber', $contract['InputNumber'])->first();
$record = Contract::where('foreign_ID', $contract['foreign_ID'])->first();
if($record != null){
$record->fill($contract);
$record->save();

View File

@ -29,7 +29,7 @@ public function setup()
{
CRUD::setModel(\App\Models\Contract::class);
CRUD::setRoute(config('backpack.base.route_prefix') . '/contract');
CRUD::setEntityNameStrings('contract', 'contracts');
CRUD::setEntityNameStrings(trans('app.contract.title'), trans('app.contract.list_title'));
}
/**
@ -40,29 +40,49 @@ public function setup()
*/
protected function setupListOperation()
{
CRUD::column('id');
CRUD::column('foreign_ID');
CRUD::column('InputNumber');
CRUD::column('InputDate');
CRUD::column('RegDate');
CRUD::addColumn([
'name' => 'MarkerSpec',
'label' => 'MarkerSpec',
'type' => 'closure',
'function' => function($entry) {
return Lang::get('imported.markerspec.' . $entry->MarkerSpec);
}
CRUD::addColumns([
[
'name' => 'InputNumber',
'label' => trans('app.contract.input_number'),
'type' => 'text'
],
[
'name' => 'InputDate',
'label' => trans('app.contract.input_date'),
'type' => 'text'
],
[
'name' => 'RegDate',
'label' => trans('app.contract.reg_date'),
'type' => 'text'
],
[
'name' => 'MarkerSpec',
'label' => trans('app.contract.status_marker'),
'type' => 'closure',
'function' => function($entry) {
return Lang::get('imported.markerspec.' . $entry->MarkerSpec);
}
],
[
'name' => 'Workflow_ID',
'label' => trans('app.contract.workflow'),
'type' => 'closure',
'function' => function($entry) {
return Lang::get('imported.workflow.' . $entry->Workflow_ID);
}
],
[
'name' => 'Note',
'label' => trans('app.contract.note'),
'type' => 'text'
],
[
'name' => 'Remark',
'label' => trans('app.contract.remark'),
'type' => 'text'
],
]);
CRUD::addColumn([
'name' => 'Workflow_ID',
'label' => 'Workflow',
'type' => 'closure',
'function' => function($entry) {
return Lang::get('imported.workflow.' . $entry->Workflow_ID);
}
]);
CRUD::column('Note');
CRUD::column('Remark');
/**
* Columns can be defined using the fluent syntax or array syntax:
* - CRUD::column('price')->type('number');
@ -80,13 +100,49 @@ protected function setupCreateOperation()
{
CRUD::setValidation(ContractRequest::class);
CRUD::field('InputNumber');
CRUD::field('InputDate');
CRUD::field('RegDate');
CRUD::field('MarkerSpec');
CRUD::field('Workflow_ID');
CRUD::field('Note');
CRUD::field('Remark');
CRUD::addFields([
[
'name' => 'InputNumber',
'label' => trans('app.contract.input_number'),
'type' => 'text'
],
[
'name' => 'InputDate',
'label' => trans('app.contract.input_date'),
'type' => 'text'
],
[
'name' => 'RegDate',
'label' => trans('app.contract.reg_date'),
'type' => 'text'
],
[
'name' => 'MarkerSpec',
'label' => trans('app.contract.status_marker'),
'type' => 'closure',
'function' => function($entry) {
return Lang::get('imported.markerspec.' . $entry->MarkerSpec);
}
],
[
'name' => 'Workflow_ID',
'label' => trans('app.contract.workflow'),
'type' => 'closure',
'function' => function($entry) {
return Lang::get('imported.workflow.' . $entry->Workflow_ID);
}
],
[
'name' => 'Note',
'label' => trans('app.contract.note'),
'type' => 'text'
],
[
'name' => 'Remark',
'label' => trans('app.contract.remark'),
'type' => 'text'
],
]);
/**
* Fields can be defined using the fluent syntax or array syntax:

View File

@ -21,37 +21,47 @@ class CountryCrudController extends CrudController
/**
* Configure the CrudPanel object. Apply settings to all operations.
*
*
* @return void
*/
public function setup()
{
CRUD::setModel(\App\Models\Country::class);
CRUD::setRoute(config('backpack.base.route_prefix') . '/country');
CRUD::setEntityNameStrings('country', 'countries');
CRUD::setEntityNameStrings(trans('app.resource.country'), trans('app.resource.countries'));
}
/**
* Define what happens when the List operation is loaded.
*
*
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
* @return void
*/
protected function setupListOperation()
{
CRUD::column('name');
CRUD::column('code');
CRUD::addColumns([
[
'name' => 'name',
'label' => trans('app.resource.name'),
'type' => 'text'
],
[
'name' => 'code',
'label' => trans('app.resource.code'),
'type' => 'text'
]
]);
/**
* Columns can be defined using the fluent syntax or array syntax:
* - CRUD::column('price')->type('number');
* - CRUD::addColumn(['name' => 'price', 'type' => 'number']);
* - CRUD::addColumn(['name' => 'price', 'type' => 'number']);
*/
}
/**
* Define what happens when the Create operation is loaded.
*
*
* @see https://backpackforlaravel.com/docs/crud-operation-create
* @return void
*/
@ -59,19 +69,29 @@ protected function setupCreateOperation()
{
CRUD::setValidation(CountryRequest::class);
CRUD::field('name');
CRUD::field('code');
CRUD::addFields([
[
'name' => 'name',
'label' => trans('app.resource.name'),
'type' => 'text'
],
[
'name' => 'code',
'label' => trans('app.resource.code'),
'type' => 'text'
]
]);
/**
* Fields can be defined using the fluent syntax or array syntax:
* - CRUD::field('price')->type('number');
* - CRUD::addField(['name' => 'price', 'type' => 'number']));
* - CRUD::addField(['name' => 'price', 'type' => 'number']));
*/
}
/**
* Define what happens when the Update operation is loaded.
*
*
* @see https://backpackforlaravel.com/docs/crud-operation-update
* @return void
*/

View File

@ -28,15 +28,15 @@ public function setup()
{
CRUD::setModel(\App\Models\Document::class);
CRUD::setRoute(config('backpack.base.route_prefix') . '/document');
CRUD::setEntityNameStrings('document', 'documents');
CRUD::setEntityNameStrings(trans('app.resource.document'), trans('app.resource.documents'));
$this->crud->addFilter([
'name' => 'business',
'type' => 'dropdown',
'label' => 'Business'
'label' => trans('app.resource.business')
], [
1 => 'yes',
0 => 'no'
1 => trans('app.resource.yes'),
0 => trans('app.resource.no')
], function ($value) { // if the filter is active
$this->crud->addClause('where', 'business', $value);
});
@ -44,10 +44,10 @@ public function setup()
$this->crud->addFilter([
'name' => 'company',
'type' => 'dropdown',
'label' => 'Company'
'label' => trans('app.resource.company')
], [
1 => 'yes',
0 => 'no'
1 => trans('app.resource.yes'),
0 => trans('app.resource.no')
], function ($value) { // if the filter is active
$this->crud->addClause('where', 'company', $value);
});
@ -55,10 +55,10 @@ public function setup()
$this->crud->addFilter([
'name' => 'all_country',
'type' => 'dropdown',
'label' => 'All country'
'label' => trans('app.rescource.all_countries')
], [
1 => 'yes',
0 => 'no'
1 => trans('app.resource.yes'),
0 => trans('app.resource.no')
], function ($value) {
$this->crud->addClause('where', 'all_country', $value);
});
@ -67,7 +67,7 @@ public function setup()
$this->crud->addFilter([
'name' => 'countries',
'type' => 'select2_multiple',
'label' => 'Countries'
'label' => trans('app.resource.countries')
], function() {
return Country::all()->pluck('name', 'id')->toArray();
}, function($values) {
@ -91,49 +91,49 @@ protected function setupListOperation()
[
'name' => 'name',
'type' => 'text',
'label' => 'Name'
'label' => trans('app.resource.name')
],
[
'name' => 'max_size',
'type' => 'number',
'label' => 'Max size (KBytes)',
'label' => trans('app.resource.max_size'),
'default' => 0
],
[
'name' => 'order',
'type' => 'number',
'label' => 'Position',
'label' => trans('app.resource.position'),
'default' => 0
],
[
'name' => 'business',
'type' => 'radio',
'label' => 'Enterpreneurs',
'label' => trans('app.resource.enterpreneurs'),
'options' => [
1 => 'Yes',
0 => 'No'
1 => trans('app.resource.yes'),
0 => trans('app.resource.no')
]
],
[
'name' => 'company',
'type' => 'radio',
'label' => 'Companies',
'label' => trans('app.resource.companies'),
'options' => [
1 => 'Yes',
0 => 'No'
1 => trans('app.resource.yes'),
0 => trans('app.resource.no')
]
],
[
'name' => 'all_country',
'type' => 'radio',
'label' => 'All countries',
'label' => trans('app.resource.all_countries'),
'options' => [
1 => 'Yes',
0 => 'No'
1 => trans('app.resource.yes'),
0 => trans('app.resource.no')
]
],
[
'label' => "Document Countries",
'label' => trans('app.resource.doc_countries'),
'type' => 'select_multiple',
'name' => 'countries',
@ -181,37 +181,21 @@ protected function setupCreateOperation()
'label' => 'Position',
'default' => 0
],
[ // Checkbox
[
'name' => 'business',
'label' => 'Enterpreneurs',
'type' => 'checkbox'
],
[ // Checkbox
[
'name' => 'company',
'label' => 'Companies',
'type' => 'checkbox'
],
[ // Checkbox
[
'name' => 'all_country',
'label' => 'All countries',
'type' => 'checkbox'
],
// [ // SelectMultiple = n-n relationship (with pivot table)
// 'label' => "Document Groups",
// 'type' => 'select_multiple',
// 'name' => 'groups', // the method that defines the relationship in your Model
// // optional
// 'entity' => 'groups', // the method that defines the relationship in your Model
// 'model' => "App\Models\Documentgroup", // foreign key model
// 'attribute' => 'name', // foreign key attribute that is shown to user
// 'pivot' => true, // on create&update, do you need to add/delete pivot table entries?
// // also optional
// 'options' => (function ($query) {
// return $query->orderBy('name', 'ASC')->get();
// }), // force the related options to be a custom query, instead of all(); you can use this to filter the results show in the select
// ],
[
'label' => "Document Countries",
'type' => 'select2_multiple',

View File

@ -112,7 +112,7 @@
'citizenship' => "Citizenship",
],
'ticket' =>[
'ticket' => [
'title' => 'Ticket',
'list_title' => 'tickets',
'statuses' => 'statuses',
@ -127,12 +127,35 @@
'last_sender' => 'Last sender',
],
'contract' => [
'list_title' => 'contracts'
'title' => 'Contract',
'list_title' => 'contracts',
'reg_date' => 'Registration date',
'input_number' => 'Input number',
'input_date' => 'Input date',
'status_marker' => 'Status marker',
'workflow' => 'Workflow',
'note' => 'Note',
'remark' => 'Remark',
],
'resource' => [
'resources' => 'resources',
'countries' => 'countries',
'documents' => 'documents',
'resources' => 'resources',
'country' => 'country',
'countries' => 'countries',
'documents' => 'documents',
'name' => 'name',
'code' => 'code',
'yes' => 'yes',
'no' => 'no',
'document' => 'document',
'documents' => 'documents',
'business' => 'Business',
'company' => 'Company',
'all_countries' => 'All countries',
'max_size' => 'Max size (KBytes)',
'position' => 'Position',
'enterpreneurs' => 'Enterpreneurs',
'companies' => 'Companies',
'doc_countries' => 'Document Countries'
],
'user' => [
'admins' => 'admins',

View File

@ -47,14 +47,6 @@
</ul>
</li>
<li class="nav-item nav-dropdown">
<a class="nav-link nav-dropdown-toggle" href="#"><i class="nav-icon la la-globe"></i> @lang('app.localization.translations')</a>
<ul class="nav-dropdown-items">
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('language') }}"><i class="nav-icon la la-flag-checkered"></i> @lang('app.localization.languages')</a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('language/texts') }}"><i class="nav-icon la la-language"></i> @lang('app.localization.texts')</a></li>
</ul>
</li>
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('log') }}'><i class='nav-icon la la-terminal'></i> @lang('app.logs')</a></li>
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('setting') }}'><i class='nav-icon la la-cog'></i> <span>@lang('app.settings')</span></a></li>