diff --git a/addons/default/visiosoft/base-theme/resources/css/default/main.css b/addons/default/visiosoft/base-theme/resources/css/default/main.css
index c9e17df59..c22e29376 100755
--- a/addons/default/visiosoft/base-theme/resources/css/default/main.css
+++ b/addons/default/visiosoft/base-theme/resources/css/default/main.css
@@ -478,7 +478,6 @@ textarea {
.offered-field {
border-top: 1px solid #d5d5d5;
- border-bottom: 1px solid #d5d5d5;
}
.banner-section h1.title {
@@ -1610,10 +1609,6 @@ a.verified i {
width: 25px;
}
-.offered-field {
- margin-top: 15px;
-}
-
.offered-row {
padding-left: 0px;
}
diff --git a/addons/default/visiosoft/base-theme/resources/js/phoneCounter.js b/addons/default/visiosoft/base-theme/resources/js/phoneCounter.js
deleted file mode 100644
index a5967dab9..000000000
--- a/addons/default/visiosoft/base-theme/resources/js/phoneCounter.js
+++ /dev/null
@@ -1,37 +0,0 @@
-function sendCount() {
- var id = $('.show-number').attr('data-id');
- if (id != "") {
- $.ajax({
- type: 'POST',
- url: '/ajax/countPhone',
- data: 'id=' + id,
- success: function (data) {
- hideLoader()
- $('.show-number').removeAttr('data-function');
- },
- beforeSend: function () {
- showLoader()
- }
- });
- }
-
-}
-
-// -------------------------------------------------------------
-// Show Mobile Number
-// -------------------------------------------------------------
-
-(function () {
- $('.show-number').on('click', function () {
- this.addEventListener('click', sendCount());
- $('.hide-text').fadeIn(500, function () {
- $(this).addClass('hide');
- });
- $('.hide-number').fadeIn(500, function () {
- $(this).addClass('show');
- });
- });
-}());
-
-
-// script end
\ No newline at end of file
diff --git a/addons/default/visiosoft/base-theme/resources/js/quantity.js b/addons/default/visiosoft/base-theme/resources/js/quantity.js
deleted file mode 100644
index ad46f4682..000000000
--- a/addons/default/visiosoft/base-theme/resources/js/quantity.js
+++ /dev/null
@@ -1,90 +0,0 @@
-function getInput(field) {
- var row = field.parent().parent();
- return $(row).find('.add-cart-quantity-input');
-}
-
-//plus
-$('.add-cart-upgrade button').on('click', function () {
- var input = getInput($(this));
- updatePrice(input, 'plus')
-})
-
-//minus
-$('.add-cart-reduce button').on('click', function () {
- var input = getInput($(this));
- updatePrice(input, 'minus')
-})
-
-//change
-$('.add-cart-quantity-input').on('change', function () {
- var input = getInput($(this));
- updatePrice(input, 'change')
-})
-
-function updatePrice(input, type) {
- var ad_id = $(input).attr('data-id');
- var current_quantity = $(input).val();
-
- productDetail(ad_id, current_quantity, type, function (data) {
- ChangeFieldForResponse(type, data.newPrice, data.newQuantity, data.maxQuantity)
- });
-
-}
-
-function productDetail(id, quantity, type, returnData) {
- if (quantity == 0) {
- quantity = 1;
- }
- $.ajax({
- type: 'POST',
- url: '/ajax/StockControl',
- data: 'id=' + id + '&quantity=' + quantity + '&type=' + type,
- success: function (data) {
- hideLoader()
- returnData(data);
- },
- beforeSend: function () {
- showLoader()
- }
- });
-}
-
-function ChangeFieldForResponse(type, price, quantity, maxQuantity) {
- if (parseInt(quantity) == 1) {
- $('.add-cart-reduce button').attr('disabled', true);
- } else {
- $('.add-cart-reduce button').attr('disabled', false);
- }
- if (quantity == maxQuantity) {
- $('.add-cart-upgrade button').attr('disabled', true);
- } else {
- $('.add-cart-upgrade button').attr('disabled', false);
- }
- $('.add-cart-quantity-input').val(parseInt(quantity));
- $('.ad-price b').html(parseInt(price))
-}
-
-$('.add-cart-button').on('click', function () {
- var quantity = $('.add-cart-quantity-input').val();
- var id = $('.add-cart-quantity-input').attr('data-id');
- return addCart(id, quantity)
-})
-
-function addCart(id, quantity) {
- $.ajax({
- type: 'POST',
- url: '/ajax/addCart',
- data: 'id=' + id + '&quantity=' + quantity,
- success: function (data) {
- if (data.status == "success") {
- var url = window.location.origin;
- window.location.reload();
- } else {
- alert(data.msg);
- }
- },
- beforeSend: function () {
- showLoader()
- }
- });
-}
\ No newline at end of file
diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/detail.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/detail.twig
index 95be6461a..b49657bc5 100644
--- a/addons/default/visiosoft/base-theme/resources/views/ad-detail/detail.twig
+++ b/addons/default/visiosoft/base-theme/resources/views/ad-detail/detail.twig
@@ -9,68 +9,54 @@
{% endblock %}
+
{% block content %}
- {{ asset_add("scripts.js", "theme::js.default.fotorama.min.js") }}
- {{ asset_add("theme.css", "theme::css.default.fotorama.min.css") }}
+
{% if entries('advs').isEnabled('comments') %}
{{ asset_add("styles.css", "visiosoft.module.comments::css/style.css") }}
{% endif %}
+
- {% else %}
- {% for image in adv.getViewPhotoUrl %}
- + + +
+ {% endif %} + + {% if profile.office_phone is not empty %} ++ + +
+ {% endif %} + + {% if profile.land_phone is not empty %} ++ + +
+ {% endif %} + + +{% endif %} \ No newline at end of file diff --git a/addons/default/visiosoft/profile-module/src/Profile/Command/FindUserProfile.php b/addons/default/visiosoft/profile-module/src/Profile/Command/FindUserProfile.php new file mode 100644 index 000000000..140dc0598 --- /dev/null +++ b/addons/default/visiosoft/profile-module/src/Profile/Command/FindUserProfile.php @@ -0,0 +1,33 @@ +id = $id; + } + + /** + * @param ProfileRepositoryInterface $profileRepository + * @return |null + */ + public function handle(ProfileRepositoryInterface $profileRepository) + { + if ($this->id) { + return $profileRepository->findByUserID($this->id); + } + return null; + } +} diff --git a/addons/default/visiosoft/profile-module/src/Profile/Contract/ProfileRepositoryInterface.php b/addons/default/visiosoft/profile-module/src/Profile/Contract/ProfileRepositoryInterface.php index 9938e4690..961e9e7ac 100644 --- a/addons/default/visiosoft/profile-module/src/Profile/Contract/ProfileRepositoryInterface.php +++ b/addons/default/visiosoft/profile-module/src/Profile/Contract/ProfileRepositoryInterface.php @@ -9,8 +9,12 @@ interface ProfileRepositoryInterface extends EntryRepositoryInterface public function getProfile($id); public function validPasswordByEmail($email); + public function validPasswordByUsername($username); public function updateUserField($fields); - public function changePassword($fields,$password); + + public function changePassword($fields, $password); + + public function findByUserID($id); } diff --git a/addons/default/visiosoft/profile-module/src/Profile/ProfileRepository.php b/addons/default/visiosoft/profile-module/src/Profile/ProfileRepository.php index c8a5422bd..2da0607d2 100644 --- a/addons/default/visiosoft/profile-module/src/Profile/ProfileRepository.php +++ b/addons/default/visiosoft/profile-module/src/Profile/ProfileRepository.php @@ -103,26 +103,31 @@ class ProfileRepository extends EntryRepository implements ProfileRepositoryInte public function changePassword($fields, $userPassword) { - if ($fields['new_password'] != $fields['re_new_password']) { - $errorList[] = trans('anomaly.module.users::field.confirm_password.name'); - $fields['error'] = $errorList; - return $fields; - } + if ($fields['new_password'] != $fields['re_new_password']) { + $errorList[] = trans('anomaly.module.users::field.confirm_password.name'); + $fields['error'] = $errorList; + return $fields; + } - $validator = $userPassword->validate($fields['new_password']); - $errorList = array(); - foreach ($validator->errors()->all() as $error) { - $errorList[] = $error; - } - if (count($errorList) != 0) { - $fields['error'] = $errorList; - return $fields; - } + $validator = $userPassword->validate($fields['new_password']); + $errorList = array(); + foreach ($validator->errors()->all() as $error) { + $errorList[] = $error; + } + if (count($errorList) != 0) { + $fields['error'] = $errorList; + return $fields; + } - UsersUsersEntryModel::query()->find(Auth::id())->update(['password' => Hash::make($fields['new_password'])]); - unset($fields['new_password'], $fields['re_new_password'], $fields['confirm_password_input']); + UsersUsersEntryModel::query()->find(Auth::id())->update(['password' => Hash::make($fields['new_password'])]); + unset($fields['new_password'], $fields['re_new_password'], $fields['confirm_password_input']); return $fields; } + public function findByUserID($id) + { + return $this->model->where('user_no_id', $id)->first(); + } + } diff --git a/addons/default/visiosoft/profile-module/src/ProfileModulePlugin.php b/addons/default/visiosoft/profile-module/src/ProfileModulePlugin.php new file mode 100644 index 000000000..749ee3007 --- /dev/null +++ b/addons/default/visiosoft/profile-module/src/ProfileModulePlugin.php @@ -0,0 +1,28 @@ +dispatch(new FindUserProfile($id))) { + return null; + } + + return $ad; + } + ) + ]; + } +} diff --git a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php index 0ac8c7d78..5da671856 100644 --- a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php +++ b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php @@ -22,7 +22,9 @@ class ProfileModuleServiceProvider extends AddonServiceProvider * * @type array|null */ - protected $plugins = []; + protected $plugins = [ + ProfileModulePlugin::class + ]; /** * The addon Artisan commands.