Merge pull request #603 from openclassify/vedat

fix add remove error
This commit is contained in:
Ozcan Durak 2020-07-01 01:11:20 +03:00 committed by GitHub
commit cd2ef906ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 502 additions and 264 deletions

View File

@ -22,4 +22,5 @@ return [
'currency_converted' => 'Currency Converted Successfully.',
'choose_user' => 'Choose a user',
'owner_updated_successfully' => 'The Owner Has Been Updated Successfully!',
'no_add_found' => 'No Ad Found!',
];

View File

@ -340,12 +340,6 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
$adv->update(['cover_photo' => $coverPhoto]);
}
public function delete_empty_advs()
{
AdvsAdvsEntryModel::query()->where('slug', "")->forceDelete();
DB::table('advs_advs_translations')->where('name', NULL)->delete();
}
public function getRecommendedAds($id)
{
return AdvModel::query()
@ -364,7 +358,9 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
public function getAdvArray($id)
{
return AdvsAdvsEntryModel::query()->where('advs_advs.id', $id)->first()->toArray();
$ad = AdvsAdvsEntryModel::query()->where('advs_advs.id', $id)->first();
return ($ad !== null) ? $ad->toArray() : null;
}
public function getQuantity($quantity, $type, $item)

View File

@ -20,8 +20,6 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface
public function cover_image_update($adv);
public function delete_empty_advs();
public function getRecommendedAds($id);
public function getLastAd($id);

View File

@ -567,11 +567,10 @@ class AdvsController extends PublicController
$adv = AdvsAdvsEntryModel::find($request->update_id);
if ($advModel->is_enabled('packages') and $adv->slug == "") {
$cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request);
if(!is_null($cat))
{
return redirect('/');
}
$cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request);
if (!is_null($cat)) {
return redirect('/');
}
}
// Create options
@ -695,6 +694,11 @@ class AdvsController extends PublicController
$isActive = new AdvModel();
$adv = $advRepository->getAdvArray($id);
if (is_null($adv)) {
$this->messages->error(trans('visiosoft.module.advs::message.no_add_found'));
return $this->redirect->to(route('advs::create_adv'));
}
if ($adv['created_by_id'] != auth()->id()
&& !auth()->user()->hasPermission('visiosoft.module.advs::advs.write')) {
abort(403);

View File

@ -139,7 +139,15 @@ class VisiosoftModuleProfileCreateProfileFields extends Migration
'mode' => 'select',
]
],
'deleted_at' => 'anomaly.field_type.datetime'
'company' => 'anomaly.field_type.text',
'tax_number' => 'anomaly.field_type.text',
'tax_office' => 'anomaly.field_type.text',
'is_company' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
],
],
];
}

View File

