|
@@ -3011,6 +3011,35 @@ $(document).ready(function(){
|
|
|
|
|
|
rootChangeForm();
|
|
rootChangeForm();
|
|
updateTopCounters();
|
|
updateTopCounters();
|
|
|
|
+
|
|
|
|
+ var unsubscribe = globalRaportStore.subscribe(function () {
|
|
|
|
+ // TODO: fetch data from globalRaportStore.getState()
|
|
|
|
+ var idsPracownicy = getListFromLocalStorage('Bocian.biAuditForm.pracownicyIds');
|
|
|
|
+ var idsKontrahenci = getListFromLocalStorage('Bocian.biAuditForm.kontrahenciIds');
|
|
|
|
+ var pozostaleOd = getListFromLocalStorage(getSelectedListLocalStorageKey('OD'));
|
|
|
|
+ var pozostaleDo = getListFromLocalStorage(getSelectedListLocalStorageKey('DO'));
|
|
|
|
+ var allOdLength = idsPracownicy.length + pozostaleOd.length;
|
|
|
|
+ var allDoLength = idsKontrahenci.length + pozostaleDo.length;
|
|
|
|
+ var depthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
|
|
|
|
+
|
|
|
|
+ if(DBG) console.warn({totalPracownicy: idsPracownicy.length, totalKontrahenci: idsKontrahenci.length})
|
|
|
|
+ $('.top--count-selected-item-pracownicy').text(idsPracownicy.length ? '('+idsPracownicy.length+')' : '');
|
|
|
|
+ $('.top--count-selected-item-kontrahenci').text(idsKontrahenci.length ? '('+idsKontrahenci.length+')' : '');
|
|
|
|
+ $('.bottom--count-selected-item-pracownicy').text(idsPracownicy.length ? "Wybrano: (" + idsPracownicy.length + ") osób" : '');
|
|
|
|
+ $('.bottom--count-selected-item-kontrahenci').text(idsKontrahenci.length ? "Wybrano: (" + idsKontrahenci.length + ") podmiotów/kontrahentaów" : '');
|
|
|
|
+
|
|
|
|
+ // disable button generate reaport if not choise 'praconwicy' or 'kontrahenci'
|
|
|
|
+ if ( !allOdLength && !allDoLength ) {
|
|
|
|
+ $('.smad-generate-reaport-button').addClass('disabled');
|
|
|
|
+ } else {
|
|
|
|
+ if ( ( !allOdLength || !allDoLength ) && parseInt(depthValue) > 6 ) {
|
|
|
|
+ $('.bottom--message-warning-critical-search').text(messageCriticalSearchData);
|
|
|
|
+ } else {
|
|
|
|
+ $('.bottom--message-warning-critical-search').text('');
|
|
|
|
+ }
|
|
|
|
+ $('.smad-generate-reaport-button').removeClass('disabled');
|
|
|
|
+ }
|
|
|
|
+ })
|
|
});
|
|
});
|
|
|
|
|
|
global.hideMoreRecordFunctionsPopover = function() {
|
|
global.hideMoreRecordFunctionsPopover = function() {
|