瀏覽代碼

Merge branch 'master' of bn.git:plabudda/se

Piotr Labudda 7 年之前
父節點
當前提交
48a3797b46
共有 21 個文件被更改,包括 641 次插入138 次删除
  1. 6 2
      SE/schema/WPS_Functions/bocian-graph-to-html/bcgtht.tree_to_dita.xsl
  2. 6 6
      SE/schema/WPS_Functions/default_db/CRM_PROCES_tree/build_CRM_PROCES_tree.xml
  3. 3 1
      SE/schema/WPS_Functions/graph_gnuplot/build_graph_gnuplot.xml
  4. 1 0
      SE/schema/WPS_Functions/graph_gnuplot/graph_gnuplot_helper.xsl
  5. 20 0
      SE/schema/WPS_Functions/graph_gnuplot/p5gnuplot__x3A__system_cache__dita.xsl
  6. 8 0
      SE/schema/build.p5build.GLOBALS.xml
  7. 68 27
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.xsl
  8. 100 0
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.stats_all.xsl
  9. 200 83
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.xsl
  10. 6 4
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl
  11. 40 0
      SE/schema/default_db_xml_cache.public/default_db/system_cache__dita.map.title__x3A__to_merge/tree_to_dita__x3A__map.title.xsl
  12. 22 0
      SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__to_merge/tree_to_dita__x3A__parts.xsl
  13. 46 0
      SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__to_merge/tree_to_dita__x3A__parts__x3A__map.title.xsl
  14. 4 0
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.xsl
  15. 29 0
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita__x3A__to_merge.xsl
  16. 26 1
      SE/se-lib/Route/UrlAction/BiAuditGenerate.php
  17. 5 5
      SE/se-lib/Teryt.php
  18. 4 9
      doc/SE/PLIKI/BI_audit_POWIAZANIA/.tasks/.tasks.ditamap
  19. 40 0
      doc/__x3A__current/error.symlink_danger_loops.config.dita
  20. 6 0
      doc/__x3A__current/x3a__current.ditamap
  21. 1 0
      doc/procesy5_doc.ditamap

+ 6 - 2
SE/schema/WPS_Functions/bocian-graph-to-html/bcgtht.tree_to_dita.xsl

@@ -25,6 +25,7 @@
                 xmlns:default_db__x3A__BI_audit_MSIG_person="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_person"
                 xmlns:default_db__x3A__BI_audit_operational_raport_note="https://biuro.biall-net.pl/wfs/default_db/BI_audit_operational_raport_note"
                 xmlns:default_db__x3A__BI_audit_MSIG_address="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_address"
+                xmlns:default_db__x3A__BI_audit_ENERGA_PRACOWNICY_adresy="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY_adresy"
                 
                 xmlns:yed="http://www.yworks.com/xml/yed/3"
                 xmlns:p5xmli="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xmlschema_interface/p5xmli.xsd"
@@ -584,7 +585,9 @@ plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxe
                   </xsl:copy>
                </xsl:when>
                <xsl:otherwise>
-                  <xsl:element name="default_db__x3A__{local-name()}:{local-name()}">
+                  <!-- xmlns:default_db__x3A__BI_audit_ENERGA_PRACOWNICY_adresy="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY_adresy" -->
+                  <xsl:element name="default_db__x3A__{local-name()}:{local-name()}" namespace="https://biuro.biall-net.pl/wfs/default_db/{local-name()}" >
+                     <xsl:namespace name="default_db__x3A__{local-name()}" select="concat('https://biuro.biall-net.pl/wfs/default_db/',local-name())"/>
                      <xsl:copy-of select="@fid"/>
                      <xsl:attribute name="p5:primaryKey" select="p5:primaryKey(@fid)"/>
                      <xsl:apply-templates mode="#current">
@@ -621,7 +624,8 @@ plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxe
    <xsl:template match="relation_from|BI_audit_MSIG_person[preceding-sibling::* and following-sibling::*][preceding-sibling::* and following-sibling::*]|BI_audit_KRS_person[ preceding-sibling::* and following-sibling::* ]|BI_audit_MSIG_company|BI_audit_KRS_company|BI_audit_taxpayer|TERYT_adresy|BI_audit_MSIG_address" mode="bocian-graph-2-html.preprocess.names" priority="5"/>
    
    <xsl:template mode="bocian-graph-2-html.preprocess.names" match="ID|imiona|nazwisko|Pelna_nazwa_kontrahenta|nazwa"> <!-- |*[not(*)] -->
-      <xsl:element name="default_db__x3A__{parent::*/local-name()}:{local-name()}">
+      <xsl:element name="default_db__x3A__{parent::*/local-name()}:{local-name()}" namespace="https://biuro.biall-net.pl/wfs/default_db/{local-name()}">
+         <xsl:namespace name="default_db__x3A__{local-name()}" select="concat('https://biuro.biall-net.pl/wfs/default_db/',local-name())"/>
          <xsl:if test="local-name()='nazwa'"><xsl:value-of select="parent::*/system_cache__dita:localname.translate(local-name())"/><xsl:text> </xsl:text></xsl:if><xsl:value-of select="text()"/>
          <!--<xsl:if test="local-name()='ID'"><xsl:comment>#201 parent/name=<xsl:value-of select="parent::*/name()"/></xsl:comment></xsl:if>-->
       </xsl:element>

+ 6 - 6
SE/schema/WPS_Functions/default_db/CRM_PROCES_tree/build_CRM_PROCES_tree.xml

@@ -368,20 +368,20 @@ For example if the parser supports a property http://apache.org/xml/properties/s
                 </antcall>
             </sequential>
         
-        <tempfile property="TEST_DEBUG" destdir="${CRM_PROCES_tree_basedir.temp}"/>
+        <!--<tempfile property="TEST_DEBUG" destdir="${CRM_PROCES_tree_basedir.temp}"/>-->
         <mkdir dir="${CRM_PROCES_tree_basedir.temp}"/>
-        <echoxml file="${TEST_DEBUG}">
+        <!--<echoxml file="${TEST_DEBUG}">
             <TESTPLIKUGADANIA>
                 <COSTAM say="test gadania">
                     
                 </COSTAM>
             </TESTPLIKUGADANIA>
-        </echoxml>
-        <echo>#380 TEST FILE ${TEST_DEBUG} </echo>
+        </echoxml>-->
+        <!--<echo>#380 TEST FILE ${TEST_DEBUG} </echo>-->
         
-        <antcall target="p5suis.p5suis.say_to_queue.copy_file">
+        <!--<antcall target="p5suis.p5suis.say_to_queue.copy_file">
             <param name="p5suis.say_to_queue.copy_file" value="${TEST_DEBUG}"/>
-      </antcall>
+      </antcall>-->
         
             <!--<sequential>
                 <echo>#339 maintaining $p5suis.say_queue_dir.waitfor = ${p5suis.say_queue_dir.waitfor} for wait for</echo>

+ 3 - 1
SE/schema/WPS_Functions/graph_gnuplot/build_graph_gnuplot.xml

@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project basedir="../../." name="graph_gnuplot" default="graph_to_image">
+<project 
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+    basedir="../../." name="graph_gnuplot" default="graph_to_image">
   <description>to use from to dita conversion from xsl/ant to generate png graphs</description>
     
     <include file="build.graph_gnuplot.PRODUCT.xml"/>

+ 1 - 0
SE/schema/WPS_Functions/graph_gnuplot/graph_gnuplot_helper.xsl

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
     xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
     exclude-result-prefixes="xs"
     version="2.0">

+ 20 - 0
SE/schema/WPS_Functions/graph_gnuplot/p5gnuplot__x3A__system_cache__dita.xsl

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+   
+   
+    <xsl:function name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names">
+        <xsl:param name="title"/>
+        <!--<xsl:value-of select="replace($title,' ','&#160;')"/>-->
+        <xsl:value-of select="concat('&quot;',substring(replace(replace($title,'   ',' '),'&quot;',' '),1,35),'&quot;')"/>
+    </xsl:function>
+   
+    
+    
+</xsl:stylesheet>

+ 8 - 0
SE/schema/build.p5build.GLOBALS.xml

@@ -17,7 +17,15 @@
     <property name="dita-ot-toolkit" location="${basedir}/WPS_Functions/dita-ot/dita-ot-2.3.3"/> <!-- TODO REMOVE FROM STUFF -->
     <property name="dita-ot.toolkit" location="${dita-ot-toolkit}"/><!-- TODO USE THIS INSTEAD OF dita-ot-toolkit -->
     
+    
+    <condition property="npm" value="/usr/local/bin/npm">
+        <available file="/usr/local/bin/npm"/>
+    </condition>
     <property name="npm" location="/opt/local/bin/npm"/>
+    
+    <condition property="node" value="/usr/local/bin/node">
+        <available file="/usr/local/bin/node"/>
+    </condition>
     <property name="node" location="/opt/local/bin/node"/>
     <property name="brew" location="/usr/local/bin/brew"/>
     

+ 68 - 27
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.xsl

@@ -47,6 +47,7 @@
             <xsl:message>#2555 system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal zrodlo = <xsl:value-of select="."/></xsl:message>
             <topichead > <!-- navtitle="żródło:{.}  Powiązania do osób z KRS ogólnie" -->
                 <xsl:attribute name="navtitle"><xsl:value-of select="."/> - <xsl:value-of select="$navtitle"/></xsl:attribute>
