Kundenhoheit

This commit is contained in:
Kevin Adametz 2020-05-06 15:43:53 +02:00
parent d8b5206031
commit dc63fa9fb2
52 changed files with 2436 additions and 557 deletions

View file

@ -30,4 +30,25 @@ a[aria-expanded='true'] > .fa-caret-expand:before {
.custom-control-label::before {
border: 1px solid rgba(182, 117, 16, 0.8);
}
.text-muted {
color: #868686 !important;
}
@media (min-width: 992px){
.modal-lg {
max-width: 55rem;
}
}
@media (min-width: 768px) {
.modal-xl {
width: 90%;
max-width:75rem;
}
}
.text-match{
color:#295B28;
}

View file

@ -1,6 +1,6 @@
$(function () {
// $('.selectpicker').selectpicker();
// $('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="tooltip"]').tooltip();
});
@ -89,171 +89,102 @@ function _scrollTo(to, offset) {
$('html,body').animate({scrollTop: $(to).offset().top - offset}, 800);
}
/*
$(function() {
$('.select2-main').each(function() {
$(this)
.wrap('<div class="position-relative"></div>')
.select2({
placeholder: 'Bitte wählen',
dropdownParent: $(this).parent(),
});
})
$('.select2-sub').each(function() {
$(this)
.wrap('<div class="position-relative"></div>')
.select2({
placeholder: 'Bitte wählen',
dropdownParent: $(this).parent(),
closeOnSelect: false
});
})
});
*/
/*
jQuery(document).ready(function() {
$(function () {
$('.main-branch').on('change', function () {
target = $(this).data('target');
if ($(this).is(':checked')) {
$(target).stop().show('slow');
} else {
$(target).stop().hide('slow');
$(target).find('.custom-control-input').prop('checked', false);
$('#modals-load-content').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
if (!button.data('id')) {
return;
}
var data = {};
$.each(button.data(), function(index, value){
data[index] = value;
});
//console.log(data);
loadModalInner(this, data);
});
var $form = $('#lead-form-validation');
if($form.find('#company_country_id').length){
$form.find('#company_country_id').on('change', function(){
$form.find('#company_pre_phone_id').val($(this).val());
$form.find('#company_pre_phone_id').selectpicker('refresh');
});
}
if($form.find('#country_id').length){
$form.find('#country_id').on('change', function(){
$form.find('#pre_phone_id').val($(this).val());
$form.find('#pre_phone_id').selectpicker('refresh');
$form.find('#pre_mobil_id').val($(this).val());
$form.find('#pre_mobil_id').selectpicker('refresh');
});
}
});
*/
/*
function trigger_company($ele, $speed){
if($ele.val() == 1){
$('.show_company_holder').show($speed);
$('.show_company_holder').find('#company_name').prop('required', true);
$('.show_company_holder').find('#company_country_id').prop('required', true);
}else{
$('.show_company_holder').hide($speed);
$('.show_company_holder').find('#company_name').prop('required', false);
$('.show_company_holder').find('#company_country_id').prop('required', false);
}
}
$( document ).ready(function() {
// With validation
var $form = $('#lead-form-validation');
$form.find('#company').on('change', function () {
trigger_company($(this), 'slow');
});
trigger_company($form.find('#company'), 0);
// Set up validator
$form.validate({
rules: {
'email': {
required: true,
email: true,
remote:
{
url: "{{ route('user_check_mail') }}",
type: "post",
data:
{
user_id: function()
{
return $('#lead-form-validation :input[name="user_id"]').val();
},
email: function()
{
return $('#lead-form-validation :input[name="email"]').val();
}
},
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
}
},
'email-confirm': {
required: true,
equalTo: "#email"
},
'accepted_data_protection': {
required: true
},
},
errorPlacement: function errorPlacement(error, element) {
$(element).parents('.form-group').append(
error.addClass('invalid-feedback small d-block')
)
},
highlight: function (element) {
if ($(element).hasClass('selectpicker')) {
$(element).parent().addClass('is-invalid');
}
$(element).addClass('is-invalid');
},
unhighlight: function (element) {
$(element).removeClass('is-invalid');
$(element).parents('.form-group').find('.is-invalid').removeClass('is-invalid');
},
messages : {
required: "{{__('This field is required.')}}",
company_country_id : {
required: "{{__('This field is required.')}}",
},
accepted_data_protection : {
required: "{{__('This field is required.')}}",
},
salutation : {
required: "{{__('This field is required.')}}",
},
company_name : {
required: "{{__('This field is required.')}}",
},
last_name : {
required: "{{__('This field is required.')}}",
},
equalTo : "{{__('Please enter the same value again.')}}",
'email-confirm' : {
equalTo : "{{__('Please enter the same value again.')}}",
required: "{{__('This field is required.')}}",
},
email: {
required : "{{__('This field is required.')}}",
email: "{{ __('Please enter a valid email address.') }}",
remote : "{{ __('This E-mail is already in use.') }}"
},
},
onkeyup: false
function initModalInner() {
$('[data-toggle="reloadModal"]').off().on('click', function(event) {
event.preventDefault();
button = $(this);
var data = {};
$.each(button.data(), function(index, value){
data[index] = value;
});
//console.log(data);
loadModalInner(this, data);
});
}
function loadModalInner(self, data){
var url = data.route,
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: contentType,
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
//console.log(data);
if(data.response.modal){
$(data.response.target).find('.modal-dialog').addClass(data.response.modal);
}
$(data.response.target).find('.modal-dialog').html(data.html);
$(data.response.target).find('.selectpicker').selectpicker('refresh');
initModalInner();
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
}
});
return false;
}
});
*/
function ajax_object_action(event, object, callback) {
event.preventDefault();
var data = {};
$.each(object.data(), function(index, value){
if(typeof value !== 'object'){
data[index] = value;
}
});
var url = data['url'];
console.log(data);
console.log(url);
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
//data will send data to callback function
callback(data);
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(status);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
}
});
return false;
}
});