mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
profile education form edit (half)
This commit is contained in:
parent
35ee03820d
commit
4e56768c20
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||
|
||||
class VisiosoftModuleProfileCreateEducationStream extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* This migration creates the stream.
|
||||
* It should be deleted on rollback.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $delete = true;
|
||||
|
||||
/**
|
||||
* The stream definition.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $stream = [
|
||||
'slug' => 'education',
|
||||
'title_column' => 'name',
|
||||
'translatable' => true,
|
||||
'versionable' => false,
|
||||
'trashable' => false,
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
];
|
||||
|
||||
/**
|
||||
* The stream assignments.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assignments = [
|
||||
'name' => [
|
||||
'translatable' => true,
|
||||
'required' => true,
|
||||
],
|
||||
'slug' => [
|
||||
'unique' => true,
|
||||
'required' => true,
|
||||
],
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||
use Visiosoft\ProfileModule\Education\EducationModel;
|
||||
|
||||
class VisiosoftModuleProfileCreateEducationPartStream extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* This migration creates the stream.
|
||||
* It should be deleted on rollback.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $delete = true;
|
||||
|
||||
/**
|
||||
* The stream definition.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $stream = [
|
||||
'slug' => 'education_part',
|
||||
'title_column' => 'name',
|
||||
'translatable' => true,
|
||||
'versionable' => false,
|
||||
'trashable' => false,
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
];
|
||||
|
||||
/**
|
||||
* The stream assignments.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assignments = [
|
||||
'education' => [
|
||||
'required' => true,
|
||||
],
|
||||
'name' => [
|
||||
'translatable' => true,
|
||||
'required' => true,
|
||||
],
|
||||
'slug' => [
|
||||
'unique' => true,
|
||||
'required' => true,
|
||||
],
|
||||
];
|
||||
|
||||
protected $fields = [
|
||||
'education' => [
|
||||
'type' => 'anomaly.field_type.relationship',
|
||||
'config' => [
|
||||
'related' => EducationModel::class,
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||
use \Visiosoft\ProfileModule\EducationPart\EducationPartModel;
|
||||
|
||||
class VisiosoftModuleProfileCreateEducationPartOptionStream extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* This migration creates the stream.
|
||||
* It should be deleted on rollback.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $delete = true;
|
||||
|
||||
/**
|
||||
* The stream definition.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $stream = [
|
||||
'slug' => 'education_part_option',
|
||||
'title_column' => 'name',
|
||||
'translatable' => true,
|
||||
'versionable' => false,
|
||||
'trashable' => false,
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
];
|
||||
|
||||
/**
|
||||
* The stream assignments.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assignments = [
|
||||
'education_part' => [
|
||||
'required' => true,
|
||||
],
|
||||
'name' => [
|
||||
'translatable' => true,
|
||||
'required' => true,
|
||||
],
|
||||
'slug' => [
|
||||
'unique' => true,
|
||||
'required' => true,
|
||||
],
|
||||
];
|
||||
|
||||
protected $fields = [
|
||||
'education_part' => [
|
||||
'type' => 'anomaly.field_type.relationship',
|
||||
'config' => [
|
||||
'related' => EducationPartModel::class,
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
}
|
||||
@ -6,4 +6,24 @@ return [
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'education' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'education' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'education_part' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'education_part_option' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
];
|
||||
|
||||
@ -15,4 +15,8 @@ return [
|
||||
'personal' => 'Personal',
|
||||
'corporate' => 'Corporate',
|
||||
'export' => 'Export',
|
||||
'new_education' => 'New Education',
|
||||
'new_education' => 'New Education',
|
||||
'new_education_part' => 'New Education part',
|
||||
'new_education_part_option' => 'New Education part option',
|
||||
];
|
||||
|
||||
@ -17,4 +17,36 @@ return [
|
||||
'delete' => 'Can delete adress?',
|
||||
],
|
||||
],
|
||||
'education' => [
|
||||
'name' => 'Education',
|
||||
'option' => [
|
||||
'read' => 'Can read education?',
|
||||
'write' => 'Can create/edit education?',
|
||||
'delete' => 'Can delete education?',
|
||||
],
|
||||
],
|
||||
'education' => [
|
||||
'name' => 'Education',
|
||||
'option' => [
|
||||
'read' => 'Can read education?',
|
||||
'write' => 'Can create/edit education?',
|
||||
'delete' => 'Can delete education?',
|
||||
],
|
||||
],
|
||||
'education_part' => [
|
||||
'name' => 'Education part',
|
||||
'option' => [
|
||||
'read' => 'Can read education part?',
|
||||
'write' => 'Can create/edit education part?',
|
||||
'delete' => 'Can delete education part?',
|
||||
],
|
||||
],
|
||||
'education_part_option' => [
|
||||
'name' => 'Education part option',
|
||||
'option' => [
|
||||
'read' => 'Can read education part option?',
|
||||
'write' => 'Can create/edit education part option?',
|
||||
'delete' => 'Can delete education part option?',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@ -9,4 +9,16 @@ return [
|
||||
],
|
||||
'general_setting' => 'General Settings',
|
||||
'recaptcha' => 'reCAPTCHA',
|
||||
'education' => [
|
||||
'title' => 'Education',
|
||||
],
|
||||
'education' => [
|
||||
'title' => 'Education',
|
||||
],
|
||||
'education_part' => [
|
||||
'title' => 'Education part',
|
||||
],
|
||||
'education_part_option' => [
|
||||
'title' => 'Education part option',
|
||||
],
|
||||
];
|
||||
|
||||
@ -7,4 +7,16 @@ return [
|
||||
'adress' => [
|
||||
'name' => 'Address',
|
||||
],
|
||||
'education' => [
|
||||
'name' => 'Education',
|
||||
],
|
||||
'education' => [
|
||||
'name' => 'Education',
|
||||
],
|
||||
'education_part' => [
|
||||
'name' => 'Education part',
|
||||
],
|
||||
'education_part_option' => [
|
||||
'name' => 'Education part option',
|
||||
],
|
||||
];
|
||||
|
||||
@ -171,40 +171,15 @@
|
||||
<label class="control-label font-weight-bold">
|
||||
{{ trans("visiosoft.module.profile::field.education.name") }}
|
||||
</label>
|
||||
{{ profileForm.fields.education.value.input|raw }}
|
||||
<select name="education" class="custom-select form-control"
|
||||
data-field="education" data-field_name="education"
|
||||
data-provides="anomaly.field_type.select" id="education">
|
||||
<option value="">
|
||||
{{ trans('visiosoft.module.profile::field.choose_an_option') }}
|
||||
</option>
|
||||
{% for education in setting_value('visiosoft.module.profile::education') %}
|
||||
<option value="{{ education }}"
|
||||
{{ profileForm.fields.education.value == education ? 'selected' }}>
|
||||
{{ education }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{{ profileForm.fields.education.input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group state_of_education-field">
|
||||
<div class="form-group education-part-field">
|
||||
<label class="control-label font-weight-bold">
|
||||
{{ trans("visiosoft.module.profile::field.state_of_education.name") }}
|
||||
{{ trans("visiosoft.module.profile::field.education_part.name") }}
|
||||
</label>
|
||||
<select name="state_of_education" class="custom-select form-control"
|
||||
data-field="state_of_education" data-field_name="state_of_education"
|
||||
data-provides="anomaly.field_type.select" id="state_of_education">
|
||||
<option value="">
|
||||
{{ trans('visiosoft.module.profile::field.choose_an_option') }}
|
||||
</option>
|
||||
{% for state_of_education in setting_value('visiosoft.module.profile::state_of_education') %}
|
||||
<option value="{{ state_of_education }}"
|
||||
{{ profileForm.fields.state_of_education.value == state_of_education ? 'selected' }}>
|
||||
{{ state_of_education }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{{ profileForm.fields.education_part.input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
@ -283,5 +258,38 @@
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
$.ajax({
|
||||
url: '/ajax/getEducation',
|
||||
success: ((res)=>{
|
||||
// console.log(res.user.education)
|
||||
$.each(res['education-part'], function (key, value) {
|
||||
$('#education_part').append(
|
||||
'<option value="'+ value.id +'" ' + value.id === res.user[""] + '>'+ value.name +'</option>'
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
$('#education').on('change', () => {
|
||||
$.ajax({
|
||||
url: '/ajax/setEducation',
|
||||
data: {
|
||||
education: $('#education').val()
|
||||
},beforeSend: function (){
|
||||
$('#education_part').html('');
|
||||
},success: function (response) {
|
||||
$.each(response.data, function (key, value) {
|
||||
$('#education_part').append(
|
||||
'<option value="'+ value.id +'">'+ value.name +'</option>'
|
||||
)
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/profile.js") }}
|
||||
{% endblock %}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education\Contract;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||
|
||||
interface EducationInterface extends EntryInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education\Contract;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface;
|
||||
|
||||
interface EducationRepositoryInterface extends EntryRepositoryInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryCollection;
|
||||
|
||||
class EducationCollection extends EntryCollection
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryCriteria;
|
||||
|
||||
class EducationCriteria extends EntryCriteria
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education;
|
||||
|
||||
use Visiosoft\ProfileModule\Education\Contract\EducationInterface;
|
||||
use Anomaly\Streams\Platform\Model\Profile\ProfileEducationEntryModel;
|
||||
|
||||
class EducationModel extends ProfileEducationEntryModel implements EducationInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryObserver;
|
||||
|
||||
class EducationObserver extends EntryObserver
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryPresenter;
|
||||
|
||||
class EducationPresenter extends EntryPresenter
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education;
|
||||
|
||||
use Visiosoft\ProfileModule\Education\Contract\EducationRepositoryInterface;
|
||||
use Anomaly\Streams\Platform\Entry\EntryRepository;
|
||||
|
||||
class EducationRepository extends EntryRepository implements EducationRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* The entry model.
|
||||
*
|
||||
* @var EducationModel
|
||||
*/
|
||||
protected $model;
|
||||
|
||||
/**
|
||||
* Create a new EducationRepository instance.
|
||||
*
|
||||
* @param EducationModel $model
|
||||
*/
|
||||
public function __construct(EducationModel $model)
|
||||
{
|
||||
$this->model = $model;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryRouter;
|
||||
|
||||
class EducationRouter extends EntryRouter
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education;
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||
|
||||
class EducationSeeder extends Seeder
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the seeder.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education\Form;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||
|
||||
class EducationFormBuilder extends FormBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The form fields.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $fields = [];
|
||||
|
||||
/**
|
||||
* Additional validation rules.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $rules = [];
|
||||
|
||||
/**
|
||||
* Fields to skip.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $skips = [];
|
||||
|
||||
/**
|
||||
* The form actions.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $actions = [];
|
||||
|
||||
/**
|
||||
* The form buttons.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $buttons = [
|
||||
'cancel',
|
||||
];
|
||||
|
||||
/**
|
||||
* The form options.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* The form sections.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $sections = [];
|
||||
|
||||
/**
|
||||
* The form assets.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assets = [];
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Education\Table;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
|
||||
|
||||
class EducationTableBuilder extends TableBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The table views.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $views = [];
|
||||
|
||||
/**
|
||||
* The table filters.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $filters = [];
|
||||
|
||||
/**
|
||||
* The table columns.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $columns = [];
|
||||
|
||||
/**
|
||||
* The table buttons.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $buttons = [
|
||||
'edit'
|
||||
];
|
||||
|
||||
/**
|
||||
* The table actions.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $actions = [
|
||||
'delete'
|
||||
];
|
||||
|
||||
/**
|
||||
* The table options.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* The table assets.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assets = [];
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart\Contract;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||
|
||||
interface EducationPartInterface extends EntryInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart\Contract;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface;
|
||||
|
||||
interface EducationPartRepositoryInterface extends EntryRepositoryInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryCollection;
|
||||
|
||||
class EducationPartCollection extends EntryCollection
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryCriteria;
|
||||
|
||||
class EducationPartCriteria extends EntryCriteria
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart;
|
||||
|
||||
use Visiosoft\ProfileModule\EducationPart\Contract\EducationPartInterface;
|
||||
use Anomaly\Streams\Platform\Model\Profile\ProfileEducationPartEntryModel;
|
||||
|
||||
class EducationPartModel extends ProfileEducationPartEntryModel implements EducationPartInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryObserver;
|
||||
|
||||
class EducationPartObserver extends EntryObserver
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryPresenter;
|
||||
|
||||
class EducationPartPresenter extends EntryPresenter
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart;
|
||||
|
||||
use Visiosoft\ProfileModule\EducationPart\Contract\EducationPartRepositoryInterface;
|
||||
use Anomaly\Streams\Platform\Entry\EntryRepository;
|
||||
|
||||
class EducationPartRepository extends EntryRepository implements EducationPartRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* The entry model.
|
||||
*
|
||||
* @var EducationPartModel
|
||||
*/
|
||||
protected $model;
|
||||
|
||||
/**
|
||||
* Create a new EducationPartRepository instance.
|
||||
*
|
||||
* @param EducationPartModel $model
|
||||
*/
|
||||
public function __construct(EducationPartModel $model)
|
||||
{
|
||||
$this->model = $model;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryRouter;
|
||||
|
||||
class EducationPartRouter extends EntryRouter
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart;
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||
|
||||
class EducationPartSeeder extends Seeder
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the seeder.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart\Form;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||
|
||||
class EducationPartFormBuilder extends FormBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The form fields.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $fields = [];
|
||||
|
||||
/**
|
||||
* Additional validation rules.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $rules = [];
|
||||
|
||||
/**
|
||||
* Fields to skip.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $skips = [];
|
||||
|
||||
/**
|
||||
* The form actions.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $actions = [];
|
||||
|
||||
/**
|
||||
* The form buttons.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $buttons = [
|
||||
'cancel',
|
||||
];
|
||||
|
||||
/**
|
||||
* The form options.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* The form sections.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $sections = [];
|
||||
|
||||
/**
|
||||
* The form assets.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assets = [];
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPart\Table;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
|
||||
|
||||
class EducationPartTableBuilder extends TableBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The table views.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $views = [];
|
||||
|
||||
/**
|
||||
* The table filters.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $filters = [];
|
||||
|
||||
/**
|
||||
* The table columns.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $columns = [];
|
||||
|
||||
/**
|
||||
* The table buttons.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $buttons = [
|
||||
'edit'
|
||||
];
|
||||
|
||||
/**
|
||||
* The table actions.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $actions = [
|
||||
'delete'
|
||||
];
|
||||
|
||||
/**
|
||||
* The table options.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* The table assets.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assets = [];
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption\Contract;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||
|
||||
interface EducationPartOptionInterface extends EntryInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption\Contract;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface;
|
||||
|
||||
interface EducationPartOptionRepositoryInterface extends EntryRepositoryInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryCollection;
|
||||
|
||||
class EducationPartOptionCollection extends EntryCollection
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryCriteria;
|
||||
|
||||
class EducationPartOptionCriteria extends EntryCriteria
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption;
|
||||
|
||||
use Visiosoft\ProfileModule\EducationPartOption\Contract\EducationPartOptionInterface;
|
||||
use Anomaly\Streams\Platform\Model\Profile\ProfileEducationPartOptionEntryModel;
|
||||
|
||||
class EducationPartOptionModel extends ProfileEducationPartOptionEntryModel implements EducationPartOptionInterface
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryObserver;
|
||||
|
||||
class EducationPartOptionObserver extends EntryObserver
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryPresenter;
|
||||
|
||||
class EducationPartOptionPresenter extends EntryPresenter
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption;
|
||||
|
||||
use Visiosoft\ProfileModule\EducationPartOption\Contract\EducationPartOptionRepositoryInterface;
|
||||
use Anomaly\Streams\Platform\Entry\EntryRepository;
|
||||
|
||||
class EducationPartOptionRepository extends EntryRepository implements EducationPartOptionRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* The entry model.
|
||||
*
|
||||
* @var EducationPartOptionModel
|
||||
*/
|
||||
protected $model;
|
||||
|
||||
/**
|
||||
* Create a new EducationPartOptionRepository instance.
|
||||
*
|
||||
* @param EducationPartOptionModel $model
|
||||
*/
|
||||
public function __construct(EducationPartOptionModel $model)
|
||||
{
|
||||
$this->model = $model;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryRouter;
|
||||
|
||||
class EducationPartOptionRouter extends EntryRouter
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption;
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||
|
||||
class EducationPartOptionSeeder extends Seeder
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the seeder.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption\Form;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||
|
||||
class EducationPartOptionFormBuilder extends FormBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The form fields.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $fields = [];
|
||||
|
||||
/**
|
||||
* Additional validation rules.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $rules = [];
|
||||
|
||||
/**
|
||||
* Fields to skip.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $skips = [];
|
||||
|
||||
/**
|
||||
* The form actions.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $actions = [];
|
||||
|
||||
/**
|
||||
* The form buttons.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $buttons = [
|
||||
'cancel',
|
||||
];
|
||||
|
||||
/**
|
||||
* The form options.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* The form sections.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $sections = [];
|
||||
|
||||
/**
|
||||
* The form assets.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assets = [];
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
<?php namespace Visiosoft\ProfileModule\EducationPartOption\Table;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
|
||||
|
||||
class EducationPartOptionTableBuilder extends TableBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The table views.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $views = [];
|
||||
|
||||
/**
|
||||
* The table filters.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $filters = [];
|
||||
|
||||
/**
|
||||
* The table columns.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $columns = [];
|
||||
|
||||
/**
|
||||
* The table buttons.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $buttons = [
|
||||
'edit'
|
||||
];
|
||||
|
||||
/**
|
||||
* The table actions.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $actions = [
|
||||
'delete'
|
||||
];
|
||||
|
||||
/**
|
||||
* The table options.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* The table assets.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assets = [];
|
||||
|
||||
}
|
||||
@ -24,6 +24,8 @@ use Visiosoft\PackagesModule\User\UserModel;
|
||||
use Visiosoft\ProfileModule\Adress\AdressModel;
|
||||
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
|
||||
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
|
||||
use Visiosoft\ProfileModule\Education\EducationModel;
|
||||
use Visiosoft\ProfileModule\EducationPart\EducationPartModel;
|
||||
use Visiosoft\ProfileModule\Profile\Form\ProfileFormBuilder;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
@ -246,4 +248,18 @@ class MyProfileController extends PublicController
|
||||
return response()->json(['status' => 'success', 'data' => $profile]);
|
||||
}
|
||||
|
||||
public function getEducation(Request $request)
|
||||
{
|
||||
$user = $this->userRepository->find(auth()->user()->getAuthIdentifier());
|
||||
$education = EducationModel::all();
|
||||
$educationPart = EducationPartModel::all();
|
||||
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
|
||||
}
|
||||
|
||||
public function setEducation(Request $request)
|
||||
{
|
||||
$user = $this->userRepository->find(auth()->user()->getAuthIdentifier())->update(['education' => $request->education]);
|
||||
$education_part = EducationPartModel::query()->where('education_id', $request->education)->get();
|
||||
return response()->json(['messages' => $user, 'data' => $education_part], 200);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
<?php namespace Visiosoft\ProfileModule\OptionHandler;
|
||||
|
||||
use Anomaly\SelectFieldType\SelectFieldType;
|
||||
use Visiosoft\ProfileModule\Education\Contract\EducationRepositoryInterface;
|
||||
|
||||
class EducationOptions
|
||||
{
|
||||
private $educationRepository;
|
||||
|
||||
public function __construct(EducationRepositoryInterface $repository)
|
||||
{
|
||||
$this->educationRepository = $repository;
|
||||
}
|
||||
|
||||
public function handle(SelectFieldType $fieldType)
|
||||
{
|
||||
$educations = $this->educationRepository->all();
|
||||
$options = $educations->pluck('name', 'id')->all();
|
||||
$fieldType->setOptions($options);
|
||||
}
|
||||
}
|
||||
@ -13,8 +13,13 @@ class ProfileFormBuilder extends FormBuilder
|
||||
'office_phone',
|
||||
'land_phone',
|
||||
'identification_number',
|
||||
'education',
|
||||
'state_of_education',
|
||||
'education' => [
|
||||
'type' => 'anomaly.field_type.select',
|
||||
'config' => [
|
||||
'handler' => 'Visiosoft\ProfileModule\OptionHandler\EducationOptions@handle',
|
||||
]
|
||||
],
|
||||
'education_part' => 'anomaly.field_type.select',
|
||||
'profession',
|
||||
'birthday',
|
||||
'register_type',
|
||||
|
||||
@ -30,6 +30,21 @@ class ProfileModule extends Module
|
||||
'new_adress',
|
||||
],
|
||||
],
|
||||
'education' => [
|
||||
'buttons' => [
|
||||
'new_education',
|
||||
]
|
||||
],
|
||||
'education_part' => [
|
||||
'buttons' => [
|
||||
'new_education',
|
||||
]
|
||||
],
|
||||
'education_part_option' => [
|
||||
'buttons' => [
|
||||
'new_education',
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
use Anomaly\Streams\Platform\Addon\AddonCollection;
|
||||
use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
|
||||
use Anomaly\Streams\Platform\Model\Profile\ProfileEducationEntryModel;
|
||||
use Maatwebsite\Excel\ExcelServiceProvider;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
|
||||
@ -10,6 +11,9 @@ use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
|
||||
use Visiosoft\ProfileModule\Adress\AdressModel;
|
||||
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
|
||||
use Visiosoft\ProfileModule\Adress\FormCompany\AddressCompanyFormBuilder;
|
||||
use Visiosoft\ProfileModule\Education\Contract\EducationRepositoryInterface;
|
||||
use Visiosoft\ProfileModule\Education\EducationModel;
|
||||
use Visiosoft\ProfileModule\Education\EducationRepository;
|
||||
use Visiosoft\ProfileModule\Http\Middleware\authCheck;
|
||||
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
|
||||
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
|
||||
@ -139,6 +143,8 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
||||
|
||||
// CacheController
|
||||
'ajax/get-user-info' => 'Visiosoft\ProfileModule\Http\Controller\CacheController@getUserInfo',
|
||||
'ajax/setEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@setEducation',
|
||||
'ajax/getEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@getEducation',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -201,6 +207,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
||||
'address' => AdressFormBuilder::class,
|
||||
'addressCompany' => AddressCompanyFormBuilder::class,
|
||||
ProfileAdressEntryModel::class => AdressModel::class,
|
||||
ProfileEducationEntryModel::class => EducationModel::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@ -210,6 +217,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
||||
*/
|
||||
protected $singletons = [
|
||||
AdressRepositoryInterface::class => AdressRepository::class,
|
||||
EducationRepositoryInterface::class => EducationRepository::class,
|
||||
'register2' => Register2FormBuilder::class,
|
||||
'sites' => SitesFormBuilder::class,
|
||||
'forgot_pass' => ForgotPassFormBuilder::class,
|
||||
|
||||
@ -123,21 +123,6 @@ class UsersFieldsSeeder extends Seeder
|
||||
"mode" => "date",
|
||||
"picker" => true,
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => trans('visiosoft.module.profile::field.education.name'),
|
||||
'slug' => 'education',
|
||||
'type' => 'anomaly.field_type.text',
|
||||
],
|
||||
[
|
||||
'name' => trans('visiosoft.module.profile::field.state_of_education.name'),
|
||||
'slug' => 'state_of_education',
|
||||
'type' => 'anomaly.field_type.text',
|
||||
],
|
||||
[
|
||||
'name' => trans('visiosoft.module.profile::field.profession.name'),
|
||||
'slug' => 'profession',
|
||||
'type' => 'anomaly.field_type.text',
|
||||
],
|
||||
[
|
||||
'name' => trans('visiosoft.module.profile::field.facebook_address.name'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user