|
@@ -20,109 +20,3 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</footer>
|
|
|
-
|
|
|
-<script type="text/javascript">
|
|
|
-
|
|
|
-
|
|
|
- toggledisplay('smad-menu-main', 'none')
|
|
|
-
|
|
|
-
|
|
|
- function toggledisplay(elementID, style = 'none') {
|
|
|
- (function(node) {
|
|
|
- if (!node) return;
|
|
|
- node.style.display = (node.style.display === 'none' ? '' : 'none');
|
|
|
- })(document.getElementById(elementID));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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';
|
|
|
- var responseUrl = getUrlParams(testUrl);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-setTimeout(searchColumnWithHref, 2000);
|
|
|
-
|
|
|
-
|
|
|
- * Funkcja przeszukuje td i pobiera dane na podstawie znalezionego adresu url
|
|
|
- */
|
|
|
-function searchColumnWithHref() {
|
|
|
- return false;
|
|
|
-
|
|
|
- console.log('START searchColumnWithHref');
|
|
|
-
|
|
|
- $(".AjaxTableCont table tbody tr").each(function () {
|
|
|
- var tableRow = $(this);
|
|
|
-
|
|
|
-
|
|
|
- tableRow.find('td').each(function ( indexTd, valueTd ) {
|
|
|
- var valueUrl = $(this).find('href');
|
|
|
-
|
|
|
- var hrefFromTd = tableRow.find('td:eq('+indexTd+') a').attr('href');
|
|
|
-
|
|
|
-
|
|
|
- if ( hrefFromTd !== undefined ) {
|
|
|
- var responseData = getDataByUrl( hrefFromTd );
|
|
|
- }
|
|
|
-
|
|
|
- console.log('td tabeli', hrefFromTd, responseData);
|
|
|
- console.log('####################' );
|
|
|
- });
|
|
|
-
|
|
|
- });
|
|
|
- console.log('END searchColumnWithHref');
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- * Funkcja do pobrania danych - należy podać url
|
|
|
- */
|
|
|
-function getDataByUrl( paramUrl, urlNamespaceParams = [] ) {
|
|
|
-
|
|
|
- if ( !paramUrl ) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- 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) {
|
|
|
-
|
|
|
-
|
|
|
-console.log(data);
|
|
|
- if (data.rows === null) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- return data.rowsdata.rows;
|
|
|
-
|
|
|
- console.log('request succeeded with JSON getDataByNamespaceAndPK', data.rows);
|
|
|
- }).catch(function(error) {
|
|
|
- console.log('request failed', error)
|
|
|
- });
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
- * Funkcja do parsowania url (pobieramy dane na temat parametr=wartosc)
|
|
|
- * Wymagane aby w adresie znajdował sie "?"
|
|
|
- * return json eg. {_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"}
|
|
|
- */
|
|
|
-function getUrlParams(url) {
|
|
|
- var params = {};
|
|
|
- (url + '?').split('?')[1].split('&').forEach(function (pair) {
|
|
|
- pair = (pair + '=').split('=').map(decodeURIComponent);
|
|
|
- if (pair[0].length) {
|
|
|
- params[pair[0]] = pair[1];
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- return params;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-</script>
|