mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
Merge pull request #863 from openclassify/muammertop
profile education form edit
This commit is contained in:
commit
73f25cf317
@ -0,0 +1,8 @@
|
|||||||
|
$("input[data-type='currency']").on('blur', function() {
|
||||||
|
const value = this.value.replace(/,/g, '');
|
||||||
|
this.value = parseFloat(value).toLocaleString('en-US', {
|
||||||
|
style: 'decimal',
|
||||||
|
maximumFractionDigits: 2,
|
||||||
|
minimumFractionDigits: 2
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -19,12 +19,14 @@
|
|||||||
<input type="number" class="price-input form-control w-100"
|
<input type="number" class="price-input form-control w-100"
|
||||||
value="{{ app.request.get('min_price') }}"
|
value="{{ app.request.get('min_price') }}"
|
||||||
name="min_price" min="0"
|
name="min_price" min="0"
|
||||||
|
data-type="currency"
|
||||||
placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}">
|
placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 p-1 pr-0 m-0">
|
<div class="col-md-4 p-1 pr-0 m-0">
|
||||||
<input class="price-input form-control w-100" type="number"
|
<input class="price-input form-control w-100" type="number"
|
||||||
value="{{ app.request.get('max_price') }}"
|
value="{{ app.request.get('max_price') }}"
|
||||||
name="max_price"
|
name="max_price"
|
||||||
|
data-type="currency"
|
||||||
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}">
|
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -41,4 +43,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{ asset_script('visiosoft.module.advs::js/currency_format.js') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -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,31 @@
|
|||||||
|
$(() => {
|
||||||
|
$.ajax({
|
||||||
|
url: '/api/getEducation',
|
||||||
|
success: ((res)=>{
|
||||||
|
$.each(res['education-part'], function (key, value) {
|
||||||
|
var selected = ""
|
||||||
|
if (res.user.education_part == value.id){ selected = 'selected'; }
|
||||||
|
$('#education_part').append('<option '+ selected +' value="'+ value.id +'">' + value.name + '</option>')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#education').on('change', () => {
|
||||||
|
$.ajax({
|
||||||
|
url: '/api/changeEducation',
|
||||||
|
data: {
|
||||||
|
info: 'education',
|
||||||
|
education: $('#education').val()
|
||||||
|
},beforeSend: function (){
|
||||||
|
$('#education_part').html('');
|
||||||
|
},success: function (response) {
|
||||||
|
$('#education_part').html('<option value="">'+ choose_an_option +'</option>')
|
||||||
|
$.each(response.data, function (key, value) {
|
||||||
|
$('#education_part').append(
|
||||||
|
'<option value="'+ value.id +'">'+ value.name +'</option>'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
@ -6,4 +6,14 @@ return [
|
|||||||
'write',
|
'write',
|
||||||
'delete',
|
'delete',
|
||||||
],
|
],
|
||||||
|
'education' => [
|
||||||
|
'read',
|
||||||
|
'write',
|
||||||
|
'delete',
|
||||||
|
],
|
||||||
|
'education_part' => [
|
||||||
|
'read',
|
||||||
|
'write',
|
||||||
|
'delete',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -15,4 +15,6 @@ return [
|
|||||||
'personal' => 'Personal',
|
'personal' => 'Personal',
|
||||||
'corporate' => 'Corporate',
|
'corporate' => 'Corporate',
|
||||||
'export' => 'Export',
|
'export' => 'Export',
|
||||||
|
'new_education' => 'New Education',
|
||||||
|
'new_education_part' => 'New Education part',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -121,6 +121,9 @@ return [
|
|||||||
'user' => [
|
'user' => [
|
||||||
'name' => 'User'
|
'name' => 'User'
|
||||||
],
|
],
|
||||||
|
'name' => [
|
||||||
|
'name' => 'Name'
|
||||||
|
],
|
||||||
|
|
||||||
/*Menu Button*/
|
/*Menu Button*/
|
||||||
'profile' => [
|
'profile' => [
|
||||||
@ -476,4 +479,8 @@ return [
|
|||||||
'personal' => [
|
'personal' => [
|
||||||
'name' => 'Personal'
|
'name' => 'Personal'
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'education_part' => [
|
||||||
|
'name' => 'State of Education'
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -17,4 +17,20 @@ return [
|
|||||||
'delete' => 'Can delete adress?',
|
'delete' => 'Can delete adress?',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'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?',
|
||||||
|
],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -9,4 +9,10 @@ return [
|
|||||||
],
|
],
|
||||||
'general_setting' => 'General Settings',
|
'general_setting' => 'General Settings',
|
||||||
'recaptcha' => 'reCAPTCHA',
|
'recaptcha' => 'reCAPTCHA',
|
||||||
|
'education' => [
|
||||||
|
'title' => 'Education',
|
||||||
|
],
|
||||||
|
'education_part' => [
|
||||||
|
'title' => 'Education part',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -7,4 +7,10 @@ return [
|
|||||||
'adress' => [
|
'adress' => [
|
||||||
'name' => 'Address',
|
'name' => 'Address',
|
||||||
],
|
],
|
||||||
|
'education' => [
|
||||||
|
'name' => 'Education',
|
||||||
|
],
|
||||||
|
'education_part' => [
|
||||||
|
'name' => 'Education part',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -171,40 +171,15 @@
|
|||||||
<label class="control-label font-weight-bold">
|
<label class="control-label font-weight-bold">
|
||||||
{{ trans("visiosoft.module.profile::field.education.name") }}
|
{{ trans("visiosoft.module.profile::field.education.name") }}
|
||||||
</label>
|
</label>
|
||||||
{{ profileForm.fields.education.value.input|raw }}
|
{{ profileForm.fields.education.setPlaceholder(trans('visiosoft.module.profile::field.choose_an_option')).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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12">
|
<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">
|
<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>
|
</label>
|
||||||
<select name="state_of_education" class="custom-select form-control"
|
{{ profileForm.fields.education_part.setPlaceholder(trans('visiosoft.module.profile::field.choose_an_option')).input|raw }}
|
||||||
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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@ -246,6 +221,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ profileForm.close()|raw }}
|
{{ profileForm.close()|raw }}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="tab-pane fade" id="nav-password" role="tabpanel" aria-labelledby="nav-password-tab">
|
<div class="tab-pane fade" id="nav-password" role="tabpanel" aria-labelledby="nav-password-tab">
|
||||||
{% set passwordForm = form('updatePassword').get() %}
|
{% set passwordForm = form('updatePassword').get() %}
|
||||||
|
|
||||||
@ -280,8 +256,12 @@
|
|||||||
<!-- User Profile Form Section-->
|
<!-- User Profile Form Section-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
var choose_an_option = "{{ trans('visiosoft.module.profile::field.choose_an_option') }}"
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endembed %}
|
{% endembed %}
|
||||||
|
|
||||||
|
{{ asset_script("visiosoft.module.profile::assets/js/education.js") }}
|
||||||
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/profile.js") }}
|
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/profile.js") }}
|
||||||
{% endblock %}
|
{% 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,15 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\Education\Form;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||||
|
|
||||||
|
class EducationFormBuilder extends FormBuilder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The form buttons.
|
||||||
|
*
|
||||||
|
* @var array|string
|
||||||
|
*/
|
||||||
|
protected $buttons = [
|
||||||
|
'cancel',
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\Education\Table;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
|
||||||
|
|
||||||
|
class EducationTableBuilder extends TableBuilder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The table buttons.
|
||||||
|
*
|
||||||
|
* @var array|string
|
||||||
|
*/
|
||||||
|
protected $buttons = [
|
||||||
|
'edit'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The table actions.
|
||||||
|
*
|
||||||
|
* @var array|string
|
||||||
|
*/
|
||||||
|
protected $actions = [
|
||||||
|
'delete'
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -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,15 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\EducationPart\Form;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||||
|
|
||||||
|
class EducationPartFormBuilder extends FormBuilder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The form buttons.
|
||||||
|
*
|
||||||
|
* @var array|string
|
||||||
|
*/
|
||||||
|
protected $buttons = [
|
||||||
|
'cancel',
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\EducationPart\Table;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
|
||||||
|
|
||||||
|
class EducationPartTableBuilder extends TableBuilder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The table buttons.
|
||||||
|
*
|
||||||
|
* @var array|string
|
||||||
|
*/
|
||||||
|
protected $buttons = [
|
||||||
|
'edit'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The table actions.
|
||||||
|
*
|
||||||
|
* @var array|string
|
||||||
|
*/
|
||||||
|
protected $actions = [
|
||||||
|
'delete'
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\Http\Controller\Admin;
|
||||||
|
|
||||||
|
use Visiosoft\ProfileModule\Education\Form\EducationFormBuilder;
|
||||||
|
use Visiosoft\ProfileModule\Education\Table\EducationTableBuilder;
|
||||||
|
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||||
|
|
||||||
|
class EducationController extends AdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display an index of existing entries.
|
||||||
|
*
|
||||||
|
* @param EducationTableBuilder $table
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function index(EducationTableBuilder $table)
|
||||||
|
{
|
||||||
|
return $table->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new entry.
|
||||||
|
*
|
||||||
|
* @param EducationFormBuilder $form
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function create(EducationFormBuilder $form)
|
||||||
|
{
|
||||||
|
return $form->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit an existing entry.
|
||||||
|
*
|
||||||
|
* @param EducationFormBuilder $form
|
||||||
|
* @param $id
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function edit(EducationFormBuilder $form, $id)
|
||||||
|
{
|
||||||
|
return $form->render($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\Http\Controller\Admin;
|
||||||
|
|
||||||
|
use Visiosoft\ProfileModule\EducationPart\Form\EducationPartFormBuilder;
|
||||||
|
use Visiosoft\ProfileModule\EducationPart\Table\EducationPartTableBuilder;
|
||||||
|
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||||
|
|
||||||
|
class EducationPartController extends AdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display an index of existing entries.
|
||||||
|
*
|
||||||
|
* @param EducationPartTableBuilder $table
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function index(EducationPartTableBuilder $table)
|
||||||
|
{
|
||||||
|
return $table->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new entry.
|
||||||
|
*
|
||||||
|
* @param EducationPartFormBuilder $form
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function create(EducationPartFormBuilder $form)
|
||||||
|
{
|
||||||
|
return $form->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit an existing entry.
|
||||||
|
*
|
||||||
|
* @param EducationPartFormBuilder $form
|
||||||
|
* @param $id
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function edit(EducationPartFormBuilder $form, $id)
|
||||||
|
{
|
||||||
|
return $form->render($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -24,6 +24,9 @@ use Visiosoft\PackagesModule\User\UserModel;
|
|||||||
use Visiosoft\ProfileModule\Adress\AdressModel;
|
use Visiosoft\ProfileModule\Adress\AdressModel;
|
||||||
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
|
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
|
||||||
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
|
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
|
||||||
|
use Visiosoft\ProfileModule\Education\EducationModel;
|
||||||
|
use Visiosoft\ProfileModule\EducationPart\EducationPartModel;
|
||||||
|
use Visiosoft\ProfileModule\EducationPartOption\EducationPartOptionModel;
|
||||||
use Visiosoft\ProfileModule\Profile\Form\ProfileFormBuilder;
|
use Visiosoft\ProfileModule\Profile\Form\ProfileFormBuilder;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
|
|
||||||
@ -246,4 +249,19 @@ class MyProfileController extends PublicController
|
|||||||
return response()->json(['status' => 'success', 'data' => $profile]);
|
return response()->json(['status' => 'success', 'data' => $profile]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getEducation(Request $request)
|
||||||
|
{
|
||||||
|
$user = $this->userRepository->find(auth()->id());
|
||||||
|
$education = EducationModel::all();
|
||||||
|
$educationPart = EducationPartModel::query()->where('education_id', $user->education)->get();
|
||||||
|
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function changeEducation(Request $request)
|
||||||
|
{
|
||||||
|
if ($request->info == 'education') {
|
||||||
|
$education = EducationPartModel::query()->where('education_id', $request->education)->get();
|
||||||
|
}
|
||||||
|
return response()->json(['data' => $education], 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',
|
'office_phone',
|
||||||
'land_phone',
|
'land_phone',
|
||||||
'identification_number',
|
'identification_number',
|
||||||
'education',
|
'education' => [
|
||||||
'state_of_education',
|
'type' => 'anomaly.field_type.select',
|
||||||
|
'config' => [
|
||||||
|
'handler' => 'Visiosoft\ProfileModule\OptionHandler\EducationOptions@handle',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'education_part' => 'anomaly.field_type.select',
|
||||||
'profession',
|
'profession',
|
||||||
'birthday',
|
'birthday',
|
||||||
'register_type',
|
'register_type',
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class ProfileFormHandler
|
|||||||
if (setting_value('visiosoft.module.profile::show_education_profession')) {
|
if (setting_value('visiosoft.module.profile::show_education_profession')) {
|
||||||
$parameters = array_merge($parameters, [
|
$parameters = array_merge($parameters, [
|
||||||
'education' => $builder->getPostValue('education'),
|
'education' => $builder->getPostValue('education'),
|
||||||
'state_of_education' => $builder->getPostValue('state_of_education'),
|
'education_part' => $builder->getPostValue('education_part'),
|
||||||
'profession' => $builder->getPostValue('profession'),
|
'profession' => $builder->getPostValue('profession'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,16 @@ class ProfileModule extends Module
|
|||||||
'new_adress',
|
'new_adress',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'education' => [
|
||||||
|
'buttons' => [
|
||||||
|
'new_education',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'education_part' => [
|
||||||
|
'buttons' => [
|
||||||
|
'new_education_part',
|
||||||
|
]
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use Anomaly\Streams\Platform\Addon\AddonCollection;
|
use Anomaly\Streams\Platform\Addon\AddonCollection;
|
||||||
use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
|
use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
|
||||||
|
use Anomaly\Streams\Platform\Model\Profile\ProfileEducationEntryModel;
|
||||||
use Maatwebsite\Excel\ExcelServiceProvider;
|
use Maatwebsite\Excel\ExcelServiceProvider;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
|
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\AdressModel;
|
||||||
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
|
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
|
||||||
use Visiosoft\ProfileModule\Adress\FormCompany\AddressCompanyFormBuilder;
|
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\Http\Middleware\authCheck;
|
||||||
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
|
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
|
||||||
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
|
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
|
||||||
@ -101,6 +105,8 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
|||||||
],
|
],
|
||||||
'profile/notification' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification',
|
'profile/notification' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification',
|
||||||
'ajax/update-user-info' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@updateAjaxProfile',
|
'ajax/update-user-info' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@updateAjaxProfile',
|
||||||
|
'api/changeEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@changeEducation',
|
||||||
|
'api/getEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@getEducation',
|
||||||
|
|
||||||
// UserAuthenticator
|
// UserAuthenticator
|
||||||
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',
|
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',
|
||||||
@ -201,6 +207,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
|||||||
'address' => AdressFormBuilder::class,
|
'address' => AdressFormBuilder::class,
|
||||||
'addressCompany' => AddressCompanyFormBuilder::class,
|
'addressCompany' => AddressCompanyFormBuilder::class,
|
||||||
ProfileAdressEntryModel::class => AdressModel::class,
|
ProfileAdressEntryModel::class => AdressModel::class,
|
||||||
|
ProfileEducationEntryModel::class => EducationModel::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -210,6 +217,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
|||||||
*/
|
*/
|
||||||
protected $singletons = [
|
protected $singletons = [
|
||||||
AdressRepositoryInterface::class => AdressRepository::class,
|
AdressRepositoryInterface::class => AdressRepository::class,
|
||||||
|
EducationRepositoryInterface::class => EducationRepository::class,
|
||||||
'register2' => Register2FormBuilder::class,
|
'register2' => Register2FormBuilder::class,
|
||||||
'sites' => SitesFormBuilder::class,
|
'sites' => SitesFormBuilder::class,
|
||||||
'forgot_pass' => ForgotPassFormBuilder::class,
|
'forgot_pass' => ForgotPassFormBuilder::class,
|
||||||
|
|||||||
@ -124,21 +124,26 @@ class UsersFieldsSeeder extends Seeder
|
|||||||
"picker" => true,
|
"picker" => true,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => trans('visiosoft.module.profile::field.education.name'),
|
'name' => trans('visiosoft.module.profile::field.education.name'),
|
||||||
'slug' => 'education',
|
'slug' => 'education',
|
||||||
'type' => 'anomaly.field_type.text',
|
'type' => 'anomaly.field_type.text',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => trans('visiosoft.module.profile::field.state_of_education.name'),
|
'name' => trans('visiosoft.module.profile::field.state_of_education.name'),
|
||||||
'slug' => 'state_of_education',
|
'slug' => 'state_of_education',
|
||||||
'type' => 'anomaly.field_type.text',
|
'type' => 'anomaly.field_type.text',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => trans('visiosoft.module.profile::field.profession.name'),
|
'name' => trans('visiosoft.module.profile::field.profession.name'),
|
||||||
'slug' => 'profession',
|
'slug' => 'profession',
|
||||||
'type' => 'anomaly.field_type.text',
|
'type' => 'anomaly.field_type.select',
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'name' => trans('visiosoft.module.profile::field.education_part.name'),
|
||||||
|
'slug' => 'education_part',
|
||||||
|
'type' => 'anomaly.field_type.select',
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'name' => trans('visiosoft.module.profile::field.facebook_address.name'),
|
'name' => trans('visiosoft.module.profile::field.facebook_address.name'),
|
||||||
'slug' => 'facebook_address',
|
'slug' => 'facebook_address',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user