diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/message.php b/addons/default/visiosoft/advs-module/resources/lang/en/message.php
index 081e8c9a2..6457e99d1 100644
--- a/addons/default/visiosoft/advs-module/resources/lang/en/message.php
+++ b/addons/default/visiosoft/advs-module/resources/lang/en/message.php
@@ -22,4 +22,5 @@ return [
'cancelBtn' => "or Cancel",
'link' => "",
],
+ 'update_category_info' => 'Please update category.',
];
diff --git a/addons/default/visiosoft/advs-module/resources/lang/tr/message.php b/addons/default/visiosoft/advs-module/resources/lang/tr/message.php
index 091b44747..4c0e3feb9 100644
--- a/addons/default/visiosoft/advs-module/resources/lang/tr/message.php
+++ b/addons/default/visiosoft/advs-module/resources/lang/tr/message.php
@@ -22,4 +22,5 @@ return [
'cancelBtn' => "ve ya İptal",
'link' => "",
],
+ 'update_category_info' => 'Lütfen kategoriyi güncelleyiniz.',
];
\ No newline at end of file
diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
index d083eec2b..d5f4cd950 100644
--- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
+++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
@@ -62,7 +62,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
$join->on('advs_advs.id', '=', 'advs_advs_translations.entry_id');
$join->where('advs_advs_translations.locale', '=', Request()->session()->get('_locale'));
});
-
+
if (!empty($param['keyword'])) {
$delimiter = '_';
$keyword = str_slug($param['keyword'], $delimiter);
@@ -167,19 +167,19 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
if (substr($para, 4, 3) === "cf_") {
$id = substr($para, 7);
$minmax = substr($para, 0, 3);
- if($minmax == 'min'){
+ if ($minmax == 'min') {
- $num = $param[$minmax.'_cf_'.$id];
+ $num = $param[$minmax . '_cf_' . $id];
$int = (int)$num;
- $column = "JSON_EXTRACT(cf_json, '$.cf" . $id . "') >= '" . $int ."'";
+ $column = "JSON_EXTRACT(cf_json, '$.cf" . $id . "') >= '" . $int . "'";
$query = $query->whereRaw($column);
}
- if($minmax == 'max'){
+ if ($minmax == 'max') {
- $num = $param[$minmax.'_cf_'.$id];
+ $num = $param[$minmax . '_cf_' . $id];
$int = (int)$num;
- $column = "JSON_EXTRACT(cf_json, '$.cf" . $id . "') <= '" . $int ."'";
+ $column = "JSON_EXTRACT(cf_json, '$.cf" . $id . "') <= '" . $int . "'";
$query = $query->whereRaw($column);
}
@@ -201,7 +201,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
$join->on('advs_advs.id', '=', 'dopings_dopings.adv_name_id');
$join->where('dopings_dopings.doping_type_id', '=', 4);
});
-
+
$query = $query->select('advs_advs.*', 'dopings_dopings.id as doping');
}
if (!empty($param['sort_by'])) {
@@ -250,12 +250,17 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
$cat1 = CategoryModel::query()->where('cats_category.id', $adv->cat1)->first();
$cat2 = CategoryModel::query()->where('cats_category.id', $adv->cat2)->first();
- $adv->setAttribute('cat1_name', $cat1->name);
- if ($cat2 == null) {
- $adv->setAttribute('cat2_name', "");
- } else {
+ if (!is_null($cat1))
+ $adv->setAttribute('cat1_name', $cat1->name);
+ else
+ $adv->setAttribute('cat1_name', "");
+
+ if (!is_null($cat2))
$adv->setAttribute('cat2_name', $cat2->name);
- }
+
+ else
+ $adv->setAttribute('cat2_name', "");
+
return $adv;
}
diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php
index 5d71e5423..5d7475e8c 100644
--- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php
+++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php
@@ -257,11 +257,14 @@ class AdvsController extends PublicController
$cat = "cat" . $i;
if ($adv->$cat != null) {
$item = $this->category_repository->getItem($adv->$cat);
- $categories['cat' . $i] = [
- 'name' => $item->name,
- 'id' => $item->id
- ];
- $categories_id[] = $item->id;
+ if (!is_null($item)) {
+ $categories['cat' . $i] = [
+ 'name' => $item->name,
+ 'id' => $item->id
+ ];
+ $categories_id[] = $item->id;
+ }
+
}
}
@@ -681,8 +684,13 @@ class AdvsController extends PublicController
for ($i = 1; $i < 7; $i++) {
if ($adv[$cat . $i] != null) {
$name = $categoryRepository->getSingleCat($adv[$cat . $i]);
- $cats_d['cat' . $i] = $name->name;
- $cats['cat' . $i] = $name->id;
+ if (!is_null($name)) {
+ $cats_d['cat' . $i] = $name->name;
+ $cats['cat' . $i] = $name->id;
+ } else {
+ $this->messages->info(trans('visiosoft.module.advs::message.update_category_info'));
+ }
+
}
}
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.