mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#2353 admin add fast product
This commit is contained in:
parent
2416534cc5
commit
87971c03eb
@ -0,0 +1,7 @@
|
|||||||
|
$cats: 10;
|
||||||
|
|
||||||
|
@for $i from 2 through $cats {
|
||||||
|
.cat#{$i} {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
44
addons/default/visiosoft/advs-module/resources/js/simple.js
Normal file
44
addons/default/visiosoft/advs-module/resources/js/simple.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
function getCats(i, cat = null, change = false) {
|
||||||
|
$(`.cat${i}`).show()
|
||||||
|
$(`#cat${i}`).prop('disabled', true)
|
||||||
|
|
||||||
|
$.get('/class/ajaxCategory', { level: i - 1, cat })
|
||||||
|
.then((response) => {
|
||||||
|
if (response.length) {
|
||||||
|
const currSelect = $(`#cat${i}`)
|
||||||
|
currSelect.html(`
|
||||||
|
<option value="">Choose an option...</option>
|
||||||
|
`)
|
||||||
|
for (let ii = 0; ii < response.length; ii++) {
|
||||||
|
currSelect.append(`
|
||||||
|
<option value="${response[ii].id}">${response[ii].name}</option>
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
currSelect.prop('disabled', false)
|
||||||
|
|
||||||
|
if (typeof ad !== 'undefined' && !change) {
|
||||||
|
if (ad[`cat${i}`]) {
|
||||||
|
currSelect.val(ad[`cat${i}`])
|
||||||
|
getCats(i + 1, ad[`cat${i}`])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(`.cat${i}`).hide()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getCats(1);
|
||||||
|
|
||||||
|
for (let i = 1; i <= 10; i++) {
|
||||||
|
$(`#cat${i}`).on('change', function () {
|
||||||
|
changeCat(i + 1, this.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeCat(level, id) {
|
||||||
|
$(`.cat${level - 1}`)
|
||||||
|
.nextUntil('.cat10 +').hide()
|
||||||
|
.find('select').val('')
|
||||||
|
|
||||||
|
getCats(level, id, true)
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'new_adv' => 'New classified',
|
'new_adv' => 'New classified',
|
||||||
|
'new_classified' => 'New classified',
|
||||||
'new_category' => 'New Category',
|
'new_category' => 'New Category',
|
||||||
'new_country' => 'New Country',
|
'new_country' => 'New Country',
|
||||||
'new_city' => 'New City',
|
'new_city' => 'New City',
|
||||||
@ -39,4 +40,5 @@ return [
|
|||||||
'new_option_configuration' => 'New Option configuration',
|
'new_option_configuration' => 'New Option configuration',
|
||||||
'create_configurations' => 'Create Configurations',
|
'create_configurations' => 'Create Configurations',
|
||||||
'replicate' => 'Replicate',
|
'replicate' => 'Replicate',
|
||||||
|
'fast_create' => 'Fast create',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -82,6 +82,15 @@ return [
|
|||||||
'cat7' => [
|
'cat7' => [
|
||||||
'name' => 'Sub Category 6'
|
'name' => 'Sub Category 6'
|
||||||
],
|
],
|
||||||
|
'cat8' => [
|
||||||
|
'name' => 'Sub Category 7'
|
||||||
|
],
|
||||||
|
'cat9' => [
|
||||||
|
'name' => 'Sub Category 8'
|
||||||
|
],
|
||||||
|
'cat10' => [
|
||||||
|
'name' => 'Sub Category 9'
|
||||||
|
],
|
||||||
'currency' => [
|
'currency' => [
|
||||||
'name' => 'Currency'
|
'name' => 'Currency'
|
||||||
],
|
],
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
{% extends template.layout ?: "theme::layouts/default" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{{ content|raw }}
|
||||||
|
|
||||||
|
{% if form.mode == 'edit' %}
|
||||||
|
<script>
|
||||||
|
const ad = JSON.parse(`{{ form.entry|json_encode|raw }}`)
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
@ -1,29 +0,0 @@
|
|||||||
{{ asset_add("scripts.js", "streams::js/form/form.js") }}
|
|
||||||
{{ asset_add("scripts.js", "streams::js/form/keyboard.js") }}
|
|
||||||
{{ asset_add("scripts.js", "streams::js/form/translations.js") }}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div class="container-fluid">
|
|
||||||
|
|
||||||
{{ form_open({
|
|
||||||
'class': 'form ' ~ form.options.class ,
|
|
||||||
'enctype': 'multipart/form-data',
|
|
||||||
'url': form.options.url ?: url_full()
|
|
||||||
}) }}
|
|
||||||
|
|
||||||
{#{% include "streams::form/partials/controls" with {"position": "top"} %}#}
|
|
||||||
{% include form.options.get('heading', "streams::form/partials/heading") %}
|
|
||||||
|
|
||||||
{% if (form.model.table()== 'advs_advs') %}
|
|
||||||
{% include "visiosoft.module.advs::form/partials/layout" %}
|
|
||||||
{% else %}
|
|
||||||
{% include "streams::form/partials/layout" %}
|
|
||||||
{% endif %}
|
|
||||||
{% include "streams::form/partials/controls" %}
|
|
||||||
|
|
||||||
{{ form_close() }}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
<div class="card">
|
|
||||||
|
|
||||||
{% include "streams::form/partials/header" with {"section": section} %}
|
|
||||||
|
|
||||||
<div class="card-block">
|
|
||||||
|
|
||||||
{% include "visiosoft.module.advs::form/partials/fields" with {"fields": form.fields.base().pluck('field_name').all()} %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,243 +0,0 @@
|
|||||||
{% for field in fields %}
|
|
||||||
{% if (field=='category') %}
|
|
||||||
<div class="field-group col-sm-24 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.input | raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{% if (field == 'price' or field == 'currency' ) %}
|
|
||||||
{% if (field == 'price') %}
|
|
||||||
<div class="row">
|
|
||||||
<div class="field-group col-sm-18 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.render({'form': form})|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% set field = 'currency' %}
|
|
||||||
<div class="field-group col-sm-6 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.render({'form': form})|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% elseif(field=='country' or field=='city' or field=='district' or field=='neighborhood') %}
|
|
||||||
{% if(field=='country') %}
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<div class="field-group col-sm-24 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.render({'form': form})|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% set field = 'city' %}
|
|
||||||
<div class="field-group col-sm-24 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.render({'form': form})|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% set field = 'district' %}
|
|
||||||
<div class="field-group col-sm-24 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.render({'form': form})|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% set field = 'neighborhood' %}
|
|
||||||
<div class="field-group col-sm-24 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.render({'form': form})|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-18">
|
|
||||||
<div id="map-canvas" style="
|
|
||||||
position: absolute; overflow: hidden;
|
|
||||||
transform: translateZ(0px) translateZ(0px) translateZ(0px) translateZ(0px) translateZ(0px) translateZ(0px);
|
|
||||||
width: 68%;
|
|
||||||
height:442px;
|
|
||||||
margin-top: 31px;
|
|
||||||
margin-left: 282px;
|
|
||||||
background-color: rgb(229, 227, 223);
|
|
||||||
"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
<div class="field-group col-sm-24 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.render({'form': form})|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endif%}
|
|
||||||
{% if (field=='files') %}
|
|
||||||
<div class="field-group col-sm-24 {{ field }}">
|
|
||||||
{% for field in form.fields.translations(field) %}
|
|
||||||
{{ field.input | raw }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCAGc0z8kg9rKGVy2FizFKoz0FoWWWzoGQ&callback="
|
|
||||||
type="text/javascript"></script>
|
|
||||||
<script>
|
|
||||||
$(document).ready(function(){
|
|
||||||
categorySelect(0,0);
|
|
||||||
});
|
|
||||||
var mapOptions = {
|
|
||||||
center: new google.maps.LatLng(38.9573415, 35.2415759),
|
|
||||||
zoom: 6,
|
|
||||||
mapTypeId: google.maps.MapTypeId.STREET
|
|
||||||
};
|
|
||||||
var secildi = 0;
|
|
||||||
var marker;
|
|
||||||
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
|
|
||||||
|
|
||||||
function haritaIslem() {
|
|
||||||
var str = '';
|
|
||||||
if ($('.countryselect').val() != "") {
|
|
||||||
str += $('.countryselect :selected').text() + ' ';
|
|
||||||
}
|
|
||||||
if ($('.cityselect').val() != "") {
|
|
||||||
str += $('.cityselect :selected').text() + ' ';
|
|
||||||
}
|
|
||||||
if ($('.districtselect').val() != "") {
|
|
||||||
str += $('.districtselect :selected').text() + ' ';
|
|
||||||
}
|
|
||||||
if ($('.neighborhoodselect').val() != "") {
|
|
||||||
str += $('.neighborhoodselect :selected').text() + ' ';
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(str);
|
|
||||||
|
|
||||||
if (!str) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
str = str.replace(/\(.+\)/g, "").replace(' ', ' ');
|
|
||||||
|
|
||||||
var geocoder = new google.maps.Geocoder();
|
|
||||||
geocoder.geocode({'address': str}, function (results, status) {
|
|
||||||
if (status == google.maps.GeocoderStatus.OK) {
|
|
||||||
var searchLoc = results[0].geometry.location;
|
|
||||||
var lat = results[0].geometry.location.lat();
|
|
||||||
var lng = results[0].geometry.location.lng();
|
|
||||||
var latlng = new google.maps.LatLng(lat, lng);
|
|
||||||
var bounds = results[0].geometry.bounds;
|
|
||||||
|
|
||||||
if (bounds != undefined) {
|
|
||||||
map.fitBounds(bounds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($('.neighborhoodselect').val() != "" && $('.neighborhoodselect').val() != 0 && secildi == 0) {
|
|
||||||
secildi = 1;
|
|
||||||
console.log("event");
|
|
||||||
google.maps.event.addListener(map, 'click', function (event) {
|
|
||||||
placeMarker(event.latLng);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function placeMarker(location) {
|
|
||||||
console.log(location);
|
|
||||||
var lat = location.lat();
|
|
||||||
var lng = location.lng();
|
|
||||||
console.log(lat, lng);
|
|
||||||
$(".mapVal").val(lat + "," + lng);
|
|
||||||
if (marker) {
|
|
||||||
marker.setPosition(location);
|
|
||||||
document.getElementById("latPosition").value = lat;
|
|
||||||
document.getElementById("lngPosition").value = lng;
|
|
||||||
} else {
|
|
||||||
marker = new google.maps.Marker({
|
|
||||||
position: location,
|
|
||||||
map: map
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function getLocationData(cat, level, elem){
|
|
||||||
$.ajax({
|
|
||||||
type: "GET",
|
|
||||||
data: "cat=" + cat + "&level=" + level,
|
|
||||||
url: "{{ url_route('visiosoft.module.advs::ajax') }}",
|
|
||||||
success: function(msg){
|
|
||||||
hideLoader()
|
|
||||||
console.log(msg);
|
|
||||||
$('.'+elem).find('option').remove();
|
|
||||||
$('.'+elem).append('<option value="">Choose an option...</option>');
|
|
||||||
$.each(msg, function(key, value){
|
|
||||||
console.log(value.id);
|
|
||||||
$('.'+elem).append('<option value="'+value.id+'">'+value.name+'</option>');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
beforeSend: function () {
|
|
||||||
showLoader()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
haritaIslem(0);
|
|
||||||
}
|
|
||||||
$(document).on('change', '.countryselect', function(){
|
|
||||||
var cat = $(this).val();
|
|
||||||
var level = 1;
|
|
||||||
getLocationData(cat, level, 'cityselect');
|
|
||||||
});
|
|
||||||
$(document).on('change', '.cityselect', function(){
|
|
||||||
var cat = $(this).val();
|
|
||||||
var level = 2;
|
|
||||||
getLocationData(cat, level, 'districtselect');
|
|
||||||
});
|
|
||||||
$(document).on('change', '.districtselect', function(){
|
|
||||||
var cat = $(this).val();
|
|
||||||
var level = 3;
|
|
||||||
console.log(cat);
|
|
||||||
getLocationData(cat, level, 'neighborhoodselect');
|
|
||||||
});
|
|
||||||
$(document).on('change', '.neighborhoodselect', function(){
|
|
||||||
var cat = $(this).val();
|
|
||||||
var level = 4;
|
|
||||||
console.log(cat);
|
|
||||||
getLocationData(cat, level, '.villageselect');
|
|
||||||
});
|
|
||||||
$(document).on('change', '.villageselect', function(){
|
|
||||||
var cat = $(this).val();
|
|
||||||
var level = 5;
|
|
||||||
console.log(cat);
|
|
||||||
haritaIslem(0);
|
|
||||||
});
|
|
||||||
function categorySelect(cat, level){
|
|
||||||
if(cat!=0){
|
|
||||||
cat = $(cat).val();
|
|
||||||
}
|
|
||||||
console.log(cat);
|
|
||||||
$.ajax({
|
|
||||||
type: "GET",
|
|
||||||
data: "cat=" + cat + "&level=" + level,
|
|
||||||
url: "{{ url_route('visiosoft.module.advs::ajaxCategory') }}",
|
|
||||||
success: function(msg){
|
|
||||||
hideLoader()
|
|
||||||
console.log(msg);
|
|
||||||
if(msg.length>0){
|
|
||||||
if(level!=0){
|
|
||||||
$('#category'+level).find('option').remove();
|
|
||||||
}
|
|
||||||
if(level!=0){
|
|
||||||
$('#advformcat').append('<div class="col-sm-6"><select class="form-control" size="15" id="category'+level+'" onchange="categorySelect(this,'+level+1+')"></select></div>');
|
|
||||||
}
|
|
||||||
$.each(msg, function(key, value){
|
|
||||||
$('#category'+level).append('<option value="'+value.id+'">'+value.name+'</option>');
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
// $("#advformcat").slideUp();
|
|
||||||
$("select[name=category]").val(cat).attr('readonly',true);
|
|
||||||
$("#advforminfo").removeClass("hidden");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
beforeSend: function () {
|
|
||||||
showLoader()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
{% if form.fields.empty %}
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-block">
|
|
||||||
{{ trans("streams::message.no_fields_available") }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
{% if not form.sections.empty() %}
|
|
||||||
|
|
||||||
{% for section in form.sections %}
|
|
||||||
{% if section.view %}
|
|
||||||
{% include section.view %}
|
|
||||||
{% elseif section.html %}
|
|
||||||
{{ section.html|raw }}
|
|
||||||
{% else %}
|
|
||||||
{% include "streams::form/partials/section" %}
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
{% include "visiosoft.module.advs::form/partials/default" %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
a
|
|
||||||
|
|
||||||
{% include "visiosoft.module.advs::form/partials/fields" with {"fields": form.fields.base().where('field_name', '!=', 'price').where('field_name', '!=', 'currency').pluck('field_name').all()} %}
|
|
||||||
@ -395,4 +395,14 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
{
|
{
|
||||||
return $this->status;
|
return $this->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function approve()
|
||||||
|
{
|
||||||
|
$defaultAdPublishTime = setting_value('visiosoft.module.advs::default_published_time');
|
||||||
|
$this->update([
|
||||||
|
'status' => 'approved',
|
||||||
|
'finish_at' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . $defaultAdPublishTime . ' day')),
|
||||||
|
'publish_at' => date('Y-m-d H:i:s')
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,4 +85,6 @@ interface AdvInterface extends EntryInterface
|
|||||||
public function getProductOptionsValues();
|
public function getProductOptionsValues();
|
||||||
|
|
||||||
public function getStatus();
|
public function getStatus();
|
||||||
|
|
||||||
|
public function approve();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,46 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Form;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||||
|
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||||
|
|
||||||
|
class SimpleAdvFormBuilder extends FormBuilder
|
||||||
|
{
|
||||||
|
protected $model = AdvModel::class;
|
||||||
|
|
||||||
|
protected $fields = [
|
||||||
|
'name',
|
||||||
|
'price',
|
||||||
|
'currency',
|
||||||
|
'advs_desc',
|
||||||
|
'cat1',
|
||||||
|
'cat2',
|
||||||
|
'cat3',
|
||||||
|
'cat4',
|
||||||
|
'cat5',
|
||||||
|
'cat6',
|
||||||
|
'cat7',
|
||||||
|
'cat8',
|
||||||
|
'cat9',
|
||||||
|
'cat10',
|
||||||
|
'is_get_adv',
|
||||||
|
'stock',
|
||||||
|
'files',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $assets = [
|
||||||
|
'scripts.js' => [
|
||||||
|
'visiosoft.module.advs::js/simple.js'
|
||||||
|
],
|
||||||
|
'styles.css' => [
|
||||||
|
'visiosoft.module.advs::css/simple.scss'
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $options = [
|
||||||
|
'wrapper_view' => 'visiosoft.module.advs::blank'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $buttons = [
|
||||||
|
'cancel',
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Form;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||||
|
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||||
|
|
||||||
|
class SimpleAdvFormHandler
|
||||||
|
{
|
||||||
|
public function handle(FormBuilder $builder, AdvRepositoryInterface $advRepository)
|
||||||
|
{
|
||||||
|
if (!$builder->canSave()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$builder->saveForm();
|
||||||
|
|
||||||
|
$ad = $builder->getFormEntry();
|
||||||
|
if ($ad->status !== 'approved') {
|
||||||
|
$ad->approve();
|
||||||
|
}
|
||||||
|
|
||||||
|
$advRepository->cover_image_update($ad);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,15 +11,12 @@ class AdvsModule extends Module
|
|||||||
protected $sections = [
|
protected $sections = [
|
||||||
'advs' => [
|
'advs' => [
|
||||||
'buttons' => [
|
'buttons' => [
|
||||||
'new_adv' => [
|
'new_classified' => [
|
||||||
'href' => "/advs/create_adv",
|
'href' => "/advs/create_adv",
|
||||||
],
|
],
|
||||||
// 'new_classified' => [
|
'new_adv' => [
|
||||||
// 'href' => "/advs/create_adv",
|
'text' => 'visiosoft.module.advs::button.fast_create'
|
||||||
// ],
|
],
|
||||||
// 'new_adv' => [
|
|
||||||
// 'text' => 'visiosoft.module.advs::button.fast_create'
|
|
||||||
// ],
|
|
||||||
'extend_all' => [
|
'extend_all' => [
|
||||||
'href' => "/advs/extendAll/admin",
|
'href' => "/advs/extendAll/admin",
|
||||||
'icon' => 'fa fa-calendar',
|
'icon' => 'fa fa-calendar',
|
||||||
|
|||||||
@ -241,10 +241,6 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
|||||||
ProductoptionsValueRepositoryInterface::class => ProductoptionsValueRepository::class,
|
ProductoptionsValueRepositoryInterface::class => ProductoptionsValueRepository::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $overrides = [
|
|
||||||
'streams::form/form' => 'visiosoft.module.advs::form/form',
|
|
||||||
];
|
|
||||||
|
|
||||||
public function boot(AddonCollection $addonCollection, FileModel $fileModel)
|
public function boot(AddonCollection $addonCollection, FileModel $fileModel)
|
||||||
{
|
{
|
||||||
$settings_url = [
|
$settings_url = [
|
||||||
|
|||||||
@ -9,6 +9,7 @@ use Illuminate\Http\Request;
|
|||||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||||
use Visiosoft\AdvsModule\Adv\Event\ChangedStatusAd;
|
use Visiosoft\AdvsModule\Adv\Event\ChangedStatusAd;
|
||||||
|
use Visiosoft\AdvsModule\Adv\Form\SimpleAdvFormBuilder;
|
||||||
use Visiosoft\AdvsModule\Adv\Table\AdvTableBuilder;
|
use Visiosoft\AdvsModule\Adv\Table\AdvTableBuilder;
|
||||||
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||||
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
|
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
|
||||||
@ -54,6 +55,16 @@ class AdvsController extends AdminController
|
|||||||
return $table->render();
|
return $table->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function create(SimpleAdvFormBuilder $form)
|
||||||
|
{
|
||||||
|
return $form->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit(SimpleAdvFormBuilder $form, $id)
|
||||||
|
{
|
||||||
|
return $form->render($id);
|
||||||
|
}
|
||||||
|
|
||||||
public function choose($advId, Request $request, UserRepositoryInterface $users)
|
public function choose($advId, Request $request, UserRepositoryInterface $users)
|
||||||
{
|
{
|
||||||
if (empty($request->all())) {
|
if (empty($request->all())) {
|
||||||
@ -67,7 +78,6 @@ class AdvsController extends AdminController
|
|||||||
|
|
||||||
public function actions($id, $type, SettingRepositoryInterface $settings, AdvModel $advModel)
|
public function actions($id, $type, SettingRepositoryInterface $settings, AdvModel $advModel)
|
||||||
{
|
{
|
||||||
|
|
||||||
$ad = $advModel->where('advs_advs.id', '=', $id)->first();
|
$ad = $advModel->where('advs_advs.id', '=', $id)->first();
|
||||||
$ad->status = $type;
|
$ad->status = $type;
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,6 @@ class AjaxController extends PublicController
|
|||||||
|
|
||||||
public function categories(Request $request)
|
public function categories(Request $request)
|
||||||
{
|
{
|
||||||
$datas = [];
|
|
||||||
if ($request->level == 0) {
|
if ($request->level == 0) {
|
||||||
$datas = CategoryModel::whereNull('parent_category_id')->get();
|
$datas = CategoryModel::whereNull('parent_category_id')->get();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user