ADMIN_USERS__wyposazenie.xsl 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  5. xmlns:system_cache__resources_tree_required_occurs_raport="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/resources_tree_required_occurs_raport"
  6. xmlns:default_db="http://biuro.biall-net.pl/xmlschema_procesy5/default_db"
  7. xmlns:default_db__ADMIN_USERS="default_db:ADMIN_USERS"
  8. xmlns:default_db__CRM_LISTA_ZASOBOW_OFFERS="default_db:CRM_LISTA_ZASOBOW_OFFERS"
  9. xmlns:default_db__CRM_LISTA_ZASOBOW="default_db:CRM_LISTA_ZASOBOW"
  10. xmlns:default_db__DEVICES="default_db:DEVICES"
  11. xmlns:default_db__TELBOXES="default_db:TELBOXES"
  12. exclude-result-prefixes="xs"
  13. version="2.0">
  14. <!--funkcje do generowania umow o prace itp -->
  15. <xsl:import href="import_resource_table_xml_from_api.xsl"/>
  16. <xsl:import href="form_occurs_max_sequence.xsl"/>
  17. <xsl:import href="get_all_xsd.xsl"/>
  18. <xsl:import href="CRM_LISTA_ZASOBOW_tree.xsl"/>
  19. <xsl:import href="IN7_MK_BAZA_DYSTRYBUCJI_tree.xsl"/>
  20. <xsl:import href="resources_tree_required_occurs_raport.xsl"/>
  21. <xsl:import href="CRM_LISTA_ZASOBOW_OFFERS__options.xsl"/>
  22. <xsl:variable name="ADMIN_USERS">
  23. <xsl:call-template name="import_resource_table_xml_from_api">
  24. <xsl:with-param name="cache" select="'read'"/>
  25. <xsl:with-param name="resource" select="'ADMIN_USERS'"/>
  26. </xsl:call-template>
  27. </xsl:variable>
  28. <xsl:variable name="DEVICES">
  29. <xsl:call-template name="import_resource_table_xml_from_api">
  30. <xsl:with-param name="cache" select="'read'"/>
  31. <xsl:with-param name="resource" select="'DEVICES'"/>
  32. </xsl:call-template>
  33. </xsl:variable>
  34. <xsl:variable name="system_cache__appinfo:_build_resources_tree_with_instances_refs">
  35. <xsl:call-template name="system_cache__appinfo:_build_resources_tree_with_instances_refs"/>
  36. </xsl:variable>
  37. <xsl:variable name="CRM_LISTA_ZASOBOW">
  38. <xsl:call-template name="import_resource_table_xml_from_api">
  39. <xsl:with-param name="cache" select="'read'"/>
  40. <xsl:with-param name="resource" select="'CRM_LISTA_ZASOBOW'"/>
  41. </xsl:call-template>
  42. </xsl:variable>
  43. <xsl:template name="main">
  44. <!--<xsl:variable name="test">
  45. <ADMIN_USERS>
  46. <ID>9</ID>
  47. <ADM_ACCOUNT>a.binder</ADM_ACCOUNT>
  48. <ADM_NAME/>
  49. <ADM_PHONE/>
  50. <ADM_ADDRESS_CITY/>
  51. <ADM_ADDRESS_STREET/>
  52. <ADM_ADDRESS_HOUSE/>
  53. </ADMIN_USERS>
  54. </xsl:variable>-->
  55. <xsl:apply-templates mode="default_db:ADMIN_USERS" select="$ADMIN_USERS//item[ID='11' or ID='9' or ADM_ACCOUNT='remiszewskim' or ADM_ACCOUNT='crash' or ID='4889' or ID='5141' or ADM_ACCOUNT='mateusz.klimek' or ID='5318' or ADM_ACCOUNT='dojlidom' ]"/>
  56. <!--<xsl:result-document href="../default_db.instance.xml/transformed/ADMIN_USERS__wyposazenie_all.html">
  57. <xsl:call-template name="wyposazenie_all"/>
  58. </xsl:result-document>-->
  59. <xsl:result-document href="../default_db.instance.xml/transformed/ADMIN_USERS__wyposazenie__allowed_functions.xml">
  60. <default_db__ADMIN_USERS:allowed_functions>
  61. <xsl:apply-templates mode="default_db__ADMIN_USERS:allowed_functions" select="$ADMIN_USERS//item[ID='11' or ID='9' or ADM_ACCOUNT='remiszewskim' or ADM_ACCOUNT='crash' or ID='4889']"/>
  62. </default_db__ADMIN_USERS:allowed_functions>
  63. </xsl:result-document>
  64. </xsl:template>
  65. <!-- funkcja do wyzwolenia podczas chodzenia przez GUI po tabeli rekordow w ADMIN_USERS wykrywajaca dla ktorych rekordow mozna wyzwolic jakas funkcje -->
  66. <xsl:template match="node()" mode="default_db__ADMIN_USERS:allowed_functions">
  67. <xsl:choose>
  68. <xsl:when test="ID and A_STATUS!='DELETED'">
  69. <system_cache__appinfo:apply-templates>
  70. <xsl:attribute name="mode" select="'default_db:ADMIN_USERS'"/>
  71. <xsl:attribute name="output" select="'html'"/>
  72. <xsl:attribute name="description" select="'wyposazenie pracownika widok html'"/>
  73. <source_record>
  74. <xsl:copy-of select="ID"/>
  75. </source_record>
  76. </system_cache__appinfo:apply-templates>
  77. </xsl:when>
  78. </xsl:choose>
  79. <!-- TODO jakos by to ograniczyc/podlaczyc do widoku biezacej listy elementow - czyli musze wiedziec, ze mam wiecej elementow na ekranie -czyli jakis count(node())&gt;1 ? -->
  80. <system_cache__appinfo:call-template>
  81. <xsl:attribute name="name" select="'wyposazenie_all'"/>
  82. <xsl:attribute name="output" select="'html'"/>
  83. <xsl:attribute name="description" select="'wyposazenie wszystkich pracownikow widok html'"/>
  84. <source_record>
  85. <xsl:comment>TODO tutaj jakas lista rekordow lub filtr dla ktorego to jest dostepne jako caly ekran lub kawalek</xsl:comment>
  86. </source_record>
  87. </system_cache__appinfo:call-template>
  88. </xsl:template>
  89. <xsl:template match="node()" mode="default_db:ADMIN_USERS">
  90. <xsl:variable name="ADMIN_USERS_node" select="current()"/>
  91. <xsl:variable name="ADMIN_USERS__wyposazenie">
  92. <xsl:call-template name="wyposazenie_i_braki_for_user">
  93. <xsl:with-param name="ADMIN_USERS_node" select="$ADMIN_USERS_node"/>
  94. </xsl:call-template>
  95. </xsl:variable>
  96. <xsl:result-document href="{concat('../default_db.instance.xml/transformed/ADMIN_USERS__wyposazenie_',$ADMIN_USERS_node/ID,'.xml')}">
  97. <xsl:copy-of select="$ADMIN_USERS__wyposazenie"></xsl:copy-of>
  98. </xsl:result-document>
  99. <xsl:apply-templates mode="wyposazenie_html" select="$ADMIN_USERS__wyposazenie">
  100. <xsl:with-param name="ADMIN_USERS_node" select="$ADMIN_USERS_node"/>
  101. </xsl:apply-templates>
  102. </xsl:template>
  103. <xsl:template name="wyposazenie_i_braki_for_user">
  104. <xsl:param name="ADMIN_USERS_node" required="yes"/>
  105. <ADMIN_USERS__wyposazenie>
  106. <xsl:attribute name="ADMIN_USERS_ID" select="$ADMIN_USERS_node/ID"></xsl:attribute>
  107. <wyposazenie>
  108. <xsl:for-each select="$system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[ name()!='ERROR_NOT_ENOUGH' and @RESOURCE and @TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID ] ">
  109. <xsl:copy-of select="."/>
  110. </xsl:for-each>
  111. </wyposazenie>
  112. <braki>
  113. <xsl:for-each-group select="$system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[ name()='ERROR_NOT_ENOUGH' and @TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID ]" group-by="@ID" >
  114. <ERROR_NOT_ENOUGH>
  115. <xsl:for-each select="@*">
  116. <xsl:attribute name="{name()}" select="."/>
  117. </xsl:for-each>
  118. <xsl:copy-of select="DESC"/>
  119. <xsl:call-template name="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource">
  120. <xsl:with-param name="default_db__CRM_LISTA_ZASOBOW:ID" select="@ID"/>
  121. </xsl:call-template>
  122. </ERROR_NOT_ENOUGH>
  123. </xsl:for-each-group>
  124. </braki>
  125. <errors_all_structures>
  126. <!-- wykrycie bledow w postaci nie odnalezionych numerow INSTANCES[@ID], podczas gdy ich RESOURCE_ID bylo w drzewie-->
  127. <DEVICES>
  128. <xsl:for-each select="$DEVICES//item">
  129. <xsl:variable name="ID" select="ID"/>
  130. <xsl:variable name="CRM_LISTA_ZASOBOW_ID" select="CRM_LISTA_ZASOBOW_ID"/>
  131. <xsl:choose>
  132. <xsl:when test="CRM_LISTA_ZASOBOW_ID=''">
  133. <ERROR_NOT_SET_RESOURCE_ID>
  134. <xsl:attribute name="ID" select="$ID"/>
  135. </ERROR_NOT_SET_RESOURCE_ID>
  136. </xsl:when>
  137. <xsl:when test="$system_cache__appinfo:_build_resources_tree_with_instances_refs//DEVICES[@RESOURCE=$CRM_LISTA_ZASOBOW_ID]">
  138. <xsl:choose>
  139. <xsl:when test="$system_cache__appinfo:_build_resources_tree_with_instances_refs//DEVICES[@RESOURCE=$CRM_LISTA_ZASOBOW_ID and @ID=$ID]">
  140. <!-- <OK_INSTANCE_FOUND>
  141. <xsl:attribute name="ID" select="$ID"></xsl:attribute>
  142. </OK_INSTANCE_FOUND>-->
  143. </xsl:when>
  144. <xsl:otherwise>
  145. <ERROR_INSTANCE_NOT_FOUND_IN_TREE>
  146. <xsl:attribute name="ID" select="$ID"/>
  147. <xsl:attribute name="CRM_LISTA_ZASOBOW_ID" select="$CRM_LISTA_ZASOBOW_ID"/>
  148. <xsl:attribute name="TYPE" select="$CRM_LISTA_ZASOBOW//item[ID=$CRM_LISTA_ZASOBOW_ID]/TYPE"/>
  149. <xsl:attribute name="A_STATUS" select="$CRM_LISTA_ZASOBOW//item[ID=$CRM_LISTA_ZASOBOW_ID]/A_STATUS"/>
  150. <xsl:choose>
  151. <xsl:when test="$system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[@ID=$CRM_LISTA_ZASOBOW_ID and name()='ERROR_NOT_ENOUGH']/@TREE_ADMIN_USERS_ID">
  152. <xsl:variable name="TREE_ADMIN_USERS_ID" select="string-join($system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[@ID=$CRM_LISTA_ZASOBOW_ID and name()='ERROR_NOT_ENOUGH']/@TREE_ADMIN_USERS_ID,' ')"/>
  153. <xsl:attribute name="TREE_ADMIN_USERS_ID" select="distinct-values(tokenize($TREE_ADMIN_USERS_ID,' '))"/>
  154. </xsl:when>
  155. <xsl:otherwise>
  156. <xsl:variable name="TREE_ADMIN_USERS_ID" select="string-join($system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[@RESOURCE=$CRM_LISTA_ZASOBOW_ID and name()='DEVICES']/@TREE_ADMIN_USERS_ID,' ')"/>
  157. <xsl:attribute name="TREE_ADMIN_USERS_ID" select="distinct-values(tokenize($TREE_ADMIN_USERS_ID,' '))"/>
  158. </xsl:otherwise>
  159. </xsl:choose>
  160. <DESC><xsl:value-of select="$CRM_LISTA_ZASOBOW//item[ID=$CRM_LISTA_ZASOBOW_ID]/DESC"/></DESC>
  161. <xsl:copy-of select="T_DEVICE_TYPE"/>
  162. <xsl:copy-of select="T_DEVICE_INFO"/>
  163. <xsl:copy-of select="T_DEVICE_SERIAL"/>
  164. </ERROR_INSTANCE_NOT_FOUND_IN_TREE>
  165. </xsl:otherwise>
  166. </xsl:choose>
  167. </xsl:when>
  168. </xsl:choose>
  169. </xsl:for-each>
  170. </DEVICES>
  171. <TELBOXES>
  172. <xsl:for-each select="$TELBOXES//item">
  173. <xsl:variable name="ID" select="ID"/>
  174. <xsl:variable name="CRM_LISTA_ZASOBOW_ID" select="CRM_LISTA_ZASOBOW_ID"/>
  175. <xsl:choose>
  176. <xsl:when test="CRM_LISTA_ZASOBOW_ID=''">
  177. <ERROR_NOT_SET_RESOURCE_ID>
  178. <xsl:attribute name="ID" select="$ID"/>
  179. </ERROR_NOT_SET_RESOURCE_ID>
  180. </xsl:when>
  181. <xsl:when test="$system_cache__appinfo:_build_resources_tree_with_instances_refs//TELBOXES[@RESOURCE=$CRM_LISTA_ZASOBOW_ID]">
  182. <xsl:choose>
  183. <xsl:when test="$system_cache__appinfo:_build_resources_tree_with_instances_refs//TELBOXES[@RESOURCE=$CRM_LISTA_ZASOBOW_ID and @ID=$ID]">
  184. <!-- <OK_INSTANCE_FOUND>
  185. <xsl:attribute name="ID" select="$ID"></xsl:attribute>
  186. </OK_INSTANCE_FOUND>-->
  187. </xsl:when>
  188. <xsl:otherwise>
  189. <ERROR_INSTANCE_NOT_FOUND_IN_TREE>
  190. <xsl:attribute name="ID" select="$ID"/>
  191. <xsl:attribute name="CRM_LISTA_ZASOBOW_ID" select="$CRM_LISTA_ZASOBOW_ID"/>
  192. <xsl:attribute name="TYPE" select="$CRM_LISTA_ZASOBOW//item[ID=$CRM_LISTA_ZASOBOW_ID]/TYPE"/>
  193. <xsl:attribute name="A_STATUS" select="$CRM_LISTA_ZASOBOW//item[ID=$CRM_LISTA_ZASOBOW_ID]/A_STATUS"/>
  194. <xsl:choose>
  195. <xsl:when test="$system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[@ID=$CRM_LISTA_ZASOBOW_ID and name()='ERROR_NOT_ENOUGH']/@TREE_ADMIN_USERS_ID">
  196. <xsl:variable name="TREE_ADMIN_USERS_ID" select="string-join($system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[@ID=$CRM_LISTA_ZASOBOW_ID and name()='ERROR_NOT_ENOUGH']/@TREE_ADMIN_USERS_ID,' ')"/>
  197. <xsl:attribute name="TREE_ADMIN_USERS_ID" select="distinct-values(tokenize($TREE_ADMIN_USERS_ID,' '))"/>
  198. </xsl:when>
  199. <xsl:otherwise>
  200. <xsl:variable name="TREE_ADMIN_USERS_ID" select="string-join($system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[@RESOURCE=$CRM_LISTA_ZASOBOW_ID and name()='DEVICES']/@TREE_ADMIN_USERS_ID,' ')"/>
  201. <xsl:attribute name="TREE_ADMIN_USERS_ID" select="distinct-values(tokenize($TREE_ADMIN_USERS_ID,' '))"/>
  202. </xsl:otherwise>
  203. </xsl:choose>
  204. <DESC><xsl:value-of select="$CRM_LISTA_ZASOBOW//item[ID=$CRM_LISTA_ZASOBOW_ID]/DESC"/></DESC>
  205. <xsl:copy-of select="T_TELBOX_NAME"/>
  206. </ERROR_INSTANCE_NOT_FOUND_IN_TREE>
  207. </xsl:otherwise>
  208. </xsl:choose>
  209. </xsl:when>
  210. </xsl:choose>
  211. </xsl:for-each>
  212. </TELBOXES>
  213. </errors_all_structures>
  214. <braki_all_structures>
  215. <xsl:for-each-group select="$system_cache__appinfo:_build_resources_tree_with_instances_refs//node()[ name()='ERROR_NOT_ENOUGH']" group-by="@ID" >
  216. <ERROR_NOT_ENOUGH>
  217. <xsl:for-each select="@*">
  218. <xsl:attribute name="{name()}" select="."/>
  219. </xsl:for-each>
  220. <xsl:copy-of select="DESC"/>
  221. <xsl:call-template name="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource">
  222. <xsl:with-param name="default_db__CRM_LISTA_ZASOBOW:ID" select="@ID"/>
  223. </xsl:call-template>
  224. </ERROR_NOT_ENOUGH>
  225. </xsl:for-each-group>
  226. </braki_all_structures>
  227. </ADMIN_USERS__wyposazenie>
  228. </xsl:template>
  229. <xsl:template name="wyposazenie_all">
  230. <html>
  231. <head>Wyposazenia</head>
  232. <body>
  233. <xsl:for-each select="$ADMIN_USERS//item[A_STATUS='NORMAL' and EMPLOYEE_TYPE='Pracownik']">
  234. <xsl:variable name="ADMIN_USERS_node" select="current()"/>
  235. <xsl:variable name="ADMIN_USERS__wyposazenie">
  236. <xsl:call-template name="wyposazenie_i_braki_for_user">
  237. <xsl:with-param name="ADMIN_USERS_node" select="$ADMIN_USERS_node"/>
  238. </xsl:call-template>
  239. </xsl:variable>
  240. <!-- <xsl:result-document href="{concat('../default_db.instance.xml/transformed/ADMIN_USERS__wyposazenie_all_',$ADMIN_USERS_node/ID,'.xml')}">
  241. <xsl:copy-of select="$ADMIN_USERS__wyposazenie"></xsl:copy-of>
  242. </xsl:result-document>-->
  243. <xsl:apply-templates mode="wyposazenie_inside" select="$ADMIN_USERS__wyposazenie">
  244. <xsl:with-param name="ADMIN_USERS_node" select="$ADMIN_USERS_node"/>
  245. </xsl:apply-templates>
  246. </xsl:for-each>
  247. </body>
  248. </html>
  249. </xsl:template>
  250. <xsl:template match="node()" mode="wyposazenie_inside">
  251. <xsl:param name="ADMIN_USERS_node"/>
  252. Wyposażenie aktualnie przydzielone: dla <xsl:value-of select="$ADMIN_USERS_node/ADM_NAME"/> (ID:<xsl:value-of select="$ADMIN_USERS_node/ID"/>/Login:<xsl:value-of select="$ADMIN_USERS_node/ADM_ACCOUNT"/>)
  253. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  254. <tr>
  255. <th>Typ</th>
  256. <th>Nr zasobu</th>
  257. <th>Nazwa</th>
  258. <th>Opis</th>
  259. <th>Producent</th>
  260. <th>Wartość</th>
  261. <th>Właściciel</th>
  262. <th>Oznaczenie</th>
  263. </tr>
  264. <xsl:for-each-group select="/ADMIN_USERS__wyposazenie/wyposazenie//node()[@RESOURCE and @TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID and (name()!='ADMIN_USERS' or @source!='ALIAS') ]" group-by="concat(@ID,'-',@RESOURCE)">
  265. <tr>
  266. <td><xsl:value-of select="name()"/></td>
  267. <td><xsl:value-of select="@RESOURCE"/></td>
  268. <td><xsl:value-of select="@ID"/></td>
  269. <td><xsl:value-of select="DESC"/></td>
  270. <td>
  271. <xsl:if test="T_DEVICE_TYPE">&#160;<xsl:value-of select="T_DEVICE_TYPE"/></xsl:if>
  272. <xsl:if test="T_DEVICE_INFO">&#160;<xsl:value-of select="T_DEVICE_INFO"/></xsl:if>
  273. &#160;<xsl:value-of select="@A_STATUS"/>
  274. <xsl:if test="ADM_PHONE"><pre> tel: <xsl:value-of select="ADM_PHONE"/></pre></xsl:if>
  275. </td>
  276. <td><xsl:value-of select="T_PRODUCER"/></td>
  277. <td><xsl:value-of select="F_BILL_COST"/></td>
  278. <td><xsl:value-of select="T_OWNER"/></td>
  279. <td><xsl:value-of select="T_DEVICE_SERIAL"/>
  280. &#160;<xsl:value-of select="T_TELBOX_NAME"/>
  281. </td>
  282. </tr>
  283. </xsl:for-each-group>
  284. </table>
  285. <br/>
  286. Wyposażenie aktualnie brakujące:
  287. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  288. <tr>
  289. <th>Typ</th>
  290. <th>Nr zasobu</th>
  291. <th>Ile brakuje</th>
  292. <th>Nazwa</th>
  293. </tr>
  294. <xsl:for-each select="/ADMIN_USERS__wyposazenie/braki//ERROR_NOT_ENOUGH[@TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID]">
  295. <tr>
  296. <td><xsl:value-of select="@TYPE"/></td>
  297. <td><xsl:value-of select="@ID"/></td>
  298. <td><xsl:value-of select="@minOccurs - @system_cache__resources_tree_required_occurs_raport:Occurs"/></td>
  299. <td><xsl:value-of select="DESC"/></td>
  300. <td></td>
  301. </tr>
  302. </xsl:for-each>
  303. </table>
  304. <hr>
  305. <br>
  306. </br>
  307. </hr>
  308. </xsl:template>
  309. <xsl:template match="node()" mode="wyposazenie_html">
  310. <xsl:param name="ADMIN_USERS_node"/>
  311. <xsl:result-document href="{concat('../default_db.instance.xml/transformed/ADMIN_USERS__wyposazenie_',$ADMIN_USERS_node/ID,'.html')}">
  312. <html>
  313. <head>Wykaz wyposazenie dla pracownika <xsl:value-of select="$ADMIN_USERS_node/ADM_NAME"/> (ID:<xsl:value-of select="$ADMIN_USERS_node/ID"/>/Login:<xsl:value-of select="$ADMIN_USERS_node/ADM_ACCOUNT"/>)</head>
  314. <body>
  315. Wyposażenie aktualnie przydzielone:
  316. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  317. <tr>
  318. <th>Typ</th>
  319. <th>Nr zasobu</th>
  320. <th>ID</th>
  321. <th>Nazwa</th>
  322. <th>Opis</th>
  323. <th>Producent</th>
  324. <th>Wartość</th>
  325. <th>Właściciel</th>
  326. <th>Oznaczenie</th>
  327. </tr>
  328. <xsl:for-each-group select="/ADMIN_USERS__wyposazenie/wyposazenie//node()[@RESOURCE and @TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID and (name()!='ADMIN_USERS') ]" group-by="concat(@ID,'-',@RESOURCE)">
  329. <tr>
  330. <td><xsl:value-of select="name()"/></td>
  331. <td><xsl:value-of select="@RESOURCE"/></td>
  332. <td><xsl:value-of select="@ID"/></td>
  333. <td><xsl:value-of select="DESC"/></td>
  334. <td>
  335. <xsl:if test="T_DEVICE_TYPE">&#160;<xsl:value-of select="T_DEVICE_TYPE"/></xsl:if>
  336. <xsl:if test="T_DEVICE_INFO">&#160;<xsl:value-of select="T_DEVICE_INFO"/></xsl:if>
  337. &#160;<xsl:value-of select="@A_STATUS"/><pre> </pre>
  338. <xsl:if test="ADM_PHONE"><pre> tel: <xsl:value-of select="ADM_PHONE"/></pre></xsl:if>
  339. </td>
  340. <td><xsl:value-of select="T_PRODUCER"/></td>
  341. <td><xsl:value-of select="F_BILL_COST"/></td>
  342. <td><xsl:value-of select="T_OWNER"/></td>
  343. <td><xsl:value-of select="T_DEVICE_SERIAL"/>
  344. &#160;<xsl:value-of select="T_TELBOX_NAME"/>
  345. </td>
  346. </tr>
  347. </xsl:for-each-group>
  348. <tr>
  349. <td/>
  350. <td/>
  351. <td/>
  352. <td>Suma kosztów wyposazenia</td>
  353. <td/>
  354. <td/>
  355. <td><!--<xsl:value-of select="sum(/ADMIN_USERS__wyposazenie/wyposazenie//node()[@RESOURCE and @TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID and (name()!='ADMIN_USERS' or @source!='ALIAS') and F_BILL_COST&gt;0]/F_BILL_COST)"/>-->
  356. <xsl:variable name="suma">
  357. <xsl:for-each-group select="/ADMIN_USERS__wyposazenie/wyposazenie//node()[@RESOURCE and @TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID and (name()!='ADMIN_USERS' or @source!='ALIAS') and F_BILL_COST&gt;0]/F_BILL_COST" group-by="concat(../@ID,../@RESOURCE)">
  358. <xsl:copy-of select="."/>
  359. </xsl:for-each-group>
  360. </xsl:variable>
  361. <xsl:value-of select="sum($suma/F_BILL_COST)"/>
  362. </td>
  363. <td/>
  364. <td/>
  365. </tr>
  366. </table>
  367. Podległy personel:
  368. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  369. <tr>
  370. <th>Typ</th>
  371. <th>Nr zasobu</th>
  372. <th>ID</th>
  373. <th>Nazwa</th>
  374. <th>Opis</th>
  375. <th>Producent</th>
  376. <th>Wartość</th>
  377. <th>Właściciel</th>
  378. <th>Oznaczenie</th>
  379. </tr>
  380. <xsl:for-each-group select="/ADMIN_USERS__wyposazenie/wyposazenie//node()[@RESOURCE and @TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID and (name()='ADMIN_USERS' and @source!='ALIAS') ]" group-by="concat(@ID,'-',@RESOURCE)">
  381. <tr>
  382. <td><xsl:value-of select="name()"/></td>
  383. <td><xsl:value-of select="@RESOURCE"/></td>
  384. <td><xsl:value-of select="@ID"/></td>
  385. <td><xsl:value-of select="DESC"/></td>
  386. <td>
  387. <xsl:if test="T_DEVICE_TYPE">&#160;<xsl:value-of select="T_DEVICE_TYPE"/></xsl:if>
  388. <xsl:if test="T_DEVICE_INFO">&#160;<xsl:value-of select="T_DEVICE_INFO"/></xsl:if>
  389. &#160;<xsl:value-of select="@A_STATUS"/><pre> </pre>
  390. <xsl:if test="ADM_PHONE"><pre> tel: <xsl:value-of select="ADM_PHONE"/></pre></xsl:if>
  391. </td>
  392. <td><xsl:value-of select="T_PRODUCER"/></td>
  393. <td><xsl:value-of select="F_BILL_COST"/></td>
  394. <td><xsl:value-of select="T_OWNER"/></td>
  395. <td><xsl:value-of select="T_DEVICE_SERIAL"/>
  396. &#160;<xsl:value-of select="T_TELBOX_NAME"/>
  397. </td>
  398. </tr>
  399. </xsl:for-each-group>
  400. </table>
  401. <br/>
  402. Wyposażenie aktualnie brakujące:
  403. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  404. <tr>
  405. <th>Typ</th>
  406. <th>Nr zasobu</th>
  407. <th>Ile brakuje</th>
  408. <th>Nazwa</th>
  409. <th>Możliwość pobrania z</th>
  410. <th>Możliwość zamówienia z</th>
  411. </tr>
  412. <xsl:for-each select="/ADMIN_USERS__wyposazenie/braki//ERROR_NOT_ENOUGH[@TREE_ADMIN_USERS_ID=$ADMIN_USERS_node/ID]">
  413. <tr>
  414. <td><xsl:value-of select="@TYPE"/></td>
  415. <td><xsl:value-of select="@ID"/></td>
  416. <td><xsl:value-of select="@minOccurs - @system_cache__resources_tree_required_occurs_raport:Occurs"/></td>
  417. <td><xsl:value-of select="DESC"/></td>
  418. <td>
  419. <xsl:for-each select="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource/INSTANCES/PARENTS/RESOURCE/node()[@ID and @A_STATUS!='OFF_HARD' and @A_STATUS!='DELETED' and @A_STATUS!='WAITING']">
  420. Źródła nadrzędne<br/><font size="-3">
  421. typ:<xsl:value-of select="name()"/>;<br/>
  422. RESOURCE:<xsl:value-of select="@RESOURCE"/>;<br/>
  423. ID:<xsl:value-of select="@ID"/>;<br/>
  424. STATUS:<xsl:value-of select="@A_STATUS"/>;<br/>
  425. <xsl:for-each select="child::*">
  426. <xsl:value-of select="name()"/>:<xsl:value-of select="text()"/><br/>
  427. </xsl:for-each>
  428. </font>
  429. <hr/>
  430. </xsl:for-each>
  431. <xsl:for-each select="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource/INSTANCES/SIBLING/RESOURCE/node()[@ID and @A_STATUS!='OFF_HARD' and @A_STATUS!='DELETED' and @A_STATUS!='WAITING']">
  432. Źródła równorzędne<br/><font size="-3">
  433. typ:<xsl:value-of select="name()"/>;<br/>
  434. RESOURCE:<xsl:value-of select="@RESOURCE"/>;<br/>
  435. ID:<xsl:value-of select="@ID"/>;<br/>
  436. STATUS:<xsl:value-of select="@A_STATUS"/>;<br/>
  437. <xsl:for-each select="child::*">
  438. <xsl:value-of select="name()"/>:<xsl:value-of select="text()"/><br/>
  439. </xsl:for-each>
  440. </font>
  441. <hr/>
  442. </xsl:for-each>
  443. <xsl:for-each select="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource/INSTANCES/CHILDS/RESOURCE/node()[@ID and @A_STATUS!='OFF_HARD' and @A_STATUS!='DELETED' and @A_STATUS!='WAITING']">
  444. Źródła dziedziczące<br/><font size="-3">
  445. typ:<xsl:value-of select="name()"/>;<br/>
  446. RESOURCE:<xsl:value-of select="@RESOURCE"/>;<br/>
  447. ID:<xsl:value-of select="@ID"/>;<br/>
  448. STATUS:<xsl:value-of select="@A_STATUS"/>;<br/>
  449. <xsl:for-each select="child::*">
  450. <xsl:value-of select="name()"/>:<xsl:value-of select="text()"/><br/>
  451. </xsl:for-each>
  452. </font>
  453. <hr/>
  454. </xsl:for-each>
  455. </td>
  456. <td>
  457. <xsl:for-each select="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource/OFFERS/PARENTS/node()[@ID and @A_STATUS!='OFF_HARD' and @A_STATUS!='DELETED' and @A_STATUS!='WAITING']">
  458. <font size="-3">
  459. Oferta/ID:<xsl:value-of select="@ID"/>;<br/>
  460. Dostawca:<xsl:copy-of select="COMPANIES_ID"/>;<br/>
  461. STATUS:<xsl:value-of select="@A_STATUS"/>;<br/>
  462. Oferta/Przelicznik/min.il.:<xsl:copy-of select="OFFER_UNIT_TYPE"/>/<xsl:copy-of select="OFFER_UNIT_TO_RESOURCE_UNIT_RATIO"/>/<xsl:copy-of select="OFFER_MIN_QTY"/>;<br/>
  463. Cena[dost]/[zasob]:<xsl:copy-of select="OFFER_PRICE_PER_UNIT"/>/<xsl:copy-of select="OFFER_PRICE_PER_RESOURCE_UNIT"/>;<br/>
  464. jakość:<xsl:copy-of select="OFFERED_QUALITY"/>
  465. </font>
  466. <hr/>
  467. </xsl:for-each>
  468. </td>
  469. </tr>
  470. </xsl:for-each>
  471. </table>
  472. <br>
  473. Niewłaściwie przydzielone do struktury urządzenia podlegające strukturalnie pod pracownika:
  474. </br>
  475. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  476. <tr>
  477. <th>Typ</th>
  478. <th>Nr zasobu</th>
  479. <th>Nr rekordu w urządzeniach</th>
  480. <th>Nazwa</th>
  481. </tr>
  482. <xsl:for-each select="/ADMIN_USERS__wyposazenie/errors_all_structures/DEVICES/ERROR_INSTANCE_NOT_FOUND_IN_TREE[contains(concat(' ',@TREE_ADMIN_USERS_ID,' ') , concat(' ',$ADMIN_USERS_node/ID,' '))]">
  483. <xsl:variable name="CRM_LISTA_ZASOBOW_ID" select="@CRM_LISTA_ZASOBOW_ID"/>
  484. <tr>
  485. <td><xsl:value-of select="@TYPE"/></td>
  486. <td><xsl:value-of select="@CRM_LISTA_ZASOBOW_ID"/></td>
  487. <td><xsl:value-of select="@ID"/></td>
  488. <td> <xsl:copy-of select="T_DEVICE_TYPE"/>
  489. <xsl:copy-of select="T_DEVICE_INFO"/>
  490. <xsl:copy-of select="T_DEVICE_SERIAL"/></td>
  491. <td></td>
  492. </tr>
  493. </xsl:for-each>
  494. </table>
  495. <br>
  496. Brakujące elementy w całej strukturze firmy
  497. </br>
  498. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  499. <tr>
  500. <th>Typ</th>
  501. <th>Nr zasobu</th>
  502. <th>Ile jest</th>
  503. <th>Ile ma byc</th>
  504. <th>Ile brakuje</th>
  505. <th>Nazwa</th>
  506. <th>Możliwość pobrania</th>
  507. </tr>
  508. <xsl:for-each-group select="/ADMIN_USERS__wyposazenie/braki_all_structures//ERROR_NOT_ENOUGH[@TYPE='URZADZENIE' or @TYPE='DOSTEP-ZAMEK-ELEKTRONICZNY' or @TYPE='OZNACZENIE_LOKALIZACJI' or @TYPE='APLIKACJA' or @TYPE='SOFTWARE' or @TYPE='ALARM-SATEL' or @TYPE='SZAFA' or @TYPE='SEJF' or @TYPE='SEGREGATOR' or @TYPE='KUWETA' or @TYPE='NARZEDZIE' or @TYPE='DOSTEP-KLUCZ' or @TYPE='DOSTEP-KARTA' or @TYPE='DOSTEP-ZAMEK' or @TYPE='MATERIAL_REKLAMOWY' or @TYPE='SERWER' or @TYPE='MATERIAL_EKSPLOATACYJNY' or @TYPE='PIECZATKA' or @TYPE='PLYTA_CD' or @TYPE='KOMPUTER' or @TYPE='URZADZENIA_I_OZNACZENIA_BHP']" group-by="@ID">
  509. <tr>
  510. <td><xsl:value-of select="@TYPE"/></td>
  511. <td><xsl:value-of select="@ID"/></td>
  512. <td><xsl:value-of select="@system_cache__resources_tree_required_occurs_raport:Occurs"/></td>
  513. <td><xsl:value-of select="@minOccurs"/></td>
  514. <td><xsl:value-of select="@minOccurs - @system_cache__resources_tree_required_occurs_raport:Occurs"/></td>
  515. <td><xsl:value-of select="DESC"/></td>
  516. <td>
  517. <xsl:for-each select="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource/INSTANCES/PARENTS/RESOURCE/node()[@ID and @A_STATUS!='OFF_HARD' and @A_STATUS!='DELETED' and @A_STATUS!='WAITING']">
  518. Źródło: nadrzędne<br/>
  519. <font size="-3">
  520. typ:<xsl:value-of select="name()"/>;<br/>
  521. RESOURCE:<xsl:value-of select="@RESOURCE"/>;<br/>
  522. ID:<xsl:value-of select="@ID"/>;<br/>
  523. STATUS:<xsl:value-of select="@A_STATUS"/>;<br/>
  524. T_DEVICE_TYPE:<xsl:copy-of select="T_DEVICE_TYPE"/>;<br/>
  525. T_DEVICE_INFO:<xsl:copy-of select="T_DEVICE_INFO"/>;<br/>
  526. T_DEVICE_SERIAL:<xsl:copy-of select="T_DEVICE_SERIAL"/>
  527. </font>
  528. <hr/>
  529. </xsl:for-each>
  530. <xsl:for-each select="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource/INSTANCES/SIBLING/RESOURCE/node()[@ID and @A_STATUS!='OFF_HARD' and @A_STATUS!='DELETED' and @A_STATUS!='WAITING']">
  531. Źródła równorzędne<br/>
  532. <font size="-3">
  533. typ:<xsl:value-of select="name()"/>;<br/>
  534. RESOURCE:<xsl:value-of select="@RESOURCE"/>;<br/>
  535. ID:<xsl:value-of select="@ID"/>;<br/>
  536. STATUS:<xsl:value-of select="@A_STATUS"/>;<br/>
  537. T_DEVICE_TYPE:<xsl:copy-of select="T_DEVICE_TYPE"/>;<br/>
  538. T_DEVICE_INFO:<xsl:copy-of select="T_DEVICE_INFO"/>;<br/>
  539. T_DEVICE_SERIAL:<xsl:copy-of select="T_DEVICE_SERIAL"/>
  540. </font>
  541. <hr/>
  542. </xsl:for-each>
  543. <xsl:for-each select="default_db__CRM_LISTA_ZASOBOW_OFFERS:show_offers_for_resource/INSTANCES/CHILDS/RESOURCE/node()[@ID and @A_STATUS!='OFF_HARD' and @A_STATUS!='DELETED' and @A_STATUS!='WAITING']">
  544. Źródła dziedziczące<br/><font size="-3">
  545. typ:<xsl:value-of select="name()"/>;<br/>
  546. RESOURCE:<xsl:value-of select="@RESOURCE"/>;<br/>
  547. ID:<xsl:value-of select="@ID"/>;<br/>
  548. STATUS:<xsl:value-of select="@A_STATUS"/>;<br/>
  549. T_DEVICE_TYPE:<xsl:copy-of select="T_DEVICE_TYPE"/>;<br/>
  550. T_DEVICE_INFO:<xsl:copy-of select="T_DEVICE_INFO"/>;<br/>
  551. T_DEVICE_SERIAL:<xsl:copy-of select="T_DEVICE_SERIAL"/>
  552. </font>
  553. <hr/>
  554. </xsl:for-each>
  555. </td>
  556. </tr>
  557. </xsl:for-each-group>
  558. </table>
  559. </body>
  560. </html>
  561. </xsl:result-document>
  562. </xsl:template>
  563. </xsl:stylesheet>