mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
commit
8bc495aee5
@ -10,6 +10,11 @@
|
||||
aria-controls="nav-description"
|
||||
aria-selected="true">{{ trans('visiosoft.module.advs::field.description') }}</a>
|
||||
|
||||
<a class="nav-item nav-link bg-secondary text-white" id="nav-location-tab"
|
||||
data-toggle="tab" href="#nav-location" role="tab"
|
||||
aria-controls="nav-location"
|
||||
aria-selected="true">{{ trans('visiosoft.module.location::addon.title') }}</a>
|
||||
|
||||
<!-- Content Tab With Block -->
|
||||
{{ addBlock('ad-detail/content-tab',{'features':features})|raw }}
|
||||
<!-- Content Tab With Block -->
|
||||
@ -25,6 +30,12 @@
|
||||
<p>{{ adv.advs_desc|raw }}</p>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade show " id="nav-location" role="tabpanel"
|
||||
aria-labelledby="nav-description-tab">
|
||||
<h4>{{ trans('visiosoft.module.location::addon.title') }}</h4>
|
||||
{% include "visiosoft.module.advs::ad-detail/partials/map" %}
|
||||
</div>
|
||||
|
||||
<!-- Content With Block -->
|
||||
{{ addBlock('ad-detail/content',{'features':features,'adv':adv, 'profile': profile})|raw }}
|
||||
<!-- Content With Block -->
|
||||
|
||||
@ -1,29 +1,47 @@
|
||||
<p>
|
||||
{% if(adv.map_Val == "") %}
|
||||
{{ trans('visiosoft.module.advs::field.no_location') }}
|
||||
{{ trans('visiosoft.module.advs::field.no_location') }}
|
||||
{% else %}
|
||||
{% set map_arr = adv.map_Val|split(',') %}
|
||||
<div id="mapDiv" style="height: 500px; width: 100%; "></div>
|
||||
<script>
|
||||
var lat = parseFloat({{ map_arr[0] }});
|
||||
var lng = parseFloat({{ map_arr[1] }});
|
||||
var google_map_key = "{{ setting_value('visiosoft.module.location::google_map_key') }}";
|
||||
{% set map_arr = adv.map_Val|split(',') %}
|
||||
<div id="mapDiv" style="height: 500px; width: 100%; "></div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var no_image_text = "{{ trans('visiosoft.module.streetview::field.no_location') }}";
|
||||
|
||||
function initMap() {
|
||||
var myLatLng = {lat: lat, lng: lng};
|
||||
|
||||
var map = new google.maps.Map(document.getElementById('mapDiv'), {
|
||||
zoom: 16,
|
||||
center: myLatLng
|
||||
});
|
||||
new google.maps.Marker({
|
||||
position: myLatLng,
|
||||
map: map
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.location::google_map_key') }}&callback=initMap"
|
||||
type="text/javascript"></script>
|
||||
var ifAnyImg = "https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=" + coord[0] + "," + coord[1] +
|
||||
"&fov=90&heading=235&pitch=10&key=" + google_map_key;
|
||||
$.getJSON(ifAnyImg, function (data) {
|
||||
if (data.status === "OK") {
|
||||
loadScript('https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.location::google_map_key') }}&callback=initMap');
|
||||
}
|
||||
if (data.status === "ZERO_RESULTS") {
|
||||
$("#mapDiv").html(no_image_text);
|
||||
} else {
|
||||
$("#mapDiv").html("Google Error : " + data.error_message);
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var lat = parseFloat({{ map_arr[0] }});
|
||||
var lng = parseFloat({{ map_arr[1] }});
|
||||
var google_map_key = "{{ setting_value('visiosoft.module.location::google_map_key') }}";
|
||||
|
||||
{% endif %}
|
||||
function initMap() {
|
||||
var myLatLng = {lat: lat, lng: lng};
|
||||
|
||||
var map = new google.maps.Map(document.getElementById('mapDiv'), {
|
||||
zoom: 16,
|
||||
center: myLatLng
|
||||
});
|
||||
new google.maps.Marker({
|
||||
position: myLatLng,
|
||||
map: map
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
</p>
|
||||
@ -1,29 +1,35 @@
|
||||
// Personal Registration
|
||||
var inputQueries = document.querySelectorAll("input[name=\"phone\"],input[name='land_phone']");
|
||||
inputQueries.forEach(function (inputQuery, key) {
|
||||
var iti = intlTelInput(inputQuery, {
|
||||
hiddenInput: "full_phone_"+inputQuery.getAttribute('name'),
|
||||
class: "form-control",
|
||||
initialCountry: "auto",
|
||||
geoIpLookup: function (success, failure) {
|
||||
$.get("https://ipinfo.io", function () {
|
||||
}, "jsonp").always(function (resp) {
|
||||
var countryCode = (resp && resp.country) ? resp.country : "";
|
||||
success(countryCode);
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$("input[name='phone'],input[name='land_phone']").on('countrychange', function (e) {
|
||||
maskPhone($(this).attr('name'))
|
||||
});
|
||||
|
||||
function maskPhone(name) {
|
||||
var currentMask = $("input[name='" + name + "']").attr('placeholder');
|
||||
$("input[name='" + name + "']").mask(currentMask.replace(/[0-9+]/ig, '9'), {
|
||||
autoclear: true,
|
||||
clearIncomplete: true
|
||||
function phoneMask(fields) {
|
||||
var inputQueries = document.querySelectorAll(fields);
|
||||
inputQueries.forEach(function (inputQuery, key) {
|
||||
var iti = intlTelInput(inputQuery, {
|
||||
hiddenInput: inputQuery.getAttribute('name'),
|
||||
class: "form-control",
|
||||
initialCountry: "auto",
|
||||
geoIpLookup: function (success, failure) {
|
||||
$.get("https://ipinfo.io", function () {
|
||||
}, "jsonp").always(function (resp) {
|
||||
var countryCode = (resp && resp.country) ? resp.country : "";
|
||||
success(countryCode);
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var fields_arr = fields.split(',');
|
||||
$.each(fields_arr, function (index, value) {
|
||||
maskPhone($(value).attr('name'))
|
||||
});
|
||||
|
||||
|
||||
$(fields).on('countrychange', function (e) {
|
||||
maskPhone($(this).attr('name'))
|
||||
});
|
||||
|
||||
function maskPhone(name) {
|
||||
var currentMask = $("input[name='" + name + "']").attr('placeholder');
|
||||
$("input[name='" + name + "']").mask(currentMask.replace(/[0-9+]/ig, '9'), {
|
||||
autoclear: true,
|
||||
clearIncomplete: true
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
phoneMask("input[name='phone'],input[name='land_phone']");
|
||||
@ -67,7 +67,7 @@
|
||||
</label>
|
||||
|
||||
<div class="input-wrapper">
|
||||
{{ form.fields.phone.setValue(form.fields.full_phone.value).input|raw }}
|
||||
{{ form.fields.phone.setValue(form.fields.phone.value).input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -72,11 +72,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/intlTelInput.min.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/utils.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/phonefield.js") }}
|
||||
{{ asset_add("styles.css", "visiosoft.theme.base::css/intlTelInput.css") }}
|
||||
{{ asset_add("styles.css", "visiosoft.theme.base::css/register.css") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/register.js") }}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@ -9,6 +9,10 @@
|
||||
{{ asset_add("theme.js", "theme::js/select2.js") }}
|
||||
{{ asset_add("theme.js", "theme::js/params.js") }}
|
||||
{{ asset_add("theme.js", "theme::js/jquery.maskedinput.js") }}
|
||||
{{ asset_add("theme.js", "visiosoft.theme.base::js/intlTelInput.min.js") }}
|
||||
{{ asset_add("theme.js", "visiosoft.theme.base::js/utils.js") }}
|
||||
{{ asset_add("theme.js", "theme::js/phoneField.js") }}
|
||||
|
||||
|
||||
{# Theme Scripts #}
|
||||
{#{{ asset_add("theme.js", "theme::js/plugins/*") }}#}
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
{{ asset_add("theme.css", "theme::css/theme.css") }}
|
||||
{{ asset_add("theme.css", "theme::css/select2.css") }}
|
||||
{{ asset_add("theme.css", "theme::css/font-awesome.min.css") }}
|
||||
{{ asset_add("theme.css", "visiosoft.theme.base::css/intlTelInput.css") }}
|
||||
|
||||
<script src="{{ asset_path('theme::js/vendor/jquery.min.js') }}"></script>
|
||||
|
||||
{{ asset_style("theme.css") }}
|
||||
|
||||
@ -106,10 +106,13 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
|
||||
|
||||
$cats = $cats->leftJoin('cats_category_translations', function ($join) {
|
||||
$join->on('cats_category.id', '=', 'cats_category_translations.entry_id');
|
||||
$join->where('cats_category_translations.locale', '=', Request()->session()->get('_locale', setting_value('streams::default_locale')));
|
||||
$join->where('cats_category_translations.locale', config('app.locale'));//active lang
|
||||
$join->orWhere('cats_category_translations.locale', setting_value('streams::default_locale'));//system lang
|
||||
$join->orWhere('cats_category_translations.locale', 'en');//default lang
|
||||
$join->orWhereNull('cats_category_translations.locale');
|
||||
});
|
||||
$cats = $cats->select('cats_category.*', 'cats_category_translations.name as name');
|
||||
$cats = $cats->orderBy('id', 'DESC')
|
||||
$cats = $cats->orderBy('id', 'DESC')->groupBy(['cats_category.id'])
|
||||
->get();
|
||||
foreach ($cats as $cat) {
|
||||
$link = '';
|
||||
|
||||
@ -1,31 +1 @@
|
||||
// Personal Registration
|
||||
var inputQueries = document.querySelectorAll("input[name='adress_gsm_phone']");
|
||||
inputQueries.forEach(function (inputQuery, key) {
|
||||
var iti = intlTelInput(inputQuery, {
|
||||
hiddenInput: "full_phone_"+inputQuery.getAttribute('name'),
|
||||
class: "form-control",
|
||||
initialCountry: "auto",
|
||||
geoIpLookup: function (success, failure) {
|
||||
$.get("https://ipinfo.io", function () {
|
||||
}, "jsonp").always(function (resp) {
|
||||
var countryCode = (resp && resp.country) ? resp.country : "";
|
||||
success(countryCode);
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
maskPhone()
|
||||
|
||||
$("input[name='adress_gsm_phone']").on('countrychange', function (e) {
|
||||
maskPhone()
|
||||
});
|
||||
|
||||
function maskPhone(name) {
|
||||
var currentMask = $("input[name='adress_gsm_phone']").attr('placeholder');
|
||||
$("input[name='adress_gsm_phone']").mask(currentMask.replace(/[0-9+]/ig, '9'), {
|
||||
autoclear: true,
|
||||
clearIncomplete: true
|
||||
});
|
||||
|
||||
}
|
||||
phoneMask("input[name='adress_gsm_phone']")
|
||||
@ -1,32 +1 @@
|
||||
// Personal Registration
|
||||
var inputQueries = document.querySelectorAll("input[name='gsm_phone'],input[name='office_phone'],input[name='land_phone']");
|
||||
inputQueries.forEach(function (inputQuery, key) {
|
||||
var iti = intlTelInput(inputQuery, {
|
||||
hiddenInput: "full_phone_" + inputQuery.getAttribute('name'),
|
||||
class: "form-control",
|
||||
initialCountry: "auto",
|
||||
geoIpLookup: function (success, failure) {
|
||||
$.get("https://ipinfo.io", function () {
|
||||
}, "jsonp").always(function (resp) {
|
||||
var countryCode = (resp && resp.country) ? resp.country : "";
|
||||
success(countryCode);
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
maskPhone('gsm_phone')
|
||||
maskPhone('land_phone')
|
||||
maskPhone('office_phone')
|
||||
$("input[name='gsm_phone'],input[name='office_phone'],input[name='land_phone']").on('countrychange', function (e) {
|
||||
maskPhone($(this).attr('name'))
|
||||
});
|
||||
|
||||
function maskPhone(name) {
|
||||
var currentMask = $("input[name='" + name + "']").attr('placeholder');
|
||||
$("input[name='" + name + "']").mask(currentMask.replace(/[0-9+]/ig, '9'), {
|
||||
autoclear: true,
|
||||
clearIncomplete: true
|
||||
});
|
||||
|
||||
}
|
||||
phoneMask("input[name='gsm_phone'],input[name='office_phone'],input[name='land_phone']")
|
||||
@ -79,9 +79,6 @@
|
||||
</div>
|
||||
</div>
|
||||
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/country.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/intlTelInput.min.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/utils.js") }}
|
||||
{{ asset_add("styles.css", "visiosoft.theme.base::css/intlTelInput.css") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/address.js") }}
|
||||
|
||||
{% endblock %}
|
||||
@ -80,8 +80,5 @@
|
||||
</div>
|
||||
</div>
|
||||
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/country.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/intlTelInput.min.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/utils.js") }}
|
||||
{{ asset_add("styles.css", "visiosoft.theme.base::css/intlTelInput.css") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/address.js") }}
|
||||
{% endblock %}
|
||||
@ -176,9 +176,6 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/intlTelInput.min.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/utils.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/profile.js") }}
|
||||
{{ asset_add("styles.css", "visiosoft.theme.base::css/intlTelInput.css") }}
|
||||
{{ asset_add("styles.css", "visiosoft.module.profile::assets/css/profile.css") }}
|
||||
{% endblock %}
|
||||
@ -199,8 +199,7 @@ class MyProfileController extends PublicController
|
||||
|
||||
$New_value = $request->all();
|
||||
$New_value['country_id'] = $New_value['country'];
|
||||
$New_value['adress_gsm_phone'] = $New_value['full_phone_adress_gsm_phone'];
|
||||
unset($New_value['_token'], $New_value['action'], $New_value['country'], $New_value['full_phone_adress_gsm_phone']);
|
||||
unset($New_value['_token'], $New_value['action'], $New_value['country']);
|
||||
$adressModel->getAdress($id)->update($New_value);
|
||||
|
||||
$message = [];
|
||||
@ -242,8 +241,7 @@ class MyProfileController extends PublicController
|
||||
return $message;
|
||||
}
|
||||
$new_adress = $request->request->all();
|
||||
$new_adress['adress_gsm_phone'] = $new_adress['full_phone_adress_gsm_phone'];
|
||||
unset($new_adress['_token'], $new_adress['full_phone_adress_gsm_phone']);
|
||||
unset($new_adress['_token']);
|
||||
$new_adress['user_id'] = Auth::id();
|
||||
|
||||
$adressModel = new AdressModel();
|
||||
@ -266,8 +264,7 @@ class MyProfileController extends PublicController
|
||||
return $message;
|
||||
}
|
||||
$new_adress = $this->request->all();
|
||||
$new_adress['adress_gsm_phone'] = $new_adress['full_phone_adress_gsm_phone'];
|
||||
unset($new_adress['_token'], $new_adress['full_phone_adress_gsm_phone']);
|
||||
unset($new_adress['_token']);
|
||||
|
||||
$address->update($new_adress);
|
||||
|
||||
|
||||
@ -17,9 +17,9 @@ class ProfileFormHandler
|
||||
}
|
||||
|
||||
$parameters = [
|
||||
'gsm_phone' => $builder->getPostValue('full_phone_gsm_phone'),
|
||||
'office_phone' => $builder->getPostValue('full_phone_office_phone'),
|
||||
'land_phone' => $builder->getPostValue('full_phone_land_phone'),
|
||||
'gsm_phone' => $builder->getPostValue('gsm_phone'),
|
||||
'office_phone' => $builder->getPostValue('office_phone'),
|
||||
'land_phone' => $builder->getPostValue('land_phone'),
|
||||
'identification_number' => $builder->getPostValue('identification_number'),
|
||||
'register_type' => $builder->getPostValue('register_type'),
|
||||
'adv_listing_banner_id' => $builder->getPostValue('adv_listing_banner'),
|
||||
|
||||
@ -41,7 +41,7 @@ class Register2FormBuilder extends FormBuilder
|
||||
'username' => [
|
||||
'required' => true,
|
||||
],
|
||||
'full_phone' => [
|
||||
'phone' => [
|
||||
'type' => 'anomaly.field_type.text',
|
||||
],
|
||||
'first_name' => [
|
||||
|
||||
@ -51,7 +51,7 @@ class Register2FormHandler
|
||||
$domain = str_replace('/', '', $domain);
|
||||
$domain = str_replace('www', '', $domain);
|
||||
|
||||
$profile_parameters['gsm_phone'] = $builder->getPostValue('full_phone_phone');
|
||||
$profile_parameters['gsm_phone'] = $builder->getPostValue('phone');
|
||||
if (!setting_value('visiosoft.module.advs::register_email_field')) {
|
||||
$builder->setFormValue('email', $builder->getPostValue('username') . "@" . $domain);
|
||||
}
|
||||
@ -59,7 +59,7 @@ class Register2FormHandler
|
||||
$fields = $builder->getPostData();
|
||||
$fields['display_name'] = $fields['first_name'] . " " . $fields['last_name'];
|
||||
unset($fields['phone']);
|
||||
unset($fields['full_phone_phone']);
|
||||
unset($fields['phone']);
|
||||
|
||||
|
||||
$register = $users->create($fields);
|
||||
|
||||
@ -7,11 +7,11 @@ class ValidateRegister
|
||||
{
|
||||
public function handle(FormBuilder $builder, ProfileRepositoryInterface $profileRepository, $attribute, $value)
|
||||
{
|
||||
if (!is_numeric($builder->getPostValue('full_phone'))) {
|
||||
$builder->addFormError('full_phone', trans('visiosoft.module.profile::message.error_valid_phone'));
|
||||
if (!is_numeric($builder->getPostValue('phone'))) {
|
||||
$builder->addFormError('phone', trans('visiosoft.module.profile::message.error_valid_phone'));
|
||||
return false;
|
||||
} elseif (!is_null($profileRepository->findPhoneNumber($builder->getPostValue('full_phone')))) {
|
||||
$builder->addFormError('full_phone', trans('visiosoft.module.profile::message.registered_phone'));
|
||||
} elseif (!is_null($profileRepository->findPhoneNumber($builder->getPostValue('phone')))) {
|
||||
$builder->addFormError('phone', trans('visiosoft.module.profile::message.registered_phone'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user