Initial xentral_oss_20.3.c9ffacf
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
var PaymentAccount = function ($) {
|
||||
'use strict';
|
||||
|
||||
var me = {
|
||||
selector: {
|
||||
listTable: '#kontenlist',
|
||||
passwordPopup: '#editPasswortTresor'
|
||||
},
|
||||
savePassword: function () {
|
||||
$.ajax({
|
||||
url: 'index.php?module=konten&action=passworttresor',
|
||||
data: {
|
||||
//Alle Felder die fürs editieren vorhanden sind
|
||||
editid: $('#e_id').val(),
|
||||
editpasswort: $('#e_passwort').val()
|
||||
},
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
App.loading.open();
|
||||
},
|
||||
success: function (data) {
|
||||
App.loading.close();
|
||||
if (data.status == 1) {
|
||||
$(me.selector.passwordPopup).find('#e_passwort').val('');
|
||||
$(me.selector.passwordPopup).dialog('close');
|
||||
} else {
|
||||
alert(data.statusText);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openPopup: function () {
|
||||
$('#e_name').focus();
|
||||
|
||||
$(me.selector.passwordPopup).dialog({
|
||||
modal: true,
|
||||
bgiframe: true,
|
||||
closeOnEscape: false,
|
||||
minWidth: 480,
|
||||
autoOpen: true,
|
||||
buttons: {
|
||||
ABBRECHEN: function () {
|
||||
$(this).dialog('close');
|
||||
},
|
||||
SPEICHERN: function () {
|
||||
me.savePassword();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
initPasswordPopup: function () {
|
||||
$('#setpassword').on('click',
|
||||
function () {
|
||||
me.openPopup();
|
||||
}
|
||||
);
|
||||
},
|
||||
initList: function () {
|
||||
$(me.selector.listTable).on('afterreload', function () {
|
||||
$(me.selector.listTable).find('.deletelink').on('click', function () {
|
||||
if (confirm('Soll der Eintrag wirklich gelöscht oder Storniert werden?')) {
|
||||
|
||||
}
|
||||
$.ajax({
|
||||
url: 'index.php?module=konten&action=delete',
|
||||
data: {
|
||||
id: $(this).data('id')
|
||||
},
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
App.loading.open();
|
||||
},
|
||||
success: function () {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$(me.selector.listTable).trigger('afterreload');
|
||||
},
|
||||
init: function () {
|
||||
if ($(me.selector.passwordPopup).length > 0) {
|
||||
me.initPasswordPopup();
|
||||
}
|
||||
if ($(me.selector.listTable).length > 0) {
|
||||
me.initList();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
init: me.init
|
||||
};
|
||||
|
||||
}(jQuery);
|
||||
|
||||
$(document).ready(function () {
|
||||
PaymentAccount.init();
|
||||
});
|
||||
@@ -0,0 +1,188 @@
|
||||
var PaymentAccountCreate = function ($) {
|
||||
'use strict';
|
||||
|
||||
var me = {
|
||||
storage: {
|
||||
hideElements: null,
|
||||
showElements: null,
|
||||
vueElement: null,
|
||||
specificEventCall: null,
|
||||
triggerSubmit: null,
|
||||
},
|
||||
selector:{
|
||||
vueElementId: '#paymentaccount-create',
|
||||
specificSettingsTable: '#specific-settings',
|
||||
editFormular: '#eprooform'
|
||||
},
|
||||
search: function (el) {
|
||||
$.ajax({
|
||||
url: 'index.php?module=konten&action=create&cmd=suche',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
val: $(el).val()
|
||||
}
|
||||
})
|
||||
.done(function (data) {
|
||||
if (typeof data != 'undefined' && data != null) {
|
||||
if (typeof data.ausblenden != 'undefined' && data.ausblenden != null) {
|
||||
me.storage.hideElements = data.ausblenden.split(';');
|
||||
$.each(me.storage.hideElements, function (k, v) {
|
||||
if (v != '') {
|
||||
$('#' + v).hide();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
if (typeof data.anzeigen != 'undefined' && data.anzeigen != null) {
|
||||
me.storage.showElements = data.anzeigen.split(';');
|
||||
$.each(me.storage.showElements, function (k, v) {
|
||||
if (v != '') {
|
||||
$('#' + v).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
updateSpecificFields: function () {
|
||||
me.storage.specificEventCall = true;
|
||||
$('#liveimport-table').loadingOverlay('show');
|
||||
$.ajax({
|
||||
url: 'index.php?module=konten&action=edit&cmd=getspecificfields',
|
||||
type: 'POST',
|
||||
dataType: 'text',
|
||||
data: {
|
||||
type: $('#type').val(),
|
||||
liveimport: $('#liveimport').val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
$(me.selector.specificSettingsTable).html(data);
|
||||
me.registerSpecificEvents();
|
||||
$('#liveimport-table').loadingOverlay('remove');
|
||||
me.storage.specificEventCall = null;
|
||||
if(me.storage.triggerSubmit === true) {
|
||||
$(me.selector.editFormular).submit();
|
||||
}
|
||||
}
|
||||
).error(function () {
|
||||
me.storage.specificEventCall = null;
|
||||
if(me.storage.triggerSubmit === true) {
|
||||
$(me.selector.editFormular).submit();
|
||||
}
|
||||
$('#liveimport-table').loadingOverlay('remove');
|
||||
});
|
||||
},
|
||||
updateLiveImportField: function (element) {
|
||||
me.storage.specificEventCall = true;
|
||||
$(me.selector.specificSettingsTable).loadingOverlay('show');
|
||||
$.ajax({
|
||||
url: 'index.php?module=konten&action=edit&cmd=updatespecificfields',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
type: $('#type').val(),
|
||||
liveimport: $('#liveimport').val(),
|
||||
elementname: element.id,
|
||||
elementvalue: $(element).is(':checkbox') ? $(element).prop('checked') : $(element).val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
$(me.selector.specificSettingsTable).html(data.html);
|
||||
$('#liveimport').val(data.liveimport);
|
||||
me.registerSpecificEvents();
|
||||
$(me.selector.specificSettingsTable).loadingOverlay('remove');
|
||||
me.storage.specificEventCall = null;
|
||||
if(me.storage.triggerSubmit === true) {
|
||||
$(me.selector.editFormular).submit();
|
||||
}
|
||||
}
|
||||
).error(function () {
|
||||
me.storage.specificEventCall = null;
|
||||
if(me.storage.triggerSubmit === true) {
|
||||
$(me.selector.editFormular).submit();
|
||||
}
|
||||
$(me.selector.specificSettingsTable).loadingOverlay('remove');
|
||||
});
|
||||
},
|
||||
registerSpecificEvents: function () {
|
||||
$(me.selector.specificSettingsTable).find('select').off('change');
|
||||
$(me.selector.specificSettingsTable).find('input').off('change');
|
||||
$(me.selector.specificSettingsTable).find('textarea').off('change');
|
||||
$(me.selector.specificSettingsTable).find('select').on('change', function () {
|
||||
me.updateLiveImportField(this);
|
||||
});
|
||||
$(me.selector.specificSettingsTable).find('input').on('change', function () {
|
||||
me.updateLiveImportField(this);
|
||||
});
|
||||
$(me.selector.specificSettingsTable).find('textarea').on('change', function () {
|
||||
me.updateLiveImportField(this);
|
||||
});
|
||||
},
|
||||
initEdit: function () {
|
||||
$('#liveimport').on('change', function () {
|
||||
me.updateSpecificFields();
|
||||
});
|
||||
$('#type').on('change', function () {
|
||||
me.updateSpecificFields();
|
||||
});
|
||||
me.registerSpecificEvents();
|
||||
$(me.selector.editFormular).on('submit', function(event){
|
||||
if(me.storage.specificEventCall !== null) {
|
||||
event.preventDefault();
|
||||
me.storage.triggerSubmit = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
init: function() {
|
||||
if ($(me.selector.specificSettingsTable).length > 0) {
|
||||
me.initEdit();
|
||||
}
|
||||
if ($(me.selector.vueElementId).length === 0) {
|
||||
return;
|
||||
}
|
||||
me.storage.vueElement = $(me.selector.vueElementId).clone();
|
||||
$('#createSearchInput').on('keyup', function () {
|
||||
me.search(this);
|
||||
});
|
||||
$('.createbutton').on('click', function () {
|
||||
$.ajax({
|
||||
url: 'index.php?module=konten&action=create&cmd=getAssistant',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
paymentaccountmodule: $(this).data('module')
|
||||
}
|
||||
}).done(function (data) {
|
||||
if (typeof data.pages == 'undefined' && typeof data.location != 'undefined') {
|
||||
window.location = data.location;
|
||||
return;
|
||||
}
|
||||
if ($(me.selector.vueElementId).length === 0) {
|
||||
$('body').append(me.storage.vueElement);
|
||||
}
|
||||
new Vue({
|
||||
el: me.selector.vueElementId,
|
||||
data: {
|
||||
showAssistant: true,
|
||||
pagination: true,
|
||||
allowClose: true,
|
||||
pages: data.pages
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$('.autoOpenModule').first().each(function () {
|
||||
$('.createbutton[data-module=\'' + $(this).data('module') + '\']').first().trigger('click');
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
};
|
||||
return {
|
||||
init: me.init
|
||||
};
|
||||
}(jQuery);
|
||||
|
||||
$(document).ready(function () {
|
||||
PaymentAccountCreate.init();
|
||||
});
|
||||
Reference in New Issue
Block a user