first commit
This commit is contained in:
33
modules/pocztapolskaen/views/templates/admin/js/orders.js
Normal file
33
modules/pocztapolskaen/views/templates/admin/js/orders.js
Normal file
@@ -0,0 +1,33 @@
|
||||
function sendBulkAction(form, action)
|
||||
{
|
||||
String.prototype.splice = function(index, remove, string) {
|
||||
return (this.slice(0, index) + string + this.slice(index + Math.abs(remove)));
|
||||
};
|
||||
|
||||
var form_action = $(form).attr('action');
|
||||
|
||||
if (form_action.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,'').replace(/\s+/g,' ') == '')
|
||||
return false;
|
||||
|
||||
if(action === 'submitBulkprintLabelsorders'){
|
||||
$(form).attr('target', '_blank');
|
||||
}
|
||||
if (form_action.indexOf('#') == -1)
|
||||
$(form).attr('action', form_action + '&' + action);
|
||||
else
|
||||
$(form).attr('action', form_action.splice(form_action.lastIndexOf('&'), 0, '&' + action));
|
||||
|
||||
$(form).submit();
|
||||
$(form).removeAttr('target');
|
||||
}
|
||||
|
||||
function checkDelBoxes(pForm, boxName, parent)
|
||||
{
|
||||
for (i = 0; i < pForm.elements.length; i++){
|
||||
if (pForm.elements[i].name == boxName){
|
||||
if(!pForm.elements[i].disabled){
|
||||
pForm.elements[i].checked = parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
384
modules/pocztapolskaen/views/templates/admin/js/pack.js
Normal file
384
modules/pocztapolskaen/views/templates/admin/js/pack.js
Normal file
@@ -0,0 +1,384 @@
|
||||
var ppPack = {
|
||||
currentToken: '',
|
||||
orders: [],
|
||||
currentOrder: '',
|
||||
formDefaultValues: [],
|
||||
msg: '',
|
||||
ids: [],
|
||||
loading: false,
|
||||
package: '',
|
||||
init: function (currentToken) {
|
||||
var $this = this;
|
||||
if (typeof (currentToken) !== 'undefined') {
|
||||
this.currentToken = currentToken;
|
||||
}
|
||||
$("#action_pack_modal").click(function () {
|
||||
$this.ids = $this.getIds();
|
||||
$this.orders = [];
|
||||
$this.currentOrder = '';
|
||||
ppPack.getOrders();
|
||||
});
|
||||
$(".pack_modal_next_button").click(function () {
|
||||
$this.beforeProcess();
|
||||
setTimeout(function(){
|
||||
$this.next();
|
||||
$this.afterProcess();
|
||||
}, 100);
|
||||
return false;
|
||||
});
|
||||
$(".pack_inline_action").click(function () {
|
||||
var id = $(this).closest('tr').data('id_order');
|
||||
$this.ids = [id];
|
||||
$this.orders = [];
|
||||
$this.currentOrder = '';
|
||||
$this.getOrders();
|
||||
});
|
||||
$(".btn_add_package").click(function () {
|
||||
var id = $(this).data('id_order');
|
||||
$this.ids = [id];
|
||||
$this.orders = [];
|
||||
$this.currentOrder = '';
|
||||
$this.getOrders();
|
||||
});
|
||||
$("#packModal").on('shown.bs.modal', function () {
|
||||
$this.currentOrder = $this.getOrder();
|
||||
$this.setOrderTitle(ppPack.currentOrder);
|
||||
$this.setButtonLabel();
|
||||
$this.setPackage();
|
||||
$this.setFields();
|
||||
$this.setDatePicker();
|
||||
//ppSetting.toggleCombo($this.package);
|
||||
$('#pp_packages').on('change', function () {
|
||||
$this.package = $(this).val();
|
||||
$this.setFields();
|
||||
});
|
||||
});
|
||||
|
||||
$this.formDefaultValues = $('#packModal select,input,textarea').serializeArray();
|
||||
$this.setNextButton();
|
||||
},
|
||||
setNextButton: function (disabled) {
|
||||
var disabled = disabled || false;
|
||||
$('.pack_modal_next_button').attr('disabled', disabled);
|
||||
},
|
||||
next: function () {
|
||||
var $this = this;
|
||||
var errors = $this.validate();
|
||||
if (errors.length <= 0) {
|
||||
$("#packModal").find('.alert-danger').hide();
|
||||
$this.packOrder(function () {
|
||||
if ($this.isEmpty()) {
|
||||
$("#packModal").modal('hide');
|
||||
window.location.reload();
|
||||
} else {
|
||||
$this.clearErrors();
|
||||
var order = $this.getOrder();
|
||||
$this.setOrderTitle(order);
|
||||
$this.setButtonLabel();
|
||||
$this.restoreDefault();
|
||||
$this.setPackage();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$this.displayErrors(errors)
|
||||
}
|
||||
},
|
||||
skipOrder: function (callback) {
|
||||
callback();
|
||||
},
|
||||
packOrder: function (callback) {
|
||||
var $this = this;
|
||||
if (typeof ($this.currentOrder.id_order) != undefined && $this.currentOrder.id_order !== '') {
|
||||
var $this = this;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: 'index.php',
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
data: $('#packModal select,input,textarea').serialize() + '&controller=AdminPocztaPolskaOrders&action=packOrder&id_order=' + $this.currentOrder.id_order + '&ajax=1&token=' + $this.currentToken,
|
||||
beforeSend: function () {
|
||||
//$this.beforeProcess();
|
||||
},
|
||||
error: function () {
|
||||
//$this.beforeProcess();
|
||||
},
|
||||
success: function (res)
|
||||
{
|
||||
if (res.success) {
|
||||
if (typeof (callback) !== 'undefined') {
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
$this.displayErrors(res.errors);
|
||||
}
|
||||
//$this.afterProcess();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
restoreDefault: function () {
|
||||
$("#packModal").find('.alert-danger').hide();
|
||||
for (var i in this.formDefaultValues) {
|
||||
var el = $('#packModal').find('[name="' + this.formDefaultValues[i].name + '"]');
|
||||
if (el.is(':radio')) {
|
||||
$('#packModal').find('[name="' + this.formDefaultValues[i].name + '"][value="' + this.formDefaultValues[i].value + '"]').attr('checked', true);
|
||||
} else {
|
||||
el.val(this.formDefaultValues[i].value);
|
||||
}
|
||||
}
|
||||
$('#packModal').find('#pp_packages').trigger('change');
|
||||
},
|
||||
replaceDefaultVariables: function(){
|
||||
var $this = this;
|
||||
var package = $this.getPackage();
|
||||
desc = $('#' + package + '_opis_przesylki').val();
|
||||
|
||||
if(typeof(desc) !== 'undefined'){
|
||||
$('#' + package + '_opis_przesylki').val(desc.replace('{reference}',$this.currentOrder.reference).replace('{id_order}',$this.currentOrder.id_order).replace('{message}',$this.currentOrder.message));
|
||||
}
|
||||
|
||||
},
|
||||
setOrderTitle: function(order) {
|
||||
var text = '<a href="'+order.url+'" target="_blank">'+order.name+'</a>';
|
||||
$('#modal_order_info').html(text);
|
||||
var counter = this.getOrdersCount();
|
||||
if(counter>1){
|
||||
$('#orders_counter').parent().show();
|
||||
$('#orders_counter').html(counter);
|
||||
}
|
||||
else{
|
||||
$('#orders_counter').parent().hide();
|
||||
}
|
||||
},
|
||||
setButtonLabel: function(){
|
||||
var counter = this.getOrdersCount();
|
||||
var label;
|
||||
if(counter>1){
|
||||
label = $('.pack_modal_next_button').data('label_multi');
|
||||
}
|
||||
else{
|
||||
label = $('.pack_modal_next_button').data('label_one');
|
||||
}
|
||||
$('.pack_modal_next_button').html(label);
|
||||
},
|
||||
getOrdersCount: function(){
|
||||
var i = 1;
|
||||
for (var id in this.orders) {
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
},
|
||||
getOrder: function () {
|
||||
var $this = this;
|
||||
if (!$this.isEmpty()) {
|
||||
var i = 0;
|
||||
for (var id in $this.orders) {
|
||||
if (i === 0) {
|
||||
$this.currentOrder = $this.orders[id];
|
||||
delete $this.orders[id];
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this.currentOrder;
|
||||
},
|
||||
isEmpty: function () {
|
||||
return $.isEmptyObject(ppPack.orders);
|
||||
},
|
||||
isChecked: function () {
|
||||
return $('[name="pocztapolskaen_orderBox[]"]:checked').length;
|
||||
},
|
||||
beforeProcess: function () {
|
||||
$('.loader').show();
|
||||
this.setNextButton(true);
|
||||
},
|
||||
afterProcess: function () {
|
||||
var $this = this;
|
||||
$this.setNextButton(false);
|
||||
$('.loader').hide();
|
||||
},
|
||||
validate: function () {
|
||||
var $this = this;
|
||||
var errors = [];
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: 'index.php',
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
data: $('#packModal select,input,textarea').serialize() + '&controller=AdminPocztaPolskaOrders&action=validatePackage&id_order=' + $this.currentOrder.id_order + '&ajax=1&token=' + $this.currentToken,
|
||||
beforeSend: function () {
|
||||
//$this.beforeProcess();
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
$this.beforeProcess();
|
||||
//window.location.reload();
|
||||
},
|
||||
success: function (res)
|
||||
{
|
||||
for (var i in res.errors) {
|
||||
errors.push(res.errors[i]);
|
||||
}
|
||||
//$this.afterProcess();
|
||||
}
|
||||
});
|
||||
|
||||
return errors;
|
||||
},
|
||||
getIds: function () {
|
||||
var ids = [];
|
||||
$('[name="ordersBox[]"]:checked').each(function () {
|
||||
var id = $(this).val();
|
||||
var shipment_number = $('[data-id_order="' + id + '"]').data('shipment_number');
|
||||
if (shipment_number === '' || shipment_number == 0) {
|
||||
ids.push(id);
|
||||
}
|
||||
});
|
||||
return ids;
|
||||
},
|
||||
displayErrors: function (errors) {
|
||||
this.clearErrors();
|
||||
for (var i in errors) {
|
||||
var li = $('<li></li>').html(errors[i]);
|
||||
$("#packModal").find('.alert-danger ol').append(li);
|
||||
}
|
||||
$("#packModal").find('.alert-danger').show();
|
||||
},
|
||||
clearErrors: function () {
|
||||
$("#packModal").find('.alert-danger ol').html('');
|
||||
},
|
||||
setDatePicker: function(){
|
||||
$(".datepicker_modal").datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
setTimeout(function(){
|
||||
$('.ui-datepicker').css('z-index', 99999999999999);
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
},
|
||||
setFields: function () {
|
||||
var $this = this;
|
||||
$this.setPni();
|
||||
$this.setWeight();
|
||||
$this.setAmountNumber();
|
||||
$this.setDeclarationValue();
|
||||
$this.replaceDefaultVariables();
|
||||
},
|
||||
setWeight: function () {
|
||||
var $this = this;
|
||||
var package = $this.getPackage();
|
||||
if ($('#' + package + '_masa').val() === ''||$('#' + package + '_masa').val()<=0 || $this.currentOrder.weight >0) {
|
||||
$('#' + package + '_masa').val($.trim($this.currentOrder.weight));
|
||||
}
|
||||
},
|
||||
setAmountNumber: function () {
|
||||
var $this = this;
|
||||
var package = $this.getPackage();
|
||||
$('input[name="' + package + '_rodzaj"]').on('click', function () {
|
||||
if ($(this).val() === 'pobranie') {
|
||||
if ($('#' + package + '_kwota_pobrania_zl').val() === '') {
|
||||
$('#' + package + '_kwota_pobrania_zl').val($this.currentOrder.total);
|
||||
}
|
||||
if ($('#' + package + '_numer_rachunku').val() === '') {
|
||||
$('#' + package + '_numer_rachunku').val($this.currentOrder.amount_number);
|
||||
}
|
||||
}
|
||||
});
|
||||
if($this.currentOrder.is_cod){
|
||||
$('#' + package + '_pobranie_on').trigger('click');
|
||||
}
|
||||
|
||||
//if ($('input[name="' + package + '_rodzaj"][value="1"]').is(':checked')) {
|
||||
if ($('#' + package + '_kwota_pobrania_zl').val() === '') {
|
||||
$('#' + package + '_kwota_pobrania_zl').val($this.currentOrder.total);
|
||||
}
|
||||
if ($('#' + package + '_numer_rachunku').val() === '') {
|
||||
$('#' + package + '_numer_rachunku').val($this.currentOrder.amount_number);
|
||||
//}
|
||||
}
|
||||
},
|
||||
setDeclarationValue: function () {
|
||||
var $this = this;
|
||||
var package = $this.getPackage();
|
||||
$('input[name="' + package + '_deklaracja_wartosci"]').on('click', function () {
|
||||
if ($(this).val() === '1') {
|
||||
if ($('#' + package + '_wartosc_zl').val() === ''||$('#' + package + '_wartosc_zl').val()<=0) {
|
||||
$('#' + package + '_wartosc_zl').val($this.currentOrder.total);
|
||||
}
|
||||
if ($('#' + package + '_wartosc_kg').val() === ''||$('#' + package + '_wartosc_kg').val()<=0 || $this.currentOrder.weight >0) {
|
||||
$('#' + package + '_wartosc_kg').val($this.currentOrder.weight);
|
||||
}
|
||||
}
|
||||
});
|
||||
//if ($('input[name="' + package + '_deklaracja_wartosci"][value="1"]').is(':checked')) {
|
||||
if ($('#' + package + '_wartosc_zl').val() === '' || $('#' + package + '_wartosc_zl').val() <= 0) {
|
||||
$('#' + package + '_wartosc_zl').val($this.currentOrder.total);
|
||||
//}
|
||||
//if ($('#' + package + '_wartosc_kg').val() === ''||$('#' + package + '_wartosc_kg').val() <=0 ) {
|
||||
if($this.currentOrder.weight > 0){
|
||||
$('#' + package + '_wartosc_kg').val($this.currentOrder.weight);
|
||||
}
|
||||
|
||||
//}
|
||||
}
|
||||
},
|
||||
setPni: function () {
|
||||
var $this = this;
|
||||
var package = $this.getPackage();
|
||||
$('input[name="' + package + '_odbior_w_punkcie"]').on('click', function () {
|
||||
if ($(this).val() === '1') {
|
||||
if ($('#' + package + '_pokaz_mape').val() === '') {
|
||||
$('#' + package + '_pokaz_mape').val($this.currentOrder.point);
|
||||
}
|
||||
if ($('#' + package + '_pni').val() === '') {
|
||||
$('#' + package + '_pni').val($this.currentOrder.pni);
|
||||
}
|
||||
}
|
||||
});
|
||||
if($this.currentOrder.point !=''){
|
||||
$('#' + package + '_odbior_w_punkcie_on').trigger('click');
|
||||
}
|
||||
if ($('input[name="' + package + '_odbior_w_punkcie"][value="1"]').is(':checked')) {
|
||||
if ($('#' + package + '_pokaz_mape').val() === '') {
|
||||
$('#' + package + '_pokaz_mape').val($this.currentOrder.point);
|
||||
}
|
||||
if ($('#' + package + '_pni').val() === '') {
|
||||
$('#' + package + '_pni').val($this.currentOrder.pni);
|
||||
}
|
||||
}
|
||||
},
|
||||
showPackModal: function () {
|
||||
this.restoreDefault();
|
||||
$("#packModal").modal('show');
|
||||
},
|
||||
getPackage: function () {
|
||||
if (this.package === '') {
|
||||
this.package = $('#pp_packages').val();
|
||||
}
|
||||
return this.package;
|
||||
},
|
||||
getOrders: function () {
|
||||
var $this = this;
|
||||
for (var i in $this.ids) {
|
||||
var id = $this.ids[i];
|
||||
$this.orders[id] = $('[data-id_order="' + id + '"]').data();
|
||||
}
|
||||
if ($this.orders.length > 0) {
|
||||
$this.showPackModal();
|
||||
}
|
||||
},
|
||||
selectPickup: function(params){
|
||||
var point = params.name +', ' + params.street + ', ' + params.zipCode +' ' +params.city;
|
||||
var package = ppPack.getPackage();
|
||||
$('#' + package + '_pokaz_mape').val(point);
|
||||
$('#' + package + '_pni').val(params.pni);
|
||||
},
|
||||
setPackage: function(){
|
||||
$('#pp_packages').val(this.currentOrder.package).trigger('change');
|
||||
}
|
||||
}
|
||||
5
modules/pocztapolskaen/views/templates/admin/js/sets.js
Normal file
5
modules/pocztapolskaen/views/templates/admin/js/sets.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var ppSet = {
|
||||
toggle: function(selector){
|
||||
$("#"+selector).toggle();
|
||||
}
|
||||
}
|
||||
230
modules/pocztapolskaen/views/templates/admin/js/settings.js
Normal file
230
modules/pocztapolskaen/views/templates/admin/js/settings.js
Normal file
@@ -0,0 +1,230 @@
|
||||
var ppSetting = {
|
||||
toggleRows: function (package_name) {
|
||||
if (package_name !== '') {
|
||||
$('.' + package_name + '.toggle_rows').find('*').change(function () {
|
||||
var val = $(this).val();
|
||||
var name = $(this).attr('name');
|
||||
var is_checked = $(this).attr('type') == 'radio' ? $(this).is(':checked') : 0;
|
||||
|
||||
if (typeof (name) !== 'undefined' && val !== '') {
|
||||
if(is_checked){
|
||||
$('.' + package_name + '.' + name).hide();
|
||||
$('.' + package_name + '.' + name + '.' + val).trigger('change').show();
|
||||
$('.' + package_name + '.' + name + '.' + val).find('*').trigger('change',package_name);
|
||||
}
|
||||
}
|
||||
}).trigger('change');
|
||||
|
||||
$('.toggle_panel.' + package_name).show();
|
||||
}
|
||||
},
|
||||
toggleCombo: function (package_name) {
|
||||
if(package_name !== ''){
|
||||
$('.' + package_name + '.toggle_combo').find('input,select').change(function(event){
|
||||
val = $(this).val();
|
||||
name = $(this).attr('name');
|
||||
var is_checked = $(this).attr('type') == 'radio' ? $(this).is(':checked') : 1;
|
||||
if(is_checked){
|
||||
$('.' + package_name +'.' + name).hide();
|
||||
$('.' + package_name +'.' + name + '.' + val).trigger('change').show();
|
||||
if(typeof (event.isTrigger) == 'undefined'){
|
||||
$('.' + package_name +'.' + name).find('input[type="text"]').val('');
|
||||
$('.' + package_name +'.' + name).find('[id$="off"]').trigger('click').attr('checked',true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}).trigger('change');
|
||||
}
|
||||
},
|
||||
packageChnage: function () {
|
||||
$('#pp_packages,#pp_packages_con').change(function () {
|
||||
var val = $(this).val();
|
||||
$('.toggle_panel').hide();
|
||||
$(this).closest('.tab-pane').find('.form-group').hide();
|
||||
$('.packages').show();
|
||||
if (val !== '') {
|
||||
$('.' + val).show();
|
||||
ppSetting.toggleRows(val);
|
||||
ppSetting.toggleCombo(val);
|
||||
}
|
||||
$('.btn-delivery').show();
|
||||
}).trigger('change');
|
||||
},
|
||||
myAccountRender: function () {
|
||||
var settings = $('#settings').clone(true);
|
||||
$('#settings').html('<div id="my_account_settings" class="col-lg-5"></div><div id="my_account_info" class="col-lg-7"></div>');
|
||||
$('#my_account_settings').append(settings);
|
||||
$('#settings').addClass('clearfix');
|
||||
$('.my_account_info').each(function () {
|
||||
$('#my_account_info').append($(this));
|
||||
});
|
||||
$('.my_account_info2').each(function () {
|
||||
$('#my_account_info').append($(this));
|
||||
});
|
||||
},
|
||||
showPassword: function(){
|
||||
$('.icon-key').parent().click(function(){
|
||||
if($('#pp_password').attr('type') == 'password'){
|
||||
$('#pp_password').attr('type','text');
|
||||
} else {
|
||||
$('#pp_password').attr('type','password');
|
||||
}
|
||||
})
|
||||
},
|
||||
setRodoButtons: function(){
|
||||
$('#pocztapolskaen_login_button').click(function () {
|
||||
if($('#pp_process_data_rodo_modal').is(':checked')){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: 'index.php',
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
data: 'controller=AdminPocztaPolskaSettings&action=saveRodo&ajax=1&pp_process_data_rodo='+Number($('#pp_process_data_rodo_modal').is(':checked'))+'&pp_process_information_rodo='+Number($('#pp_process_information_rodo_modal').is(':checked'))+'&token='+token,
|
||||
success: function (res)
|
||||
{
|
||||
if (res.success) {
|
||||
$("#pp_process_data_rodo").prop('checked',$('#pp_process_data_rodo_modal').is(':checked'));
|
||||
$("#pp_process_information_rodo").prop('checked',$('#pp_process_information_rodo_modal').is(':checked'));
|
||||
$('#modal_rodo_information').modal('hide');
|
||||
|
||||
} else {
|
||||
alert('Błąd zapisu');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
error_modal('Błąd','Zaznacz wymagane zgody');
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
showRODOForm: function(){
|
||||
if(!$('#pp_process_data_rodo').is(':checked')){
|
||||
$('#modal_rodo_information').modal({
|
||||
backdrop: 'static',
|
||||
keyboard: false
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
sendSettingForm: function(){
|
||||
$('#configuration_form').submit();
|
||||
},
|
||||
closeConfirmation:function(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function change(val) {
|
||||
$('.toggle_panel').hide();
|
||||
$('#services .form-group').hide();
|
||||
$('.services_packages').show();
|
||||
if (val !== '') {
|
||||
$('.' + val).show();
|
||||
ppSetting.toggleRows(val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setSettingsButtons() {
|
||||
$('.btn-settings').click(function () {
|
||||
$('form input[name="action"]').val($(this).attr('data-name'));
|
||||
if($(this).attr('data-name') == 'settings' && !$('#pp_process_data_rodo').is(':checked')){
|
||||
confirm_modal('Czy na pewno?','W przypadku wycofania zgody nastąpi wylogowanie z wtyczki i ' +
|
||||
'konieczne będzie ponowne zalogowanie i wyrażenie zgody','OK','Anuluj',ppSetting.sendSettingForm,ppSetting.closeConfirmation);
|
||||
} else {
|
||||
$(this).parents('form').submit();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setPassword() {
|
||||
if ($('form input[name="pp_password_new"]').val() != '') {
|
||||
$('.new_pass').show();
|
||||
} else {
|
||||
$('.new_pass').hide();
|
||||
}
|
||||
$('.show-password').click(function () {
|
||||
$('.new_pass').show();
|
||||
});
|
||||
}
|
||||
|
||||
function setKarta() {
|
||||
if ($('#pp_default_karta_id').val() == null) {
|
||||
$('.default_karta').hide();
|
||||
} else {
|
||||
$('.default_karta').show();
|
||||
}
|
||||
}
|
||||
function setUrzad() {
|
||||
if ($('#pp_default_urzad_id').val() == null) {
|
||||
$('.default_urzad').hide();
|
||||
} else {
|
||||
$('.default_urzad').show();
|
||||
}
|
||||
}
|
||||
/*function setKurierSerwis() {
|
||||
$('.pp_pocztex_serwis').change(function () {
|
||||
if ($(this).val() == 'EKSPRES24') {
|
||||
if ($('#pp_pocztex_wartosc_ubezpieczenia').find('option[value="1000"]').attr('selected')) {
|
||||
$('#pp_pocztex_wartosc_ubezpieczenia').find('option[value="5000"]').attr('selected', true);
|
||||
}
|
||||
$('#pp_pocztex_wartosc_ubezpieczenia').find('option[value="1000"]').attr('disabled', true);
|
||||
} else {
|
||||
$('#pp_pocztex_wartosc_ubezpieczenia').find('option[value="1000"]').attr('disabled', false);
|
||||
}
|
||||
}).trigger('change');
|
||||
}*/
|
||||
|
||||
function setTabs() {
|
||||
if (typeof (active_tab) != undefined && active_tab != '') {
|
||||
$('.active').removeClass('active');
|
||||
$('a[href="#' + active_tab + '"]').parent().addClass('active');
|
||||
$('#' + active_tab).addClass('active');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ppLoadScripts(){
|
||||
ppSetting.packageChnage();
|
||||
ppSetting.toggleRows('statuses');
|
||||
ppSetting.toggleRows('delivery');
|
||||
ppSetting.toggleCombo();
|
||||
ppSetting.showPassword();
|
||||
setSettingsButtons();
|
||||
setPassword();
|
||||
setKarta();
|
||||
setUrzad();
|
||||
setTabs();
|
||||
ppSetting.setRodoButtons();
|
||||
ppSetting.showRODOForm();
|
||||
//setKurierSerwis();
|
||||
ppSetting.myAccountRender();
|
||||
|
||||
//$('#modal_rodo_information').modal('show');
|
||||
//confirm_modal('test','test2','OK','Anuluj');
|
||||
}
|
||||
|
||||
function loadPocztaPolskaOrderForm(link){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: link,
|
||||
async: false,
|
||||
dataType: 'html',
|
||||
success: function (res)
|
||||
{
|
||||
$('#pocztapolskaen_order_detail').html(res);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
ppLoadScripts();
|
||||
});
|
||||
Reference in New Issue
Block a user