Browse Source

Merge branch 'master' of ssh://biuro.biall-net.pl:2222/p5/project-bocian

* 'master' of ssh://biuro.biall-net.pl:2222/p5/project-bocian: (67 commits)
  znowu nadpisany z bravecom.yellowgroup.pl po ./1.rsync-bocian-local.sh - pewnie ktos ma otwarty plik w edytorze i go saveuje???
  - fix czerwonej kreski nachodzacej na logo
  fixed bug in count selected kontrahenci
  fixed bug in updateCountItemCheckedByType
  upd
  bug na cudzyslowiu w interfejsie!!
  Proszę Dariuszu nie kasuj tych zmian...
  - dodanie prawidłowych sieżek do pliów przykładów csv
  dodanie plików z przykładowe pliki csv. (nalezy piamietać aby po dodaniu nowych pól wyedytować pliki aby klient miał nadal aktualna wersje)
  - nazwa użytkownika w miejscu przycisku
  - dodanie menu po kliknieciu użytkownika
  - fix wyświetlenia aktualnego nicku użytkownika
  - ustawienie zagłebienia defaultowego na 7
  - fix wyświetlenia przycisku utworzenia nowej grypy pracowniyc
  - fix wyświetlenia przycisku nazwy grupy -> utwórz grupę w pracownikach
  - ukrycie przycisku generowanie raportów
  fix todo - powinna być nazwa zalogowanego użytklownika!
  upd
  upd linkow do obiektow - wiecej danych dostepnych
  reset to commit Dariusz
  ...

# Conflicts:
#	theme/view/top.php
a.binder 7 years ago
parent
commit
213f879327

BIN
schema/ant-object/default_db.BI___.zip


File diff suppressed because it is too large
+ 0 - 0
theme/assets/css/styles.css


BIN
theme/assets/file_example/kontrahenci_example.zip


BIN
theme/assets/file_example/pracownicy_example.zip


+ 68 - 12
theme/assets/less/styles.less

@@ -1,5 +1,6 @@
 // Variables, Mixins
 @import "variables.less";
+@import "buttons.less";
 
 // html5
 article,
@@ -34,6 +35,10 @@ strong {
   color: @brand-primary;
 }
 
+.link-primary {
+  color: @brand-primary!important;
+  cursor: pointer;
+}
 .font-weight-700 {
   font-weight: 700;
 }
