Merge branch 'master' of https://github.com/openclassify/openclassify into muammer2

 Conflicts:
	addons/default/visiosoft/advs-module/resources/lang/en/field.php
	addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
	addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php
This commit is contained in:
Muammer Top 2020-10-23 15:11:50 +03:00
commit 40fa8899ab
174 changed files with 843 additions and 616 deletions

View File

@ -0,0 +1,27 @@
<?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleAdvsCreateOldPriceField extends Migration
{
protected $delete = false;
protected $stream = [
'slug' => 'advs',
];
protected $fields = [
'old_price' => [
'type' => 'visiosoft.field_type.decimal',
'config' => [
'decimal' => 2,
'separator' => '.',
'point' => ','
],
],
];
protected $assignments = [
'old_price'
];
}

View File

@ -200,6 +200,10 @@ a.sort-by-open-dropdown:hover {
color: #8598AA;
}
.list-view-type button {
background-color: unset;
}
.list-view-type button:focus {
outline: none;
}

View File

@ -1,13 +1,21 @@
// Hide watermark_image by default
$(".watermark_image").hide();
const watermarkType = $("select[name='watermark_type']")
const watermarkText = $(".watermark_text")
const watermarkImage = $(".watermark_image")
$("select[name='watermark_type']").change((event) => {
let watermarkType = event.target.value;
if (watermarkType === 'text') {
$(".watermark_image").hide();
$(".watermark_text").show()
if (watermarkType.val() === 'text') {
watermarkImage.hide();
} else {
watermarkText.hide();
}
$(watermarkType).change((event) => {
const watermarkTypeValue = event.target.value;
if (watermarkTypeValue === 'text') {
watermarkImage.hide();
watermarkText.show()
} else if (event.target.value === 'image') {
$(".watermark_image").show();
$(".watermark_text").hide()
watermarkImage.show();
watermarkText.hide()
}
});

View File

@ -32,4 +32,5 @@ return [
'name' => 'تحديث الفئة'
],
'new_option' => 'خيار جديد',
'export' => 'تصدير'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'و ما فوق',
'and_below' => 'و تحت',
'clear_all' => 'امسح الكل',
'balances' => 'الرصيد',
'packages' => 'الحزمة',
'dopings' => 'المنشطات',
'advs' => 'Advs',
'site' => 'الموقع',
'subscription' => 'اشتراك',
'created' => 'خلقت',
'old_price' => [
'name' => 'سعر قديم'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Kateqoriya yeniləyin'
],
'new_option' => 'Yeni Seçim',
'export' => 'İxrac'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'və yuxarıda',
'and_below' => 'və aşağıda',
'clear_all' => 'Hamısını sil, hamısını təmizlə',
'balances' => 'Qalıqlar',
'packages' => 'Paketlər',
'dopings' => 'Dopinqlər',
'advs' => 'Advs',
'site' => 'Sayt',
'subscription' => 'Abunə',
'created' => 'Yarandı',
'old_price' => [
'name' => 'Köhnə Qiymət'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'আপডেট বিভাগ'
],
'new_option' => 'নতুন বিকল্প',
'export' => 'রফতানি'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'এবং উপরে',
'and_below' => 'এবং নিচে',
'clear_all' => 'সব পরিষ্কার করে দাও',
'balances' => 'ব্যালেন্স',
'packages' => 'প্যাকেজগুলি',
'dopings' => 'ডোপিংস',
'advs' => 'অ্যাড',
'site' => 'সাইট',
'subscription' => 'সাবস্ক্রিপশন',
'created' => 'তৈরি হয়েছে',
'old_price' => [
'name' => 'পুরাতন মূল্য'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Kategorie aktualisieren'
],
'new_option' => 'Neue Option',
'export' => 'Export'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'und darüber',
'and_below' => 'und darunter',
'clear_all' => 'Alles löschen',
'balances' => 'Guthaben',
'packages' => 'Pakete',
'dopings' => 'Dopings',
'advs' => 'Advs',
'site' => 'Seite? ˅',
'subscription' => 'Abonnement',
'created' => 'Erstellt',
'old_price' => [
'name' => 'Alter Preis'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Ενημέρωση κατηγορίας'
],
'new_option' => 'Νέα επιλογή',
'export' => 'Εξαγωγή'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'και παραπανω',
'and_below' => 'και παρακάτω',
'clear_all' => 'Τα καθαρίζω όλα',
'balances' => 'Υπόλοιπα',
'packages' => 'Πακέτα',
'dopings' => 'Ντόπινγκ',
'advs' => 'Advs',
'site' => 'Ιστοσελίδα',
'subscription' => 'Συνδρομή',
'created' => 'Δημιουργήθηκε',
'old_price' => [
'name' => 'Παλιά τιμή'
],
];

View File

@ -318,5 +318,8 @@ return [
],
'option_json' => [
'name' => 'Option'
]
],
'old_price' => [
'name' => 'Old Price'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Actualizar categoría'
],
'new_option' => 'Nueva opción',
'export' => 'Exportar'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'y por encima',
'and_below' => 'y por debajo',
'clear_all' => 'Limpiar todo',
'balances' => 'Saldos',
'packages' => 'Paquetes',
'dopings' => 'Dopings',
'advs' => 'Advs',
'site' => 'Sitio',
'subscription' => 'Suscripción',
'created' => 'Creado',
'old_price' => [
'name' => 'Precio anterior'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'رده به روزرسانی'
],
'new_option' => 'گزینه جدید',
'export' => 'صادرات'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'و بالاتر',
'and_below' => 'و در زیر',
'clear_all' => 'همه را پاک کن',
'balances' => 'موازنه',
'packages' => 'بسته ها',
'dopings' => 'دوپینگ',
'advs' => 'تبلیغات',
'site' => 'سایت',
'subscription' => 'اشتراک، ابونمان',
'created' => 'ایجاد شده',
'old_price' => [
'name' => 'قیمت قدیمی'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Mettre à jour la catégorie'
],
'new_option' => 'Nouvelle option',
'export' => 'Exportation'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'et ci-dessus',
'and_below' => 'et plus bas',
'clear_all' => 'Tout effacer',
'balances' => 'Soldes',
'packages' => 'Paquets',
'dopings' => 'Dopage',
'advs' => 'Advs',
'site' => 'Site',
'subscription' => 'Abonnement',
'created' => 'Créé',
'old_price' => [
'name' => 'Ancien prix'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'עדכן קטגוריה'
],
'new_option' => 'אפשרות חדשה',
'export' => 'יְצוּא'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'ומעל',
'and_below' => 'ומתחת',
'clear_all' => 'נקה הכל',
'balances' => 'יתרות',
'packages' => 'חבילות',
'dopings' => 'סמים',
'advs' => 'עו"ד',
'site' => 'אֲתַר',
'subscription' => 'מִנוּי',
'created' => 'נוצר',
'old_price' => [
'name' => 'מחיר ישן'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'अद्यतन श्रेणी'
],
'new_option' => 'नया विकल्प',
'export' => 'निर्यात'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'और ऊपर',
'and_below' => 'और नीचे',
'clear_all' => 'सभी साफ करें',
'balances' => 'शेष',
'packages' => 'संकुल',
'dopings' => 'dopings',
'advs' => 'advs',
'site' => 'साइट',
'subscription' => 'अंशदान',
'created' => 'बनाया था',
'old_price' => [
'name' => 'पुरानी कीमत'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Categoria di aggiornamento'
],
'new_option' => 'Nuova opzione',
'export' => 'Esportare'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'e al di sopra',
'and_below' => 'e sotto',
'clear_all' => 'Cancella tutto',
'balances' => 'Saldi',
'packages' => 'Pacchi',
'dopings' => 'Dopings',
'advs' => 'Advs',
'site' => 'Luogo',
'subscription' => 'Sottoscrizione',
'created' => 'Creato',
'old_price' => [
'name' => 'Vecchio prezzo'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'カテゴリを更新'
],
'new_option' => '新しいオプション',
'export' => '書き出す'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => '以上',
'and_below' => '以下',
'clear_all' => 'すべてクリア',
'balances' => 'バランス',
'packages' => 'パッケージ',
'dopings' => 'ドーピング',
'advs' => 'アドバンス',
'site' => '地点',
'subscription' => 'サブスクリプション',
'created' => '作成した',
'old_price' => [
'name' => '古い価格'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => '카테고리 업데이트'
],
'new_option' => '새로운 옵션',
'export' => '수출'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => '이상',
'and_below' => '이하',
'clear_all' => '모두 지우기',
'balances' => '균형',
'packages' => '패키지',
'dopings' => '도핑',
'advs' => 'Advs',
'site' => '대지',
'subscription' => '신청',
'created' => '만들어진',
'old_price' => [
'name' => '이전 가격'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Categorie bijwerken'
],
'new_option' => 'Nieuwe optie',
'export' => 'Exporteren'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'en hoger',
'and_below' => 'en onder',
'clear_all' => 'Wis alles',
'balances' => 'Weegschalen',
'packages' => 'Pakketjes',
'dopings' => 'Dopings',
'advs' => 'Advs',
'site' => 'Site',
'subscription' => 'Abonnement',
'created' => 'Gemaakt',
'old_price' => [
'name' => 'Oude prijs'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Zaktualizuj kategorię'
],
'new_option' => 'Nowa opcja',
'export' => 'Eksport'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'i powyżej',
'and_below' => 'i poniżej',
'clear_all' => 'Wyczyść wszystko',
'balances' => 'Salda',
'packages' => 'Pakiety',
'dopings' => 'Dopingi',
'advs' => 'Advs',
'site' => 'Teren',
'subscription' => 'Subskrypcja',
'created' => 'Utworzony',
'old_price' => [
'name' => 'Stara cena'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Atualizar categoria'
],
'new_option' => 'Nova Opção',
'export' => 'Exportar'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'e acima',
'and_below' => 'e abaixo',
'clear_all' => 'Limpar tudo',
'balances' => 'Saldos',
'packages' => 'Pacotes',
'dopings' => 'Dopings',
'advs' => 'Advs',
'site' => 'Local',
'subscription' => 'Inscrição',
'created' => 'Criado',
'old_price' => [
'name' => 'Preço antigo'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Actualizare categorie'
],
'new_option' => 'Opțiune nouă',
'export' => 'Export'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'Si mai sus',
'and_below' => 'si sub',
'clear_all' => 'Curata tot',
'balances' => 'Solduri',
'packages' => 'Pachete',
'dopings' => 'Dopaje',
'advs' => 'Sfaturi',
'site' => 'Site',
'subscription' => 'Abonament',
'created' => 'Creată',
'old_price' => [
'name' => 'Preț vechi'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Обновить категорию'
],
'new_option' => 'Новый вариант',
'export' => 'Экспорт'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'и выше',
'and_below' => 'и ниже',
'clear_all' => 'Очистить все',
'balances' => 'Балансы',
'packages' => 'Пакеты',
'dopings' => 'Допинг',
'advs' => 'Advs',
'site' => 'Сайт',
'subscription' => 'Подписка',
'created' => 'Создано',
'old_price' => [
'name' => 'Старая цена'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Kategoria Azhornimeve'
],
'new_option' => 'Opsioni i ri',
'export' => 'Eksporto'
];