+                <xsl:attribute name="props">name__universal</xsl:attribute>
                 <xsl:if test="$keys"><xsl:attribute name="keys" select="$keys"/></xsl:if>
                 <xsl:for-each select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq//uniq[@source=$source]">
                     
@@ -305,7 +306,17 @@
     <xsl:template mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" match="*">
         <xsl:param name="title" select="'Ścieżka śledzenia do '"/>
         <xsl:param name="count"/>
-        
+        <xsl:variable name="context" select="."/>
+        <xsl:choose>
+            <xsl:when test="Numer_kontrahenta/text()|ID/text()|source/text()|jednostka_organizacyjna/text()">
+                <ph>
+                    <xsl:if test="Numer_kontrahenta/text()"> nr kontr: <b><xsl:value-of select="Numer_kontrahenta"/></b></xsl:if>
+                    <xsl:if test="jednostka_organizacyjna/text()"> nr kontr: <b><xsl:value-of select="jednostka_organizacyjna"/></b></xsl:if>
+                    <xsl:if test="ID/text()"> ID <b><xsl:value-of select="ID"/></b></xsl:if>
+                    <xsl:if test="source/text()"> source <b><xsl:value-of select="source"/></b></xsl:if>
+                </ph>
+            </xsl:when>
+        </xsl:choose>
         <xsl:choose>
             <xsl:when test="nazwa/text()|Pelna_nazwa_kontrahenta/text()">
                 <ph>
@@ -319,7 +330,7 @@
             <xsl:when test="imiona/text()|nazwisko/text()">
                 <ph>
                     <xsl:if test="nazwisko/text()"> nazwisko: <b><xsl:value-of select="nazwisko"/></b></xsl:if>
-                    <xsl:if test="imiona/text()"> imiona : <b><xsl:value-of select="imiona"/></b></xsl:if>
+                    <xsl:if test="imiona/text()"> imiona: <b><xsl:value-of select="imiona"/></b></xsl:if>
                 </ph>
             </xsl:when>
         </xsl:choose>
@@ -327,8 +338,8 @@
         <xsl:choose>
             <xsl:when test="pesel/text()|PESEL/text()">
                 <ph>
-                    <xsl:if test="pesel/text()"> pesel: <b><xsl:value-of select="pesel"/></b></xsl:if>
-                    <xsl:if test="PESEL/text()"> PESEL : <b><xsl:value-of select="PESEL"/></b></xsl:if>
+                    <xsl:if test="pesel/text()"> PESEL: <b><xsl:value-of select="pesel"/></b></xsl:if>
+                    <xsl:if test="PESEL/text()"> PESEL: <b><xsl:value-of select="PESEL"/></b></xsl:if>
                 </ph>
             </xsl:when>
         </xsl:choose>
@@ -338,8 +349,8 @@
                 <ph>
                     <xsl:if test="krs/text()"> KRS: <b><xsl:value-of select="krs"/></b></xsl:if>
                     <xsl:if test="KRS/text()"> KRS: <b><xsl:value-of select="KRS"/></b></xsl:if>
-                    <xsl:if test="regon/text()"> Regon: <b><xsl:value-of select="regon"/></b></xsl:if>
-                    <xsl:if test="REGON/text()"> Regon: <b><xsl:value-of select="REGON"/></b></xsl:if>
+                    <xsl:if test="regon/text()"> REGON: <b><xsl:value-of select="regon"/></b></xsl:if>
+                    <xsl:if test="REGON/text()"> REGON: <b><xsl:value-of select="REGON"/></b></xsl:if>
                     <xsl:if test="NIP/text()"> NIP: <b><xsl:value-of select="NIP"/></b></xsl:if>
                     <xsl:if test="nip/text()"> NIP: <b><xsl:value-of select="nip"/></b></xsl:if>
                     
@@ -350,8 +361,8 @@
         <xsl:choose>
             <xsl:when test="S_kraj/text()|S_wojewodztwo/text()">
                 <ph>
-                    <xsl:if test="S_kraj/text()"> Kraj: <b><xsl:value-of select="S_kraj"/></b></xsl:if>
-                    <xsl:if test="S_wojewodztwo/text()"> Województwo: <b><xsl:value-of select="S_wojewodztwo"/></b></xsl:if>
+                    <xsl:if test="S_kraj/text()"> kraj: <b><xsl:value-of select="S_kraj"/></b></xsl:if>
+                    <xsl:if test="S_wojewodztwo/text()"> woj.: <b><xsl:value-of select="S_wojewodztwo"/></b></xsl:if>
                     
                 </ph>
             </xsl:when>
@@ -361,17 +372,17 @@
         <xsl:choose>
             <xsl:when test="A_miejscowosc/text()|Miejscowosc/text()|A_ulica/text()|A_nrDomu/text()|ulica/text()|Numer_budynku/text()|nrLokalu/text()|Numer_mieszkania_lokalu/text()|Ulica/text()">
                 <ph>
-                    <xsl:if test="A_miejscowosc/text()"> Miejscowość: <b><xsl:value-of select="A_miejscowosc"/></b></xsl:if>
-                    <xsl:if test="Miejscowosc/text()"> Miejscowość: <b><xsl:value-of select="Miejscowosc"/></b></xsl:if>
-                    <xsl:if test="A_ulica/text()"> Ulica: <b><xsl:value-of select="A_ulica"/></b></xsl:if>
-                    <xsl:if test="ulica/text()"> Ulica: <b><xsl:value-of select="ulica"/></b></xsl:if>
-                    <xsl:if test="Ulica/text()"> Ulica: <b><xsl:value-of select="Ulica"/></b></xsl:if>
-                    <xsl:if test="A_nrDomu/text()"> Nr: <b><xsl:value-of select="A_nrDomu"/></b></xsl:if>
-                    <xsl:if test="Numer_budynku/text()"> Nr: <b><xsl:value-of select="Numer_budynku"/></b></xsl:if>
-                    <xsl:if test="nrLokalu/text()"> lok: <b><xsl:value-of select="nrLokalu"/></b></xsl:if>
-                    <xsl:if test="A_nrLokalu/text()"> lok: <b><xsl:value-of select="A_nrLokalu"/></b></xsl:if>
+                    <xsl:if test="A_miejscowosc/text()"> msc.: <b><xsl:value-of select="A_miejscowosc"/></b></xsl:if>
+                    <xsl:if test="Miejscowosc/text()"> msc.: <b><xsl:value-of select="Miejscowosc"/></b></xsl:if>
+                    <xsl:if test="A_ulica/text()"> ul.: <b><xsl:value-of select="A_ulica"/></b></xsl:if>
+                    <xsl:if test="ulica/text()"> ul.: <b><xsl:value-of select="ulica"/></b></xsl:if>
+                    <xsl:if test="Ulica/text()"> ul.: <b><xsl:value-of select="Ulica"/></b></xsl:if>
+                    <xsl:if test="A_nrDomu/text()"> dom: <b><xsl:value-of select="A_nrDomu"/></b></xsl:if>
+                    <xsl:if test="Numer_budynku/text()"> dom: <b><xsl:value-of select="Numer_budynku"/></b></xsl:if>
+                    <xsl:if test="nrLokalu/text()"> lok.: <b><xsl:value-of select="nrLokalu"/></b></xsl:if>
+                    <xsl:if test="A_nrLokalu/text()"> lok.: <b><xsl:value-of select="A_nrLokalu"/></b></xsl:if>
                     
-                    <xsl:if test="Numer_mieszkania_lokalu/text()"> lok: <b><xsl:value-of select="Numer_mieszkania_lokalu"/></b></xsl:if>
+                    <xsl:if test="Numer_mieszkania_lokalu/text()"> lok.: <b><xsl:value-of select="Numer_mieszkania_lokalu"/></b></xsl:if>
                     
                 </ph>
             </xsl:when>
@@ -380,21 +391,50 @@
         <xsl:choose>
             <xsl:when test="A_poczta/text()|kodPocztowy/text()|A_kod/text()">
                 <ph>
-                    <xsl:if test="A_poczta/text()"> Poczta: <b><xsl:value-of select="A_poczta"/></b></xsl:if>
+                    <xsl:if test="A_poczta/text()"> pcozta: <b><xsl:value-of select="A_poczta"/></b></xsl:if>
                     <xsl:if test="kodPocztowy/text()"> kod: <b><xsl:value-of select="kodPocztowy"/></b></xsl:if>
-                    <xsl:if test="A_kod/text()"> Kod: <b><xsl:value-of select="A_kod"/></b></xsl:if>
+                    <xsl:if test="A_kod/text()"> kod: <b><xsl:value-of select="A_kod"/></b></xsl:if>
                 </ph>
             </xsl:when>
         </xsl:choose>
         
         <xsl:choose>