@@ -72,6 +77,7 @@ strong {
 .text-grey {
   color: @brand-text-light;
 }
+
 .bg-white {
   background-color: @brand-white!important;
 }
@@ -88,6 +94,7 @@ strong {
 .border-bottom-grey {
   border-bottom: 2px solid @brand-grey;
 }
+
 ul.breadcrumb {
   background-color: @brand-white;
   li {
@@ -106,17 +113,33 @@ ul.breadcrumb {
 
 /* menu hamburger*/
 #hamburger-menu {
-    float: right;
-    
+  .smad-menu-title {
+    font-size: 11px;
+    height: 17px;
+    text-align: center;
+    color: @brand-primary;
+    font-weight: bold;
+  }
+
+  float: right;
   .hamburger-menu-line {
     width: 35px;
     height: 3px;
     background-color: @brand-dark;
     margin: 6px 0;
     text-align: right;
+
   }
 }
 
+
+/** drop down menu */
+#smad-header-section ul.dropdown-menu li{
+    display: block;
+}
+
+
+
 /** Bootstrap */
 .btn:focus,.btn:active {
   outline: none !important;
@@ -135,9 +158,9 @@ ul.breadcrumb {
   color: @brand-white;
   background-color: @brand-primary;
   border-color: @brand-primary;
-}
-
+}*/
 
+/*
 .btn-default {
   color: @brand-primary;
   background-color: @brand-white;
@@ -153,10 +176,10 @@ ul.breadcrumb {
   color: @brand-white;
   background-color: @brand-primary;
   border-color: @brand-primary;
-}
+}*/
 
 
-.btn-default-red {
+/*.btn-default-red {
   color: @brand-white!important;
   background-color: @brand-primary;
   border-color: @brand-primary;
@@ -171,8 +194,8 @@ ul.breadcrumb {
   color: @brand-primary!important;
   background-color: @brand-white;
   border-color: @brand-primary;
-}
-
+}*/
+/*
 .btn-grey-border {
   color: @brand-secondary!important;
   background-color: @brand-white;
@@ -188,13 +211,14 @@ ul.breadcrumb {
   color: @brand-white!important;
   background-color: @brand-secondary;
   border-color: @brand-secondary;
-}
-*/
+}*/
 
 /* Select option */
 .form-control {
   height: 43px;
 }
+
+
 .col-centered {
   margin: 0 auto;
   float: none;
@@ -220,6 +244,7 @@ ul.breadcrumb {
   background-color: @brand-grey-light;
 
   .smad-top-first {
+    margin-left: 4%;
     padding-top: 20px;
     border-bottom: 1px solid @brand-primary;
   }
@@ -244,6 +269,10 @@ ul.breadcrumb {
         padding-right: 10px;
         color: @brand-text;
         font-size: 13px;
+
+        #ProcesMenuLoginDropdownLink {
+          color: @brand-text;
+        }
       }
 
     }
@@ -264,6 +293,7 @@ ul.breadcrumb {
 /** Menu */
 #smad-menu-section {
 
+
   .smad-heder-title {
     color: @brand-text;
     font-weight: 700;
@@ -405,10 +435,18 @@ footer {
 }
 
 
+
+/**
+ * Employees
+ */
+#smad-reaport-section {
+
+}
+
 /**
  * Employees
  */
-#smad-employees-sectionn, #smad-reaport-section  {
+#smad-employees-section, #smad-reaport-section  {
   /*Form Wizard*/
   .smad-wizard {
     margin-top: 0px;
@@ -434,6 +472,13 @@ footer {
 
     .step-item {
 
+      a {
+        color: @brand-primary;
+        &:focus, &:hover {
+          color: @brand-primary;
+        }
+      }
+
       .step-title {
         color: @brand-text-light;
       }
@@ -443,6 +488,12 @@ footer {
   .smad-wizard-step.complete {
     .step-item {
       color: @brand-primary;
+      a {
+        color: @brand-primary;
+        &:focus, &:hover {
+          color: @brand-primary;
+        }
+      }
     }
 
     .step-title {
@@ -552,13 +603,18 @@ footer {
         font-size: 14px;
       }
     }
+
+    .smad-depth {
+      width: 80px;
+      text-align: center;
+    }
   }
 
   /** form list employes */
   .smad-employees-list-head, .smad-form-list-head {
     padding: 15px 0px;
     background-color: @brand-grey-light;
-    display: fix;
+    display: flex;
 
     .title {
 

+ 6 - 0
theme/bocian.php

@@ -8,6 +8,12 @@ class Theme_bocian extends ThemeDefault {
 		// echo ''; // TODO: dodać bootsrap-theme-bocian
 		echo '<meta name="robots" content="noindex, nofollow">';
 		UI::inlineCSS(dirname(__FILE__) . '/assets/css/styles.css');
+		echo UI::h('style', [ 'type' => "text/css" ], "
+			.AjaxTable { font-size:14px }
+			.AjaxTable .tblAjax__head__filter .stickyCol1 button { padding:1px 3px }
+			.AjaxTable tbody .stickyCol1 { font-size:12px }
+			.popover-content li { text-align:left; font-size:14px }
+		");
 	}
 
 

+ 57 - 34
theme/view/footer.php

@@ -10,9 +10,9 @@
 			  <div class="col-lg-12">
 					<ul class="menu-bottom">
 						<li><a href="#" title="O Bocianie">O Bocianie</a></li>
-						<li><a href="#" title="">Funkcje</a></li>
-						<li><a href="#" title="Bezpieczeństwo">Bezpieczeństwo</a></li>
 						<li><a href="#" title="">Kontakt</a></li>
+						<li><a href="index.php?_route=ViewTableAjax&namespace=default_db/QUALITY_NOTICES#CREATE" title="Zgłoszenia usterek/błędów jakości" class="btn btn-success">Zgł. błędów.</a></li>
+
 					</ul>
 				</div>
 			</div>
@@ -32,57 +32,79 @@
       })(document.getElementById(elementID).style);
   }
 
-  //
+  // todo: do usuniecia
   var testUrl = 'index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_ENERGA_PRACOWNICY/BI_audit_ENERGA_PRACOWNICY&backRefNS=default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA&backRefPK=26&backRefField=default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY';
-getUrlParams(testUrl);
+  var responseUrl = getUrlParams(testUrl);
+console.log(responseUrl);
+
+// todo: przenieść do eventu który nasłuchuje zakonczenie wczytania tabeli
+setTimeout(searchColumnWithHref, 2000);
 
 /**
- * Funkcja do aktualizacji kolumny w której podajemy namespace backRef i id PK backRef'u
+ * Funkcja przeszukuje td i pobiera dane na podstawie znalezionego adresu url
  */
-function updateColumnDataFieldByBackRefNsAndBackRefPK( paramUrl, arrayShowDataField, countShowDataField = 2 ) {
-	var urlParams = getUrlParams(url_string);
-  var urlGetData = '';
+function searchColumnWithHref() {
+  return false; // todo: usunc
+  //todo: dostanie sie do tabeli jQuery('#BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA').on('TableAjax:render', function (event) { console.log(event) })
+  console.log('START searchColumnWithHref');
+// todo: przeparsować adres url /
+  $(".AjaxTableCont table tbody tr").each(function () {
+    var tableRow = $(this);
+
+
+      tableRow.find('td').each(function ( indexTd, valueTd ) {
+        var valueUrl = $(this).find('href');
+        // pobieramy url z linku a href
+        var hrefFromTd = tableRow.find('td:eq('+indexTd+') a').attr('href');
+
+        // pobieramy dane
+        if ( hrefFromTd !== undefined ) {
+          var responseData = getDataByUrl( hrefFromTd );
+        }
 
-	console.log(urlParams);
-  //urlGetData = 
-  //todo: pobranie danych
-  getDataByNamespaceAndPK(urlGetData);
-  //todo: sprawdzenie wystapiepnia koluny i aktualizacja o dane
+        console.log('td tabeli',  hrefFromTd, responseData);
+        console.log('####################' );
+      });
 
+  });
+  console.log('END searchColumnWithHref');
 }
 
+
 /**
- * Funkcja do pobrania danych- należy podać url
+ * Funkcja do pobrania danych - należy podać url
  */
-functon getDataByNamespaceAndPK(url) {
+function getDataByUrl( paramUrl, urlNamespaceParams = [] ) {
 
-  if (!url) {
+  if ( !paramUrl ) {
     return;
   }
-  fetch(url, {
+  // dodanie tego zapisu pozwala na zwrócenie danych w formacie JSON posortowanego
+  var jsonFormatParam = '&_task=loadDataAjax&currSortCol=ID&currSortFlip=desc';
+  window.fetch(paramUrl + jsonFormatParam, {
+
       credentials: 'same-origin'
-    })
-    .then(function parseJSON(response) {
-      return response.json()
-    })
-    .then(function(data) {
-      //todo: odebrane dane
-      //data.body.items
-
-        if (data.body.item === null) {
-          return;
-        }
+      })
+      .then(function parseJSON(response) {
+        return response.json()
+      })
+      .then(function(data) {
+        //todo: odebrane daneFVFF
+        //data.body.items
+console.log(data);
+          if (data.rows === null) {
+            return;
+          }
 
-        return data.body.items;
+          return data.rowsdata.rows;
 
+        console.log('request succeeded with JSON getDataByNamespaceAndPK', data.rows);
+      }).catch(function(error) {
+        console.log('request failed', error)
+      });
 
-      console.log('request succeeded with JSON updateColumnDataFieldByBackRefNsAndBackRefPK', data.body.items);
-    }).catch(function(error) {
-      console.log('request failed', error)
-    });
 }
 
-
 /**
  * Funkcja do parsowania url (pobieramy dane na temat parametr=wartosc)
  * Wymagane aby w adresie znajdował sie "?"
@@ -100,4 +122,5 @@ function getUrlParams(url) {
   return params;
 }
 
+
 </script>

+ 5 - 4
theme/view/home.php

@@ -27,7 +27,7 @@
                     <div class="menu-form-input text-center">
                         <div class="menu-item smad-heder-title">głębokość powiązań:</div>
                         <div class="menu-item">
-                            <input type="text" class="form-control smad-depth" placeholder="1-16" value="" />
+                            <input type="text" class="form-control smad-depth" placeholder="1-16" value="7" />
                         </div>
                     </div>
                 </div>
@@ -40,7 +40,8 @@
 <div id="smad-generate-link" class="container-fluid">
     <div>
         <div class="text-center">
-            <a href="#" title="GENERUJ RAPORT POWIĄZAŃ" class="btn btn-primary font-weight-700">GENERUJ RAPORT POWIĄZAŃ</a>
+          <?php //todo: ukrycie przycisku generownia raportów powiazan ?>
+          <!--  <a href="#" title="GENERUJ RAPORT POWIĄZAŃ" class="btn btn-primary font-weight-700">GENERUJ RAPORT POWIĄZAŃ</a> -->
         </div>
     </div>
 </div>
@@ -48,7 +49,7 @@
 <script type="text/javascript">
 
 if (localStorage.getItem("Bocian.biAuditForm.depth") === null) {
-  localStorage.setItem('Bocian.biAuditForm.depth', 2);
+  localStorage.setItem('Bocian.biAuditForm.depth', 7);
 }
 
 $(document).ready(function() {
@@ -61,7 +62,7 @@ function loadCurrentDepthInInput(idInput) {
   var depthValue = getItemLocalStorage("Bocian.biAuditForm.depth");
 
   if ( getItemLocalStorage('Bocian.biAuditForm.depth') === null ) {
-    depthValue = setItemLocalStorage('Bocian.biAuditForm.depth', 2);
+    depthValue = setItemLocalStorage('Bocian.biAuditForm.depth', 7);
   }
 
   $(idInput).val(function() {

+ 34 - 3
theme/view/top.php

@@ -1,4 +1,3 @@
-<!-- start:top -->
 <div id="smad-header-section" class="container-fluid">
 	<div class="row">
 		<div class="col-xs-12 col-sm-2 col-md-2 col-lg-1 brand-logo">
@@ -38,6 +37,7 @@
 									<li class="divider"></li>
 
 								<li><a href="procesy5.php?task=USER" title="diradmin"><i class="glyphicon glyphicon-user"></i> Profil</a></li>
+<<<<<<< HEAD
 								<li><a href="<?php echo Request::getPathUri(); ?>index.php?_route=UrlAction_Calendar"><i class="glyphicon glyphicon-calendar"></i> Grafik pracy</a></li>
 								<li><a href="<?php echo Request::getPathUri(); ?>index.php?_route=UserMsgs" title="Wiadomości systemowe"><i class="glyphicon glyphicon-envelope"></i> Wiadomości</a></li>
 								<li><a href="<?php echo Request::getPathUri(); ?>index.php?_route=Notify" title="Powiadomienia"><i class="glyphicon glyphicon-bell"></i> Powiadomienia</a></li>
@@ -46,6 +46,16 @@
 								<li><a href="<?php echo Request::getPathUri(); ?>index.php?_route=Status" title="Status systemu"><i class="glyphicon glyphicon-cog"></i> Status systemu</a></li>
 								<li><p class="text-muted" style="padding:3px 20px;"><nobr>Pokaż testy pracownika:</nobr></p>
 									<form action="<?php echo Request::getPathUri(); ?>index.php" method="POST">
+=======
+								<li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=UrlAction_Calendar"><i class="glyphicon glyphicon-calendar"></i> Grafik pracy</a></li>
+								<li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=UserMsgs" title="Wiadomości systemowe"><i class="glyphicon glyphicon-envelope"></i> Wiadomości</a></li>
+								<li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=Notify" title="Powiadomienia"><i class="glyphicon glyphicon-bell"></i> Powiadomienia</a></li>
+								<li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=Users&amp;_task=reloadPerms" title="Przeładuj uprawnienia"><i class="glyphicon glyphicon-refresh"></i> Przeładuj uprawnienia</a></li>
+								<li class="divider"></li>
+								<li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=Status" title="Status systemu"><i class="glyphicon glyphicon-cog"></i> Status systemu</a></li>
+								<li><p class="text-muted" style="padding:3px 20px;"><nobr>Pokaż testy pracownika:</nobr></p>
+									<form action="<?php echo Request::getPathUri(); ?>"index.php" method="POST">
+>>>>>>> 388019714d78019eb994ade7441153d9b2f6303e
 										<input type="hidden" name="FUNCTION_INIT" value="MENU_SELECT_PROCES">
 										<input type="hidden" name="_action" value="showMyTests">
 										<div class="typepsecial"><select id="ts-_user_id" placeholder="Szukaj..." name="_user_id" tabindex="-1" class="selectized" style="display: none;"><option value="" selected="selected"></option></select><div class="selectize-control single"><div class="selectize-input items not-full"><input type="text" autocomplete="off" tabindex="" placeholder="Szukaj..." style="width: 67px; opacity: 1; position: relative; left: 0px;"></div><div class="selectize-dropdown single" style="display: none;"><div class="selectize-dropdown-content"></div></div></div></div><script>
@@ -174,6 +184,7 @@
 									</li>
 									<li class="divider"></li>
 									<li><a href="<?php echo Request::getPathUri(); ?>index.php?LOGIN=LOGOUT"><i class="glyphicon glyphicon-off"></i> Wyloguj</a></li>
+<<<<<<< HEAD
 				</ul>
 			</div>
 
@@ -182,17 +193,26 @@
 					<li> <span class="smad-line-grey">|</span>	<a href="<?php echo Request::getPathUri(); ?>index.php?LOGIN=LOGOUT" title="Wyloguj" class="smad-logout"><img src="<?= $this->asset("assets/images/logout.png"); ?>" alt="Wyloguj" /> Wyloguj</a></li>
 				</ul>
 				</div>
+=======
+								</ul>
+							</div>
+
+
+					</div></li>
+					<li> <span class="smad-line-grey">|</span>	<a href="<?php echo Request::getPathUri(); ?>index.php?LOGIN=LOGOUT" title="Wyloguj" class="smad-logout"><img src="<?= $this->asset("assets/images/logout.png"); ?>" alt="Wyloguj" /> Wyloguj</a></li>
+				</ul>
+			</div>
+>>>>>>> 388019714d78019eb994ade7441153d9b2f6303e
 			<div class="smad-top-second">
 				 <ul>
 					 <li><div class="smad-header-title">koniec sesji za:</div></li>
 					 <li><div class="smad-desc"><code id="session-timer" style="padding:2px 5px;font-weight:normal;color:#000;" title="Czas sesji">52:40</code></div></li>
 				 </ul>
-			 </div>
 			</div>
 		</div>
 	</div>
 <!-- end:top -->
-<!-- start:menu -->
+<!--  start:menu -->
 <div id="smad-menu-main" class="container-fluid" style="display:none;">
     <div>
         <div>
@@ -202,8 +222,12 @@
                         <div class="smad-heder-title menu-item"><span class="smad-line-red">|</span> RAPORTY</div>
                         <div class="menu-item">
                             <ul>
+<<<<<<< HEAD
                                 <li><a href="<?php echo Request::getPathUri(); ?>index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA" title="zobacz raporty" class="btn btn-success">zobacz raporty</a></li>
 	                            <li><a href="<?php echo Request::getPathUri(); ?>index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_operational_raport_note/BI_audit_operational_raport_note" title="Baza zgłoszeń operacyjnych i notatek" class="btn btn-success">Operac. Baza zgł.</a></li>
+=======
+                                <li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA" title="zobacz raporty" class="btn btn-success">zobacz raporty</a></li>
+>>>>>>> 388019714d78019eb994ade7441153d9b2f6303e
                             </ul>
                         </div>
                     </div>
@@ -213,6 +237,7 @@
                         <div class="menu-item smad-heder-title"><span class="smad-line-red">|</span> BAZY DANYCH</div>
                         <div class="menu-item">
                             <ul>
+<<<<<<< HEAD
 	                                                        
 	                            
 	                            
@@ -228,6 +253,12 @@
                                 <li><a href="<?php echo Request::getPathUri(); ?>index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_ENERGA_FAKTURY/BI_audit_ENERGA_FAKTURY" title="Faktury - do imoportowania" class="btn btn-success">Faktury(i)</a></li>
                                 
                                 <!--<li><a href="#" title="KSIĘGOWOŚĆ" class="btn btn-success">KSIĘGOWOŚĆ</a></li> -->
+=======
+                                <li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_KRS/BI_audit_KRS" title="KRS" class="btn btn-success">KRS</a></li>
+                                <li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_CEIDG/BI_audit_CEIDG" title="CIDG" class="btn btn-success">CEIDG</a></li>
+                                <li><a href="<?php echo Request::getPathUri(); ?>"index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_ENERGA_RUM_KONTRAHENCI" title="RUM" class="btn btn-success">RUM</a></li>
+                                <li><a href="#" title="KSIĘGOWOŚĆ" class="btn btn-success">KSIĘGOWOŚĆ</a></li>
+>>>>>>> 388019714d78019eb994ade7441153d9b2f6303e
                             </ul>
                         </div>
                     </div>

File diff suppressed because it is too large
+ 511 - 333
tools/Bocian.php


+ 375 - 82
tools/Bocian.php.view.js

@@ -1,14 +1,8 @@
-console.log('test1... DBG:', DBG)
 
-// localStorage.setItem('Bocian.pracownicyIds', JSON.stringify(ids))
-// var ids = localStorage.getItem('Bocian.pracownicyIds')
-// localStorage.removeItem('Bocian.pracownicyIds')
-// localStorage.removeItem('Bocian.kontrahenciIds')
-// localStorage.removeItem('Bocian.depth') // TODO: zapis na stronie głównej i BiAuditRaport
-
-if (!URL_FETCH_KONTRAHENCI_POWIAZANIA) {
-	throw "Brak zmiennej URL_FETCH_KONTRAHENCI_POWIAZANIA"
+if (!BASE_URLS) {
+	throw "Brak BASE_URLS"
 }
+console.log('BASE_URLS',BASE_URLS);
 
 $(window).on('hashchange', function() {
 	initLocalStorage();
@@ -16,7 +10,6 @@ $(window).on('hashchange', function() {
 });
 
 
-
 /* DATA FOR READ REAPORT */
 
 function urlFetchKontrahenciPowiazania() {
@@ -37,7 +30,6 @@ function urlFetchKontrahenciPowiazania() {
 
 		$( "#body-reaport-kontrahenci-powiazani-tree" ).html(reaportItemsKontrahenciPowiazani);
 
-		console.log('request succeeded with JSON response URL_FETCH_KONTRAHENCI_POWIAZANIA', data)
 	}).catch(function(error) {
 		console.log('request failed', error)
 	});
@@ -102,8 +94,143 @@ function initLocalStorage() {
 	setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', 0);
 
 	if (getItemLocalStorage('Bocian.biAuditForm.depth') === null) {
-		updateLocalStorageBiAuditDepth(2);
+		updateLocalStorageBiAuditDepth(7);
+	}
+}
+
+/**
+ * Funkcja pozwala na wyświetlenie okienka importu
+ */
+function showViewUploadFile( event, headerTitle, enumType, showCheckbox, csvFileExample ) {
+	event.preventDefault();
+
+	var enumType = enumType;
+
+	if( csvFileExample !== undefined) { // przykład + instrukcja do pobrania
+			csvFileExample = '<div><a href="'+csvFileExample+'" title="Pobierz przykład" download target="_balnk">Pobierz przykład</a></div>';
 	}
+
+	swal({
+		title: 'Importuj plik csv',
+		input: 'file',
+		html: csvFileExample,
+		inputAttributes: {
+			'accept': 'text/csv',
+			'aria-label': 'Upload csv file'
+		},
+		confirmButtonText: 'Importuj',
+		preConfirm: function (file) {
+			return new Promise(function (resolve, reject) {
+				if (!file) {
+					reject("Proszę wybrać plik csv");
+					return
+				}
+				var input = document.querySelector('input[type="file"]');
+
+				var data = new FormData()
+				data.append('file', input.files[0])
+				data.append('showCheckbox', showCheckbox);
+
+				var responseParseFile = parseCsvFile( data, enumType );
+				resolve('file imported')
+			})
+		},
+	}).then(function (result) {
+		console.log('result', result)
+	}).catch(function (e) {
+		console.log('catch: ', e)
+	});
+
+}
+
+
+/**
+ * Funkcja przekazuje dane z pliku csv do przeparsowania
+ */
+function parseCsvFile( fileData, enumType ) {
+	event.preventDefault();
+
+console.log( 'parseCsvFile fileData', fileData);
+
+	fetch(URL_FORM_DATA_CSV_FILE_AJAX, {
+	  method: 'POST',
+		credentials: 	'same-origin',
+	  body: fileData
+	})
+	.then(function(response) {
+	 return response.json()
+ }).then(function(json) {
+
+					 swal({
+								 title: 'Dane załadowane z pliku CSV',
+								 html: json.body.view,
+								 width: Math.round(window.innerWidth * 0.9),
+								 allowOutsideClick: false, // TODO: btn Anuluj na dole?
+								 showCloseButton: true,
+								 confirmButtonText: 'Zapisz',
+								 preConfirm: function (dataForm) {
+						 			return new Promise(function (resolve, reject) {
+						 				if (!dataForm) {
+						 					reject("Formularz nie zawiera danych do zapisania");
+						 					return
+						 				}
+
+										// zapisanie danych
+						 				var responseSaveData = saveFormCsvFileAjaxAction(enumType);
+						 				resolve('data save from form')
+						 			})
+						 		},
+							 }).then(function (result) {
+
+	 							console.log('result', result)
+	 						}).catch(function (e) {
+	 							console.log('catch: ', e)
+	 						});
+
+ }).catch(function(ex) {
+	 console.log('parsing failed', ex)
+ });
+}
+
+/**
+ * Funkcja zapisuje dane z formularza do wgrania pliku csv
+ */
+function saveFormCsvFileAjaxAction(enumType) {
+	event.preventDefault();
+
+	var formDataFrom =	$("#formDataFromCsv").serialize();
+
+	formDataFrom = formDataFrom.replace(/%5B/g,"[");
+	formDataFrom = formDataFrom.replace(/%5D/g,"]");
+
+//var formDataFrom =	$("#formDataFromCsv").serializeArray();
+console.log('dane z formularza formDataFrom ', formDataFrom );
+
+	fetch(URL_SAVE_FORM_CSV_FILE_AJAX, {
+	  method: 'POST',
+		credentials: 	'same-origin',
+		headers: {
+			'Content-Type': 'application/json'
+		},
+		body: JSON.stringify({
+			 formData: formDataFrom,
+			 enumType: enumType
+		})
+	})
+	.then(function(response) {
+	 return response.json()
+ }).then(function(json) {
+	 console.log('parsed json', json)
+
+	 if (response.type == 'success') {
+
+	 	p5UI__notifyAjaxCallback(response.msg);
+	 }
+
+	// return json;
+ }).catch(function(ex) {
+	 console.log('parsing failed', ex)
+ });
 }
 
 
@@ -114,9 +241,11 @@ function defaultBIAuditLocalStorage() {
 	setItemLocalStorage('Bocian.biAuditForm.kontrahenci.pagination.page', 1);
 	setItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup', 0);
 	setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', 0);
-	setItemLocalStorage('Bocian.biAuditForm.depth', 2);
+	setItemLocalStorage('Bocian.biAuditForm.depth', 7);
 }
 
+
+
 function generateBiAuditRaport(event) {
 	event.preventDefault();
 
@@ -157,12 +286,12 @@ function generateBiAuditRaport(event) {
 					}
 				})
 				.then(function(result) {
-					result
+
 					if (result.type == 'success') {
 
 						p5UI__notifyAjaxCallback(result);
 						defaultBIAuditLocalStorage();
-						window.setTimeout(window.location.href = "https://bravecom.yellowgroup.pl/SE/index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA", 4000);
+						window.setTimeout(window.location.href = "/SE/index.php?_route=ViewTableAjax&namespace=default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA", 6000);
 						resolve(result.msg);
 
 					} else {
@@ -175,29 +304,42 @@ function generateBiAuditRaport(event) {
 		}
 }
 
+
+/**
+ * Popup z opcja przeniesienia pracowników do innej grupy
+ */
 function addPracownikToGroup(event) {
 	event.preventDefault();
 
 	var pracownicyIdsArray = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
-
+	console.log(pracownicyIdsArray);
 	if (pracownicyIdsArray === null) {
 		showTextListIdPracownikow = 'ID pracowników: nie wybrano';
 	} else {
 		showTextListIdPracownikow = 'ID pracowników: ' + pracownicyIdsArray;
 	}
 
+	var arrayGroupOptions = [];
+	var listGroupStorage = getItemLocalStorage('Bocian.biAuditForm.pracownicy.groups');
+  // utworzenie tablicy Optionsów grupy
+	listGroupStorage.map(function(item) {
+		if (item.ID !== undefined) {
+			arrayGroupOptions[item.ID] = item.NAZWA;
+		}
+	});
+
 	swal({
 	  title: 'Przenieś do grupy',
 		input: 'select',
 		text: showTextListIdPracownikow,
-	  inputOptions: getItemLocalStorage('Bocian.biAuditForm.pracownicy.groups'),
+	  inputOptions: arrayGroupOptions,
 	  inputPlaceholder: 'Wybierz grupę',
 	  showCancelButton: true,
 	  confirmButtonText: 'Zapisz',
 	  showLoaderOnConfirm: true,
 	  preConfirm: function (idGroup) {
 	    return new Promise(function (resolve, reject) {
-				console.log('value', idGroup);
+				console.log('idGrupy value', idGroup);
 
 				if ( !pracownicyIdsArray || pracownicyIdsArray === null || pracownicyIdsArray === 'undefined' ) {
 						reject('Wybierz pracowników');
@@ -229,7 +371,7 @@ function addPracownikToGroup(event) {
 					}
 				})
 				.then(function(result) {
-					result
+
 					if (result.type == 'success') {
 						p5UI__notifyAjaxCallback(result);
 						resolve(result.msg);
@@ -248,22 +390,35 @@ function addPracownikToGroup(event) {
 	});
 }
 
+/**
+ * Popup z opcja przeniesienia kontrahentów do innej grupy
+ */
 function addKontrahenciToGroup(event) {
 	event.preventDefault();
 
 	var kontrahenciIdsArray = getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds');
 
 	if (kontrahenciIdsArray === null) {
-		showTextListIdKontrahentow = 'ID pracowników: nie wybrano';
+		showTextListIdKontrahentow = 'ID kontrahentów: nie wybrano';
 	} else {
-		showTextListIdKontrahentow = 'ID pracowników: ' + pracownicyIdsArray;
+		showTextListIdKontrahentow = 'ID kontrahentów: ' + kontrahenciIdsArray;
 	}
 
+
+		var arrayGroupOptions = [];
+		var listGroupStorage = getItemLocalStorage('Bocian.biAuditForm.kontrahenci.groups');
+	  // utworzenie tablicy Optionsów grupy
+		listGroupStorage.map(function(item) {
+			if (item.ID !== undefined) {
+		   	arrayGroupOptions[item.ID] = item.NAZWA;
+			}
+		});
+
 	swal({
 	  title: 'Przenieś do grupy',
 		input: 'select',
 		text: showTextListIdKontrahentow,
-	  inputOptions: getItemLocalStorage('Bocian.biAuditForm.kontrahenci.groups'),
+	  inputOptions: arrayGroupOptions,
 	  inputPlaceholder: 'Wybierz grupę',
 	  showCancelButton: true,
 	  confirmButtonText: 'Zapisz',
@@ -314,7 +469,7 @@ function addKontrahenciToGroup(event) {
 	  },
 	  allowOutsideClick: false
 	}).then(function (groupKontrahenciData) {
-		//TODO: pIOTRKU CZY TU POWINIENEM COŚ JESZCZE OBSŁUŻYĆ
+		//TODO: PIOTRKU CZY TU POWINIENEM COŚ JESZCZE OBSŁUŻYĆ
 	});
 }
 
@@ -354,21 +509,24 @@ function createGroupKontrahenci(event) {
 					}
 				})
 				.then(function(result) {
-					result
+
 					if (result.type == 'success') {
-						p5UI_notifyAjaxCallback(result);
-						resolve(result.msg);
+						p5UI__notifyAjaxCallback(result);
+						resolve(result.body);
 					} else {
-						reject(result.msg);
+
+						reject("Proszę podać inną nazwę grupy");
 					}
 				})
-				;
+				.catch(function(error) {
+					console.log('request failed', error)
+				})
 	    })
 	  },
 	  allowOutsideClick: false
 	}).then(function (groupKontrahenciData) {
 			//TODO: aktualizacja fitrów na widoku -> SPrawdzić co dostaniemy w odpowiedzi po dodaniu filtra grupy
-			groupsKontrahenci = '<button class="btn btn-default" title="'+groupKontrahenciData['NAZWA']+'" data-group-filter="'+groupKontrahenciData['ID']+'">'+groupKontrahenciData['NAZWA']+'</button>';
+			groupsKontrahenci = '<button class="btn btn-default" title="'+groupKontrahenciData['nazwa']+'" data-group-filter="'+groupKontrahenciData['id']+'">'+groupKontrahenciData['nazwa']+'</button>';
 			$('#group-kontrahenci').append(groupsKontrahenci);
 	});
 
@@ -409,21 +567,26 @@ function createGroupPracownicy(event) {
 					}
 				})
 				.then(function(result) {
-					result
+
 					if (result.type == 'success') {
-						p5UI_notifyAjaxCallback(result);
-						resolve(result.msg);
+						console.log('grupa prac1: ', result);
+						p5UI__notifyAjaxCallback(result);
+						resolve(result.body);
 					} else {
-						reject(result.msg);
+						reject("Proszę podać inną nazwę grupy");
 					}
 				})
-				;
+				.catch(function(error) {
+					console.log('request failed', error)
+				})
+
 	    })
 	  },
 	  allowOutsideClick: false
 	}).then(function (groupPracownicyData) {
+		console.log('grupa prac2: ', groupPracownicyData);
 		//TODO: aktualizacja fitrów na widoku -> SPrawdzić co dostaniemy w odpowiedzi po dodaniu filtra grupy
-		groupsPracownicy = '<button class="btn btn-default" title="'+groupPracownicyData['NAZWA']+'" data-group-filter="'+groupPracownicyData['ID']+'">'+groupPracownicyData['NAZWA']+'</button>';
+		groupsPracownicy = '<button class="btn btn-default" title="'+groupPracownicyData['nazwa']+'" data-group-filter="'+groupPracownicyData['id']+'">'+groupPracownicyData['nazwa']+'</button>';
 		$('#group-pracownicy').append(groupsPracownicy);
 
 	});
@@ -431,36 +594,12 @@ function createGroupPracownicy(event) {
 }
 
 
-// fetch(URL_FETCH_TEST_KRS, {
-// 	credentials: 'same-origin'
-// })
-// .then(function parseJSON(response) {
-//   return response.json()
-// })
-// .then(function(data) {
-// 	console.log('request succeeded with JSON response', data)
-// }).catch(function(error) {
-// 	console.log('request failed', error)
-// })
-//
-// fetch(URL_FETCH_TEST_CEIDG, {
-// 	credentials: 'same-origin'
-// })
-// .then(function parseJSON(response) {
-//   return response.json()
-// })
-// .then(function(data) {
-// 	console.log('request succeeded with JSON response', data)
-// }).catch(function(error) {
-// 	console.log('request failed', error)
-// })
-
 function rootChangeForm() {
-
 //todo: do przeniesienia
 urlFetchKontrahenciPowiazania();
 	var valueUrl = global.location.hash;
 
+console.log('URL', valueUrl);
 	switch (valueUrl) {
 		case '#KONTRAHENCI':
 			$( ".container-bi_audit_form_kontrahenci_raport" ).html( VIEW_KONTRAHENCI );
@@ -471,25 +610,25 @@ urlFetchKontrahenciPowiazania();
 			break;
 
 		case '#PRACOWNICY':
-			$( ".container-bi_audit_form_pracownicy_raport" ).html( VIEW_PRACOWNICY );
+		$( ".container-bi_audit_form_pracownicy_raport" ).html( VIEW_PRACOWNICY );
 			urlFetchPracownicy(1);
-			fetchGroupPracownicy()
+			fetchGroupPracownicy();
 			$( ".container-bi_audit_form_kontrahenci_raport" ).hide();
 			$( ".container-bi_audit_form_pracownicy_raport" ).show();
 		break;
 
-		case '#REAPORT':
-			$( ".container-bi_audit_form_raport_data" ).html( VIEW_TREE_REAPORT );
-			urlFetchKontrahenciPowiazania();
-			$( ".container-bi_audit_form_kontrahenci_raport" ).hide();
-			$( ".container-bi_audit_form_pracownicy_raport" ).hide();
-			$( ".container-bi_audit_form_raport_data" ).show();
-		break;
+		// case '#REAPORT':
+		// 	$( ".container-bi_audit_form_raport_data" ).html( VIEW_TREE_REAPORT );
+		// 	urlFetchKontrahenciPowiazania();
+		// 	$( ".container-bi_audit_form_kontrahenci_raport" ).hide();
+		// 	$( ".container-bi_audit_form_pracownicy_raport" ).hide();
+		// 	$( ".container-bi_audit_form_raport_data" ).show();
+		// break;
 
 		default:
-			$( ".container-bi_audit_form_pracownicy_raport" ).html( VIEW_PRACOWNICY );
+		$( ".container-bi_audit_form_pracownicy_raport" ).html( VIEW_PRACOWNICY );
 			urlFetchPracownicy(1);
-			fetchGroupPracownicy()
+			fetchGroupPracownicy();
 			$( ".container-bi_audit_form_kontrahenci_raport" ).hide();
 			$( ".container-bi_audit_form_pracownicy_raport" ).show();
 		break;
@@ -523,6 +662,29 @@ function getAddressData(objectValue) {
 	return listData;
 }
 
+
+/**
+ *  Get name name group
+ */
+function getNameGroupById(store, filterIdGroup) {
+
+	var NAZWA = '';
+	if (!store || filterIdGroup === 0 ) {
+		NAZWA = 'Wszyscy';
+	} else {
+
+		$(store).each(function() {
+				if ( parseInt(filterIdGroup) === parseInt(this.ID) ) {
+					NAZWA = this.NAZWA;
+				}
+		});
+	}
+
+	return NAZWA;
+
+}
+
+
 function urlFetchKontrahenci(page) {
 			var page = page || getItemLocalStorage('Bocian.biAuditForm.kontrahenci.pagination.page');
 
@@ -543,6 +705,7 @@ function urlFetchKontrahenci(page) {
 						})
 				.then(function(data) {
 
+
 						var listItemsKontrahenci = null;
 						data.body.items.forEach (function(row) {
 							listItemsKontrahenci += '<tr><td><input type="checkbox" name="kontrID[]" value="'+row['ID']+'" /></td>'+
@@ -580,17 +743,30 @@ function urlFetchKontrahenci(page) {
 
 				if (data.body.pagination !== undefined) {
 					Pagination.Init(document.getElementById('pagination-kontrahenci'), {
-							url: 'https://bravecom.yellowgroup.pl/SE/index.php?_route=UrlAction_BiAuditRaport#KONTRAHENCI',
+							url: BASE_URLS+'index.php?_route=UrlAction_Bocian#KONTRAHENCI',
 							id_pagination: 'pagination-kontrahenci',
 							type: 'KONTRAHENCI',
+							limit: data.body.pagination.limit,
 							total_items: data.body.pagination.total_items, // pages size
 							size: data.body.pagination.size, // pages size
 							page: page,  // selected page
 							step: 1   // pages before and after current
 					});
 
+					var paginationShowNextCount = 1;
+					if ( parseInt(data.body.pagination.current) !== 1) {
+						 paginationShowNextCount = parseInt(data.body.pagination.limit) * (parseInt(data.body.pagination.current) - 1 ) + 1;
+					}
+					$('#paginationShowNextCount-KONTRAHENCI').text(paginationShowNextCount);
+					$('#smad-filter-desc-kontrahenci').text(data.body.pagination.total_items);
+
 				}
 
+				var groupSelectData = getNameGroupById(getItemLocalStorage('Bocian.biAuditForm.kontrahenci.groups'), filterIdGroup);
+				$('#smad-filter-head-title-kontrahenci').text(groupSelectData);
+				console.log('kontrahenci groupSelectData: ', groupSelectData);
+
+
 				$( "#body-kontrahenci" ).html(listItemsKontrahenci);
 				checkAll('KONTRAHENCI');
 				catchEventCheckbox('KONTRAHENCI');
@@ -652,23 +828,35 @@ function urlFetchPracownicy(page) {
 
 			if (data.body.pagination.size) {
 						Pagination.Init(document.getElementById('pagination-pracownicy'), {
-							  url: 'https://bravecom.yellowgroup.pl/SE/index.php?_route=UrlAction_BiAuditRaport#PRACOWNICY',
+							  url: BASE_URLS+'index.php?_route=UrlAction_Bocian#PRACOWNICY',
 								id_pagination: 'pagination-pracownicy',
 								type: 'PRACOWNICY',
+								limit: data.body.pagination.limit,
 								total_items: data.body.pagination.total_items, // pages size
 								size: data.body.pagination.size, // pages size
 								page: data.body.pagination.current,  // selected page
 								step: 1   // pages before and after current
 						});
+
+						var paginationShowNextCount = 1;
+						if ( parseInt(data.body.pagination.current) !== 1) {
+							 paginationShowNextCount = parseInt(data.body.pagination.limit) * (parseInt(data.body.pagination.current) - 1 ) + 1;
+						}
+						$('#paginationShowNextCount-PRACOWNICY').text(paginationShowNextCount);
+						$('#smad-filter-desc-pracownicy').text(data.body.pagination.total_items);
 			}
 
+
+			// wyświetlenie wybranej grupy w naglówku nad tabela
+			var groupSelectData = getNameGroupById(getItemLocalStorage('Bocian.biAuditForm.pracownicy.groups'), filterIdGroup);
+			$('#smad-filter-head-title-pracownicy').text(groupSelectData);
+
+			// zaladaowanie listy pracowników
 			$( "#body-pracownicy" ).html( listItemsPracownik);
 				checkAll('PRACOWNICY');
 				catchEventCheckbox('PRACOWNICY');
 				checkedChoiseItems('PRACOWNICY', getItemLocalStorage('Bocian.biAuditForm.pracownicyIds') );
 
-			//	$( ".container-bi_audit_raport" ).append( data.body.view );
-				console.log('request succeeded with JSON responsePRACOWNICY', data)
 			}).catch(function(error) {
 				console.log('request failed', error)
 			})
@@ -719,6 +907,9 @@ function checkAll(type) {
 
 				deleteListIdBiAuditReaport(type, allValsUnChecked);
 			}
+
+			// update count selected IDs
+			updateCountItemCheckedByType(type.toLowerCase());
 	});
 }
 
@@ -727,11 +918,18 @@ function checkAll(type) {
  */
 function checkedChoiseItems(type, store) {
 
+	updateCountItemCheckedByType(type.toLowerCase());
+
 	var idElement = 'smad-table-' + type;
 
 	// if id element exist
 	if (document.getElementById(idElement)) {
 
+		// if not checked
+		if (!store) {
+			return false;
+		}
+
 		// checked again if user selected Item (pracownicy/kontrahent)
 			for (i = 0; i < store.length; i++) {
 				$('#body-'+type.toLowerCase() +' input[type=checkbox] ').map(function(k, v) {
@@ -743,7 +941,6 @@ function checkedChoiseItems(type, store) {
 
 	}
 
-	//$('#checkAll-' + type).on('bind', function() {
 	$('#smad-table-' + type + ' input[type=checkbox]').on( 'load', function() {
 		var itemsCHecked = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
 
@@ -779,12 +976,10 @@ function checkedChoiseItems(type, store) {
 
 				deleteListIdBiAuditReaport(type, allValsUnChecked);
 			}
+
 	});
 }
 
-
-
-
 function catchEventCheckbox(type) {
 
 		$('#smad-table-' + type + ' input[type="checkbox"]').on('change', function() {
@@ -804,6 +999,9 @@ function catchEventCheckbox(type) {
 
 						deleteListIdBiAuditReaport(type, allValsUnChecke);
 		    }
+
+				// update count selected IDs
+				updateCountItemCheckedByType(type.toLowerCase());
 		});
 
 }
@@ -878,6 +1076,11 @@ function fetchGroupPracownicy() {
 					}
 
 					var filterIdGroup = getItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup');
+					var currentDepthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
+					setItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup', filterIdGroup);
+
+					setItemLocalStorage('Bocian.biAuditForm.depth', currentDepthValue);
+
 					var groupsPracownicy = '';
 					var activeButton = '';
 
@@ -887,8 +1090,10 @@ function fetchGroupPracownicy() {
 					});
 
 					$("#group-pracownicy").append(groupsPracownicy);
+					updateCountItemCheckedByType('pracownicy');
 
-				console.log('request succeeded with JSON fetchGroupPracownicy', data.body.itmesGroupPracownicy)
+					// detect filter group
+					detectChoiseFilter();
 			}).catch(function(error) {
 				console.log('request failed', error)
 			});
@@ -910,6 +1115,11 @@ function fetchGroupKontrahenci() {
 					}
 
 					var filterIdGroup = getItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup');
+					var currentDepthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
+					setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', filterIdGroup);
+
+					setItemLocalStorage('Bocian.biAuditForm.depth', currentDepthValue);
+
 					var groupsKontrahenci = '';
 					var activeButton = '';
 
@@ -919,7 +1129,10 @@ function fetchGroupKontrahenci() {
 					});
 
 					$("#group-kontrahenci").append(groupsKontrahenci);
+					updateCountItemCheckedByType('kontrahenci');
 
+					// detect filter group
+					detectChoiseFilter();
 				console.log('request succeeded with JSON fetchGroupKontrahenci', data.body.itemsGroupKontrahenci);
 			}).catch(function(error) {
 				console.log('request failed', error)
@@ -936,6 +1149,13 @@ function detectChoiseFilter() {
 
 		// pobranie id grupy kliknietego buttonu
 		var filterIdGroup = $(this).attr("data-group-filter");
+		// aktaulna wartość  zagłebienia
+		var currentDepthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
+		//reset LocalStorage
+		defaultBIAuditLocalStorage();
+		// ustawienie ostaniej wartości zagłebienia  przed resete
+		setItemLocalStorage('Bocian.biAuditForm.depth', currentDepthValue);
+
 		// ustawić id grupy do sesyjnej
 		setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', parseInt(filterIdGroup));
 		// wywylac funckje pobrania danych
@@ -949,6 +1169,13 @@ function detectChoiseFilter() {
 
 		// pobranie id grupy kliknietego buttonu
 		var filterIdGroup = $(this).attr("data-group-filter");
+		// aktaulna wartość  zagłebienia
+		var currentDepthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
+		//reset LocalStorage
+		defaultBIAuditLocalStorage();
+		// ustawienie ostaniej wartości zagłebienia  przed resete
+		setItemLocalStorage('Bocian.biAuditForm.depth', currentDepthValue);
+
 		// ustawić id grupy do sesyjnej
 		setItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup', parseInt(filterIdGroup));
 		// wywylac funckje pobrania danych
@@ -999,6 +1226,7 @@ function removeItemInArray(arr, item) {
  * item - array list items
  */
 function removeItemArrayInArray(arr, itemsArray) {
+
       for(var i = arr.length; i--;) {
 	      for(var j = itemsArray.length; j--;) {
 	          if(arr[i] === itemsArray[j]) {
@@ -1010,6 +1238,58 @@ function removeItemArrayInArray(arr, itemsArray) {
 			return arr;
   }
 
+/**
+ * Cleart list local storage by type
+ * typeNameLocalStorage - name (praconwicy/kontrahenci)
+ */
+function clearListLocalStorageByType(typeNameLocalStorage) {
+
+	if (typeNameLocalStorage === 'pracownicy') {
+		setItemLocalStorage('Bocian.biAuditForm.pracownicyIds', []);
+	}
+
+	if (typeNameLocalStorage === 'kontrahenci') {
+		setItemLocalStorage('Bocian.biAuditForm.kontrahenciIds', []);
+
+	}
+	// update count selected item
+	updateCountItemCheckedByType(typeNameLocalStorage);
+	// unchecked checkbox
+	$('#smad-table-'+typeNameLocalStorage.toUpperCase()+' form').find(':checkbox').prop('checked', false);
+}
+
+/**
+ * Update count selected pracowniyc/kontrahenci
+ */
+function updateCountItemCheckedByType(typeNameLocalStorage) {
+  var countId = 0;
+
+	if (typeNameLocalStorage === 'pracownicy') {
+		var countPracownicy = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
+
+		if (countPracownicy === null || countPracownicy === undefined) {
+			return countId;
+		}
+
+		countId = Object.keys(countPracownicy).length;
+		$('#count-selected-item-pracownicy').text(countId);
+	}
+
+	if (typeNameLocalStorage === 'kontrahenci') {
+		var countKontrahenci = getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds');
+
+
+		if (countKontrahenci === null || countKontrahenci === undefined) {
+			return countId;
+		}
+
+		countId = Object.keys(countKontrahenci).length;
+		$('#count-selected-item-kontrahenci').text(countId);
+	}
+
+	return countId;
+}
+
 // Pagination
 var Pagination = {
 
@@ -1025,6 +1305,7 @@ var Pagination = {
         Pagination.url = data.url;
         Pagination.id_pagination = data.id_pagination;
         Pagination.type = data.type;
+        Pagination.limit = data.limit;
         Pagination.total_items = data.total_items;
         Pagination.size = data.size || 2;
         Pagination.page = data.page || 1;
@@ -1132,9 +1413,15 @@ var Pagination = {
         Pagination.Bind();
     },
 
+
     // find pagination type
     Start: function() {
-			Pagination.code = '<div class="foot-info tblAjax__footer__toolbar__info footer_pagination_menu_items"><p>Wiersze od 1 do ' + Pagination.total_items + ' z ' + Pagination.total_items + '</p></div>';
+			Pagination.code = '';
+			if ( Pagination.type === 'KONTRAHENCI' ) {
+				Pagination.code = '<div class="foot-info tblAjax__footer__toolbar__info footer_pagination_menu_items"><p>Wiersze od <span id="paginationShowNextCount-KONTRAHENCI"></span> do ' + Pagination.total_items + ' z ' + Pagination.total_items + '</p></div>';
+			} else if ( Pagination.type === 'PRACOWNICY' ) {
+					Pagination.code = '<div class="foot-info tblAjax__footer__toolbar__info footer_pagination_menu_items"><p>Wiersze od <span id="paginationShowNextCount-PRACOWNICY"></span> do ' + Pagination.total_items + ' z ' + Pagination.total_items + '</p></div>';
+			}
 			Pagination.code += '<nav aria-label="Page navigation" class="footer_pagination_menu_items"><ul class="btn-group tblAjax__footer__toolbar__pagination smad-pagination">';
 			Pagination.First();
 			Pagination.Prev();
@@ -1143,7 +1430,7 @@ var Pagination = {
 				if ( Pagination.type === 'KONTRAHENCI' ) {
 					Pagination.page = getItemLocalStorage('Bocian.biAuditForm.kontrahenci.pagination.page') || 1;
 				}
-				else if ( Pagination.type === 'PRACOWNICY' ){
+				else if ( Pagination.type === 'PRACOWNICY' ) {
 					Pagination.page = getItemLocalStorage('Bocian.biAuditForm.pracownicy.pagination.page') || 1;
 				}
 
@@ -1221,6 +1508,7 @@ global.checkAll = checkAll;
 global.checkedChoiseItems = checkedChoiseItems;
 global.catchEventCheckbox = catchEventCheckbox;
 global.clearSelectedCheckbox = clearSelectedCheckbox;
+global.getNameGroupById = getNameGroupById;
 global.createGroupPracownicy = createGroupPracownicy;
 global.createGroupKontrahenci = createGroupKontrahenci;
 global.selectPage = selectPage;
@@ -1245,3 +1533,8 @@ global.removeItemInArray = removeItemInArray;
 global.removeItemArrayInArray = removeItemArrayInArray;
 
 global.addPracownikToGroup = addPracownikToGroup;
+global.addKontrahenciToGroup = addKontrahenciToGroup;
+
+global.showViewUploadFile = showViewUploadFile;
+global.parseCsvFile = parseCsvFile;
+global.clearListLocalStorageByType = clearListLocalStorageByType;

Some files were not shown because too many files changed in this diff