mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Compare commits
447 Commits
3.1.1-1
...
faf/improv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
470ccd72f5 | ||
|
|
2d5cd7042a | ||
|
|
7b01108c91 | ||
|
|
3b9ca4ad18 | ||
|
|
59129bc3ce | ||
|
|
eddc750ca8 | ||
|
|
f3abe1ff13 | ||
|
|
473cf004b6 | ||
|
|
90a5a7a9a7 | ||
|
|
5574952033 | ||
|
|
1a8de82be5 | ||
|
|
d15a0a0070 | ||
|
|
76167a3d54 | ||
|
|
46273dfc12 | ||
|
|
24f1cf8ca1 | ||
|
|
2a5337d84c | ||
|
|
fbe7f559d2 | ||
|
|
c8810708ef | ||
|
|
e8c11f38d2 | ||
|
|
1394bc221d | ||
|
|
baa05ba8d4 | ||
|
|
e7b493dafa | ||
|
|
940833a66f | ||
|
|
2b172d6e19 | ||
|
|
69677954b4 | ||
|
|
9c35cddfc0 | ||
|
|
86bf6ba0b0 | ||
|
|
82e19f6eca | ||
|
|
8f1d8b1dc2 | ||
|
|
b67057c863 | ||
|
|
0546a7b82b | ||
|
|
3d360e99da | ||
|
|
3cc3f0e4ff | ||
|
|
b6230ed486 | ||
|
|
123dfd8dd3 | ||
|
|
e9bd76f2cd | ||
|
|
47f7dfeb47 | ||
|
|
405919f204 | ||
|
|
b7f43ba22b | ||
|
|
b813a32225 | ||
|
|
b13e0c92a5 | ||
|
|
a6e5f95ff4 | ||
|
|
2e5f0b064c | ||
|
|
a9f6e86381 | ||
|
|
c6548ace61 | ||
|
|
aa81c94dad | ||
|
|
478afb88e3 | ||
|
|
7c17957ec7 | ||
|
|
ba0a585256 | ||
|
|
f41f2a063d | ||
|
|
d7e9ae1a77 | ||
|
|
dd6a138ea1 | ||
|
|
b6caa51552 | ||
|
|
8a67ceff57 | ||
|
|
095c94a917 | ||
|
|
102a4a0c75 | ||
|
|
f6fec506b1 | ||
|
|
829d82dfe3 | ||
|
|
5fdf8d7687 | ||
|
|
1ddf8b419a | ||
|
|
7d0801f74f | ||
|
|
3b9f281afd | ||
|
|
c718fcf176 | ||
|
|
bcba666483 | ||
|
|
ec465174f7 | ||
|
|
2982911df7 | ||
|
|
9f675fef02 | ||
|
|
c7cb7c0b68 | ||
|
|
68f229f91c | ||
|
|
1d106eb33a | ||
|
|
31bd763b90 | ||
|
|
5c12151c26 | ||
|
|
ceba1ad1e9 | ||
|
|
efe5f004a1 | ||
|
|
b716a3965c | ||
|
|
15fa495458 | ||
|
|
1dfb2e0a1a | ||
|
|
d775658980 | ||
|
|
2bd40bef47 | ||
|
|
961315cf34 | ||
|
|
67d43c19ec | ||
|
|
2695aeb64b | ||
|
|
95fef002a6 | ||
|
|
9777ac1a5c | ||
|
|
9e24447835 | ||
|
|
296250b20f | ||
|
|
38601bf0cf | ||
|
|
9f46aad80a | ||
|
|
ba0020fa63 | ||
|
|
1e83f2eb60 | ||
|
|
dd27a3ebb4 | ||
|
|
54439ad529 | ||
|
|
a492f7a664 | ||
|
|
85a49262e9 | ||
|
|
2c61ac4949 | ||
|
|
8f7bf00551 | ||
|
|
0483cea226 | ||
|
|
922a842e96 | ||
|
|
955d04252e | ||
|
|
95c4a93f2e | ||
|
|
e4f068a518 | ||
|
|
c020de59a7 | ||
|
|
85dac470aa | ||
|
|
3c2350961d | ||
|
|
391c78ae42 | ||
|
|
aa53de467d | ||
|
|
bc6efc99ed | ||
|
|
bb3ab76205 | ||
|
|
0b1bdfff55 | ||
|
|
77c0cdf5aa | ||
|
|
af9fb74c54 | ||
|
|
5d6c4939f6 | ||
|
|
41eb927480 | ||
|
|
5663c61e51 | ||
|
|
bec5e250a5 | ||
|
|
51d0d16a11 | ||
|
|
9fe45e9472 | ||
|
|
78133418d7 | ||
|
|
8275de8fa7 | ||
|
|
ba7c154e84 | ||
|
|
d2b0140fa4 | ||
|
|
5c4ba74237 | ||
|
|
848528567e | ||
|
|
b0634c9fbc | ||
|
|
7f4b50ca7f | ||
|
|
fabeea8dba | ||
|
|
c951a33646 | ||
|
|
e7687a0fe6 | ||
|
|
5dd5986b88 | ||
|
|
8f250e82f4 | ||
|
|
ed694b09b0 | ||
|
|
3e0ca6a70a | ||
|
|
3b08ed5f51 | ||
|
|
41dcb26283 | ||
|
|
d4879b9bd8 | ||
|
|
87856fe382 | ||
|
|
205a37a879 | ||
|
|
e830c90314 | ||
|
|
5308b49cd2 | ||
|
|
216ea34a3c | ||
|
|
0a9c5250f8 | ||
|
|
0e91c75dc2 | ||
|
|
cf996dda0b | ||
|
|
21638e6a9e | ||
|
|
272d6e9b66 | ||
|
|
87b08669d7 | ||
|
|
de86682562 | ||
|
|
25c2e34eed | ||
|
|
e92b006f70 | ||
|
|
962eb08e40 | ||
|
|
6342e0065a | ||
|
|
ac44ffcdff | ||
|
|
dfb5a4875a | ||
|
|
ddce3058be | ||
|
|
9235c395b4 | ||
|
|
e1296105f9 | ||
|
|
38cdcf4f61 | ||
|
|
5623decdb3 | ||
|
|
0f39ea8ac7 | ||
|
|
f3d3ec6ef7 | ||
|
|
fde01d5004 | ||
|
|
71d9710322 | ||
|
|
7a5ce8cd6b | ||
|
|
18deb79068 | ||
|
|
16b3e62587 | ||
|
|
6c1edadc55 | ||
|
|
8928a87b14 | ||
|
|
8eca200023 | ||
|
|
865b6d14f0 | ||
|
|
b63af9b919 | ||
|
|
4d4cdf9e60 | ||
|
|
3868d57d28 | ||
|
|
1b3a2c8470 | ||
|
|
618d8e6468 | ||
|
|
53a2a7a8e2 | ||
|
|
9a26c37ffd | ||
|
|
1e3ef6846d | ||
|
|
31225b9e23 | ||
|
|
436b6808b5 | ||
|
|
cc5e105d7f | ||
|
|
7f62bd61e3 | ||
|
|
aecc34a78b | ||
|
|
72bbc31cd9 | ||
|
|
f54d1273c9 | ||
|
|
01a955a16f | ||
|
|
ed99433448 | ||
|
|
669e6f93fa | ||
|
|
a5aac0caad | ||
|
|
31e29506fa | ||
|
|
df9d71e2f5 | ||
|
|
3005bc1234 | ||
|
|
3f3b0cbe55 | ||
|
|
cff50f8732 | ||
|
|
a8cd9566ac | ||
|
|
dab03e5b5d | ||
|
|
5935800b21 | ||
|
|
87582a021b | ||
|
|
200cdefa1a | ||
|
|
8ef04bedf2 | ||
|
|
9eeb4b8751 | ||
|
|
ae3d0f9444 | ||
|
|
9ddb82073c | ||
|
|
1fa4fe6d35 | ||
|
|
2ed0666c3b | ||
|
|
51fdd04881 | ||
|
|
9b5988133b | ||
|
|
a61b117f71 | ||
|
|
9830178a47 | ||
|
|
83ac219ec9 | ||
|
|
c140ebcb6b | ||
|
|
d721632f2b | ||
|
|
fddf9e36c7 | ||
|
|
b181914d25 | ||
|
|
7a0a4e377b | ||
|
|
7fffbb60e9 | ||
|
|
dfd5a5bebc | ||
|
|
490f8600e5 | ||
|
|
03b095f246 | ||
|
|
b3be796277 | ||
|
|
b3f2232ba4 | ||
|
|
ef083d5e8f | ||
|
|
73c989ee67 | ||
|
|
bfb05d331e | ||
|
|
e8c371174c | ||
|
|
b8892e9651 | ||
|
|
8cde0ce5c5 | ||
|
|
2fd9523c16 | ||
|
|
18887bf7f9 | ||
|
|
a32dd779cb | ||
|
|
fad5571d9b | ||
|
|
48c4e2d13d | ||
|
|
3607748f49 | ||
|
|
5b2b9c92e1 | ||
|
|
a4f6f6e877 | ||
|
|
68fa3d0236 | ||
|
|
abb3ea3272 | ||
|
|
1de390a24d | ||
|
|
96d4aac650 | ||
|
|
20478958ad | ||
|
|
5726a61861 | ||
|
|
5619586645 | ||
|
|
773762bb99 | ||
|
|
34499a719f | ||
|
|
26f600542b | ||
|
|
ba99f8f5a4 | ||
|
|
8092f566a5 | ||
|
|
6724658181 | ||
|
|
379062f1f7 | ||
|
|
3f365885f0 | ||
|
|
48fe808adf | ||
|
|
c61fa7b92f | ||
|
|
135d410a6b | ||
|
|
6042e7f74d | ||
|
|
cb64dbe79f | ||
|
|
5e233f4bec | ||
|
|
f1d5f8635c | ||
|
|
19c93249e3 | ||
|
|
a1e2b648f4 | ||
|
|
9af08fa693 | ||
|
|
05db99aa69 | ||
|
|
2681abbeed | ||
|
|
94c604a6af | ||
|
|
031c90e797 | ||
|
|
34f0053db7 | ||
|
|
f84e2060be | ||
|
|
6995a3c641 | ||
|
|
afbdff928d | ||
|
|
e007e09155 | ||
|
|
4ee70cb95a | ||
|
|
9865bf0779 | ||
|
|
34ad18eee8 | ||
|
|
e73fcc5903 | ||
|
|
2144933927 | ||
|
|
0c467e7115 | ||
|
|
300ec74f76 | ||
|
|
326a115936 | ||
|
|
b962488954 | ||
|
|
b5c8c75c4e | ||
|
|
e2574a0738 | ||
|
|
3fb5c05467 | ||
|
|
0c100ea2de | ||
|
|
be99a7c02d | ||
|
|
17d131a9b1 | ||
|
|
4a164f9c01 | ||
|
|
45c50995e3 | ||
|
|
fb29ff29cf | ||
|
|
fc2be85c95 | ||
|
|
e748d72c03 | ||
|
|
62d7e10257 | ||
|
|
9ac823c0ba | ||
|
|
1c09a7c38e | ||
|
|
8e2e155e65 | ||
|
|
45a806ac77 | ||
|
|
427646a0c3 | ||
|
|
34e6e921ec | ||
|
|
a41c58ebb4 | ||
|
|
beb015b082 | ||
|
|
4dfd9b062e | ||
|
|
27ce51ab07 | ||
|
|
863ab4560c | ||
|
|
c27c99b245 | ||
|
|
d1531c5a80 | ||
|
|
75f8c428b3 | ||
|
|
4fb581c784 | ||
|
|
7b15103880 | ||
|
|
bf3de38214 | ||
|
|
8c4c2b2ee4 | ||
|
|
add500193b | ||
|
|
8dff590fe2 | ||
|
|
ccfc29a6a9 | ||
|
|
f0ce091809 | ||
|
|
5aaaeda6c5 | ||
|
|
3bdb883f1c | ||
|
|
fbd69f6d3a | ||
|
|
f736634c3e | ||
|
|
4b19911e12 | ||
|
|
e73f2c9a30 | ||
|
|
87bb3d17a9 | ||
|
|
33596249a1 | ||
|
|
26beeb6a80 | ||
|
|
982b3aa5f3 | ||
|
|
8e179f0563 | ||
|
|
95e0f02cae | ||
|
|
c0b1e877ad | ||
|
|
444c9e0589 | ||
|
|
fb0f692c73 | ||
|
|
90a0e50e75 | ||
|
|
ad0795da02 | ||
|
|
65674b9cc4 | ||
|
|
ad0fa6636b | ||
|
|
67650012ce | ||
|
|
d00137026a | ||
|
|
12a1321bc1 | ||
|
|
c41ecb1b9d | ||
|
|
770bf4c42a | ||
|
|
d5f054b739 | ||
|
|
473c4cf3fa | ||
|
|
347156f900 | ||
|
|
76b70684cd | ||
|
|
336b5da2a7 | ||
|
|
6f39ae5d76 | ||
|
|
078fc7bfb8 | ||
|
|
a67d095c70 | ||
|
|
647f43882b | ||
|
|
ca47f5458c | ||
|
|
3027bb5092 | ||
|
|
893efa8e2d | ||
|
|
1ea9659227 | ||
|
|
31e58d7597 | ||
|
|
3b21ed8fe8 | ||
|
|
0ad8db565d | ||
|
|
a1a83a1ba3 | ||
|
|
e7d11e4bec | ||
|
|
e3c26c97f2 | ||
|
|
d6e132fbda | ||
|
|
74c4c642eb | ||
|
|
af3be19175 | ||
|
|
ee49d64120 | ||
|
|
58257fa25e | ||
|
|
cb3d8120bd | ||
|
|
ace88cb709 | ||
|
|
8ca20e3135 | ||
|
|
4e13cce770 | ||
|
|
f408e14d4b | ||
|
|
543daac06d | ||
|
|
800d1b03c1 | ||
|
|
9b970a472f | ||
|
|
593131a7ea | ||
|
|
148f708360 | ||
|
|
7d0feab078 | ||
|
|
aae2db8ad8 | ||
|
|
f3d488de26 | ||
|
|
ebc15db75e | ||
|
|
dd28aca260 | ||
|
|
2a6e5b21a9 | ||
|
|
14f6ce3626 | ||
|
|
34a2a6ce03 | ||
|
|
db940e3bba | ||
|
|
9f3a6be255 | ||
|
|
b6ac92d192 | ||
|
|
ce1c517a9f | ||
|
|
75b6a3ede8 | ||
|
|
3818bc3f98 | ||
|
|
d8ec900933 | ||
|
|
29ba5e73fa | ||
|
|
acf449c03a | ||
|
|
ecb4cb7435 | ||
|
|
3200b5dc86 | ||
|
|
e20d4cecd5 | ||
|
|
36177e09f7 | ||
|
|
9ae62adff1 | ||
|
|
73a2c935a7 | ||
|
|
42acbe66c3 | ||
|
|
22a9299d97 | ||
|
|
b9acd0a9a6 | ||
|
|
c761364bed | ||
|
|
d79dacf8a3 | ||
|
|
efc36e12bc | ||
|
|
5a0b12f078 | ||
|
|
22d04cb9fc | ||
|
|
d8da119c56 | ||
|
|
a24d50d7e3 | ||
|
|
e5716e66bb | ||
|
|
c6c2bb33ed | ||
|
|
0d0ef86550 | ||
|
|
ca0bd674a7 | ||
|
|
260b2e0bd6 | ||
|
|
90413ae4fe | ||
|
|
b7466e3206 | ||
|
|
f2812cdbe5 | ||
|
|
95a2fdec99 | ||
|
|
6880c49a32 | ||
|
|
1b48b4a1e1 | ||
|
|
0516100aae | ||
|
|
5b4079ab7e | ||
|
|
d284d629a4 | ||
|
|
c52195e6cd | ||
|
|
a61734a6f8 | ||
|
|
750ecd4804 | ||
|
|
781c15d1ee | ||
|
|
a1499a04d4 | ||
|
|
fb23bddeb2 | ||
|
|
aa6fa4c674 | ||
|
|
19e7fc9cb9 | ||
|
|
a0a66f3b54 | ||
|
|
3c9c13a371 | ||
|
|
96d04e35f9 | ||
|
|
629a8412dc | ||
|
|
19a83bc944 | ||
|
|
a59dacf679 | ||
|
|
8b93a404ef | ||
|
|
ded204344d | ||
|
|
b3121d46c4 | ||
|
|
f60d03ddd3 | ||
|
|
3d8345b92c | ||
|
|
9ab928e92e | ||
|
|
ea56939b7a | ||
|
|
6caddb65e9 | ||
|
|
8df0d66fb6 | ||
|
|
a80aa20b23 | ||
|
|
fd336ffd92 | ||
|
|
be1c559ad4 | ||
|
|
2dce37f289 | ||
|
|
22b5eef4ce | ||
|
|
63426e459a | ||
|
|
8393172ad2 | ||
|
|
cc06afc6df |
@@ -1,7 +1,14 @@
|
|||||||
# iTop version history
|
# iTop version history
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true,'mainBranchName': 'develop','rotateCommitLabel': true}} }%%
|
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'themeVariables': {
|
||||||
|
'git0': 'lawngreen',
|
||||||
|
'git3': 'dodgerblue',
|
||||||
|
'git4': 'grey',
|
||||||
|
'git5': 'grey',
|
||||||
|
'git6': 'grey',
|
||||||
|
'git7': 'grey'
|
||||||
|
}, 'gitGraph': {'showBranches': true,'mainBranchName': 'develop','rotateCommitLabel': true}} }%%
|
||||||
gitGraph
|
gitGraph
|
||||||
commit id: "2016-07-06" tag: "2.3.0" type: HIGHLIGHT
|
commit id: "2016-07-06" tag: "2.3.0" type: HIGHLIGHT
|
||||||
branch support/2.3 order: 900
|
branch support/2.3 order: 900
|
||||||
@@ -68,6 +75,10 @@ gitGraph
|
|||||||
branch support/3.1 order: 840
|
branch support/3.1 order: 840
|
||||||
checkout support/3.1
|
checkout support/3.1
|
||||||
commit id: "2023-08-09" tag: "3.1.0-2"
|
commit id: "2023-08-09" tag: "3.1.0-2"
|
||||||
|
checkout support/2.7
|
||||||
|
commit id: "2023-08-10" tag: "2.7.9"
|
||||||
|
checkout support/3.1
|
||||||
|
commit id: "2023-12-20" tag: "3.1.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
To learn more, check the [iTop community versions history on the official wiki](https://www.itophub.io/wiki/page?id=latest:release:start).
|
To learn more, check the [iTop community versions history on the official wiki](https://www.itophub.io/wiki/page?id=latest:release:start).
|
||||||
|
|||||||
83
.github/pull_request_template.md
vendored
Normal file
83
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<!--
|
||||||
|
|
||||||
|
IMPORTANT: Please follow the guidelines within this PR template before submitting it, it will greatly help us process your PR. 🙏
|
||||||
|
|
||||||
|
Any PRs not following the guidelines or with missing information will not be considered.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Base information
|
||||||
|
| Question | Answer
|
||||||
|
|---------------------------------------------------------------|--------
|
||||||
|
| Related to a SourceForge thead / Another PR / Combodo ticket? | <!-- Put the URL -->
|
||||||
|
| Type of change? | Bug fix / Enhancement / Translations
|
||||||
|
|
||||||
|
|
||||||
|
## Symptom (bug) / Objective (enhancement)
|
||||||
|
<!--
|
||||||
|
If it's a bug
|
||||||
|
- Explain the symptom in details
|
||||||
|
- If possible put error messages, logs or screenshots (you can paste image directly in this editor).
|
||||||
|
|
||||||
|
If it's an enhancement
|
||||||
|
- Describe what is blocking you, what is the objective with as much details as possible.
|
||||||
|
- Add screenshots if it's related to UI.
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
## Reproduction procedure (bug)
|
||||||
|
<!--
|
||||||
|
Remove this section only if it's NOT a bug.
|
||||||
|
|
||||||
|
Otherwise, explain step by step how to reproduce the issue on a standard iTop Community.
|
||||||
|
|
||||||
|
If it requires a custom datamodel, provide the minimal XML delta to reproduce it on a standard iTop Community.
|
||||||
|
-->
|
||||||
|
|
||||||
|
1. On iTop x.y.z <!-- Put complete iTop version (eg. 3.1.0-2) -->
|
||||||
|
2. With PHP x.y.z <!-- Put complete PHP version (eg. 8.1.24) -->
|
||||||
|
2. First go there
|
||||||
|
2. Then do that
|
||||||
|
3. ...
|
||||||
|
4. Finally, see that...
|
||||||
|
|
||||||
|
|
||||||
|
## Cause (bug)
|
||||||
|
<!--
|
||||||
|
Remove this section only if it's NOT a bug.
|
||||||
|
|
||||||
|
Otherwise, explain what is the cause of the issue (where in the code and why)
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
## Proposed solution (bug and enhancement)
|
||||||
|
<!--
|
||||||
|
Explain in details how you are proposing to solve this:
|
||||||
|
- What did you do in the code and why
|
||||||
|
- If you changed something in the UI, put before / after screenshots (you can paste image directly in this editor)
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
## Checklist before requesting a review
|
||||||
|
<!--
|
||||||
|
Don't remove these lines, check them once done.
|
||||||
|
-->
|
||||||
|
- [ ] I have performed a self-review of my code
|
||||||
|
- [ ] I have tested all changes I made on an iTop instance
|
||||||
|
- [ ] I have added a unit test, otherwise I have explained why I couldn't
|
||||||
|
- [ ] Is the PR clear and detailled enough so anyone can understand digging in the code?
|
||||||
|
|
||||||
|
## Checklist of things to do before PR is ready to merge
|
||||||
|
<!--
|
||||||
|
Things that needs to be done in the PR before it can be considered as ready to be merged
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
- Changes requested in the review
|
||||||
|
- Unit test to add
|
||||||
|
- Dictionary entries to translate
|
||||||
|
- ...
|
||||||
|
-->
|
||||||
|
|
||||||
|
- [ ] ...
|
||||||
|
- [ ] ...
|
||||||
|
- [ ] ...
|
||||||
@@ -22,13 +22,13 @@ $iElapsed = time() - $iBeginTime;
|
|||||||
|
|
||||||
if (count($aFailedCommands))
|
if (count($aFailedCommands))
|
||||||
{
|
{
|
||||||
fwrite(STDERR, "\nafterBuild execution failed! (in ${iElapsed}s)\n");
|
fwrite(STDERR, "\nafterBuild execution failed! (in {$iElapsed}s)\n");
|
||||||
fwrite(STDERR, "List of failling commands:\n - " . implode("\n - ", $aFailedCommands) . "\n");
|
fwrite(STDERR, "List of failling commands:\n - " . implode("\n - ", $aFailedCommands) . "\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "\nDone (${iElapsed}s)\n";
|
echo "\nDone ({$iElapsed}s)\n";
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,7 +74,7 @@ function ExecCommand($cmd) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "| elapsed:${iElapsed}s \n";
|
echo "| elapsed:{$iElapsed}s \n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($stderr))
|
if (!empty($stderr))
|
||||||
|
|||||||
56
.make/composer/tcpdf/tcpdfDefaultFontsToKeepInItop.txt
Normal file
56
.make/composer/tcpdf/tcpdfDefaultFontsToKeepInItop.txt
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
courier.php
|
||||||
|
courierb.php
|
||||||
|
courierbi.php
|
||||||
|
courieri.php
|
||||||
|
dejavusans.ctg.z
|
||||||
|
dejavusans.php
|
||||||
|
dejavusans.z
|
||||||
|
dejavusansb.ctg.z
|
||||||
|
dejavusansb.php
|
||||||
|
dejavusansb.z
|
||||||
|
dejavusansbi.ctg.z
|
||||||
|
dejavusansbi.php
|
||||||
|
dejavusansbi.z
|
||||||
|
dejavusanscondensed.ctg.z
|
||||||
|
dejavusanscondensed.php
|
||||||
|
dejavusanscondensed.z
|
||||||
|
dejavusanscondensedb.ctg.z
|
||||||
|
dejavusanscondensedb.php
|
||||||
|
dejavusanscondensedb.z
|
||||||
|
dejavusanscondensedbi.ctg.z
|
||||||
|
dejavusanscondensedbi.php
|
||||||
|
dejavusanscondensedbi.z
|
||||||
|
dejavusanscondensedi.ctg.z
|
||||||
|
dejavusanscondensedi.php
|
||||||
|
dejavusanscondensedi.z
|
||||||
|
dejavusansextralight.ctg.z
|
||||||
|
dejavusansextralight.php
|
||||||
|
dejavusansextralight.z
|
||||||
|
dejavusansi.ctg.z
|
||||||
|
dejavusansi.php
|
||||||
|
dejavusansi.z
|
||||||
|
dejavusansmono.ctg.z
|
||||||
|
dejavusansmono.php
|
||||||
|
dejavusansmono.z
|
||||||
|
dejavusansmonob.ctg.z
|
||||||
|
dejavusansmonob.php
|
||||||
|
dejavusansmonob.z
|
||||||
|
dejavusansmonobi.ctg.z
|
||||||
|
dejavusansmonobi.php
|
||||||
|
dejavusansmonobi.z
|
||||||
|
dejavusansmonoi.ctg.z
|
||||||
|
dejavusansmonoi.php
|
||||||
|
dejavusansmonoi.z
|
||||||
|
droidsansfallback.ctg.z
|
||||||
|
droidsansfallback.php
|
||||||
|
droidsansfallback.z
|
||||||
|
helvetica.php
|
||||||
|
helveticab.php
|
||||||
|
helveticabi.php
|
||||||
|
helveticai.php
|
||||||
|
symbol.php
|
||||||
|
times.php
|
||||||
|
timesb.php
|
||||||
|
timesbi.php
|
||||||
|
timesi.php
|
||||||
|
zapfdingbats.php
|
||||||
101
.make/composer/tcpdf/tcpdfUpdateFonts.php
Normal file
101
.make/composer/tcpdf/tcpdfUpdateFonts.php
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This script will copy custom fonts in the TCPDF lib fonts directory.
|
||||||
|
* If you need to add other files :
|
||||||
|
* - add the corresponding files in this script directory
|
||||||
|
* - modify this script to copy also your files
|
||||||
|
*
|
||||||
|
* @since 2.7.0 N°1947 add DroidSansFallback font (see also PR #49 in the links below)
|
||||||
|
* @since 2.7.0 N°2435 TCPPDF lib forked and added in composer.json (at that time the lib was announced as deprecated and rewritten in tecnickcom/tc-lib-pdf)
|
||||||
|
* @since 3.2.0 N°7175 switch back to TCPDF original lib (which is finally still maintained, tecnickcom/tc-lib-pdf us still under dev), script creation to keep custom DroidSansFallback font
|
||||||
|
*
|
||||||
|
* @link https://github.com/Combodo/iTop/pull/49 add DroidSansFallback font
|
||||||
|
* @link https://github.com/tecnickcom/TCPDF?tab=readme-ov-file#note TCPDF is in support only mode
|
||||||
|
*/
|
||||||
|
|
||||||
|
$sItopRootFolder = realpath(__DIR__ . "/../../../");
|
||||||
|
$sCurrentScriptFileName = basename(__FILE__);
|
||||||
|
|
||||||
|
|
||||||
|
require_once ("$sItopRootFolder/lib/autoload.php");
|
||||||
|
|
||||||
|
|
||||||
|
$sTcPdfRootFolder = $sItopRootFolder.'/lib/tecnickcom/tcpdf';
|
||||||
|
if (false === file_exists($sTcPdfRootFolder)) {
|
||||||
|
echo $sCurrentScriptFileName.": No TCPDF lib detected, exiting !\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$sTcPdfFontsFolder = $sTcPdfRootFolder.'/Fonts/';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1) Cleaning up the fonts directory to keep only the ones we want in iTop
|
||||||
|
*/
|
||||||
|
echo $sCurrentScriptFileName.": ---1) Cleaning up the fonts files\n";
|
||||||
|
$aTcpdfDefaultFontsToKeepInItop = file(__DIR__.'/tcpdfDefaultFontsToKeepInItop.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
|
|
||||||
|
$aTcpdfFontsDirContent = scandir($sTcPdfFontsFolder);
|
||||||
|
foreach ($aTcpdfFontsDirContent as $sTcpdfFontResourceName) {
|
||||||
|
if ($sTcpdfFontResourceName === '.') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($sTcpdfFontResourceName === '..') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!in_array($sTcpdfFontResourceName, $aTcpdfDefaultFontsToKeepInItop, true)) {
|
||||||
|
echo $sCurrentScriptFileName.": Removing $sTcpdfFontResourceName !\n";
|
||||||
|
|
||||||
|
$sTcpdfFontResourceFullPath = $sTcPdfFontsFolder.$sTcpdfFontResourceName;
|
||||||
|
if (is_file($sTcpdfFontResourceFullPath)) {
|
||||||
|
unlink($sTcpdfFontResourceFullPath);
|
||||||
|
} elseif (is_dir($sTcpdfFontResourceFullPath)) {
|
||||||
|
rrmdir($sTcpdfFontResourceFullPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2) Then adding the DroidSansFallback font (useful for CJK data for example)
|
||||||
|
*/
|
||||||
|
echo $sCurrentScriptFileName.": ---2) Copying font files to TCPDF ($sTcPdfFontsFolder)...\n";
|
||||||
|
$aFontFilesToCopy = glob(__DIR__.'\droidsansfallback.*');
|
||||||
|
foreach ($aFontFilesToCopy as $sFontFileToCopy) {
|
||||||
|
$sFontFileName = basename($sFontFileToCopy);
|
||||||
|
echo $sCurrentScriptFileName.': copying '.$sFontFileName."\n";
|
||||||
|
copy($sFontFileToCopy, $sTcPdfFontsFolder.$sFontFileName);
|
||||||
|
}
|
||||||
|
echo $sCurrentScriptFileName.": Done !\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively delete a directory and its content
|
||||||
|
*
|
||||||
|
* @param $sDirToRemovePath
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function rrmdir($sDirToRemovePath):void
|
||||||
|
{
|
||||||
|
if (is_dir($sDirToRemovePath)) {
|
||||||
|
$objects = scandir($sDirToRemovePath);
|
||||||
|
foreach ($objects as $object) {
|
||||||
|
if ($object != "." && $object != "..") {
|
||||||
|
if (filetype($sDirToRemovePath."/".$object) == "dir") {
|
||||||
|
rrmdir($sDirToRemovePath."/".$object);
|
||||||
|
} else {
|
||||||
|
unlink($sDirToRemovePath."/".$object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reset($objects);
|
||||||
|
rmdir($sDirToRemovePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -140,7 +140,7 @@ When your code is working, please:
|
|||||||
* Pull request description: mind to add all the information useful to understand why you're suggesting this modification and anything necessary to dive into your work. Especially:
|
* Pull request description: mind to add all the information useful to understand why you're suggesting this modification and anything necessary to dive into your work. Especially:
|
||||||
- Bugfixes: exact steps to reproduce the bug (given/when/then), description of the bug cause and what solution is implemented
|
- Bugfixes: exact steps to reproduce the bug (given/when/then), description of the bug cause and what solution is implemented
|
||||||
- Enhancements: use cases, implementation details if needed
|
- Enhancements: use cases, implementation details if needed
|
||||||
* Mind to check the "[Allow edits from maintainers](https://docs.github.com/en/github-ae@latest/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)" option !
|
* Mind to check the "[Allow edits from maintainers](https://docs.github.com/en/github-ae@latest/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)" option ! (note that if you are working with an org fork, this option [won't be available](https://github.com/orgs/community/discussions/5634))
|
||||||
|
|
||||||
|
|
||||||
## 🙏 We are thankful
|
## 🙏 We are thankful
|
||||||
|
|||||||
@@ -87,9 +87,11 @@ We would like to give a special thank you 🤗 to the people from the community
|
|||||||
- Castro, Randall Badilla
|
- Castro, Randall Badilla
|
||||||
- Colantoni, Maria Laura
|
- Colantoni, Maria Laura
|
||||||
- Couronné, Guy
|
- Couronné, Guy
|
||||||
|
- Dejin, Bie (a.k.a [@bdejin](https://github.com/bdejin))
|
||||||
- Dvořák, Lukáš
|
- Dvořák, Lukáš
|
||||||
- Goethals, Stefan
|
- Goethals, Stefan
|
||||||
- Gumble, David
|
- Gumble, David
|
||||||
|
- Ji, Leeb (冀利斌) (a.k.a [@chileeb](https://github.com/chileeb))
|
||||||
- Kaltefleiter, Lars (a.k.a [@larhip](https://www.github.com/larhip))
|
- Kaltefleiter, Lars (a.k.a [@larhip](https://www.github.com/larhip))
|
||||||
- Khamit, Shamil
|
- Khamit, Shamil
|
||||||
- Kincel, Martin
|
- Kincel, Martin
|
||||||
@@ -105,9 +107,12 @@ We would like to give a special thank you 🤗 to the people from the community
|
|||||||
- Roháč, Richard (a.k.a [@RohacRichard](https://github.com/RohacRichard))
|
- Roháč, Richard (a.k.a [@RohacRichard](https://github.com/RohacRichard))
|
||||||
- Rosenke, Stephan
|
- Rosenke, Stephan
|
||||||
- Rudner, Björn (a.k.a [@rudnerbjoern](https://github.com/rudnerbjoern))
|
- Rudner, Björn (a.k.a [@rudnerbjoern](https://github.com/rudnerbjoern))
|
||||||
|
- Šafránek, Jaroslav (a.k.a [jkcinik](https://sourceforge.net/u/jkcinik/profile/) on SourceForge)
|
||||||
- Seki, Shoji
|
- Seki, Shoji
|
||||||
- Shilov, Vladimir
|
- Shilov, Vladimir
|
||||||
|
- Stetina, Pavel (a.k.a [@Stetinac](https://github.com/Stetinac))
|
||||||
- Stukalov, Ilya (a.k.a [@ilya](https://www.github.com/ilya)-stukalov)
|
- Stukalov, Ilya (a.k.a [@ilya](https://www.github.com/ilya)-stukalov)
|
||||||
|
- Tarjányi, Csaba (a.k.a [@tacsaby](https://github.com/tacsaby))
|
||||||
- Tulio, Marco
|
- Tulio, Marco
|
||||||
- Turrubiates, Miguel
|
- Turrubiates, Miguel
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
define('ADMIN_PROFILE_NAME', 'Administrator');
|
define('ADMIN_PROFILE_NAME', 'Administrator');
|
||||||
define('PORTAL_PROFILE_NAME', 'Portal user');
|
define('PORTAL_PROFILE_NAME', 'Portal user');
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
define('ADMIN_PROFILE_NAME', 'Administrator');
|
define('ADMIN_PROFILE_NAME', 'Administrator');
|
||||||
define('PORTAL_PROFILE_NAME', 'Portal user');
|
define('PORTAL_PROFILE_NAME', 'Portal user');
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
define('ADMIN_PROFILE_ID', 1);
|
define('ADMIN_PROFILE_ID', 1);
|
||||||
|
|
||||||
class UserRightsBaseClass extends cmdbAbstractObject
|
class UserRightsBaseClass extends cmdbAbstractObject
|
||||||
|
|||||||
29
app.php
Normal file
29
app.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2013-2023 Combodo SARL
|
||||||
|
*
|
||||||
|
* This file is part of iTop.
|
||||||
|
*
|
||||||
|
* iTop is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* iTop 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
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Kernel;
|
||||||
|
|
||||||
|
require_once __DIR__.'/lib/autoload_runtime.php';
|
||||||
|
|
||||||
|
require_once('approot.inc.php');
|
||||||
|
require_once('application/startup.inc.php');
|
||||||
|
|
||||||
|
return function (array $context) {
|
||||||
|
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||||
|
};
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
// cannot notify depreciation for now as this is still load in autoloader
|
// cannot notify depreciation for now as this is still load in autoloader
|
||||||
//DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/AjaxPage.php, now loadable using autoloader');
|
//DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/AjaxPage.php, now loadable using autoloader');
|
||||||
|
use Combodo\iTop\Application\WebPage\AjaxPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ajax_page
|
* Class ajax_page
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Symfony\Component\DependencyInjection\Container;
|
use Symfony\Component\DependencyInjection\Container;
|
||||||
|
|
||||||
require_once(APPROOT.'application/newsroomprovider.class.inc.php');
|
require_once(APPROOT.'application/newsroomprovider.class.inc.php');
|
||||||
@@ -270,14 +272,14 @@ interface iPreferencesExtension
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function DisplayPreferences(WebPage $oPage);
|
public function DisplayPreferences(WebPage $oPage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param string $sOperation
|
* @param string $sOperation
|
||||||
*
|
*
|
||||||
* @return bool true if the operation has been used
|
* @return bool true if the operation has been used
|
||||||
@@ -1272,8 +1274,6 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
|
|||||||
*/
|
*/
|
||||||
public function GetNorthPaneHtml(iTopWebPage $oPage)
|
public function GetNorthPaneHtml(iTopWebPage $oPage)
|
||||||
{
|
{
|
||||||
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1282,8 +1282,6 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
|
|||||||
*/
|
*/
|
||||||
public function GetSouthPaneHtml(iTopWebPage $oPage)
|
public function GetSouthPaneHtml(iTopWebPage $oPage)
|
||||||
{
|
{
|
||||||
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1292,8 +1290,6 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
|
|||||||
*/
|
*/
|
||||||
public function GetBannerHtml(iTopWebPage $oPage)
|
public function GetBannerHtml(iTopWebPage $oPage)
|
||||||
{
|
{
|
||||||
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class lnkAuditCategoryToAuditDomain extends cmdbAbstractObject
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "application, grant_by_profile",
|
"category" => "application,grant_by_profile",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => "",
|
"name_attcode" => "",
|
||||||
"state_attcode" => "",
|
"state_attcode" => "",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Html\HtmlFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Html\HtmlFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\SelectUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenuItem\JsPopoverMenuItem;
|
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenuItem\JsPopoverMenuItem;
|
||||||
@@ -42,6 +42,9 @@ use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Links\Direct\BlockDirectLinkSetViewTable;
|
use Combodo\iTop\Application\UI\Links\Direct\BlockDirectLinkSetViewTable;
|
||||||
use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinkSetViewTable;
|
use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinkSetViewTable;
|
||||||
use Combodo\iTop\Application\UI\Links\Set\LinkSetUIBlockFactory;
|
use Combodo\iTop\Application\UI\Links\Set\LinkSetUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\AjaxPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Renderer\BlockRenderer;
|
use Combodo\iTop\Renderer\BlockRenderer;
|
||||||
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
||||||
use Combodo\iTop\Renderer\Console\ConsoleFormRenderer;
|
use Combodo\iTop\Renderer\Console\ConsoleFormRenderer;
|
||||||
@@ -134,6 +137,8 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
public const ENUM_INPUT_TYPE_TAGSET = 'tagset';
|
public const ENUM_INPUT_TYPE_TAGSET = 'tagset';
|
||||||
/** @var string */
|
/** @var string */
|
||||||
|
public const ENUM_INPUT_TYPE_TAGSET_LINKEDSET = 'tagset_linkedset';
|
||||||
|
/** @var string */
|
||||||
public const ENUM_INPUT_TYPE_RADIO = 'radio';
|
public const ENUM_INPUT_TYPE_RADIO = 'radio';
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public const ENUM_INPUT_TYPE_CHECKBOX = 'checkbox';
|
public const ENUM_INPUT_TYPE_CHECKBOX = 'checkbox';
|
||||||
@@ -285,7 +290,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \cmdbAbstractObject $oObj
|
* @param \cmdbAbstractObject $oObj
|
||||||
* @param array $aParams
|
* @param array $aParams
|
||||||
*
|
*
|
||||||
@@ -354,7 +359,7 @@ JS
|
|||||||
* @param int $iKey The identifier of the object
|
* @param int $iKey The identifier of the object
|
||||||
* @param string $sMessageId Your id or one of the well-known ids: 'create', 'update' and 'apply_stimulus'
|
* @param string $sMessageId Your id or one of the well-known ids: 'create', 'update' and 'apply_stimulus'
|
||||||
* @param string $sMessage The HTML message (must be correctly escaped)
|
* @param string $sMessage The HTML message (must be correctly escaped)
|
||||||
* @param string $sSeverity Any of the \WebPage::ENUM_SESSION_MESSAGE_SEVERITY_XXX constants
|
* @param string $sSeverity Any of the WebPage::ENUM_SESSION_MESSAGE_SEVERITY_XXX constants
|
||||||
* @param float $fRank Ordering of the message: smallest displayed first (can be negative)
|
* @param float $fRank Ordering of the message: smallest displayed first (can be negative)
|
||||||
* @param bool $bMustNotExist Do not alter any existing message (considering the id)
|
* @param bool $bMustNotExist Do not alter any existing message (considering the id)
|
||||||
*
|
*
|
||||||
@@ -376,7 +381,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage Warning, since 3.0.0 this parameter was kept for compatibility reason. You shouldn't write directly on the page!
|
* @param WebPage $oPage Warning, since 3.0.0 this parameter was kept for compatibility reason. You shouldn't write directly on the page!
|
||||||
* When writing to the page, markup will be put above the real header of the panel.
|
* When writing to the page, markup will be put above the real header of the panel.
|
||||||
* To insert something IN the panel, we now need to add UIBlocks in either the "subtitle" or "toolbar" sections of the array that will be returned.
|
* To insert something IN the panel, we now need to add UIBlocks in either the "subtitle" or "toolbar" sections of the array that will be returned.
|
||||||
* @param bool $bEditMode Deprecated parameter in iTop 3.0.0, use {@see GetDisplayMode()} and ENUM_DISPLAY_MODE_* constants instead
|
* @param bool $bEditMode Deprecated parameter in iTop 3.0.0, use {@see GetDisplayMode()} and ENUM_DISPLAY_MODE_* constants instead
|
||||||
@@ -554,7 +559,7 @@ HTML
|
|||||||
/**
|
/**
|
||||||
* Display properties tab of an object
|
* Display properties tab of an object
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
||||||
* @param string $sPrefix
|
* @param string $sPrefix
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
@@ -593,7 +598,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $sAttCode
|
* @param $sAttCode
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -634,7 +639,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
||||||
*
|
*
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
@@ -861,7 +866,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
||||||
* @param string $sPrefix
|
* @param string $sPrefix
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
@@ -1065,7 +1070,7 @@ HTML
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode Note that this parameter is no longer used in this method, {@see static::$sDisplayMode} is used instead, but we cannot remove it as it part of the base interface (iDisplay)...
|
* @param bool $bEditMode Note that this parameter is no longer used in this method, {@see static::$sDisplayMode} is used instead, but we cannot remove it as it part of the base interface (iDisplay)...
|
||||||
*
|
*
|
||||||
* @throws \ApplicationException
|
* @throws \ApplicationException
|
||||||
@@ -1112,7 +1117,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note: DisplayBareHeader is called before adding $oObjectDetails to the page, so it can inject HTML before it through $oPage.
|
// Note: DisplayBareHeader is called before adding $oObjectDetails to the page, so it can inject HTML before it through $oPage.
|
||||||
/** @var \iTopWebPage $oPage */
|
/** @var iTopWebPage $oPage */
|
||||||
$aHeadersBlocks = $this->DisplayBareHeader($oPage, $bEditMode);
|
$aHeadersBlocks = $this->DisplayBareHeader($oPage, $bEditMode);
|
||||||
if (false === empty($aHeadersBlocks['subtitle'])) {
|
if (false === empty($aHeadersBlocks['subtitle'])) {
|
||||||
$oObjectDetails->AddSubTitleBlocks($aHeadersBlocks['subtitle']);
|
$oObjectDetails->AddSubTitleBlocks($aHeadersBlocks['subtitle']);
|
||||||
@@ -1147,7 +1152,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
*
|
*
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
@@ -1170,7 +1175,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aExtraParams See possible values in {@see DataTableUIBlockFactory::RenderDataTable()}
|
* @param array $aExtraParams See possible values in {@see DataTableUIBlockFactory::RenderDataTable()}
|
||||||
*
|
*
|
||||||
@@ -1232,7 +1237,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \DBObjectSet $oSet
|
* @param \DBObjectSet $oSet
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -1404,7 +1409,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aExtraParams key used :
|
* @param array $aExtraParams key used :
|
||||||
* <ul>
|
* <ul>
|
||||||
@@ -1527,7 +1532,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aParams
|
* @param array $aParams
|
||||||
* @param string $sCharset
|
* @param string $sCharset
|
||||||
@@ -1686,7 +1691,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aParams
|
* @param array $aParams
|
||||||
*
|
*
|
||||||
@@ -1899,7 +1904,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aParams
|
* @param array $aParams
|
||||||
*
|
*
|
||||||
@@ -1977,7 +1982,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -2008,7 +2013,7 @@ HTML
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param string $sAttCode
|
* @param string $sAttCode
|
||||||
* @param \AttributeDefinition $oAttDef
|
* @param \AttributeDefinition $oAttDef
|
||||||
@@ -2359,6 +2364,7 @@ EOF
|
|||||||
|
|
||||||
case 'LinkedSet':
|
case 'LinkedSet':
|
||||||
if ($oAttDef->GetDisplayStyle() === LINKSET_DISPLAY_STYLE_PROPERTY) {
|
if ($oAttDef->GetDisplayStyle() === LINKSET_DISPLAY_STYLE_PROPERTY) {
|
||||||
|
$sInputType = self::ENUM_INPUT_TYPE_TAGSET_LINKEDSET;
|
||||||
if (array_key_exists('bulk_context', $aArgs)) {
|
if (array_key_exists('bulk_context', $aArgs)) {
|
||||||
$oTagSetBlock = LinkSetUIBlockFactory::MakeForBulkLinkSet($iId, $oAttDef, $value, $sWizardHelperJsVarName, $aArgs['bulk_context']);
|
$oTagSetBlock = LinkSetUIBlockFactory::MakeForBulkLinkSet($iId, $oAttDef, $value, $sWizardHelperJsVarName, $aArgs['bulk_context']);
|
||||||
} else {
|
} else {
|
||||||
@@ -2746,7 +2752,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
@@ -3151,7 +3157,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Select the derived class to create
|
* Select the derived class to create
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param \ApplicationContext $oAppContext
|
* @param \ApplicationContext $oAppContext
|
||||||
* @param array $aPossibleClasses
|
* @param array $aPossibleClasses
|
||||||
* @param array $aHiddenFields
|
* @param array $aHiddenFields
|
||||||
@@ -3246,7 +3252,7 @@ EOF
|
|||||||
return $oBlock;
|
return $oBlock;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param \DBObject|null $oSourceObject Object to use for the creation form, can be either the class to instantiate, an object to clone or an object to use (eg. already prefilled / modeled object)
|
* @param \DBObject|null $oSourceObject Object to use for the creation form, can be either the class to instantiate, an object to clone or an object to use (eg. already prefilled / modeled object)
|
||||||
* @param array $aArgs
|
* @param array $aArgs
|
||||||
@@ -3331,7 +3337,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param string $sStimulus
|
* @param string $sStimulus
|
||||||
* @param array|null $aPrefillFormParam
|
* @param array|null $aPrefillFormParam
|
||||||
* @param bool $bDisplayBareProperties Whether to display the object details or not
|
* @param bool $bDisplayBareProperties Whether to display the object details or not
|
||||||
@@ -3586,16 +3592,26 @@ EOF
|
|||||||
$oPage->add_ready_script(InlineImage::EnableCKEditorImageUpload($this, $sTempId));
|
$oPage->add_ready_script(InlineImage::EnableCKEditorImageUpload($this, $sTempId));
|
||||||
} else {
|
} else {
|
||||||
//we can directly apply the stimuli
|
//we can directly apply the stimuli
|
||||||
|
$sExceptionMessage = null;
|
||||||
|
try {
|
||||||
$bApplyStimulus = $this->ApplyStimulus($sStimulus); // will write the object in the DB
|
$bApplyStimulus = $this->ApplyStimulus($sStimulus); // will write the object in the DB
|
||||||
if (!$bApplyStimulus) {
|
}
|
||||||
throw new ApplicationException(Dict::S('UI:FailedToApplyStimuli'));
|
catch (Exception $oException) {
|
||||||
} else {
|
// Catch any exception happening during the stimulus
|
||||||
|
$bApplyStimulus = false;
|
||||||
|
$sExceptionMessage = ($oException instanceof CoreCannotSaveObjectException) ? $oException->getHtmlMessage() : $oException->getMessage();
|
||||||
|
}
|
||||||
|
finally {
|
||||||
if ($sOwnershipToken !== null) {
|
if ($sOwnershipToken !== null) {
|
||||||
// Release the concurrent lock, if any
|
// Release the concurrent lock, if any
|
||||||
iTopOwnershipLock::ReleaseLock($sClass, $iKey, $sOwnershipToken);
|
iTopOwnershipLock::ReleaseLock($sClass, $iKey, $sOwnershipToken);
|
||||||
}
|
}
|
||||||
|
if (!$bApplyStimulus) {
|
||||||
return true;
|
// Throw an application oriented exception if necessary
|
||||||
|
throw new ApplicationException($sExceptionMessage ?? Dict::S('UI:FailedToApplyStimuli'));
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3709,7 +3725,7 @@ HTML;
|
|||||||
if ($oAttDef->GetEditClass() == 'Document') {
|
if ($oAttDef->GetEditClass() == 'Document') {
|
||||||
/** @var \ormDocument $oDocument */
|
/** @var \ormDocument $oDocument */
|
||||||
$oDocument = $this->Get($sAttCode);
|
$oDocument = $this->Get($sAttCode);
|
||||||
if (!$oDocument->IsEmpty()) {
|
if (is_object($oDocument) && !$oDocument->IsEmpty()) {
|
||||||
$sFieldAsHtml = $this->GetAsHTML($sAttCode);
|
$sFieldAsHtml = $this->GetAsHTML($sAttCode);
|
||||||
|
|
||||||
$sDisplayLabel = Dict::S('UI:OpenDocumentInNewWindow_');
|
$sDisplayLabel = Dict::S('UI:OpenDocumentInNewWindow_');
|
||||||
@@ -3744,7 +3760,7 @@ HTML;
|
|||||||
/**
|
/**
|
||||||
* Displays a blob document *inline* (if possible, depending on the type of the document)
|
* Displays a blob document *inline* (if possible, depending on the type of the document)
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $sAttCode
|
* @param $sAttCode
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -4591,6 +4607,7 @@ HTML;
|
|||||||
public function DBUpdate()
|
public function DBUpdate()
|
||||||
{
|
{
|
||||||
$this->LogCRUDEnter(__METHOD__);
|
$this->LogCRUDEnter(__METHOD__);
|
||||||
|
$res = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (count($this->ListChanges()) === 0) {
|
if (count($this->ListChanges()) === 0) {
|
||||||
@@ -4651,6 +4668,7 @@ HTML;
|
|||||||
if (static::IsCrudStackEmpty()) {
|
if (static::IsCrudStackEmpty()) {
|
||||||
// Avoid signaling the current object that links were modified
|
// Avoid signaling the current object that links were modified
|
||||||
static::RemoveObjectAwaitingEventDbLinksChanged(get_class($this), $this->GetKey());
|
static::RemoveObjectAwaitingEventDbLinksChanged(get_class($this), $this->GetKey());
|
||||||
|
$this->LogCRUDDebug(__METHOD__, var_export(self::$aObjectsAwaitingEventDbLinksChanged, true));
|
||||||
static::FireEventDbLinksChangedForAllObjects();
|
static::FireEventDbLinksChangedForAllObjects();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4659,6 +4677,11 @@ HTML;
|
|||||||
return $oDeletionPlan;
|
return $oDeletionPlan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function PostDeleteActions(): void
|
||||||
|
{
|
||||||
|
parent::PostDeleteActions();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 3.1.1 3.2.0 N°6967 We will have only one DBDelete method in the future
|
* @deprecated 3.1.1 3.2.0 N°6967 We will have only one DBDelete method in the future
|
||||||
*/
|
*/
|
||||||
@@ -4825,7 +4848,7 @@ HTML;
|
|||||||
/**
|
/**
|
||||||
* Special display where the case log uses the whole "screen" at the bottom of the "Properties" tab
|
* Special display where the case log uses the whole "screen" at the bottom of the "Properties" tab
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param string $sAttCode
|
* @param string $sAttCode
|
||||||
* @param string $sComment
|
* @param string $sComment
|
||||||
* @param string $sPrefix
|
* @param string $sPrefix
|
||||||
@@ -4929,7 +4952,7 @@ HTML
|
|||||||
/**
|
/**
|
||||||
* Special display where the case log uses the whole "screen" at the bottom of the "Properties" tab
|
* Special display where the case log uses the whole "screen" at the bottom of the "Properties" tab
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param string $sAttCode
|
* @param string $sAttCode
|
||||||
* @param string $sComment
|
* @param string $sComment
|
||||||
* @param string $sPrefix
|
* @param string $sPrefix
|
||||||
@@ -5054,7 +5077,7 @@ HTML
|
|||||||
* Display a form for modifying several objects at once
|
* Display a form for modifying several objects at once
|
||||||
* The form will be submitted to the current page, with the specified additional values
|
* The form will be submitted to the current page, with the specified additional values
|
||||||
*
|
*
|
||||||
* @param \iTopWebPage $oP
|
* @param iTopWebPage $oP
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param array $aSelectedObj
|
* @param array $aSelectedObj
|
||||||
* @param string $sCustomOperation
|
* @param string $sCustomOperation
|
||||||
@@ -5298,7 +5321,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Process the reply made from a form built with DisplayBulkModifyForm
|
* Process the reply made from a form built with DisplayBulkModifyForm
|
||||||
*
|
*
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param array $aSelectedObj
|
* @param array $aSelectedObj
|
||||||
* @param string $sCustomOperation
|
* @param string $sCustomOperation
|
||||||
@@ -5438,7 +5461,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Perform all the needed checks to delete one (or more) objects
|
* Perform all the needed checks to delete one (or more) objects
|
||||||
*
|
*
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sClass
|
* @param $sClass
|
||||||
* @param \DBObject[] $aObjects
|
* @param \DBObject[] $aObjects
|
||||||
* @param $bPreview
|
* @param $bPreview
|
||||||
@@ -5944,6 +5967,16 @@ JS
|
|||||||
$this->FireEvent(EVENT_DB_CHECK_TO_DELETE, ['deletion_plan' => $oDeletionPlan]);
|
$this->FireEvent(EVENT_DB_CHECK_TO_DELETE, ['deletion_plan' => $oDeletionPlan]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
* @throws \CoreException
|
||||||
|
* @since 3.1.2
|
||||||
|
*/
|
||||||
|
final protected function FireEventAboutToDelete(): void
|
||||||
|
{
|
||||||
|
$this->FireEvent(EVENT_DB_ABOUT_TO_DELETE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
@@ -5953,7 +5986,6 @@ JS
|
|||||||
final protected function FireEventAfterDelete(): void
|
final protected function FireEventAfterDelete(): void
|
||||||
{
|
{
|
||||||
$this->NotifyAttachedObjectsOnLinkClassModification();
|
$this->NotifyAttachedObjectsOnLinkClassModification();
|
||||||
$this->FireEventDbLinksChangedForCurrentObject();
|
|
||||||
$this->FireEvent(EVENT_DB_AFTER_DELETE);
|
$this->FireEvent(EVENT_DB_AFTER_DELETE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5986,13 +6018,16 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sTargetObjectId = $this->Get($sExternalKeyAttCode);
|
$sTargetObjectId = $this->Get($sExternalKeyAttCode);
|
||||||
|
$sTargetClass = $oAttDef->GetTargetClass();
|
||||||
if ($sTargetObjectId > 0) {
|
if ($sTargetObjectId > 0) {
|
||||||
self::RegisterObjectAwaitingEventDbLinksChanged($oAttDef->GetTargetClass(), $sTargetObjectId);
|
$this->LogCRUDDebug(__METHOD__, "Add $sTargetClass:$sTargetObjectId for DBLINKS_CHANGED");
|
||||||
|
self::RegisterObjectAwaitingEventDbLinksChanged($sTargetClass, $sTargetObjectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sPreviousTargetObjectId = $aPreviousValues[$sExternalKeyAttCode] ?? 0;
|
$sPreviousTargetObjectId = $aPreviousValues[$sExternalKeyAttCode] ?? 0;
|
||||||
if ($sPreviousTargetObjectId > 0) {
|
if ($sPreviousTargetObjectId > 0) {
|
||||||
self::RegisterObjectAwaitingEventDbLinksChanged($oAttDef->GetTargetClass(), $sPreviousTargetObjectId);
|
$this->LogCRUDDebug(__METHOD__, "Add $sTargetClass:$sPreviousTargetObjectId for DBLINKS_CHANGED");
|
||||||
|
self::RegisterObjectAwaitingEventDbLinksChanged($sTargetClass, $sPreviousTargetObjectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6042,7 +6077,12 @@ JS
|
|||||||
|
|
||||||
$sClass = get_class($this);
|
$sClass = get_class($this);
|
||||||
$sId = $this->GetKey();
|
$sId = $this->GetKey();
|
||||||
self::FireEventDbLinksChangedForClassId($sClass, $sId);
|
$bIsObjectAwaitingEventDbLinksChanged = self::RemoveObjectAwaitingEventDbLinksChanged($sClass, $sId);
|
||||||
|
if (false === $bIsObjectAwaitingEventDbLinksChanged) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self::FireEventDbLinksChangedForObject($this);
|
||||||
|
self::RemoveObjectAwaitingEventDbLinksChanged($sClass, $sId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6074,9 +6114,15 @@ JS
|
|||||||
// We want to avoid launching the listener twice, first here, and secondly after saving the Ticket in the listener
|
// We want to avoid launching the listener twice, first here, and secondly after saving the Ticket in the listener
|
||||||
// By disabling the event to be fired, we can remove the current object from the attribute !
|
// By disabling the event to be fired, we can remove the current object from the attribute !
|
||||||
$oObject = MetaModel::GetObject($sClass, $sId, false);
|
$oObject = MetaModel::GetObject($sClass, $sId, false);
|
||||||
|
self::FireEventDbLinksChangedForObject($oObject);
|
||||||
|
self::RemoveObjectAwaitingEventDbLinksChanged($sClass, $sId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function FireEventDbLinksChangedForObject(DBObject $oObject)
|
||||||
|
{
|
||||||
|
self::SetEventDBLinksChangedBlocked(true);
|
||||||
// N°6408 The object can have been deleted
|
// N°6408 The object can have been deleted
|
||||||
if (!is_null($oObject)) {
|
if (!is_null($oObject)) {
|
||||||
self::SetEventDBLinksChangedBlocked(true);
|
|
||||||
MetaModel::StartReentranceProtection($oObject);
|
MetaModel::StartReentranceProtection($oObject);
|
||||||
$oObject->FireEvent(EVENT_DB_LINKS_CHANGED);
|
$oObject->FireEvent(EVENT_DB_LINKS_CHANGED);
|
||||||
MetaModel::StopReentranceProtection($oObject);
|
MetaModel::StopReentranceProtection($oObject);
|
||||||
@@ -6084,7 +6130,6 @@ JS
|
|||||||
$oObject->DBUpdate();
|
$oObject->DBUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self::RemoveObjectAwaitingEventDbLinksChanged($sClass, $sId);
|
|
||||||
cmdbAbstractObject::SetEventDBLinksChangedBlocked(false);
|
cmdbAbstractObject::SetEventDBLinksChangedBlocked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
|
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
require_once(APPROOT.'application/dashboardlayout.class.inc.php');
|
require_once(APPROOT.'application/dashboardlayout.class.inc.php');
|
||||||
require_once(APPROOT.'application/dashlet.class.inc.php');
|
require_once(APPROOT.'application/dashlet.class.inc.php');
|
||||||
@@ -422,7 +424,7 @@ abstract class Dashboard
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage *
|
* @param WebPage $oPage *
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @throws \ReflectionException
|
* @throws \ReflectionException
|
||||||
@@ -513,7 +515,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param bool $bCanEdit
|
* @param bool $bCanEdit
|
||||||
@@ -569,7 +571,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
*
|
*
|
||||||
* @throws \ReflectionException
|
* @throws \ReflectionException
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -592,7 +594,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*/
|
*/
|
||||||
public function RenderDashletsProperties(WebPage $oPage, $aExtraParams = array())
|
public function RenderDashletsProperties(WebPage $oPage, $aExtraParams = array())
|
||||||
@@ -1109,7 +1111,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -1228,7 +1230,7 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
*
|
*
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -1488,7 +1490,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $sOQL
|
* @param $sOQL
|
||||||
*
|
*
|
||||||
* @throws \DictExceptionMissingString
|
* @throws \DictExceptionMissingString
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
|||||||
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardColumn;
|
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardColumn;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
|
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardRow;
|
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardRow;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dashboard presentation
|
* Dashboard presentation
|
||||||
@@ -106,7 +107,7 @@ abstract class DashboardLayoutMultiCol extends DashboardLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $aCells
|
* @param $aCells
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
require_once(APPROOT.'application/forms.class.inc.php');
|
require_once(APPROOT.'application/forms.class.inc.php');
|
||||||
|
|
||||||
@@ -222,7 +223,7 @@ abstract class Dashlet
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param bool $bEnclosingDiv
|
* @param bool $bEnclosingDiv
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
@@ -298,7 +299,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -309,7 +310,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Rendering without the real data
|
* Rendering without the real data
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.1">
|
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.2">
|
||||||
<classes>
|
<classes>
|
||||||
<class id="AbstractResource" _delta="define">
|
<class id="AbstractResource" _delta="define">
|
||||||
<parent>cmdbAbstractObject</parent>
|
<parent>cmdbAbstractObject</parent>
|
||||||
@@ -270,6 +270,23 @@
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
|
<event id="EVENT_DB_ABOUT_TO_DELETE" _delta="define">
|
||||||
|
<description>An object is about to be deleted from the database</description>
|
||||||
|
<sources>
|
||||||
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
|
</sources>
|
||||||
|
<replaces>cmdbAbstractObject::OnDelete</replaces>
|
||||||
|
<event_data>
|
||||||
|
<event_datum id="object">
|
||||||
|
<description>The object about to be deleted</description>
|
||||||
|
<type>DBObject</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="debug_info">
|
||||||
|
<description>Debug string</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
</event_data>
|
||||||
|
</event>
|
||||||
<event id="EVENT_DB_AFTER_DELETE" _delta="define">
|
<event id="EVENT_DB_AFTER_DELETE" _delta="define">
|
||||||
<description>An object has been deleted into the database</description>
|
<description>An object has been deleted into the database</description>
|
||||||
<sources>
|
<sources>
|
||||||
@@ -287,8 +304,8 @@
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_BEFORE_APPLY_STIMULUS" _delta="define">
|
<event id="EVENT_ENUM_TRANSITIONS" _delta="define">
|
||||||
<description>A stimulus is about to be applied to an object</description>
|
<description>Manage the allowed transitions in current object state. The only action allowed is to deny transitions with DBObject::DenyTransition()</description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -297,89 +314,9 @@
|
|||||||
<description>The object where the stimulus is targeted</description>
|
<description>The object where the stimulus is targeted</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="stimulus">
|
<event_datum id="allowed_stimuli">
|
||||||
<description>Current stimulus applied</description>
|
<description>The list of available stimuli in the current state</description>
|
||||||
<type>string</type>
|
<type>array</type>
|
||||||
</event_datum>
|
|
||||||
<event_datum id="previous_state">
|
|
||||||
<description>Object previous state</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="new_state">
|
|
||||||
<description>Object new state</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="save_object">
|
|
||||||
<description>The object must be saved in the database</description>
|
|
||||||
<type>boolean</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="debug_info">
|
|
||||||
<description>Debug string</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
</event_data>
|
|
||||||
</event>
|
|
||||||
<event id="EVENT_DB_AFTER_APPLY_STIMULUS" _delta="define">
|
|
||||||
<description>A stimulus has been applied to an object</description>
|
|
||||||
<sources>
|
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
|
||||||
</sources>
|
|
||||||
<event_data>
|
|
||||||
<event_datum id="object">
|
|
||||||
<description>The object where the stimulus is targeted</description>
|
|
||||||
<type>DBObject</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="stimulus">
|
|
||||||
<description>Current stimulus applied</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="previous_state">
|
|
||||||
<description>Object previous state</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="new_state">
|
|
||||||
<description>Object new state</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="save_object">
|
|
||||||
<description>The object is asked to be saved in the database</description>
|
|
||||||
<type>boolean</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="debug_info">
|
|
||||||
<description>Debug string</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
</event_data>
|
|
||||||
</event>
|
|
||||||
<event id="EVENT_DB_APPLY_STIMULUS_FAILED" _delta="define">
|
|
||||||
<description>A stimulus has failed</description>
|
|
||||||
<sources>
|
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
|
||||||
</sources>
|
|
||||||
<event_data>
|
|
||||||
<event_datum id="action">
|
|
||||||
<description>The action that failed to apply the stimulus</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="object">
|
|
||||||
<description>The object where the stimulus is targeted</description>
|
|
||||||
<type>DBObject</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="stimulus">
|
|
||||||
<description>Current stimulus applied</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="previous_state">
|
|
||||||
<description>Object previous state</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="new_state">
|
|
||||||
<description>Object new state</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="save_object">
|
|
||||||
<description>The object must be saved in the database</description>
|
|
||||||
<type>boolean</type>
|
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
@@ -514,10 +451,18 @@
|
|||||||
<description>The object containing the document</description>
|
<description>The object containing the document</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
|
<event_datum id="att_code">
|
||||||
|
<description>The optional object attribute code hosting the document</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
<event_datum id="document">
|
<event_datum id="document">
|
||||||
<description>The document downloaded</description>
|
<description>The document downloaded</description>
|
||||||
<type>ormDocument</type>
|
<type>ormDocument</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
|
<event_datum id="content_disposition">
|
||||||
|
<description>The content disposition of the document ("inline" or "attachment")</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,8 +63,8 @@ class DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param \DataTableSettings $oSettings
|
* @param DataTableSettings $oSettings
|
||||||
* @param $bActionsMenu
|
* @param $bActionsMenu
|
||||||
* @param $sSelectMode
|
* @param $sSelectMode
|
||||||
* @param $bViewLink
|
* @param $bViewLink
|
||||||
@@ -141,7 +143,7 @@ class DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
* @param $iPageIndex
|
* @param $iPageIndex
|
||||||
@@ -236,7 +238,7 @@ class DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $sSelectMode
|
* @param $sSelectMode
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -255,7 +257,7 @@ class DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
* @param $iPageIndex
|
* @param $iPageIndex
|
||||||
@@ -348,7 +350,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $aExtraParams
|
* @param $aExtraParams
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -375,7 +377,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $aExtraParams
|
* @param $aExtraParams
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -405,7 +407,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $aColumns
|
* @param $aColumns
|
||||||
* @param $bViewLink
|
* @param $bViewLink
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
@@ -658,7 +660,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $aColumns
|
* @param $aColumns
|
||||||
* @param $sSelectMode
|
* @param $sSelectMode
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
@@ -790,7 +792,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
* @param $iStart
|
* @param $iStart
|
||||||
*/
|
*/
|
||||||
@@ -818,7 +820,7 @@ JS
|
|||||||
class PrintableDataTable extends DataTable
|
class PrintableDataTable extends DataTable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
* @param $iPageIndex
|
* @param $iPageIndex
|
||||||
@@ -844,7 +846,7 @@ class PrintableDataTable extends DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param $aColumns
|
* @param $aColumns
|
||||||
* @param $sSelectMode
|
* @param $sSelectMode
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ use Combodo\iTop\Application\UI\DisplayBlock\BlockChartAjaxBars\BlockChartAjaxBa
|
|||||||
use Combodo\iTop\Application\UI\DisplayBlock\BlockChartAjaxPie\BlockChartAjaxPie;
|
use Combodo\iTop\Application\UI\DisplayBlock\BlockChartAjaxPie\BlockChartAjaxPie;
|
||||||
use Combodo\iTop\Application\UI\DisplayBlock\BlockCsv\BlockCsv;
|
use Combodo\iTop\Application\UI\DisplayBlock\BlockCsv\BlockCsv;
|
||||||
use Combodo\iTop\Application\UI\DisplayBlock\BlockList\BlockList;
|
use Combodo\iTop\Application\UI\DisplayBlock\BlockList\BlockList;
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Service\Router\Router;
|
use Combodo\iTop\Service\Router\Router;
|
||||||
|
|
||||||
require_once(APPROOT.'/application/utils.inc.php');
|
require_once(APPROOT.'/application/utils.inc.php');
|
||||||
@@ -595,7 +597,7 @@ class DisplayBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @throws \ApplicationException
|
* @throws \ApplicationException
|
||||||
@@ -1354,7 +1356,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @return \Combodo\iTop\Application\UI\Base\iUIBlock
|
* @return \Combodo\iTop\Application\UI\Base\iUIBlock
|
||||||
@@ -1378,7 +1380,7 @@ JS
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
*
|
*
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
* @throws \ConfigException
|
* @throws \ConfigException
|
||||||
@@ -1456,7 +1458,7 @@ JS
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
*
|
*
|
||||||
* @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
|
* @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
|
||||||
* @throws \ApplicationException
|
* @throws \ApplicationException
|
||||||
@@ -1564,7 +1566,7 @@ JS
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.1.0 N°5957
|
* @deprecated 3.1.0 N°5957
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @return \Combodo\iTop\Application\UI\Base\Component\Html\Html|\Combodo\iTop\Application\UI\Base\Layout\UIContentBlock|string
|
* @return \Combodo\iTop\Application\UI\Base\Component\Html\Html|\Combodo\iTop\Application\UI\Base\Layout\UIContentBlock|string
|
||||||
@@ -1664,7 +1666,7 @@ JS
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
*
|
*
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
@@ -1830,7 +1832,7 @@ class MenuBlock extends DisplayBlock
|
|||||||
* an object in with the same tab active by default as the tab that was active when selecting
|
* an object in with the same tab active by default as the tab that was active when selecting
|
||||||
* the "Modify..." action.
|
* the "Modify..." action.
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param string|null $sId
|
* @param string|null $sId
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\CLIPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\Page;
|
||||||
|
|
||||||
require_once('xlsxwriter.class.php');
|
require_once('xlsxwriter.class.php');
|
||||||
|
|
||||||
class ExcelExporter
|
class ExcelExporter
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper class to build interactive forms to be used either in stand-alone
|
* Helper class to build interactive forms to be used either in stand-alone
|
||||||
@@ -828,7 +829,7 @@ class DesignerFormField
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param string $sFormId
|
* @param string $sFormId
|
||||||
* @param string $sRenderMode
|
* @param string $sRenderMode
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -119,6 +119,11 @@ class LoginDefaultAfter extends AbstractLoginFSMExtension implements iLogoutExte
|
|||||||
protected function OnConnected(&$iErrorCode)
|
protected function OnConnected(&$iErrorCode)
|
||||||
{
|
{
|
||||||
Session::Unset('login_temp_auth_user');
|
Session::Unset('login_temp_auth_user');
|
||||||
|
if (is_null(UserRights::GetUserObject())){
|
||||||
|
//N°7085 avoid infinite loop
|
||||||
|
IssueLog::Error("No user logged in. exit");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
return LoginWebPage::LOGIN_FSM_CONTINUE;
|
return LoginWebPage::LOGIN_FSM_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,4 +139,4 @@ class LoginDefaultAfter extends AbstractLoginFSMExtension implements iLogoutExte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,11 @@ class LoginForm extends AbstractLoginFSMExtension implements iLoginUIExtension
|
|||||||
$oLoginContext->AddBlockExtension('login_form_footer', new LoginBlockExtension('extensionblock/loginformfooter.html.twig'));
|
$oLoginContext->AddBlockExtension('login_form_footer', new LoginBlockExtension('extensionblock/loginformfooter.html.twig'));
|
||||||
|
|
||||||
$bEnableResetPassword = MetaModel::GetConfig()->Get('forgot_password');
|
$bEnableResetPassword = MetaModel::GetConfig()->Get('forgot_password');
|
||||||
$sResetPasswordUrl = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?loginop=forgot_pwd';
|
$sResetPasswordUrl = MetaModel::GetConfig()->Get('forgot_password.url');
|
||||||
|
if ($sResetPasswordUrl == '')
|
||||||
|
{
|
||||||
|
$sResetPasswordUrl = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?loginop=forgot_pwd';
|
||||||
|
}
|
||||||
$aData = array(
|
$aData = array(
|
||||||
'bEnableResetPassword' => $bEnableResetPassword,
|
'bEnableResetPassword' => $bEnableResetPassword,
|
||||||
'sResetPasswordUrl' => $sResetPasswordUrl,
|
'sResetPasswordUrl' => $sResetPasswordUrl,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
use Combodo\iTop\Application\Branding;
|
use Combodo\iTop\Application\Branding;
|
||||||
use Combodo\iTop\Application\TwigBase\Twig\Extension;
|
use Combodo\iTop\Application\TwigBase\Twig\Extension;
|
||||||
|
use Combodo\iTop\Application\WebPage\NiceWebPage;
|
||||||
use Twig\Environment;
|
use Twig\Environment;
|
||||||
use Twig\Loader\ChainLoader;
|
use Twig\Loader\ChainLoader;
|
||||||
use Twig\Loader\FilesystemLoader;
|
use Twig\Loader\FilesystemLoader;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
use Combodo\iTop\Application\Branding;
|
use Combodo\iTop\Application\Branding;
|
||||||
use Combodo\iTop\Application\Helper\Session;
|
use Combodo\iTop\Application\Helper\Session;
|
||||||
|
use Combodo\iTop\Application\WebPage\ErrorPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\NiceWebPage;
|
||||||
use Combodo\iTop\Service\Events\EventData;
|
use Combodo\iTop\Service\Events\EventData;
|
||||||
use Combodo\iTop\Service\Events\EventService;
|
use Combodo\iTop\Service\Events\EventService;
|
||||||
|
|
||||||
@@ -80,7 +82,7 @@ class LoginWebPage extends NiceWebPage
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected static $m_sLoginFailedMessage = '';
|
protected static $m_sLoginFailedMessage = '';
|
||||||
|
|
||||||
public function __construct($sTitle = null)
|
public function __construct($sTitle = null)
|
||||||
{
|
{
|
||||||
if ($sTitle === null) {
|
if ($sTitle === null) {
|
||||||
@@ -90,7 +92,7 @@ class LoginWebPage extends NiceWebPage
|
|||||||
parent::__construct($sTitle);
|
parent::__construct($sTitle);
|
||||||
$this->SetStyleSheet();
|
$this->SetStyleSheet();
|
||||||
$this->no_cache();
|
$this->no_cache();
|
||||||
$this->add_xframe_options();
|
$this->add_http_headers();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SetStyleSheet()
|
public function SetStyleSheet()
|
||||||
@@ -99,6 +101,15 @@ class LoginWebPage extends NiceWebPage
|
|||||||
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/all.min.css');
|
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/all.min.css');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function GetFaviconAbsoluteUrl()
|
||||||
|
{
|
||||||
|
return Branding::GetLoginFavIconAbsoluteUrl();
|
||||||
|
}
|
||||||
|
|
||||||
public static function SetLoginFailedMessage($sMessage)
|
public static function SetLoginFailedMessage($sMessage)
|
||||||
{
|
{
|
||||||
self::$m_sLoginFailedMessage = $sMessage;
|
self::$m_sLoginFailedMessage = $sMessage;
|
||||||
@@ -908,13 +919,13 @@ class LoginWebPage extends NiceWebPage
|
|||||||
$aAllProfiles = array();
|
$aAllProfiles = array();
|
||||||
while ($oProfile = $oProfilesSet->Fetch())
|
while ($oProfile = $oProfilesSet->Fetch())
|
||||||
{
|
{
|
||||||
$aAllProfiles[strtolower($oProfile->GetName())] = $oProfile->GetKey();
|
$aAllProfiles[mb_strtolower($oProfile->GetName())] = $oProfile->GetKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
$aProfiles = array();
|
$aProfiles = array();
|
||||||
foreach ($aRequestedProfiles as $sRequestedProfile)
|
foreach ($aRequestedProfiles as $sRequestedProfile)
|
||||||
{
|
{
|
||||||
$sRequestedProfile = strtolower($sRequestedProfile);
|
$sRequestedProfile = mb_strtolower($sRequestedProfile);
|
||||||
if (isset($aAllProfiles[$sRequestedProfile]))
|
if (isset($aAllProfiles[$sRequestedProfile]))
|
||||||
{
|
{
|
||||||
$aProfiles[] = $aAllProfiles[$sRequestedProfile];
|
$aProfiles[] = $aAllProfiles[$sRequestedProfile];
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
// Maintenance message display functions
|
// Maintenance message display functions
|
||||||
// Only included by approot.inc.php
|
// Only included by approot.inc.php
|
||||||
//
|
//
|
||||||
|
use Combodo\iTop\Application\WebPage\ErrorPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use a setup page to display the maintenance message
|
* Use a setup page to display the maintenance message
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\Helper\WebResourcesHelper;
|
use Combodo\iTop\Application\Helper\WebResourcesHelper;
|
||||||
|
use Combodo\iTop\Application\WebPage\ErrorPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
require_once(APPROOT.'/application/utils.inc.php');
|
require_once(APPROOT.'/application/utils.inc.php');
|
||||||
require_once(APPROOT.'/application/template.class.inc.php');
|
require_once(APPROOT.'/application/template.class.inc.php');
|
||||||
@@ -345,7 +348,7 @@ class ApplicationMenu
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point to display the whole menu into the web page, used by iTopWebPage
|
* Entry point to display the whole menu into the web page, used by iTopWebPage
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @throws DictExceptionMissingString
|
* @throws DictExceptionMissingString
|
||||||
*
|
*
|
||||||
@@ -419,7 +422,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Handles the display of the sub-menus (called recursively if necessary)
|
* Handles the display of the sub-menus (called recursively if necessary)
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param array $aMenus
|
* @param array $aMenus
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param int $iActiveMenu
|
* @param int $iActiveMenu
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSetUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSetUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\TextArea;
|
use Combodo\iTop\Application\UI\Base\Component\Input\TextArea;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
abstract class Query extends cmdbAbstractObject
|
abstract class Query extends cmdbAbstractObject
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
||||||
/**
|
/**
|
||||||
* This class manages the special template format used internally to build the iTop web pages
|
* This class manages the special template format used internally to build the iTop web pages
|
||||||
|
|||||||
@@ -536,7 +536,7 @@ CSS;
|
|||||||
if (static::HasImageExtension($sImg)
|
if (static::HasImageExtension($sImg)
|
||||||
&& ! array_key_exists($sImg, $aImages))
|
&& ! array_key_exists($sImg, $aImages))
|
||||||
{
|
{
|
||||||
$sFilePath = realpath($sImg);
|
$sFilePath = utils::RealPath($sImg, APPROOT);
|
||||||
if ($sFilePath !== false) {
|
if ($sFilePath !== false) {
|
||||||
$sFilePathWithSlashes = str_replace('\\', '/', $sFilePath);
|
$sFilePathWithSlashes = str_replace('\\', '/', $sFilePath);
|
||||||
$aImages[$sImg] = $sFilePathWithSlashes;
|
$aImages[$sImg] = $sFilePathWithSlashes;
|
||||||
@@ -544,7 +544,7 @@ CSS;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sCanonicalPath = static::CanonicalizePath($sTargetThemeFolderPath.'/'.$sImg);
|
$sCanonicalPath = static::CanonicalizePath($sTargetThemeFolderPath.'/'.$sImg);
|
||||||
$sFilePath = realpath($sCanonicalPath);
|
$sFilePath = utils::RealPath($sCanonicalPath, APPROOT);
|
||||||
if ($sFilePath !== false) {
|
if ($sFilePath !== false) {
|
||||||
$sFilePathWithSlashes = str_replace('\\', '/', $sFilePath);
|
$sFilePathWithSlashes = str_replace('\\', '/', $sFilePath);
|
||||||
$aImages[$sImg] = $sFilePathWithSlashes;
|
$aImages[$sImg] = $sFilePathWithSlashes;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
use Combodo\iTop\Application\Helper\FormHelper;
|
use Combodo\iTop\Application\Helper\FormHelper;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Form\FormUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Form\FormUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Core\MetaModel\FriendlyNameType;
|
use Combodo\iTop\Core\MetaModel\FriendlyNameType;
|
||||||
|
|
||||||
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
||||||
@@ -65,7 +66,7 @@ class UIExtKeyWidget
|
|||||||
//public function __construct($sAttCode, $sClass, $sTitle, $oAllowedValues, $value, $iInputId, $bMandatory, $sNameSuffix = '', $sFieldPrefix = '', $sFormPrefix = '')
|
//public function __construct($sAttCode, $sClass, $sTitle, $oAllowedValues, $value, $iInputId, $bMandatory, $sNameSuffix = '', $sFieldPrefix = '', $sFormPrefix = '')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param string $sAttCode
|
* @param string $sAttCode
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param string $sTitle
|
* @param string $sTitle
|
||||||
@@ -132,7 +133,7 @@ class UIExtKeyWidget
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param int $iMaxComboLength
|
* @param int $iMaxComboLength
|
||||||
* @param bool $bAllowTargetCreation
|
* @param bool $bAllowTargetCreation
|
||||||
* @param string $sTitle
|
* @param string $sTitle
|
||||||
@@ -444,7 +445,7 @@ JS
|
|||||||
/**
|
/**
|
||||||
* Get the HTML fragment corresponding to the ext key editing widget
|
* Get the HTML fragment corresponding to the ext key editing widget
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param int $iMaxComboLength
|
* @param int $iMaxComboLength
|
||||||
* @param boolean $bAllowTargetCreation
|
* @param boolean $bAllowTargetCreation
|
||||||
* @param string $sTitle
|
* @param string $sTitle
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
use Combodo\iTop\Application\Helper\WebResourcesHelper;
|
use Combodo\iTop\Application\Helper\WebResourcesHelper;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UIHTMLEditorWidget
|
* Class UIHTMLEditorWidget
|
||||||
@@ -71,15 +72,16 @@ class UIHTMLEditorWidget
|
|||||||
// To change the default settings of the editor,
|
// To change the default settings of the editor,
|
||||||
// a) edit the file /js/ckeditor/config.js
|
// a) edit the file /js/ckeditor/config.js
|
||||||
// b) or override some of the configuration settings, using the second parameter of ckeditor()
|
// b) or override some of the configuration settings, using the second parameter of ckeditor()
|
||||||
|
$sJSDefineWidth = '';
|
||||||
$aConfig = utils::GetCkeditorPref();
|
$aConfig = utils::GetCkeditorPref();
|
||||||
$sWidthSpec = addslashes(trim($this->m_oAttDef->GetWidth()));
|
$sWidthSpec = addslashes(trim($this->m_oAttDef->GetWidth()));
|
||||||
if ($sWidthSpec != '')
|
if ($sWidthSpec != '') {
|
||||||
{
|
/*N°6543 - the function min allow to keep text inside the column when width is defined*/
|
||||||
$aConfig['width'] = $sWidthSpec;
|
$aConfig['width'] = "min($sWidthSpec,100%)";
|
||||||
|
$sJSDefineWidth = '$("#cke_'.$iId.' iframe").contents().find("body").css("width", "'.$sWidthSpec.'")';
|
||||||
}
|
}
|
||||||
$sHeightSpec = addslashes(trim($this->m_oAttDef->GetHeight()));
|
$sHeightSpec = addslashes(trim($this->m_oAttDef->GetHeight()));
|
||||||
if ($sHeightSpec != '')
|
if ($sHeightSpec != '') {
|
||||||
{
|
|
||||||
$aConfig['height'] = $sHeightSpec;
|
$aConfig['height'] = $sHeightSpec;
|
||||||
}
|
}
|
||||||
$sConfigJS = json_encode($aConfig);
|
$sConfigJS = json_encode($aConfig);
|
||||||
@@ -110,6 +112,7 @@ $('#$iId').on('update', function(evt){
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
oMe.data('ckeditorInstance').setReadOnly(oMe.prop('disabled'));
|
oMe.data('ckeditorInstance').setReadOnly(oMe.prop('disabled'));
|
||||||
|
$sJSDefineWidth
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
setTimeout(delayedSetReadOnly, 50);
|
setTimeout(delayedSetReadOnly, 50);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
use Combodo\iTop\Application\Helper\FormHelper;
|
use Combodo\iTop\Application\Helper\FormHelper;
|
||||||
use Combodo\iTop\Application\UI\Links\Direct\BlockDirectLinkSetEditTable;
|
use Combodo\iTop\Application\UI\Links\Direct\BlockDirectLinkSetEditTable;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTableRow\FormTableRow;
|
use Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTableRow\FormTableRow;
|
||||||
use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinkSetEditTable;
|
use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinkSetEditTable;
|
||||||
use Combodo\iTop\Application\UI\Links\Indirect\BlockObjectPickerDialog;
|
use Combodo\iTop\Application\UI\Links\Indirect\BlockObjectPickerDialog;
|
||||||
|
use Combodo\iTop\Application\WebPage\JsonPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
||||||
|
|
||||||
require_once(APPROOT.'application/displayblock.class.inc.php');
|
require_once(APPROOT.'application/displayblock.class.inc.php');
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
||||||
|
|
||||||
class UIPasswordWidget
|
class UIPasswordWidget
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
||||||
|
|
||||||
class UISearchFormForeignKeys
|
class UISearchFormForeignKeys
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,7 +20,10 @@
|
|||||||
use Combodo\iTop\Application\Helper\Session;
|
use Combodo\iTop\Application\Helper\Session;
|
||||||
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
||||||
|
use Combodo\iTop\Application\UI\Hook\iKeyboardShortcut;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Service\Module\ModuleService;
|
use Combodo\iTop\Service\Module\ModuleService;
|
||||||
|
use Combodo\iTop\Test\UnitTest\Application\utilsTest;
|
||||||
use ScssPhp\ScssPhp\Compiler;
|
use ScssPhp\ScssPhp\Compiler;
|
||||||
use ScssPhp\ScssPhp\OutputStyle;
|
use ScssPhp\ScssPhp\OutputStyle;
|
||||||
use ScssPhp\ScssPhp\ValueConverter;
|
use ScssPhp\ScssPhp\ValueConverter;
|
||||||
@@ -165,7 +168,11 @@ class utils
|
|||||||
|
|
||||||
private static $iNextId = 0;
|
private static $iNextId = 0;
|
||||||
|
|
||||||
private static $m_sAppRootUrl = null;
|
/**
|
||||||
|
* @var ?string
|
||||||
|
* @used-by GetAbsoluteUrlAppRoot
|
||||||
|
*/
|
||||||
|
private static $sAbsoluteUrlAppRootCache = null;
|
||||||
|
|
||||||
protected static function LoadParamFile($sParamFile)
|
protected static function LoadParamFile($sParamFile)
|
||||||
{
|
{
|
||||||
@@ -1035,28 +1042,27 @@ class utils
|
|||||||
return $bTrustProxies;
|
return $bTrustProxies;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the absolute URL to the application root path
|
* Returns the absolute URL to the application root path
|
||||||
*
|
*
|
||||||
* @param bool $bForceTrustProxy
|
* @param bool $bForceTrustProxy
|
||||||
*
|
*
|
||||||
* @return string The absolute URL to the application root, without the first slash
|
* @return string The absolute URL to the application root, without the first slash
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*
|
*
|
||||||
* @since 2.7.4 $bForceTrustProxy param added
|
* @since 2.7.4 $bForceTrustProxy param added
|
||||||
*/
|
*/
|
||||||
public static function GetAbsoluteUrlAppRoot($bForceTrustProxy = false)
|
public static function GetAbsoluteUrlAppRoot($bForceTrustProxy = false)
|
||||||
{
|
{
|
||||||
$sUrl = static::$m_sAppRootUrl;
|
if (static::$sAbsoluteUrlAppRootCache === null || $bForceTrustProxy)
|
||||||
if ($sUrl === null || $bForceTrustProxy)
|
|
||||||
{
|
{
|
||||||
$sUrl = self::GetConfig()->Get('app_root_url');
|
static::$sAbsoluteUrlAppRootCache = self::GetConfig()->Get('app_root_url');
|
||||||
if ($sUrl == '')
|
if (static::$sAbsoluteUrlAppRootCache == '')
|
||||||
{
|
{
|
||||||
$sUrl = self::GetDefaultUrlAppRoot($bForceTrustProxy);
|
static::$sAbsoluteUrlAppRootCache = self::GetDefaultUrlAppRoot($bForceTrustProxy);
|
||||||
}
|
}
|
||||||
elseif (strpos($sUrl, SERVER_NAME_PLACEHOLDER) > -1)
|
elseif (strpos(static::$sAbsoluteUrlAppRootCache, SERVER_NAME_PLACEHOLDER) > -1)
|
||||||
{
|
{
|
||||||
if (isset($_SERVER['SERVER_NAME']))
|
if (isset($_SERVER['SERVER_NAME']))
|
||||||
{
|
{
|
||||||
@@ -1067,11 +1073,10 @@ class utils
|
|||||||
// CLI mode ?
|
// CLI mode ?
|
||||||
$sServerName = php_uname('n');
|
$sServerName = php_uname('n');
|
||||||
}
|
}
|
||||||
$sUrl = str_replace(SERVER_NAME_PLACEHOLDER, $sServerName, $sUrl);
|
static::$sAbsoluteUrlAppRootCache = str_replace(SERVER_NAME_PLACEHOLDER, $sServerName, static::$sAbsoluteUrlAppRootCache);
|
||||||
}
|
}
|
||||||
static::$m_sAppRootUrl = $sUrl;
|
|
||||||
}
|
}
|
||||||
return static::$m_sAppRootUrl;
|
return static::$sAbsoluteUrlAppRootCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1453,7 +1458,7 @@ class utils
|
|||||||
/**
|
/**
|
||||||
* Merge standard menu items with plugin provided menus items
|
* Merge standard menu items with plugin provided menus items
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param int $iMenuId
|
* @param int $iMenuId
|
||||||
* @param \DBObjectSet $param
|
* @param \DBObjectSet $param
|
||||||
* @param array $aActions
|
* @param array $aActions
|
||||||
@@ -2956,7 +2961,7 @@ HTML;
|
|||||||
$aResultPref = [];
|
$aResultPref = [];
|
||||||
$aShortcutPrefs = appUserPreferences::GetPref('keyboard_shortcuts', []);
|
$aShortcutPrefs = appUserPreferences::GetPref('keyboard_shortcuts', []);
|
||||||
// Note: Mind the 4 blackslashes, see utils::GetClassesForInterface()
|
// Note: Mind the 4 blackslashes, see utils::GetClassesForInterface()
|
||||||
$aShortcutClasses = utils::GetClassesForInterface('iKeyboardShortcut', '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]', '[\\\\/]tests[\\\\/]'));
|
$aShortcutClasses = utils::GetClassesForInterface(iKeyboardShortcut::class, '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]', '[\\\\/]tests[\\\\/]'));
|
||||||
|
|
||||||
foreach ($aShortcutClasses as $cShortcutPlugin) {
|
foreach ($aShortcutClasses as $cShortcutPlugin) {
|
||||||
$sTriggeredElement = $cShortcutPlugin::GetShortcutTriggeredElementSelector();
|
$sTriggeredElement = $cShortcutPlugin::GetShortcutTriggeredElementSelector();
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
require_once(APPROOT.'/application/uiwizard.class.inc.php');
|
require_once(APPROOT.'/application/uiwizard.class.inc.php');
|
||||||
|
|
||||||
class WizardHelper
|
class WizardHelper
|
||||||
@@ -367,7 +369,7 @@ JS;
|
|||||||
/**
|
/**
|
||||||
* Add necessary JS snippets (to the page) to be executed for fields update
|
* Add necessary JS snippets (to the page) to be executed for fields update
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @return void
|
* @return void
|
||||||
* @since 3.0.3-2 3.0.4 3.1.1 3.2.0 N°6766
|
* @since 3.0.3-2 3.0.4 3.1.1 3.2.0 N°6766
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ define('APPCONF', APPROOT.'conf/');
|
|||||||
*
|
*
|
||||||
* @see ITOP_CORE_VERSION to get full iTop core version
|
* @see ITOP_CORE_VERSION to get full iTop core version
|
||||||
*/
|
*/
|
||||||
define('ITOP_DESIGN_LATEST_VERSION', '3.1');
|
define('ITOP_DESIGN_LATEST_VERSION', '3.2');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant containing the iTop core version, whatever application was built
|
* Constant containing the iTop core version, whatever application was built
|
||||||
@@ -23,7 +23,7 @@ define('ITOP_DESIGN_LATEST_VERSION', '3.1');
|
|||||||
* @used-by utils::GetItopVersionWikiSyntax()
|
* @used-by utils::GetItopVersionWikiSyntax()
|
||||||
* @used-by iTopModulesPhpVersionIntegrationTest
|
* @used-by iTopModulesPhpVersionIntegrationTest
|
||||||
*/
|
*/
|
||||||
define('ITOP_CORE_VERSION', '3.1.1');
|
define('ITOP_CORE_VERSION', '3.2.0');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"type": "project",
|
"type": "project",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.4.0 <8.2.0",
|
"php": ">=8.1.0 <8.4.0",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
@@ -13,28 +13,32 @@
|
|||||||
"ext-mysqli": "*",
|
"ext-mysqli": "*",
|
||||||
"ext-soap": "*",
|
"ext-soap": "*",
|
||||||
"apereo/phpcas": "~1.6.0",
|
"apereo/phpcas": "~1.6.0",
|
||||||
"combodo/tcpdf": "~6.4.4",
|
"firebase/php-jwt": "^6.4.0",
|
||||||
"firebase/php-jwt": "~6.4.0",
|
|
||||||
"guzzlehttp/guzzle": "^7.5.1",
|
"guzzlehttp/guzzle": "^7.5.1",
|
||||||
"laminas/laminas-mail": "^2.11",
|
"laminas/laminas-mail": "^2.11",
|
||||||
"laminas/laminas-servicemanager": "^3.5",
|
"laminas/laminas-servicemanager": "^3.5",
|
||||||
"league/oauth2-google": "^3.0",
|
"league/oauth2-google": "^4.0.1",
|
||||||
"nikic/php-parser": "~4.14.0",
|
"nikic/php-parser": "^4.14.0",
|
||||||
"pear/archive_tar": "~1.4.14",
|
"pear/archive_tar": "~1.4.14",
|
||||||
"pelago/emogrifier": "^6.0.0",
|
"pelago/emogrifier": "^7.2.0",
|
||||||
"scssphp/scssphp": "^1.10.3",
|
"psr/log": "^3.0.0",
|
||||||
"symfony/console": "5.4.*",
|
"scssphp/scssphp": "^1.12.1",
|
||||||
"symfony/dotenv": "5.4.*",
|
"symfony/console": "~6.4.0",
|
||||||
"symfony/framework-bundle": "5.4.*",
|
"symfony/dotenv": "~6.4.0",
|
||||||
"symfony/http-foundation": "5.4.*",
|
"symfony/framework-bundle": "~6.4.0",
|
||||||
"symfony/http-kernel": "5.4.*",
|
"symfony/http-foundation": "~6.4.0",
|
||||||
"symfony/twig-bundle": "5.4.*",
|
"symfony/http-kernel": "~6.4.0",
|
||||||
"symfony/yaml": "5.4.*",
|
"symfony/runtime": "~6.4.0",
|
||||||
|
"symfony/twig-bundle": "~6.4.0",
|
||||||
|
"symfony/var-dumper": "~6.4.0",
|
||||||
|
"symfony/yaml": "~6.4.0",
|
||||||
|
"tecnickcom/tcpdf": "^6.6.0",
|
||||||
"thenetworg/oauth2-azure": "^2.0"
|
"thenetworg/oauth2-azure": "^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/stopwatch": "5.4.*",
|
"symfony/debug-bundle": "~6.4.0",
|
||||||
"symfony/web-profiler-bundle": "5.4.*"
|
"symfony/stopwatch": "~6.4.0",
|
||||||
|
"symfony/web-profiler-bundle": "~6.4.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-libsodium": "Required to use the AttributeEncryptedString.",
|
"ext-libsodium": "Required to use the AttributeEncryptedString.",
|
||||||
@@ -46,7 +50,7 @@
|
|||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "7.4.0"
|
"php": "8.1.0"
|
||||||
},
|
},
|
||||||
"vendor-dir": "lib",
|
"vendor-dir": "lib",
|
||||||
"preferred-install": {
|
"preferred-install": {
|
||||||
@@ -54,7 +58,10 @@
|
|||||||
},
|
},
|
||||||
"sort-packages": true,
|
"sort-packages": true,
|
||||||
"classmap-authoritative": true,
|
"classmap-authoritative": true,
|
||||||
"platform-check": true
|
"platform-check": true,
|
||||||
|
"allow-plugins": {
|
||||||
|
"symfony/runtime": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
"classmap": [
|
||||||
@@ -72,6 +79,9 @@
|
|||||||
"application/logindefault.class.inc.php",
|
"application/logindefault.class.inc.php",
|
||||||
"application/loginexternal.class.inc.php",
|
"application/loginexternal.class.inc.php",
|
||||||
"application/loginurl.class.inc.php"
|
"application/loginurl.class.inc.php"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"sources/alias.php"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
@@ -81,11 +91,15 @@
|
|||||||
"symfony": {
|
"symfony": {
|
||||||
"allow-contrib": false,
|
"allow-contrib": false,
|
||||||
"require": "3.4.*"
|
"require": "3.4.*"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"dotenv_path": "symfony/.env"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-install-cmd": ["@rmDeniedTestDir"],
|
"post-install-cmd": ["@rmDeniedTestDir", "@tcpdfCustomFonts"],
|
||||||
"post-update-cmd": ["@rmDeniedTestDir"],
|
"post-update-cmd": ["@rmDeniedTestDir", "@tcpdfCustomFonts"],
|
||||||
"rmDeniedTestDir": "@php .make/composer/rmDeniedTestDir.php"
|
"rmDeniedTestDir": "@php .make/composer/rmDeniedTestDir.php",
|
||||||
|
"tcpdfCustomFonts": "@php .make/composer/tcpdf/tcpdfUpdateFonts.php"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2073
composer.lock
generated
2073
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -521,6 +521,6 @@ class Str
|
|||||||
|
|
||||||
public static function islowcase($sString)
|
public static function islowcase($sString)
|
||||||
{
|
{
|
||||||
return (strtolower($sString) == $sString);
|
return (mb_strtolower($sString) == $sString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
use Combodo\iTop\Application\TwigBase\Twig\TwigHelper;
|
use Combodo\iTop\Application\TwigBase\Twig\TwigHelper;
|
||||||
|
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
use Combodo\iTop\Service\Notification\NotificationsRepository;
|
||||||
|
use Combodo\iTop\Service\Notification\NotificationsService;
|
||||||
|
use Combodo\iTop\Service\Router\Router;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persistent classes (internal): user defined actions
|
* Persistent classes (internal): user defined actions
|
||||||
@@ -76,6 +81,7 @@ abstract class Action extends cmdbAbstractObject
|
|||||||
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("trigger_list",
|
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("trigger_list",
|
||||||
array("linked_class" => "lnkTriggerAction", "ext_key_to_me" => "action_id", "ext_key_to_remote" => "trigger_id", "allowed_values" => null, "count_min" => 0, "count_max" => 0, "depends_on" => array(), "display_style" => 'property')));
|
array("linked_class" => "lnkTriggerAction", "ext_key_to_me" => "action_id", "ext_key_to_remote" => "trigger_id", "allowed_values" => null, "count_min" => 0, "count_max" => 0, "depends_on" => array(), "display_style" => 'property')));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeEnum("asynchronous", array("allowed_values" => new ValueSetEnum(['use_global_setting' => 'Use global settings','yes' => 'Yes' ,'no' => 'No']), "sql" => "asynchronous", "default_value" => 'use_global_setting', "is_null_allowed" => false, "depends_on" => array())));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
// - Attributes to be displayed for the complete details
|
// - Attributes to be displayed for the complete details
|
||||||
@@ -167,6 +173,100 @@ abstract class Action extends cmdbAbstractObject
|
|||||||
$this->m_aCheckWarnings[] = Dict::S('Action:WarningNoTriggerLinked');
|
$this->m_aCheckWarnings[] = Dict::S('Action:WarningNoTriggerLinked');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 3.2.0 N°5472 method creation
|
||||||
|
*/
|
||||||
|
public function DisplayBareRelations(WebPage $oPage, $bEditMode = false)
|
||||||
|
{
|
||||||
|
parent::DisplayBareRelations($oPage, false);
|
||||||
|
|
||||||
|
if ($oPage instanceof iTopWebPage) {
|
||||||
|
$this->GenerateLastExecutionsTab($oPage, $bEditMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 3.2.0 N°5472 method creation
|
||||||
|
*/
|
||||||
|
protected function GenerateLastExecutionsTab(iTopWebPage $oPage, $bEditMode)
|
||||||
|
{
|
||||||
|
$oRouter = Router::GetInstance();
|
||||||
|
$sActionLastExecutionsPageUrl = $oRouter->GenerateUrl('notifications.action.last_executions_tab', ['action_id' => $this->GetKey()]);
|
||||||
|
$oPage->AddAjaxTab('action_errors', $sActionLastExecutionsPageUrl, false, Dict::S('Action:last_executions_tab'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \Combodo\iTop\Application\WebPage\WebPage $oPage
|
||||||
|
*
|
||||||
|
* @throws \ApplicationException
|
||||||
|
* @throws \ArchivedObjectException
|
||||||
|
* @throws \ConfigException
|
||||||
|
* @throws \CoreException
|
||||||
|
* @throws \CoreUnexpectedValue
|
||||||
|
* @throws \DictExceptionMissingString
|
||||||
|
* @throws \InvalidConfigParamException
|
||||||
|
* @throws \MissingQueryArgument
|
||||||
|
* @throws \MySQLException
|
||||||
|
* @throws \MySQLHasGoneAwayException
|
||||||
|
* @throws \OQLException
|
||||||
|
* @throws \ReflectionException
|
||||||
|
* @since 3.2.0 N°5472 method creation
|
||||||
|
*/
|
||||||
|
public function GetLastExecutionsTabContent(WebPage $oPage): void
|
||||||
|
{
|
||||||
|
$oConfig = utils::GetConfig();
|
||||||
|
$sLastExecutionDaysConfigParamName = 'notifications.last_executions_days';
|
||||||
|
$iLastExecutionDays = $oConfig->Get($sLastExecutionDaysConfigParamName);
|
||||||
|
|
||||||
|
if ($iLastExecutionDays < 0) {
|
||||||
|
throw new InvalidConfigParamException("Invalid value for {$sLastExecutionDaysConfigParamName} config parameter. Param desc: " . $oConfig->GetDescription($sLastExecutionDaysConfigParamName));
|
||||||
|
}
|
||||||
|
|
||||||
|
$sActionQueryOql = 'SELECT EventNotification WHERE action_id = :action_id';
|
||||||
|
$aActionQueryParams = ['action_id' => $this->GetKey()];
|
||||||
|
if ($iLastExecutionDays > 0) {
|
||||||
|
$sActionQueryOql .= ' AND date > DATE_SUB(NOW(), INTERVAL :days DAY)';
|
||||||
|
$aActionQueryParams['days'] = $iLastExecutionDays;
|
||||||
|
$sActionQueryLimit = Dict::Format('Action:last_executions_tab_limit_days', $iLastExecutionDays);
|
||||||
|
} else {
|
||||||
|
$sActionQueryLimit = Dict::S('Action:last_executions_tab_limit_none');
|
||||||
|
}
|
||||||
|
|
||||||
|
$oActionFilter = DBObjectSearch::FromOQL($sActionQueryOql, $aActionQueryParams);
|
||||||
|
$oSet = new DBObjectSet($oActionFilter, ['date' => false]);
|
||||||
|
|
||||||
|
$sPanelTitle = Dict::Format('Action:last_executions_tab_panel_title', $sActionQueryLimit);
|
||||||
|
$oExecutionsListBlock = DataTableUIBlockFactory::MakeForResult($oPage, 'action_executions_list', $oSet, ['panel_title' => $sPanelTitle]);
|
||||||
|
|
||||||
|
$oPage->AddUiBlock($oExecutionsListBlock);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will be overloaded by the children classes to return the value of their global asynchronous setting (eg. `email_asynchronous` for `\ActionEmail`, `prefer_asynchronous` for `\ActionWebhook`, ...)
|
||||||
|
*
|
||||||
|
* @return bool true if the global setting for this kind of action if to be executed asynchronously, false otherwise.
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public static function GetAsynchronousGlobalSetting(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool true if that action instance should be executed asynchronously, otherwise false
|
||||||
|
* @throws \ArchivedObjectException
|
||||||
|
* @throws \CoreException
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function IsAsynchronous(): bool
|
||||||
|
{
|
||||||
|
$sAsynchronous = $this->Get('asynchronous');
|
||||||
|
if ($sAsynchronous === 'use_global_setting') {
|
||||||
|
return static::GetAsynchronousGlobalSetting();
|
||||||
|
}
|
||||||
|
return $sAsynchronous === 'yes';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,12 +301,39 @@ abstract class ActionNotification extends Action
|
|||||||
MetaModel::Init_SetZListItems('details', array('name', 'description', 'status', 'trigger_list'));
|
MetaModel::Init_SetZListItems('details', array('name', 'description', 'status', 'trigger_list'));
|
||||||
// - Attributes to be displayed for a list
|
// - Attributes to be displayed for a list
|
||||||
MetaModel::Init_SetZListItems('list', array('finalclass', 'description', 'status'));
|
MetaModel::Init_SetZListItems('list', array('finalclass', 'description', 'status'));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeApplicationLanguage("language", array("sql"=>"language", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
|
|
||||||
// Search criteria
|
// Search criteria
|
||||||
// - Criteria of the std search form
|
// - Criteria of the std search form
|
||||||
// MetaModel::Init_SetZListItems('standard_search', array('name'));
|
// MetaModel::Init_SetZListItems('standard_search', array('name'));
|
||||||
// - Default criteria of the search form
|
// - Default criteria of the search form
|
||||||
// MetaModel::Init_SetZListItems('default_search', array('name'));
|
// MetaModel::Init_SetZListItems('default_search', array('name'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $sLanguage
|
||||||
|
* @param $sLanguageCode
|
||||||
|
*
|
||||||
|
* @return array [$sPreviousLanguage, $aPreviousPluginProperties]
|
||||||
|
* @throws \ArchivedObjectException
|
||||||
|
* @throws \CoreException
|
||||||
|
* @throws \DictExceptionUnknownLanguage
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function SetNotificationLanguage($sLanguage = null, $sLanguageCode = null){
|
||||||
|
$sPreviousLanguage = Dict::GetUserLanguage();
|
||||||
|
$aPreviousPluginProperties = ApplicationContext::GetPluginProperties('QueryLocalizerPlugin');
|
||||||
|
$sLanguage = $sLanguage ?? $this->Get('language');
|
||||||
|
$sLanguageCode = $sLanguageCode ?? $sLanguage;
|
||||||
|
if (!utils::IsNullOrEmptyString($sLanguage)) {
|
||||||
|
// If a language is specified for this action, force this language
|
||||||
|
// when rendering all placeholders inside this message
|
||||||
|
Dict::SetUserLanguage($sLanguage);
|
||||||
|
AttributeDateTime::LoadFormatFromConfig();
|
||||||
|
ApplicationContext::SetPluginProperty('QueryLocalizerPlugin', 'language_code', $sLanguageCode);
|
||||||
|
}
|
||||||
|
return [$sPreviousLanguage, $aPreviousPluginProperties];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -257,6 +384,7 @@ class ActionEmail extends ActionNotification
|
|||||||
"db_table" => "priv_action_email",
|
"db_table" => "priv_action_email",
|
||||||
"db_key_field" => "id",
|
"db_key_field" => "id",
|
||||||
"db_finalclass_field" => "",
|
"db_finalclass_field" => "",
|
||||||
|
'style' => new ormStyle(null, null, null, null, null, '../images/icons/icons8-mailing.svg'),
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
MetaModel::Init_InheritAttributes();
|
MetaModel::Init_InheritAttributes();
|
||||||
@@ -273,7 +401,6 @@ class ActionEmail extends ActionNotification
|
|||||||
MetaModel::Init_AddAttribute(new AttributeTemplateString("subject", array("allowed_values" => null, "sql" => "subject", "default_value" => null, "is_null_allowed" => false, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeTemplateString("subject", array("allowed_values" => null, "sql" => "subject", "default_value" => null, "is_null_allowed" => false, "depends_on" => array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeTemplateHTML("body", array("allowed_values" => null, "sql" => "body", "default_value" => null, "is_null_allowed" => false, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeTemplateHTML("body", array("allowed_values" => null, "sql" => "body", "default_value" => null, "is_null_allowed" => false, "depends_on" => array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeEnum("importance", array("allowed_values" => new ValueSetEnum('low,normal,high'), "sql" => "importance", "default_value" => 'normal', "is_null_allowed" => false, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeEnum("importance", array("allowed_values" => new ValueSetEnum('low,normal,high'), "sql" => "importance", "default_value" => 'normal', "is_null_allowed" => false, "depends_on" => array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeApplicationLanguage("language", array("sql"=>"language", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeBlob("html_template", array("is_null_allowed"=>true, "depends_on"=>array(), "always_load_in_tables"=>false)));
|
MetaModel::Init_AddAttribute(new AttributeBlob("html_template", array("is_null_allowed"=>true, "depends_on"=>array(), "always_load_in_tables"=>false)));
|
||||||
MetaModel::Init_AddAttribute(new AttributeEnum("ignore_notify", array("allowed_values" => new ValueSetEnum('yes,no'), "sql" => "ignore_notify", "default_value" => 'yes', "is_null_allowed" => false, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeEnum("ignore_notify", array("allowed_values" => new ValueSetEnum('yes,no'), "sql" => "ignore_notify", "default_value" => 'yes', "is_null_allowed" => false, "depends_on" => array())));
|
||||||
|
|
||||||
@@ -294,6 +421,7 @@ class ActionEmail extends ActionNotification
|
|||||||
),
|
),
|
||||||
'fieldset:ActionEmail:trigger' => array(
|
'fieldset:ActionEmail:trigger' => array(
|
||||||
0 => 'trigger_list',
|
0 => 'trigger_list',
|
||||||
|
1 => 'asynchronous'
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'col:col2' => array(
|
'col:col2' => array(
|
||||||
@@ -328,27 +456,33 @@ class ActionEmail extends ActionNotification
|
|||||||
protected $m_aMailErrors; //array of strings explaining the issue
|
protected $m_aMailErrors; //array of strings explaining the issue
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a the list of emails as a string, or a detailed error description
|
* Return the list of emails as a string, or a detailed error description
|
||||||
*
|
*
|
||||||
* @param string $sRecipAttCode
|
* @param string $sRecipAttCode
|
||||||
* @param array $aArgs
|
* @param array $aArgs
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
|
* @throws \CoreCannotSaveObjectException
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
* @throws \CoreUnexpectedValue
|
* @throws \CoreUnexpectedValue
|
||||||
|
* @throws \CoreWarning
|
||||||
|
* @throws \MissingQueryArgument
|
||||||
* @throws \MySQLException
|
* @throws \MySQLException
|
||||||
|
* @throws \MySQLHasGoneAwayException
|
||||||
|
* @throws \OQLException
|
||||||
*/
|
*/
|
||||||
protected function FindRecipients($sRecipAttCode, $aArgs)
|
protected function FindRecipients($sRecipAttCode, $aArgs)
|
||||||
{
|
{
|
||||||
|
$oTrigger = $aArgs['trigger->object()'] ?? null;
|
||||||
$sOQL = $this->Get($sRecipAttCode);
|
$sOQL = $this->Get($sRecipAttCode);
|
||||||
if (strlen($sOQL) === 0) return '';
|
if (utils::IsNullOrEmptyString($sOQL)) return '';
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$oSearch = DBObjectSearch::FromOQL($sOQL);
|
$oSearch = DBObjectSearch::FromOQL($sOQL);
|
||||||
if ($this->Get('ignore_notify') === 'no') {
|
if ($this->Get('ignore_notify') === 'no') {
|
||||||
// In theory it is possible to notify *any* kind of object,
|
// In theory, it is possible to notify *any* kind of object,
|
||||||
// as long as there is an email attribute in the class
|
// as long as there is an email attribute in the class
|
||||||
// So let's not assume that the selected class is a Person
|
// So let's not assume that the selected class is a Person
|
||||||
$sFirstSelectedClass = $oSearch->GetClass();
|
$sFirstSelectedClass = $oSearch->GetClass();
|
||||||
@@ -381,16 +515,29 @@ class ActionEmail extends ActionNotification
|
|||||||
return "The objects of the class '$sClass' do not have any email attribute";
|
return "The objects of the class '$sClass' do not have any email attribute";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($oTrigger !== null && in_array('Contact', MetaModel::EnumParentClasses($sClass, ENUM_CHILD_CLASSES_ALL), true)) {
|
||||||
|
$aArgs['trigger_id'] = $oTrigger->GetKey();
|
||||||
|
$aArgs['action_id'] = $this->GetKey();
|
||||||
|
|
||||||
|
$sSubscribedContactsOQL = NotificationsRepository::GetInstance()->GetSearchOQLContactUnsubscribedByTriggerAndAction();
|
||||||
|
$sSubscribedContactsOQL->ApplyParameters($aArgs);
|
||||||
|
$sAlias = $oSearch->GetClassAlias();
|
||||||
|
$oSearch->AddConditionExpression(Expression::FromOQL("`$sAlias`.id NOT IN ($sSubscribedContactsOQL)"));
|
||||||
|
}
|
||||||
|
|
||||||
$oSet = new DBObjectSet($oSearch, array() /* order */, $aArgs);
|
$oSet = new DBObjectSet($oSearch, array() /* order */, $aArgs);
|
||||||
$aRecipients = array();
|
$aRecipients = array();
|
||||||
while ($oObj = $oSet->Fetch())
|
while ($oObj = $oSet->Fetch())
|
||||||
{
|
{
|
||||||
$sAddress = trim($oObj->Get($sEmailAttCode));
|
$sAddress = trim($oObj->Get($sEmailAttCode));
|
||||||
if (strlen($sAddress) > 0)
|
if (utils::IsNotNullOrEmptyString($sAddress))
|
||||||
{
|
{
|
||||||
$aRecipients[] = $sAddress;
|
$aRecipients[] = $sAddress;
|
||||||
$this->m_iRecipients++;
|
$this->m_iRecipients++;
|
||||||
}
|
}
|
||||||
|
if ($oTrigger !== null && in_array('Contact', MetaModel::EnumParentClasses($sClass, ENUM_CHILD_CLASSES_ALL), true)) {
|
||||||
|
NotificationsService::GetInstance()->RegisterSubscription($oTrigger, $this, $oObj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return implode(', ', $aRecipients);
|
return implode(', ', $aRecipients);
|
||||||
}
|
}
|
||||||
@@ -510,7 +657,7 @@ class ActionEmail extends ActionNotification
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$aErrors = [];
|
$aErrors = [];
|
||||||
$iRes = $oEmail->Send($aErrors, false, $oLog); // allow asynchronous mode
|
$iRes = $oEmail->Send($aErrors, $this->IsAsynchronous() ? Email::ENUM_SEND_FORCE_ASYNCHRONOUS : Email::ENUM_SEND_FORCE_SYNCHRONOUS, $oLog);
|
||||||
switch ($iRes)
|
switch ($iRes)
|
||||||
{
|
{
|
||||||
case EMAIL_SEND_OK:
|
case EMAIL_SEND_OK:
|
||||||
@@ -539,8 +686,17 @@ class ActionEmail extends ActionNotification
|
|||||||
* @param \EventNotification $oLog
|
* @param \EventNotification $oLog
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws \ArchivedObjectException
|
||||||
|
* @throws \CoreCannotSaveObjectException
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
* @throws \Exception
|
* @throws \CoreUnexpectedValue
|
||||||
|
* @throws \CoreWarning
|
||||||
|
* @throws \DictExceptionMissingString
|
||||||
|
* @throws \DictExceptionUnknownLanguage
|
||||||
|
* @throws \MissingQueryArgument
|
||||||
|
* @throws \MySQLException
|
||||||
|
* @throws \MySQLHasGoneAwayException
|
||||||
|
* @throws \OQLException
|
||||||
* @since 3.1.0 N°918
|
* @since 3.1.0 N°918
|
||||||
*/
|
*/
|
||||||
protected function PrepareMessageContent($aContextArgs, &$oLog): array
|
protected function PrepareMessageContent($aContextArgs, &$oLog): array
|
||||||
@@ -561,15 +717,7 @@ class ActionEmail extends ActionNotification
|
|||||||
'attachments' => [],
|
'attachments' => [],
|
||||||
];
|
];
|
||||||
$sPreviousUrlMaker = ApplicationContext::SetUrlMakerClass();
|
$sPreviousUrlMaker = ApplicationContext::SetUrlMakerClass();
|
||||||
$sPreviousLanguage = Dict::GetUserLanguage();
|
[$sPreviousLanguage, $aPreviousPluginProperties] = $this->SetNotificationLanguage();
|
||||||
$aPreviousPluginProperties = ApplicationContext::GetPluginProperties('QueryLocalizerPlugin');
|
|
||||||
if ($this->Get('language') !== '') {
|
|
||||||
// If a language is specified for this action, force this language
|
|
||||||
// when rendering all placeholders inside this message
|
|
||||||
Dict::SetUserLanguage($this->Get('language'));
|
|
||||||
AttributeDateTime::LoadFormatFromConfig();
|
|
||||||
ApplicationContext::SetPluginProperty('QueryLocalizerPlugin', 'language_code', $this->Get('language'));
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -601,9 +749,7 @@ class ActionEmail extends ActionNotification
|
|||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
ApplicationContext::SetUrlMakerClass($sPreviousUrlMaker);
|
ApplicationContext::SetUrlMakerClass($sPreviousUrlMaker);
|
||||||
Dict::SetUserLanguage($sPreviousLanguage);
|
$this->SetNotificationLanguage($sPreviousLanguage, $aPreviousPluginProperties['language_code'] ?? null);
|
||||||
AttributeDateTime::LoadFormatFromConfig();
|
|
||||||
ApplicationContext::SetPluginProperty('QueryLocalizerPlugin', 'language_code', $aPreviousPluginProperties['language_code'] ?? null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($oLog)) {
|
if (!is_null($oLog)) {
|
||||||
@@ -629,9 +775,7 @@ class ActionEmail extends ActionNotification
|
|||||||
$oLog->Set('body', HTMLSanitizer::Sanitize($aMessageContent['body']));
|
$oLog->Set('body', HTMLSanitizer::Sanitize($aMessageContent['body']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sStyles = file_get_contents(APPROOT.'css/email.css');
|
|
||||||
$sStyles .= MetaModel::GetConfig()->Get('email_css');
|
|
||||||
|
|
||||||
if ($this->IsBeingTested()) {
|
if ($this->IsBeingTested()) {
|
||||||
$sTestBody = $aMessageContent['body'];
|
$sTestBody = $aMessageContent['body'];
|
||||||
$sTestBody .= "<div style=\"border: dashed;\">\n";
|
$sTestBody .= "<div style=\"border: dashed;\">\n";
|
||||||
@@ -660,10 +804,11 @@ class ActionEmail extends ActionNotification
|
|||||||
if (isset($aContextArgs['attachments']))
|
if (isset($aContextArgs['attachments']))
|
||||||
{
|
{
|
||||||
$aAttachmentReport = array();
|
$aAttachmentReport = array();
|
||||||
|
/** @var \ormDocument $oDocument */
|
||||||
foreach($aContextArgs['attachments'] as $oDocument)
|
foreach($aContextArgs['attachments'] as $oDocument)
|
||||||
{
|
{
|
||||||
$aMessageContent['attachments'][] = ['data' => $oDocument->GetData(), 'filename' => $oDocument->GetFileName(), 'mime_type' => $oDocument->GetMimeType()];
|
$aMessageContent['attachments'][] = ['data' => $oDocument->GetData(), 'filename' => $oDocument->GetFileName(), 'mime_type' => $oDocument->GetMimeType()];
|
||||||
$aAttachmentReport[] = array($oDocument->GetFileName(), $oDocument->GetMimeType(), strlen($oDocument->GetData()));
|
$aAttachmentReport[] = array($oDocument->GetFileName(), $oDocument->GetMimeType(), strlen($oDocument->GetData() ?? ''));
|
||||||
}
|
}
|
||||||
$oLog->Set('attachments', $aAttachmentReport);
|
$oLog->Set('attachments', $aAttachmentReport);
|
||||||
}
|
}
|
||||||
@@ -773,4 +918,13 @@ class ActionEmail extends ActionNotification
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public static function GetAsynchronousGlobalSetting(): bool
|
||||||
|
{
|
||||||
|
return utils::GetConfig()->Get('email_asynchronous');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,31 @@ function apc_delete($key)
|
|||||||
return $bRet1 || $bRet2;
|
return $bRet1 || $bRet2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if APCu emulation key exists
|
||||||
|
*
|
||||||
|
* @param string|string[] $keys A string, or an array of strings, that contain keys.
|
||||||
|
*
|
||||||
|
* @return bool|string[] Returns TRUE if the key exists, otherwise FALSE
|
||||||
|
* Or if an array was passed to keys, then an array is returned that
|
||||||
|
* contains all existing keys, or an empty array if none exist.
|
||||||
|
* @since 3.2.0 N°7068
|
||||||
|
*/
|
||||||
|
function apc_exists($keys)
|
||||||
|
{
|
||||||
|
if (is_array($keys)) {
|
||||||
|
$aExistingKeys = [];
|
||||||
|
foreach ($keys as $sKey) {
|
||||||
|
if (apcFile::ExistsOneFile($sKey)) {
|
||||||
|
$aExistingKeys[] = $sKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $aExistingKeys;
|
||||||
|
} else {
|
||||||
|
return apcFile::ExistsOneFile($keys);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class apcFile
|
class apcFile
|
||||||
{
|
{
|
||||||
// Check only once per request
|
// Check only once per request
|
||||||
@@ -183,6 +208,16 @@ class apcFile
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if cache key exists
|
||||||
|
* @param $sKey
|
||||||
|
* @return bool
|
||||||
|
* @since 3.2.0 N°7068
|
||||||
|
*/
|
||||||
|
static public function ExistsOneFile($sKey) {
|
||||||
|
return is_file(self::GetCacheFileName('-' . $sKey)) || is_file(self::GetCacheFileName($sKey));
|
||||||
|
}
|
||||||
|
|
||||||
/** Get one cache entry content.
|
/** Get one cache entry content.
|
||||||
* @param $sKey
|
* @param $sKey
|
||||||
* @return bool|mixed
|
* @return bool|mixed
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
use Combodo\iTop\Service\Notification\Event\EventiTopNotificationService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -457,3 +458,87 @@ class AsyncSendEmail extends AsyncTask
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An async notification to be sent to iTop users
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
class AsyncSendiTopNotifications extends AsyncTask {
|
||||||
|
|
||||||
|
public static function Init()
|
||||||
|
{
|
||||||
|
$aParams = array
|
||||||
|
(
|
||||||
|
"category" => "core/cmdb",
|
||||||
|
"key_type" => "autoincrement",
|
||||||
|
"name_attcode" => "created",
|
||||||
|
"state_attcode" => "",
|
||||||
|
"reconc_keys" => array(),
|
||||||
|
"db_table" => "priv_async_send_itop_notifications",
|
||||||
|
"db_key_field" => "id",
|
||||||
|
"db_finalclass_field" => "",
|
||||||
|
);
|
||||||
|
MetaModel::Init_Params($aParams);
|
||||||
|
MetaModel::Init_InheritAttributes();
|
||||||
|
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeText("recipients", array("allowed_values"=>null, "sql"=>"recipients", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("action_id", array("targetclass"=>"Action", "allowed_values"=>null, "sql"=>"action_id", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("trigger_id", array("targetclass"=>"Trigger", "allowed_values"=>null, "sql"=>"trigger_id", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeText("title", array("allowed_values"=>null, "sql"=>"title", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeText("message", array("allowed_values"=>null, "sql"=>"message", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeInteger("object_id", array("allowed_values"=>null, "sql"=>"object_id", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeString("object_class", array("allowed_values"=>null, "sql"=>"object_class", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeText("url", array("allowed_values"=>null, "sql"=>"url", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeDateTime("date", array("allowed_values"=>null, "sql"=>"date", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws \ArchivedObjectException
|
||||||
|
* @throws \CoreCannotSaveObjectException
|
||||||
|
* @throws \CoreException
|
||||||
|
* @throws \CoreUnexpectedValue
|
||||||
|
* @throws \CoreWarning
|
||||||
|
* @throws \MySQLException
|
||||||
|
* @throws \OQLException
|
||||||
|
*/
|
||||||
|
public static function AddToQueue(int $iActionId, int $iTriggerId, array $aRecipients, string $sMessage, string $sTitle, string $sUrl, int $iObjectId, ?string $sObjectClass): void
|
||||||
|
{
|
||||||
|
$oNew = new static();
|
||||||
|
$oNew->Set('action_id', $iActionId);
|
||||||
|
$oNew->Set('trigger_id', $iTriggerId);
|
||||||
|
$oNew->Set('recipients', json_encode($aRecipients));
|
||||||
|
$oNew->Set('message', $sMessage);
|
||||||
|
$oNew->Set('title', $sTitle);
|
||||||
|
$oNew->Set('url', $sUrl);
|
||||||
|
$oNew->Set('object_id', $iObjectId);
|
||||||
|
$oNew->Set('object_class', $sObjectClass);
|
||||||
|
$oNew->SetCurrentDate('date');
|
||||||
|
|
||||||
|
$oNew->DBInsert();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function DoProcess()
|
||||||
|
{
|
||||||
|
$oAction = MetaModel::GetObject('Action', $this->Get('action_id'));
|
||||||
|
$iTriggerId = $this->Get('trigger_id');
|
||||||
|
$aRecipients = json_decode($this->Get('recipients'));
|
||||||
|
$sMessage = $this->Get('message');
|
||||||
|
$sTitle = $this->Get('title');
|
||||||
|
$sUrl = $this->Get('url');
|
||||||
|
$iObjectId = $this->Get('object_id');
|
||||||
|
$sObjectClass = $this->Get('object_class');
|
||||||
|
$sDate = $this->Get('date');
|
||||||
|
|
||||||
|
foreach ($aRecipients as $iRecipientId)
|
||||||
|
{
|
||||||
|
$oEvent = EventiTopNotificationService::MakeEventFromAction($oAction, $iRecipientId, $iTriggerId, $sMessage, $sTitle, $sUrl, $iObjectId, $sObjectClass, $sDate);
|
||||||
|
$oEvent->DBInsertNoReload();
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Sent";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
use Combodo\iTop\Application\UI\Base\Component\FieldBadge\FieldBadgeUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\FieldBadge\FieldBadgeUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Links\Set\BlockLinkSetDisplayAsProperty;
|
use Combodo\iTop\Application\UI\Links\Set\BlockLinkSetDisplayAsProperty;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Form\Field\LabelField;
|
use Combodo\iTop\Form\Field\LabelField;
|
||||||
use Combodo\iTop\Form\Field\TextAreaField;
|
use Combodo\iTop\Form\Field\TextAreaField;
|
||||||
use Combodo\iTop\Form\Form;
|
use Combodo\iTop\Form\Form;
|
||||||
@@ -3061,6 +3062,11 @@ class AttributeObjectKey extends AttributeDBFieldVoid
|
|||||||
return ((int) $proposedValue) !== 0;
|
return ((int) $proposedValue) !== 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*
|
||||||
|
* @param int|DBObject $proposedValue Object key or valid ({@see MetaModel::IsValidObject()}) datamodel object
|
||||||
|
*/
|
||||||
public function MakeRealValue($proposedValue, $oHostObj)
|
public function MakeRealValue($proposedValue, $oHostObj)
|
||||||
{
|
{
|
||||||
if (is_null($proposedValue))
|
if (is_null($proposedValue))
|
||||||
@@ -3073,7 +3079,6 @@ class AttributeObjectKey extends AttributeDBFieldVoid
|
|||||||
}
|
}
|
||||||
if (MetaModel::IsValidObject($proposedValue))
|
if (MetaModel::IsValidObject($proposedValue))
|
||||||
{
|
{
|
||||||
/** @var \DBObject $proposedValue */
|
|
||||||
return $proposedValue->GetKey();
|
return $proposedValue->GetKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3505,7 +3510,7 @@ class AttributeBoolean extends AttributeInteger
|
|||||||
$sProposedValue, $bLocalizedValue = false, $sSepItem = null, $sSepAttribute = null, $sSepValue = null,
|
$sProposedValue, $bLocalizedValue = false, $sSepItem = null, $sSepAttribute = null, $sSepValue = null,
|
||||||
$sAttributeQualifier = null
|
$sAttributeQualifier = null
|
||||||
) {
|
) {
|
||||||
$sInput = strtolower(trim($sProposedValue));
|
$sInput = mb_strtolower(trim($sProposedValue));
|
||||||
if ($bLocalizedValue)
|
if ($bLocalizedValue)
|
||||||
{
|
{
|
||||||
switch ($sInput)
|
switch ($sInput)
|
||||||
@@ -4530,7 +4535,6 @@ class AttributeText extends AttributeString
|
|||||||
$sStyle = '';
|
$sStyle = '';
|
||||||
if (count($aStyles) > 0)
|
if (count($aStyles) > 0)
|
||||||
{
|
{
|
||||||
$aStyles[] = 'overflow:auto';
|
|
||||||
$sStyle = 'style="'.implode(';', $aStyles).'"';
|
$sStyle = 'style="'.implode(';', $aStyles).'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6510,6 +6514,11 @@ class AttributeDateTime extends AttributeDBField
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*
|
||||||
|
* @param int|string $proposedValue timestamp ({@see DateTime::getTimestamp()) or date as string, following the {@see GetInternalFormat} format.
|
||||||
|
*/
|
||||||
public function MakeRealValue($proposedValue, $oHostObj)
|
public function MakeRealValue($proposedValue, $oHostObj)
|
||||||
{
|
{
|
||||||
if (is_null($proposedValue))
|
if (is_null($proposedValue))
|
||||||
@@ -8299,9 +8308,9 @@ class AttributeBlob extends AttributeDefinition
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Users can provide the document from an URL (including an URL on iTop itself)
|
* {@inheritDoc}
|
||||||
* for CSV import. Administrators can even provide the path to a local file
|
*
|
||||||
* {@inheritDoc}
|
* @param string $proposedValue Can be an URL (including an URL to iTop itself), or a local path (CSV import)
|
||||||
*
|
*
|
||||||
* @see AttributeDefinition::MakeRealValue()
|
* @see AttributeDefinition::MakeRealValue()
|
||||||
*/
|
*/
|
||||||
@@ -8542,7 +8551,7 @@ class AttributeBlob extends AttributeDefinition
|
|||||||
$sFingerprint = '';
|
$sFingerprint = '';
|
||||||
if ($value instanceOf ormDocument)
|
if ($value instanceOf ormDocument)
|
||||||
{
|
{
|
||||||
$sFingerprint = md5($value->GetData());
|
$sFingerprint = $value->GetSignature();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sFingerprint;
|
return $sFingerprint;
|
||||||
@@ -8653,6 +8662,20 @@ class AttributeImage extends AttributeBlob
|
|||||||
parent::__construct($sCode, $aParams);
|
parent::__construct($sCode, $aParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function Get($sParamName)
|
||||||
|
{
|
||||||
|
$oParamValue = parent::Get($sParamName);
|
||||||
|
|
||||||
|
if ($sParamName === 'default_image') {
|
||||||
|
/** @noinspection NestedPositiveIfStatementsInspection */
|
||||||
|
if (!empty($oParamValue)) {
|
||||||
|
return utils::GetAbsoluteUrlModulesRoot() . $oParamValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $oParamValue;
|
||||||
|
}
|
||||||
|
|
||||||
public function GetEditClass()
|
public function GetEditClass()
|
||||||
{
|
{
|
||||||
return "Image";
|
return "Image";
|
||||||
@@ -12996,7 +13019,7 @@ class AttributeRedundancySettings extends AttributeDBField
|
|||||||
* Display an option (form, or current value)
|
* Display an option (form, or current value)
|
||||||
*
|
*
|
||||||
* @param string $sCurrentValue
|
* @param string $sCurrentValue
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param string $sFormPrefix
|
* @param string $sFormPrefix
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param string $sUserOption
|
* @param string $sUserOption
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ MetaModel::IncludeModule('application/audit.domain.class.inc.php');
|
|||||||
MetaModel::IncludeModule('application/query.class.inc.php');
|
MetaModel::IncludeModule('application/query.class.inc.php');
|
||||||
MetaModel::IncludeModule('setup/moduleinstallation.class.inc.php');
|
MetaModel::IncludeModule('setup/moduleinstallation.class.inc.php');
|
||||||
|
|
||||||
|
|
||||||
MetaModel::IncludeModule('core/event.class.inc.php');
|
MetaModel::IncludeModule('core/event.class.inc.php');
|
||||||
MetaModel::IncludeModule('core/action.class.inc.php');
|
MetaModel::IncludeModule('core/action.class.inc.php');
|
||||||
MetaModel::IncludeModule('core/trigger.class.inc.php');
|
MetaModel::IncludeModule('core/trigger.class.inc.php');
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
// The BOM is added at the head of exported UTF-8 CSV data, and removed (if present) from input UTF-8 data.
|
// The BOM is added at the head of exported UTF-8 CSV data, and removed (if present) from input UTF-8 data.
|
||||||
// This helps MS-Excel (Version > 2007, Windows only) in changing its interpretation of a CSV file (by default Excel reads data as ISO-8859-1 -not 100% sure!)
|
// This helps MS-Excel (Version > 2007, Windows only) in changing its interpretation of a CSV file (by default Excel reads data as ISO-8859-1 -not 100% sure!)
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
define('UTF8_BOM', chr(239).chr(187).chr(191)); // 0xEF, 0xBB, 0xBF
|
define('UTF8_BOM', chr(239).chr(187).chr(191)); // 0xEF, 0xBB, 0xBF
|
||||||
|
|
||||||
|
|
||||||
@@ -160,7 +163,7 @@ class CellStatus_SearchIssue extends CellStatus_Issue
|
|||||||
* @param null $sAllowedValues : used for additional message that provides allowed values $sAllowedValues for current class
|
* @param null $sAllowedValues : used for additional message that provides allowed values $sAllowedValues for current class
|
||||||
* @param string|null $sAllowedValuesSearch : used to search all allowed values
|
* @param string|null $sAllowedValuesSearch : used to search all allowed values
|
||||||
*/
|
*/
|
||||||
public function __construct($sSerializedSearch, $sReason, $sClass=null, $sAllowedValues=null, string $sAllowedValuesSearch=null)
|
public function __construct($sSerializedSearch, $sReason, $sClass = null, $sAllowedValues = null, string $sAllowedValuesSearch = null)
|
||||||
{
|
{
|
||||||
parent::__construct(null, null, $sReason);
|
parent::__construct(null, null, $sReason);
|
||||||
$this->sSerializedSearch = $sSerializedSearch;
|
$this->sSerializedSearch = $sSerializedSearch;
|
||||||
@@ -195,7 +198,7 @@ class CellStatus_SearchIssue extends CellStatus_Issue
|
|||||||
public function GetSearchLinkUrl()
|
public function GetSearchLinkUrl()
|
||||||
{
|
{
|
||||||
return sprintf("UI.php?operation=search&filter=%s",
|
return sprintf("UI.php?operation=search&filter=%s",
|
||||||
rawurlencode($this->sSerializedSearch)
|
rawurlencode($this->sSerializedSearch ?? "")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +209,7 @@ class CellStatus_SearchIssue extends CellStatus_Issue
|
|||||||
public function GetAllowedValuesLinkUrl(): ?string
|
public function GetAllowedValuesLinkUrl(): ?string
|
||||||
{
|
{
|
||||||
return sprintf("UI.php?operation=search&filter=%s",
|
return sprintf("UI.php?operation=search&filter=%s",
|
||||||
rawurlencode($this->sAllowedValuesSearch)
|
rawurlencode($this->sAllowedValuesSearch ?? "")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -262,7 +265,7 @@ class CellStatus_Ambiguous extends CellStatus_Issue
|
|||||||
public function GetSearchLinkUrl()
|
public function GetSearchLinkUrl()
|
||||||
{
|
{
|
||||||
return sprintf("UI.php?operation=search&filter=%s",
|
return sprintf("UI.php?operation=search&filter=%s",
|
||||||
rawurlencode($this->sSerializedSearch)
|
rawurlencode($this->sSerializedSearch ?? "")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\Page;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
define('EXPORTER_DEFAULT_CHUNK_SIZE', 1000);
|
define('EXPORTER_DEFAULT_CHUNK_SIZE', 1000);
|
||||||
|
|
||||||
class BulkExportException extends Exception
|
class BulkExportException extends Exception
|
||||||
@@ -391,7 +394,7 @@ abstract class BulkExport
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sPartId
|
* @param $sPartId
|
||||||
*
|
*
|
||||||
* @return UIContentBlock
|
* @return UIContentBlock
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ abstract class CMDBObject extends DBObject
|
|||||||
$oMyChangeOp->Set("objclass", MetaModel::GetRootClass(get_class($this)));
|
$oMyChangeOp->Set("objclass", MetaModel::GetRootClass(get_class($this)));
|
||||||
$oMyChangeOp->Set("objkey", $objkey);
|
$oMyChangeOp->Set("objkey", $objkey);
|
||||||
$oMyChangeOp->Set("fclass", get_class($this));
|
$oMyChangeOp->Set("fclass", get_class($this));
|
||||||
$oMyChangeOp->Set("fname", substr($this->GetRawName(), 0, 255)); // Protect against very long friendly names
|
$oMyChangeOp->SetTrim("fname", $this->GetRawName()); // Protect against very long friendly names
|
||||||
$iId = $oMyChangeOp->DBInsertNoReload();
|
$iId = $oMyChangeOp->DBInsertNoReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ class CMDBSource
|
|||||||
const ENUM_DB_VENDOR_MARIADB = 'MariaDB';
|
const ENUM_DB_VENDOR_MARIADB = 'MariaDB';
|
||||||
const ENUM_DB_VENDOR_PERCONA = 'Percona';
|
const ENUM_DB_VENDOR_PERCONA = 'Percona';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 2.7.10 3.0.4 3.1.2 3.0.2 N°6889 constant creation
|
||||||
|
* @internal will be removed in a future version
|
||||||
|
*/
|
||||||
|
const MYSQL_DEFAULT_PORT = 3306;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Error: 1205 SQLSTATE: HY000 (ER_LOCK_WAIT_TIMEOUT)
|
* Error: 1205 SQLSTATE: HY000 (ER_LOCK_WAIT_TIMEOUT)
|
||||||
* Message: Lock wait timeout exceeded; try restarting transaction
|
* Message: Lock wait timeout exceeded; try restarting transaction
|
||||||
@@ -212,16 +218,19 @@ class CMDBSource
|
|||||||
/**
|
/**
|
||||||
* @param string $sDbHost initial value ("p:domain:port" syntax)
|
* @param string $sDbHost initial value ("p:domain:port" syntax)
|
||||||
* @param string $sServer server variable to update
|
* @param string $sServer server variable to update
|
||||||
* @param int $iPort port variable to update
|
* @param int|null $iPort port variable to update, will return null if nothing is specified in $sDbHost
|
||||||
|
*
|
||||||
|
* @since 2.7.10 3.0.4 3.1.2 3.2.0 N°6889 will return null in $iPort if port isn't present in $sDbHost. Use {@see MYSQL_DEFAULT_PORT} if needed
|
||||||
|
*
|
||||||
|
* @link http://php.net/manual/en/mysqli.persistconns.php documentation for the "p:" prefix (persistent connexion)
|
||||||
*/
|
*/
|
||||||
public static function InitServerAndPort($sDbHost, &$sServer, &$iPort)
|
public static function InitServerAndPort($sDbHost, &$sServer, &$iPort)
|
||||||
{
|
{
|
||||||
$aConnectInfo = explode(':', $sDbHost);
|
$aConnectInfo = explode(':', $sDbHost);
|
||||||
|
|
||||||
$bUsePersistentConnection = false;
|
$bUsePersistentConnection = false;
|
||||||
if (strcasecmp($aConnectInfo[0], 'p') == 0)
|
if (strcasecmp($aConnectInfo[0], 'p') === 0)
|
||||||
{
|
{
|
||||||
// we might have "p:" prefix to use persistent connections (see http://php.net/manual/en/mysqli.persistconns.php)
|
|
||||||
$bUsePersistentConnection = true;
|
$bUsePersistentConnection = true;
|
||||||
$sServer = $aConnectInfo[0].':'.$aConnectInfo[1];
|
$sServer = $aConnectInfo[0].':'.$aConnectInfo[1];
|
||||||
}
|
}
|
||||||
@@ -239,10 +248,6 @@ class CMDBSource
|
|||||||
{
|
{
|
||||||
$iPort = (int)($aConnectInfo[1]);
|
$iPort = (int)($aConnectInfo[1]);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$iPort = 3306;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ define('ITOP_APPLICATION_SHORT', 'iTop');
|
|||||||
*
|
*
|
||||||
* @see ITOP_CORE_VERSION to get iTop core version
|
* @see ITOP_CORE_VERSION to get iTop core version
|
||||||
*/
|
*/
|
||||||
define('ITOP_VERSION', '3.1.1-dev');
|
define('ITOP_VERSION', '3.2.0-dev');
|
||||||
|
|
||||||
define('ITOP_VERSION_NAME', 'Fullmoon');
|
define('ITOP_VERSION_NAME', 'Fullmoon');
|
||||||
define('ITOP_REVISION', 'svn');
|
define('ITOP_REVISION', 'svn');
|
||||||
@@ -447,14 +447,14 @@ class Config
|
|||||||
'show_in_conf_sample' => true,
|
'show_in_conf_sample' => true,
|
||||||
],
|
],
|
||||||
'export_pdf_font' => [ // @since 2.7.0 PR #49 / N°1947
|
'export_pdf_font' => [ // @since 2.7.0 PR #49 / N°1947
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'description' => 'Font used when generating a PDF file',
|
'description' => 'Font used when generating a PDF file',
|
||||||
'default' => 'DejaVuSans', // DejaVuSans is a UTF-8 Unicode font, embedded in the TCPPDF lib we're using
|
'default' => 'DejaVuSans', // DejaVuSans is a UTF-8 Unicode font, embedded in the TCPPDF lib we're using
|
||||||
// Standard PDF fonts like helvetica or times newroman are NOT Unicode
|
// Standard PDF fonts like helvetica or times newroman are NOT Unicode
|
||||||
// A new DroidSansFallback can be used to improve CJK support (se PR #49)
|
// A new DroidSansFallback can be used to improve CJK support (se PR #49)
|
||||||
'value' => '',
|
'value' => '',
|
||||||
'source_of_value' => '',
|
'source_of_value' => '',
|
||||||
'show_in_conf_sample' => false,
|
'show_in_conf_sample' => false,
|
||||||
],
|
],
|
||||||
'access_mode' => [
|
'access_mode' => [
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
@@ -889,6 +889,14 @@ class Config
|
|||||||
'source_of_value' => '',
|
'source_of_value' => '',
|
||||||
'show_in_conf_sample' => false,
|
'show_in_conf_sample' => false,
|
||||||
],
|
],
|
||||||
|
'forgot_password.url' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'description' => 'Set this value to your "forgot password" service URL if it should be handled out of '.ITOP_APPLICATION_SHORT.'. Note that it will apply to all users (iTop users, LDAP users, ...)',
|
||||||
|
'default' => '',
|
||||||
|
'value' => '',
|
||||||
|
'source_of_value' => '',
|
||||||
|
'show_in_conf_sample' => false,
|
||||||
|
],
|
||||||
'deadline_format' => [
|
'deadline_format' => [
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'description' => 'The format used for displaying "deadline" attributes: any string with the following placeholders: $date$, $difference$',
|
'description' => 'The format used for displaying "deadline" attributes: any string with the following placeholders: $date$, $difference$',
|
||||||
@@ -1111,6 +1119,14 @@ class Config
|
|||||||
'source_of_value' => '',
|
'source_of_value' => '',
|
||||||
'show_in_conf_sample' => false,
|
'show_in_conf_sample' => false,
|
||||||
],
|
],
|
||||||
|
'purge_data.max_chunk_size' => [
|
||||||
|
'type' => 'integer',
|
||||||
|
'description' => 'Maximum number of items deleted per loop. Used in function MetaModel::PurgeData',
|
||||||
|
'default' => 1000,
|
||||||
|
'value' => 1000,
|
||||||
|
'source_of_value' => '',
|
||||||
|
'show_in_conf_sample' => false,
|
||||||
|
],
|
||||||
'max_history_length' => [
|
'max_history_length' => [
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
'description' => 'Maximum length of the history table (in the "History" tab on each object) before it gets truncated. Latest modifications are displayed first.',
|
'description' => 'Maximum length of the history table (in the "History" tab on each object) before it gets truncated. Latest modifications are displayed first.',
|
||||||
@@ -1316,9 +1332,9 @@ class Config
|
|||||||
'draft_attachments_lifetime' => [
|
'draft_attachments_lifetime' => [
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
'description' => 'Lifetime (in seconds) of drafts\' attachments and inline images: after this duration, the garbage collector will delete them.',
|
'description' => 'Lifetime (in seconds) of drafts\' attachments and inline images: after this duration, the garbage collector will delete them.',
|
||||||
'default' => 86400,
|
'default' => 86400,
|
||||||
'value' => '',
|
'value' => '',
|
||||||
'source_of_value' => '',
|
'source_of_value' => '',
|
||||||
'show_in_conf_sample' => false,
|
'show_in_conf_sample' => false,
|
||||||
],
|
],
|
||||||
'date_and_time_format' => [
|
'date_and_time_format' => [
|
||||||
@@ -1595,6 +1611,38 @@ class Config
|
|||||||
'source_of_value' => '',
|
'source_of_value' => '',
|
||||||
'show_in_conf_sample' => false,
|
'show_in_conf_sample' => false,
|
||||||
],
|
],
|
||||||
|
'notifications.itop.read_notification_retention' => [
|
||||||
|
'type' => 'integer',
|
||||||
|
'description' => 'Duration in days after which iTop read notifications will be deleted',
|
||||||
|
'default' => 182,
|
||||||
|
'value' => 182,
|
||||||
|
'source_of_value' => '',
|
||||||
|
'show_in_conf_sample' => false,
|
||||||
|
],
|
||||||
|
'notifications.itop.send_asynchronously' => [
|
||||||
|
'type' => 'bool',
|
||||||
|
'description' => 'If true then iTop notifications will be sent asynchronously',
|
||||||
|
'default' => false,
|
||||||
|
'value' => false,
|
||||||
|
'source_of_value' => '',
|
||||||
|
'show_in_conf_sample' => false,
|
||||||
|
],
|
||||||
|
'notifications.itop.newsroom_cache_time' => [
|
||||||
|
'type' => 'integer',
|
||||||
|
'description' => 'Duration in min between each fetch for notifications in newsroom',
|
||||||
|
'default' => 5,
|
||||||
|
'value' => 5,
|
||||||
|
'source_of_value' => '',
|
||||||
|
'show_in_conf_sample' => false,
|
||||||
|
],
|
||||||
|
'notifications.last_executions_days' => [
|
||||||
|
'type' => 'integer',
|
||||||
|
'description' => 'Number of days to display in the Action\'s last executions tab (0 means no limit)',
|
||||||
|
'default' => 30 + 31, // 2 months
|
||||||
|
'value' => 61,
|
||||||
|
'source_of_value' => '',
|
||||||
|
'show_in_conf_sample' => false,
|
||||||
|
],
|
||||||
'regenerate_session_id_enabled' => [
|
'regenerate_session_id_enabled' => [
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'description' => 'If true then session id will be regenerated on each login, to prevent session fixation.',
|
'description' => 'If true then session id will be regenerated on each login, to prevent session fixation.',
|
||||||
@@ -1643,6 +1691,14 @@ class Config
|
|||||||
'source_of_value' => '',
|
'source_of_value' => '',
|
||||||
'show_in_conf_sample' => false,
|
'show_in_conf_sample' => false,
|
||||||
],
|
],
|
||||||
|
'security.enable_header_xcontent_type_options' => [
|
||||||
|
'type' => 'bool',
|
||||||
|
'description' => 'If set to false, iTop will stop sending the X-Content-Type-Options HTTP header. This header could trigger CORB protection on certain resources (JSON, XML, HTML, text) therefore blocking them.',
|
||||||
|
'default' => true,
|
||||||
|
'value' => '',
|
||||||
|
'source_of_value' => '',
|
||||||
|
'show_in_conf_sample' => false,
|
||||||
|
],
|
||||||
'security.disable_inline_documents_sandbox' => [
|
'security.disable_inline_documents_sandbox' => [
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'description' => 'If true then the sandbox for documents displayed in a browser tab will be disabled; enabling scripts and other interactive content. Note that setting this to true will open the application to potential XSS attacks!',
|
'description' => 'If true then the sandbox for documents displayed in a browser tab will be disabled; enabling scripts and other interactive content. Note that setting this to true will open the application to potential XSS attacks!',
|
||||||
@@ -1707,6 +1763,14 @@ class Config
|
|||||||
'source_of_value' => '',
|
'source_of_value' => '',
|
||||||
'show_in_conf_sample' => false,
|
'show_in_conf_sample' => false,
|
||||||
],
|
],
|
||||||
|
'application.secret' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'description' => 'Application secret, uses this value for encrypting the cookies used in the remember me functionality and for creating signed URIs when using ESI (Edge Side Includes).',
|
||||||
|
'default' => '',
|
||||||
|
'value' => '',
|
||||||
|
'source_of_value' => '',
|
||||||
|
'show_in_conf_sample' => false,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
public function IsProperty($sPropCode)
|
public function IsProperty($sPropCode)
|
||||||
@@ -1834,6 +1898,7 @@ class Config
|
|||||||
* @var integer Number of seconds between two reloads of the display (standard)
|
* @var integer Number of seconds between two reloads of the display (standard)
|
||||||
*/
|
*/
|
||||||
protected $m_iStandardReloadInterval;
|
protected $m_iStandardReloadInterval;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer Number of seconds between two reloads of the display (fast)
|
* @var integer Number of seconds between two reloads of the display (fast)
|
||||||
*/
|
*/
|
||||||
@@ -1886,6 +1951,15 @@ class Config
|
|||||||
*/
|
*/
|
||||||
protected $m_iPasswordHashAlgo;
|
protected $m_iPasswordHashAlgo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Symfony uses this value for encrypting the cookies used in the remember me functionality and for creating signed URIs when using ESI (Edge Side Includes).
|
||||||
|
*
|
||||||
|
* @see https://symfony.com/doc/current/reference/configuration/framework.html#secret
|
||||||
|
* @since 3.2.0 - N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $m_sAppSecret;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config constructor.
|
* Config constructor.
|
||||||
*
|
*
|
||||||
@@ -1930,6 +2004,7 @@ class Config
|
|||||||
$this->m_aCharsets = array();
|
$this->m_aCharsets = array();
|
||||||
$this->m_bQueryCacheEnabled = DEFAULT_QUERY_CACHE_ENABLED;
|
$this->m_bQueryCacheEnabled = DEFAULT_QUERY_CACHE_ENABLED;
|
||||||
$this->m_iPasswordHashAlgo = DEFAULT_HASH_ALGO;
|
$this->m_iPasswordHashAlgo = DEFAULT_HASH_ALGO;
|
||||||
|
$this->m_sAppSecret = bin2hex(random_bytes(16));
|
||||||
|
|
||||||
//define default encryption params according to php install
|
//define default encryption params according to php install
|
||||||
$aEncryptParams = SimpleCrypt::GetNewDefaultParams();
|
$aEncryptParams = SimpleCrypt::GetNewDefaultParams();
|
||||||
@@ -2090,6 +2165,7 @@ class Config
|
|||||||
$this->m_sEncryptionLibrary = isset($MySettings['encryption_library']) ? trim($MySettings['encryption_library']) : $this->m_sEncryptionLibrary;
|
$this->m_sEncryptionLibrary = isset($MySettings['encryption_library']) ? trim($MySettings['encryption_library']) : $this->m_sEncryptionLibrary;
|
||||||
$this->m_aCharsets = isset($MySettings['csv_import_charsets']) ? $MySettings['csv_import_charsets'] : array();
|
$this->m_aCharsets = isset($MySettings['csv_import_charsets']) ? $MySettings['csv_import_charsets'] : array();
|
||||||
$this->m_iPasswordHashAlgo = isset($MySettings['password_hash_algo']) ? $MySettings['password_hash_algo'] : $this->m_iPasswordHashAlgo;
|
$this->m_iPasswordHashAlgo = isset($MySettings['password_hash_algo']) ? $MySettings['password_hash_algo'] : $this->m_iPasswordHashAlgo;
|
||||||
|
$this->m_sAppSecret = isset($MySettings['application.secret']) ? trim($MySettings['application.secret']) : $this->m_sAppSecret;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function Verify()
|
protected function Verify()
|
||||||
@@ -2225,6 +2301,11 @@ class Config
|
|||||||
return $this->m_sEncryptionKey;
|
return $this->m_sEncryptionKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetAppSecret()
|
||||||
|
{
|
||||||
|
return $this->m_sAppSecret;
|
||||||
|
}
|
||||||
|
|
||||||
public function GetEncryptionLibrary()
|
public function GetEncryptionLibrary()
|
||||||
{
|
{
|
||||||
return $this->m_sEncryptionLibrary;
|
return $this->m_sEncryptionLibrary;
|
||||||
@@ -2313,6 +2394,24 @@ class Config
|
|||||||
$this->m_sAllowedLoginTypes = implode('|', $aAllowedLoginTypes);
|
$this->m_sAllowedLoginTypes = implode('|', $aAllowedLoginTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 2.7.11 N°7085
|
||||||
|
* Add login mode if not configured already
|
||||||
|
* @param string $sLoginMode
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function AddAllowedLoginTypes($sLoginMode)
|
||||||
|
{
|
||||||
|
$aAllowedLoginTypes = $this->GetAllowedLoginTypes();
|
||||||
|
if (in_array($sLoginMode, $aAllowedLoginTypes)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$aAllowedLoginTypes[] = $sLoginMode;
|
||||||
|
$this->SetAllowedLoginTypes($aAllowedLoginTypes);
|
||||||
|
}
|
||||||
|
|
||||||
public function SetExternalAuthenticationVariable($sExtAuthVariable)
|
public function SetExternalAuthenticationVariable($sExtAuthVariable)
|
||||||
{
|
{
|
||||||
$this->m_sExtAuthVariable = $sExtAuthVariable;
|
$this->m_sExtAuthVariable = $sExtAuthVariable;
|
||||||
@@ -2323,6 +2422,12 @@ class Config
|
|||||||
$this->m_sEncryptionKey = $sKey;
|
$this->m_sEncryptionKey = $sKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function SetAppSecret($sKey)
|
||||||
|
{
|
||||||
|
$this->m_sAppSecret = $sKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function SetCSVImportCharsets($aCharsets)
|
public function SetCSVImportCharsets($aCharsets)
|
||||||
{
|
{
|
||||||
$this->m_aCharsets = $aCharsets;
|
$this->m_aCharsets = $aCharsets;
|
||||||
@@ -2374,6 +2479,7 @@ class Config
|
|||||||
$aSettings['encryption_library'] = $this->m_sEncryptionLibrary;
|
$aSettings['encryption_library'] = $this->m_sEncryptionLibrary;
|
||||||
$aSettings['csv_import_charsets'] = $this->m_aCharsets;
|
$aSettings['csv_import_charsets'] = $this->m_aCharsets;
|
||||||
$aSettings['password_hash_algo'] = $this->m_iPasswordHashAlgo;
|
$aSettings['password_hash_algo'] = $this->m_iPasswordHashAlgo;
|
||||||
|
$aSettings['application.secret'] = $this->m_sAppSecret;
|
||||||
|
|
||||||
foreach ($this->m_aModuleSettings as $sModule => $aProperties)
|
foreach ($this->m_aModuleSettings as $sModule => $aProperties)
|
||||||
{
|
{
|
||||||
@@ -2464,9 +2570,9 @@ class Config
|
|||||||
|
|
||||||
// Old fashioned integer settings
|
// Old fashioned integer settings
|
||||||
$aIntValues = array(
|
$aIntValues = array(
|
||||||
'fast_reload_interval' => $this->m_iFastReloadInterval,
|
'fast_reload_interval' => $this->m_iFastReloadInterval,
|
||||||
'max_display_limit' => $this->m_iMaxDisplayLimit,
|
'max_display_limit' => $this->m_iMaxDisplayLimit,
|
||||||
'min_display_limit' => $this->m_iMinDisplayLimit,
|
'min_display_limit' => $this->m_iMinDisplayLimit,
|
||||||
'standard_reload_interval' => $this->m_iStandardReloadInterval,
|
'standard_reload_interval' => $this->m_iStandardReloadInterval,
|
||||||
);
|
);
|
||||||
foreach ($aIntValues as $sKey => $iValue)
|
foreach ($aIntValues as $sKey => $iValue)
|
||||||
@@ -2486,7 +2592,8 @@ class Config
|
|||||||
'encryption_key' => $this->m_sEncryptionKey,
|
'encryption_key' => $this->m_sEncryptionKey,
|
||||||
'encryption_library' => $this->m_sEncryptionLibrary,
|
'encryption_library' => $this->m_sEncryptionLibrary,
|
||||||
'csv_import_charsets' => $this->m_aCharsets,
|
'csv_import_charsets' => $this->m_aCharsets,
|
||||||
'password_hash_algo' => $this->m_iPasswordHashAlgo
|
'password_hash_algo' => $this->m_iPasswordHashAlgo,
|
||||||
|
'application.secret' => $this->m_sAppSecret,
|
||||||
);
|
);
|
||||||
foreach ($aOtherValues as $sKey => $value)
|
foreach ($aOtherValues as $sKey => $value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,11 +8,13 @@ use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSetUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\SelectUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
||||||
use Combodo\iTop\Application\Helper\ExportHelper;
|
use Combodo\iTop\Application\Helper\ExportHelper;
|
||||||
|
use Combodo\iTop\Application\WebPage\Page;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk export: CSV export
|
* Bulk export: CSV export
|
||||||
@@ -101,7 +103,7 @@ class CSVBulkExport extends TabularBulkExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sPartId
|
* @param $sPartId
|
||||||
*
|
*
|
||||||
* @return UIContentBlock
|
* @return UIContentBlock
|
||||||
|
|||||||
@@ -1,5 +1,416 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.1">
|
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.2">
|
||||||
|
<classes>
|
||||||
|
<class id="lnkActionNotificationToContact" _delta="define">
|
||||||
|
<parent>cmdbAbstractObject</parent>
|
||||||
|
<properties>
|
||||||
|
<category>core/cmdb,application</category>
|
||||||
|
<abstract>false</abstract>
|
||||||
|
<key_type>autoincrement</key_type>
|
||||||
|
<db_table>priv_lnk_action_notif_to_contact</db_table>
|
||||||
|
<db_key_field>id</db_key_field>
|
||||||
|
<db_final_class_field/>
|
||||||
|
<naming>
|
||||||
|
<attributes>
|
||||||
|
<attribute id="action_id"/>
|
||||||
|
<attribute id="contact_id"/>
|
||||||
|
</attributes>
|
||||||
|
</naming>
|
||||||
|
<uniqueness_rules>
|
||||||
|
<rule>
|
||||||
|
<attributes>
|
||||||
|
<attribute id="action_id"/>
|
||||||
|
<attribute id="contact_id"/>
|
||||||
|
<attribute id="trigger_id"/>
|
||||||
|
</attributes>
|
||||||
|
<filter/>
|
||||||
|
<disabled>false</disabled>
|
||||||
|
<is_blocking>true</is_blocking>
|
||||||
|
</rule>
|
||||||
|
</uniqueness_rules>
|
||||||
|
</properties>
|
||||||
|
<fields>
|
||||||
|
<field id="action_id" xsi:type="AttributeExternalKey">
|
||||||
|
<sql>action_id</sql>
|
||||||
|
<target_class>ActionNotification</target_class>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="contact_id" xsi:type="AttributeExternalKey">
|
||||||
|
<sql>contact_id</sql>
|
||||||
|
<target_class>Contact</target_class>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="trigger_id" xsi:type="AttributeExternalKey">
|
||||||
|
<sql>trigger_id</sql>
|
||||||
|
<target_class>Trigger</target_class>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="subscribed" xsi:type="AttributeBoolean">
|
||||||
|
<sql>subscribed</sql>
|
||||||
|
<default_value>true</default_value>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
</fields>
|
||||||
|
<presentation>
|
||||||
|
<details>
|
||||||
|
<items>
|
||||||
|
<item id="col:col1">
|
||||||
|
<items>
|
||||||
|
<item id="fieldset:lnkActionNotificationToContact:content">
|
||||||
|
<items>
|
||||||
|
<item id="action_id">
|
||||||
|
<rank>10</rank>
|
||||||
|
</item>
|
||||||
|
<item id="contact_id">
|
||||||
|
<rank>20</rank>
|
||||||
|
</item>
|
||||||
|
<item id="title">
|
||||||
|
<rank>30</rank>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</details>
|
||||||
|
<list>
|
||||||
|
<items>
|
||||||
|
<item id="action_id">
|
||||||
|
<rank>10</rank>
|
||||||
|
</item>
|
||||||
|
<item id="contact_id">
|
||||||
|
<rank>20</rank>
|
||||||
|
</item>
|
||||||
|
<item id="title">
|
||||||
|
<rank>30</rank>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</list>
|
||||||
|
</presentation>
|
||||||
|
<methods/>
|
||||||
|
</class>
|
||||||
|
<class id="ActioniTopNotification" _delta="define">
|
||||||
|
<php_parent>
|
||||||
|
<name>ActionNotification</name>
|
||||||
|
</php_parent>
|
||||||
|
<parent>cmdbAbstractObject</parent>
|
||||||
|
<properties>
|
||||||
|
<category>grant_by_profile,core/cmdb,application</category>
|
||||||
|
<abstract>false</abstract>
|
||||||
|
<key_type>autoincrement</key_type>
|
||||||
|
<db_table>priv_action_itop_notif</db_table>
|
||||||
|
<db_key_field>id</db_key_field>
|
||||||
|
<db_final_class_field/>
|
||||||
|
<naming>
|
||||||
|
<attributes>
|
||||||
|
<attribute id="name"/>
|
||||||
|
</attributes>
|
||||||
|
</naming>
|
||||||
|
<style>
|
||||||
|
<icon>../../images/icons/icons8-notification.svg</icon>
|
||||||
|
</style>
|
||||||
|
</properties>
|
||||||
|
<fields>
|
||||||
|
<field id="title" xsi:type="AttributeString">
|
||||||
|
<sql>title</sql>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="message" xsi:type="AttributeText">
|
||||||
|
<sql>message</sql>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>true</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="icon" xsi:type="AttributeImage">
|
||||||
|
<sql>icon</sql>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>true</is_null_allowed>
|
||||||
|
<display_max_width>96</display_max_width>
|
||||||
|
<display_max_height>96</display_max_height>
|
||||||
|
<storage_max_width>256</storage_max_width>
|
||||||
|
<storage_max_height>256</storage_max_height>
|
||||||
|
<default_image />
|
||||||
|
</field>
|
||||||
|
<field id="priority" xsi:type="AttributeEnum">
|
||||||
|
<sql>priority</sql>
|
||||||
|
<values>
|
||||||
|
<value id="1">
|
||||||
|
<code>1</code>
|
||||||
|
</value>
|
||||||
|
<value id="2">
|
||||||
|
<code>2</code>
|
||||||
|
</value>
|
||||||
|
<value id="3">
|
||||||
|
<code>3</code>
|
||||||
|
</value>
|
||||||
|
<value id="4">
|
||||||
|
<code>4</code>
|
||||||
|
</value>
|
||||||
|
</values>
|
||||||
|
<default_value>4</default_value>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="recipients" xsi:type="AttributeOQL">
|
||||||
|
<sql>recipients</sql>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="url" xsi:type="AttributeString">
|
||||||
|
<sql>url</sql>
|
||||||
|
<default_value>$this->url()$</default_value>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
</fields>
|
||||||
|
<presentation>
|
||||||
|
<details>
|
||||||
|
<items>
|
||||||
|
<item id="col:col1">
|
||||||
|
<items>
|
||||||
|
<item id="fieldset:ActioniTopNotification:content">
|
||||||
|
<items>
|
||||||
|
<item id="name">
|
||||||
|
<rank>10</rank>
|
||||||
|
</item>
|
||||||
|
<item id="status">
|
||||||
|
<rank>20</rank>
|
||||||
|
</item>
|
||||||
|
<item id="language">
|
||||||
|
<rank>30</rank>
|
||||||
|
</item>
|
||||||
|
<item id="title">
|
||||||
|
<rank>40</rank>
|
||||||
|
</item>
|
||||||
|
<item id="message">
|
||||||
|
<rank>50</rank>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</item>
|
||||||
|
<item id="fieldset:ActioniTopNotification:trigger">
|
||||||
|
<items>
|
||||||
|
<item id="trigger_list">
|
||||||
|
<rank>10</rank>
|
||||||
|
</item>
|
||||||
|
<item id="asynchronous">
|
||||||
|
<rank>20</rank>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</item>
|
||||||
|
<item id="col:col2">
|
||||||
|
<items>
|
||||||
|
<item id="fieldset:ActioniTopNotification:settings">
|
||||||
|
<items>
|
||||||
|
<item id="priority">
|
||||||
|
<rank>10</rank>
|
||||||
|
</item>
|
||||||
|
<item id="icon">
|
||||||
|
<rank>20</rank>
|
||||||
|
</item>
|
||||||
|
<item id="recipients">
|
||||||
|
<rank>30</rank>
|
||||||
|
</item>
|
||||||
|
<item id="url">
|
||||||
|
<rank>40</rank>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</details>
|
||||||
|
<list>
|
||||||
|
<items>
|
||||||
|
<item id="title">
|
||||||
|
<rank>10</rank>
|
||||||
|
</item>
|
||||||
|
<item id="status">
|
||||||
|
<rank>20</rank>
|
||||||
|
</item>
|
||||||
|
<item id="language">
|
||||||
|
<rank>30</rank>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</list>
|
||||||
|
</presentation>
|
||||||
|
<methods>
|
||||||
|
<method id="DoExecute">
|
||||||
|
<comment> /**
|
||||||
|
*
|
||||||
|
* Create EventiTopNotification for each recipient
|
||||||
|
* @param $oTrigger
|
||||||
|
* @param $aContextArgs
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws \ArchivedObjectException
|
||||||
|
* @throws \CoreCannotSaveObjectException
|
||||||
|
* @throws \CoreException
|
||||||
|
* @throws \CoreUnexpectedValue
|
||||||
|
* @throws \CoreWarning
|
||||||
|
* @throws \MySQLException
|
||||||
|
* @throws \OQLException
|
||||||
|
*/</comment>
|
||||||
|
<static>false</static>
|
||||||
|
<access>public</access>
|
||||||
|
<code><![CDATA[
|
||||||
|
public function DoExecute($oTrigger, $aContextArgs)
|
||||||
|
{
|
||||||
|
$oRecipientsSearch = DBObjectSearch::FromOQL($this->Get('recipients'));
|
||||||
|
$oRecipientsSearch->AllowAllData();
|
||||||
|
$oRecipientsSet = new DBObjectSet($oRecipientsSearch);
|
||||||
|
$bIsAsync = $this->IsAsynchronous();
|
||||||
|
[$sPreviousLanguage, $aPreviousPluginProperties] = $this->SetNotificationLanguage();
|
||||||
|
|
||||||
|
if($bIsAsync === true){
|
||||||
|
$aRecipients = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$sMessage = MetaModel::ApplyParams($this->Get('message'), $aContextArgs);
|
||||||
|
$sTitle = MetaModel::ApplyParams($this->Get('title'), $aContextArgs);
|
||||||
|
$sUrl = MetaModel::ApplyParams($this->Get('url'), $aContextArgs);
|
||||||
|
$iObjectId = 0;
|
||||||
|
$sObjectClass = null;
|
||||||
|
if (array_key_exists('this->object()', $aContextArgs)) {
|
||||||
|
$iObjectId = $aContextArgs['this->object()']->GetKey();
|
||||||
|
$sObjectClass = get_class($aContextArgs['this->object()']);
|
||||||
|
}
|
||||||
|
|
||||||
|
while ($oRecipient = $oRecipientsSet->Fetch()) {
|
||||||
|
// Skip recipients that have no users
|
||||||
|
if (get_class($oRecipient) === Person::class && UserRights::GetUserFromPerson($oRecipient) === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!\Combodo\iTop\Service\Notification\NotificationsService::GetInstance()->IsSubscribed($oTrigger, $this, $oRecipient)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($bIsAsync === true) {
|
||||||
|
$aRecipients[] = $oRecipient->GetKey();
|
||||||
|
} else {
|
||||||
|
$oEvent = Combodo\iTop\Service\Notification\Event\EventiTopNotificationService::MakeEventFromAction($this, $oRecipient->GetKey(), $oTrigger->GetKey(), $sMessage, $sTitle, $sUrl, $iObjectId, $sObjectClass);
|
||||||
|
$oEvent->DBInsertNoReload();
|
||||||
|
}
|
||||||
|
|
||||||
|
\Combodo\iTop\Service\Notification\NotificationsService::GetInstance()->RegisterSubscription($oTrigger, $this, $oRecipient);
|
||||||
|
}
|
||||||
|
if ($bIsAsync === true) {
|
||||||
|
AsyncSendiTopNotifications::AddToQueue($this->GetKey(), $oTrigger->GetKey(), $aRecipients, $sMessage, $sTitle, $sUrl, $iObjectId, $sObjectClass);
|
||||||
|
}
|
||||||
|
$this->SetNotificationLanguage($sPreviousLanguage, $aPreviousPluginProperties['language_code'] ?? null);
|
||||||
|
}
|
||||||
|
]]></code>
|
||||||
|
</method>
|
||||||
|
<method id="GetAsynchronousGlobalSetting">
|
||||||
|
<comment></comment>
|
||||||
|
<static>true</static>
|
||||||
|
<access>public</access>
|
||||||
|
<code><![CDATA[
|
||||||
|
public static function GetAsynchronousGlobalSetting(): bool
|
||||||
|
{
|
||||||
|
return utils::GetConfig()->Get('notifications.itop.send_asynchronously');
|
||||||
|
}
|
||||||
|
]]></code>
|
||||||
|
</method>
|
||||||
|
</methods>
|
||||||
|
</class>
|
||||||
|
<class id="EventiTopNotification" _delta="define">
|
||||||
|
<php_parent>
|
||||||
|
<name>EventNotification</name>
|
||||||
|
</php_parent>
|
||||||
|
<parent>cmdbAbstractObject</parent>
|
||||||
|
<properties>
|
||||||
|
<category>core/cmdb,view_in_gui</category>
|
||||||
|
<abstract>false</abstract>
|
||||||
|
<key_type>autoincrement</key_type>
|
||||||
|
<db_table>priv_event_itop_notif</db_table>
|
||||||
|
<db_key_field>id</db_key_field>
|
||||||
|
<db_final_class_field/>
|
||||||
|
<naming>
|
||||||
|
<attributes>
|
||||||
|
<attribute id="title"/>
|
||||||
|
</attributes>
|
||||||
|
</naming>
|
||||||
|
</properties>
|
||||||
|
<fields>
|
||||||
|
<field id="title" xsi:type="AttributeString">
|
||||||
|
<sql>title</sql>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="icon" xsi:type="AttributeImage">
|
||||||
|
<sql>icon</sql>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>true</is_null_allowed>
|
||||||
|
<default_image />
|
||||||
|
</field>
|
||||||
|
<field id="priority" xsi:type="AttributeEnum">
|
||||||
|
<sql>priority</sql>
|
||||||
|
<values>
|
||||||
|
<value id="1">
|
||||||
|
<code>1</code>
|
||||||
|
</value>
|
||||||
|
<value id="2">
|
||||||
|
<code>2</code>
|
||||||
|
</value>
|
||||||
|
<value id="3">
|
||||||
|
<code>3</code>
|
||||||
|
</value>
|
||||||
|
<value id="4">
|
||||||
|
<code>4</code>
|
||||||
|
</value>
|
||||||
|
</values>
|
||||||
|
<default_value>4</default_value>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="url" xsi:type="AttributeURL">
|
||||||
|
<sql>url</sql>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
<target>_blank</target>
|
||||||
|
</field>
|
||||||
|
<field id="read" xsi:type="AttributeEnum">
|
||||||
|
<sql>read</sql>
|
||||||
|
<values>
|
||||||
|
<value id="yes">
|
||||||
|
<code>yes</code>
|
||||||
|
</value>
|
||||||
|
<value id="no">
|
||||||
|
<code>no</code>
|
||||||
|
</value>
|
||||||
|
</values>
|
||||||
|
<default_value>no</default_value>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="read_date" xsi:type="AttributeDateTime">
|
||||||
|
<sql>read_date</sql>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>true</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
<field id="contact_id" xsi:type="AttributeExternalKey">
|
||||||
|
<sql>contact_id</sql>
|
||||||
|
<target_class>Contact</target_class>
|
||||||
|
<default_value/>
|
||||||
|
<is_null_allowed>false</is_null_allowed>
|
||||||
|
</field>
|
||||||
|
</fields>
|
||||||
|
<presentation>
|
||||||
|
<summary>
|
||||||
|
<items>
|
||||||
|
<item id="date">
|
||||||
|
<rank>10</rank>
|
||||||
|
</item>
|
||||||
|
<item id="message">
|
||||||
|
<rank>20</rank>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
</summary>
|
||||||
|
</presentation>
|
||||||
|
<methods/>
|
||||||
|
</class>
|
||||||
|
</classes>
|
||||||
<user_rights>
|
<user_rights>
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile id="1024" _delta="define">
|
<profile id="1024" _delta="define">
|
||||||
@@ -282,8 +693,50 @@
|
|||||||
<field id="obj_attcode" xsi:type="AttributeString"/>
|
<field id="obj_attcode" xsi:type="AttributeString"/>
|
||||||
</fields>
|
</fields>
|
||||||
</class>
|
</class>
|
||||||
|
<class id="DefaultWorkingTimeComputer" _delta="define">
|
||||||
|
<interfaces>
|
||||||
|
<interface id="iWorkingTimeComputer"/>
|
||||||
|
</interfaces>
|
||||||
|
</class>
|
||||||
|
<class id="ActionNotification" _delta="define">
|
||||||
|
<!-- Generated by toolkit/export-class-to-meta.php -->
|
||||||
|
<parent>Action</parent>
|
||||||
|
<properties>
|
||||||
|
<category>grant_by_profile,core/cmdb</category>
|
||||||
|
</properties>
|
||||||
|
<fields>
|
||||||
|
<field id="name" xsi:type="AttributeString"/>
|
||||||
|
<field id="description" xsi:type="AttributeString"/>
|
||||||
|
<field id="status" xsi:type="AttributeEnum"/>
|
||||||
|
<field id="trigger_list" xsi:type="AttributeLinkedSetIndirect"/>
|
||||||
|
<field id="language" xsi:type="AttributeApplicationLanguage"/>
|
||||||
|
</fields>
|
||||||
|
</class>
|
||||||
|
<class id="EventNotification" _delta="define">
|
||||||
|
<!-- Generated by toolkit/export-class-to-meta.php -->
|
||||||
|
<parent>Event</parent>
|
||||||
|
<properties>
|
||||||
|
<category>core/cmdb,view_in_gui</category>
|
||||||
|
</properties>
|
||||||
|
<fields>
|
||||||
|
<field id="message" xsi:type="AttributeText"/>
|
||||||
|
<field id="date" xsi:type="AttributeDateTime"/>
|
||||||
|
<field id="userinfo" xsi:type="AttributeString"/>
|
||||||
|
<field id="trigger_id" xsi:type="AttributeExternalKey">
|
||||||
|
<target_class>Trigger</target_class>
|
||||||
|
</field>
|
||||||
|
<field id="action_id" xsi:type="AttributeExternalKey">
|
||||||
|
<target_class>Action</target_class>
|
||||||
|
</field>
|
||||||
|
<field id="object_id" xsi:type="AttributeInteger"/>
|
||||||
|
<field id="trigger_id_friendlyname" xsi:type="AttributeExternalField"/>
|
||||||
|
<field id="trigger_id_finalclass_recall" xsi:type="AttributeExternalField"/>
|
||||||
|
<field id="action_id_friendlyname" xsi:type="AttributeExternalField"/>
|
||||||
|
<field id="action_id_finalclass_recall" xsi:type="AttributeExternalField"/>
|
||||||
|
</fields>
|
||||||
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
<attribute_properties_definition _delta="define">
|
<attribute_properties_definition _delta="define">
|
||||||
<properties>
|
<properties>
|
||||||
<property id="sql">
|
<property id="sql">
|
||||||
<php_param>sql</php_param>
|
<php_param>sql</php_param>
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Core\MetaModel\FriendlyNameType;
|
use Combodo\iTop\Core\MetaModel\FriendlyNameType;
|
||||||
use Combodo\iTop\Service\Events\EventData;
|
use Combodo\iTop\Service\Events\EventData;
|
||||||
use Combodo\iTop\Service\Events\EventException;
|
use Combodo\iTop\Service\Events\EventException;
|
||||||
use Combodo\iTop\Service\Events\EventService;
|
use Combodo\iTop\Service\Events\EventService;
|
||||||
use Combodo\iTop\Service\Events\EventServiceLog;
|
use Combodo\iTop\Service\Events\EventServiceLog;
|
||||||
use Combodo\iTop\Service\Module\ModuleService;
|
use Combodo\iTop\Service\Module\ModuleService;
|
||||||
|
use Combodo\iTop\Service\SummaryCard\SummaryCardService;
|
||||||
use Combodo\iTop\Service\TemporaryObjects\TemporaryObjectManager;
|
use Combodo\iTop\Service\TemporaryObjects\TemporaryObjectManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,6 +210,7 @@ abstract class DBObject implements iDisplay
|
|||||||
const MAX_UPDATE_LOOP_COUNT = 10;
|
const MAX_UPDATE_LOOP_COUNT = 10;
|
||||||
|
|
||||||
private $aEventListeners = [];
|
private $aEventListeners = [];
|
||||||
|
private array $aAllowedTransitions = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DBObject constructor.
|
* DBObject constructor.
|
||||||
@@ -606,11 +609,10 @@ abstract class DBObject implements iDisplay
|
|||||||
* Attributes setter
|
* Attributes setter
|
||||||
*
|
*
|
||||||
* Set $sAttCode to $value.
|
* Set $sAttCode to $value.
|
||||||
* The value must be valid according to the type of attribute.
|
* The value must be valid according to the type of attribute : see the different {@see AttributeDefinition::MakeRealValue()} implementations
|
||||||
* The value will not be recorded into the DB until DBObject::DBWrite() is called.
|
* The value will not be recorded into the DB until DBObject::DBWrite() is called.
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
* @see DBWrite()
|
|
||||||
*
|
*
|
||||||
* @param string $sAttCode
|
* @param string $sAttCode
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
@@ -618,6 +620,8 @@ abstract class DBObject implements iDisplay
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
* @throws CoreUnexpectedValue
|
* @throws CoreUnexpectedValue
|
||||||
|
*
|
||||||
|
* @see DBWrite()
|
||||||
*/
|
*/
|
||||||
public function Set($sAttCode, $value)
|
public function Set($sAttCode, $value)
|
||||||
{
|
{
|
||||||
@@ -756,13 +760,26 @@ abstract class DBObject implements iDisplay
|
|||||||
{
|
{
|
||||||
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
||||||
$iMaxSize = $oAttDef->GetMaxSize();
|
$iMaxSize = $oAttDef->GetMaxSize();
|
||||||
if ($iMaxSize && (strlen($sValue) > $iMaxSize))
|
$sLength = mb_strlen($sValue);
|
||||||
{
|
if ($iMaxSize && ($sLength > $iMaxSize)) {
|
||||||
$sValue = substr($sValue, 0, $iMaxSize);
|
$sMessage = " -truncated ($sLength chars)";
|
||||||
|
$sValue = mb_substr($sValue, 0, $iMaxSize - mb_strlen($sMessage)).$sMessage;
|
||||||
}
|
}
|
||||||
$this->Set($sAttCode, $sValue);
|
$this->Set($sAttCode, $sValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
* @throws \ReflectionException
|
||||||
|
*/
|
||||||
|
protected function PostDeleteActions(): void
|
||||||
|
{
|
||||||
|
$this->FireEventAfterDelete();
|
||||||
|
$oKPI = new ExecutionKPI();
|
||||||
|
$this->AfterDelete();
|
||||||
|
$oKPI->ComputeStatsForExtension($this, 'AfterDelete');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute (and optionally start) the StopWatches deadlines
|
* Compute (and optionally start) the StopWatches deadlines
|
||||||
*
|
*
|
||||||
@@ -2098,33 +2115,26 @@ abstract class DBObject implements iDisplay
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($toCheck instanceof ormSet)
|
if ($toCheck instanceof ormSet) {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Bad type";
|
return "Bad type";
|
||||||
}
|
} elseif ($oAtt->IsScalar()) {
|
||||||
elseif ($oAtt->IsScalar())
|
|
||||||
{
|
|
||||||
$aValues = $oAtt->GetAllowedValues($this->ToArgsForQuery());
|
$aValues = $oAtt->GetAllowedValues($this->ToArgsForQuery());
|
||||||
if (is_array($aValues) && (count($aValues) > 0))
|
if (is_array($aValues) && (count($aValues) > 0)) {
|
||||||
{
|
if (!array_key_exists($toCheck, $aValues)) {
|
||||||
if (!array_key_exists($toCheck, $aValues))
|
|
||||||
{
|
|
||||||
return "Value not allowed [$toCheck]";
|
return "Value not allowed [$toCheck]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!is_null($iMaxSize = $oAtt->GetMaxSize()))
|
if (!is_null($iMaxSize = $oAtt->GetMaxSize())) {
|
||||||
{
|
$iLen = mb_strlen($toCheck);
|
||||||
$iLen = strlen($toCheck);
|
if ($iLen > $iMaxSize) {
|
||||||
if ($iLen > $iMaxSize)
|
|
||||||
{
|
|
||||||
return "String too long (found $iLen, limited to $iMaxSize)";
|
return "String too long (found $iLen, limited to $iMaxSize)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$oAtt->CheckFormat($toCheck))
|
if (!$oAtt->CheckFormat($toCheck)) {
|
||||||
{
|
|
||||||
return "Wrong format [$toCheck]";
|
return "Wrong format [$toCheck]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2347,6 +2357,8 @@ abstract class DBObject implements iDisplay
|
|||||||
$oUniquenessQuery->AddConditionForInOperatorUsingParam('finalclass', $aChildClassesWithRuleDisabled, false);
|
$oUniquenessQuery->AddConditionForInOperatorUsingParam('finalclass', $aChildClassesWithRuleDisabled, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$oUniquenessQuery->AllowAllData();
|
||||||
|
|
||||||
return $oUniquenessQuery;
|
return $oUniquenessQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4094,6 +4106,8 @@ abstract class DBObject implements iDisplay
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->SetReadOnly("No modification allowed before delete");
|
||||||
|
$this->FireEventAboutToDelete();
|
||||||
$oKPI = new ExecutionKPI();
|
$oKPI = new ExecutionKPI();
|
||||||
$this->OnDelete();
|
$this->OnDelete();
|
||||||
$oKPI->ComputeStatsForExtension($this, 'OnDelete');
|
$oKPI->ComputeStatsForExtension($this, 'OnDelete');
|
||||||
@@ -4203,15 +4217,13 @@ abstract class DBObject implements iDisplay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->FireEventAfterDelete();
|
$this->m_bIsInDB = false;
|
||||||
$oKPI = new ExecutionKPI();
|
|
||||||
$this->AfterDelete();
|
$this->PostDeleteActions();
|
||||||
$oKPI->ComputeStatsForExtension($this, 'AfterDelete');
|
|
||||||
|
|
||||||
// - Trigger for object pointing to the current object
|
// - Trigger for object pointing to the current object
|
||||||
$this->ActivateOnObjectUpdateTriggersForTargetObjects();
|
$this->ActivateOnObjectUpdateTriggersForTargetObjects();
|
||||||
|
|
||||||
$this->m_bIsInDB = false;
|
|
||||||
$this->LogCRUDExit(__METHOD__);
|
$this->LogCRUDExit(__METHOD__);
|
||||||
// Fix for N°926: do NOT reset m_iKey as it can be used to have it for reporting purposes (see the REST service to delete
|
// Fix for N°926: do NOT reset m_iKey as it can be used to have it for reporting purposes (see the REST service to delete
|
||||||
// objects, reported as bug N°926)
|
// objects, reported as bug N°926)
|
||||||
@@ -4267,6 +4279,7 @@ abstract class DBObject implements iDisplay
|
|||||||
foreach ($aToDelete as $iId => $aData) {
|
foreach ($aToDelete as $iId => $aData) {
|
||||||
/** @var \DBObject $oToDelete */
|
/** @var \DBObject $oToDelete */
|
||||||
$oToDelete = $aData['to_delete'];
|
$oToDelete = $aData['to_delete'];
|
||||||
|
|
||||||
// The deletion based on a deletion plan should not be done for each object if the deletion plan is common (Trac #457)
|
// The deletion based on a deletion plan should not be done for each object if the deletion plan is common (Trac #457)
|
||||||
// because for each object we would try to update all the preceding ones... that are already deleted
|
// because for each object we would try to update all the preceding ones... that are already deleted
|
||||||
// A better approach would be to change the API to apply the DBDelete on the deletion plan itself... just once
|
// A better approach would be to change the API to apply the DBDelete on the deletion plan itself... just once
|
||||||
@@ -4392,9 +4405,32 @@ abstract class DBObject implements iDisplay
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->aAllowedTransitions = $aSortedTransitions;
|
||||||
|
$this->FireEvent(EVENT_ENUM_TRANSITIONS, ['allowed_stimuli' => array_keys($aSortedTransitions)]);
|
||||||
|
$aSortedTransitions = $this->aAllowedTransitions;
|
||||||
|
$this->aAllowedTransitions = [];
|
||||||
|
|
||||||
return $aSortedTransitions;
|
return $aSortedTransitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a transition for a specific stimulus.
|
||||||
|
* This is only usable by EVENT_ENUM_TRANSITIONS listeners in order
|
||||||
|
* to manage the allowed transitions in the current object state.
|
||||||
|
*
|
||||||
|
* @param string $sStimulus
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @api
|
||||||
|
* @since 3.1.2
|
||||||
|
*/
|
||||||
|
public function DenyTransition(string $sStimulus): void
|
||||||
|
{
|
||||||
|
if (isset($this->aAllowedTransitions[$sStimulus])) {
|
||||||
|
unset($this->aAllowedTransitions[$sStimulus]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to reset a stop-watch
|
* Helper to reset a stop-watch
|
||||||
* Suitable for use as a lifecycle action
|
* Suitable for use as a lifecycle action
|
||||||
@@ -4480,14 +4516,6 @@ abstract class DBObject implements iDisplay
|
|||||||
$sNewState = $aTransitionDef['target_state'];
|
$sNewState = $aTransitionDef['target_state'];
|
||||||
$this->Set($sStateAttCode, $sNewState);
|
$this->Set($sStateAttCode, $sNewState);
|
||||||
|
|
||||||
$aEventData = [
|
|
||||||
'stimulus' => $sStimulusCode,
|
|
||||||
'previous_state' => $sPreviousState,
|
|
||||||
'new_state' => $sNewState,
|
|
||||||
'save_object' => !$bDoNotWrite,
|
|
||||||
];
|
|
||||||
$this->FireEvent(EVENT_DB_BEFORE_APPLY_STIMULUS, $aEventData);
|
|
||||||
|
|
||||||
// $aTransitionDef is an
|
// $aTransitionDef is an
|
||||||
// array('target_state'=>..., 'actions'=>array of handlers procs, 'user_restriction'=>TBD
|
// array('target_state'=>..., 'actions'=>array of handlers procs, 'user_restriction'=>TBD
|
||||||
|
|
||||||
@@ -4572,8 +4600,6 @@ abstract class DBObject implements iDisplay
|
|||||||
if (!$bDoNotWrite) {
|
if (!$bDoNotWrite) {
|
||||||
$this->DBWrite();
|
$this->DBWrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->FireEvent(EVENT_DB_AFTER_APPLY_STIMULUS, $aEventData);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -4582,8 +4608,6 @@ abstract class DBObject implements iDisplay
|
|||||||
{
|
{
|
||||||
$this->m_aCurrValues[$sAttCode] = $aBackupValues[$sAttCode];
|
$this->m_aCurrValues[$sAttCode] = $aBackupValues[$sAttCode];
|
||||||
}
|
}
|
||||||
$aEventData['action'] = $sActionDesc;
|
|
||||||
$this->FireEvent(EVENT_DB_APPLY_STIMULUS_FAILED, $aEventData);
|
|
||||||
}
|
}
|
||||||
return $bSuccess;
|
return $bSuccess;
|
||||||
}
|
}
|
||||||
@@ -4720,7 +4744,7 @@ abstract class DBObject implements iDisplay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$oDate->modify($sModifier);
|
$oDate->modify($sModifier);
|
||||||
$this->Set($sAttCode, $oDate->format('Y-m-d H:i:s'));
|
$this->Set($sAttCode, $oDate->getTimestamp());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6614,6 +6638,14 @@ abstract class DBObject implements iDisplay
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
* @since 3.1.2
|
||||||
|
*/
|
||||||
|
protected function FireEventAboutToDelete(): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
|
|||||||
@@ -6,7 +6,102 @@
|
|||||||
|
|
||||||
/** @internal Dev hack for disabling some query build optimizations (Folding/Merging) */
|
/** @internal Dev hack for disabling some query build optimizations (Folding/Merging) */
|
||||||
define('ENABLE_OPT', true);
|
define('ENABLE_OPT', true);
|
||||||
|
class DBSharedSearch extends DBObjectSearch {
|
||||||
|
|
||||||
|
public function MakeSelectQuery($aOrderBy = array(), $aArgs = array(), $aAttToLoad = null, $aExtendedDataSpec = null, $iLimitCount = 0, $iLimitStart = 0, $bGetCount = false, $bBeautifulSQL = true)
|
||||||
|
{
|
||||||
|
// Check the order by specification, and prefix with the class alias
|
||||||
|
// and make sure that the ordering columns are going to be selected
|
||||||
|
//
|
||||||
|
$sClass = $this->GetClass();
|
||||||
|
$sClassAlias = $this->GetClassAlias();
|
||||||
|
$aOrderSpec = array();
|
||||||
|
foreach ($aOrderBy as $sFieldAlias => $bAscending)
|
||||||
|
{
|
||||||
|
if (!is_bool($bAscending))
|
||||||
|
{
|
||||||
|
throw new CoreException("Wrong direction in ORDER BY spec, found '$bAscending' and expecting a boolean value");
|
||||||
|
}
|
||||||
|
|
||||||
|
$iDotPos = strpos($sFieldAlias, '.');
|
||||||
|
if ($iDotPos === false)
|
||||||
|
{
|
||||||
|
$sAttClass = $sClass;
|
||||||
|
$sAttClassAlias = $sClassAlias;
|
||||||
|
$sAttCode = $sFieldAlias;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sAttClassAlias = substr($sFieldAlias, 0, $iDotPos);
|
||||||
|
$sAttClass = $this->GetClassName($sAttClassAlias);
|
||||||
|
$sAttCode = substr($sFieldAlias, $iDotPos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($sAttCode != 'id')
|
||||||
|
{
|
||||||
|
MyHelpers::CheckValueInArray('field name in ORDER BY spec', $sAttCode, MetaModel::GetAttributesList($sAttClass));
|
||||||
|
|
||||||
|
$oAttDef = MetaModel::GetAttributeDef($sAttClass, $sAttCode);
|
||||||
|
foreach($oAttDef->GetOrderBySQLExpressions($sAttClassAlias) as $sSQLExpression)
|
||||||
|
{
|
||||||
|
$aOrderSpec[$sSQLExpression] = $bAscending;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$aOrderSpec['`'.$sAttClassAlias.$sAttCode.'`'] = $bAscending;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure that the columns used for sorting are present in the loaded columns
|
||||||
|
if (!is_null($aAttToLoad) && !isset($aAttToLoad[$sAttClassAlias][$sAttCode]))
|
||||||
|
{
|
||||||
|
$aAttToLoad[$sAttClassAlias][$sAttCode] = MetaModel::GetAttributeDef($sAttClass, $sAttCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*******START difference with MakeSelectQuery **************/
|
||||||
|
$sClass = key($aAttToLoad);
|
||||||
|
$sKey = $aAttToLoad[$sClass][0];
|
||||||
|
$oObjId = new FieldExpression($sKey, $sClass);
|
||||||
|
|
||||||
|
$oSQLQuery = $this->GetSQLQuery($aOrderBy, $aArgs, [], $aExtendedDataSpec, $iLimitCount, $iLimitStart, $bGetCount, null, [$oObjId] );
|
||||||
|
/********END difference with MakeSelectQuery*************/
|
||||||
|
|
||||||
|
if ($this->m_bNoContextParameters)
|
||||||
|
{
|
||||||
|
// Only internal parameters
|
||||||
|
$aScalarArgs = $this->GetInternalParams();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// The complete list of arguments will include magic arguments (e.g. current_user->attcode)
|
||||||
|
$aScalarArgs = MetaModel::PrepareQueryArguments($aArgs, $this->GetInternalParams(), $this->GetExpectedArguments());
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$sRes = $oSQLQuery->RenderSelect($aOrderSpec, $aScalarArgs, $iLimitCount, $iLimitStart, $bGetCount, $bBeautifulSQL);
|
||||||
|
if ($sClassAlias == '_itop_')
|
||||||
|
{
|
||||||
|
IssueLog::Info('SQL Query (_itop_): '.$sRes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (MissingQueryArgument $e)
|
||||||
|
{
|
||||||
|
// Add some information...
|
||||||
|
$e->addInfo('OQL', $this->ToOQL());
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
$this->AddQueryTraceSelect($oSQLQuery->GetSourceOQL(), $aOrderBy, $aScalarArgs, $aAttToLoad, $aExtendedDataSpec, $iLimitCount, $iLimitStart, $bGetCount, $sRes);
|
||||||
|
return $sRes;
|
||||||
|
}
|
||||||
|
protected function GetSQLQuery($aOrderBy, $aArgs, $aAttToLoad, $aExtendedDataSpec, $iLimitCount, $iLimitStart, $bGetCount, $aGroupByExpr = null, $aSelectExpr = null)
|
||||||
|
{
|
||||||
|
$oSQLQuery = parent::GetSQLQuery($aOrderBy, $aArgs, $aAttToLoad, $aExtendedDataSpec, $iLimitCount, $iLimitStart, $bGetCount, $aGroupByExpr, $aSelectExpr);
|
||||||
|
|
||||||
|
$oSQLQuery->SetSelect($aSelectExpr);
|
||||||
|
return $oSQLQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* A search over a DBObject
|
* A search over a DBObject
|
||||||
*
|
*
|
||||||
@@ -909,15 +1004,15 @@ class DBObjectSearch extends DBSearch
|
|||||||
*/
|
*/
|
||||||
public function AddCondition_PointingTo(DBObjectSearch $oFilter, $sExtKeyAttCode, $iOperatorCode = TREE_OPERATOR_EQUALS, &$aRealiasingMap = null)
|
public function AddCondition_PointingTo(DBObjectSearch $oFilter, $sExtKeyAttCode, $iOperatorCode = TREE_OPERATOR_EQUALS, &$aRealiasingMap = null)
|
||||||
{
|
{
|
||||||
if (!MetaModel::IsValidKeyAttCode($this->GetClass(), $sExtKeyAttCode))
|
if (!MetaModel::IsValidKeyAttCode($this->GetClass(), $sExtKeyAttCode))
|
||||||
{
|
{
|
||||||
throw new CoreWarning("The attribute code '$sExtKeyAttCode' is not an external key of the class '{$this->GetClass()}'");
|
throw new CoreWarning("The attribute code '$sExtKeyAttCode' is not an external key of the class '{$this->GetClass()}'");
|
||||||
}
|
}
|
||||||
$oAttExtKey = MetaModel::GetAttributeDef($this->GetClass(), $sExtKeyAttCode);
|
$oAttExtKey = MetaModel::GetAttributeDef($this->GetClass(), $sExtKeyAttCode);
|
||||||
if(!MetaModel::IsSameFamilyBranch($oFilter->GetClass(), $oAttExtKey->GetTargetClass()))
|
if(!MetaModel::IsSameFamilyBranch($oFilter->GetClass(), $oAttExtKey->GetTargetClass()))
|
||||||
{
|
{
|
||||||
throw new CoreException("The specified filter (pointing to {$oFilter->GetClass()}) is not compatible with the key '{$this->GetClass()}::$sExtKeyAttCode', which is pointing to {$oAttExtKey->GetTargetClass()}");
|
throw new CoreException("The specified filter (pointing to {$oFilter->GetClass()}) is not compatible with the key '{$this->GetClass()}::$sExtKeyAttCode', which is pointing to {$oAttExtKey->GetTargetClass()}");
|
||||||
}
|
}
|
||||||
if(($iOperatorCode != TREE_OPERATOR_EQUALS) && !($oAttExtKey instanceof AttributeHierarchicalKey))
|
if(($iOperatorCode != TREE_OPERATOR_EQUALS) && !($oAttExtKey instanceof AttributeHierarchicalKey))
|
||||||
{
|
{
|
||||||
throw new CoreException("The specified tree operator $iOperatorCode is not applicable to the key '{$this->GetClass()}::$sExtKeyAttCode', which is not a HierarchicalKey");
|
throw new CoreException("The specified tree operator $iOperatorCode is not applicable to the key '{$this->GetClass()}::$sExtKeyAttCode', which is not a HierarchicalKey");
|
||||||
@@ -1616,6 +1711,10 @@ class DBObjectSearch extends DBSearch
|
|||||||
{
|
{
|
||||||
return NestedQueryExpression::FromOQLObjectQuery($oExpression->GetOQLObjectQuery());
|
return NestedQueryExpression::FromOQLObjectQuery($oExpression->GetOQLObjectQuery());
|
||||||
}
|
}
|
||||||
|
elseif ($oExpression instanceof SharedQueryExpression)
|
||||||
|
{
|
||||||
|
return SharedQueryExpression::FromOQLObjectQuery($oExpression->GetOQLObjectQuery());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new CoreException('Unknown expression type', array('class'=>get_class($oExpression), 'query'=>$sQuery));
|
throw new CoreException('Unknown expression type', array('class'=>get_class($oExpression), 'query'=>$sQuery));
|
||||||
|
|||||||
@@ -851,11 +851,11 @@ abstract class DBSearch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($aColumns) == 0)
|
if (count($aColumns) == 0)
|
||||||
{
|
{
|
||||||
$aColumns = array_keys(MetaModel::ListAttributeDefs($this->GetClass()));
|
$aColumns = array_keys(MetaModel::ListAttributeDefs($this->GetClass()));
|
||||||
// Add the standard id (as first column)
|
// Add the standard id (as first column)
|
||||||
array_unshift($aColumns, 'id');
|
array_unshift($aColumns, 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
$aQueryCols = CMDBSource::GetColumns($resQuery, $sSQL);
|
$aQueryCols = CMDBSource::GetColumns($resQuery, $sSQL);
|
||||||
@@ -885,6 +885,55 @@ abstract class DBSearch
|
|||||||
return $aRes;
|
return $aRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selects a column ($sAttCode) from the specified class ($sClassAlias - default main class) of the DBsearch object and gives the result as an array
|
||||||
|
* @param string $sAttCode
|
||||||
|
* @param string|null $sClassAlias
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
* @throws ConfigException
|
||||||
|
* @throws CoreException
|
||||||
|
* @throws MissingQueryArgument
|
||||||
|
* @throws MySQLException
|
||||||
|
* @throws MySQLHasGoneAwayException
|
||||||
|
*/
|
||||||
|
public function SelectAttributeToArray(string $sAttCode, ?string $sClassAlias = null):array
|
||||||
|
{
|
||||||
|
if(is_null($sClassAlias)) {
|
||||||
|
$sClassAlias = $this->GetClassAlias();
|
||||||
|
}
|
||||||
|
|
||||||
|
$sClass = $this->GetClass();
|
||||||
|
if($sAttCode === 'id'){
|
||||||
|
$aAttToLoad[$sClassAlias]=[];
|
||||||
|
} else {
|
||||||
|
$aAttToLoad[$sClassAlias][$sAttCode] = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sSQL = $this->MakeSelectQuery([], [], $aAttToLoad);
|
||||||
|
$resQuery = CMDBSource::Query($sSQL);
|
||||||
|
if (!$resQuery)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$sColName = $sClassAlias.$sAttCode;
|
||||||
|
|
||||||
|
$aRes = [];
|
||||||
|
while ($aRow = CMDBSource::FetchArray($resQuery))
|
||||||
|
{
|
||||||
|
$aMappedRow = array();
|
||||||
|
if($sAttCode === 'id') {
|
||||||
|
$aMappedRow[$sAttCode] = $aRow[$sColName];
|
||||||
|
} else {
|
||||||
|
$aMappedRow[$sAttCode] = $aAttToLoad[$sClassAlias][$sAttCode]->FromSQLToValue($aRow, $sColName);
|
||||||
|
}
|
||||||
|
$aRes[] = $aMappedRow;
|
||||||
|
}
|
||||||
|
CMDBSource::FreeResult($resQuery);
|
||||||
|
return $aRes;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Construction of the SQL queries
|
// Construction of the SQL queries
|
||||||
|
|||||||
@@ -64,16 +64,22 @@ class DesignDocument extends DOMDocument
|
|||||||
/**
|
/**
|
||||||
* Overload of the standard API
|
* Overload of the standard API
|
||||||
*
|
*
|
||||||
* @param $filename
|
* @param string $filename
|
||||||
* @param int $options
|
* @param int $options
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function load($filename, $options = null)
|
public function load(string $filename, int $options = 0): bool
|
||||||
{
|
{
|
||||||
libxml_clear_errors();
|
libxml_clear_errors();
|
||||||
if (parent::load($filename, LIBXML_NOBLANKS) === false) {
|
if (parent::load($filename, LIBXML_NOBLANKS) === false) {
|
||||||
$aErrors = libxml_get_errors();
|
$aErrors = libxml_get_errors();
|
||||||
IssueLog::Error("Error loading $filename", LogAPI::CHANNEL_DEFAULT, $aErrors);
|
IssueLog::Error("Error loading $filename", LogAPI::CHANNEL_DEFAULT, $aErrors);
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ use Combodo\iTop\Application\UI\Base\Component\MedallionIcon\MedallionIcon;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\Panel;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\Panel;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\iTopPDF;
|
||||||
|
use Combodo\iTop\Application\WebPage\PDFPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Renderer\BlockRenderer;
|
use Combodo\iTop\Renderer\BlockRenderer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,6 +37,7 @@ class DisplayableNode extends GraphNode
|
|||||||
{
|
{
|
||||||
public $x;
|
public $x;
|
||||||
public $y;
|
public $y;
|
||||||
|
public bool $bFiltered;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new node inside a graph
|
* Create a new node inside a graph
|
||||||
@@ -62,7 +66,7 @@ class DisplayableNode extends GraphNode
|
|||||||
|
|
||||||
public function GetWidth()
|
public function GetWidth()
|
||||||
{
|
{
|
||||||
return max(32, 5*strlen($this->GetProperty('label'))); // approximation of the text's bounding box
|
return max(32, 5 * mb_strlen($this->GetProperty('label'))); // approximation of the text's bounding box
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetHeight()
|
public function GetHeight()
|
||||||
@@ -491,7 +495,7 @@ class DisplayableNode extends GraphNode
|
|||||||
if ($bNoLabel)
|
if ($bNoLabel)
|
||||||
{
|
{
|
||||||
// simulate a fake label with the approximate same size as the true label
|
// simulate a fake label with the approximate same size as the true label
|
||||||
$sLabel = str_repeat('x',strlen($this->GetProperty('label', $this->GetId())));
|
$sLabel = str_repeat('x', mb_strlen($this->GetProperty('label', $this->GetId())));
|
||||||
$sDot = 'label="'.$sLabel.'"';
|
$sDot = 'label="'.$sLabel.'"';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1580,7 +1584,7 @@ EOF
|
|||||||
* @param string $sContextKey
|
* @param string $sContextKey
|
||||||
* @param array $aContextParams
|
* @param array $aContextParams
|
||||||
* @param array $aExcludedObjects
|
* @param array $aExcludedObjects
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param array $aResults
|
* @param array $aResults
|
||||||
* @param bool $bLazyLoading
|
* @param bool $bLazyLoading
|
||||||
*
|
*
|
||||||
@@ -1602,7 +1606,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param array $aResults
|
* @param array $aResults
|
||||||
* @param bool $bLazyLoading
|
* @param bool $bLazyLoading
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -46,6 +46,15 @@ class EMail implements iEMail
|
|||||||
const ORIGINAL_FORMAT = 1; // Original format, consisting in serializing the whole object, inculding the Swift Mailer's object.
|
const ORIGINAL_FORMAT = 1; // Original format, consisting in serializing the whole object, inculding the Swift Mailer's object.
|
||||||
// Did not work with attachements since their binary representation cannot be stored as a valid UTF-8 string
|
// Did not work with attachements since their binary representation cannot be stored as a valid UTF-8 string
|
||||||
const FORMAT_V2 = 2; // New format, only the raw data are serialized (base64 encoded if needed)
|
const FORMAT_V2 = 2; // New format, only the raw data are serialized (base64 encoded if needed)
|
||||||
|
|
||||||
|
/** @var int ENUM_SEND_DEFAULT This option can be used when sending an e-mail to respect the default configuration parameter. */
|
||||||
|
const ENUM_SEND_DEFAULT = 0;
|
||||||
|
|
||||||
|
/** @var int ENUM_SEND_FORCE_SYNCHRONOUS This option can be used when sending an e-mail to ignore the default and force synchronous sending instead. Example of a use case: instant e-mail test. */
|
||||||
|
const ENUM_SEND_FORCE_SYNCHRONOUS = 1;
|
||||||
|
|
||||||
|
/** @var int ENUM_SEND_FORCE_ASYNCHRONOUS This option can be used when sending an e-mail to ignore the default and force synchronous sending instead. Example of a use case: Bulk mails. */
|
||||||
|
const ENUM_SEND_FORCE_ASYNCHRONOUS = 2;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2023 Combodo SARL
|
* Copyright (C) 2013-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
@@ -242,44 +245,33 @@ class EventIssue extends Event
|
|||||||
{
|
{
|
||||||
if (is_string($sValue))
|
if (is_string($sValue))
|
||||||
{
|
{
|
||||||
if (strlen($sValue) < 256)
|
if (mb_strlen($sValue) < 256) {
|
||||||
{
|
|
||||||
$aPost[$sKey] = $sValue;
|
$aPost[$sKey] = $sValue;
|
||||||
|
} else {
|
||||||
|
$aPost[$sKey] = "!long string: ".mb_strlen($sValue)." chars";
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
$aPost[$sKey] = "!long string: ".strlen($sValue). " chars";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Not a string (avoid warnings in case the value cannot be easily casted into a string)
|
// Not a string (avoid warnings in case the value cannot be easily casted into a string)
|
||||||
$aPost[$sKey] = @(string) $sValue;
|
$aPost[$sKey] = @(string)$sValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->Set('arguments_post', $aPost);
|
$this->Set('arguments_post', $aPost);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->Set('arguments_post', array());
|
$this->Set('arguments_post', array());
|
||||||
}
|
}
|
||||||
|
$sLength = mb_strlen($this->Get('issue'));
|
||||||
$sLength = strlen($this->Get('issue'));
|
if ($sLength > 255) {
|
||||||
if ($sLength > 255)
|
$this->Set('issue', mb_substr($this->Get('issue'), 0, 210)." -truncated ($sLength chars)");
|
||||||
{
|
|
||||||
$this->Set('issue', substr($this->Get('issue'), 0, 200)." -truncated ($sLength chars)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sLength = strlen($this->Get('impact'));
|
$sLength = mb_strlen($this->Get('impact'));
|
||||||
if ($sLength > 255)
|
if ($sLength > 255) {
|
||||||
{
|
$this->Set('impact', mb_substr($this->Get('impact'), 0, 210)." -truncated ($sLength chars)");
|
||||||
$this->Set('impact', substr($this->Get('impact'), 0, 200)." -truncated ($sLength chars)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sLength = strlen($this->Get('page'));
|
$sLength = mb_strlen($this->Get('page'));
|
||||||
if ($sLength > 255)
|
if ($sLength > 255) {
|
||||||
{
|
$this->Set('page', mb_substr($this->Get('page'), 0, 210)." -truncated ($sLength chars)");
|
||||||
$this->Set('page', substr($this->Get('page'), 0, 200)." -truncated ($sLength chars)");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
||||||
use Combodo\iTop\Application\Helper\ExportHelper;
|
use Combodo\iTop\Application\Helper\ExportHelper;
|
||||||
|
use Combodo\iTop\Application\WebPage\Page;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
require_once(APPROOT.'application/xlsxwriter.class.php');
|
require_once(APPROOT.'application/xlsxwriter.class.php');
|
||||||
|
|
||||||
@@ -69,7 +71,7 @@ class ExcelBulkExport extends TabularBulkExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sPartId
|
* @param $sPartId
|
||||||
*
|
*
|
||||||
* @return UIContentBlock
|
* @return UIContentBlock
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ EOF;
|
|||||||
EOF;
|
EOF;
|
||||||
|
|
||||||
SetupUtils::builddir(dirname($sFilePath));
|
SetupUtils::builddir(dirname($sFilePath));
|
||||||
file_put_contents($sFilePath, $content);
|
file_put_contents($sFilePath, $content, LOCK_EX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Dict::SetUserLanguage($sUserLang);
|
Dict::SetUserLanguage($sUserLang);
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
use Combodo\iTop\Application\WebPage\Page;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk export: HTML export
|
* Bulk export: HTML export
|
||||||
@@ -37,7 +39,7 @@ class HTMLBulkExport extends TabularBulkExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sPartId
|
* @param $sPartId
|
||||||
*
|
*
|
||||||
* @return UIContentBlock
|
* @return UIContentBlock
|
||||||
|
|||||||
@@ -1090,6 +1090,11 @@ class DeadLockLog extends LogAPI
|
|||||||
*/
|
*/
|
||||||
class DeprecatedCallsLog extends LogAPI
|
class DeprecatedCallsLog extends LogAPI
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
* @since 3.2.0 N°4897
|
||||||
|
*/
|
||||||
|
public const ENUM_CHANNEL_PHP_API = 'deprecated-php-api';
|
||||||
public const ENUM_CHANNEL_PHP_METHOD = 'deprecated-php-method';
|
public const ENUM_CHANNEL_PHP_METHOD = 'deprecated-php-method';
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
@@ -1283,6 +1288,35 @@ class DeprecatedCallsLog extends LogAPI
|
|||||||
static::Warning($sMessage, static::ENUM_CHANNEL_FILE);
|
static::Warning($sMessage, static::ENUM_CHANNEL_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sImplementationClass Class implementing the deprecated API
|
||||||
|
* @param string $sDeprecatedApi Class name of the deprecated API
|
||||||
|
* @param string $sDeprecatedMethod Method name of the deprecated API
|
||||||
|
* @param string|null $sAdditionalMessage Additional message, mostly used to explain what API to use instead
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0 N°4897
|
||||||
|
*/
|
||||||
|
public static function NotifyDeprecatedPhpApi(string $sImplementationClass, string $sDeprecatedApi, string $sDeprecatedMethod, ?string $sAdditionalMessage = null): void
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (!static::IsLogLevelEnabled(self::LEVEL_WARNING, self::ENUM_CHANNEL_PHP_API)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ConfigException $oException) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sMessage = "Implementation of {$sDeprecatedApi}::{$sDeprecatedMethod}() in class {$sImplementationClass}";
|
||||||
|
|
||||||
|
if (!is_null($sAdditionalMessage)) {
|
||||||
|
$sMessage .= " : $sAdditionalMessage";
|
||||||
|
}
|
||||||
|
|
||||||
|
static::Warning($sMessage, self::ENUM_CHANNEL_PHP_API);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|null $sAdditionalMessage
|
* @param string|null $sAdditionalMessage
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -6846,18 +6846,6 @@ abstract class MetaModel
|
|||||||
$sClass = $aRow[$sClassAlias."finalclass"];
|
$sClass = $aRow[$sClassAlias."finalclass"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// if an object is already being updated, then this method will return this object instead of recreating a new one.
|
|
||||||
// At this point the method DBUpdate of a new object with the same class and id won't do anything due to reentrance protection,
|
|
||||||
// so to ensure that the potential modifications are correctly saved, the object currently being updated is returned.
|
|
||||||
// DBUpdate() method then will take care that all the modifications will be saved.
|
|
||||||
if (array_key_exists($sClassAlias.'id', $aRow)) {
|
|
||||||
$iKey = $aRow[$sClassAlias."id"];
|
|
||||||
$oObject = self::GetReentranceObject($sClass, $iKey);
|
|
||||||
if ($oObject !== false) {
|
|
||||||
return $oObject;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new $sClass($aRow, $sClassAlias, $aAttToLoad, $aExtendedDataSpec);
|
return new $sClass($aRow, $sClassAlias, $aAttToLoad, $aExtendedDataSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7180,32 +7168,45 @@ abstract class MetaModel
|
|||||||
*/
|
*/
|
||||||
public static function PurgeData($oFilter)
|
public static function PurgeData($oFilter)
|
||||||
{
|
{
|
||||||
|
$iMaxChunkSize = MetaModel::GetConfig()->Get('purge_data.max_chunk_size');
|
||||||
$sTargetClass = $oFilter->GetClass();
|
$sTargetClass = $oFilter->GetClass();
|
||||||
$oSet = new DBObjectSet($oFilter);
|
$iNbIdsDeleted = 0;
|
||||||
$oSet->OptimizeColumnLoad(array($sTargetClass => array('finalclass')));
|
$bExecuteQuery = true;
|
||||||
$aIdToClass = $oSet->GetColumnAsArray('finalclass', true);
|
|
||||||
|
|
||||||
$aIds = array_keys($aIdToClass);
|
// This loop allows you to delete objects in batches of $iMaxChunkSize elements
|
||||||
if (count($aIds) > 0)
|
while ($bExecuteQuery) {
|
||||||
{
|
$oSet = new DBObjectSet($oFilter);
|
||||||
$aQuotedIds = CMDBSource::Quote($aIds);
|
$oSet->SetLimit($iMaxChunkSize);
|
||||||
$sIdList = implode(',', $aQuotedIds);
|
$oSet->OptimizeColumnLoad(array($sTargetClass => array('finalclass')));
|
||||||
$aTargetClasses = array_merge(
|
$aIdToClass = $oSet->GetColumnAsArray('finalclass', true);
|
||||||
self::EnumChildClasses($sTargetClass, ENUM_CHILD_CLASSES_ALL),
|
|
||||||
self::EnumParentClasses($sTargetClass, ENUM_PARENT_CLASSES_EXCLUDELEAF)
|
|
||||||
);
|
|
||||||
foreach($aTargetClasses as $sSomeClass)
|
|
||||||
{
|
|
||||||
$sTable = MetaModel::DBGetTable($sSomeClass);
|
|
||||||
$sPKField = MetaModel::DBGetKey($sSomeClass);
|
|
||||||
|
|
||||||
$sDeleteSQL = "DELETE FROM `$sTable` WHERE `$sPKField` IN ($sIdList)";
|
$aIds = array_keys($aIdToClass);
|
||||||
CMDBSource::DeleteFrom($sDeleteSQL);
|
$iNbIds = count($aIds);
|
||||||
|
if ($iNbIds > 0) {
|
||||||
|
$aQuotedIds = CMDBSource::Quote($aIds);
|
||||||
|
$sIdList = implode(',', $aQuotedIds);
|
||||||
|
$aTargetClasses = array_merge(
|
||||||
|
self::EnumChildClasses($sTargetClass, ENUM_CHILD_CLASSES_ALL),
|
||||||
|
self::EnumParentClasses($sTargetClass, ENUM_PARENT_CLASSES_EXCLUDELEAF)
|
||||||
|
);
|
||||||
|
foreach ($aTargetClasses as $sSomeClass) {
|
||||||
|
$sTable = MetaModel::DBGetTable($sSomeClass);
|
||||||
|
$sPKField = MetaModel::DBGetKey($sSomeClass);
|
||||||
|
|
||||||
|
$sDeleteSQL = "DELETE FROM `$sTable` WHERE `$sPKField` IN ($sIdList)";
|
||||||
|
CMDBSource::DeleteFrom($sDeleteSQL);
|
||||||
|
}
|
||||||
|
$iNbIdsDeleted += $iNbIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
// stop loop if query returned fewer objects than $iMaxChunkSize. In this case, all objects have been deleted.
|
||||||
|
if ($iNbIds < $iMaxChunkSize) {
|
||||||
|
$bExecuteQuery = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count($aIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return $iNbIdsDeleted;
|
||||||
|
}
|
||||||
// Links
|
// Links
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ class PHP_ParserGenerator
|
|||||||
while (isset($errmsg[$restart]) && $errmsg[$restart] == ' ') {
|
while (isset($errmsg[$restart]) && $errmsg[$restart] == ' ') {
|
||||||
$restart++;
|
$restart++;
|
||||||
}
|
}
|
||||||
printf("%s%.${end}s\n", $prefix, $errmsg);
|
printf("%s%.{$end}s\n", $prefix, $errmsg);
|
||||||
$errmsg = substr($errmsg, $restart);
|
$errmsg = substr($errmsg, $restart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -771,7 +771,7 @@ class PHP_ParserGenerator
|
|||||||
for ($j = $i; $j < $this->nsymbol; $j += $skip) {
|
for ($j = $i; $j < $this->nsymbol; $j += $skip) {
|
||||||
$sp = $this->symbols[$j];
|
$sp = $this->symbols[$j];
|
||||||
//assert( sp->index==j );
|
//assert( sp->index==j );
|
||||||
printf(" %3d %-${maxlen}.${maxlen}s", $j, $sp->name);
|
printf(" %3d %-{$maxlen}.{$maxlen}s", $j, $sp->name);
|
||||||
}
|
}
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,19 +231,19 @@ class PHP_ParserGenerator_Action
|
|||||||
switch ($this->type)
|
switch ($this->type)
|
||||||
{
|
{
|
||||||
case self::SHIFT:
|
case self::SHIFT:
|
||||||
fprintf($fp, "%${indent}s shift %d", $this->sp->name, $this->x->statenum);
|
fprintf($fp, "%{$indent}s shift %d", $this->sp->name, $this->x->statenum);
|
||||||
break;
|
break;
|
||||||
case self::REDUCE:
|
case self::REDUCE:
|
||||||
fprintf($fp, "%${indent}s reduce %d", $this->sp->name, $this->x->index);
|
fprintf($fp, "%{$indent}s reduce %d", $this->sp->name, $this->x->index);
|
||||||
break;
|
break;
|
||||||
case self::ACCEPT:
|
case self::ACCEPT:
|
||||||
fprintf($fp, "%${indent}s accept", $this->sp->name);
|
fprintf($fp, "%{$indent}s accept", $this->sp->name);
|
||||||
break;
|
break;
|
||||||
case self::ERROR:
|
case self::ERROR:
|
||||||
fprintf($fp, "%${indent}s error", $this->sp->name);
|
fprintf($fp, "%{$indent}s error", $this->sp->name);
|
||||||
break;
|
break;
|
||||||
case self::CONFLICT:
|
case self::CONFLICT:
|
||||||
fprintf($fp, "%${indent}s reduce %-3d ** Parsing conflict **", $this->sp->name, $this->x->index);
|
fprintf($fp, "%{$indent}s reduce %-3d ** Parsing conflict **", $this->sp->name, $this->x->index);
|
||||||
break;
|
break;
|
||||||
case self::SH_RESOLVED:
|
case self::SH_RESOLVED:
|
||||||
case self::RD_RESOLVED:
|
case self::RD_RESOLVED:
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ use Combodo\iTop\Application\UI\Base\Component\CollapsibleSection\CollapsibleSec
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
||||||
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Renderer\BlockRenderer;
|
use Combodo\iTop\Renderer\BlockRenderer;
|
||||||
|
|
||||||
define('CASELOG_VISIBLE_ITEMS', 2);
|
define('CASELOG_VISIBLE_ITEMS', 2);
|
||||||
@@ -169,7 +170,7 @@ class ormCaseLog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process the case of an eventual remainder (quick migration of AttributeText fields)
|
// Process the case of an eventual remainder (quick migration of AttributeText fields)
|
||||||
if ($iPos < (strlen($this->m_sLog) - 1))
|
if ($iPos < (utils::StrLen($this->m_sLog) - 1))
|
||||||
{
|
{
|
||||||
$sTextEntry = substr($this->m_sLog, $iPos);
|
$sTextEntry = substr($this->m_sLog, $iPos);
|
||||||
|
|
||||||
@@ -292,7 +293,7 @@ class ormCaseLog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process the case of an eventual remainder (quick migration of AttributeText fields)
|
// Process the case of an eventual remainder (quick migration of AttributeText fields)
|
||||||
if ($iPos < (strlen($this->m_sLog) - 1)) {
|
if ($iPos < (utils::StrLen($this->m_sLog) - 1)) {
|
||||||
$sTextEntry = substr($this->m_sLog, $iPos);
|
$sTextEntry = substr($this->m_sLog, $iPos);
|
||||||
$sTextEntry = str_replace(array("\r\n", "\n", "\r"), "<br/>", utils::EscapeHtml($sTextEntry));
|
$sTextEntry = str_replace(array("\r\n", "\n", "\r"), "<br/>", utils::EscapeHtml($sTextEntry));
|
||||||
|
|
||||||
@@ -373,7 +374,7 @@ class ormCaseLog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process the case of an eventual remainder (quick migration of AttributeText fields)
|
// Process the case of an eventual remainder (quick migration of AttributeText fields)
|
||||||
if ($iPos < (strlen($this->m_sLog) - 1)) {
|
if ($iPos < (utils::StrLen($this->m_sLog) - 1)) {
|
||||||
$sTextEntry = substr($this->m_sLog, $iPos);
|
$sTextEntry = substr($this->m_sLog, $iPos);
|
||||||
$sTextEntry = str_replace(array("\r\n", "\n", "\r"), "<br/>", utils::EscapeHtml($sTextEntry));
|
$sTextEntry = str_replace(array("\r\n", "\n", "\r"), "<br/>", utils::EscapeHtml($sTextEntry));
|
||||||
|
|
||||||
@@ -467,7 +468,7 @@ class ormCaseLog {
|
|||||||
$oBlock->AddSubBlock($oCollapsibleBlock);
|
$oBlock->AddSubBlock($oCollapsibleBlock);
|
||||||
}
|
}
|
||||||
// Process the case of an eventual remainder (quick migration of AttributeText fields)
|
// Process the case of an eventual remainder (quick migration of AttributeText fields)
|
||||||
if ($iPos < (strlen($this->m_sLog) - 1)) {
|
if ($iPos < (utils::StrLen($this->m_sLog) - 1)) {
|
||||||
// In this case the format is always "text"
|
// In this case the format is always "text"
|
||||||
$sTextEntry = substr($this->m_sLog, $iPos);
|
$sTextEntry = substr($this->m_sLog, $iPos);
|
||||||
$sTextEntry = str_replace(array("\r\n", "\n", "\r"), "<br/>", utils::EscapeHtml($sTextEntry));
|
$sTextEntry = str_replace(array("\r\n", "\n", "\r"), "<br/>", utils::EscapeHtml($sTextEntry));
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
use Combodo\iTop\Service\Events\EventData;
|
use Combodo\iTop\Service\Events\EventData;
|
||||||
use Combodo\iTop\Service\Events\EventService;
|
use Combodo\iTop\Service\Events\EventService;
|
||||||
|
|
||||||
@@ -343,6 +344,6 @@ class ormDocument
|
|||||||
*/
|
*/
|
||||||
public function GetSignature(): string
|
public function GetSignature(): string
|
||||||
{
|
{
|
||||||
return md5($this->GetData());
|
return md5($this->GetData() ?? '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,13 @@ use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSetUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\SelectUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\Page;
|
||||||
|
use Combodo\iTop\Application\WebPage\PDFPage;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk export: PDF export, based on the HTML export converted to PDF
|
* Bulk export: PDF export, based on the HTML export converted to PDF
|
||||||
@@ -49,7 +52,7 @@ class PDFBulkExport extends HTMLBulkExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sPartId
|
* @param $sPartId
|
||||||
*
|
*
|
||||||
* @return UIContentBlock
|
* @return UIContentBlock
|
||||||
@@ -68,8 +71,6 @@ class PDFBulkExport extends HTMLBulkExport
|
|||||||
|
|
||||||
//page format
|
//page format
|
||||||
$oSelectFormat = SelectUIBlockFactory::MakeForSelectWithLabel("page_size", Dict::S('Core:BulkExport:PDFPageSize'));
|
$oSelectFormat = SelectUIBlockFactory::MakeForSelectWithLabel("page_size", Dict::S('Core:BulkExport:PDFPageSize'));
|
||||||
$oSelectFormat->SetIsLabelBefore(false);
|
|
||||||
//$oSelectFormat->AddCSSClass('ibo-input-checkbox');
|
|
||||||
$oFieldSetFormat->AddSubBlock($oSelectFormat);
|
$oFieldSetFormat->AddSubBlock($oSelectFormat);
|
||||||
|
|
||||||
$aPossibleFormat = ['A3', 'A4', 'Letter'];
|
$aPossibleFormat = ['A3', 'A4', 'Letter'];
|
||||||
@@ -79,10 +80,7 @@ class PDFBulkExport extends HTMLBulkExport
|
|||||||
}
|
}
|
||||||
$oFieldSetFormat->AddSubBlock(new Html('</br>'));
|
$oFieldSetFormat->AddSubBlock(new Html('</br>'));
|
||||||
|
|
||||||
$oSelectOrientation = SelectUIBlockFactory::MakeForSelectWithLabel("page_orientation",
|
$oSelectOrientation = SelectUIBlockFactory::MakeForSelectWithLabel("page_orientation", Dict::S('Core:BulkExport:PDFPageOrientation'));
|
||||||
Dict::S('Core:BulkExport:PDFPageOrientation'));
|
|
||||||
$oSelectOrientation->SetIsLabelBefore(false);
|
|
||||||
//$oSelectOrientation->AddCSSClass('ibo-input-checkbox');
|
|
||||||
$oFieldSetFormat->AddSubBlock($oSelectOrientation);
|
$oFieldSetFormat->AddSubBlock($oSelectOrientation);
|
||||||
|
|
||||||
$aPossibleOrientation = ['P', 'L'];
|
$aPossibleOrientation = ['P', 'L'];
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\Page;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk export: "spreadsheet" export: a simplified HTML export in which the date/time columns are split in two column: date AND time
|
* Bulk export: "spreadsheet" export: a simplified HTML export in which the date/time columns are split in two column: date AND time
|
||||||
@@ -34,7 +36,7 @@ class SpreadsheetBulkExport extends TabularBulkExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sPartId
|
* @param $sPartId
|
||||||
*
|
*
|
||||||
* @return UIContentBlock
|
* @return UIContentBlock
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk export: Tabular export: abstract base class for all "tabular" exports.
|
* Bulk export: Tabular export: abstract base class for all "tabular" exports.
|
||||||
@@ -22,7 +23,7 @@ abstract class TabularBulkExport extends BulkExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sPartId
|
* @param $sPartId
|
||||||
*
|
*
|
||||||
* @return UIContentBlock
|
* @return UIContentBlock
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Stores data for {@link AttributeTagSet} fields
|
* <p>Stores data for {@link AttributeTagSet} fields
|
||||||
@@ -296,7 +298,7 @@ abstract class TagSetFieldData extends cmdbAbstractObject
|
|||||||
/**
|
/**
|
||||||
* Display Tag Usage
|
* Display Tag Usage
|
||||||
*
|
*
|
||||||
* @param \WebPage $oPage
|
* @param WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
*
|
*
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
|
|||||||
@@ -53,9 +53,10 @@ abstract class Trigger extends cmdbAbstractObject
|
|||||||
MetaModel::Init_AddAttribute(new AttributeEnumSet("context", array("allowed_values" => null, "possible_values" => new ValueSetEnumPadded($aTags, true), "sql" => "context", "depends_on" => array(), "is_null_allowed" => true, "max_items" => 12)));
|
MetaModel::Init_AddAttribute(new AttributeEnumSet("context", array("allowed_values" => null, "possible_values" => new ValueSetEnumPadded($aTags, true), "sql" => "context", "depends_on" => array(), "is_null_allowed" => true, "max_items" => 12)));
|
||||||
// "complement" is a computed field, fed by Trigger sub-classes, in general in ComputeValues method, for eg. the TriggerOnObject fed it with target_class info
|
// "complement" is a computed field, fed by Trigger sub-classes, in general in ComputeValues method, for eg. the TriggerOnObject fed it with target_class info
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("complement", array("allowed_values" => null, "sql" => "complement", "default_value" => null, "is_null_allowed" => true, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeString("complement", array("allowed_values" => null, "sql" => "complement", "default_value" => null, "is_null_allowed" => true, "depends_on" => array())));
|
||||||
|
MetaModel::Init_AddAttribute(new AttributeEnum("subscription_policy", array("allowed_values" => new ValueSetEnum('allow_no_channel,force_at_least_one_channel,force_all_channels'), "sql" => "subscription_policy", "default_value" => 'allow_no_channel', "is_null_allowed" => false, "depends_on" => array())));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('finalclass', 'description', 'context', 'action_list', 'complement')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('finalclass', 'description', 'context', 'subscription_policy', 'action_list', 'complement')); // Attributes to be displayed for the complete details
|
||||||
MetaModel::Init_SetZListItems('list', array('finalclass', 'complement')); // Attributes to be displayed for a list
|
MetaModel::Init_SetZListItems('list', array('finalclass', 'complement')); // Attributes to be displayed for a list
|
||||||
// Search criteria
|
// Search criteria
|
||||||
// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
||||||
@@ -111,19 +112,31 @@ abstract class Trigger extends cmdbAbstractObject
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$aContextArgs['trigger->object()'] = $this;
|
||||||
|
|
||||||
// Find the related actions
|
// Find the related actions
|
||||||
$oLinkedActions = $this->Get('action_list');
|
$oLinkedActions = $this->Get('action_list');
|
||||||
while ($oLink = $oLinkedActions->Fetch())
|
|
||||||
{
|
// Order actions as expected
|
||||||
/** @var \DBObject $oLink */
|
$aActionListOrdered = [];
|
||||||
$iActionId = $oLink->Get('action_id');
|
while ($oLink = $oLinkedActions->Fetch()) {
|
||||||
/** @var \Action $oAction */
|
$aActionListOrdered[(int) $oLink->Get('order')][] = $oLink;
|
||||||
$oAction = MetaModel::GetObject('Action', $iActionId);
|
}
|
||||||
if ($oAction->IsActive())
|
ksort($aActionListOrdered);
|
||||||
{
|
|
||||||
$oKPI = new ExecutionKPI();
|
// Execute actions
|
||||||
$oAction->DoExecute($this, $aContextArgs);
|
foreach ($aActionListOrdered as $aActionSubList) {
|
||||||
$oKPI->ComputeStatsForExtension($oAction, 'DoExecute');
|
foreach ($aActionSubList as $oLink) /** @var \DBObject $oLink */ {
|
||||||
|
/** @var \DBObject $oLink */
|
||||||
|
$iActionId = $oLink->Get('action_id');
|
||||||
|
/** @var \Action $oAction */
|
||||||
|
$oAction = MetaModel::GetObject('Action', $iActionId);
|
||||||
|
if ($oAction->IsActive()) {
|
||||||
|
$oKPI = new ExecutionKPI();
|
||||||
|
$aContextArgs['action->object()'] = $oAction;
|
||||||
|
$oAction->DoExecute($this, $aContextArgs);
|
||||||
|
$oKPI->ComputeStatsForExtension($oAction, 'DoExecute');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -438,7 +451,7 @@ class TriggerOnStateEnter extends TriggerOnStateChange
|
|||||||
MetaModel::Init_InheritAttributes();
|
MetaModel::Init_InheritAttributes();
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'state', 'action_list')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'state', 'subscription_policy', 'action_list')); // Attributes to be displayed for the complete details
|
||||||
MetaModel::Init_SetZListItems('list', array('target_class', 'state')); // Attributes to be displayed for a list
|
MetaModel::Init_SetZListItems('list', array('target_class', 'state')); // Attributes to be displayed for a list
|
||||||
// Search criteria
|
// Search criteria
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class', 'state')); // Criteria of the std search form
|
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class', 'state')); // Criteria of the std search form
|
||||||
@@ -471,7 +484,7 @@ class TriggerOnStateLeave extends TriggerOnStateChange
|
|||||||
MetaModel::Init_InheritAttributes();
|
MetaModel::Init_InheritAttributes();
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'state', 'action_list')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'state', 'subscription_policy', 'action_list')); // Attributes to be displayed for the complete details
|
||||||
MetaModel::Init_SetZListItems('list', array('target_class', 'state')); // Attributes to be displayed for a list
|
MetaModel::Init_SetZListItems('list', array('target_class', 'state')); // Attributes to be displayed for a list
|
||||||
// Search criteria
|
// Search criteria
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class', 'state')); // Criteria of the std search form
|
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class', 'state')); // Criteria of the std search form
|
||||||
@@ -504,7 +517,7 @@ class TriggerOnObjectCreate extends TriggerOnObject
|
|||||||
MetaModel::Init_InheritAttributes();
|
MetaModel::Init_InheritAttributes();
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'action_list')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'subscription_policy', 'action_list')); // Attributes to be displayed for the complete details
|
||||||
MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
|
MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
|
||||||
// Search criteria
|
// Search criteria
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
|
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
|
||||||
@@ -537,7 +550,7 @@ class TriggerOnObjectDelete extends TriggerOnObject
|
|||||||
MetaModel::Init_InheritAttributes();
|
MetaModel::Init_InheritAttributes();
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'action_list')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'subscription_policy', 'action_list')); // Attributes to be displayed for the complete details
|
||||||
MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
|
MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
|
||||||
// Search criteria
|
// Search criteria
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
|
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
|
||||||
@@ -572,7 +585,7 @@ class TriggerOnObjectUpdate extends TriggerOnObject
|
|||||||
MetaModel::Init_AddAttribute(new AttributeClassAttCodeSet('target_attcodes', array("allowed_values" => null, "class_field" => "target_class", "sql" => "target_attcodes", "default_value" => null, "is_null_allowed" => true, "max_items" => 20, "min_items" => 0, "attribute_definition_exclusion_list" => "AttributeDashboard,AttributeExternalField,AttributeFinalClass,AttributeFriendlyName,AttributeObsolescenceDate,AttributeObsolescenceFlag,AttributeSubItem", "attribute_definition_list" => null, "depends_on" => array('target_class'))));
|
MetaModel::Init_AddAttribute(new AttributeClassAttCodeSet('target_attcodes', array("allowed_values" => null, "class_field" => "target_class", "sql" => "target_attcodes", "default_value" => null, "is_null_allowed" => true, "max_items" => 20, "min_items" => 0, "attribute_definition_exclusion_list" => "AttributeDashboard,AttributeExternalField,AttributeFinalClass,AttributeFriendlyName,AttributeObsolescenceDate,AttributeObsolescenceFlag,AttributeSubItem", "attribute_definition_list" => null, "depends_on" => array('target_class'))));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'target_attcodes', 'action_list')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'target_attcodes', 'subscription_policy', 'action_list')); // Attributes to be displayed for the complete details
|
||||||
MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
|
MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
|
||||||
// Search criteria
|
// Search criteria
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
|
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
|
||||||
@@ -668,7 +681,7 @@ class TriggerOnObjectMention extends TriggerOnObject
|
|||||||
MetaModel::Init_AddAttribute(new AttributeOQL("mentioned_filter", array("allowed_values" => null, "sql" => "mentioned_filter", "default_value" => null, "is_null_allowed" => true, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeOQL("mentioned_filter", array("allowed_values" => null, "sql" => "mentioned_filter", "default_value" => null, "is_null_allowed" => true, "depends_on" => array())));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'mentioned_filter', 'action_list')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'mentioned_filter', 'subscription_policy', 'action_list')); // Attributes to be displayed for the complete details
|
||||||
MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
|
MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
|
||||||
// Search criteria
|
// Search criteria
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
|
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Combodo\iTop\Application\Helper\Session;
|
use Combodo\iTop\Application\Helper\Session;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
define('UR_ALLOWED_NO', 0);
|
define('UR_ALLOWED_NO', 0);
|
||||||
define('UR_ALLOWED_YES', 1);
|
define('UR_ALLOWED_YES', 1);
|
||||||
@@ -161,7 +162,7 @@ abstract class UserRightsAddOnAPI
|
|||||||
$oSearchSharers->AllowAllData();
|
$oSearchSharers->AllowAllData();
|
||||||
$oSearchSharers->AddCondition_ReferencedBy($oShareSearch, 'sharing_org_id');
|
$oSearchSharers->AddCondition_ReferencedBy($oShareSearch, 'sharing_org_id');
|
||||||
$aSharers = array();
|
$aSharers = array();
|
||||||
foreach($oSearchSharers->ToDataArray(array('id')) as $aRow)
|
foreach($oSearchSharers->SelectAttributeToArray('id') as $aRow)
|
||||||
{
|
{
|
||||||
$aSharers[] = $aRow['id'];
|
$aSharers[] = $aRow['id'];
|
||||||
}
|
}
|
||||||
@@ -179,23 +180,17 @@ abstract class UserRightsAddOnAPI
|
|||||||
$sShareClass = $aShareProperties['share_class'];
|
$sShareClass = $aShareProperties['share_class'];
|
||||||
$sShareAttCode = $aShareProperties['attcode'];
|
$sShareAttCode = $aShareProperties['attcode'];
|
||||||
|
|
||||||
$oSearchShares = new DBObjectSearch($sShareClass);
|
$oSearchShares = new DBSharedSearch($sShareClass);
|
||||||
$oSearchShares->AllowAllData();
|
$oSearchShares->AllowAllData();
|
||||||
|
|
||||||
$sHierarchicalKeyCode = MetaModel::IsHierarchicalClass('Organization');
|
$sHierarchicalKeyCode = MetaModel::IsHierarchicalClass('Organization');
|
||||||
$oOrgField = new FieldExpression('org_id', $sShareClass);
|
$oOrgField = new FieldExpression('org_id', $sShareClass);
|
||||||
$oSearchShares->AddConditionExpression(new BinaryExpression($oOrgField, 'IN', $oListExpr));
|
$oSearchShares->AddConditionExpression(new BinaryExpression($oOrgField, 'IN', $oListExpr));
|
||||||
$aShared = array();
|
|
||||||
foreach($oSearchShares->ToDataArray(array($sShareAttCode)) as $aRow)
|
$oNested = SharedQueryExpression::FromOQLObjectQuery($oSearchShares, [$sShareClass =>[$sShareAttCode]]);
|
||||||
{
|
$oObjId = new FieldExpression('id', $sClass);
|
||||||
$aShared[] = $aRow[$sShareAttCode];
|
$oFilter->MergeConditionExpression(new BinaryExpression($oObjId, 'IN', $oNested));
|
||||||
}
|
|
||||||
if (count($aShared) > 0)
|
|
||||||
{
|
|
||||||
$oObjId = new FieldExpression('id', $sClass);
|
|
||||||
$oSharedIdList = ListExpression::FromScalars($aShared);
|
|
||||||
$oFilter->MergeConditionExpression(new BinaryExpression($oObjId, 'IN', $oSharedIdList));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // if HasSharing
|
} // if HasSharing
|
||||||
|
|
||||||
@@ -248,7 +243,7 @@ abstract class User extends cmdbAbstractObject
|
|||||||
"depends_on" => array(),
|
"depends_on" => array(),
|
||||||
)));
|
)));
|
||||||
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("profile_list",array("linked_class" => "URP_UserProfile", "ext_key_to_me" => "userid", "ext_key_to_remote" => "profileid", "allowed_values" => null, "count_min" => 1, "count_max" => 0, "depends_on" => array(), "display_style" => 'property', "with_php_constraint" => true)));
|
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("profile_list",array("linked_class" => "URP_UserProfile", "ext_key_to_me" => "userid", "ext_key_to_remote" => "profileid", "allowed_values" => null, "count_min" => 1, "count_max" => 0, "depends_on" => array(), "display_style" => 'property', "with_php_constraint" => true, "with_php_computation" => true)));
|
||||||
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("allowed_org_list", array("linked_class" => "URP_UserOrg", "ext_key_to_me" => "userid", "ext_key_to_remote" => "allowed_org_id", "allowed_values" => null, "count_min" => 1, "count_max" => 0, "depends_on" => array(), 'with_php_constraint' => true)));
|
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("allowed_org_list", array("linked_class" => "URP_UserOrg", "ext_key_to_me" => "userid", "ext_key_to_remote" => "allowed_org_id", "allowed_values" => null, "count_min" => 1, "count_max" => 0, "depends_on" => array(), 'with_php_constraint' => true)));
|
||||||
MetaModel::Init_AddAttribute(new AttributeCaseLog("log", array("sql" => 'log', "is_null_allowed" => true, "default_value" => '', "allowed_values" => null, "depends_on" => array(), "always_load_in_tables" => false)));
|
MetaModel::Init_AddAttribute(new AttributeCaseLog("log", array("sql" => 'log', "is_null_allowed" => true, "default_value" => '', "allowed_values" => null, "depends_on" => array(), "always_load_in_tables" => false)));
|
||||||
|
|
||||||
@@ -867,6 +862,8 @@ class UserRights
|
|||||||
*/
|
*/
|
||||||
public static function Login($sLogin, $sAuthentication = 'any')
|
public static function Login($sLogin, $sAuthentication = 'any')
|
||||||
{
|
{
|
||||||
|
self::ResetCurrentUserData();
|
||||||
|
|
||||||
$oUser = self::FindUser($sLogin, $sAuthentication);
|
$oUser = self::FindUser($sLogin, $sAuthentication);
|
||||||
if (is_null($oUser))
|
if (is_null($oUser))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\ColumnUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactory;
|
||||||
|
use Combodo\iTop\Application\WebPage\Page;
|
||||||
|
use Combodo\iTop\Application\WebPage\WebPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk export: XML export
|
* Bulk export: XML export
|
||||||
@@ -30,7 +32,7 @@ class XMLBulkExport extends BulkExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \WebPage $oP
|
* @param WebPage $oP
|
||||||
* @param $sPartId
|
* @param $sPartId
|
||||||
*
|
*
|
||||||
* @return UIContentBlock
|
* @return UIContentBlock
|
||||||
|
|||||||
@@ -49,3 +49,63 @@
|
|||||||
.ibo-navigation-menu.ibo-is-active .ibo-navigation-menu--drawer{
|
.ibo-navigation-menu.ibo-is-active .ibo-navigation-menu--drawer{
|
||||||
transform: translate3d(0,0,0);
|
transform: translate3d(0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Toggler legacy CSS that has somehow been added to iTop 3.0 and that is now used by some extensions
|
||||||
|
// Round Toggle
|
||||||
|
/* The switch - the box around the slider */
|
||||||
|
.switch {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 36px;
|
||||||
|
height: 20px;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide default HTML checkbox */
|
||||||
|
.switch input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The slider */
|
||||||
|
.slider {
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: $ibo-color-secondary-600;
|
||||||
|
transition: .4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
height: 15px;
|
||||||
|
width: 15px;
|
||||||
|
left: 3px;
|
||||||
|
bottom: 3px;
|
||||||
|
background-color: $ibo-color-secondary-300;
|
||||||
|
transition: .4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: $ibo-color-primary-600;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus + .slider {
|
||||||
|
box-shadow: 0 0 1px $ibo-color-primary-600;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(14.5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Rounded sliders */
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,10 +11,6 @@ $ibo-scrollbar--scrollbar-thumb-background-color: $ibo-color-grey-300 !default;
|
|||||||
$ibo-scrollbar--scrollbar-thumb-border: none !default;
|
$ibo-scrollbar--scrollbar-thumb-border: none !default;
|
||||||
$ibo-scrollbar--scrollbar-thumb-border-radius: $ibo-border-radius-500 !default;
|
$ibo-scrollbar--scrollbar-thumb-border-radius: $ibo-border-radius-500 !default;
|
||||||
|
|
||||||
$ibo-hyperlink-color: $ibo-color-primary-700 !default;
|
|
||||||
$ibo-hyperlink-color--on-hover: $ibo-color-primary-800 !default;
|
|
||||||
$ibo-hyperlink-color--on-active: $ibo-color-primary-900 !default;
|
|
||||||
|
|
||||||
$ibo-svg-illustration--fill: $ibo-color-primary-500 !default;
|
$ibo-svg-illustration--fill: $ibo-color-primary-500 !default;
|
||||||
|
|
||||||
$ibo-content-block--background-color: $ibo-color-white-100 !default;
|
$ibo-content-block--background-color: $ibo-color-white-100 !default;
|
||||||
@@ -29,10 +25,6 @@ $ibo-content-block--border: 1px solid $ibo-color-grey-400 !default;
|
|||||||
--ibo-scrollbar--scrollbar-thumb-background-color: #{$ibo-scrollbar--scrollbar-thumb-background-color};
|
--ibo-scrollbar--scrollbar-thumb-background-color: #{$ibo-scrollbar--scrollbar-thumb-background-color};
|
||||||
--ibo-scrollbar--scrollbar-thumb-border: #{$ibo-scrollbar--scrollbar-thumb-border};
|
--ibo-scrollbar--scrollbar-thumb-border: #{$ibo-scrollbar--scrollbar-thumb-border};
|
||||||
--ibo-scrollbar--scrollbar-thumb-border-radius: #{$ibo-scrollbar--scrollbar-thumb-border-radius};
|
--ibo-scrollbar--scrollbar-thumb-border-radius: #{$ibo-scrollbar--scrollbar-thumb-border-radius};
|
||||||
|
|
||||||
--ibo-hyperlink-color: #{$ibo-hyperlink-color};
|
|
||||||
--ibo-hyperlink-color--on-hover: #{$ibo-hyperlink-color--on-hover};
|
|
||||||
--ibo-hyperlink-color--on-active: #{$ibo-hyperlink-color--on-active};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Box sizing reset */
|
/* Box sizing reset */
|
||||||
@@ -73,17 +65,19 @@ html{
|
|||||||
/* Hyperlinks reset, ensure that they are of the right color and without decoration everywhere (of course this can be overloaded in some components) */
|
/* Hyperlinks reset, ensure that they are of the right color and without decoration everywhere (of course this can be overloaded in some components) */
|
||||||
a{
|
a{
|
||||||
color: var(--ibo-hyperlink-color);
|
color: var(--ibo-hyperlink-color);
|
||||||
text-decoration: none;
|
text-decoration: var(--ibo-hyperlink-text-decoration);
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&:active,
|
&:active,
|
||||||
&:visited{
|
&:visited{
|
||||||
text-decoration: none;
|
text-decoration: var(--ibo-hyperlink-text-decoration);
|
||||||
}
|
}
|
||||||
&:hover{
|
&:hover{
|
||||||
color: var(--ibo-hyperlink-color--on-hover);
|
color: var(--ibo-hyperlink-color--on-hover);
|
||||||
|
text-decoration: var(--ibo-hyperlink-text-decoration--on-hover);
|
||||||
}
|
}
|
||||||
&:active{
|
&:active{
|
||||||
color: var(--ibo-hyperlink-color--on-active);
|
color: var(--ibo-hyperlink-color--on-active);
|
||||||
|
text-decoration: var(--ibo-hyperlink-text-decoration--on-active);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ $ibo-alert-colors: (
|
|||||||
$bg-color: nth($aColorValues, 1);
|
$bg-color: nth($aColorValues, 1);
|
||||||
$highlight-color: nth($aColorValues, 2);
|
$highlight-color: nth($aColorValues, 2);
|
||||||
$text-color: nth($aColorValues, 3);
|
$text-color: nth($aColorValues, 3);
|
||||||
.ibo-alert.ibo-is-#{$sColor} {
|
%ibo-alert-#{$sColor}, .ibo-alert.ibo-is-#{$sColor} {
|
||||||
background-color: $bg-color;
|
background-color: $bg-color;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
a {
|
a {
|
||||||
|
|||||||
@@ -32,4 +32,5 @@
|
|||||||
@import "search-form";
|
@import "search-form";
|
||||||
@import "field-badge";
|
@import "field-badge";
|
||||||
@import "file-select";
|
@import "file-select";
|
||||||
@import "medallion-icon";
|
@import "medallion-icon";
|
||||||
|
@import "toast";
|
||||||
@@ -80,16 +80,29 @@ $ibo-field--enable-bulk--checkbox--margin-left: $ibo-spacing-300 !default;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*N°6543 - We need the rule to keep text inside the column when width is defined*/
|
||||||
|
&[data-attribute-type="AttributeHtml"],
|
||||||
|
&[data-attribute-type="AttributeText"] {
|
||||||
|
&[data-attribute-flag-read-only="true"] {
|
||||||
|
display: grid;
|
||||||
|
|
||||||
|
> .ibo-field--value {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Large field = Label on top, value below */
|
/* Large field = Label on top, value below */
|
||||||
.ibo-field-large {
|
.ibo-field-large {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
.ibo-field--label {
|
.ibo-field--label {
|
||||||
position: relative; /* Necessary for fullscreen toggler */
|
position: relative; /* Necessary for fullscreen toggler */
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
max-width: initial;
|
max-width: initial;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,31 +36,30 @@ $ibo-popover-menu--item--no-message--image--svg--padding : 15px !default;
|
|||||||
#ibo-navigation-menu--notifications-menu {
|
#ibo-navigation-menu--notifications-menu {
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
min-width: $ibo-navigation-menu--notifications-menu--min-width;
|
min-width: $ibo-navigation-menu--notifications-menu--min-width;
|
||||||
.ibo-navigation-menu--notifications--messages-section{
|
.ibo-navigation-menu--notifications--messages-section {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ibo-navigation-menu--notifications--show-all-messages, .ibo-navigation-menu--notifications-dismiss-all, .ibo-navigation-menu--notifications-show-all-multiple{
|
.ibo-navigation-menu--notifications--show-all-messages, .ibo-navigation-menu--notifications-dismiss-all, .ibo-navigation-menu--notifications-show-all-multiple {
|
||||||
overflow-x: inherit;
|
overflow-x: inherit;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
min-height: 45px;
|
min-height: 45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ibo-navigation-menu--notifications--item--image{
|
.ibo-navigation-menu--notifications--item--image {
|
||||||
max-width: $ibo-navigation-menu--notifications--item--image--max-width;
|
max-width: $ibo-navigation-menu--notifications--item--image--max-width;
|
||||||
max-height: $ibo-navigation-menu--notifications--item--image--max-height;
|
max-height: $ibo-navigation-menu--notifications--item--image--max-height;
|
||||||
margin: $ibo-navigation-menu--notifications--item--image--margin-y $ibo-navigation-menu--notifications--item--image--margin-x;
|
margin: $ibo-navigation-menu--notifications--item--image--margin-y $ibo-navigation-menu--notifications--item--image--margin-x;
|
||||||
border-radius: $ibo-navigation-menu--notifications--item--image--border-radius;
|
border-radius: $ibo-navigation-menu--notifications--item--image--border-radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
img.ibo-navigation-menu--notifications--item--image[src=""]{
|
.ibo-navigation-menu--notifications--item--image[src=""] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
img.ibo-navigation-menu--notifications--item--image:not([src=""]) ~ i.ibo-navigation-menu--notifications--item--image
|
.ibo-navigation-menu--notifications--item--image:not([src=""]) ~ .ibo-navigation-menu--notifications--item--image {
|
||||||
{
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.ibo-navigation-menu--notifications--item--bottom-text{
|
.ibo-navigation-menu--notifications--item--bottom-text {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -68,18 +67,23 @@ img.ibo-navigation-menu--notifications--item--image:not([src=""]) ~ i.ibo-naviga
|
|||||||
align-self: center;
|
align-self: center;
|
||||||
margin-left: $ibo-navigation-menu--notifications--item--bottom-text--margin-left;
|
margin-left: $ibo-navigation-menu--notifications--item--bottom-text--margin-left;
|
||||||
}
|
}
|
||||||
.ibo-navigation-menu--notifications--item--content{
|
.ibo-navigation-menu--notifications--item--content {
|
||||||
padding: $ibo-navigation-menu--notifications--item--content--padding-y $ibo-navigation-menu--notifications--item--content--padding-x;
|
padding: $ibo-navigation-menu--notifications--item--content--padding-y $ibo-navigation-menu--notifications--item--content--padding-x;
|
||||||
img{
|
|
||||||
|
img {
|
||||||
max-height: $ibo-navigation-menu--notifications--item--content--img--max-height;
|
max-height: $ibo-navigation-menu--notifications--item--content--img--max-height;
|
||||||
padding: $ibo-navigation-menu--notifications--item--content--img--padding;
|
padding: $ibo-navigation-menu--notifications--item--content--img--padding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ibo-navigation-menu--notifications-item{
|
.ibo-navigation-menu--notifications-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
|
.ibo-navigation-menu--notifications--item--content a {
|
||||||
|
@extend %ibo-hyperlink-forced-colors;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.ibo-navigation-menu--notifications--item--new-message-indicator{
|
.ibo-navigation-menu--notifications--item--new-message-indicator {
|
||||||
width: $ibo-navigation-menu--notifications--item--new-message-indicator--width;
|
width: $ibo-navigation-menu--notifications--item--new-message-indicator--width;
|
||||||
height: $ibo-navigation-menu--notifications--item--new-message-indicator--height;
|
height: $ibo-navigation-menu--notifications--item--new-message-indicator--height;
|
||||||
background-color: $ibo-navigation-menu--notifications--item--new-message-indicator--background-color;
|
background-color: $ibo-navigation-menu--notifications--item--new-message-indicator--background-color;
|
||||||
@@ -87,22 +91,22 @@ img.ibo-navigation-menu--notifications--item--image:not([src=""]) ~ i.ibo-naviga
|
|||||||
margin-top: $ibo-navigation-menu--notifications--item--new-message-indicator--margin-top;
|
margin-top: $ibo-navigation-menu--notifications--item--new-message-indicator--margin-top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ibo-navigation-menu--notifications-show-all-multiple ~ .ibo-popover-menu{
|
.ibo-navigation-menu--notifications-show-all-multiple ~ .ibo-popover-menu {
|
||||||
.ibo-navigation-menu--notifications--item--new-message-indicator{
|
.ibo-navigation-menu--notifications--item--new-message-indicator {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: $ibo-navigation-menu--notifications-show-all-multiple--ibo-popover-menu--indicator--margin-right;
|
margin-right: $ibo-navigation-menu--notifications-show-all-multiple--ibo-popover-menu--indicator--margin-right;
|
||||||
}
|
}
|
||||||
.ibo-navigation-menu--notifications-show-all-multiple--counter{
|
.ibo-navigation-menu--notifications-show-all-multiple--counter {
|
||||||
@extend %ibo-font-weight-600;
|
@extend %ibo-font-weight-600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ibo-navigation-menu--notifications-dismiss-all--icon{
|
.ibo-navigation-menu--notifications-dismiss-all--icon {
|
||||||
margin: $ibo-navigation-menu--notifications-dismiss-all--icon--margin;
|
margin: $ibo-navigation-menu--notifications-dismiss-all--icon--margin;
|
||||||
}
|
}
|
||||||
.ibo-popover-menu--item--no-message{
|
.ibo-popover-menu--item--no-message {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.ibo-popover-menu--item--no-message--image>svg{
|
.ibo-popover-menu--item--no-message--image > svg {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: $ibo-popover-menu--item--no-message--image--svg--width;
|
width: $ibo-popover-menu--item--no-message--image--svg--width;
|
||||||
height: $ibo-popover-menu--item--no-message--image--svg--height;
|
height: $ibo-popover-menu--item--no-message--image--svg--height;
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ $ibo-panel--collapsible-toggler--margin-right: $ibo-spacing-300 !default;
|
|||||||
$ibo-panel--collapsible-toggler--font-size: $ibo-font-size-250 !default;
|
$ibo-panel--collapsible-toggler--font-size: $ibo-font-size-250 !default;
|
||||||
$ibo-panel--collapsible-toggler--color: $ibo-color-grey-700 !default;
|
$ibo-panel--collapsible-toggler--color: $ibo-color-grey-700 !default;
|
||||||
|
|
||||||
|
$ibo-panel--is-selectable--body--after--z-index: $ibo-panel--header--z-index + 1 !default;
|
||||||
|
$ibo-panel--is-selectable--body--after--font-size: $ibo-font-size-700 !default;
|
||||||
|
|
||||||
/* Rules */
|
/* Rules */
|
||||||
.ibo-panel {
|
.ibo-panel {
|
||||||
--ibo-main-color: #{map-get($ibo-panel-colors, 'neutral')}; /* --ibo-main-color is to allow overload from custom dynamic value from the DM. The overload will be done through an additional CSS class of a particular DM class or DM attribute */
|
--ibo-main-color: #{map-get($ibo-panel-colors, 'neutral')}; /* --ibo-main-color is to allow overload from custom dynamic value from the DM. The overload will be done through an additional CSS class of a particular DM class or DM attribute */
|
||||||
@@ -128,6 +131,30 @@ $ibo-panel--collapsible-toggler--color: $ibo-color-grey-700 !default;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.ibo-is-selectable .ibo-panel--body::after {
|
||||||
|
@include ibo-selectable;
|
||||||
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
z-index: $ibo-panel--is-selectable--body--after--z-index;
|
||||||
|
font-size: $ibo-panel--is-selectable--body--after--font-size;
|
||||||
|
}
|
||||||
|
&.ibo-is-selectable:hover .ibo-panel--body::after {
|
||||||
|
@include ibo-selectable-hover;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
&.ibo-is-selected .ibo-panel--body::after {
|
||||||
|
@include ibo-selected;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
&.ibo-is-selected:hover .ibo-panel--body::after {
|
||||||
|
@include ibo-selected-hover;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ibo-panel--header {
|
.ibo-panel--header {
|
||||||
|
|||||||
62
css/backoffice/components/_toast.scss
Normal file
62
css/backoffice/components/_toast.scss
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* @copyright Copyright (C) 2010-2024 Combodo SARL
|
||||||
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* SCSS variables */
|
||||||
|
$ibo-toast--padding-y: $ibo-spacing-400 !default;
|
||||||
|
$ibo-toast--padding-right: $ibo-spacing-300 !default;
|
||||||
|
$ibo-toast--padding-left: $ibo-spacing-500 !default;
|
||||||
|
$ibo-toast--border-radius: $ibo-border-radius-300 !default;
|
||||||
|
$ibo-toast--box-shadow: $ibo-elevation-200 !default;
|
||||||
|
$ibo-toast--max-width: calc(50% - 20px) !default;
|
||||||
|
|
||||||
|
@keyframes decreaseHighlight {
|
||||||
|
0% {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
8%{
|
||||||
|
border-radius: 0 0 0 3px;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ibo-toast {
|
||||||
|
display: inline-flex;
|
||||||
|
position: fixed;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
max-width: $ibo-toast--max-width ;
|
||||||
|
padding: $ibo-toast--padding-y $ibo-toast--padding-right $ibo-toast--padding-y $ibo-toast--padding-left;
|
||||||
|
border-radius: $ibo-toast--border-radius;
|
||||||
|
|
||||||
|
box-shadow: $ibo-toast--box-shadow;
|
||||||
|
transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
|
||||||
|
z-index: 2147483647;
|
||||||
|
&::before {
|
||||||
|
@include ibo-vertical-highlight;
|
||||||
|
top: initial;
|
||||||
|
bottom: 0;
|
||||||
|
border-radius: $ibo-toast--border-radius 0 0 $ibo-toast--border-radius;
|
||||||
|
}
|
||||||
|
&.ibo-is-auto-closeable::before{
|
||||||
|
animation: decreaseHighlight 5s linear forwards;
|
||||||
|
}
|
||||||
|
&:hover::before {
|
||||||
|
animation: none; /* Pause animation on hover */
|
||||||
|
}
|
||||||
|
&.ibo-is-error{
|
||||||
|
@extend %ibo-alert-danger;
|
||||||
|
}
|
||||||
|
&.ibo-is-warning{
|
||||||
|
@extend %ibo-alert-warning;
|
||||||
|
}
|
||||||
|
&.ibo-is-success{
|
||||||
|
@extend %ibo-alert-success;
|
||||||
|
}
|
||||||
|
&.ibo-is-information{
|
||||||
|
@extend %ibo-alert-information;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -123,6 +123,13 @@ $ibo-fieldsorter--selected--background-color: $ibo-color-blue-200 !default;
|
|||||||
.ibo-datatable--row-actions-toolbar{
|
.ibo-datatable--row-actions-toolbar{
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
}
|
}
|
||||||
|
/* N°6543 - We need the rule to keep text inside the column when width is defined */
|
||||||
|
> [data-attribute-type="AttributeHtml"],
|
||||||
|
> [data-attribute-type="AttributeText"] {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ $ibo-datatableconfig--settings-panel--option--margin-right: $ibo-spacing-200 !de
|
|||||||
}
|
}
|
||||||
.ibo-datatableconfig--attributes-panel--per-page--input{
|
.ibo-datatableconfig--attributes-panel--per-page--input{
|
||||||
margin: $ibo-datatableconfig--attributes-panel--per-page--input--margin-y $ibo-datatableconfig--attributes-panel--per-page--input--margin-x;
|
margin: $ibo-datatableconfig--attributes-panel--per-page--input--margin-y $ibo-datatableconfig--attributes-panel--per-page--input--margin-x;
|
||||||
|
max-width: 4em;
|
||||||
|
@extend .ibo-input;
|
||||||
|
display: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ibo-datatableconfig--settings-panel .ibo-panel--body{
|
.ibo-datatableconfig--settings-panel .ibo-panel--body{
|
||||||
|
|||||||
@@ -16,3 +16,4 @@
|
|||||||
@import "input-one-way-password";
|
@import "input-one-way-password";
|
||||||
@import "input-set";
|
@import "input-set";
|
||||||
@import "input-text";
|
@import "input-text";
|
||||||
|
@import "input-toggler";
|
||||||
|
|||||||
@@ -224,7 +224,11 @@ $ibo-input-select--autocomplete-item-image--border: 1px solid $ibo-color-grey-60
|
|||||||
margin-right: $ibo-input-select--autocomplete-item-image--margin-right;
|
margin-right: $ibo-input-select--autocomplete-item-image--margin-right;
|
||||||
background-color: $ibo-input-select--autocomplete-item-image--background-color;
|
background-color: $ibo-input-select--autocomplete-item-image--background-color;
|
||||||
border: $ibo-input-select--autocomplete-item-image--border;
|
border: $ibo-input-select--autocomplete-item-image--border;
|
||||||
|
&.ibo-is-not-medallion{
|
||||||
|
border: unset;
|
||||||
|
border-radius: 0;
|
||||||
|
background-color: unset;
|
||||||
|
}
|
||||||
@extend %ibo-fully-centered-content;
|
@extend %ibo-fully-centered-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
72
css/backoffice/components/input/_input-toggler.scss
Normal file
72
css/backoffice/components/input/_input-toggler.scss
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* @copyright Copyright (C) 2010-2024 Combodo SARL
|
||||||
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
$ibo-toggler--wrapper--width: 36px !default;
|
||||||
|
$ibo-toggler--wrapper--height: 20px !default;
|
||||||
|
|
||||||
|
$ibo-toggler--slider--border-radius: $ibo-border-radius-900 !default;
|
||||||
|
$ibo-toggler--slider--background-color: $ibo-color-secondary-600 !default;
|
||||||
|
|
||||||
|
$ibo-toggler--slider--before--height: 15px !default;
|
||||||
|
$ibo-toggler--slider--before--width: 15px !default;
|
||||||
|
$ibo-toggler--slider--before--border-radius: $ibo-border-radius-full !default;
|
||||||
|
$ibo-toggler--slider--before--background-color: $ibo-color-grey-100 !default;
|
||||||
|
|
||||||
|
$ibo-toggler--slider--checked--background-color: $ibo-color-primary-600 !default;
|
||||||
|
$ibo-toggler--slider--focus--box-shadow: 0 0 1px $ibo-color-primary-600 !default;
|
||||||
|
|
||||||
|
$ibo-toggler--label--margin-left: 4px !default;
|
||||||
|
|
||||||
|
|
||||||
|
.ibo-toggler--wrapper {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: $ibo-toggler--wrapper--width;
|
||||||
|
height: $ibo-toggler--wrapper--height;
|
||||||
|
vertical-align: baseline;
|
||||||
|
.ibo-toggler {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ibo-toggler--slider{
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
border-radius: $ibo-toggler--slider--border-radius;
|
||||||
|
background-color: $ibo-toggler--slider--background-color;
|
||||||
|
transition: .4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ibo-toggler--slider:before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 3px;
|
||||||
|
bottom: 3px;
|
||||||
|
height: $ibo-toggler--slider--before--height;
|
||||||
|
width: $ibo-toggler--slider--before--width;
|
||||||
|
border-radius: $ibo-toggler--slider--before--border-radius;
|
||||||
|
background-color: $ibo-toggler--slider--before--background-color;
|
||||||
|
transition: .4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ibo-toggler--wrapper input:checked + .ibo-toggler--slider {
|
||||||
|
background-color: $ibo-toggler--slider--checked--background-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus + .ibo-toggler--slider {
|
||||||
|
box-shadow: $ibo-toggler--slider--focus--box-shadow;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .ibo-toggler--slider:before {
|
||||||
|
transform: translateX(14.5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
label ~ .ibo-toggler--wrapper {
|
||||||
|
margin-left: $ibo-toggler--label--margin-left;
|
||||||
|
}
|
||||||
@@ -62,63 +62,4 @@ $ibo-top-bar--toolbar-dashboard-title--max-width: 350px !default;
|
|||||||
@extend %ibo-full-height-content;
|
@extend %ibo-full-height-content;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Round Toggle
|
|
||||||
/* The switch - the box around the slider */
|
|
||||||
.switch {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
width: 36px;
|
|
||||||
height: 20px;
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide default HTML checkbox */
|
|
||||||
.switch input {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The slider */
|
|
||||||
.slider {
|
|
||||||
position: absolute;
|
|
||||||
cursor: pointer;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: $ibo-color-secondary-600;
|
|
||||||
transition: .4s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider:before {
|
|
||||||
position: absolute;
|
|
||||||
content: "";
|
|
||||||
height: 15px;
|
|
||||||
width: 15px;
|
|
||||||
left: 3px;
|
|
||||||
bottom: 3px;
|
|
||||||
background-color: $ibo-color-secondary-300;
|
|
||||||
transition: .4s;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:checked + .slider {
|
|
||||||
background-color: $ibo-color-primary-600;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:focus + .slider {
|
|
||||||
box-shadow: 0 0 1px $ibo-color-primary-600;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:checked + .slider:before {
|
|
||||||
transform: translateX(14.5px);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Rounded sliders */
|
|
||||||
.slider.round {
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider.round:before {
|
|
||||||
border-radius: 7px;
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$ibo-object-summary--header--margin-y: $ibo-panel--highlight--height!default;
|
$ibo-object-summary--header--margin-top: $ibo-panel--highlight--height!default;
|
||||||
|
$ibo-object-summary--header--margin-bottom: $ibo-spacing-0!default;
|
||||||
$ibo-object-summary--header--margin-x: $ibo-spacing-0 !default;
|
$ibo-object-summary--header--margin-x: $ibo-spacing-0 !default;
|
||||||
|
|
||||||
$ibo-object-summary--header--padding-y: $ibo-spacing-300 !default;
|
$ibo-object-summary--header--padding-y: $ibo-spacing-300 !default;
|
||||||
@@ -51,7 +52,7 @@ $ibo-object-summary--content--attributes--code--padding-right: $ibo-spacing-500
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ibo-object-summary--header{
|
.ibo-object-summary--header{
|
||||||
margin: $ibo-object-summary--header--margin-y $ibo-object-summary--header--margin-x;
|
margin: $ibo-object-summary--header--margin-top $ibo-object-summary--header--margin-x $ibo-object-summary--header--margin-bottom $ibo-object-summary--header--margin-x;
|
||||||
padding: $ibo-object-summary--header--padding-y $ibo-object-summary--header--padding-x;
|
padding: $ibo-object-summary--header--padding-y $ibo-object-summary--header--padding-x;
|
||||||
background-color: $ibo-object-summary--header--background-color;
|
background-color: $ibo-object-summary--header--background-color;
|
||||||
border-bottom: $ibo-object-summary--header--border;
|
border-bottom: $ibo-object-summary--header--border;
|
||||||
|
|||||||
@@ -15,4 +15,6 @@
|
|||||||
@import "global-search";
|
@import "global-search";
|
||||||
@import "run-query";
|
@import "run-query";
|
||||||
@import "welcome-popup";
|
@import "welcome-popup";
|
||||||
@import "oauth.wizard";
|
@import "oauth.wizard";
|
||||||
|
@import "notifications";
|
||||||
|
@import "notifications-center";
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user