|
@@ -190,7 +190,6 @@ var P5UI__BocianHeader = createReactClass({
|
|
return !value && 'Proszę wybrać typ danych';
|
|
return !value && 'Proszę wybrać typ danych';
|
|
}
|
|
}
|
|
}).then(function (data) {
|
|
}).then(function (data) {
|
|
- DBG1 && console.log('DBG: selected', data);
|
|
|
|
handleAddToReportByPreviousReport(data.value);
|
|
handleAddToReportByPreviousReport(data.value);
|
|
})
|
|
})
|
|
|
|
|
|
@@ -823,16 +822,15 @@ function addPracownikToGroup(event) {
|
|
confirmButtonText: 'Zapisz',
|
|
confirmButtonText: 'Zapisz',
|
|
showLoaderOnConfirm: true,
|
|
showLoaderOnConfirm: true,
|
|
preConfirm: function (idGroup) {
|
|
preConfirm: function (idGroup) {
|
|
|
|
+ if (!idGroup) {
|
|
|
|
+ swal.showValidationError('Proszę wybrać nazwę grupy');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!pracownicyIdsArray || !pracownicyIdsArray.length) {
|
|
|
|
+ swal.showValidationError('Proszę wybrać pracowników');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
return new Promise(function (resolve, reject) {
|
|
return new Promise(function (resolve, reject) {
|
|
- if (!idGroup) {
|
|
|
|
- reject('Proszę wybrać nazwę grupy');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (!pracownicyIdsArray || !pracownicyIdsArray.length) {
|
|
|
|
- reject('Wybierz pracowników');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
window.fetch(URL_ADD_PRACOWNICY_TO_GROUP, {
|
|
window.fetch(URL_ADD_PRACOWNICY_TO_GROUP, {
|
|
method: 'POST',
|
|
method: 'POST',
|
|
header: { 'contentType': 'applications/json' },
|
|
header: { 'contentType': 'applications/json' },
|
|
@@ -872,6 +870,8 @@ function addPracownikToGroup(event) {
|
|
updateCountItemCheckedByType('pracownicy');
|
|
updateCountItemCheckedByType('pracownicy');
|
|
$('form').find(':checkbox').prop('checked', false);
|
|
$('form').find(':checkbox').prop('checked', false);
|
|
}
|
|
}
|
|
|
|
+ }).catch(function (e) {
|
|
|
|
+ DBG && console.log('DBG: e', e)
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -996,16 +996,15 @@ function addKontrahenciToGroup(event) {
|
|
confirmButtonText: 'Zapisz',
|
|
confirmButtonText: 'Zapisz',
|
|
showLoaderOnConfirm: true,
|
|
showLoaderOnConfirm: true,
|
|
preConfirm: function (idGroup) {
|
|
preConfirm: function (idGroup) {
|
|
|
|
+ if (!idGroup) {
|
|
|
|
+ swal.showValidationError('Proszę wybrać nazwę grupy');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!kontrahenciIdsArray || !kontrahenciIdsArray.length) {
|
|
|
|
+ swal.showValidationError('Proszę wybrać kontrahentów');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
return new Promise(function (resolve, reject) {
|
|
return new Promise(function (resolve, reject) {
|
|
- if (!idGroup) {
|
|
|
|
- reject('Proszę wybrać nazwę grupy');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (!kontrahenciIdsArray || !kontrahenciIdsArray.length) {
|
|
|
|
- reject('Wybierz kontrahentów');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
window.fetch(URL_ADD_KONTRAHENCI_TO_GROUP, {
|
|
window.fetch(URL_ADD_KONTRAHENCI_TO_GROUP, {
|
|
method: 'POST',
|
|
method: 'POST',
|
|
header: { 'contentType': 'applications/json' },
|
|
header: { 'contentType': 'applications/json' },
|
|
@@ -1045,6 +1044,8 @@ function addKontrahenciToGroup(event) {
|
|
updateCountItemCheckedByType('kontrahenci');
|
|
updateCountItemCheckedByType('kontrahenci');
|
|
$('form').find(':checkbox').prop('checked', false);
|
|
$('form').find(':checkbox').prop('checked', false);
|
|
}
|
|
}
|
|
|
|
+ }).catch(function (e) {
|
|
|
|
+ DBG && console.log('DBG: e', e)
|
|
});
|
|
});
|
|
}
|
|
}
|
|
function addKontrahenciAllToGroup(event) {
|
|
function addKontrahenciAllToGroup(event) {
|
|
@@ -1660,12 +1661,6 @@ function urlFetchKontrahenci(page) {
|
|
var btnAddAllToGroup = $('<button class="btn btn-info" style="padding:1px 5px; margin-left:12px">DODAJ WSZYSTKIE DO GRUPY</button>');
|
|
var btnAddAllToGroup = $('<button class="btn btn-info" style="padding:1px 5px; margin-left:12px">DODAJ WSZYSTKIE DO GRUPY</button>');
|
|
btnAddAllToGroup.on('click', addKontrahenciAllToGroup);
|
|
btnAddAllToGroup.on('click', addKontrahenciAllToGroup);
|
|
$('#smad-filter-desc-kontrahenci').append(btnAddAllToGroup);
|
|
$('#smad-filter-desc-kontrahenci').append(btnAddAllToGroup);
|
|
-
|
|
|
|
- // case 'KONTRAHENCI':
|
|
|
|
- // $buttonMoveToGroup = '<a title="DODAJ WYBRANE DO GRUPY" onClick="addKontrahenciToGroup(event)" class="btn btn-info">DODAJ WYBRANE DO GRUPY</a>';
|
|
|
|
- // $buttonMoveToGroup .= '<a title="DODAJ WSZYSTKIE DO GRUPY" onClick="addKontrahenciAllToGroup(event)" class="btn btn-info" style="margin-left:12px">DODAJ WSZYSTKIE DO GRUPY</a>';
|
|
|
|
- // $buttonMoveToGroup .= '<a title="USUN WYBRANE Z GRUPY" onClick="removeKontrahenciFromGroup(event)" class="btn btn-info" style="margin-left:12px">USUŃ WYBRANE Z GRUPY</a>';
|
|
|
|
- // break;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1815,13 +1810,6 @@ function urlFetchPracownicy(page) {
|
|
var btnAddAllToGroup = $('<button class="btn btn-info" style="padding:1px 5px; margin-left:12px">DODAJ WSZYSTKIE DO GRUPY</button>');
|
|
var btnAddAllToGroup = $('<button class="btn btn-info" style="padding:1px 5px; margin-left:12px">DODAJ WSZYSTKIE DO GRUPY</button>');
|
|
btnAddAllToGroup.on('click', addPracownikAllToGroup);
|
|
btnAddAllToGroup.on('click', addPracownikAllToGroup);
|
|
$('#smad-filter-desc-kontrahenci').append(btnAddAllToGroup);
|
|
$('#smad-filter-desc-kontrahenci').append(btnAddAllToGroup);
|
|
-
|
|
|
|
- // case 'PRACOWNICY':
|
|
|
|
- // $buttonMoveToGroup = '<a title="DODAJ WYBRANE DO GRUPY" onClick="addPracownikToGroup(event)" class="btn btn-info">DODAJ WYBRANE DO GRUPY</a>';
|
|
|
|
- // $buttonMoveToGroup .= '<a title="DODAJ WSZYSTKIE DO GRUPY" onClick="addPracownikAllToGroup(event)" class="btn btn-info" style="margin-left:12px">DODAJ WSZYSTKIE DO GRUPY</a>';
|
|
|
|
- // $buttonMoveToGroup .= '<a title="USUN WYBRANE Z GRUPY" onClick="removePracownikFromGroup(event)" class="btn btn-info" style="margin-left:12px">USUŃ WYBRANE Z GRUPY</a>';
|
|
|
|
- // break;
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|