@ -12,11 +12,11 @@ class VisiosoftModuleProfileCreateAdressStream extends Migration
*/
protected $stream = [
'slug' => 'adress',
'title_column' => 'id',
'translatable' => false,
'trashable' => false,
'searchable' => false,
'sortable' => false,
'title_column' => 'id',
'translatable' => false,
'trashable' => true,
'searchable' => false,
'sortable' => false,
];
/**
@ -41,16 +41,17 @@ class VisiosoftModuleProfileCreateAdressStream extends Migration
'city' => [
'required' => true,
],
'district' => [
'required' => true,
],
'district',
'adress_content' => [
'required' => true,
],
'adress_gsm_phone' => [
'required' => true,
],
'deleted_at'
'company',
'tax_number',
'tax_office',
'is_company',
];
}

View File

@ -1 +0,0 @@
phoneMask("input[name='adress_gsm_phone']")

View File

@ -0,0 +1,51 @@
$(document).on('change', 'select[name="country"]', function () {
Locations($(this).val(), 1, "city");
});
$(document).on('change', 'select[name="city"]', function () {
Locations($(this).val(), 2, "district")
});
function Locations(cat, level, name) {
$.ajax({
type: "GET",
async: false,
data: "cat=" + cat + "&level=" + level,
url: "/class/ajax",
success: function (msg) {
$('select[name="' + name + '"]').find('option').remove();
$('select[name="' + name + '"]').append('<option>...</option>');
$.each(msg, function (key, value) {
$('select[name="' + name + '"]').append('<option value="' + value.id + '">' + value.name + '</option>');
});
}
});
}
if (country != "") {
//For Request
Locations(country, 1, "city");
if (city != "") {
$('select[name="city"]').val(city);
Locations(city, 2, "district");
if (district != "") {
$('select[name="district"]').val(district);
}
}
} else {
//Set Default
$('select[name="country"]').val(default_country);
Locations(default_country, 1, "city");
if (default_city != "") {
$('select[name="city"]').val(default_city);
Locations(default_city, 2, "district");
if (default_district != "") {
$('select[name="district"]').val(default_district);
}
}
}
phoneMask("input[name='adress_gsm_phone']");

View File

@ -8,7 +8,7 @@ return [
'general_setting' => [
'title' => 'visiosoft.module.profile::section.general_setting',
'fields' => [
'show_my_ads', 'upload_avatar'
'show_my_ads', 'upload_avatar', 'show_tax_office'
],
],
],

View File

@ -13,4 +13,11 @@ return [
'default_value' => 1
],
],
'show_tax_office' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
],
],
];

View File

@ -12,4 +12,6 @@ return [
'edit' => 'Edit',
'go_profile' => 'Go to Profile Detail',
'go_user' => 'Go to User Detail',
'personal' => 'Personal',
'corporate' => 'Corporate',
];

View File

@ -431,5 +431,15 @@ return [
'choose' => [
'name' => 'Choose'
],
'my_address' => 'My Address'
'my_address' => 'My Address',
'company' => [
'name' => 'Company Name'
],
'tax_office' => [
'name' => 'Tax Office'
],
'tax_number' => [
'name' => 'Tax Number'
],
];

View File

@ -7,4 +7,8 @@ return [
'upload_avatar' => [
'name' => 'Avatar Upload',
],
'show_tax_office' => [
'name' => 'Show Tax Office Field',
],
];

View File

@ -5,78 +5,99 @@
{% block detail %}
<div class="row px-3">
<div class="col-md-12 bg-dark text-white p-5">
<h3>{{ trans('visiosoft.module.profile::field.create_address.name') }}</h3>
<h3>
{% if request().segment(3) == "edit" %}
{{ trans('visiosoft.module.profile::field.edit_address.name') }}
{% else %}
{{ trans('visiosoft.module.profile::field.create_address.name') }}
{% endif %}
</h3>
</div>
<div class="col-md-12 bg-light profile-section">
{% set form = form('profile', 'adress').entry(adress.id).actions({'save':'save'}).get() %}
{{ form_open({
'class': 'form ' ~ form.options.class ,
'enctype': 'multipart/form-data',
'url': 'profile/adress/create'
})|raw }}
<div class="py-3 px-3 px-sm-0">
{% set form = form('address').entry(id).actions({'save':'save'}).get() %}
<div class="form-group">
<label class="control-label font-weight-bold">{{ form.fields.adress_name.label|raw }}</label>
{{ form.fields.adress_name.input|raw }}
</div>
<div class="form-group">
<label class="control-label font-weight-bold">{{ form.fields.adress_gsm_phone.label|raw }}</label>
{{ form.fields.adress_gsm_phone.input|raw }}
</div>
<div class="form-group">
<label class="control-label font-weight-bold">{{ form.fields.adress_first_name.label|raw }}</label>
{{ form.fields.adress_first_name.input|raw }}
</div>
<div class="form-group">
<label class="control-label font-weight-bold">{{ form.fields.adress_last_name.label|raw }}</label>
{{ form.fields.adress_last_name.input|raw }}
</div>
<div class="row form-group location-map">
<div class="col-sm-4">
<label class="control-label font-weight-bold">{{ form.fields.country.label|raw }}</label>
<div class="input-wrapper">
<select name="country" class="custom-select form-control"
data-content="{{ adress.country.id }}"
data-field_name="adress_country_id"
data-provides="anomaly.field_type.select">
{% for countryField in country %}
<option value="{{ countryField.id }}">{{ countryField.name }}</option>
{% endfor %}
</select>
{% set isCompany = form.entry.is_company %}
<div class="card-header tab-card-header">
<ul class="nav nav-tabs card-header-tabs" role="tablist">
<li class="nav-item {% if isCompany %}d-none{% endif %}">
<a class="nav-link active show" id="personal-tab" data-toggle="tab" href="#personal"
role="tab"
aria-controls="Personal" aria-selected="true">{{ trans('visiosoft.module.profile::button.personal') }}</a></li>
<li class="nav-item">
<a class="nav-link {% if isCompany %}active show{% endif %}" id="corporate-tab" data-toggle="tab" href="#corporate" role="tab"
aria-controls="Corporate" aria-selected="false">{{ trans('visiosoft.module.profile::button.corporate') }}</a>
</li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane fade show active p-3 {% if isCompany %}d-none{% endif %}" id="personal" role="tabpanel"
aria-labelledby="personal-tab">
{{ form_open({
'class': 'form ' ~ form.options.class ,
'enctype': 'multipart/form-data',
'url':form.options.url
})|raw }}
<div class="py-3 px-3 px-sm-0">
{% include "visiosoft.module.profile::address/partials/fields" %}
<div class="form-group">
{{ form.actions|raw }}
</div>
</div>
{{ form_close() }}
<div class="col-sm-4 location-field city-data"
data-content="{{ adress.city }}">
<label class="control-label font-weight-bold">{{ form.fields.city.label|raw }}</label>
{{ form.fields.city.input|raw }}
</div>
<div class="col-sm-4 location-field district-data"
data-content="{{ adress.district }}">
<label class="control-label font-weight-bold">{{ form.fields.district.label|raw }}</label>
{{ form.fields.district.input|raw }}
</div>
</div>
<div class="form-group location-map">
<div class="col-sm-12">
<div class="row form-group add-title">
<label class="control-label font-weight-bold">{{ form.fields.adress_content.label|raw }}</label>
{{ form.fields.adress_content.input|raw }}
<div class="tab-pane fade p-3 {% if isCompany %}active show{% endif %}" id="corporate" role="tabpanel" aria-labelledby="corporate-tab">
{% set form = form('addressCompany').entry(id).actions({'save':'save'}).get() %}
{{ form_open({
'class': 'form ' ~ form.options.class ,
'enctype': 'multipart/form-data',
'url':form.options.url
})|raw }}
<div class="py-3 px-3 px-sm-0">
<div class="form-group font-weight-bolder">
{{ form.fields.company|raw }}
</div>
{% if setting_value('visiosoft.module.profile::show_tax_office') %}
<div class="form-group font-weight-bolder">
{{ form.fields.tax_office|raw }}
</div>
{% endif %}
<div class="form-group font-weight-bolder">
{{ form.fields.tax_number|raw }}
</div>
{% include "visiosoft.module.profile::address/partials/fields" %}
<div class="form-group">
{{ form.actions|raw }}
</div>
</div>
{{ form_close() }}
</div>
<div class="form-group">
{{ form.actions|raw }}
</div>
</div>
</div>
</div>
<script>
//For Request
var country = "{% if request().segment(3) == "edit" %}{{ form.fields.country.value.id }}{% else %}{{ form.fields.country.value|raw }}{% endif %}";
var city = "{% if request().segment(3) == "edit" %}{{ form.fields.city.value }}{% else %}{{ form.fields.city.value|raw }}{% endif %}";
var district = "{% if request().segment(3) == "edit" %}{{ form.fields.district.value }}{% else %}{{ form.fields.district.value|raw }}{% endif %}";
//Default
var default_country = "{{ setting_value('visiosoft.module.location::default_country') }}";
var default_city = "{{ setting_value('visiosoft.module.location::default_city') }}";
var default_district = "{{ setting_value('visiosoft.module.location::default_district') }}";
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/country.js") }}
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/address.js") }}
</script>
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/create.js") }}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -1,82 +0,0 @@
{% extends "theme::layouts/default" %}
{% block content %}
{% embed 'visiosoft.module.profile::profile/index' %}
{% block detail %}
<div class="row px-3">
<div class="col-md-12 bg-dark text-white p-5">
<h3>{{ trans('visiosoft.module.profile::field.edit_address.name') }}</h3>
</div>
<div class="col-md-12 bg-light profile-section">
{% set form = form('profile', 'adress').entry(adress.id).actions({'update':'update'}).get() %}
{{ form_open({
'class': 'form ' ~ form.options.class ,
'enctype': 'multipart/form-data',
'url': 'profile/adress/update/'~ adress.id
})|raw }}
<div class="py-3 px-3 px-sm-0">
<div class="form-group">
<label class="control-label font-weight-bold">{{ form.fields.adress_name.label|raw }}</label>
{{ form.fields.adress_name.input|raw }}
</div>
<div class="form-group">
<label class="control-label font-weight-bold">{{ form.fields.adress_gsm_phone.label|raw }}</label>
{{ form.fields.adress_gsm_phone.input|raw }}
</div>
<div class="form-group">
<label class="control-label font-weight-bold">{{ form.fields.adress_first_name.label|raw }}</label>
{{ form.fields.adress_first_name.input|raw }}
</div>
<div class="form-group">
<label class="control-label font-weight-bold">{{ form.fields.adress_last_name.label|raw }}</label>
{{ form.fields.adress_last_name.input|raw }}
</div>
<div class="row form-group location-map">
<div class="col-sm-4">
<label class="control-label font-weight-bold">{{ form.fields.country.label|raw }}</label>
<div class="input-wrapper">
<select name="country" class="custom-select form-control"
data-content="{{ adress.country.id }}"
data-field_name="adress_country_id"
data-provides="anomaly.field_type.select">
{% for countryField in country %}
<option value="{{ countryField.id }}">{{ countryField.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="col-sm-4 location-field city-data"
data-content="{{ adress.city }}">
<label class="control-label font-weight-bold">{{ form.fields.city.label|raw }}</label>
{{ form.fields.city.input|raw }}
</div>
<div class="col-sm-4 location-field district-data"
data-content="{{ adress.district }}">
<label class="control-label font-weight-bold">{{ form.fields.district.label|raw }}</label>
{{ form.fields.district.input|raw }}
</div>
</div>
<div class="form-group location-map">
<div class="col-sm-12">
<div class="row form-group add-title">
<label class="control-label font-weight-bold">{{ form.fields.adress_content.label|raw }}</label>
{{ adress.adress_content.input|raw }}
</div>
</div>
</div>
<div class="form-group">
{{ form.actions|raw }}
</div>
</div>
</div>
</div>
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/country.js") }}
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/address.js") }}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -0,0 +1,36 @@
<div class="form-group font-weight-bolder">
{{ form.fields.adress_name|raw }}
</div>
<div class="form-group font-weight-bolder">
{{ form.fields.adress_gsm_phone|raw }}
</div>
<div class="form-group font-weight-bold">
{{ form.fields.adress_first_name|raw }}
</div>
<div class="form-group font-weight-bold">
{{ form.fields.adress_last_name|raw }}
</div>
<div class="row form-group location-map">
<div class="col-sm-4 font-weight-bold">
{{ form.fields.country|raw }}
</div>
<div class="col-sm-4 location-field city-data font-weight-bold"
data-content="{{ adress.city }}">
{{ form.fields.city|raw }}
</div>
<div class="col-sm-4 location-field district-data font-weight-bold"
data-content="{{ adress.district }}">
{{ form.fields.district|raw }}
</div>
</div>
<div class="form-group location-map">
<div class="col-sm-12">
<div class="row form-group add-title">
<label class="control-label font-weight-bolder"
for="country">{{ form.fields.adress_content.label|raw }} <span
class="required">*</span></label>
{{ form.fields.adress_content.input|raw }}
</div>
</div>
</div>

View File

@ -5,14 +5,6 @@ use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class AdressFormBuilder extends FormBuilder
{
/**
* The form fields.
*
* @var array|string
*/
protected $fields = [
];
/**
* Additional validation rules.
*
@ -49,6 +41,8 @@ class AdressFormBuilder extends FormBuilder
* @var array
*/
protected $options = [
'redirect' => '/profile/address',
'success_message' => 'visiosoft.module.profile::message.adress_success_create',
];
/**

View File

@ -0,0 +1,36 @@
<?php namespace Visiosoft\ProfileModule\Adress\Form;
class AdressFormFields
{
public function handle(AdressFormBuilder $builder)
{
$builder->setFields(
[
'adress_name' => [
'required' => true,
],
'adress_gsm_phone' => [
'required' => true,
],
'adress_first_name' => [
'required' => true,
],
'adress_last_name' => [
'required' => true,
],
'country' => [
'required' => true,
],
'city' => [
'required' => true,
],
'district',
'adress_content' => [
'required' => true,
],
]
);
}
}

View File

@ -0,0 +1,30 @@
<?php namespace Visiosoft\ProfileModule\Adress\Form;
use Anomaly\UsersModule\User\Contract\UserInterface;
use Anomaly\UsersModule\User\Event\UserHasRegistered;
use Anomaly\UsersModule\User\Register\Command\HandleAutomaticRegistration;
use Anomaly\UsersModule\User\Register\Command\HandleEmailRegistration;
use Anomaly\UsersModule\User\Register\Command\HandleManualRegistration;
use Anomaly\UsersModule\User\UserActivator;
use Illuminate\Support\Facades\Auth;
class AdressFormHandler
{
public function handle(
AdressFormBuilder $builder)
{
if (!$builder->canSave()) {
return;
}
$builder->saveForm();
$entry = $builder->getFormEntry();
$entry->user_id = Auth::id();
$entry->save();
}
}

View File

@ -0,0 +1,65 @@
<?php namespace Visiosoft\ProfileModule\Adress\FormCompany;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Visiosoft\ProfileModule\Adress\AdressModel;
class AddressCompanyFormBuilder extends FormBuilder
{
/**
* Additional validation rules.
*
* @var array|string
*/
protected $model = AdressModel::class;
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 = [
'redirect' => '/profile/address',
'success_message' => 'visiosoft.module.profile::message.adress_success_create',
];
/**
* The form sections.
*
* @var array
*/
protected $sections = [];
/**
* The form assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -0,0 +1,48 @@
<?php namespace Visiosoft\ProfileModule\Adress\FormCompany;
class AddressCompanyFormFields
{
public function handle(AddressCompanyFormBuilder $builder)
{
$builder->setFields(
[
'company' => [
'required' => true,
],
'tax_number' => [
'required' => true,
],
'adress_name' => [
'required' => true,
],
'adress_gsm_phone' => [
'required' => true,
],
'adress_first_name' => [
'required' => true,
],
'adress_last_name' => [
'required' => true,
],
'country' => [
'required' => true,
],
'city' => [
'required' => true,
],
'district',
'adress_content' => [
'required' => true,
],
]
);
if (setting_value('visiosoft.module.profile::show_tax_office')) {
$builder->addField('tax_office', [
'required' => true,
]);
}
}
}

View File

@ -0,0 +1,25 @@
<?php namespace Visiosoft\ProfileModule\Adress\FormCompany;
use Illuminate\Support\Facades\Auth;
class AddressCompanyFormHandler
{
public function handle(
AddressCompanyFormBuilder $builder)
{
if (!$builder->canSave()) {
return;
}
$builder->saveForm();
$entry = $builder->getFormEntry();
$entry->user_id = Auth::id();
$entry->is_company = true;
$entry->save();
}
}

View File

@ -0,0 +1,50 @@
<?php namespace Visiosoft\ProfileModule\Http\Controller;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Visiosoft\LocationModule\City\Contract\CityRepositoryInterface;
use Visiosoft\ProfileModule\Adress\AdressModel;
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
use Visiosoft\ProfileModule\Adress\Table\AdressTableBuilder;
use Anomaly\Streams\Platform\Http\Controller\AdminController;
class AddressController extends AdminController
{
private $address;
public function __construct(AdressModel $address)
{
$this->address = $address;
parent::__construct();
}
public function index(AdressTableBuilder $table)
{
$address = $this->address->getUserAdress();
return $this->view->make('visiosoft.module.profile::address/list', compact('address'));
}
public function create()
{
return $this->view->make('visiosoft.module.profile::address/create');
}
public function edit($id)
{
return $this->view->make('visiosoft.module.profile::address/create', compact('id'));
}
public function delete($id)
{
$address = $this->address->newQuery()->find($id);
if ($address->user_id == Auth::id()) {
$address->delete();
}
return $this->redirect->back();
}
}

View File

@ -50,9 +50,6 @@ class MyProfileController extends PublicController
public function home(ProfileFormBuilder $form, AdvRepositoryInterface $advRepository)
{
//clear empty ads
$advRepository->delete_empty_advs();
$advs_count = new AdvModel();
$advs_count = count($advs_count->myAdvsByUser()->get());
@ -135,71 +132,6 @@ class MyProfileController extends PublicController
}
public function adressEdit($id)
{
$adressModel = new AdressModel();
$adress = $adressModel->getAdressFirst($id);
if ($adress->getAttribute('user_id') == Auth::id()) {
$country = CountryModel::all();
return $this->view->make('visiosoft.module.profile::address/edit', compact('adress', 'country'));
}
}
public function adressSoftDelete($id)
{
$address = $this->adressRepository->find($id);
if ($address->user_id == Auth::id()) {
$address->update([
'deleted_at' => date('Y-m-d H:i:s')
]);
}
return $this->redirect->back();
}
public function adressUpdate(AdressFormBuilder $form, Request $request, $id)
{
$error = $form->build()->validate()->getFormErrors()->getMessages();
if (!empty($error)) {
return $this->redirect->back();
}
$adressModel = new AdressModel();
$adress = $adressModel->getAdressFirst($id);
if ($adress->getAttribute('user_id') == Auth::id()) {
$New_value = $request->all();
$New_value['country_id'] = $New_value['country'];
unset($New_value['_token'], $New_value['action'], $New_value['country']);
$adressModel->getAdress($id)->update($New_value);
$message = [];
$message[] = trans('visiosoft.module.profile::message.adress_success_update');
return redirect(route('profile::address'))->with('success', $message);
}
}
public function adressCreate(AdressFormBuilder $form, Request $request)
{
if (isset($request->request->all()['action']) == "save") {
$error = $form->build()->validate()->getFormErrors()->getMessages();
if (!empty($error)) {
return $this->redirect->back();
}
$new_adress = $request->request->all();
unset($new_adress['action'], $new_adress['_to*ken']);
$new_adress['user_id'] = Auth::id();
$adressModel = new AdressModel();
$adressModel->getAdress()->create($new_adress);
$message = [];
$message[] = trans('visiosoft.module.profile::message.adress_success_create');
return redirect(route('profile::address'))->with('success', $message);
}
$country = CountryModel::all();
return $this->view->make('visiosoft.module.profile::address/create', compact('country'));
}
public function adressAjaxCreate(AdressFormBuilder $form, Request $request)
{
@ -277,13 +209,6 @@ class MyProfileController extends PublicController
}
}
public function Address()
{
$address = new AdressModel();
$address = $address->getUserAdress();
return $this->view->make('visiosoft.module.profile::address/list', compact('address'));
}
public function disableAccount()
{

View File

@ -5,6 +5,8 @@ use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
use Visiosoft\ProfileModule\Adress\AdressRepository;
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\Http\Middleware\authCheck;
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
@ -67,14 +69,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
'admin/profile/editAdress/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@edit',
'admin/profile/update/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@adressupdate',
'profile/adress/update/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressUpdate',
'profile/address' => [
'as' => 'profile::address',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@Address',
],
'profile/adress/create' => [
'as' => 'visiosoft.module.profile::adress_create',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressCreate'
],
'profile/adress/ajaxCreate' => [
'as' => 'visiosoft.module.profile::adress_ajax_create',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressAjaxCreate'
@ -87,14 +82,6 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
'as' => 'visiosoft.module.profile::adress_ajax_detail',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressAjaxDetail'
],
'profile/adress/edit/{id}' => [
'as' => 'visiosoft.module.profile::address_edit',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressEdit'
],
'profile/adress/soft-del/{id}' => [
'as' => 'visiosoft.module.profile::address_soft_delete',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressSoftDelete'
],
/* Profile */
'profile/edit' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@edit',
@ -128,6 +115,26 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
'ajax/update-user-info' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@updateAjaxProfile',
//Address
'profile/address' => [
'as' => 'profile::address',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\AddressController@index',
],
'profile/adress/create' => [
'as' => 'visiosoft.module.profile::adress_create',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\AddressController@create'
],
'profile/adress/edit/{id}' => [
'as' => 'visiosoft.module.profile::address_edit',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\AddressController@edit'
],
'profile/adress/delete/{id}' => [
'as' => 'visiosoft.module.profile::address_soft_delete',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\AddressController@delete'
],
// Cache links
'ajax/get-user-info' => 'Visiosoft\ProfileModule\Http\Controller\CacheController@getUserInfo',
];
@ -189,6 +196,8 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
'userProfile' => UserFormBuilder::class,
'profile' => ProfileFormBuilder::class,
'signIn' => SignInFormBuilder::class,
'address' => AdressFormBuilder::class,
'addressCompany' => AddressCompanyFormBuilder::class,
ProfileAdressEntryModel::class => AdressModel::class,
];