-            <xsl:when test="Numer_kontrahenta/text()|ID/text()|source/text()|jednostka_organizacyjna/text()">
-                <ph>
-                    <xsl:if test="Numer_kontrahenta/text()"> nr kontr: <b><xsl:value-of select="Numer_kontrahenta"/></b></xsl:if>
-                    <xsl:if test="jednostka_organizacyjna/text()"> nr kontr: <b><xsl:value-of select="jednostka_organizacyjna"/></b></xsl:if>
-                    <xsl:if test="ID/text()"> ID <b><xsl:value-of select="ID"/></b></xsl:if>
-                    <xsl:if test="source/text()"> source <b><xsl:value-of select="source"/></b></xsl:if>
-                </ph>
+            <xsl:when test="BI_audit_ENERGA_PRACOWNICY_adresy/*">
+                <xsl:for-each select="BI_audit_ENERGA_PRACOWNICY_adresy">
+                    <p>
+                        <xsl:choose>
+                            <xsl:when test="last() &gt; 0"><i> adres nr <xsl:value-of select="position()"/>/<xsl:value-of select="last()"/></i></xsl:when>
+                        </xsl:choose>
+                        
+                        <xsl:if test="kodPocztowy/text()"> kod: <b><xsl:value-of select="kodPocztowy"/></b> </xsl:if>
+                        <xsl:if test="miejscowosc/text()"> msc.: <b><xsl:value-of select="miejscowosc"/></b> </xsl:if>
+                        <xsl:if test="ulica/text()"> ul.: <b><xsl:value-of select="ulica"/></b> </xsl:if>
+                        <xsl:if test="nrBudynku/text()"> dom: <b><xsl:value-of select="nrBudynku"/></b> </xsl:if>
+                        <xsl:if test="nrLokalu/text()"> lok.: <b><xsl:value-of select="nrLokalu"/></b> </xsl:if>
+                    </p>
+                </xsl:for-each>
+            </xsl:when>
+        </xsl:choose>
+        
+        <xsl:choose>
+            <xsl:when test="TERYT_names/*">
+                <xsl:for-each select="TERYT_names">
+                    <p>
+                        <xsl:choose>
+                            <xsl:when test="last() &gt; 0"><i> teryt. adres: </i></xsl:when>
+                        </xsl:choose>
+                        
+                        <xsl:if test="wojewodztwo/text()"> woj.: <b><xsl:value-of select="wojewodztwo"/></b> </xsl:if>
+                        <xsl:if test="powiat/text()"> pow.: <b><xsl:value-of select="powiat"/></b> </xsl:if>
+                        <xsl:if test="gmina/text()"> gm.: <b><xsl:value-of select="gmina"/></b> </xsl:if>
+                        <xsl:if test="miejscowosc/text()"> msc.: <b><xsl:value-of select="miejscowosc"/></b> </xsl:if>
+                        <xsl:if test="ulica_cecha/text()"><i><xsl:value-of select="ulica_cecha"/>:</i> </xsl:if>
+                        <xsl:if test="ulica_nazwa_1/text()"> <b><xsl:value-of select="ulica_nazwa_1"/></b> </xsl:if>
+                        <xsl:if test="ulica_nazwa_2/text()"> <b><xsl:value-of select="ulica_nazwa_2"/></b> </xsl:if>
+                        <xsl:if test="$context/nrDomu/text()"> dom: <b><xsl:value-of select="$context/nrDomu"/></b> </xsl:if>
+                        <xsl:if test="$context/nrLokalu/text()"> lok.: <b><xsl:value-of select="$context/nrLokalu"/></b> </xsl:if>
+                    </p>
+                </xsl:for-each>
             </xsl:when>
         </xsl:choose>
         
@@ -405,6 +445,7 @@
     <xsl:template mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.last.table" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
         <draft-comment author="a.binder">#159 system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.last.table  </draft-comment>
         <simpletable frame="all" relcolwidth="1* 2* 2* 4*" id="{$uuid}__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.last.table_{system_cache__dita:files.topic.table.id('',@fid)}_path_{generate-id()}">
+            <xsl:attribute name="props">mode__universal.last.table</xsl:attribute>
             <strow>
                 <stentry>Lp</stentry>
                 <stentry>Sposób wyszukania</stentry>

