mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
commit
586595e43c
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||
|
||||
class VisiosoftModuleAdvsCreateShowPhoneNumberField extends Migration
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
//Maria DB will be removed when the version is updated.
|
||||
\Illuminate\Support\Facades\DB::getDoctrineSchemaManager()
|
||||
->getDatabasePlatform()->registerDoctrineTypeMapping('point', 'string');
|
||||
}
|
||||
|
||||
protected $delete = false;
|
||||
|
||||
protected $stream = [
|
||||
'slug' => 'advs',
|
||||
];
|
||||
|
||||
protected $fields = [
|
||||
'show_phone_number' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => true,
|
||||
'mode' => 'checkbox',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
protected $assignments = [
|
||||
'show_phone_number'
|
||||
];
|
||||
}
|
||||
@ -337,6 +337,9 @@ return [
|
||||
'owner' => 'Owner',
|
||||
'default_owner_instruction' => 'The owner will default to the current user if no user is selected',
|
||||
'create_page_subtitle' => 'Create the ad flawlessly by entering detailed information about your ad.',
|
||||
'with_my_phone_numbers' => 'With my phone numbers',
|
||||
'not_with_my_phone_numbers' => "I don't want to be reached by phone",
|
||||
'how_can_you_be_contacted' => "How can you be contacted?",
|
||||
|
||||
// Listing page
|
||||
'ad_title' => 'Ad title',
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<div id="contactInfo" class="mb-3">
|
||||
<h3>{{ trans('visiosoft.module.advs::field.contact_info') }}</h3>
|
||||
{# TODO Add an option to show or hide phone number #}
|
||||
{# <div id="reachInfo">#}
|
||||
{# <p>Size nasıl ulaşılsın?</p>#}
|
||||
{# <div>#}
|
||||
{# <label class="mr-3">#}
|
||||
{# <input type="radio" class="mr-1" checked>#}
|
||||
{# Telefon numaralarım ile#}
|
||||
{# </label>#}
|
||||
{# <label>#}
|
||||
{# <input type="radio" class="mr-1">#}
|
||||
{# Telefonla ulaşılmak istemiyorum#}
|
||||
{# </label>#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
<div id="reachInfo">
|
||||
{% set showPhoneNumber = form.fields.show_phone_number.value %}
|
||||
<p>{{ trans('visiosoft.module.advs::field.how_can_you_be_contacted') }}</p>
|
||||
<div>
|
||||
<label class="mr-3">
|
||||
<input type="radio" class="mr-1" name="show_phone_number" value="1" {{ showPhoneNumber ? 'checked' }}>
|
||||
{{ trans('visiosoft.module.advs::field.with_my_phone_numbers') }}
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" class="mr-1" name="show_phone_number" value="0" {{ not showPhoneNumber ? 'checked' }}>
|
||||
{{ trans('visiosoft.module.advs::field.not_with_my_phone_numbers') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="contactSummary" class="d-flex justify-content-between flex-wrap">
|
||||
<label>
|
||||
{{ trans('visiosoft.module.profile::field.name.name') }}
|
||||
|
||||
@ -14,10 +14,25 @@ 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
|
||||
{
|
||||
public function getTransNameAttribute()
|
||||
{
|
||||
if (is_null($this->name)) {
|
||||
$ad = DB::table('advs_advs')
|
||||
->join('advs_advs_translations', 'advs_advs.id', '=', 'entry_id')
|
||||
->select('name')
|
||||
->where('advs_advs.id', $this->id)
|
||||
->whereNotNull('name')
|
||||
->first();
|
||||
|
||||
return $ad ? $ad->name : '-';
|
||||
}
|
||||
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function is_enabled($slug)
|
||||
{
|
||||
if ($addon = app('module.collection')->get($slug)) {
|
||||
|
||||
@ -4,6 +4,8 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||
|
||||
interface AdvInterface extends EntryInterface
|
||||
{
|
||||
public function getTransNameAttribute();
|
||||
|
||||
public function is_enabled($slug);
|
||||
|
||||
public function is_enabled_extension($slug);
|
||||
|
||||
@ -82,7 +82,8 @@ class AdvFormBuilder extends FormBuilder
|
||||
'doc_files',
|
||||
'popular_adv',
|
||||
'adv_day',
|
||||
'product_options_value'
|
||||
'product_options_value',
|
||||
'show_phone_number'
|
||||
];
|
||||
|
||||
if (setting_value('visiosoft.module.advs::show_finish_and_publish_date')) {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
{% else %}
|
||||
{% set showTheme = true %}
|
||||
{% endif %}
|
||||
{% if showTheme %}
|
||||
{% if showTheme and params.adv.show_phone_number.value %}
|
||||
{% set user = params.adv.created_by %}
|
||||
{% if user.gsm_phone is not null %}
|
||||
<div class="col-md-12 m-2 number-container">
|
||||
|
||||
@ -33,7 +33,7 @@ class SignInFormHandler
|
||||
(strpos(session('url')['intended'], 'admin') !== false) ? request()->session()->flush() : '';
|
||||
}
|
||||
|
||||
$authenticator->login($user, $builder->getFormValue('remember_me'));
|
||||
$authenticator->login($user, !!$builder->getFormValue('remember_me'));
|
||||
|
||||
$builder->setFormResponse($redirect->intended($builder->getFormOption('redirect', '/')));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user