mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
Merge branches 'fatihalp' and 'master' of https://github.com/openclassify/openclassify into fatihalp
Conflicts: addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php
This commit is contained in:
commit
397b33847c
@ -173,6 +173,7 @@ return [
|
|||||||
'type' => 'anomaly.field_type.checkboxes',
|
'type' => 'anomaly.field_type.checkboxes',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'config' => [
|
'config' => [
|
||||||
|
'mode' => 'tags',
|
||||||
'default_value' => function () {
|
'default_value' => function () {
|
||||||
return [config('streams::currencies.default')];
|
return [config('streams::currencies.default')];
|
||||||
},
|
},
|
||||||
|
|||||||
@ -70,7 +70,7 @@ promiseForCategory.then(function (categories_list) {
|
|||||||
function CategoryField(name, level) {
|
function CategoryField(name, level) {
|
||||||
return '<div class="col-12 px-0 py-1 category-select-mobile category-box" data-level="' + level + '">\n' +
|
return '<div class="col-12 px-0 py-1 category-select-mobile category-box" data-level="' + level + '">\n' +
|
||||||
'</span>\n<select data-level="' + level + '" class="form-control cat-select ' + name + '">\n' +
|
'</span>\n<select data-level="' + level + '" class="form-control cat-select ' + name + '">\n' +
|
||||||
'<option> ...</option>' +
|
'<option>'+ catsPlaceholder +'</option>' +
|
||||||
'</select>\n</div>';
|
'</select>\n</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,12 +130,3 @@ $('.set_category').on('click', function () {
|
|||||||
$('#filterModal').find('form').attr("action", '/advs/list');
|
$('#filterModal').find('form').attr("action", '/advs/list');
|
||||||
$('#filterModal').modal('toggle');
|
$('#filterModal').modal('toggle');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Move filter on small screen
|
|
||||||
$(window).on("load resize", function () {
|
|
||||||
const width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
|
|
||||||
if (width <= 575) {
|
|
||||||
const detach = $('#listFilterForm').detach();
|
|
||||||
$('#modalListFilterForm').append(detach);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|||||||
@ -163,7 +163,8 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function getCities(country) {
|
function getCities(country) {
|
||||||
return crudAjax(`id=${country}`, '/ajax/getCities', 'POST', () => {}, true)
|
return crudAjax(`id=${country}`, '/ajax/getCities', 'POST', () => {
|
||||||
|
}, true)
|
||||||
.then(function (cities) {
|
.then(function (cities) {
|
||||||
$('select[name="filter_City"]').html("<option value=''>" + $('select[name=filter_City] option:first-child').text() + "</option>");
|
$('select[name="filter_City"]').html("<option value=''>" + $('select[name=filter_City] option:first-child').text() + "</option>");
|
||||||
$.each(cities, function (index, value) {
|
$.each(cities, function (index, value) {
|
||||||
@ -172,9 +173,10 @@ function getCities(country) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#listFilterForm").submit(function(e) {
|
$("#listFilterForm, #listFilterFormMobile").submit(function (e) {
|
||||||
// Disable unselected inputs
|
// Disable unselected inputs
|
||||||
const inputs = $('#listFilterForm :input');
|
const inputs = $('#' + $(this).attr('id') + ' :input');
|
||||||
|
|
||||||
[...inputs].forEach((input) => {
|
[...inputs].forEach((input) => {
|
||||||
if (input.type === 'checkbox' || input.type === 'radio') {
|
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||||
if ($(input).prop("checked") == false) {
|
if ($(input).prop("checked") == false) {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
var categories = {};
|
let categories = {}
|
||||||
|
catsPlaceholder = '{{ trans("visiosoft.module.advs::field.categories.name") }}';
|
||||||
</script>
|
</script>
|
||||||
{{ asset_add('scripts.js','visiosoft.module.advs::js/filter_modal.js') }}
|
{{ asset_add('scripts.js','visiosoft.module.advs::js/filter_modal.js') }}
|
||||||
<div class="modal fade" id="filterModal" tabindex="-1" role="dialog" aria-labelledby="filterModal" aria-hidden="true">
|
<div class="modal fade" id="filterModal" tabindex="-1" role="dialog" aria-labelledby="filterModal" aria-hidden="true">
|
||||||
@ -35,7 +36,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="modalListFilterForm"></div>
|
<div id="modalListFilterForm">
|
||||||
|
{% include 'visiosoft.module.advs::list/partials/list-filter' with {"filter_id": 'listFilterFormMobile'} %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{% set formHtml %}
|
{% set formHtml %}
|
||||||
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="listFilterForm" rel="nofollow">
|
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="{{ (filter_id) ? filter_id : "listFilterForm" }}" rel="nofollow">
|
||||||
{% endset %}
|
{% endset %}
|
||||||
{% set catSlug = null %}
|
{% set catSlug = null %}
|
||||||
{% set citySlug = null %}
|
{% set citySlug = null %}
|
||||||
@ -12,7 +12,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if catSlug %}
|
{% if catSlug %}
|
||||||
{% set formHtml %}
|
{% set formHtml %}
|
||||||
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="listFilterForm" rel="nofollow">
|
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="{{ (filter_id) ? filter_id : "listFilterForm" }}" rel="nofollow">
|
||||||
{% endset %}
|
{% endset %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ formHtml }}
|
{{ formHtml }}
|
||||||
|
|||||||
@ -1,4 +1,14 @@
|
|||||||
{% if setting_value('visiosoft.module.advs::hide_price_filter') == false %}
|
{% set hidePriceCats = setting_value('visiosoft.module.advs::hide_price_categories') %}
|
||||||
|
{% set cats = entries('cats','category').whereIn('id', hidePriceCats).get() %}
|
||||||
|
{% set isHidden = false %}
|
||||||
|
|
||||||
|
{% for cat in cats %}
|
||||||
|
{% if request().segment(2) == cat.slug %}
|
||||||
|
{% set isHidden = true %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if setting_value('visiosoft.module.advs::hide_price_filter') == false and not isHidden%}
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<div class="card-header breadcrumb mb-0" id="priceHeading">
|
<div class="card-header breadcrumb mb-0" id="priceHeading">
|
||||||
<h5 class="mb-0">
|
<h5 class="mb-0">
|
||||||
|
|||||||
@ -103,11 +103,13 @@
|
|||||||
</div>
|
</div>
|
||||||
{% set PriceValue = form.fields.price.value|split('.') %}
|
{% set PriceValue = form.fields.price.value|split('.') %}
|
||||||
<div class="col-6 col-sm-7 pr-0 col-md-3">
|
<div class="col-6 col-sm-7 pr-0 col-md-3">
|
||||||
<input class="form-control priceField whole-price" value="{{ PriceValue|first }}">
|
<input class="form-control priceField whole-price"
|
||||||
|
value="{{ PriceValue|first }}">
|
||||||
</div>
|
</div>
|
||||||
{% if setting_value('visiosoft.field_type.decimal::showDecimal') %}
|
{% if setting_value('visiosoft.field_type.decimal::showDecimal') %}
|
||||||
<div class="col-4 col-md-1">
|
<div class="col-4 col-md-1">
|
||||||
<input class="form-control priceDecimalField decimal-price" placeholder="00" maxlength="2"
|
<input class="form-control priceDecimalField decimal-price" placeholder="00"
|
||||||
|
maxlength="2"
|
||||||
value="{{ PriceValue[1] }}">
|
value="{{ PriceValue[1] }}">
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -135,11 +137,13 @@
|
|||||||
{{ trans('visiosoft.module.advs::field.options') }}
|
{{ trans('visiosoft.module.advs::field.options') }}
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="selectOptions" class="form-control options-tags" multiple="multiple"
|
<select id="selectOptions" class="form-control options-tags"
|
||||||
|
multiple="multiple"
|
||||||
name="options[]">
|
name="options[]">
|
||||||
{% if count(options) %}
|
{% if count(options) %}
|
||||||
{% for option in options %}
|
{% for option in options %}
|
||||||
<option id="advOption{{ option.id }}" selected="selected">{{ option.name }}</option>
|
<option id="advOption{{ option.id }}"
|
||||||
|
selected="selected">{{ option.name }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</select>
|
</select>
|
||||||
@ -177,25 +181,28 @@
|
|||||||
<div class="row form-group images">
|
<div class="row form-group images">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
{{ form.fields.files.input |raw }}
|
{{ form.fields.files.input |raw }}
|
||||||
<input name="doc_files" value="{{ form.fields.doc_files.value.pluck('id').all()|join(',') }}" hidden>
|
<input name="doc_files"
|
||||||
|
value="{{ form.fields.doc_files.value.pluck('id').all()|join(',') }}"
|
||||||
|
hidden>
|
||||||
<div class="doc_list small">
|
<div class="doc_list small">
|
||||||
{% for docs in form.fields.doc_files.value %}
|
{% for docs in form.fields.doc_files.value %}
|
||||||
<a id="{{ docs.id }}" href="javascript:void(0)" onclick="deleteDocs({{ docs.id }})" class="text-dark">
|
<a id="{{ docs.id }}" href="javascript:void(0)"
|
||||||
{{ docs.name }}
|
onclick="deleteDocs({{ docs.id }})" class="text-dark">
|
||||||
<i class="fa fa-trash text-danger pl-2"></i>
|
{{ docs.name }}
|
||||||
</a><br>
|
<i class="fa fa-trash text-danger pl-2"></i>
|
||||||
|
</a><br>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% set other_fields = addBlock('new-ad/other-fields',{'custom_fields':custom_fields}) %}
|
||||||
{% if custom_fields and count(custom_fields) %}
|
{% if other_fields or (custom_fields and count(custom_fields)) %}
|
||||||
<h5 class="mt-5 pb-1 border-bottom">
|
<h5 class="mt-5 pb-1 border-bottom">
|
||||||
{{ trans('visiosoft.module.advs::field.additional_fields') }}
|
{{ trans('visiosoft.module.advs::field.additional_fields') }}
|
||||||
</h5>
|
</h5>
|
||||||
<div class="bg-light p-4">
|
<div class="bg-light p-4">
|
||||||
{{ addBlock('new-ad/other-fields',{'custom_fields':custom_fields})|raw }}
|
{{ other_fields|raw }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ class AdvCriteria extends EntryCriteria
|
|||||||
|
|
||||||
public function getCurrentLocale()
|
public function getCurrentLocale()
|
||||||
{
|
{
|
||||||
return locale_get_display_name(config('app.locale'));
|
return trans('streams::locale.' . config('app.locale') . '.name');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isEnabled($slug)
|
public function isEnabled($slug)
|
||||||
|
|||||||
@ -320,6 +320,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
'mime_type' => $image->mime,
|
'mime_type' => $image->mime,
|
||||||
'extension' => $image->extension,
|
'extension' => $image->extension,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
$coverPhoto = 'files/images/' . $fileName;
|
$coverPhoto = 'files/images/' . $fileName;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -22,12 +22,16 @@ class AdvTableColumns
|
|||||||
'wrapper' => '
|
'wrapper' => '
|
||||||
<strong><span class="text-muted">#{value.id}</span>{value.name}</strong>
|
<strong><span class="text-muted">#{value.id}</span>{value.name}</strong>
|
||||||
<br>
|
<br>
|
||||||
<small class="text-muted">{value.finish_at}</small>
|
<small class="text-muted">{value.date}</small>
|
||||||
<br>
|
<br>
|
||||||
<span>{value.category}</span>',
|
<span>{value.category}</span>',
|
||||||
'value' => [
|
'value' => [
|
||||||
'id' => 'entry.id',
|
'id' => 'entry.id',
|
||||||
'finish_at' => 'entry.finish_at',
|
'date' => function(EntryInterface $entry){
|
||||||
|
$created_at = ($entry['created_at']) ?date_format($entry['created_at'], 'd.m.Y H:i'): '';
|
||||||
|
$finish_at = ($entry['finish_at']) ? date_format($entry['finish_at'], 'd.m.Y H:i'): '';
|
||||||
|
return $created_at . ' <i class="fa fa-angle-right"></i> ' . $finish_at;
|
||||||
|
},
|
||||||
'name' => function (EntryInterface $entry) {
|
'name' => function (EntryInterface $entry) {
|
||||||
if ($entry->getTitle()) {
|
if ($entry->getTitle()) {
|
||||||
$value = "<a href='" . $entry->getAdvDetailLinkByModel($entry, 'list') . "' > {entry.name}</a > ";
|
$value = "<a href='" . $entry->getAdvDetailLinkByModel($entry, 'list') . "' > {entry.name}</a > ";
|
||||||
|
|||||||
@ -24,6 +24,7 @@ use Visiosoft\AdvsModule\Adv\Event\ViewAd;
|
|||||||
use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder;
|
use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder;
|
||||||
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
|
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
|
||||||
use Visiosoft\AdvsModule\OptionConfiguration\Contract\OptionConfigurationRepositoryInterface;
|
use Visiosoft\AdvsModule\OptionConfiguration\Contract\OptionConfigurationRepositoryInterface;
|
||||||
|
use Visiosoft\AdvsModule\OptionConfiguration\OptionConfigurationModel;
|
||||||
use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface;
|
use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface;
|
||||||
use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface;
|
use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface;
|
||||||
use Visiosoft\CatsModule\Category\CategoryModel;
|
use Visiosoft\CatsModule\Category\CategoryModel;
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\OptionConfiguration;
|
<?php namespace Visiosoft\AdvsModule\OptionConfiguration;
|
||||||
|
|
||||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
|
||||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||||
use Visiosoft\AdvsModule\OptionConfiguration\Contract\OptionConfigurationInterface;
|
use Visiosoft\AdvsModule\OptionConfiguration\Contract\OptionConfigurationInterface;
|
||||||
use Anomaly\Streams\Platform\Model\Advs\AdvsOptionConfigurationEntryModel;
|
use Anomaly\Streams\Platform\Model\Advs\AdvsOptionConfigurationEntryModel;
|
||||||
use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface;
|
|
||||||
use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface;
|
use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface;
|
||||||
|
|
||||||
class OptionConfigurationModel extends AdvsOptionConfigurationEntryModel implements OptionConfigurationInterface
|
class OptionConfigurationModel extends AdvsOptionConfigurationEntryModel implements OptionConfigurationInterface
|
||||||
@ -24,4 +22,20 @@ class OptionConfigurationModel extends AdvsOptionConfigurationEntryModel impleme
|
|||||||
return $adv->name . ' | ' . trim($option_group_value, ' ');
|
return $adv->name . ' | ' . trim($option_group_value, ' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function stockControl($id, $quantity)
|
||||||
|
{
|
||||||
|
$conf = $this->newQuery()->find($id);
|
||||||
|
$stock = $conf->stock;
|
||||||
|
|
||||||
|
if ($stock === NULL || $stock === 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($stock < $quantity) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,85 +9,88 @@ use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueReposit
|
|||||||
class OptionConfigurationRepository extends EntryRepository implements OptionConfigurationRepositoryInterface
|
class OptionConfigurationRepository extends EntryRepository implements OptionConfigurationRepositoryInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The entry model.
|
* The entry model.
|
||||||
*
|
*
|
||||||
* @var OptionConfigurationModel
|
* @var OptionConfigurationModel
|
||||||
*/
|
*/
|
||||||
protected $model;
|
protected $model;
|
||||||
protected $advRepository;
|
protected $advRepository;
|
||||||
protected $productOptionsValueRepository;
|
protected $productOptionsValueRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new OptionConfigurationRepository instance.
|
* Create a new OptionConfigurationRepository instance.
|
||||||
*
|
*
|
||||||
* @param OptionConfigurationModel $model
|
* @param OptionConfigurationModel $model
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
OptionConfigurationModel $model,
|
OptionConfigurationModel $model,
|
||||||
AdvRepositoryInterface $advRepository,
|
AdvRepositoryInterface $advRepository,
|
||||||
ProductoptionsValueRepositoryInterface $productoptionsValueRepository
|
ProductoptionsValueRepositoryInterface $productoptionsValueRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
$this->advRepository = $advRepository;
|
$this->advRepository = $advRepository;
|
||||||
$this->productOptionsValueRepository = $productoptionsValueRepository;
|
$this->productOptionsValueRepository = $productoptionsValueRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createConfigration($ad_id, $price, $currency, $stock, $option_json)
|
public function createConfigration($ad_id, $price, $currency, $stock, $option_json)
|
||||||
{
|
{
|
||||||
return $this->create([
|
return $this->create([
|
||||||
'parent_adv_id' => $ad_id,
|
'parent_adv_id' => $ad_id,
|
||||||
'price' => $price,
|
'price' => $price,
|
||||||
'currency' => $currency,
|
'currency' => $currency,
|
||||||
'stock' => $stock,
|
'stock' => $stock,
|
||||||
'option_json' => $option_json,
|
'option_json' => $option_json,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConf($ad_id)
|
public function getConf($ad_id)
|
||||||
{
|
{
|
||||||
$adv = $this->advRepository->find($ad_id);
|
$adv = $this->advRepository->find($ad_id);
|
||||||
$configurations = array();
|
$configurations = array();
|
||||||
|
|
||||||
$product_configurations = $this->model->where('stock', '>', '0')->where('parent_adv_id', $ad_id)->get();
|
$product_configurations = $this->model->where('stock', '>', '0')
|
||||||
|
->where('parent_adv_id', $ad_id)
|
||||||
|
->orderBy('created_at', 'ASC')
|
||||||
|
->get();
|
||||||
|
|
||||||
foreach ($product_configurations as $product_configuration) {
|
foreach ($product_configurations as $product_configuration) {
|
||||||
$configurations_item = json_decode($product_configuration->option_json, true);
|
$configurations_item = json_decode($product_configuration->option_json, true);
|
||||||
$option_group_value = "";
|
$option_group_value = "";
|
||||||
foreach ($configurations_item as $option_id => $value) {
|
foreach ($configurations_item as $option_id => $value) {
|
||||||
$value_entry = $this->productOptionsValueRepository->find($value);
|
$value_entry = $this->productOptionsValueRepository->find($value);
|
||||||
$option_group_value .= " " . $value_entry->getName();
|
$option_group_value .= " " . $value_entry->getName();
|
||||||
}
|
}
|
||||||
$configurations[$product_configuration->getId()] = [
|
$configurations[$product_configuration->getId()] = [
|
||||||
'name' => $option_group_value,
|
'name' => $option_group_value,
|
||||||
'price' => $product_configuration->price,
|
'price' => $product_configuration->price,
|
||||||
'currency' => $product_configuration->currency,
|
'currency' => $product_configuration->currency,
|
||||||
'stock' => $product_configuration->stock,
|
'stock' => $product_configuration->stock,
|
||||||
'adv' => $adv->name . ' (' . trim($option_group_value, ' ') . ')',
|
'adv' => $adv->name . ' (' . trim($option_group_value, ' ') . ')',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $configurations;
|
return $configurations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnusedConfigs()
|
public function getUnusedConfigs()
|
||||||
{
|
{
|
||||||
return $this->newQuery()
|
return $this->newQuery()
|
||||||
->leftJoin('advs_advs as ads', 'advs_option_configuration.parent_adv_id', 'ads.id')
|
->leftJoin('advs_advs as ads', 'advs_option_configuration.parent_adv_id', 'ads.id')
|
||||||
->whereNull('ads.id')
|
->whereNull('ads.id')
|
||||||
->orWhereNotNull('deleted_at')
|
->orWhereNotNull('deleted_at')
|
||||||
->pluck('parent_adv_id')
|
->pluck('parent_adv_id')
|
||||||
->all();
|
->all();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteUnusedConfigs($adsIDs)
|
public function deleteUnusedConfigs($adsIDs)
|
||||||
{
|
{
|
||||||
return $this->newQuery()->whereIn('parent_adv_id', $adsIDs)->delete();
|
return $this->newQuery()->whereIn('parent_adv_id', $adsIDs)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteAdsConfigs($adID)
|
public function deleteAdsConfigs($adID)
|
||||||
{
|
{
|
||||||
return $this->newQuery()->where('parent_adv_id', $adID)->delete();
|
return $this->newQuery()->where('parent_adv_id', $adID)->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,3 +32,15 @@ if (!function_exists('auth_id_if_null'))
|
|||||||
return $userId ?: auth()->id();
|
return $userId ?: auth()->id();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('replace_to_text'))
|
||||||
|
{
|
||||||
|
function replace_to_text($content, $array)
|
||||||
|
{
|
||||||
|
foreach ($array as $key => $value) {
|
||||||
|
$content = str_replace('${' . $key . '}', $value, $content);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
<tfoot>
|
||||||
|
{% if table.actions|length or table.data.pagination.links|length %}
|
||||||
|
<tr>
|
||||||
|
<th colspan="100%" style="padding: 10px;">
|
||||||
|
|
||||||
|
<div class="pull-left actions table__actions">
|
||||||
|
{{ buttons(table.actions)|raw }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if table.data.pagination.links|length %}
|
||||||
|
<div class="pull-right">
|
||||||
|
|
||||||
|
<select onchange="window.location=this.value;"
|
||||||
|
class="custom-select table-limit">
|
||||||
|
<option {{ table.options.limit == 5 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 5} + request_query()) }}">
|
||||||
|
5 {{ trans('streams::message.results') }}</option>
|
||||||
|
<option {{ table.options.limit == 10 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 10} + request_query()) }}">
|
||||||
|
10 {{ trans('streams::message.results') }}</option>
|
||||||
|
<option {{ table.options.limit == 15 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 15} + request_query()) }}">
|
||||||
|
15 {{ trans('streams::message.results') }}</option>
|
||||||
|
<option {{ table.options.limit == 25 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 25} + request_query()) }}">
|
||||||
|
25 {{ trans('streams::message.results') }}</option>
|
||||||
|
<option {{ table.options.limit == 50 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 50} + request_query()) }}">
|
||||||
|
50 {{ trans('streams::message.results') }}</option>
|
||||||
|
<option {{ table.options.limit == 75 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 75} + request_query()) }}">
|
||||||
|
75 {{ trans('streams::message.results') }}</option>
|
||||||
|
<option {{ table.options.limit == 100 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 100} + request_query()) }}">
|
||||||
|
100 {{ trans('streams::message.results') }}</option>
|
||||||
|
<option {{ table.options.limit == 150 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 150} + request_query()) }}">
|
||||||
|
150 {{ trans('streams::message.results') }}</option>
|
||||||
|
<option {{ table.options.limit == 1000 ? 'selected' }}
|
||||||
|
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 1000} + request_query()) }}">
|
||||||
|
{{ trans('streams::message.show_all') }}</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
{{ table.data.pagination.links|raw }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div style="clear: both;"></div>
|
||||||
|
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% if table.options.total_results %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="100%">
|
||||||
|
<small class="text-muted pull-right">
|
||||||
|
{{ table.options.total_results }} {{ trans('streams::message.results') }}
|
||||||
|
</small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
</tfoot>
|
||||||
@ -27,6 +27,10 @@ class DefaultadminThemeServiceProvider extends AddonServiceProvider
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected $overrides = [
|
||||||
|
'streams::table/partials/footer' => 'visiosoft.theme.defaultadmin::table/partials/footer'
|
||||||
|
];
|
||||||
|
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
AbstractPaginator::$defaultView = 'visiosoft.theme.defaultadmin::pagination/bootstrap-4';
|
AbstractPaginator::$defaultView = 'visiosoft.theme.defaultadmin::pagination/bootstrap-4';
|
||||||
|
|||||||
@ -15,7 +15,7 @@ function Locations(cat, level, name) {
|
|||||||
url: "/class/ajax",
|
url: "/class/ajax",
|
||||||
success: function (msg) {
|
success: function (msg) {
|
||||||
$('select[name="' + name + '"]').find('option').remove();
|
$('select[name="' + name + '"]').find('option').remove();
|
||||||
$('select[name="' + name + '"]').append('<option>...</option>');
|
$('select[name="' + name + '"]').append('<option value="">...</option>');
|
||||||
$.each(msg, function (key, value) {
|
$.each(msg, function (key, value) {
|
||||||
$('select[name="' + name + '"]').append('<option value="' + value.id + '">' + value.name + '</option>');
|
$('select[name="' + name + '"]').append('<option value="' + value.id + '">' + value.name + '</option>');
|
||||||
});
|
});
|
||||||
|
|||||||
@ -7,6 +7,7 @@ return [
|
|||||||
'general_setting' => [
|
'general_setting' => [
|
||||||
'title' => 'visiosoft.module.profile::section.general_setting',
|
'title' => 'visiosoft.module.profile::section.general_setting',
|
||||||
'fields' => [
|
'fields' => [
|
||||||
|
'required_district',
|
||||||
'show_my_ads',
|
'show_my_ads',
|
||||||
'upload_avatar',
|
'upload_avatar',
|
||||||
'show_tax_office',
|
'show_tax_office',
|
||||||
|
|||||||
@ -70,4 +70,10 @@ return [
|
|||||||
"education" => "anomaly.field_type.tags",
|
"education" => "anomaly.field_type.tags",
|
||||||
"state_of_education" => "anomaly.field_type.tags",
|
"state_of_education" => "anomaly.field_type.tags",
|
||||||
"profession" => "anomaly.field_type.tags",
|
"profession" => "anomaly.field_type.tags",
|
||||||
|
'required_district' => [
|
||||||
|
'type' => 'anomaly.field_type.boolean',
|
||||||
|
'config' => [
|
||||||
|
'default_value' => false,
|
||||||
|
]
|
||||||
|
],
|
||||||
];
|
];
|
||||||
@ -47,4 +47,7 @@ return [
|
|||||||
'name' => 'Hide Register Type in Profile Page',
|
'name' => 'Hide Register Type in Profile Page',
|
||||||
'instructions' => 'Hides the register type field in the profile edit page.',
|
'instructions' => 'Hides the register type field in the profile edit page.',
|
||||||
],
|
],
|
||||||
|
'required_district' => [
|
||||||
|
'name' => 'Required District'
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -26,7 +26,9 @@ class AdressFormFields
|
|||||||
'city' => [
|
'city' => [
|
||||||
'required' => true,
|
'required' => true,
|
||||||
],
|
],
|
||||||
'district',
|
'district' => [
|
||||||
|
'required' => setting_value( 'visiosoft.module.profile::required_district'),
|
||||||
|
],
|
||||||
'adress_content' => [
|
'adress_content' => [
|
||||||
'required' => true,
|
'required' => true,
|
||||||
],
|
],
|
||||||
|
|||||||
@ -134,8 +134,15 @@ class MyProfileController extends PublicController
|
|||||||
{
|
{
|
||||||
$message = [];
|
$message = [];
|
||||||
|
|
||||||
|
$error_district = false;
|
||||||
|
if (setting_value('visiosoft.module.profile::required_district') and (!$this->request->district or $this->request->district == "")) {
|
||||||
|
$error_district = true;
|
||||||
|
}
|
||||||
|
|
||||||
$error = $form->build()->validate()->getFormErrors()->getMessages();
|
$error = $form->build()->validate()->getFormErrors()->getMessages();
|
||||||
if (!empty($error)) {
|
|
||||||
|
if (!empty($error) or $error_district) {
|
||||||
|
$this->messages->flush();
|
||||||
$message['status'] = "error";
|
$message['status'] = "error";
|
||||||
$message['msg'] = trans('visiosoft.module.profile::message.required_all');
|
$message['msg'] = trans('visiosoft.module.profile::message.required_all');
|
||||||
return $message;
|
return $message;
|
||||||
@ -248,19 +255,19 @@ class MyProfileController extends PublicController
|
|||||||
return response()->json(['status' => 'success', 'data' => $profile]);
|
return response()->json(['status' => 'success', 'data' => $profile]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEducation(Request $request)
|
public function getEducation(Request $request)
|
||||||
{
|
{
|
||||||
$user = $this->userRepository->find(auth()->id());
|
$user = $this->userRepository->find(auth()->id());
|
||||||
$education = EducationModel::all();
|
$education = EducationModel::all();
|
||||||
$educationPart = EducationPartModel::query()->where('education_id', $user->education)->get();
|
$educationPart = EducationPartModel::query()->where('education_id', $user->education)->get();
|
||||||
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
|
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function changeEducation(Request $request)
|
public function changeEducation(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->info == 'education') {
|
if ($request->info == 'education') {
|
||||||
$education = EducationPartModel::query()->where('education_id', $request->education)->get();
|
$education = EducationPartModel::query()->where('education_id', $request->education)->get();
|
||||||
}
|
}
|
||||||
return response()->json(['data' => $education], 200);
|
return response()->json(['data' => $education], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -180,6 +180,17 @@ class Loader extends FileLoader
|
|||||||
$lines = array_replace_recursive($lines, $this->files->getRequire($file));
|
$lines = array_replace_recursive($lines, $this->files->getRequire($file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Override System
|
||||||
|
$override_list = config('streams::translate.override');
|
||||||
|
|
||||||
|
foreach ($override_list as $override) {
|
||||||
|
$override = explode(':', $override);
|
||||||
|
if (count($override) > 1) {
|
||||||
|
$lines = $this->findArrayValue($override[0], $override[1], $lines);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (config()->has('override_text')) {
|
if (config()->has('override_text')) {
|
||||||
foreach (config()->get('override_text') as $override) {
|
foreach (config()->get('override_text') as $override) {
|
||||||
$override = explode(':', $override);
|
$override = explode(':', $override);
|
||||||
|
|||||||
7
resources/streams/config/translate.php
Normal file
7
resources/streams/config/translate.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'override' => [
|
||||||
|
'Sümüklüböcek:Benzersiz İsim',
|
||||||
|
],
|
||||||
|
];
|
||||||
Loading…
Reference in New Issue
Block a user