+ 100 - 0
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.stats_all.xsl

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:ogr="http://ogr.maptools.org/"
+    xmlns:Benford="https://pl.wikipedia.org/wiki/Rozkład_Benforda"
+    xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
+    xmlns:p5="https://biuro.biall-net.pl/wfs"
+    xmlns:get_wfs="http://biuro.biall-net.pl/WPS_Functions/get_wfs/get_wfs.xsd"
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+    exclude-result-prefixes="xs system_cache__appinfo system_cache__dita ogr Benford default_db get_wfs p5 p5gnuplot"
+    version="2.0">
+    
+    
+   
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    <xsl:template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all">
+        <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[not(position()=1) and not(position()=last())]/*[1]" group-by="local-name()">
+            <topicref href="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.{local-name()}.dita" props="name__BaERKP.stats_all">
+                <xsl:result-document href="{$temp}/{$uuid}/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.{local-name()}.dita">
+                    <xsl:apply-templates select="." mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.local-name"/>
+                </xsl:result-document>
+            </topicref>
+        </xsl:for-each-group>
+    </xsl:template>
+    
+    
+    
+    <xsl:template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all__x3A__preprocess">
+        <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[not(position()=1) and not(position()=last())]/*[1]" group-by="local-name()">
+                    <xsl:apply-templates select="." mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.local-name"/>
+        </xsl:for-each-group>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.local-name" match="*">
+        <topic id="{$uuid}BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.{local-name()}.dita" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+            <title>Statystyka powiązań dla obiektu <xsl:value-of select="local-name()"/>
+                
+            </title>
+            <xsl:comment>#972-38 </xsl:comment>
+            <body>
+                
+                
+                
+                <xsl:variable name="simpletable"> 
+                    <simpletable frame="all" id="{$uuid}BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.{local-name()}.dita" props="print__no">
+                        <strow>
+                            
+                            <xsl:for-each-group select="current-group()[nazwisko|nazwa|Pelna_nazwa_kontrahenta|ID]" group-by="@fid">
+                                <stentry>
+                                    <xsl:value-of select="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(concat('[',ID,'] ',imiona,' ',nazwisko,' ', nazwa, Pelna_nazwa_kontrahenta,' ',TERYT_names/miejscowosc,' ',TERYT_names/ulica_cecha,' ',TERYT_names/ulica_nazwa_1,' ',TERYT_names/ulica_nazwa_2,A_kod,' ', A_miejscowosc,' ',A_ulica ))"/>
+                                </stentry>
+                            </xsl:for-each-group>
+                        </strow>
+                        <strow>
+                            
+                            <xsl:for-each-group select="current-group()[nazwisko|nazwa|Pelna_nazwa_kontrahenta|ID]" group-by="@fid">
+                                <stentry>
+                                    <xsl:value-of select="count(current-group())"/>
+                                </stentry>
+                            </xsl:for-each-group>
+                        </strow>
+                    </simpletable>
+                </xsl:variable>
+                <xsl:choose>
+                    <xsl:when test="$simpletable//stentry">
+                        <p> Ilości powiązań  obiektu <xsl:value-of select="name()"/></p>
+                        <p>
+                            <foreign>
+                                <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
+                            </foreign>
+                            <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
+                                <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
+                                <xsl:with-param name="width" select="600"/>
+                            </xsl:apply-templates>
+                        </p>
+                    </xsl:when>
+                    
+                </xsl:choose>
+                
+                
+                
+                                
+                <xsl:comment>#1016-103 </xsl:comment>
+                
+                
+            </body>
+        </topic>
+    </xsl:template>
+    
+    
+    
+    <xsl:template mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.local-name" match="text()|comment()"/>
+    
+</xsl:stylesheet>

+ 200 - 83
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.xsl

@@ -8,7 +8,8 @@
     xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
     xmlns:p5="https://biuro.biall-net.pl/wfs"
     xmlns:get_wfs="http://biuro.biall-net.pl/WPS_Functions/get_wfs/get_wfs.xsd"
-    exclude-result-prefixes="xs system_cache__appinfo system_cache__dita ogr Benford default_db get_wfs p5"
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+    exclude-result-prefixes="xs system_cache__appinfo system_cache__dita ogr Benford default_db get_wfs p5 p5gnuplot"
     version="2.0">
     
     
@@ -33,6 +34,8 @@
     <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_FAKTURY.data_sprzedazy" select="'data_sprzedazy'"/>
     <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_FAKTURY.Kwota_netto" select="'Kwota_netto'"/>
     
+    <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person.print" select="'no'"/><!-- 'yes' -->
+    <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.print.middle" select="'no'"/>
     <!-- duze roznice
         <Data_zawarcia>29.04.2008</Data_zawarcia>
         <Okres_obowiazywania_umowy>Bezterminowa</Okres_obowiazywania_umowy>
@@ -152,8 +155,16 @@
             </xsl:apply-templates>
         </xsl:for-each>
         
+        <xsl:variable name="dita">
+            <xsl:call-template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all__x3A__preprocess"/>
+        </xsl:variable>
         
-        
+        <xsl:for-each select="$dita//simpletable">
+            <xsl:message>#163 ..stats_all for @id = <xsl:value-of select="@id"/></xsl:message>
+            <xsl:apply-templates select="." mode="system_cache__dita:graph__write_dita_preprocess">
+                <xsl:with-param name="fileindex" select="@id"/>
+            </xsl:apply-templates>
+        </xsl:for-each>
         
         <xsl:comment>#144 bocian-graph-2-html.preprocess </xsl:comment>
         <!--<xsl:variable name="dita">
@@ -586,20 +597,22 @@
         </topic>
     </xsl:template>
     
+    <xsl:template mode="system_cache__dita:map.title" match="L_APPOITMENT_INFO[text()]">
+        <xsl:text> raport: </xsl:text><xsl:value-of select="."/>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita:map.title" match="@fid">
+        <xsl:text> numer: </xsl:text><xsl:value-of select="get_wfs:id_from_fid(.)"/>
+    </xsl:template>
     
     <xsl:template match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA" mode="ditamap_root">
         <!--<xsl:result-document href="energa_bledy_rum.ditamap">-->
             <map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:map.xsd">
-                <title>raport <xsl:choose>
-                    <xsl:when test="L_APPOITMENT_INFO"><xsl:value-of select="L_APPOITMENT_INFO/text()"/></xsl:when>
-                </xsl:choose><xsl:choose>
-                    <xsl:when test="get_wfs:id_from_fid(@fid)"> numer <xsl:value-of select="get_wfs:id_from_fid(@fid)"/> </xsl:when>
-                </xsl:choose> 
-                    
-                    przetwarzanie powiązań BOCIAN 
-                    v2018-08-30(procesy5/rip)
-                </title>
+                
+                
+                <xsl:call-template name="system_cache__dita:map.title"/>
+                
                 <!-- osoby Akceptujacy_merytorycznie___nazwisko_i_imie -->
                 <xsl:variable name="resulset" select="."/> <!-- current() -->
                 
@@ -704,21 +717,7 @@
                     <xsl:copy-of select="$BI_audit_ENERGA_RUM_KONTRAHENCI_filtered"/>
                 </xsl:result-document>
                 
-                <topichead navtitle="Graf powiązań">
-                    <topicref href="bocian-graph-2-html.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita">
-                        <xsl:result-document href="{$temp}/{$uuid}/bocian-graph-2-html.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita">
-                            <xsl:apply-templates select="." mode="bocian-graph-2-html.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita"/>
-                        </xsl:result-document>
-                    </topicref>
-                </topichead>
-                
-                <topichead navtitle="Statystyka ilości powiązań">
-                    <topicref href="statystyka_pracownik.dita">
-                        <xsl:result-document href="{$temp}/{$uuid}/statystyka_pracownik.dita">
-                            <xsl:apply-templates select="." mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita"/>
-                        </xsl:result-document>
-                    </topicref>
-                </topichead>
+               
                 
                 <xsl:choose><!-- XX1 sure -->
                     <xsl:when test="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[not(local-name()='BI_audit_ENERGA_PRACOWNICY')]">
@@ -726,6 +725,7 @@
                         <topichead navtitle="Powiązania innych niż pracownicy obiektów wejściowych (1e) - grupowanie po źródłach">
                             <xsl:for-each select="$sources/sources/source">
                                 <topichead >
+                                    <xsl:attribute name="props">mode__ditamap__root</xsl:attribute>
                                     <xsl:choose>
                                         <xsl:when test="string-length(.) &gt; 0">
                                             <xsl:attribute name="navtitle">Źródło danych (<xsl:value-of select="."/>) - Powiązania innych niż pracownicy obiektów wejściowych (1e-s) </xsl:attribute>
@@ -1613,7 +1613,16 @@
                                                 </xsl:when>
                                                 <xsl:otherwise>
                                                     <xsl:variable name="refpos" select="concat($group_name,'_', position())"/>
-                                                    <topicref href="{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href($group_name)}"/>
+                                                    <topicref href="{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href($group_name)}">
+                                                        <xsl:attribute name="props">
+                                                            <xsl:choose>
+                                                                <xsl:when test="position()=1">pos__first</xsl:when>
+                                                                <xsl:when test="position()=last()">pos__last</xsl:when>
+                                                                <xsl:otherwise>pos__else</xsl:otherwise>
+                                                            </xsl:choose>
+                                                            <xsl:text> mode__cust_fe1626</xsl:text>
+                                                        </xsl:attribute>
+                                                    </topicref>
                                                 </xsl:otherwise>
                                             </xsl:choose>
                                         </xsl:when>
@@ -1633,7 +1642,25 @@
                     </xsl:for-each>
                 </topichead>
                 
+                <topichead navtitle="Graf powiązań">
+                    <topicref href="bocian-graph-2-html.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita">
+                        <xsl:result-document href="{$temp}/{$uuid}/bocian-graph-2-html.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita">
+                            <xsl:apply-templates select="." mode="bocian-graph-2-html.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita"/>
+                        </xsl:result-document>
+                    </topicref>
+                </topichead>
                 
+                <topichead navtitle="Statystyka ilości powiązań">
+                    <topicref href="statystyka_pracownik.dita" props="mode__BaERKP_statystyka_pracownik.dita">
+                        <xsl:result-document href="{$temp}/{$uuid}/statystyka_pracownik.dita">
+                            <xsl:apply-templates select="." mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita"/>
+                        </xsl:result-document>
+                    </topicref>
+                    
+                    <xsl:call-template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all"/>
+                    
+                    
+                </topichead>
                 
                 
             </map>
@@ -1676,31 +1703,50 @@
             <xsl:comment>#972 </xsl:comment>
             <body>
                 
-                <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY" group-by="@fud">
-                    <p><xsl:value-of select="ID"/> - <xsl:value-of select="nazwisko"/><xsl:text> </xsl:text> <xsl:value-of select="imiona"/><xsl:text> </xsl:text> <xsl:value-of select="nazwa"/><xsl:text> </xsl:text><xsl:if test="source">źródło:<xsl:value-of select="source"/></xsl:if></p>
+                <!--<xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]" group-by="@fud">
+                    <p><xsl:value-of select="ID"/> - <xsl:value-of select="nazwisko"/><xsl:text> </xsl:text> <xsl:value-of select="imiona"/><xsl:text> </xsl:text> <xsl:value-of select="nazwa"/><xsl:text> </xsl:text><xsl:text> </xsl:text> <xsl:value-of select="Pelna_nazwa_kontrahenta"/> <xsl:if test="source"> źródło:<xsl:value-of select="source"/></xsl:if></p>
+                    </xsl:for-each-group>-->
+                
+                <!--<xsl:variable name="avg">
+                    <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]" group-by="@fid">
+                        <xsl:variable name="pracownik" select="ID"/>
+                        <stentry><xsl:value-of select=" count( current-group() )"/></stentry>
                     </xsl:for-each-group>
+                </xsl:variable>-->
+                
+                <!--<xsl:variable name="avg.scale_max" select="(round(max($avg//stentry) div 100)) * 100"/>-->
                 
                 <xsl:variable name="simpletable"> 
-                    <simpletable frame="all" id="{$uuid}topic_simpletable_statystyka_pracownik.dita_table">
+                    <simpletable frame="all" id="{$uuid}topic_simpletable_statystyka_pracownik.dita_table" props="print__no">
                         <strow>
-                            <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY" group-by="@fid">
-                                <stentry><xsl:value-of select="ID"/></stentry>
+                            <stentry><xsl:value-of select="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names('skala 0')"/></stentry>
+                            <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]" group-by="@fid">
+                                <stentry>
+                                   
+                                            <xsl:value-of select="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(concat('[',ID,'] ',imiona,' ',nazwisko,' ', nazwa, Pelna_nazwa_kontrahenta ))"/>
+                                       
+                                    <!--<xsl:value-of select="ID"/>-->
+                                </stentry>
                             </xsl:for-each-group>
+                            <!--<stentry><xsl:value-of select="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(concat('skala ',$avg.scale_max))"/></stentry>-->
                         </strow>
                         <strow>
-                            <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY" group-by="@fid">
+                            <stentry>0</stentry>
+                            <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]" group-by="@fid">
                                 <xsl:variable name="pracownik" select="ID"/>
                                 <stentry><xsl:value-of select=" count( current-group() )"/></stentry>
                             </xsl:for-each-group>
+                            <!--<stentry><xsl:value-of select="$avg.scale_max"/></stentry>-->
                         </strow>
                     </simpletable>
                 </xsl:variable>
                 <xsl:choose>
                     <xsl:when test="$simpletable//stentry">
-                        <p> Ilości powiązań <note>Uwaga, w przypadku odnalezionych kilku tras do tego samego kontrahenta pokazywana jest jedna trasa (wykres nie zawiera tego ograniczenia)</note>
-                            
+                        <p> Ilości powiązań </p>
+                            <foreign>
                             <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
-                            <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
+                            </foreign>
+                         <p>   <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                                 <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                                 <xsl:with-param name="width" select="500"/>
                             </xsl:apply-templates>
@@ -1719,29 +1765,40 @@
                 
                 <xsl:comment>#1016 </xsl:comment>
                 
+                <!--<xsl:variable name="avg">
+                    <stentry><xsl:value-of select=" round(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/count(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object))"/></stentry>
+                </xsl:variable>-->
+                
                 <xsl:variable name="simpletable"> 
-                    <simpletable frame="all" id="{$uuid}topic_simpletable_statystyka_pracownik.dita_table_srednie">
+                    <simpletable frame="all" id="{$uuid}topic_simpletable_statystyka_pracownik.dita_table_srednie" props="print__no">
                         <strow>
-                            <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY" group-by="@fid">
-                                <stentry><xsl:value-of select="ID"/></stentry>
+                            <stentry><xsl:value-of select="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names('skala 0')"/></stentry>
+                            <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]" group-by="@fid">
+                                <stentry>
+                                            <xsl:value-of select="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(concat('[',ID,'] ',imiona,' ',nazwisko,' ', nazwa, Pelna_nazwa_kontrahenta ))"/>
+                                </stentry>
                             </xsl:for-each-group>
+                            <!--<stentry><xsl:value-of select="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(concat('skala ',$avg.scale_max))"/></stentry>-->
                         </strow>
                         <strow>
-                            <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY" group-by="@fid">
+                            <stentry>0</stentry>
+                            <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]" group-by="@fid">
                                 <xsl:variable name="pracownik" select="@fid"/>
-                                <stentry><xsl:value-of select=" round(count( $current/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY/@fid=$pracownik]/*[1]) div count( current-group() ) )"/></stentry>
+                                <stentry><xsl:value-of select=" round(count( $current/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[*[1]/@fid=$pracownik][ position() = 1]]/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object) div count( current-group() ) )"/></stentry>
                             </xsl:for-each-group>
+                            <!--<stentry><xsl:value-of select="$avg.scale_max"/></stentry>-->
                         </strow>
                     </simpletable>
                 </xsl:variable>
                 
                 <xsl:choose>
                     <xsl:when test="$simpletable//stentry">
-                        <p>Średnie długości powiązań
+                        <p>Średnie długości powiązań</p>
                             <!--<xsl:value-of select="count( $current/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY/ID=$PROCES_INIT_tree.ditamap]/object)"/>-->
-                            
+                            <foreign>
                             <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
-                            <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
+                            </foreign>
+                         <p>   <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                                 <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                                 <xsl:with-param name="width" select="500"/>
                             </xsl:apply-templates>
@@ -1757,7 +1814,10 @@
                     <simpletable frame="all" id="{$uuid}topic_simpletable_statystyka_pracownik.dita_table_kwoty">
                         <strow>
                             <xsl:for-each-group select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY" group-by="ID">
-                                <stentry><xsl:value-of select="ID"/></stentry>
+                                <stentry>
+                                            <xsl:value-of select="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(concat(ID,' ',imiona,' ',nazwisko,' ', substring(nazwa,1,10), substring(Pelna_nazwa_kontrahenta,1,10) ))"/>
+                                
+                                </stentry>
                             </xsl:for-each-group>
                         </strow>
                         <strow>
@@ -1787,9 +1847,9 @@
                     <xsl:when test="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_UMOWY.DISABLE"/>
                     <xsl:when test="not($current//BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_UMOWY/Wartosc/text())"/>
                     <xsl:when test="$simpletable//stentry">
-                        <p>Kwoty transakcji <note>w mln PLN</note>
+                        <p>Kwoty transakcji <note>w mln PLN</note></p>
                             <xsl:copy-of select="$simpletable"/>
-                            <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
+                         <p>   <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                                 <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                                 <xsl:with-param name="width" select="500"/>
                             </xsl:apply-templates>
@@ -1816,6 +1876,14 @@
         <topicref ><!-- XX7 href="{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','','1'))}" --> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',$position) -->
             <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$title)" copy-namespaces="no"/>
             <xsl:copy-of select="system_cache__dita:files.context.title.keys(.,$title)" copy-namespaces="no"/> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.dita.key.attr(.) -->
+            <xsl:attribute name="props">
+                <xsl:choose>
+                    <xsl:when test="position()=1">pos__first</xsl:when>
+                    <xsl:when test="position()=last()">pos__last</xsl:when>
+                    <xsl:otherwise>pos_else</xsl:otherwise>
+                </xsl:choose>
+                <xsl:text> mode__BaERK</xsl:text>
+            </xsl:attribute>
             <xsl:message>#781 debug : result doc: <xsl:value-of select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','','1'))"/>. dita</xsl:message>
             
             <xsl:variable name="BI_audit_ENERGA_RUM_UMOWY_fix" select="$resulset/BI_audit_ENERGA_RUM_KONTRAHENCI[@fid = current()/@fid ]"/> <!-- ]$resulset/BI_audit_ENERGA_RUM_KONTRAHENCI[ID/text()= current()/ID ] --><!-- XX1  -->
@@ -1936,8 +2004,6 @@
                                                 </xsl:for-each>
                                                 <stentry>Suma</stentry>
                                             </sthead>
-                                            
-                                            
                                             <xsl:for-each select="$Osoba_merytoryczna___nazwisko_i_imie//Osoba_merytoryczna___nazwisko_i_imie  ">
                                                 <xsl:variable name="Osoba" select="."/>
                                                 <strow>
@@ -2158,6 +2224,16 @@
         <xsl:variable name="refpos" select="concat($group_name,'_', position())"/>
         <xsl:variable name="context" select="."/>
         <topicref > <!-- XX7 {system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',$position))} --> <!-- {$group_name}/{$refpos}.dita --> <!-- {system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[position() =  last()]/*[1]/local-name(),parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[position() =  last()]/*[1]/@fid,$position)}.dita -->
+            <xsl:attribute name="print" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person.print"/>
+            <xsl:attribute name="props">
+                <xsl:value-of select="concat('print_',$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person.print)"/>
+                <xsl:choose>
+                    <xsl:when test="position()=1"> pos__first </xsl:when>
+                    <xsl:when test="position()=last()"> pos__last </xsl:when>
+                    <xsl:otherwise> pos__else</xsl:otherwise>
+                </xsl:choose>
+                <xsl:text> mode__BaERKPp</xsl:text>
+            </xsl:attribute>
             <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$title)" copy-namespaces="no"/>
             <xsl:copy-of select="system_cache__dita:files.context.title.keys(.,$title)" copy-namespaces="no"/>
             <xsl:copy-of select="system_cache__dita:files.context.title.keydef(.,'map',$title)" copy-namespaces="no"/>
@@ -2169,7 +2245,6 @@
             <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.title.context(.,$title)}" ><!-- XX7 href="{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',$position))}" --><!-- {$temp}/{$uuid}/{$group_name}/{$refpos}.dita --> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,ancestor::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[1]/local-name(),ancestor::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[1]/@fid,$position) --><!-- {$temp}/{$uuid}/{$group_name}/{$refpos}.dita XXS -->
                 <topic id="{$uuid}topic_simpletable_person_{$group_name}_{position()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
-                    
                     <xsl:variable name="count">
                         <count>
                             <!--<xsl:for-each-group select="current-group()/../../." group-by="concat(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid , parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  1]/*[ position() = 1]/@fid)">
@@ -2206,7 +2281,6 @@
                         <xsl:value-of select="pesel"/><xsl:text> </xsl:text> <xsl:value-of select="nazwa"/><xsl:text> </xsl:text>
                         <xsl:text> </xsl:text> <xsl:value-of select="A_miejscowosc"/><xsl:text> </xsl:text>
                         <xsl:text> </xsl:text> <xsl:value-of select="A_ulica"/><xsl:text> </xsl:text>
-                        
                     </title>-->
                     <!--<curr><xsl:copy-of select="current-group()"></xsl:copy-of></curr>-->
                     <!--<curr_parrent><xsl:copy-of select="current-group()/../../."></xsl:copy-of></curr_parrent>-->
@@ -2240,22 +2314,15 @@
                         <!--<xsl:for-each-group select="current-group()/../../.[ position() = 1 ] " group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid"><!-\- firmy do -\->
                             <xsl:variable name="position_1" select="position()"/>    
                             <xsl:variable name="firma_do_id" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid"/> 
-                            
                             <xsl:for-each-group select="$current_group_person[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() = last()]/*[position()=1]/@fid = $firma_do_id  and position() = 1] " group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  1]/*[ position() = 1]/@fid"> <!-\- pracownicy -\-> <!-\- X11 -\->
                                 <xsl:call-template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA.ends.desc.table">
-                                    <xsl:with-param name="row_obj_first" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]"/>
-                                    
+                                    <xsl:with-param name="row_obj_first" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]"/>                                    
                                     <xsl:with-param name="row_obj_last" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]"/>
-                                    
                                     <xsl:with-param name="context" select="."/>
                                 </xsl:call-template>
-                            </xsl:for-each-group>
-                            
-                            
+                            </xsl:for-each-group>                            
                         </xsl:for-each-group>-->
-                        
-                        <draft-comment author="a.binder">#2253 - testing  </draft-comment>
-                        
+                        <draft-comment author="a.binder">#2253 - testing  </draft-comment>                        
                         <!--<xsl:for-each-group select="current-group()/../../.[ position() &lt; 10 ] " group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid"><!-\- firmy do -\->
                             <xsl:variable name="position_1" select="position()"/>    
                             <xsl:variable name="firma_do_id" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid"/> <!-\- X11 -\->
@@ -2273,8 +2340,6 @@
                                 
                             </xsl:for-each-group>
                         </xsl:for-each-group>-->
-                        
-                        
                         <simpletable frame="all" relcolwidth="1* 3* 3*" id="{$uuid}simpletable_rows__child_person_{$group_name}_{$refpos}">
                             <strow>
                                 <stentry>Lp</stentry>
@@ -2282,44 +2347,33 @@
                                 <stentry> od</stentry>
                                 <!--<stentry> w</stentry>-->
                                 <stentry> do</stentry>
-                                
-                            </strow>
-                            
-                            
+                            </strow>                            
                             <!--<debug.1444>
                                 <xsl:copy-of select="current-group()"/>
                             </debug.1444>-->
-                            
                             <!-- <xsl:for-each select="current-group()[ position() &lt; 10 ] ">-->
                             <xsl:variable name="current_group_person" select="current-group()/../../."/>
                             <!--<debug.current_group_person>
                                 <xsl:copy-of select="$current_group_person"></xsl:copy-of>
                             </debug.current_group_person>-->
                             <xsl:message>#2425 current-group()/../../.[ position() &lt; 10 ]  = <xsl:value-of select="count(current-group()/../../.[ position() &lt; 10 ]) "/></xsl:message>
-                            
-                            
-                            
                             <xsl:for-each-group select="current-group()/../../.[ position() &lt; 10 ] " group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid"><!-- firmy do -->
                                 <xsl:variable name="position_1" select="position()"/>    
                                 <xsl:variable name="firma_do_id" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid"/> <!-- X11 -->
                                 <xsl:comment>#278 $firma_do_id=<xsl:value-of select="$firma_do_id"/>; $position_1=<xsl:value-of select="$position_1"/>; do <xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid"/></xsl:comment>
                                 <xsl:message>#278 $firma_do_id=<xsl:value-of select="$firma_do_id"/>; $position_1=<xsl:value-of select="$position_1"/>; do <xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ position() = 1]/@fid"/></xsl:message>
-                                
                                 <xsl:for-each-group select="$current_group_person[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() = last()]/*[position()=1]/@fid = $firma_do_id  and position() &lt; 10 ] " group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  1]/*[ position() = 1]/@fid"> <!-- pracownicy --> <!-- X11 -->
                                     <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.middle_ref" select=".">
                                         <xsl:with-param name="position_1" select="$position_1"/>
                                         <xsl:with-param name="position" select="position()"/>
                                         <xsl:with-param name="context" select="$context"/>
                                         <xsl:with-param name="title" select="$title"/>
+                                        
                                     </xsl:apply-templates>
                                 </xsl:for-each-group>
                             </xsl:for-each-group>
-                            
-                            
                             <!--</xsl:for-each>-->
                         </simpletable>
-                        
-                        
                     </body>
                 </topic>
             </xsl:result-document>
@@ -2345,7 +2399,16 @@
             <!-- new -->
             <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$group_name)" copy-namespaces="no"/>
             <xsl:copy-of select="system_cache__dita:files.context.title.keys(current(),$group_name)" copy-namespaces="no"/>
+            <xsl:attribute name="props">
+                <xsl:choose>
+                    <xsl:when test="position()=1">pos__fist</xsl:when>
+                    <xsl:when test="position()=last()">pos__last</xsl:when>
+                    <xsl:otherwise>pos__else</xsl:otherwise>
+                </xsl:choose>
+                <xsl:text> mode__raport_note</xsl:text>
+            </xsl:attribute>
             <xsl:copy-of select="system_cache__dita:files.href.context.title.keydef(system_cache__dita:files.key.title.context.href(current(),'map',$group_name),current(),'BI_audit_operational_raport_note')" copy-namespaces="no"/>
+            
             <!-- old -->
             <!--<xsl:copy-of select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.dita.fid.keydef($href,$group_name)" copy-namespaces="no"/>--><!-- TODO -->
             
@@ -2461,8 +2524,8 @@
             <stentry><xsl:value-of select="$position_1"/> / <!--<xsl:value-of select="$position"/> / --><xsl:value-of select="$position"/> </stentry>
             <!--<stentry>-->
             <!--<xsl:choose>
-                                                <xsl:when test="../../BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 2]/BI_audit_KRS_person/pesel[ //]"></xsl:when>
-                                            </xsl:choose>-->
+            <xsl:when test="../../BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 2]/BI_audit_KRS_person/pesel[ //]"></xsl:when>
+            </xsl:choose>-->
             <!--</stentry>-->
             <stentry>
                 <xref > <!-- href="../{ system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]/@fid ,BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = last()]/*[ position() = 1]/name(),BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = last()]/*[ position() = 1]/@fid,@pos))}" -->
@@ -2499,7 +2562,6 @@
                 <xref>
                     <xsl:copy-of select="system_cache__dita:files.context.title.keyref(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1],'BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA')" copy-namespaces="no"/>
                     link
-                    
                 </xref>
                 <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() =  last()]/*[ 1]"/>
                 <!--<xsl:choose>
@@ -2584,6 +2646,14 @@
         <xsl:variable name="refpos" select="concat(krs,'_', position())"/>
         
         <topicref href="{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',$position))}.dita">
+            <xsl:attribute name="props">
+                <xsl:choose>
+                    <xsl:when test="position()=1">pos__first</xsl:when>
+                    <xsl:when test="position()=last()">pos__last</xsl:when>
+                    <xsl:otherwise>pos__else</xsl:otherwise>
+                </xsl:choose>
+                <xsl:text> mode__POWIAZANIA_krs</xsl:text>
+            </xsl:attribute>
             <xsl:message>#545 debug : @fid=<xsl:value-of select="@fid"/>; $position=<xsl:value-of select="$position"/>;  result doc: <xsl:value-of select="$group_name"/>/<xsl:value-of select="$refpos"/></xsl:message>
             <xsl:result-document href="{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',$position))}">
                 <topic id="{$uuid}topic_simpletable_{$group_name}_{position()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -2622,6 +2692,7 @@
                                         <xsl:with-param name="position" select="position()"/>
                                         <xsl:with-param name="title" select="''"/>
                                         <xsl:with-param name="context" select="."/>
+                                        <xsl:with-param name="print" select="'no'"/>
                                     </xsl:apply-templates>
                                     <!--<xsl:variable name="group_name_refpos" select="../../BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY/system_cache__appinfo:truncate_special_and_do_uppercase(concat(imiona,'_',nazwisko,'_',nip))"/>
                                     <xsl:variable name="group_name_refpos.kon" select="concat(../../BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() = last() ]/*[ position() = 1]/system_cache__appinfo:truncate_special_and_do_uppercase(concat(ID,Pelna_nazwa_kontrahenta)),'1_DO')"/>
@@ -2895,6 +2966,14 @@
         <xsl:variable name="current" select="."/>
         <xsl:variable name="current_nip" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = last()]/*/NIP"/>
         <topicref href="{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',position()))}"> <!-- {$group_name}_DO/{position()}.dita -->