View File

@ -307,4 +307,14 @@ return [
'and_above' => 'dhe më lart',
'and_below' => 'dhe më poshtë',
'clear_all' => 'Pastroji të gjitha',
'balances' => 'Bilancet',
'packages' => 'Paketat',
'dopings' => 'Dopingët',
'advs' => 'Adv',
'site' => 'Faqen',
'subscription' => 'Abonim',
'created' => 'Krijuar',
'old_price' => [
'name' => 'Çmimi i Vjetër'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Uppdatera kategori'
],
'new_option' => 'Nytt alternativ',
'export' => 'Exportera'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'och ovan',
'and_below' => 'och under',
'clear_all' => 'Rensa alla',
'balances' => 'Balanser',
'packages' => 'Paket',
'dopings' => 'Dopings',
'advs' => 'Adv',
'site' => 'Webbplats',
'subscription' => 'Prenumeration',
'created' => 'Skapad',
'old_price' => [
'name' => 'Gammalt pris'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Kategori Güncelle'
],
'new_option' => 'Yeni Seçenek',
'export' => 'İhracat'
];

View File

@ -150,7 +150,7 @@ return [
'search_desc' => 'Burada favori arama seçimlerinizi ekleyebilir ve yönetebilirsiniz.',
'complaint_placeholder' => 'Şikayet ayrıntılarınızı buraya yazın.',
'show_details' => 'Detayları göster',
'ad_actions' => 'Reklam İşlemleri',
'ad_actions' => 'İlan İşlemleri',
'edit' => 'Düzenle',
'approve' => 'Onayla',
'passive' => "Pasif",
@ -275,11 +275,11 @@ return [
"were_found" => 'bulundular.',
// Pending screen
'pending_message_1' => 'Reklam Onay Sürecinde',
'pending_message_2' => "Reklamın Güncelleme Tarihi",
'pending_message_1' => 'İlan Onay Sürecinde',
'pending_message_2' => "İlan Güncelleme Tarihi",
'pending_message_3' => 'Tahmini Bekleme Süresi',
'pending_message_4' => 'Onay sürecinde geçirilen süre doping zamanına eklenecektir.',
'pending_message_5' => 'Onay sürecinde reklamla ilgili çağrı merkezinden hiçbir işlem yapılamaz.',
'pending_message_5' => 'Onay sürecinde ilanla ilgili çağrı merkezinden hiçbir işlem yapılamaz.',
'hours' => 'saatler',
// Preview page
@ -308,4 +308,14 @@ return [
'and_above' => 've yukarıda',
'and_below' => 've aşağıda',
'clear_all' => 'Hepsini temizle',
'balances' => 'Bakiyeler',
'packages' => 'Paketler',
'dopings' => 'Dopingler',
'advs' => 'Advs',
'site' => 'Site',
'subscription' => 'Abonelik',
'created' => 'Oluşturuldu',
'old_price' => [
'name' => 'Eski fiyat'
],
];

View File

@ -23,6 +23,6 @@ return [
'choose_user' => 'Bir kullanıcı seçin',
'owner_updated_successfully' => 'Sahibi Başarıyla Güncellenmiştir!',
'no_add_found' => 'İlan Bulunamadı!',
'replicated_success' => 'Reklam başarıyla kopyalandı!',
'ad_doesnt_exist' => "Bu reklam mevcut değil!",
'replicated_success' => 'İlan başarıyla kopyalandı!',
'ad_doesnt_exist' => "Bu İlan mevcut değil!",
];

View File

@ -44,5 +44,5 @@ return [
'options' => [
'title' => 'Seçenekler',
],
'ads_image' => 'Reklam Resmi',
'ads_image' => 'İlan Resmi',
];

View File

@ -9,7 +9,7 @@ return [
],
'hide_zero_price' => [
'name' => 'Sıfır ise Fiyatı Gizle',
'instructions' => 'Reklam fiyatı 0 ise fiyatı gizle',
'instructions' => 'İlan fiyatı 0 ise fiyatı gizle',
],
'estimated_pending_time' => [
'name' => 'Tahmini Bekleme Süresi',
@ -129,7 +129,7 @@ return [
'name' => 'TCMB Exchange URL\'si',
],
'popular_ads_limit' => [
'name' => 'Popüler Reklam Limiti',
'name' => 'Popüler İlan Limiti',
],
//Image

View File

@ -32,4 +32,5 @@ return [
'name' => 'Оновити категорію'
],
'new_option' => 'Нова опція',
'export' => 'Експорт'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'і вище',
'and_below' => 'і нижче',
'clear_all' => 'Очистити все',
'balances' => 'Баланси',
'packages' => 'Пакети',
'dopings' => 'Допінг',
'advs' => 'Advs',
'site' => 'Сайт',
'subscription' => 'Передплата',
'created' => 'Створено',
'old_price' => [
'name' => 'Стара ціна'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'زمرہ اپ ڈیٹ کریں'
],
'new_option' => 'نیا آپشن',
'export' => 'برآمد کریں'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'اور اوپر',
'and_below' => 'اور نیچے',
'clear_all' => 'تمام کو صاف کریں',
'balances' => 'توازن',
'packages' => 'پیکیجز',
'dopings' => 'ڈوپنگز',
'advs' => 'ایڈز',
'site' => 'سائٹ',
'subscription' => 'سب سکریپشن',
'created' => 'بنائی گئی',
'old_price' => [
'name' => 'پرانی قیمت'
],
];

View File

@ -32,4 +32,5 @@ return [
'name' => 'Cập nhật danh mục'
],
'new_option' => 'Tùy chọn mới',
'export' => 'Xuất khẩu'
];

View File

@ -306,4 +306,14 @@ return [
'and_above' => 'trở lên',
'and_below' => 'và dưới đây',
'clear_all' => 'Làm sạch tất cả',
'balances' => 'Cân bằng',
'packages' => 'Các gói',
'dopings' => 'Liều lượng',
'advs' => 'Lời khuyên',
'site' => 'Địa điểm',
'subscription' => 'Đăng ký',
'created' => 'Tạo',
'old_price' => [
'name' => 'Giá cũ'
],
];

View File

@ -1,7 +1,7 @@
<div class="slider-text">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row">
{% set standardPrice = adv.standard_price.value %}
{% if standardPrice %}
{% if standardPrice and standardPrice > 0 %}
<div class="d-flex flex-wrap align-items-center">
<h3 class="ad-price-standard mr-3 text-truncate">
<b>{{ adv.standard_price.currency(null,'currency') }}</b>

View File

@ -58,33 +58,33 @@
{{ form.fields.slug|raw }}
</div>
</div>
<div class="col-12 standard-price-hidden d-none">
{{ form.fields.standard_price.setAttributes({
'required' :true,
}).input|raw }}
</div>
{% if setting_value('visiosoft.module.advs::market_place') %}
{{ addBlock('new-ad/fields', {'adv': adv})|raw }}
<div class="row form-group select-price{{ setting_value('visiosoft.module.advs::hide_standard_price_field') ? ' d-none' }}">
<label class="col-sm-2 col-xs-12">
{{ form.fields.standard_price.label|raw }}
<span class="required">*</span>
</label>
{% set standardPriceValue = form.fields.standard_price.value|split('.') %}
<div class="col-8 pr-0 col-md-3">
<input class="form-control standard-price-field whole-price"
value="{{ standardPriceValue|first }}">
</div>
<div class="col-4 col-md-1">
<input class="form-control standard-price-decimal-field decimal-price"
placeholder="00" maxlength="2"
value="{{ standardPriceValue[1] }}">
</div>
</div>
{% endif %}
<div class="row form-group select-price
{{ setting_value('visiosoft.module.advs::hide_standard_price_field') ? ' d-none' }}
{{ setting_value('visiosoft.module.advs::market_place') != true ? 'd-none' }}">
<label class="col-sm-2 col-xs-12">
{{ form.fields.standard_price.label|raw }}
<span class="required">*</span>
</label>
<div class="col-12 standard-price-hidden d-none">
{{ form.fields.standard_price.setAttributes({
'required' :true
}).input|raw }}
</div>
{% set standardPriceValue = form.fields.standard_price.value|split('.') %}
<div class="col-8 pr-0 col-md-3">
<input class="form-control standard-price-field whole-price"
value="{{ standardPriceValue|first }}">
</div>
<div class="col-4 col-md-1">
<input class="form-control standard-price-decimal-field decimal-price"
placeholder="00" maxlength="2"
value="{{ standardPriceValue[1] }}">
</div>
</div>
<div class="row form-group select-price">
<label class="col-sm-2 col-xs-12">

View File

@ -13,6 +13,8 @@ use Visiosoft\LocationModule\Country\CountryModel;
use Visiosoft\CartsModule\Cart\Command\GetCart;
use Visiosoft\LocationModule\District\DistrictModel;
use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel;
use Visiosoft\LocationModule\Village\Contract\VillageRepositoryInterface;
use Visiosoft\LocationModule\Village\VillageModel;
class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
{
@ -67,9 +69,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
return $query->where('advs_advs.slug', '!=', "");
}
public function userAdv($nullable_ad = false)
public function userAdv($nullable_ad = false, $checkRole = true)
{
if (Auth::user()->hasRole('admin')) {
if (Auth::user()->hasRole('admin') && $checkRole) {
return $this->getAdv(null, $nullable_ad);
} else {
return $this->getAdv(null, $nullable_ad)
@ -373,6 +375,12 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
return $neighborhood ? $neighborhood->name : false;
}
public function getVillage()
{
$village = app(VillageRepositoryInterface::class)->find($this->village);
return $village ? $village->name : false;
}
public function expired()
{
return $this->finish_at ? $this->finish_at < Carbon::now() : true;

View File

@ -451,4 +451,26 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
public function getName($id){
return $this->find($id)->name;
}
public function approveAds($adsIDs)
{
$defaultAdPublishTime = setting_value('visiosoft.module.advs::default_published_time');
$ads = $this->newQuery()->whereIn('advs_advs.id', $adsIDs)->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')
]);
return $ads;
}
public function getUserAds($userID = null)
{
$userID = auth_id_if_null($userID);
return $this->newQuery()
->where('advs_advs.created_by_id', $userID)
->where('status', 'approved')
->where('finish_at', '>', date('Y-m-d H:i:s'))
->get();
}
}

View File

@ -0,0 +1,18 @@
<?php namespace Visiosoft\AdvsModule\Adv\Command;
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
class GetUserAds
{
protected $userID;
public function __construct($userID)
{
$this->userID = $userID;
}
public function handle(AdvRepositoryInterface $advRepository)
{
return $advRepository->getUserAds($this->userID);
}
}

View File

@ -4,6 +4,82 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
interface AdvInterface extends EntryInterface
{
public function is_enabled($slug);
public function is_enabled_extension($slug);
public function is_active($id);
public function getAdv($id = null, $nullable_ad = false, $trashed = false);
public function userAdv($nullable_ad = false, $checkRole = true);
public function getAdvByCat($cat_id);
public function pendingAdvsByUser();
public function favsAdvsByUser($fav_ids);
public function myAdvsByUser();
public function foreignCurrency($currency, $price, $isUpdate, $settings);
public function popularAdvs();
public function advsofDay();
public function statusAds($id, $status);
public function finish_at_Ads($id, $endDate);
public function publish_at_Ads($id);
public function getLastUserAdv();
public function getLocationNames($advs);
public function isAdv($id);
public function addCart($item, $quantity = 1, $name = null);
public function getAdvDetailLinkByModel($object, $type = null);
public function getAdvDetailLinkByAdId($id);
public function getAdvimage($id);
public function getLatestField($slug);
public function updateStock($id, $quantity);
public function stockControl($id, $quantity);
public function saveCustomField($category_id, $field_id, $name);
public function customfields();
public function priceFormat($adv);
public function AddAdsDefaultCoverImage($ad);
public function GetAdsDefaultCoverImageByAdId($id);
public function viewed_Ad($id);
public function getRecommended($id);
public function authControl();
public function inStock();
public function getCity();
public function getDistrict();
public function getNeighborhood();
public function getVillage();
public function expired();
public function getProductOptionsValues();

View File

@ -46,4 +46,8 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface
public function getPopular();
public function getName($id);
public function approveAds($adsIDs);
public function getUserAds($userID = null);
}

View File

@ -7,9 +7,9 @@ use Visiosoft\AdvsModule\Adv\Command\appendRequestURL;
use Visiosoft\AdvsModule\Adv\Command\GetAd;
use Visiosoft\AdvsModule\Adv\Command\getExchange;
use Visiosoft\AdvsModule\Adv\Command\getPopular;
use Visiosoft\AdvsModule\Adv\Command\GetUserAds;
use Visiosoft\AdvsModule\Adv\Command\isActive;
use Visiosoft\AdvsModule\Adv\Command\LatestAds;
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
use Visiosoft\AdvsModule\Currency\Currency;
use Visiosoft\AdvsModule\Currency\CurrencyFormat;
@ -78,6 +78,12 @@ class AdvsModulePlugin extends Plugin
->get();
}
),
new \Twig_SimpleFunction(
'getUserAds',
function ($userID = null) {
return $this->dispatch(new GetUserAds($userID));
}
),
new \Twig_SimpleFunction(
'getUserPassiveAdvs',
function ($user = null) {

View File

@ -270,15 +270,6 @@ class AdvsController extends PublicController
if ($categoryId) {
$seo_keywords = $this->category_model->getMeta_keywords($categoryId->id);
$seo_description = $this->category_model->getMeta_description($categoryId->id);
$seo_title = $this->category_model->getMeta_title($categoryId->id);
$this->template->set('og_description', $seo_description);
$this->template->set('meta_description', $seo_description);
$this->template->set('meta_title', $seo_title);
$this->template->set('meta_keywords', implode(', ', $seo_keywords));
$mainCats = $this->category_model->getMains($categoryId->id);
$current_cat = $this->category_model->getCat($categoryId->id);
$mainCats[] = [
@ -385,13 +376,36 @@ class AdvsController extends PublicController
$viewType = $this->requestHttp->cookie('viewType');
list('catText' => $catText, 'user' => $user) = $this->handleSeo($categoryId, $mainCats, $cityId);
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'param',
'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges',
'seenList', 'radio', 'categoryId', 'cityId', 'allCats', 'catText', 'cFArray');
return $this->viewTypeBasedRedirect($viewType, $compact);
}
private function handleSeo($category, $mainCats, $city)
{
$showTitle = true;
$metaTitle = '';
$catText = '';
if (!$allCats) {
if (count($mainCats) == 1 || count($mainCats) == 2) {
if ($category) {
$seo_keywords = $this->category_model->getMeta_keywords($category->id);
$seo_description = $this->category_model->getMeta_description($category->id);
$seo_title = $this->category_model->getMeta_title($category->id);
$this->template->set('og_description', $seo_description);
$this->template->set('meta_description', $seo_description);
$this->template->set('meta_keywords', implode(', ', $seo_keywords));
if ($city) {
$catText = "$city->name $catText";
} elseif (count($mainCats) == 1 || count($mainCats) == 2) {
$catText = end($mainCats)['val'];
} elseif (count($mainCats) > 2) {
$catArray = array_slice($mainCats, 2);
$catText = '';
$loop = 0;
foreach ($catArray as $cat) {
$catText = !$loop ? $catText . $cat['val'] : $catText . ' ' . $cat['val'];
@ -399,26 +413,29 @@ class AdvsController extends PublicController
}
}
if ($cityId) {
$catText = "$cityId->name $catText";
}
$this->template->set('showTitle', false);
$this->template->set('meta_title', $catText);
$showTitle = false;
$metaTitle = $catText ?: $seo_title;
}
$user = null;
if (!empty($param['user'])) {
$user = $this->userRepository->find($param['user']);
$this->template->set('showTitle', false);
$this->template->set('meta_title', $user->name() . ' ' . trans('visiosoft.module.advs::field.ads'));
if (\request()->user) {
$user = $this->userRepository->find(\request()->user);
$showTitle = false;
$metaTitle = $user->name() . ' ' . trans('visiosoft.module.advs::field.ads');
}
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'param',
'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges',
'seenList', 'radio', 'categoryId', 'cityId', 'allCats', 'catText', 'cFArray');
$this->template->set('showTitle', $showTitle);
$this->template->set('meta_title', $metaTitle);
return $this->viewTypeBasedRedirect($viewType, $compact);
// Set rel="canonical"
if (\request()->sort_by || \request()->doping) {
$canonParam = \request()->all();
unset($canonParam['sort_by'], $canonParam['doping']);
$canonUrl = fullLink($canonParam, \request()->url());
$this->template->set('additional_meta', "<link rel='canonical' href='$canonUrl'/>");
}
return compact('catText', 'user');
}
public function viewTypeBasedRedirect($viewType, $compact)
@ -449,7 +466,7 @@ class AdvsController extends PublicController
$adv = $this->adv_repository->getListItemAdv($id);
if ($adv && !$adv->expired()) {
if ($adv && (!$adv->expired() || $adv->created_by_id === \auth()->id())) {
if ($this->adv_model->is_enabled('complaints')) {
$complaints = ComplaintsComplainTypesEntryModel::all();
@ -516,7 +533,14 @@ class AdvsController extends PublicController
$coverPhoto = \Illuminate\Support\Facades\Request::root() . '/' . $adv->cover_photo;
}
}
$this->template->set('meta_image', $coverPhoto);
$coverPhotoInfo = pathinfo($coverPhoto);
if (substr($coverPhotoInfo['basename'], 0, 3) === "tn-") {
$ogImage = substr(basename($coverPhotoInfo['basename']), 3);
$ogImage = $coverPhotoInfo['dirname'] . "/$ogImage";
} else {
$ogImage = $coverPhoto;
}
$this->template->set('meta_image', $ogImage);
$configurations = $this->optionConfigurationRepository->getConf($adv->id);
@ -661,8 +685,7 @@ class AdvsController extends PublicController
CategoryRepositoryInterface $categoryRepository,
Dispatcher $events,
AdvModel $advModel,
AdressRepositoryInterface $address,
CategoryModel $categoryModel
AdressRepositoryInterface $address
)
{
if (!Auth::user()) {
@ -677,10 +700,21 @@ class AdvsController extends PublicController
/* Update Adv */
$adv = AdvsAdvsEntryModel::find($request->update_id);
//Set Old Price
$old_price = ($adv->slug == "") ? $request->price : $adv->price;
$adv->old_price = $old_price;
$allowPendingAdCreation = false;
if ($advModel->is_enabled('packages') and $adv->slug == "") {
$cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request);
if (!is_null($cat)) {
return redirect('/');
if (array_key_exists('allowPendingAds', $cat)) {
$allowPendingAdCreation = $cat['allowPendingAds'];
} else {
return redirect($cat['redirect']);
}
}
}
@ -735,7 +769,7 @@ class AdvsController extends PublicController
}
// Auto approve
if (setting_value('visiosoft.module.advs::auto_approve')) {
if (setting_value('visiosoft.module.advs::auto_approve') && !$allowPendingAdCreation) {
$defaultAdPublishTime = setting_value('visiosoft.module.advs::default_published_time');
$adv->update([
'status' => 'approved',
@ -780,7 +814,11 @@ class AdvsController extends PublicController
return redirect('/advs/edit_advs/' . $request->update_id)->with('cats_d', $cats_d)->with('request', $request);
}
event(new CreatedAd($adv));
return redirect(route('advs_preview', [$request->update_id]));
if ($allowPendingAdCreation) {
return redirect(route("visiosoft.module.packages::buy_package") . '?ad_id=' . $adv->id);
} else {
return redirect(route('advs_preview', [$request->update_id]));
}
}
/* New Create Adv */

View File

@ -71,20 +71,4 @@ return [
'style' => [
'type' => 'anomaly.field_type.editor',
],
'default_country' => [
'bind' => 'visiosoft.theme.base::countries.enabled',
'env' => 'ADV_ENABLED_COUNTRIES',
'type' => 'anomaly.field_type.select',
'required' => false,
'config' => [
'default_value' => function () {
return config('visiosoft.theme.base::countries.default');
},
'options' => function () {
$array = CountryModel::query()->get()->pluck('name', 'abv')->toArray();
return $array;
},
],
],
];

View File

@ -1,5 +1,6 @@
function phoneMask(fields) {
var country = document.getElementById('country').innerText;
var country = document.getElementById('default-phone-country')
? document.getElementById('default-phone-country').innerText : null;
var inputQueries = document.querySelectorAll(fields);
inputQueries.forEach(function (inputQuery, key) {
var iti = intlTelInput(inputQuery, {

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'حد الفئات الفرعية للصفحة الرئيسية',
],
'default_country' => [
'name' => 'صفحة التسجيل ، البلد الافتراضي للهاتف',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Əsas alt kateqoriyalar məhdudiyyəti',
],
'default_country' => [
'name' => 'Qeydiyyat səhifəsi, telefon üçün standart ölkə',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'হোমপেজ সাব বিভাগের সীমা',
],
'default_country' => [
'name' => 'ফোনের জন্য পৃষ্ঠা, ডিফল্ট দেশ নিবন্ধ করুন',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Homepage Unterkategorien Limit',
],
'default_country' => [
'name' => 'Registrierungsseite, Standardland für Telefon',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Όριο υποκατηγοριών αρχικής σελίδας',
],
'default_country' => [
'name' => 'Σελίδα εγγραφής, προεπιλεγμένη χώρα για τηλέφωνο',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Límite de subcategorías de la página de inicio',
],
'default_country' => [
'name' => 'Página de registro, país predeterminado para el teléfono',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'زیرمجموعه ها',
],
'default_country' => [
'name' => 'صفحه ثبت نام ، کشور پیش فرض تلفن',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Limite des sous-catégories de la page d\'accueil',
],
'default_country' => [
'name' => 'Page d\'enregistrement, pays par défaut pour le téléphone',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'מגבלת קטגוריות המשנה לדף הבית',
],
'default_country' => [
'name' => 'דף הרשמה, ארץ ברירת המחדל לטלפון',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'मुखपृष्ठ उप श्रेणियाँ श्रेणियाँ सीमा',
],
'default_country' => [
'name' => 'रजिस्टर पेज, फोन के लिए डिफ़ॉल्ट देश',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Limite delle sottocategorie della home page',
],
'default_country' => [
'name' => 'Pagina di registrazione, paese predefinito per il telefono',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'ホームページのサブカテゴリの制限',
],
'default_country' => [
'name' => '登録ページ、電話のデフォルトの国',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => '홈페이지 하위 카테고리 제한',
],
'default_country' => [
'name' => '등록 페이지, 전화의 기본 국가',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Limiet subcategorieën op homepage',
],
'default_country' => [
'name' => 'Registratiepagina, standaardland voor telefoon',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Limit podkategorii strony głównej',
],
'default_country' => [
'name' => 'Strona rejestracji, domyślny kraj dla telefonu',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Limite de subcategorias da página inicial',
],
'default_country' => [
'name' => 'Página de registro, país padrão para telefone',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Limita de subcategorii pentru pagina principală',
],
'default_country' => [
'name' => 'Pagina de înregistrare, țara implicită pentru telefon',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Ограничение подкатегорий домашней страницы',
],
'default_country' => [
'name' => 'Страница регистрации, страна по умолчанию для телефона',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Nënkategoritë e faqes kryesore Kufiri',
],
'default_country' => [
'name' => 'Faqja e regjistrimit, vendi i paracaktuar për telefon',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Hemsida Underkategorier Begränsning',
],
'default_country' => [
'name' => 'Registrera sida, standardland för telefon',
]
];

View File

@ -27,9 +27,9 @@ return [
// Registration instructions
'personal_registration_header' => 'Bireysel Üyelik Avantajları Nelerdir?',
'personal_registration_body' => 'Evinizi, arabanızı satmak ve kiralamak, kullanılmayan eşyalarınızı satmak, yenilerini almak.',
'personal_registration_list_1' => 'Ücretsiz bir reklam gönderin,',
'personal_registration_list_2' => 'İlgilendiğiniz reklamları ekleyin, favorilerinize ekledikten sonra fiyat değişikliklerini takip edin, kriterlerinize uygun favori aramalar oluşturun,',
'personal_registration_list_3' => 'Sitedeki reklam sahiplerine mesaj gönderin.',
'personal_registration_list_1' => 'Ücretsiz bir İlan gönderin,',
'personal_registration_list_2' => 'İlgilendiğiniz ilanları ekleyin, favorilerinize ekledikten sonra fiyat değişikliklerini takip edin, kriterlerinize uygun favori aramalar oluşturun,',
'personal_registration_list_3' => 'Sitedeki İlan sahiplerine mesaj gönderin.',
'register_information_note' => 'Bu sayfadaki bilgiler ' . env('APPLICATION_DOMAIN') . ' üyelik. Kişisel verilerin korunması hakkında ayrıntılı bilgiyi burada bulabilirsiniz.',
// Register page
@ -45,7 +45,7 @@ return [
// Side menu links
'company_directory' => 'Firma Rehberi',
'popular_ads' => 'popüler reklamlar',
'popular_ads' => 'Popüler İlanlar',
'last_48_hours' => 'son 48 saat',
'secure_e-commerce_ads' => 'güvenli e-ticaret',
'sms' => 'Kısa Mesaj Gönder (SMS)',

View File

@ -20,10 +20,10 @@ return [
'name' => 'Breadcrumb',
],
'ad_details' => [
'name' => 'Reklam Ayrıntıları',
'name' => 'İlan Ayrıntıları',
],
'ad_details_tab' => [
'name' => 'Reklam Ayrıntıları Sekmesi',
'name' => 'İlan Ayrıntıları Sekmesi',
],
'latest_and_view_all_btn' => [
'name' => 'Tümünü Görüntüle',
@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Ana Sayfa Alt Kategoriler Sınırı',
],
'default_country' => [
'name' => 'Kayıt sayfası, telefon için varsayılan ülke',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Підкатегорії домашньої сторінки Обмеження',
],
'default_country' => [
'name' => 'Сторінка реєстрації, країна за замовчуванням для телефону',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'مرکزی صفحہ ذیلی زمرے کی حد',
],
'default_country' => [
'name' => 'صفحہ کیلئے رجسٹر ، فون کے لئے پہلے سے طے شدہ ملک',
]
];

View File

@ -40,4 +40,7 @@ return [
'home_page_sub_categories_limit' => [
'name' => 'Giới hạn danh mục phụ của trang chủ',
],
'default_country' => [
'name' => 'Trang đăng ký, quốc gia mặc định cho điện thoại',
]
];

View File

@ -56,7 +56,7 @@
<div class="input-wrapper validate-phone">
{{ form.fields.phone.setValue(form.fields.phone.value).input|raw }}
<div id="country" class="hidden">{{ setting_value('visiosoft.theme.base::default_country') }}</div>
<div id="default-phone-country" class="hidden">{{ setting_value('visiosoft.module.location::country_for_phone_field') }}</div>
</div>
</div>
</div>

View File

@ -9,6 +9,9 @@
{{ setting_value('visiosoft.module.advs::google_statistic_code')|raw }}
<!-- Meta Tags -->
{% set additionalMeta = template.get('additional_meta') %}
{{ additionalMeta ? additionalMeta|raw }}
<title>
{% set title = trans(template.meta_title) %}
{% set showTitle = template.showTitle is same as(false) ? false : true %}

View File

@ -35,7 +35,7 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
public function mainCats()
{
return $this->model->where('parent_category_id', null)->where('deleted_at', null)->orderBy('sort_order')->get();
return $this->model->where('parent_category_id', null)->orderBy('sort_order')->get();
}
public function getItem($cat)

View File

@ -1,5 +1,5 @@
<?php
return [
'view_ads' => 'Reklamlara göz at',
'view_ads' => 'İlanlara göz at',
];

View File

@ -7,7 +7,7 @@ return [
'general' => [
'title' => 'visiosoft.module.location::section.general',
'fields' => [
'home_page_location', 'list_page_location', 'detail_page_location', 'create_ad_page_location',
'home_page_location', 'list_page_location', 'detail_page_location', 'create_ad_page_location', 'country_for_phone_field'
],
],
'map' => [

View File

@ -33,6 +33,19 @@ return [
'default_value' => 212,
]
],
'country_for_phone_field' => [
'type' => 'anomaly.field_type.select',
'required' => false,
'config' => [
'default_value' => function () {
return config('visiosoft.theme.base::countries.default');
},
'options' => function () {
$array = \Visiosoft\LocationModule\Country\CountryModel::query()->get()->pluck('name', 'abv')->toArray();
return $array;
},
],
],
'default_city' => [
'type' => 'anomaly.field_type.select',
],

View File

@ -44,4 +44,7 @@ return [
'hide_location_filter' => [
'name' => 'إخفاء عامل تصفية الموقع',
],
'country_for_phone_field' => [
'name' => 'البلد الافتراضي لتسجيل حقل الهاتف'
]
];

View File

@ -44,4 +44,7 @@ return [
'hide_location_filter' => [
'name' => 'Yer filtrini gizlət',
],
'country_for_phone_field' => [
'name' => 'Telefon sahəsi üçün qeydiyyatdan keçmiş ölkə'
]
];

View File

@ -44,4 +44,7 @@ return [
'hide_location_filter' => [
'name' => 'অবস্থান ফিল্টার লুকান',
],
'country_for_phone_field' => [
'name' => 'রেজিস্টার ফোন ফিল্ডের জন্য ডিফল্ট দেশ'
]
];

Some files were not shown because too many files have changed in this diff Show More