Compare commits
693 Commits
Hotfix-1
...
Hotfix-103
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ffa33b219 | |||
| 213a309c40 | |||
| e42083ebb0 | |||
| 3b53f53c68 | |||
| d7c4e01462 | |||
| aab0694714 | |||
| 29697cfc42 | |||
| e706aebee6 | |||
| c023c69993 | |||
| 8b636610b4 | |||
| 56a24bae69 | |||
| d36c35ac34 | |||
| f25727acb6 | |||
| 12d1c63d94 | |||
| 00b8743290 | |||
| bb016e1497 | |||
| 0122e07d05 | |||
| 742cdc8788 | |||
| 48182e8959 | |||
| d38ab3a183 | |||
| 16fc3cace2 | |||
| 45055f360a | |||
| 49adb5b445 | |||
| b38f3e1d55 | |||
| 7334d78550 | |||
| b70c5cae56 | |||
| f4009321be | |||
| f52f610192 | |||
| 43bff29df0 | |||
| 6dec77bad0 | |||
| 6f474c2ffe | |||
| 76639f8f05 | |||
| 565778b890 | |||
| e23c733cf7 | |||
| 52602e881e | |||
| 02d225c015 | |||
| 79e2f809e9 | |||
| 7f1dff41d6 | |||
| 73dee404e5 | |||
| fc8ed78b2f | |||
| 4fab8ba00e | |||
| b79b9d1536 | |||
| 4da1df2769 | |||
| e2ccacfe3d | |||
| 02e21075ce | |||
| 2665b90b7e | |||
| 5121c001d0 | |||
| 1f7595c2c4 | |||
| 9ebe0e4c8a | |||
| 11082cd151 | |||
| 56dad0b395 | |||
| 591b25db92 | |||
| 94ca5e9a89 | |||
| bff80debb5 | |||
| ecd8179591 | |||
| f7b9423427 | |||
| b0ffa32c5d | |||
| 047745bb71 | |||
| 756b646b68 | |||
| 31b44b67c3 | |||
| cac4f16829 | |||
| c7669fa16c | |||
| 35622ef3d3 | |||
| f552024921 | |||
| 5735d26a94 | |||
| e205c643c6 | |||
| 5429ca6ca7 | |||
| 46b4744880 | |||
| 4075b8d462 | |||
| fa817edd5e | |||
| bdd3aefe81 | |||
| c4973302e8 | |||
| b9b47c7f87 | |||
| eb11a7cf2c | |||
| cce3d7c33a | |||
| 903f436edd | |||
| 5db62fb4c0 | |||
| 8284c82879 | |||
| 31247162a9 | |||
| 4622c09ccb | |||
| 62954b2416 | |||
| 2292c85faf | |||
| f402705ce8 | |||
| eb5d5ef48b | |||
| 6b7d9c6c4b | |||
| 38566f81d4 | |||
| 6d7651f8ac | |||
| 4520f54acf | |||
| 9af738c7de | |||
| 88fc193f3b | |||
| 07f7f9e91e | |||
| be0ca4277e | |||
| 46615c6e6b | |||
| d3c40132a5 | |||
| 3720433430 | |||
| eef2ac0b88 | |||
| 3b91cd7c22 | |||
| 313b06dc8a | |||
| 8de52d5905 | |||
| 6b1ba9f6f3 | |||
| 850a5f6d58 | |||
| 8e236e4761 | |||
| f2e03798f5 | |||
| b88d0bd79b | |||
| 6d5871e31c | |||
| 3c223d0931 | |||
| 0a3c3c9133 | |||
| 0b7b200b3c | |||
| 0b4d2d21d6 | |||
| 85e9f35a52 | |||
| 445b38fa86 | |||
| a7a3f25459 | |||
| 8039b09e55 | |||
| 9d559738f7 | |||
| 2caaec07a3 | |||
| 1077b01289 | |||
| e112a239a7 | |||
| 9005b2508e | |||
| 74f8255703 | |||
| 4b0112fad3 | |||
| eb37b379e4 | |||
| 71e355437a | |||
| 03fba4aa65 | |||
| d24d87423f | |||
| 05ab084fe6 | |||
| be12b34fd3 | |||
| 615fc70bad | |||
| fdbaa1341b | |||
| d0724a1917 | |||
| cd72b3e703 | |||
| 870f1a5968 | |||
| bf2fb73ce8 | |||
| bc1455d0aa | |||
| 4d3a0bd22a | |||
| 7866f1729d | |||
| 9428350a5b | |||
| 0874ff4aaa | |||
| 947fbe3d72 | |||
| 8c2f844ff3 | |||
| 97d3af0e73 | |||
| a260dc3398 | |||
| 713d702d1a | |||
| 02b88f5da0 | |||
| d483ec2a0b | |||
| 0299a7444e | |||
| 321f589120 | |||
| 8182fe756a | |||
| ba76d87880 | |||
| 7f8d58feeb | |||
| 0563dd6ecb | |||
| b63769c23a | |||
| 8f00a783f4 | |||
| ea3b4cb6a8 | |||
| 7c5219407e | |||
| 16861ae24c | |||
| a3d5d97349 | |||
| 705739f17b | |||
| 6dffb960d7 | |||
| 4c883ba028 | |||
| c24ead668c | |||
| cf4d5cd485 | |||
| d755b7b63a | |||
| 07be9315c1 | |||
| e9403e9772 | |||
| 2de7c0c1b8 | |||
| d566ffcacc | |||
| a3052a6d74 | |||
| 2df1846599 | |||
| f408812937 | |||
| 4bdc4b4cee | |||
| 2fc71efee1 | |||
| a5c0ddcfca | |||
| ad710e72b0 | |||
| 33af25f356 | |||
| c5ad6c8335 | |||
| 5a4cfe58f2 | |||
| 674c2130f9 | |||
| 25475c1f25 | |||
| fe7509fa26 | |||
| d9714f1cf6 | |||
| 7d48a38369 | |||
| c947557691 | |||
| 948672c3f6 | |||
| 91e1693f6f | |||
| 12ce4695d9 | |||
| 34b5141ed3 | |||
| 1158f2d454 | |||
| c9f79a055b | |||
| 7b5fb3f161 | |||
| d04e21e419 | |||
| 2eb95fe48e | |||
| 55da63464f | |||
| a66c03ae46 | |||
| a3839b2093 | |||
| 69edad6243 | |||
| 77b239442e | |||
| 4f14d94d87 | |||
| 512e648595 | |||
| 014adf46a7 | |||
| ecd9a0179d | |||
| d588662417 | |||
| 631211c1cb | |||
| 2f5e1d3536 | |||
| 9dd850f3fb | |||
| bba2affc82 | |||
| 72825dfc9b | |||
| faba6eabdc | |||
| af2c0a395d | |||
| c5fb5fa78c | |||
| 0291e8c499 | |||
| c6d9e3a036 | |||
| b1ff5df213 | |||
| 9a0ac8e4cc | |||
| 2c6f07d14a | |||
| 5949198892 | |||
| 703d0cf900 | |||
| ad32be2add | |||
| 3a0d7f52ce | |||
| 12a8b77ab8 | |||
| 7835de21b5 | |||
| 8a18c5027c | |||
| d1fe1cb838 | |||
| 86b873bfd7 | |||
| ee8ed89407 | |||
| ba2624ddc9 | |||
| 66def484dc | |||
| 56ff2bcfbc | |||
| 04bc21c6fd | |||
| 22be8242fd | |||
| 5c4eb047bb | |||
| 83771ca0fc | |||
| b64b22f29d | |||
| 568cb9033b | |||
| acec0f975e | |||
| 2d2af7c7cc | |||
| 9cee3f2c38 | |||
| 51faa42383 | |||
| 41f149d155 | |||
| 8de559da35 | |||
| e4045dd551 | |||
| e8c9dece24 | |||
| 80066bc22c | |||
| 8d7ccf0422 | |||
| 5ca244e042 | |||
| c1a2aee50a | |||
| 88c6e7b872 | |||
| b4bbce97e6 | |||
| 86824d9666 | |||
| 4637e2797e | |||
| 5a7617f974 | |||
| 47b4223966 | |||
| bcc8aa318a | |||
| 387545588a | |||
| b3725429b8 | |||
| 8263441546 | |||
| b3f19d1994 | |||
| 4a5ebc4710 | |||
| 1f05d3b075 | |||
| a7ada54c19 | |||
| e59d585f72 | |||
| 7dc55c5865 | |||
| 918b387c0a | |||
| 2f5e9e8926 | |||
| 23c2eece69 | |||
| 96cb14df5b | |||
| 9ba6e44929 | |||
| fa6a40f287 | |||
| c2e53bdd76 | |||
| a86d558927 | |||
| 390e3ccea7 | |||
| 6eee5cbd8c | |||
| 61cdbe0cee | |||
| 6e9514e9fe | |||
| 66a2772cbd | |||
| b556bd079c | |||
| 83963061ba | |||
| 1d3c707945 | |||
| 2f1379c426 | |||
| 6d2dc71bd8 | |||
| 186445706e | |||
| 2eff385a39 | |||
| 879b52f854 | |||
| ed271a3fd6 | |||
| f80d53d277 | |||
| 297b4eae54 | |||
| 5c92f2183a | |||
| 1585879d42 | |||
| 4accea1633 | |||
| 9f2e75050b | |||
| 9afb4eae90 | |||
| ab666c5058 | |||
| 3292d32f60 | |||
| 2cd90b401e | |||
| 983fa935df | |||
| 711bc8f3d9 | |||
| f5eeb41740 | |||
| 8542c8da88 | |||
| b93e904399 | |||
| d5c0da7907 | |||
| 4232d63266 | |||
| a08f15d7de | |||
| 2749e0a7b9 | |||
| 9d3d34d91f | |||
| 6771ec2bc2 | |||
| be4391fd17 | |||
| 2a9564faff | |||
| b72cff48f3 | |||
| 21e6a06bb8 | |||
| bc393fc175 | |||
| 2a4e89225a | |||
| 857be3ddb3 | |||
| 56262f60bd | |||
| 37a93d68a5 | |||
| f1db752b58 | |||
| c6758f5f12 | |||
| e1913e2e80 | |||
| 7a8de2f145 | |||
| da9805d339 | |||
| fe628e51fd | |||
| 767b12a6de | |||
| f997b6d79f | |||
| 52dafde44c | |||
| 66b4036ab7 | |||
| 411f952bd0 | |||
| dde74a21bd | |||
| e6589085df | |||
| c19b6adc81 | |||
| fbd3e6d426 | |||
| 89d2883f4b | |||
| 7555b0318b | |||
| 6be812ab54 | |||
| 1d53015e77 | |||
| 6dba8a8a38 | |||
| 340467345e | |||
| 91978f0ad9 | |||
| dc5a67d952 | |||
| d7928ee13b | |||
| cbf09a16b6 | |||
| e8f8eee762 | |||
| 22c8aecfaa | |||
| d62342afdb | |||
| c0960078f3 | |||
| 69a1b81952 | |||
| b6ce92e183 | |||
| 96a99ad096 | |||
| 8f039181f0 | |||
| 09290fca17 | |||
| 39bb1df4bb | |||
| 5937c2f40a | |||
| 8314d24840 | |||
| 3a6e27e721 | |||
| ecad9c9a0a | |||
| a2a035bcbf | |||
| 9ab2e8246b | |||
| c413d43041 | |||
| 0f9d4166fb | |||
| 4070f80596 | |||
| 4ec1c96494 | |||
| 29c5158079 | |||
| cd51004052 | |||
| 61a1e22c4c | |||
| 2943232d68 | |||
| 2976980971 | |||
| db31ad1bc5 | |||
| 9c04eb581a | |||
| 9b253d91cd | |||
| 5d25352503 | |||
| 2a580b917d | |||
| 34e652affc | |||
| a5062c1554 | |||
| 10fcbb03d0 | |||
| 311d3e75a3 | |||
| 544c34b378 | |||
| 0fa0a74d55 | |||
| 7279f43596 | |||
| e6cfa62e9e | |||
| 3e128125dd | |||
| 568dbf1e28 | |||
| 166028f942 | |||
| 25367823d8 | |||
| 7761ad2b0f | |||
| 8825e4af77 | |||
| 0f23ab3a0e | |||
| 0e32aed0cc | |||
| 31113e4c26 | |||
| a165ccc84f | |||
| 50f98fac24 | |||
| 602a6ef694 | |||
| d960dda689 | |||
| 680d280379 | |||
| 13085ef576 | |||
| 4ed94a2a40 | |||
| 95db8d954e | |||
| b6760452d9 | |||
| 1cda739c2b | |||
| 0b266d6c4e | |||
| 273c52a353 | |||
| 602d8ebb50 | |||
| 4963de452c | |||
| a62aedaa99 | |||
| 549540d9a7 | |||
| 06ffc6657a | |||
| 8e8ade5c7d | |||
| a36ed2d9e8 | |||
| 22730e0340 | |||
| 17c5ac72f9 | |||
| 19a2bea8f6 | |||
| ce309a9df4 | |||
| 9213abb0f3 | |||
| 6b1ede6119 | |||
| 40df5f7bfd | |||
| 423f697471 | |||
| 276efb5190 | |||
| 7932f3a5c9 | |||
| 96ae98d39f | |||
| cc7e18d3ef | |||
| 8460d43275 | |||
| 90c3f1d5bb | |||
| 4bd52f51d1 | |||
| 74153a9fee | |||
| 1c47bbbe59 | |||
| 0a690e7421 | |||
| 610e3c9b10 | |||
| cd438e8971 | |||
| dc377d119e | |||
| 3dcd9b3799 | |||
| f7171cf2c1 | |||
| bc5a714228 | |||
| 8092fae347 | |||
| 0ca1bba534 | |||
| 5950d88065 | |||
| 1479bb2acc | |||
| 9c603fbcf2 | |||
| 2e9e470bc8 | |||
| 11ffd5c311 | |||
| f1375756fc | |||
| 2ad8e1abc7 | |||
| d7c56a3b9e | |||
| ec88947444 | |||
| 0d9b67e51a | |||
| edfb31eb29 | |||
| 145ce05525 | |||
| d7a38ec222 | |||
| 7fc12a03db | |||
| 5cbc9f179d | |||
| bba2d62128 | |||
| eecb5c2540 | |||
| d9277b3450 | |||
| 5372d8ae22 | |||
| 2281815bac | |||
| e45595d032 | |||
| ebea771603 | |||
| 26c647d966 | |||
| d331cf02d8 | |||
| c33f2fbe51 | |||
| 19b1b94b15 | |||
| 2a178756a2 | |||
| 175a9a4edd | |||
| f73012e6e9 | |||
| 8304a1a9b4 | |||
| ba017cd81c | |||
| 5845cb75ef | |||
| 613a4cae36 | |||
| 60c80619f5 | |||
| 3bfcb4ad91 | |||
| edd5bba14c | |||
| 8bf6279728 | |||
| 93648a9adc | |||
| beb90b4ce0 | |||
| 83a5f99f1b | |||
| dd96d1d2d4 | |||
| e9d4895ce4 | |||
| c54a713d53 | |||
| b0215c360c | |||
| 6666811e0f | |||
| add6d704e6 | |||
| 537beae792 | |||
| f761a6ae5e | |||
| 9f3613c464 | |||
| 07c7278d9b | |||
| 575d51a772 | |||
| cf698e9ab8 | |||
| f83d572b37 | |||
| a120522807 | |||
| 7a0e74fa7b | |||
| 8b0e1f78ef | |||
| 89d7ff52ef | |||
| dd4a0c606e | |||
| b6e481e08d | |||
| ff5c45f6ff | |||
| 08cc34d25a | |||
| d8d088f5cb | |||
| d7f71c381e | |||
| 267fbcb6d5 | |||
| 3a2217eb99 | |||
| dd527768cd | |||
| ba7144c23e | |||
| 872db7820c | |||
| a9a75a2bdd | |||
| 64df4a7139 | |||
| 6c46d127e7 | |||
| 89735b90e2 | |||
| 5cdc726cdc | |||
| 7bbe722c04 | |||
| bccaeec280 | |||
| 6c282f01a4 | |||
| c1aa31a180 | |||
| 7fb09edb43 | |||
| f2fb4d4bf4 | |||
| 1fc13d7d9e | |||
| 43e560303b | |||
| 95b63ed6e3 | |||
| 0d14e2f7e2 | |||
| e81c8f14f5 | |||
| b1d92b796b | |||
| 784b4afcf7 | |||
| 3c9f1daab0 | |||
| 49ff282e59 | |||
| 93e18650ea | |||
| c10799665b | |||
| afa981edc0 | |||
| 9a580d2be0 | |||
| 66af3f5514 | |||
| f89112d01f | |||
| 78176fba04 | |||
| a924ad9573 | |||
| 81105cd10b | |||
| 4b12007403 | |||
| f84c33ab03 | |||
| 5f627358c8 | |||
| 442e0bf7b1 | |||
| 2b8ff873c4 | |||
| fe4f851f5c | |||
| 1242c75f8e | |||
| 99ab8df449 | |||
| b4b3e45350 | |||
| 467214f0ae | |||
| 7a11422f86 | |||
| 653d476eab | |||
| 3ba8c4f1dc | |||
| 062c474db5 | |||
| 4cae8ad40b | |||
| 25212b712e | |||
| 82e08a1a55 | |||
| cf0988fee6 | |||
| 9c0d1de484 | |||
| 4a7f0e47e5 | |||
| aea000514b | |||
| 4ffc4ba95a | |||
| 4171fab84a | |||
| ee1a639734 | |||
| ca347de911 | |||
| ebaf8ed2e5 | |||
| be17bf9020 | |||
| a47acb80f9 | |||
| 361a7752bf | |||
| 181b6922c4 | |||
| 773e150862 | |||
| 2c9983c12f | |||
| 2e7df9f691 | |||
| 59b6c6d579 | |||
| 25f62f43b0 | |||
| 07592ab0f0 | |||
| 2df5a4f23d | |||
| 91c1cfc279 | |||
| 90ebbfc190 | |||
| 112d2ba652 | |||
| 6f74678730 | |||
| 4d2ffdeeb8 | |||
| a534d7d2eb | |||
| e4ddd6d83a | |||
| 2c829c8abf | |||
| 3491d9b894 | |||
| 9f7f41a67b | |||
| 6799ad7694 | |||
| 929f8998a7 | |||
| c2db2d1a2a | |||
| e687055e0a | |||
| 6028a64a5b | |||
| ca3dc49c12 | |||
| b5a13a13f8 | |||
| 35e0098606 | |||
| 497d1fb9ba | |||
| bf6fbbae72 | |||
| c252f533e5 | |||
| 42b035604a | |||
| 7522f4f517 | |||
| 13eb9b7340 | |||
| dfb3ee776d | |||
| 6e755dd239 | |||
| f3f2540902 | |||
| 12a587c84c | |||
|
|
29e8ee715a | ||
| 10cd087c09 | |||
| cbd8856788 | |||
| 23f3ad3068 | |||
| 9388a3b3a9 | |||
| 574b54e4fa | |||
| 7335806122 | |||
| 056c00d103 | |||
| e2be26ba23 | |||
| c6ab941772 | |||
| 2bfc6e9d7c | |||
| 8f0b930d54 | |||
| a04dcd26c1 | |||
| 0ee4751ff2 | |||
| b1b36fe139 | |||
| 4073944270 | |||
| 5a1d206ea6 | |||
| fc7bed2e01 | |||
| cd03c3d834 | |||
| aa28ac776b | |||
| 8af1c6079d | |||
| d4261c4fbe | |||
| 3fae3864e0 | |||
| 7ce4c3be03 | |||
| 07b7876087 | |||
| 5fc78177b9 | |||
| 4ddec1a4bc | |||
| 416c1c92ed | |||
| 1d41a467bd | |||
| e604df178a | |||
| b43c012b62 | |||
| cbf1f6aea9 | |||
| 710a407a52 | |||
| b44ebf6b83 | |||
| 9a42441c54 | |||
| 716eaeec25 | |||
| 9cd37e3835 | |||
| f1fc12a82e | |||
| 101608ba80 | |||
| bf0522850a | |||
| baab2e5166 | |||
| d58ab43fc9 | |||
| eb26a9948d | |||
| 03a86a0125 | |||
| cc3b9a11c5 | |||
| c61f7b340e | |||
| e18734efd4 | |||
| 181dc47231 | |||
| 281599422a | |||
| bb8bd9610a | |||
| 7345579d9e | |||
| 21e14becd1 | |||
| 7aa001f5c8 | |||
| 12e6b0ab76 | |||
| d5abff436b | |||
| 46c7e86426 | |||
| 2c9d98ccde | |||
| b1e00b641c | |||
| 2d9c24f716 | |||
| 20dbf2ccdb | |||
| 30506088bc | |||
| 526e820f71 | |||
| c1b45c6652 | |||
| 4ebc3e4fb1 | |||
| 5af33fd213 | |||
| 0d87345b62 | |||
| 8052a39024 | |||
| 0a805280e9 | |||
| 2f9f830133 | |||
| 8812ed647d | |||
| ea8e512aa7 | |||
| 6db0ae82ea | |||
| a30c1fbcc6 | |||
| 9ea03b70fe | |||
| 0f2dc1d262 | |||
| c538ddffc9 | |||
| 6d1dd943a6 | |||
| 5671964a27 | |||
| d5bc0774bf | |||
| 0c36980dc5 | |||
| 57bc5a352d | |||
| f1133b60ca | |||
| bf7d8c0d14 | |||
| 3657e0da69 | |||
| 1c61771e65 | |||
| cfa85dd881 | |||
| e945d0bc67 | |||
| 822034e8a8 | |||
| 7ed15b5d47 | |||
| 9346ded567 | |||
| 5e85afcfe1 | |||
| 801db2f272 | |||
| a4c7c52be0 | |||
| 5f53cf48dd | |||
| f44d53189d | |||
| 27edd1a3ce | |||
| 2eda323a2e | |||
| dc4e10d0cf | |||
| cdce344112 | |||
| 2fccd57926 | |||
| 8ba889eb51 |
2
.idea/dataSources.xml
generated
2
.idea/dataSources.xml
generated
@@ -5,7 +5,7 @@
|
||||
<driver-ref>sqlserver.ms</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlserver://serverdb</jdbc-url>
|
||||
<jdbc-url>jdbc:sqlserver://serverdb;database=gramm</jdbc-url>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
15
.idea/git_toolbox_prj.xml
generated
Normal file
15
.idea/git_toolbox_prj.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationConfigOverride">
|
||||
<CommitMessageValidationOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</CommitMessageValidationOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
33
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
33
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,33 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="classname" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myCustomValuesEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="8">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
<item index="3" class="java.lang.String" itemvalue="noscript" />
|
||||
<item index="4" class="java.lang.String" itemvalue="embed" />
|
||||
<item index="5" class="java.lang.String" itemvalue="script" />
|
||||
<item index="6" class="java.lang.String" itemvalue="button" />
|
||||
<item index="7" class="java.lang.String" itemvalue="input" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myCustomValuesEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="TaskProblemsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
5
.idea/php.xml
generated
5
.idea/php.xml
generated
@@ -1,5 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpDebugIgnoredPathsSettings">
|
||||
<skipped_paths>
|
||||
<skipped_path path="$PROJECT_DIR$/../REPO-IMAGES" />
|
||||
</skipped_paths>
|
||||
</component>
|
||||
<component name="PhpIncludePathManager">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/public_html/vendor/athari/yalinqo" />
|
||||
|
||||
200
Gruntfile.js
200
Gruntfile.js
@@ -16,29 +16,37 @@ var _arr_aziende = [
|
||||
{n: "gramm"},
|
||||
{n: "ime_te", sub: ["ime_ba"]},
|
||||
{n: "lamonarca"},
|
||||
{n: "licor"},
|
||||
{n: "loredana"},
|
||||
{n: "maggioSRL"},
|
||||
{n: "medsol"},
|
||||
{n: "midel"},
|
||||
{n: "morgante"},
|
||||
{n: "mysrl"},
|
||||
{n: "new_life_store"},
|
||||
{n: "new_life"},
|
||||
{n: "produzione"},
|
||||
{n: "risto_cash"},
|
||||
{n: "sapori_veri", sub: ["dispensa"]},
|
||||
{n: "smetar"},
|
||||
{n: "suit", sub: ["santantonio", "carni_sardegna"]},
|
||||
{n: "tosca_ce"},
|
||||
{n: "tosca_mi"},
|
||||
{n: "tosca_rm"},
|
||||
{n: "tosca_rg"},
|
||||
{n: "tosca_vr"},
|
||||
{n: "twobrothers"},
|
||||
{n: "vgalimenti"},
|
||||
{n: "vgalimenti", sub: ["salpar"]},
|
||||
{n: "vinella"}
|
||||
];
|
||||
// </editor-fold >
|
||||
|
||||
module.exports = function(grunt){
|
||||
module.exports = function (grunt) {
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON("package.json"),
|
||||
clean: {
|
||||
tmp: {
|
||||
src: ["exports/tmp/*", "!exports/tmp/assets", "!exports/tmp/vendor"]
|
||||
},
|
||||
default: {
|
||||
src: ["exports"]
|
||||
},
|
||||
@@ -46,11 +54,11 @@ module.exports = function(grunt){
|
||||
src: ["public_html/build", "public_html/build.json", "exports/**/scriptList.json"]
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
copy: copy_getValues(grunt),
|
||||
|
||||
|
||||
compress: compress_getValues(),
|
||||
|
||||
|
||||
open: {file: {path: "C:\\wamp\\www\\pvm\\exports\\"}},
|
||||
|
||||
prompt: {
|
||||
@@ -62,13 +70,13 @@ module.exports = function(grunt){
|
||||
type: "input", // list, checkbox, confirm, input, password
|
||||
message: "ID modulo:", // Question to ask the user, function needs to return a string,
|
||||
default: "", // default value if nothing is entered
|
||||
validate: function(moduleID){
|
||||
if(typeof (moduleID) === "undefined" || !moduleID.length){
|
||||
validate: function (moduleID) {
|
||||
if (typeof (moduleID) === "undefined" || !moduleID.length) {
|
||||
return "Valore vuoto non ammesso";
|
||||
} else{
|
||||
} else {
|
||||
moduleID = format_id(moduleID);
|
||||
var moduleList = get_listModuli();
|
||||
if(moduleID in moduleList){
|
||||
if (moduleID in moduleList) {
|
||||
return "ID già esistente. Specificarne un altro";
|
||||
}
|
||||
//console.log(moduleList);
|
||||
@@ -98,10 +106,10 @@ module.exports = function(grunt){
|
||||
// when: function(answers) // only ask this question when this function returns true
|
||||
}
|
||||
],
|
||||
then: function(results){
|
||||
then: function (results) {
|
||||
var moduleName = format_id(results.moduleName);
|
||||
var moduleTitle = results.moduleTitle;
|
||||
if(moduleTitle.length === 0){
|
||||
if (moduleTitle.length === 0) {
|
||||
moduleTitle = results.moduleName;
|
||||
}
|
||||
moduleTitle = ucwords(moduleTitle.replace("_", " ").toLowerCase());
|
||||
@@ -151,7 +159,7 @@ module.exports = function(grunt){
|
||||
dest: "public_html/config-menu.json"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
uglify: {
|
||||
options: {
|
||||
mangle: false
|
||||
@@ -163,14 +171,14 @@ module.exports = function(grunt){
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
cssmin: {
|
||||
options: {
|
||||
mergeIntoShorthands: false,
|
||||
roundingPrecision: -1
|
||||
},
|
||||
build: {
|
||||
files:{
|
||||
files: {
|
||||
"public_html/build/css/main/main.min.css": ["public_html/css/main/*.css"],
|
||||
"public_html/build/css/main/fonts.min.css": ["public_html/css/main/fonts.css"],
|
||||
"public_html/build/css/addons.min.css": ["public_html/css/addons/*.css"],
|
||||
@@ -178,7 +186,7 @@ module.exports = function(grunt){
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"file-creator": fileCreator_getValues()
|
||||
});
|
||||
|
||||
@@ -193,7 +201,8 @@ module.exports = function(grunt){
|
||||
grunt.loadNpmTasks("grunt-contrib-uglify");
|
||||
grunt.loadNpmTasks("grunt-file-creator");
|
||||
|
||||
grunt.registerTask("build", "Salva file di build", function(arg1){
|
||||
|
||||
grunt.registerTask("build", "Salva file di build", function (arg1) {
|
||||
var date = new Date();
|
||||
var build = {
|
||||
name: cleanName(arg1),
|
||||
@@ -211,63 +220,75 @@ module.exports = function(grunt){
|
||||
arr_taskBuildAll.push("uglify");
|
||||
arr_taskBuildAll.push("cssmin");
|
||||
arr_taskBuildAll.push("copy:build_folder");
|
||||
for(var i in _arr_aziende){
|
||||
arr_taskBuildAll.push("copy:assets");
|
||||
for (var i in _arr_aziende) {
|
||||
var nomeAzienda = _arr_aziende[i].n.toLowerCase();
|
||||
grunt.registerTask(nomeAzienda, ["clean:default", "uglify", "cssmin", "copy:build_folder",
|
||||
"build:" + cleanName(nomeAzienda), "copy:" + cleanName(nomeAzienda),
|
||||
"file-creator:" + cleanName(nomeAzienda), "clean:build",
|
||||
"compress:" + cleanName(nomeAzienda), "open:file"]);
|
||||
|
||||
grunt.registerTask(nomeAzienda, [
|
||||
"clean:default",
|
||||
"uglify",
|
||||
"cssmin",
|
||||
"copy:build_folder",
|
||||
"build:" + cleanName(nomeAzienda),
|
||||
"copy:" + cleanName(nomeAzienda),
|
||||
"file-creator:" + cleanName(nomeAzienda),
|
||||
"clean:build",
|
||||
"compress:" + cleanName(nomeAzienda),
|
||||
"open:file"
|
||||
]);
|
||||
|
||||
|
||||
arr_taskBuildAll.push("clean:tmp");
|
||||
arr_taskBuildAll.push("build:" + cleanName(nomeAzienda));
|
||||
arr_taskBuildAll.push("copy:" + cleanName(nomeAzienda));
|
||||
arr_taskBuildAll.push("file-creator:" + cleanName(nomeAzienda));
|
||||
arr_taskBuildAll.push("compress:" + cleanName(nomeAzienda));
|
||||
|
||||
}
|
||||
arr_taskBuildAll.push("clean:build");
|
||||
arr_taskBuildAll.push("open:file");
|
||||
|
||||
|
||||
grunt.registerTask("BuildAll", arr_taskBuildAll);
|
||||
|
||||
grunt.registerTask("Nuovo modulo", ["prompt:newmodule", "copy:newmodule_folder", "copy:newmodule_homephp", "rename:newmodule", "merge-append-json:newmodule"]);
|
||||
};
|
||||
|
||||
function format_id(s){
|
||||
function format_id(s) {
|
||||
return s.replace(/ /g, "_").toLowerCase();
|
||||
}
|
||||
|
||||
function cleanName(s){
|
||||
function cleanName(s) {
|
||||
return s.replace(/-/g, "");
|
||||
}
|
||||
|
||||
function fileCreator_getValues(){
|
||||
function fileCreator_getValues() {
|
||||
var ret = {};
|
||||
|
||||
var _getFunc = function(_nomeAzienda){
|
||||
return function(fs, fd, done) {
|
||||
|
||||
var _getFunc = function (_nomeAzienda) {
|
||||
return function (fs, fd, done) {
|
||||
fs.writeSync(fd, _nomeAzienda);
|
||||
done();
|
||||
};
|
||||
};
|
||||
|
||||
for(var i in _arr_aziende){
|
||||
|
||||
for (var i in _arr_aziende) {
|
||||
var nomeAzienda = cleanName(_arr_aziende[i].n).toUpperCase();
|
||||
var nomeAziendaLower = nomeAzienda.toLowerCase();
|
||||
var path = "exports/" + nomeAzienda + "/nome_azienda.txt";
|
||||
var path = "exports/tmp/nome_azienda.txt";
|
||||
ret[nomeAziendaLower] = {};
|
||||
ret[nomeAziendaLower][path] = _getFunc(nomeAzienda);
|
||||
}//log(ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
function compress_getValues(){
|
||||
function compress_getValues() {
|
||||
var ret = {};
|
||||
for(var i in _arr_aziende){
|
||||
for (var i in _arr_aziende) {
|
||||
var nomeAzienda = cleanName(_arr_aziende[i].n).toUpperCase();
|
||||
var nomeAziendaLower = nomeAzienda.toLowerCase();
|
||||
ret[nomeAziendaLower] = {
|
||||
options: {archive: "exports/" + nomeAziendaLower + ".zip"},
|
||||
expand: true,
|
||||
cwd: "exports/" + nomeAzienda + "/",
|
||||
cwd: "exports/tmp", // + nomeAzienda + "/",
|
||||
src: ["**/*"],
|
||||
dest: "/"
|
||||
};
|
||||
@@ -275,73 +296,73 @@ function compress_getValues(){
|
||||
return ret;
|
||||
}
|
||||
|
||||
function get_listModuli(){
|
||||
function get_listModuli() {
|
||||
return require("./public_html/config-menu.json");
|
||||
}
|
||||
|
||||
function log(v){
|
||||
function log(v) {
|
||||
console.log(v);
|
||||
}
|
||||
|
||||
function get_listScriptFile(){
|
||||
function get_listScriptFile() {
|
||||
var root = "public_html/";
|
||||
var arr_scripts = require("./" + root + "include/scriptList.json");
|
||||
for(var i=0; i<arr_scripts.length; i++){
|
||||
arr_scripts[i] = root+arr_scripts[i];
|
||||
for (var i = 0; i < arr_scripts.length; i++) {
|
||||
arr_scripts[i] = root + arr_scripts[i];
|
||||
}
|
||||
return arr_scripts;
|
||||
}
|
||||
|
||||
function get_listScriptFileLogin(){
|
||||
function get_listScriptFileLogin() {
|
||||
var root = "public_html/";
|
||||
var arr_scripts = require("./" + root + "gest-lib/login/"+"include/scriptList.json");
|
||||
for(var i=0; i<arr_scripts.length; i++){
|
||||
arr_scripts[i] = root+arr_scripts[i];
|
||||
var arr_scripts = require("./" + root + "gest-lib/login/" + "include/scriptList.json");
|
||||
for (var i = 0; i < arr_scripts.length; i++) {
|
||||
arr_scripts[i] = root + arr_scripts[i];
|
||||
}
|
||||
return arr_scripts;
|
||||
}
|
||||
|
||||
// <editor-fold desc="copy_getValues" defaultstate="collapsed">
|
||||
function copy_getValues(grunt){
|
||||
// <editor-fold desc="copy_getValues" defaultstate="collapsed">
|
||||
function copy_getValues(grunt) {
|
||||
var ret = {};
|
||||
try{
|
||||
try {
|
||||
var arr_systemFile = [
|
||||
"config.php", "flushcache.php", "functions.php", "image.php", "download.php",
|
||||
"include_login.php", "index.php", "logout.php", "obj-json-b64-codecs.php","firebase-messaging-sw.js"
|
||||
"include_login.php", "index.php", "logout.php", "obj-json-b64-codecs.php", "firebase-messaging-sw.js"
|
||||
];
|
||||
|
||||
|
||||
var moduleList = get_listModuli();
|
||||
|
||||
for(var i in _arr_aziende){
|
||||
for (var i in _arr_aziende) {
|
||||
var item = _arr_aziende[i];
|
||||
var nomeAzienda = cleanName(item.n).toLowerCase();
|
||||
|
||||
var arr_profiles = [nomeAzienda];
|
||||
if (typeof item.sub != "undefined"){
|
||||
for (var i in item.sub){
|
||||
if (typeof item.sub != "undefined") {
|
||||
for (var i in item.sub) {
|
||||
arr_profiles.push(item.sub[i]);
|
||||
}
|
||||
}
|
||||
|
||||
var arr_gestAzi = [];
|
||||
var data = require("./public_html/config_aziende/" + nomeAzienda.toUpperCase() + "/gestioni.json");
|
||||
for(var i in data){
|
||||
for (var i in data) {
|
||||
var item = data[i];
|
||||
arr_gestAzi.push(item.name);
|
||||
}
|
||||
arr_gestAzi.push("tasks_launcher", "impostazioni", "index", "report_area", "phpinfo", "login", "emailcheck", "user_settings", "messenger","logs","notifiche","i18n", "weather", "allegati");
|
||||
|
||||
arr_gestAzi.push("tasks_launcher", "impostazioni", "index", "report_area", "associazione_report", "phpinfo", "login", "emailcheck", "user_settings", "messenger", "logs", "notifiche", "i18n", "weather", "allegati");
|
||||
|
||||
var arr_moduleIDToCopy = [];
|
||||
for(var moduleID in moduleList){
|
||||
if(!moduleList.hasOwnProperty(moduleID)) continue;
|
||||
if(arr_gestAzi.indexOf(moduleID) >= 0){
|
||||
for (var moduleID in moduleList) {
|
||||
if (!moduleList.hasOwnProperty(moduleID)) continue;
|
||||
if (arr_gestAzi.indexOf(moduleID) >= 0) {
|
||||
arr_moduleIDToCopy.push(moduleID);
|
||||
|
||||
var module = moduleList[moduleID];
|
||||
if("children" in module && module.children != null){
|
||||
for(var j in module.children){
|
||||
if ("children" in module && module.children != null) {
|
||||
for (var j in module.children) {
|
||||
var childModuleName = module.children[j];
|
||||
if(arr_moduleIDToCopy.indexOf(childModuleName) < 0 && childModuleName in moduleList){
|
||||
if (arr_moduleIDToCopy.indexOf(childModuleName) < 0 && childModuleName in moduleList) {
|
||||
arr_moduleIDToCopy.push(childModuleName);
|
||||
}
|
||||
}
|
||||
@@ -350,20 +371,20 @@ function copy_getValues(grunt){
|
||||
}
|
||||
|
||||
var arr_gestFileAzi = [];
|
||||
for(var i = 0; i < arr_moduleIDToCopy.length; i++){
|
||||
for (var i = 0; i < arr_moduleIDToCopy.length; i++) {
|
||||
var moduleID = arr_moduleIDToCopy[i];
|
||||
var module = moduleList[moduleID];
|
||||
var basename = moduleID.split("-")[0];
|
||||
|
||||
|
||||
// AGGIUNGE FILE PHP GESTIONE IN ROOT
|
||||
var page = module.pages.split("?")[0]; // es. "colli_aperti.php?spedizione" -> "colli_aperti.php", "spedizione"
|
||||
arr_gestFileAzi.push(page);
|
||||
|
||||
// AGGIUNGE FILE SFUSI SPECIFICATI IN gestione.include
|
||||
if(typeof module.include != "undefined"){
|
||||
if (typeof module.include != "undefined") {
|
||||
arr_gestFileAzi = arr_gestFileAzi.concat(module.include);
|
||||
}
|
||||
|
||||
|
||||
// AGGIUNGE DIRECTORY GESTIONI SOTTO gest-lib
|
||||
arr_gestFileAzi.push("gest-lib/" + basename + "/**");
|
||||
|
||||
@@ -371,7 +392,7 @@ function copy_getValues(grunt){
|
||||
//arr_gestFileAzi.push("!gest-lib/"+basename+"/scss/**");
|
||||
|
||||
// AGGIUNGE FILE CONFIGURAZIONE AZIENDA
|
||||
for(var j = 0; j < arr_profiles.length; j++){
|
||||
for (var j = 0; j < arr_profiles.length; j++) {
|
||||
var item = arr_profiles[j];
|
||||
//arr_gestFileAzi.push("!config_aziende/"+item.toUpperCase()+"/login-bg/**"); // non funziona
|
||||
arr_gestFileAzi.push("config_aziende/" + item.toUpperCase() + "/**");
|
||||
@@ -379,35 +400,44 @@ function copy_getValues(grunt){
|
||||
}
|
||||
}
|
||||
|
||||
var arr_copyValues = ["**", "!*.php", "!*.js", "!js/**", "!css/**",
|
||||
var arr_copyValues = ["**", "!*.php", "!*.js", "!js/**", "!css/**", "!assets/**", "!vendor/**",
|
||||
"!gest-lib/**", "!cache/**", "!config_aziende/**"];
|
||||
|
||||
arr_copyValues = arr_copyValues.concat(arr_systemFile);
|
||||
arr_copyValues = arr_copyValues.concat(arr_gestFileAzi);
|
||||
arr_copyValues.push("!**/old/**");
|
||||
|
||||
|
||||
/*
|
||||
arr_copyValues = a.filter(function(item, pos){ // rimuove eventuali doppioni
|
||||
return a.indexOf(item) == pos;
|
||||
});*/
|
||||
|
||||
|
||||
ret[nomeAzienda] = {
|
||||
cwd: "public_html",
|
||||
src: arr_copyValues,
|
||||
dest: "exports/" + nomeAzienda.toUpperCase(),
|
||||
dest: "exports/tmp", // + nomeAzienda.toUpperCase(),
|
||||
expand: true,
|
||||
options: {timestamp: true}
|
||||
};
|
||||
}
|
||||
;
|
||||
|
||||
ret["assets"] = {
|
||||
cwd: "public_html",
|
||||
src: ["assets/**", "vendor/**"],
|
||||
dest: "exports/tmp", // + nomeAzienda.toUpperCase(),
|
||||
expand: true,
|
||||
options: {timestamp: true}
|
||||
};
|
||||
|
||||
|
||||
ret.build_folder = {
|
||||
cwd: "public_html/",
|
||||
src: ["css/**", "!css/*/*.css","!css/addons"],
|
||||
src: ["css/**", "!css/*/*.css", "!css/addons"],
|
||||
dest: "public_html/build/",
|
||||
expand: true,
|
||||
options: {timestamp: true}
|
||||
};
|
||||
|
||||
|
||||
ret.newmodule_folder = {
|
||||
cwd: "public_html/gest-lib/empty_section",
|
||||
src: "**",
|
||||
@@ -415,7 +445,7 @@ function copy_getValues(grunt){
|
||||
expand: true,
|
||||
options: {
|
||||
timestamp: true,
|
||||
processContent: function(content, srcpath){ // nelle versioni piu recenti si chiama 'process'
|
||||
processContent: function (content, srcpath) { // nelle versioni piu recenti si chiama 'process'
|
||||
var moduleNameCCLower = toCamelCase(format_id(grunt.config("moduleName")));
|
||||
var moduleNameCC = ucfirst(moduleNameCCLower);
|
||||
content = content.replace(/EmptySection/g, moduleNameCC);
|
||||
@@ -424,12 +454,12 @@ function copy_getValues(grunt){
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
ret.newmodule_homephp = {
|
||||
options: {
|
||||
expand: true,
|
||||
flatten: true,
|
||||
processContent: function(content, srcpath){ // nelle versioni piu recenti si chiama 'process'
|
||||
processContent: function (content, srcpath) { // nelle versioni piu recenti si chiama 'process'
|
||||
var moduleName = format_id(grunt.config("moduleName"));
|
||||
var moduleNameCC = ucfirst(toCamelCase(moduleName));
|
||||
//console.log(moduleName+" "+moduleNameCC);
|
||||
@@ -439,7 +469,7 @@ function copy_getValues(grunt){
|
||||
files: []
|
||||
};
|
||||
|
||||
} catch(e){
|
||||
} catch (e) {
|
||||
console.log(e.message);
|
||||
}
|
||||
return ret;
|
||||
@@ -447,21 +477,21 @@ function copy_getValues(grunt){
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
function toCamelCase(s){
|
||||
return s.replace(/(\_[a-z])/g, function ($1){
|
||||
function toCamelCase(s) {
|
||||
return s.replace(/(\_[a-z])/g, function ($1) {
|
||||
return $1.toUpperCase().replace("_", "");
|
||||
});
|
||||
}
|
||||
|
||||
function ucfirst(s){
|
||||
return s!==null ? s.charAt(0).toUpperCase() + s.slice(1) : null;
|
||||
function ucfirst(s) {
|
||||
return s !== null ? s.charAt(0).toUpperCase() + s.slice(1) : null;
|
||||
}
|
||||
|
||||
function ucwords(s){
|
||||
if(s !== null){
|
||||
function ucwords(s) {
|
||||
if (s !== null) {
|
||||
s = s.toLowerCase();
|
||||
return s.replace(/(^([a-zA-Z\p{M}]))|([ -][a-zA-Z\p{M}])/g,
|
||||
function(s){
|
||||
function (s) {
|
||||
return s.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
3171
package-lock.json
generated
3171
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,7 @@
|
||||
"grunt-merge-append-json": "^0.10.0",
|
||||
"grunt-mkdir": "^1.0.0",
|
||||
"grunt-open": "^0.2.3",
|
||||
"grunt-parallel": "^0.5.1",
|
||||
"grunt-processhtml": "^0.3.8",
|
||||
"grunt-prompt": "^1.3.3",
|
||||
"grunt-string-replace": "^1.3.1"
|
||||
|
||||
@@ -15,23 +15,23 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
if(isset($_GET["viewdoc"])){
|
||||
include Controller::current_gestpath_include("viewdoc.php");
|
||||
} else if(isset($_GET["viewchk"])){
|
||||
include Controller::current_gestpath_include("viewchks.php");
|
||||
} else{
|
||||
include Controller::current_gestpath_include("step1.php");
|
||||
}
|
||||
}?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
if (isset($_GET["viewdoc"])) {
|
||||
include Controller::current_gestpath_include("viewdoc.php");
|
||||
} else if (isset($_GET["viewchk"])) {
|
||||
include Controller::current_gestpath_include("viewchks.php");
|
||||
} else {
|
||||
include Controller::current_gestpath_include("step1.php");
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,17 +19,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -45,7 +45,9 @@
|
||||
"assets/jquery/jquery.maskedinput.min.js",
|
||||
"assets/jquery/jquery.mobile.touch.min.js",
|
||||
"assets/jquery/jquery.tabbable.min.js",
|
||||
"assets/jquery/jquery.serialize-object.min.js"
|
||||
"assets/jquery/jquery.serialize-object.min.js",
|
||||
"assets/jquery/jquery.color.min.js",
|
||||
"assets/jquery/jquery.color.svg-names.js"
|
||||
],
|
||||
"css": []
|
||||
},
|
||||
@@ -63,17 +65,30 @@
|
||||
"dataTables": {
|
||||
"js": [
|
||||
"assets/datatables/js/jquery.dataTables.min.js",
|
||||
"assets/datatables/js/jquery.dataTables.custom.js",
|
||||
"assets/datatables/js/dataTables.bootstrap.min.js",
|
||||
"assets/datatables/js/dataTables.fixedColumns.min.js",
|
||||
"assets/datatables/js/dataTables.fixedHeader.min.js",
|
||||
"assets/datatables/js/dataTables.responsive.min.js",
|
||||
"assets/datatables/js/responsive.bootstrap.min.js",
|
||||
"assets/datatables/js/dataTables.scroller.min.js"
|
||||
"assets/datatables/js/dataTables.scroller.min.js",
|
||||
"assets/datatables/js/dataTables.rowGroup.min.js",
|
||||
"assets/datatables/js/dataTables.buttons.min.js",
|
||||
"assets/datatables/js/buttons.bootstrap.min.js",
|
||||
"assets/datatables/js/dataTables.select.min.js",
|
||||
"assets/datatables/js/select.bootstrap.min.js",
|
||||
"assets/datatables/js/dataTables.rowReorder.min.js"
|
||||
],
|
||||
"css": [
|
||||
"assets/datatables/css/dataTables.bootstrap.css",
|
||||
"assets/datatables/css/fixedHeader.bootstrap.min.css",
|
||||
"assets/datatables/css/scroller.dataTables.min.css"
|
||||
"assets/datatables/css/fixedColumns.dataTables.min.css",
|
||||
"assets/datatables/css/scroller.dataTables.min.css",
|
||||
"assets/datatables/css/rowReorder.bootstrap.min.css",
|
||||
"assets/datatables/css/rowGroup.dataTables.min.css",
|
||||
"assets/datatables/css/buttons.bootstrap.min.css",
|
||||
"assets/datatables/css/select.dataTables.min.css",
|
||||
"assets/datatables/css/select.bootstrap.min.css"
|
||||
]
|
||||
},
|
||||
"bootstrap": {
|
||||
@@ -311,7 +326,8 @@
|
||||
],
|
||||
"js": [
|
||||
"assets/tinymce/tinymce.min.js",
|
||||
"assets/tinymce/jquery.tinymce.min.js"
|
||||
"assets/tinymce/jquery.tinymce.min.js",
|
||||
"assets/tinymce/langs/it_IT.js"
|
||||
]
|
||||
},
|
||||
"bootstrap-table": {
|
||||
@@ -327,23 +343,23 @@
|
||||
"assets/bootstrap-table/css/bootstrap-table-filter-control.min.css"
|
||||
]
|
||||
},
|
||||
"kendogrid" : {
|
||||
"js" : [
|
||||
"kendogrid": {
|
||||
"js": [
|
||||
"assets/kendogrid/js/kendo.all.min.js",
|
||||
"assets/kendogrid/js/cultures/kendo.culture.it-IT.min.js",
|
||||
"assets/kendogrid/js/messages/kendo.messages.it-IT.min.js"
|
||||
],
|
||||
"css" : [
|
||||
"css": [
|
||||
"assets/kendogrid/styles/kendo.bootstrap-table.theme.css"
|
||||
]
|
||||
},
|
||||
"amcharts" : {
|
||||
"js" : [
|
||||
"amcharts": {
|
||||
"js": [
|
||||
"assets/amcharts/js/core.js",
|
||||
"assets/amcharts/js/charts.js",
|
||||
"assets/amcharts/js/animated.js"
|
||||
],
|
||||
"css" : [
|
||||
"css": [
|
||||
]
|
||||
}
|
||||
}
|
||||
1
public_html/assets/datatables/css/buttons.bootstrap.min.css
vendored
Normal file
1
public_html/assets/datatables/css/buttons.bootstrap.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@keyframes dtb-spinner{100%{transform:rotate(360deg)}}@-o-keyframes dtb-spinner{100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes dtb-spinner{100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dtb-spinner{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes dtb-spinner{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}div.dt-button-info{position:fixed;top:50%;left:50%;width:400px;margin-top:-100px;margin-left:-200px;background-color:white;border:2px solid #111;box-shadow:3px 3px 8px rgba(0, 0, 0, 0.3);border-radius:3px;text-align:center;z-index:21}div.dt-button-info h2{padding:.5em;margin:0;font-weight:normal;border-bottom:1px solid #ddd;background-color:#f3f3f3}div.dt-button-info>div{padding:1em}button.dtb-hide-drop{display:none !important}div.dt-button-collection-title{text-align:center;padding:.3em 0 .5em;font-size:.9em}div.dt-button-collection-title:empty{display:none}div.dt-button-collection{position:absolute;z-index:2001;width:100%}div.dt-button-collection ul.dropdown-menu{position:relative;display:block;z-index:2002;min-width:100%}div.dt-button-collection div.dt-button-collection-title{background-color:white}div.dt-button-collection div.dt-btn-split-wrapper{width:100%;display:inline-flex;padding-left:5px;padding-right:5px}div.dt-button-collection button.dt-btn-split-drop-button{width:100%;border:none;border-radius:0px;margin-left:0px !important}div.dt-button-collection button.dt-btn-split-drop-button:focus{border:none;border-radius:0px;outline:none}div.dt-button-collection.fixed{position:fixed;top:50%;left:50%;margin-left:-75px;border-radius:0}div.dt-button-collection.fixed.two-column{margin-left:-200px}div.dt-button-collection.fixed.three-column{margin-left:-225px}div.dt-button-collection.fixed.four-column{margin-left:-300px}div.dt-button-collection>:last-child{display:block !important;-webkit-column-gap:8px;-moz-column-gap:8px;-ms-column-gap:8px;-o-column-gap:8px;column-gap:8px}div.dt-button-collection>:last-child>*{-webkit-column-break-inside:avoid;break-inside:avoid}div.dt-button-collection.two-column{width:400px}div.dt-button-collection.two-column>:last-child{padding-bottom:1px;-webkit-column-count:2;-moz-column-count:2;-ms-column-count:2;-o-column-count:2;column-count:2}div.dt-button-collection.three-column{width:450px}div.dt-button-collection.three-column>:last-child{padding-bottom:1px;-webkit-column-count:3;-moz-column-count:3;-ms-column-count:3;-o-column-count:3;column-count:3}div.dt-button-collection.four-column{width:600px}div.dt-button-collection.four-column>:last-child{padding-bottom:1px;-webkit-column-count:4;-moz-column-count:4;-ms-column-count:4;-o-column-count:4;column-count:4}div.dt-button-collection .dt-button{border-radius:0}div.dt-button-background{position:fixed;top:0;left:0;width:100%;height:100%;z-index:2001}@media screen and (max-width: 767px){div.dt-buttons{float:none;width:100%;text-align:center;margin-bottom:.5em}div.dt-buttons a.btn{float:none}}div.dt-buttons button.btn.processing,div.dt-buttons div.btn.processing,div.dt-buttons a.btn.processing{color:rgba(0, 0, 0, 0.2)}div.dt-buttons button.btn.processing:after,div.dt-buttons div.btn.processing:after,div.dt-buttons a.btn.processing:after{position:absolute;top:50%;left:50%;width:16px;height:16px;margin:-8px 0 0 -8px;box-sizing:border-box;display:block;content:" ";border:2px solid #282828;border-radius:50%;border-left-color:transparent;border-right-color:transparent;animation:dtb-spinner 1500ms infinite linear;-o-animation:dtb-spinner 1500ms infinite linear;-ms-animation:dtb-spinner 1500ms infinite linear;-webkit-animation:dtb-spinner 1500ms infinite linear;-moz-animation:dtb-spinner 1500ms infinite linear}div.dt-btn-split-wrapper button.dt-btn-split-drop{border-top-right-radius:4px !important;border-bottom-right-radius:4px !important}span.dt-down-arrow{color:rgba(70, 70, 70, 0.9);font-size:10px;padding-left:10px}div.dataTables_wrapper div.dt-buttons.btn-group button.btn:last-of-type:first-of-type{border-radius:4px !important}
|
||||
@@ -1,231 +1,193 @@
|
||||
html[direction='ltr'] div.dataTables_length label {
|
||||
float: left;
|
||||
text-align: left;
|
||||
@charset "UTF-8";
|
||||
table.dataTable {
|
||||
clear: both;
|
||||
margin-top: 6px !important;
|
||||
margin-bottom: 6px !important;
|
||||
max-width: none !important;
|
||||
border-collapse: separate !important;
|
||||
}
|
||||
html[direction='rtl'] div.dataTables_length label {
|
||||
float: right;
|
||||
text-align: right;
|
||||
table.dataTable td,
|
||||
table.dataTable th {
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
table.dataTable td.dataTables_empty,
|
||||
table.dataTable th.dataTables_empty {
|
||||
text-align: center;
|
||||
}
|
||||
table.dataTable.nowrap th,
|
||||
table.dataTable.nowrap td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.dataTables_length select {
|
||||
width: 75px;
|
||||
div.dataTables_wrapper div.dataTables_length label {
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_length select {
|
||||
width: 75px;
|
||||
display: inline-block;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_filter {
|
||||
text-align: right;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_filter label {
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_filter input {
|
||||
margin-left: 0.5em;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_info {
|
||||
padding-top: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_paginate {
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
|
||||
margin: 2px 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_processing {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 200px;
|
||||
margin-left: -100px;
|
||||
margin-top: -26px;
|
||||
text-align: center;
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
html[direction='ltr'] div.dataTables_filter label {
|
||||
float: right;
|
||||
table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting,
|
||||
table.dataTable thead > tr > td.sorting_asc,
|
||||
table.dataTable thead > tr > td.sorting_desc,
|
||||
table.dataTable thead > tr > td.sorting {
|
||||
padding-right: 30px;
|
||||
}
|
||||
html[direction='rtl'] div.dataTables_filter label {
|
||||
float: left;
|
||||
table.dataTable thead > tr > th:active,
|
||||
table.dataTable thead > tr > td:active {
|
||||
outline: none;
|
||||
}
|
||||
table.dataTable thead .sorting,
|
||||
table.dataTable thead .sorting_asc,
|
||||
table.dataTable thead .sorting_desc,
|
||||
table.dataTable thead .sorting_asc_disabled,
|
||||
table.dataTable thead .sorting_desc_disabled {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
table.dataTable thead .sorting:after,
|
||||
table.dataTable thead .sorting_asc:after,
|
||||
table.dataTable thead .sorting_desc:after,
|
||||
table.dataTable thead .sorting_asc_disabled:after,
|
||||
table.dataTable thead .sorting_desc_disabled:after {
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
right: 8px;
|
||||
display: block;
|
||||
font-family: "Glyphicons Halflings";
|
||||
opacity: 0.5;
|
||||
}
|
||||
table.dataTable thead .sorting:after {
|
||||
opacity: 0.2;
|
||||
content: "";
|
||||
/* sort */
|
||||
}
|
||||
table.dataTable thead .sorting_asc:after {
|
||||
opacity: 0.5;
|
||||
content: "";
|
||||
/* sort-by-attributes */
|
||||
}
|
||||
table.dataTable thead .sorting_desc:after {
|
||||
opacity: 0.5;
|
||||
content: "";
|
||||
/* sort-by-attributes-alt */
|
||||
}
|
||||
table.dataTable thead .sorting_asc_disabled:after,
|
||||
table.dataTable thead .sorting_desc_disabled:after {
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
div.dataTables_info {
|
||||
padding-top: 26px;
|
||||
div.dataTables_scrollHead table.dataTable {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
div.dataTables_paginate {
|
||||
margin: 0;
|
||||
div.dataTables_scrollBody > table {
|
||||
border-top: none;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
html[direction='ltr'] div.dataTables_paginate {
|
||||
float: right;
|
||||
div.dataTables_scrollBody > table > thead .sorting:after,
|
||||
div.dataTables_scrollBody > table > thead .sorting_asc:after,
|
||||
div.dataTables_scrollBody > table > thead .sorting_desc:after {
|
||||
display: none;
|
||||
}
|
||||
html[direction='rtl'] div.dataTables_paginate {
|
||||
float: left;
|
||||
div.dataTables_scrollBody > table > tbody > tr:first-child > th,
|
||||
div.dataTables_scrollBody > table > tbody > tr:first-child > td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
table.table {
|
||||
clear: both;
|
||||
/*margin-bottom: 6px !important;*/
|
||||
max-width: none !important;
|
||||
div.dataTables_scrollFoot > .dataTables_scrollFootInner {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
|
||||
margin-top: 0 !important;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
table.table thead .sorting,
|
||||
table.table thead .sorting_asc,
|
||||
table.table thead .sorting_desc,
|
||||
table.table thead .sorting_asc_disabled,
|
||||
table.table thead .sorting_desc_disabled {
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
@media screen and (max-width: 767px) {
|
||||
div.dataTables_wrapper div.dataTables_length,
|
||||
div.dataTables_wrapper div.dataTables_filter,
|
||||
div.dataTables_wrapper div.dataTables_info,
|
||||
div.dataTables_wrapper div.dataTables_paginate {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
table.dataTable.table-condensed > thead > tr > th {
|
||||
padding-right: 20px;
|
||||
}
|
||||
table.dataTable.table-condensed .sorting:after,
|
||||
table.dataTable.table-condensed .sorting_asc:after,
|
||||
table.dataTable.table-condensed .sorting_desc:after {
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use Glyphicons Halflings from Bootstrap 3 instead of images.
|
||||
*
|
||||
* Relevant icons:
|
||||
*
|
||||
* Glyphicons Halflings (default)
|
||||
* glyphicon-sort '\e150' sort
|
||||
* glyphicon-sort-by-attributes '\e155' asc
|
||||
* glyphicon-sort-by-attributes-alt '\e156' desc
|
||||
*
|
||||
* Font Awesome
|
||||
* fa-sort '\f0dc' sort
|
||||
* fa-caret-up '\f0d8' asc
|
||||
* fa-caret-down '\f0d7' desc
|
||||
*/
|
||||
table.table thead .sorting:after,
|
||||
table.table thead .sorting_asc:after,
|
||||
table.table thead .sorting_desc:after,
|
||||
table.table thead .sorting_asc_disabled:after,
|
||||
table.table thead .sorting_desc_disabled:after {
|
||||
/*font-family: 'Glyphicons Halflings';*/
|
||||
/*font-family: 'FontAwesome';*/
|
||||
/*font-family: 'Font Awesome 5 Free';*/
|
||||
font-family: 'Font Awesome 5 Pro';
|
||||
|
||||
|
||||
table.table-bordered.dataTable {
|
||||
border-right-width: 0;
|
||||
}
|
||||
html[direction='ltr'] table.table thead .sorting:after,
|
||||
html[direction='ltr'] table.table thead .sorting_asc:after,
|
||||
html[direction='ltr'] table.table thead .sorting_desc:after,
|
||||
html[direction='ltr'] table.table thead .sorting_asc_disabled:after,
|
||||
html[direction='ltr'] table.table thead .sorting_desc_disabled:after {
|
||||
text-align: right;
|
||||
float: right;
|
||||
table.table-bordered.dataTable th,
|
||||
table.table-bordered.dataTable td {
|
||||
border-left-width: 0;
|
||||
}
|
||||
html[direction='rtl'] table.table thead .sorting:after,
|
||||
html[direction='rtl'] table.table thead .sorting_asc:after,
|
||||
html[direction='rtl'] table.table thead .sorting_desc:after,
|
||||
html[direction='rtl'] table.table thead .sorting_asc_disabled:after,
|
||||
html[direction='rtl'] table.table thead .sorting_desc_disabled:after {
|
||||
text-align: left;
|
||||
float: left;
|
||||
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child,
|
||||
table.table-bordered.dataTable td:last-child,
|
||||
table.table-bordered.dataTable td:last-child {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
table.table thead .sorting:after { content: ' \f0dc'; opacity: 0.2; }
|
||||
table.table thead .sorting_asc:after { content: ' \f0d8'; }
|
||||
table.table thead .sorting_desc:after { content: ' \f0d7'; }
|
||||
table.table thead .sorting_asc_disabled:after { content: ' \f0d8'; opacity: 0.2; }
|
||||
table.table thead .sorting_desc_disabled:after { content: ' \f0d7'; opacity: 0.2; }
|
||||
|
||||
table.dataTable th:active {
|
||||
outline: none;
|
||||
table.table-bordered.dataTable tbody th,
|
||||
table.table-bordered.dataTable tbody td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
/* Scrolling */
|
||||
div.dataTables_scrollHead table {
|
||||
margin-bottom: 0 !important;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
div.dataTables_scrollHead table.table-bordered {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollHead table thead tr:last-child th:first-child,
|
||||
div.dataTables_scrollHead table thead tr:last-child td:first-child {
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
div.table-responsive > div.dataTables_wrapper > div.row {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody table {
|
||||
border-top: none;
|
||||
margin-bottom: 0 !important;
|
||||
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody tbody tr:first-child th,
|
||||
div.dataTables_scrollBody tbody tr:first-child td {
|
||||
border-top: none;
|
||||
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollFoot table {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* TableTools styles
|
||||
*/
|
||||
.table tbody tr.active td,
|
||||
.table tbody tr.active th {
|
||||
background-color: #08C;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.table tbody tr.active:hover td,
|
||||
.table tbody tr.active:hover th {
|
||||
background-color: #0075b0 !important;
|
||||
}
|
||||
|
||||
.table-striped tbody tr.active:nth-child(odd) td,
|
||||
.table-striped tbody tr.active:nth-child(odd) th {
|
||||
background-color: #017ebc;
|
||||
}
|
||||
|
||||
table.DTTT_selectable tbody tr {
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
}
|
||||
|
||||
div.DTTT .btn {
|
||||
color: #333 !important;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
div.DTTT .btn:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
|
||||
ul.DTTT_dropdown.dropdown-menu a {
|
||||
color: #333 !important; /* needed only when demo_page.css is included */
|
||||
}
|
||||
|
||||
ul.DTTT_dropdown.dropdown-menu li:hover a {
|
||||
background-color: #0088cc;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
/* TableTools information display */
|
||||
div.DTTT_print_info.modal {
|
||||
height: 150px;
|
||||
margin-top: -75px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.DTTT_print_info h6 {
|
||||
font-weight: normal;
|
||||
font-size: 28px;
|
||||
line-height: 28px;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
div.DTTT_print_info p {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* FixedColumns styles
|
||||
*/
|
||||
div.DTFC_LeftHeadWrapper table,
|
||||
div.DTFC_LeftFootWrapper table,
|
||||
table.DTFC_Cloned tr.even {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
div.DTFC_LeftHeadWrapper table {
|
||||
margin-bottom: 0 !important;
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child,
|
||||
div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child {
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
div.DTFC_LeftBodyWrapper table {
|
||||
border-top: none;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
div.DTFC_LeftBodyWrapper tbody tr:first-child th,
|
||||
div.DTFC_LeftBodyWrapper tbody tr:first-child td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
div.DTFC_LeftFootWrapper table {
|
||||
border-top: none;
|
||||
}
|
||||
1
public_html/assets/datatables/css/fixedColumns.dataTables.min.css
vendored
Normal file
1
public_html/assets/datatables/css/fixedColumns.dataTables.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
table.dataTable.display tbody tr.DTFC_NoData{background-color:transparent}tr.even td{background-color:#fff}tr.odd td{background-color:#f9f9f9}tr.selected td{background-color:#a6b4cd}tr.dt-rowReorder-moving td.dtfc-fixed-left,tr.dt-rowReorder-moving td.dtfc-fixed-right{border-top:2px solid #555 !important;border-bottom:2px solid #555 !important}tr.dt-rowReorder-moving td.dtfc-fixed-left:first-child{border-left:2px solid #555 !important}tr.dt-rowReorder-moving td.dtfc-fixed-right:last-child{border-right:2px solid #555 !important}
|
||||
1
public_html/assets/datatables/css/rowGroup.dataTables.min.css
vendored
Normal file
1
public_html/assets/datatables/css/rowGroup.dataTables.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
table.dataTable tr.dtrg-group td{background-color:#e0e0e0}table.dataTable tr.dtrg-group.dtrg-level-0 td{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 td,table.dataTable tr.dtrg-group.dtrg-level-2 td,table.dataTable tr.dtrg-group.dtrg-level-3 td,table.dataTable tr.dtrg-group.dtrg-level-4 td,table.dataTable tr.dtrg-group.dtrg-level-5 td{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 td{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 td{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 td{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 td{background-color:#f3f3f3;padding-left:4em}
|
||||
1
public_html/assets/datatables/css/rowReorder.bootstrap.min.css
vendored
Normal file
1
public_html/assets/datatables/css/rowReorder.bootstrap.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
table.dt-rowReorder-float{position:absolute !important;opacity:.8;table-layout:fixed;outline:2px solid #337ab7;outline-offset:-2px;z-index:12001}tr.dt-rowReorder-moving{outline:2px solid #888;outline-offset:-2px}body.dt-rowReorder-noOverflow{overflow-x:hidden}table.dataTable td.reorder{text-align:center;cursor:move}
|
||||
1
public_html/assets/datatables/css/select.bootstrap.min.css
vendored
Normal file
1
public_html/assets/datatables/css/select.bootstrap.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
table.dataTable tbody>tr.selected,table.dataTable tbody>tr>.selected{background-color:#08c}table.dataTable.stripe tbody>tr.odd.selected,table.dataTable.stripe tbody>tr.odd>.selected,table.dataTable.display tbody>tr.odd.selected,table.dataTable.display tbody>tr.odd>.selected{background-color:#0085c7}table.dataTable.hover tbody>tr.selected:hover,table.dataTable.hover tbody>tr>.selected:hover,table.dataTable.display tbody>tr.selected:hover,table.dataTable.display tbody>tr>.selected:hover{background-color:#0083c5}table.dataTable.order-column tbody>tr.selected>.sorting_1,table.dataTable.order-column tbody>tr.selected>.sorting_2,table.dataTable.order-column tbody>tr.selected>.sorting_3,table.dataTable.order-column tbody>tr>.selected,table.dataTable.display tbody>tr.selected>.sorting_1,table.dataTable.display tbody>tr.selected>.sorting_2,table.dataTable.display tbody>tr.selected>.sorting_3,table.dataTable.display tbody>tr>.selected{background-color:#0085c8}table.dataTable.display tbody>tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_1{background-color:#0081c1}table.dataTable.display tbody>tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_2{background-color:#0082c2}table.dataTable.display tbody>tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_3{background-color:#0083c4}table.dataTable.display tbody>tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_1{background-color:#0085c8}table.dataTable.display tbody>tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_2{background-color:#0086ca}table.dataTable.display tbody>tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_3{background-color:#0087cb}table.dataTable.display tbody>tr.odd>.selected,table.dataTable.order-column.stripe tbody>tr.odd>.selected{background-color:#0081c1}table.dataTable.display tbody>tr.even>.selected,table.dataTable.order-column.stripe tbody>tr.even>.selected{background-color:#0085c8}table.dataTable.display tbody>tr.selected:hover>.sorting_1,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_1{background-color:#007dbb}table.dataTable.display tbody>tr.selected:hover>.sorting_2,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_2{background-color:#007ebd}table.dataTable.display tbody>tr.selected:hover>.sorting_3,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_3{background-color:#007fbf}table.dataTable.display tbody>tr:hover>.selected,table.dataTable.display tbody>tr>.selected:hover,table.dataTable.order-column.hover tbody>tr:hover>.selected,table.dataTable.order-column.hover tbody>tr>.selected:hover{background-color:#007dbb}table.dataTable tbody td.select-checkbox,table.dataTable tbody th.select-checkbox{position:relative}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody td.select-checkbox:after,table.dataTable tbody th.select-checkbox:before,table.dataTable tbody th.select-checkbox:after{display:block;position:absolute;top:1.2em;left:50%;width:12px;height:12px;box-sizing:border-box}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody th.select-checkbox:before{content:" ";margin-top:-6px;margin-left:-6px;border:1px solid black;border-radius:3px}table.dataTable tr.selected td.select-checkbox:after,table.dataTable tr.selected th.select-checkbox:after{content:"✓";font-size:20px;margin-top:-19px;margin-left:-6px;text-align:center;text-shadow:1px 1px #b0bed9,-1px -1px #b0bed9,1px -1px #b0bed9,-1px 1px #b0bed9}table.dataTable.compact tbody td.select-checkbox:before,table.dataTable.compact tbody th.select-checkbox:before{margin-top:-12px}table.dataTable.compact tr.selected td.select-checkbox:after,table.dataTable.compact tr.selected th.select-checkbox:after{margin-top:-16px}div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:.5em}@media screen and (max-width: 640px){div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0;display:block}}table.dataTable tbody tr.selected,table.dataTable tbody th.selected,table.dataTable tbody td.selected{color:white}table.dataTable tbody tr.selected a,table.dataTable tbody th.selected a,table.dataTable tbody td.selected a{color:#a2d4ed}
|
||||
1
public_html/assets/datatables/css/select.dataTables.min.css
vendored
Normal file
1
public_html/assets/datatables/css/select.dataTables.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
table.dataTable tbody>tr.selected,table.dataTable tbody>tr>.selected{background-color:#b0bed9}table.dataTable.stripe tbody>tr.odd.selected,table.dataTable.stripe tbody>tr.odd>.selected,table.dataTable.display tbody>tr.odd.selected,table.dataTable.display tbody>tr.odd>.selected{background-color:#acbad4}table.dataTable.hover tbody>tr.selected:hover,table.dataTable.hover tbody>tr>.selected:hover,table.dataTable.display tbody>tr.selected:hover,table.dataTable.display tbody>tr>.selected:hover{background-color:#aab7d1}table.dataTable.order-column tbody>tr.selected>.sorting_1,table.dataTable.order-column tbody>tr.selected>.sorting_2,table.dataTable.order-column tbody>tr.selected>.sorting_3,table.dataTable.order-column tbody>tr>.selected,table.dataTable.display tbody>tr.selected>.sorting_1,table.dataTable.display tbody>tr.selected>.sorting_2,table.dataTable.display tbody>tr.selected>.sorting_3,table.dataTable.display tbody>tr>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody>tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody>tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody>tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody>tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody>tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody>tr.odd>.selected,table.dataTable.order-column.stripe tbody>tr.odd>.selected{background-color:#a6b4cd}table.dataTable.display tbody>tr.even>.selected,table.dataTable.order-column.stripe tbody>tr.even>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.selected:hover>.sorting_1,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody>tr.selected:hover>.sorting_2,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody>tr.selected:hover>.sorting_3,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_3{background-color:#a5b2cb}table.dataTable.display tbody>tr:hover>.selected,table.dataTable.display tbody>tr>.selected:hover,table.dataTable.order-column.hover tbody>tr:hover>.selected,table.dataTable.order-column.hover tbody>tr>.selected:hover{background-color:#a2aec7}table.dataTable tbody td.select-checkbox,table.dataTable tbody th.select-checkbox{position:relative}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody td.select-checkbox:after,table.dataTable tbody th.select-checkbox:before,table.dataTable tbody th.select-checkbox:after{display:block;position:absolute;top:1.2em;left:50%;width:12px;height:12px;box-sizing:border-box}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody th.select-checkbox:before{content:" ";margin-top:-6px;margin-left:-6px;border:1px solid black;border-radius:3px}table.dataTable tr.selected td.select-checkbox:after,table.dataTable tr.selected th.select-checkbox:after{content:"✓";font-size:20px;margin-top:-19px;margin-left:-6px;text-align:center;text-shadow:1px 1px #b0bed9,-1px -1px #b0bed9,1px -1px #b0bed9,-1px 1px #b0bed9}table.dataTable.compact tbody td.select-checkbox:before,table.dataTable.compact tbody th.select-checkbox:before{margin-top:-12px}table.dataTable.compact tr.selected td.select-checkbox:after,table.dataTable.compact tr.selected th.select-checkbox:after{margin-top:-16px}div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:.5em}@media screen and (max-width: 640px){div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0;display:block}}
|
||||
7
public_html/assets/datatables/js/buttons.bootstrap.min.js
vendored
Normal file
7
public_html/assets/datatables/js/buttons.bootstrap.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
Bootstrap integration for DataTables' Buttons
|
||||
©2016 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-buttons"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs")(a,b).$);b.fn.dataTable.Buttons||require("datatables.net-buttons")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,e){a=c.fn.dataTable;c.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons btn-group"},
|
||||
button:{className:"btn btn-default"},collection:{tag:"ul",className:"dropdown-menu",button:{tag:"li",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"a",className:""}},splitWrapper:{tag:"div",className:"dt-btn-split-wrapper btn-group"},splitDropdown:{tag:"button",text:"▼",className:"btn btn-default dt-btn-split-drop dropdown-toggle",align:"split-left",splitAlignClass:"dt-button-split-left"},splitDropdownButton:{tag:"button",className:"dt-btn-split-drop-button btn btn-default"}}});
|
||||
a.ext.buttons.collection.text=function(d){return d.i18n("buttons.collection",'Collection <span class="caret"/>')};return a.Buttons});
|
||||
@@ -2,7 +2,13 @@
|
||||
DataTables Bootstrap 3 integration
|
||||
©2011-2015 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(f.ext.classes,
|
||||
{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new f.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")};
|
||||
l=0;for(h=f.length;l<h;l++)if(c=f[l],b.isArray(c))q(d,c);else{g=e="";switch(c){case "ellipsis":e="…";g="disabled";break;case "first":e=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":e=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":e=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":e=k.sLast;g=c+(j<n-1?"":" disabled");break;default:e=c+1,g=j===c?"active":""}e&&(i=b("<li>",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#",
|
||||
"aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),m);i&&b(h).find("[data-dt-idx="+i+"]").focus()};return f});
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var f=a[d];if(b.call(c,f,d,a))return{i:d,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};
|
||||
$jscomp.polyfill=function(a,b,c,e){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,e):$jscomp.polyfillUnisolated(a,b,c,e))};$jscomp.polyfillUnisolated=function(a,b,c,e){c=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];if(!(d in c))return;c=c[d]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
|
||||
$jscomp.polyfillIsolated=function(a,b,c,e){var d=a.split(".");a=1===d.length;e=d[0];e=!a&&e in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<d.length-1;f++){var l=d[f];if(!(l in e))return;e=e[l]}d=d[d.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?e[d]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,d,{configurable:!0,writable:!0,value:b}):b!==c&&($jscomp.propertyToPolyfillSymbol[d]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(d):$jscomp.POLYFILL_PREFIX+d,d=
|
||||
$jscomp.propertyToPolyfillSymbol[d],$jscomp.defineProperty(e,d,{configurable:!0,writable:!0,value:b})))};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(b,c){return $jscomp.findInternal(this,b,c).v}},"es6","es3");
|
||||
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);c&&c.fn.dataTable||(c=require("datatables.net")(b,c).$);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a,b,c,e){var d=a.fn.dataTable;a.extend(!0,d.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});a.extend(d.ext.classes,
|
||||
{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});d.ext.renderer.pageButton.bootstrap=function(f,l,A,B,m,t){var u=new d.Api(f),C=f.oClasses,n=f.oLanguage.oPaginate,D=f.oLanguage.oAria.paginate||{},h,k,v=0,y=function(q,w){var x,E=function(p){p.preventDefault();a(p.currentTarget).hasClass("disabled")||u.page()==p.data.action||u.page(p.data.action).draw("page")};
|
||||
var r=0;for(x=w.length;r<x;r++){var g=w[r];if(Array.isArray(g))y(q,g);else{k=h="";switch(g){case "ellipsis":h="…";k="disabled";break;case "first":h=n.sFirst;k=g+(0<m?"":" disabled");break;case "previous":h=n.sPrevious;k=g+(0<m?"":" disabled");break;case "next":h=n.sNext;k=g+(m<t-1?"":" disabled");break;case "last":h=n.sLast;k=g+(m<t-1?"":" disabled");break;default:h=g+1,k=m===g?"active":""}if(h){var F=a("<li>",{"class":C.sPageButton+" "+k,id:0===A&&"string"===typeof g?f.sTableId+"_"+g:null}).append(a("<a>",
|
||||
{href:"#","aria-controls":f.sTableId,"aria-label":D[g],"data-dt-idx":v,tabindex:f.iTabIndex}).html(h)).appendTo(q);f.oApi._fnBindAction(F,{action:g},E);v++}}}};try{var z=a(l).find(c.activeElement).data("dt-idx")}catch(q){}y(a(l).empty().html('<ul class="pagination"/>').children("ul"),B);z!==e&&a(l).find("[data-dt-idx="+z+"]").trigger("focus")};return d});
|
||||
|
||||
51
public_html/assets/datatables/js/dataTables.buttons.min.js
vendored
Normal file
51
public_html/assets/datatables/js/dataTables.buttons.min.js
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
/*!
|
||||
Buttons for DataTables 2.0.1
|
||||
©2016-2021 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(C){return e(C,window,document)}):"object"===typeof exports?module.exports=function(C,y){C||(C=window);y&&y.fn.dataTable||(y=require("datatables.net")(C,y).$);return e(y,C,C.document)}:e(jQuery,window,document)})(function(e,C,y,p){function I(a,b,c){e.fn.animate?a.stop().fadeIn(b,c):(a.css("display","block"),c&&c.call(a))}function J(a,b,c){e.fn.animate?a.stop().fadeOut(b,c):(a.css("display","none"),c&&c.call(a))}
|
||||
function L(a,b){a=new u.Api(a);b=b?b:a.init().buttons||u.defaults.buttons;return(new v(a,b)).container()}var u=e.fn.dataTable,O=0,P=0,z=u.ext.buttons,v=function(a,b){if(!(this instanceof v))return function(c){return(new v(c,a)).container()};"undefined"===typeof b&&(b={});!0===b&&(b={});Array.isArray(b)&&(b={buttons:b});this.c=e.extend(!0,{},v.defaults,b);b.buttons&&(this.c.buttons=b.buttons);this.s={dt:new u.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+O++};this.dom={container:e("<"+this.c.dom.container.tag+
|
||||
"/>").addClass(this.c.dom.container.className)};this._constructor()};e.extend(v.prototype,{action:function(a,b){a=this._nodeToButton(a);if(b===p)return a.conf.action;a.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.button.active;c=e(c.node);if(b===p)return c.hasClass(a);c.toggleClass(a,b===p?!0:b);return this},add:function(a,b){var c=this.s.buttons;if("string"===typeof b){b=b.split("-");var d=this.s;c=0;for(var l=b.length-1;c<l;c++)d=d.buttons[1*b[c]];c=d.buttons;
|
||||
b=1*b[b.length-1]}this._expandButton(c,a,a!==p?a.split:p,(a===p||a.split===p||0===a.split.length)&&d!==p,!1,b);this._draw();return this},collectionRebuild:function(a,b){a=this._nodeToButton(a);if(b!==p){var c;for(c=a.buttons.length-1;0<=c;c--)this.remove(a.buttons[c].node);for(c=0;c<b.length;c++)this._expandButton(a.buttons,b[c],b[c]!==p&&b[c].config!==p&&b[c].config.split!==p,!0,b[c].parentConf!==p&&b[c].parentConf.split!==p,c,b[c].parentConf)}this._draw(a.collection,a.buttons)},container:function(){return this.dom.container},
|
||||
disable:function(a){a=this._nodeToButton(a);e(a.node).addClass(this.c.dom.button.disabled).attr("disabled",!0);return this},destroy:function(){e("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b;var c=0;for(b=a.length;c<b;c++)this.remove(a[c].node);this.dom.container.remove();a=this.s.dt.settings()[0];c=0;for(b=a.length;c<b;c++)if(a.inst===this){a.splice(c,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);a=this._nodeToButton(a);e(a.node).removeClass(this.c.dom.button.disabled).removeAttr("disabled");
|
||||
return this},name:function(){return this.c.name},node:function(a){if(!a)return this.dom.container;a=this._nodeToButton(a);return e(a.node)},processing:function(a,b){var c=this.s.dt,d=this._nodeToButton(a);if(b===p)return e(d.node).hasClass("processing");e(d.node).toggleClass("processing",b);e(c.table().node()).triggerHandler("buttons-processing.dt",[b,c.button(a),c,e(a),d.conf]);return this},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),d=this.s.dt;if(b.buttons.length)for(var l=
|
||||
b.buttons.length-1;0<=l;l--)this.remove(b.buttons[l].node);b.conf.destroying=!0;b.conf.destroy&&b.conf.destroy.call(d.button(a),d,e(a),b.conf);this._removeKey(b.conf);e(b.node).remove();a=e.inArray(b,c);c.splice(a,1);return this},text:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.collection.buttonLiner;a=c.inCollection&&a&&a.tag?a.tag:this.c.dom.buttonLiner.tag;var d=this.s.dt,l=e(c.node),f=function(k){return"function"===typeof k?k(d,l,c.conf):k};if(b===p)return f(c.conf.text);c.conf.text=
|
||||
b;a?l.children(a).filter(":not(.dt-down-arrow)").html(f(b)):l.html(f(b));return this},_constructor:function(){var a=this,b=this.s.dt,c=b.settings()[0],d=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var l=0,f=d.length;l<f;l++)this.add(d[l]);b.on("destroy",function(k,h){h===c&&a.destroy()});e("body").on("keyup."+this.s.namespace,function(k){if(!y.activeElement||y.activeElement===y.body){var h=String.fromCharCode(k.keyCode).toLowerCase();-1!==a.s.listenKeys.toLowerCase().indexOf(h)&&
|
||||
a._keypress(h,k)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=e.isPlainObject(a.key)?a.key.key:a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,d=b.length;c<d;c++)a.append(b[c].inserter),a.append(" "),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,d,l,f,k){var h=this.s.dt,n=0,q=Array.isArray(b)?b:[b];b===p&&(q=Array.isArray(c)?c:[c]);c=0;for(var r=q.length;c<r;c++){var m=this._resolveExtends(q[c]);
|
||||
if(m)if(b=m.config!==p&&m.config.split?!0:!1,Array.isArray(m))this._expandButton(a,m,g!==p&&g.conf!==p?g.conf.split:p,d,k!==p&&k.split!==p,f,k);else{var g=this._buildButton(m,d,m.split!==p||m.config!==p&&m.config.split!==p,l);if(g){f!==p&&null!==f?(a.splice(f,0,g),f++):a.push(g);if(g.conf.buttons||g.conf.split){g.collection=e("<"+(b?this.c.dom.splitCollection.tag:this.c.dom.collection.tag)+"/>");g.conf._collection=g.collection;if(g.conf.split)for(var t=0;t<g.conf.split.length;t++)"object"===typeof g.conf.split[t]&&
|
||||
(g.conf.split[c].parent=k,g.conf.split[t].collectionLayout===p&&(g.conf.split[t].collectionLayout=g.conf.collectionLayout),g.conf.split[t].dropup===p&&(g.conf.split[t].dropup=g.conf.dropup),g.conf.split[t].fade===p&&(g.conf.split[t].fade=g.conf.fade));else e(g.node).append(e('<span class="dt-down-arrow">'+this.c.dom.splitDropdown.text+"</span>"));this._expandButton(g.buttons,g.conf.buttons,g.conf.split,!b,b,f,g.conf)}g.conf.parent=k;m.init&&m.init.call(h.button(g.node),h,e(g.node),m);n++}}}},_buildButton:function(a,
|
||||
b,c,d){var l=this.c.dom.button,f=this.c.dom.buttonLiner,k=this.c.dom.collection,h=this.c.dom.splitCollection,n=this.c.dom.splitDropdownButton,q=this.s.dt,r=function(w){return"function"===typeof w?w(q,m,a):w};!c&&d&&h?l=n:!c&&b&&k.button&&(l=k.button);!c&&d&&h.buttonLiner?f=h.buttonLiner:!c&&b&&k.buttonLiner&&(f=k.buttonLiner);if(a.available&&!a.available(q,a)&&!a.hasOwnProperty("html"))return!1;if(a.hasOwnProperty("html"))var m=e(a.html);else{var g=function(w,B,E,F){F.action.call(B.button(E),w,B,
|
||||
E,F);e(B.table().node()).triggerHandler("buttons-action.dt",[B.button(E),B,E,F])};k=a.tag||l.tag;var t=a.clickBlurs===p?!1:a.clickBlurs;m=e("<"+k+"/>").addClass(l.className).addClass(d?this.c.dom.splitDropdownButton.className:"").attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(w){w.preventDefault();!m.hasClass(l.disabled)&&a.action&&g(w,q,m,a);t&&m.trigger("blur")}).on("keyup.dtb",function(w){13===w.keyCode&&!m.hasClass(l.disabled)&&
|
||||
a.action&&g(w,q,m,a)});"a"===k.toLowerCase()&&m.attr("href","#");"button"===k.toLowerCase()&&m.attr("type","button");f.tag?(k=e("<"+f.tag+"/>").html(r(a.text)).addClass(f.className),"a"===f.tag.toLowerCase()&&k.attr("href","#"),m.append(k)):m.html(r(a.text));!1===a.enabled&&m.addClass(l.disabled);a.className&&m.addClass(a.className);a.titleAttr&&m.attr("title",r(a.titleAttr));a.attr&&m.attr(a.attr);a.namespace||(a.namespace=".dt-button-"+P++);a.config!==p&&a.config.split&&(a.split=a.config.split)}f=
|
||||
(f=this.c.dom.buttonContainer)&&f.tag?e("<"+f.tag+"/>").addClass(f.className).append(m):m;this._addKey(a);this.c.buttonCreated&&(f=this.c.buttonCreated(a,f));if(c){var x=e("<div/>").addClass(this.c.dom.splitWrapper.className);x.append(m);var A=e.extend(a,{text:this.c.dom.splitDropdown.text,className:this.c.dom.splitDropdown.className,attr:{"aria-haspopup":!0,"aria-expanded":!1},align:this.c.dom.splitDropdown.align,splitAlignClass:this.c.dom.splitDropdown.splitAlignClass});this._addKey(A);var G=function(w,
|
||||
B,E,F){z.split.action.call(B.button(e("div.dt-btn-split-wrapper")[0]),w,B,E,F);e(B.table().node()).triggerHandler("buttons-action.dt",[B.button(E),B,E,F]);E.attr("aria-expanded",!0)},D=e('<button class="'+this.c.dom.splitDropdown.className+' dt-button"><span class="dt-btn-split-drop-arrow">'+this.c.dom.splitDropdown.text+"</span></button>").on("click.dtb",function(w){w.preventDefault();w.stopPropagation();!D.hasClass(l.disabled)&&A.action&&G(w,q,D,A);t&&D.trigger("blur")}).on("keyup.dtb",function(w){13===
|
||||
w.keyCode&&!D.hasClass(l.disabled)&&A.action&&G(w,q,D,A)});0===a.split.length&&D.addClass("dtb-hide-drop");x.append(D).attr(A.attr)}return{conf:a,node:c?x.get(0):m.get(0),inserter:c?x:f,buttons:[],inCollection:b,isSplit:c,inSplit:d,collection:null}},_nodeToButton:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var l=this._nodeToButton(a,b[c].buttons);if(l)return l}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=
|
||||
0,d=b.length;c<d;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var l=this._nodeToHost(a,b[c].buttons);if(l)return l}}},_keypress:function(a,b){if(!b._buttonsHandled){var c=function(d){for(var l=0,f=d.length;l<f;l++){var k=d[l].conf,h=d[l].node;k.key&&(k.key===a?(b._buttonsHandled=!0,e(h).click()):!e.isPlainObject(k.key)||k.key.key!==a||k.key.shiftKey&&!b.shiftKey||k.key.altKey&&!b.altKey||k.key.ctrlKey&&!b.ctrlKey||k.key.metaKey&&!b.metaKey||(b._buttonsHandled=!0,e(h).click()));d[l].buttons.length&&
|
||||
c(d[l].buttons)}};c(this.s.buttons)}},_removeKey:function(a){if(a.key){var b=e.isPlainObject(a.key)?a.key.key:a.key;a=this.s.listenKeys.split("");b=e.inArray(b,a);a.splice(b,1);this.s.listenKeys=a.join("")}},_resolveExtends:function(a){var b=this.s.dt,c,d=function(h){for(var n=0;!e.isPlainObject(h)&&!Array.isArray(h);){if(h===p)return;if("function"===typeof h){if(h=h(b,a),!h)return!1}else if("string"===typeof h){if(!z[h])return{html:h};h=z[h]}n++;if(30<n)throw"Buttons: Too many iterations";}return Array.isArray(h)?
|
||||
h:e.extend({},h)};for(a=d(a);a&&a.extend;){if(!z[a.extend])throw"Cannot extend unknown button type: "+a.extend;var l=d(z[a.extend]);if(Array.isArray(l))return l;if(!l)return!1;var f=l.className;a.config!==p&&l.config!==p&&(a.config=e.extend({},l.config,a.config));a=e.extend({},l,a);f&&a.className!==f&&(a.className=f+" "+a.className);var k=a.postfixButtons;if(k){a.buttons||(a.buttons=[]);f=0;for(c=k.length;f<c;f++)a.buttons.push(k[f]);a.postfixButtons=null}if(k=a.prefixButtons){a.buttons||(a.buttons=
|
||||
[]);f=0;for(c=k.length;f<c;f++)a.buttons.splice(f,0,k[f]);a.prefixButtons=null}a.extend=l.extend}return a},_popover:function(a,b,c,d){d=this.c;var l=!1,f=e.extend({align:"button-left",autoClose:!1,background:!0,backgroundClassName:"dt-button-background",contentClassName:d.dom.collection.className,collectionLayout:"",collectionTitle:"",dropup:!1,fade:400,popoverTitle:"",rightAlignClassName:"dt-button-right",splitRightAlignClassName:"dt-button-split-right",splitLeftAlignClassName:"dt-button-split-left",
|
||||
tag:d.dom.collection.tag},c),k=b.node(),h=function(){l=!0;J(e(".dt-button-collection"),f.fade,function(){e(this).detach()});e(b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes()).attr("aria-expanded","false");e("div.dt-button-background").off("click.dtb-collection");v.background(!1,f.backgroundClassName,f.fade,k);e("body").off(".dtb-collection");b.off("buttons-action.b-internal");b.off("destroy")};!1===a&&h();c=e(b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes());c.length&&
|
||||
(k=c.eq(0),h());c=e("<div/>").addClass("dt-button-collection").addClass(f.collectionLayout).addClass(f.splitAlignClass).css("display","none");a=e(a).addClass(f.contentClassName).attr("role","menu").appendTo(c);k.attr("aria-expanded","true");k.parents("body")[0]!==y.body&&(k=y.body.lastChild);f.popoverTitle?c.prepend('<div class="dt-button-collection-title">'+f.popoverTitle+"</div>"):f.collectionTitle&&c.prepend('<div class="dt-button-collection-title">'+f.collectionTitle+"</div>");I(c.insertAfter(k),
|
||||
f.fade);var n=e(b.table().container());d=c.css("position");"dt-container"===f.align&&(k=k.parent(),c.css("width",n.width()));if("absolute"===d){var q=k.position();d=e(b.node()).position();c.css({top:e(e(b[0].node).parent()[0]).hasClass("dt-buttons")?d.top+k.outerHeight():q.top+k.outerHeight(),left:q.left});q=c.outerHeight();var r=n.offset().top+n.height();r=d.top+k.outerHeight()+q-r;var m=d.top-q,g=n.offset().top;d=d.top-q-5;(r>g-m||f.dropup)&&-d<g&&c.css("top",d);d=n.offset().left;n=n.width();n=
|
||||
d+n;q=c.offset().left;r=c.outerWidth();0===r&&0<c.children().length&&(r=e(c.children()[0]).outerWidth());r=q+r;var t=k.offset().left;g=k.outerWidth();m=t+g;if(c.hasClass(f.rightAlignClassName)||c.hasClass(f.leftAlignClassName)||c.hasClass(f.splitAlignClass)||"dt-container"===f.align){var x=m;k.hasClass("dt-btn-split-wrapper")&&0<k.children("button.dt-btn-split-drop").length&&(t=k.children("button.dt-btn-split-drop").offset().left,g=k.children("button.dt-btn-split-drop").outerWidth(),x=t+g);g=0;if(c.hasClass(f.rightAlignClassName))g=
|
||||
m-r,d>q+g&&(d-=q+g,n-=r+g,g=d>n?g+n:g+d);else if(c.hasClass(f.splitRightAlignClassName))g=x-r,d>q+g&&(d-=q+g,n-=r+g,g=d>n?g+n:g+d);else if(c.hasClass(f.splitLeftAlignClassName)){if(g=t-q,n<r+g||d>q+g)d-=q+g,n-=r+g,g=d>n?g+n:g+d}else g=d-q,n<r+g&&(d-=q+g,n-=r+g,g=d>n?g+n:g+d)}else d=k.offset().top,g=0,g="button-right"===f.align?m-r:t-q;c.css("left",c.position().left+g)}else d=c.height()/2,d>e(C).height()/2&&(d=e(C).height()/2),c.css("marginTop",-1*d);f.background&&v.background(!0,f.backgroundClassName,
|
||||
f.fade,k);e("div.dt-button-background").on("click.dtb-collection",function(){});f.autoClose&&setTimeout(function(){b.on("buttons-action.b-internal",function(A,G,D,w){w[0]!==k[0]&&h()})},0);e(c).trigger("buttons-popover.dt");b.on("destroy",h);setTimeout(function(){l=!1;e("body").on("click.dtb-collection",function(A){if(!l){var G=e.fn.addBack?"addBack":"andSelf",D=e(A.target).parent()[0];(!e(A.target).parents()[G]().filter(a).length&&!e(D).hasClass("dt-buttons")||e(A.target).hasClass("dt-button-background"))&&
|
||||
h()}}).on("keyup.dtb-collection",function(A){27===A.keyCode&&h()})},0)}});v.background=function(a,b,c,d){c===p&&(c=400);d||(d=y.body);a?I(e("<div/>").addClass(b).css("display","none").insertAfter(d),c):J(e("div."+b),c,function(){e(this).removeClass(b).remove()})};v.instanceSelector=function(a,b){if(a===p||null===a)return e.map(b,function(f){return f.inst});var c=[],d=e.map(b,function(f){return f.name}),l=function(f){if(Array.isArray(f))for(var k=0,h=f.length;k<h;k++)l(f[k]);else"string"===typeof f?
|
||||
-1!==f.indexOf(",")?l(f.split(",")):(f=e.inArray(f.trim(),d),-1!==f&&c.push(b[f].inst)):"number"===typeof f&&c.push(b[f].inst)};l(a);return c};v.buttonSelector=function(a,b){for(var c=[],d=function(h,n,q){for(var r,m,g=0,t=n.length;g<t;g++)if(r=n[g])m=q!==p?q+g:g+"",h.push({node:r.node,name:r.conf.name,idx:m}),r.buttons&&d(h,r.buttons,m+"-")},l=function(h,n){var q,r=[];d(r,n.s.buttons);var m=e.map(r,function(g){return g.node});if(Array.isArray(h)||h instanceof e)for(m=0,q=h.length;m<q;m++)l(h[m],
|
||||
n);else if(null===h||h===p||"*"===h)for(m=0,q=r.length;m<q;m++)c.push({inst:n,node:r[m].node});else if("number"===typeof h)c.push({inst:n,node:n.s.buttons[h].node});else if("string"===typeof h)if(-1!==h.indexOf(","))for(r=h.split(","),m=0,q=r.length;m<q;m++)l(r[m].trim(),n);else if(h.match(/^\d+(\-\d+)*$/))m=e.map(r,function(g){return g.idx}),c.push({inst:n,node:r[e.inArray(h,m)].node});else if(-1!==h.indexOf(":name"))for(h=h.replace(":name",""),m=0,q=r.length;m<q;m++)r[m].name===h&&c.push({inst:n,
|
||||
node:r[m].node});else e(m).filter(h).each(function(){c.push({inst:n,node:this})});else"object"===typeof h&&h.nodeName&&(r=e.inArray(h,m),-1!==r&&c.push({inst:n,node:m[r]}))},f=0,k=a.length;f<k;f++)l(b,a[f]);return c};v.stripData=function(a,b){if("string"!==typeof a)return a;a=a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");a=a.replace(/<!\-\-.*?\-\->/g,"");if(!b||b.stripHtml)a=a.replace(/<[^>]*>/g,"");if(!b||b.trim)a=a.replace(/^\s+|\s+$/g,"");if(!b||b.stripNewlines)a=a.replace(/\n/g,
|
||||
" ");if(!b||b.decodeEntities)M.innerHTML=a,a=M.value;return a};v.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:""},button:{tag:"button",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""},split:{tag:"div",className:"dt-button-split"},splitWrapper:{tag:"div",className:"dt-btn-split-wrapper"},splitDropdown:{tag:"button",text:"▼",className:"dt-btn-split-drop",
|
||||
align:"split-right",splitAlignClass:"dt-button-split-left"},splitDropdownButton:{tag:"button",className:"dt-btn-split-drop-button dt-button"},splitCollection:{tag:"div",className:"dt-button-split-collection"}}};v.version="2.0.1";e.extend(z,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection",init:function(a,b,c){b.attr("aria-expanded",!1)},action:function(a,b,c,d){d._collection.parents("body").length?this.popover(!1,d):this.popover(d._collection,
|
||||
d)},attr:{"aria-haspopup":!0}},split:{text:function(a){return a.i18n("buttons.split","Split")},className:"buttons-split",init:function(a,b,c){return b.attr("aria-expanded",!1)},action:function(a,b,c,d){this.popover(d._collection,d)},attr:{"aria-haspopup":!0}},copy:function(a,b){if(z.copyHtml5)return"copyHtml5"},csv:function(a,b){if(z.csvHtml5&&z.csvHtml5.available(a,b))return"csvHtml5"},excel:function(a,b){if(z.excelHtml5&&z.excelHtml5.available(a,b))return"excelHtml5"},pdf:function(a,b){if(z.pdfHtml5&&
|
||||
z.pdfHtml5.available(a,b))return"pdfHtml5"},pageLength:function(a){a=a.settings()[0].aLengthMenu;var b=[],c=[];if(Array.isArray(a[0]))b=a[0],c=a[1];else for(var d=0;d<a.length;d++){var l=a[d];e.isPlainObject(l)?(b.push(l.value),c.push(l.label)):(b.push(l),c.push(l))}return{extend:"collection",text:function(f){return f.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},f.page.len())},className:"buttons-page-length",autoClose:!0,buttons:e.map(b,function(f,k){return{text:c[k],className:"button-page-length",
|
||||
action:function(h,n){n.page.len(f).draw()},init:function(h,n,q){var r=this;n=function(){r.active(h.page.len()===f)};h.on("length.dt"+q.namespace,n);n()},destroy:function(h,n,q){h.off("length.dt"+q.namespace)}}}),init:function(f,k,h){var n=this;f.on("length.dt"+h.namespace,function(){n.text(h.text)})},destroy:function(f,k,h){f.off("length.dt"+h.namespace)}}}});u.Api.register("buttons()",function(a,b){b===p&&(b=a,a=p);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(d){if(d._buttons)return v.buttonSelector(v.instanceSelector(a,
|
||||
d._buttons),b)},!0);c._groupSelector=a;return c});u.Api.register("button()",function(a,b){a=this.buttons(a,b);1<a.length&&a.splice(1,a.length);return a});u.Api.registerPlural("buttons().active()","button().active()",function(a){return a===p?this.map(function(b){return b.inst.active(b.node)}):this.each(function(b){b.inst.active(b.node,a)})});u.Api.registerPlural("buttons().action()","button().action()",function(a){return a===p?this.map(function(b){return b.inst.action(b.node)}):this.each(function(b){b.inst.action(b.node,
|
||||
a)})});u.Api.registerPlural("buttons().collectionRebuild()","button().collectionRebuild()",function(a){return this.each(function(b){for(var c=0;c<a.length;c++)"object"===typeof a[c]&&(a[c].parentConf=b);b.inst.collectionRebuild(b.node,a)})});u.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});u.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});u.Api.registerPlural("buttons().nodes()",
|
||||
"button().node()",function(){var a=e();e(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});u.Api.registerPlural("buttons().processing()","button().processing()",function(a){return a===p?this.map(function(b){return b.inst.processing(b.node)}):this.each(function(b){b.inst.processing(b.node,a)})});u.Api.registerPlural("buttons().text()","button().text()",function(a){return a===p?this.map(function(b){return b.inst.text(b.node)}):this.each(function(b){b.inst.text(b.node,a)})});u.Api.registerPlural("buttons().trigger()",
|
||||
"button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});u.Api.register("button().popover()",function(a,b){return this.map(function(c){return c.inst._popover(a,this.button(this[0].node),b)})});u.Api.register("buttons().containers()",function(){var a=e(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons){c=v.instanceSelector(b,c._buttons);for(var d=0,l=c.length;d<l;d++)a=a.add(c[d].container())}});return a});u.Api.register("buttons().container()",
|
||||
function(){return this.containers().eq(0)});u.Api.register("button().add()",function(a,b){var c=this.context;c.length&&(c=v.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b,a));return this.button(this._groupSelector,a)});u.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});u.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var H;
|
||||
u.Api.register("buttons.info()",function(a,b,c){var d=this;if(!1===a)return this.off("destroy.btn-info"),J(e("#datatables_buttons_info"),400,function(){e(this).remove()}),clearTimeout(H),H=null,this;H&&clearTimeout(H);e("#datatables_buttons_info").length&&e("#datatables_buttons_info").remove();a=a?"<h2>"+a+"</h2>":"";I(e('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a).append(e("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body"));c!==p&&0!==
|
||||
c&&(H=setTimeout(function(){d.buttons.info(!1)},c));this.on("destroy.btn-info",function(){d.buttons.info(!1)});return this});u.Api.register("buttons.exportData()",function(a){if(this.context.length)return Q(new u.Api(this.context[0]),a)});u.Api.register("buttons.exportInfo()",function(a){a||(a={});var b=a;var c="*"===b.filename&&"*"!==b.title&&b.title!==p&&null!==b.title&&""!==b.title?b.title:b.filename;"function"===typeof c&&(c=c());c===p||null===c?c=null:(-1!==c.indexOf("*")&&(c=c.replace("*",e("head > title").text()).trim()),
|
||||
c=c.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(b=K(b.extension))||(b=""),c+=b);b=K(a.title);b=null===b?null:-1!==b.indexOf("*")?b.replace("*",e("head > title").text()||"Exported data"):b;return{filename:c,title:b,messageTop:N(this,a.message||a.messageTop,"top"),messageBottom:N(this,a.messageBottom,"bottom")}});var K=function(a){return null===a||a===p?null:"function"===typeof a?a():a},N=function(a,b,c){b=K(b);if(null===b)return null;a=e("caption",a.table().container()).eq(0);return"*"===
|
||||
b?a.css("caption-side")!==c?null:a.length?a.text():"":b},M=e("<textarea/>")[0],Q=function(a,b){var c=e.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(t){return v.stripData(t,c)},footer:function(t){return v.stripData(t,c)},body:function(t){return v.stripData(t,c)}},customizeData:null},b);b=a.columns(c.columns).indexes().map(function(t){var x=a.column(t).header();return c.format.header(x.innerHTML,
|
||||
t,x)}).toArray();var d=a.table().footer()?a.columns(c.columns).indexes().map(function(t){var x=a.column(t).footer();return c.format.footer(x?x.innerHTML:"",t,x)}).toArray():null,l=e.extend({},c.modifier);a.select&&"function"===typeof a.select.info&&l.selected===p&&a.rows(c.rows,e.extend({selected:!0},l)).any()&&e.extend(l,{selected:!0});l=a.rows(c.rows,l).indexes().toArray();var f=a.cells(l,c.columns);l=f.render(c.orthogonal).toArray();f=f.nodes().toArray();for(var k=b.length,h=[],n=0,q=0,r=0<k?l.length/
|
||||
k:0;q<r;q++){for(var m=[k],g=0;g<k;g++)m[g]=c.format.body(l[n],q,g,f[n]),n++;h[q]=m}b={header:b,footer:d,body:h};c.customizeData&&c.customizeData(b);return b};e.fn.dataTable.Buttons=v;e.fn.DataTable.Buttons=v;e(y).on("init.dt plugin-init.dt",function(a,b){"dt"===a.namespace&&(a=b.oInit.buttons||u.defaults.buttons)&&!b._buttons&&(new v(b,a)).container()});u.ext.feature.push({fnInit:L,cFeature:"B"});u.ext.features&&u.ext.features.register("buttons",L);return v});
|
||||
@@ -1,30 +1,40 @@
|
||||
/*!
|
||||
FixedColumns 3.0.4
|
||||
©2010-2014 SpryMedia Ltd - datatables.net/license
|
||||
FixedColumns 4.0.1
|
||||
2019-2021 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(r,s,t){var p=function(d){var j=function(a,b){var c=this;if(this instanceof j){"undefined"==typeof b&&(b={});var g=d.fn.dataTable.camelToHungarian;g&&(g(j.defaults,j.defaults,!0),g(j.defaults,b));g=d.fn.dataTable.Api?(new d.fn.dataTable.Api(a)).settings()[0]:a.fnSettings();this.s={dt:g,iTableColumns:g.aoColumns.length,aiOuterWidths:[],aiInnerWidths:[]};this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null,
|
||||
head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}};g._oFixedColumns=this;g._bInitComplete?this._fnConstruct(b):g.oApi._fnCallbackReg(g,"aoInitComplete",function(){c._fnConstruct(b)},"FixedColumns")}else alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword.")};j.prototype={fnUpdate:function(){this._fnDraw(!0)},fnRedrawLayout:function(){this._fnColCalc();this._fnGridLayout();this.fnUpdate()},fnRecalculateHeight:function(a){delete a._DTTC_iHeight;
|
||||
a.style.height="auto"},fnSetRowHeight:function(a,b){a.style.height=b+"px"},fnGetPosition:function(a){var b=this.s.dt.oInstance;if(d(a).parents(".DTFC_Cloned").length){if("tr"===a.nodeName.toLowerCase())return a=d(a).index(),b.fnGetPosition(d("tr",this.s.dt.nTBody)[a]);var c=d(a).index(),a=d(a.parentNode).index();return[b.fnGetPosition(d("tr",this.s.dt.nTBody)[a]),c,b.oApi._fnVisibleToColumnIndex(this.s.dt,c)]}return b.fnGetPosition(a)},_fnConstruct:function(a){var b=this;if("function"!=typeof this.s.dt.oInstance.fnVersionCheck||
|
||||
!0!==this.s.dt.oInstance.fnVersionCheck("1.8.0"))alert("FixedColumns "+j.VERSION+" required DataTables 1.8.0 or later. Please upgrade your DataTables installation");else if(""===this.s.dt.oScroll.sX)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"FixedColumns is not needed (no x-scrolling in DataTables enabled), so no action will be taken. Use 'FixedHeader' for column fixing when scrolling is not enabled");else{this.s=d.extend(!0,this.s,j.defaults,a);a=this.s.dt.oClasses;this.dom.grid.dt=d(this.s.dt.nTable).parents("div."+
|
||||
a.sScrollWrapper)[0];this.dom.scroller=d("div."+a.sScrollBody,this.dom.grid.dt)[0];this._fnColCalc();this._fnGridSetup();var c;d(this.dom.scroller).on("mouseover.DTFC touchstart.DTFC",function(){c="main"}).on("scroll.DTFC",function(){if("main"===c&&(0<b.s.iLeftColumns&&(b.dom.grid.left.liner.scrollTop=b.dom.scroller.scrollTop),0<b.s.iRightColumns))b.dom.grid.right.liner.scrollTop=b.dom.scroller.scrollTop});var g="onwheel"in s.createElement("div")?"wheel.DTFC":"mousewheel.DTFC";if(0<b.s.iLeftColumns)d(b.dom.grid.left.liner).on("mouseover.DTFC touchstart.DTFC",
|
||||
function(){c="left"}).on("scroll.DTFC",function(){"left"===c&&(b.dom.scroller.scrollTop=b.dom.grid.left.liner.scrollTop,0<b.s.iRightColumns&&(b.dom.grid.right.liner.scrollTop=b.dom.grid.left.liner.scrollTop))}).on(g,function(a){b.dom.scroller.scrollLeft-="wheel"===a.type?-a.originalEvent.deltaX:a.originalEvent.wheelDeltaX});if(0<b.s.iRightColumns)d(b.dom.grid.right.liner).on("mouseover.DTFC touchstart.DTFC",function(){c="right"}).on("scroll.DTFC",function(){"right"===c&&(b.dom.scroller.scrollTop=
|
||||
b.dom.grid.right.liner.scrollTop,0<b.s.iLeftColumns&&(b.dom.grid.left.liner.scrollTop=b.dom.grid.right.liner.scrollTop))}).on(g,function(a){b.dom.scroller.scrollLeft-="wheel"===a.type?-a.originalEvent.deltaX:a.originalEvent.wheelDeltaX});d(r).on("resize.DTFC",function(){b._fnGridLayout.call(b)});var f=!0,e=d(this.s.dt.nTable);e.on("draw.dt.DTFC",function(){b._fnDraw.call(b,f);f=!1}).on("column-sizing.dt.DTFC",function(){b._fnColCalc();b._fnGridLayout(b)}).on("column-visibility.dt.DTFC",function(){b._fnColCalc();
|
||||
b._fnGridLayout(b);b._fnDraw(!0)}).on("destroy.dt.DTFC",function(){e.off("column-sizing.dt.DTFC destroy.dt.DTFC draw.dt.DTFC");d(b.dom.scroller).off("scroll.DTFC mouseover.DTFC");d(r).off("resize.DTFC");d(b.dom.grid.left.liner).off("scroll.DTFC mouseover.DTFC "+g);d(b.dom.grid.left.wrapper).remove();d(b.dom.grid.right.liner).off("scroll.DTFC mouseover.DTFC "+g);d(b.dom.grid.right.wrapper).remove()});this._fnGridLayout();this.s.dt.oInstance.fnDraw(!1)}},_fnColCalc:function(){var a=this,b=0,c=0;this.s.aiInnerWidths=
|
||||
[];this.s.aiOuterWidths=[];d.each(this.s.dt.aoColumns,function(g,f){var e=d(f.nTh),h;if(e.filter(":visible").length){var i=e.outerWidth();0===a.s.aiOuterWidths.length&&(h=d(a.s.dt.nTable).css("border-left-width"),i+="string"===typeof h?1:parseInt(h,10));a.s.aiOuterWidths.length===a.s.dt.aoColumns.length-1&&(h=d(a.s.dt.nTable).css("border-right-width"),i+="string"===typeof h?1:parseInt(h,10));a.s.aiOuterWidths.push(i);a.s.aiInnerWidths.push(e.width());g<a.s.iLeftColumns&&(b+=i);a.s.iTableColumns-a.s.iRightColumns<=
|
||||
g&&(c+=i)}else a.s.aiInnerWidths.push(0),a.s.aiOuterWidths.push(0)});this.s.iLeftWidth=b;this.s.iRightWidth=c},_fnGridSetup:function(){var a=this._fnDTOverflow(),b;this.dom.body=this.s.dt.nTable;this.dom.header=this.s.dt.nTHead.parentNode;this.dom.header.parentNode.parentNode.style.position="relative";var c=d('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;"><div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_LeftBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_LeftBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_LeftFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div></div><div class="DTFC_RightWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_RightHeadWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightHeadBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div><div class="DTFC_RightBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_RightBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_RightFootWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightFootBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div></div></div>')[0],
|
||||
g=c.childNodes[0],f=c.childNodes[1];this.dom.grid.dt.parentNode.insertBefore(c,this.dom.grid.dt);c.appendChild(this.dom.grid.dt);this.dom.grid.wrapper=c;0<this.s.iLeftColumns&&(this.dom.grid.left.wrapper=g,this.dom.grid.left.head=g.childNodes[0],this.dom.grid.left.body=g.childNodes[1],this.dom.grid.left.liner=d("div.DTFC_LeftBodyLiner",c)[0],c.appendChild(g));0<this.s.iRightColumns&&(this.dom.grid.right.wrapper=f,this.dom.grid.right.head=f.childNodes[0],this.dom.grid.right.body=f.childNodes[1],this.dom.grid.right.liner=
|
||||
d("div.DTFC_RightBodyLiner",c)[0],b=d("div.DTFC_RightHeadBlocker",c)[0],b.style.width=a.bar+"px",b.style.right=-a.bar+"px",this.dom.grid.right.headBlock=b,b=d("div.DTFC_RightFootBlocker",c)[0],b.style.width=a.bar+"px",b.style.right=-a.bar+"px",this.dom.grid.right.footBlock=b,c.appendChild(f));if(this.s.dt.nTFoot&&(this.dom.footer=this.s.dt.nTFoot.parentNode,0<this.s.iLeftColumns&&(this.dom.grid.left.foot=g.childNodes[2]),0<this.s.iRightColumns))this.dom.grid.right.foot=f.childNodes[2]},_fnGridLayout:function(){var a=
|
||||
this.dom.grid,b=d(a.wrapper).width(),c=d(this.s.dt.nTable.parentNode).outerHeight(),g=d(this.s.dt.nTable.parentNode.parentNode).outerHeight(),f=this._fnDTOverflow(),e=this.s.iLeftWidth,h=this.s.iRightWidth,i=function(a,b){f.bar?a.style.width=b+f.bar+"px":(a.style.width=b+20+"px",a.style.paddingRight="20px",a.style.boxSizing="border-box")};f.x&&(c-=f.bar);a.wrapper.style.height=g+"px";0<this.s.iLeftColumns&&(a.left.wrapper.style.width=e+"px",a.left.wrapper.style.height="1px",a.left.body.style.height=
|
||||
c+"px",a.left.foot&&(a.left.foot.style.top=(f.x?f.bar:0)+"px"),i(a.left.liner,e),a.left.liner.style.height=c+"px");0<this.s.iRightColumns&&(b-=h,f.y&&(b-=f.bar),a.right.wrapper.style.width=h+"px",a.right.wrapper.style.left=b+"px",a.right.wrapper.style.height="1px",a.right.body.style.height=c+"px",a.right.foot&&(a.right.foot.style.top=(f.x?f.bar:0)+"px"),i(a.right.liner,h),a.right.liner.style.height=c+"px",a.right.headBlock.style.display=f.y?"block":"none",a.right.footBlock.style.display=f.y?"block":
|
||||
"none")},_fnDTOverflow:function(){var a=this.s.dt.nTable,b=a.parentNode,c={x:!1,y:!1,bar:this.s.dt.oScroll.iBarWidth};a.offsetWidth>b.clientWidth&&(c.x=!0);a.offsetHeight>b.clientHeight&&(c.y=!0);return c},_fnDraw:function(a){this._fnGridLayout();this._fnCloneLeft(a);this._fnCloneRight(a);null!==this.s.fnDrawCallback&&this.s.fnDrawCallback.call(this,this.dom.clone.left,this.dom.clone.right);d(this).trigger("draw.dtfc",{leftClone:this.dom.clone.left,rightClone:this.dom.clone.right})},_fnCloneRight:function(a){if(!(0>=
|
||||
this.s.iRightColumns)){var b,c=[];for(b=this.s.iTableColumns-this.s.iRightColumns;b<this.s.iTableColumns;b++)this.s.dt.aoColumns[b].bVisible&&c.push(b);this._fnClone(this.dom.clone.right,this.dom.grid.right,c,a)}},_fnCloneLeft:function(a){if(!(0>=this.s.iLeftColumns)){var b,c=[];for(b=0;b<this.s.iLeftColumns;b++)this.s.dt.aoColumns[b].bVisible&&c.push(b);this._fnClone(this.dom.clone.left,this.dom.grid.left,c,a)}},_fnCopyLayout:function(a,b){for(var c=[],g=[],f=[],e=0,h=a.length;e<h;e++){var i=[];
|
||||
i.nTr=d(a[e].nTr).clone(!0,!0)[0];for(var k=0,j=this.s.iTableColumns;k<j;k++)if(-1!==d.inArray(k,b)){var m=d.inArray(a[e][k].cell,f);-1===m?(m=d(a[e][k].cell).clone(!0,!0)[0],g.push(m),f.push(a[e][k].cell),i.push({cell:m,unique:a[e][k].unique})):i.push({cell:g[m],unique:a[e][k].unique})}c.push(i)}return c},_fnClone:function(a,b,c,g){var f=this,e,h,i,k,j,m,o,n,q,l=this.s.dt;if(g){null!==a.header&&a.header.parentNode.removeChild(a.header);a.header=d(this.dom.header).clone(!0,!0)[0];a.header.className+=
|
||||
" DTFC_Cloned";a.header.style.width="100%";b.head.appendChild(a.header);n=this._fnCopyLayout(l.aoHeader,c);k=d(">thead",a.header);k.empty();e=0;for(h=n.length;e<h;e++)k[0].appendChild(n[e].nTr);l.oApi._fnDrawHead(l,n,!0)}else{n=this._fnCopyLayout(l.aoHeader,c);q=[];l.oApi._fnDetectHeader(q,d(">thead",a.header)[0]);e=0;for(h=n.length;e<h;e++){i=0;for(k=n[e].length;i<k;i++)q[e][i].cell.className=n[e][i].cell.className,d("span.DataTables_sort_icon",q[e][i].cell).each(function(){this.className=d("span.DataTables_sort_icon",
|
||||
n[e][i].cell)[0].className})}}this._fnEqualiseHeights("thead",this.dom.header,a.header);"auto"==this.s.sHeightMatch&&d(">tbody>tr",f.dom.body).css("height","auto");null!==a.body&&(a.body.parentNode.removeChild(a.body),a.body=null);a.body=d(this.dom.body).clone(!0)[0];a.body.className+=" DTFC_Cloned";a.body.style.paddingBottom=l.oScroll.iBarWidth+"px";a.body.style.marginBottom=2*l.oScroll.iBarWidth+"px";null!==a.body.getAttribute("id")&&a.body.removeAttribute("id");d(">thead>tr",a.body).empty();d(">tfoot",
|
||||
a.body).remove();var p=d("tbody",a.body)[0];d(p).empty();if(0<l.aiDisplay.length){h=d(">thead>tr",a.body)[0];for(o=0;o<c.length;o++)j=c[o],m=d(l.aoColumns[j].nTh).clone(!0)[0],m.innerHTML="",k=m.style,k.paddingTop="0",k.paddingBottom="0",k.borderTopWidth="0",k.borderBottomWidth="0",k.height=0,k.width=f.s.aiInnerWidths[j]+"px",h.appendChild(m);d(">tbody>tr",f.dom.body).each(function(a){var b=this.cloneNode(false);b.removeAttribute("id");a=f.s.dt.aoData[f.s.dt.oFeatures.bServerSide===false?f.s.dt.aiDisplay[f.s.dt._iDisplayStart+
|
||||
a]:a].anCells||d(this).children("td, th");for(o=0;o<c.length;o++){j=c[o];if(a.length>0){m=d(a[j]).clone(true,true)[0];b.appendChild(m)}}p.appendChild(b)})}else d(">tbody>tr",f.dom.body).each(function(){m=this.cloneNode(true);m.className=m.className+" DTFC_NoData";d("td",m).html("");p.appendChild(m)});a.body.style.width="100%";a.body.style.margin="0";a.body.style.padding="0";l.oScroller!==t&&(h=l.oScroller.dom.force,b.forcer?b.forcer.style.height=h.style.height:(b.forcer=h.cloneNode(!0),b.liner.appendChild(b.forcer)));
|
||||
b.liner.appendChild(a.body);this._fnEqualiseHeights("tbody",f.dom.body,a.body);if(null!==l.nTFoot){if(g){null!==a.footer&&a.footer.parentNode.removeChild(a.footer);a.footer=d(this.dom.footer).clone(!0,!0)[0];a.footer.className+=" DTFC_Cloned";a.footer.style.width="100%";b.foot.appendChild(a.footer);n=this._fnCopyLayout(l.aoFooter,c);b=d(">tfoot",a.footer);b.empty();e=0;for(h=n.length;e<h;e++)b[0].appendChild(n[e].nTr);l.oApi._fnDrawHead(l,n,!0)}else{n=this._fnCopyLayout(l.aoFooter,c);b=[];l.oApi._fnDetectHeader(b,
|
||||
d(">tfoot",a.footer)[0]);e=0;for(h=n.length;e<h;e++){i=0;for(k=n[e].length;i<k;i++)b[e][i].cell.className=n[e][i].cell.className}}this._fnEqualiseHeights("tfoot",this.dom.footer,a.footer)}b=l.oApi._fnGetUniqueThs(l,d(">thead",a.header)[0]);d(b).each(function(a){j=c[a];this.style.width=f.s.aiInnerWidths[j]+"px"});null!==f.s.dt.nTFoot&&(b=l.oApi._fnGetUniqueThs(l,d(">tfoot",a.footer)[0]),d(b).each(function(a){j=c[a];this.style.width=f.s.aiInnerWidths[j]+"px"}))},_fnGetTrNodes:function(a){for(var b=
|
||||
[],c=0,d=a.childNodes.length;c<d;c++)"TR"==a.childNodes[c].nodeName.toUpperCase()&&b.push(a.childNodes[c]);return b},_fnEqualiseHeights:function(a,b,c){if(!("none"==this.s.sHeightMatch&&"thead"!==a&&"tfoot"!==a)){var g,f,e=b.getElementsByTagName(a)[0],c=c.getElementsByTagName(a)[0],a=d(">"+a+">tr:eq(0)",b).children(":first");a.outerHeight();a.height();for(var e=this._fnGetTrNodes(e),b=this._fnGetTrNodes(c),h=[],c=0,a=b.length;c<a;c++)g=e[c].offsetHeight,f=b[c].offsetHeight,g=f>g?f:g,"semiauto"==this.s.sHeightMatch&&
|
||||
(e[c]._DTTC_iHeight=g),h.push(g);c=0;for(a=b.length;c<a;c++)b[c].style.height=h[c]+"px",e[c].style.height=h[c]+"px"}}};j.defaults={iLeftColumns:1,iRightColumns:0,fnDrawCallback:null,sHeightMatch:"semiauto"};j.version="3.0.4";d.fn.dataTable.FixedColumns=j;return d.fn.DataTable.FixedColumns=j};"function"===typeof define&&define.amd?define(["jquery","datatables"],p):"object"===typeof exports?p(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.FixedColumns&&p(jQuery,jQuery.fn.dataTable)})(window,
|
||||
document);
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var g=0;g<a.length;++g){var k=a[g];if(k&&k.Math==Math)return k}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.checkEs6ConformanceViaProxy=function(){try{var a={},g=Object.create(new $jscomp.global.Proxy(a,{get:function(k,e,d){return k==a&&"q"==e&&d==g}}));return!0===g.q}catch(k){return!1}};$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();$jscomp.arrayIteratorImpl=function(a){var g=0;return function(){return g<a.length?{done:!1,value:a[g++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};
|
||||
$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,g,k){if(a==Array.prototype||a==Object.prototype)return a;a[g]=k.value;return a};$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;
|
||||
$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,g){var k=$jscomp.propertyToPolyfillSymbol[g];if(null==k)return a[g];k=a[k];return void 0!==k?k:a[g]};$jscomp.polyfill=function(a,g,k,e){g&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,g,k,e):$jscomp.polyfillUnisolated(a,g,k,e))};
|
||||
$jscomp.polyfillUnisolated=function(a,g,k,e){k=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];if(!(d in k))return;k=k[d]}a=a[a.length-1];e=k[a];g=g(e);g!=e&&null!=g&&$jscomp.defineProperty(k,a,{configurable:!0,writable:!0,value:g})};
|
||||
$jscomp.polyfillIsolated=function(a,g,k,e){var d=a.split(".");a=1===d.length;e=d[0];e=!a&&e in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var h=0;h<d.length-1;h++){var m=d[h];if(!(m in e))return;e=e[m]}d=d[d.length-1];k=$jscomp.IS_SYMBOL_NATIVE&&"es6"===k?e[d]:null;g=g(k);null!=g&&(a?$jscomp.defineProperty($jscomp.polyfills,d,{configurable:!0,writable:!0,value:g}):g!==k&&($jscomp.propertyToPolyfillSymbol[d]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(d):$jscomp.POLYFILL_PREFIX+d,d=
|
||||
$jscomp.propertyToPolyfillSymbol[d],$jscomp.defineProperty(e,d,{configurable:!0,writable:!0,value:g})))};$jscomp.initSymbol=function(){};
|
||||
$jscomp.polyfill("Symbol",function(a){if(a)return a;var g=function(d,h){this.$jscomp$symbol$id_=d;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:h})};g.prototype.toString=function(){return this.$jscomp$symbol$id_};var k=0,e=function(d){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new g("jscomp_symbol_"+(d||"")+"_"+k++,d)};return e},"es6","es3");$jscomp.initSymbolIterator=function(){};
|
||||
$jscomp.polyfill("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var g="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),k=0;k<g.length;k++){var e=$jscomp.global[g[k]];"function"===typeof e&&"function"!=typeof e.prototype[a]&&$jscomp.defineProperty(e.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return a},"es6",
|
||||
"es3");$jscomp.initSymbolAsyncIterator=function(){};$jscomp.iteratorPrototype=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a};$jscomp.makeIterator=function(a){var g="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return g?g.call(a):$jscomp.arrayIterator(a)};$jscomp.owns=function(a,g){return Object.prototype.hasOwnProperty.call(a,g)};
|
||||
$jscomp.polyfill("WeakMap",function(a){function g(){if(!a||!Object.seal)return!1;try{var b=Object.seal({}),f=Object.seal({}),l=new a([[b,2],[f,3]]);if(2!=l.get(b)||3!=l.get(f))return!1;l.delete(b);l.set(f,4);return!l.has(b)&&4==l.get(f)}catch(u){return!1}}function k(){}function e(b){var f=typeof b;return"object"===f&&null!==b||"function"===f}function d(b){if(!$jscomp.owns(b,m)){var f=new k;$jscomp.defineProperty(b,m,{value:f})}}function h(b){if(!$jscomp.ISOLATE_POLYFILLS){var f=Object[b];f&&(Object[b]=
|
||||
function(l){if(l instanceof k)return l;Object.isExtensible(l)&&d(l);return f(l)})}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(a&&$jscomp.ES6_CONFORMANCE)return a}else if(g())return a;var m="$jscomp_hidden_"+Math.random();h("freeze");h("preventExtensions");h("seal");var n=0,c=function(b){this.id_=(n+=Math.random()+1).toString();if(b){b=$jscomp.makeIterator(b);for(var f;!(f=b.next()).done;)f=f.value,this.set(f[0],f[1])}};c.prototype.set=function(b,f){if(!e(b))throw Error("Invalid WeakMap key");
|
||||
d(b);if(!$jscomp.owns(b,m))throw Error("WeakMap key fail: "+b);b[m][this.id_]=f;return this};c.prototype.get=function(b){return e(b)&&$jscomp.owns(b,m)?b[m][this.id_]:void 0};c.prototype.has=function(b){return e(b)&&$jscomp.owns(b,m)&&$jscomp.owns(b[m],this.id_)};c.prototype.delete=function(b){return e(b)&&$jscomp.owns(b,m)&&$jscomp.owns(b[m],this.id_)?delete b[m][this.id_]:!1};return c},"es6","es3");$jscomp.MapEntry=function(){};
|
||||
$jscomp.polyfill("Map",function(a){function g(){if($jscomp.ASSUME_NO_NATIVE_MAP||!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),b=new a($jscomp.makeIterator([[c,"s"]]));if("s"!=b.get(c)||1!=b.size||b.get({x:4})||b.set({x:4},"t")!=b||2!=b.size)return!1;var f=b.entries(),l=f.next();if(l.done||l.value[0]!=c||"s"!=l.value[1])return!1;l=f.next();return l.done||4!=l.value[0].x||"t"!=l.value[1]||!f.next().done?!1:!0}catch(u){return!1}}
|
||||
if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(a&&$jscomp.ES6_CONFORMANCE)return a}else if(g())return a;var k=new WeakMap,e=function(c){this.data_={};this.head_=m();this.size=0;if(c){c=$jscomp.makeIterator(c);for(var b;!(b=c.next()).done;)b=b.value,this.set(b[0],b[1])}};e.prototype.set=function(c,b){c=0===c?0:c;var f=d(this,c);f.list||(f.list=this.data_[f.id]=[]);f.entry?f.entry.value=b:(f.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:c,value:b},f.list.push(f.entry),
|
||||
this.head_.previous.next=f.entry,this.head_.previous=f.entry,this.size++);return this};e.prototype.delete=function(c){c=d(this,c);return c.entry&&c.list?(c.list.splice(c.index,1),c.list.length||delete this.data_[c.id],c.entry.previous.next=c.entry.next,c.entry.next.previous=c.entry.previous,c.entry.head=null,this.size--,!0):!1};e.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=m();this.size=0};e.prototype.has=function(c){return!!d(this,c).entry};e.prototype.get=function(c){return(c=
|
||||
d(this,c).entry)&&c.value};e.prototype.entries=function(){return h(this,function(c){return[c.key,c.value]})};e.prototype.keys=function(){return h(this,function(c){return c.key})};e.prototype.values=function(){return h(this,function(c){return c.value})};e.prototype.forEach=function(c,b){for(var f=this.entries(),l;!(l=f.next()).done;)l=l.value,c.call(b,l[1],l[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var d=function(c,b){var f=b&&typeof b;"object"==f||"function"==f?k.has(b)?f=k.get(b):
|
||||
(f=""+ ++n,k.set(b,f)):f="p_"+b;var l=c.data_[f];if(l&&$jscomp.owns(c.data_,f))for(c=0;c<l.length;c++){var u=l[c];if(b!==b&&u.key!==u.key||b===u.key)return{id:f,list:l,index:c,entry:u}}return{id:f,list:l,index:-1,entry:void 0}},h=function(c,b){var f=c.head_;return $jscomp.iteratorPrototype(function(){if(f){for(;f.head!=c.head_;)f=f.previous;for(;f.next!=f.head;)return f=f.next,{done:!1,value:b(f)};f=null}return{done:!0,value:void 0}})},m=function(){var c={};return c.previous=c.next=c.head=c},n=0;
|
||||
return e},"es6","es3");
|
||||
(function(){var a,g,k=function(){function e(d,h){var m=this;if(!g||!g.versionCheck||!g.versionCheck("1.10.0"))throw Error("StateRestore requires DataTables 1.10 or newer");d=new g.Api(d);this.classes=a.extend(!0,{},e.classes);this.c=a.extend(!0,{},e.defaults,h);void 0===h.left&&void 0!==this.c.leftColumns&&(this.c.left=this.c.leftColumns);void 0===h.right&&void 0!==this.c.rightColumns&&(this.c.right=this.c.rightColumns);this.s={barWidth:0,dt:d,rtl:"rtl"===a(d.table().node()).css("direction")};h={"background-color":"white",
|
||||
bottom:"0px",display:"block",position:"absolute",width:this.s.barWidth+1+"px"};this.dom={leftBottomBlocker:a("<div>").css(h).css("left",0).addClass(this.classes.leftBottomBlocker),leftTopBlocker:a("<div>").css(h).css({left:0,top:0}).addClass(this.classes.leftTopBlocker),rightBottomBlocker:a("<div>").css(h).css("right",0).addClass(this.classes.rightBottomBlocker),rightTopBlocker:a("<div>").css(h).css({right:0,top:0}).addClass(this.classes.rightTopBlocker)};if(this.s.dt.settings()[0]._bInitComplete)this._addStyles(),
|
||||
this._setKeyTableListener();else d.one("preInit.dt",function(){m._addStyles();m._setKeyTableListener()});d.settings()[0]._fixedColumns=this;return this}e.prototype.left=function(d){void 0!==d&&(this.c.left=d,this._addStyles());return this.c.left};e.prototype.right=function(d){void 0!==d&&(this.c.right=d,this._addStyles());return this.c.right};e.prototype._addStyles=function(){if(this.s.dt.settings()[0].oScroll.sY){var d=a(this.s.dt.table().node()).closest("div.dataTables_scrollBody")[0],h=this.s.dt.settings()[0].oBrowser.barWidth;
|
||||
this.s.barWidth=d.offsetWidth-d.clientWidth>=h?h:0;this.dom.rightTopBlocker.css("width",this.s.barWidth+1);this.dom.leftTopBlocker.css("width",this.s.barWidth+1);this.dom.rightBottomBlocker.css("width",this.s.barWidth+1);this.dom.leftBottomBlocker.css("width",this.s.barWidth+1)}d=null;h=this.s.dt.column(0).header();var m=null;null!==h&&(h=a(h),m=h.outerHeight()+1,d=a(h.closest("div.dataTables_scroll")).css("position","relative"));var n=this.s.dt.column(0).footer(),c=null;null!==n&&(n=a(n),c=n.outerHeight(),
|
||||
null===d&&(d=a(n.closest("div.dataTables_scroll")).css("position","relative")));for(var b=this.s.dt.columns().data().toArray().length,f=0,l=0,u=a(this.s.dt.table().node()).children("tbody").children("tr"),x=0,A=new Map,r=0;r<b;r++){var t=this.s.dt.column(r);0<r&&A.set(r-1,x);if(t.visible()){var y=a(t.header());t=a(t.footer());if(r-x<this.c.left){a(this.s.dt.table().node()).addClass(this.classes.tableFixedLeft);d.addClass(this.classes.tableFixedLeft);if(0<r-x)for(var p=r;p+1<b;){var q=this.s.dt.column(p-
|
||||
1,{page:"current"});if(q.visible()){f+=a(q.nodes()[0]).outerWidth();l+=q.header()?a(q.header()).outerWidth():q.footer()?a(q.header()).outerWidth():0;break}p--}for(var v=0,w=u;v<w.length;v++)p=w[v],a(a(p).children()[r-x]).css(this._getCellCSS(!1,f,"left")).addClass(this.classes.fixedLeft);y.css(this._getCellCSS(!0,l,"left")).addClass(this.classes.fixedLeft);t.css(this._getCellCSS(!0,l,"left")).addClass(this.classes.fixedLeft)}else{v=0;for(w=u;v<w.length;v++)p=w[v],p=a(a(p).children()[r-x]),p.hasClass(this.classes.fixedLeft)&&
|
||||
p.css(this._clearCellCSS("left")).removeClass(this.classes.fixedLeft);y.hasClass(this.classes.fixedLeft)&&y.css(this._clearCellCSS("left")).removeClass(this.classes.fixedLeft);t.hasClass(this.classes.fixedLeft)&&t.css(this._clearCellCSS("left")).removeClass(this.classes.fixedLeft)}}else x++}null===h||h.hasClass("index")||(this.s.rtl?(this.dom.leftTopBlocker.outerHeight(m),d.append(this.dom.leftTopBlocker)):(this.dom.rightTopBlocker.outerHeight(m),d.append(this.dom.rightTopBlocker)));null===n||n.hasClass("index")||
|
||||
(this.s.rtl?(this.dom.leftBottomBlocker.outerHeight(c),d.append(this.dom.leftBottomBlocker)):(this.dom.rightBottomBlocker.outerHeight(c),d.append(this.dom.rightBottomBlocker)));v=l=f=0;for(r=b-1;0<=r;r--)if(t=this.s.dt.column(r),t.visible())if(y=a(t.header()),t=a(t.footer()),w=A.get(r),void 0===w&&(w=x),r+v>=b-this.c.right){a(this.s.dt.table().node()).addClass(this.classes.tableFixedRight);d.addClass(this.classes.tableFixedRight);if(r+1+v<b)for(p=r;p+1<b;){q=this.s.dt.column(p+1,{page:"current"});
|
||||
if(q.visible()){f+=a(q.nodes()[0]).outerWidth();l+=q.header()?a(q.header()).outerWidth():q.footer()?a(q.header()).outerWidth():0;break}p++}q=0;for(var z=u;q<z.length;q++)p=z[q],a(a(p).children()[r-w]).css(this._getCellCSS(!1,f,"right")).addClass(this.classes.fixedRight);y.css(this._getCellCSS(!0,l,"right")).addClass(this.classes.fixedRight);t.css(this._getCellCSS(!0,l,"right")).addClass(this.classes.fixedRight)}else{q=0;for(z=u;q<z.length;q++)p=z[q],p=a(a(p).children()[r-w]),p.hasClass(this.classes.fixedRight)&&
|
||||
p.css(this._clearCellCSS("right")).removeClass(this.classes.fixedRight);y.hasClass(this.classes.fixedRight)&&y.css(this._clearCellCSS("right")).removeClass(this.classes.fixedRight);t.hasClass(this.classes.fixedRight)&&t.css(this._clearCellCSS("right")).removeClass(this.classes.fixedRight)}else v++;h&&(this.s.rtl?(this.dom.leftTopBlocker.outerHeight(m),d.append(this.dom.leftTopBlocker)):(this.dom.rightTopBlocker.outerHeight(m),d.append(this.dom.rightTopBlocker)));n&&(this.s.rtl?(this.dom.leftBottomBlocker.outerHeight(c),
|
||||
d.append(this.dom.leftBottomBlocker)):(this.dom.rightBottomBlocker.outerHeight(c),d.append(this.dom.rightBottomBlocker)))};e.prototype._getCellCSS=function(d,h,m){return"left"===m?this.s.rtl?{position:"sticky",right:h+(d?this.s.barWidth:0)+"px"}:{left:h+"px",position:"sticky"}:this.s.rtl?{left:h+"px",position:"sticky"}:{position:"sticky",right:h+(d?this.s.barWidth:0)+"px"}};e.prototype._clearCellCSS=function(d){return"left"===d?this.s.rtl?{position:"",right:""}:{left:"",position:""}:this.s.rtl?{left:"",
|
||||
position:""}:{position:"",right:""}};e.prototype._setKeyTableListener=function(){var d=this;this.s.dt.on("key-focus",function(h,m,n){h=a(n.node()).offset();m=a(a(d.s.dt.table().node()).closest("div.dataTables_scrollBody"));if(0<d.c.left){var c=a(d.s.dt.column(d.c.left-1).header()),b=c.offset(),f=c.outerWidth();h.left<b.left+f&&(c=m.scrollLeft(),m.scrollLeft(c-(b.left+f-h.left)))}0<d.c.right&&(c=d.s.dt.columns().data().toArray().length,n=a(n.node()).outerWidth(),b=a(d.s.dt.column(c-d.c.right).header()).offset(),
|
||||
h.left+n>b.left&&(c=m.scrollLeft(),m.scrollLeft(c-(b.left-(h.left+n)))))});this.s.dt.on("draw",function(){d._addStyles()});this.s.dt.on("column-reorder",function(){d._addStyles()});this.s.dt.on("column-visibility",function(){setTimeout(function(){d._addStyles()},50)})};e.version="4.0.1";e.classes={fixedLeft:"dtfc-fixed-left",fixedRight:"dtfc-fixed-right",leftBottomBlocker:"dtfc-left-bottom-blocker",leftTopBlocker:"dtfc-left-top-blocker",rightBottomBlocker:"dtfc-right-bottom-blocker",rightTopBlocker:"dtfc-right-top-blocker",
|
||||
tableFixedLeft:"dtfc-has-left",tableFixedRight:"dtfc-has-right"};e.defaults={i18n:{button:"FixedColumns"},left:1,right:0};return e}();(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(d){return e(d,window,document)}):"object"===typeof exports?module.exports=function(d,h){d||(d=window);h&&h.fn.dataTable||(h=require("datatables.net")(d,h).$);return e(h,d,d.document)}:e(window.jQuery,window,document)})(function(e,d,h){function m(c,b){void 0===b&&(b=null);
|
||||
c=new n.Api(c);b=b?b:c.init().fixedColumns||n.defaults.fixedColumns;return new k(c,b)}a=e;g=a.fn.dataTable;var n=e.fn.dataTable;e.fn.dataTable.FixedColumns=k;e.fn.DataTable.FixedColumns=k;d=e.fn.dataTable.Api.register;d("fixedColumns()",function(){return this});d("fixedColumns().left()",function(c){var b=this.context[0];return void 0!==c?(b._fixedColumns.left(c),this):b._fixedColumns.left()});d("fixedColumns().right()",function(c){var b=this.context[0];return void 0!==c?(b._fixedColumns.right(c),
|
||||
this):b._fixedColumns.right()});e.fn.dataTable.ext.buttons.fixedColumns={action:function(c,b,f,l){e(f).attr("active")?(e(f).removeAttr("active").removeClass("active"),b.fixedColumns().left(0),b.fixedColumns().right(0)):(e(f).attr("active",!0).addClass("active"),b.fixedColumns().left(l.config.left),b.fixedColumns().right(l.config.right))},config:{left:1,right:0},init:function(c,b,f){void 0===c.settings()[0]._fixedColumns&&m(c.settings(),f);e(b).attr("active",!0).addClass("active");c.button(b).text(f.text||
|
||||
c.i18n("buttons.fixedColumns",c.settings()[0]._fixedColumns.c.i18n.button))},text:null};e(h).on("init.dt.dtfc",function(c,b){"dt"===c.namespace&&(b.oInit.fixedColumns||n.defaults.fixedColumns)&&(b._fixedColumns||m(b,null))})})})();
|
||||
28
public_html/assets/datatables/js/dataTables.rowGroup.min.js
vendored
Normal file
28
public_html/assets/datatables/js/dataTables.rowGroup.min.js
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
Copyright 2017-2021 SpryMedia Ltd.
|
||||
|
||||
This source file is free software, available under the following license:
|
||||
MIT license - http://datatables.net/license/mit
|
||||
|
||||
This source file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
|
||||
For details please refer to: http://www.datatables.net
|
||||
RowGroup 1.1.4
|
||||
©2017-2021 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,c,d){b instanceof String&&(b=String(b));for(var g=b.length,e=0;e<g;e++){var k=b[e];if(c.call(d,k,e,b))return{i:e,v:k}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,c,d){if(b==Array.prototype||b==Object.prototype)return b;b[c]=d.value;return b};$jscomp.getGlobal=function(b){b=["object"==typeof globalThis&&globalThis,b,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var c=0;c<b.length;++c){var d=b[c];if(d&&d.Math==Math)return d}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(b,c){var d=$jscomp.propertyToPolyfillSymbol[c];if(null==d)return b[c];d=b[d];return void 0!==d?d:b[c]};
|
||||
$jscomp.polyfill=function(b,c,d,g){c&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(b,c,d,g):$jscomp.polyfillUnisolated(b,c,d,g))};$jscomp.polyfillUnisolated=function(b,c,d,g){d=$jscomp.global;b=b.split(".");for(g=0;g<b.length-1;g++){var e=b[g];if(!(e in d))return;d=d[e]}b=b[b.length-1];g=d[b];c=c(g);c!=g&&null!=c&&$jscomp.defineProperty(d,b,{configurable:!0,writable:!0,value:c})};
|
||||
$jscomp.polyfillIsolated=function(b,c,d,g){var e=b.split(".");b=1===e.length;g=e[0];g=!b&&g in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var k=0;k<e.length-1;k++){var a=e[k];if(!(a in g))return;g=g[a]}e=e[e.length-1];d=$jscomp.IS_SYMBOL_NATIVE&&"es6"===d?g[e]:null;c=c(d);null!=c&&(b?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:c}):c!==d&&($jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+e,e=
|
||||
$jscomp.propertyToPolyfillSymbol[e],$jscomp.defineProperty(g,e,{configurable:!0,writable:!0,value:c})))};$jscomp.polyfill("Array.prototype.find",function(b){return b?b:function(c,d){return $jscomp.findInternal(this,c,d).v}},"es6","es3");
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(c){return b(c,window,document)}):"object"===typeof exports?module.exports=function(c,d){c||(c=window);d&&d.fn.dataTable||(d=require("datatables.net")(c,d).$);return b(d,c,c.document)}:b(jQuery,window,document)})(function(b,c,d,g){var e=b.fn.dataTable,k=function(a,f){if(!e.versionCheck||!e.versionCheck("1.10.8"))throw"RowGroup requires DataTables 1.10.8 or newer";this.c=b.extend(!0,{},e.defaults.rowGroup,
|
||||
k.defaults,f);this.s={dt:new e.Api(a)};this.dom={};a=this.s.dt.settings()[0];if(f=a.rowGroup)return f;a.rowGroup=this;this._constructor()};b.extend(k.prototype,{dataSrc:function(a){if(a===g)return this.c.dataSrc;var f=this.s.dt;this.c.dataSrc=a;b(f.table().node()).triggerHandler("rowgroup-datasrc.dt",[f,a]);return this},disable:function(){this.c.enable=!1;return this},enable:function(a){if(!1===a)return this.disable();this.c.enable=!0;return this},enabled:function(){return this.c.enable},_constructor:function(){var a=
|
||||
this,f=this.s.dt,h=f.settings()[0];f.on("draw.dtrg",function(m,r){a.c.enable&&h===r&&a._draw()});f.on("column-visibility.dt.dtrg responsive-resize.dt.dtrg",function(){a._adjustColspan()});f.on("destroy",function(){f.off(".dtrg")})},_adjustColspan:function(){b("tr."+this.c.className,this.s.dt.table().body()).find("td:visible").attr("colspan",this._colspan())},_colspan:function(){return this.s.dt.columns().visible().reduce(function(a,f){return a+f},0)},_draw:function(){var a=this._group(0,this.s.dt.rows({page:"current"}).indexes());
|
||||
this._groupDisplay(0,a)},_group:function(a,f){for(var h=Array.isArray(this.c.dataSrc)?this.c.dataSrc:[this.c.dataSrc],m=e.ext.oApi._fnGetObjectDataFn(h[a]),r=this.s.dt,n,q,p=[],l=0,t=f.length;l<t;l++){var u=f[l];n=r.row(u).data();n=m(n);if(null===n||n===g)n=this.c.emptyDataGroup;if(q===g||n!==q)p.push({dataPoint:n,rows:[]}),q=n;p[p.length-1].rows.push(u)}if(h[a+1]!==g)for(l=0,t=p.length;l<t;l++)p[l].children=this._group(a+1,p[l].rows);return p},_groupDisplay:function(a,f){for(var h=this.s.dt,m,r=
|
||||
0,n=f.length;r<n;r++){var q=f[r],p=q.dataPoint,l=q.rows;this.c.startRender&&(m=this.c.startRender.call(this,h.rows(l),p,a),(m=this._rowWrap(m,this.c.startClassName,a))&&m.insertBefore(h.row(l[0]).node()));this.c.endRender&&(m=this.c.endRender.call(this,h.rows(l),p,a),(m=this._rowWrap(m,this.c.endClassName,a))&&m.insertAfter(h.row(l[l.length-1]).node()));q.children&&this._groupDisplay(a+1,q.children)}},_rowWrap:function(a,f,h){if(null===a||""===a)a=this.c.emptyDataGroup;return a===g||null===a?null:
|
||||
("object"===typeof a&&a.nodeName&&"tr"===a.nodeName.toLowerCase()?b(a):a instanceof b&&a.length&&"tr"===a[0].nodeName.toLowerCase()?a:b("<tr/>").append(b("<td/>").attr("colspan",this._colspan()).append(a))).addClass(this.c.className).addClass(f).addClass("dtrg-level-"+h)}});k.defaults={className:"dtrg-group",dataSrc:0,emptyDataGroup:"No group",enable:!0,endClassName:"dtrg-end",endRender:null,startClassName:"dtrg-start",startRender:function(a,f){return f}};k.version="1.1.4";b.fn.dataTable.RowGroup=
|
||||
k;b.fn.DataTable.RowGroup=k;e.Api.register("rowGroup()",function(){return this});e.Api.register("rowGroup().disable()",function(){return this.iterator("table",function(a){a.rowGroup&&a.rowGroup.enable(!1)})});e.Api.register("rowGroup().enable()",function(a){return this.iterator("table",function(f){f.rowGroup&&f.rowGroup.enable(a===g?!0:a)})});e.Api.register("rowGroup().enabled()",function(){var a=this.context;return a.length&&a[0].rowGroup?a[0].rowGroup.enabled():!1});e.Api.register("rowGroup().dataSrc()",
|
||||
function(a){return a===g?this.context[0].rowGroup.dataSrc():this.iterator("table",function(f){f.rowGroup&&f.rowGroup.dataSrc(a)})});b(d).on("preInit.dt.dtrg",function(a,f,h){"dt"===a.namespace&&(a=f.oInit.rowGroup,h=e.defaults.rowGroup,a||h)&&(h=b.extend({},h,a),!1!==a&&new k(f,h))});return k});
|
||||
29
public_html/assets/datatables/js/dataTables.rowReorder.min.js
vendored
Normal file
29
public_html/assets/datatables/js/dataTables.rowReorder.min.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/*!
|
||||
Copyright 2015-2020 SpryMedia Ltd.
|
||||
|
||||
This source file is free software, available under the following license:
|
||||
MIT license - http://datatables.net/license/mit
|
||||
|
||||
This source file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
|
||||
For details please refer to: http://www.datatables.net
|
||||
RowReorder 1.2.8
|
||||
2015-2020 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(m){return d(m,window,document)}):"object"===typeof exports?module.exports=function(m,h){m||(m=window);h&&h.fn.dataTable||(h=require("datatables.net")(m,h).$);return d(h,m,m.document)}:d(jQuery,window,document)})(function(d,m,h,A){var q=d.fn.dataTable,p=function(a,b){if(!q.versionCheck||!q.versionCheck("1.10.8"))throw"DataTables RowReorder requires DataTables 1.10.8 or newer";this.c=d.extend(!0,{},q.defaults.rowReorder,
|
||||
p.defaults,b);this.s={bodyTop:null,dt:new q.Api(a),getDataFn:q.ext.oApi._fnGetObjectDataFn(this.c.dataSrc),middles:null,scroll:{},scrollInterval:null,setDataFn:q.ext.oApi._fnSetObjectDataFn(this.c.dataSrc),start:{top:0,left:0,offsetTop:0,offsetLeft:0,nodes:[]},windowHeight:0,documentOuterHeight:0,domCloneOuterHeight:0};this.dom={clone:null,dtScroll:d("div.dataTables_scrollBody",this.s.dt.table().container())};a=this.s.dt.settings()[0];if(b=a.rowreorder)return b;this.dom.dtScroll.length||(this.dom.dtScroll=
|
||||
d(this.s.dt.table().container(),"tbody"));a.rowreorder=this;this._constructor()};d.extend(p.prototype,{_constructor:function(){var a=this,b=this.s.dt,c=d(b.table().node());"static"===c.css("position")&&c.css("position","relative");d(b.table().container()).on("mousedown.rowReorder touchstart.rowReorder",this.c.selector,function(e){if(a.c.enable){if(d(e.target).is(a.c.excludedChildren))return!0;var f=d(this).closest("tr"),g=b.row(f);if(g.any())return a._emitEvent("pre-row-reorder",{node:g.node(),index:g.index()}),
|
||||
a._mouseDown(e,f),!1}});b.on("destroy.rowReorder",function(){d(b.table().container()).off(".rowReorder");b.off(".rowReorder")})},_cachePositions:function(){var a=this.s.dt,b=d(a.table().node()).find("thead").outerHeight(),c=d.unique(a.rows({page:"current"}).nodes().toArray());c=d.map(c,function(e,f){f=d(e).position().top-b;return(f+f+d(e).outerHeight())/2});this.s.middles=c;this.s.bodyTop=d(a.table().body()).offset().top;this.s.windowHeight=d(m).height();this.s.documentOuterHeight=d(h).outerHeight()},
|
||||
_clone:function(a){var b=d(this.s.dt.table().node().cloneNode(!1)).addClass("dt-rowReorder-float").append("<tbody/>").append(a.clone(!1)),c=a.outerWidth(),e=a.outerHeight(),f=a.children().map(function(){return d(this).width()});b.width(c).height(e).find("tr").children().each(function(g){this.style.width=f[g]+"px"});b.appendTo("body");this.dom.clone=b;this.s.domCloneOuterHeight=b.outerHeight()},_clonePosition:function(a){var b=this.s.start,c=this._eventToPage(a,"Y")-b.top;a=this._eventToPage(a,"X")-
|
||||
b.left;var e=this.c.snapX;c+=b.offsetTop;b=!0===e?b.offsetLeft:"number"===typeof e?b.offsetLeft+e:a+b.offsetLeft;0>c?c=0:c+this.s.domCloneOuterHeight>this.s.documentOuterHeight&&(c=this.s.documentOuterHeight-this.s.domCloneOuterHeight);this.dom.clone.css({top:c,left:b})},_emitEvent:function(a,b){this.s.dt.iterator("table",function(c,e){d(c.nTable).triggerHandler(a+".dt",b)})},_eventToPage:function(a,b){return-1!==a.type.indexOf("touch")?a.originalEvent.touches[0]["page"+b]:a["page"+b]},_mouseDown:function(a,
|
||||
b){var c=this,e=this.s.dt,f=this.s.start,g=b.offset();f.top=this._eventToPage(a,"Y");f.left=this._eventToPage(a,"X");f.offsetTop=g.top;f.offsetLeft=g.left;f.nodes=d.unique(e.rows({page:"current"}).nodes().toArray());this._cachePositions();this._clone(b);this._clonePosition(a);this.dom.target=b;b.addClass("dt-rowReorder-moving");d(h).on("mouseup.rowReorder touchend.rowReorder",function(k){c._mouseUp(k)}).on("mousemove.rowReorder touchmove.rowReorder",function(k){c._mouseMove(k)});d(m).width()===d(h).width()&&
|
||||
d(h.body).addClass("dt-rowReorder-noOverflow");a=this.dom.dtScroll;this.s.scroll={windowHeight:d(m).height(),windowWidth:d(m).width(),dtTop:a.length?a.offset().top:null,dtLeft:a.length?a.offset().left:null,dtHeight:a.length?a.outerHeight():null,dtWidth:a.length?a.outerWidth():null}},_mouseMove:function(a){this._clonePosition(a);for(var b=this._eventToPage(a,"Y")-this.s.bodyTop,c=this.s.middles,e=null,f=this.s.dt,g=0,k=c.length;g<k;g++)if(b<c[g]){e=g;break}null===e&&(e=c.length);if(null===this.s.lastInsert||
|
||||
this.s.lastInsert!==e)b=d.unique(f.rows({page:"current"}).nodes().toArray()),e>this.s.lastInsert?this.dom.target.insertAfter(b[e-1]):this.dom.target.insertBefore(b[e]),this._cachePositions(),this.s.lastInsert=e;this._shiftScroll(a)},_mouseUp:function(a){var b=this,c=this.s.dt,e,f=this.c.dataSrc;this.dom.clone.remove();this.dom.clone=null;this.dom.target.removeClass("dt-rowReorder-moving");d(h).off(".rowReorder");d(h.body).removeClass("dt-rowReorder-noOverflow");clearInterval(this.s.scrollInterval);
|
||||
this.s.scrollInterval=null;var g=this.s.start.nodes,k=d.unique(c.rows({page:"current"}).nodes().toArray()),n={},r=[],t=[],u=this.s.getDataFn,B=this.s.setDataFn;var l=0;for(e=g.length;l<e;l++)if(g[l]!==k[l]){var w=c.row(k[l]).id(),C=c.row(k[l]).data(),x=c.row(g[l]).data();w&&(n[w]=u(x));r.push({node:k[l],oldData:u(C),newData:u(x),newPosition:l,oldPosition:d.inArray(k[l],g)});t.push(k[l])}var y=[r,{dataSrc:f,nodes:t,values:n,triggerRow:c.row(this.dom.target),originalEvent:a}];this._emitEvent("row-reorder",
|
||||
y);var z=function(){if(b.c.update){l=0;for(e=r.length;l<e;l++){var D=c.row(r[l].node).data();B(D,r[l].newData);c.columns().every(function(){this.dataSrc()===f&&c.cell(r[l].node,this.index()).invalidate("data")})}b._emitEvent("row-reordered",y);c.draw(!1)}};this.c.editor?(this.c.enable=!1,this.c.editor.edit(t,!1,d.extend({submit:"changed"},this.c.formOptions)).multiSet(f,n).one("preSubmitCancelled.rowReorder",function(){b.c.enable=!0;b.c.editor.off(".rowReorder");c.draw(!1)}).one("submitUnsuccessful.rowReorder",
|
||||
function(){c.draw(!1)}).one("submitSuccess.rowReorder",function(){z()}).one("submitComplete",function(){b.c.enable=!0;b.c.editor.off(".rowReorder")}).submit()):z()},_shiftScroll:function(a){var b=this,c=this.s.scroll,e=!1,f=a.pageY-h.body.scrollTop,g,k;f<d(m).scrollTop()+65?g=-5:f>c.windowHeight+d(m).scrollTop()-65&&(g=5);null!==c.dtTop&&a.pageY<c.dtTop+65?k=-5:null!==c.dtTop&&a.pageY>c.dtTop+c.dtHeight-65&&(k=5);g||k?(c.windowVert=g,c.dtVert=k,e=!0):this.s.scrollInterval&&(clearInterval(this.s.scrollInterval),
|
||||
this.s.scrollInterval=null);!this.s.scrollInterval&&e&&(this.s.scrollInterval=setInterval(function(){if(c.windowVert){var n=d(h).scrollTop();d(h).scrollTop(n+c.windowVert);n!==d(h).scrollTop()&&(n=parseFloat(b.dom.clone.css("top")),b.dom.clone.css("top",n+c.windowVert))}c.dtVert&&(n=b.dom.dtScroll[0],c.dtVert&&(n.scrollTop+=c.dtVert))},20))}});p.defaults={dataSrc:0,editor:null,enable:!0,formOptions:{},selector:"td:first-child",snapX:!1,update:!0,excludedChildren:"a"};var v=d.fn.dataTable.Api;v.register("rowReorder()",
|
||||
function(){return this});v.register("rowReorder.enable()",function(a){a===A&&(a=!0);return this.iterator("table",function(b){b.rowreorder&&(b.rowreorder.c.enable=a)})});v.register("rowReorder.disable()",function(){return this.iterator("table",function(a){a.rowreorder&&(a.rowreorder.c.enable=!1)})});p.version="1.2.8";d.fn.dataTable.RowReorder=p;d.fn.DataTable.RowReorder=p;d(h).on("init.dt.dtr",function(a,b,c){"dt"===a.namespace&&(a=b.oInit.rowReorder,c=q.defaults.rowReorder,a||c)&&(c=d.extend({},a,
|
||||
c),!1!==a&&new p(b,c))});return p});
|
||||
40
public_html/assets/datatables/js/dataTables.select.min.js
vendored
Normal file
40
public_html/assets/datatables/js/dataTables.select.min.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*!
|
||||
Copyright 2015-2021 SpryMedia Ltd.
|
||||
|
||||
This source file is free software, available under the following license:
|
||||
MIT license - http://datatables.net/license/mit
|
||||
|
||||
This source file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
|
||||
For details please refer to: http://www.datatables.net/extensions/select
|
||||
Select for DataTables 1.3.4
|
||||
2015-2021 SpryMedia Ltd - datatables.net/license/mit
|
||||
*/
|
||||
(function(h){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(r){return h(r,window,document)}):"object"===typeof exports?module.exports=function(r,v){r||(r=window);v&&v.fn.dataTable||(v=require("datatables.net")(r,v).$);return h(v,r,r.document)}:h(jQuery,window,document)})(function(h,r,v,l){function I(a,b,c){var d=function(g,f){if(g>f){var k=f;f=g;g=k}var n=!1;return a.columns(":visible").indexes().filter(function(q){q===g&&(n=!0);return q===f?(n=!1,!0):n})};var e=
|
||||
function(g,f){var k=a.rows({search:"applied"}).indexes();if(k.indexOf(g)>k.indexOf(f)){var n=f;f=g;g=n}var q=!1;return k.filter(function(y){y===g&&(q=!0);return y===f?(q=!1,!0):q})};a.cells({selected:!0}).any()||c?(d=d(c.column,b.column),c=e(c.row,b.row)):(d=d(0,b.column),c=e(0,b.row));c=a.cells(c,d).flatten();a.cells(b,{selected:!0}).any()?a.cells(c).deselect():a.cells(c).select()}function C(a){var b=a.settings()[0]._select.selector;h(a.table().container()).off("mousedown.dtSelect",b).off("mouseup.dtSelect",
|
||||
b).off("click.dtSelect",b);h("body").off("click.dtSelect"+D(a.table().node()))}function J(a){var b=h(a.table().container()),c=a.settings()[0],d=c._select.selector,e;b.on("mousedown.dtSelect",d,function(g){if(g.shiftKey||g.metaKey||g.ctrlKey)b.css("-moz-user-select","none").one("selectstart.dtSelect",d,function(){return!1});r.getSelection&&(e=r.getSelection())}).on("mouseup.dtSelect",d,function(){b.css("-moz-user-select","")}).on("click.dtSelect",d,function(g){var f=a.select.items();if(e){var k=r.getSelection();
|
||||
if((!k.anchorNode||h(k.anchorNode).closest("table")[0]===a.table().node())&&k!==e)return}k=a.settings()[0];var n=a.settings()[0].oClasses.sWrapper.trim().replace(/ +/g,".");if(h(g.target).closest("div."+n)[0]==a.table().container()&&(n=a.cell(h(g.target).closest("td, th")),n.any())){var q=h.Event("user-select.dt");u(a,q,[f,n,g]);q.isDefaultPrevented()||(q=n.index(),"row"===f?(f=q.row,E(g,a,k,"row",f)):"column"===f?(f=n.index().column,E(g,a,k,"column",f)):"cell"===f&&(f=n.index(),E(g,a,k,"cell",f)),
|
||||
k._select_lastCell=q)}});h("body").on("click.dtSelect"+D(a.table().node()),function(g){!c._select.blurable||h(g.target).parents().filter(a.table().container()).length||0===h(g.target).parents("html").length||h(g.target).parents("div.DTE").length||z(c,!0)})}function u(a,b,c,d){if(!d||a.flatten().length)"string"===typeof b&&(b+=".dt"),c.unshift(a),h(a.table().node()).trigger(b,c)}function N(a){var b=a.settings()[0];if(b._select.info&&b.aanFeatures.i&&"api"!==a.select.style()){var c=a.rows({selected:!0}).flatten().length,
|
||||
d=a.columns({selected:!0}).flatten().length,e=a.cells({selected:!0}).flatten().length,g=function(f,k,n){f.append(h('<span class="select-item"/>').append(a.i18n("select."+k+"s",{_:"%d "+k+"s selected",0:"",1:"1 "+k+" selected"},n)))};h.each(b.aanFeatures.i,function(f,k){k=h(k);f=h('<span class="select-info"/>');g(f,"row",c);g(f,"column",d);g(f,"cell",e);var n=k.children("span.select-info");n.length&&n.remove();""!==f.text()&&k.append(f)})}}function O(a){var b=new m.Api(a);a._select_init=!0;a.aoRowCreatedCallback.push({fn:function(c,
|
||||
d,e){d=a.aoData[e];d._select_selected&&h(c).addClass(a._select.className);c=0;for(e=a.aoColumns.length;c<e;c++)(a.aoColumns[c]._select_selected||d._selected_cells&&d._selected_cells[c])&&h(d.anCells[c]).addClass(a._select.className)},sName:"select-deferRender"});b.on("preXhr.dt.dtSelect",function(c,d){if(d===b.settings()[0]){var e=b.rows({selected:!0}).ids(!0).filter(function(f){return f!==l}),g=b.cells({selected:!0}).eq(0).map(function(f){var k=b.row(f.row).id(!0);return k?{row:k,column:f.column}:
|
||||
l}).filter(function(f){return f!==l});b.one("draw.dt.dtSelect",function(){b.rows(e).select();g.any()&&g.each(function(f){b.cells(f.row,f.column).select()})})}});b.on("draw.dtSelect.dt select.dtSelect.dt deselect.dtSelect.dt info.dt",function(){N(b);b.state.save()});b.on("destroy.dtSelect",function(){b.rows({selected:!0}).deselect();C(b);b.off(".dtSelect");h("body").off(".dtSelect"+D(b.table().node()))})}function K(a,b,c,d){var e=a[b+"s"]({search:"applied"}).indexes();d=h.inArray(d,e);var g=h.inArray(c,
|
||||
e);if(a[b+"s"]({selected:!0}).any()||-1!==d){if(d>g){var f=g;g=d;d=f}e.splice(g+1,e.length);e.splice(0,d)}else e.splice(h.inArray(c,e)+1,e.length);a[b](c,{selected:!0}).any()?(e.splice(h.inArray(c,e),1),a[b+"s"](e).deselect()):a[b+"s"](e).select()}function z(a,b){if(b||"single"===a._select.style)a=new m.Api(a),a.rows({selected:!0}).deselect(),a.columns({selected:!0}).deselect(),a.cells({selected:!0}).deselect()}function E(a,b,c,d,e){var g=b.select.style(),f=b.select.toggleable(),k=b[d](e,{selected:!0}).any();
|
||||
if(!k||f)"os"===g?a.ctrlKey||a.metaKey?b[d](e).select(!k):a.shiftKey?"cell"===d?I(b,e,c._select_lastCell||null):K(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):(a=b[d+"s"]({selected:!0}),k&&1===a.flatten().length?b[d](e).deselect():(a.deselect(),b[d](e).select())):"multi+shift"==g?a.shiftKey?"cell"===d?I(b,e,c._select_lastCell||null):K(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):b[d](e).select(!k):b[d](e).select(!k)}function D(a){return a.id.replace(/[^a-zA-Z0-9\-_]/g,"-")}function A(a,
|
||||
b){return function(c){return c.i18n("buttons."+a,b)}}function F(a){a=a._eventNamespace;return"draw.dt.DT"+a+" select.dt.DT"+a+" deselect.dt.DT"+a}function P(a,b){return-1!==h.inArray("rows",b.limitTo)&&a.rows({selected:!0}).any()||-1!==h.inArray("columns",b.limitTo)&&a.columns({selected:!0}).any()||-1!==h.inArray("cells",b.limitTo)&&a.cells({selected:!0}).any()?!0:!1}var m=h.fn.dataTable;m.select={};m.select.version="1.3.4";m.select.init=function(a){var b=a.settings()[0];if(!b._select){var c=a.state.loaded(),
|
||||
d=function(t,G,p){if(null!==p&&p.select!==l){a.rows().deselect();a.columns().deselect();a.cells().deselect();p.select.rows!==l&&a.rows(p.select.rows).select();p.select.columns!==l&&a.columns(p.select.columns).select();if(p.select.cells!==l)for(t=0;t<p.select.cells.length;t++)a.cell(p.select.cells[t].row,p.select.cells[t].column).select();a.state.save()}};a.one("init",function(){a.on("stateSaveParams",function(t,G,p){p.select={};p.select.rows=a.rows({selected:!0}).ids(!0).toArray();p.select.columns=
|
||||
a.columns({selected:!0})[0];p.select.cells=a.cells({selected:!0})[0].map(function(L){return{row:a.row(L.row).id(!0),column:L.column}})});d(l,l,c);a.on("stateLoaded stateLoadParams",d)});var e=b.oInit.select,g=m.defaults.select;e=e===l?g:e;g="row";var f="api",k=!1,n=!0,q=!0,y="td, th",M="selected",B=!1;b._select={};!0===e?(f="os",B=!0):"string"===typeof e?(f=e,B=!0):h.isPlainObject(e)&&(e.blurable!==l&&(k=e.blurable),e.toggleable!==l&&(n=e.toggleable),e.info!==l&&(q=e.info),e.items!==l&&(g=e.items),
|
||||
f=e.style!==l?e.style:"os",B=!0,e.selector!==l&&(y=e.selector),e.className!==l&&(M=e.className));a.select.selector(y);a.select.items(g);a.select.style(f);a.select.blurable(k);a.select.toggleable(n);a.select.info(q);b._select.className=M;h.fn.dataTable.ext.order["select-checkbox"]=function(t,G){return this.api().column(G,{order:"index"}).nodes().map(function(p){return"row"===t._select.items?h(p).parent().hasClass(t._select.className):"cell"===t._select.items?h(p).hasClass(t._select.className):!1})};
|
||||
!B&&h(a.table().node()).hasClass("selectable")&&a.select.style("os")}};h.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(a,b){m.ext.selector[b.type].push(function(c,d,e){d=d.selected;var g=[];if(!0!==d&&!1!==d)return e;for(var f=0,k=e.length;f<k;f++){var n=c[b.prop][e[f]];(!0===d&&!0===n._select_selected||!1===d&&!n._select_selected)&&g.push(e[f])}return g})});m.ext.selector.cell.push(function(a,b,c){b=b.selected;var d=[];if(b===l)return c;for(var e=0,g=c.length;e<g;e++){var f=
|
||||
a.aoData[c[e].row];(!0===b&&f._selected_cells&&!0===f._selected_cells[c[e].column]||!(!1!==b||f._selected_cells&&f._selected_cells[c[e].column]))&&d.push(c[e])}return d});var w=m.Api.register,x=m.Api.registerPlural;w("select()",function(){return this.iterator("table",function(a){m.select.init(new m.Api(a))})});w("select.blurable()",function(a){return a===l?this.context[0]._select.blurable:this.iterator("table",function(b){b._select.blurable=a})});w("select.toggleable()",function(a){return a===l?this.context[0]._select.toggleable:
|
||||
this.iterator("table",function(b){b._select.toggleable=a})});w("select.info()",function(a){return a===l?this.context[0]._select.info:this.iterator("table",function(b){b._select.info=a})});w("select.items()",function(a){return a===l?this.context[0]._select.items:this.iterator("table",function(b){b._select.items=a;u(new m.Api(b),"selectItems",[a])})});w("select.style()",function(a){return a===l?this.context[0]._select.style:this.iterator("table",function(b){b._select||m.select.init(new m.Api(b));b._select_init||
|
||||
O(b);b._select.style=a;var c=new m.Api(b);C(c);"api"!==a&&J(c);u(new m.Api(b),"selectStyle",[a])})});w("select.selector()",function(a){return a===l?this.context[0]._select.selector:this.iterator("table",function(b){C(new m.Api(b));b._select.selector=a;"api"!==b._select.style&&J(new m.Api(b))})});x("rows().select()","row().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("row",function(c,d){z(c);c.aoData[d]._select_selected=!0;h(c.aoData[d].nTr).addClass(c._select.className)});
|
||||
this.iterator("table",function(c,d){u(b,"select",["row",b[d]],!0)});return this});x("columns().select()","column().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("column",function(c,d){z(c);c.aoColumns[d]._select_selected=!0;d=(new m.Api(c)).column(d);h(d.header()).addClass(c._select.className);h(d.footer()).addClass(c._select.className);d.nodes().to$().addClass(c._select.className)});this.iterator("table",function(c,d){u(b,"select",["column",b[d]],!0)});return this});
|
||||
x("cells().select()","cell().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("cell",function(c,d,e){z(c);d=c.aoData[d];d._selected_cells===l&&(d._selected_cells=[]);d._selected_cells[e]=!0;d.anCells&&h(d.anCells[e]).addClass(c._select.className)});this.iterator("table",function(c,d){u(b,"select",["cell",b.cells(b[d]).indexes().toArray()],!0)});return this});x("rows().deselect()","row().deselect()",function(){var a=this;this.iterator("row",function(b,c){b.aoData[c]._select_selected=
|
||||
!1;b._select_lastCell=null;h(b.aoData[c].nTr).removeClass(b._select.className)});this.iterator("table",function(b,c){u(a,"deselect",["row",a[c]],!0)});return this});x("columns().deselect()","column().deselect()",function(){var a=this;this.iterator("column",function(b,c){b.aoColumns[c]._select_selected=!1;var d=new m.Api(b),e=d.column(c);h(e.header()).removeClass(b._select.className);h(e.footer()).removeClass(b._select.className);d.cells(null,c).indexes().each(function(g){var f=b.aoData[g.row],k=f._selected_cells;
|
||||
!f.anCells||k&&k[g.column]||h(f.anCells[g.column]).removeClass(b._select.className)})});this.iterator("table",function(b,c){u(a,"deselect",["column",a[c]],!0)});return this});x("cells().deselect()","cell().deselect()",function(){var a=this;this.iterator("cell",function(b,c,d){c=b.aoData[c];c._selected_cells!==l&&(c._selected_cells[d]=!1);c.anCells&&!b.aoColumns[d]._select_selected&&h(c.anCells[d]).removeClass(b._select.className)});this.iterator("table",function(b,c){u(a,"deselect",["cell",a[c]],
|
||||
!0)});return this});var H=0;h.extend(m.ext.buttons,{selected:{text:A("selected","Selected"),className:"buttons-selected",limitTo:["rows","columns","cells"],init:function(a,b,c){var d=this;c._eventNamespace=".select"+H++;a.on(F(c),function(){d.enable(P(a,c))});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}},selectedSingle:{text:A("selectedSingle","Selected single"),className:"buttons-selected-single",init:function(a,b,c){var d=this;c._eventNamespace=".select"+H++;a.on(F(c),function(){var e=
|
||||
a.rows({selected:!0}).flatten().length+a.columns({selected:!0}).flatten().length+a.cells({selected:!0}).flatten().length;d.enable(1===e)});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}},selectAll:{text:A("selectAll","Select all"),className:"buttons-select-all",action:function(){this[this.select.items()+"s"]().select()}},selectNone:{text:A("selectNone","Deselect all"),className:"buttons-select-none",action:function(){z(this.settings()[0],!0)},init:function(a,b,c){var d=this;c._eventNamespace=
|
||||
".select"+H++;a.on(F(c),function(){var e=a.rows({selected:!0}).flatten().length+a.columns({selected:!0}).flatten().length+a.cells({selected:!0}).flatten().length;d.enable(0<e)});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}}});h.each(["Row","Column","Cell"],function(a,b){var c=b.toLowerCase();m.ext.buttons["select"+b+"s"]={text:A("select"+b+"s","Select "+c+"s"),className:"buttons-select-"+c+"s",action:function(){this.select.items(c)},init:function(d){var e=this;d.on("selectItems.dt.DT",
|
||||
function(g,f,k){e.active(k===c)})}}});h(v).on("preInit.dt.dtSelect",function(a,b){"dt"===a.namespace&&m.select.init(new m.Api(b))});return m.select});
|
||||
24
public_html/assets/datatables/js/jquery.dataTables.custom.js
Normal file
24
public_html/assets/datatables/js/jquery.dataTables.custom.js
Normal file
@@ -0,0 +1,24 @@
|
||||
$.fn.extend($.fn.dataTableExt.oSort, {
|
||||
"non-empty-string-asc": function (str1, str2) {
|
||||
if (str1 === "") {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (str2 === "") {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return str1 < str2 ? -1 : (str1 > str2 ? 1 : 0);
|
||||
},
|
||||
"non-empty-string-desc": function (str1, str2) {
|
||||
if (str1 === "") {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (str2 === "") {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return str1 < str2 ? 1 : (str1 > str2 ? -1 : 0);
|
||||
}
|
||||
});
|
||||
15421
public_html/assets/datatables/js/jquery.dataTables.min.js
vendored
15421
public_html/assets/datatables/js/jquery.dataTables.min.js
vendored
File diff suppressed because it is too large
Load Diff
5
public_html/assets/datatables/js/select.bootstrap.min.js
vendored
Normal file
5
public_html/assets/datatables/js/select.bootstrap.min.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/*!
|
||||
Bootstrap 3 styling wrapper for Select
|
||||
©2018 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-select"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs")(a,b).$);b.fn.dataTable.select||require("datatables.net-select")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
|
||||
11
public_html/assets/jquery/jquery.color.min.js
vendored
Normal file
11
public_html/assets/jquery/jquery.color.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
149
public_html/assets/jquery/jquery.color.svg-names.js
Normal file
149
public_html/assets/jquery/jquery.color.svg-names.js
Normal file
@@ -0,0 +1,149 @@
|
||||
/*!
|
||||
* jQuery Color Animations v@VERSION - SVG Color Names
|
||||
* https://github.com/jquery/jquery-color
|
||||
*
|
||||
* Remaining HTML/CSS color names per W3C's CSS Color Module Level 4 draft.
|
||||
* https://drafts.csswg.org/css-color-4/
|
||||
*
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: @DATE
|
||||
*/
|
||||
jQuery.extend( jQuery.Color.names, {
|
||||
|
||||
// 4.3. Extended color keywords (minus the basic ones in core color plugin)
|
||||
aliceblue: "#f0f8ff",
|
||||
antiquewhite: "#faebd7",
|
||||
aquamarine: "#7fffd4",
|
||||
azure: "#f0ffff",
|
||||
beige: "#f5f5dc",
|
||||
bisque: "#ffe4c4",
|
||||
blanchedalmond: "#ffebcd",
|
||||
blueviolet: "#8a2be2",
|
||||
brown: "#a52a2a",
|
||||
burlywood: "#deb887",
|
||||
cadetblue: "#5f9ea0",
|
||||
chartreuse: "#7fff00",
|
||||
chocolate: "#d2691e",
|
||||
coral: "#ff7f50",
|
||||
cornflowerblue: "#6495ed",
|
||||
cornsilk: "#fff8dc",
|
||||
crimson: "#dc143c",
|
||||
cyan: "#00ffff",
|
||||
darkblue: "#00008b",
|
||||
darkcyan: "#008b8b",
|
||||
darkgoldenrod: "#b8860b",
|
||||
darkgray: "#a9a9a9",
|
||||
darkgreen: "#006400",
|
||||
darkgrey: "#a9a9a9",
|
||||
darkkhaki: "#bdb76b",
|
||||
darkmagenta: "#8b008b",
|
||||
darkolivegreen: "#556b2f",
|
||||
darkorange: "#ff8c00",
|
||||
darkorchid: "#9932cc",
|
||||
darkred: "#8b0000",
|
||||
darksalmon: "#e9967a",
|
||||
darkseagreen: "#8fbc8f",
|
||||
darkslateblue: "#483d8b",
|
||||
darkslategray: "#2f4f4f",
|
||||
darkslategrey: "#2f4f4f",
|
||||
darkturquoise: "#00ced1",
|
||||
darkviolet: "#9400d3",
|
||||
deeppink: "#ff1493",
|
||||
deepskyblue: "#00bfff",
|
||||
dimgray: "#696969",
|
||||
dimgrey: "#696969",
|
||||
dodgerblue: "#1e90ff",
|
||||
firebrick: "#b22222",
|
||||
floralwhite: "#fffaf0",
|
||||
forestgreen: "#228b22",
|
||||
gainsboro: "#dcdcdc",
|
||||
ghostwhite: "#f8f8ff",
|
||||
gold: "#ffd700",
|
||||
goldenrod: "#daa520",
|
||||
greenyellow: "#adff2f",
|
||||
grey: "#808080",
|
||||
honeydew: "#f0fff0",
|
||||
hotpink: "#ff69b4",
|
||||
indianred: "#cd5c5c",
|
||||
indigo: "#4b0082",
|
||||
ivory: "#fffff0",
|
||||
khaki: "#f0e68c",
|
||||
lavender: "#e6e6fa",
|
||||
lavenderblush: "#fff0f5",
|
||||
lawngreen: "#7cfc00",
|
||||
lemonchiffon: "#fffacd",
|
||||
lightblue: "#add8e6",
|
||||
lightcoral: "#f08080",
|
||||
lightcyan: "#e0ffff",
|
||||
lightgoldenrodyellow: "#fafad2",
|
||||
lightgray: "#d3d3d3",
|
||||
lightgreen: "#90ee90",
|
||||
lightgrey: "#d3d3d3",
|
||||
lightpink: "#ffb6c1",
|
||||
lightsalmon: "#ffa07a",
|
||||
lightseagreen: "#20b2aa",
|
||||
lightskyblue: "#87cefa",
|
||||
lightslategray: "#778899",
|
||||
lightslategrey: "#778899",
|
||||
lightsteelblue: "#b0c4de",
|
||||
lightyellow: "#ffffe0",
|
||||
limegreen: "#32cd32",
|
||||
linen: "#faf0e6",
|
||||
magenta: "#ff00ff",
|
||||
mediumaquamarine: "#66cdaa",
|
||||
mediumblue: "#0000cd",
|
||||
mediumorchid: "#ba55d3",
|
||||
mediumpurple: "#9370db",
|
||||
mediumseagreen: "#3cb371",
|
||||
mediumslateblue: "#7b68ee",
|
||||
mediumspringgreen: "#00fa9a",
|
||||
mediumturquoise: "#48d1cc",
|
||||
mediumvioletred: "#c71585",
|
||||
midnightblue: "#191970",
|
||||
mintcream: "#f5fffa",
|
||||
mistyrose: "#ffe4e1",
|
||||
moccasin: "#ffe4b5",
|
||||
navajowhite: "#ffdead",
|
||||
oldlace: "#fdf5e6",
|
||||
olivedrab: "#6b8e23",
|
||||
orange: "#ffa500",
|
||||
orangered: "#ff4500",
|
||||
orchid: "#da70d6",
|
||||
palegoldenrod: "#eee8aa",
|
||||
palegreen: "#98fb98",
|
||||
paleturquoise: "#afeeee",
|
||||
palevioletred: "#db7093",
|
||||
papayawhip: "#ffefd5",
|
||||
peachpuff: "#ffdab9",
|
||||
peru: "#cd853f",
|
||||
pink: "#ffc0cb",
|
||||
plum: "#dda0dd",
|
||||
powderblue: "#b0e0e6",
|
||||
rebeccapurple: "#663399",
|
||||
rosybrown: "#bc8f8f",
|
||||
royalblue: "#4169e1",
|
||||
saddlebrown: "#8b4513",
|
||||
salmon: "#fa8072",
|
||||
sandybrown: "#f4a460",
|
||||
seagreen: "#2e8b57",
|
||||
seashell: "#fff5ee",
|
||||
sienna: "#a0522d",
|
||||
skyblue: "#87ceeb",
|
||||
slateblue: "#6a5acd",
|
||||
slategray: "#708090",
|
||||
slategrey: "#708090",
|
||||
snow: "#fffafa",
|
||||
springgreen: "#00ff7f",
|
||||
steelblue: "#4682b4",
|
||||
tan: "#d2b48c",
|
||||
thistle: "#d8bfd8",
|
||||
tomato: "#ff6347",
|
||||
turquoise: "#40e0d0",
|
||||
violet: "#ee82ee",
|
||||
wheat: "#f5deb3",
|
||||
whitesmoke: "#f5f5f5",
|
||||
yellowgreen: "#9acd32"
|
||||
} );
|
||||
File diff suppressed because one or more lines are too long
@@ -1,3 +1,7 @@
|
||||
span.tox-statusbar__branding {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.tox-tinymce-aux {
|
||||
z-index: 10008;
|
||||
}
|
||||
370
public_html/assets/tinymce/langs/it_IT.js
Normal file
370
public_html/assets/tinymce/langs/it_IT.js
Normal file
@@ -0,0 +1,370 @@
|
||||
tinymce.addI18n('it_IT',{
|
||||
"Redo": "Ripristina",
|
||||
"Undo": "Annulla",
|
||||
"Cut": "Taglia",
|
||||
"Copy": "Copia",
|
||||
"Paste": "Incolla",
|
||||
"Select all": "Seleziona tutto",
|
||||
"New document": "Nuovo documento",
|
||||
"Ok": "OK",
|
||||
"Cancel": "Annulla",
|
||||
"Visual aids": "Aiuti visivi",
|
||||
"Bold": "Grassetto",
|
||||
"Italic": "Corsivo",
|
||||
"Underline": "Sottolineato",
|
||||
"Strikethrough": "Barrato",
|
||||
"Superscript": "Apice",
|
||||
"Subscript": "Pedice",
|
||||
"Clear formatting": "Cancella la formattazione",
|
||||
"Align left": "Allinea a sinistra",
|
||||
"Align center": "Allinea al centro",
|
||||
"Align right": "Allinea a destra",
|
||||
"Justify": "Giustifica",
|
||||
"Bullet list": "Elenco puntato",
|
||||
"Numbered list": "Elenco numerato",
|
||||
"Decrease indent": "Riduci rientro",
|
||||
"Increase indent": "Aumenta rientro",
|
||||
"Close": "Chiudi",
|
||||
"Formats": "Formati",
|
||||
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Il browser non supporta l'accesso diretto alla cartella degli appunti. Usare i tasti di scelta rapida Ctrl+X\/C\/V.",
|
||||
"Headers": "Intestazioni",
|
||||
"Header 1": "Intestazione 1",
|
||||
"Header 2": "Intestazione 2",
|
||||
"Header 3": "Intestazione 3",
|
||||
"Header 4": "Intestazione 4",
|
||||
"Header 5": "Intestazione 5",
|
||||
"Header 6": "Intestazione 6",
|
||||
"Headings": "Titoli",
|
||||
"Heading 1": "Titolo 1",
|
||||
"Heading 2": "Titolo 2",
|
||||
"Heading 3": "Titolo 3",
|
||||
"Heading 4": "Titolo 4",
|
||||
"Heading 5": "Titolo 5",
|
||||
"Heading 6": "Titolo 6",
|
||||
"Preformatted": "Preformattato",
|
||||
"Div": "Div",
|
||||
"Pre": "Pre",
|
||||
"Code": "Codice",
|
||||
"Paragraph": "Paragrafo",
|
||||
"Blockquote": "Blockquote",
|
||||
"Inline": "In linea",
|
||||
"Blocks": "Blocchi",
|
||||
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Incolla \u00e8 in modalit\u00e0 testo normale. I contenuti saranno incollati come testo normale se non viene disattivata questa opzione.",
|
||||
"Fonts": "Caratteri",
|
||||
"Font Sizes": "Dimensioni caratteri",
|
||||
"Class": "Classe",
|
||||
"Browse for an image": "Cerca un'immagine",
|
||||
"OR": "OPPURE",
|
||||
"Drop an image here": "Rilasciare un'immagine qui",
|
||||
"Upload": "Carica",
|
||||
"Block": "Blocco",
|
||||
"Align": "Allinea",
|
||||
"Default": "Predefinito",
|
||||
"Circle": "Circolo",
|
||||
"Disc": "Disco",
|
||||
"Square": "Quadrato",
|
||||
"Lower Alpha": "Alfabetico minuscolo",
|
||||
"Lower Greek": "Greco minuscolo",
|
||||
"Lower Roman": "Romano minuscolo",
|
||||
"Upper Alpha": "Alfabetico maiuscolo",
|
||||
"Upper Roman": "Romano maiuscolo",
|
||||
"Anchor...": "Ancoraggio...",
|
||||
"Name": "Nome",
|
||||
"Id": "ID",
|
||||
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "L'ID dovrebbe cominciare con una lettera, seguita unicamente da lettere, numeri, linee, punti, due punti o caratteri di sottolineatura.",
|
||||
"You have unsaved changes are you sure you want to navigate away?": "Ci sono modifiche non salvate, si \u00e8 sicuro di volere uscire?",
|
||||
"Restore last draft": "Ripristina l'ultima bozza",
|
||||
"Special characters...": "Caratteri speciali...",
|
||||
"Source code": "Codice sorgente",
|
||||
"Insert\/Edit code sample": "Inserisci\/modifica esempio di codice",
|
||||
"Language": "Lingua",
|
||||
"Code sample...": "Esempio di codice...",
|
||||
"Color Picker": "Selezione colori",
|
||||
"R": "R",
|
||||
"G": "G",
|
||||
"B": "B",
|
||||
"Left to right": "Da sinistra a destra",
|
||||
"Right to left": "Da destra a sinistra",
|
||||
"Emoticons...": "Emoticon...",
|
||||
"Metadata and Document Properties": "Metadata e propriet\u00e0 del documento",
|
||||
"Title": "Titolo",
|
||||
"Keywords": "Parole chiave",
|
||||
"Description": "Descrizione",
|
||||
"Robots": "Robot",
|
||||
"Author": "Autore",
|
||||
"Encoding": "Codifica",
|
||||
"Fullscreen": "A tutto schermo",
|
||||
"Action": "Azione",
|
||||
"Shortcut": "Collegamento",
|
||||
"Help": "Guida",
|
||||
"Address": "Indirizzo",
|
||||
"Focus to menubar": "Imposta stato attivo per la barra dei menu",
|
||||
"Focus to toolbar": "Imposta stato attivo per la barra degli strumenti",
|
||||
"Focus to element path": "Imposta stato attivo per il percorso dell'elemento",
|
||||
"Focus to contextual toolbar": "Imposta stato attivo per la barra degli strumenti contestuale",
|
||||
"Insert link (if link plugin activated)": "Inserisci un collegamento (se \u00e8 attivato l'apposito plugin)",
|
||||
"Save (if save plugin activated)": "Salva (se \u00e8 attivato l'apposito plugin)",
|
||||
"Find (if searchreplace plugin activated)": "Trova (se \u00e8 attivato l'apposito plugin)",
|
||||
"Plugins installed ({0}):": "Plugin installati ({0}):",
|
||||
"Premium plugins:": "Plugin Premium:",
|
||||
"Learn more...": "Maggiori informazioni...",
|
||||
"You are using {0}": "Si sta utilizzando {0}",
|
||||
"Plugins": "Plugin",
|
||||
"Handy Shortcuts": "Scorciatoie utili",
|
||||
"Horizontal line": "Linea orizzontale",
|
||||
"Insert\/edit image": "Inserisci\/modifica immagine",
|
||||
"Image description": "Descrizione immagine",
|
||||
"Source": "Fonte",
|
||||
"Dimensions": "Dimensioni",
|
||||
"Constrain proportions": "Mantieni proporzioni",
|
||||
"General": "Generali",
|
||||
"Advanced": "Avanzate",
|
||||
"Style": "Stile",
|
||||
"Vertical space": "Spazio verticale",
|
||||
"Horizontal space": "Spazio orizzontale",
|
||||
"Border": "Bordo",
|
||||
"Insert image": "Inserisci immagine",
|
||||
"Image...": "Immagine...",
|
||||
"Image list": "Elenco immagini",
|
||||
"Rotate counterclockwise": "Ruota in senso antiorario",
|
||||
"Rotate clockwise": "Ruota in senso orario",
|
||||
"Flip vertically": "Rifletti verticalmente",
|
||||
"Flip horizontally": "Rifletti orizzontalmente",
|
||||
"Edit image": "Modifica immagine",
|
||||
"Image options": "Opzioni immagine",
|
||||
"Zoom in": "Ingrandisci",
|
||||
"Zoom out": "Zoom indietro",
|
||||
"Crop": "Ritaglia",
|
||||
"Resize": "Ridimensiona",
|
||||
"Orientation": "Orientamento",
|
||||
"Brightness": "Luminosit\u00e0",
|
||||
"Sharpen": "Nitidezza",
|
||||
"Contrast": "Contrasto",
|
||||
"Color levels": "Livelli di colore",
|
||||
"Gamma": "Gamma",
|
||||
"Invert": "Inverti",
|
||||
"Apply": "Applica",
|
||||
"Back": "Indietro",
|
||||
"Insert date\/time": "Inserisci data\/ora",
|
||||
"Date\/time": "Data\/ora",
|
||||
"Insert\/Edit Link": "Inserisci\/modifica collegamento",
|
||||
"Insert\/edit link": "Inserisci\/modifica collegamento",
|
||||
"Text to display": "Testo da visualizzare",
|
||||
"Url": "URL",
|
||||
"Open link in...": "Apri collegamento in...",
|
||||
"Current window": "Finestra corrente",
|
||||
"None": "Nessuno",
|
||||
"New window": "Nuova finestra",
|
||||
"Remove link": "Rimuovi collegamento",
|
||||
"Anchors": "Ancoraggi",
|
||||
"Link...": "Collegamento...",
|
||||
"Paste or type a link": "Incolla o digita un collegamento",
|
||||
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "L'URL inserito sembra essere un indirizzo email. Si vuole aggiungere il necessario prefisso mailto:?",
|
||||
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "L'URL inserito sembra essere un collegamento esterno. Si vuole aggiungere il necessario prefisso http:\/\/?",
|
||||
"Link list": "Elenco collegamenti",
|
||||
"Insert video": "Inserisci video",
|
||||
"Insert\/edit video": "Inserisci\/modifica video",
|
||||
"Insert\/edit media": "Inserisci\/modifica oggetti multimediali",
|
||||
"Alternative source": "Sorgente alternativa",
|
||||
"Alternative source URL": "URL sorgente alternativa",
|
||||
"Media poster (Image URL)": "Poster dell'oggetto multimediale (URL dell'immagine)",
|
||||
"Paste your embed code below:": "Incolla il codice d'incorporamento di seguito:",
|
||||
"Embed": "Incorpora",
|
||||
"Media...": "Oggetto multimediale...",
|
||||
"Nonbreaking space": "Spazio indivisibile",
|
||||
"Page break": "Interruzione di pagina",
|
||||
"Paste as text": "Incolla senza formattazioni",
|
||||
"Preview": "Anteprima",
|
||||
"Print...": "Stampa...",
|
||||
"Save": "Salva",
|
||||
"Find": "Trova",
|
||||
"Replace with": "Sostituisci con",
|
||||
"Replace": "Sostituisci",
|
||||
"Replace all": "Sostituisci tutto",
|
||||
"Previous": "Indietro",
|
||||
"Next": "Avanti",
|
||||
"Find and replace...": "Trova e sostituisci...",
|
||||
"Could not find the specified string.": "Impossibile trovare la stringa specificata.",
|
||||
"Match case": "Maiuscole\/minuscole",
|
||||
"Find whole words only": "Trova solo parole intere",
|
||||
"Spell check": "Controllo ortografia",
|
||||
"Ignore": "Ignora",
|
||||
"Ignore all": "Ignora tutto",
|
||||
"Finish": "Fine",
|
||||
"Add to Dictionary": "Aggiungi al dizionario",
|
||||
"Insert table": "Inserisci tabella",
|
||||
"Table properties": "Propriet\u00e0 della tabella",
|
||||
"Delete table": "Elimina tabella",
|
||||
"Cell": "Cella",
|
||||
"Row": "Riga",
|
||||
"Column": "Colonna",
|
||||
"Cell properties": "Propriet\u00e0 cella",
|
||||
"Merge cells": "Unisci le celle",
|
||||
"Split cell": "Dividi la cella",
|
||||
"Insert row before": "Inserisci riga prima",
|
||||
"Insert row after": "Inserisci riga dopo",
|
||||
"Delete row": "Elimina riga",
|
||||
"Row properties": "Propriet\u00e0 della riga",
|
||||
"Cut row": "Taglia riga",
|
||||
"Copy row": "Copia riga",
|
||||
"Paste row before": "Incolla riga prima",
|
||||
"Paste row after": "Incolla riga dopo",
|
||||
"Insert column before": "Inserisci colonna prima",
|
||||
"Insert column after": "Inserisci colonna dopo",
|
||||
"Delete column": "Elimina colonna",
|
||||
"Cols": "Colonne",
|
||||
"Rows": "Righe",
|
||||
"Width": "Larghezza",
|
||||
"Height": "Altezza",
|
||||
"Cell spacing": "Spaziatura tra celle",
|
||||
"Cell padding": "Spaziatura interna celle",
|
||||
"Show caption": "Mostra didascalia",
|
||||
"Left": "Sinistra",
|
||||
"Center": "Centro",
|
||||
"Right": "Destra",
|
||||
"Cell type": "Tipo di cella",
|
||||
"Scope": "Ambito",
|
||||
"Alignment": "Allineamento",
|
||||
"H Align": "Allineamento H",
|
||||
"V Align": "Allineamento V",
|
||||
"Top": "In alto",
|
||||
"Middle": "Centrato",
|
||||
"Bottom": "In basso",
|
||||
"Header cell": "Cella d'intestazione",
|
||||
"Row group": "Gruppo di righe",
|
||||
"Column group": "Gruppo di colonne",
|
||||
"Row type": "Tipo di riga",
|
||||
"Header": "Intestazione",
|
||||
"Body": "Corpo",
|
||||
"Footer": "Pi\u00e8 di pagina",
|
||||
"Border color": "Colore del bordo",
|
||||
"Insert template...": "Inserisci modello...",
|
||||
"Templates": "Modelli",
|
||||
"Template": "Modello",
|
||||
"Text color": "Colore testo",
|
||||
"Background color": "Colore dello sfondo",
|
||||
"Custom...": "Personalizzato...",
|
||||
"Custom color": "Colore personalizzato",
|
||||
"No color": "Nessun colore",
|
||||
"Remove color": "Rimuovi colore",
|
||||
"Table of Contents": "Sommario",
|
||||
"Show blocks": "Mostra blocchi",
|
||||
"Show invisible characters": "Mostra caratteri invisibili",
|
||||
"Word count": "Conteggio parole",
|
||||
"Words: {0}": "Parole: {0}",
|
||||
"{0} words": "{0} parole",
|
||||
"File": "File",
|
||||
"Edit": "Modifica",
|
||||
"Insert": "Inserisci",
|
||||
"View": "Visualizza",
|
||||
"Format": "Formato",
|
||||
"Table": "Tabella",
|
||||
"Tools": "Strumenti",
|
||||
"Powered by {0}": "Con tecnologia {0}",
|
||||
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Area di testo RTF. Premere ALT-F9 per il menu. Premere ALT-F10 per la barra degli strumenti. Premere ALT-0 per la guida.",
|
||||
"Image title": "Titolo immagine",
|
||||
"Border width": "Larghezza del bordo",
|
||||
"Border style": "Stile del bordo",
|
||||
"Error": "Errore",
|
||||
"Warn": "Avviso",
|
||||
"Valid": "Valido",
|
||||
"To open the popup, press Shift+Enter": "Per aprire il popup, premere Shift+Invio",
|
||||
"Rich Text Area. Press ALT-0 for help.": "Area di testo RTF. Premere ALT-0 per la guida.",
|
||||
"System Font": "Carattere di sistema",
|
||||
"Failed to upload image: {0}": "Caricamento immagine fallito: {0}",
|
||||
"Failed to load plugin: {0} from url {1}": "Caricamento plugin fallito: {0} dall'URL {1}",
|
||||
"Failed to load plugin url: {0}": "Caricamento URL plugin fallito: {0}",
|
||||
"Failed to initialize plugin: {0}": "Inizializzazione plugin fallita: {0}",
|
||||
"example": "esempio",
|
||||
"Search": "Cerca",
|
||||
"All": "Tutto",
|
||||
"Currency": "Valuta",
|
||||
"Text": "Testo",
|
||||
"Quotations": "Citazioni",
|
||||
"Mathematical": "Caratteri matematici",
|
||||
"Extended Latin": "Latino esteso",
|
||||
"Symbols": "Simboli",
|
||||
"Arrows": "Frecce",
|
||||
"User Defined": "Definito dall'utente",
|
||||
"dollar sign": "simbolo del dollaro",
|
||||
"currency sign": "simbolo di valuta",
|
||||
"euro-currency sign": "simbolo dell'euro",
|
||||
"colon sign": "simbolo del col\u00f3n",
|
||||
"cruzeiro sign": "simbolo del cruzeiro",
|
||||
"french franc sign": "simbolo del franco francese",
|
||||
"lira sign": "simbolo della lira",
|
||||
"mill sign": "simbolo del mill",
|
||||
"naira sign": "simbolo della naira",
|
||||
"peseta sign": "simbolo della peseta",
|
||||
"rupee sign": "simbolo della rup\u00eca",
|
||||
"won sign": "simbolo del won",
|
||||
"new sheqel sign": "simbolo del nuovo shekel",
|
||||
"dong sign": "simbolo del dong",
|
||||
"kip sign": "simbolo del kip",
|
||||
"tugrik sign": "simbolo del tugrik",
|
||||
"drachma sign": "simbolo della dracma",
|
||||
"german penny symbol": "simbolo del pfennig tedesco",
|
||||
"peso sign": "simbolo del peso",
|
||||
"guarani sign": "simbolo del guaran\u00ec",
|
||||
"austral sign": "simbolo dell'austral",
|
||||
"hryvnia sign": "simbolo della hryvnia",
|
||||
"cedi sign": "simbolo del cedi",
|
||||
"livre tournois sign": "simbolo della lira di Tours",
|
||||
"spesmilo sign": "simbolo dello spesmilo",
|
||||
"tenge sign": "simbolo del tenge",
|
||||
"indian rupee sign": "simbolo della rup\u00eca indiana",
|
||||
"turkish lira sign": "simbolo della lira turca",
|
||||
"nordic mark sign": "simbolo del marco nordico",
|
||||
"manat sign": "simbolo del manat",
|
||||
"ruble sign": "simbolo del rublo",
|
||||
"yen character": "simbolo dello yen",
|
||||
"yuan character": "simbolo dello yuan",
|
||||
"yuan character, in hong kong and taiwan": "simbolo dello yuan, Hong Kong e Taiwan",
|
||||
"yen\/yuan character variant one": "simbolo yen\/yuan variante uno",
|
||||
"Loading emoticons...": "Caricamento emoticon in corso",
|
||||
"Could not load emoticons": "Impossibile caricare emoticon",
|
||||
"People": "Persone",
|
||||
"Animals and Nature": "Animali e natura",
|
||||
"Food and Drink": "Cibi e bevande",
|
||||
"Activity": "Attivit\u00e0",
|
||||
"Travel and Places": "Viaggi e luoghi",
|
||||
"Objects": "Oggetti",
|
||||
"Flags": "Bandiere",
|
||||
"Characters": "Caratteri",
|
||||
"Characters (no spaces)": "Caratteri (senza spazi)",
|
||||
"Error: Form submit field collision.": "Errore: Conflitto di campi nel modulo inviato.",
|
||||
"Error: No form element found.": "Errore: Nessun elemento di modulo trovato.",
|
||||
"Update": "Aggiorna",
|
||||
"Color swatch": "Campione di colore",
|
||||
"Turquoise": "Turchese",
|
||||
"Green": "Verde",
|
||||
"Blue": "Blu",
|
||||
"Purple": "Viola",
|
||||
"Navy Blue": "Blu scuro",
|
||||
"Dark Turquoise": "Turchese scuro",
|
||||
"Dark Green": "Verde scuro",
|
||||
"Medium Blue": "Blu medio",
|
||||
"Medium Purple": "Viola medio",
|
||||
"Midnight Blue": "Blu notte",
|
||||
"Yellow": "Giallo",
|
||||
"Orange": "Arancio",
|
||||
"Red": "Rosso",
|
||||
"Light Gray": "Grigio chiaro",
|
||||
"Gray": "Grigio",
|
||||
"Dark Yellow": "Giallo scuro",
|
||||
"Dark Orange": "Arancio scuro",
|
||||
"Dark Red": "Rosso scuro",
|
||||
"Medium Gray": "Grigio medio",
|
||||
"Dark Gray": "Grigio scuro",
|
||||
"Black": "Nero",
|
||||
"White": "Bianco",
|
||||
"Switch to or from fullscreen mode": "Attiva\/disattiva la modalit\u00e0 schermo intero",
|
||||
"Open help dialog": "Apri la finestra di aiuto",
|
||||
"history": "cronologia",
|
||||
"styles": "stili",
|
||||
"formatting": "formattazione",
|
||||
"alignment": "allineamento",
|
||||
"indentation": "indentazione",
|
||||
"permanent pen": "penna indelebile",
|
||||
"comments": "commenti"
|
||||
});
|
||||
31
public_html/associazione_report.php
Normal file
31
public_html/associazione_report.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
session_start();
|
||||
include "functions.php";
|
||||
require_once "include_login.php";
|
||||
include "config.php";
|
||||
include "include/module.php";
|
||||
|
||||
include Controller::current_mainClasspath();
|
||||
include Controller::current_gestpath_include("ajax.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<!--html manifest="manifest.appcache"-->
|
||||
<html>
|
||||
<head>
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,17 +15,17 @@ include Controller::current_gestpath_include("ajax.php");
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if(!PVM\CurrentModule::isAuthorizedToCurrentUser()){
|
||||
include pvm_unauthorized;
|
||||
} else{
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,82 +1,114 @@
|
||||
<?php
|
||||
class Azienda{
|
||||
|
||||
class Azienda {
|
||||
private static $datiAzienda = null;
|
||||
|
||||
private static function getDatiAzienda(){
|
||||
if(is_null(self::$datiAzienda)){
|
||||
|
||||
private static function getDatiAzienda() {
|
||||
if (is_null(self::$datiAzienda)) {
|
||||
$Query = new Query;
|
||||
$Query->select("nome_ditta AS nome_azienda", "indirizzo", "cap", "citta", "prov", "e_mail")->from("azienda");
|
||||
$Query->select("nome_ditta AS nome_azienda", "indirizzo", "cap", "citta", "prov", "e_mail", "part_iva", "num_tel")->from("azienda");
|
||||
$Ret = $Query->firstRow()->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
self::$datiAzienda = $Ret->get_data();
|
||||
}
|
||||
}
|
||||
return self::$datiAzienda;
|
||||
}
|
||||
|
||||
private static function getKeyValue($key){
|
||||
|
||||
private static function getKeyValue($key) {
|
||||
$datiAzienda = self::getDatiAzienda();
|
||||
if(!is_null($datiAzienda) && array_key_exists($key, $datiAzienda)){
|
||||
if (!is_null($datiAzienda) && array_key_exists($key, $datiAzienda)) {
|
||||
return $datiAzienda[$key];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getNomeAzienda(){
|
||||
|
||||
public static function getNomeAzienda() {
|
||||
return self::getKeyValue("nome_azienda");
|
||||
}
|
||||
|
||||
public static function getIndirizzo(){
|
||||
|
||||
public static function getIndirizzo() {
|
||||
return self::getKeyValue("indirizzo");
|
||||
}
|
||||
|
||||
public static function getCitta(){
|
||||
|
||||
public static function getCitta() {
|
||||
return self::getKeyValue("citta");
|
||||
}
|
||||
|
||||
public static function getProv(){
|
||||
|
||||
public static function getProv() {
|
||||
return self::getKeyValue("prov");
|
||||
}
|
||||
|
||||
public static function getEmail(){
|
||||
|
||||
public static function getEmail() {
|
||||
return self::getKeyValue("e_mail");
|
||||
}
|
||||
|
||||
public static function getLatLng(){
|
||||
|
||||
public static function getPartIva() {
|
||||
return self::getKeyValue("part_iva");
|
||||
}
|
||||
|
||||
public static function getNumTel() {
|
||||
return self::getKeyValue("num_tel");
|
||||
}
|
||||
|
||||
public static function getLatLng() {
|
||||
$datiAzienda = self::getDatiAzienda();
|
||||
$location = Utility\Str::format_indirizzoCompleto($datiAzienda);
|
||||
$Ret = \Utility\Geo::rawAddressToLatLng($location);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
if(isset($retData["lat"]) && isset($retData["lng"])){
|
||||
if (isset($retData["lat"]) && isset($retData["lng"])) {
|
||||
return $retData;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getProfileDb(){
|
||||
|
||||
public static function getProfileDb() {
|
||||
return \User::get_current_profileDb();
|
||||
}
|
||||
|
||||
public static function getId(){
|
||||
|
||||
public static function getId() {
|
||||
return \Config::get_azienda();
|
||||
}
|
||||
|
||||
public static function getLogo(){
|
||||
|
||||
public static function getLogo() {
|
||||
return \AziendaUtils::getLogo(self::getProfileDb());
|
||||
}
|
||||
|
||||
public static function getPathHome($fileName = ""){
|
||||
|
||||
public static function getPathHome($fileName = "") {
|
||||
return AziendaUtils::getPathHome(Config::get_azienda(), $fileName);
|
||||
}
|
||||
|
||||
public static function getPathHomeCurrentModulo($fileName = ""){
|
||||
|
||||
public static function getPathHomeCurrentModulo($fileName = "") {
|
||||
$moduloName = \Controller::current_module();
|
||||
return self::getPathHome().$moduloName."/".$fileName;
|
||||
return self::getPathHome() . $moduloName . "/" . $fileName;
|
||||
}
|
||||
|
||||
public static function hasModulo($idModulo){
|
||||
|
||||
public static function hasModulo($idModulo) {
|
||||
return !is_null(AziendaUtils::getModulo($idModulo));
|
||||
}
|
||||
|
||||
public static function getWidgets() {
|
||||
$widgetsPath = self::getPathHome("widgets");
|
||||
$widgets = array();
|
||||
if (file_exists($widgetsPath) && is_dir($widgetsPath)) {
|
||||
$widgets = scandir($widgetsPath);
|
||||
$widgets = array_filter($widgets, function ($widgetPath) {
|
||||
return $widgetPath != "." && $widgetPath != "..";
|
||||
});
|
||||
$widgets = array_map(function ($widget) use ($widgetsPath) {
|
||||
$configPath = $widgetsPath . DIRECTORY_SEPARATOR . $widget . DIRECTORY_SEPARATOR . "config.json";
|
||||
$configs = file_exists($configPath) ? @json_decode(file_get_contents($configPath), true) : null;
|
||||
return array(
|
||||
"id" => snakeCaseEncode($widget),
|
||||
"widget" => $widget,
|
||||
"configs" => $configs,
|
||||
"path" => $widgetsPath . DIRECTORY_SEPARATOR . $widget,
|
||||
"module" => "tasks_launcher"
|
||||
);
|
||||
}, $widgets);
|
||||
}
|
||||
return $widgets;
|
||||
}
|
||||
}
|
||||
@@ -1,71 +1,74 @@
|
||||
<?php
|
||||
class AziendaUtils{
|
||||
|
||||
public static function getLogo($profileDB){
|
||||
|
||||
class AziendaUtils {
|
||||
|
||||
public static function getLogo($profileDB) {
|
||||
$logoAziendaConfig = Config::get_logoAzienda($profileDB);
|
||||
$aziendaMain = Config::get_azienda($profileDB);
|
||||
if(is_null($logoAziendaConfig)){
|
||||
if (is_null($logoAziendaConfig)) {
|
||||
$profileDB = Config::get_azienda();
|
||||
}
|
||||
$azienda = $profileDB;
|
||||
$fileName = if_null(Config::get_logoAzienda($azienda), "logo_azienda.png");
|
||||
$filePath = str_replace(DIRECTORY_SEPARATOR, "/", self::getPathHome($aziendaMain, "images")."/".$fileName);
|
||||
return file_exists($filePath) ? $filePath: null;
|
||||
$filePath = str_replace(DIRECTORY_SEPARATOR, "/", self::getPathHome($aziendaMain, "images") . "/" . $fileName);
|
||||
return file_exists($filePath) ? $filePath : null;
|
||||
}
|
||||
|
||||
public static function getPathHome($azienda, $fileName = ""){
|
||||
|
||||
public static function getPathHome($azienda, $fileName = "") {
|
||||
$azienda = is_null($azienda) ? Config::get_azienda() : $azienda;
|
||||
return "config_aziende".DIRECTORY_SEPARATOR.strtoupper($azienda).DIRECTORY_SEPARATOR.$fileName;
|
||||
return "config_aziende" . DIRECTORY_SEPARATOR . strtoupper($azienda) . DIRECTORY_SEPARATOR . $fileName;
|
||||
}
|
||||
|
||||
public static function getModuli($azienda = null){// echopre(debug_backtrace());
|
||||
|
||||
public static function getModuli($azienda = null) {// echopre(debug_backtrace());
|
||||
$arr_moduliAzienda = self::getModuliFromConfig($azienda);
|
||||
$arr_moduliStandard = PVM\ModuloUtils::getModuliStandard();
|
||||
foreach($arr_moduliStandard as $moduloStandard){ // evito il ripetersi di eventuali gestioni gia definite
|
||||
foreach ($arr_moduliStandard as $moduloStandard) { // evito il ripetersi di eventuali gestioni gia definite
|
||||
$idModulo = $moduloStandard["name"];
|
||||
$result = from($arr_moduliAzienda)->where(function($x) use($idModulo){ return $x["name"] == $idModulo;})->count();
|
||||
if($result==0){
|
||||
$result = from($arr_moduliAzienda)->where(function ($x) use ($idModulo) {
|
||||
return $x["name"] == $idModulo;
|
||||
})->count();
|
||||
if ($result == 0) {
|
||||
$arr_moduliAzienda[] = $moduloStandard;
|
||||
}
|
||||
}
|
||||
return $arr_moduliAzienda;
|
||||
}
|
||||
|
||||
public static function getModulo($idModulo, $azienda = null){
|
||||
|
||||
public static function getModulo($idModulo, $azienda = null) {
|
||||
$arr_moduli = self::getModuli($azienda);
|
||||
foreach($arr_moduli as $modulo){
|
||||
if($modulo["name"]===$idModulo){
|
||||
foreach ($arr_moduli as $modulo) {
|
||||
if ($modulo["name"] === $idModulo) {
|
||||
return $modulo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getIdModuliFromConfig($azienda = null){
|
||||
|
||||
public static function getIdModuliFromConfig($azienda = null) {
|
||||
return array_column(self::getModuliFromConfig($azienda), "name");
|
||||
}
|
||||
|
||||
public static function getModuliFromConfig($azienda = null){
|
||||
|
||||
public static function getModuliFromConfig($azienda = null) {
|
||||
$azienda = is_null($azienda) ? Config::get_azienda() : $azienda;
|
||||
if(!is_null($azienda)){
|
||||
if (!is_null($azienda)) {
|
||||
$idx = "moduliAzienda{$azienda}";
|
||||
|
||||
if(!isset($GLOBALS[$idx])){
|
||||
|
||||
if (!isset($GLOBALS[$idx])) {
|
||||
$ret = array();
|
||||
$moduleConfigFileAzienda = AziendaUtils::getPathHome($azienda, "gestioni.json");
|
||||
if(file_exists($moduleConfigFileAzienda)){
|
||||
if (file_exists($moduleConfigFileAzienda)) {
|
||||
$ret = json_decode(file_get_contents($moduleConfigFileAzienda), true);
|
||||
}
|
||||
|
||||
|
||||
//$ret[] = array("name" => "messenger", "group" => "NULL");
|
||||
|
||||
|
||||
|
||||
|
||||
$GLOBALS[$idx] = $ret;
|
||||
}
|
||||
|
||||
|
||||
return $GLOBALS[$idx];
|
||||
}
|
||||
|
||||
|
||||
return array();
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace BC;
|
||||
class Alert{
|
||||
class Alert {
|
||||
private $id = null;
|
||||
private $text = null;
|
||||
private $title = null;
|
||||
@@ -12,155 +13,162 @@ class Alert{
|
||||
private $columns = null; // 12
|
||||
private $offsetColumns = null; // 0
|
||||
private $size = null;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->info()->closeBtn(false);
|
||||
}
|
||||
|
||||
public function _class($v){
|
||||
if(is_array($v)){
|
||||
|
||||
public function _class($v) {
|
||||
if (is_array($v)) {
|
||||
$this->class = array_merge($this->class, $v);
|
||||
} else{
|
||||
} else {
|
||||
$this->class[] = $v;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function css($property, $v){
|
||||
|
||||
public function css($property, $v) {
|
||||
$this->css[$property] = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function closeBtn($v = true){
|
||||
|
||||
public function closeBtn($v = true) {
|
||||
$this->closeBtn = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function icon($v){
|
||||
|
||||
public function icon($v) {
|
||||
$this->icon = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function sm(){
|
||||
|
||||
public function sm() {
|
||||
$this->size = "sm";
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function size($v){
|
||||
|
||||
public function size($v) {
|
||||
$this->columns = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function offset($v = null){
|
||||
|
||||
public function offset($v = null) {
|
||||
$this->offsetColumns = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function title($v){
|
||||
|
||||
public function title($v) {
|
||||
$this->title = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function message($v){ // alias text
|
||||
|
||||
public function message($v) { // alias text
|
||||
return $this->text($v);
|
||||
}
|
||||
|
||||
public function text($v){
|
||||
|
||||
public function text($v) {
|
||||
$this->text = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function success(){
|
||||
|
||||
public function success() {
|
||||
return $this->theme("success");
|
||||
}
|
||||
public function info(){
|
||||
|
||||
public function info() {
|
||||
return $this->theme("info");
|
||||
}
|
||||
public function warning(){
|
||||
|
||||
public function warning() {
|
||||
return $this->theme("warning");
|
||||
}
|
||||
public function danger(){
|
||||
|
||||
public function danger() {
|
||||
return $this->theme("danger");
|
||||
}
|
||||
public function primary(){
|
||||
|
||||
public function primary() {
|
||||
return $this->theme("primary");
|
||||
}
|
||||
public function secondary(){
|
||||
|
||||
public function secondary() {
|
||||
return $this->theme("secondary");
|
||||
}
|
||||
public function dark(){
|
||||
|
||||
public function dark() {
|
||||
return $this->theme("dark");
|
||||
}
|
||||
public function light(){
|
||||
|
||||
public function light() {
|
||||
return $this->theme("light");
|
||||
}
|
||||
|
||||
public function theme($v){
|
||||
|
||||
public function theme($v) {
|
||||
$this->theme = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTheme(){
|
||||
|
||||
public function getTheme() {
|
||||
return $this->theme;
|
||||
}
|
||||
|
||||
public function getId(){
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function id($v){
|
||||
|
||||
public function id($v) {
|
||||
$this->id = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function buildHtml(){
|
||||
$id = !is_null($this->id) ? "id='".$this->id."'" : "";
|
||||
|
||||
$this->_class("alert-".$this->theme);
|
||||
|
||||
|
||||
public function buildHtml() {
|
||||
$id = !is_null($this->id) ? "id='" . $this->id . "'" : "";
|
||||
|
||||
$this->_class("alert-" . $this->theme);
|
||||
|
||||
$columns = !is_null($this->columns) ? $this->columns : 12;
|
||||
$this->_class("col-sm-".$columns);
|
||||
|
||||
if(is_null($this->offsetColumns)){
|
||||
$offsetColumns = floor((12-$columns)/2);
|
||||
} else{
|
||||
$this->_class("col-sm-" . $columns);
|
||||
|
||||
if (is_null($this->offsetColumns)) {
|
||||
$offsetColumns = floor((12 - $columns) / 2);
|
||||
} else {
|
||||
$offsetColumns = $this->offsetColumns;
|
||||
}
|
||||
$this->_class("col-sm-offset-".$offsetColumns);
|
||||
|
||||
if(!is_null($this->size)){
|
||||
$this->_class("alert-".$this->size);
|
||||
$this->_class("col-sm-offset-" . $offsetColumns);
|
||||
|
||||
if (!is_null($this->size)) {
|
||||
$this->_class("alert-" . $this->size);
|
||||
}
|
||||
|
||||
$closeBtn = $this->closeBtn===true;
|
||||
if($closeBtn){
|
||||
|
||||
$closeBtn = $this->closeBtn === true;
|
||||
if ($closeBtn) {
|
||||
$this->_class("alert-dismissible");
|
||||
}
|
||||
|
||||
|
||||
$classes = implode(" ", $this->class);
|
||||
|
||||
|
||||
$style = "";
|
||||
foreach($this->css as $property => $value){
|
||||
foreach ($this->css as $property => $value) {
|
||||
$style .= "$property:$value;";
|
||||
}
|
||||
|
||||
$div = '<div '.$id.' class="alert text-left '.$classes.'" style="'.$style.'">';
|
||||
if($closeBtn){
|
||||
|
||||
$div = '<div ' . $id . ' class="alert text-left ' . $classes . '" style="' . $style . '">';
|
||||
if ($closeBtn) {
|
||||
$div .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span>×</span></button>';
|
||||
}
|
||||
if(!is_null($this->icon)){
|
||||
$div .= "<i class='fa fa-".$this->icon."'></i> ";
|
||||
if (!is_null($this->icon)) {
|
||||
$div .= "<i class='fa fa-" . $this->icon . "'></i> ";
|
||||
}
|
||||
if(!is_null($this->title)){
|
||||
$div .= "<strong>".$this->title."</strong><br/>";
|
||||
if (!is_null($this->title)) {
|
||||
$div .= "<strong>" . $this->title . "</strong><br/>";
|
||||
}
|
||||
|
||||
$div .= $this->text."</div>";
|
||||
|
||||
$div .= $this->text . "</div>";
|
||||
return \Utility\Str::remove_multiple_spaces($div);
|
||||
}
|
||||
|
||||
public function show(){
|
||||
|
||||
public function show() {
|
||||
echo $this->buildHtml();
|
||||
// echo htmlentities($this->buildHtml());
|
||||
// echo htmlentities($this->buildHtml());
|
||||
}
|
||||
}
|
||||
@@ -1,70 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace BC;
|
||||
class Icon{
|
||||
class Icon {
|
||||
private $classes = null;
|
||||
private $fa = null;
|
||||
private $type = null;
|
||||
|
||||
public function __construct(){
|
||||
// $this->regular();
|
||||
|
||||
public function __construct() {
|
||||
// $this->regular();
|
||||
}
|
||||
|
||||
public function classes($value){
|
||||
|
||||
public function classes($value) {
|
||||
$this->classes = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function fa($value){
|
||||
|
||||
public function fa($value) {
|
||||
$this->fa = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function type($value){
|
||||
|
||||
public function type($value) {
|
||||
$this->type = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function solid(){
|
||||
|
||||
public function solid() {
|
||||
return $this->type("s");
|
||||
}
|
||||
|
||||
public function regular(){
|
||||
|
||||
public function regular() {
|
||||
return $this->type("r");
|
||||
}
|
||||
|
||||
public static function show($options = null){
|
||||
|
||||
public static function show($options = null) {
|
||||
$Icon = new \BC\Icon;
|
||||
return $Icon->parseOptions($options)->render();
|
||||
}
|
||||
|
||||
private function parseOptions($options = null){
|
||||
if(!is_null($options)){
|
||||
if(array_key_exists("classes", $options)){
|
||||
|
||||
private function parseOptions($options = null) {
|
||||
if (!is_null($options)) {
|
||||
if (array_key_exists("classes", $options)) {
|
||||
$this->classes($options["classes"]);
|
||||
}
|
||||
if(array_key_exists("fa", $options)){
|
||||
if (array_key_exists("fa", $options)) {
|
||||
$this->fa($options["fa"]);
|
||||
}
|
||||
if(array_key_exists("r", $options)){
|
||||
if (array_key_exists("r", $options)) {
|
||||
$this->regular();
|
||||
}
|
||||
if(array_key_exists("s", $options)){
|
||||
if (array_key_exists("s", $options)) {
|
||||
$this->solid();
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render(){
|
||||
|
||||
public function render() {
|
||||
$class = "";
|
||||
if(!is_null($this->classes)){
|
||||
$class .= $this->classes." ";
|
||||
if (!is_null($this->classes)) {
|
||||
$class .= $this->classes . " ";
|
||||
}
|
||||
if(!is_null($this->type)){
|
||||
$class .= "fa".$this->type." ";
|
||||
if (!is_null($this->type)) {
|
||||
$class .= "fa" . $this->type . " ";
|
||||
}
|
||||
if(!is_null($this->fa)){
|
||||
$class .= "fa-".$this->fa." ";
|
||||
if (!is_null($this->fa)) {
|
||||
$class .= "fa-" . $this->fa . " ";
|
||||
}
|
||||
return "<i class='{$class}'></i>";
|
||||
}
|
||||
|
||||
@@ -1,54 +1,55 @@
|
||||
<?php // BootstrapComponents
|
||||
include "BC.Alert.class.php";
|
||||
class BC{
|
||||
|
||||
public static function show_progressBar($options){
|
||||
if(isset($options["perc"])){
|
||||
|
||||
class BC {
|
||||
|
||||
public static function show_progressBar($options) {
|
||||
if (isset($options["perc"])) {
|
||||
$perc = $options["perc"];
|
||||
|
||||
} else if(isset($options["value"]) && isset($options["max"])){
|
||||
|
||||
} else if (isset($options["value"]) && isset($options["max"])) {
|
||||
$perc = ($options["value"] / $options["max"]) * 100;
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$theme = null;
|
||||
if(isset($options["theme"])){
|
||||
if(is_array($options["theme"])){
|
||||
if (isset($options["theme"])) {
|
||||
if (is_array($options["theme"])) {
|
||||
ksort($options["theme"]);
|
||||
foreach($options["theme"] as $p => $pTheme){
|
||||
if(is_null($theme)){
|
||||
foreach ($options["theme"] as $p => $pTheme) {
|
||||
if (is_null($theme)) {
|
||||
$theme = $pTheme;
|
||||
}
|
||||
if($perc>=floatval($p)){
|
||||
if ($perc >= floatval($p)) {
|
||||
$theme = $pTheme;
|
||||
}
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$theme = $options["theme"];
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$theme = "info";
|
||||
}
|
||||
|
||||
|
||||
$viewVal = !(isset($options["viewVal"]) && !$options["viewVal"]);
|
||||
|
||||
$percSys = $perc>100 ? 100 : $perc;
|
||||
|
||||
$percSys = $perc > 100 ? 100 : $perc;
|
||||
$div = "<div class='progress'>
|
||||
<div class='progress-bar progress-bar-{$theme}' role='progressbar' aria-valuenow='{$percSys}' aria-valuemin='0' aria-valuemax='100' style='width:{$percSys}%'>
|
||||
".($viewVal?intval($perc)."%":"")."
|
||||
" . ($viewVal ? intval($perc) . "%" : "") . "
|
||||
</div>
|
||||
</div>";
|
||||
return Utility\Str::remove_multiple_spaces($div);
|
||||
}
|
||||
|
||||
public static function get_titleBarText(){
|
||||
|
||||
public static function get_titleBarText() {
|
||||
global $pageTitle;
|
||||
$currentModuleTitle = PVM\CurrentModule::getTitle();
|
||||
if(!is_null($currentModuleTitle)){
|
||||
if (!is_null($currentModuleTitle)) {
|
||||
return $currentModuleTitle;
|
||||
} else if(isset($pageTitle)){
|
||||
} else if (isset($pageTitle)) {
|
||||
return $pageTitle;
|
||||
}
|
||||
return "Portale WEB";
|
||||
|
||||
@@ -1,159 +1,159 @@
|
||||
<?php
|
||||
class Cache{
|
||||
|
||||
class Cache {
|
||||
private static $cache_folder = "cache/";
|
||||
const time_in_cache = 86400; // 24 * 60 * 60 (24 ore in secondi)
|
||||
const delete_ignore = "T87"; // estensioni file non auto-eliminabili, separati da virgola
|
||||
|
||||
public static function get_cacheRoot(){
|
||||
|
||||
public static function get_cacheRoot() {
|
||||
return self::$cache_folder;
|
||||
}
|
||||
|
||||
public static function set_cacheRoot($cacheFolder){
|
||||
|
||||
public static function set_cacheRoot($cacheFolder) {
|
||||
self::$cache_folder = $cacheFolder;
|
||||
}
|
||||
|
||||
private static function gen_filename_rnd($cachePath, $filenameIn, $c = 0){
|
||||
|
||||
private static function gen_filename_rnd($cachePath, $filenameIn, $c = 0) {
|
||||
$basename = pathinfo($filenameIn, PATHINFO_FILENAME);
|
||||
$ext = pathinfo($filenameIn, PATHINFO_EXTENSION);
|
||||
|
||||
|
||||
$filenameOut = $basename;
|
||||
if($c>0){
|
||||
$filenameOut .= "-".rand(1, 10000);
|
||||
if ($c > 0) {
|
||||
$filenameOut .= "-" . rand(1, 10000);
|
||||
}
|
||||
$filenameOut .= ".".$ext;
|
||||
|
||||
$filePath = $cachePath.$filenameOut;
|
||||
if(file_exists($filePath)){
|
||||
$filenameOut .= "." . $ext;
|
||||
|
||||
$filePath = $cachePath . $filenameOut;
|
||||
if (file_exists($filePath)) {
|
||||
$c++;
|
||||
return self::gen_filename_rnd($cachePath, $filenameOut, $c);
|
||||
} else{
|
||||
} else {
|
||||
return $filenameOut;
|
||||
}
|
||||
}
|
||||
|
||||
private static function get_cachePath($fileName = null, $subfolder = null){
|
||||
|
||||
private static function get_cachePath($fileName = null, $subfolder = null) {
|
||||
$subfolder = !is_null($fileName) ? self::complete_subfolder($fileName, $subfolder) : $subfolder;
|
||||
$cacheRoot = self::get_cacheRoot();
|
||||
if(!file_exists($cacheRoot)){
|
||||
if (!file_exists($cacheRoot)) {
|
||||
@mkdir($cacheRoot, 0777);
|
||||
}
|
||||
if(!is_null($subfolder)){
|
||||
$cachePath = $cacheRoot.$subfolder."/";
|
||||
if(!file_exists($cachePath)){
|
||||
if (!is_null($subfolder)) {
|
||||
$cachePath = $cacheRoot . $subfolder . "/";
|
||||
if (!file_exists($cachePath)) {
|
||||
@mkdir($cachePath, 0777);
|
||||
}
|
||||
return $cachePath;
|
||||
}
|
||||
return $cacheRoot;
|
||||
}
|
||||
|
||||
public static function read($fileName, $subfolder = null, $timeInCache = null){
|
||||
|
||||
public static function read($fileName, $subfolder = null, $timeInCache = null) {
|
||||
$filePath = self::get_filepath($fileName, $subfolder, true);
|
||||
self::clean_folder($filePath, $timeInCache);
|
||||
return file_exists($filePath) ? file_get_contents($filePath) : null;
|
||||
}
|
||||
|
||||
private static function exists_filename($cachePath, $fileName){
|
||||
return file_exists($cachePath.$fileName);
|
||||
|
||||
private static function exists_filename($cachePath, $fileName) {
|
||||
return file_exists($cachePath . $fileName);
|
||||
}
|
||||
|
||||
private static function generateIncrementalFilename($cachePath, $fileName){
|
||||
|
||||
private static function generateIncrementalFilename($cachePath, $fileName) {
|
||||
$IncrementName = new \Utility\File\IncrementName($fileName);
|
||||
$pattern = (!is_null(nullIfBlank($fileName)) ? " - " : "")."[N]";
|
||||
$pattern = (!is_null(nullIfBlank($fileName)) ? " - " : "") . "[N]";
|
||||
$IncrementName->set_pattern($pattern)->set_numPad(2);
|
||||
$i = 0;
|
||||
do{
|
||||
do {
|
||||
$result = $IncrementName->set_number($i)->get_result();
|
||||
$i++;
|
||||
}
|
||||
while(self::exists_filename($cachePath, $result));
|
||||
} while (self::exists_filename($cachePath, $result));
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function get_filepath($fileName = null, $subfolder = null, $overwrite = false){
|
||||
|
||||
public static function get_filepath($fileName = null, $subfolder = null, $overwrite = false) {
|
||||
$fileName = !is_null($fileName) ? Utility\File::nameSanitized(str_replace("/", "-", $fileName)) : "file";
|
||||
$cachePath = self::get_cachePath($fileName, $subfolder);
|
||||
|
||||
if(!$overwrite){
|
||||
|
||||
if (!$overwrite) {
|
||||
$fileName = self::generateIncrementalFilename($cachePath, $fileName);
|
||||
//$fileName = !is_null($fileName) ? self::gen_filename_rnd($cachePath, $fileName) : null;
|
||||
}
|
||||
|
||||
return $cachePath.blankIfNull($fileName);
|
||||
|
||||
return $cachePath . blankIfNull($fileName);
|
||||
}
|
||||
|
||||
private static function complete_subfolder($fileName, $subfolder){
|
||||
if($subfolder===true){ // usa l'estensione del file in automatico
|
||||
if(\Utility\File::isImageFromName($fileName)){
|
||||
|
||||
private static function complete_subfolder($fileName, $subfolder) {
|
||||
if ($subfolder === true) { // usa l'estensione del file in automatico
|
||||
if (\Utility\File::isImageFromName($fileName)) {
|
||||
return "images";
|
||||
}
|
||||
return nullIfBlank(strtolower(pathinfo($fileName, PATHINFO_EXTENSION)));
|
||||
}
|
||||
return $subfolder;
|
||||
}
|
||||
|
||||
private static function clean_folder($filePath, $timeInCache = self::time_in_cache){
|
||||
|
||||
private static function clean_folder($filePath, $timeInCache = self::time_in_cache) {
|
||||
$folder = pathinfo($filePath, PATHINFO_DIRNAME);
|
||||
$ext = pathinfo($filePath, PATHINFO_EXTENSION);
|
||||
$arr_deleteIgnore = explode(",", self::delete_ignore);
|
||||
|
||||
if($handle = opendir($folder)){
|
||||
while(false!==($file = readdir($handle))){
|
||||
$fpath = $folder."/".$file;
|
||||
if(file_exists($fpath) && !is_dir($fpath)){
|
||||
|
||||
if ($handle = opendir($folder)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
$fpath = $folder . "/" . $file;
|
||||
if (file_exists($fpath) && !is_dir($fpath)) {
|
||||
$fpath_ext = strtolower(pathinfo($fpath, PATHINFO_EXTENSION));
|
||||
if((!$ext || \Utility\Str::ciEquals($fpath_ext, $ext)) && !in_arrayi($fpath_ext, $arr_deleteIgnore)){
|
||||
if ((!$ext || \Utility\Str::ciEquals($fpath_ext, $ext)) && !in_arrayi($fpath_ext, $arr_deleteIgnore)) {
|
||||
$filelastmodified = filemtime($fpath);
|
||||
if((Utility\Date::getNow() - $filelastmodified) > $timeInCache){
|
||||
if ((Utility\Date::getNow() - $filelastmodified) > $timeInCache) {
|
||||
unlink($fpath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
|
||||
public static function writeR($fileName, $content = null, $subfolder = null, $overwrite = false, $timeInCache = self::time_in_cache){
|
||||
|
||||
public static function writeR($fileName, $content = null, $subfolder = null, $overwrite = false, $timeInCache = self::time_in_cache) {
|
||||
$Ret = new \Ret;
|
||||
$filePath = self::get_filepath($fileName, $subfolder, $overwrite);
|
||||
|
||||
if($overwrite && file_exists($filePath)){
|
||||
|
||||
if ($overwrite && file_exists($filePath)) {
|
||||
unlink($filePath);
|
||||
}
|
||||
|
||||
|
||||
self::clean_folder($filePath, $timeInCache);
|
||||
|
||||
if(!is_null(\nullIfBlank($content))){
|
||||
|
||||
if (!is_null(\nullIfBlank($content))) {
|
||||
$filePath = @file_put_contents($filePath, $content) ? $filePath : false;
|
||||
if($filePath!==false){
|
||||
if ($filePath !== false) {
|
||||
$Ret->set_string($filePath);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Si è verificato un errore durante la scrittura del file nel percorso temporaneo")
|
||||
->set_errorTitle(pathinfo($fileName, PATHINFO_FILENAME));
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Il contenuto del file non è valido")->set_errorTitle(pathinfo($fileName, PATHINFO_FILENAME));
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public static function write($fileName, $content = null, $subfolder = null, $overwrite = false, $timeInCache = self::time_in_cache){
|
||||
* @deprecated
|
||||
*/
|
||||
public static function write($fileName, $content = null, $subfolder = null, $overwrite = false, $timeInCache = self::time_in_cache) {
|
||||
$Ret = self::writeR($fileName, $content, $subfolder, $overwrite, $timeInCache);
|
||||
return $Ret->is_OK() ? $Ret->get_string() : false;
|
||||
}
|
||||
|
||||
public static function tempFile(){
|
||||
$cachePath = self::get_cachePath(null, "temp");
|
||||
|
||||
public static function tempFile() {
|
||||
$cachePath = self::get_cachePath(null, "temp");
|
||||
$filePath = self::gen_filename_rnd($cachePath, "cache.temp");
|
||||
register_shutdown_function(function() use($filePath){
|
||||
register_shutdown_function(function () use ($filePath) {
|
||||
@unlink($filePath);
|
||||
});
|
||||
return $cachePath.$filePath;
|
||||
return $cachePath . $filePath;
|
||||
}
|
||||
}
|
||||
@@ -32,10 +32,10 @@ class Config {
|
||||
|
||||
public static function loadComposerAutoload($profileDb) {
|
||||
if (isset($profileDb)) {
|
||||
$composerJsonPath = "config_aziende" . DIRECTORY_SEPARATOR . $profileDb . DIRECTORY_SEPARATOR . "composer.json";
|
||||
$composerJsonPath = "config_aziende" . DIRECTORY_SEPARATOR . strtoupper($profileDb) . DIRECTORY_SEPARATOR . "composer.json";
|
||||
|
||||
if (file_exists($composerJsonPath)) {
|
||||
return "config_aziende" . DIRECTORY_SEPARATOR . $profileDb . DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php";
|
||||
return "config_aziende" . DIRECTORY_SEPARATOR . strtoupper($profileDb) . DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,10 @@ class Config {
|
||||
if (!is_null($endPoint)) {
|
||||
$endPoint = Controller::endPointParsed($endPoint);
|
||||
}
|
||||
|
||||
if (is_number(strpos($endPoint,"192.168.3.15:8080")) && is_number(strpos(ISSET($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:$_SERVER["PHP_SELF"],"/dev/pvm"))){
|
||||
$endPoint = "http://192.168.2.215:8080";
|
||||
}
|
||||
return $endPoint;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,182 +1,195 @@
|
||||
<?php
|
||||
class Controller{
|
||||
|
||||
class Controller {
|
||||
public static $baseModule = "base";
|
||||
public static $abs_root_project = null;
|
||||
|
||||
//public static $gestname = null;
|
||||
|
||||
public static function current_url(){
|
||||
|
||||
public static function current_url() {
|
||||
return (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] === "on" ? "https" : "http") . "://{$_SERVER["HTTP_HOST"]}{$_SERVER["REQUEST_URI"]}";
|
||||
}
|
||||
|
||||
public static function current_module(){ // è data dal nome della gestione .php
|
||||
|
||||
public static function current_module() { // è data dal nome della gestione .php
|
||||
/*if(!is_null(self::$gestname)){
|
||||
return self::$gestname;
|
||||
}*/
|
||||
// valutare ModuloUtils\CurrentModule\getId
|
||||
|
||||
|
||||
return pathinfo($_SERVER["PHP_SELF"], PATHINFO_FILENAME);
|
||||
}
|
||||
|
||||
public static function current_gestpath(){
|
||||
|
||||
public static function current_gestpath() {
|
||||
return self::module_gestpath(self::current_module());
|
||||
}
|
||||
public static function module_gestpath($moduleName){
|
||||
return "gest-lib".DIRECTORY_SEPARATOR."{$moduleName}".DIRECTORY_SEPARATOR;
|
||||
|
||||
public static function module_gestpath($moduleName) {
|
||||
return "gest-lib" . DIRECTORY_SEPARATOR . "{$moduleName}" . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
public static function current_gestpath_resource($resource){
|
||||
|
||||
public static function current_gestpath_resource($resource) {
|
||||
return self::module_gestpath_resource(self::current_module(), $resource);
|
||||
}
|
||||
public static function module_gestpath_resource($moduleName, $resource){
|
||||
return self::module_gestpath($moduleName).$resource.DIRECTORY_SEPARATOR;
|
||||
|
||||
public static function module_gestpath_resource($moduleName, $resource) {
|
||||
return self::module_gestpath($moduleName) . $resource . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_gestpath_classes($fileName = ""){
|
||||
public static function current_gestpath_classes($fileName = "") {
|
||||
return self::module_gestpath_classes(self::current_module(), $fileName);
|
||||
}
|
||||
public static function module_gestpath_classes($moduleName, $fileName = ""){
|
||||
return self::$abs_root_project.DIRECTORY_SEPARATOR.self::module_gestpath_resource($moduleName, "classes").$fileName;
|
||||
|
||||
public static function module_gestpath_classes($moduleName, $fileName = "") {
|
||||
return self::$abs_root_project . DIRECTORY_SEPARATOR . self::module_gestpath_resource($moduleName, "classes") . $fileName;
|
||||
}
|
||||
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
/*
|
||||
public static function current_gestpath_widgets($fileName = ""){
|
||||
return self::module_gestpath_classes(self::current_module(), $fileName);
|
||||
}*/
|
||||
public static function module_gestpath_widgets($moduleName, $fileName = ""){
|
||||
return self::$abs_root_project.DIRECTORY_SEPARATOR.self::module_gestpath_resource($moduleName, "widgets").$fileName;
|
||||
}
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_mainClasspath(){
|
||||
return self::module_mainClasspath(self::current_module());
|
||||
}
|
||||
public static function module_mainClasspath($moduleName){
|
||||
$fileName = ucfirst(\Utility\Str::camelCaseEncode($moduleName)).".class.php";
|
||||
return self::module_gestpath_classes($moduleName, $fileName);
|
||||
}
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_gestpath_sql($fileName = ""){
|
||||
return self::module_gestpath_sql(self::current_module(), $fileName);
|
||||
}
|
||||
/* here you can understand what module name use to reach your sql file */
|
||||
public static function module_gestpath_sql($moduleName, $fileName = ""){
|
||||
return self::$abs_root_project."/".self::module_gestpath_resource($moduleName, "sql").$fileName;
|
||||
}
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_gestpath_include($fileName = ""){
|
||||
return self::module_gestpath_include(self::current_module(), $fileName);
|
||||
}
|
||||
public static function module_gestpath_include($moduleName, $fileName = ""){
|
||||
return self::module_gestpath_resource($moduleName, "include").$fileName;
|
||||
}
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
/************************************* RELATION BETWEEN MAIN.PHP AND {GESTIONE}.PHP *************************************************/
|
||||
public static function current_gestpath_mainPage(){
|
||||
return self::module_gestpath_mainPage(self::current_module());
|
||||
}
|
||||
public static function module_gestpath_mainPage($moduleName){
|
||||
return self::module_gestpath_include($moduleName, "main.php");
|
||||
}
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_gestpath_certs($fileName = ""){
|
||||
return self::module_gestpath_certs(self::current_module(), $fileName);
|
||||
}
|
||||
public static function module_gestpath_certs($moduleName, $fileName = ""){
|
||||
return self::module_gestpath_resource($moduleName, "certs").$fileName;
|
||||
}
|
||||
|
||||
// PATH CLIENT-SIDE
|
||||
public static function module_gestpath_js($moduleName, $fileName = ""){
|
||||
return str_replace(DIRECTORY_SEPARATOR, "/", self::module_gestpath_resource($moduleName, "js")).$fileName;
|
||||
public static function module_gestpath_widgets($moduleName, $fileName = "") {
|
||||
return self::$abs_root_project . DIRECTORY_SEPARATOR . self::module_gestpath_resource($moduleName, "widgets") . $fileName;
|
||||
}
|
||||
|
||||
public static function module_gestpath_audio($moduleName, $fileName = ""){
|
||||
return str_replace(DIRECTORY_SEPARATOR, "/", self::module_gestpath_resource($moduleName, "audio")).$fileName;
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_mainClasspath() {
|
||||
return self::module_mainClasspath(self::current_module());
|
||||
}
|
||||
|
||||
public static function module_gestpath_css($moduleName, $fileName = ""){
|
||||
return str_replace(DIRECTORY_SEPARATOR, "/", self::module_gestpath_resource($moduleName, "css")).$fileName;
|
||||
|
||||
public static function module_mainClasspath($moduleName) {
|
||||
$fileName = ucfirst(\Utility\Str::camelCaseEncode($moduleName)) . ".class.php";
|
||||
return self::module_gestpath_classes($moduleName, $fileName);
|
||||
}
|
||||
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_gestpath_sql($fileName = "") {
|
||||
return self::module_gestpath_sql(self::current_module(), $fileName);
|
||||
}
|
||||
|
||||
/* here you can understand what module name use to reach your sql file */
|
||||
public static function module_gestpath_sql($moduleName, $fileName = "") {
|
||||
return self::$abs_root_project . "/" . self::module_gestpath_resource($moduleName, "sql") . $fileName;
|
||||
}
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_gestpath_include($fileName = "") {
|
||||
return self::module_gestpath_include(self::current_module(), $fileName);
|
||||
}
|
||||
|
||||
public static function module_gestpath_include($moduleName, $fileName = "") {
|
||||
return self::module_gestpath_resource($moduleName, "include") . $fileName;
|
||||
}
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
|
||||
/************************************* RELATION BETWEEN MAIN.PHP AND {GESTIONE}.PHP *************************************************/
|
||||
public static function current_gestpath_mainPage() {
|
||||
return self::module_gestpath_mainPage(self::current_module());
|
||||
}
|
||||
|
||||
public static function module_gestpath_mainPage($moduleName) {
|
||||
return self::module_gestpath_include($moduleName, "main.php");
|
||||
}
|
||||
|
||||
// PATH SERVER-SIDE
|
||||
public static function current_gestpath_certs($fileName = "") {
|
||||
return self::module_gestpath_certs(self::current_module(), $fileName);
|
||||
}
|
||||
|
||||
public static function module_gestpath_certs($moduleName, $fileName = "") {
|
||||
return self::module_gestpath_resource($moduleName, "certs") . $fileName;
|
||||
}
|
||||
|
||||
// PATH CLIENT-SIDE
|
||||
public static function current_gestpath_images($fileName = ""){
|
||||
public static function module_gestpath_js($moduleName, $fileName = "") {
|
||||
return str_replace(DIRECTORY_SEPARATOR, "/", self::module_gestpath_resource($moduleName, "js")) . $fileName;
|
||||
}
|
||||
|
||||
public static function module_gestpath_audio($moduleName, $fileName = "") {
|
||||
return str_replace(DIRECTORY_SEPARATOR, "/", self::module_gestpath_resource($moduleName, "audio")) . $fileName;
|
||||
}
|
||||
|
||||
public static function module_gestpath_css($moduleName, $fileName = "") {
|
||||
return str_replace(DIRECTORY_SEPARATOR, "/", self::module_gestpath_resource($moduleName, "css")) . $fileName;
|
||||
}
|
||||
|
||||
// PATH CLIENT-SIDE
|
||||
public static function current_gestpath_images($fileName = "") {
|
||||
return self::module_gestpath_images(self::current_module(), $fileName);
|
||||
}
|
||||
public static function module_gestpath_images($moduleName, $fileName = ""){
|
||||
return self::module_gestpath_resource($moduleName, "images").$fileName;
|
||||
|
||||
public static function module_gestpath_images($moduleName, $fileName = "") {
|
||||
return self::module_gestpath_resource($moduleName, "images") . $fileName;
|
||||
}
|
||||
|
||||
public static function current_gestpath_html($fileName = ""){
|
||||
|
||||
public static function current_gestpath_html($fileName = "") {
|
||||
return self::module_gestpath_html(self::current_module(), $fileName);
|
||||
}
|
||||
public static function module_gestpath_html($moduleName, $fileName = ""){
|
||||
return self::module_gestpath_resource($moduleName, "html").$fileName;
|
||||
|
||||
public static function module_gestpath_html($moduleName, $fileName = "") {
|
||||
return self::module_gestpath_resource($moduleName, "html") . $fileName;
|
||||
}
|
||||
|
||||
public static function wwwpath(){
|
||||
return (PVM::isDebugEnv() && file_exists("../public_html") ? "../" : "")."../";
|
||||
|
||||
public static function wwwpath() {
|
||||
return (PVM::isDebugEnv() && file_exists("../public_html") ? "../" : "") . "../";
|
||||
}
|
||||
|
||||
public static function endPointParsed($endPoint){
|
||||
|
||||
public static function endPointParsed($endPoint) {
|
||||
$scheme = parse_url($endPoint, PHP_URL_SCHEME);
|
||||
$host = parse_url($endPoint, PHP_URL_HOST);
|
||||
$path = parse_url($endPoint, PHP_URL_PATH);
|
||||
$port = parse_url($endPoint, PHP_URL_PORT);
|
||||
if(is_null($host)){
|
||||
if (is_null($host)) {
|
||||
$host = $path;
|
||||
}
|
||||
$protocol = is_null($scheme) ? Rest::$protocol : $scheme;
|
||||
$endPoint = $protocol."://".$host;
|
||||
if(!is_null($port)){
|
||||
$endPoint .= ":".$port;
|
||||
$endPoint = $protocol . "://" . $host;
|
||||
if (!is_null($port)) {
|
||||
$endPoint .= ":" . $port;
|
||||
}
|
||||
return $endPoint;
|
||||
}
|
||||
|
||||
private static function getCurrentUrlParameters(){
|
||||
|
||||
private static function getCurrentUrlParameters() {
|
||||
$currentUrl = self::current_url();
|
||||
$params = array();
|
||||
parse_str(parse_url($currentUrl, PHP_URL_QUERY), $params);
|
||||
return array_keys($params);
|
||||
}
|
||||
|
||||
private static function calcNavTabScore($navParams){
|
||||
|
||||
private static function calcNavTabScore($navParams) {
|
||||
$currentParams = self::getCurrentUrlParameters();
|
||||
$navTabScore = 0;
|
||||
foreach($currentParams as $param){
|
||||
if(in_array($param, $navParams)){
|
||||
foreach ($currentParams as $param) {
|
||||
if (in_array($param, $navParams)) {
|
||||
$navTabScore++;
|
||||
}
|
||||
}
|
||||
return $navTabScore;
|
||||
}
|
||||
|
||||
private static function getIdxActiveNavTab(){
|
||||
|
||||
private static function getIdxActiveNavTab() {
|
||||
$userNavTabs = self::getUserNavTabs();
|
||||
$idx = $maxScore = 0;
|
||||
foreach($userNavTabs as $i => $userNavTab){
|
||||
if($userNavTab["score"]>$maxScore){
|
||||
foreach ($userNavTabs as $i => $userNavTab) {
|
||||
if ($userNavTab["score"] > $maxScore) {
|
||||
$idx = $i;
|
||||
$maxScore = $userNavTab["score"];
|
||||
}
|
||||
}
|
||||
return $idx;
|
||||
}
|
||||
|
||||
private static function getUserNavTabs(){
|
||||
|
||||
private static function getUserNavTabs() {
|
||||
$userNavTabs = array();
|
||||
$currentUrl = self::current_url();
|
||||
$Modulo = PVM\CurrentModule::getModulo();
|
||||
if(!is_null($currentUrl) && !is_null($Modulo) && $Modulo->isLoaded()){
|
||||
foreach($Modulo->getPosition() as $pItem){
|
||||
if (!is_null($currentUrl) && !is_null($Modulo) && $Modulo->isLoaded()) {
|
||||
foreach ($Modulo->getPosition() as $pItem) {
|
||||
$flagView = PVM::processItemPolicyToCurrentUser($pItem);
|
||||
if($flagView){
|
||||
if ($flagView) {
|
||||
$navTab = array_pick($pItem, "title", "url");
|
||||
$pQ = array();
|
||||
parse_str(parse_url($navTab["url"], PHP_URL_QUERY), $pQ);
|
||||
@@ -187,20 +200,20 @@ class Controller{
|
||||
}
|
||||
return $userNavTabs;
|
||||
}
|
||||
|
||||
public static function getNavTabs(){
|
||||
|
||||
public static function getNavTabs() {
|
||||
$navTabs = self::getUserNavTabs();
|
||||
if(count($navTabs)>0){
|
||||
if (count($navTabs) > 0) {
|
||||
$idxAttivo = self::getIdxActiveNavTab();
|
||||
foreach($navTabs as $i => $navTab){
|
||||
if(isset($navTab["usergroups"]) && !array_key_exists(User::get_current_group(), $navTab["usergroups"])) {
|
||||
foreach ($navTabs as $i => $navTab) {
|
||||
if (isset($navTab["usergroups"]) && !array_key_exists(User::get_current_group(), $navTab["usergroups"])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if($idxAttivo===$i){
|
||||
if ($idxAttivo === $i) {
|
||||
$navTab["active"] = true;
|
||||
$navTab["url"] = "#";
|
||||
} else{
|
||||
} else {
|
||||
$navTab["active"] = false;
|
||||
}
|
||||
$navTabs[$i] = $navTab;
|
||||
@@ -209,106 +222,105 @@ class Controller{
|
||||
return $navTabs;
|
||||
}
|
||||
|
||||
public static function get_js_files(){
|
||||
public static function get_js_files() {
|
||||
$files = array();
|
||||
$assetsLibs = self::loadCurrentAssetsLibs();
|
||||
foreach($assetsLibs as $lib){
|
||||
foreach ($assetsLibs as $lib) {
|
||||
$files = array_merge($files, self::loadLibrary($lib, "js"));
|
||||
}
|
||||
if(empty($files)){
|
||||
if (empty($files)) {
|
||||
$files = self::loadLibrary(self::$baseModule, "js");
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
public static function get_css_files(){
|
||||
|
||||
public static function get_css_files() {
|
||||
$files = array();
|
||||
$assetsLibs = self::loadCurrentAssetsLibs();
|
||||
foreach($assetsLibs as $lib){
|
||||
foreach ($assetsLibs as $lib) {
|
||||
$files = array_merge($files, self::loadLibrary($lib, "css"));
|
||||
}
|
||||
if(empty($files)){
|
||||
if (empty($files)) {
|
||||
$files = self::loadLibrary(self::$baseModule, "css");
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
private static function loadCurrentAssetsLibs(){
|
||||
|
||||
private static function loadCurrentAssetsLibs() {
|
||||
$modules = PVM::get_userModulesTree();
|
||||
$mergedModules = array();
|
||||
foreach($modules as $module){
|
||||
foreach ($modules as $module) {
|
||||
$mergedModules = array_merge($mergedModules, $module);
|
||||
}
|
||||
|
||||
|
||||
$currentActiveModuleName = array(self::current_module());
|
||||
if(self::current_module()!=="login"){
|
||||
if (self::current_module() !== "login") {
|
||||
$currentActiveModuleName = array_merge($currentActiveModuleName, \PVM\ModuloUtils::getIdModuliBase());
|
||||
}
|
||||
|
||||
|
||||
$libs = array();
|
||||
foreach($mergedModules as $commonModule){
|
||||
if(in_array($commonModule["id"], $currentActiveModuleName)){
|
||||
foreach ($mergedModules as $commonModule) {
|
||||
if (in_array($commonModule["id"], $currentActiveModuleName)) {
|
||||
$libs = array_merge($libs, $commonModule["libs"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return array_values(array_unique($libs));
|
||||
}
|
||||
|
||||
public static function loadLibrary($libName, $fileType){
|
||||
public static function loadLibrary($libName, $fileType) {
|
||||
$libs = PVM::loadAssetsLibs();
|
||||
$fileList = array();
|
||||
|
||||
if(isset($libs[$libName])){
|
||||
|
||||
if (isset($libs[$libName])) {
|
||||
$lib = $libs[$libName];
|
||||
|
||||
if(isset($lib[$fileType])){
|
||||
foreach($lib[$fileType] as $file){
|
||||
if(file_exists($file)){
|
||||
|
||||
if (isset($lib[$fileType])) {
|
||||
foreach ($lib[$fileType] as $file) {
|
||||
if (file_exists($file) || Utility::validateUrl($file)) {
|
||||
$fileList[] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($lib["children"])){
|
||||
foreach($lib["children"] as $childLibName){
|
||||
|
||||
if (isset($lib["children"])) {
|
||||
foreach ($lib["children"] as $childLibName) {
|
||||
$fileList = array_merge($fileList, self::loadLibrary($childLibName, $fileType));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $fileList;
|
||||
}
|
||||
|
||||
public static function get_build(){
|
||||
public static function get_build() {
|
||||
return file_exists("build.json") ? json_decode(file_get_contents("build.json"), true) : null;
|
||||
}
|
||||
|
||||
public static function is_ajaxRequest(){
|
||||
|
||||
public static function is_ajaxRequest() {
|
||||
return isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && \Utility\Str::ciEquals($_SERVER["HTTP_X_REQUESTED_WITH"], "xmlhttprequest");
|
||||
}
|
||||
|
||||
public static function loginRedirect(){
|
||||
|
||||
public static function loginRedirect() {
|
||||
header("Location: login.php");
|
||||
}
|
||||
|
||||
public static function homeRedirect(){
|
||||
$url = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
||||
if(strpos($url, "public_html") !== false){
|
||||
|
||||
public static function homeRedirect() {
|
||||
$url = $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
|
||||
if (strpos($url, "public_html") !== false) {
|
||||
header("Location: ../");
|
||||
} else{
|
||||
} else {
|
||||
header("Location: ./");
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_audio_files()
|
||||
{
|
||||
public static function get_audio_files() {
|
||||
$files = array();
|
||||
$assetsLibs = self::loadCurrentAssetsLibs();
|
||||
foreach($assetsLibs as $lib){
|
||||
foreach ($assetsLibs as $lib) {
|
||||
$files = array_merge($files, self::loadLibrary($lib, "mp3"));
|
||||
}
|
||||
if(empty($files)){
|
||||
if (empty($files)) {
|
||||
$files = self::loadLibrary(self::$baseModule, "mp3");
|
||||
}
|
||||
return $files;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
class EntityItem
|
||||
{
|
||||
class EntityItem {
|
||||
public $endPoint = null;
|
||||
private $authUsername = null;
|
||||
private $authPassword = null;
|
||||
@@ -25,31 +24,26 @@ class EntityItem
|
||||
const SELECT_OBJECT = "SELECT_OBJECT";
|
||||
const NO_OP = "NO_OP";
|
||||
|
||||
public function __construct($type = null)
|
||||
{
|
||||
public function __construct($type = null) {
|
||||
if (!is_null($type)) {
|
||||
$this->type($type);
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
public function __toString() {
|
||||
return self::get_jsonBody();
|
||||
}
|
||||
|
||||
public function type($type)
|
||||
{
|
||||
public function type($type) {
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getType()
|
||||
{
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
private static function is_validKey($key)
|
||||
{
|
||||
private static function is_validKey($key) {
|
||||
if (strpos($key, "_") !== false) { // deve accettare solo chiavi camelCase
|
||||
print_r("EntityItem->field accetta solo key con nomenclatura camel-case ('{$key}')");
|
||||
return false;
|
||||
@@ -57,29 +51,25 @@ class EntityItem
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function is_entityItem($value)
|
||||
{
|
||||
public static function is_entityItem($value) {
|
||||
return !is_null($value) && gettype($value) == "object" && (get_class($value) == "EntityItem" || is_subclass_of($value, "EntityItem"));
|
||||
}
|
||||
|
||||
public function count_entityChildren($key)
|
||||
{
|
||||
public function count_entityChildren($key) {
|
||||
if (isset($this->childEntityArray[$key])) {
|
||||
return count($this->childEntityArray[$key]->get_children());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function get_childEntityArray($key)
|
||||
{
|
||||
private function get_childEntityArray($key) {
|
||||
if (!isset($this->childEntityArray[$key])) {
|
||||
$this->childEntityArray[$key] = new EntityArray($key);
|
||||
}
|
||||
return $this->childEntityArray[$key];
|
||||
}
|
||||
|
||||
private static function log_deprecatedFunction()
|
||||
{
|
||||
private static function log_deprecatedFunction() {
|
||||
$caller = debug_backtrace();
|
||||
$caller = array_pick($caller[1], "file", "line");
|
||||
|
||||
@@ -98,13 +88,11 @@ class EntityItem
|
||||
@Cache::writeR($logFile, $content, null, true);
|
||||
}
|
||||
|
||||
public function unset_child($key)
|
||||
{
|
||||
public function unset_child($key) {
|
||||
return $this->unset_field($key);
|
||||
}
|
||||
|
||||
public function unset_field($key)
|
||||
{
|
||||
public function unset_field($key) {
|
||||
if (array_key_exists($key, $this->arr_fields)) {
|
||||
unset($this->arr_fields[$key]);
|
||||
}
|
||||
@@ -114,27 +102,23 @@ class EntityItem
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_field($key)
|
||||
{
|
||||
public function get_field($key) {
|
||||
return (self::is_validKey($key) && isset($this->arr_fields[$key])) ? $this->arr_fields[$key] : null;
|
||||
}
|
||||
|
||||
public function setDatetime($key, $value, $setNullConstant = false)
|
||||
{
|
||||
public function setDatetime($key, $value, $setNullConstant = false) {
|
||||
$setNullConstant = $setNullConstant === true ? \Format::IMS_NULL_TIME : $setNullConstant;
|
||||
$value = \Utility\Date::isValidUnixtime($value) ? strftime(\Format::strftimeYMDHMS, $value) : $value;
|
||||
return $this->set($key, $value, $setNullConstant);
|
||||
}
|
||||
|
||||
public function setDate($key, $value, $setNullConstant = false)
|
||||
{
|
||||
public function setDate($key, $value, $setNullConstant = false) {
|
||||
$setNullConstant = $setNullConstant === true ? \Format::IMS_NULL_TIME : $setNullConstant;
|
||||
$value = \Utility\Date::isValidUnixtime($value) ? strftime(\Format::strftimeYMD, $value) : $value;
|
||||
return $this->set($key, $value, $setNullConstant);
|
||||
}
|
||||
|
||||
public function set($key, $value = false, $setNullConstant = false, $oneToOneRelationship = false)
|
||||
{
|
||||
public function set($key, $value = false, $setNullConstant = false, $oneToOneRelationship = false) {
|
||||
if (count(func_get_args()) == 1) { // GET
|
||||
if (isset($this->arr_fields[$key])) {
|
||||
return $this->arr_fields[$key];
|
||||
@@ -187,8 +171,7 @@ class EntityItem
|
||||
return false;
|
||||
}
|
||||
|
||||
public function setOldPk($input)
|
||||
{ // esclusivo substitute
|
||||
public function setOldPk($input) { // esclusivo substitute
|
||||
if (self::is_entityItem($input)) {
|
||||
$this->detail("oldPk", $input);
|
||||
|
||||
@@ -203,8 +186,7 @@ class EntityItem
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function detail($type, $value)
|
||||
{
|
||||
public function detail($type, $value) {
|
||||
if (self::is_validKey($type)) {
|
||||
$this->arr_fields[$type] = $value;
|
||||
return $this;
|
||||
@@ -212,44 +194,37 @@ class EntityItem
|
||||
return false;
|
||||
}
|
||||
|
||||
public function profileDB($value)
|
||||
{
|
||||
public function profileDB($value) {
|
||||
$this->profileDB = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function endPoint($endPoint)
|
||||
{
|
||||
public function endPoint($endPoint) {
|
||||
$this->endPoint = $endPoint;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function authUsername($value)
|
||||
{
|
||||
public function authUsername($value) {
|
||||
$this->authUsername = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function authPassword($value)
|
||||
{
|
||||
public function authPassword($value) {
|
||||
$this->authPassword = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function anonymousAuth($value = true)
|
||||
{
|
||||
public function anonymousAuth($value = true) {
|
||||
$this->anonymousAuth = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function onlyPkMaster($enabled = true)
|
||||
{
|
||||
public function onlyPkMaster($enabled = true) {
|
||||
$this->onlyPkMaster = (bool)$enabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function send()
|
||||
{
|
||||
public function send() {
|
||||
if ($this->cacheFile !== false) {
|
||||
$this->writeJsonToCache();
|
||||
}
|
||||
@@ -270,8 +245,7 @@ class EntityItem
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function get_result($entityType = false, $idx = 0)
|
||||
{
|
||||
public function get_result($entityType = false, $idx = 0) {
|
||||
if ($entityType === false) {
|
||||
$entityType = $this->type;
|
||||
}
|
||||
@@ -293,8 +267,7 @@ class EntityItem
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get_body()
|
||||
{
|
||||
public function get_body() {
|
||||
$body = array();
|
||||
if (!is_null($this->type)) {
|
||||
$body["type"] = $this->type;
|
||||
@@ -328,13 +301,11 @@ class EntityItem
|
||||
return $body;
|
||||
}
|
||||
|
||||
public function get_jsonBody()
|
||||
{
|
||||
public function get_jsonBody() {
|
||||
return Utility::json_encode($this->get_body());
|
||||
}
|
||||
|
||||
public function select()
|
||||
{
|
||||
public function select() {
|
||||
$arr_columns = func_get_args();
|
||||
if (count($arr_columns) == 1 && is_array($arr_columns[0])) {
|
||||
$arr_columns = $arr_columns[0];
|
||||
@@ -370,95 +341,77 @@ class EntityItem
|
||||
return $Ret->is_OK() ? $Ret->get_data() : null;
|
||||
}
|
||||
|
||||
public function get_operation()
|
||||
{
|
||||
public function get_operation() {
|
||||
return $this->operation;
|
||||
}
|
||||
|
||||
public function operation($operation)
|
||||
{
|
||||
public function operation($operation) {
|
||||
$this->operation = $operation;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function is_insert()
|
||||
{
|
||||
public function is_insert() {
|
||||
return $this->operation == self::INSERT;
|
||||
}
|
||||
|
||||
public function is_update()
|
||||
{
|
||||
public function is_update() {
|
||||
return $this->operation == self::UPDATE;
|
||||
}
|
||||
|
||||
public function is_insert_or_update()
|
||||
{
|
||||
public function is_insert_or_update() {
|
||||
return $this->operation == self::INSERT_OR_UPDATE;
|
||||
}
|
||||
|
||||
public function is_delete()
|
||||
{
|
||||
public function is_delete() {
|
||||
return $this->operation == self::DELETE;
|
||||
}
|
||||
|
||||
public function is_substitute()
|
||||
{
|
||||
public function is_substitute() {
|
||||
return $this->operation == self::SUBSTITUTE;
|
||||
}
|
||||
|
||||
public function is_no_op()
|
||||
{
|
||||
public function is_no_op() {
|
||||
return $this->operation == self::NO_OP;
|
||||
}
|
||||
|
||||
public function insert()
|
||||
{
|
||||
public function insert() {
|
||||
return $this->operation(self::INSERT);
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
public function update() {
|
||||
return $this->operation(self::UPDATE);
|
||||
}
|
||||
|
||||
public function insert_or_update()
|
||||
{
|
||||
public function insert_or_update() {
|
||||
return $this->operation(self::INSERT_OR_UPDATE);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
public function delete() {
|
||||
return $this->operation(self::DELETE);
|
||||
}
|
||||
|
||||
public function substitute()
|
||||
{
|
||||
public function substitute() {
|
||||
return $this->operation(self::SUBSTITUTE);
|
||||
}
|
||||
|
||||
public function select_object()
|
||||
{
|
||||
public function select_object() {
|
||||
return $this->operation(self::SELECT_OBJECT);
|
||||
}
|
||||
|
||||
public function select_entity()
|
||||
{
|
||||
public function select_entity() {
|
||||
return $this->operation(self::SELECT);
|
||||
}
|
||||
|
||||
public function no_op()
|
||||
{
|
||||
public function no_op() {
|
||||
return $this->operation(self::NO_OP);
|
||||
}
|
||||
|
||||
public function cacheFile($prefix = true)
|
||||
{
|
||||
public function cacheFile($prefix = true) {
|
||||
$this->cacheFile = $prefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function writeJsonToCache()
|
||||
{
|
||||
private function writeJsonToCache() {
|
||||
if (is_string($this->cacheFile)) {
|
||||
$filename = $this->cacheFile;
|
||||
|
||||
@@ -475,20 +428,17 @@ class EntityItem
|
||||
}
|
||||
}
|
||||
|
||||
class EntityArray
|
||||
{
|
||||
class EntityArray {
|
||||
private $children = array();
|
||||
private $type = null;
|
||||
|
||||
public function __construct($type = null)
|
||||
{
|
||||
public function __construct($type = null) {
|
||||
if (!is_null($type)) {
|
||||
$this->type($type);
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
public function __toString() {
|
||||
$arr_body = array();
|
||||
foreach ($this->get_children() as $EntityItem) {
|
||||
$arr_body[] = $EntityItem->get_body();
|
||||
@@ -496,20 +446,17 @@ class EntityArray
|
||||
return json_encode($arr_body);
|
||||
}
|
||||
|
||||
public function type($type)
|
||||
{
|
||||
public function type($type) {
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function append($EntityItem)
|
||||
{
|
||||
public function append($EntityItem) {
|
||||
$this->children[] = $EntityItem;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_children()
|
||||
{
|
||||
public function get_children() {
|
||||
return $this->children;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
class EntityList{
|
||||
|
||||
class EntityList {
|
||||
private $endPoint = null;
|
||||
private $profileDB = null;
|
||||
private $entityItems = array();
|
||||
@@ -8,100 +9,101 @@ class EntityList{
|
||||
private $authPassword = null;
|
||||
private $anonymousAuth = false;
|
||||
private $cacheFile = false;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$arr_entityItem = func_get_args();
|
||||
foreach($arr_entityItem as $EntityItem){
|
||||
foreach ($arr_entityItem as $EntityItem) {
|
||||
$this->push($EntityItem);
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString(){
|
||||
|
||||
public function __toString() {
|
||||
return self::get_jsonBody();
|
||||
}
|
||||
|
||||
public function cacheFile($prefix = true){
|
||||
|
||||
public function cacheFile($prefix = true) {
|
||||
$this->cacheFile = $prefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_jsonBody(){
|
||||
|
||||
public function get_jsonBody() {
|
||||
return json_encode($this->get_body());
|
||||
}
|
||||
|
||||
public function profileDB($value){
|
||||
|
||||
public function profileDB($value) {
|
||||
$this->profileDB = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function endPoint($endPoint){
|
||||
|
||||
public function endPoint($endPoint) {
|
||||
$this->endPoint = $endPoint;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function authUsername($value){
|
||||
|
||||
public function authUsername($value) {
|
||||
$this->authUsername = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function authPassword($value){
|
||||
|
||||
public function authPassword($value) {
|
||||
$this->authPassword = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function anonymousAuth($value = true){
|
||||
|
||||
public function anonymousAuth($value = true) {
|
||||
$this->anonymousAuth = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function push(){
|
||||
|
||||
public function push() {
|
||||
$arr_entityItem = func_get_args();
|
||||
foreach($arr_entityItem as $EntityItem){
|
||||
if(\EntityItem::is_entityItem($EntityItem)){
|
||||
foreach ($arr_entityItem as $EntityItem) {
|
||||
if (\EntityItem::is_entityItem($EntityItem)) {
|
||||
$this->entityItems[] = $EntityItem;
|
||||
if(!is_null($EntityItem->endPoint)){
|
||||
if (!is_null($EntityItem->endPoint)) {
|
||||
$this->endPoint($EntityItem->endPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_body(){
|
||||
|
||||
public function get_body() {
|
||||
$body = array();
|
||||
foreach($this->entityItems as $EntityItem){
|
||||
foreach ($this->entityItems as $EntityItem) {
|
||||
$body[] = $EntityItem->get_body();
|
||||
}
|
||||
return $body;
|
||||
}
|
||||
|
||||
public function get_result($entityType = false, $idx = null){
|
||||
if($entityType===false){
|
||||
|
||||
public function get_result($entityType = false, $idx = null) {
|
||||
if ($entityType === false) {
|
||||
$result = $this->entityResult;
|
||||
|
||||
} else{
|
||||
$result = array_values(from($this->entityResult)->where(function($x) use($entityType){ return $x["type"] == $entityType; })->toArray());
|
||||
|
||||
} else {
|
||||
$result = array_values(from($this->entityResult)->where(function ($x) use ($entityType) {
|
||||
return $x["type"] == $entityType;
|
||||
})->toArray());
|
||||
}
|
||||
|
||||
if(isset($result) && count($result)>0){
|
||||
if(!is_null($idx)){
|
||||
if(isset($result[$idx])){
|
||||
|
||||
if (isset($result) && count($result) > 0) {
|
||||
if (!is_null($idx)) {
|
||||
if (isset($result[$idx])) {
|
||||
return $result[$idx];
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function count(){
|
||||
|
||||
public function count() {
|
||||
return count($this->entityItems);
|
||||
}
|
||||
|
||||
public function send()
|
||||
{
|
||||
public function send() {
|
||||
$Ret = new Ret;
|
||||
if (count($this->entityItems) > 0) {
|
||||
|
||||
@@ -148,8 +150,8 @@ class EntityList{
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function is_entityList($value){
|
||||
return gettype($value)=="object" && get_class($value)=="EntityList";
|
||||
|
||||
public static function is_entityList($value) {
|
||||
return gettype($value) == "object" && get_class($value) == "EntityList";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
class ErrorHandler{
|
||||
|
||||
class ErrorHandler {
|
||||
const EMSCONNECT = 0;
|
||||
const EMSHTTP = 1;
|
||||
const EMSHTTP400 = 2;
|
||||
@@ -12,7 +13,7 @@ class ErrorHandler{
|
||||
const UNAUTHORIZED_USER = 9;
|
||||
const FAIL_IMAGERESIZE = 10;
|
||||
const UNEXPECTED_METHOD = 11;
|
||||
|
||||
|
||||
// apixu (deprecated)
|
||||
const APIXU_MISSING_INVALID_KEY = 1002;
|
||||
const APIXU_MISSING_Q = 1003;
|
||||
@@ -23,149 +24,147 @@ class ErrorHandler{
|
||||
const APIXU_EXCEED_QUOTA = 2007;
|
||||
const APIXU_DISABLED_KEY = 2008;
|
||||
const APIXU_INTERNAL_ERROR = 9999;
|
||||
|
||||
|
||||
|
||||
|
||||
// reCAPTCHA
|
||||
const MISSINGINPUTSECRET = "missing-input-secret";
|
||||
const INVALIDINPUTSECRET = "invalid-input-secret";
|
||||
const MISSINGINPUTRESPONSE = "missing-input-response";
|
||||
const INVALIDINPUTRESPONSE = "invalid-input-response";
|
||||
const INVALIDINPUTRESPONSE = "invalid-input-response";
|
||||
const BADREQUEST = "bad-request";
|
||||
|
||||
public static function get_message($errorCode, $p1 = null, $p2 = null, $p3 = null){
|
||||
|
||||
public static function get_message($errorCode, $p1 = null, $p2 = null, $p3 = null) {
|
||||
// sostituito switch/case con if/elseif perche non veniva cfatta la comparazione col tipo
|
||||
if($errorCode===self::EMSCONNECT){
|
||||
return (!is_null($p1)?"<span class='text-monospace'>Servizio <b>{$p1}</b></span><hr class='mt-0 mb-10'/>":"")
|
||||
."Il servizio EMS non è raggiungibile";
|
||||
|
||||
} else if($errorCode===self::EMSHTTP){
|
||||
return (!is_null($p1)?"<span class='text-monospace'>Servizio <b>{$p3}</b></span><hr class='mt-0 mb-10'/>":"")
|
||||
."La chiamata al servizio ha restituito l'errore http <u>".blankIfNull($p1)."</u>".(!is_null($p2)?"<div class='mt-10 text-muted text-monospace small'>{$p2}</div>":"");
|
||||
|
||||
} else if($errorCode===self::EMSHTTP400){
|
||||
return (!is_null($p1)?"<span class='text-monospace'>Servizio <b>{$p1}</b></span><hr class='mt-0 mb-10'/>":"")
|
||||
."La chiamata al servizio ha restituito l'errore http <u>400</u> (Bad Request)";
|
||||
|
||||
} else if($errorCode===self::EMSPARSE){
|
||||
return (!is_null($p1)?"<span class='text-monospace'>Servizio <b>{$p1}</b></span><hr class='mt-0 mb-10'/>":"").
|
||||
"Parse della risposta del servizio <b>".blankIfNull($p1)."</b> fallita";
|
||||
|
||||
} else if($errorCode===self::EMSNOMESSAGE){
|
||||
return (!is_null($p1)?"<span class='text-monospace'>Servizio <b>{$p1}</b></span><hr class='mt-0 mb-10'/>":"")
|
||||
."Messaggio di errore non pervenuto";
|
||||
|
||||
} else if($errorCode===self::MISSINGINPUTSECRET){
|
||||
if ($errorCode === self::EMSCONNECT) {
|
||||
return (!is_null($p1) ? "<span class='text-monospace'>Servizio <b>{$p1}</b></span><hr class='mt-0 mb-10'/>" : "")
|
||||
. "Il servizio EMS non è raggiungibile";
|
||||
|
||||
} else if ($errorCode === self::EMSHTTP) {
|
||||
return (!is_null($p1) ? "<span class='text-monospace'>Servizio <b>{$p3}</b></span><hr class='mt-0 mb-10'/>" : "")
|
||||
. "La chiamata al servizio ha restituito l'errore http <u>" . blankIfNull($p1) . "</u>" . (!is_null($p2) ? "<div class='mt-10 text-muted text-monospace small'>{$p2}</div>" : "");
|
||||
|
||||
} else if ($errorCode === self::EMSHTTP400) {
|
||||
return (!is_null($p1) ? "<span class='text-monospace'>Servizio <b>{$p1}</b></span><hr class='mt-0 mb-10'/>" : "")
|
||||
. "La chiamata al servizio ha restituito l'errore http <u>400</u> (Bad Request)";
|
||||
|
||||
} else if ($errorCode === self::EMSPARSE) {
|
||||
return (!is_null($p1) ? "<span class='text-monospace'>Servizio <b>{$p1}</b></span><hr class='mt-0 mb-10'/>" : "") .
|
||||
"Parse della risposta del servizio <b>" . blankIfNull($p1) . "</b> fallita";
|
||||
|
||||
} else if ($errorCode === self::EMSNOMESSAGE) {
|
||||
return (!is_null($p1) ? "<span class='text-monospace'>Servizio <b>{$p1}</b></span><hr class='mt-0 mb-10'/>" : "")
|
||||
. "Messaggio di errore non pervenuto";
|
||||
|
||||
} else if ($errorCode === self::MISSINGINPUTSECRET) {
|
||||
return "Parametro secret mancante";
|
||||
|
||||
} else if($errorCode===self::INVALIDINPUTSECRET){
|
||||
|
||||
} else if ($errorCode === self::INVALIDINPUTSECRET) {
|
||||
return "Parametro secret mancante o non valido";
|
||||
|
||||
} else if($errorCode===self::MISSINGINPUTRESPONSE){
|
||||
|
||||
} else if ($errorCode === self::MISSINGINPUTRESPONSE) {
|
||||
return "Parametro response mancante";
|
||||
|
||||
} else if($errorCode===self::INVALIDINPUTRESPONSE){
|
||||
|
||||
} else if ($errorCode === self::INVALIDINPUTRESPONSE) {
|
||||
return "Parametro response mancante o non valido";
|
||||
|
||||
} else if($errorCode===self::BADREQUEST){
|
||||
|
||||
} else if ($errorCode === self::BADREQUEST) {
|
||||
return "La richiesta non è valida";
|
||||
|
||||
} else if($errorCode===self::UNEXPECTED_AJAX_METHOD){
|
||||
|
||||
} else if ($errorCode === self::UNEXPECTED_AJAX_METHOD) {
|
||||
$body = $_SERVER["REQUEST_METHOD"] === "POST" ? $_POST : $_GET;
|
||||
unset($body["_"]);
|
||||
$method = count($body)>0 ? "<i>".implode(", ", array_keys($body))."</i>" : "ajax";
|
||||
$method = count($body) > 0 ? "<i>" . implode(", ", array_keys($body)) . "</i>" : "ajax";
|
||||
return "Il metodo richiesto {$method} non è previsto";
|
||||
|
||||
} else if($errorCode===self::MISSING_SETUP){
|
||||
|
||||
} else if ($errorCode === self::MISSING_SETUP) {
|
||||
$message = self::getGestSetupMissingInfo($p1);
|
||||
if(!is_null($message)){
|
||||
if (!is_null($message)) {
|
||||
return $message;
|
||||
|
||||
} else if(!is_null($p1) && is_string($p1)){
|
||||
|
||||
} else if (!is_null($p1) && is_string($p1)) {
|
||||
return "Il parametro <i>{$p1}</i> non è stato configurato";
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
return "Un parametro del modulo corrente non è stato configurato";
|
||||
}
|
||||
|
||||
} else if($errorCode===self::INVALID_REPORT){
|
||||
|
||||
} else if ($errorCode === self::INVALID_REPORT) {
|
||||
$message = self::getGestSetupMissingInfo($p1);
|
||||
if(!is_null($message)){
|
||||
return "Il report non risulta esser stato configurato:<br/>".$message;
|
||||
|
||||
} else{
|
||||
return "Il report ".((!is_null($p1) && is_string($p1))?"<i>{$p1}</i>":"")." non è valido";
|
||||
if (!is_null($message)) {
|
||||
return "Il report non risulta esser stato configurato:<br/>" . $message;
|
||||
} else {
|
||||
return "Il report " . ((!is_null($p1) && is_string($p1)) ? "<i>{$p1}</i>" : "") . "non è valido";
|
||||
}
|
||||
|
||||
} else if($errorCode===self::NORESULT_REPORT){
|
||||
|
||||
} else if ($errorCode === self::NORESULT_REPORT) {
|
||||
return "Il report non ha generato alcun risultato";
|
||||
|
||||
} else if($errorCode===self::UNAUTHORIZED_USER){
|
||||
|
||||
} else if ($errorCode === self::UNAUTHORIZED_USER) {
|
||||
return "La procedura non è abilitata all'utente";
|
||||
|
||||
} else if($errorCode===self::FAIL_IMAGERESIZE){
|
||||
|
||||
} else if ($errorCode === self::FAIL_IMAGERESIZE) {
|
||||
return "Ridimensionamento immagine fallito";
|
||||
}
|
||||
else if($errorCode===self::APIXU_MISSING_INVALID_KEY){
|
||||
} else if ($errorCode === self::APIXU_MISSING_INVALID_KEY) {
|
||||
return "La chiave API non è valida o non è stata specificata";
|
||||
|
||||
} else if($errorCode===self::APIXU_MISSING_Q){
|
||||
|
||||
} else if ($errorCode === self::APIXU_MISSING_Q) {
|
||||
return "Il parametro q non è stato specificato";
|
||||
} else if($errorCode===self::APIXU_INVALID_URL){
|
||||
} else if ($errorCode === self::APIXU_INVALID_URL) {
|
||||
return "L'url della richiesta non è valido";
|
||||
} else if($errorCode===self::APIXU_LOCATION_NOT_FOUND){
|
||||
} else if ($errorCode === self::APIXU_LOCATION_NOT_FOUND) {
|
||||
return "Luogo non trovato";
|
||||
} else if($errorCode===self::APIXU_DAY_UNAVAILABLE){
|
||||
} else if ($errorCode === self::APIXU_DAY_UNAVAILABLE) {
|
||||
return "Il meteo non è disponibile alla data selezionata";
|
||||
} else if($errorCode===self::APIXU_INVALID_KEY){
|
||||
} else if ($errorCode === self::APIXU_INVALID_KEY) {
|
||||
return "La chiave API non è valida";
|
||||
} else if($errorCode===self::APIXU_EXCEED_QUOTA){
|
||||
} else if ($errorCode === self::APIXU_EXCEED_QUOTA) {
|
||||
return "La chiave API ha superato il numero massimo di richieste consentite";
|
||||
} else if($errorCode===self::APIXU_DISABLED_KEY){
|
||||
} else if ($errorCode === self::APIXU_DISABLED_KEY) {
|
||||
return "La chiave API non è abilitata";
|
||||
} else if($errorCode===self::APIXU_INTERNAL_ERROR){
|
||||
} else if ($errorCode === self::APIXU_INTERNAL_ERROR) {
|
||||
return "Si è verificato un errore di applicazione interno";
|
||||
} else{
|
||||
} else {
|
||||
return "Si è verificato un errore non codificato";
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static function getGestSetupMissingInfo($GestSetup){
|
||||
if(\GestSetup::isGestSetupObject($GestSetup)){
|
||||
|
||||
private static function getGestSetupMissingInfo($GestSetup) {
|
||||
if (\GestSetup::isGestSetupObject($GestSetup)) {
|
||||
$description = $GestSetup->getDescription();
|
||||
|
||||
$message = "<span class='small font-italic text-uppercase'>".$GestSetup->getGestName()." > ".$GestSetup->getSection()." > <b>".$GestSetup->getKeySection()."</b></span>";
|
||||
if(!is_null($description)){
|
||||
$message .= " <span class='text-xs opacity-90 font-italic'>(".ucfirst($description).")</span>";
|
||||
|
||||
$message = "<span class='small font-italic text-uppercase'>" . $GestSetup->getGestName() . " > " . $GestSetup->getSection() . " > <b>" . $GestSetup->getKeySection() . "</b></span>";
|
||||
if (!is_null($description)) {
|
||||
$message .= " <span class='text-xs opacity-90 font-italic'>(" . ucfirst($description) . ")</span>";
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function get_title($errorCode, $p1 = null, $p2 = null, $p3 = null){
|
||||
if(in_array($errorCode, array(self::EMSHTTP400, self::EMSHTTP, self::EMSPARSE, self::EMSNOMESSAGE, self::EMSCONNECT))){
|
||||
|
||||
public static function get_title($errorCode, $p1 = null, $p2 = null, $p3 = null) {
|
||||
if (in_array($errorCode, array(self::EMSHTTP400, self::EMSHTTP, self::EMSPARSE, self::EMSNOMESSAGE, self::EMSCONNECT))) {
|
||||
return "Servizio non disponibile";
|
||||
|
||||
} else if(in_array($errorCode, array(self::UNEXPECTED_AJAX_METHOD, self::UNEXPECTED_METHOD))){
|
||||
|
||||
} else if (in_array($errorCode, array(self::UNEXPECTED_AJAX_METHOD, self::UNEXPECTED_METHOD))) {
|
||||
return "Operazione non valida";
|
||||
|
||||
} else if(in_array($errorCode, array(self::MISSING_SETUP))){
|
||||
|
||||
} else if (in_array($errorCode, array(self::MISSING_SETUP))) {
|
||||
return "Configurazione setup incompleta";
|
||||
|
||||
} else if(in_array($errorCode, array(self::INVALID_REPORT))){
|
||||
|
||||
} else if (in_array($errorCode, array(self::INVALID_REPORT))) {
|
||||
return "Report non configurato";
|
||||
|
||||
} else if(in_array($errorCode, array(self::NORESULT_REPORT))){
|
||||
|
||||
} else if (in_array($errorCode, array(self::NORESULT_REPORT))) {
|
||||
return "Report non generato";
|
||||
|
||||
} else if(in_array($errorCode, array(self::UNAUTHORIZED_USER))){
|
||||
|
||||
} else if (in_array($errorCode, array(self::UNAUTHORIZED_USER))) {
|
||||
return "Utente non autorizzato";
|
||||
|
||||
} else if(in_array($errorCode, array(self::APIXU_MISSING_INVALID_KEY, self::APIXU_MISSING_Q, self::APIXU_INVALID_URL, self::APIXU_LOCATION_NOT_FOUND, self::APIXU_DAY_UNAVAILABLE, self::APIXU_INVALID_KEY, self::APIXU_EXCEED_QUOTA, self::APIXU_DISABLED_KEY, self::APIXU_INTERNAL_ERROR))){
|
||||
|
||||
} else if (in_array($errorCode, array(self::APIXU_MISSING_INVALID_KEY, self::APIXU_MISSING_Q, self::APIXU_INVALID_URL, self::APIXU_LOCATION_NOT_FOUND, self::APIXU_DAY_UNAVAILABLE, self::APIXU_INVALID_KEY, self::APIXU_EXCEED_QUOTA, self::APIXU_DISABLED_KEY, self::APIXU_INTERNAL_ERROR))) {
|
||||
return "Servizio meteo non disponibile";
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
<?php
|
||||
|
||||
class EscposPrinter{
|
||||
class EscposPrinter {
|
||||
private $tempFile = null;
|
||||
private $instance = null;
|
||||
private $html = null;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->init_instance();
|
||||
$this->html = "";
|
||||
}
|
||||
|
||||
public function init_instance(){
|
||||
|
||||
public function init_instance() {
|
||||
$this->tempFile = Cache::tempFile();
|
||||
$connector = new Mike42\Escpos\PrintConnectors\FilePrintConnector($this->tempFile);
|
||||
// $connector = new Mike42\Escpos\PrintConnectors\NetworkPrintConnector("127.0.0.1", 9100);
|
||||
// $connector = new Mike42\Escpos\PrintConnectors\NetworkPrintConnector("127.0.0.1", 9100);
|
||||
$this->instance = new Mike42\Escpos\Printer($connector);
|
||||
}
|
||||
|
||||
public function get_blob(){
|
||||
if(!is_null($this->tempFile) && file_exists($this->tempFile)){
|
||||
|
||||
public function get_blob() {
|
||||
if (!is_null($this->tempFile) && file_exists($this->tempFile)) {
|
||||
return file_get_contents($this->tempFile);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function to_html(){
|
||||
|
||||
public function to_html() {
|
||||
return $this->html;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// <editor-fold desc="FUNZIONI Mike42\Escpos" defaultstate="collapsed">
|
||||
const MODE_DOUBLE_WIDTH = Mike42\Escpos\Printer::MODE_DOUBLE_WIDTH;
|
||||
const MODE_FONT_A = Mike42\Escpos\Printer::MODE_FONT_A;
|
||||
@@ -36,32 +36,39 @@ class EscposPrinter{
|
||||
const JUSTIFY_LEFT = Mike42\Escpos\Printer::JUSTIFY_LEFT;
|
||||
const JUSTIFY_CENTER = Mike42\Escpos\Printer::JUSTIFY_CENTER;
|
||||
const JUSTIFY_RIGHT = Mike42\Escpos\Printer::JUSTIFY_RIGHT;
|
||||
public function feed($lines = 1){
|
||||
|
||||
public function feed($lines = 1) {
|
||||
$this->instance->feed($lines);
|
||||
return $this;
|
||||
}
|
||||
public function text($str = ""){
|
||||
|
||||
public function text($str = "") {
|
||||
$this->instance->text($str);
|
||||
$this->html .= str_replace(" ", " ", str_replace("\n", "<br/>", $str));
|
||||
return $this;
|
||||
}
|
||||
public function selectPrintMode($mode = self::MODE_FONT_A){
|
||||
|
||||
public function selectPrintMode($mode = self::MODE_FONT_A) {
|
||||
$this->instance->selectPrintMode($mode);
|
||||
return $this;
|
||||
}
|
||||
public function setEmphasis($on = true){
|
||||
|
||||
public function setEmphasis($on = true) {
|
||||
$this->instance->setEmphasis($on);
|
||||
return $this;
|
||||
}
|
||||
public function setJustification($justification = self::JUSTIFY_LEFT){
|
||||
|
||||
public function setJustification($justification = self::JUSTIFY_LEFT) {
|
||||
$this->instance->setJustification($justification);
|
||||
return $this;
|
||||
}
|
||||
public function cut($mode = Mike42\Escpos\Printer::CUT_FULL, $lines = 3){
|
||||
|
||||
public function cut($mode = Mike42\Escpos\Printer::CUT_FULL, $lines = 3) {
|
||||
$this->instance->cut($mode, $lines);
|
||||
return $this;
|
||||
}
|
||||
public function close(){
|
||||
|
||||
public function close() {
|
||||
$this->instance->close();
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
class FileExchange{
|
||||
|
||||
class FileExchange {
|
||||
// <editor-fold desc="PARAMETERS" defaultstate="collapsed">
|
||||
private $profileDB = null;
|
||||
private $codMdep = null;
|
||||
private $filename = null;
|
||||
private $subDirs = null;
|
||||
private $content = null;
|
||||
|
||||
|
||||
private $urlService = null;
|
||||
private $action = null;
|
||||
private $asServer = false;
|
||||
@@ -14,49 +15,58 @@ class FileExchange{
|
||||
private $contentHash = null;
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="SETTERS" defaultstate="collapsed">
|
||||
public function profileDB($value){
|
||||
public function profileDB($value) {
|
||||
$this->profileDB = $value;
|
||||
return $this;
|
||||
}
|
||||
public function codMdep($value){
|
||||
|
||||
public function codMdep($value) {
|
||||
$this->codMdep = $value;
|
||||
return $this;
|
||||
}
|
||||
public function subDirs($value){
|
||||
|
||||
public function subDirs($value) {
|
||||
$this->subDirs = $value;
|
||||
return $this;
|
||||
}
|
||||
public function filename($value){
|
||||
|
||||
public function filename($value) {
|
||||
$this->filename = $value;
|
||||
return $this;
|
||||
}
|
||||
public function content($value){
|
||||
|
||||
public function content($value) {
|
||||
$this->content = base64_encode(Utility\Compression\GZ::encode($value));
|
||||
$this->contentSize = Utility::blobSize($value);
|
||||
$this->contentHash = $this->get_blobHash($value);
|
||||
return $this;
|
||||
}
|
||||
public function urlService($value){
|
||||
|
||||
public function urlService($value) {
|
||||
$this->urlService = $value;
|
||||
return $this;
|
||||
}
|
||||
public function asServer($value = true){
|
||||
|
||||
public function asServer($value = true) {
|
||||
$this->asServer = $value;
|
||||
return $this;
|
||||
}
|
||||
public function upload(){
|
||||
|
||||
public function upload() {
|
||||
$this->action = "upload";
|
||||
return $this;
|
||||
}
|
||||
public function download(){
|
||||
|
||||
public function download() {
|
||||
$this->action = "download";
|
||||
return $this;
|
||||
}
|
||||
public function getLog(){
|
||||
|
||||
public function getLog() {
|
||||
$this->action = "get_log";
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="GETTERS" defaultstate="collapsed">
|
||||
/*
|
||||
@@ -67,58 +77,59 @@ class FileExchange{
|
||||
return strlen($byte);
|
||||
}
|
||||
}*/
|
||||
|
||||
private function get_blobHash($byte){
|
||||
|
||||
private function get_blobHash($byte) {
|
||||
return strtolower(md5($byte));
|
||||
}
|
||||
|
||||
private function get_urlService(){
|
||||
if(!is_null($this->urlService)){
|
||||
|
||||
private function get_urlService() {
|
||||
if (!is_null($this->urlService)) {
|
||||
return $this->urlService;
|
||||
}
|
||||
return self::get_defaultUrlService();
|
||||
}
|
||||
|
||||
public static function get_defaultUrlService(){
|
||||
if(PVM::isDevClient()){
|
||||
|
||||
public static function get_defaultUrlService() {
|
||||
if (PVM::isDevClient()) {
|
||||
return "http://192.168.2.26/sync/filesync.php";
|
||||
// return "http://127.0.0.1/sync/filesync.php";
|
||||
// return "http://127.0.0.1/sync/filesync.php";
|
||||
}
|
||||
$GestSetup = new GestSetup;
|
||||
return $GestSetup->gest_name("INTEGRETAIL")->section("SYNC")->keySection("ENDPOINT_WEB")->get();
|
||||
}
|
||||
|
||||
private function get_profileDb(){
|
||||
if(is_null($this->profileDB)){
|
||||
|
||||
private function get_profileDb() {
|
||||
if (is_null($this->profileDB)) {
|
||||
return User::get_current_profileDb();
|
||||
}
|
||||
return $this->profileDB;
|
||||
}
|
||||
|
||||
private function get_codMdep(){
|
||||
if(is_null($this->codMdep)){
|
||||
|
||||
private function get_codMdep() {
|
||||
if (is_null($this->codMdep)) {
|
||||
return User::get_current_userCodMdep();
|
||||
}
|
||||
return $this->codMdep;
|
||||
}
|
||||
|
||||
private function get_mode(){
|
||||
|
||||
private function get_mode() {
|
||||
return $this->asServer === true ? "SERVER" : "CLIENT";
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new Ret;
|
||||
$action = $this->action;
|
||||
if(!is_null($action)){
|
||||
try{
|
||||
if (!is_null($action)) {
|
||||
try {
|
||||
$data = array(
|
||||
"action" => $action,
|
||||
"profileDB" => $this->get_profileDb(),
|
||||
"cod_mdep" => $this->get_codMdep()
|
||||
);
|
||||
|
||||
if($action=="upload"){
|
||||
|
||||
if ($action == "upload") {
|
||||
$data = array_merge($data, array(
|
||||
"hash" => $this->contentHash,
|
||||
"size" => $this->contentSize,
|
||||
@@ -128,39 +139,39 @@ class FileExchange{
|
||||
"content" => $this->content
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
$url = $this->get_urlService();
|
||||
if(!is_null($url)){
|
||||
|
||||
if (!is_null($url)) {
|
||||
|
||||
$Httpful = Httpful\Request::init();
|
||||
|
||||
if($action=="upload"){
|
||||
|
||||
if ($action == "upload") {
|
||||
$Httpful->method(Httpful\Http::POST)
|
||||
->uri($url)
|
||||
->sendsType(Httpful\Mime::FORM)
|
||||
->body(http_build_query(array("data" => Utility::B64JSON_stringify($data))));
|
||||
|
||||
}else{ // download / get_log
|
||||
$url .= "?".http_build_query(array("data" => Utility::B64JSON_stringify($data)));
|
||||
->uri($url)
|
||||
->sendsType(Httpful\Mime::FORM)
|
||||
->body(http_build_query(array("data" => Utility::B64JSON_stringify($data))));
|
||||
|
||||
} else { // download / get_log
|
||||
$url .= "?" . http_build_query(array("data" => Utility::B64JSON_stringify($data)));
|
||||
$Httpful->method(Httpful\Http::GET)->uri($url);
|
||||
}
|
||||
|
||||
|
||||
$response = $Httpful->send();
|
||||
if($response->code==200){
|
||||
if ($response->code == 200) {
|
||||
$Ret->parse($response->raw_body);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_errorCode(ErrorHandler::EMSHTTP, $response->code);
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Url del servizio FileExchange nullo");
|
||||
}
|
||||
} catch(Httpful\Exception\ConnectionErrorException $e){
|
||||
$Ret->set_error("Servizio FileExchange non disponibile (".$e->getMessage().")");
|
||||
} catch(Exception $e){
|
||||
} catch (Httpful\Exception\ConnectionErrorException $e) {
|
||||
$Ret->set_error("Servizio FileExchange non disponibile (" . $e->getMessage() . ")");
|
||||
} catch (Exception $e) {
|
||||
$Ret->set_error($e->getMessage());
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Operazione servizio FileExchange non definita");
|
||||
}
|
||||
return $Ret;
|
||||
|
||||
@@ -1,42 +1,43 @@
|
||||
<?php
|
||||
class Format{
|
||||
|
||||
class Format {
|
||||
const EXCEL = "EXCEL";
|
||||
const PDF = "PDF";
|
||||
|
||||
|
||||
const IMS_NULL_STRING = "[NULL]";
|
||||
const IMS_NULL_ANY = "NULL";
|
||||
const IMS_NULL_TIME = "1900-01-01 00:00:00";
|
||||
|
||||
|
||||
const strtotimeDMY = "d/m/Y";
|
||||
const strtotimeDMYHMS = "d/m/Y H:i:s";
|
||||
const strtotimeDMYHM = "d/m/Y H:i";
|
||||
|
||||
const strtotimeYMDHMS = "Y-m-d H:i:s";
|
||||
const strtotimeYMDHM = "Y-m-d H:i";
|
||||
const strtotimeDMYHMS = "d/m/Y H:i:s";
|
||||
|
||||
const strtotimeYMD = "Y-m-d";
|
||||
|
||||
const strtotimeYMDHM = "Y-m-d H:i";
|
||||
const strtotimeYMDHMS = "Y-m-d H:i:s";
|
||||
|
||||
const strtotimeHM = "H:i";
|
||||
const strtotimeHMS = "H:i:s";
|
||||
|
||||
|
||||
const strftimeYMD = "%Y-%m-%d";
|
||||
const strftimeSlashedYMD = "%Y/%m/%d";
|
||||
|
||||
const strftimeYMDHMS = "%Y-%m-%d %H:%M:%S";
|
||||
const strftimeYMDHM = "%Y-%m-%d %H:%M";
|
||||
|
||||
const strftimeYMDTHM = "%Y-%m-%dT%H:%M";
|
||||
|
||||
const strftimeDMY = "%d/%m/%Y";
|
||||
const strftimeDMYHM = "%d/%m/%Y %H:%M";
|
||||
const strftimeDMYHMS = "%d/%m/%Y %H:%M:%S";
|
||||
|
||||
|
||||
const strftimeDMy = "%d/%m/%y";
|
||||
const strftimeDMYY = "%d/%m/%Y";
|
||||
const strftimeDMyHM = "%d/%m/%y %H:%M";
|
||||
const strftimeDMyHMS = "%d/%m/%y %H:%M:%S";
|
||||
|
||||
|
||||
const strftimeDM = "%d/%m";
|
||||
|
||||
|
||||
const strftimeHM = "%H:%M";
|
||||
const strftimeHMS = "%H:%M:%S";
|
||||
|
||||
|
||||
const latLng1 = "lat;lng";
|
||||
}
|
||||
@@ -1,32 +1,32 @@
|
||||
<?php
|
||||
class FotoArticoli{
|
||||
public static function resizeImage($blob, $fileName, $maxWidth, $maxHeight, $forceRewrite = false){
|
||||
|
||||
class FotoArticoli {
|
||||
public static function resizeImage($blob, $fileName, $maxWidth, $maxHeight, $forceRewrite = false) {
|
||||
$ret = false;
|
||||
$Image = new \Utility\Image;
|
||||
if($Image->importFromBlob($blob)){
|
||||
if ($Image->importFromBlob($blob)) {
|
||||
$Image->basename($fileName);
|
||||
if($Image->resize($maxWidth, $maxHeight, true, true, $forceRewrite)){
|
||||
if ($Image->resize($maxWidth, $maxHeight, true, true, $forceRewrite)) {
|
||||
$ret = $Image->get_fileCachedPath();
|
||||
} else{
|
||||
} else {
|
||||
//echo "no";exit;
|
||||
}
|
||||
}
|
||||
unset($Image);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
private static function set_additionalInfo($item){
|
||||
|
||||
private static function set_additionalInfo($item) {
|
||||
$base_path_dest = PVM::isDevClient() ? "../" : "";
|
||||
$item["flag_exists"] = true;
|
||||
if(!is_null($item["path_link"])){
|
||||
$item["path_link"] = $base_path_dest."../".$item["path_link"];
|
||||
if (!is_null($item["path_link"])) {
|
||||
$item["path_link"] = $base_path_dest . "../" . $item["path_link"];
|
||||
$item["flag_exists"] = file_exists($item["path_link"]);
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function get_photoArt($codMart, $idRiga = null)
|
||||
{
|
||||
public static function get_photoArt($codMart, $idRiga = null) {
|
||||
$Ret = MtbAartLink::get_items($codMart, $idRiga);
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
class GestSetup{
|
||||
|
||||
class GestSetup {
|
||||
private $setupTable = "stb_gest_setup";
|
||||
|
||||
|
||||
private $profileDB;
|
||||
|
||||
|
||||
public $gest_name = null;
|
||||
public $section = null;
|
||||
public $key_section = null;
|
||||
|
||||
|
||||
private $default_value;
|
||||
private $asArray;
|
||||
private $asJson;
|
||||
@@ -18,281 +19,281 @@ class GestSetup{
|
||||
private $separator = "|";
|
||||
private $_currentModule = null;
|
||||
private $_caller = null;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
||||
public function init() {
|
||||
$this->_currentModule = Controller::current_module();
|
||||
$caller = debug_backtrace();
|
||||
if(isset($caller[3])){
|
||||
if (isset($caller[3])) {
|
||||
$this->_caller = $caller[3];
|
||||
}
|
||||
|
||||
|
||||
return $this->gest_name("PVM")
|
||||
// ->section(Controller::current_module())
|
||||
->keySection(null)
|
||||
->default_value(false)
|
||||
->asString();
|
||||
// ->section(Controller::current_module())
|
||||
->keySection(null)
|
||||
->default_value(false)
|
||||
->asString();
|
||||
}
|
||||
|
||||
private function getModulo(){
|
||||
|
||||
private function getModulo() {
|
||||
$caller = $this->_caller;
|
||||
$azienda = Config::get_azienda();
|
||||
if(isset($caller["class"])){
|
||||
if (isset($caller["class"])) {
|
||||
$callerClassName = strtolower(\Utility\Str::camelCaseDecode($caller["class"]));
|
||||
if(!is_null(AziendaUtils::getModulo($callerClassName, $azienda))){
|
||||
if (!is_null(AziendaUtils::getModulo($callerClassName, $azienda))) {
|
||||
return $callerClassName;
|
||||
}
|
||||
}
|
||||
return $this->_currentModule;
|
||||
}
|
||||
|
||||
public function profileDB($v){
|
||||
|
||||
public function profileDB($v) {
|
||||
$this->profileDB = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGestName(){
|
||||
|
||||
public function getGestName() {
|
||||
return $this->gest_name;
|
||||
}
|
||||
|
||||
public function getSection(){
|
||||
if(is_null($this->section)){
|
||||
|
||||
public function getSection() {
|
||||
if (is_null($this->section)) {
|
||||
$this->section(strtoupper($this->getModulo()));
|
||||
}
|
||||
return $this->section;
|
||||
}
|
||||
|
||||
public function getKeySection(){
|
||||
|
||||
public function getKeySection() {
|
||||
return $this->key_section;
|
||||
}
|
||||
|
||||
public function getDescription(){
|
||||
|
||||
public function getDescription() {
|
||||
$Ret = self::getRecord();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$record = $Ret->get_data();
|
||||
if(!is_null($record)){
|
||||
return $record["description"];
|
||||
if (!is_null($record)) {
|
||||
return $record["description"];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function gest_name($v){
|
||||
* @deprecated
|
||||
*/
|
||||
public function gest_name($v) {
|
||||
return $this->gestName($v);
|
||||
}
|
||||
|
||||
public function gestName($v){
|
||||
|
||||
public function gestName($v) {
|
||||
$this->gest_name = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function section($v){
|
||||
|
||||
public function section($v) {
|
||||
$this->section = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function key_section($v){
|
||||
* @deprecated
|
||||
*/
|
||||
public function key_section($v) {
|
||||
return $this->keySection($v);
|
||||
}
|
||||
|
||||
public function keySection($v){
|
||||
|
||||
public function keySection($v) {
|
||||
$this->key_section = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function default_value($v){
|
||||
* @deprecated
|
||||
*/
|
||||
public function default_value($v) {
|
||||
return $this->defaultValue($v);
|
||||
}
|
||||
|
||||
public function defaultValue($v){
|
||||
|
||||
public function defaultValue($v) {
|
||||
$this->default_value = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asString($v = true){
|
||||
if($v===true){
|
||||
|
||||
public function asString($v = true) {
|
||||
if ($v === true) {
|
||||
$this->asArray(false)->asFloat(false)->asInt(false)->asJson(false)->asBoolean(false);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asArray($v = true){
|
||||
|
||||
public function asArray($v = true) {
|
||||
$this->asArray = $v;
|
||||
if($v===true){
|
||||
if ($v === true) {
|
||||
$this->asFloat(false)->asInt(false)->asJson(false)->asBoolean(false);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asFloat($v = true){
|
||||
|
||||
public function asFloat($v = true) {
|
||||
$this->asFloat = $v;
|
||||
if($v===true){
|
||||
if ($v === true) {
|
||||
$this->asArray(false)->asInt(false)->asJson(false)->asBoolean(false);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asInt($v = true){
|
||||
|
||||
public function asInt($v = true) {
|
||||
$this->asInt = $v;
|
||||
if($v===true){
|
||||
if ($v === true) {
|
||||
$this->asArray(false)->asFloat(false)->asJson(false)->asBoolean(false);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asJson($v = true){
|
||||
|
||||
public function asJson($v = true) {
|
||||
$this->asJson = $v;
|
||||
if($v===true){
|
||||
if ($v === true) {
|
||||
$this->asArray(false)->asFloat(false)->asInt(false)->asBoolean(false);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asBoolean($v = true){
|
||||
|
||||
public function asBoolean($v = true) {
|
||||
$this->asBoolean = $v;
|
||||
if($v===true){
|
||||
if ($v === true) {
|
||||
$this->asArray(false)->asFloat(false)->asInt(false)->asJson(false);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function parseValue($value){
|
||||
if($this->default_value===false){
|
||||
if($this->asBoolean===true){
|
||||
|
||||
public function parseValue($value) {
|
||||
if ($this->default_value === false) {
|
||||
if ($this->asBoolean === true) {
|
||||
$this->default_value("N"); // perchè boolval(null) = false
|
||||
|
||||
} else if($this->asArray===true){
|
||||
|
||||
} else if ($this->asArray === true) {
|
||||
$this->default_value(array());
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$this->default_value(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$value = nullIfBlank($value);
|
||||
if(is_null($value)){
|
||||
if (is_null($value)) {
|
||||
$value = $this->default_value;
|
||||
}
|
||||
|
||||
if(!is_null($value)){
|
||||
if($this->asArray===true){
|
||||
if(is_string($value)){
|
||||
if(strpos($value, $this->separator)===false){
|
||||
|
||||
if (!is_null($value)) {
|
||||
if ($this->asArray === true) {
|
||||
if (is_string($value)) {
|
||||
if (strpos($value, $this->separator) === false) {
|
||||
$this->separator = ",";
|
||||
}
|
||||
return explode($this->separator, $value);
|
||||
}
|
||||
|
||||
} else if($this->asJson===true){
|
||||
if(is_string($value)){
|
||||
|
||||
} else if ($this->asJson === true) {
|
||||
if (is_string($value)) {
|
||||
return @json_decode($value, true);
|
||||
}
|
||||
|
||||
} else if($this->asBoolean===true){
|
||||
|
||||
} else if ($this->asBoolean === true) {
|
||||
return boolValue($value);
|
||||
|
||||
} else if($this->asInt===true){
|
||||
if(is_numeric($value)){
|
||||
} else if ($this->asInt === true) {
|
||||
if (is_numeric($value)) {
|
||||
return intval($value);
|
||||
}
|
||||
|
||||
} else if($this->asFloat===true){
|
||||
if(is_numeric($value)){
|
||||
|
||||
} else if ($this->asFloat === true) {
|
||||
if (is_numeric($value)) {
|
||||
return floatval($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
private function getHash(){
|
||||
$rawString = !is_null($this->profileDB) ? $this->profileDB.";" : "";
|
||||
$rawString .= $this->gest_name.";";
|
||||
$rawString .= $this->getSection().";";
|
||||
|
||||
private function getHash() {
|
||||
$rawString = !is_null($this->profileDB) ? $this->profileDB . ";" : "";
|
||||
$rawString .= $this->gest_name . ";";
|
||||
$rawString .= $this->getSection() . ";";
|
||||
$rawString .= $this->key_section;
|
||||
return md5($rawString);
|
||||
}
|
||||
|
||||
private function getFromCache(){
|
||||
|
||||
private function getFromCache() {
|
||||
$hash = $this->getHash();
|
||||
if(!isset($GLOBALS[$this->setupTable])){
|
||||
if (!isset($GLOBALS[$this->setupTable])) {
|
||||
$GLOBALS[$this->setupTable] = array();
|
||||
}
|
||||
|
||||
if(array_key_exists($hash, $GLOBALS[$this->setupTable])){
|
||||
|
||||
if (array_key_exists($hash, $GLOBALS[$this->setupTable])) {
|
||||
$Ret = new Ret;
|
||||
return $Ret->set_data($GLOBALS[$this->setupTable][$hash]);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function cacheValue($value){
|
||||
|
||||
private function cacheValue($value) {
|
||||
$hash = $this->getHash();
|
||||
if(!isset($GLOBALS[$this->setupTable])){
|
||||
if (!isset($GLOBALS[$this->setupTable])) {
|
||||
$GLOBALS[$this->setupTable] = array();
|
||||
}
|
||||
$GLOBALS[$this->setupTable][$hash] = $value;
|
||||
}
|
||||
|
||||
private function getRecord(){
|
||||
|
||||
private function getRecord() {
|
||||
$Query = new Query;
|
||||
$Query->select(
|
||||
"CONVERT(TEXT, value) AS value",
|
||||
$this->setupTable.".description",
|
||||
"stb_gest_setup_query.cod_query",
|
||||
"stb_gest_setup_query.description AS query_description"
|
||||
)
|
||||
->from($this->setupTable." LEFT OUTER JOIN stb_gest_setup_query ON ".$this->setupTable.".query_default = stb_gest_setup_query.cod_query")
|
||||
->where("section", $this->getSection())
|
||||
->where("gest_name", $this->gest_name)
|
||||
->where("key_section", $this->key_section);
|
||||
if(!is_null($this->profileDB)){
|
||||
"CONVERT(TEXT, value) AS value",
|
||||
$this->setupTable . ".description",
|
||||
"stb_gest_setup_query.cod_query",
|
||||
"stb_gest_setup_query.description AS query_description"
|
||||
)
|
||||
->from($this->setupTable . " LEFT OUTER JOIN stb_gest_setup_query ON " . $this->setupTable . ".query_default = stb_gest_setup_query.cod_query")
|
||||
->where("section", $this->getSection())
|
||||
->where("gest_name", $this->gest_name)
|
||||
->where("key_section", $this->key_section);
|
||||
if (!is_null($this->profileDB)) {
|
||||
$Query->profileDB($this->profileDB);
|
||||
}
|
||||
|
||||
|
||||
$Ret = $Query->firstRow()->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$this->cacheValue($Ret->get_data());
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function get(){
|
||||
|
||||
public function get() {
|
||||
$Ret = $this->getFromCache();
|
||||
if(is_null($Ret)){
|
||||
if (is_null($Ret)) {
|
||||
$Ret = $this->getRecord();
|
||||
}
|
||||
|
||||
|
||||
$data = $Ret->is_OK() ? $Ret->get_data() : null;
|
||||
return $this->parseValue($data["value"]);
|
||||
return $this->parseValue(isset($data["value"]) ? $data["value"] : null);
|
||||
}
|
||||
|
||||
public static function isGestSetupObject($value){
|
||||
return (gettype($value)=="object" && (get_class($value)=="GestSetup" || is_subclass_of($value, "GestSetup")));
|
||||
|
||||
public static function isGestSetupObject($value) {
|
||||
return (gettype($value) == "object" && (get_class($value) == "GestSetup" || is_subclass_of($value, "GestSetup")));
|
||||
}
|
||||
|
||||
public function set($value){
|
||||
|
||||
public function set($value) {
|
||||
$EntityItem = new \EntityItem($this->setupTable);
|
||||
$EntityItem->insert_or_update()
|
||||
->set("gestName", $this->gest_name)
|
||||
->set("section", $this->getSection())
|
||||
->set("keySection", $this->key_section)
|
||||
->set("value", $value);
|
||||
->set("gestName", $this->gest_name)
|
||||
->set("section", $this->getSection())
|
||||
->set("keySection", $this->key_section)
|
||||
->set("value", $value);
|
||||
return $EntityItem->send();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
<?php
|
||||
class GestSetupDepo extends GestSetup{
|
||||
|
||||
class GestSetupDepo extends GestSetup {
|
||||
private $setupTable = "stb_gest_setup_depo";
|
||||
private $codMdep = null;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
||||
public function init() {
|
||||
return parent::init()->cod_mdep(User::get_current_userCodMdep());
|
||||
}
|
||||
|
||||
public function cod_mdep($value){
|
||||
|
||||
public function cod_mdep($value) {
|
||||
$this->codMdep = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get(){
|
||||
|
||||
public function get() {
|
||||
$Query = new Query;
|
||||
$Query->select("CONVERT(TEXT, value) AS value")
|
||||
->from($this->setupTable)
|
||||
->where("cod_mdep", $this->codMdep)
|
||||
->where("section", $this->getSection())
|
||||
->where("gest_name", $this->gest_name)
|
||||
->where("key_section", $this->key_section);
|
||||
|
||||
->from($this->setupTable)
|
||||
->where("cod_mdep", $this->codMdep)
|
||||
->where("section", $this->getSection())
|
||||
->where("gest_name", $this->gest_name)
|
||||
->where("key_section", $this->key_section);
|
||||
|
||||
$Ret = $Query->firstRowFirstValue()->toRet()->execute();
|
||||
$value = $Ret->is_OK() ? $Ret->get_data() : null;
|
||||
return $this->parseValue($value);
|
||||
|
||||
@@ -1,70 +1,71 @@
|
||||
<?php
|
||||
class GestSetupWebUser extends GestSetup{
|
||||
|
||||
class GestSetupWebUser extends GestSetup {
|
||||
private $setupTable = "wtb_gest_setup_user";
|
||||
private $userName = null;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
||||
public function init() {
|
||||
return parent::init()->userName(User::get_current_username());
|
||||
}
|
||||
|
||||
public function userName($value){
|
||||
|
||||
public function userName($value) {
|
||||
$this->userName = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function check_userGrant(){
|
||||
if(!User::group_is(User::RESPONSABILE_EDP, User::AMMINISTRATORE_SISTEMA)){
|
||||
|
||||
private function check_userGrant() {
|
||||
if (!User::group_is(User::RESPONSABILE_EDP, User::AMMINISTRATORE_SISTEMA)) {
|
||||
return \Utility\Str::ciEquals($this->userName, User::get_current_username());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get(){
|
||||
|
||||
public function get() {
|
||||
$Query = new Query;
|
||||
$Query->select("CONVERT(TEXT, value) AS value")
|
||||
->from($this->setupTable)
|
||||
->where("user_name", $this->userName)
|
||||
->where("section", $this->getSection())
|
||||
->where("gest_name", $this->gest_name)
|
||||
->where("key_section", $this->key_section);
|
||||
|
||||
->from($this->setupTable)
|
||||
->where("user_name", $this->userName)
|
||||
->where("section", $this->getSection())
|
||||
->where("gest_name", $this->gest_name)
|
||||
->where("key_section", $this->key_section);
|
||||
|
||||
$Ret = $Query->firstRowFirstValue()->toRet()->execute();
|
||||
$value = $Ret->is_OK() ? $Ret->get_data() : null;
|
||||
return $this->parseValue($value);
|
||||
}
|
||||
|
||||
public function set($value){
|
||||
|
||||
public function set($value) {
|
||||
$Ret = new Ret;
|
||||
if($this->checkKey()){
|
||||
if($this->check_userGrant()){
|
||||
|
||||
if ($this->checkKey()) {
|
||||
if ($this->check_userGrant()) {
|
||||
|
||||
$EntityItem = new \EntityItem($this->setupTable);
|
||||
$EntityItem->insert_or_update()
|
||||
->set("userName", $this->userName)
|
||||
->set("gestName", $this->gest_name)
|
||||
->set("section", $this->getSection())
|
||||
->set("keySection", $this->key_section)
|
||||
->set("value", $value);
|
||||
|
||||
->set("userName", $this->userName)
|
||||
->set("gestName", $this->gest_name)
|
||||
->set("section", $this->getSection())
|
||||
->set("keySection", $this->key_section)
|
||||
->set("value", $value);
|
||||
|
||||
$Ret = $EntityItem->send();
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Utente non abilitato");
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Chiave setup incompleta");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function checkKey(){
|
||||
|
||||
public function checkKey() {
|
||||
return !is_null($this->gest_name) && !is_null($this->getSection()) && !is_null($this->key_section) && !is_null($this->userName);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,52 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class CheckPartitaIva extends \IMSApi{
|
||||
class CheckPartitaIva extends \IMSApi {
|
||||
private $countryCode = null;
|
||||
private $vatNumber = null;
|
||||
|
||||
|
||||
// <editor-fold desc="SETTERS" defaultstate="collapsed">
|
||||
public function countryCode($value){
|
||||
public function countryCode($value) {
|
||||
$this->countryCode = strtoupper($value);
|
||||
return $this;
|
||||
}
|
||||
public function vatNumber($value){
|
||||
|
||||
public function vatNumber($value) {
|
||||
$this->vatNumber = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->countryCode("IT")->service("checkPartitaIva")->post()->asJson();
|
||||
}
|
||||
|
||||
private static function get_indirizzo($address){ // portarlo fuori
|
||||
|
||||
private static function get_indirizzo($address) { // portarlo fuori
|
||||
$IMSApi = new \IMSApi("geocode");
|
||||
$Ret = $IMSApi->queryParams(array("address" => $address))->send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
if(isset($retData[0]["dto"])){
|
||||
if (isset($retData[0]["dto"])) {
|
||||
$Ret->set_data($retData[0]["dto"]);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_data(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new \Ret;
|
||||
if(!is_null($this->countryCode) && !is_null($this->vatNumber)){
|
||||
if($this->is_valid()){
|
||||
if (!is_null($this->countryCode) && !is_null($this->vatNumber)) {
|
||||
if ($this->is_valid()) {
|
||||
$body = array("countryCode" => $this->countryCode, "vatNumber" => $this->vatNumber);
|
||||
$this->body($body);
|
||||
$Ret = parent::send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$dto = $retData[0]["dto"];
|
||||
|
||||
|
||||
$newtemp = true;
|
||||
if(!$newtemp){
|
||||
if (!$newtemp) {
|
||||
$return = array(
|
||||
"valid" => $dto["valid"],
|
||||
"name" => $dto["name"],
|
||||
@@ -57,7 +60,7 @@ class CheckPartitaIva extends \IMSApi{
|
||||
"prov" => null
|
||||
);
|
||||
$Ret2 = self::get_indirizzo($dto["address"]);
|
||||
if($Ret2->is_OK()){
|
||||
if ($Ret2->is_OK()) {
|
||||
$retData = $Ret2->get_data();
|
||||
$return["indirizzo"] = $retData["indirizzo"];
|
||||
$return["citta"] = $retData["citta"];
|
||||
@@ -65,31 +68,31 @@ class CheckPartitaIva extends \IMSApi{
|
||||
$return["prov"] = $retData["prov"];
|
||||
}
|
||||
$Ret->set_data($return);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_data($dto);
|
||||
}
|
||||
|
||||
} else{
|
||||
if($Ret->get_number()==400){
|
||||
|
||||
} else {
|
||||
if ($Ret->get_number() == 400) {
|
||||
$Ret->set_error("Partita IVA non formalmente valida");
|
||||
}
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Partita IVA non valida");
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Parametri incompleti");
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private function is_valid(){
|
||||
if($this->countryCode=="IT"){
|
||||
|
||||
private function is_valid() {
|
||||
if ($this->countryCode == "IT") {
|
||||
$pi = $this->vatNumber;
|
||||
if(is_string($pi) && strlen($pi)==11 && is_numeric($pi)){
|
||||
if (is_string($pi) && strlen($pi) == 11 && is_numeric($pi)) {
|
||||
$checksum = "";
|
||||
foreach(str_split(strrev($pi)) as $i => $d) {
|
||||
$checksum .= $i%2 !== 0 ? $d*2 : $d;
|
||||
foreach (str_split(strrev($pi)) as $i => $d) {
|
||||
$checksum .= $i % 2 !== 0 ? $d * 2 : $d;
|
||||
}
|
||||
return array_sum(str_split($checksum)) % 10 === 0;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class Export extends \IMSApi\ImportExport{
|
||||
|
||||
public function __construct(){
|
||||
class Export extends \IMSApi\ImportExport {
|
||||
|
||||
public function __construct() {
|
||||
$this->service("export")->post()->asJson();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class Import extends \IMSApi\ImportExport{
|
||||
|
||||
public function __construct(){
|
||||
class Import extends \IMSApi\ImportExport {
|
||||
|
||||
public function __construct() {
|
||||
$this->service("import")->post()->asJson();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class ImportAnagListini extends \IMSApi{
|
||||
public function __construct(){
|
||||
class ImportAnagListini extends \IMSApi {
|
||||
public function __construct() {
|
||||
$this->post("importAnagListini")->queryParam("tipoImportListino", "V")->asJson();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class ImportDoc extends \IMSApi\ImportExport{
|
||||
|
||||
public function __construct(){
|
||||
class ImportDoc extends \IMSApi\ImportExport {
|
||||
|
||||
public function __construct() {
|
||||
$this->service("importDoc")->post()->asJson();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,85 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class ImportExport extends \IMSApi{
|
||||
class ImportExport extends \IMSApi {
|
||||
private $type = null;
|
||||
private $format = null;
|
||||
private $whereCond = array();
|
||||
private $arr_parameters = array();
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->post()->asJson();
|
||||
}
|
||||
|
||||
public function type($v){
|
||||
|
||||
public function type($v) {
|
||||
$this->type = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function format($v){
|
||||
|
||||
public function format($v) {
|
||||
$this->format = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function where($k, $v){
|
||||
|
||||
public function where($k, $v) {
|
||||
$this->whereCond[$k] = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function whereDate($k, $v){
|
||||
|
||||
public function whereDate($k, $v) {
|
||||
$v = \Utility\Date::isValidUnixtime($v) ? strftime(\Format::strftimeYMD, $v) : $v;
|
||||
return $this->where($k, $v);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public function whereCond(array $v){
|
||||
$this->whereCond = $v;
|
||||
return $this;
|
||||
}*/
|
||||
|
||||
public function dateParameter($k, $v){
|
||||
|
||||
public function dateParameter($k, $v) {
|
||||
$v = \Utility\Date::isValidUnixtime($v) ? strftime(\Format::strftimeYMD, $v) : $v;
|
||||
return $this->parameter($k, $v);
|
||||
}
|
||||
|
||||
public function parameter($k, $v){
|
||||
|
||||
public function parameter($k, $v) {
|
||||
$this->arr_parameters[$k] = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new \Ret;
|
||||
if(is_null($this->type) && is_null($this->format)){
|
||||
if (is_null($this->type) && is_null($this->format)) {
|
||||
$Ret->set_error("Parametri type e format non specificati");
|
||||
|
||||
} else if(is_null($this->type)){
|
||||
|
||||
} else if (is_null($this->type)) {
|
||||
$Ret->set_error("Parametro type non specificato");
|
||||
|
||||
} else if(is_null($this->format)){
|
||||
|
||||
} else if (is_null($this->format)) {
|
||||
$Ret->set_error("Parametro format non specificato");
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$this->queryParams(array("type" => $this->type, "format" => $this->format));
|
||||
|
||||
|
||||
$body = $this->body();
|
||||
if(count($this->arr_parameters)>0){
|
||||
if (count($this->arr_parameters) > 0) {
|
||||
$body = is_null($body) ? array() : $body;
|
||||
$body = array_merge($body, array("parameter" => $this->arr_parameters));
|
||||
}
|
||||
|
||||
if(!is_null($this->whereCond) && count($this->whereCond)>0){
|
||||
|
||||
if (!is_null($this->whereCond) && count($this->whereCond) > 0) {
|
||||
$whereCond = isset($body["whereCond"]) ? $body["whereCond"] : "";
|
||||
foreach($this->whereCond as $k => $v){
|
||||
$whereCond .= \Query::process_whereParameters($k, $v)." AND ";
|
||||
foreach ($this->whereCond as $k => $v) {
|
||||
$whereCond .= \Query::process_whereParameters($k, $v) . " AND ";
|
||||
}
|
||||
$body["whereCond"] = rtrim($whereCond, " AND ");
|
||||
}
|
||||
|
||||
|
||||
//echojson($body);exit;
|
||||
$this->body($body);
|
||||
|
||||
|
||||
$Ret = parent::send();
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,120 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class InfoComuni extends \IMSApi{
|
||||
|
||||
class InfoComuni extends \IMSApi {
|
||||
|
||||
private $nome = null;
|
||||
private $cap = null;
|
||||
private $indirizzo = null;
|
||||
private $codiceCatastale = null;
|
||||
private $prov = null;
|
||||
private $regione = null;
|
||||
|
||||
|
||||
// <editor-fold desc="SETTERS" defaultstate="collapsed">
|
||||
public function nome($value){
|
||||
public function nome($value) {
|
||||
$this->nome = $value;
|
||||
return $this;
|
||||
}
|
||||
public function cap($value){
|
||||
|
||||
public function cap($value) {
|
||||
$this->cap = $value;
|
||||
return $this;
|
||||
}
|
||||
public function indirizzo($value){
|
||||
|
||||
public function indirizzo($value) {
|
||||
$this->indirizzo = $value;
|
||||
return $this;
|
||||
}
|
||||
public function codiceCatastale($value){
|
||||
|
||||
public function codiceCatastale($value) {
|
||||
$this->codiceCatastale = $value;
|
||||
return $this;
|
||||
}
|
||||
public function prov($value){
|
||||
|
||||
public function prov($value) {
|
||||
$this->prov = $value;
|
||||
return $this;
|
||||
}
|
||||
public function regione($value){
|
||||
|
||||
public function regione($value) {
|
||||
$this->regione = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->service("infoComuni")->post()->asJson();
|
||||
}
|
||||
|
||||
public function get_comuneByNome($value = null){
|
||||
if(!is_null($value)){
|
||||
|
||||
public function get_comuneByNome($value = null) {
|
||||
if (!is_null($value)) {
|
||||
$this->nome($value);
|
||||
}
|
||||
$Ret = $this->send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$Ret->set_data($retData[0]);
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function get_comuneByCap($value = null){
|
||||
if(!is_null($value)){
|
||||
|
||||
public function get_comuneByCap($value = null) {
|
||||
if (!is_null($value)) {
|
||||
$this->cap($value);
|
||||
}
|
||||
$Ret = $this->send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$Ret->set_data($retData[0]);
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function get_comuneByCodiceCatastale($value){
|
||||
|
||||
public function get_comuneByCodiceCatastale($value) {
|
||||
$Ret = $this->codiceCatastale($value)->send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$Ret->set_data($retData[0]);
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function get_listComuniByProv($value){
|
||||
|
||||
public function get_listComuniByProv($value) {
|
||||
return $this->prov($value)->send();
|
||||
}
|
||||
|
||||
public function get_listComuniByRegione($value){
|
||||
|
||||
public function get_listComuniByRegione($value) {
|
||||
return $this->regione($value)->send();
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new \Ret;
|
||||
$params = array();
|
||||
if(!is_null($this->nome)){
|
||||
if (!is_null($this->nome)) {
|
||||
$params["nome"] = $this->nome;
|
||||
}
|
||||
if(!is_null($this->cap)){
|
||||
if (!is_null($this->cap)) {
|
||||
$params["cap"] = $this->cap;
|
||||
}
|
||||
if(!is_null($this->indirizzo)){
|
||||
if (!is_null($this->indirizzo)) {
|
||||
$params["indirizzo"] = $this->indirizzo;
|
||||
}
|
||||
if(!is_null($this->codiceCatastale)){
|
||||
if (!is_null($this->codiceCatastale)) {
|
||||
$params["codiceCatastale"] = $this->codiceCatastale;
|
||||
}
|
||||
if(!is_null($this->prov)){
|
||||
if (!is_null($this->prov)) {
|
||||
$params["prov"] = $this->prov;
|
||||
}
|
||||
if(!is_null($this->regione)){
|
||||
if (!is_null($this->regione)) {
|
||||
$params["regione"] = $this->regione;
|
||||
}
|
||||
if(count($params)>0){
|
||||
if (count($params) > 0) {
|
||||
$this->queryParams($params);
|
||||
$Ret = parent::send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$dto = $retData[0]["dto"];
|
||||
if(count($dto)>0){
|
||||
if (count($dto) > 0) {
|
||||
$Ret->set_data($dto);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_warning("Nessun risultato");
|
||||
}
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Nessun parametro specificato");
|
||||
}
|
||||
return $Ret;
|
||||
|
||||
@@ -1,41 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class PrintFile extends \IMSApi{
|
||||
class PrintFile extends \IMSApi {
|
||||
private $_blob = null;
|
||||
private $_printerName = null;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->service("print")->post()->asJson();
|
||||
}
|
||||
|
||||
public function blob($v){
|
||||
|
||||
public function blob($v) {
|
||||
$this->_blob = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function printerName($v){
|
||||
|
||||
public function printerName($v) {
|
||||
$this->_printerName = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new \Ret;
|
||||
|
||||
if(!is_null($this->_blob)){
|
||||
|
||||
|
||||
if (!is_null($this->_blob)) {
|
||||
|
||||
$IMSApi = new IMSApi;
|
||||
$IMSApi->post("print")
|
||||
->asText()
|
||||
// ->queryParam("mimeType", Mime::PDF)
|
||||
->queryParam("printerName", $this->_printerName)
|
||||
->body(base64_encode(Utility\Compression\GZ::encode($this->_blob)));
|
||||
->asText()
|
||||
// ->queryParam("mimeType", Mime::PDF)
|
||||
->queryParam("printerName", $this->_printerName)
|
||||
->body(base64_encode(Utility\Compression\GZ::encode($this->_blob)));
|
||||
$Ret = $IMSApi->send();
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Il contenuto del file non è valido");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,46 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class ProcessSql extends \IMSApi{
|
||||
class ProcessSql extends \IMSApi {
|
||||
private $sql = null;
|
||||
private $date2ts = false;
|
||||
public function __construct($sql = null){
|
||||
|
||||
public function __construct($sql = null) {
|
||||
$this->service("processSql")->post()->asJson()->sql($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $date2ts
|
||||
*/
|
||||
public function setDate2ts($date2ts)
|
||||
{
|
||||
public function setDate2ts($date2ts) {
|
||||
$this->date2ts = $date2ts;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function sql($value){
|
||||
if(\Query::is_typeQuery($value)){
|
||||
|
||||
public function sql($value) {
|
||||
if (\Query::is_typeQuery($value)) {
|
||||
$this->sql = $value->getSql();
|
||||
} else{
|
||||
} else {
|
||||
$this->sql = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new \Ret;
|
||||
if(!is_null($this->sql)){
|
||||
$this->body(array("nativeSql" => $this->sql));
|
||||
|
||||
if (!is_null($this->sql)) {
|
||||
$this->body(array("nativeSql" => $this->sql));
|
||||
|
||||
$Ret = parent::send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
//$dto = $retData[0]["dto"];
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Nessun parametro specificato");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class ProcessStoredProcedure extends \IMSApi{
|
||||
class ProcessStoredProcedure extends \IMSApi {
|
||||
private $name = null;
|
||||
private $parameters = array();
|
||||
|
||||
public function __construct($name = null){
|
||||
|
||||
public function __construct($name = null) {
|
||||
$this->service("processStoredProcedure")->post()->asJson()->name($name);
|
||||
}
|
||||
|
||||
public function name($value){
|
||||
|
||||
public function name($value) {
|
||||
$this->name = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function parameter($type, $value, $isOutput){
|
||||
|
||||
private function parameter($type, $value, $isOutput) {
|
||||
$this->parameters[] = array("type" => $type, "value" => $value, "isOutput" => $isOutput);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function stringParameter($value, $isOutput = false){
|
||||
|
||||
public function stringParameter($value, $isOutput = false) {
|
||||
return $this->parameter("string", $value, $isOutput);
|
||||
}
|
||||
|
||||
public function intParameter($value, $isOutput = false){
|
||||
|
||||
public function intParameter($value, $isOutput = false) {
|
||||
return $this->parameter("int", $value, $isOutput);
|
||||
}
|
||||
|
||||
public function shortParameter($value, $isOutput = false){
|
||||
|
||||
public function shortParameter($value, $isOutput = false) {
|
||||
return $this->parameter("short", $value, $isOutput);
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new \Ret;
|
||||
if(!is_null($this->name)){
|
||||
$this->body(array("procedure" => $this->name, "parameters" => $this->parameters));
|
||||
|
||||
if (!is_null($this->name)) {
|
||||
$this->body(array("procedure" => $this->name, "parameters" => $this->parameters));
|
||||
|
||||
$Ret = parent::send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$Ret->set_data($retData[0]["genericList"]);
|
||||
}
|
||||
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Stored Procedure non specificata");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class Response extends \IMSApi{
|
||||
class Response extends \IMSApi {
|
||||
private $esito = null;
|
||||
private $execDate = null;
|
||||
private $execTime = null;
|
||||
@@ -15,102 +16,111 @@ class Response extends \IMSApi{
|
||||
private $entity = null;
|
||||
private $jsonObject = null;
|
||||
private $listResponse = false;
|
||||
|
||||
public function __construct($returnData = null){
|
||||
if(!is_null($returnData)){
|
||||
|
||||
public function __construct($returnData = null) {
|
||||
if (!is_null($returnData)) {
|
||||
$this->parse($returnData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// <editor-fold desc="GET/SET/CHECK SEMPLICI" defaultstate="collapsed">
|
||||
public function is_OK(){
|
||||
public function is_OK() {
|
||||
return $this->esito == 1;
|
||||
}
|
||||
public function is_KO(){
|
||||
|
||||
public function is_KO() {
|
||||
return !$this->is_OK();
|
||||
}
|
||||
private function set_OK(){
|
||||
|
||||
private function set_OK() {
|
||||
$this->esito = 1;
|
||||
return $this;
|
||||
}
|
||||
private function set_KO(){
|
||||
|
||||
private function set_KO() {
|
||||
$this->esito = -1;
|
||||
return $this;
|
||||
}
|
||||
public function get_errorMessage(){
|
||||
|
||||
public function get_errorMessage() {
|
||||
return $this->errorMessage;
|
||||
}
|
||||
private function set_errorMessage($v){
|
||||
|
||||
private function set_errorMessage($v) {
|
||||
$this->errorMessage = $v;
|
||||
return $this;
|
||||
}
|
||||
public function get_jsonObject(){
|
||||
|
||||
public function get_jsonObject() {
|
||||
return $this->jsonObject;
|
||||
}
|
||||
private function set_jsonObject($v){
|
||||
|
||||
private function set_jsonObject($v) {
|
||||
$this->jsonObject = $v;
|
||||
return $this;
|
||||
}
|
||||
private function is_list(){
|
||||
return $this->listResponse!==false && is_array($this->listResponse);
|
||||
|
||||
private function is_list() {
|
||||
return $this->listResponse !== false && is_array($this->listResponse);
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
public function get_item($i){
|
||||
if($this->is_list() && array_key_exists($i, $this->listResponse)){
|
||||
|
||||
public function get_item($i) {
|
||||
if ($this->is_list() && array_key_exists($i, $this->listResponse)) {
|
||||
return $this->listResponse[$i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function parse($returnData){
|
||||
if(isset($returnData[0])){ // LISTA
|
||||
|
||||
private function parse($returnData) {
|
||||
if (isset($returnData[0])) { // LISTA
|
||||
$this->set_OK();
|
||||
$this->listResponse = array();
|
||||
foreach($returnData as $retDataItem){
|
||||
foreach ($returnData as $retDataItem) {
|
||||
$Response = new Response($retDataItem);
|
||||
if($Response->is_KO()){
|
||||
if ($Response->is_KO()) {
|
||||
$this->set_KO()->set_errorMessage($Response->get_errorMessage());
|
||||
}
|
||||
$this->listResponse[] = $Response;
|
||||
}
|
||||
|
||||
} else{ // SINGOLO
|
||||
if(array_key_exists("esito", $returnData)){
|
||||
|
||||
} else { // SINGOLO
|
||||
if (array_key_exists("esito", $returnData)) {
|
||||
$this->esito = $returnData["esito"];
|
||||
}
|
||||
if(array_key_exists("execDate", $returnData)){
|
||||
if (array_key_exists("execDate", $returnData)) {
|
||||
$this->execDate = $returnData["execDate"];
|
||||
$this->execTime = \Utility\Date::strtotime($this->execDate, \Format::strtotimeYMDHMS);
|
||||
}
|
||||
if(array_key_exists("profileDB", $returnData)){
|
||||
if (array_key_exists("profileDB", $returnData)) {
|
||||
$this->profileDB = $returnData["profileDB"];
|
||||
}
|
||||
if(array_key_exists("operationType", $returnData)){
|
||||
if (array_key_exists("operationType", $returnData)) {
|
||||
$this->operationType = $returnData["operationType"];
|
||||
}
|
||||
if(array_key_exists("errorMessage", $returnData)){
|
||||
if (array_key_exists("errorMessage", $returnData)) {
|
||||
$this->errorMessage = $returnData["errorMessage"];
|
||||
}
|
||||
if(array_key_exists("errorType", $returnData)){
|
||||
if (array_key_exists("errorType", $returnData)) {
|
||||
$this->errorType = $returnData["errorType"];
|
||||
}
|
||||
if(array_key_exists("report", $returnData)){
|
||||
if (array_key_exists("report", $returnData)) {
|
||||
$this->report = $returnData["report"];
|
||||
}
|
||||
if(array_key_exists("xml", $returnData)){
|
||||
if (array_key_exists("xml", $returnData)) {
|
||||
$this->xml = $returnData["xml"];
|
||||
}
|
||||
if(array_key_exists("lastTransactionIdImport", $returnData)){
|
||||
if (array_key_exists("lastTransactionIdImport", $returnData)) {
|
||||
$this->lastTransactionIdImport = $returnData["lastTransactionIdImport"];
|
||||
}
|
||||
if(array_key_exists("syncActive", $returnData)){
|
||||
if (array_key_exists("syncActive", $returnData)) {
|
||||
$this->syncActive = $returnData["syncActive"];
|
||||
}
|
||||
if(array_key_exists("entity", $returnData)){
|
||||
if (array_key_exists("entity", $returnData)) {
|
||||
$this->entity = $returnData["entity"];
|
||||
}
|
||||
if(array_key_exists("dto", $returnData)){
|
||||
if (array_key_exists("dto", $returnData)) {
|
||||
$this->jsonObject = $returnData["dto"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,55 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class SaveTerminalino extends \IMSApi{
|
||||
class SaveTerminalino extends \IMSApi {
|
||||
private $file = null;
|
||||
|
||||
public function __construct($file=null){
|
||||
|
||||
public function __construct($file = null) {
|
||||
$this->post("saveTerminalino")->asText()->file($file);
|
||||
}
|
||||
|
||||
public function file($value){
|
||||
|
||||
public function file($value) {
|
||||
$this->file = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new \Ret;
|
||||
$file = $this->file;
|
||||
if(is_null($file)){
|
||||
if (is_null($file)) {
|
||||
return $Ret->set_error("File non pervenuto");
|
||||
}
|
||||
|
||||
if(!\Utility\File::checkFileNameExtension($file["name"], "xml")){
|
||||
|
||||
if (!\Utility\File::checkFileNameExtension($file["name"], "xml")) {
|
||||
return $Ret->set_error("Tipo file non valido<br/>");
|
||||
}
|
||||
|
||||
|
||||
$xml = simplexml_load_file($file["tmp_name"]);
|
||||
if(!isset($xml->COD_MDEP)){
|
||||
if (!isset($xml->COD_MDEP)) {
|
||||
return $Ret->set_error("Il file non è conforme poiché il deposito non è stato specificato<br/>");
|
||||
}
|
||||
|
||||
|
||||
$xmlCodMdep = (string)$xml->COD_MDEP;
|
||||
if(strlen(trim($xmlCodMdep))==0){
|
||||
if (strlen(trim($xmlCodMdep)) == 0) {
|
||||
$xml->COD_MDEP = $xmlCodMdep = \User::get_current_userCodMdep();
|
||||
}
|
||||
|
||||
if($xmlCodMdep != \User::get_current_userCodMdep()){
|
||||
|
||||
if ($xmlCodMdep != \User::get_current_userCodMdep()) {
|
||||
return $Ret->set_error("Il file non è conforme poiché è stato creato per un altro deposito<br/>");
|
||||
}
|
||||
|
||||
if(!isset($xml->ROW)){
|
||||
|
||||
if (!isset($xml->ROW)) {
|
||||
return $Ret->set_error("Il file non è conforme poiché non ci sono righe<br/>");
|
||||
}
|
||||
|
||||
|
||||
$this->body(utf8_encode($xml->asXML()));
|
||||
$Ret = parent::send();
|
||||
// $ImsAPI = new IMSApi;
|
||||
// $Ret = $ImsAPI->post("saveTerminalino")->body(utf8_encode($xml->asXML()))->asText()->send();
|
||||
if($Ret->is_OK()){
|
||||
// $ImsAPI = new IMSApi;
|
||||
// $Ret = $ImsAPI->post("saveTerminalino")->body(utf8_encode($xml->asXML()))->asText()->send();
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$Ret->set_data($retData[0]);
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class SearchComuni extends \IMSApi{
|
||||
|
||||
class SearchComuni extends \IMSApi {
|
||||
|
||||
private $q = null;
|
||||
private $limit = null;
|
||||
|
||||
// <editor-fold desc="SETTERS" defaultstate="collapsed">
|
||||
public function q($value){
|
||||
public function q($value) {
|
||||
$this->q = $value;
|
||||
return $this;
|
||||
}
|
||||
public function limit($value){
|
||||
if(is_int($value) && $value>=0){
|
||||
|
||||
public function limit($value) {
|
||||
if (is_int($value) && $value >= 0) {
|
||||
$this->limit = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->service("searchComuni")->post()->asJson();
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new \Ret;
|
||||
if(!is_null($this->q)){
|
||||
if (!is_null($this->q)) {
|
||||
$params = array("q" => $this->q);
|
||||
if(!is_null($this->limit)){
|
||||
if (!is_null($this->limit)) {
|
||||
$params["limit"] = $this->limit;
|
||||
}
|
||||
|
||||
|
||||
$this->queryParams($params);
|
||||
$Ret = parent::send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$dto = $retData[0]["dto"];//var_dump($dto);
|
||||
if(count($dto)>0){
|
||||
foreach($dto as $i => $row){
|
||||
if (count($dto) > 0) {
|
||||
foreach ($dto as $i => $row) {
|
||||
$dto[$i] = array(
|
||||
"citta" => $row["nome"],
|
||||
"cap" => $row["cap"],
|
||||
@@ -49,7 +52,7 @@ class SearchComuni extends \IMSApi{
|
||||
}
|
||||
$Ret->set_data($dto);
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Nessun parametro specificato");
|
||||
}
|
||||
return $Ret;
|
||||
|
||||
@@ -1,91 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace IMSApi;
|
||||
class SqlToExcel extends \IMSApi{
|
||||
class SqlToExcel extends \IMSApi {
|
||||
private $_title = null;
|
||||
private $_sql = null;
|
||||
private $_dataSource = null;
|
||||
private $_arr_fields = array();
|
||||
private $_cacheAs = false;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->service("sqlToExcel")->post()->asJson();
|
||||
}
|
||||
|
||||
public function title($v){
|
||||
|
||||
public function title($v) {
|
||||
$this->_title = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSql($v){
|
||||
if(\Query::is_typeQuery($v)){
|
||||
|
||||
public function setSql($v) {
|
||||
if (\Query::is_typeQuery($v)) {
|
||||
$this->_sql = $v->getSql();
|
||||
} else if(is_string($v)){
|
||||
} else if (is_string($v)) {
|
||||
$this->_sql = $v;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDataSource($v){
|
||||
|
||||
public function setDataSource($v) {
|
||||
$this->_dataSource = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function fields(){
|
||||
|
||||
public function fields() {
|
||||
$arr_values = func_get_args();
|
||||
foreach($arr_values as $value){
|
||||
if(is_array($value)){
|
||||
foreach($value as $field){
|
||||
foreach ($arr_values as $value) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $field) {
|
||||
$this->fields($field);
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$this->_arr_fields[] = $value;
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function cacheAs($fileName = true){
|
||||
|
||||
public function cacheAs($fileName = true) {
|
||||
$this->_cacheAs = $fileName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function send(){
|
||||
if(!is_null($this->_dataSource)){
|
||||
|
||||
public function send() {
|
||||
if (!is_null($this->_dataSource)) {
|
||||
$TempTable = new \Utility\Db\TempTable;
|
||||
$Ret = $TempTable->prefix("SqlToExcel")->source($this->_dataSource)->run();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$tableTempName = $Ret->get_string();
|
||||
$this->setSql("SELECT * FROM ".$tableTempName);
|
||||
$this->setSql("SELECT * FROM " . $tableTempName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$Query = new \Query($this->_sql);
|
||||
$Ret = $Query->checkSyntax();
|
||||
if($Ret->is_OK()){
|
||||
$this->body(array("sql" => $this->_sql, "fields" => $this->_arr_fields));
|
||||
if ($Ret->is_OK()) {
|
||||
$this->body(array("sql" => $this->_sql, "fields" => $this->_arr_fields));
|
||||
$Ret = parent::send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$content = base64_decode($retData[0]["dto"]);
|
||||
$Ret->set_byte(null)->set_string(null)->set_data(null);
|
||||
|
||||
if($this->_cacheAs===true || is_string($this->_cacheAs)){
|
||||
|
||||
if ($this->_cacheAs === true || is_string($this->_cacheAs)) {
|
||||
$fileName = is_string($this->_cacheAs) ? $this->_cacheAs : null;
|
||||
$overwrite = true;
|
||||
|
||||
if(is_null($fileName)){
|
||||
|
||||
if (is_null($fileName)) {
|
||||
$overwrite = false;
|
||||
$fileName = "Foglio ".date("Ymd His");
|
||||
$fileName = "Foglio " . date("Ymd His");
|
||||
}
|
||||
|
||||
$Ret = \Cache::writeR($fileName.".xlsx", $content, true, $overwrite);
|
||||
|
||||
} else{
|
||||
|
||||
$Ret = \Cache::writeR($fileName . ".xlsx", $content, true, $overwrite);
|
||||
|
||||
} else {
|
||||
$Ret->set_byte($content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
class IMSApi{
|
||||
|
||||
class IMSApi {
|
||||
const serviceRootPath = "ems-api/";
|
||||
private $contentType = null;
|
||||
private $serviceName = null;
|
||||
@@ -13,86 +14,86 @@ class IMSApi{
|
||||
private $anonymousAuth = false;
|
||||
private $isDownload = false;
|
||||
private $timeout = 0;
|
||||
|
||||
public function __construct($serviceName = null){
|
||||
|
||||
public function __construct($serviceName = null) {
|
||||
$this->get()->asJson()->service($serviceName);
|
||||
}
|
||||
|
||||
|
||||
// <editor-fold desc="Setters" defaultstate="collapsed">
|
||||
public function service($value){
|
||||
public function service($value) {
|
||||
$this->serviceName = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function method($value){
|
||||
|
||||
public function method($value) {
|
||||
$this->serviceMethod = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function profileDB($value){
|
||||
|
||||
public function profileDB($value) {
|
||||
$this->profileDB = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function endpoint($value){
|
||||
|
||||
public function endpoint($value) {
|
||||
$this->endpoint = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function authUsername($value){
|
||||
|
||||
public function authUsername($value) {
|
||||
$this->authUsername = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function authPassword($value){
|
||||
|
||||
public function authPassword($value) {
|
||||
$this->authPassword = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function anonymousAuth($value = true){
|
||||
$this->anonymousAuth = $value!==false;
|
||||
|
||||
public function anonymousAuth($value = true) {
|
||||
$this->anonymousAuth = $value !== false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function queryDateParam($key, $value){
|
||||
|
||||
public function queryDateParam($key, $value) {
|
||||
return $this->queryParam($key, $value, \Format::strftimeYMD);
|
||||
}
|
||||
|
||||
public function queryDatetimeParam($key, $value){
|
||||
|
||||
public function queryDatetimeParam($key, $value) {
|
||||
return $this->queryParam($key, $value, \Format::strftimeYMDHMS);
|
||||
}
|
||||
|
||||
public function queryParam($key, $value, $type = null){
|
||||
if($type==\Format::strftimeYMD && \Utility\Date::isValidUnixtime($value)){
|
||||
|
||||
public function queryParam($key, $value, $type = null) {
|
||||
if ($type == \Format::strftimeYMD && \Utility\Date::isValidUnixtime($value)) {
|
||||
$value = strftime(\Format::strftimeYMD, $value);
|
||||
|
||||
} else if($type==\Format::strftimeYMDHMS && \Utility\Date::isValidUnixtime($value)){
|
||||
|
||||
} else if ($type == \Format::strftimeYMDHMS && \Utility\Date::isValidUnixtime($value)) {
|
||||
$value = strftime(\Format::strftimeYMDHMS, $value);
|
||||
|
||||
} else if($type==\Format::latLng1){
|
||||
|
||||
|
||||
} else if ($type == \Format::latLng1) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
$this->queryParams[$key] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function queryParams($array){
|
||||
|
||||
public function queryParams($array) {
|
||||
$this->queryParams = array_merge($this->queryParams, $array);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get($serviceName = null){
|
||||
|
||||
public function get($serviceName = null) {
|
||||
$this->method("GET");
|
||||
if(!is_null($serviceName)){
|
||||
if (!is_null($serviceName)) {
|
||||
$this->service($serviceName);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function post($serviceName = null){
|
||||
|
||||
public function post($serviceName = null) {
|
||||
$this->method("POST");
|
||||
if(!is_null($serviceName)){
|
||||
if (!is_null($serviceName)) {
|
||||
$this->service($serviceName);
|
||||
}
|
||||
return $this;
|
||||
@@ -113,128 +114,130 @@ class IMSApi{
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asText(){
|
||||
|
||||
public function asText() {
|
||||
$this->contentType = Rest::TEXTPLAIN;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asJson(){
|
||||
|
||||
public function asJson() {
|
||||
$this->contentType = Rest::APPLICATIONJSON;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asForm(){
|
||||
|
||||
public function asForm() {
|
||||
$this->contentType = Rest::FORM;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function timeout($seconds){
|
||||
public function timeout($seconds) {
|
||||
$this->timeout = $seconds;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function body($value = null){
|
||||
if(is_null($value)){ // GET
|
||||
if(is_array($this->body)){
|
||||
if($this->contentType == Rest::FORM){
|
||||
|
||||
public function body($value = null) {
|
||||
if (is_null($value)) { // GET
|
||||
if (is_array($this->body)) {
|
||||
if ($this->contentType == Rest::FORM) {
|
||||
return http_build_query($this->body);
|
||||
} else{
|
||||
} else {
|
||||
return Utility::json_encode($this->body);
|
||||
}
|
||||
}
|
||||
return $this->body;
|
||||
|
||||
} else{ // SET
|
||||
if(EntityItem::is_entityItem($value) || EntityList::is_entityList($value)){
|
||||
|
||||
} else { // SET
|
||||
if (EntityItem::is_entityItem($value) || EntityList::is_entityList($value)) {
|
||||
$value = $value->get_body();
|
||||
}
|
||||
|
||||
|
||||
$this->body = $value;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
public function writeLog_body(){
|
||||
if(!is_null($this->body())){
|
||||
$filename = "IMSApi".( !is_null($this->serviceName)?"-".$this->serviceName:"" ).".json";
|
||||
|
||||
public function writeLog_body() {
|
||||
if (!is_null($this->body())) {
|
||||
$filename = "IMSApi" . (!is_null($this->serviceName) ? "-" . $this->serviceName : "") . ".json";
|
||||
\Cache::writeR($filename, $this->body(), "logs");
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function get_serviceRootPath(){
|
||||
|
||||
public static function get_serviceRootPath() {
|
||||
return self::serviceRootPath;
|
||||
}
|
||||
|
||||
private function get_authCredentials(){
|
||||
if($this->anonymousAuth && (!is_null($this->profileDB) || isset($GLOBALS["profileDB"]))){
|
||||
$profileDb = !is_null($this->profileDB) ? $this->profileDB : (isset($GLOBALS["profileDB"])?$GLOBALS["profileDB"]:null);
|
||||
|
||||
private function get_authCredentials() {
|
||||
if ($this->anonymousAuth && (!is_null($this->profileDB) || isset($GLOBALS["profileDB"]))) {
|
||||
$profileDb = !is_null($this->profileDB) ? $this->profileDB : (isset($GLOBALS["profileDB"]) ? $GLOBALS["profileDB"] : null);
|
||||
return array("username" => $profileDb, "password" => $profileDb);
|
||||
|
||||
} else if(!is_null($this->authUsername) && !is_null($this->authPassword)){
|
||||
|
||||
} else if (!is_null($this->authUsername) && !is_null($this->authPassword)) {
|
||||
return array("username" => $this->authUsername, "password" => $this->authPassword);
|
||||
|
||||
} else if(\User::is_authenticated() && isset($_SESSION["password"])){
|
||||
|
||||
} else if (\User::is_authenticated() && isset($_SESSION["password"])) {
|
||||
return array("username" => $_SESSION["username"], "password" => $_SESSION["password"]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function send(){
|
||||
|
||||
public function send() {
|
||||
$Ret = new Ret;
|
||||
|
||||
if(!is_null($this->profileDB)){
|
||||
|
||||
if (!is_null($this->profileDB)) {
|
||||
$this->queryParam("profileDb", $this->profileDB);
|
||||
}
|
||||
$queryParams = $this->queryParams;
|
||||
|
||||
|
||||
$Rest = new Rest;
|
||||
$Rest->service($this->serviceName)
|
||||
->contentType($this->contentType)
|
||||
->method($this->serviceMethod)
|
||||
->urlData($queryParams)
|
||||
->serviceRootPath(self::get_serviceRootPath())
|
||||
->timeout($this->timeout)
|
||||
->setIsDownload($this->isDownload)
|
||||
->setProfileDb($this->profileDB)
|
||||
->endPoint($this->endpoint)
|
||||
->body($this->body()); /**** here the body of IMSApi is passed to $Rest; *******/
|
||||
|
||||
->contentType($this->contentType)
|
||||
->method($this->serviceMethod)
|
||||
->urlData($queryParams)
|
||||
->serviceRootPath(self::get_serviceRootPath())
|
||||
->timeout($this->timeout)
|
||||
->setIsDownload($this->isDownload)
|
||||
->setProfileDb($this->profileDB)
|
||||
->endPoint($this->endpoint)
|
||||
->body($this->body());
|
||||
/**** here the body of IMSApi is passed to $Rest; *******/
|
||||
|
||||
$credentials = $this->get_authCredentials();
|
||||
if(!is_null($credentials)){
|
||||
if (!is_null($credentials)) {
|
||||
$Rest->authUsername($credentials["username"])->authPassword($credentials["password"]);
|
||||
} else{
|
||||
return $Ret->set_error("Credenziali di autenticazione al servizio <i>".$this->serviceName."</i> non valide");
|
||||
} else {
|
||||
return $Ret->set_error("Credenziali di autenticazione al servizio <i>" . $this->serviceName . "</i> non valide");
|
||||
}
|
||||
|
||||
/********************************** HERE IT IS PERFORMED THE REST APIs CALL *************************************/
|
||||
$Ret = $Rest->send();
|
||||
/****************************************************************************************************************/
|
||||
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data(); // utilizzato solo per verificare errore (non dati di ritorno)
|
||||
if(!$this->isDownload){
|
||||
foreach($retData as $entityResponse){
|
||||
if($entityResponse["esito"] != 1){
|
||||
if (!$this->isDownload) {
|
||||
foreach ($retData as $entityResponse) {
|
||||
if ($entityResponse["esito"] != 1) {
|
||||
$Ret->set_error($entityResponse["errorMessage"]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
@$Ret->set_Response(new IMSApi\Response($retData));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function download($serviceName){
|
||||
public function download($serviceName) {
|
||||
$this->method("GET");
|
||||
$this->isDownload = true;
|
||||
if(!is_null($serviceName)){
|
||||
if (!is_null($serviceName)) {
|
||||
$this->service($serviceName);
|
||||
}
|
||||
return $this;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
class JasperProcessor{
|
||||
|
||||
use Report\Parameter;
|
||||
|
||||
class JasperProcessor {
|
||||
private $_title = null; // non necessario per l'esecuzione, lo carica solo leggendolo dal db
|
||||
private $_QUERY = null;
|
||||
private $_REPORT_NAME = null;
|
||||
@@ -11,316 +14,365 @@ class JasperProcessor{
|
||||
private $_SUBREPORTS = null;
|
||||
private $_cacheAs = false;
|
||||
private $_report = null;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->asPdf();
|
||||
}
|
||||
|
||||
private function is_loaded(){
|
||||
|
||||
private function is_loaded() {
|
||||
$Ret = new Ret;
|
||||
if(is_null($this->_B64_JRXML) && is_null($this->_REPORT_NAME)){
|
||||
if (is_null($this->_B64_JRXML) && is_null($this->_REPORT_NAME)) {
|
||||
$Ret->set_error("Risorsa non caricata nel JasperProcessor");
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private function process(){
|
||||
|
||||
private function process() {
|
||||
$IMSApi = new IMSApi;
|
||||
|
||||
if(!\User::is_authenticated()){
|
||||
|
||||
if (!\User::is_authenticated()) {
|
||||
$IMSApi->anonymousAuth();
|
||||
}
|
||||
|
||||
|
||||
$Ret = $IMSApi->post("processReport")->body($this->getJasperDTO())->send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
if(isset($retData[0])){
|
||||
if (isset($retData[0])) {
|
||||
$retData = $retData[0];
|
||||
}
|
||||
if($retData["esito"]==1){
|
||||
if(isset($retData["report"]["fileb64Content"]) && !is_null($retData["report"])){
|
||||
if ($retData["esito"] == 1) {
|
||||
if (isset($retData["report"]["fileb64Content"]) && !is_null($retData["report"])) {
|
||||
$content = base64_decode($retData["report"]["fileb64Content"]);
|
||||
|
||||
if($this->_cacheAs===true || is_string($this->_cacheAs)){
|
||||
if($content){
|
||||
|
||||
if ($this->_cacheAs === true || is_string($this->_cacheAs)) {
|
||||
if ($content) {
|
||||
$fileName = is_string($this->_cacheAs) ? $this->_cacheAs : null;
|
||||
$overwrite = true;
|
||||
|
||||
if(is_null($fileName)){
|
||||
|
||||
if (is_null($fileName)) {
|
||||
$overwrite = false;
|
||||
if(!is_null($this->_REPORT_NAME)){
|
||||
if (!is_null($this->_REPORT_NAME)) {
|
||||
$fileName = $this->_REPORT_NAME;
|
||||
|
||||
} else if(!is_null($this->_B64_JRXML)){
|
||||
|
||||
} else if (!is_null($this->_B64_JRXML)) {
|
||||
$fileName = Report::getNameFromJrxml_static($this->_B64_JRXML);
|
||||
}
|
||||
|
||||
if(is_null($fileName)){
|
||||
|
||||
if (is_null($fileName)) {
|
||||
$fileName = "Report";
|
||||
}
|
||||
}
|
||||
|
||||
$Ret = \Cache::writeR($fileName.".pdf", $content, true, $overwrite);
|
||||
|
||||
} else{
|
||||
|
||||
$Ret = \Cache::writeR($fileName . ".pdf", $content, true, $overwrite);
|
||||
|
||||
} else {
|
||||
$Ret->set_errorCode(\ErrorHandler::NORESULT_REPORT)->set_WARN();
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_byte($content);
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_errorCode(\ErrorHandler::NORESULT_REPORT)->set_WARN();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function run(){
|
||||
|
||||
public function run() {
|
||||
$Ret = $this->is_loaded();
|
||||
if($Ret->is_KO() && !is_null($this->_report)){
|
||||
if ($Ret->is_KO() && !is_null($this->_report)) {
|
||||
$Ret = $this->load($this->_report);
|
||||
}
|
||||
|
||||
if($Ret->is_OK()){
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret = $this->is_loaded();
|
||||
if($Ret->is_OK()){
|
||||
if($this->_FORMATO_EXPORT == Format::PDF){
|
||||
if ($Ret->is_OK()) {
|
||||
if ($this->_FORMATO_EXPORT == Format::PDF) {
|
||||
$Ret = $this->process();
|
||||
} else{
|
||||
$Ret->set_error("Formato export report non supportato (".$this->_FORMATO_EXPORT.")");
|
||||
} else {
|
||||
$Ret->set_error("Formato export report non supportato (" . $this->_FORMATO_EXPORT . ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function sendToPrinter($printerName = null, $numberOfCopies = null){
|
||||
|
||||
public function sendToPrinter($printerName = null, $numberOfCopies = null) {
|
||||
$Ret = $this->is_loaded();
|
||||
if($Ret->is_KO() && !is_null($this->_report)){
|
||||
if ($Ret->is_KO() && !is_null($this->_report)) {
|
||||
$Ret = $this->load($this->_report);
|
||||
}
|
||||
|
||||
if($Ret->is_OK()){
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret = $this->is_loaded();
|
||||
if($Ret->is_OK()){
|
||||
if(\Utility\Str::ciEquals($this->_FORMATO_EXPORT, \Format::PDF)){
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
if (\Utility\Str::ciEquals($this->_FORMATO_EXPORT, \Format::PDF)) {
|
||||
|
||||
$IMSApi = new IMSApi;
|
||||
if(!\User::is_authenticated()){
|
||||
if (!\User::is_authenticated()) {
|
||||
$IMSApi->anonymousAuth();
|
||||
}
|
||||
|
||||
|
||||
$IMSApi->post("processPrintReport")
|
||||
->queryParam("printerName", $printerName)
|
||||
->queryParam("numberOfCopies", $numberOfCopies)
|
||||
->body($this->getJasperDTO());
|
||||
|
||||
->queryParam("printerName", $printerName)
|
||||
->queryParam("numberOfCopies", $numberOfCopies)
|
||||
->body($this->getJasperDTO());
|
||||
|
||||
$Ret = $IMSApi->send();
|
||||
|
||||
} else{
|
||||
$Ret->set_error("Formato export report non supportato (".$this->_FORMATO_EXPORT.")");
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Formato export report non supportato (" . $this->_FORMATO_EXPORT . ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function loadFromJtbDisegni($codProd, $fileTypes = null){
|
||||
|
||||
public function loadFromJtbDisegni($codProd, $fileTypes = null) {
|
||||
$fileTypes = !is_null($fileTypes) ? array($fileTypes) : array(\JtbDisegniFiles::REPORT_JASPER, \JtbDisegniFiles::SUBREPORT_JASPER);
|
||||
$Ret = \JtbDisegniFiles::get_items(array("cod_prod" => $codProd, "file_type" => $fileTypes));
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_files = $Ret->get_data();
|
||||
$jrxml = null;
|
||||
if(count($arr_files)>0){
|
||||
$result = array_values(from($arr_files)->where(function($x) use($fileTypes){ return $x["file_type"]===$fileTypes[0];})->toArray());
|
||||
if(count($result)>0){
|
||||
if (count($arr_files) > 0) {
|
||||
$result = array_values(from($arr_files)->where(function ($x) use ($fileTypes) {
|
||||
return $x["file_type"] === $fileTypes[0];
|
||||
})->toArray());
|
||||
if (count($result) > 0) {
|
||||
$jrxml = $result[0]["content"];
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_null($jrxml)){
|
||||
|
||||
if (!is_null($jrxml)) {
|
||||
$Report = new \Report;
|
||||
$Report->setJrxml($jrxml);
|
||||
|
||||
$arr_subreportItem = array_values(from($arr_files)->where(function($x){ return $x["file_type"]===\JtbDisegniFiles::SUBREPORT_JASPER;})->toArray());
|
||||
foreach($arr_subreportItem as $subreportItem){
|
||||
$Report->appendSubreport(array("jasper_filename" => $subreportItem["file_name"], "b64_jasper" => $subreportItem["content"]));
|
||||
|
||||
$arr_subreportItem = array_values(from($arr_files)->where(function ($x) {
|
||||
return $x["file_type"] === \JtbDisegniFiles::SUBREPORT_JASPER;
|
||||
})->toArray());
|
||||
foreach ($arr_subreportItem as $subreportItem) {
|
||||
$Report->appendSubreport(array("jasper_filename" => $subreportItem["file_name"], "b64_jasper" => $subreportItem["content"], "id" => $subreportItem["id"]));
|
||||
}
|
||||
|
||||
|
||||
$Ret = $this->load($Report);
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Risorsa JtbDisegni non valida");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function load($input){
|
||||
|
||||
public function load($input) {
|
||||
$Ret = new Ret;
|
||||
if(!is_null($input)){
|
||||
if(is_string($input)){ // reportName
|
||||
if (!is_null($input)) {
|
||||
if (is_string($input)) { // reportName
|
||||
$Report = new \Report;
|
||||
$Ret = $Report->load_report($input);
|
||||
|
||||
} else if(\Report::isReportObject($input)){
|
||||
|
||||
} else if (\Report::isReportObject($input)) {
|
||||
$Report = $input;
|
||||
|
||||
} else if(\GestSetup::isGestSetupObject($input)){
|
||||
|
||||
} else if (\GestSetup::isGestSetupObject($input)) {
|
||||
$reportName = $input->get();
|
||||
$Report = new \Report;
|
||||
$Ret = $Report->load_report($reportName);
|
||||
if(!$Ret->is_OK()){
|
||||
if (!$Ret->is_OK()) {
|
||||
return $Ret->set_errorCode(\ErrorHandler::INVALID_REPORT, $input);
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Valore in input non valido");
|
||||
}
|
||||
|
||||
if($Ret->is_OK()){
|
||||
if($Report->is_loaded()){
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
if ($Report->is_loaded()) {
|
||||
$this->setReportName($Report->name)
|
||||
->setTitle($Report->title)
|
||||
->setQuery(nullIfBlank($Report->query));
|
||||
|
||||
if(is_null($Report->name)){
|
||||
$this->setB64Jrxml($Report->b64_jrxml)
|
||||
->setSubreports($Report->getSubreports());
|
||||
->setTitle($Report->title)
|
||||
->setQuery(nullIfBlank($Report->query));
|
||||
|
||||
if (is_array($Report->Parameters)) {
|
||||
/**
|
||||
* @var Parameter $param
|
||||
*/
|
||||
foreach ($Report->Parameters as $param) {
|
||||
if (!empty($param->expression) && !$this->hasParam($param->name)) {
|
||||
switch ($param->tipo) {
|
||||
case Parameter::TYPE_DATESTATIC:
|
||||
case Parameter::TYPE_DATEDYNAMIC:
|
||||
$value = base64_decode($param->expression);
|
||||
|
||||
if (strtolower($value) === "today") {
|
||||
$value = time();
|
||||
}
|
||||
|
||||
$this->paramDate($param->name, $value);
|
||||
break;
|
||||
case Parameter::TYPE_TEXT:
|
||||
case Parameter::TYPE_WHERE:
|
||||
$this->param($param->name, base64_decode($param->expression));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (is_null($Report->name)) {
|
||||
$this->setB64Jrxml($Report->b64_jrxml)
|
||||
->setSubreports($Report->getSubreports());
|
||||
}
|
||||
|
||||
$Ret->set("JP", $this);
|
||||
|
||||
} else{
|
||||
$Ret->set_errorCode(ErrorHandler::INVALID_REPORT, is_string($input)?$input:null);
|
||||
|
||||
} else {
|
||||
$Ret->set_errorCode(ErrorHandler::INVALID_REPORT, is_string($input) ? $input : null);
|
||||
}
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Parametro nome report non specificato");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function getTitle(){
|
||||
|
||||
public function getTitle() {
|
||||
return $this->_title;
|
||||
}
|
||||
|
||||
public function report($v){
|
||||
|
||||
public function report($v) {
|
||||
$this->_report = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asPdf(){
|
||||
|
||||
public function asPdf() {
|
||||
return $this->asFormat(\Format::PDF);
|
||||
}
|
||||
|
||||
public function asFormat($v){
|
||||
|
||||
public function asFormat($v) {
|
||||
$this->_FORMATO_EXPORT = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTitle($v){
|
||||
|
||||
public function setTitle($v) {
|
||||
$this->_title = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setReportName($v){
|
||||
|
||||
public function setReportName($v) {
|
||||
$this->_REPORT_NAME = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setB64Jrxml($v){
|
||||
|
||||
public function getReportName() {
|
||||
return $this->_REPORT_NAME;
|
||||
}
|
||||
|
||||
public function setB64Jrxml($v) {
|
||||
$this->_B64_JRXML = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSubreports($v){
|
||||
|
||||
public function setSubreports($v) {
|
||||
$this->_SUBREPORTS = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setQuery($v){
|
||||
|
||||
public function setQuery($v) {
|
||||
$this->_QUERY = Utility::isBase64Encoded($v) ? base64_decode($v) : $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setJsonSource($v){
|
||||
if((is_array($v) || is_object($v)) && !is_string($v)){ // è possibile fornire anche una struttura, la conversione in json string avviene in atuomatico
|
||||
|
||||
public function setJsonSource($v) {
|
||||
if ((is_array($v) || is_object($v)) && !is_string($v)) { // è possibile fornire anche una struttura, la conversione in json string avviene in atuomatico
|
||||
$v = json_encode($v);
|
||||
}
|
||||
$this->_JSON_SOURCE = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function cacheAs($fileName = true){
|
||||
|
||||
public function cacheAs($fileName = true) {
|
||||
$this->_cacheAs = $fileName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function paramDate($key, $value){
|
||||
|
||||
public function paramDate($key, $value) {
|
||||
return $this->param($key, $value, \Format::strftimeYMD);
|
||||
}
|
||||
|
||||
public function param($key, $value, $type = null){ // append parametro singolo
|
||||
if(!is_null($type) && $type==\Format::strftimeYMD && \Utility\Date::isValidUnixtime($value)){
|
||||
|
||||
public function param($key, $value, $type = null) { // append parametro singolo
|
||||
if (!is_null($type) && $type == \Format::strftimeYMD && \Utility\Date::isValidUnixtime($value)) {
|
||||
$value = strftime(\Format::strftimeYMD, $value);
|
||||
|
||||
} else if(!is_null($type) && $type==\Format::strftimeYMDHMS && \Utility\Date::isValidUnixtime($value)){
|
||||
|
||||
} else if (!is_null($type) && $type == \Format::strftimeYMDHMS && \Utility\Date::isValidUnixtime($value)) {
|
||||
$value = strftime(\Format::strftimeYMDHMS, $value);
|
||||
|
||||
} else if(!is_null($type) && $type==\Format::strftimeSlashedYMD && \Utility\Date::isValidUnixtime($value)){
|
||||
|
||||
} else if (!is_null($type) && $type == \Format::strftimeSlashedYMD && \Utility\Date::isValidUnixtime($value)) {
|
||||
$value = strftime(\Format::strftimeSlashedYMD, $value);
|
||||
|
||||
} else if(!is_null($type) && $type==\Format::latLng1){
|
||||
|
||||
} else if (!is_null($type) && $type == \Format::latLng1) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($this->hasParam($key)) {
|
||||
$this->_PARAMS = array_filter($this->_PARAMS, function ($param) use ($key) {
|
||||
return $param["name"] !== $key;
|
||||
});
|
||||
}
|
||||
|
||||
$this->_PARAMS[] = array("name" => $key, "value" => $value);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function params($v = null){ // set tutti parametri (sovrascrive)
|
||||
|
||||
public function hasParam($paramName) {
|
||||
$param = array_filter($this->_PARAMS, function ($pr) use ($paramName) {
|
||||
return $pr["name"] === $paramName;
|
||||
});
|
||||
|
||||
return !empty($param);
|
||||
}
|
||||
|
||||
public function params($v = null) { // set tutti parametri (sovrascrive)
|
||||
$this->_PARAMS = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function resetParams(){
|
||||
|
||||
public function resetParams() {
|
||||
return $this->params(array());
|
||||
}
|
||||
|
||||
private function get_where(){
|
||||
return !is_null($this->_WHERE_COND)? rtrim($this->_WHERE_COND, " AND ") : null;
|
||||
|
||||
private function get_where() {
|
||||
return !is_null($this->_WHERE_COND) ? rtrim($this->_WHERE_COND, " AND ") : null;
|
||||
}
|
||||
|
||||
public function where($fieldname = null, $value = false, $type = null){ // si puo settare in onetime o in append
|
||||
$this->_WHERE_COND = blankIfNull($this->_WHERE_COND).Query::process_whereParameters($fieldname, $value, $type)." AND ";
|
||||
|
||||
public function where($fieldname = null, $value = false, $type = null) { // si puo settare in onetime o in append
|
||||
$this->_WHERE_COND = blankIfNull($this->_WHERE_COND) . Query::process_whereParameters($fieldname, $value, $type) . " AND ";
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function get_queryCompiled(){
|
||||
if(!is_null($this->_QUERY)){
|
||||
|
||||
private function get_queryCompiled() {
|
||||
if (!is_null($this->_QUERY)) {
|
||||
$query = $this->_QUERY;
|
||||
foreach($this->_PARAMS as $param){
|
||||
foreach ($this->_PARAMS as $param) {
|
||||
$query = str_replace("[[{$param["name"]}]]", "'{$param["value"]}'", $query);
|
||||
}
|
||||
return nullIfBlank($query);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function getSubreportDTOList(){
|
||||
|
||||
private function getSubreportDTOList() {
|
||||
$itemList = null;
|
||||
if(!is_null($this->_SUBREPORTS) && count($this->_SUBREPORTS)>0){
|
||||
if (!is_null($this->_SUBREPORTS) && count($this->_SUBREPORTS) > 0) {
|
||||
$itemList = array();
|
||||
foreach($this->_SUBREPORTS as $item){
|
||||
if(\boolValue($item["setted"])){
|
||||
foreach ($this->_SUBREPORTS as $item) {
|
||||
if (\boolValue($item["setted"])) {
|
||||
$isJrxml = \Utility\Str::ciEquals($item["format"], "jrxml");
|
||||
$itemList[] = array(
|
||||
"name" => $item["jasper_filename"],
|
||||
@@ -332,22 +384,22 @@ class JasperProcessor{
|
||||
}
|
||||
return $itemList;
|
||||
}
|
||||
|
||||
private function getJasperDTO(){
|
||||
|
||||
private function getJasperDTO() {
|
||||
$JasperDTO = new EntityItem;
|
||||
$JasperDTO->set("reportName", $this->_REPORT_NAME)
|
||||
->set("query", $this->get_queryCompiled())
|
||||
->set("jsonSource", $this->_JSON_SOURCE)
|
||||
->set("b64ReportJrxml", $this->_B64_JRXML)
|
||||
->set("subreports", $this->getSubreportDTOList())
|
||||
->set("whereCond", $this->get_where());
|
||||
|
||||
foreach($this->_PARAMS as $item){
|
||||
->set("query", $this->get_queryCompiled())
|
||||
->set("jsonSource", $this->_JSON_SOURCE)
|
||||
->set("b64ReportJrxml", $this->_B64_JRXML)
|
||||
->set("subreports", $this->getSubreportDTOList())
|
||||
->set("whereCond", $this->get_where());
|
||||
|
||||
foreach ($this->_PARAMS as $item) {
|
||||
$Param = new EntityItem;
|
||||
$Param->set("name", $item["name"])->set("value", $item["value"]);
|
||||
$JasperDTO->set("params")->append($Param);
|
||||
}
|
||||
|
||||
|
||||
return $JasperDTO;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,18 @@
|
||||
<?php
|
||||
class JtbDisegniFiles{
|
||||
|
||||
class JtbDisegniFiles {
|
||||
const DISEGNO_ALLEGATO = "DISEGNO/ALLEGATO";
|
||||
const ETICHETTA_CARTONE = "ETICHETTA_UI";
|
||||
const ETICHETTA_PRODOTTO = "ETICHETTA_UC";
|
||||
const ETICHETTA_SSCC = "ETICHETTA_UL";
|
||||
const REPORT_JASPER = "REPORT_JASPER";
|
||||
const SUBREPORT_JASPER = "SUBREPORT_JASPER";
|
||||
|
||||
public static function get_items($filter){ // pk cod_disegno + filename
|
||||
|
||||
public static function get_items($filter) { // pk cod_disegno + filename
|
||||
$sql = "SELECT * FROM(
|
||||
SELECT jtb_disegni_files.cod_disegno,
|
||||
jtb_disegni_files.file_name,
|
||||
NULL AS id,
|
||||
jrl_cicl_disegni.cod_prod,
|
||||
0 AS size,
|
||||
jtb_disegni_files.content,
|
||||
@@ -21,20 +23,21 @@ class JtbDisegniFiles{
|
||||
FROM jtb_disegni_files LEFT OUTER JOIN jrl_cicl_disegni ON jtb_disegni_files.cod_disegno = jrl_cicl_disegni.cod_disegno
|
||||
) t
|
||||
WHERE 1=1";
|
||||
|
||||
|
||||
$Query = new Query($sql);
|
||||
foreach($filter as $k => $v){
|
||||
foreach ($filter as $k => $v) {
|
||||
$Query->where($k, $v);
|
||||
}
|
||||
$Ret = $Query->toRet()->date2ts()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
foreach($arr_rows as $i => $row){
|
||||
foreach ($arr_rows as $i => $row) {
|
||||
$row["content"] = Utility\Compression\GZ::uncompress($row["content"]);
|
||||
$content = $row["content"];
|
||||
$fileName = $row["file_name"];
|
||||
$icon = Utility\File::getFaIcoFromName($fileName);
|
||||
$arr_rows[$i] = array_merge($arr_rows[$i], array(
|
||||
"id" => $row["id"],
|
||||
"file_size" => strlen($content),
|
||||
"user_creator" => null,
|
||||
"content" => $content,
|
||||
@@ -43,35 +46,35 @@ class JtbDisegniFiles{
|
||||
"icon_style" => $icon["style"]
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
$Ret->set_data($arr_rows);
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function get_item($key){
|
||||
|
||||
public static function get_item($key) {
|
||||
$Ret = self::get_items($key);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
if(count($retData)>0){
|
||||
if (count($retData) > 0) {
|
||||
$Ret->set_data($retData[0]);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Allegato non valido");
|
||||
}
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function cache($key){
|
||||
|
||||
public static function cache($key) {
|
||||
$Ret = self::get_item($key);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$content = $retData["content"];
|
||||
$fileName = pathinfo($retData["file_name"], PATHINFO_BASENAME);
|
||||
$Ret = \Cache::writeR($fileName, $content, "JtbDisegniFiles", true);
|
||||
}
|
||||
|
||||
|
||||
return $Ret->set_data(null);
|
||||
}
|
||||
}
|
||||
315
public_html/classes/KendoService.class.php
Normal file
315
public_html/classes/KendoService.class.php
Normal file
@@ -0,0 +1,315 @@
|
||||
<?php
|
||||
|
||||
class KendoService {
|
||||
public static function queryInizializerService($data, $sqlFile, $defaultOrderField, $sqlIsString = false) {
|
||||
$pageSize = (isset($data['pageSize'])) ? $data['pageSize'] : '20';
|
||||
$page = (isset($data['page'])) ? $data['page'] : '0';
|
||||
|
||||
$query = new Query();
|
||||
|
||||
if ($sqlIsString) {
|
||||
$query
|
||||
->module("index")
|
||||
->importSqlFile('kendo-query-template')
|
||||
->setVar('sql', $sqlFile);
|
||||
} else {
|
||||
$query
|
||||
->importSqlFile($sqlFile);
|
||||
}
|
||||
|
||||
$filter = "1 = 1";
|
||||
|
||||
if (isset($data["filter"]) && count($data["filter"]["filters"]) > 0) {
|
||||
$filter = KendoService::filter($data["filter"]);
|
||||
}
|
||||
|
||||
$orderBy = $defaultOrderField;
|
||||
|
||||
if (isset($data["sort"]) && count($data["sort"]) > 0) {
|
||||
$orderBy = KendoService::sort($data["sort"]);
|
||||
}
|
||||
|
||||
$query
|
||||
->setVar("filter", $filter)
|
||||
->setVar('orderBy', $orderBy)
|
||||
->setVar('pageSize', $pageSize)
|
||||
->setVar('pageNum', $page)
|
||||
->cacheResult()
|
||||
->toRet()
|
||||
->date2ts();
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
public static function queryFiltersService($data, $alias) {
|
||||
$filter = (isset($data['filter'])) ? $data['filter'] : array();
|
||||
|
||||
$query = KendoService::filterQuery($filter, $alias, "");
|
||||
|
||||
$query = chop($query, "and ");
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
public static function filterQuery($filter, $alias, $query) {
|
||||
if (isset($filter["filters"])) {
|
||||
$query .= "(";
|
||||
$logic = $filter["logic"];
|
||||
$filters = $filter["filters"];
|
||||
|
||||
foreach ($filters as $filt) {
|
||||
if (array_key_exists('filters', $filt)) {
|
||||
$query = KendoService::filterQuery($filt, $alias, $query);
|
||||
continue;
|
||||
}
|
||||
|
||||
$field = (array_key_exists('field', $filt)) ? $filt['field'] : "";
|
||||
$operator = (array_key_exists('operator', $filt)) ? $filt['operator'] : "";
|
||||
$value = (array_key_exists('value', $filt)) ? $filt['value'] : "";
|
||||
$type = (array_key_exists('type', $filt)) ? $filt['type'] : "";
|
||||
|
||||
$val1 = null;
|
||||
$val2 = null;
|
||||
|
||||
switch ($operator) {
|
||||
case 'contains' :
|
||||
$op = 'LIKE';
|
||||
$val = '%' . $value . '%';
|
||||
break;
|
||||
case 'doesnotcontain' :
|
||||
$op = 'NOT LIKE';
|
||||
$val = '%' . $value . '%';
|
||||
break;
|
||||
case 'neq' :
|
||||
$op = '<>';
|
||||
$val = $value;
|
||||
break;
|
||||
case 'startswith' :
|
||||
$op = 'LIKE';
|
||||
$val = $value . '%';
|
||||
break;
|
||||
case 'endswith' :
|
||||
$op = 'LIKE';
|
||||
$val = '%' . $value;
|
||||
break;
|
||||
case 'isnull' :
|
||||
$op = 'IS NULL';
|
||||
$val = NULL;
|
||||
break;
|
||||
case 'isnotnull' :
|
||||
$op = 'IS NOT NULL';
|
||||
$val = NULL;
|
||||
break;
|
||||
case 'isempty' :
|
||||
$op = 'LIKE';
|
||||
$val = '';
|
||||
break;
|
||||
case 'isnotempty' :
|
||||
$op = 'NOT LIKE';
|
||||
$val = '';
|
||||
break;
|
||||
case 'gte' :
|
||||
$op = '>=';
|
||||
$val = $value;
|
||||
break;
|
||||
case 'gt' :
|
||||
$op = '>';
|
||||
$val = $value;
|
||||
break;
|
||||
case 'lte' :
|
||||
$op = '<=';
|
||||
$val = $value;
|
||||
break;
|
||||
case 'lt' :
|
||||
$op = '<';
|
||||
$val = $value;
|
||||
break;
|
||||
case 'inday' :
|
||||
$val1 = strftime("%Y-%m-%d 00:00", $value);
|
||||
$val2 = strftime("%Y-%m-%d 23:59", $value);
|
||||
break;
|
||||
case 'eq':
|
||||
default:
|
||||
$op = '=';
|
||||
$val = $value;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($val1 && $val2) {
|
||||
$query .= ($alias . '.' . $field . ' > \'' . $val1 . '\' ' . $logic . ' ');
|
||||
$query .= ($alias . '.' . $field . ' < \'' . $val2 . '\' ' . $logic . ' ');
|
||||
} else {
|
||||
// Se val è un timestamp (controlla se la stringa ha solo numeri)
|
||||
if (ctype_digit($val) && ($type === "datetime" || $type === "date")) {
|
||||
if (strftime("%Y-%m-%d %R", $val)) {
|
||||
$val = strftime("%Y-%m-%d %R", $val);
|
||||
}
|
||||
}
|
||||
|
||||
$val = ($val) ? ' \'' . $val . '\'' : null;
|
||||
|
||||
$query .= ($alias . '.' . $field . ' ' . $op . $val . ' ' . $logic . ' ');
|
||||
}
|
||||
}
|
||||
$query = chop($query, $logic . " ");
|
||||
$query .= ") and ";
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
public static function filter($filter) {
|
||||
$filterWhere = \YaLinqo\Enumerable::from($filter["filters"])
|
||||
->select(function ($filter) {
|
||||
$isString = false;
|
||||
$value = "";
|
||||
|
||||
if (isset($filter["value"])) {
|
||||
$value = $filter["value"];
|
||||
|
||||
if ($date = DateTime::createFromFormat("Y-m-d\TH:i:s+", $value)) {
|
||||
$value = $date->format(Format::strtotimeYMDHMS);
|
||||
|
||||
$isString = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($filter["filters"])) {
|
||||
$where = KendoService::filter($filter);
|
||||
} else {
|
||||
switch ($filter["operator"]) {
|
||||
case "eq":
|
||||
$where = "{field} = {value}";
|
||||
|
||||
$isString = !is_numeric($value);
|
||||
|
||||
break;
|
||||
case "neq":
|
||||
$where = "{field} <> {value}";
|
||||
|
||||
$isString = !is_numeric($value);
|
||||
|
||||
break;
|
||||
case "isnull":
|
||||
$where = "{field} is null";
|
||||
break;
|
||||
case "isnotnull":
|
||||
$where = "{field} is not null";
|
||||
break;
|
||||
case "gte":
|
||||
$where = "{field} >= {value}";
|
||||
break;
|
||||
case "gt":
|
||||
$where = "{field} > {value}";
|
||||
break;
|
||||
case "lt":
|
||||
$where = "{field} < {value}";
|
||||
break;
|
||||
case "lte":
|
||||
$where = "{field} <= {value}";
|
||||
break;
|
||||
case "isempty":
|
||||
$where = "{field} = ''";
|
||||
break;
|
||||
case "isnotempty":
|
||||
$where = "{field} <> ''";
|
||||
break;
|
||||
case "startswith":
|
||||
$where = "{field} like '{value}%'";
|
||||
break;
|
||||
case "contains":
|
||||
$where = "{field} like '%{value}%'";
|
||||
break;
|
||||
case "doesnotcontain":
|
||||
$where = "{field} not like '%{value}%'";
|
||||
break;
|
||||
case "endswith":
|
||||
$where = "{field} like '%{value}'";
|
||||
break;
|
||||
case "isnullorempty":
|
||||
$where = "{field} is null or {field} = ''";
|
||||
break;
|
||||
case "isnotnullorempty":
|
||||
$where = "{field} is not null and {field} <> ''";
|
||||
break;
|
||||
default:
|
||||
$where = "1 = 1";
|
||||
}
|
||||
}
|
||||
|
||||
$value = str_replace("'", "''", $value);
|
||||
|
||||
return strtr($where,
|
||||
array(
|
||||
"{field}" => isset($filter["field"]) ? $filter["field"] : "",
|
||||
"{value}" => $isString ? "'" . $value . "'" : $value
|
||||
)
|
||||
);
|
||||
})
|
||||
->toString(" " . $filter["logic"] . " ");
|
||||
|
||||
return isset($filterWhere) ? "(" . $filterWhere . ")" : "1 = 1";
|
||||
}
|
||||
|
||||
public static function sort($sort, $reverse = false) {
|
||||
$arraySort = \YaLinqo\Enumerable::from($sort)
|
||||
->select(function ($field) {
|
||||
return sprintf(
|
||||
"%s %s",
|
||||
$field["field"],
|
||||
$field["dir"]
|
||||
);
|
||||
})
|
||||
->toArray();
|
||||
|
||||
if ($reverse) {
|
||||
$arraySort = array_reverse($arraySort);
|
||||
}
|
||||
|
||||
return implode(", ", $arraySort);
|
||||
}
|
||||
|
||||
public static function getColumnsDefinitionFromQuery($sql) {
|
||||
$query = new Query();
|
||||
|
||||
$query
|
||||
->setSql($sql)
|
||||
->cacheResult();
|
||||
$Ret = $query->toRet()->firstRow()->execute();
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_types = $query->getColumnsTypes();
|
||||
|
||||
$_colonne = array();
|
||||
|
||||
foreach ($arr_types as $key => $value) {
|
||||
$colonna = array();
|
||||
if (!is_null($value)) {
|
||||
switch ($value) {
|
||||
case in_array($value, array("int", "bigint", "smallint", "tinyint", "real", "decimal", "float", "numeric")):
|
||||
$type = "number";
|
||||
break;
|
||||
case in_array($value, array("date", "datetime")):
|
||||
$type = "date";
|
||||
break;
|
||||
case in_array($value, array("bit")):
|
||||
$type = "boolean";
|
||||
break;
|
||||
default:
|
||||
$type = "string";
|
||||
break;
|
||||
}
|
||||
|
||||
$colonna["field"] = $key;
|
||||
$colonna["title"] = ucwords(str_replace('_', ' ', $key));
|
||||
$colonna["type"] = $type;
|
||||
$colonna["attributes"] = array("style" => 'text-align: center;');
|
||||
|
||||
$_colonne[] = $colonna;
|
||||
}
|
||||
}
|
||||
$Ret->set_data($_colonne);
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
class Mime{
|
||||
|
||||
class Mime {
|
||||
const JPG = "image/jpeg";
|
||||
const JPEG = "image/jpeg";
|
||||
const PNG = "image/png";
|
||||
@@ -17,12 +18,12 @@ class Mime{
|
||||
const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||
const PPT = "application/vnd.ms-powerpoint";
|
||||
const PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
||||
|
||||
public static function get_list(){ // restituisce lista ["application/json" => ["json"],...]
|
||||
|
||||
public static function get_list() { // restituisce lista ["application/json" => ["json"],...]
|
||||
$mimeClass = new ReflectionClass("Mime");
|
||||
$returnArray = array();
|
||||
foreach($mimeClass->getConstants() as $key => $value){
|
||||
if(!isset($returnArray[$value])){
|
||||
foreach ($mimeClass->getConstants() as $key => $value) {
|
||||
if (!isset($returnArray[$value])) {
|
||||
$returnArray[$value] = array();
|
||||
}
|
||||
$returnArray[$value][] = strtolower($key);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
class Modulo
|
||||
{
|
||||
class Modulo {
|
||||
private $id = null; // camel case decoded
|
||||
private $title = null;
|
||||
private $pages = null;
|
||||
@@ -18,30 +17,25 @@ class Modulo
|
||||
private $azienda = null; // current default
|
||||
private $optionsAzienda = null;
|
||||
|
||||
public function __construct($id = null, $azienda = null)
|
||||
{
|
||||
public function __construct($id = null, $azienda = null) {
|
||||
$id = \Utility\Str::isCamelCaseEncoded($id) ? strtolower(\Utility\Str::camelCaseDecode($id)) : $id;
|
||||
$this->setAzienda($azienda)->load($id);
|
||||
}
|
||||
|
||||
public function isLoaded()
|
||||
{
|
||||
public function isLoaded() {
|
||||
return !is_null($this->id);
|
||||
}
|
||||
|
||||
private function getIdCamelCaseEncoded()
|
||||
{
|
||||
private function getIdCamelCaseEncoded() {
|
||||
return ucfirst(\Utility\Str::camelCaseEncode($this->id));
|
||||
}
|
||||
|
||||
public function setAzienda($v)
|
||||
{
|
||||
public function setAzienda($v) {
|
||||
$this->azienda = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function load($id)
|
||||
{
|
||||
public function load($id) {
|
||||
if (!is_null($id)) {//var_dump($id);
|
||||
$listModuli = \PVM::getListModuli();//echopre($listModuli);
|
||||
if (isset($listModuli[$id])) {
|
||||
@@ -65,36 +59,30 @@ class Modulo
|
||||
}
|
||||
}
|
||||
|
||||
public function getOptionAzienda($key)
|
||||
{
|
||||
public function getOptionAzienda($key) {
|
||||
if (!is_null($this->optionsAzienda) && array_key_exists($key, $this->optionsAzienda)) {
|
||||
return $this->optionsAzienda[$key];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
public function getTitle() {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function getLibs()
|
||||
{
|
||||
public function getLibs() {
|
||||
return $this->libs;
|
||||
}
|
||||
|
||||
public function getGroup()
|
||||
{
|
||||
public function getGroup() {
|
||||
return $this->group;
|
||||
}
|
||||
|
||||
public function getPosition()
|
||||
{
|
||||
public function getPosition() {
|
||||
if (!is_null($this->getOptionAzienda("position"))) {
|
||||
$positions = $this->position;
|
||||
|
||||
@@ -114,30 +102,25 @@ class Modulo
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function getChildren()
|
||||
{
|
||||
public function getChildren() {
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
public function getPages()
|
||||
{
|
||||
public function getPages() {
|
||||
return $this->pages;
|
||||
}
|
||||
|
||||
public function getPage()
|
||||
{
|
||||
public function getPage() {
|
||||
$parts = explode("?", $this->getPages()); // es. "colli_aperti.php?spedizione" -> "colli_aperti.php", "spedizione"
|
||||
return $parts[0];
|
||||
}
|
||||
|
||||
public function getPageDet()
|
||||
{
|
||||
public function getPageDet() {
|
||||
$parts = explode("?", $this->getPages()); // es. "colli_aperti.php?spedizione" -> "colli_aperti.php", "spedizione"
|
||||
return isset($parts[1]) ? $parts[1] : null;
|
||||
}
|
||||
|
||||
private function loadOptionsAzienda()
|
||||
{
|
||||
private function loadOptionsAzienda() {
|
||||
$id = $this->id;
|
||||
$result = array_values(array_filter(AziendaUtils::getModuli($this->azienda), function ($x) use ($id) {
|
||||
return $x["name"] === $id;
|
||||
@@ -150,14 +133,14 @@ class Modulo
|
||||
"usergroups" => self::getObjectValue($options, "usergroups"),
|
||||
"users" => self::getObjectValue($options, "users"),
|
||||
"position" => self::getObjectValue($options, "position"),
|
||||
"showLocales" => self::getObjectValue($options, "showLocales", false)
|
||||
);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isAuthorizedToCurrentUser($ignoreDev = false)
|
||||
{
|
||||
public function isAuthorizedToCurrentUser($ignoreDev = false) {
|
||||
if (!$ignoreDev && \PVM::isDevClient() && $this->flagDev === true) {
|
||||
return true;
|
||||
}
|
||||
@@ -169,23 +152,19 @@ class Modulo
|
||||
return \PVM::processItemPolicyToCurrentUser($this->optionsAzienda);
|
||||
}
|
||||
|
||||
private static function getObjectValue($object, $key, $default = null)
|
||||
{
|
||||
private static function getObjectValue($object, $key, $default = null) {
|
||||
return array_key_exists($key, $object) ? $object[$key] : $default;
|
||||
}
|
||||
|
||||
public function getUsergroupsPolicy()
|
||||
{
|
||||
public function getUsergroupsPolicy() {
|
||||
return $this->getOptionAzienda("usergroups");
|
||||
}
|
||||
|
||||
public function getUsersPolicy()
|
||||
{
|
||||
public function getUsersPolicy() {
|
||||
return $this->getOptionAzienda("users");
|
||||
}
|
||||
|
||||
public function getParsedPolicy()
|
||||
{
|
||||
public function getParsedPolicy() {
|
||||
$retGroup = null;
|
||||
|
||||
$usergroups = $this->getUsergroupsPolicy();
|
||||
@@ -219,8 +198,7 @@ class Modulo
|
||||
return array("groups" => $retGroup, "users" => $retUser);
|
||||
}
|
||||
|
||||
public function runMethod($method, $data = array())
|
||||
{
|
||||
public function runMethod($method, $data = array()) {
|
||||
$Ret = new \Ret;
|
||||
if ($this->isLoaded()) {
|
||||
$idModulo = $this->id;
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
<?php
|
||||
class Mssql{
|
||||
|
||||
class Mssql {
|
||||
private $hostName = null;
|
||||
private $userName = null;
|
||||
private $password = null;
|
||||
private $dbName = null;
|
||||
|
||||
|
||||
public $Row;
|
||||
public $Error_message = null;
|
||||
private $Link_ID = 0;
|
||||
private $Query_ID = 0;
|
||||
private $Record = array();
|
||||
|
||||
public function __construct($settings = null){
|
||||
if(!is_null($settings)){
|
||||
|
||||
public function __construct($settings = null) {
|
||||
if (!is_null($settings)) {
|
||||
$this->hostName = $settings["hostName"];
|
||||
$this->userName = $settings["userName"];
|
||||
$this->password = $settings["password"];
|
||||
@@ -21,106 +22,106 @@ class Mssql{
|
||||
}
|
||||
|
||||
|
||||
private function close(){
|
||||
private function close() {
|
||||
$this->connection = null;
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
public function __destruct() {
|
||||
$this->close();
|
||||
}
|
||||
private function connect(){
|
||||
if($this->Link_ID==0){
|
||||
|
||||
private function connect() {
|
||||
if ($this->Link_ID == 0) {
|
||||
$this->Link_ID = @mssql_connect($this->hostName, $this->userName, $this->password);
|
||||
if(!$this->Link_ID){
|
||||
$this->Error_message = "Connessione su database host ".$this->hostName." fallita";
|
||||
if (!$this->Link_ID) {
|
||||
$this->Error_message = "Connessione su database host " . $this->hostName . " fallita";
|
||||
return false;
|
||||
}
|
||||
if(!@mssql_select_db($this->dbName, $this->Link_ID)){
|
||||
$this->Error_message = "Database ".$this->dbName." non disponibile (".mssql_get_last_message().")";
|
||||
if (!@mssql_select_db($this->dbName, $this->Link_ID)) {
|
||||
$this->Error_message = "Database " . $this->dbName . " non disponibile (" . mssql_get_last_message() . ")";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function query($Query_String){
|
||||
if($this->connect()){
|
||||
public function query($Query_String) {
|
||||
if ($this->connect()) {
|
||||
@mssql_query("SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED");
|
||||
// @mssql_query("SET ANSI_WARNINGS ON");
|
||||
// @mssql_query("SET ANSI_WARNINGS ON");
|
||||
|
||||
$this->Query_ID = @mssql_query($Query_String, $this->Link_ID);
|
||||
$this->Row = 0;
|
||||
// var_dump($this->Query_ID." ".$Query_String);
|
||||
if(!$this->Query_ID){
|
||||
// var_dump($this->Query_ID." ".$Query_String);
|
||||
if (!$this->Query_ID) {
|
||||
$this->Error_message = mssql_get_last_message();
|
||||
}
|
||||
return $this->Query_ID;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function begin_transaction(){
|
||||
|
||||
public function begin_transaction() {
|
||||
$this->connect();
|
||||
$result = @mssql_query("BEGIN TRAN");
|
||||
return !($result===false);
|
||||
return !($result === false);
|
||||
//return $this->query("BEGIN TRAN");
|
||||
}
|
||||
|
||||
public function commit(){
|
||||
if($this->Link_ID!=0){
|
||||
|
||||
public function commit() {
|
||||
if ($this->Link_ID != 0) {
|
||||
$result = @mssql_query("COMMIT");
|
||||
if($result===false){
|
||||
if ($result === false) {
|
||||
$this->Error_message = mssql_get_last_message();
|
||||
}
|
||||
return !($result===false);
|
||||
return !($result === false);
|
||||
//return $this->query("COMMIT");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function rollback(){
|
||||
if($this->Link_ID!=0){
|
||||
|
||||
public function rollback() {
|
||||
if ($this->Link_ID != 0) {
|
||||
$result = @mssql_query("ROLLBACK");
|
||||
if($result===false){
|
||||
if ($result === false) {
|
||||
$this->Error_message = mssql_get_last_message();
|
||||
}
|
||||
return !($result===false);
|
||||
// return $this->query("ROLLBACK");
|
||||
return !($result === false);
|
||||
// return $this->query("ROLLBACK");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function next_record(){
|
||||
|
||||
public function next_record() {
|
||||
$this->Record = mssql_fetch_array($this->Query_ID);
|
||||
$this->Row += 1;
|
||||
$stat = is_array($this->Record);
|
||||
return $stat;
|
||||
}
|
||||
|
||||
public function free_stmt(){ // libera memoria
|
||||
|
||||
public function free_stmt() { // libera memoria
|
||||
mssql_free_result($this->Query_ID);
|
||||
// mssql_free_statement($stmt)
|
||||
// mssql_free_statement($stmt)
|
||||
return true;
|
||||
}
|
||||
|
||||
public function num_rows(){
|
||||
|
||||
public function num_rows() {
|
||||
return mssql_num_rows($this->Query_ID);
|
||||
}
|
||||
|
||||
public function num_fields(){
|
||||
public function num_fields() {
|
||||
return mssql_num_fields($this->Query_ID);
|
||||
}
|
||||
|
||||
public function field_name($column){
|
||||
|
||||
public function field_name($column) {
|
||||
return mssql_field_name($this->Query_ID, $column);
|
||||
}
|
||||
|
||||
public function field_type($column){
|
||||
|
||||
public function field_type($column) {
|
||||
return mssql_field_type($this->Query_ID, $column);
|
||||
}
|
||||
|
||||
public function f($Name){
|
||||
|
||||
public function f($Name) {
|
||||
return $this->Record[$Name];
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
class MtbAartLink{
|
||||
|
||||
public static function get_items($codMart, $idRiga = null){
|
||||
class MtbAartLink {
|
||||
|
||||
public static function get_items($codMart, $idRiga = null) {
|
||||
$Query = new Query;
|
||||
$Query->select("cod_mart", "id_riga", "path_link", "descrizione_link", "3*(DATALENGTH(b64_content)/4) AS file_size")
|
||||
->from("mtb_aart_link")
|
||||
->where("cod_mart", $codMart);
|
||||
if(!is_null($idRiga)){
|
||||
if (!is_null($idRiga)) {
|
||||
$Query->where("id_riga", $idRiga);
|
||||
}
|
||||
|
||||
$Ret = $Query->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
foreach($arr_rows as $i => $row){
|
||||
foreach ($arr_rows as $i => $row) {
|
||||
$pathLink = $row["path_link"];
|
||||
$icon = Utility\File::getFaIcoFromName($pathLink);
|
||||
$arr_rows[$i]["file_name"] = $pathLink;
|
||||
@@ -31,9 +32,9 @@ class MtbAartLink{
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function get_item($codMart, $idRiga){
|
||||
public static function get_item($codMart, $idRiga) {
|
||||
$Ret = self::get_items($codMart, $idRiga);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$Ret->set_data(count($retData) > 0 ? $retData[0] : null);
|
||||
}
|
||||
@@ -41,8 +42,7 @@ class MtbAartLink{
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function getItemContent($codMart, $idRiga, $includeDescrizione = false, $includeB64 = true)
|
||||
{
|
||||
public static function getItemContent($codMart, $idRiga, $includeDescrizione = false, $includeB64 = true) {
|
||||
$Query = new Query;
|
||||
|
||||
$Query->select("path_link", "id_riga");
|
||||
@@ -87,61 +87,60 @@ class MtbAartLink{
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function remove($codMart, $idRiga){
|
||||
public static function remove($codMart, $idRiga) {
|
||||
$MtbAartLink = new EntityItem("mtb_aart_link");
|
||||
$MtbAartLink->set("idRiga", $idRiga)->delete();
|
||||
|
||||
$MtbAart = new EntityItem("mtb_aart");
|
||||
$MtbAart->update()
|
||||
->set("codMart", $codMart)
|
||||
->set("mtbAartLink")->append($MtbAartLink);
|
||||
|
||||
->set("codMart", $codMart)
|
||||
->set("mtbAartLink")->append($MtbAartLink);
|
||||
|
||||
$Ret = $MtbAart->send()->set_data(null);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_data(array("cod_mart" => $codMart, "id_riga" => $idRiga));
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function upload($codMart, $fileItem){
|
||||
public static function upload($codMart, $fileItem) {
|
||||
$Ret = new Ret;
|
||||
|
||||
if(file_exists($fileItem["tmp_name"])){
|
||||
if (file_exists($fileItem["tmp_name"])) {
|
||||
$name = str_replace("'", "", $fileItem["name"]);
|
||||
$content = file_get_contents($fileItem["tmp_name"]);
|
||||
|
||||
if(Utility\File::isImageFromBlob($content)){
|
||||
if (Utility\File::isImageFromBlob($content)) {
|
||||
$content = \Utility\Image::resizeStaticToBlob($content, 1600, 1200);
|
||||
if($content === false){
|
||||
if ($content === false) {
|
||||
return $Ret->set_errorCode(\ErrorHandler::FAIL_IMAGERESIZE);
|
||||
}
|
||||
}
|
||||
|
||||
$Ret = self::save($codMart, $name, base64_encode($content));
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
@unlink($fileItem["tmp_name"]);
|
||||
}
|
||||
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("File non trovato");
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private static function get_uniqueFileName($fileName){
|
||||
private static function get_uniqueFileName($fileName) {
|
||||
$Query = new Query;
|
||||
$Query->select("path_link")->from("mtb_aart_link");
|
||||
$Ret = $Query->firstColumn()->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_string(Utility\File::check_duplicateFilename($Ret->get_data(), $fileName, "-[N]", 3));
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function save($codMart, $pathLink = null, $b64Content = null, $idRiga = null, $descrizioneLink = null, $uniqueFileName = false)
|
||||
{
|
||||
public static function save($codMart, $pathLink = null, $b64Content = null, $idRiga = null, $descrizioneLink = null, $uniqueFileName = false) {
|
||||
$MtbAartLink = new EntityItem("mtb_aart_link");
|
||||
$MtbAartLink->insert_or_update()
|
||||
->set("idRiga", $idRiga)
|
||||
@@ -188,38 +187,38 @@ class MtbAartLink{
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function cache($codMart, $idRiga, $options = array()){
|
||||
public static function cache($codMart, $idRiga, $options = array()) {
|
||||
$retData = null;
|
||||
$options["renew"] = isset($options["renew"]) && $options["renew"] !== false;
|
||||
$options["quality"] = isset($options["quality"]) ? $options["quality"] : null;
|
||||
$options["resize"] = isset($options["resize"]) && is_array($options["resize"]) && isset($options["resize"][0]) ? $options["resize"] : false;
|
||||
$sadImageOnError = isset($options["sadImageOnError"]) && $options["sadImageOnError"] !== false;
|
||||
|
||||
|
||||
$Ret = \MtbAartLink::getItemContent($codMart, $idRiga);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$fileItem = $Ret->get_data();
|
||||
$fileName = $fileItem["file_name"];
|
||||
|
||||
if(Utility\File::isImageFromName($fileName) && $options["resize"] !== false){
|
||||
if (Utility\File::isImageFromName($fileName) && $options["resize"] !== false) {
|
||||
$Ret = \Utility\Image::getResizeImage($fileName, $options, $fileItem["content"]);
|
||||
|
||||
} else{
|
||||
} else {
|
||||
$filePath = \Cache::get_filepath($fileName, true, true);
|
||||
if($options["renew"] === false && file_exists($filePath)){
|
||||
if ($options["renew"] === false && file_exists($filePath)) {
|
||||
$Ret->set_string($filePath)->set_data(null);
|
||||
|
||||
} else{
|
||||
} else {
|
||||
$Ret = \Cache::writeR($fileName, $fileItem["content"], true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$Ret->is_OK() && $sadImageOnError){
|
||||
if (!$Ret->is_OK() && $sadImageOnError) {
|
||||
$retData = array("sad" => true);
|
||||
$filePath = "images/sad.png";
|
||||
if($options["resize"] !== false){
|
||||
if ($options["resize"] !== false) {
|
||||
$Ret = Utility\Image::getResizeImage($filePath, $options);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_OK()->set_string($filePath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,123 +1,124 @@
|
||||
<?php
|
||||
class OrdiniWeb{
|
||||
private static function build_entityItem($key){
|
||||
|
||||
class OrdiniWeb {
|
||||
private static function build_entityItem($key) {
|
||||
$WdtbOrdt = new EntityItem("wdtb_ordt");
|
||||
$WdtbOrdt->set("gestione", $key["gestione"])
|
||||
->setDate("dataOrd", $key["data_ord"])
|
||||
->set("numOrd", $key["num_ord"])
|
||||
->set("serie", $key["serie"]);
|
||||
->setDate("dataOrd", $key["data_ord"])
|
||||
->set("numOrd", $key["num_ord"])
|
||||
->set("serie", $key["serie"]);
|
||||
return $WdtbOrdt;
|
||||
}
|
||||
|
||||
private static function isDeletable($key){
|
||||
|
||||
private static function isDeletable($key) {
|
||||
$Query = new Query;
|
||||
$Query->select("num_ord")
|
||||
->from("dtb_ordt")
|
||||
->where("gestione", $key["gestione"])
|
||||
->whereDate("data_ord", $key["data_ord"])
|
||||
->where("serie", $key["serie"])
|
||||
->where("num_ord_provv", $key["num_ord"]);
|
||||
->from("dtb_ordt")
|
||||
->where("gestione", $key["gestione"])
|
||||
->whereDate("data_ord", $key["data_ord"])
|
||||
->where("serie", $key["serie"])
|
||||
->where("num_ord_provv", $key["num_ord"]);
|
||||
$Ret = $Query->toRet()->countRows();
|
||||
if($Ret->is_OK()){
|
||||
$Ret->set_boolean($Ret->get_number()==0);
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_boolean($Ret->get_number() == 0);
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private static function getFlagElaborato($key){
|
||||
|
||||
private static function getFlagElaborato($key) {
|
||||
$Query = new Query;
|
||||
$Query->select("flag_elaborato")
|
||||
->from("wdtb_ordt")
|
||||
->where("gestione", $key["gestione"])
|
||||
->whereDate("data_ord", $key["data_ord"])
|
||||
->where("num_ord", $key["num_ord"])
|
||||
->where("serie", $key["serie"]);
|
||||
|
||||
->from("wdtb_ordt")
|
||||
->where("gestione", $key["gestione"])
|
||||
->whereDate("data_ord", $key["data_ord"])
|
||||
->where("num_ord", $key["num_ord"])
|
||||
->where("serie", $key["serie"]);
|
||||
|
||||
return $Query->toRet()->firstRowFirstValue()->execute();
|
||||
}
|
||||
|
||||
public static function isElaborato($key){
|
||||
|
||||
public static function isElaborato($key) {
|
||||
$Ret = self::getFlagElaborato($key);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$flagElaborato = $Ret->get_data();
|
||||
$Ret->set_boolean($flagElaborato==="S");
|
||||
$Ret->set_boolean($flagElaborato === "S");
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function delete($data){
|
||||
|
||||
public static function delete($data) {
|
||||
$Ret = new Ret;
|
||||
$key = $data["key"];
|
||||
if(!is_null($key)){
|
||||
if (!is_null($key)) {
|
||||
$Ret = self::isDeletable($key);
|
||||
if($Ret->is_OK()){
|
||||
if($Ret->get_boolean()){
|
||||
if ($Ret->is_OK()) {
|
||||
if ($Ret->get_boolean()) {
|
||||
$WdtbOrdt = self::build_entityItem($key);
|
||||
$Ret = $WdtbOrdt->delete()->send();
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Non è possibile eliminare un ordine già importato");
|
||||
}
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Chiave ordine non valida");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function confirm($data, $flagElaborato = "N"){
|
||||
|
||||
public static function confirm($data, $flagElaborato = "N") {
|
||||
$Ret = new Ret;
|
||||
if(!is_null($data["key"])){
|
||||
if (!is_null($data["key"])) {
|
||||
$WdtbOrdt = self::build_entityItem($data["key"]);
|
||||
$WdtbOrdt->set("flagElaborato", $flagElaborato);
|
||||
|
||||
if(array_key_exists("note", $data)){
|
||||
|
||||
if (array_key_exists("note", $data)) {
|
||||
$WdtbOrdt->set("note", !is_null($data["note"]) ? substr($data["note"], 0, 255) : null, true);
|
||||
}
|
||||
|
||||
|
||||
$Ret = $WdtbOrdt->update()->send();
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Ordine non valido");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function reopen($data){
|
||||
|
||||
public static function reopen($data) {
|
||||
$Ret = new Ret;
|
||||
if(!is_null($data["key"])){
|
||||
if (!is_null($data["key"])) {
|
||||
$Ret = self::getFlagElaborato($data["key"]);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$flagElaborato = $Ret->get_data(); // ignorato stato 'I'
|
||||
if($flagElaborato=="S"){
|
||||
if ($flagElaborato == "S") {
|
||||
$Ret->set_error("Non è possibile aprire un ordine già importato");
|
||||
|
||||
} else if(in_array($flagElaborato, array("N", "P")) || array_key_exists("note", $data)){ // AGGIORNO SE IL FLAG ELABORATO E' N OPPURE SE CI SONO NOTE DA SALVARE
|
||||
} else if (in_array($flagElaborato, array("N", "P")) || array_key_exists("note", $data)) { // AGGIORNO SE IL FLAG ELABORATO E' N OPPURE SE CI SONO NOTE DA SALVARE
|
||||
$WdtbOrdt = self::build_entityItem($data["key"]);
|
||||
$WdtbOrdt->update()
|
||||
->set("flagElaborato", "I")
|
||||
->set("userName", User::get_current_username());
|
||||
|
||||
if(array_key_exists("note", $data)){
|
||||
->set("flagElaborato", "I")
|
||||
->set("userName", User::get_current_username());
|
||||
|
||||
if (array_key_exists("note", $data)) {
|
||||
$WdtbOrdt->set("note", !is_null($data["note"]) ? substr($data["note"], 0, 255) : null, true);
|
||||
}
|
||||
|
||||
|
||||
$Ret = $WdtbOrdt->send();
|
||||
}
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Ordine non valido");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function calc_hashOrdine($key){
|
||||
$s = $key["data_ord"].$key["gestione"].(isset($key["serie"])?$key["serie"]:"").$key["num_ord"];
|
||||
|
||||
public static function calc_hashOrdine($key) {
|
||||
$s = $key["data_ord"] . $key["gestione"] . (isset($key["serie"]) ? $key["serie"] : "") . $key["num_ord"];
|
||||
return substr(md5($s), 0, 10);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
class PDOSqlsrv{
|
||||
|
||||
class PDOSqlsrv {
|
||||
private $hostName = null;
|
||||
private $userName = null;
|
||||
private $password = null;
|
||||
private $dbName = null;
|
||||
|
||||
|
||||
private $connection = null;
|
||||
private $stmt = null;
|
||||
|
||||
|
||||
public $Row;
|
||||
public $Error_message = null;
|
||||
private $Record = array();
|
||||
|
||||
public function __construct($settings = null){
|
||||
if(!is_null($settings)){
|
||||
|
||||
public function __construct($settings = null) {
|
||||
if (!is_null($settings)) {
|
||||
$this->hostName = $settings["hostName"];
|
||||
$this->userName = $settings["userName"];
|
||||
$this->password = $settings["password"];
|
||||
@@ -21,22 +22,21 @@ class PDOSqlsrv{
|
||||
}
|
||||
}
|
||||
|
||||
private function close(){
|
||||
private function close() {
|
||||
$this->connection = null;
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
public function __destruct() {
|
||||
$this->close();
|
||||
}
|
||||
|
||||
|
||||
private function connect(){
|
||||
private function connect() {
|
||||
$this->connection = new PDO(
|
||||
"sqlsrv:".
|
||||
"server=".$this->hostName.";".
|
||||
"Database=".$this->dbName.";".
|
||||
"TransactionIsolation=".PDO::SQLSRV_TXN_READ_UNCOMMITTED,
|
||||
"sqlsrv:" .
|
||||
"server=" . $this->hostName . ";" .
|
||||
"Database=" . $this->dbName . ";" .
|
||||
"TransactionIsolation=" . PDO::SQLSRV_TXN_READ_UNCOMMITTED,
|
||||
$this->userName,
|
||||
$this->password,
|
||||
array(
|
||||
@@ -46,21 +46,21 @@ class PDOSqlsrv{
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function getConnection(){
|
||||
if(is_null($this->connection)){
|
||||
|
||||
public function getConnection() {
|
||||
if (is_null($this->connection)) {
|
||||
$this->connect();
|
||||
}
|
||||
return $this->connection;
|
||||
}
|
||||
|
||||
public function query($sql){
|
||||
if(is_null($this->connection)){
|
||||
|
||||
public function query($sql) {
|
||||
if (is_null($this->connection)) {
|
||||
$this->connect();
|
||||
}
|
||||
|
||||
|
||||
$this->stmt = $this->connection->query($sql);
|
||||
if(!$this->stmt){//
|
||||
if (!$this->stmt) {//
|
||||
$errorInfo = $this->connection->errorInfo();
|
||||
/*
|
||||
STRUTTURA errorInfo:
|
||||
@@ -71,9 +71,10 @@ class PDOSqlsrv{
|
||||
*/
|
||||
$this->Error_message = $errorInfo[2];
|
||||
}
|
||||
|
||||
|
||||
return $this->stmt;
|
||||
}
|
||||
|
||||
/*
|
||||
public function prepare($sql){
|
||||
if(is_null($this->connection)){
|
||||
@@ -102,14 +103,14 @@ class PDOSqlsrv{
|
||||
}
|
||||
}
|
||||
*/
|
||||
public function begin_transaction(){/*
|
||||
public function begin_transaction() {/*
|
||||
$this->connect();
|
||||
$result = @mssql_query("BEGIN TRAN");
|
||||
return !($result===false);*/
|
||||
//return $this->query("BEGIN TRAN");
|
||||
}
|
||||
|
||||
public function commit(){/*
|
||||
|
||||
public function commit() {/*
|
||||
if($this->Link_ID!=0){
|
||||
$result = @mssql_query("COMMIT");
|
||||
if($result===false){
|
||||
@@ -120,8 +121,8 @@ class PDOSqlsrv{
|
||||
}
|
||||
return false;*/
|
||||
}
|
||||
|
||||
public function rollback(){
|
||||
|
||||
public function rollback() {
|
||||
/*
|
||||
if($this->Link_ID!=0){
|
||||
$result = @mssql_query("ROLLBACK");
|
||||
@@ -133,44 +134,44 @@ class PDOSqlsrv{
|
||||
}
|
||||
return false;*/
|
||||
}
|
||||
|
||||
public function next_record(){
|
||||
|
||||
public function next_record() {
|
||||
$this->Record = $this->stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$this->Row += 1;
|
||||
return is_array($this->Record);
|
||||
}
|
||||
|
||||
public function free_stmt(){ // libera memoria
|
||||
if(!is_null($this->stmt)){
|
||||
|
||||
public function free_stmt() { // libera memoria
|
||||
if (!is_null($this->stmt)) {
|
||||
$this->stmt->closeCursor();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function num_rows(){
|
||||
|
||||
public function num_rows() {
|
||||
return $this->stmt->rowCount();
|
||||
}
|
||||
|
||||
public function num_fields(){
|
||||
public function num_fields() {
|
||||
return $this->stmt->columnCount();
|
||||
}
|
||||
|
||||
public function field_name($column){
|
||||
|
||||
public function field_name($column) {
|
||||
$meta = $this->stmt->getColumnMeta($column);
|
||||
return $meta["name"];
|
||||
}
|
||||
|
||||
public function field_type($column){
|
||||
|
||||
public function field_type($column) {
|
||||
$meta = $this->stmt->getColumnMeta($column);
|
||||
// echo $meta["name"].":".$meta["sqlsrv:decl_type"]." ";
|
||||
// echo $meta["name"].":".$meta["sqlsrv:decl_type"]." ";
|
||||
return self::get_typeDesc($meta["sqlsrv:decl_type"]);
|
||||
}
|
||||
|
||||
public function f($Name){
|
||||
|
||||
public function f($Name) {
|
||||
return $this->Record[$Name];
|
||||
}
|
||||
|
||||
private static function get_typeDesc($sqlsrvDeclType){
|
||||
|
||||
private static function get_typeDesc($sqlsrvDeclType) {
|
||||
return $sqlsrvDeclType;
|
||||
//return null;
|
||||
}
|
||||
|
||||
@@ -1,180 +1,243 @@
|
||||
<?php
|
||||
|
||||
namespace PVM;
|
||||
class Ajax{
|
||||
public static function getInfoComune($filter){
|
||||
class Ajax {
|
||||
public static function getInfoComune($filter) {
|
||||
$Ret = new \Ret;
|
||||
$InfoComuni = new \IMSApi\InfoComuni;
|
||||
if(isset($filter["cap"])){
|
||||
if (isset($filter["cap"])) {
|
||||
$Ret = $InfoComuni->get_comuneByCap($filter["cap"]);
|
||||
|
||||
} else if(isset($filter["nome"])){
|
||||
if(isset($filter["indirizzo"])){
|
||||
|
||||
} else if (isset($filter["nome"])) {
|
||||
if (isset($filter["indirizzo"])) {
|
||||
$InfoComuni->indirizzo($filter["indirizzo"]);
|
||||
}
|
||||
$Ret = $InfoComuni->get_comuneByNome($filter["nome"]);
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Parametri non validi");
|
||||
}
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_data(array_pick($Ret->get_data(), "nome", "cap", "sigla"));
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function searchComuni($filter){
|
||||
|
||||
public static function searchComuni($filter) {
|
||||
$Ret = new \Ret;
|
||||
$SearchComuni = new \IMSApi\SearchComuni;
|
||||
if(isset($filter["q"])){
|
||||
if(isset($filter["limit"])){
|
||||
if (isset($filter["q"])) {
|
||||
if (isset($filter["limit"])) {
|
||||
$SearchComuni->limit($filter["limit"]);
|
||||
}
|
||||
$Ret = $SearchComuni->q($filter["q"])->send();
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Parametri non validi");
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function check_pIva($filter){
|
||||
|
||||
public static function check_pIva($filter) {
|
||||
$CheckPIva = new \IMSApi\CheckPartitaIva;
|
||||
return $CheckPIva->countryCode($filter["nazione"])->vatNumber($filter["pIva"])->send();
|
||||
}
|
||||
|
||||
public static function check_eMail($eMail){
|
||||
|
||||
public static function check_eMail($eMail) {
|
||||
$Ret = new \Ret;
|
||||
return $Ret->set_boolean(\Utility::is_validEmail($eMail));
|
||||
}
|
||||
|
||||
public static function userTipClosed($data){
|
||||
|
||||
public static function userTipClosed($data) {
|
||||
$id = $data["id"];
|
||||
$UserTip = new \User\Tip;
|
||||
return $UserTip->close($id);
|
||||
}
|
||||
|
||||
public static function check_codFisc($cf){
|
||||
|
||||
public static function check_codFisc($cf) {
|
||||
$Ret = new \Ret;
|
||||
$isValid = true;
|
||||
|
||||
if(strlen($cf) != 16){
|
||||
|
||||
if (strlen($cf) != 16) {
|
||||
$isValid = false; // Lunghezza del codice fiscale non corretta
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$cf = strtoupper($cf);
|
||||
if(preg_match("/^[A-Za-z0-9]+\$/", $cf) != 1 ){
|
||||
if (preg_match("/^[A-Za-z0-9]+\$/", $cf) != 1) {
|
||||
$isValid = false; // contiene dei caratteri non validi
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$s = 0;
|
||||
for($i=1; $i<=13; $i+=2){
|
||||
for ($i = 1; $i <= 13; $i += 2) {
|
||||
$c = $cf[$i];
|
||||
if(strcmp($c, "0") >= 0 and strcmp($c, "9") <= 0){
|
||||
if (strcmp($c, "0") >= 0 and strcmp($c, "9") <= 0) {
|
||||
$s += ord($c) - ord("0");
|
||||
} else{
|
||||
} else {
|
||||
$s += ord($c) - ord("A");
|
||||
}
|
||||
}
|
||||
for($i=0; $i<=14; $i+=2){
|
||||
$c = $cf[$i];
|
||||
switch($c){
|
||||
case '0': case 'A': $s += 1; break;
|
||||
case '1': case 'B': $s += 0; break;
|
||||
case '2': case 'C': $s += 5; break;
|
||||
case '3': case 'D': $s += 7; break;
|
||||
case '4': case 'E': $s += 9; break;
|
||||
case '5': case 'F': $s += 13; break;
|
||||
case '6': case 'G': $s += 15; break;
|
||||
case '7': case 'H': $s += 17; break;
|
||||
case '8': case 'I': $s += 19; break;
|
||||
case '9': case 'J': $s += 21; break;
|
||||
case 'K': $s += 2; break;
|
||||
case 'L': $s += 4; break;
|
||||
case 'M': $s += 18; break;
|
||||
case 'N': $s += 20; break;
|
||||
case 'O': $s += 11; break;
|
||||
case 'P': $s += 3; break;
|
||||
case 'Q': $s += 6; break;
|
||||
case 'R': $s += 8; break;
|
||||
case 'S': $s += 12; break;
|
||||
case 'T': $s += 14; break;
|
||||
case 'U': $s += 16; break;
|
||||
case 'V': $s += 10; break;
|
||||
case 'W': $s += 22; break;
|
||||
case 'X': $s += 25; break;
|
||||
case 'Y': $s += 24; break;
|
||||
case 'Z': $s += 23; break;
|
||||
}
|
||||
}
|
||||
$isValid = chr($s%26 + ord('A')) == $cf[15];
|
||||
for ($i = 0; $i <= 14; $i += 2) {
|
||||
$c = $cf[$i];
|
||||
switch ($c) {
|
||||
case '0':
|
||||
case 'A':
|
||||
$s += 1;
|
||||
break;
|
||||
case '1':
|
||||
case 'B':
|
||||
$s += 0;
|
||||
break;
|
||||
case '2':
|
||||
case 'C':
|
||||
$s += 5;
|
||||
break;
|
||||
case '3':
|
||||
case 'D':
|
||||
$s += 7;
|
||||
break;
|
||||
case '4':
|
||||
case 'E':
|
||||
$s += 9;
|
||||
break;
|
||||
case '5':
|
||||
case 'F':
|
||||
$s += 13;
|
||||
break;
|
||||
case '6':
|
||||
case 'G':
|
||||
$s += 15;
|
||||
break;
|
||||
case '7':
|
||||
case 'H':
|
||||
$s += 17;
|
||||
break;
|
||||
case '8':
|
||||
case 'I':
|
||||
$s += 19;
|
||||
break;
|
||||
case '9':
|
||||
case 'J':
|
||||
$s += 21;
|
||||
break;
|
||||
case 'K':
|
||||
$s += 2;
|
||||
break;
|
||||
case 'L':
|
||||
$s += 4;
|
||||
break;
|
||||
case 'M':
|
||||
$s += 18;
|
||||
break;
|
||||
case 'N':
|
||||
$s += 20;
|
||||
break;
|
||||
case 'O':
|
||||
$s += 11;
|
||||
break;
|
||||
case 'P':
|
||||
$s += 3;
|
||||
break;
|
||||
case 'Q':
|
||||
$s += 6;
|
||||
break;
|
||||
case 'R':
|
||||
$s += 8;
|
||||
break;
|
||||
case 'S':
|
||||
$s += 12;
|
||||
break;
|
||||
case 'T':
|
||||
$s += 14;
|
||||
break;
|
||||
case 'U':
|
||||
$s += 16;
|
||||
break;
|
||||
case 'V':
|
||||
$s += 10;
|
||||
break;
|
||||
case 'W':
|
||||
$s += 22;
|
||||
break;
|
||||
case 'X':
|
||||
$s += 25;
|
||||
break;
|
||||
case 'Y':
|
||||
$s += 24;
|
||||
break;
|
||||
case 'Z':
|
||||
$s += 23;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$isValid = chr($s % 26 + ord('A')) == $cf[15];
|
||||
}
|
||||
}
|
||||
return $Ret->set_boolean($isValid);
|
||||
}
|
||||
|
||||
public static function stayinAlive(){
|
||||
|
||||
public static function stayinAlive() {
|
||||
@session_start();
|
||||
$Ret = new \Ret;
|
||||
return $Ret->set_string("stayin' alive, stayin' alive");
|
||||
}
|
||||
|
||||
public static function autocomplete_indirizzo($filter){
|
||||
|
||||
public static function autocomplete_indirizzo($filter) {
|
||||
return \Utility\Geo::autocomplete($filter["q"]);
|
||||
}
|
||||
|
||||
public static function getPlaceInfo($data){
|
||||
|
||||
public static function getPlaceInfo($data) {
|
||||
return \Utility\Geo::getPlaceInfo($data["placeId"]);
|
||||
}
|
||||
|
||||
public static function coordinatesToAddress($data){
|
||||
|
||||
public static function coordinatesToAddress($data) {
|
||||
$latLng = null;
|
||||
if(isset($data["latLng"])){
|
||||
if(is_string($data["latLng"])){
|
||||
if (isset($data["latLng"])) {
|
||||
if (is_string($data["latLng"])) {
|
||||
$latLng = $data["latLng"];
|
||||
} else if(is_array($data["latLng"])){
|
||||
} else if (is_array($data["latLng"])) {
|
||||
$latLng = implode(",", $data["latLng"]);
|
||||
}
|
||||
} else if(isset($data["lat"]) && isset($data["lng"])){
|
||||
$latLng = $data["lat"].",".$data["lng"];
|
||||
} else if (isset($data["lat"]) && isset($data["lng"])) {
|
||||
$latLng = $data["lat"] . "," . $data["lng"];
|
||||
}
|
||||
return \Utility\Geo::coordinatesToAddress($latLng);
|
||||
}
|
||||
|
||||
public static function appendModalNotification($data){
|
||||
|
||||
public static function appendModalNotification($data) {
|
||||
$data["type"] = "modal";
|
||||
self::appendNotification($data);
|
||||
}
|
||||
|
||||
private static function appendNotification($data){
|
||||
$type = isset($data["type"]) && $data["type"]=="modal" ? "modal" : "toast";
|
||||
if($_SESSION){
|
||||
if(!isset($_SESSION["onload-messages"])){
|
||||
|
||||
private static function appendNotification($data) {
|
||||
$type = isset($data["type"]) && $data["type"] == "modal" ? "modal" : "toast";
|
||||
if ($_SESSION) {
|
||||
if (!isset($_SESSION["onload-messages"])) {
|
||||
$_SESSION["onload-messages"] = array("toast" => array(), "modal" => array());
|
||||
}
|
||||
$_SESSION["onload-messages"][$type][] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
public static function appendToastNotification($data){
|
||||
|
||||
public static function appendToastNotification($data) {
|
||||
$data["type"] = "toast";
|
||||
self::appendNotification($data);
|
||||
}
|
||||
|
||||
public static function get_moduleTemplates($data){
|
||||
|
||||
public static function get_moduleTemplates($data) {
|
||||
$moduleName = $data["module_name"];
|
||||
$moduleNameCc = ucfirst(\Utility\Str::camelCaseEncode($moduleName));
|
||||
include \Controller::module_gestpath_classes($moduleName, "{$moduleNameCc}.class.php");
|
||||
$templateId = isset($data["template_id"]) ? $data["template_id"] : null;
|
||||
$retData = array();
|
||||
$gestPathHtml = \Controller::module_gestpath_resource($moduleName, "html");
|
||||
if(file_exists($gestPathHtml)){
|
||||
$arr_files = glob($gestPathHtml."*.{html,htm,php}", GLOB_BRACE);
|
||||
foreach($arr_files as $file){
|
||||
if (file_exists($gestPathHtml)) {
|
||||
$arr_files = glob($gestPathHtml . "*.{html,htm,php,ejs}", GLOB_BRACE);
|
||||
foreach ($arr_files as $file) {
|
||||
$id = pathinfo($file, PATHINFO_FILENAME);
|
||||
if(is_null($templateId) || $templateId==$id){
|
||||
if (is_null($templateId) || $templateId == $id) {
|
||||
$ext = pathinfo($file, PATHINFO_EXTENSION);
|
||||
if(in_array($ext, array("html", "htm"))){
|
||||
if (in_array($ext, array("html", "htm", "ejs"))) {
|
||||
$html = file_get_contents($file);
|
||||
} else{ // .php
|
||||
} else { // .php
|
||||
ob_start();
|
||||
include $file;
|
||||
$html = ob_get_contents();
|
||||
@@ -188,99 +251,99 @@ class Ajax{
|
||||
$Ret = new \Ret;
|
||||
return $Ret->set_data($retData);
|
||||
}
|
||||
|
||||
public static function get_moduleTemplate($data){
|
||||
|
||||
public static function get_moduleTemplate($data) {
|
||||
return self::get_moduleTemplates($data);
|
||||
}
|
||||
|
||||
public static function get_moduleDatasource($data){
|
||||
|
||||
public static function get_moduleDatasource($data) {
|
||||
$Ret = new \Ret;
|
||||
$idModulo = $data["module_name"];
|
||||
$idModuloCC = ucfirst(\Utility\Str::camelCaseEncode($idModulo));
|
||||
$methodName = "_moduleDatasource";
|
||||
include \Controller::module_gestpath_classes($idModulo, "{$idModuloCC}.class.php");
|
||||
if(class_exists($idModuloCC)){
|
||||
if(isset($data["profileDB"])){
|
||||
if (class_exists($idModuloCC)) {
|
||||
if (isset($data["profileDB"])) {
|
||||
$GLOBALS["profileDB"] = $data["profileDB"];
|
||||
}
|
||||
if(method_exists("\\{$idModuloCC}", $methodName)){
|
||||
if (method_exists("\\{$idModuloCC}", $methodName)) {
|
||||
$filter = isset($data["filter"]) ? $data["filter"] : array();
|
||||
$Ret = call_user_func_array("\\{$idModuloCC}::{$methodName}", array($filter));
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_string("Method {$idModuloCC}::{$methodName} not exists");
|
||||
}
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function get_forecast($data){
|
||||
|
||||
public static function get_forecast($data) {
|
||||
$dayFrom = \Utility\Date::startOfDay($data["day_from"]);
|
||||
$dayTo = isset($data["day_to"]) ? \Utility\Date::startOfDay($data["day_to"]) : $dayFrom;
|
||||
$Wheater = new \Utility\Weather;
|
||||
return $Wheater->setLatLng($data["latLng"])->setDayFrom($dayFrom)->setDayTo($dayTo)->forceRefresh(true)->loadForecastDaysInterval();
|
||||
}
|
||||
|
||||
public static function urlToImage($data){
|
||||
|
||||
public static function urlToImage($data) {
|
||||
$url = $data["url"];
|
||||
$Ret = self::loadUrl($url);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$content = $Ret->get_byte();
|
||||
$Ret->set_byte(null);
|
||||
$mimeType = \Utility\File::getMimeTypeFromBlob($content);
|
||||
$fileName = pathinfo($url, PATHINFO_BASENAME);
|
||||
|
||||
if(\Utility\File::isImageFromMimeType($mimeType)){
|
||||
|
||||
|
||||
if (\Utility\File::isImageFromMimeType($mimeType)) {
|
||||
|
||||
$Image = new \Utility\Image;
|
||||
if($Image->importFromBlob($content)){
|
||||
|
||||
if($Image->resize(1600, 1200, true, true, true)){
|
||||
|
||||
if ($Image->importFromBlob($content)) {
|
||||
|
||||
if ($Image->resize(1600, 1200, true, true, true)) {
|
||||
|
||||
$retData = array(
|
||||
"fileName" => $fileName,
|
||||
"fileCachePath" => $Image->get_fileCachedPath(),
|
||||
"mimeType" => $mimeType,
|
||||
"isImage" => \Utility\File::isImageFromMimeType($mimeType)
|
||||
);
|
||||
|
||||
|
||||
$Ret->set_data($retData)->set_byte(null);
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Errore importazione immagine");
|
||||
}
|
||||
|
||||
|
||||
unset($Image);
|
||||
|
||||
} else if($mimeType==\Mime::HTML){
|
||||
|
||||
} else if ($mimeType == \Mime::HTML) {
|
||||
$doc = \phpQuery::newDocumentHTML($content);
|
||||
|
||||
|
||||
$ogImageUrl = nullIfBlank($doc["meta[property='og:image']"]->attr("content"));
|
||||
|
||||
if(is_null($ogImageUrl)){ // PROVA AMAZON
|
||||
|
||||
if (is_null($ogImageUrl)) { // PROVA AMAZON
|
||||
$ogImageUrl = nullIfBlank(pq($doc["#landingImage"])->attr("src"));
|
||||
}
|
||||
|
||||
if(!is_null($ogImageUrl)){
|
||||
|
||||
if (!is_null($ogImageUrl)) {
|
||||
$Ret = self::urlToImage(array("url" => $ogImageUrl));
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_warning("Il link immesso non contiene alcuna immagine");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function urlToBase64($data){
|
||||
|
||||
public static function urlToBase64($data) {
|
||||
$url = $data["url"];
|
||||
$Ret = self::loadUrl($url);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$content = $Ret->get_byte();
|
||||
$mimeType = \Utility\File::getMimeTypeFromBlob($content);
|
||||
$fileName = pathinfo($url, PATHINFO_BASENAME);
|
||||
|
||||
|
||||
$retData = array(
|
||||
"fileName" => $fileName,
|
||||
"fileBase64" => base64_encode($content),
|
||||
@@ -289,14 +352,14 @@ class Ajax{
|
||||
);
|
||||
$Ret->set_data($retData)->set_byte(null);
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function urlToFile($data){
|
||||
|
||||
public static function urlToFile($data) {
|
||||
$url = $data["url"];
|
||||
$Ret = self::loadUrl($url);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$content = $Ret->get_byte();
|
||||
$mimeType = \Utility\File::getMimeTypeFromBlob($content);
|
||||
$fileName = pathinfo($url, PATHINFO_BASENAME);
|
||||
@@ -307,49 +370,49 @@ class Ajax{
|
||||
"mimeType" => $mimeType,
|
||||
"isImage" => \Utility\File::isImageFromMimeType($mimeType)
|
||||
);
|
||||
|
||||
|
||||
$Ret->set_data($retData)->set_byte(null);
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private static function get_httpResponseCode($url){//return "200";
|
||||
|
||||
private static function get_httpResponseCode($url) {//return "200";
|
||||
$headers = @get_headers($url);
|
||||
return $headers!==false ? substr($headers[0], 9, 3) : false;
|
||||
return $headers !== false ? substr($headers[0], 9, 3) : false;
|
||||
}
|
||||
|
||||
private static function getSslPage($url){ // non con php 5.3
|
||||
|
||||
private static function getSslPage($url) { // non con php 5.3
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
// Edit: prior variable $postFields should be $postfields;
|
||||
// curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
|
||||
// curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // On dev server only!
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $result;
|
||||
/*
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_REFERER, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
$result = curl_exec($ch);var_dump($result);
|
||||
curl_close($ch);
|
||||
return $result;*/
|
||||
}
|
||||
|
||||
private static function loadUrl($url){
|
||||
/*
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_REFERER, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
$result = curl_exec($ch);var_dump($result);
|
||||
curl_close($ch);
|
||||
return $result;*/
|
||||
}
|
||||
|
||||
private static function loadUrl($url) {
|
||||
$Ret = self::validateUrlSintax($url);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$responseCode = self::get_httpResponseCode($url);
|
||||
if($responseCode!==false && $responseCode=="200"){
|
||||
$arrContextOptions=array(/*
|
||||
if ($responseCode !== false && $responseCode == "200") {
|
||||
$arrContextOptions = array(/*
|
||||
"http" => array(
|
||||
"method" => "POST",
|
||||
"header" =>
|
||||
@@ -359,10 +422,10 @@ class Ajax{
|
||||
"timeout" => (float)30.0,
|
||||
"content" => $strRequestXML,
|
||||
),*/
|
||||
"ssl"=>array(
|
||||
"allow_self_signed"=>true,
|
||||
"verify_peer"=>false,
|
||||
"verify_peer_name"=>false,
|
||||
"ssl" => array(
|
||||
"allow_self_signed" => true,
|
||||
"verify_peer" => false,
|
||||
"verify_peer_name" => false,
|
||||
),
|
||||
);
|
||||
/*
|
||||
@@ -372,26 +435,26 @@ class Ajax{
|
||||
"verify_peer_name"=>false,
|
||||
),
|
||||
); */
|
||||
|
||||
// $content = self::getSslPage($url);
|
||||
|
||||
// $content = self::getSslPage($url);
|
||||
$content = @file_get_contents($url);
|
||||
// $content = file_get_contents($url, false, stream_context_create($arrContextOptions));
|
||||
if($content!==false){
|
||||
// $content = file_get_contents($url, false, stream_context_create($arrContextOptions));
|
||||
if ($content !== false) {
|
||||
$Ret->set_byte($content);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Contenuto risorsa non valido");
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Risorsa non disponibile o non valida")->set_number($responseCode)->set_string($url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private static function validateUrlSintax($url){
|
||||
|
||||
private static function validateUrlSintax($url) {
|
||||
$Ret = new \Ret;
|
||||
if(is_null($url) || !filter_var($url, FILTER_VALIDATE_URL)){
|
||||
if (is_null($url) || !filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
$Ret->set_error("URL non valido");
|
||||
}
|
||||
return $Ret;
|
||||
|
||||
@@ -1,41 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace PVM;
|
||||
|
||||
use PVM\ModuloUtils;
|
||||
use Modulo;
|
||||
class CurrentModule{
|
||||
|
||||
public static function isAuthorizedToCurrentUser(){
|
||||
|
||||
class CurrentModule {
|
||||
|
||||
public static function isAuthorizedToCurrentUser() {
|
||||
$Modulo = self::getModulo();
|
||||
if(!is_null($Modulo)){
|
||||
if (!is_null($Modulo)) {
|
||||
return $Modulo->isAuthorizedToCurrentUser();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
public static function is_userAuthorized(){
|
||||
return !is_null(self::get_info()) || in_array(\Controller::current_module(), array("login", "index"));
|
||||
}*/
|
||||
|
||||
public static function getModulo(){
|
||||
|
||||
public static function getModulo() {
|
||||
$id = ModuloUtils::searchIdByCurrentPageUrl();
|
||||
return !is_null($id) ? new Modulo($id) : null;
|
||||
}
|
||||
|
||||
public static function isLoad(){
|
||||
|
||||
public static function isLoad() {
|
||||
return !is_null(self::getModulo());
|
||||
}
|
||||
|
||||
public static function getGroup(){
|
||||
|
||||
public static function getGroup() {
|
||||
$Modulo = self::getModulo();
|
||||
return !is_null($Modulo) ? $Modulo->getGroup() : null;
|
||||
}
|
||||
|
||||
public static function getId(){
|
||||
|
||||
public static function getId() {
|
||||
$Modulo = self::getModulo();
|
||||
return !is_null($Modulo) ? $Modulo->getId() : null;
|
||||
}
|
||||
|
||||
public static function getTitle(){
|
||||
|
||||
public static function getTitle() {
|
||||
$Modulo = self::getModulo();
|
||||
return !is_null($Modulo) ? $Modulo->getTitle() : null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace PVM;
|
||||
class Mailer{
|
||||
class Mailer {
|
||||
private $_from = null;
|
||||
private $_fromName = null;
|
||||
private $_to = array();
|
||||
@@ -15,18 +16,18 @@ class Mailer{
|
||||
private $_replyToName = null;
|
||||
private $_sendDev = false;
|
||||
private $_useTemplate = true;
|
||||
|
||||
|
||||
private $_disableSafeDebugging = false;
|
||||
private $_mailDefaultSafeDebugging = null;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->_subject = "Comunicazione dal Portale WEB";
|
||||
$this->_mailDefaultSafeDebugging = "v.castellana@integry.it";
|
||||
$this->_mailDefaultSafeDebugging = "developer@integry.it";
|
||||
}
|
||||
|
||||
|
||||
// <editor-fold desc="SETTERS MITT e DEST" defaultstate="collapsed">
|
||||
|
||||
public static function parseRecipients($arg1, $name = null){
|
||||
|
||||
public static function parseRecipients($arg1, $name = null) {
|
||||
$results = array();
|
||||
|
||||
if (is_array($arg1)) { // array
|
||||
@@ -49,116 +50,116 @@ class Mailer{
|
||||
$results[] = array($arg1, $name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function addTo($arg1, $name = null){
|
||||
|
||||
public function addTo($arg1, $name = null) {
|
||||
$this->_to = array_merge($this->_to, self::parseRecipients($arg1, $name));
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getListTo(){
|
||||
|
||||
public function getListTo() {
|
||||
$Ret = self::implodeEmailList($this->_to);
|
||||
return $Ret->is_OK() ? $Ret->get_string() : null;
|
||||
}
|
||||
|
||||
public function addCc($arg1, $name = null){
|
||||
|
||||
public function addCc($arg1, $name = null) {
|
||||
$this->_cc = array_merge($this->_cc, self::parseRecipients($arg1, $name));
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getListCc(){
|
||||
|
||||
public function getListCc() {
|
||||
$Ret = self::implodeEmailList($this->_cc);
|
||||
return $Ret->is_OK() ? $Ret->get_string() : null;
|
||||
}
|
||||
|
||||
public function addCcn($arg1, $name = null){
|
||||
|
||||
public function addCcn($arg1, $name = null) {
|
||||
$this->_ccn = array_merge($this->_ccn, self::parseRecipients($arg1, $name));
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getListCcn(){
|
||||
|
||||
public function getListCcn() {
|
||||
$Ret = self::implodeEmailList($this->_ccn);
|
||||
return $Ret->is_OK() ? $Ret->get_string() : null;
|
||||
}
|
||||
|
||||
public function replyTo($eMail, $name = null){
|
||||
if(\Utility::is_validEmail($eMail)){
|
||||
|
||||
public function replyTo($eMail, $name = null) {
|
||||
if (\Utility::is_validEmail($eMail)) {
|
||||
$this->_replyTo = $eMail;
|
||||
$this->_replyToName = $name;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function from($eMail, $name = null){
|
||||
if(\Utility::is_validEmail($eMail)){
|
||||
|
||||
public function from($eMail, $name = null) {
|
||||
if (\Utility::is_validEmail($eMail)) {
|
||||
$this->_from = $eMail;
|
||||
if(!is_null($name)){
|
||||
$this->_fromName = $name;
|
||||
if (!is_null($name)) {
|
||||
$this->_fromName = $name;
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function fromName($name){
|
||||
|
||||
public function fromName($name) {
|
||||
$this->_fromName = $name;
|
||||
return $this;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
|
||||
// <editor-fold desc="ALLEGATO" defaultstate="collapsed">
|
||||
public function addAttachment($filePath, $content = null){
|
||||
public function addAttachment($filePath, $content = null) {
|
||||
$name = pathinfo($filePath, PATHINFO_BASENAME);
|
||||
if(is_null($content) && file_exists($filePath)){
|
||||
if (is_null($content) && file_exists($filePath)) {
|
||||
$content = file_get_contents($filePath);
|
||||
}
|
||||
if(!is_null($content)){
|
||||
if (!is_null($content)) {
|
||||
$this->_attachments[] = array("name" => $name, "content" => $content);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
|
||||
// <editor-fold desc="ALTRI SETTERS" defaultstate="collapsed">
|
||||
public function host($value){
|
||||
public function host($value) {
|
||||
$this->_host = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function azienda($value = null){
|
||||
|
||||
public function azienda($value = null) {
|
||||
$this->_azienda = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function subject($value){
|
||||
|
||||
public function subject($value) {
|
||||
$this->_subject = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function safeDebugging($value){
|
||||
if(is_bool($value)){
|
||||
|
||||
public function safeDebugging($value) {
|
||||
if (is_bool($value)) {
|
||||
$this->_disableSafeDebugging = !$value;
|
||||
} else if(\Utility::is_validEmail($value)){
|
||||
} else if (\Utility::is_validEmail($value)) {
|
||||
$this->_mailDefaultSafeDebugging = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
|
||||
// <editor-fold desc="SETTERS BODY MESSAGGIO" defaultstate="collapsed">
|
||||
public function message($value){
|
||||
public function message($value) {
|
||||
return $this->body($value);
|
||||
}
|
||||
|
||||
public function body($value){
|
||||
|
||||
public function body($value) {
|
||||
$this->_textMessage = blankIfNull($value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function getMessage(){
|
||||
if(!is_null($this->_textMessage)){
|
||||
if($this->_useTemplate){
|
||||
|
||||
private function getMessage() {
|
||||
if (!is_null($this->_textMessage)) {
|
||||
if ($this->_useTemplate) {
|
||||
ob_start();
|
||||
$azienda = $this->_azienda; // SERVE IN TEMPLATE.PHP
|
||||
$GLOBALS["profileDB"] = $azienda;
|
||||
@@ -170,7 +171,7 @@ class Mailer{
|
||||
$doc = \phpQuery::newDocumentHTML($template);
|
||||
$doc["#mailbody"]->html($this->_textMessage);
|
||||
return \Utility\Str::remove_multiple_spaces($doc->htmlOuter());
|
||||
|
||||
|
||||
} else {
|
||||
return \Utility\Str::remove_multiple_spaces($this->_textMessage);
|
||||
}
|
||||
@@ -178,32 +179,33 @@ class Mailer{
|
||||
return null;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
|
||||
// <editor-fold desc="VALIDAZIONE E PREPARAZIONE INDIRIZZI EMAIL" defaultstate="collapsed">
|
||||
private static function implodeEmailList($emailList){
|
||||
private static function implodeEmailList($emailList) {
|
||||
$Ret = new \Ret;
|
||||
$emails = "";
|
||||
foreach($emailList as $emailItem){
|
||||
foreach ($emailList as $emailItem) {
|
||||
$emailItem[0] = trim($emailItem[0]);
|
||||
if(\Utility::is_validEmail($emailItem[0])){
|
||||
if(is_null($emailItem[1])){
|
||||
$emails .= $emailItem[0].";";
|
||||
} else{
|
||||
$emails .= $emailItem[1]." <".$emailItem[0].">;";
|
||||
if (\Utility::is_validEmail($emailItem[0])) {
|
||||
if (is_null($emailItem[1])) {
|
||||
$emails .= $emailItem[0] . ";";
|
||||
} else {
|
||||
$emails .= $emailItem[1] . " <" . $emailItem[0] . ">;";
|
||||
}
|
||||
} else{
|
||||
return $Ret->set_error("Indirizzo email non valido: ".$emailItem[0]);
|
||||
} else {
|
||||
return $Ret->set_error("Indirizzo email non valido: " . $emailItem[0]);
|
||||
}
|
||||
}
|
||||
return $Ret->set_string(rtrim($emails, ";"));
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
public function send(){
|
||||
if(!$this->_disableSafeDebugging){
|
||||
|
||||
public function send() {
|
||||
if (!$this->_disableSafeDebugging) {
|
||||
$this->runSafeDebugging();
|
||||
}
|
||||
|
||||
|
||||
$body = array(
|
||||
"from" => $this->_from,
|
||||
"fromName" => !is_null($this->_fromName) ? $this->_fromName : \Azienda::getNomeAzienda(),
|
||||
@@ -212,98 +214,106 @@ class Mailer{
|
||||
"isHtml" => true,
|
||||
"attachments" => array()
|
||||
);
|
||||
|
||||
|
||||
$Ret = self::implodeEmailList($this->_to);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$body["to"] = $Ret->get_string();
|
||||
} else{
|
||||
} else {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
$Ret = self::implodeEmailList($this->_ccn);
|
||||
if($Ret->is_OK()){
|
||||
$s = $Ret->get_string();
|
||||
if(strlen($s)>0){
|
||||
$body["ccn"] = $s;
|
||||
}
|
||||
} else{
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
$Ret = self::implodeEmailList($this->_cc);
|
||||
if($Ret->is_OK()){
|
||||
$s = $Ret->get_string();
|
||||
if(strlen($s)>0){
|
||||
$body["cc"] = $s;
|
||||
}
|
||||
} else{
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
if(!is_null($this->_replyTo)){
|
||||
$body["replyTo"] = $this->_replyTo;
|
||||
}
|
||||
|
||||
if(isset($body["to"]) && strlen($body["to"])>0){
|
||||
foreach($this->_attachments as $attachmentItem){
|
||||
$Ret = self::implodeEmailList($this->_ccn);
|
||||
if ($Ret->is_OK()) {
|
||||
$s = $Ret->get_string();
|
||||
if (strlen($s) > 0) {
|
||||
$body["ccn"] = $s;
|
||||
}
|
||||
} else {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
$Ret = self::implodeEmailList($this->_cc);
|
||||
if ($Ret->is_OK()) {
|
||||
$s = $Ret->get_string();
|
||||
if (strlen($s) > 0) {
|
||||
$body["cc"] = $s;
|
||||
}
|
||||
} else {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
if (!is_null($this->_replyTo)) {
|
||||
$body["replyTo"] = $this->_replyTo;
|
||||
}
|
||||
|
||||
if (isset($body["to"]) && strlen($body["to"]) > 0) {
|
||||
foreach ($this->_attachments as $attachmentItem) {
|
||||
$body["attachments"][] = array("fileName" => $attachmentItem["name"], "fileb64Content" => base64_encode($attachmentItem["content"]));
|
||||
}
|
||||
|
||||
|
||||
$IMSApi = new \IMSApi;
|
||||
if(!\User::is_authenticated()){
|
||||
if (!\User::is_authenticated()) {
|
||||
$IMSApi->anonymousAuth();
|
||||
//$IMSApi->authUsername($GLOBALS["profileDB"])->authPassword($GLOBALS["profileDB"]);
|
||||
}
|
||||
if (!\PVM::isDevClient() || $this->_sendDev){
|
||||
if (!\PVM::isDevClient() || $this->_sendDev) {
|
||||
$Ret = $IMSApi->post("sendEmail")->body($body)->send();
|
||||
}else{
|
||||
} else {
|
||||
$fileContent = sprintf(
|
||||
"<pre>%s</pre>",
|
||||
print_r($body, true)
|
||||
);
|
||||
|
||||
\Cache::writeR("mail.html", $fileContent, "mailsSent");
|
||||
|
||||
$Ret = new \Ret();
|
||||
$Ret->set_OK();
|
||||
}
|
||||
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Lista email destinatari vuota");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private function runSafeDebugging(){
|
||||
if(\PVM::isDevMode()){
|
||||
|
||||
private function runSafeDebugging() {
|
||||
if (\PVM::isDevMode()) {
|
||||
|
||||
$defaultEmail = $this->_mailDefaultSafeDebugging;
|
||||
$arr_debugEmailWL = array("@integry.it");
|
||||
|
||||
$safetize = function($arr_emails) use($arr_debugEmailWL, $defaultEmail){
|
||||
foreach($arr_emails as &$d){
|
||||
$safetize = function ($arr_emails) use ($arr_debugEmailWL, $defaultEmail) {
|
||||
foreach ($arr_emails as &$d) {
|
||||
$flag_replace = true;
|
||||
$email = $d[0];
|
||||
if(count($arr_debugEmailWL)>0){
|
||||
foreach($arr_debugEmailWL as $debugEmailWL){
|
||||
if(\Utility\Str::ciEquals($email, $debugEmailWL) || \Utility\Str::endsWith($email, $debugEmailWL, false)){
|
||||
if (count($arr_debugEmailWL) > 0) {
|
||||
foreach ($arr_debugEmailWL as $debugEmailWL) {
|
||||
if (\Utility\Str::ciEquals($email, $debugEmailWL) || \Utility\Str::endsWith($email, $debugEmailWL, false)) {
|
||||
$flag_replace = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($flag_replace){
|
||||
if ($flag_replace) {
|
||||
$d[0] = $defaultEmail;
|
||||
}
|
||||
}
|
||||
return $arr_emails;
|
||||
};
|
||||
|
||||
|
||||
$this->_to = $safetize($this->_to);
|
||||
$this->_cc = $safetize($this->_cc);
|
||||
$this->_ccn = $safetize($this->_ccn);
|
||||
}
|
||||
}
|
||||
|
||||
public function ignoreTemplate(){
|
||||
|
||||
public function ignoreTemplate() {
|
||||
$this->_useTemplate = false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function sendDev($sendDev = true){
|
||||
public function sendDev($sendDev = true) {
|
||||
$this->_sendDev = $sendDev;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -1,27 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace PVM;
|
||||
|
||||
use User;
|
||||
class ModuloUtils{
|
||||
|
||||
public static function searchIdByCurrentPageUrl(){
|
||||
|
||||
class ModuloUtils {
|
||||
|
||||
public static function searchIdByCurrentPageUrl() {
|
||||
$currentPage = basename($_SERVER["PHP_SELF"]);
|
||||
$queryString = $_SERVER["QUERY_STRING"];
|
||||
$id = null;
|
||||
$f_priority = false;
|
||||
|
||||
|
||||
$userModulesTree = \PVM::get_userModulesTree();
|
||||
foreach($userModulesTree as $menuGroup){
|
||||
foreach($menuGroup as $menuOpt){
|
||||
if(isset($menuOpt["pages"])){ // è false se non aut.
|
||||
foreach ($userModulesTree as $menuGroup) {
|
||||
foreach ($menuGroup as $menuOpt) {
|
||||
if (isset($menuOpt["pages"])) { // è false se non aut.
|
||||
$page = $menuOpt["pages"];
|
||||
$pageDet = $menuOpt["page-det"];
|
||||
if($currentPage==$page){
|
||||
if(is_null($pageDet) || \Utility\Str::contains($queryString, $pageDet)){
|
||||
if(!$f_priority){
|
||||
if ($currentPage == $page) {
|
||||
if (is_null($pageDet) || \Utility\Str::contains($queryString, $pageDet)) {
|
||||
if (!$f_priority) {
|
||||
$parts = explode("-", $menuOpt["id"]); // es. "catalogo-ordini" : "catalogo"
|
||||
$id = $parts[0];
|
||||
}
|
||||
if(\Utility\Str::contains($queryString, $pageDet)){
|
||||
if (\Utility\Str::contains($queryString, $pageDet)) {
|
||||
$id = $menuOpt["id"];
|
||||
$f_priority = true;
|
||||
}
|
||||
@@ -30,35 +33,35 @@ class ModuloUtils{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $id;
|
||||
}
|
||||
|
||||
public static function getIdAttivi(){
|
||||
|
||||
public static function getIdAttivi() {
|
||||
$currentIdModulo = \Controller::current_module();
|
||||
|
||||
|
||||
$idsModuli = array($currentIdModulo);
|
||||
if($currentIdModulo!=="login"){
|
||||
if ($currentIdModulo !== "login") {
|
||||
$idsModuli = array_merge($idsModuli, self::getIdModuliBase());
|
||||
}
|
||||
|
||||
|
||||
$Modulo = new \Modulo($currentIdModulo);
|
||||
if($Modulo->isLoaded()){
|
||||
if ($Modulo->isLoaded()) {
|
||||
$idsModuli = array_merge($idsModuli, $Modulo->getChildren());
|
||||
|
||||
if (in_array("gettext", $Modulo->getLibs())) {
|
||||
$idsModuli[] = "i18n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return array_unique($idsModuli);
|
||||
}
|
||||
|
||||
public static function getIdModuliBase(){
|
||||
|
||||
public static function getIdModuliBase() {
|
||||
return array(/*"messenger",*/ "allegati", "notifiche");
|
||||
}
|
||||
|
||||
public static function getModuliStandard(){
|
||||
|
||||
public static function getModuliStandard() {
|
||||
return array(
|
||||
array("name" => "impostazioni", "group" => "Sistema", "usergroups" => array(\User::AMMINISTRATORE_SISTEMA, \User::RESPONSABILE_EDP)),
|
||||
array("name" => "phpinfo", "group" => "Sistema", "usergroups" => array(\User::AMMINISTRATORE_SISTEMA, \User::RESPONSABILE_EDP)),
|
||||
@@ -66,8 +69,9 @@ class ModuloUtils{
|
||||
// array("name" => "gestione_notifiche", "group" => "Utilità", "usergroups" => array(\User::AMMINISTRATORE_SISTEMA)),
|
||||
array("name" => "logs", "group" => "Utilità", "usergroups" => array(\User::AMMINISTRATORE_SISTEMA, User::RESPONSABILE_EDP)),
|
||||
array("name" => "report_area", "group" => "Utilità"),
|
||||
array("name" => "associazione_report", "group" => "Utilità", "usergroups" => array(\User::AMMINISTRATORE_SISTEMA, User::RESPONSABILE_EDP)),
|
||||
array("name" => "weather", "group" => "NULL"),
|
||||
array("name" => "user_settings", "group" => "NULL", "usergroups" => array("!".\User::OSPITE)),
|
||||
array("name" => "user_settings", "group" => "NULL", "usergroups" => array("!" . \User::OSPITE)),
|
||||
array("name" => "index", "group" => "NULL"),
|
||||
array("name" => "login", "group" => "NULL"),
|
||||
array("name" => "emailcheck", "group" => "NULL"),
|
||||
@@ -75,8 +79,8 @@ class ModuloUtils{
|
||||
array("name" => "blank", "group" => "Utilità", "group" => "NULL")
|
||||
);
|
||||
}
|
||||
|
||||
public static function getIdModuliStandard(){
|
||||
|
||||
public static function getIdModuliStandard() {
|
||||
return array_column(self::getModuliStandard(), "name");
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace PVM;
|
||||
class Tips{
|
||||
class Tips {
|
||||
private $arr_alerts = array();
|
||||
|
||||
public function append($Tip){
|
||||
|
||||
public function append($Tip) {
|
||||
$this->arr_alerts[] = $Tip;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_alerts(){
|
||||
|
||||
public function get_alerts() {
|
||||
return $this->arr_alerts;
|
||||
}
|
||||
|
||||
public static function Tip(){
|
||||
|
||||
public static function Tip() {
|
||||
$Alert = new \BC\Alert;
|
||||
return $Alert->closeBtn();
|
||||
}
|
||||
|
||||
@@ -1,176 +1,180 @@
|
||||
<?php
|
||||
class PVM{
|
||||
|
||||
class PVM {
|
||||
const RECAPTCHA_KEY = "6Lc5jYEUAAAAADrmRdJMxphOkSNLTHknFX1Wzgms";
|
||||
const RECAPTCHA_SECRET = "6Lc5jYEUAAAAAOwV7vb1zUn-g780xg2ePR-V4GMR";
|
||||
|
||||
public static function is_integryClient(){
|
||||
|
||||
public static function is_integryClient() {
|
||||
$arr_publicIpIntegry = array("79.11.173.216", "79.8.93.221", "195.81.66.239", "151.58.240.141", "79.10.170.29");
|
||||
return in_array(self::get_clientIp(), $arr_publicIpIntegry);
|
||||
}
|
||||
|
||||
public static function get_clientIp(){
|
||||
|
||||
public static function get_clientIp() {
|
||||
return $_SERVER["REMOTE_ADDR"];
|
||||
}
|
||||
|
||||
public static function isDebugEnv(){
|
||||
return self::getAziendaHost()==="studioml";
|
||||
|
||||
public static function isDebugEnv() {
|
||||
return self::getAziendaHost() === "studioml";
|
||||
}
|
||||
|
||||
public static function isDevMode(){
|
||||
|
||||
public static function isDevMode() {
|
||||
return self::is_integryClient() || self::isDebugEnv();
|
||||
}
|
||||
|
||||
public static function get_hostPublicIp(){
|
||||
|
||||
public static function get_hostPublicIp() {
|
||||
$ipCached = self::get_hostPublicIp_cached();
|
||||
if(is_null($ipCached)){
|
||||
if (is_null($ipCached)) {
|
||||
$url = "https://api.ipify.org/?format=json";
|
||||
$req = \Httpful\Request::get($url);
|
||||
$result = $req->send();
|
||||
if($result->code==200){
|
||||
if ($result->code == 200) {
|
||||
$retData = json_decode($result->raw_body, true);
|
||||
self::set_hostPublicIp_cached($retData["ip"]);
|
||||
return $retData["ip"];
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
return $ipCached;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static function get_hostPublicIp_cached(){
|
||||
|
||||
private static function get_hostPublicIp_cached() {
|
||||
$filePath = Cache::get_filepath("ip.txt", null, true);
|
||||
$value = file_exists($filePath) ? file_get_contents($filePath) : null;
|
||||
return (!is_null($value) && filter_var($value, FILTER_VALIDATE_IP)) ? $value : null;
|
||||
}
|
||||
|
||||
private static function set_hostPublicIp_cached($ip){
|
||||
|
||||
private static function set_hostPublicIp_cached($ip) {
|
||||
return Cache::write("ip.txt", $ip, null, true);
|
||||
}
|
||||
|
||||
public static function get_lastAppUpdateTime(){
|
||||
|
||||
public static function get_lastAppUpdateTime() {
|
||||
$lastAppUpdateTime = 0;
|
||||
$arr_rootFiles = glob(Controller::$abs_root_project.DIRECTORY_SEPARATOR."*.*");
|
||||
foreach($arr_rootFiles as $file){
|
||||
if(filemtime($file)>$lastAppUpdateTime){
|
||||
$arr_rootFiles = glob(Controller::$abs_root_project . DIRECTORY_SEPARATOR . "*.*");
|
||||
foreach ($arr_rootFiles as $file) {
|
||||
if (filemtime($file) > $lastAppUpdateTime) {
|
||||
$lastAppUpdateTime = filemtime($file);
|
||||
}
|
||||
}
|
||||
return $lastAppUpdateTime;
|
||||
}
|
||||
|
||||
public static function getAziendaHost(){
|
||||
|
||||
public static function getAziendaHost() {
|
||||
$nomeAzienda = self::rootFileExists("nome_azienda.txt");
|
||||
if($nomeAzienda!==false){
|
||||
if ($nomeAzienda !== false) {
|
||||
$azienda = nullIfBlank(file_get_contents($nomeAzienda));
|
||||
return is_null($azienda) ? "studioml" : strtolower($azienda);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function isDevClient(){
|
||||
return self::rootFileExists("Gruntfile.js")!==false;
|
||||
|
||||
public static function isDevClient() {
|
||||
return self::rootFileExists("Gruntfile.js") !== false;
|
||||
}
|
||||
|
||||
private static function rootFileExists($filename, $upTo = 5){
|
||||
|
||||
private static function rootFileExists($filename, $upTo = 5) {
|
||||
// VERIFICA L'ESISTENZA DEL FILE SALENDO FINO A $upTo LIVELLI
|
||||
for($i=1; $i<=$upTo; $i++){
|
||||
if(file_exists($filename)){
|
||||
for ($i = 1; $i <= $upTo; $i++) {
|
||||
if (file_exists($filename)) {
|
||||
return $filename;
|
||||
}
|
||||
$filename = "../".$filename;
|
||||
$filename = "../" . $filename;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function get_projectName(){
|
||||
|
||||
public static function get_projectName() {
|
||||
$parts = explode("/", trim($_SERVER["REQUEST_URI"], "/"));
|
||||
return $parts[0];
|
||||
}
|
||||
|
||||
public static function get_rootPath(){
|
||||
$root = substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"], "/"));
|
||||
public static function get_rootPath() {
|
||||
$root = substr($_SERVER["PHP_SELF"], 0, strrpos($_SERVER["PHP_SELF"], "/"));
|
||||
return $root;
|
||||
}
|
||||
|
||||
public static function get_protocol(){
|
||||
return isset($_SERVER["HTTPS"])?"https":"http";
|
||||
|
||||
public static function get_protocol() {
|
||||
return isset($_SERVER["HTTPS"]) ? "https" : "http";
|
||||
}
|
||||
|
||||
public static function get_current_projectPublicUrl(){
|
||||
|
||||
public static function get_current_projectPublicUrl() {
|
||||
$publicUrl = Config::get_publicUrl();
|
||||
if(!is_null($publicUrl)){
|
||||
if (!is_null($publicUrl)) {
|
||||
return $publicUrl;
|
||||
} else{
|
||||
} else {
|
||||
$projectName = self::get_projectName();
|
||||
$protocol = self::get_protocol();
|
||||
return $protocol."://"."{$_SERVER["HTTP_HOST"]}/{$projectName}/";
|
||||
return $protocol . "://" . "{$_SERVER["HTTP_HOST"]}/{$projectName}/";
|
||||
}
|
||||
}
|
||||
|
||||
public static function getCurrentUrl(){
|
||||
public static function getCurrentUrl() {
|
||||
$projectName = self::get_rootPath();
|
||||
$protocol = self::get_protocol();
|
||||
return $protocol."://"."{$_SERVER["HTTP_HOST"]}{$projectName}/";
|
||||
return $protocol . "://" . "{$_SERVER["HTTP_HOST"]}{$projectName}/";
|
||||
}
|
||||
|
||||
public static function get_userModulesTree(){
|
||||
|
||||
public static function get_userModulesTree() {
|
||||
$retData = array();
|
||||
$arr_modules = self::getListModuliUtente();
|
||||
foreach($arr_modules as $module){
|
||||
foreach ($arr_modules as $module) {
|
||||
$retData[$module["group"]][] = $module;
|
||||
}
|
||||
return $retData;
|
||||
}
|
||||
|
||||
public static function getListIdModuli($includeAlias = true){
|
||||
|
||||
public static function getListIdModuli($includeAlias = true) {
|
||||
$listIdModuli = array_keys(self::getListModuli());
|
||||
|
||||
if($includeAlias===false){
|
||||
$listIdModuli = array_unique(array_map(function($x){ $parts = explode("-", $x); return $parts[0];}, $listIdModuli));
|
||||
|
||||
if ($includeAlias === false) {
|
||||
$listIdModuli = array_unique(array_map(function ($x) {
|
||||
$parts = explode("-", $x);
|
||||
return $parts[0];
|
||||
}, $listIdModuli));
|
||||
}
|
||||
|
||||
|
||||
sort($listIdModuli);
|
||||
return $listIdModuli;
|
||||
}
|
||||
|
||||
public static function getListModuli(){ // TUTTE LE GESTIONI ESISTENTI
|
||||
|
||||
public static function getListModuli() { // TUTTE LE GESTIONI ESISTENTI
|
||||
$idx = "config-menu.json";
|
||||
if(!isset($GLOBALS[$idx])){
|
||||
if (!isset($GLOBALS[$idx])) {
|
||||
$list = json_decode(file_get_contents("config-menu.json"), true);
|
||||
ksort($list);
|
||||
$GLOBALS[$idx] = $list;
|
||||
}
|
||||
return $GLOBALS[$idx];
|
||||
}
|
||||
|
||||
public static function getListModuliUtente(){
|
||||
|
||||
public static function getListModuliUtente() {
|
||||
$arr_pvmModule = self::getListModuli(); // TUTTE LE GESTIONI ESISTENTI
|
||||
$arr_aziModule = AziendaUtils::getModuli(); // GESTIONI ATTIVE PER L'AZIENDA + INFO AGG
|
||||
$ret = array();
|
||||
foreach($arr_aziModule as $aziModule){ // COMBINA I DATI DEI 2 ARRAY (ABILITAZIONE UTENTI ECC), FILTRANDO QUELLE PER L'UTENTE CONNESSO
|
||||
foreach ($arr_aziModule as $aziModule) { // COMBINA I DATI DEI 2 ARRAY (ABILITAZIONE UTENTI ECC), FILTRANDO QUELLE PER L'UTENTE CONNESSO
|
||||
$idModule = $aziModule["name"];
|
||||
if(isset($arr_pvmModule[$idModule])){
|
||||
if (isset($arr_pvmModule[$idModule])) {
|
||||
$pvmModule = $arr_pvmModule[$idModule];
|
||||
|
||||
|
||||
|
||||
|
||||
$parts = explode("?", $pvmModule["pages"]); // es. "colli_aperti.php?spedizione" -> "colli_aperti.php", "spedizione"
|
||||
$page = $parts[0];
|
||||
$pageDet = isset($parts[1]) ? $parts[1] : null;
|
||||
|
||||
|
||||
$arr_position = $pvmModule["position"];
|
||||
|
||||
if(isset($aziModule["position"])){
|
||||
foreach($arr_position as $i => $posPvm){
|
||||
|
||||
if (isset($aziModule["position"])) {
|
||||
foreach ($arr_position as $i => $posPvm) {
|
||||
$posPvmTitle = $posPvm["title"];
|
||||
foreach($aziModule["position"] as $posAzi){
|
||||
foreach ($aziModule["position"] as $posAzi) {
|
||||
$posPvmAzi = $posAzi["title"];//
|
||||
if($posPvmTitle==$posPvmAzi && isset($posAzi["usergroups"])){
|
||||
if ($posPvmTitle == $posPvmAzi && isset($posAzi["usergroups"])) {
|
||||
$arr_position[$i] = array_merge($posPvm, $posAzi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$section = array(
|
||||
"id" => $aziModule["name"],
|
||||
"title" => isset($pvmModule["title"]) ? $pvmModule["title"] : null,
|
||||
@@ -184,111 +188,113 @@ class PVM{
|
||||
"sqlNotification" => isset($pvmModule["sqlNotification"]) ? $pvmModule["sqlNotification"] : null,
|
||||
"widgets" => isset($pvmModule["widgets"]) ? $pvmModule["widgets"] : array()
|
||||
);
|
||||
|
||||
|
||||
$parts = explode("-", $idModule); // es. "colli_aperti-spedizione" -> "colli_aperti"
|
||||
$idMainModule = $parts[0];
|
||||
$section["icon"] = "gest-lib/{$idMainModule}/".(isset($pvmModule["icon"]) ? $pvmModule["icon"] : "icon.png");
|
||||
|
||||
if(isset($aziModule["usergroups"])){
|
||||
$section["icon"] = "gest-lib/{$idMainModule}/" . (isset($pvmModule["icon"]) ? $pvmModule["icon"] : "icon.png");
|
||||
|
||||
if (isset($aziModule["usergroups"])) {
|
||||
$section["usergroups"] = $aziModule["usergroups"];
|
||||
}
|
||||
|
||||
if(isset($aziModule["users"])){
|
||||
|
||||
if (isset($aziModule["users"])) {
|
||||
$section["users"] = $aziModule["users"];
|
||||
}
|
||||
|
||||
if(self::processItemPolicyToCurrentUser($section)){
|
||||
|
||||
if (self::processItemPolicyToCurrentUser($section)) {
|
||||
$ret[$idModule] = $section;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function processItemPolicyToUser($item, $user){
|
||||
|
||||
public static function processItemPolicyToUser($item, $user) {
|
||||
$isGranted = false;
|
||||
|
||||
if(isset($item["id"]) && $item["id"]=="phpinfo" && self::isDebugEnv()){
|
||||
|
||||
if (isset($item["id"]) && $item["id"] == "phpinfo" && self::isDebugEnv()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(isset($user["group"])) {
|
||||
if (isset($user["group"])) {
|
||||
// Permesso per Amministratore aziendale e di sistema di accedere a tutto
|
||||
if($user["group"] == 9 or $user["group"] == 1) {
|
||||
if ($user["group"] == 9 or $user["group"] == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($item["usergroups"]) && !isset($item["users"])){
|
||||
|
||||
if (!isset($item["usergroups"]) && !isset($item["users"])) {
|
||||
$isGranted = true;
|
||||
|
||||
} else{
|
||||
if(isset($item["usergroups"])){
|
||||
if(count($item["usergroups"])>0){
|
||||
$countNegati = from($item["usergroups"])->where(function($x){ return $x[0]=="!";})->count();
|
||||
|
||||
} else {
|
||||
if (isset($item["usergroups"])) {
|
||||
if (count($item["usergroups"]) > 0) {
|
||||
$countNegati = from($item["usergroups"])->where(function ($x) {
|
||||
return $x[0] == "!";
|
||||
})->count();
|
||||
$isGranted = count($item["usergroups"]) == $countNegati;
|
||||
}
|
||||
|
||||
if(in_arrayi($user["group"], $item["usergroups"])){
|
||||
|
||||
if (in_arrayi($user["group"], $item["usergroups"])) {
|
||||
$isGranted = true;
|
||||
} else if(in_arrayi("!".$user["group"], $item["usergroups"])){
|
||||
} else if (in_arrayi("!" . $user["group"], $item["usergroups"])) {
|
||||
$isGranted = false;
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$isGranted = true;
|
||||
}
|
||||
|
||||
if(isset($item["users"])){
|
||||
if(in_arrayi($user["name"], $item["users"])){
|
||||
|
||||
if (isset($item["users"])) {
|
||||
if (in_arrayi($user["name"], $item["users"])) {
|
||||
$isGranted = true;
|
||||
} else if(in_arrayi("!".$user["name"], $item["users"])){
|
||||
} else if (in_arrayi("!" . $user["name"], $item["users"])) {
|
||||
$isGranted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $isGranted;
|
||||
}
|
||||
|
||||
public static function processItemPolicyToCurrentUser($item){
|
||||
|
||||
public static function processItemPolicyToCurrentUser($item) {
|
||||
$user = array("name" => User::get_current_username(), "group" => User::get_current_group());
|
||||
return self::processItemPolicyToUser($item, $user);
|
||||
}
|
||||
|
||||
public static function get_userMenuItems(){
|
||||
|
||||
public static function get_userMenuItems() {
|
||||
$retData = array();
|
||||
$userModulesTree = PVM::get_userModulesTree();
|
||||
$currentModuleTitle = PVM\CurrentModule::getTitle();
|
||||
foreach($userModulesTree as $groupId => $menuGroup){
|
||||
foreach ($userModulesTree as $groupId => $menuGroup) {
|
||||
$is_currentGroup = false;
|
||||
$arr_submenu = array();
|
||||
$notificationGroup = 0;
|
||||
foreach($menuGroup as $menuOpt){
|
||||
if($currentModuleTitle==$menuOpt["title"]){
|
||||
foreach ($menuGroup as $menuOpt) {
|
||||
if ($currentModuleTitle == $menuOpt["title"]) {
|
||||
$is_currentGroup = true;
|
||||
}
|
||||
|
||||
|
||||
$href = isset($menuOpt["pages"]) ? $menuOpt["pages"] : null;
|
||||
if(!is_null($href) && !is_null($menuOpt["page-det"])){
|
||||
$href .= "?".$menuOpt["page-det"];
|
||||
if (!is_null($href) && !is_null($menuOpt["page-det"])) {
|
||||
$href .= "?" . $menuOpt["page-det"];
|
||||
}
|
||||
$idModulo = pathinfo($href, PATHINFO_FILENAME);
|
||||
|
||||
|
||||
$notification = null;
|
||||
if(!is_null($menuOpt["sqlNotification"])){
|
||||
if (!is_null($menuOpt["sqlNotification"])) {
|
||||
$Query = new Query;
|
||||
$Query->importSqlFile($menuOpt["sqlNotification"], $idModulo)
|
||||
->setVar("user_name", User::get_current_username());
|
||||
->setVar("user_name", User::get_current_username());
|
||||
$Ret = $Query->firstRowFirstValue()->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$notification = $Ret->get_data();
|
||||
$notificationGroup += $notification;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$menuItem = array(
|
||||
"current" => $currentModuleTitle==$menuOpt["title"],
|
||||
"current" => $currentModuleTitle == $menuOpt["title"],
|
||||
"href" => $href,
|
||||
"module" => $idModulo,
|
||||
"title" => $menuOpt["title"],
|
||||
@@ -296,36 +302,38 @@ class PVM{
|
||||
"asPopup" => $menuOpt["asPopup"],
|
||||
"notification" => $notification
|
||||
);
|
||||
|
||||
|
||||
$arr_submenu[] = $menuItem;
|
||||
}
|
||||
|
||||
if(count($arr_submenu)>0){
|
||||
$arr_submenu = array_values(from($arr_submenu)->orderBy(function($x){ return $x["title"];})->toArray());
|
||||
$retData[] = array("id" => $groupId, "href" =>null, "current" => $is_currentGroup, "notification" => $notificationGroup, "items" => $arr_submenu);
|
||||
|
||||
if (count($arr_submenu) > 0) {
|
||||
$arr_submenu = array_values(from($arr_submenu)->orderBy(function ($x) {
|
||||
return $x["title"];
|
||||
})->toArray());
|
||||
$retData[] = array("id" => $groupId, "href" => null, "current" => $is_currentGroup, "notification" => $notificationGroup, "items" => $arr_submenu);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $retData;
|
||||
}
|
||||
|
||||
public static function getUrlImgResized($src, $w = null, $h = null, $nograiny = false){
|
||||
$url = "image.php?src=".$src;
|
||||
$url .= !is_null($w) && is_numeric($w) ? "&w=".$w : "";
|
||||
$url .= !is_null($h) && is_numeric($h) ? "&h=".$h : "";
|
||||
|
||||
public static function getUrlImgResized($src, $w = null, $h = null, $nograiny = false) {
|
||||
$url = "image.php?src=" . $src;
|
||||
$url .= !is_null($w) && is_numeric($w) ? "&w=" . $w : "";
|
||||
$url .= !is_null($h) && is_numeric($h) ? "&h=" . $h : "";
|
||||
$url .= $nograiny ? "&nograiny=1" : "";
|
||||
return $url;
|
||||
}
|
||||
|
||||
public static function loadAssetsLibs(){
|
||||
|
||||
public static function loadAssetsLibs() {
|
||||
return json_decode(file_get_contents("assets/assets-libs.json"), true);
|
||||
}
|
||||
|
||||
public static function getListAziende(){
|
||||
|
||||
public static function getListAziende() {
|
||||
$arr_ret = array();
|
||||
foreach(glob("config_aziende/*.config.json") as $filename){
|
||||
foreach (glob("config_aziende/*.config.json") as $filename) {
|
||||
$azienda = strtoupper(basename($filename, ".config.json"));
|
||||
if($azienda != "empty"){
|
||||
if ($azienda != "empty") {
|
||||
$arr_ret[] = $azienda;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
class Pagination{
|
||||
|
||||
class Pagination {
|
||||
private $errorText = null;
|
||||
private $passo;
|
||||
private $adjacents = 2;
|
||||
@@ -13,28 +14,28 @@ class Pagination{
|
||||
private $sql = null;
|
||||
private $orderBy = array();
|
||||
private $newMode = true;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
global $_GET;
|
||||
$this->passo(10)->setCurrentPage(!isset($_GET["pag"]) ? 1 : $_GET["pag"]);
|
||||
}
|
||||
|
||||
public function setCurrentPage($c){
|
||||
if((is_numeric($c) || is_number($c)) && intval($c)>0){
|
||||
|
||||
public function setCurrentPage($c) {
|
||||
if ((is_numeric($c) || is_number($c)) && intval($c) > 0) {
|
||||
$this->currentPage = intval($c);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getErrorText(){
|
||||
|
||||
public function getErrorText() {
|
||||
return $this->errorText;
|
||||
}
|
||||
|
||||
private function setResultsCount(){
|
||||
if(!is_null($this->sql)){
|
||||
|
||||
private function setResultsCount() {
|
||||
if (!is_null($this->sql)) {
|
||||
$Query = new Query;
|
||||
$Ret = $Query->setSql($this->sql)->toRet()->countRowsSql();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$this->resultsCount = $Ret->get_number();
|
||||
$this->setListPagesNumber();
|
||||
$this->flagBtPrev = !$this->isFirstPage($this->getCurrentNumPage());
|
||||
@@ -43,97 +44,98 @@ class Pagination{
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
// <editor-fold desc="GETTERS" defaultstate="collapsed">
|
||||
public function getMaxNumPage(){
|
||||
if($this->getPasso() > 0){
|
||||
public function getMaxNumPage() {
|
||||
if ($this->getPasso() > 0) {
|
||||
return ceil($this->getResultsCount() / $this->getPasso());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public function getResultsCount(){
|
||||
|
||||
public function getResultsCount() {
|
||||
return $this->resultsCount;
|
||||
}
|
||||
|
||||
public function getPasso(){
|
||||
|
||||
public function getPasso() {
|
||||
return $this->passo;
|
||||
}
|
||||
|
||||
public function getListNumPage(){
|
||||
|
||||
public function getListNumPage() {
|
||||
return $this->pages;
|
||||
}
|
||||
|
||||
public function getCurrentNumPage(){
|
||||
|
||||
public function getCurrentNumPage() {
|
||||
return $this->currentPage;
|
||||
}
|
||||
|
||||
public function getFlagBtPrev(){
|
||||
|
||||
public function getFlagBtPrev() {
|
||||
return $this->flagBtPrev;
|
||||
}
|
||||
|
||||
public function getFlagBtNext(){
|
||||
|
||||
public function getFlagBtNext() {
|
||||
return $this->flagBtNext;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
|
||||
// <editor-fold desc="PREPARE + EXEC QUERY" defaultstate="collapsed">
|
||||
|
||||
public function execute(){
|
||||
|
||||
public function execute() {
|
||||
$Query = new Query;
|
||||
$Ret = $Query->setSql($this->get_query_fixed())->cacheFile($this->cacheFile)->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set("pagination", $this);
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function orderBy($arr_values){
|
||||
|
||||
public function orderBy($arr_values) {
|
||||
$this->orderBy = array();
|
||||
foreach($arr_values as $field => $typeSort){
|
||||
foreach ($arr_values as $field => $typeSort) {
|
||||
$this->orderBy[$field] = array($typeSort); // x ora mantengo compatibilita formato vecchio
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function newMode($b = true){
|
||||
|
||||
public function newMode($b = true) {
|
||||
$this->newMode = $b;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_query_fixed(){
|
||||
|
||||
public function get_query_fixed() {
|
||||
$this->setResultsCount();
|
||||
|
||||
if($this->newMode){
|
||||
$from = ($this->currentPage-1) * $this->getPasso();
|
||||
|
||||
if ($this->newMode) {
|
||||
$from = ($this->currentPage - 1) * $this->getPasso();
|
||||
$to = $from + $this->getPasso();
|
||||
|
||||
|
||||
$orderBy = "";
|
||||
foreach($this->orderBy as $sorterField => $sortOption){
|
||||
foreach ($this->orderBy as $sorterField => $sortOption) {
|
||||
$sortType = in_arrayi("DESC", $sortOption) ? "DESC" : "ASC";
|
||||
$orderBy .= " ".$sorterField." ".$sortType.",";
|
||||
$orderBy .= " " . $sorterField . " " . $sortType . ",";
|
||||
}
|
||||
|
||||
|
||||
$Query = new Query($this->sql);
|
||||
$sql = $Query->fromToRow($from, $to, rtrim($orderBy, ","))->getSql();
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$currentNumPage = $this->getCurrentNumPage();
|
||||
$isTheLastNumPage = $this->isCurrentPage($currentNumPage);
|
||||
$to = $isTheLastNumPage ? $this->getResultsCount() : $currentNumPage * $this->getPasso();
|
||||
|
||||
|
||||
$orderBy1 = $orderBy2 = "";
|
||||
foreach($this->orderBy as $sorterField => $sortOption){
|
||||
foreach ($this->orderBy as $sorterField => $sortOption) {
|
||||
$isDescending = isset($sortOption["DESC"]) || in_arrayi("DESC", $sortOption);
|
||||
$orderBy1 .= " ".$sorterField." ".($isDescending ? " ASC" : " DESC").","; // INVERSO
|
||||
$orderBy2 .= " ".$sorterField." ".($isDescending ? " DESC" : " ASC").",";
|
||||
$orderBy1 .= " " . $sorterField . " " . ($isDescending ? " ASC" : " DESC") . ","; // INVERSO
|
||||
$orderBy2 .= " " . $sorterField . " " . ($isDescending ? " DESC" : " ASC") . ",";
|
||||
}
|
||||
$orderBy1 = rtrim($orderBy1, ",");
|
||||
$orderBy2 = rtrim($orderBy2, ",");
|
||||
|
||||
|
||||
$sql = "SELECT * FROM (
|
||||
SELECT TOP ".$this->getPasso()." * FROM (
|
||||
SELECT TOP ".$to." * FROM (
|
||||
".$this->sql."
|
||||
SELECT TOP " . $this->getPasso() . " * FROM (
|
||||
SELECT TOP " . $to . " * FROM (
|
||||
" . $this->sql . "
|
||||
) tb1
|
||||
ORDER BY {$orderBy1}
|
||||
) tb2
|
||||
@@ -143,153 +145,160 @@ class Pagination{
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
public function passo($value){
|
||||
|
||||
public function passo($value) {
|
||||
$this->passo = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function adjacents($value){
|
||||
|
||||
public function adjacents($value) {
|
||||
$this->adjacents = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function sm(){
|
||||
|
||||
public function sm() {
|
||||
$this->size = "sm";
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function lg(){
|
||||
|
||||
public function lg() {
|
||||
$this->size = "lg";
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function md(){
|
||||
|
||||
public function md() {
|
||||
$this->size = "md";
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function cacheFile($prefix = true){
|
||||
|
||||
public function cacheFile($prefix = true) {
|
||||
$this->cacheFile = $prefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function query($value){
|
||||
if(\Query::is_typeQuery($value)){
|
||||
|
||||
public function query($value) {
|
||||
if (\Query::is_typeQuery($value)) {
|
||||
$this->sql = $value->getSql();
|
||||
if($this->cacheFile===false){
|
||||
if ($this->cacheFile === false) {
|
||||
$this->cacheFile($value->getCacheFile());
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$this->sql = $value;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function isCurrentPage($numPage){
|
||||
|
||||
private function isCurrentPage($numPage) {
|
||||
return $numPage === $this->getCurrentNumPage();
|
||||
}
|
||||
|
||||
private function isLastPage($numPage){
|
||||
|
||||
private function isLastPage($numPage) {
|
||||
return $numPage >= $this->getMaxNumPage();
|
||||
}
|
||||
|
||||
private function isFirstPage($numPage){
|
||||
|
||||
private function isFirstPage($numPage) {
|
||||
return $numPage === 1;
|
||||
}
|
||||
|
||||
public function render(){
|
||||
|
||||
public function render() {
|
||||
global $_GET;
|
||||
if($this->getMaxNumPage()>1){
|
||||
if ($this->getMaxNumPage() > 1) {
|
||||
$get_p = $_GET;
|
||||
unset($get_p["pag"]);
|
||||
parse_str(http_build_query($get_p), $HttpQuery);
|
||||
$queryUri = http_build_query($HttpQuery);
|
||||
$queryUri = preg_replace('/%5B[0-9]+%5D/simU', '%5B%5D', $queryUri);
|
||||
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div>
|
||||
<ul class="pagination pagination-<?=$this->size?>"><?
|
||||
if($this->flagBtPrev){?>
|
||||
<li>
|
||||
<a href="<?="{$_SERVER["PHP_SELF"]}?{$queryUri}&pag=".($this->getCurrentNumPage()-1)?>" aria-label="Precedente">
|
||||
<span aria-hidden="true">«</span>
|
||||
</a>
|
||||
</li><?
|
||||
<ul class="pagination pagination-<?= $this->size ?>"><?
|
||||
if ($this->flagBtPrev) {
|
||||
?>
|
||||
<li>
|
||||
<a href="<?= "{$_SERVER["PHP_SELF"]}?{$queryUri}&pag=" . ($this->getCurrentNumPage() - 1) ?>"
|
||||
aria-label="Precedente">
|
||||
<span aria-hidden="true">«</span>
|
||||
</a>
|
||||
</li><?
|
||||
}
|
||||
|
||||
$arr_pagesList = $this->getListNumPage();
|
||||
foreach ($arr_pagesList as $c => $number) {
|
||||
if ($arr_pagesList[(($c == 0) ? 0 : $c - 1)] + 1 != $number && $c > 0) {
|
||||
?>
|
||||
<li class="disabled"><a href="#">...</a></li><?
|
||||
}
|
||||
|
||||
$arr_pagesList = $this->getListNumPage();
|
||||
foreach($arr_pagesList as $c => $number){
|
||||
if($arr_pagesList[(($c==0)?0:$c-1)]+1!=$number && $c>0){?>
|
||||
<li class="disabled"><a href="#">...</a></li><?
|
||||
}
|
||||
if(!$this->isCurrentPage($number)){?>
|
||||
<li>
|
||||
<a href="<?="{$_SERVER["PHP_SELF"]}?{$queryUri}&pag={$number}"?>">
|
||||
<?=number_format($number, 0, ".", "'")?>
|
||||
</a>
|
||||
</li><?
|
||||
} else{ // corrente ?>
|
||||
<li class="active"><a href="#"><?=number_format($number, 0, ".", "'")?></a></li><?
|
||||
}
|
||||
}
|
||||
|
||||
if($this->flagBtNext){?>
|
||||
if (!$this->isCurrentPage($number)) {
|
||||
?>
|
||||
<li>
|
||||
<a href="<?="{$_SERVER["PHP_SELF"]}?{$queryUri}&pag=".($this->getCurrentNumPage()+1)?>" aria-label="Successiva">
|
||||
<span aria-hidden="true">»</span>
|
||||
</a>
|
||||
<a href="<?= "{$_SERVER["PHP_SELF"]}?{$queryUri}&pag={$number}" ?>">
|
||||
<?= number_format($number, 0, ".", "'") ?>
|
||||
</a>
|
||||
</li><?
|
||||
}?>
|
||||
</ul>
|
||||
} else { // corrente ?>
|
||||
<li class="active"><a href="#"><?= number_format($number, 0, ".", "'") ?></a></li><?
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->flagBtNext) {
|
||||
?>
|
||||
<li>
|
||||
<a href="<?= "{$_SERVER["PHP_SELF"]}?{$queryUri}&pag=" . ($this->getCurrentNumPage() + 1) ?>"
|
||||
aria-label="Successiva">
|
||||
<span aria-hidden="true">»</span>
|
||||
</a>
|
||||
</li><?
|
||||
} ?>
|
||||
</ul>
|
||||
</div><?
|
||||
|
||||
|
||||
$html = Utility\Str::remove_multiple_spaces(ob_get_contents());
|
||||
@ob_end_clean();
|
||||
@ob_end_flush();
|
||||
echo $html;
|
||||
}
|
||||
}
|
||||
|
||||
public function display(){
|
||||
|
||||
public function display() {
|
||||
return $this->render();
|
||||
}
|
||||
|
||||
private function setListPagesNumber(){
|
||||
|
||||
private function setListPagesNumber() {
|
||||
$lastpage = $this->getMaxNumPage();
|
||||
$thispage = $this->getCurrentNumPage();
|
||||
|
||||
|
||||
$array = array();
|
||||
$adjacents = $this->adjacents;
|
||||
$n_extr_pages = 2;
|
||||
if(Utility::is_mobile()){
|
||||
if (Utility::is_mobile()) {
|
||||
$adjacents = 1;
|
||||
$n_extr_pages = 1;
|
||||
}
|
||||
|
||||
for($counter = 1; $counter <= $lastpage; $counter++){
|
||||
if($lastpage < 7 + $adjacents * 2){
|
||||
|
||||
for ($counter = 1; $counter <= $lastpage; $counter++) {
|
||||
if ($lastpage < 7 + $adjacents * 2) {
|
||||
$array[] = $counter;
|
||||
} else if($lastpage > 5 + $adjacents * 2){
|
||||
if($thispage < 1 + $adjacents * 2){ //close to beginning; only hide later pages
|
||||
if($counter < 4 + $adjacents * 2 || ($counter <= $lastpage && $counter >= $lastpage-($n_extr_pages-1))){
|
||||
} else if ($lastpage > 5 + $adjacents * 2) {
|
||||
if ($thispage < 1 + $adjacents * 2) { //close to beginning; only hide later pages
|
||||
if ($counter < 4 + $adjacents * 2 || ($counter <= $lastpage && $counter >= $lastpage - ($n_extr_pages - 1))) {
|
||||
$array[] = $counter;
|
||||
}
|
||||
} else if($lastpage - $adjacents * 2 > $thispage && $thispage > $adjacents * 2){ //in middle; hide some front and some back
|
||||
if($counter <= $n_extr_pages || ( $counter >= $thispage - $adjacents && $counter <= $thispage + $adjacents) || ($counter >= $lastpage-($n_extr_pages-1) || $counter <= $n_extr_pages)){
|
||||
} else if ($lastpage - $adjacents * 2 > $thispage && $thispage > $adjacents * 2) { //in middle; hide some front and some back
|
||||
if ($counter <= $n_extr_pages || ($counter >= $thispage - $adjacents && $counter <= $thispage + $adjacents) || ($counter >= $lastpage - ($n_extr_pages - 1) || $counter <= $n_extr_pages)) {
|
||||
$array[] = $counter; // PRIME PAGINE || PAGINE NEL MEZZO || ULTIME PAGINE
|
||||
}
|
||||
} else{ //close to end; only hide early pages
|
||||
if($counter <= $n_extr_pages || ($counter >= $lastpage - (2 + $adjacents * 2) && $counter <= $lastpage)){
|
||||
} else { //close to end; only hide early pages
|
||||
if ($counter <= $n_extr_pages || ($counter >= $lastpage - (2 + $adjacents * 2) && $counter <= $lastpage)) {
|
||||
$array[] = $counter; // PRIME PAGINE || PAGINE NEL MEZZO || ULTIME PAGINE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->pages = $array;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
<?php
|
||||
class PdfDoc{
|
||||
|
||||
class PdfDoc {
|
||||
private $arr_whereCond = array();
|
||||
|
||||
public function whereDate($k, $v){
|
||||
|
||||
public function whereDate($k, $v) {
|
||||
$v = \Utility\Date::isValidUnixtime($v) ? strftime(\Format::strftimeYMD, $v) : $v;
|
||||
return $this->where($k, $v);
|
||||
}
|
||||
|
||||
public function where($k, $v = false){
|
||||
if($v!==false){
|
||||
if(in_array($k, array("ser_doc", "cod_anag", "cod_dtip", "data_doc", "num_doc"))){
|
||||
$k = "dtb_doc_pdf.".$k;
|
||||
|
||||
public function where($k, $v = false) {
|
||||
if ($v !== false) {
|
||||
if (in_array($k, array("ser_doc", "cod_anag", "cod_dtip", "data_doc", "num_doc"))) {
|
||||
$k = "dtb_doc_pdf." . $k;
|
||||
}
|
||||
$this->arr_whereCond[] = array("k" => $k, "v" => $v);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getList(){
|
||||
|
||||
public function getList() {
|
||||
$Ret = new Ret;
|
||||
if(count($this->arr_whereCond)>0){
|
||||
if (count($this->arr_whereCond) > 0) {
|
||||
$sql = "SELECT t.*,
|
||||
dtb_doc_pdf.filename,
|
||||
dtb_doc_pdf.filesize,
|
||||
@@ -59,68 +60,68 @@ class PdfDoc{
|
||||
dtb_doc_pdf.ser_doc = t.ser_doc AND
|
||||
dtb_doc_pdf.versione = t.versione
|
||||
WHERE 1 = 1";
|
||||
|
||||
|
||||
$Query = new Query($sql);
|
||||
foreach($this->arr_whereCond as $whereCond){
|
||||
foreach ($this->arr_whereCond as $whereCond) {
|
||||
$Query->where($whereCond["k"], $whereCond["v"]);
|
||||
}
|
||||
$Ret = $Query->toRet()->date2ts()->execute();
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Condizione non pervenuta");
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function get($key){
|
||||
|
||||
public static function get($key) {
|
||||
$Query = new \Query;
|
||||
$Query->select("data_doc", "num_doc", "ser_doc", "cod_anag", "cod_dtip", "versione", "filename AS name")
|
||||
->from("dtb_doc_pdf")
|
||||
->where("(filecontent IS NOT NULL OR ref_uuid IS NOT NULL)")
|
||||
->whereDate("data_doc", $key["data_doc"])
|
||||
->where("num_doc", $key["num_doc"])
|
||||
->where("ser_doc", $key["ser_doc"])
|
||||
->where("cod_anag", $key["cod_anag"])
|
||||
->where("cod_dtip", $key["cod_dtip"])
|
||||
->orderBy("versione DESC");
|
||||
|
||||
if(array_key_exists("versione", $key)){
|
||||
->from("dtb_doc_pdf")
|
||||
->where("(filecontent IS NOT NULL OR ref_uuid IS NOT NULL)")
|
||||
->whereDate("data_doc", $key["data_doc"])
|
||||
->where("num_doc", $key["num_doc"])
|
||||
->where("ser_doc", $key["ser_doc"])
|
||||
->where("cod_anag", $key["cod_anag"])
|
||||
->where("cod_dtip", $key["cod_dtip"])
|
||||
->orderBy("versione DESC");
|
||||
|
||||
if (array_key_exists("versione", $key)) {
|
||||
$Query->where("versione", $key["versione"]);
|
||||
}
|
||||
|
||||
|
||||
$Ret = $Query->firstRow()->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$item = $Ret->get_data();
|
||||
if(!is_null($item)){
|
||||
if (!is_null($item)) {
|
||||
$IMSApi = new IMSApi;
|
||||
$IMSApi->download("downloadDtbDocPdf")
|
||||
->queryDateParam("dataDoc", $item["data_doc"])
|
||||
->queryParam("numDoc", $item["num_doc"])
|
||||
->queryParam("serDoc", $item["ser_doc"])
|
||||
->queryParam("codAnag", $item["cod_anag"])
|
||||
->queryParam("codDtip", $item["cod_dtip"])
|
||||
->queryParam("versione", $item["versione"]);
|
||||
->queryDateParam("dataDoc", $item["data_doc"])
|
||||
->queryParam("numDoc", $item["num_doc"])
|
||||
->queryParam("serDoc", $item["ser_doc"])
|
||||
->queryParam("codAnag", $item["cod_anag"])
|
||||
->queryParam("codDtip", $item["cod_dtip"])
|
||||
->queryParam("versione", $item["versione"]);
|
||||
$Ret = $IMSApi->send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_byte(Utility\Compression\GZ::uncompress($Ret->get_data()))
|
||||
->set_string($item["name"])
|
||||
->set_data($item);
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("File non trovato");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function cache($key){
|
||||
|
||||
public static function cache($key) {
|
||||
$Ret = self::get($key);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret = Cache::writeR($Ret->get_string(), $Ret->get_byte(), true, true);
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,25 +1,26 @@
|
||||
<?php
|
||||
class PdfOrd{
|
||||
|
||||
class PdfOrd {
|
||||
private $arr_whereCond = array();
|
||||
|
||||
public function whereDate($k, $v){
|
||||
|
||||
public function whereDate($k, $v) {
|
||||
$v = \Utility\Date::isValidUnixtime($v) ? strftime(\Format::strftimeYMD, $v) : $v;
|
||||
return $this->where($k, $v);
|
||||
}
|
||||
|
||||
public function where($k, $v = false){
|
||||
if($v!==false){
|
||||
if(in_array($k, array("gestione", "data_ord", "num_ord"))){
|
||||
$k = "dtb_ord_pdf.".$k;
|
||||
|
||||
public function where($k, $v = false) {
|
||||
if ($v !== false) {
|
||||
if (in_array($k, array("gestione", "data_ord", "num_ord"))) {
|
||||
$k = "dtb_ord_pdf." . $k;
|
||||
}
|
||||
$this->arr_whereCond[] = array("k" => $k, "v" => $v);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getList(){
|
||||
|
||||
public function getList() {
|
||||
$Ret = new Ret;
|
||||
if(count($this->arr_whereCond)>0){
|
||||
if (count($this->arr_whereCond) > 0) {
|
||||
$sql = "SELECT t.*,
|
||||
dtb_ord_pdf.filename,
|
||||
dtb_ord_pdf.filesize,
|
||||
@@ -40,64 +41,64 @@ class PdfOrd{
|
||||
dtb_ord_pdf.gestione = t.gestione AND
|
||||
dtb_ord_pdf.versione = t.versione
|
||||
WHERE 1 = 1";
|
||||
|
||||
|
||||
$Query = new Query($sql);
|
||||
foreach($this->arr_whereCond as $whereCond){
|
||||
foreach ($this->arr_whereCond as $whereCond) {
|
||||
$Query->where($whereCond["k"], $whereCond["v"]);
|
||||
}
|
||||
$Ret = $Query->toRet()->date2ts()->execute();
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Condizione non pervenuta");
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function get($key){
|
||||
|
||||
public static function get($key) {
|
||||
$Query = new \Query;
|
||||
$Query->select("data_ord", "num_ord", "gestione", "versione", "filename AS name")
|
||||
->from("dtb_ord_pdf")
|
||||
->where("filecontent IS NOT NULL")
|
||||
->whereDate("data_ord", $key["data_ord"])
|
||||
->where("num_ord", $key["num_ord"])
|
||||
->where("gestione", $key["gestione"])
|
||||
->orderBy("versione DESC");
|
||||
|
||||
if(array_key_exists("versione", $key)){
|
||||
->from("dtb_ord_pdf")
|
||||
->where("filecontent IS NOT NULL")
|
||||
->whereDate("data_ord", $key["data_ord"])
|
||||
->where("num_ord", $key["num_ord"])
|
||||
->where("gestione", $key["gestione"])
|
||||
->orderBy("versione DESC");
|
||||
|
||||
if (array_key_exists("versione", $key)) {
|
||||
$Query->where("versione", $key["versione"]);
|
||||
}
|
||||
|
||||
|
||||
$Ret = $Query->firstRow()->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$item = $Ret->get_data();
|
||||
if(!is_null($item)){
|
||||
if (!is_null($item)) {
|
||||
$IMSApi = new IMSApi;
|
||||
$IMSApi->download("downloadDtbOrdPdf")
|
||||
->queryDateParam("dataOrd", $item["data_ord"])
|
||||
->queryParam("numOrd", $item["num_ord"])
|
||||
->queryParam("gestione", $item["gestione"])
|
||||
->queryParam("versione", $item["versione"]);
|
||||
->queryDateParam("dataOrd", $item["data_ord"])
|
||||
->queryParam("numOrd", $item["num_ord"])
|
||||
->queryParam("gestione", $item["gestione"])
|
||||
->queryParam("versione", $item["versione"]);
|
||||
$Ret = $IMSApi->send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_byte(Utility\Compression\GZ::uncompress($Ret->get_data()))
|
||||
->set_string($item["name"])
|
||||
->set_data($item);
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("File non trovato");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function cache($key){
|
||||
|
||||
public static function cache($key) {
|
||||
$Ret = self::get($key);
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret = Cache::writeR($Ret->get_string(), $Ret->get_byte(), true, true);
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,100 +1,101 @@
|
||||
<?php
|
||||
class PdfUtils{
|
||||
|
||||
class PdfUtils {
|
||||
private $arr_pdfBlobs = array();
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->arr_pdfBlobs = array();
|
||||
}
|
||||
|
||||
public function add($blob){
|
||||
if(!is_null($blob)){
|
||||
|
||||
public function add($blob) {
|
||||
if (!is_null($blob)) {
|
||||
$this->arr_pdfBlobs[] = $blob;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function merge(){
|
||||
|
||||
public function merge() {
|
||||
$Ret = new Ret;
|
||||
try{
|
||||
try {
|
||||
$body = $this->buildBody();
|
||||
if(count($body)>0){
|
||||
if(count($body)==1){ // un solo pdf, non chiamo il servizio di merging
|
||||
if (count($body) > 0) {
|
||||
if (count($body) == 1) { // un solo pdf, non chiamo il servizio di merging
|
||||
$Ret->set_byte($this->arr_pdfBlobs[0]);
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$IMSApi = new IMSApi;
|
||||
$Ret = $IMSApi->post("mergePDF")->body($body)->send();
|
||||
|
||||
if($Ret->is_OK()){
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$returnData = $Ret->get_data();
|
||||
if(!is_null($returnData) && isset($returnData[0])){
|
||||
if($returnData[0]["esito"]==1){
|
||||
if (!is_null($returnData) && isset($returnData[0])) {
|
||||
if ($returnData[0]["esito"] == 1) {
|
||||
$Ret->set_byte(self::decodeBlob($returnData[0]["genericList"][0]));
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error($returnData[0]["errorMessage"]);
|
||||
}
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Return data vuota");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Lista file pdf vuota");
|
||||
}
|
||||
|
||||
} catch(Exception $e){
|
||||
$Ret->set_error("PdfUtils.merge.catch: ".$e->getMessage());
|
||||
|
||||
} catch (Exception $e) {
|
||||
$Ret->set_error("PdfUtils.merge.catch: " . $e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function split(){
|
||||
|
||||
public function split() {
|
||||
$Ret = new Ret;
|
||||
try{
|
||||
try {
|
||||
$body = $this->buildBody();
|
||||
if(count($body)>0){
|
||||
if (count($body) > 0) {
|
||||
$IMSApi = new IMSApi;
|
||||
$Ret = $IMSApi->post("splitPDF")->body($body)->send();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$returnData = $Ret->get_data();
|
||||
if(count($returnData[0]["dto"])>0){
|
||||
foreach($returnData[0]["dto"] as $i => $blob){
|
||||
if (count($returnData[0]["dto"]) > 0) {
|
||||
foreach ($returnData[0]["dto"] as $i => $blob) {
|
||||
$returnData[0]["dto"][$i] = self::decodeBlob($blob);
|
||||
}
|
||||
$Ret->set_data($returnData[0]["dto"]);
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("Non è stato generato alcun file");
|
||||
}
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_error("File pdf non pervenuto");
|
||||
}
|
||||
} catch(Exception $e){
|
||||
$Ret->set_error("PdfUtils.split.catch: ".$e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
$Ret->set_error("PdfUtils.split.catch: " . $e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private function buildBody(){
|
||||
|
||||
private function buildBody() {
|
||||
$body = array();
|
||||
foreach($this->arr_pdfBlobs as $blob){
|
||||
foreach ($this->arr_pdfBlobs as $blob) {
|
||||
$body[] = array("b64_gz_blob_pdf" => base64_encode(\Utility\Compression\GZ::compress($blob)));
|
||||
}
|
||||
return $body;
|
||||
}
|
||||
|
||||
private static function decodeBlob($blob){
|
||||
if(self::isBase64Encoded($blob)){
|
||||
|
||||
private static function decodeBlob($blob) {
|
||||
if (self::isBase64Encoded($blob)) {
|
||||
$blob = base64_decode($blob);
|
||||
}
|
||||
return Utility\Compression\GZ::uncompress($blob);
|
||||
}
|
||||
|
||||
private static function isBase64Encoded($data){
|
||||
|
||||
private static function isBase64Encoded($data) {
|
||||
return !(base64_decode($data, true) === false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +1,40 @@
|
||||
<?php
|
||||
class PvwClientiProspect{ // VALUTARE POSSIBILITA DI CREARE PROGENITORE
|
||||
|
||||
class PvwClientiProspect { // VALUTARE POSSIBILITA DI CREARE PROGENITORE
|
||||
const view = "pvw_clienti_prospect";
|
||||
const oneRow = true;
|
||||
|
||||
|
||||
private $key = array();
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function key($key, $value){
|
||||
|
||||
public function key($key, $value) {
|
||||
$this->key[$key] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get(){
|
||||
|
||||
public function get() {
|
||||
$arr_columns = func_get_args();
|
||||
if(count($arr_columns)>0){
|
||||
foreach($arr_columns as &$item){
|
||||
if (count($arr_columns) > 0) {
|
||||
foreach ($arr_columns as &$item) {
|
||||
$item = Utility\Str::camelCaseDecode($item);
|
||||
}
|
||||
|
||||
|
||||
$table = $this->get_tableName();
|
||||
$Query = new Query;
|
||||
$Query = $Query->select($arr_columns)->from($table);
|
||||
foreach($this->key as $key => $value){
|
||||
foreach ($this->key as $key => $value) {
|
||||
$key = Utility\Str::camelCaseDecode($key);
|
||||
$Query->where($key, $value);
|
||||
}
|
||||
|
||||
|
||||
$Ret = $Query->date2ts()->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
if(self::oneRow){
|
||||
if(count($arr_rows)>0){
|
||||
if(count($arr_columns)==1){
|
||||
if (self::oneRow) {
|
||||
if (count($arr_rows) > 0) {
|
||||
if (count($arr_columns) == 1) {
|
||||
return $arr_rows[0][$arr_columns[0]];
|
||||
}
|
||||
return $arr_rows[0];
|
||||
@@ -45,8 +46,8 @@ class PvwClientiProspect{ // VALUTARE POSSIBILITA DI CREARE PROGENITORE
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function get_tableName(){
|
||||
|
||||
private function get_tableName() {
|
||||
return self::view;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
class Query
|
||||
{
|
||||
class Query {
|
||||
public $errorText = null;
|
||||
public $sql = null;
|
||||
public $processSql = false;
|
||||
public $date2ts = false;
|
||||
public $date2iso = false;
|
||||
public $firstRow = false;
|
||||
public $firstColumn = false;
|
||||
|
||||
@@ -34,25 +34,22 @@ class Query
|
||||
private $arr_distinct = array();
|
||||
private $arr_values = array(); // WARN va insieme a insert()
|
||||
private $arr_select = array(); // CONTIENE IL NOME DELLE SOLE COLONNE DA TORNARE (NON COMPLETAMENTE SUPPORTATO)
|
||||
private $fieldsarray = array();
|
||||
|
||||
public function __construct($s = null)
|
||||
{//var_dump($s);
|
||||
public function __construct($s = null) {//var_dump($s);
|
||||
$this->construct($s)//->cacheFile()
|
||||
;
|
||||
}
|
||||
|
||||
public function construct($s)
|
||||
{
|
||||
public function construct($s) {
|
||||
return $this->setSql($s, false)->date2ts()->profileDB();
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
public function __destruct() {
|
||||
$this->db = null;
|
||||
}
|
||||
|
||||
public function profileDB($profileDB = null)
|
||||
{
|
||||
public function profileDB($profileDB = null) {
|
||||
$this->db = false;
|
||||
$this->profileDB = $profileDB;
|
||||
|
||||
@@ -73,8 +70,7 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function getAvailableDrivers()
|
||||
{
|
||||
public static function getAvailableDrivers() {
|
||||
$drivers = array("mssql");
|
||||
if (extension_loaded("sqlsrv")) {
|
||||
$drivers[] = "sqlsrv";
|
||||
@@ -85,13 +81,11 @@ class Query
|
||||
return $drivers;
|
||||
}
|
||||
|
||||
public static function getDefaultDriver()
|
||||
{
|
||||
public static function getDefaultDriver() {
|
||||
return "mssql";
|
||||
}
|
||||
|
||||
private function getDriver()
|
||||
{
|
||||
private function getDriver() {
|
||||
$driver = self::getDefaultDriver();
|
||||
$dbConfig = Config::get_dbData($this->profileDB);
|
||||
if (!is_null($dbConfig)) {
|
||||
@@ -105,8 +99,7 @@ class Query
|
||||
return $driver;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
public function __toString() {
|
||||
return \Utility\Str::remove_multiple_spaces($this->getSql());
|
||||
}
|
||||
|
||||
@@ -123,31 +116,26 @@ class Query
|
||||
return true;
|
||||
}*/
|
||||
|
||||
public function fromToRow($from = null, $to = null, $orderByFromTo = null)
|
||||
{
|
||||
public function fromToRow($from = null, $to = null, $orderByFromTo = null) {
|
||||
return $this->fromRow($from)->toRow($to)->orderByFromTo($orderByFromTo);
|
||||
}
|
||||
|
||||
private function fromRow($n)
|
||||
{
|
||||
private function fromRow($n) {
|
||||
$this->fromRow = $n;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function toRow($n)
|
||||
{
|
||||
private function toRow($n) {
|
||||
$this->toRow = $n;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function orderByFromTo($value)
|
||||
{
|
||||
private function orderByFromTo($value) {
|
||||
$this->orderByFromTo = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function groupBy($values)
|
||||
{
|
||||
public function groupBy($values) {
|
||||
$values = func_get_args();
|
||||
if (count($values) > 0) {
|
||||
$this->groupBy = implode(",", $values);
|
||||
@@ -155,14 +143,12 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function orderBy($value)
|
||||
{
|
||||
public function orderBy($value) {
|
||||
$this->orderBy = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSql()
|
||||
{
|
||||
public function getSql() {
|
||||
if ($this->is_insertSql() && count($this->arr_values) > 0) {
|
||||
if (!$this->staticSql) {
|
||||
self::complete_insertSql();
|
||||
@@ -211,18 +197,15 @@ class Query
|
||||
return $this->sql;
|
||||
}
|
||||
|
||||
private static function is_selectSql($sql)
|
||||
{
|
||||
private static function is_selectSql($sql) {
|
||||
return !is_null($sql) ? Utility\Str::startsWith($sql, "SELECT ", false) : false;
|
||||
}
|
||||
|
||||
private function is_insertSql()
|
||||
{
|
||||
private function is_insertSql() {
|
||||
return !is_null($this->sql) ? Utility\Str::startsWith($this->sql, "INSERT INTO ", false) : false;
|
||||
}
|
||||
|
||||
private function complete_insertSql()
|
||||
{
|
||||
private function complete_insertSql() {
|
||||
if (!is_null($this->sql)) {
|
||||
$this->sql .= "(";
|
||||
foreach ($this->arr_values as $fieldname => $value) {
|
||||
@@ -237,75 +220,70 @@ class Query
|
||||
}
|
||||
}
|
||||
|
||||
public function setSql($sql, $staticSql = true)
|
||||
{
|
||||
public function setSql($sql, $staticSql = true) {
|
||||
$this->sql = self::is_typeQuery($sql) ? $sql->getSql() : $sql;
|
||||
$this->staticSql = $staticSql;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function top($n)
|
||||
{
|
||||
public function top($n) {
|
||||
$this->top = $n;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function camelCaseColumnName($b = true)
|
||||
{
|
||||
public function camelCaseColumnName($b = true) {
|
||||
$this->camelCaseColumnName = $b !== false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function date2ts($b = true)
|
||||
{
|
||||
$this->date2ts = $b !== false;
|
||||
public function date2ts($b = true) {
|
||||
$this->date2iso = !$b;
|
||||
$this->date2ts = $b;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function cacheResult($b = true)
|
||||
{
|
||||
public function date2iso($b = true) {
|
||||
$this->date2ts = !$b;
|
||||
$this->date2iso = $b;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function cacheResult($b = true) {
|
||||
$this->cacheResult = $b !== false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function firstColumn($b = true)
|
||||
{ // se la query ha successo, torna solo un array di valori della prima colonna
|
||||
public function firstColumn($b = true) { // se la query ha successo, torna solo un array di valori della prima colonna
|
||||
$this->firstColumn = $b !== false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function firstRow($b = true)
|
||||
{ // se la query ha successo, torna solo la prima riga (non in un array)
|
||||
public function firstRow($b = true) { // se la query ha successo, torna solo la prima riga (non in un array)
|
||||
$this->firstRow = $b !== false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function firstRowFirstValue($b = true)
|
||||
{ // se la query ha successo, torna solo il valore semplice della prima colonna e della prima riga
|
||||
public function firstRowFirstValue($b = true) { // se la query ha successo, torna solo il valore semplice della prima colonna e della prima riga
|
||||
$this->firstRowFirstValue = $b !== false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function toRet($b = true)
|
||||
{ // è necessario posizionarlo "prima" di execute()
|
||||
public function toRet($b = true) { // è necessario posizionarlo "prima" di execute()
|
||||
$this->toRet = $b !== false;
|
||||
$this->_flagSettedToRet = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function cacheFile($prefix = true)
|
||||
{
|
||||
public function cacheFile($prefix = true) {
|
||||
$this->cacheSqlFile = $prefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCacheFile()
|
||||
{
|
||||
public function getCacheFile() {
|
||||
return $this->cacheSqlFile;
|
||||
}
|
||||
|
||||
private static function getModuloCaller()
|
||||
{
|
||||
private static function getModuloCaller() {
|
||||
try {
|
||||
$caller = debug_backtrace();
|
||||
$caller = $caller[3]; //echopre($caller);
|
||||
@@ -322,20 +300,17 @@ class Query
|
||||
return null;
|
||||
}
|
||||
|
||||
public function distinct()
|
||||
{ /* WARN crea una vista esterna, se la query originaria contiene ORDER BY non funziona. utilizzare il metodo orderBy()*/
|
||||
public function distinct() { /* WARN crea una vista esterna, se la query originaria contiene ORDER BY non funziona. utilizzare il metodo orderBy()*/
|
||||
$this->arr_distinct = array_merge($this->arr_distinct, func_get_args());
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function module($moduleName)
|
||||
{
|
||||
public function module($moduleName) {
|
||||
$this->module = $moduleName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function importSqlFile($fileName, $moduleName = null)
|
||||
{
|
||||
public function importSqlFile($fileName, $moduleName = null) {
|
||||
$ext = nullIfBlank(pathinfo($fileName, PATHINFO_EXTENSION));
|
||||
if (is_null($ext)) {
|
||||
$fileName .= ".sql";
|
||||
@@ -351,8 +326,7 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function getSqlFilePath()
|
||||
{
|
||||
private function getSqlFilePath() {
|
||||
$dirname = nullIfBlank(trim(pathinfo($this->sqlFilename, PATHINFO_DIRNAME), "."));
|
||||
if (!is_null($dirname)) { // passato un percorso completo col file .sql (non controlla nella cartella sql interna alla gestione corrente)
|
||||
$filePath = $this->sqlFilename;
|
||||
@@ -372,8 +346,7 @@ class Query
|
||||
return file_exists($filePath) ? $filePath : null;
|
||||
}
|
||||
|
||||
private function loadSqlFile()
|
||||
{
|
||||
private function loadSqlFile() {
|
||||
$Ret = new Ret;
|
||||
$filePath = $this->getSqlFilePath();
|
||||
if (!is_null($filePath)) {
|
||||
@@ -384,8 +357,7 @@ class Query
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function select()
|
||||
{ // è importante eseguire in ordine select -> from -> where
|
||||
public function select() { // è importante eseguire in ordine select -> from -> where
|
||||
// ACCETTA: nessun argument = * ; argument come array: array("campo1", "campo2") ; piu argument (anche misti cona array): "campo1", "campo2"
|
||||
$arr_values = func_get_args();
|
||||
// PREVENT OVERWRITE SQL
|
||||
@@ -413,14 +385,12 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function fromView($input, $viewName = "v")
|
||||
{
|
||||
public function fromView($input, $viewName = "v") {
|
||||
$sql = self::is_typeQuery($input) ? $input->getSql() : $input;
|
||||
return $this->from("({$sql}) {$viewName} WHERE 1=1");
|
||||
}
|
||||
|
||||
public function from($value)
|
||||
{/*
|
||||
public function from($value) {/*
|
||||
if(self::is_selectSql($value)){
|
||||
$this->sql .= " FROM (".$value.") v1";
|
||||
|
||||
@@ -431,35 +401,30 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function insert($table)
|
||||
{// è importante eseguire in ordine insert -> value
|
||||
public function insert($table) {// è importante eseguire in ordine insert -> value
|
||||
if (!is_null($table) && strlen(trim($table)) > 0) {
|
||||
$this->sql = "INSERT INTO {$table} ";
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function valueDatetime($fieldname, $value)
|
||||
{
|
||||
public function valueDatetime($fieldname, $value) {
|
||||
return $this->value($fieldname, strftime(\Format::strftimeYMDHMS, $value));
|
||||
}
|
||||
|
||||
public function value($fieldname, $value = null)
|
||||
{ // WARN va insieme a insert()
|
||||
public function value($fieldname, $value = null) { // WARN va insieme a insert()
|
||||
$this->arr_values[$fieldname] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function update($table)
|
||||
{// è importante eseguire in ordine update -> set -> from -> where
|
||||
public function update($table) {// è importante eseguire in ordine update -> set -> from -> where
|
||||
if (!is_null($table) && strlen(trim($table)) > 0) {
|
||||
$this->sql = "UPDATE " . $table . " SET ";
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function delete($table)
|
||||
{
|
||||
public function delete($table) {
|
||||
if (!is_null($table) && strlen(trim($table)) > 0) {
|
||||
$this->sql = "DELETE FROM " . $table;
|
||||
}
|
||||
@@ -471,16 +436,14 @@ class Query
|
||||
|
||||
}*/
|
||||
|
||||
public function set($field, $value)
|
||||
{// WARN va insieme a update()
|
||||
public function set($field, $value) {// WARN va insieme a update()
|
||||
if (!is_null($this->sql)) {
|
||||
$this->sql .= "{$field} = " . self::sqlValue($value) . ",";
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function sqlValue($v, $type = null)
|
||||
{
|
||||
public static function sqlValue($v, $type = null) {
|
||||
if ($type == \Format::strftimeYMD) {
|
||||
$v = strftime(\Format::strftimeYMD, $v);
|
||||
|
||||
@@ -494,13 +457,11 @@ class Query
|
||||
return is_null($v) ? "NULL" : ((is_float($v) || is_int($v)) ? $v : "'" . str_replace("'", "''", $v) . "'");
|
||||
}
|
||||
|
||||
public static function process_whereParameters($fieldname, $value = false, $type = null)
|
||||
{
|
||||
public static function process_whereParameters($fieldname, $value = false, $type = null) {
|
||||
return self::processWhereParameters($fieldname, $value, $type);
|
||||
}
|
||||
|
||||
public static function processWhereParameters($fieldname, $value = false, $type = null)
|
||||
{
|
||||
public static function processWhereParameters($fieldname, $value = false, $type = null, $mode = "AND") {
|
||||
$whereCond = "";
|
||||
if ($value !== false) {
|
||||
if (is_null($value)) {
|
||||
@@ -545,17 +506,16 @@ class Query
|
||||
} else {
|
||||
$whereCond .= self::process_whereParameters($cond[0]);
|
||||
}
|
||||
$whereCond .= " AND ";
|
||||
$whereCond .= " {$mode} ";
|
||||
}
|
||||
} else {
|
||||
$whereCond = $fieldname; // condizione fissa
|
||||
}
|
||||
|
||||
return strlen($whereCond) > 0 ? " (" . rtrim($whereCond, " AND ") . ") " : "";
|
||||
return strlen($whereCond) > 0 ? " (" . rtrim($whereCond, " {$mode} ") . ") " : "";
|
||||
}
|
||||
|
||||
public static function processWhereLikeParameters($fieldname, $value, $type = null)
|
||||
{/*
|
||||
public static function processWhereLikeParameters($fieldname, $value, $type = null) {/*
|
||||
if($type==\Format::strftimeYMD){
|
||||
$value = strftime(\Format::strftimeYMD, $value);
|
||||
|
||||
@@ -570,8 +530,7 @@ class Query
|
||||
return strlen($whereCond) > 0 ? " (" . rtrim($whereCond, " AND ") . ") " : "";
|
||||
}
|
||||
|
||||
public function whereNot($fieldname, $value = false, $type = null)
|
||||
{
|
||||
public function whereNot($fieldname, $value = false, $type = null) {
|
||||
if (is_array($fieldname)) {
|
||||
foreach ($fieldname as $_fieldname => $_value) {
|
||||
$this->whereNot($_fieldname, $_value);
|
||||
@@ -583,20 +542,17 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function whereDatetime($fieldname, $value = false)
|
||||
{
|
||||
public function whereDatetime($fieldname, $value = false) {
|
||||
$whereCond = self::process_whereParameters($fieldname, $value, Format::strftimeYMDHMS);
|
||||
return $this->whereAppend($whereCond);
|
||||
}
|
||||
|
||||
public function whereDate($fieldname, $value = false)
|
||||
{
|
||||
public function whereDate($fieldname, $value = false) {
|
||||
$whereCond = self::process_whereParameters($fieldname, $value, Format::strftimeYMD);
|
||||
return $this->whereAppend($whereCond);
|
||||
}
|
||||
|
||||
private function applyWhereCondDateComparison($fieldname, $value, $operator)
|
||||
{
|
||||
private function applyWhereCondDateComparison($fieldname, $value, $operator) {
|
||||
$value = \Utility\Date::isValidUnixtime($value) ? strftime(\Format::strftimeYMDHMS, $value) : null;
|
||||
if (!is_null($value)) {
|
||||
return $this->whereAppend("$fieldname $operator '{$value}'");
|
||||
@@ -610,8 +566,7 @@ class Query
|
||||
* @param string $fieldname nome colonna
|
||||
* @param int $value timestamp
|
||||
*/
|
||||
public function whereDateLT($fieldname, $value)
|
||||
{
|
||||
public function whereDateLT($fieldname, $value) {
|
||||
return $this->applyWhereCondDateComparison($fieldname, $value, "<");
|
||||
}
|
||||
|
||||
@@ -621,8 +576,7 @@ class Query
|
||||
* @param string $fieldname nome colonna
|
||||
* @param int $value timestamp
|
||||
*/
|
||||
public function whereDateLE($fieldname, $value)
|
||||
{
|
||||
public function whereDateLE($fieldname, $value) {
|
||||
return $this->applyWhereCondDateComparison($fieldname, $value, "<=");
|
||||
}
|
||||
|
||||
@@ -632,8 +586,7 @@ class Query
|
||||
* @param string $fieldname nome colonna
|
||||
* @param int $value timestamp
|
||||
*/
|
||||
public function whereDateGTE($fieldname, $value)
|
||||
{
|
||||
public function whereDateGTE($fieldname, $value) {
|
||||
return $this->applyWhereCondDateComparison($fieldname, $value, ">=");
|
||||
}
|
||||
|
||||
@@ -643,13 +596,11 @@ class Query
|
||||
* @param string $fieldname nome colonna
|
||||
* @param int $value timestamp
|
||||
*/
|
||||
public function whereDateGT($fieldname, $value)
|
||||
{
|
||||
public function whereDateGT($fieldname, $value) {
|
||||
return $this->applyWhereCondDateComparison($fieldname, $value, ">");
|
||||
}
|
||||
|
||||
public function where($fieldname, $value = false, $type = null)
|
||||
{
|
||||
public function where($fieldname, $value = false, $type = null, $mode = "AND") {
|
||||
if (is_array($fieldname)) {
|
||||
foreach ($fieldname as $key => $_value) {
|
||||
if (is_array($_value)) {
|
||||
@@ -662,27 +613,24 @@ class Query
|
||||
}
|
||||
|
||||
} else if (is_string($fieldname)) {
|
||||
$whereCond = self::processWhereParameters($fieldname, $value, $type);
|
||||
$this->whereAppend($whereCond);
|
||||
$whereCond = self::processWhereParameters($fieldname, $value, $type, $mode);
|
||||
$this->whereAppend($whereCond, $mode);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function whereLike($fieldname, $value = false, $type = null)
|
||||
{
|
||||
public function whereLike($fieldname, $value = false, $type = null, $mode = "AND") {
|
||||
$whereCond = self::processWhereLikeParameters($fieldname, $value, $type);
|
||||
return $this->whereAppend($whereCond);
|
||||
return $this->whereAppend($whereCond, $mode);
|
||||
}
|
||||
|
||||
private function whereAppend($whereCond)
|
||||
{
|
||||
$this->sql = self::addWhereCondToSql($whereCond, $this->sql);
|
||||
private function whereAppend($whereCond, $mode = "AND") {
|
||||
$this->sql = self::addWhereCondToSql($whereCond, $this->sql, $mode);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function addWhereCondToSql($whereCond, $sql)
|
||||
{ // non va sulle union
|
||||
public static function addWhereCondToSql($whereCond, $sql, $mode = "AND") { // non va sulle union
|
||||
if (!is_null($sql)) {
|
||||
$sql = rtrim($sql, ",");
|
||||
$keyword = "WHERE";
|
||||
@@ -690,7 +638,7 @@ class Query
|
||||
if ($wherePos !== false) { // HA WHERE
|
||||
$SQL_select_from = substr($sql, 0, $wherePos);
|
||||
$SQL_where = substr(substr($sql, $wherePos, strlen($sql)), strlen($keyword));
|
||||
$whereCond = " ({$whereCond}) AND ";
|
||||
$whereCond = " ({$whereCond}) {$mode} ";
|
||||
} else {
|
||||
$SQL_select_from = $sql;
|
||||
$SQL_where = "";
|
||||
@@ -701,18 +649,15 @@ class Query
|
||||
return null;
|
||||
}
|
||||
|
||||
public function setDateVar($key, $value)
|
||||
{
|
||||
public function setDateVar($key, $value) {
|
||||
return $this->setVar($key, $value, \Format::strftimeYMD);
|
||||
}
|
||||
|
||||
public function setDatetimeVar($key, $value)
|
||||
{
|
||||
public function setDatetimeVar($key, $value) {
|
||||
return $this->setVar($key, $value, \Format::strftimeYMDHMS);
|
||||
}
|
||||
|
||||
public function setVar($key, $value, $type = null)
|
||||
{
|
||||
public function setVar($key, $value, $type = null) {
|
||||
if (!is_null($this->sql)) {
|
||||
if (!is_null($type) && !is_null($value) && $type == \Format::strftimeYMD) {
|
||||
$value = strftime(\Format::strftimeYMD, $value);
|
||||
@@ -722,6 +667,8 @@ class Query
|
||||
|
||||
} else if (!is_null($type) && !is_null($value) && $type == \Format::latLng1) {
|
||||
|
||||
} else if (is_array($value)) {
|
||||
$value = implode("','", $value);
|
||||
}
|
||||
|
||||
$arr_pattern = array(
|
||||
@@ -754,8 +701,7 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function sqlToFileCache($filename = "")
|
||||
{
|
||||
private function sqlToFileCache($filename = "") {
|
||||
$Ret = $this->checkSql();
|
||||
if ($Ret->is_OK()) {
|
||||
$filename .= (strlen($filename) > 0 ? "_" : "") . date("Ymd-His") . ".sql";
|
||||
@@ -764,10 +710,9 @@ class Query
|
||||
return null;
|
||||
}
|
||||
|
||||
public function countRowsSql()
|
||||
{
|
||||
public function countRowsSql() {
|
||||
$Query = new Query("SELECT COUNT(*) AS counter FROM (" . $this->getSql() . ") TCOUNT");
|
||||
$Ret = $Query->firstRowFirstValue()->toRet()->execute();
|
||||
$Ret = $Query->profileDB($this->profileDB)->firstRowFirstValue()->toRet()->execute();
|
||||
if ($this->toRet === true) {
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_number($Ret->get_data())->set_data(null);
|
||||
@@ -781,13 +726,13 @@ class Query
|
||||
return $Ret->is_OK() ? $Ret->get_data() : false;
|
||||
}
|
||||
|
||||
public function countRows()
|
||||
{ // su tante richie(clienti fid anag, 200k) la memoria non cia fa
|
||||
$Query = new Query($this->getSql());
|
||||
$Ret = $Query->toRet()->cacheFile($this->cacheSqlFile)->execute();
|
||||
public function countRows() { // su tante richie(clienti fid anag, 200k) la memoria non cia fa
|
||||
// $Query = new Query($this->getSql());
|
||||
// $Ret = $Query->toRet()->cacheFile($this->cacheSqlFile)->execute();
|
||||
$Ret = $this->execute();
|
||||
if ($this->toRet === true) {
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_number(count($Ret->get_data()))->set_data(null);
|
||||
$Ret->set_number(count($Ret->get_data()))->set_data();
|
||||
}
|
||||
return $Ret;
|
||||
|
||||
@@ -796,12 +741,11 @@ class Query
|
||||
@Utility::send_debugMessage("sqlToRet3");
|
||||
}
|
||||
|
||||
return $Ret->is_OK() ? count($Ret->get_data()) : false;
|
||||
return count($Ret);
|
||||
}
|
||||
}
|
||||
|
||||
public function commit()
|
||||
{
|
||||
public function commit() {
|
||||
if ($this->autocommit === false && $this->db !== false) {
|
||||
$result = $this->db->commit();
|
||||
if ($result === false) {
|
||||
@@ -812,8 +756,7 @@ class Query
|
||||
return false;
|
||||
}
|
||||
|
||||
public function rollback()
|
||||
{
|
||||
public function rollback() {
|
||||
if ($this->autocommit === false && $this->db !== false) {
|
||||
$result = $this->db->rollback();
|
||||
if ($result === false) {
|
||||
@@ -824,8 +767,7 @@ class Query
|
||||
return false;
|
||||
}
|
||||
|
||||
public function begin_transaction()
|
||||
{
|
||||
public function begin_transaction() {
|
||||
$this->autocommit = false;
|
||||
if ($this->db !== false) {
|
||||
$this->db->begin_transaction();
|
||||
@@ -833,20 +775,37 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function processResource()
|
||||
{
|
||||
public function getColumnsTypes() {
|
||||
$arr_types = array();
|
||||
|
||||
if (isset($this->fieldsarray) && count($this->fieldsarray) > 0) {
|
||||
foreach ($this->fieldsarray as $i => $field) {
|
||||
$type = $this->db->field_type($i); //if($field=="content")exit($field. " ".$value." - ");
|
||||
$arr_types += array(
|
||||
$field => $type,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $arr_types;
|
||||
}
|
||||
|
||||
private function processResource() {
|
||||
$arr_rows = array();
|
||||
|
||||
while ($this->db->next_record()) {
|
||||
if ($this->db->Row == 1) { // LETTURA NOME COLONNE
|
||||
$this->fieldsarray = array();
|
||||
for ($i = 0; $i < $this->db->num_fields(); $i++) {
|
||||
$fieldsarray[] = $this->db->field_name($i);
|
||||
$this->fieldsarray[] = $this->db->field_name($i);
|
||||
}
|
||||
}
|
||||
foreach ($fieldsarray as $i => $field) { // LETTURA RIGA
|
||||
$row = array();// LETTURA RIGA
|
||||
foreach ($this->fieldsarray as $i => $field) {
|
||||
$value = $this->db->f($field);
|
||||
$type = $this->db->field_type($i); //if($field=="content")exit($field. " ".$value." - ");
|
||||
if (!is_null($value)) { // echo ' {'.$field.': '.$type.'}';
|
||||
if (in_array($type, array("int", "bigint", "smallint", "tinyint"))) {
|
||||
if (in_array($type, array("int", "bigint", "smallint", "tinyint", "bit"))) {
|
||||
$value = intval($value);
|
||||
|
||||
} else if (in_array($type, array("real", "decimal", "float", "numeric"))) {
|
||||
@@ -859,6 +818,8 @@ class Query
|
||||
}*/
|
||||
$value = strtotime($value);
|
||||
|
||||
} else if ($this->date2iso && in_array($type, array("date", "datetime"))) {
|
||||
$value = \Utility\Date::format(strtotime($value), Format::strftimeSlashedYMD);
|
||||
} else if (in_array($type, array("image"))) {
|
||||
if (self::getDriver() == "pdosqlsrv") {
|
||||
$value = \Utility\File::hex2bin($value);
|
||||
@@ -868,7 +829,7 @@ class Query
|
||||
$value = self::parse_pointValue($value);
|
||||
}// echo "{".$field.": ".$type."} ";
|
||||
|
||||
if ($this->date2ts === false && in_array($type, array("date", "datetime"))) {
|
||||
if (!$this->date2ts && !$this->date2iso && in_array($type, array("date", "datetime"))) {
|
||||
@Utility::send_debugMessage("sqlDatetime");
|
||||
}
|
||||
}
|
||||
@@ -902,8 +863,7 @@ class Query
|
||||
return $retValue;
|
||||
}
|
||||
|
||||
public function checkSyntax()
|
||||
{
|
||||
public function checkSyntax() {
|
||||
$Ret = $this->checkSql();
|
||||
if ($Ret->is_OK()) {
|
||||
$sql = "SET FMTONLY ON;" . $this->getSql() . ";SET FMTONLY OFF;";
|
||||
@@ -913,8 +873,7 @@ class Query
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
private function checkSql()
|
||||
{
|
||||
private function checkSql() {
|
||||
$Ret = new Ret;
|
||||
if (!is_null($this->sqlFilename)) {
|
||||
// NON LO IMPORTA (LO FA IN PRECEDENZA), LO RIPETE X VERIFICARE CHE SIA ANDATO A BUON FINE
|
||||
@@ -932,13 +891,11 @@ class Query
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
public function execute() {
|
||||
return $this->run();
|
||||
}
|
||||
|
||||
public function getConnection()
|
||||
{
|
||||
public function getConnection() {
|
||||
if ($this->db !== false) {
|
||||
return $this->db->getConnection();
|
||||
}
|
||||
@@ -965,13 +922,11 @@ class Query
|
||||
}
|
||||
}*/
|
||||
|
||||
public static function calcSqlHash($sql)
|
||||
{
|
||||
public static function calcSqlHash($sql) {
|
||||
return md5($sql);
|
||||
}
|
||||
|
||||
private function getCachedResult()
|
||||
{
|
||||
private function getCachedResult() {
|
||||
$sql = $this->getSql();
|
||||
$sqlHash = self::calcSqlHash($sql);
|
||||
if (isset($GLOBALS["QueryResult"]) && array_key_exists($sqlHash, $GLOBALS["QueryResult"])) {
|
||||
@@ -980,8 +935,7 @@ class Query
|
||||
return false;
|
||||
}
|
||||
|
||||
private function setCachedResult($value)
|
||||
{
|
||||
private function setCachedResult($value) {
|
||||
$sql = $this->getSql();
|
||||
$sqlHash = self::calcSqlHash($sql);
|
||||
if (!isset($GLOBALS["QueryResult"]) || !is_array($GLOBALS["QueryResult"])) {
|
||||
@@ -990,8 +944,7 @@ class Query
|
||||
$GLOBALS["QueryResult"][$sqlHash] = $value;
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
public function run() {
|
||||
$retValue = false;
|
||||
|
||||
$Ret = new Ret;
|
||||
@@ -1103,8 +1056,7 @@ class Query
|
||||
return $retValue;
|
||||
}
|
||||
|
||||
public function execute_multiSql($arr_sql)
|
||||
{
|
||||
public function execute_multiSql($arr_sql) {
|
||||
$Ret = new Ret;
|
||||
$this->begin_transaction();
|
||||
foreach ($arr_sql as $sql) {
|
||||
@@ -1122,13 +1074,11 @@ class Query
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function get_lastSqlMessage()
|
||||
{
|
||||
public function get_lastSqlMessage() {
|
||||
return $this->lastSqlMessage;
|
||||
}
|
||||
|
||||
public function exportToSqlInsert($tablename)
|
||||
{
|
||||
public function exportToSqlInsert($tablename) {
|
||||
$arr_res = $this->execute();
|
||||
$arr_sqlOut = array();
|
||||
if ($arr_res !== false) {
|
||||
@@ -1157,8 +1107,7 @@ class Query
|
||||
return $arr_sqlOut;
|
||||
}
|
||||
|
||||
private static function parse_pointValue($s)
|
||||
{ //$txt='POINT (40.9953441 17.2195846)';
|
||||
private static function parse_pointValue($s) { //$txt='POINT (40.9953441 17.2195846)';
|
||||
if (is_string($s)) {
|
||||
$re1 = '(POINT)'; # Word 1
|
||||
$re2 = '.*?'; # Non-greedy match on filler
|
||||
@@ -1182,21 +1131,18 @@ class Query
|
||||
return $s;
|
||||
}
|
||||
|
||||
public static function is_typeQuery($value)
|
||||
{
|
||||
public static function is_typeQuery($value) {
|
||||
return gettype($value) == "object" && (get_class($value) == "Query" || is_subclass_of($value, "Query"));
|
||||
}
|
||||
|
||||
public function addSelect($select)
|
||||
{
|
||||
public function addSelect($select) {
|
||||
if (!is_null($this->sql)) {
|
||||
$selectPos = strpos($this->sql, "SELECT");
|
||||
$this->sql = substr_replace($this->sql, " " . $select . ", \n\r", ($selectPos + 6), 0);
|
||||
}
|
||||
}
|
||||
|
||||
public function processSql($processSql = true)
|
||||
{
|
||||
public function processSql($processSql = true) {
|
||||
$this->processSql = $processSql;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -1,71 +1,72 @@
|
||||
<?php
|
||||
class RemoteModuleUrl{
|
||||
|
||||
class RemoteModuleUrl {
|
||||
private $profileDB = null;
|
||||
private $module = null;
|
||||
private $destPage = null;
|
||||
private $urlParamName = null;
|
||||
private $data = array();
|
||||
private $customQueryParams = array();
|
||||
|
||||
public function __construct(){
|
||||
|
||||
public function __construct() {
|
||||
$this->profileDB(User::get_current_profileDb())->urlParamName("d")->destPage("emailcheck.php");
|
||||
}
|
||||
|
||||
public function get_url(){
|
||||
|
||||
public function get_url() {
|
||||
$urlData = array(
|
||||
"profileDB" => $this->profileDB,
|
||||
"gest-lib" => $this->module,
|
||||
"data" => $this->data
|
||||
);
|
||||
|
||||
|
||||
$baseUrl = PVM::get_current_projectPublicUrl();
|
||||
if(PVM::isDevClient()){
|
||||
if (PVM::isDevClient()) {
|
||||
$protocol = PVM::get_protocol();
|
||||
$projectName = PVM::get_projectName();
|
||||
$baseUrl = $protocol."://localhost/{$projectName}/";
|
||||
$baseUrl = $protocol . "://localhost/{$projectName}/";
|
||||
}
|
||||
|
||||
|
||||
$params = $this->customQueryParams;
|
||||
if(!is_null($this->urlParamName)){
|
||||
if (!is_null($this->urlParamName)) {
|
||||
$params[$this->urlParamName] = Utility::B64JSON_stringify($urlData);
|
||||
}
|
||||
|
||||
return $baseUrl.$this->destPage."?".http_build_query($params);
|
||||
|
||||
return $baseUrl . $this->destPage . "?" . http_build_query($params);
|
||||
//return $baseUrl.$this->destPage."?".$this->urlParamName."=".Utility::B64JSON_stringify($urlData);
|
||||
}
|
||||
|
||||
public function profileDB($v){
|
||||
|
||||
public function profileDB($v) {
|
||||
$this->profileDB = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function urlParamName($v){
|
||||
|
||||
public function urlParamName($v) {
|
||||
$this->urlParamName = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function destPage($v){
|
||||
|
||||
public function destPage($v) {
|
||||
$this->destPage = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function module($v){
|
||||
|
||||
public function module($v) {
|
||||
$this->module = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function data($v){
|
||||
|
||||
public function data($v) {
|
||||
$this->data = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function appendCustomQueryParam($k, $v){
|
||||
|
||||
public function appendCustomQueryParam($k, $v) {
|
||||
$this->customQueryParams[$k] = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function redirectToModulo($v){
|
||||
return $this->destPage("login.php")->appendCustomQueryParam("ref", $v.".php");
|
||||
|
||||
public function redirectToModulo($v) {
|
||||
return $this->destPage("login.php")->appendCustomQueryParam("ref", $v . ".php");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,67 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Report;
|
||||
class Functions{
|
||||
|
||||
public static function parsePoliciesList($item){
|
||||
class Functions {
|
||||
|
||||
public static function parsePoliciesList($item) {
|
||||
$showToUsergroups = is_null(\nullIfBlank($item["show_to_usergroups"])) ? array() : explode(",", $item["show_to_usergroups"]);
|
||||
$hideToUsergroups = is_null(\nullIfBlank($item["hide_to_usergroups"])) ? array() : explode(",", $item["hide_to_usergroups"]);
|
||||
$showToUsers = is_null(\nullIfBlank($item["show_to_users"])) ? array() : explode(",", $item["show_to_users"]);
|
||||
$hideToUsers = is_null(\nullIfBlank($item["hide_to_users"])) ? array() : explode(",", $item["hide_to_users"]);
|
||||
|
||||
|
||||
return array(
|
||||
"G" => array("show" => $showToUsergroups, "hide" => $hideToUsergroups),
|
||||
"U" => array("show" => $showToUsers, "hide" => $hideToUsers)
|
||||
);
|
||||
}
|
||||
|
||||
public static function applyPolicies($item, $userName, $userGroup){
|
||||
|
||||
public static function applyPolicies($item, $userName, $userGroup) {
|
||||
$retData = array("G" => null, "U" => null);
|
||||
|
||||
|
||||
// PREPARAZIONE DELLE LISTE
|
||||
$parsedList = self::parsePoliciesList($item);
|
||||
$showToUsergroups = $parsedList["G"]["show"];
|
||||
$hideToUsergroups = $parsedList["G"]["hide"];
|
||||
$showToUsers = $parsedList["U"]["show"];
|
||||
$hideToUsers = $parsedList["U"]["hide"];
|
||||
|
||||
|
||||
//***** CONTROLLO GRUPPO *****//
|
||||
if(is_null($retData["G"]) && count($showToUsergroups)>0){
|
||||
if (is_null($retData["G"]) && count($showToUsergroups) > 0) {
|
||||
// REPORT/PARAMETRO DICHIARATO 'VISIBILE' PER GRUPPI SPECIFICI
|
||||
if(in_array($userGroup, $showToUsergroups)){
|
||||
if (in_array($userGroup, $showToUsergroups)) {
|
||||
$retData["G"] = true;
|
||||
// IL GRUPPO CORRENTE E' INCLUSO NELLA LISTA
|
||||
} else if(!in_array($userGroup, $showToUsergroups)){
|
||||
} else if (!in_array($userGroup, $showToUsergroups)) {
|
||||
$retData["G"] = false;
|
||||
// IL GRUPPO CORRENTE NON E' INCLUSO NELLA LISTA
|
||||
}
|
||||
}
|
||||
|
||||
if(is_null($retData["G"]) && count($hideToUsergroups)>0){
|
||||
if (is_null($retData["G"]) && count($hideToUsergroups) > 0) {
|
||||
// REPORT/PARAMETRO DICHIARATO 'NASCOSTO' PER GRUPPI SPECIFICI
|
||||
if(in_array($userGroup, $hideToUsergroups)){
|
||||
if (in_array($userGroup, $hideToUsergroups)) {
|
||||
$retData["G"] = false; // IL GRUPPO CORRENTE E' INCLUSO NELLA LISTA
|
||||
}
|
||||
}
|
||||
|
||||
//***** CONTROLLO SPECIFICO UTENTE *****//
|
||||
if(is_null($retData["U"]) && count($showToUsers)>0){
|
||||
if (is_null($retData["U"]) && count($showToUsers) > 0) {
|
||||
// REPORT/PARAMETRO DICHIARATO 'VISIBILE' PER UTENTI SPECIFICI
|
||||
if(in_array($userName, $showToUsers)){
|
||||
if (in_array($userName, $showToUsers)) {
|
||||
// L'UTENTE CORRENTE E' INCLUSO NELLA LISTA
|
||||
$retData["U"] = true;
|
||||
} else if(!in_array($userName, $showToUsers) && is_null($retData["G"])){
|
||||
} else if (!in_array($userName, $showToUsers) && is_null($retData["G"])) {
|
||||
// L'UTENTE CORRENTE NON E' INCLUSO NELLA LISTA, E NON E' ESPLICITAMENTE INCLUSO/ESCLUSO NELLA POLICY 'GRUPPO'
|
||||
$retData["U"] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(is_null($retData["U"]) && count($hideToUsers)>0){
|
||||
if (is_null($retData["U"]) && count($hideToUsers) > 0) {
|
||||
// REPORT/PARAMETRO DICHIARATO 'NASCOSTO' PER UTENTI SPECIFICI
|
||||
if(in_array($userName, $hideToUsers)){ // L'UTENTE CORRENTE E' INCLUSO NELLA LISTA
|
||||
if (in_array($userName, $hideToUsers)) { // L'UTENTE CORRENTE E' INCLUSO NELLA LISTA
|
||||
$retData["U"] = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $retData;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Report;
|
||||
class Parameter{
|
||||
class Parameter {
|
||||
const TYPE_TEXT = "text";
|
||||
const TYPE_DATESTATIC = "date_static";
|
||||
const TYPE_DATEDYNAMIC = "date_dynamic";
|
||||
@@ -8,10 +9,10 @@ class Parameter{
|
||||
const TYPE_MONOSELECT = "monoselect_sql";
|
||||
const TYPE_WHERE = "where_static";
|
||||
const TYPE_IMAGE = "image";
|
||||
|
||||
|
||||
public $expression = null;
|
||||
public $name = null;
|
||||
public $report_name = null;
|
||||
public $report_id = null;
|
||||
public $tipo = null;
|
||||
public $label = null;
|
||||
public $flag_visible = null;
|
||||
@@ -25,17 +26,17 @@ class Parameter{
|
||||
public $hide_to_usergroups = null;
|
||||
public $show_to_users = null;
|
||||
public $hide_to_users = null;
|
||||
|
||||
|
||||
public $sys_param = null;
|
||||
|
||||
|
||||
public $dependenceChildren = null;
|
||||
public $dependenceParents = null;
|
||||
|
||||
function __construct($array = null){
|
||||
if(!is_null($array)){
|
||||
|
||||
function __construct($array = null) {
|
||||
if (!is_null($array)) {
|
||||
$this->expression = $array["expression"];
|
||||
$this->name = $array["name"];
|
||||
$this->report_name = $array["report_name"];
|
||||
$this->report_id = $array["report_id"];
|
||||
$this->tipo = $array["tipo"];
|
||||
$this->label = $array["etichetta"];
|
||||
$this->flag_visible = $array["flag_visible"];
|
||||
@@ -45,50 +46,50 @@ class Parameter{
|
||||
$this->field_to_search = nullIfBlank($array["field_to_search"]);
|
||||
$this->obbl_groups = nullIfBlank($array["obbl_groups"]);
|
||||
$this->ordine = $array["ordine"];
|
||||
|
||||
|
||||
$this->show_to_usergroups = nullIfBlank($array["show_to_usergroups"]);
|
||||
$this->hide_to_usergroups = nullIfBlank($array["hide_to_usergroups"]);
|
||||
$this->show_to_users = nullIfBlank($array["show_to_users"]);
|
||||
$this->hide_to_users = nullIfBlank($array["hide_to_users"]);
|
||||
|
||||
|
||||
$this->sys_param = $array["sys_param"];
|
||||
|
||||
|
||||
$this->dependenceChildren = $this->get_dependenceChildren();
|
||||
$this->dependenceParents = $this->get_dependenceParents();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function get_dependenceChildren(){
|
||||
|
||||
private function get_dependenceChildren() {
|
||||
$Query = new \Query(self::get_sql_dependenceChildren());
|
||||
$Query->setVar("report_name", $this->report_name)
|
||||
->setVar("parameter_name", $this->name);
|
||||
$Query->setVar("report_id", $this->report_id)
|
||||
->setVar("parameter_name", $this->name);
|
||||
$Ret = $Query->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
$arr_dependenceChildren = array();
|
||||
foreach($arr_rows as $row){
|
||||
if(strpos(base64_decode($row["expression"]), "[[".$this->name."]]") !== false){
|
||||
foreach ($arr_rows as $row) {
|
||||
if (strpos(base64_decode($row["expression"]), "[[" . $this->name . "]]") !== false) {
|
||||
$arr_dependenceChildren[] = $row["name"];
|
||||
}
|
||||
}
|
||||
return count($arr_dependenceChildren)>0 ? $arr_dependenceChildren : null;
|
||||
return count($arr_dependenceChildren) > 0 ? $arr_dependenceChildren : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function get_dependenceParents(){
|
||||
|
||||
private function get_dependenceParents() {
|
||||
$expression = $this->get_expression();
|
||||
if(!is_null($expression)){
|
||||
if (!is_null($expression)) {
|
||||
preg_match_all("/\[\[.*?\]\]/", $expression, $m);
|
||||
$arr_parts = $m[0];
|
||||
if(count($arr_parts)>0){
|
||||
if (count($arr_parts) > 0) {
|
||||
$arr_parents = array();
|
||||
foreach($arr_parts as $part){
|
||||
foreach ($arr_parts as $part) {
|
||||
$parent_pname = str_replace("[[", "", str_replace("]]", "", $part)); // PRENDE NOME PARAMETRO
|
||||
if(!in_array($parent_pname, $arr_parents)){
|
||||
if (!in_array($parent_pname, $arr_parents)) {
|
||||
$arr_parents[] = $parent_pname;
|
||||
}
|
||||
}
|
||||
@@ -97,179 +98,180 @@ class Parameter{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function load_from_db($reportName, $parameterName){
|
||||
|
||||
public function load_from_db($reportId, $parameterName) {
|
||||
$sql = "SELECT *, CONVERT(TEXT, expression) AS expression, parameter_name AS name
|
||||
FROM wtb_jrepr
|
||||
WHERE report_name = '[report_name]' AND
|
||||
WHERE report_id = '[report_id]' AND
|
||||
parameter_name = '[parameter_name]'";
|
||||
$Query = new \Query($sql);
|
||||
$Ret = $Query->setVar("report_name", $reportName)->setVar("parameter_name", $parameterName)->toRet()->firstRow()->execute();
|
||||
if($Ret->is_OK()){
|
||||
$Ret = $Query->setVar("report_id", $reportId)->setVar("parameter_name", $parameterName)->toRet()->firstRow()->execute();
|
||||
if ($Ret->is_OK()) {
|
||||
$result = $Ret->get_data();
|
||||
if(!is_null($result)){
|
||||
if (!is_null($result)) {
|
||||
$result["sys_param"] = false; // fittizio, ininfluente in questa posizione
|
||||
return $this->__construct($result);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function process_groovyExpression($value, $class){
|
||||
if($class=="java.lang.String"){
|
||||
|
||||
public static function process_groovyExpression($value, $class) {
|
||||
if ($class == "java.lang.String") {
|
||||
return trim($value, "\"");
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function get_tipo(){
|
||||
|
||||
public function get_tipo() {
|
||||
return $this->tipo;
|
||||
}
|
||||
|
||||
public function get_expression(){
|
||||
if(!is_null($this->expression) && !$this->is_image()){
|
||||
|
||||
public function get_expression() {
|
||||
if (!is_null($this->expression) && !$this->is_image()) {
|
||||
return base64_decode($this->expression);
|
||||
}
|
||||
return $this->expression;
|
||||
}
|
||||
|
||||
public function set_expression($value){
|
||||
|
||||
public function set_expression($value) {
|
||||
$this->expression = !$this->is_image() ? base64_encode($value) : $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_fieldToSearch(){
|
||||
|
||||
public function get_fieldToSearch() {
|
||||
return $this->field_to_search;
|
||||
}
|
||||
|
||||
public function is_sysParam(){
|
||||
|
||||
public function is_sysParam() {
|
||||
return $this->sys_param;
|
||||
}
|
||||
|
||||
public function is_disabled(){
|
||||
|
||||
public function is_disabled() {
|
||||
return \boolValue($this->flag_disabled);
|
||||
}
|
||||
|
||||
private function process_value_dateStatic($value){
|
||||
if(strlen($value)>0){
|
||||
try{
|
||||
|
||||
private function process_value_dateStatic($value) {
|
||||
if (strlen($value) > 0) {
|
||||
try {
|
||||
return date($value);
|
||||
} catch(Exception $e){
|
||||
} catch (Exception $e) {
|
||||
return "-1";
|
||||
}
|
||||
}
|
||||
return ""; // strftime("%d/%m/%Y");
|
||||
}
|
||||
|
||||
public function is_weekPicker(){
|
||||
|
||||
public function is_weekPicker() {
|
||||
return substr($this->get_expression(), 0, 4) == "WEEK";
|
||||
}
|
||||
|
||||
public function process_value_dateDynamic($value, $format = "d/m/Y"){
|
||||
if($this->is_weekPicker()){
|
||||
|
||||
public function process_value_dateDynamic($value, $format = "d/m/Y") {
|
||||
if ($this->is_weekPicker()) {
|
||||
preg_match('#\((.*?)\)#', $value, $m); // estrae il valore dentro le parentesi
|
||||
$value = nullIfBlank($m[1]);
|
||||
}
|
||||
|
||||
if(!is_null($value) && strlen(trim($value))>0){
|
||||
try{
|
||||
|
||||
if (!is_null($value) && strlen(trim($value)) > 0) {
|
||||
try {
|
||||
$d = new \DateTime($value);
|
||||
return $d->format($format);
|
||||
} catch(Exception $e){
|
||||
} catch (Exception $e) {
|
||||
return "01/01/1970";
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$d = new \DateTime();
|
||||
return $d->format($format);
|
||||
}
|
||||
}
|
||||
|
||||
public function load_expressionResult(){
|
||||
|
||||
public function load_expressionResult() {
|
||||
$Ret = new \Ret;
|
||||
|
||||
|
||||
$expression = $this->get_expression();
|
||||
if(!is_null($expression)){
|
||||
if($this->is_dateStatic()){
|
||||
if (!is_null($expression)) {
|
||||
if ($this->is_dateStatic()) {
|
||||
$Ret->set_data($this->process_value_dateStatic($expression));
|
||||
|
||||
} else if($this->is_dateDynamic()){
|
||||
|
||||
} else if ($this->is_dateDynamic()) {
|
||||
$sel_arr = explode("<br />", nl2br($expression));
|
||||
|
||||
if(count($sel_arr)==1){ // DATA SINGOLA
|
||||
|
||||
if (count($sel_arr) == 1) { // DATA SINGOLA
|
||||
$Ret->set_data($this->process_value_dateDynamic($expression));
|
||||
|
||||
} else if(count($sel_arr)==2){ // INTERVALLO DI 2 DATE
|
||||
|
||||
} else if (count($sel_arr) == 2) { // INTERVALLO DI 2 DATE
|
||||
$data1 = $data2 = null;
|
||||
if(strpos($sel_arr[0], "|") !== false){
|
||||
if (strpos($sel_arr[0], "|") !== false) {
|
||||
list($data1, $descrVal1) = explode("|", $sel_arr[0]);
|
||||
} else{
|
||||
} else {
|
||||
$data1 = trim($sel_arr[0]);
|
||||
}
|
||||
if(strpos($sel_arr[1], '|') !== false){
|
||||
if (strpos($sel_arr[1], '|') !== false) {
|
||||
list($data2, $descrVal2) = explode("|", $sel_arr[1]);
|
||||
} else{
|
||||
} else {
|
||||
$data2 = trim($sel_arr[1]);
|
||||
}
|
||||
|
||||
|
||||
$Ret->set_data(array(
|
||||
$this->process_value_dateDynamic($data1),
|
||||
$this->process_value_dateDynamic($data2)
|
||||
));
|
||||
} else{
|
||||
));
|
||||
} else {
|
||||
$Ret->set_error("Valori dateDynamic non validi");
|
||||
}
|
||||
|
||||
} else if($this->is_text()){
|
||||
|
||||
} else if ($this->is_text()) {
|
||||
$sel_arr = explode("<br />", nl2br($expression));
|
||||
if(count($sel_arr)>1){
|
||||
if (count($sel_arr) > 1) {
|
||||
$result = array();
|
||||
foreach($sel_arr as $sel_opt){
|
||||
if(strpos($sel_opt, '|') !== false){
|
||||
foreach ($sel_arr as $sel_opt) {
|
||||
if (strpos($sel_opt, '|') !== false) {
|
||||
list($val, $descrVal) = explode("|", $sel_opt);
|
||||
} else{
|
||||
} else {
|
||||
$val = $descrVal = $sel_opt;
|
||||
}
|
||||
$val = $this->get_phpvar_value($val);
|
||||
$result[] = array("value" => $val, "descr" => $descrVal);
|
||||
}
|
||||
$Ret->set_data($result);
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$Ret->set_data($this->get_phpvar_value($expression));
|
||||
}
|
||||
|
||||
} else if($this->is_whereCond()){
|
||||
|
||||
} else if ($this->is_whereCond()) {
|
||||
$sel_arr = explode("<br />", nl2br($expression));
|
||||
if(count($sel_arr)>1){
|
||||
if (count($sel_arr) > 1) {
|
||||
$result = array();
|
||||
foreach($sel_arr as $sel_opt){
|
||||
if(strpos($sel_opt, '|') !== false){
|
||||
foreach ($sel_arr as $sel_opt) {
|
||||
if (strpos($sel_opt, '|') !== false) {
|
||||
list($val, $descrVal) = explode("|", $sel_opt);
|
||||
} else{
|
||||
} else {
|
||||
$val = $descrVal = trim($sel_opt);
|
||||
}
|
||||
$val = $this->replace_sql_phpvars_to_value($val);
|
||||
$result[] = array("value" => $val, "descr" => $descrVal);
|
||||
}
|
||||
$Ret->set_data($result);
|
||||
|
||||
} else{
|
||||
|
||||
} else {
|
||||
$expression = $this->replace_sql_phpvars_to_value($expression);
|
||||
$Ret->set_data($expression);//$Ret->set_data($this->get_phpvar_value($expression));
|
||||
}
|
||||
|
||||
} else if($this->is_monoSelect()){
|
||||
|
||||
} else if ($this->is_monoSelect()) {
|
||||
$Ret = $this->processMonoselect($expression);
|
||||
|
||||
} else if($this->is_multiSelect()){
|
||||
|
||||
} else if ($this->is_multiSelect()) {
|
||||
$Ret = $this->processMultiselect($expression);
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
$Ret->set_data($expression);
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
/*
|
||||
private function replaceSubstrIfStartsWith($haystack, $needle, $replaceWith){ // case insensitive
|
||||
if(\Utility\String::startsWith($haystack, $needle, false)){
|
||||
@@ -277,32 +279,32 @@ class Parameter{
|
||||
}
|
||||
return $haystack;
|
||||
}*/
|
||||
|
||||
public function processMultiselect($expression){
|
||||
|
||||
public function processMultiselect($expression) {
|
||||
$sql = $this->replace_sql_phpvars_to_value(str_replace("NOPREVIEW:", "", $expression));
|
||||
|
||||
|
||||
$GestSetup = new \GestSetup;
|
||||
$maxResults = $GestSetup->section("REPORT_AREA")->keySection("RESULT_LIMIT_MULTISELECT")->defaultValue(500)->asInt()->get();
|
||||
|
||||
|
||||
$arr_replacements = array(
|
||||
array("from" => "SELECT DISTINCT", "to" => "SELECT DISTINCT TOP {$maxResults}"),
|
||||
array("from" => "SELECT", "to" => "SELECT TOP {$maxResults}"),
|
||||
);
|
||||
|
||||
foreach($arr_replacements as $replacement){
|
||||
if(\Utility\Str::startsWith($sql, $replacement["from"], false)){
|
||||
$sql = $replacement["to"].substr(trim($sql), strlen($replacement["from"]));
|
||||
|
||||
foreach ($arr_replacements as $replacement) {
|
||||
if (\Utility\Str::startsWith($sql, $replacement["from"], false)) {
|
||||
$sql = $replacement["to"] . substr(trim($sql), strlen($replacement["from"]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$Query = new \Query;
|
||||
$Ret = $Query->setSql($sql)->toRet()->execute();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$rows = $Ret->get_data();
|
||||
foreach($rows as $i => $row){
|
||||
foreach($row as $key => $field){
|
||||
if($key != $this->name){
|
||||
foreach ($rows as $i => $row) {
|
||||
foreach ($row as $key => $field) {
|
||||
if ($key != $this->name) {
|
||||
$row[$key] = htmlentities($field);
|
||||
}
|
||||
}
|
||||
@@ -310,32 +312,32 @@ class Parameter{
|
||||
}
|
||||
$Ret->set_data($rows);
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function processMonoselect($expression){
|
||||
|
||||
public function processMonoselect($expression) {
|
||||
$expression = str_replace("NOPREVIEW:", "", $expression);
|
||||
$sql = $this->replace_sql_phpvars_to_value(str_replace("MONOSELECT:", "", $expression));
|
||||
|
||||
|
||||
$Query = new \Query($sql);
|
||||
$Ret = $Query->toRet()->date2ts()->execute();
|
||||
$retData = array();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
if(count($arr_rows)>0){
|
||||
if(isset($arr_rows[0][$this->name])){
|
||||
if (count($arr_rows) > 0) {
|
||||
if (isset($arr_rows[0][$this->name])) {
|
||||
|
||||
// SELEZIONO NOME COLONNA DESCRITTIVA
|
||||
$descr_columnName = $this->name;
|
||||
foreach($arr_rows[0] as $key => $value){
|
||||
if($key!=$this->name){
|
||||
foreach ($arr_rows[0] as $key => $value) {
|
||||
if ($key != $this->name) {
|
||||
$descr_columnName = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($arr_rows as $row){
|
||||
|
||||
foreach ($arr_rows as $row) {
|
||||
$retData[] = array(
|
||||
"value" => $row[$this->name],
|
||||
"descr" => htmlentities($row[$descr_columnName])
|
||||
@@ -344,86 +346,86 @@ class Parameter{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $Ret->set_data($retData);
|
||||
}
|
||||
|
||||
public function replace_sql_phpvars_to_value($sql){
|
||||
|
||||
public function replace_sql_phpvars_to_value($sql) {
|
||||
preg_match_all('~{(.+?)}~', $sql, $m);
|
||||
$values = $m[1];
|
||||
foreach($values as $val){
|
||||
$varname = '{'.$val.'}';
|
||||
foreach ($values as $val) {
|
||||
$varname = '{' . $val . '}';
|
||||
$sql = str_replace($varname, $this->get_phpvar_value($val), $sql);
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
|
||||
private function get_phpvar_value($string){
|
||||
if(strlen(trim($string))>0){
|
||||
if(strpos($string, '$_SESSION[') !== false){ // PRENDE UNA VARIABILE DI SESSIONE
|
||||
|
||||
private function get_phpvar_value($string) {
|
||||
if (strlen(trim($string)) > 0) {
|
||||
if (strpos($string, '$_SESSION[') !== false) { // PRENDE UNA VARIABILE DI SESSIONE
|
||||
$string = str_replace('$_SESSION[', "", str_replace(']', "", $string));
|
||||
$string = str_replace('"', "", str_replace("'", "", $string));
|
||||
$string = $_SESSION[trim($string)];
|
||||
} else if($string{0}=="$"){ // PRENDE UNA VARIABILE DEL CODICE
|
||||
$string = substr($string, 1);
|
||||
$string = $GLOBALS[$string];
|
||||
} else if ($string{0} == "$") { // PRENDE UNA VARIABILE DEL CODICE
|
||||
$string = substr($string, 1);
|
||||
$string = $GLOBALS[$string];
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function is_text(){
|
||||
|
||||
public function is_text() {
|
||||
return !is_null($this->tipo) && $this->tipo == self::TYPE_TEXT;
|
||||
}
|
||||
|
||||
public function is_multiSelect(){
|
||||
|
||||
public function is_multiSelect() {
|
||||
return !is_null($this->tipo) && $this->tipo == self::TYPE_MULTISELECT;
|
||||
}
|
||||
|
||||
public function is_monoSelect(){
|
||||
|
||||
public function is_monoSelect() {
|
||||
return !is_null($this->tipo) && $this->tipo == self::TYPE_MONOSELECT;
|
||||
}
|
||||
|
||||
public function is_date(){
|
||||
|
||||
public function is_date() {
|
||||
return $this->is_dateStatic() || $this->is_dateDynamic();
|
||||
}
|
||||
|
||||
public function is_dateStatic(){
|
||||
|
||||
public function is_dateStatic() {
|
||||
return !is_null($this->tipo) && $this->tipo == self::TYPE_DATESTATIC;
|
||||
}
|
||||
|
||||
public function is_dateDynamic(){
|
||||
|
||||
public function is_dateDynamic() {
|
||||
return !is_null($this->tipo) && $this->tipo == self::TYPE_DATEDYNAMIC;
|
||||
}
|
||||
|
||||
public function is_whereCond(){
|
||||
|
||||
public function is_whereCond() {
|
||||
return !is_null($this->tipo) && $this->tipo == self::TYPE_WHERE;
|
||||
}
|
||||
|
||||
public function is_image(){
|
||||
|
||||
public function is_image() {
|
||||
return !is_null($this->tipo) && $this->tipo == self::TYPE_IMAGE;
|
||||
}
|
||||
|
||||
public function is_visible(){
|
||||
|
||||
public function is_visible() {
|
||||
return \boolValue($this->flag_visible);
|
||||
}
|
||||
|
||||
public function is_editable(){
|
||||
|
||||
public function is_editable() {
|
||||
return \boolValue($this->flag_editable);
|
||||
}
|
||||
|
||||
public function get_obblGroups(){
|
||||
|
||||
public function get_obblGroups() {
|
||||
return $this->obbl_groups;
|
||||
}
|
||||
|
||||
|
||||
// <editor-fold desc="SQL dependence-children" defaultstate="collapsed">
|
||||
private static function get_sql_dependenceChildren(){
|
||||
private static function get_sql_dependenceChildren() {
|
||||
return "SELECT CONVERT(TEXT, expression) AS expression,
|
||||
parameter_name AS name
|
||||
FROM wtb_jrepr
|
||||
WHERE report_name = '[report_name]' AND
|
||||
tipo IN ('".self::TYPE_MULTISELECT."', '".self::TYPE_MONOSELECT."', '".self::TYPE_TEXT."') AND
|
||||
WHERE report_id = [report_id] AND
|
||||
tipo IN ('" . self::TYPE_MULTISELECT . "', '" . self::TYPE_MONOSELECT . "', '" . self::TYPE_TEXT . "') AND
|
||||
parameter_name <> '[parameter_name]' AND
|
||||
flag_disabled = 'N'";
|
||||
}
|
||||
|
||||
@@ -1,97 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Report\Processor;
|
||||
class DtbDocPdf extends \Report\Processor{
|
||||
class DtbDocPdf extends \Report\Processor {
|
||||
private $dataDoc = null;
|
||||
private $serDoc = null;
|
||||
private $numDoc = null;
|
||||
private $codAnag = null;
|
||||
private $codDtip = null;
|
||||
|
||||
public function __construct($key = null){
|
||||
if(!is_null($key)){
|
||||
|
||||
public function __construct($key = null) {
|
||||
if (!is_null($key)) {
|
||||
$this->setKeyDoc($key);
|
||||
}
|
||||
}
|
||||
|
||||
public function setKeyDoc($key){
|
||||
if(isset($key["data_doc"])){
|
||||
|
||||
public function setKeyDoc($key) {
|
||||
if (isset($key["data_doc"])) {
|
||||
$this->dataDoc($key["data_doc"]);
|
||||
}
|
||||
if(isset($key["ser_doc"])){
|
||||
if (isset($key["ser_doc"])) {
|
||||
$this->serDoc($key["ser_doc"]);
|
||||
}
|
||||
if(isset($key["num_doc"])){
|
||||
if (isset($key["num_doc"])) {
|
||||
$this->numDoc($key["num_doc"]);
|
||||
}
|
||||
if(isset($key["cod_anag"])){
|
||||
if (isset($key["cod_anag"])) {
|
||||
$this->codAnag($key["cod_anag"]);
|
||||
}
|
||||
if(isset($key["cod_dtip"])){
|
||||
if (isset($key["cod_dtip"])) {
|
||||
$this->codDtip($key["cod_dtip"]);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function dataDoc($v){
|
||||
|
||||
public function dataDoc($v) {
|
||||
$this->dataDoc = $v;
|
||||
return $this;
|
||||
}
|
||||
public function serDoc($v){
|
||||
|
||||
public function serDoc($v) {
|
||||
$this->serDoc = $v;
|
||||
return $this;
|
||||
}
|
||||
public function numDoc($v){
|
||||
|
||||
public function numDoc($v) {
|
||||
$this->numDoc = $v;
|
||||
return $this;
|
||||
}
|
||||
public function codAnag($v){
|
||||
|
||||
public function codAnag($v) {
|
||||
$this->codAnag = $v;
|
||||
return $this;
|
||||
}
|
||||
public function codDtip($v){
|
||||
|
||||
public function codDtip($v) {
|
||||
$this->codDtip = $v;
|
||||
return $this;
|
||||
}
|
||||
public function reportName($v){
|
||||
|
||||
public function reportName($v) {
|
||||
$this->setReport($v);
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function checkParameters(){
|
||||
|
||||
private function checkParameters() {
|
||||
return !is_null($this->dataDoc) && !is_null($this->serDoc) && !is_null($this->numDoc) && !is_null($this->codAnag) && !is_null($this->codDtip);
|
||||
}
|
||||
|
||||
private function process(){
|
||||
|
||||
private function process() {
|
||||
$Ret = new \Ret;
|
||||
if($this->checkParameters()){
|
||||
if ($this->checkParameters()) {
|
||||
$Ret = $this->processJasper();
|
||||
|
||||
} else{
|
||||
$Ret->set_error("I parametri Report\Processor\DtbDocPdf sono incompleti");
|
||||
|
||||
} else {
|
||||
$Ret->set_error("I parametri Report\Processor\DtbDocPdf sono incompleti");
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public function backup(){
|
||||
|
||||
public function backup() {
|
||||
$Ret = $this->process();
|
||||
if($Ret->is_OK()){
|
||||
if ($Ret->is_OK()) {
|
||||
$fileContent = $Ret->get_byte();
|
||||
|
||||
$DtbDocPdf = new \EntityItem("dtb_doc_pdf");
|
||||
$DtbDocPdf->insert()
|
||||
->setDate("dataDoc", $this->dataDoc)
|
||||
->set("numDoc", $this->numDoc)
|
||||
->set("serDoc", $this->serDoc)
|
||||
->set("codDtip", $this->codDtip)
|
||||
->set("codAnag", $this->codAnag)
|
||||
->set("utente", \User::get_current_username())
|
||||
->set("filesize", \Utility::blobSize($fileContent))
|
||||
->set("filecontent", base64_encode(\Utility\Compression\GZ::compress($fileContent)));
|
||||
->setDate("dataDoc", $this->dataDoc)
|
||||
->set("numDoc", $this->numDoc)
|
||||
->set("serDoc", $this->serDoc)
|
||||
->set("codDtip", $this->codDtip)
|
||||
->set("codAnag", $this->codAnag)
|
||||
->set("utente", \User::get_current_username())
|
||||
->set("filesize", \Utility::blobSize($fileContent))
|
||||
->set("filecontent", base64_encode(\Utility\Compression\GZ::compress($fileContent)));
|
||||
$Ret = $DtbDocPdf->send();
|
||||
}
|
||||
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user