+            <xsl:attribute name="props">
+                <xsl:choose>
+                    <xsl:when test="position()=1">pos__first</xsl:when>
+                    <xsl:when test="position()=last()">pos__last</xsl:when>
+                    <xsl:otherwise>pos__else</xsl:otherwise>
+                </xsl:choose>
+                <xsl:text> mode__POWIAZANIA_row_do</xsl:text>
+            </xsl:attribute>
             <xsl:result-document href="{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',position()))}"> <!-- {$temp}/{$uuid}/{$group_name}_DO/{position()}.dita -->
                 <topic id="{$uuid}topic_simpletable_cheat_POS__row_{$group_name}_DO_{position()}_{ generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
@@ -3113,6 +3192,24 @@
         <topicref> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'',$current-grouping-key,$position)) --><!-- {$group_name}_LIST.dita -->
             <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$title)" copy-namespaces="no"/>
             <xsl:copy-of select="system_cache__dita:files.context.title.keys($context/*[1],$title)" copy-namespaces="no"/>
+            <xsl:if test="string-length($system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.print.middle) &gt; 0 and not(position() = 1) and not(position() = last())">
+                <xsl:attribute name="print">
+                   <!-- <xsl:choose>
+                        <xsl:when test="not(position() = 1) and not(position() = last())">-->
+                            <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.print.middle"/>
+                        <!--</xsl:when>
+                    </xsl:choose>-->
+                </xsl:attribute>
+                <xsl:attribute name="props" select="concat('print_',$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.print.middle)"/>
+            </xsl:if>
+            <xsl:attribute name="props">
+                <xsl:choose>
+                    <xsl:when test="position()=1">pos__first</xsl:when>
+                    <xsl:when test="position()= last()">pos__last</xsl:when>
+                    <xsl:otherwise>pos__else</xsl:otherwise>
+                </xsl:choose>
+                <xsl:text> mode__row_LISTA</xsl:text>
+            </xsl:attribute>
             <xsl:comment>#3063 system_cache__dita:files.href.context.title.keydef</xsl:comment>
             <xsl:copy-of select="system_cache__dita:files.href.context.title.keydef(system_cache__dita:files.key.title.context.href(current(),'map',$title),BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1],'BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA')" copy-namespaces="no"/>
             <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.title.context(.,$title)}"> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'',$current-grouping-key,$position)) --><!-- {$temp}/{$uuid}/{$group_name}_LIST.dita -->
