|
@@ -42,6 +42,38 @@ function urlFetchKontrahenciPowiazania() {
|
|
|
|
|
|
|
|
|
/* FORM DATA FOR GENERATAE REAPORT */
|
|
|
+/**
|
|
|
+ * Load data default title reaport in storage
|
|
|
+ */
|
|
|
+function loadCurrentReaportTitleInInput(idInput) {
|
|
|
+ var reaportTitleValue = getItemLocalStorage("Bocian.biAuditForm.smadReaportTitle");
|
|
|
+
|
|
|
+ if ( getItemLocalStorage('Bocian.biAuditForm.smadReaportTitle') === null ) {
|
|
|
+ reaportTitleValue = setItemLocalStorage('Bocian.biAuditForm.smadReaportTitle', 'Default reaport');
|
|
|
+ }
|
|
|
+
|
|
|
+ $(idInput).val(function() {
|
|
|
+ return reaportTitleValue;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Update data title reaport in storage from input
|
|
|
+ */
|
|
|
+function updateLocalStorageBiAuditReaportTitle(idInput) {
|
|
|
+ $(idInput).keyup(function() {
|
|
|
+ delayUpdate(function(){
|
|
|
+ var newValue = $(idInput).val();
|
|
|
+ setItemLocalStorage('Bocian.biAuditForm.smadReaportTitle', newValue);
|
|
|
+ loadCurrentReaportTitleInInput('.smad-reaport-title-pracownicy');
|
|
|
+ loadCurrentReaportTitleInInput('.smad-reaport-title-kontrahenci');
|
|
|
+ }, 1000 );
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Load data default depth in storage
|
|
|
+ */
|
|
|
function loadCurrentDepthInInput(idInput) {
|
|
|
var depthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
|
|
|
|
|
@@ -50,7 +82,9 @@ function loadCurrentDepthInInput(idInput) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+/**
|
|
|
+ * Update data default depth in storage
|
|
|
+ */
|
|
|
function updateLocalStorageBiAuditDepth(idInput) {
|
|
|
$(idInput).keyup(function() {
|
|
|
delayUpdate(function(){
|
|
@@ -171,6 +205,10 @@ function initLocalStorage() {
|
|
|
updateLocalStorageBiAuditDepth(7);
|
|
|
}
|
|
|
|
|
|
+ if (getItemLocalStorage('Bocian.biAuditForm.smadReaportTitle') === null) {
|
|
|
+ updateLocalStorageBiAuditReaportTitle('Default reaport');
|
|
|
+ }
|
|
|
+
|
|
|
if (getItemLocalStorage('Bocian.biAuditForm.analizaOnlyTargets') === null) {
|
|
|
setItemLocalStorage('Bocian.biAuditForm.analizaOnlyTargets', defaultOnlyTarger);
|
|
|
}
|
|
@@ -329,9 +367,13 @@ function generateBiAuditRaport(event) {
|
|
|
var pracownicyIdsArray = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
|
|
|
var kontrahenciIdsArray = getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds');
|
|
|
var depthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
|
|
|
+ var smadReaportTitle = getItemLocalStorage('Bocian.biAuditForm.smadReaportTitle');
|
|
|
var analizaOnlyTargets = getItemLocalStorage('Bocian.biAuditForm.analizaOnlyTargets');
|
|
|
|
|
|
// validate
|
|
|
+ if(!smadReaportTitle || smadReaportTitle == '') {
|
|
|
+ p5UI__notifyAjaxCallback({ type: 'error', msg: 'Nie podano tytułu raportu' });
|
|
|
+ }
|
|
|
if (!depthValue || depthValue === 0) {
|
|
|
p5UI__notifyAjaxCallback({ type: 'error', msg: 'Nie podano wartości dla głębokości powiązań' });
|
|
|
} else if ( (!pracownicyIdsArray || pracownicyIdsArray.length === 0) && (!kontrahenciIdsArray || kontrahenciIdsArray.length === 0) ) {
|
|
@@ -371,6 +413,7 @@ function generateBiAuditRaport(event) {
|
|
|
pracownicyIds: pracownicyIdsArray,
|
|
|
kontrahenciIds: kontrahenciIdsArray,
|
|
|
depthValue: depthValue,
|
|
|
+ smadReaportTitle: smadReaportTitle,
|
|
|
analizaOnlyTargets: analizaOnlyTargets
|
|
|
})
|
|
|
})
|
|
@@ -928,9 +971,17 @@ urlFetchKontrahenciPowiazania();
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
+ // pobranie defaultowego tytułu dla generowanego raportu
|
|
|
+ loadCurrentReaportTitleInInput('.smad-reaport-title-pracownicy');
|
|
|
+ loadCurrentReaportTitleInInput('.smad-reaport-title-kontrahenci');
|
|
|
+ // aktualizacja inputów defaultowego tytułu dla generowanego raportu
|
|
|
+ updateLocalStorageBiAuditReaportTitle('.smad-reaport-title-pracownicy');
|
|
|
+ updateLocalStorageBiAuditReaportTitle('.smad-reaport-title-kontrahenci');
|
|
|
+
|
|
|
//aktualizacja inputa głebokości powiazan
|
|
|
loadCurrentDepthInInput('.smad-depth');
|
|
|
loadCurrentDepthInInput('.smad-depth-kontrahenci');
|
|
|
+
|
|
|
updateLocalStorageBiAuditDepth('.smad-depth');
|
|
|
updateLocalStorageBiAuditDepth('.smad-depth-kontrahenci');
|
|
|
// aktualizacja select option czy zwracać wyniki tylko z obiektami docelowymi
|
|
@@ -2778,6 +2829,9 @@ global.urlFetchPracownicy = urlFetchPracownicy;
|
|
|
global.generateBiAuditRaport = generateBiAuditRaport;
|
|
|
global.getAddressData = getAddressData;
|
|
|
|
|
|
+global.loadCurrentReaportTitleInInput = loadCurrentReaportTitleInInput;
|
|
|
+global.updateLocalStorageBiAuditReaportTitle = updateLocalStorageBiAuditReaportTitle;
|
|
|
+
|
|
|
global.Pagination = Pagination;
|
|
|
global.todo__fetchRaport = todo__fetchRaport;
|
|
|
|