@@ -3240,6 +3337,20 @@
         <topicref> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'',$current-grouping-key,$position)) --><!-- {$group_name}_LIST.dita -->
             <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$title)" copy-namespaces="no"/>
             <xsl:copy-of select="system_cache__dita:files.context.title.keys($context/*[1],$title)" copy-namespaces="no"/>
+            <xsl:attribute name="props">
+                <xsl:choose>
+                    <xsl:when test="position() = 1 ">pos_first</xsl:when>
+                    <xsl:when test="position() = last()">pos_last</xsl:when>
+                    <xsl:otherwise>pos_else</xsl:otherwise>
+                </xsl:choose>
+                <xsl:text> mode__row_LISTA</xsl:text>
+            </xsl:attribute>
+            <xsl:choose>
+                <xsl:when test="not(position()=1) and not(position()=last()) and string-length($system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.print.middle) &gt;0">
+                    <xsl:attribute name="print" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.print.middle"/>
+                </xsl:when>
+            </xsl:choose>
+            
             <xsl:comment>#3063_B system_cache__dita:files.href.context.title.keydef</xsl:comment>
             <xsl:copy-of select="system_cache__dita:files.href.context.title.keydef(system_cache__dita:files.key.title.context.href(current(),'map',$title),*[1],'BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA')" copy-namespaces="no"/>
             <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.title.context(.,$title)}"> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'',$current-grouping-key,$position)) --><!-- {$temp}/{$uuid}/{$group_name}_LIST.dita -->
@@ -3308,10 +3419,7 @@
                                     </stentry>
                                     
                                 </strow>
-                                        
-                                     
-                                    
-                               
+                             
                             </simpletable>
                         </p>
                     </body>
@@ -3371,6 +3479,7 @@
                         <xsl:choose>
                             <xsl:when test=" position() = 0 ">
                                 <topichead navtitle=" Pominięto więcej przykładów z uwagi na ilość"/>
+                                <xsl:attribute name="props">mode__POWIAZANIA_row</xsl:attribute>
                             </xsl:when>
                             <xsl:when test=" position() = 0 ">
                                 <xsl:variable name="current-save-file-id" select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',$position_save))"/>
@@ -3554,6 +3663,14 @@
                                 
                                 <topicref > <!-- <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$title)"/> --> <!-- {$group_name}.dita XXS -->
                                     <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$title)" copy-namespaces="no"/>
+                                    <xsl:attribute name="props">
+                                        <xsl:choose>
+                                            <xsl:when test="position()=1">pos_first</xsl:when>
+                                            <xsl:when test="position()=last()">pos_last</xsl:when>
+                                            <xsl:otherwise>pos_else</xsl:otherwise>
+                                        </xsl:choose>
+                                        <xsl:text> mode__POWIAZANIA_row_3624 </xsl:text>
+                                    </xsl:attribute>
                                     <xsl:choose>
                                         <xsl:when test="position() &gt; $limit">
                                             <xsl:attribute name="processing-role">resource-only</xsl:attribute> 

+ 6 - 4
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl

@@ -43,7 +43,7 @@
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
     
-    
+    <xsl:include href="../../../WPS_Functions/graph_gnuplot/p5gnuplot__x3A__system_cache__dita.xsl"/>
     
     
     <xsl:template mode="system_cache__dita:graph__write_dita_preprocess" match="simpletable">
@@ -53,13 +53,14 @@
             <xsl:with-param name="fileindex" select="$fileindex"/>
         </xsl:apply-templates>
         <xsl:result-document href="{$ditadir}/graph_to_image/{$fileindex}.gnuplot" omit-xml-declaration="yes">
-set terminal pngcairo font "arial,6" size 800,600
+set terminal pngcairo font "arial,9" size 800,600
 set nokey
 set output '<xsl:value-of select="$fileindex"/>.png'
 set boxwidth 0.75
 set style fill solid
 set title "Wykres"
-plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxes
+set xtics rotate
+plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 0:2:3:xtic(1) with boxes  lc variable
         </xsl:result-document>
         <xsl:result-document href="{$ditadir}/graph_to_image/{$fileindex}.gnuplot.dat" omit-xml-declaration="yes">
             <!--<system_cache__appinfo:graph_to_image.population.dat>-->
@@ -68,6 +69,7 @@ plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxe
             <xsl:variable name="strow" select="(strow|sthead)"/>
                 <xsl:message>#69 graph cols <xsl:value-of select="$cols"/></xsl:message>
                 <xsl:for-each select="1 to $cols">
+                    <xsl:variable name="column" select="."/>
                     <xsl:for-each select="$strow/stentry[ position() = current()]">
                         <xsl:choose>
                             <xsl:when test="position() = 1">
@@ -75,7 +77,7 @@ plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxe
                                 <xsl:value-of select="string(.)"/><xsl:text>&#09;</xsl:text>
                             </xsl:when>
                             <xsl:otherwise>
-                                <xsl:value-of select="string(.)"/><xsl:text>&#09;</xsl:text>
+                                <xsl:value-of select="string(.)"/><xsl:text>&#09;</xsl:text><xsl:text>&#09;</xsl:text><xsl:value-of select="$column"/>
                             </xsl:otherwise>
                         </xsl:choose>
                     </xsl:for-each>

+ 40 - 0
SE/schema/default_db_xml_cache.public/default_db/system_cache__dita.map.title__x3A__to_merge/tree_to_dita__x3A__map.title.xsl

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    exclude-result-prefixes="xs"
+    xmlns:get_wfs="http://biuro.biall-net.pl/WPS_Functions/get_wfs/get_wfs.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:p5="https://biuro.biall-net.pl/wfs"
+    version="2.0">
+    
+    
+    
+    <xsl:template name="system_cache__dita:map.title">
+        <title>raport  <xsl:text>
+            
+        </xsl:text>
+            
+            <xsl:apply-templates mode="system_cache__dita:map.title"/>
+            
+            <xsl:call-template name="system_cache__dita:parts__x3A__map.title"/>
+            
+          <xsl:text>
+              
+          </xsl:text>  
+            przetwarzanie powiązań BOCIAN 
+            rev B2018-09-18.A (procesy5/rip)
+        </title>
+    </xsl:template>
+    
+    
+    
+    <xsl:template mode="system_cache__dita:map.title" match="*"/>
+    <xsl:template mode="system_cache__dita:map.title" match="text()|comment()"/>    
+    
+    
+    
+    
+    
+    
+</xsl:stylesheet>

+ 22 - 0
SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__to_merge/tree_to_dita__x3A__parts.xsl

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    exclude-result-prefixes="xs"
+    xmlns:get_wfs="http://biuro.biall-net.pl/WPS_Functions/get_wfs/get_wfs.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:p5="https://biuro.biall-net.pl/wfs"
+    version="2.0">
+    
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    <xsl:include href="tree_to_dita__x3A__parts__x3A__map.title.xsl"/>
+    
+    <xsl:template mode="system_cache__dita:parts" match="*|text()|comment()"/>
+    
+    
+    
+    
+</xsl:stylesheet>

+ 46 - 0
SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__to_merge/tree_to_dita__x3A__parts__x3A__map.title.xsl

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    exclude-result-prefixes="xs"
+    xmlns:get_wfs="http://biuro.biall-net.pl/WPS_Functions/get_wfs/get_wfs.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:p5="https://biuro.biall-net.pl/wfs"
+    version="2.0">
+    
+    
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    <xsl:template name="system_cache__dita:parts__x3A__map.title">
+        <xsl:choose>
+            <xsl:when test="count(system_cache__dita:parts) &gt; 1 ">
+                <xsl:apply-templates mode="system_cache__dita:parts__x3A__map.title" select="@*"/><xsl:text> ( łącznie </xsl:text> <xsl:value-of select="count(system_cache__dita:parts)"/><xsl:text> części ) </xsl:text>
+            </xsl:when>
+            <xsl:when test="system_cache__dita:parts">
+                <xsl:apply-templates mode="system_cache__dita:parts__x3A__map.title" select="@*"/>
+                <xsl:text> (jedyna)
+                </xsl:text>
+            </xsl:when>
+        </xsl:choose>
+        
+    </xsl:template>
+    
+    
+    <xsl:template mode="system_cache__dita:parts__x3A__map.title" match="@system_cache__dita:part">
+        <xsl:text> , część nr: </xsl:text><xsl:value-of select="."/><xsl:text> 
+        </xsl:text>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita:parts__x3A__map.title" match="@*"/>
+         
+    
+    
+    <xsl:template mode="system_cache__dita:parts__x3A__map.title" match="*"/>
+        
+    <xsl:template mode="system_cache__dita:parts__x3A__map.title" match="text()|comment()"/>
+    
+    
+    
+</xsl:stylesheet>

+ 4 - 0
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.xsl

@@ -168,6 +168,10 @@
     
     <xsl:include href="../../WPS_Functions/system_ui_info_speech/p5suis.say_to_queue.copy_file.xsl"/><!-- TODO waitfor task communications -->
     
+    <!-- __x3A__to_merge -->
+    <xsl:include href="tree_to_dita__x3A__to_merge.xsl"/>
+    
+    
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
     

+ 29 - 0
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita__x3A__to_merge.xsl

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:Benford="https://pl.wikipedia.org/wiki/Rozkład_Benforda"
+    xmlns:math="http://exslt.org/math"
+    xmlns:func="http://exslt.org/functions"
+    xmlns:get_wfs="http://biuro.biall-net.pl/WPS_Functions/get_wfs/get_wfs.xsd"
+    xmlns:default_db__x3A__BI_audit_VALIDATE="https://biuro.biall-net.pl/wfs/default_db/BI_audit_VALIDATE"
+    xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
+    xmlns:ogr="http://ogr.maptools.org/"
+    xmlns:p5="https://biuro.biall-net.pl/wfs"
+    xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
+    extension-element-prefixes="math func system_cache__appinfo"
+    exclude-result-prefixes="xs p5 system_cache__appinfo system_cache__dita ogr Benford default_db get_wfs"
+    version="2.0">
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    
+    <xsl:include href="system_cache__dita.map.title__x3A__to_merge/tree_to_dita__x3A__map.title.xsl"/>
+    <xsl:include href="system_cache__dita__x3A__to_merge/tree_to_dita__x3A__parts.xsl"/>
+    <xsl:include href="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.stats_all.xsl"/>
+    <!--<xsl:include href="../../WPS_Functions/render-vis-js-in-electron-\-v0.0.1/p5.nodeCoords__x3A__tree_to_dita.xsl"/>-->
+    
+    
+</xsl:stylesheet>

+ 26 - 1
SE/se-lib/Route/UrlAction/BiAuditGenerate.php

@@ -3837,6 +3837,8 @@ class BiAuditPowiazania {
 	}
 
 	private function generateItemsResults($resultsPart = null) {
+		Lib::loadClass('Teryt');
+
 		if ($resultsPart === null) self::saveToLog("Generuję dane na potrzeby utworzenia pojedynczego pliku XML");
 		else {
 			self::saveToLog("Generuję dane na potrzeby utworzenia pliku XML ({$resultsPart})");
@@ -3856,19 +3858,27 @@ class BiAuditPowiazania {
 		$refUmowyToKontrahenci = BiAuditRefTables::getRefTable('BI_audit_ENERGA_RUM_UMOWY', 'BI_audit_ENERGA_RUM_KONTRAHENCI', true);
 		$refFakturyToKontrahenci = BiAuditRefTables::getRefTable('BI_audit_ENERGA_FAKTURY', 'BI_audit_ENERGA_RUM_KONTRAHENCI', true);
 		$refKwRequestedToKwRequestedPerson = BiAuditRefTables::getRefTable('BI_audit_KW_requested', 'BI_audit_KW_requested_person', true);
+		$refPracownicyToPracownicyAdresy = BiAuditRefTables::getRefTable('BI_audit_ENERGA_PRACOWNICY', 'BI_audit_ENERGA_PRACOWNICY_adresy', true);
 
 		$this->items_results[$resultsPart] = [];
 		$this->items_results[$resultsPart]['@attributes'] = ['xmlns:system_cache__dita' => 'http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd'];
 		$this->items_results[$resultsPart][$xmlTask]['@attributes'] = ['fid' => "{$xmlTask}.{$this->ID}"];
-		$this->items_results[$resultsPart][$xmlTask]['L_APPOITMENT_INFO'] = $this->L_APPOITMENT_INFO;
 
 		if ($resultsPart === null) {
 			$results = $this->results;
+			$parts = 0;
 		} else {
 			$results = (!empty($this->splittedResults[$resultsPart])) ? $this->splittedResults[$resultsPart] : [];
+			$parts = count($this->splittedResults);
 			$this->items_results[$resultsPart][$xmlTask]['@attributes']['system_cache__dita:part'] = ($resultsPart + 1);
 		}
 
+		for ($i = 1; $i <= $parts; $i++) {
+			$this->items_results[$resultsPart][$xmlTask]['system_cache__dita:parts'][] = ['@attributes' => ['system_cache__dita:part' => $i]];
+		}
+
+		$this->items_results[$resultsPart][$xmlTask]['L_APPOITMENT_INFO'] = $this->L_APPOITMENT_INFO;
+
 		foreach ($results as $key => $result) {
 			if ($this->fidRow) $item_results = ['@attributes' => ['fid' => "{$xmlRow}.{$this->fidRow[$key]['fid']}"]];
 			foreach ($result as $ID => $rel) {
@@ -3897,6 +3907,20 @@ class BiAuditPowiazania {
 					}
 				}
 
+				if ($row['REMOTE_TABLE'] == "BI_audit_ENERGA_PRACOWNICY") {
+					$query = "select pa.* from BI_audit_ENERGA_PRACOWNICY_adresy pa join `{$refPracownicyToPracownicyAdresy}` ref on pa.ID = ref.REMOTE_PRIMARY_KEY where ref.PRIMARY_KEY = '{$row['REMOTE_ID']}'";
+					$adresy = DB::getPDO()->fetchAll($query);
+					foreach ($adresy as $adres) {
+						$item_result[$row['REMOTE_TABLE']]['BI_audit_ENERGA_PRACOWNICY_adresy'][] = array_merge(['@attributes' => ['fid' => "BI_audit_ENERGA_PRACOWNICY_adresy.{$adres['ID']}"]], $adres);
+					}
+				} elseif ($row['REMOTE_TABLE'] == 'TERYT_adresy') {
+					try {
+						$teryt = Teryt::getNames(['SYM' => $obj->TERYT_SYM, 'SYM_UL' => $obj->TERYT_SYM_UL]);
+						$item_result[$row['REMOTE_TABLE']]['TERYT_names'] = $teryt;
+					} catch (Exception $e) {
+					}
+				}
+
 				if ($rel) $item_result['relation_from'] = $this->relationName($rel);
 				$item_results[$xmlObject][] = $item_result;
 
@@ -3926,6 +3950,7 @@ class BiAuditPowiazania {
 					}
 
 					if ($faktury || $umowy) {
+						$item_kontrahenci = [];
 						$item_kontrahenci['@attributes'] = ['fid' => "{$row['REMOTE_TABLE']}.{$row['REMOTE_ID']}"];
 						$item_kontrahenci['ID'] = $row['REMOTE_ID'];
 						if ($faktury) $item_kontrahenci['BI_audit_ENERGA_FAKTURY'] = $faktury;

+ 5 - 5
SE/se-lib/Teryt.php

@@ -299,10 +299,10 @@ class Teryt {
 		$result = self::verify($args);
 
 		if ($args['SYM_UL']) {
-			$return['ulica_cecha'] = $result['CECHA'];
-			$return['ulica_nazwa_1'] = $result['NAZWA_1'];
-			$return['ulica_nazwa_2'] = $result['NAZWA_2'];
-		}
+			$return_ul['ulica_cecha'] = $result['CECHA'];
+			$return_ul['ulica_nazwa_1'] = $result['NAZWA_1'];
+			$return_ul['ulica_nazwa_2'] = $result['NAZWA_2'];
+		} else $return_ul = [];
 
 		if (isset($args['WOJ'])) {
 			if ($args['WOJ'] != $result['WOJ']) throw new Exception("Invalid WOJ");
@@ -336,7 +336,7 @@ class Teryt {
 		if (count($result) > 1) throw new Exception("Found too many miejscowoscs");
 		$return['miejscowosc'] = $result[0]['NAZWA'];
 
-		return $return;
+		return array_merge($return, $return_ul);
 	}
 
 }

+ 4 - 9
doc/SE/PLIKI/BI_audit_POWIAZANIA/.tasks/.tasks.ditamap

@@ -25,15 +25,10 @@
         navtitle="generatePowiazania-136.log"
         href="generatePowiazania-136.log"
         props=" imported  log "/>
-    <topicref href="generatePowiazania-136.php.dita"
-        keys="generatePowiazania-136.php"
-        keyscope="generatePowiazania-136.php"
-        props=" imported ">
-        <keydef format="php"
-            processing-role="resource-only"
-            navtitle="generatePowiazania-136.php"
-            keys="generatePowiazania-136.php"
-            href="generatePowiazania-136.php"
+    <topicref href="generatePowiazania-136.php.dita" keys="generatePowiazania-136.php"
+        keyscope="generatePowiazania-136.php" props=" imported howto_regenerate_powiazania">
+        <keydef format="php" processing-role="resource-only" navtitle="generatePowiazania-136.php"
+            keys="generatePowiazania-136.php" href="generatePowiazania-136.php"
             props=" imported  php "/>
     </topicref>
     <!--

+ 40 - 0
doc/__x3A__current/error.symlink_danger_loops.config.dita

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
+<topic id="error.symlink_danger_loops.config">
+    <title>error.SYMLINK_DANGER_LOOPS.config</title>
+    <body>
+        <p></p>
+    </body>
+    <topic id="topic_us3_2dc_nfb" props="input">
+        <title>input</title>
+        <abstract>
+            <codeblock>    [echo]          #84 [ E R R O R  ] [ error.SYMLINK_DANGER_LOOPS.config ]          
+        error.SYMLINK_DANGER_LOOPS.config      
+            /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/config.symlink/config/config   </codeblock>
+        </abstract>
+    </topic>
+    <topic id="topic_xdh_gdc_nfb" props="important_action_to_apply"
+        audience="system_integrator  role.mobile_systems_developper administrator">
+        <title>what to do</title>
+        <body>
+            <p><cmdname props="input">rm
+                    /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/config.symlink/config/config</cmdname></p>
+            <codeblock props="output"> rm /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/config.symlink/config/config
+remove /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/config.symlink/config/config? y
+[root@biuro.biall-net.pl ~]# ls /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/config.symlink/
+[root@biuro.biall-net.pl ~]# ls /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/config.symlink
+</codeblock>
+        </body>
+        <topic id="topic_irw_5dc_nfb">
+            <title>do also</title>
+            <body>
+                <codeblock>rm /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/repository.symlink/repository/repository</codeblock>
+                <codeblock>ls /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/temp.symlink/
+WPS_Functions/ p5build_SE/    temp/          
+[root@biuro.biall-net.pl ~]# rm /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/temp.symlink/temp/temp
+remove /Library/Server/Web/Data/Sites/SE-production-git/SE/schema/temp.symlink/temp/temp? y
+</codeblock>
+            </body>
+        </topic>
+    </topic>
+</topic>

+ 6 - 0
doc/__x3A__current/x3a__current.ditamap

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
+<map>
+    <title>__x3A__current</title>
+    <topicref href="error.symlink_danger_loops.config.dita"/>
+</map>

+ 1 - 0
doc/procesy5_doc.ditamap

@@ -5,4 +5,5 @@
     <topicref href="SE/PLIKI/BI_audit_POWIAZANIA/.tasks/.tasks.ditamap" format="ditamap"/>
     <topicref href="SE/se-lib/Route/UrlAction/UrlAction.ditamap" format="ditamap"/>
     <topicref href="scenario/se.doc.scenario.ditamap" format="ditamap"/>
+    <topicref href="__x3A__current/x3a__current.ditamap" format="ditamap"/>
 </map>