mirror of
https://github.com/Combodo/iTop.git
synced 2026-11-22 22:58:55 +01:00
Compare commits
279 Commits
support/3.
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac8b331a77 | ||
|
|
16dcbb131a | ||
|
|
7021495b21 | ||
|
|
d6428b2101 | ||
|
|
aeea0a98b7 | ||
|
|
28669c0a6e | ||
|
|
2df8af4ade | ||
|
|
801e92929c | ||
|
|
cfc648b67c | ||
|
|
e233e80fb9 | ||
|
|
4f72ef753c | ||
|
|
54eb1ed149 | ||
|
|
05f5cf457b | ||
|
|
16af5e1aab | ||
|
|
82983f8019 | ||
|
|
fb0c58ea73 | ||
|
|
199161318f | ||
|
|
bb31415dd3 | ||
|
|
fb55aa442e | ||
|
|
c63f3e650d | ||
|
|
c5a4433d0e | ||
|
|
d8b9533697 | ||
|
|
cd469d401c | ||
|
|
425ce880b2 | ||
|
|
ab8bbb2609 | ||
|
|
aa8a756af9 | ||
|
|
264bd89617 | ||
|
|
4dcd6f9b44 | ||
|
|
1578488640 | ||
|
|
35e17bf680 | ||
|
|
3fd4862428 | ||
|
|
57f1409d44 | ||
|
|
5761dc912b | ||
|
|
dbd13e9a4a | ||
|
|
25598e31dd | ||
|
|
de0568c4a4 | ||
|
|
18f4ed1f3b | ||
|
|
3282130fb7 | ||
|
|
af6ea0770d | ||
|
|
7dda01d90b | ||
|
|
da4a810534 | ||
|
|
6865c845f0 | ||
|
|
f2ab9f2902 | ||
|
|
0eef3b6c7b | ||
|
|
accbc1f4db | ||
|
|
7ed7b575f1 | ||
|
|
530c7b2ddd | ||
|
|
692c0723ab | ||
|
|
a1a1a1d037 | ||
|
|
2c40f7d143 | ||
|
|
23619ec6cd | ||
|
|
0ba1bf829c | ||
|
|
7e671eccc1 | ||
|
|
2112871365 | ||
|
|
07b37859ee | ||
|
|
16cac91c8a | ||
|
|
6ad176dd59 | ||
|
|
8ab6a97883 | ||
|
|
4a0609ab32 | ||
|
|
476ff607e2 | ||
|
|
271ee5ffb1 | ||
|
|
01bf120da3 | ||
|
|
6477468572 | ||
|
|
b4e3ede617 | ||
|
|
fabcdccb57 | ||
|
|
62d7ca4037 | ||
|
|
8915f2687b | ||
|
|
84a92b8529 | ||
|
|
4639d06a0d | ||
|
|
c0cbb2b473 | ||
|
|
5c962b0fef | ||
|
|
09574d90d5 | ||
|
|
0211627b5c | ||
|
|
d375fc7d82 | ||
|
|
9c3dffdbc3 | ||
|
|
a32cff4286 | ||
|
|
15f9a0ec7f | ||
|
|
87b6b34683 | ||
|
|
0a4bbfe5a9 | ||
|
|
31a4e1a0a0 | ||
|
|
de74103118 | ||
|
|
11fba06d58 | ||
|
|
7908f67be0 | ||
|
|
220d6df86a | ||
|
|
67c6a0732c | ||
|
|
a2a00cb582 | ||
|
|
8dd2f2d7e9 | ||
|
|
4cfc1c2153 | ||
|
|
4e8d34bb23 | ||
|
|
4d699f79e8 | ||
|
|
28cb200e63 | ||
|
|
fcd66bed2a | ||
|
|
58d74f1521 | ||
|
|
4e70886d2a | ||
|
|
f9c94e9c62 | ||
|
|
c2929ecd33 | ||
|
|
873cea1a76 | ||
|
|
f637669336 | ||
|
|
b7432b9e60 | ||
|
|
b4386b0ce6 | ||
|
|
adc2596b4a | ||
|
|
af972313d7 | ||
|
|
d051d51699 | ||
|
|
16d68fe993 | ||
|
|
4e1bf80b9f | ||
|
|
2ac4229ee0 | ||
|
|
e6d485855e | ||
|
|
ab9d270b62 | ||
|
|
4a6af15237 | ||
|
|
05e585ced3 | ||
|
|
9e4f2a3053 | ||
|
|
a8b7622110 | ||
|
|
c241c257a5 | ||
|
|
ffa2a6dfd4 | ||
|
|
5d99042d4c | ||
|
|
8ff57dabd0 | ||
|
|
b9a7923a40 | ||
|
|
6c1206658e | ||
|
|
1a395f4b50 | ||
|
|
0ae3bc2821 | ||
|
|
98a007ff9c | ||
|
|
ee17738e8e | ||
|
|
da62814e67 | ||
|
|
aef80d60a8 | ||
|
|
5597040a8a | ||
|
|
7d89a05d8b | ||
|
|
ddc3fd8fd1 | ||
|
|
59af2e8b96 | ||
|
|
7d8a350394 | ||
|
|
4ae3a8ec1d | ||
|
|
34c394718d | ||
|
|
1fac630fdb | ||
|
|
cab1710498 | ||
|
|
8d1711bef5 | ||
|
|
f35af2b8b0 | ||
|
|
91e997a4e0 | ||
|
|
a8eb2a3fff | ||
|
|
dc5384f8aa | ||
|
|
2540d7039d | ||
|
|
373942f922 | ||
|
|
7d4fc98ecc | ||
|
|
cfb04561ec | ||
|
|
f3bad3538c | ||
|
|
9c6baaeef4 | ||
|
|
e769e53653 | ||
|
|
42380f7a7a | ||
|
|
8b384498e3 | ||
|
|
04f1eaff1f | ||
|
|
175b88de30 | ||
|
|
0a5b0b403e | ||
|
|
a346b71e9a | ||
|
|
8065343ea6 | ||
|
|
9c6087fd54 | ||
|
|
66073ba390 | ||
|
|
4756e2474c | ||
|
|
7dbbf742c4 | ||
|
|
2cd4fd1e0e | ||
|
|
fffff76c82 | ||
|
|
06d593631d | ||
|
|
54a0dfd06f | ||
|
|
e31492fe27 | ||
|
|
dfd7f4cd0a | ||
|
|
69624116db | ||
|
|
f3b69ad12e | ||
|
|
edb33e31da | ||
|
|
5542d9882f | ||
|
|
629f9ec210 | ||
|
|
4bd5c22d36 | ||
|
|
2c53b740fc | ||
|
|
18b7ee4d30 | ||
|
|
98913a2a86 | ||
|
|
62ea1c1fd6 | ||
|
|
b919adf4d8 | ||
|
|
4ebd03eebb | ||
|
|
4f891a9170 | ||
|
|
7583ede3b3 | ||
|
|
95cb21cff7 | ||
|
|
cdd7bbedcb | ||
|
|
ea1ed03d0c | ||
|
|
2073e8c10c | ||
|
|
1a41349d7b | ||
|
|
fdc1ef40e6 | ||
|
|
4722551a16 | ||
|
|
a2934ef05b | ||
|
|
1cdc2c5648 | ||
|
|
31eddad029 | ||
|
|
b43d71f324 | ||
|
|
97364af71d | ||
|
|
26033774b8 | ||
|
|
27c0fe191b | ||
|
|
fac132f707 | ||
|
|
6f9a4cb55f | ||
|
|
c07317dc71 | ||
|
|
a3fcc6fdf0 | ||
|
|
b13065f23f | ||
|
|
2eaca40632 | ||
|
|
7f3a1811d7 | ||
|
|
87b48c638c | ||
|
|
54a1221e4a | ||
|
|
97c589c440 | ||
|
|
68e799c0fd | ||
|
|
658825b308 | ||
|
|
af08824866 | ||
|
|
8693951aa9 | ||
|
|
a28e481ee4 | ||
|
|
6032628a70 | ||
|
|
2892949e33 | ||
|
|
ba643ba2ab | ||
|
|
3711e8a5a1 | ||
|
|
a38fef5bbf | ||
|
|
23e4ce7263 | ||
|
|
1bba486ee8 | ||
|
|
801090fddb | ||
|
|
1d77b9faa2 | ||
|
|
5282913791 | ||
|
|
36fae27355 | ||
|
|
812f0b573d | ||
|
|
c7c16f091b | ||
|
|
3739067473 | ||
|
|
fd553b86dd | ||
|
|
d7625d9650 | ||
|
|
893a1d7f71 | ||
|
|
fda1d3dd16 | ||
|
|
61464fc819 | ||
|
|
c281677768 | ||
|
|
e280251623 | ||
|
|
f657308137 | ||
|
|
4596404666 | ||
|
|
64394099f7 | ||
|
|
67e2899a60 | ||
|
|
8d75531d95 | ||
|
|
1e023e5431 | ||
|
|
e2a1c3e79e | ||
|
|
c7570d62c1 | ||
|
|
a30ed63a62 | ||
|
|
dd77124b07 | ||
|
|
9bfe0430f5 | ||
|
|
3fe91ed0b4 | ||
|
|
ccb9633226 | ||
|
|
82b50dc6cd | ||
|
|
d3451f8c30 | ||
|
|
b5c8a98695 | ||
|
|
1403914572 | ||
|
|
b976471a0d | ||
|
|
fa66a09104 | ||
|
|
47981f78e3 | ||
|
|
476ec75a2e | ||
|
|
10c000ddfe | ||
|
|
7e55b9ccfc | ||
|
|
5bb288ffca | ||
|
|
56d7e40f4c | ||
|
|
e0dc1fa571 | ||
|
|
d6466c0bd6 | ||
|
|
eb16e6cbc8 | ||
|
|
42007ffd95 | ||
|
|
6329c157e8 | ||
|
|
9ee0548767 | ||
|
|
620a6b9a51 | ||
|
|
968c56745a | ||
|
|
04a5e5463a | ||
|
|
006dd3d6c2 | ||
|
|
a808e89c30 | ||
|
|
d88687527e | ||
|
|
2cc071b07a | ||
|
|
a5c14e4870 | ||
|
|
0e72b090ee | ||
|
|
1b70b4bf70 | ||
|
|
41f51a2c0c | ||
|
|
73ede13443 | ||
|
|
40dd72ef82 | ||
|
|
c8aea56171 | ||
|
|
041437cbeb | ||
|
|
5715e0484f | ||
|
|
109fdfa06b | ||
|
|
13fad9efc1 | ||
|
|
9fbc53cf00 | ||
|
|
918f110dc9 | ||
|
|
bd9cc9c15e | ||
|
|
60ce21509f |
@@ -2,13 +2,17 @@
|
||||
|
||||
```mermaid
|
||||
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'themeVariables': {
|
||||
'git0': 'lawngreen',
|
||||
'git3': 'dodgerblue',
|
||||
'git4': 'grey',
|
||||
'git5': 'grey',
|
||||
'git6': 'grey',
|
||||
'git7': 'grey',
|
||||
'git8': 'grey'
|
||||
'git0': '#7ccf00',
|
||||
'git1': '#7ccf00',
|
||||
'git2': '#99a1af',
|
||||
'git3': '#99a1af',
|
||||
'git4': '#99a1af',
|
||||
'git5': '#99a1af',
|
||||
'git6': '#99a1af',
|
||||
'git7': '#99a1af',
|
||||
'git8': '#99a1af',
|
||||
'git9': '#99a1af',
|
||||
'git10': '#99a1af'
|
||||
}, 'gitGraph': {'showBranches': true,'mainBranchName': 'develop','rotateCommitLabel': true}} }%%
|
||||
gitGraph
|
||||
commit id: "2016-07-06" tag: "2.3.0" type: HIGHLIGHT
|
||||
@@ -106,6 +110,11 @@ gitGraph
|
||||
commit id: "2025-09-25" tag: "2.7.13"
|
||||
checkout support/3.2
|
||||
commit id: "2026-04-27 " tag: "3.2.3"
|
||||
commit id: "2026-05-25 " tag: "3.2.3-1"
|
||||
commit id: "2026-07-17 " tag: "3.2.3-2"
|
||||
checkout develop
|
||||
commit id: "2026-07-23" tag: "3.3.0-beta1"
|
||||
commit id: "2026-09-15" tag: "3.3.0"
|
||||
```
|
||||
|
||||
To learn more, check the [iTop community versions history on the official wiki](https://www.itophub.io/wiki/page?id=latest:release:start).
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/enhancement.yml
vendored
2
.github/ISSUE_TEMPLATE/enhancement.yml
vendored
@@ -8,6 +8,8 @@ body:
|
||||
Please explain why you're creating this issue :
|
||||
- Please describe what's your improvement proposition.
|
||||
- Then tell us if you're willing to create a PR for this enhancement ? If so, we'll indicate in the issue if we're interested in it.
|
||||
- The more users are affected and the greater is the impact, the more likely this improvement will be accepted. If you identified a bug and have an improvement proposition, please use the 'Bug report' template instead."
|
||||
Please note we're not willing to accept code improvement (e.g. refactoring) that won't have a "functional" change for the user.
|
||||
|
||||
- type: textarea
|
||||
id: enhancement_details
|
||||
|
||||
15
.github/pull_request_template.md
vendored
15
.github/pull_request_template.md
vendored
@@ -1,18 +1,22 @@
|
||||
<!--
|
||||
IMPORTANT: Before creating your PR, please create an issue first to know if Combodo is interested in your contribution (not needed for translations PR).
|
||||
Since we may refuse a PR, it's preferable to create an issue first, to avoid spending time coding something that won't be accepted.
|
||||
PR that will benefit the most users and has a greater impact on the product are more likely to be accepted, so please explain your use case and why you think it would be useful for the community.
|
||||
We're not willing to receive PR concerning codes improvements (e.g. code refactoring), except if it's part of a code that brings/corrects a feature for users.
|
||||
Please note that we're working with sprints, so we reserve the right to decline a PR if we do not plan to work on that subject in the 6 coming months.
|
||||
Thank you for your comprehension 😊
|
||||
|
||||
Once you've done it, and we confirmed we're interested in it, please follow the guidelines within this PR template before submitting it, it will greatly help us process your PR. 🙏
|
||||
Once you've created the issue, and we confirmed we're interested in it, 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 thread / Another PR / A GitHub Issue / Combodo ticket? | <!-- Put the URL --> |
|
||||
| Type of change? | Bug fix / Enhancement / Translations |
|
||||
| Question | Answer |
|
||||
|---------------------------------------------------------------------------------|---------------------------------------|
|
||||
| Related to a SourceForge thread / Another PR / A GitHub Issue / Combodo ticket? | <!-- Put the URL or ticket number --> |
|
||||
| Type of change? | Bug fix / Enhancement / Translations |
|
||||
|
||||
## Symptom (bug) / Objective (enhancement)
|
||||
|
||||
@@ -70,6 +74,7 @@ Explain in details how you are proposing to solve this:
|
||||
Don't remove these lines, check them once done.
|
||||
-->
|
||||
|
||||
- [ ] If my PR is a bug fix or an enhancement, I opened an issue that got reviewed and approved by Combodo
|
||||
- [ ] 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
|
||||
|
||||
56
.github/workflows/action.yml
vendored
56
.github/workflows/action.yml
vendored
@@ -1,56 +0,0 @@
|
||||
name: Add PRs to Combodo PRs Dashboard
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
add-to-project:
|
||||
name: Add PR to Combodo Project
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if author is a member of the organization
|
||||
id: check-membership
|
||||
run: |
|
||||
ORG="Combodo"
|
||||
AUTHOR=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
|
||||
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
|
||||
"https://api.github.com/orgs/$ORG/members/$AUTHOR")
|
||||
if [ "$RESPONSE" == "404" ]; then
|
||||
echo "project_url=https://github.com/orgs/Combodo/projects/5" >> $GITHUB_ENV
|
||||
echo "is_member=false" >> $GITHUB_ENV
|
||||
else
|
||||
echo "project_url=https://github.com/orgs/Combodo/projects/4" >> $GITHUB_ENV
|
||||
echo "is_member=true" >> $GITHUB_ENV
|
||||
|
||||
fi
|
||||
|
||||
- name: Add internal tag if member of the organization
|
||||
if: env.is_member == 'true'
|
||||
run: |
|
||||
curl -X POST -H "Authorization: token ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
|
||||
-d '{"labels":["internal"]}'
|
||||
|
||||
- name: Set PR author as assignee if member of the organization
|
||||
if: env.is_member == 'true' && github.event_name == 'pull_request'
|
||||
run: |
|
||||
curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
|
||||
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/assignees \
|
||||
-d '{"assignees":["${{ github.event.pull_request.user.login }}"]}'
|
||||
env:
|
||||
is_member: ${{ env.is_member }}
|
||||
- name: Add PR to the appropriate project
|
||||
uses: actions/add-to-project@v2
|
||||
with:
|
||||
project-url: ${{ env.project_url }}
|
||||
github-token: ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}
|
||||
13
.github/workflows/add-to-dashboard.yml
vendored
Normal file
13
.github/workflows/add-to-dashboard.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
name: Add issue/PR to Combodo dashboard
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened]
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
route-to-project:
|
||||
uses: Combodo/.github/.github/workflows/action.yml@master
|
||||
secrets:
|
||||
PR_AUTOMATICALLY_ADD_TO_PROJECT: ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -33,7 +33,6 @@ tests/*/vendor/*
|
||||
!/data/index.php
|
||||
!/data/web.config
|
||||
!/data/exclude.txt
|
||||
!/data/.compilation-symlinks
|
||||
|
||||
# iTop extensions
|
||||
/extensions/**
|
||||
|
||||
@@ -61,7 +61,7 @@ foreach ($aTcpdfFontsDirContent as $sTcpdfFontResourceName) {
|
||||
* 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.*');
|
||||
$aFontFilesToCopy = glob(__DIR__.DIRECTORY_SEPARATOR.'droidsansfallback.*');
|
||||
foreach ($aFontFilesToCopy as $sFontFileToCopy) {
|
||||
$sFontFileName = basename($sFontFileToCopy);
|
||||
echo $sCurrentScriptFileName.': copying '.$sFontFileName."\n";
|
||||
|
||||
149
AGENTS.md
Normal file
149
AGENTS.md
Normal file
@@ -0,0 +1,149 @@
|
||||
# AGENTS.md: iTop
|
||||
|
||||
Instructions for AI coding agents and AI code reviewers working on this repository.
|
||||
iTop (by Combodo) is an open-source ITSM/CMDB web application: PHP backend, JS/HTML/SCSS front-end, XML datamodel.
|
||||
Write all code, identifiers, comments and review comments in English.
|
||||
When asked to review code, also follow `REVIEW.md`.
|
||||
|
||||
## Critical rules (security first)
|
||||
|
||||
These rules apply to every change. In code review, a violation is a P1 issue.
|
||||
|
||||
### Input: sanitize with an explicit filter
|
||||
- Read request parameters only with `utils::ReadParam()` or `utils::ReadPostedParam()`, never from `$_GET`, `$_POST`, `$_REQUEST` or `$_COOKIE`.
|
||||
- Always pass the filter explicitly as a `utils::ENUM_SANITIZATION_FILTER_*` constant, the most restrictive that fits (`INTEGER`, `CLASS`, `FIELD_NAME`, `TRANSACTION_ID`, `URL`...).
|
||||
- `utils::ENUM_SANITIZATION_FILTER_RAW_DATA` requires a comment explaining why no other filter fits.
|
||||
|
||||
### Output: escape at consumption time, in the right context
|
||||
- Sanitizing input is not escaping output. Escape where the value is rendered, never upstream in the backend, and never store escaped values.
|
||||
- PHP to HTML: `utils::EscapeHtml()`. Not `htmlentities()` nor `utils::HtmlEntities()` (they escape every non-ASCII char).
|
||||
- Twig: rely on auto-escaping; use `|escape('js')` in JS contexts and `|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME'))` (or `..._ELEMENT_IDENTIFIER`) for generated identifiers. `|raw` only for trusted HTML, with a comment.
|
||||
- JS to DOM: escape untrusted values with `CombodoSanitizer.EscapeHtml()` before building HTML; prefer `.text()` to `.html()` or `innerHTML`.
|
||||
- User-provided rich HTML goes through `HTMLSanitizer::Sanitize()`.
|
||||
|
||||
### CSRF
|
||||
- Never change state on a GET request.
|
||||
- A form that changes state embeds a transaction id from `utils::GetNewTransactionId()`; its handler calls `utils::IsTransactionValid()` before any modification.
|
||||
- Ajax calls use jQuery or `CombodoHTTP.Fetch()`, which send the `X-Combodo-Ajax` header checked by `pages/ajax.render.php`. Never use raw `fetch()` or `XMLHttpRequest`.
|
||||
|
||||
### Data access and permissions
|
||||
- OQL: use placeholders (`WHERE name = :name`) and pass values in the `$aParams` argument of `DBObjectSearch::FromOQL()`. Never concatenate input into OQL or SQL; raw SQL values go through `CMDBSource::Quote()`.
|
||||
- Every new entry point (page, ajax operation, controller route, webservice) enforces authentication (`LoginWebPage::DoLogin()` / `DoLoginEx()`) and rights (`UserRights::IsActionAllowed()`, `UserRights::IsAdministrator()`...).
|
||||
- `AllowAllData()` bypasses user rights and scopes: only when strictly needed, with a comment.
|
||||
|
||||
### Secrets and logs
|
||||
- Never log passwords, tokens, API keys, session ids or personal data. Log security events on `LogChannels::SECURITY`.
|
||||
|
||||
### Security configuration parameters: secure by default
|
||||
- The default value of a configuration parameter is always the secure one.
|
||||
- An option that weakens a protection is opt-in: a `bool` named `security.disable_<protection>`, default `false`, whose description states the risk when set to `true` (model: `security.disable_inline_documents_sandbox` in `core/config.class.inc.php`). Do not add new `security.enable_*` parameters.
|
||||
|
||||
### Vulnerability fixes
|
||||
- The repository is public: the commit message, code comments, test names and PR description of a vulnerability fix describe the functional change without revealing that it fixes a vulnerability. No security wording (vulnerability, XSS, injection, CSRF, security, CVE...), no exploit, no affected versions. E.g. `N°1234 - Fix display of special characters in the activity panel`, not `N°1234 - Fix XSS in the activity panel` nor `N°1234 - Security hardening`.
|
||||
|
||||
## Project overview
|
||||
|
||||
- Supported PHP versions: the `require.php` constraint in `composer.json`. Never use a language feature above its minimum version.
|
||||
- Branches: `develop` (next version), `support/x.y` (maintained versions).
|
||||
- Layout:
|
||||
- `core/`: ORM, `MetaModel`, OQL, configuration (`core/config.class.inc.php`), logs. Legacy structure, meant to be replaced by `sources/` in the long term.
|
||||
- `application/`: legacy UI layer, `utils` (`application/utils.inc.php`), exceptions (`application/exceptions/`). Legacy structure, meant to be replaced by `sources/` in the long term.
|
||||
- `sources/`: namespaced code (`Combodo\iTop\...`, namespace matches the folder): services, controllers, UI blocks, forms.
|
||||
- `pages/`: legacy entry points (`UI.php`, `ajax.render.php`).
|
||||
- `datamodels/2.x/<module>/`: modules (`module.<module>.php`, `datamodel.<module>.xml`, `dictionaries/`).
|
||||
- `dictionaries/`: core translations. `templates/`: Twig. `js/`: iTop JS. `css/`: SCSS and compiled CSS.
|
||||
- `tests/`: PHPUnit (`php-unit-tests/`), PHP-CS-Fixer (`php-code-style/`), PHPStan (`php-static-analysis/`).
|
||||
- Never edit:
|
||||
- `lib/` (Composer `vendor-dir`) and `node_modules/` (npm): third-party code. Only Composer updates `lib/composer/autoload_*.php` (see Commands).
|
||||
- `env-*/`: generated by the datamodel compilation, not versioned.
|
||||
- `data/`: temporary or cached files, not versioned.
|
||||
|
||||
## Commands
|
||||
|
||||
- Unit tests (needs an installed iTop instance, see `tests/php-unit-tests/README.md`): run `composer install` in `tests/php-unit-tests/`, then `tests/php-unit-tests/vendor/bin/phpunit --configuration tests/php-unit-tests/phpunit.xml.dist <path>`.
|
||||
- PHP code style: run `composer install` in `tests/php-code-style/`, then `tests/php-code-style/vendor/bin/php-cs-fixer fix --config tests/php-code-style/.php-cs-fixer.dist.php <path>`.
|
||||
- Static analysis: PHPStan, see `tests/php-static-analysis/README.md` (analyses `env-production`, needs a setup).
|
||||
- After adding, renaming or moving a PHP class in `core/`, `application/` or `sources/`: run `composer dump-autoload --no-interaction --classmap-authoritative` at the repository root (the classmap is authoritative: an unlisted class is not found) and commit `lib/composer/autoload_classmap.php` and `lib/composer/autoload_static.php`.
|
||||
- After changing SCSS: regenerate and commit the compiled `.css` versioned next to some SCSS files (`css/setup.css`, which includes `css/backoffice/`, `css/email.css`, `css/unauthenticated.css`, portal CSS...). For `css/setup.css`, run `php .make/build/commands/setupCssCompiler.php`; for the others, tell the user. The back-office theme is compiled by the setup into `env-*/`: nothing to commit.
|
||||
- After changing datamodel XML: the datamodel must be recompiled by the iTop setup or toolkit. An agent cannot do it: tell the user.
|
||||
|
||||
## Coding conventions
|
||||
|
||||
### PHP
|
||||
- Formatting is enforced by PHP-CS-Fixer (PSR-12, tabs): do not hand-format.
|
||||
- New classes go in `sources/` (namespace `Combodo\iTop\...` matching the folder), not in `core/` or `application/`. Module-specific code stays in its module.
|
||||
- Variables: mixed case with a type prefix: `$s` string, `$i` int, `$b` bool, `$a` array, `$o` object, `$f` float, no prefix for mixed types. Loop counters (`$i`, `$j`) are fine.
|
||||
- Functions and methods: UpperCamelCase starting with a verb (`GetInstance()`, `ReadParam()`). Classes: UpperCamelCase.
|
||||
- Array keys: snake_case, documented with PHPDoc array shapes (`array{key: type}`) or generics (`array<string, \CheckResult>`).
|
||||
- New code uses strict comparison (`===`). `==` only with a comment explaining why.
|
||||
- Test empty strings with `utils::IsNullOrEmptyString()`, not `empty()` (`"0"` is empty).
|
||||
- Type hints in new code only (see Backward compatibility).
|
||||
- PHPDoc: `@since` is mandatory on new classes and on new or changed methods and properties, e.g. `@since 3.3.0 N°1234`. If the target version is unknown, ask the user. Use `bool`, not `boolean`.
|
||||
- Do not modify existing copyright headers.
|
||||
- Configuration parameters: lowercase, domain prefix, underscores (`email_transport_smtp.host`), declared in `core/config.class.inc.php`.
|
||||
|
||||
### Backward compatibility
|
||||
Extensions use public and protected classes, methods and constants, events, configuration parameters, dictionary codes and REST/webservice APIs.
|
||||
- Never remove or rename them, nor change their signature or behavior. Do not add type hints to existing signatures, nor return types to fluent methods.
|
||||
- To replace one, keep it, tag it `@deprecated <version> N°1234 - Use Xxx() instead` and call `DeprecatedCallsLog::NotifyDeprecatedPhpMethod()` in it.
|
||||
|
||||
### Performance
|
||||
- No query in a loop: prefer a single OQL query (`IN`, joins).
|
||||
- Use `DBObjectSet::Count()`, `CountExceeds()` or `SetLimit()` when a count or a subset is enough.
|
||||
- When iterating over a set, load only the needed attributes with `DBObjectSet::OptimizeColumnLoad()`.
|
||||
|
||||
### Services
|
||||
- A new service is a singleton: private constructor, `private static $oInstance`, `public static function GetInstance()`. Model: `sources/Service/Module/ModuleService.php`.
|
||||
|
||||
### Exceptions and logs
|
||||
- Throw iTop exceptions (`CoreException` and its subclasses in `application/exceptions/`) rather than a bare `\Exception`.
|
||||
- Log a caught exception with `ExceptionLog::LogException($oException)`, not `IssueLog::Error($oException->getMessage())`.
|
||||
- Other logs: `IssueLog` with a `LogChannels::*` channel.
|
||||
- Never swallow an exception: an empty `catch` needs a comment explaining why.
|
||||
|
||||
### JavaScript, Twig, SCSS
|
||||
- JS functions: UpperCamelCase starting with a verb. Follow the escaping and Ajax rules above.
|
||||
- Indentation follows `.editorconfig` (PHP, JS: tabs; SCSS, XML: 2 spaces; Twig: 4 spaces).
|
||||
|
||||
### Translations
|
||||
- No hard-coded UI text: use `Dict::S()`, `Dict::Format()`, or `|dict_s` / `|dict_format` in Twig.
|
||||
- Add new entries in English in the `en` dictionary file (`dictionaries/en.dictionary.itop.*.php` or `datamodels/2.x/<module>/dictionaries/en.dict.<module>.php`).
|
||||
- Add new entries in every other language file next to the `en` one (same folder): translate them, or use the English text with a `~~` suffix if unsure. When creating a new dictionary file, create it for every language listed in `tests/php-unit-tests/integration-tests/DictionariesConsistencyTest.php` (`GetLanguagesData()`).
|
||||
- When adding a new language, also declare it in `GetLanguagesData()`, otherwise `DictionariesConsistencyTest` fails.
|
||||
- In other languages, a ~~ suffix marks an untranslated entry: never remove it without translating.
|
||||
|
||||
### Commits
|
||||
- Start either with the ticket reference (`N°*`) or with one of the supported Gitmoji code (`:white_check_mark:`, `:green_heart:`, `:memo:`, `:bookmark:`), imperative present tense, first line 72 characters max, describe the functional change. More details in the body if needed.
|
||||
|
||||
## Dependencies and licenses
|
||||
|
||||
- Dependencies are versioned in the repository: Composer in `lib/`, npm in `node_modules/`. Change versions in `composer.json` / `package.json` and run Composer or npm; never edit the files directly.
|
||||
- Every new dependency must have an entry in `setup/licenses/community-licenses.xml`, with a license compatible with AGPL-3.0. For Composer packages, propose to the user to run `php .make/license/updateLicenses.php` (needs bash, composer and jq) and review its diff; npm packages and other bundled assets are added by hand.
|
||||
|
||||
## Datamodel
|
||||
|
||||
- The datamodel ("DM") is compiled from the XML of the modules (`datamodels/2.x/<module>/datamodel.<module>.xml`) and of installed extensions into `env-<environment>/` (usually `env-production/`), accessed at runtime through `MetaModel`.
|
||||
- Changing an existing class or attribute impacts every customer upgrade and their extensions (which alter the datamodel through XML deltas): treat it as high-impact and flag it.
|
||||
|
||||
## Tests
|
||||
|
||||
- Location: `tests/php-unit-tests/unitary-tests/`, mirroring the source path (tests for `application/foo.php` go in `unitary-tests/application/`). Cross-application data consistency: `integration-tests/`.
|
||||
- Naming: `MyClass` is tested by `MyClassTest`; `MyMethod()` by `testMyMethod()`.
|
||||
- Use the lightest base class that works:
|
||||
1. `PHPUnit\Framework\TestCase`: pure logic.
|
||||
2. `Combodo\iTop\Test\UnitTest\ItopTestCase`: iTop helpers, no datamodel.
|
||||
3. `Combodo\iTop\Test\UnitTest\ItopDataTestCase`: starts the datamodel (`MetaModel`) and rolls back CRUD operations. Slow: only when the test needs the datamodel or iTop objects.
|
||||
4. `Combodo\iTop\Test\UnitTest\ItopCustomDatamodelTestCase`: a non-standard datamodel.
|
||||
- Process isolation (`@runInSeparateProcess`, about 800 ms per `ItopDataTestCase` test) only when needed, on the test, never globally.
|
||||
- Do not leave static state behind (`ContextTag::AddContext()`, `EventService::RegisterListener()`, `Dict::Add()`): checked by `integration-tests/DetectStaticPollutionTest.php`.
|
||||
- `markTestSkipped()` only for a temporarily disabled test.
|
||||
- More details: `tests/php-unit-tests/README.md`.
|
||||
|
||||
## Glossary
|
||||
|
||||
- **DM / datamodel**: the application data model (classes, attributes, lifecycles, menus), compiled from XML and PHP into `env-*/`.
|
||||
- **Module**: a unit of iTop code under `datamodels/2.x/<module>/`. **Extension**: a packaged set of modules installed on top of iTop.
|
||||
- **OQL**: iTop's object query language.
|
||||
- **Transaction id**: iTop's CSRF token.
|
||||
- **Console / back-office**: the main UI for agents. **Portal**: the end-user UI (`datamodels/2.x/itop-portal-base/`).
|
||||
- **N°xxxx**: Combodo internal ticket number, used in commits and `@since`.
|
||||
17
README.md
17
README.md
@@ -33,13 +33,13 @@ iTop also offers mass import tools to help you become even more efficient.
|
||||
[62]: https://www.itophub.io/wiki/page?id=latest:release:change_log
|
||||
[63]: https://www.itophub.io/wiki/page?id=latest:release:start
|
||||
[64]: https://www.itophub.io/wiki/page?id=latest:install:start
|
||||
[65]: https://sourceforge.net/projects/itop/files/latest/download
|
||||
[65]: https://github.com/Combodo/iTop/releases/latest
|
||||
|
||||
|
||||
## Resources
|
||||
|
||||
- [iTop Forums][1]: community support
|
||||
- [iTop Tickets][2]: for feature requests and bug reports
|
||||
- [GitHub Discussions][1]: community support
|
||||
- [GitHub Issues Tickets ][2]: for feature requests and bug reports
|
||||
- [Releases download][3]
|
||||
- [iTop requirements][4]
|
||||
- [Documentation][5] covering both iTop and its official extensions
|
||||
@@ -47,9 +47,9 @@ iTop also offers mass import tools to help you become even more efficient.
|
||||
- [iTop versions history][7]
|
||||
|
||||
|
||||
[1]: https://sourceforge.net/p/itop/discussion/
|
||||
[2]: https://sourceforge.net/p/itop/tickets/
|
||||
[3]: https://sourceforge.net/projects/itop/files/itop/
|
||||
[1]: https://github.com/Combodo/iTop/discussions
|
||||
[2]: https://github.com/Combodo/iTop/issues
|
||||
[3]: https://github.com/Combodo/iTop/releases
|
||||
[4]: https://www.itophub.io/wiki/page?id=latest:install:requirements
|
||||
[5]: https://www.itophub.io/wiki
|
||||
[6]: https://store.itophub.io/en_US/
|
||||
@@ -95,7 +95,7 @@ We would like to give a special thank you 🤗 to the people from the community
|
||||
- Casteleyn, Thomas (a.k.a [@Hipska](https://www.github.com/Hipska))
|
||||
- Castro, Randall Badilla
|
||||
- Colantoni, Maria Laura
|
||||
- Couronné, Guy
|
||||
- Couronné, Guy [@GurneyHallack](https://github.com/GurneyHallack)
|
||||
- Dejin, Bie (a.k.a [@bdejin](https://github.com/bdejin))
|
||||
- Delicado, Elodie
|
||||
- Dvořák, Lukáš
|
||||
@@ -110,7 +110,7 @@ We would like to give a special thank you 🤗 to the people from the community
|
||||
- Khamit, Shamil
|
||||
- Kincel, Martin
|
||||
- Konečný, Kamil
|
||||
- Kunin, Vladimir
|
||||
- Kunin, Vladimir (a.k.a [@vbkunin](https://github.com/vbkunin)
|
||||
- Lassiter, Denis (a.k.a [@delassiter](https://github.com/delassiter))
|
||||
- Lazcano, Federico
|
||||
- Lucas, Jonathan
|
||||
@@ -128,6 +128,7 @@ We would like to give a special thank you 🤗 to the people from the community
|
||||
- Šafránek, Jaroslav (a.k.a [jkcinik](https://sourceforge.net/u/jkcinik/profile/) on SourceForge)
|
||||
- Seki, Shoji
|
||||
- Shilov, Vladimir
|
||||
- Srivastava, Vaibhav (a.k.a [@vaibhav8a](https://github.com/vaibhav8a))
|
||||
- Stetina, Pavel (a.k.a [@Stetinac](https://github.com/Stetinac))
|
||||
- Stukalov, Ilya (a.k.a [@ilya](https://www.github.com/ilya-stukalov))
|
||||
- Tarjányi, Csaba (a.k.a [@tacsaby](https://github.com/tacsaby))
|
||||
|
||||
31
REVIEW.md
Normal file
31
REVIEW.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# REVIEW.md: AI code review instructions for iTop
|
||||
|
||||
For automated reviewers (GitHub Copilot code review, Greptile, ...). Project conventions and security rules are in `AGENTS.md`; this file says what to comment on and how.
|
||||
|
||||
## Output
|
||||
- Write every comment in English.
|
||||
- Start each comment with its priority: `[P1-Security]`, `[P2-Bug]`, `[P2-Regression]`, `[P2-Performance]`, `[P2-Architecture]` or `[P3]`.
|
||||
- Report every P1 and P2 issue. Report at most 3 `[P3]` comments per PR: keep the most useful ones.
|
||||
- Prefix test suggestions with `[Tests]` and put them on the code to cover; they do not count toward the P3 limit.
|
||||
- No praise, no comment that only describes the change.
|
||||
|
||||
## Priorities
|
||||
1. **P1 Security**: XSS, CSRF, OQL/SQL injection, missing authentication or rights check, sensitive data in logs, unsafe file or path handling, any breach of the "Critical rules" in `AGENTS.md`, a security option that is not secure by default or not named `security.disable_*`.
|
||||
2. **P2 Bug**: logic error, wrong condition, unhandled `null`/`false` return or exception, code incompatible with the minimum PHP version, broken existing feature, leftover debug output (`var_dump()`, `print_r()`, `console.log()`).
|
||||
3. **P2 Regression**: breach of the "Backward compatibility" rules in `AGENTS.md`; change to an existing datamodel class or attribute.
|
||||
4. **P2 Performance**: breach of the "Performance" rules in `AGENTS.md`, repeated expensive calls.
|
||||
5. **P2 Architecture**: logic in the wrong layer, a new service that is not a singleton, a new core production PHP class outside of the `sources/` folder (excluding test classes and module-specific code), a new PHP class in `core/`, `application/` or `sources/` without the updated `lib/composer/autoload_classmap.php`, a new dependency missing from `setup/licenses/community-licenses.xml`, SCSS changed without its versioned compiled CSS.
|
||||
6. **P3 Other**: unclear names (variables, functions, classes), deviations from `AGENTS.md` conventions, typos and grammar in identifiers, comments and dictionary entries, UI labels that could be clearer or more consistent with existing ones, duplicated logic or re-implementation of an existing helper (`utils`, `MetaModel`...), dead or commented-out code, function too long or too nested to read.
|
||||
|
||||
## Tests
|
||||
- When the PR changes behavior, propose the missing test cases: what to assert, in which file of `tests/php-unit-tests/unitary-tests/`.
|
||||
- Check that the base class is the lightest that works (`ItopDataTestCase` only if the test needs the datamodel). Flag unjustified process isolation and static state left behind.
|
||||
|
||||
## Do not comment on
|
||||
- Formatting: indentation, spacing, line breaks, brace placement. PHP-CS-Fixer and `.editorconfig` handle it.
|
||||
- Third-party code in `lib/` and `node_modules/`, and generated code in `env-*/`. Only check whether `lib/composer/autoload_*.php` should have changed.
|
||||
- Code the PR does not touch, unless the change breaks it or it needs to be adjusted accordingly.
|
||||
|
||||
## Vulnerabilities
|
||||
- A vulnerability introduced by the PR is always a `[P1-Security]` comment: explain the risk and how to fix it.
|
||||
- This repository is public. If the PR seems to fix an existing vulnerability, review it as an ordinary change: never call it a security fix, never describe the vulnerability, how to exploit it, or the affected versions, in comments or in the PR overview. If the fix looks incomplete, describe only the missing check in neutral technical terms (for example "this value is not escaped here").
|
||||
@@ -582,7 +582,9 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
||||
*/
|
||||
public function ListProfiles($oUser)
|
||||
{
|
||||
if (count($oUser->ListChanges()) === 0) { // backward compatibility
|
||||
if (!array_key_exists('profile_list', $oUser->ListChanges())) {
|
||||
// Profiles list is not modified on the $oUser object, we can use DBObjectSearch with `all data` capabilities
|
||||
// Note: This is the default behavior
|
||||
$aRet = [];
|
||||
$oSearch = new DBObjectSearch('URP_UserProfile');
|
||||
$oSearch->AllowAllData();
|
||||
@@ -595,6 +597,8 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
||||
|
||||
return $aRet;
|
||||
} else {
|
||||
// Profiles list must be computed with memory changes.
|
||||
// Note: this is a bit tricky because the user object may have been modified in memory (e.g. a profile added or removed) and we need to take that into account
|
||||
$aRet = [];
|
||||
$oProfilesSet = $oUser->Get('profile_list');
|
||||
foreach ($oProfilesSet as $oUserProfile) {
|
||||
|
||||
@@ -30,6 +30,15 @@ require_once(APPROOT.'application/newsroomprovider.class.inc.php');
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
* @since 2.7.0
|
||||
*/
|
||||
|
||||
require_once(APPROOT.'application/applicationextension/common/ApplicationPopupMenuItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/common/iPopupMenuExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/common/JSButtonItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/common/JSPopupMenuItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/common/SeparatorPopupMenuItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/common/URLButtonItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/common/URLPopupMenuItem.php');
|
||||
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iApplicationUIExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iBackofficeDictEntriesExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iBackofficeDictEntriesPrefixesExtension.php');
|
||||
@@ -43,19 +52,12 @@ require_once(APPROOT.'application/applicationextension/backoffice/iBackofficeScr
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iBackofficeStyleExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iFieldRendererMappingsExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iPageUIBlockExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iPopupMenuExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iPreferencesExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/iWelcomePopupExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/AbstractApplicationUIExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/AbstractPageUIBlockExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/AbstractPreferencesExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/AbstractWelcomePopupExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/ApplicationPopupMenuItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/JSButtonItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/JSPopupMenuItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/SeparatorPopupMenuItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/URLButtonItem.php');
|
||||
require_once(APPROOT.'application/applicationextension/backoffice/URLPopupMenuItem.php');
|
||||
|
||||
require_once(APPROOT.'application/applicationextension/iBackupExtraFilesExtension.php');
|
||||
require_once(APPROOT.'application/applicationextension/iKPILoggerExtension.php');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Implement this interface to add sass file (SCSS) to the backoffice pages.
|
||||
* Implement this interface to add sass files (SCSS) to the backoffice pages.
|
||||
* example: return "css/setup.scss"
|
||||
*
|
||||
* @api
|
||||
@@ -11,9 +11,9 @@
|
||||
interface iBackofficeSassExtension
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
* @see \iTopWebPage::$a_styles
|
||||
* @return array An array of relative paths (from loaded import paths) to the files to compile and include
|
||||
* @see \iTopWebPage::$a_linked_stylesheets
|
||||
* @api
|
||||
*/
|
||||
public function GetSass(): string;
|
||||
public function GetSassRelPaths(): array;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\Common\Metadata\AriaAttributes;
|
||||
use Combodo\iTop\Application\UI\Base\Common\Metadata\DataAttributes;
|
||||
use Combodo\iTop\Application\UI\Base\Common\Metadata\Grouping;
|
||||
|
||||
/**
|
||||
* Base class for the various types of custom menus
|
||||
*
|
||||
@@ -7,7 +11,7 @@
|
||||
* @package UIExtensibilityAPI
|
||||
* @since 2.0
|
||||
*/
|
||||
abstract class ApplicationPopupMenuItem
|
||||
abstract class ApplicationPopupMenuItem implements iGroupingProvider, iDataAttributesProvider, iAriaAttributesProvider
|
||||
{
|
||||
/** @ignore */
|
||||
protected $sUID;
|
||||
@@ -19,6 +23,12 @@ abstract class ApplicationPopupMenuItem
|
||||
protected $sIconClass;
|
||||
/** @ignore */
|
||||
protected $aCssClasses;
|
||||
/** @since 3.3.0 */
|
||||
protected ?AriaAttributes $oAriaAttributes = null;
|
||||
/** @since 3.3.0 */
|
||||
protected ?DataAttributes $oDataAttributes = null;
|
||||
/** @since 3.3.0 */
|
||||
protected ?Grouping $oGrouping = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -58,6 +68,17 @@ abstract class ApplicationPopupMenuItem
|
||||
return $this->sLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sLabel
|
||||
*
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function SetLabel(string $sLabel): void
|
||||
{
|
||||
$this->sLabel = $sLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CSS classes
|
||||
*
|
||||
@@ -141,9 +162,76 @@ abstract class ApplicationPopupMenuItem
|
||||
*/
|
||||
abstract public function GetMenuItem();
|
||||
|
||||
/**
|
||||
* Get additional data, child classes can use this without having to worry about this class interfaces
|
||||
* @return array<string, mixed>
|
||||
* @since 3.3.0
|
||||
*/
|
||||
protected function GetMenuItemAdditionalData(): array
|
||||
{
|
||||
$aAdditionalData = [];
|
||||
|
||||
$aDataAttributes = $this->GetDataAttributes()->GetAttributes();
|
||||
if (!empty($aDataAttributes)) {
|
||||
$aAdditionalData['data_attributes'] = $aDataAttributes;
|
||||
}
|
||||
|
||||
$aAriaAttributes = $this->GetAriaAttributes()->GetAttributes();
|
||||
if (!empty($aAriaAttributes)) {
|
||||
$aAdditionalData['aria_attributes'] = $aAriaAttributes;
|
||||
}
|
||||
|
||||
$oGrouping = $this->GetGrouping();
|
||||
if ($oGrouping !== null) {
|
||||
$aAdditionalData['grouping_uid'] = $oGrouping->GetUID();
|
||||
}
|
||||
|
||||
return $aAdditionalData;
|
||||
}
|
||||
|
||||
/** @ignore */
|
||||
public function GetLinkedScripts()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function GetAriaAttributes(): AriaAttributes
|
||||
{
|
||||
return $this->oAriaAttributes ??= new AriaAttributes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function GetDataAttributes(): DataAttributes
|
||||
{
|
||||
return $this->oDataAttributes ??= new DataAttributes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function GetGrouping(): ?Grouping
|
||||
{
|
||||
return $this->oGrouping;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Grouping|null $oGrouping
|
||||
* @return static
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function SetGrouping(?Grouping $oGrouping): static
|
||||
{
|
||||
$this->oGrouping = $oGrouping;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Class for adding an item into a popup menu that triggers some Javascript code
|
||||
*
|
||||
* Note: This works only in the backoffice, {@see \JSButtonItem} for the end-user portal
|
||||
* Note: This works only in the backoffice, {@see \common\JSButtonItem} for the end-user portal
|
||||
*
|
||||
* @api
|
||||
* @package UIExtensibilityAPI
|
||||
@@ -40,7 +40,7 @@ class JSPopupMenuItem extends ApplicationPopupMenuItem
|
||||
public function GetMenuItem()
|
||||
{
|
||||
// Note: the semicolumn is a must here!
|
||||
return [
|
||||
$aData = [
|
||||
'label' => $this->GetLabel(),
|
||||
'onclick' => $this->GetJsCode().'; return false;',
|
||||
'url' => $this->GetUrl(),
|
||||
@@ -48,6 +48,8 @@ class JSPopupMenuItem extends ApplicationPopupMenuItem
|
||||
'icon_class' => $this->sIconClass,
|
||||
'tooltip' => $this->sTooltip,
|
||||
];
|
||||
|
||||
return array_merge($aData, $this->GetMenuItemAdditionalData());
|
||||
}
|
||||
|
||||
/** @ignore */
|
||||
@@ -24,6 +24,12 @@ class SeparatorPopupMenuItem extends ApplicationPopupMenuItem
|
||||
/** @ignore */
|
||||
public function GetMenuItem()
|
||||
{
|
||||
return ['label' => '<hr class="menu-separator">', 'url' => '', 'css_classes' => $this->aCssClasses];
|
||||
$aData = [
|
||||
'label' => '<hr class="menu-separator">',
|
||||
'url' => '',
|
||||
'css_classes' => $this->aCssClasses,
|
||||
];
|
||||
|
||||
return array_merge($aData, $this->GetMenuItemAdditionalData());
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Class for adding an item into a popup menu that browses to the given URL
|
||||
*
|
||||
* Note: This works only in the backoffice, {@see \URLButtonItem} for the end-user portal
|
||||
* Note: This works only in the backoffice, {@see \common\URLButtonItem} for the end-user portal
|
||||
*
|
||||
* @api
|
||||
* @package UIExtensibilityAPI
|
||||
@@ -35,13 +35,15 @@ class URLPopupMenuItem extends ApplicationPopupMenuItem
|
||||
/** @ignore */
|
||||
public function GetMenuItem()
|
||||
{
|
||||
return ['label' => $this->GetLabel(),
|
||||
$aData = ['label' => $this->GetLabel(),
|
||||
'url' => $this->GetUrl(),
|
||||
'target' => $this->GetTarget(),
|
||||
'css_classes' => $this->aCssClasses,
|
||||
'icon_class' => $this->sIconClass,
|
||||
'tooltip' => $this->sTooltip,
|
||||
];
|
||||
|
||||
return array_merge($aData, $this->GetMenuItemAdditionalData());
|
||||
}
|
||||
|
||||
/** @ignore */
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\Common\Metadata\AriaAttributes;
|
||||
|
||||
/**
|
||||
* Allows to provide ARIA attributes to classes that implement this interface.
|
||||
* The ARIA attributes will be used to improve accessibility of the UI components
|
||||
*
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
interface iAriaAttributesProvider
|
||||
{
|
||||
public function GetAriaAttributes(): AriaAttributes;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\Common\Metadata\DataAttributes;
|
||||
|
||||
/**
|
||||
* Allows to provide data attributes to classes that implement this interface.
|
||||
* The data attributes will be used to provide additional information to the UI components
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
interface iDataAttributesProvider
|
||||
{
|
||||
public function GetDataAttributes(): DataAttributes;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\Common\Metadata\Grouping;
|
||||
|
||||
/**
|
||||
* Allows to provide grouping information to classes that implement this interface.
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
interface iGroupingProvider
|
||||
{
|
||||
public function GetGrouping(): ?Grouping;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Implemented by metadata value objects that flatten to HTML attributes.
|
||||
* Ease the implementation of classes that need to provide HTML attributes to the UI components
|
||||
*
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
interface iHtmlAttributesSource
|
||||
{
|
||||
/** @return array<string, string> Attribute name => value, ready to be escaped and printed */
|
||||
public function GetHtmlAttributes(): array;
|
||||
}
|
||||
@@ -95,7 +95,24 @@ interface iPopupMenuExtension
|
||||
* @todo
|
||||
*/
|
||||
public const PORTAL_MENU_ACTIONS = 10;
|
||||
|
||||
/**
|
||||
* Get the list of items to be added to the backoffice top-bar items
|
||||
* $param is an array: [] for now, in a distant future we want to give a complete context
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public const MENU_TOPBAR_ACTIONS = 11;
|
||||
/**
|
||||
* Get the list of items to be added to the actions on a given form field (i.e. the attribute of an object)
|
||||
* $param is an array: ['object' => DBObject, att_code => attribute code , mode => edit/read]
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public const MENU_OBJDETAILS_FIELD_ACTIONS = 12;
|
||||
/**
|
||||
* Get the list of items to be added to the actions in the activity panel (read-only mode)
|
||||
* $param is an array: ['object' => DBObject, caselog_att_code => caselog attribute code or 'activity']
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public const MENU_OBJDETAILS_ACTIVITY_PANEL_ACTIONS = 13;
|
||||
/**
|
||||
* Get the list of items to be added to a menu.
|
||||
*
|
||||
@@ -49,6 +49,7 @@ use Combodo\iTop\Application\WebPage\WebPage;
|
||||
use Combodo\iTop\Renderer\BlockRenderer;
|
||||
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
||||
use Combodo\iTop\Renderer\Console\ConsoleFormRenderer;
|
||||
use Combodo\iTop\Service\InterfaceDiscovery\InterfaceDiscovery;
|
||||
use Combodo\iTop\Service\Links\LinkSetDataTransformer;
|
||||
use Combodo\iTop\Service\Links\LinkSetModel;
|
||||
use Combodo\iTop\Service\TemporaryObjects\TemporaryObjectHelper;
|
||||
@@ -1046,7 +1047,7 @@ HTML
|
||||
// Add extra data for markup generation
|
||||
// - Attribute code and AttributeDef. class
|
||||
$val['attcode'] = $sAttCode;
|
||||
$val['atttype'] = $oAttDef->GetType();
|
||||
$val['atttype'] = $oAttDef->GetTypeShortClassName();
|
||||
$val['attlabel'] = $sAttLabel;
|
||||
$val['attflags'] = ($bEditMode) ? $this->GetFormAttributeFlags($sAttCode) : OPT_ATT_READONLY;
|
||||
|
||||
@@ -1065,6 +1066,14 @@ HTML
|
||||
}
|
||||
}
|
||||
$val['value_raw'] = ($bExcludeRawValue === false) ? $this->Get($sAttCode) : '';
|
||||
$val['actions'] = [];
|
||||
|
||||
/** @var \iPopupMenuExtension $oExtensionInstance */
|
||||
foreach (InterfaceDiscovery::GetInstance()->FindItopClasses('iPopupMenuExtension') as $oExtensionInstance) {
|
||||
foreach ($oExtensionInstance::EnumItems(iPopupMenuExtension::MENU_OBJDETAILS_FIELD_ACTIONS, ['object' => $this, 'att_code' => $sAttCode, 'mode' => $bEditMode ? 'edit' : 'read']) as $oMenuItem) {
|
||||
$val['actions'][] = $oMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
// The field is visible, add it to the current column
|
||||
$oField = FieldUIBlockFactory::MakeFromParams($val);
|
||||
@@ -1535,190 +1544,6 @@ HTML
|
||||
return $sHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param WebPage $oPage
|
||||
* @param \CMDBObjectSet $oSet
|
||||
* @param array $aParams
|
||||
*
|
||||
* @throws \Exception
|
||||
* only used in old and deprecated export.php
|
||||
*
|
||||
* @internal Only to be used by `/webservices/export.php` : this is a legacy method that produces wrong HTML (no TR on table body rows)
|
||||
*/
|
||||
public static function DisplaySetAsHTMLSpreadsheet(WebPage $oPage, CMDBObjectSet $oSet, $aParams = [])
|
||||
{
|
||||
$oPage->add(self::GetSetAsHTMLSpreadsheet($oSet, $aParams));
|
||||
}
|
||||
|
||||
/**
|
||||
* Spreadsheet output: designed for end users doing some reporting
|
||||
* Then the ids are excluded and replaced by the corresponding friendlyname
|
||||
*
|
||||
* @param \DBObjectSet $oSet
|
||||
* @param array $aParams
|
||||
*
|
||||
* @return string
|
||||
* @throws \CoreException
|
||||
* @throws \CoreUnexpectedValue
|
||||
* @throws \MissingQueryArgument
|
||||
* @throws \MySQLException
|
||||
* @throws \MySQLHasGoneAwayException
|
||||
* @throws \Exception
|
||||
*
|
||||
* @internal Only to be used by `/webservices/export.php` : this is a legacy method that produces wrong HTML (no TR on table body rows)
|
||||
*/
|
||||
public static function GetSetAsHTMLSpreadsheet(DBObjectSet $oSet, $aParams = [])
|
||||
{
|
||||
$aFields = null;
|
||||
if (isset($aParams['fields']) && (strlen($aParams['fields']) > 0)) {
|
||||
$aFields = explode(',', $aParams['fields']);
|
||||
}
|
||||
|
||||
$bFieldsAdvanced = false;
|
||||
if (isset($aParams['fields_advanced'])) {
|
||||
$bFieldsAdvanced = (bool)$aParams['fields_advanced'];
|
||||
}
|
||||
|
||||
$bLocalize = true;
|
||||
if (isset($aParams['localize_values'])) {
|
||||
$bLocalize = (bool)$aParams['localize_values'];
|
||||
}
|
||||
|
||||
$aList = [];
|
||||
|
||||
$aClasses = $oSet->GetFilter()->GetSelectedClasses();
|
||||
$aAuthorizedClasses = [];
|
||||
foreach ($aClasses as $sAlias => $sClassName) {
|
||||
if (UserRights::IsActionAllowed($sClassName, UR_ACTION_READ, $oSet) != UR_ALLOWED_NO) {
|
||||
$aAuthorizedClasses[$sAlias] = $sClassName;
|
||||
}
|
||||
}
|
||||
$aHeader = [];
|
||||
foreach ($aAuthorizedClasses as $sAlias => $sClassName) {
|
||||
$aList[$sAlias] = [];
|
||||
|
||||
foreach (MetaModel::ListAttributeDefs($sClassName) as $sAttCode => $oAttDef) {
|
||||
if (is_null($aFields) || (count($aFields) == 0)) {
|
||||
// Standard list of attributes (no link sets)
|
||||
if ($oAttDef->IsScalar() && ($oAttDef->IsWritable() || $oAttDef->IsExternalField())) {
|
||||
$sAttCodeEx = $oAttDef->IsExternalField() ? $oAttDef->GetKeyAttCode().'->'.$oAttDef->GetExtAttCode() : $sAttCode;
|
||||
|
||||
$aList[$sAlias][$sAttCodeEx] = $oAttDef;
|
||||
|
||||
if ($bFieldsAdvanced && $oAttDef->IsExternalKey(EXTKEY_RELATIVE)) {
|
||||
$sRemoteClass = $oAttDef->GetTargetClass();
|
||||
foreach (MetaModel::GetReconcKeys($sRemoteClass) as $sRemoteAttCode) {
|
||||
$aList[$sAlias][$sAttCode.'->'.$sRemoteAttCode] = MetaModel::GetAttributeDef(
|
||||
$sRemoteClass,
|
||||
$sRemoteAttCode
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// User defined list of attributes
|
||||
if (in_array($sAttCode, $aFields) || in_array($sAlias.'.'.$sAttCode, $aFields)) {
|
||||
$aList[$sAlias][$sAttCode] = $oAttDef;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Replace external key by the corresponding friendly name (if not already in the list)
|
||||
foreach ($aList[$sAlias] as $sAttCode => $oAttDef) {
|
||||
if ($oAttDef->IsExternalKey()) {
|
||||
unset($aList[$sAlias][$sAttCode]);
|
||||
$sFriendlyNameAttCode = $sAttCode.'_friendlyname';
|
||||
if (!array_key_exists(
|
||||
$sFriendlyNameAttCode,
|
||||
$aList[$sAlias]
|
||||
) && MetaModel::IsValidAttCode($sClassName, $sFriendlyNameAttCode)) {
|
||||
$oFriendlyNameAtt = MetaModel::GetAttributeDef($sClassName, $sFriendlyNameAttCode);
|
||||
$aList[$sAlias][$sFriendlyNameAttCode] = $oFriendlyNameAtt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($aList[$sAlias] as $sAttCodeEx => $oAttDef) {
|
||||
$sColLabel = $bLocalize ? MetaModel::GetLabel($sClassName, $sAttCodeEx) : $sAttCodeEx;
|
||||
|
||||
$oFinalAttDef = $oAttDef->GetFinalAttDef();
|
||||
if (get_class($oFinalAttDef) == 'AttributeDateTime') {
|
||||
$aHeader[] = $sColLabel.' ('.Dict::S('UI:SplitDateTime-Date').')';
|
||||
$aHeader[] = $sColLabel.' ('.Dict::S('UI:SplitDateTime-Time').')';
|
||||
} else {
|
||||
$aHeader[] = $sColLabel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sHtml = "<table border=\"1\">\n";
|
||||
$sHtml .= "<tr>\n";
|
||||
$sHtml .= "<td>".implode("</td><td>", $aHeader)."</td>\n";
|
||||
$sHtml .= "</tr>\n";
|
||||
$oSet->Seek(0);
|
||||
while ($aObjects = $oSet->FetchAssoc()) {
|
||||
$aRow = [];
|
||||
foreach ($aAuthorizedClasses as $sAlias => $sClassName) {
|
||||
$oObj = $aObjects[$sAlias];
|
||||
foreach ($aList[$sAlias] as $sAttCodeEx => $oAttDef) {
|
||||
if (is_null($oObj)) {
|
||||
$aRow[] = '<td></td>';
|
||||
} else {
|
||||
$oFinalAttDef = $oAttDef->GetFinalAttDef();
|
||||
if (get_class($oFinalAttDef) == 'AttributeDateTime') {
|
||||
$sDate = $oObj->Get($sAttCodeEx);
|
||||
if ($sDate === null) {
|
||||
$aRow[] = '<td></td>';
|
||||
$aRow[] = '<td></td>';
|
||||
} else {
|
||||
$iDate = AttributeDateTime::GetAsUnixSeconds($sDate);
|
||||
$aRow[] = '<td>'.date(
|
||||
'Y-m-d',
|
||||
$iDate
|
||||
).'</td>'; // Format kept as-is for 100% backward compatibility of the exports
|
||||
$aRow[] = '<td>'.date(
|
||||
'H:i:s',
|
||||
$iDate
|
||||
).'</td>'; // Format kept as-is for 100% backward compatibility of the exports
|
||||
}
|
||||
} else {
|
||||
if ($oAttDef instanceof AttributeCaseLog) {
|
||||
$rawValue = $oObj->Get($sAttCodeEx);
|
||||
$outputValue = str_replace(
|
||||
"\n",
|
||||
"<br/>",
|
||||
utils::EscapeHtml($rawValue->__toString())
|
||||
);
|
||||
// Trick for Excel: treat the content as text even if it begins with an equal sign
|
||||
$aRow[] = '<td x:str>'.$outputValue.'</td>';
|
||||
} else {
|
||||
$rawValue = $oObj->Get($sAttCodeEx);
|
||||
// Due to custom formatting rules, empty friendlynames may be rendered as non-empty strings
|
||||
// let's fix this and make sure we render an empty string if the key == 0
|
||||
if ($oAttDef instanceof AttributeExternalField && $oAttDef->IsFriendlyName()) {
|
||||
$sKeyAttCode = $oAttDef->GetKeyAttCode();
|
||||
if ($oObj->Get($sKeyAttCode) == 0) {
|
||||
$rawValue = '';
|
||||
}
|
||||
}
|
||||
if ($bLocalize) {
|
||||
$outputValue = utils::EscapeHtml($oFinalAttDef->GetEditValue($rawValue));
|
||||
} else {
|
||||
$outputValue = utils::EscapeHtml($rawValue);
|
||||
}
|
||||
$aRow[] = '<td>'.$outputValue.'</td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$sHtml .= implode("\n", $aRow);
|
||||
$sHtml .= "</tr>\n";
|
||||
}
|
||||
$sHtml .= "</table>\n";
|
||||
|
||||
return $sHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param WebPage $oPage
|
||||
* @param \CMDBObjectSet $oSet
|
||||
@@ -3250,8 +3075,12 @@ EOF
|
||||
}
|
||||
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, $aArgs);
|
||||
if (is_array($aAllowedValues) && count($aAllowedValues) == 1) {
|
||||
$aValues = array_keys($aAllowedValues);
|
||||
$this->Set($sAttCode, $aValues[0]);
|
||||
// linkset are ignored
|
||||
// N°9622 - Error in the user story life cycle
|
||||
if (!$oAttDef->IsLinkSet()) {
|
||||
$aValues = array_keys($aAllowedValues);
|
||||
$this->Set($sAttCode, $aValues[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4167,6 +3996,27 @@ HTML;
|
||||
$sTagSetJson = utils::ReadPostedParam("attr_{$sFormPrefix}{$sAttCode}", null, 'raw_data');
|
||||
if ($sTagSetJson !== null) { // bulk modify, direct linked set not handled
|
||||
$value = json_decode($sTagSetJson, true);
|
||||
if ($this->IsNew()) {
|
||||
if (is_array($value['orig_value'])) {
|
||||
foreach ($value['orig_value'] as $val) {
|
||||
if (!in_array($val, $value['removed'])) {
|
||||
$value['added'][] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$aCurrentValues = $this->Get($sAttCode)->GetValues();
|
||||
foreach ($value['orig_value'] as $val) {
|
||||
if (!in_array($val, $aCurrentValues) && !in_array($val, $value['removed']) && !in_array($val, $value['added'])) {
|
||||
$value['added'][] = $val;
|
||||
}
|
||||
}
|
||||
foreach ($aCurrentValues as $val) {
|
||||
if (!in_array($val, $value['orig_value']) && !in_array($val, $value['removed']) && !in_array($val, $value['added'])) {
|
||||
$value['removed'][] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4507,7 +4357,7 @@ HTML;
|
||||
|
||||
$oDivField = FieldUIBlockFactory::MakeLarge("");
|
||||
// UIContentBlockUIBlockFactory::MakeStandard(null,["field_container field_large"]);
|
||||
$oDivField->AddDataAttribute("attribute-type", $oAttDef->GetType());
|
||||
$oDivField->AddDataAttribute("attribute-type", $oAttDef->GetTypeShortClassName());
|
||||
$oDivField->AddDataAttribute("attribute-label", $sAttMetaDataLabel);
|
||||
$oDivField->AddDataAttribute("attribute-flag-hidden", false);
|
||||
$oDivField->AddDataAttribute("attribute-flag-read-only", false);
|
||||
@@ -4810,7 +4660,7 @@ EOF
|
||||
// Not in preview mode, do the update for real
|
||||
$sTransactionId = utils::ReadPostedParam('transaction_id', '', 'transaction_id');
|
||||
if (!utils::IsTransactionValid($sTransactionId, false)) {
|
||||
throw new Exception(Dict::S('UI:Error:ObjectAlreadyUpdated'));
|
||||
throw new Exception(Dict::S('UI:Error:InvalidToken'));
|
||||
}
|
||||
utils::RemoveTransaction($sTransactionId);
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ EOF
|
||||
*/
|
||||
public function Render($oPage, $bEditMode = false, $aExtraParams = [], $bCanEdit = true)
|
||||
{
|
||||
$aExtraParams['dashboard_div_id'] = utils::Sanitize($aExtraParams['dashboard_div_id'] ?? null, $this->GetId(), utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER);
|
||||
$aExtraParams['dashboard_div_id'] = utils::Sanitize($aExtraParams['dashboard_div_id'] ?? $this->GetId(), $this->GetId(), utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER);
|
||||
|
||||
/** @var \DashboardLayoutMultiCol $oLayout */
|
||||
$oLayout = new $this->sLayoutClass();
|
||||
@@ -586,7 +586,7 @@ JS
|
||||
/** @var \Dashlet $oDashlet */
|
||||
foreach ($aCell as $oDashlet) {
|
||||
if ($oDashlet->IsVisible()) {
|
||||
$oPage->add('<div class="dashlet_properties" id="dashlet_properties_'.$oDashlet->GetID().'" style="display:none">');
|
||||
$oPage->add('<div class="dashlet_properties" id="dashlet_properties_'.$oDashlet->GetID().'" data-role="ibo-dashlet-properties" data-dashlet-class="'.$oDashlet->GetDashletType().'" style="display:none">');
|
||||
$oForm = $oDashlet->GetForm();
|
||||
$this->SetFormParams($oForm, $aExtraParams);
|
||||
$oForm->RenderAsPropertySheet($oPage, false, '.itop-dashboard');
|
||||
@@ -1203,7 +1203,7 @@ EOF
|
||||
}
|
||||
$aRenderParams['dashboard_div_id'] = $aExtraParams['dashboard_div_id'];
|
||||
$sJSExtraParams = json_encode($aExtraParams);
|
||||
$oPage->add('<div id="dashboard_editor" class="ibo-dashboard-editor" data-role="ibo-dashboard-editor">');
|
||||
$oPage->add('<div id="dashboard_editor" class="ibo-dashboard-editor" data-role="ibo-dashboard-editor" data-dashboard-id="'.$this->sId.'">');
|
||||
$oPage->add('<div class="ui-layout-center">');
|
||||
$this->SetCustomFlag(true);
|
||||
$this->Render($oPage, true, $aRenderParams);
|
||||
|
||||
@@ -25,6 +25,20 @@ use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||
use Combodo\iTop\Application\WebPage\WebPage;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeDateTime;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeDecimal;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeDuration;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeEncryptedString;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeEnum;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeExternalField;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeFriendlyName;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeInteger;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeLinkedSet;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeOneWayPassword;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributePassword;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributePercentage;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeSubItem;
|
||||
use Combodo\iTop\Core\AttributeDefinition\iAttributeNoGroupBy;
|
||||
|
||||
require_once(APPROOT.'application/forms.class.inc.php');
|
||||
|
||||
@@ -440,7 +454,7 @@ EOF
|
||||
// For external fields, find the real type of the target
|
||||
$sExtFieldAttCode = $sAttCode;
|
||||
$sTargetClass = $sClass;
|
||||
while (is_a($sAttType, 'AttributeExternalField', true)) {
|
||||
while (is_a($sAttType, AttributeExternalField::class, true)) {
|
||||
$sExtKeyAttCode = $this->oModelReflection->GetAttributeProperty($sTargetClass, $sExtFieldAttCode, 'extkey_attcode');
|
||||
$sTargetAttCode = $this->oModelReflection->GetAttributeProperty($sTargetClass, $sExtFieldAttCode, 'target_attcode');
|
||||
$sTargetClass = $this->oModelReflection->GetAttributeProperty($sTargetClass, $sExtKeyAttCode, 'targetclass');
|
||||
@@ -450,13 +464,13 @@ EOF
|
||||
}
|
||||
|
||||
$aForbidenAttType = [
|
||||
'AttributeLinkedSet',
|
||||
'AttributeFriendlyName',
|
||||
AttributeLinkedSet::class,
|
||||
AttributeFriendlyName::class,
|
||||
|
||||
'iAttributeNoGroupBy', //we cannot only use iAttributeNoGroupBy since this method is also used by the designer who do not have access to the classes' PHP reflection API. So the known classes has to be listed altogether
|
||||
'AttributeOneWayPassword',
|
||||
'AttributeEncryptedString',
|
||||
'AttributePassword',
|
||||
iAttributeNoGroupBy::class, //we cannot only use iAttributeNoGroupBy since this method is also used by the designer who do not have access to the classes' PHP reflection API. So the known classes has to be listed altogether
|
||||
AttributeOneWayPassword::class,
|
||||
AttributeEncryptedString::class,
|
||||
AttributePassword::class,
|
||||
];
|
||||
foreach ($aForbidenAttType as $sForbidenAttType) {
|
||||
if (is_a($sAttType, $sForbidenAttType, true)) {
|
||||
@@ -468,7 +482,7 @@ EOF
|
||||
if (!in_array($sLabel, $aGroupBy)) {
|
||||
$aGroupBy[$sAttCode] = $sLabel;
|
||||
|
||||
if (is_a($sAttType, 'AttributeDateTime', true)) {
|
||||
if (is_a($sAttType, AttributeDateTime::class, true)) {
|
||||
$aGroupBy[$sAttCode.':hour'] = Dict::Format('UI:DashletGroupBy:Prop-GroupBy:Select-Hour', $sLabel);
|
||||
$aGroupBy[$sAttCode.':month'] = Dict::Format('UI:DashletGroupBy:Prop-GroupBy:Select-Month', $sLabel);
|
||||
$aGroupBy[$sAttCode.':day_of_week'] = Dict::Format('UI:DashletGroupBy:Prop-GroupBy:Select-DayOfWeek', $sLabel);
|
||||
@@ -1102,7 +1116,7 @@ abstract class DashletGroupBy extends Dashlet
|
||||
$aAttributeTypes = $this->oModelReflection->ListAttributes($this->sClass);
|
||||
if (isset($aAttributeTypes[$this->sGroupByAttCode])) {
|
||||
$sAttributeType = $aAttributeTypes[$this->sGroupByAttCode];
|
||||
if (is_subclass_of($sAttributeType, 'AttributeDateTime') || $sAttributeType == 'AttributeDateTime') {
|
||||
if (is_subclass_of($sAttributeType, AttributeDateTime::class) || $sAttributeType == AttributeDateTime::class) {
|
||||
$this->sOrderDirection = 'asc';
|
||||
} else {
|
||||
$this->sOrderDirection = 'desc';
|
||||
@@ -1258,7 +1272,7 @@ abstract class DashletGroupBy extends Dashlet
|
||||
if ($this->oModelReflection->IsValidAttCode($sClass, $this->sGroupByAttCode)) {
|
||||
$aAttributeTypes = $this->oModelReflection->ListAttributes($sClass);
|
||||
$sAttributeType = $aAttributeTypes[$this->sGroupByAttCode];
|
||||
if (is_subclass_of($sAttributeType, 'AttributeDateTime') || $sAttributeType == 'AttributeDateTime') {
|
||||
if (is_subclass_of($sAttributeType, AttributeDateTime::class) || $sAttributeType == AttributeDateTime::class) {
|
||||
// Note: an alternative to this somewhat hardcoded way of doing things would be to implement...
|
||||
//$oExpr = Expression::FromOQL($this->sGroupByExpr);
|
||||
//$aTranslationData = array($oQuery->GetClassAlias() => array($this->sGroupByAttCode => new ScalarExpression(date('Y-m-d H:i:s', $iTime))));
|
||||
@@ -1289,7 +1303,7 @@ abstract class DashletGroupBy extends Dashlet
|
||||
foreach ($aValues as $sValue) {
|
||||
$aDisplayValues[] = ['label' => $sValue, 'value' => (int)rand(1, 15)];
|
||||
}
|
||||
} elseif (is_subclass_of($sAttributeType, 'AttributeEnum') || $sAttributeType == 'AttributeEnum') {
|
||||
} elseif (is_subclass_of($sAttributeType, AttributeEnum::class) || $sAttributeType == AttributeEnum::class) {
|
||||
$aAllowed = $this->oModelReflection->GetAllowedValues_att($sClass, $this->sGroupByAttCode);
|
||||
if ($aAllowed) { // null for non enums
|
||||
foreach ($aAllowed as $sValue => $sValueLabel) {
|
||||
@@ -1458,11 +1472,11 @@ abstract class DashletGroupBy extends Dashlet
|
||||
}
|
||||
foreach ($this->oModelReflection->ListAttributes($sClass) as $sAttCode => $sAttType) {
|
||||
switch ($sAttType) {
|
||||
case 'AttributeDecimal':
|
||||
case 'AttributeDuration':
|
||||
case 'AttributeInteger':
|
||||
case 'AttributePercentage':
|
||||
case 'AttributeSubItem': // TODO: Known limitation: no unit displayed (values in sec)
|
||||
case AttributeDecimal::class:
|
||||
case AttributeDuration::class:
|
||||
case AttributeInteger::class:
|
||||
case AttributePercentage::class:
|
||||
case AttributeSubItem::class: // TODO: Known limitation: no unit displayed (values in sec)
|
||||
$sLabel = $this->oModelReflection->GetLabel($sClass, $sAttCode);
|
||||
$aFunctionAttributes[$sAttCode] = $sLabel;
|
||||
break;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://www.combodo.com/itop-schema/3.3"
|
||||
version="3.3">
|
||||
version="3.4">
|
||||
<classes>
|
||||
<class id="AbstractResource" _delta="define">
|
||||
<parent>cmdbAbstractObject</parent>
|
||||
|
||||
@@ -1707,7 +1707,7 @@ JS
|
||||
$oBlock->bAdvancedMode = utils::ReadParam('advanced', false);
|
||||
|
||||
$oBlock->sCsvFile = strtolower($this->m_oFilter->GetClass()).'.csv';
|
||||
$oBlock->sDownloadLink = utils::GetAbsoluteUrlAppRoot().'webservices/export.php?expression='.urlencode($this->m_oFilter->ToOQL(true)).'&format=csv&filename='.urlencode($oBlock->sCsvFile);
|
||||
$oBlock->sDownloadLink = utils::GetAbsoluteUrlAppRoot().'webservices/export-v2.php?expression='.urlencode($this->m_oFilter->ToOQL(true)).'&format=csv&filename='.urlencode($oBlock->sCsvFile);
|
||||
$oBlock->sLinkToToggle = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=search'.$oAppContext->GetForLink(true).'&filter='.rawurlencode($this->m_oFilter->serialize()).'&format=csv';
|
||||
// Pass the parameters via POST, since expression may be very long
|
||||
$aParamsToPost = [
|
||||
@@ -1724,7 +1724,7 @@ JS
|
||||
$oBlock->sLinkToToggle = $oBlock->sLinkToToggle.'&advanced=1';
|
||||
$oBlock->sChecked = '';
|
||||
}
|
||||
$oBlock->sAjaxLink = utils::GetAbsoluteUrlAppRoot().'webservices/export.php';
|
||||
$oBlock->sAjaxLink = utils::GetAbsoluteUrlAppRoot().'webservices/export-v2.php';
|
||||
|
||||
$oBlock->sCharsetNotice = false;
|
||||
$oBlock->sJsonParams = json_encode($aParamsToPost);
|
||||
@@ -2034,17 +2034,8 @@ class MenuBlock extends DisplayBlock
|
||||
$aAllowedProfiles = MetaModel::GetConfig()->Get('concurrent_lock_override_profiles');
|
||||
$bCanKill = false;
|
||||
|
||||
$oUser = UserRights::GetUserObject();
|
||||
$aUserProfiles = [];
|
||||
if (!is_null($oUser)) {
|
||||
$oProfileSet = $oUser->Get('profile_list');
|
||||
while ($oProfile = $oProfileSet->Fetch()) {
|
||||
$aUserProfiles[$oProfile->Get('profile')] = true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($aAllowedProfiles as $sProfile) {
|
||||
if (array_key_exists($sProfile, $aUserProfiles)) {
|
||||
if (UserRights::HasProfile($sProfile)) {
|
||||
$bCanKill = true;
|
||||
break;
|
||||
}
|
||||
@@ -2292,6 +2283,17 @@ class MenuBlock extends DisplayBlock
|
||||
}
|
||||
// ResourceId should not be sanitized
|
||||
$oActionButton->AddDataAttribute('resource-id', $sActionId);
|
||||
if (isset($aAction['data_attributes']) && is_array($aAction['data_attributes'])) {
|
||||
foreach ($aAction['data_attributes'] as $sName => $sValue) {
|
||||
$sDataAttributeName = $sName;
|
||||
$oActionButton->AddDataAttribute($sDataAttributeName, (string) $sValue);
|
||||
}
|
||||
}
|
||||
if (isset($aAction['aria_attributes']) && is_array($aAction['aria_attributes'])) {
|
||||
foreach ($aAction['aria_attributes'] as $sName => $sValue) {
|
||||
$oActionButton->AddAriaAttribute((string) $sName, (string) $sValue);
|
||||
}
|
||||
}
|
||||
$oActionButton->AddCSSClasses(['ibo-action-button', 'ibo-regular-action-button']);
|
||||
if (empty($sLabel)) {
|
||||
if (empty($aAction['tooltip'])) {
|
||||
|
||||
@@ -220,10 +220,19 @@ class DesignerForm
|
||||
$sValidationFields = '</td><td class="prop_icon prop_apply ibo-prop--apply" >'.$sValidation.'</td><td class="prop_icon prop_cancel ibo-prop--cancel"><span><div class="ibo-button ibo-is-alternative ibo-is-neutral" data-tooltip-content="'.Dict::Format('UI:DashboardEdit:Revert').'"><i class="fas fa-undo"></i></div></span></td>'
|
||||
.$this->EndRow();
|
||||
|
||||
$aPropertyFieldData = [
|
||||
'code' => $oField->GetCode(),
|
||||
'type' => $oField->GetInputType(),
|
||||
'label' => $aRow['label'],
|
||||
'raw-value' => $oField->GetRawValue(),
|
||||
];
|
||||
if (is_null($aRow['label'])) {
|
||||
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_value" colspan="2">'.$aRow['value'];
|
||||
$sReturn .= $this->StartRow($sFieldId, $aPropertyFieldData).
|
||||
'<td class="prop_value" data-role="ibo-property-field-value" colspan="2">'.$aRow['value'];
|
||||
} else {
|
||||
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_label">'.$aRow['label'].'</td><td class="prop_value">'.$aRow['value'];
|
||||
$sReturn .= $this->StartRow($sFieldId, $aPropertyFieldData).
|
||||
'<td class="prop_label" data-role="ibo-property-field-label">'.$aRow['label'].
|
||||
'</td><td class="prop_value" data-role="ibo-property-field-value">'.$aRow['value'];
|
||||
}
|
||||
if (!($oField instanceof DesignerFormSelectorField) && !($oField instanceof DesignerMultipleSubFormField)) {
|
||||
$sReturn .= $sValidationFields;
|
||||
@@ -294,12 +303,21 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
public function StartRow($sFieldId = null)
|
||||
public function StartRow($sFieldId = null, $aPropertyFieldData = [])
|
||||
{
|
||||
if ($sFieldId != null) {
|
||||
return '<tr id="row_'.$sFieldId.'" data-path="'.$this->GetHierarchyPath().'" data-selector="'.$this->GetHierarchyParent().'">';
|
||||
$sPropertyFieldAttributes = '';
|
||||
foreach ($aPropertyFieldData as $sAttribute => $value) {
|
||||
if (is_array($value)) {
|
||||
$value = json_encode($value);
|
||||
} elseif (is_null($value)) {
|
||||
$value = '';
|
||||
}
|
||||
$sPropertyFieldAttributes .= ' data-property-field-'.$sAttribute.'="'.utils::EscapeHtml((string)$value).'"';
|
||||
}
|
||||
return '<tr data-path="'.$this->GetHierarchyPath().'" data-selector="'.$this->GetHierarchyParent().'">';
|
||||
if ($sFieldId != null) {
|
||||
return '<tr id="row_'.$sFieldId.'" data-path="'.$this->GetHierarchyPath().'" data-selector="'.$this->GetHierarchyParent().'"'.$sPropertyFieldAttributes.'>';
|
||||
}
|
||||
return '<tr data-path="'.$this->GetHierarchyPath().'" data-selector="'.$this->GetHierarchyParent().'"'.$sPropertyFieldAttributes.'>';
|
||||
}
|
||||
|
||||
public function EndRow()
|
||||
@@ -679,6 +697,14 @@ class DesignerFormField
|
||||
return $this->sCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function GetRawValue()
|
||||
{
|
||||
return $this->defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DesignerForm $oForm
|
||||
*/
|
||||
@@ -1202,7 +1228,6 @@ class DesignerComboField extends DesignerFormField
|
||||
{
|
||||
$sId = $this->oForm->GetFieldId($this->sCode);
|
||||
$sName = $this->oForm->GetFieldName($this->sCode);
|
||||
$sChecked = $this->defaultValue ? 'checked' : '';
|
||||
$sMandatory = $this->bMandatory ? 'true' : 'false';
|
||||
$sReadOnly = $this->IsReadOnly() ? 'disabled="disabled"' : '';
|
||||
if ($this->IsSorted()) {
|
||||
@@ -1245,8 +1270,7 @@ class DesignerComboField extends DesignerFormField
|
||||
} else {
|
||||
$sSelected = ($sKey == $this->defaultValue) ? 'selected' : '';
|
||||
}
|
||||
// Quick and dirty: display the menu parents as a tree
|
||||
$sHtmlValue = str_replace(' ', ' ', $sDisplayValue);
|
||||
$sHtmlValue = $this->PrepareValueForRendering($sDisplayValue);
|
||||
$sHtml .= "<option value=\"".utils::EscapeHtml($sKey)."\" $sSelected>$sHtmlValue</option>";
|
||||
}
|
||||
$sHtml .= "</select></span>";
|
||||
@@ -1263,6 +1287,14 @@ EOF
|
||||
|
||||
}
|
||||
|
||||
protected function PrepareValueForRendering($sValue = null): ?string
|
||||
{
|
||||
if (is_null($sValue)) {
|
||||
$sValue = $this->defaultValue;
|
||||
}
|
||||
return $sValue;
|
||||
}
|
||||
|
||||
public function ReadParam(&$aValues)
|
||||
{
|
||||
parent::ReadParam($aValues);
|
||||
@@ -1629,6 +1661,11 @@ class DesignerFormSelectorField extends DesignerFormField
|
||||
return 'selector_property_field';
|
||||
}
|
||||
|
||||
public function GetRawValue()
|
||||
{
|
||||
return $this->defaultRealValue;
|
||||
}
|
||||
|
||||
public function AddSubForm($oSubForm, $sLabel, $sValue)
|
||||
{
|
||||
$this->aSubForms[] = ['form' => $oSubForm, 'label' => $sLabel, 'value' => $sValue];
|
||||
|
||||
@@ -5,7 +5,7 @@ use Combodo\iTop\Application\Helper\Session;
|
||||
/**
|
||||
* Class LoginBasic
|
||||
*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @copyright Copyright (C) 2010-2026 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
@@ -24,11 +24,7 @@ class LoginBasic extends AbstractLoginFSMExtension
|
||||
protected function OnModeDetection(&$iErrorCode)
|
||||
{
|
||||
if (!Session::IsSet('login_mode')) {
|
||||
if (isset($_SERVER['HTTP_AUTHORIZATION']) && !empty($_SERVER['HTTP_AUTHORIZATION'])) {
|
||||
Session::Set('login_mode', 'basic');
|
||||
} elseif (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && !empty($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
|
||||
Session::Set('login_mode', 'basic');
|
||||
} elseif (isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
if (!is_null($this->GetAuthUserAndPassword())) {
|
||||
Session::Set('login_mode', 'basic');
|
||||
}
|
||||
}
|
||||
@@ -86,38 +82,49 @@ class LoginBasic extends AbstractLoginFSMExtension
|
||||
return LoginWebPage::LOGIN_FSM_CONTINUE;
|
||||
}
|
||||
|
||||
private function GetAuthUserAndPassword()
|
||||
/**
|
||||
* @return array|null [$sAuthUser, $sAuthPwd]
|
||||
*/
|
||||
private function GetAuthUserAndPassword(): ?array
|
||||
{
|
||||
$sAuthUser = '';
|
||||
$sAuthPwd = null;
|
||||
$sAuthorization = '';
|
||||
if (isset($_SERVER['HTTP_AUTHORIZATION']) && !empty($_SERVER['HTTP_AUTHORIZATION'])) {
|
||||
$sAuthorization = $_SERVER['HTTP_AUTHORIZATION'];
|
||||
} elseif (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && !empty($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
|
||||
$sAuthorization = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
|
||||
} elseif (isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
$sAuthUser = $_SERVER['PHP_AUTH_USER'];
|
||||
// Unfortunately, the RFC is not clear about the encoding...
|
||||
// IE and FF supply the user and password encoded in ISO-8859-1 whereas Chrome provides them encoded in UTF-8
|
||||
// So let's try to guess if it's an UTF-8 string or not... fortunately all encodings share the same ASCII base
|
||||
if (!LoginWebPage::LooksLikeUTF8($sAuthUser)) {
|
||||
// Does not look like and UTF-8 string, try to convert it from iso-8859-1 to UTF-8
|
||||
// Supposed to be harmless in case of a plain ASCII string...
|
||||
$sAuthUser = iconv('iso-8859-1', 'utf-8', $sAuthUser);
|
||||
}
|
||||
$sAuthPwd = $_SERVER['PHP_AUTH_PW'];
|
||||
if (!LoginWebPage::LooksLikeUTF8($sAuthPwd)) {
|
||||
// Does not look like and UTF-8 string, try to convert it from iso-8859-1 to UTF-8
|
||||
// Supposed to be harmless in case of a plain ASCII string...
|
||||
$sAuthPwd = iconv('iso-8859-1', 'utf-8', $sAuthPwd);
|
||||
}
|
||||
|
||||
return [$sAuthUser, $sAuthPwd];
|
||||
}
|
||||
|
||||
if (!empty($sAuthorization)) {
|
||||
list($sAuthUser, $sAuthPwd) = explode(':', base64_decode(substr($sAuthorization, 6)));
|
||||
} else {
|
||||
if (isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
$sAuthUser = $_SERVER['PHP_AUTH_USER'];
|
||||
// Unfortunately, the RFC is not clear about the encoding...
|
||||
// IE and FF supply the user and password encoded in ISO-8859-1 whereas Chrome provides them encoded in UTF-8
|
||||
// So let's try to guess if it's an UTF-8 string or not... fortunately all encodings share the same ASCII base
|
||||
if (!LoginWebPage::LooksLikeUTF8($sAuthUser)) {
|
||||
// Does not look like and UTF-8 string, try to convert it from iso-8859-1 to UTF-8
|
||||
// Supposed to be harmless in case of a plain ASCII string...
|
||||
$sAuthUser = iconv('iso-8859-1', 'utf-8', $sAuthUser);
|
||||
}
|
||||
$sAuthPwd = $_SERVER['PHP_AUTH_PW'];
|
||||
if (!LoginWebPage::LooksLikeUTF8($sAuthPwd)) {
|
||||
// Does not look like and UTF-8 string, try to convert it from iso-8859-1 to UTF-8
|
||||
// Supposed to be harmless in case of a plain ASCII string...
|
||||
$sAuthPwd = iconv('iso-8859-1', 'utf-8', $sAuthPwd);
|
||||
}
|
||||
}
|
||||
if (empty($sAuthorization)) {
|
||||
return null;
|
||||
}
|
||||
return [$sAuthUser, $sAuthPwd];
|
||||
|
||||
// Decode without Bearer
|
||||
if (strncasecmp($sAuthorization, 'Basic ', 6) !== 0) {
|
||||
return null;
|
||||
}
|
||||
$sDecodedAuthorisation = base64_decode(substr($sAuthorization, 6));
|
||||
if (str_contains($sDecodedAuthorisation, ':')) {
|
||||
return explode(':', $sDecodedAuthorisation);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
*/
|
||||
|
||||
use Combodo\iTop\Application\Branding;
|
||||
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\EventService;
|
||||
use Combodo\iTop\Service\Session\Session;
|
||||
|
||||
/**
|
||||
* Web page used for displaying the login form
|
||||
@@ -369,16 +369,7 @@ class LoginWebPage extends NiceWebPage
|
||||
public static function ResetSession()
|
||||
{
|
||||
// Unset all of the session variables.
|
||||
Session::Unset('auth_user');
|
||||
Session::Unset('login_state');
|
||||
Session::Unset('can_logoff');
|
||||
Session::Unset('archive_mode');
|
||||
Session::Unset('impersonate_user');
|
||||
Session::Unset('PluginProperties');
|
||||
Session::Unset('UrlMakerClass');
|
||||
Session::Unset('itop_env');
|
||||
Session::Unset('obj_messages');
|
||||
Session::Unset('profile_list');
|
||||
Session::UnsetAll();
|
||||
UserRights::_ResetSessionCache();
|
||||
// If it's desired to kill the session, also delete the session cookie.
|
||||
// Note: This will destroy the session, and not just the session data!
|
||||
|
||||
@@ -109,10 +109,18 @@ $('#shortcut_rename_dlg').dialog({
|
||||
modal: true,
|
||||
title: '$sDialogTitle',
|
||||
buttons: [
|
||||
{ text: "$sOkButtonLabel", click: ShortcutRenameOK},
|
||||
{ text: "$sCancelButtonLabel", click: function() {
|
||||
$(this).dialog( "close" ); $(this).remove();
|
||||
} },
|
||||
{
|
||||
text: "$sCancelButtonLabel",
|
||||
click: function() {
|
||||
$(this).dialog( "close" ); $(this).remove();
|
||||
},
|
||||
'class': 'ibo-button ibo-is-alternative ibo-is-neutral action cancel'
|
||||
},
|
||||
{
|
||||
text: "$sOkButtonLabel",
|
||||
click: ShortcutRenameOK,
|
||||
'class': 'ibo-is-regular ibo-is-primary'
|
||||
},
|
||||
],
|
||||
close: function() { $(this).remove(); }
|
||||
});
|
||||
|
||||
@@ -115,7 +115,7 @@ class privUITransactionSession
|
||||
// Strictly speaking, the two lines below should be grouped together
|
||||
// by a critical section
|
||||
// sem_acquire($rSemIdentified);
|
||||
$id = static::GetUserPrefix().str_replace(['.', ' '], '', microtime());
|
||||
$id = static::GetUserPrefix().str_replace(['.', ' '], '', microtime()).'-'.bin2hex(random_bytes(24));
|
||||
Session::Set(['transactions', $id], true);
|
||||
// sem_release($rSemIdentified);
|
||||
|
||||
@@ -236,7 +236,7 @@ class privUITransactionFile
|
||||
|
||||
self::CleanupOldTransactions();
|
||||
|
||||
$sTransactionIdFullPath = tempnam(utils::GetDataPath().'transactions', static::GetUserPrefix());
|
||||
$sTransactionIdFullPath = static::CreateUniqueTransactionFilePath(utils::GetDataPath().'transactions', static::GetUserPrefix());
|
||||
file_put_contents($sTransactionIdFullPath, $iCurrentUserId, LOCK_EX);
|
||||
|
||||
$sTransactionIdFileName = basename($sTransactionIdFullPath);
|
||||
@@ -245,6 +245,33 @@ class privUITransactionFile
|
||||
return $sTransactionIdFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a transaction file path with a longer random suffix and create it atomically.
|
||||
*
|
||||
* @param string $sDir
|
||||
* @param string $sPrefix
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws CoreException
|
||||
*/
|
||||
private static function CreateUniqueTransactionFilePath(string $sDir, string $sPrefix): string
|
||||
{
|
||||
$iMaxAttempts = 10;
|
||||
for ($i = 0; $i < $iMaxAttempts; $i++) {
|
||||
$sFileName = $sPrefix.bin2hex(random_bytes(24)); // 48 random hex chars
|
||||
$sFullPath = $sDir.'/'.$sFileName;
|
||||
|
||||
$hFile = @fopen($sFullPath, 'x');
|
||||
if ($hFile !== false) {
|
||||
fclose($hFile);
|
||||
return $sFullPath;
|
||||
}
|
||||
}
|
||||
|
||||
throw new CoreException('Failed to allocate a unique transaction file name after multiple attempts.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a transaction is valid or not and (optionally) remove the valid transaction from
|
||||
* the session so that another call to IsTransactionValid for the same transaction id
|
||||
@@ -281,6 +308,18 @@ class privUITransactionFile
|
||||
return false;
|
||||
}
|
||||
|
||||
$iTime = filemtime($sFilepath);
|
||||
$iLifetime = (int) MetaModel::GetConfig()->Get('transactions_file_lifetime');
|
||||
$iLimit = time() - $iLifetime;
|
||||
if ($iTime < $iLimit) {
|
||||
self::Info("IsTransactionValid: Transaction '$id' expired.");
|
||||
if ($iLifetime < 3600) {
|
||||
IssueLog::Warning("IsTransactionValid: Transaction '$id' expired after only $iLifetime seconds. Consider increasing the 'transactions_file_lifetime' configuration parameter.");
|
||||
}
|
||||
@unlink($sFilepath);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($bRemoveTransaction) {
|
||||
$bResult = @unlink($sFilepath);
|
||||
if (!$bResult) {
|
||||
@@ -314,7 +353,7 @@ class privUITransactionFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup old transactions which have been pending since more than 24 hours
|
||||
* Cleanup old transactions which have been pending since more than the lifetime defined in the configuration parameter 'transactions_file_lifetime'.
|
||||
* Use filemtime instead of filectime since filectime may be affected by operations on the directory (like changing the access rights)
|
||||
*/
|
||||
protected static function CleanupOldTransactions($sTransactionDir = null)
|
||||
@@ -327,7 +366,7 @@ class privUITransactionFile
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
$iLimit = time() - 24 * 3600;
|
||||
$iLimit = time() - (int) MetaModel::GetConfig()->Get('transactions_file_lifetime');
|
||||
$sPattern = $sTransactionDir ? "$sTransactionDir/*" : utils::GetDataPath().'transactions/*';
|
||||
$aTransactions = glob($sPattern);
|
||||
foreach ($aTransactions as $sFileName) {
|
||||
|
||||
@@ -1313,8 +1313,8 @@ class utils
|
||||
}
|
||||
|
||||
if (is_null($sAuthUser)) {
|
||||
$sAuthUser = self::ReadParam('auth_user', '', 'raw_data');
|
||||
$sAuthPwd = self::ReadParam('auth_pwd', '', 'raw_data');
|
||||
$sAuthUser = self::ReadParam('auth_user', '', true, 'raw_data');
|
||||
$sAuthPwd = self::ReadParam('auth_pwd', '', true, 'raw_data');
|
||||
}
|
||||
$sParamFile = self::GetParamSourceFile('auth_user');
|
||||
if (is_null($sParamFile)) {
|
||||
@@ -1833,10 +1833,15 @@ SQL;
|
||||
/**
|
||||
* Some characters cause troubles with jQuery when used inside DOM IDs, so let's replace them by the safe _ (underscore)
|
||||
* @param string $sId The ID to sanitize
|
||||
* @param bool $bForSelector Whether to apply strict CSS/jQuery selector-safe sanitization
|
||||
* @return string The sanitized ID
|
||||
*/
|
||||
public static function GetSafeId($sId)
|
||||
public static function GetSafeId($sId, bool $bForSelector = false)
|
||||
{
|
||||
if ($bForSelector) {
|
||||
return preg_replace('/[^a-zA-Z0-9_]/', '_', $sId);
|
||||
}
|
||||
|
||||
return str_replace([':', '[', ']', '+', '-', ' '], '_', $sId);
|
||||
}
|
||||
|
||||
@@ -1881,12 +1886,15 @@ SQL;
|
||||
$aHTTPHeaders[] = trim($sHeaderString);
|
||||
}
|
||||
// Default options, can be overloaded/extended with the 4th parameter of this method, see above $aCurlOptions
|
||||
$iCurlAllowedProtocols = self::ConvertProtocolsToCurlOption(
|
||||
self::GetConfig()->Get('security.post_requests.allowed_protocols')
|
||||
);
|
||||
$aOptions = [
|
||||
CURLOPT_RETURNTRANSFER => true, // return the content of the request
|
||||
CURLOPT_HEADER => false, // don't return the headers in the output
|
||||
CURLOPT_FOLLOWLOCATION => true, // follow redirects
|
||||
CURLOPT_ENCODING => "", // handle all encodings
|
||||
CURLOPT_USERAGENT => "spider", // who am i
|
||||
CURLOPT_USERAGENT => static::GetConfig()->Get('http.request.user_agent'), // who am i
|
||||
CURLOPT_AUTOREFERER => true, // set referer on redirect
|
||||
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
|
||||
CURLOPT_TIMEOUT => 120, // timeout on response
|
||||
@@ -1903,6 +1911,9 @@ SQL;
|
||||
$aAllOptions = $aCurlOptions + $aOptions;
|
||||
$ch = curl_init($sUrl);
|
||||
curl_setopt_array($ch, $aAllOptions);
|
||||
if (!curl_setopt($ch, CURLOPT_PROTOCOLS, $iCurlAllowedProtocols)) {
|
||||
throw new Exception('Unable to enforce allowed protocols for cURL request');
|
||||
}
|
||||
$response = curl_exec($ch);
|
||||
$iErr = curl_errno($ch);
|
||||
$sErrMsg = curl_error($ch);
|
||||
@@ -1924,6 +1935,40 @@ SQL;
|
||||
return $response;
|
||||
}
|
||||
|
||||
private static function ConvertProtocolsToCurlOption(string $sProtocols): int
|
||||
{
|
||||
$aProtocols = explode(',', $sProtocols);
|
||||
|
||||
$iCurlProtocols = 0;
|
||||
foreach ($aProtocols as $sProtocol) {
|
||||
$iCurlProtocols |= match (strtolower(trim($sProtocol))) {
|
||||
'dict' => defined('CURLPROTO_DICT') ? CURLPROTO_DICT : 0,
|
||||
'file' => defined('CURLPROTO_FILE') ? CURLPROTO_FILE : 0,
|
||||
'ftp' => defined('CURLPROTO_FTP') ? CURLPROTO_FTP : 0,
|
||||
'ftps' => defined('CURLPROTO_FTPS') ? CURLPROTO_FTPS : 0,
|
||||
'gopher' => defined('CURLPROTO_GOPHER') ? CURLPROTO_GOPHER : 0,
|
||||
'http' => defined('CURLPROTO_HTTP') ? CURLPROTO_HTTP : 0,
|
||||
'https' => defined('CURLPROTO_HTTPS') ? CURLPROTO_HTTPS : 0,
|
||||
'imap' => defined('CURLPROTO_IMAP') ? CURLPROTO_IMAP : 0,
|
||||
'imaps' => defined('CURLPROTO_IMAPS') ? CURLPROTO_IMAPS : 0,
|
||||
'ldap' => defined('CURLPROTO_LDAP') ? CURLPROTO_LDAP : 0,
|
||||
'ldaps' => defined('CURLPROTO_LDAPS') ? CURLPROTO_LDAPS : 0,
|
||||
'mqtt' => defined('CURLPROTO_MQTT') ? CURLPROTO_MQTT : 0,
|
||||
'pop3' => defined('CURLPROTO_POP3') ? CURLPROTO_POP3 : 0,
|
||||
'pop3s' => defined('CURLPROTO_POP3S') ? CURLPROTO_POP3S : 0,
|
||||
'rtsp' => defined('CURLPROTO_RTSP') ? CURLPROTO_RTSP : 0,
|
||||
'scp' => defined('CURLPROTO_SCP') ? CURLPROTO_SCP : 0,
|
||||
'sftp' => defined('CURLPROTO_SFTP') ? CURLPROTO_SFTP : 0,
|
||||
'smtp' => defined('CURLPROTO_SMTP') ? CURLPROTO_SMTP : 0,
|
||||
'smtps' => defined('CURLPROTO_SMTPS') ? CURLPROTO_SMTPS : 0,
|
||||
'telnet' => defined('CURLPROTO_TELNET') ? CURLPROTO_TELNET : 0,
|
||||
'tftp' => defined('CURLPROTO_TFTP') ? CURLPROTO_TFTP : 0,
|
||||
default => throw new Exception("Unsupported protocol: $sProtocol"),
|
||||
};
|
||||
}
|
||||
return $iCurlProtocols;
|
||||
}
|
||||
|
||||
public static function QuoteForPHP(string $sValue): string
|
||||
{
|
||||
$sEscaped = str_replace(['\\', "'"], ['\\\\', "\\'"], $sValue);
|
||||
@@ -3022,7 +3067,6 @@ TXT
|
||||
* Note: Only works for backoffice URLs for now
|
||||
*
|
||||
* @param string $sText Text containing the mentioned objects to be found
|
||||
* @param string $sFormat {@uses static::ENUM_TEXT_FORMAT_HTML, ...}
|
||||
*
|
||||
* @return array Array of object classes / IDs for the ones found in $sText
|
||||
*
|
||||
@@ -3037,13 +3081,45 @@ TXT
|
||||
public static function GetMentionedObjectsFromText(string $sText): array
|
||||
{
|
||||
$aMentionedObjects = [];
|
||||
$aMentionMatches = [];
|
||||
$sText = html_entity_decode($sText);
|
||||
$aMentionAllowedClasses = MetaModel::GetConfig()->Get('mentions.allowed_classes');
|
||||
$oDom = new \DOMDocument();
|
||||
$bPreviousUseInternalErrors = libxml_use_internal_errors(true); // to keep processing even in case of "invalid" HTML, cf. testGetMentionedObjectsFromText
|
||||
|
||||
preg_match_all('/<a\s*([^>]*)data-object-class="([^"]*)"\s.*data-object-key="([^"]*)"/Ui', $sText, $aMentionMatches);
|
||||
foreach ($aMentionMatches[0] as $iMatchIdx => $sCompleteMatch) {
|
||||
$sMatchedClass = $aMentionMatches[2][$iMatchIdx];
|
||||
$sMatchedId = $aMentionMatches[3][$iMatchIdx];
|
||||
try {
|
||||
$oDom->loadHTML('<?xml encoding="UTF-8">'.$sText);
|
||||
} finally {
|
||||
libxml_clear_errors();
|
||||
libxml_use_internal_errors($bPreviousUseInternalErrors);
|
||||
}
|
||||
$oXpath = new \DOMXPath($oDom);
|
||||
$oNodes = $oXpath->query('//a[@data-object-class and @data-object-key]');
|
||||
|
||||
foreach ($oNodes as $oObjNode) {
|
||||
$sMatchedClass = $oObjNode->getAttribute('data-object-class');
|
||||
$sMatchedId = $oObjNode->getAttribute('data-object-key');
|
||||
$sMatchedName = trim($oObjNode->textContent);
|
||||
|
||||
// Ensure that what we found is actually configured as a mention
|
||||
$sMentionPrefix = array_search($sMatchedClass, $aMentionAllowedClasses);
|
||||
// - No direct configuration for the matched class, let's look for a configuration on parent classes
|
||||
if (false === $sMentionPrefix) {
|
||||
$bHasMentionConfigurationForParentClass = false;
|
||||
foreach (MetaModel::EnumParentClasses($sMatchedClass, ENUM_PARENT_CLASSES_EXCLUDELEAF, false) as $aMatchedParentClass) {
|
||||
$sMentionPrefix = array_search($aMatchedParentClass, $aMentionAllowedClasses);
|
||||
if (false !== $sMentionPrefix) {
|
||||
$bHasMentionConfigurationForParentClass = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (false === $bHasMentionConfigurationForParentClass) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// - Test if the name starts with $sMentionPrefix (e.g. '@' for 'Contact' class)
|
||||
if (false === str_starts_with($sMatchedName, $sMentionPrefix)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Prepare array for matched class if not already present
|
||||
if (!array_key_exists($sMatchedClass, $aMentionedObjects)) {
|
||||
@@ -3218,4 +3294,48 @@ TXT
|
||||
return (int)$sLimit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0 N°9875
|
||||
* Open archive and raise appropriate exception.
|
||||
* Warning: do not forget to close archive afterwhile
|
||||
* @param string $sArchiveFilePath
|
||||
* @param int|null $flags
|
||||
* @return ZipArchive
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function ZipArchiveOpen(string $sArchiveFilePath, int|null $flags = null): ZipArchive
|
||||
{
|
||||
$oZip = new ZipArchive();
|
||||
if (is_null($flags)) {
|
||||
$code = $oZip->open($sArchiveFilePath);
|
||||
} else {
|
||||
$code = $oZip->open($sArchiveFilePath, $flags);
|
||||
}
|
||||
if (true !== $code) {
|
||||
//ZipArchive::ZIP_ER_NOZIP : 19
|
||||
if ($code === 19) {
|
||||
throw new \Exception(sprintf('Cannot open zip file due to inconsistent or empty content'));
|
||||
}
|
||||
|
||||
throw new \Exception(sprintf('Cannot open zip file due to error code %s', $code));
|
||||
}
|
||||
return $oZip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0 N°9875
|
||||
* @param string $sDirectory
|
||||
* @param string $sPrefix
|
||||
* @return ZipArchive
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function ZipArchiveCreateWithTempNam(string $sDirectory, string $sPrefix): ZipArchive
|
||||
{
|
||||
$sTempnam = tempnam($sDirectory, $sPrefix);
|
||||
unlink($sTempnam);
|
||||
$sArchiveName = $sTempnam.'.zip';
|
||||
|
||||
return self::ZipArchiveOpen($sArchiveName, ZipArchive::CREATE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,10 +35,14 @@ class WizardHelper
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the PHP target object from the parameters sent to the web page by the wizard
|
||||
*
|
||||
* @param boolean $bReadUploadedFiles True to also read any uploaded file (for blob/document fields)
|
||||
*
|
||||
* @return object
|
||||
* @throws CoreException
|
||||
*/
|
||||
public function GetTargetObject($bReadUploadedFiles = false)
|
||||
{
|
||||
@@ -57,7 +61,14 @@ class WizardHelper
|
||||
// assumes this is handled as an array of objects
|
||||
// thus encoded in json like: [ { name:'link1', 'id': 123}, { name:'link2', 'id': 124}...]
|
||||
if (!is_array($value)) {
|
||||
$aData = json_decode($value, true); // true means decode as a hash array (not an object)
|
||||
try {
|
||||
$aData = json_decode($value, associative: true, flags: JSON_THROW_ON_ERROR); // true means decode as a hash array (not an object)
|
||||
} catch (JsonException $e) {
|
||||
throw new CoreException('WizardHelper GetTargetObject: invalid data for linked set attribute '.$sAttCode.' of class '.$this->m_aData['m_sClass'], [
|
||||
'att_code' => $sAttCode,
|
||||
'linked_class' => $this->m_aData['m_sClass'],
|
||||
], 'Invalid JSON data', $e);
|
||||
}
|
||||
} else {
|
||||
$aData = $value;
|
||||
}
|
||||
@@ -66,9 +77,6 @@ class WizardHelper
|
||||
$aFields = $this->GetLinkedWizardStructure($oAttDef);
|
||||
$sLinkedClass = $oAttDef->GetLinkedClass();
|
||||
$aLinkedObjectsArray = [];
|
||||
if (!is_array($aData)) {
|
||||
echo("aData: '$aData' (value: '$value')\n");
|
||||
}
|
||||
foreach ($aData as $aLinkedObject) {
|
||||
$oLinkedObj = MetaModel::NewObject($sLinkedClass);
|
||||
foreach ($aFields as $sLinkedAttCode) {
|
||||
|
||||
@@ -11,7 +11,7 @@ define('APPCONF', APPROOT.'conf/');
|
||||
*
|
||||
* @see ITOP_CORE_VERSION to get full iTop core version
|
||||
*/
|
||||
define('ITOP_DESIGN_LATEST_VERSION', '3.3');
|
||||
define('ITOP_DESIGN_LATEST_VERSION', '3.4');
|
||||
|
||||
/**
|
||||
* Constant containing the iTop core version, whatever application was built
|
||||
@@ -23,7 +23,7 @@ define('ITOP_DESIGN_LATEST_VERSION', '3.3');
|
||||
* @used-by utils::GetItopVersionWikiSyntax()
|
||||
* @used-by iTopModulesPhpVersionIntegrationTest
|
||||
*/
|
||||
define('ITOP_CORE_VERSION', '3.3.0');
|
||||
define('ITOP_CORE_VERSION', '3.4.0');
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
||||
@@ -704,14 +704,14 @@ class ActionEmail extends ActionNotification
|
||||
$aMessageContent['cc'] = $this->FindRecipients('cc', $aContextArgs);
|
||||
$aMessageContent['bcc'] = $this->FindRecipients('bcc', $aContextArgs);
|
||||
|
||||
$aMessageContent['from'] = MetaModel::ApplyParams($this->Get('from'), $aContextArgs);
|
||||
$aMessageContent['from_label'] = MetaModel::ApplyParams($this->Get('from_label'), $aContextArgs);
|
||||
$aMessageContent['reply_to'] = MetaModel::ApplyParams($this->Get('reply_to'), $aContextArgs);
|
||||
$aMessageContent['reply_to_label'] = MetaModel::ApplyParams($this->Get('reply_to_label'), $aContextArgs);
|
||||
$aMessageContent['from'] = MetaModel::ApplyParams($this->Get('from'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$aMessageContent['from_label'] = MetaModel::ApplyParams($this->Get('from_label'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$aMessageContent['reply_to'] = MetaModel::ApplyParams($this->Get('reply_to'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$aMessageContent['reply_to_label'] = MetaModel::ApplyParams($this->Get('reply_to_label'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
|
||||
$aMessageContent['subject'] = MetaModel::ApplyParams($this->Get('subject'), $aContextArgs);
|
||||
$sBody = $this->BuildMessageBody(false);
|
||||
$aMessageContent['body'] = MetaModel::ApplyParams($sBody, $aContextArgs);
|
||||
$aMessageContent['subject'] = MetaModel::ApplyParams($this->Get('subject'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$sBody = MetaModel::ApplyParams($this->Get('body'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_HTML);
|
||||
$aMessageContent['body'] = $this->BuildMessageBody(false, $sBody);
|
||||
|
||||
$oObj = $aContextArgs['this->object()'];
|
||||
$aMessageContent['message_id'] = $this->GenerateIdentifierForHeaders($oObj, static::ENUM_HEADER_NAME_MESSAGE_ID);
|
||||
@@ -832,14 +832,16 @@ class ActionEmail extends ActionNotification
|
||||
* Compose the body of the message from the 'body' attribute and the HTML template (if any)
|
||||
* @since 3.1.0 N°4849
|
||||
* @param bool $bHighlightPlaceholders If true add some extra HTML around placeholders to highlight them
|
||||
* @param string|null $sBody The body of the message to be wrapped in the HTML template (if any). If null, the 'body' attribute will be used. @since 3.2.4 N°9436
|
||||
* @return string
|
||||
*/
|
||||
protected function BuildMessageBody(bool $bHighlightPlaceholders = false): string
|
||||
protected function BuildMessageBody(bool $bHighlightPlaceholders = false, ?string $sBody = null): string
|
||||
{
|
||||
$sBody = $sBody ?? $this->Get('body');
|
||||
// Wrap content with a specific class in order to apply styles of HTML fields through the emogrifier (see `css/email.scss`)
|
||||
$sBody = <<<HTML
|
||||
<div class="email-is-html-content">
|
||||
{$this->Get('body')}
|
||||
{$sBody}
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ define('ITOP_APPLICATION_SHORT', 'iTop');
|
||||
*
|
||||
* @see ITOP_CORE_VERSION to get iTop core version
|
||||
*/
|
||||
define('ITOP_VERSION', '3.3.0-dev');
|
||||
define('ITOP_VERSION', '3.4.0-dev');
|
||||
|
||||
define('ITOP_VERSION_NAME', 'Fullmoon');
|
||||
define('ITOP_REVISION', 'svn');
|
||||
@@ -607,6 +607,14 @@ class Config
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
'attribute.max_actions_items' => [
|
||||
'type' => 'integer',
|
||||
'description' => 'Maximum number of actions to display before it\'s compacted into a single action (0 means no limit)',
|
||||
'default' => 2,
|
||||
'value' => 2,
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
'email_asynchronous' => [
|
||||
'type' => 'bool',
|
||||
'description' => 'If set, the emails are sent off line, which requires cron.php to be activated. Exception: some features like the email test utility will force the serialized mode',
|
||||
@@ -1288,6 +1296,14 @@ class Config
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
'transactions_file_lifetime' => [
|
||||
'type' => 'integer',
|
||||
'description' => 'Value in seconds for the lifetime of a transaction file (after this duration, the transaction will be invalid and the garbage collector could delete it). This only works if the "transaction_storage" parameter is set to "File".',
|
||||
'default' => 3600,
|
||||
'value' => '',
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
'log_transactions' => [
|
||||
'type' => 'bool',
|
||||
'description' => 'Whether or not to enable the debug log for the transactions.',
|
||||
@@ -1746,11 +1762,19 @@ class Config
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
'security.disable_mandatory_authentication_for_inline_images' => [
|
||||
'type' => 'bool',
|
||||
'description' => 'If true then image access does not require user authentication, provided the image\'s secret is valid. Note that setting this to true gives a less secure access to inline images!',
|
||||
'default' => false,
|
||||
'value' => false,
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
'security.disable_joined_classes_filter' => [
|
||||
'type' => 'bool',
|
||||
'description' => 'If true, scope filters aren\'t applied to joined classes or union classes not directly listed in the SELECT clause.',
|
||||
'default' => true,
|
||||
'value' => true,
|
||||
'default' => false,
|
||||
'value' => false,
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
@@ -1765,8 +1789,16 @@ class Config
|
||||
'security.disable_exec_forced_login_for_all_enpoints' => [
|
||||
'type' => 'bool',
|
||||
'description' => 'If true, when no delegated authentication module is defined, no login will be forced on modules exec endpoints',
|
||||
'default' => true,
|
||||
'value' => true,
|
||||
'default' => false,
|
||||
'value' => false,
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
'security.post_requests.allowed_protocols' => [
|
||||
'type' => 'string',
|
||||
'description' => 'List of allowed protocols that will be used for post requests. Allowed values: dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp',
|
||||
'default' => 'http,https,ftp,ftps,sftp',
|
||||
'value' => 'http,https,ftp,ftps,sftp',
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.3">
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.4">
|
||||
<classes>
|
||||
<class id="lnkActionNotificationToContact" _delta="define">
|
||||
<parent>DBObject</parent>
|
||||
@@ -320,9 +320,9 @@
|
||||
$bIsAsync = $this->IsAsynchronous();
|
||||
[$sPreviousLanguage, $aPreviousPluginProperties] = $this->SetNotificationLanguage();
|
||||
|
||||
$sMessage = MetaModel::ApplyParams($this->Get('message'), $aContextArgs);
|
||||
$sTitle = MetaModel::ApplyParams($this->Get('title'), $aContextArgs);
|
||||
$sUrl = MetaModel::ApplyParams($this->Get('url'), $aContextArgs);
|
||||
$sMessage = MetaModel::ApplyParams($this->Get('message'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$sTitle = MetaModel::ApplyParams($this->Get('title'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$sUrl = MetaModel::ApplyParams($this->Get('url'), $aContextArgs, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$iObjectId = 0;
|
||||
$sObjectClass = null;
|
||||
if (array_key_exists('this->object()', $aContextArgs)) {
|
||||
|
||||
@@ -730,13 +730,8 @@ abstract class DBObject implements iDisplay
|
||||
public function SetTrim($sAttCode, $sValue)
|
||||
{
|
||||
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
||||
$iMaxSize = $oAttDef->GetMaxSize();
|
||||
$sLength = mb_strlen($sValue);
|
||||
if ($iMaxSize && ($sLength > $iMaxSize)) {
|
||||
$sMessage = " -truncated ($sLength chars)";
|
||||
$sValue = mb_substr($sValue, 0, $iMaxSize - mb_strlen($sMessage)).$sMessage;
|
||||
}
|
||||
$this->Set($sAttCode, $sValue);
|
||||
|
||||
$this->Set($sAttCode, $oAttDef->TrimValue($sValue));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2038,7 +2033,7 @@ abstract class DBObject implements iDisplay
|
||||
}
|
||||
}
|
||||
if (!is_null($iMaxSize = $oAtt->GetMaxSize())) {
|
||||
$iLen = mb_strlen($toCheck);
|
||||
$iLen = $oAtt->GetSize($toCheck);
|
||||
if ($iLen > $iMaxSize) {
|
||||
return "String too long (found $iLen, limited to $iMaxSize)";
|
||||
}
|
||||
@@ -5620,7 +5615,7 @@ abstract class DBObject implements iDisplay
|
||||
$aContext['current_contact_friendlyname'] = UserRights::GetUserFriendlyName();
|
||||
$aContext['current_date'] = date(AttributeDate::GetSQLFormat());
|
||||
$aContext['current_time'] = date(AttributeDateTime::GetSQLTimeFormat());
|
||||
$sValue = MetaModel::ApplyParams($sRawValue, $aContext);
|
||||
$sValue = MetaModel::ApplyParams($sRawValue, $aContext, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$this->Set($sAttCode, $sValue);
|
||||
break;
|
||||
|
||||
@@ -5644,7 +5639,7 @@ abstract class DBObject implements iDisplay
|
||||
$aContext['current_contact_friendlyname'] = UserRights::GetUserFriendlyName();
|
||||
$aContext['current_date'] = date(AttributeDate::GetSQLFormat());
|
||||
$aContext['current_time'] = date(AttributeDateTime::GetSQLTimeFormat());
|
||||
$sAddendum = MetaModel::ApplyParams($sRawAddendum, $aContext);
|
||||
$sAddendum = MetaModel::ApplyParams($sRawAddendum, $aContext, MetaModel::APPLY_PARAMS_SANITIZE_NONE);
|
||||
$this->Set($sAttCode, $this->Get($sAttCode).$sAddendum);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1711,7 +1711,7 @@ class DBObjectSearch extends DBSearch
|
||||
* @return array|mixed|\SQLObjectQuery|null
|
||||
* @throws \CoreException
|
||||
*/
|
||||
public function GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr = null, $aSelectedClasses = null, $aSelectExpr = null)
|
||||
public function GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr = null, $aSelectedClasses = null, $aSelectExpr = null, $bSelectOnlyIds = false)
|
||||
{
|
||||
// Hide objects that are not visible to the current user
|
||||
//
|
||||
@@ -1782,6 +1782,8 @@ class DBObjectSearch extends DBSearch
|
||||
$aContextData['aSelectExpr'] = $aSelectExpr;
|
||||
$sRawId .= $bGetCount;
|
||||
$aContextData['bGetCount'] = $bGetCount;
|
||||
$sRawId .= 'ids:'.($bSelectOnlyIds ? '1' : '0');
|
||||
$aContextData['bSelectOnlyIds'] = $bSelectOnlyIds;
|
||||
if (is_array($aSelectedClasses)) {
|
||||
$sRawId .= implode(',', $aSelectedClasses); // Unions may alter the list of selected columns
|
||||
}
|
||||
@@ -1835,7 +1837,7 @@ class DBObjectSearch extends DBSearch
|
||||
if (!isset($oSQLQuery)) {
|
||||
$oKPI = new ExecutionKPI();
|
||||
$oSQLObjectQueryBuilder = new SQLObjectQueryBuilder($oSearch);
|
||||
$oSQLQuery = $oSQLObjectQueryBuilder->BuildSQLQueryStruct($aAttToLoad, $bGetCount, $aModifierProperties, $aGroupByExpr, $aSelectedClasses, $aSelectExpr);
|
||||
$oSQLQuery = $oSQLObjectQueryBuilder->BuildSQLQueryStruct($aAttToLoad, $bGetCount, $aModifierProperties, $aGroupByExpr, $aSelectedClasses, $aSelectExpr, $bSelectOnlyIds);
|
||||
$oKPI->ComputeStats('BuildSQLQueryStruct', $sOqlQuery);
|
||||
|
||||
if (self::$m_bQueryCacheEnabled) {
|
||||
@@ -1945,7 +1947,7 @@ class DBObjectSearch extends DBSearch
|
||||
$oSearch = $this;
|
||||
$aClassesToFilter = $this->GetSelectedClasses();
|
||||
|
||||
// Opt-in for joined classes filtering, otherwise only filter the selected class(es)
|
||||
// Joined classes filtering can be disabled through the configuration.
|
||||
if (MetaModel::GetConfig()->Get('security.disable_joined_classes_filter') === false) {
|
||||
$aClassesToFilter = $this->GetJoinedClasses();
|
||||
}
|
||||
|
||||
@@ -921,7 +921,7 @@ abstract class DBSearch
|
||||
* @internal
|
||||
*
|
||||
*/
|
||||
public function MakeSelectQuery($aOrderBy = [], $aArgs = [], $aAttToLoad = null, $aExtendedDataSpec = null, $iLimitCount = 0, $iLimitStart = 0, $bGetCount = false, $bBeautifulSQL = true)
|
||||
public function MakeSelectQuery($aOrderBy = [], $aArgs = [], $aAttToLoad = null, $aExtendedDataSpec = null, $iLimitCount = 0, $iLimitStart = 0, $bGetCount = false, $bBeautifulSQL = true, $bSelectOnlyIds = false)
|
||||
{
|
||||
// Check the order by specification, and prefix with the class alias
|
||||
// and make sure that the ordering columns are going to be selected
|
||||
@@ -962,7 +962,7 @@ abstract class DBSearch
|
||||
}
|
||||
}
|
||||
|
||||
$oSQLQuery = $this->GetSQLQuery($aOrderBy, $aArgs, $aAttToLoad, $aExtendedDataSpec, $iLimitCount, $iLimitStart, $bGetCount);
|
||||
$oSQLQuery = $this->GetSQLQuery($aOrderBy, $aArgs, $aAttToLoad, $aExtendedDataSpec, $iLimitCount, $iLimitStart, $bGetCount, null, null, $bSelectOnlyIds);
|
||||
|
||||
if ($this->m_bNoContextParameters) {
|
||||
// Only internal parameters
|
||||
@@ -1046,7 +1046,7 @@ abstract class DBSearch
|
||||
* @internal
|
||||
*
|
||||
*/
|
||||
protected function GetSQLQuery($aOrderBy, $aArgs, $aAttToLoad, $aExtendedDataSpec, $iLimitCount, $iLimitStart, $bGetCount, $aGroupByExpr = null, $aSelectExpr = null)
|
||||
protected function GetSQLQuery($aOrderBy, $aArgs, $aAttToLoad, $aExtendedDataSpec, $iLimitCount, $iLimitStart, $bGetCount, $aGroupByExpr = null, $aSelectExpr = null, $bSelectOnlyIds = false)
|
||||
{
|
||||
$oSearch = $this->ApplyDataFilters();
|
||||
|
||||
@@ -1068,7 +1068,7 @@ abstract class DBSearch
|
||||
}
|
||||
}
|
||||
|
||||
$oSQLQuery = $oSearch->GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr, null, $aSelectExpr);
|
||||
$oSQLQuery = $oSearch->GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr, null, $aSelectExpr, $bSelectOnlyIds);
|
||||
$oSQLQuery->SetSourceOQL($oSearch->ToOQL());
|
||||
|
||||
// Join to an additional table, if required...
|
||||
@@ -1103,7 +1103,8 @@ abstract class DBSearch
|
||||
$bGetCount,
|
||||
$aGroupByExpr = null,
|
||||
$aSelectedClasses = null,
|
||||
$aSelectExpr = null
|
||||
$aSelectExpr = null,
|
||||
$bSelectOnlyIds = false
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -527,10 +527,10 @@ class DBUnionSearch extends DBSearch
|
||||
throw new Exception('MakeUpdateQuery is not implemented for the unions!');
|
||||
}
|
||||
|
||||
public function GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr = null, $aSelectedClasses = null, $aSelectExpr = null)
|
||||
public function GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr = null, $aSelectedClasses = null, $aSelectExpr = null, $bSelectOnlyIds = false)
|
||||
{
|
||||
if (count($this->aSearches) == 1) {
|
||||
return $this->aSearches[0]->GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr, $aSelectedClasses, $aSelectExpr);
|
||||
return $this->aSearches[0]->GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr, $aSelectedClasses, $aSelectExpr, $bSelectOnlyIds);
|
||||
}
|
||||
|
||||
$aSQLQueries = [];
|
||||
@@ -610,7 +610,7 @@ class DBUnionSearch extends DBSearch
|
||||
}
|
||||
}
|
||||
}
|
||||
$oSubQuery = $oSearch->GetSQLQueryStructure($aQueryAttToLoad, false, $aQueryGroupByExpr, $aSearchSelectedClasses, $aQuerySelectExpr);
|
||||
$oSubQuery = $oSearch->GetSQLQueryStructure($aQueryAttToLoad, false, $aQueryGroupByExpr, $aSearchSelectedClasses, $aQuerySelectExpr, $bSelectOnlyIds);
|
||||
if (count($aSearchAliases) > 1) {
|
||||
// Necessary to make sure that selected columns will match throughout all the queries
|
||||
// (default order of selected fields depending on the order of JOINS)
|
||||
@@ -683,7 +683,7 @@ class DBUnionSearch extends DBSearch
|
||||
return $this;
|
||||
}
|
||||
|
||||
// Opt-in for joined classes filtering, otherwise fallback on DBSearch filtering
|
||||
// Joined classes filtering can be disabled through the configuration.
|
||||
if (MetaModel::GetConfig()->Get('security.disable_joined_classes_filter') === true) {
|
||||
return parent::ApplyDataFilters();
|
||||
}
|
||||
|
||||
@@ -323,6 +323,7 @@ class HTMLDOMSanitizer extends DOMSanitizer
|
||||
|
||||
protected static $aAttrsWhiteList = [
|
||||
'src' => '/^(http:|https:|data:)/i',
|
||||
'href' => '/^(https?:|ftps?:|mailto:|\$|%24)/i',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -354,30 +355,6 @@ class HTMLDOMSanitizer extends DOMSanitizer
|
||||
'white-space',
|
||||
];
|
||||
|
||||
public function __construct($sInlineImageClassName = InlineImage::class)
|
||||
{
|
||||
parent::__construct($sInlineImageClassName);
|
||||
|
||||
// Building href validation pattern from url and email validation patterns as the patterns are not used the same way in HTML content than in standard attributes value.
|
||||
// eg. "foo@bar.com" vs "mailto:foo@bar.com?subject=Title&body=Hello%20world"
|
||||
if (!array_key_exists('href', self::$aAttrsWhiteList)) {
|
||||
// Regular urls
|
||||
$sUrlPattern = utils::GetConfig()->Get('url_validation_pattern');
|
||||
|
||||
// Mailto urls
|
||||
$sMailtoPattern = '(mailto:('.utils::GetConfig()->Get('email_validation_pattern').')(?:\?(?:subject|body)=([a-zA-Z0-9+\$_.-]*)(?:&(?:subject|body)=([a-zA-Z0-9+\$_.-]*))?)?)';
|
||||
|
||||
// Notification placeholders
|
||||
// eg. $this->caller_id$, $this->hyperlink()$, $this->hyperlink(portal)$, $APP_URL$, $MODULES_URL$, ...
|
||||
// Note: Authorize both $xxx$ and %24xxx%24 as the latter one is encoded when used in HTML attributes (eg. a[href])
|
||||
$sPlaceholderPattern = '(\$|%24)[\w-]*(->[\w]*(\([\w-]*?\))?)?(\$|%24)';
|
||||
|
||||
$sPattern = $sUrlPattern.'|'.$sMailtoPattern.'|'.$sPlaceholderPattern;
|
||||
$sPattern = '/'.str_replace('/', '\/', $sPattern).'/i';
|
||||
self::$aAttrsWhiteList['href'] = $sPattern;
|
||||
}
|
||||
}
|
||||
|
||||
public function GetTagsWhiteList()
|
||||
{
|
||||
return static::$aTagsWhiteList;
|
||||
|
||||
@@ -1303,6 +1303,40 @@ class DeprecatedCallsLog extends LogAPI
|
||||
static::ForwardToTriggerError($sMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this helper when a method receives arguments matching a deprecated signature.
|
||||
* The method itself remains supported.
|
||||
*
|
||||
* @param string|null $sAdditionalMessage Explain which arguments should be passed instead
|
||||
*
|
||||
* @since 3.2.4 3.3.1 3.4.0 N°9436
|
||||
*/
|
||||
public static function NotifyDeprecatedPhpMethodSignature(?string $sAdditionalMessage = null): void
|
||||
{
|
||||
try {
|
||||
if (!static::IsLogLevelEnabled(self::LEVEL_WARNING, self::ENUM_CHANNEL_PHP_METHOD)) {
|
||||
return;
|
||||
}
|
||||
} catch (ConfigException $oException) {
|
||||
// Deprecation reporting must not interrupt the caller when logging is misconfigured.
|
||||
return;
|
||||
}
|
||||
|
||||
$aStack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
|
||||
$sFunctionDesc = isset($aStack[1]['class'])
|
||||
? $aStack[1]['class'].$aStack[1]['type'].$aStack[1]['function']
|
||||
: $aStack[1]['function'];
|
||||
|
||||
$sMessage = "Calling $sFunctionDesc() with this signature is deprecated";
|
||||
if ($sAdditionalMessage !== null) {
|
||||
$sMessage .= ': '.$sAdditionalMessage;
|
||||
}
|
||||
$sMessage .= '. Caller: '.self::SummarizeCallStack(array_slice($aStack, 1));
|
||||
|
||||
static::Warning($sMessage, self::ENUM_CHANNEL_PHP_METHOD);
|
||||
static::ForwardToTriggerError($sMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this helper within deprecated methods
|
||||
*
|
||||
|
||||
@@ -118,6 +118,12 @@ define('MYSQL_ENGINE', 'innodb');
|
||||
*/
|
||||
abstract class MetaModel
|
||||
{
|
||||
/** Constants used for apply param function sanitization parameter */
|
||||
/** @since 3.2.4 3.3.1 3.4.0 N°9436 */
|
||||
public const APPLY_PARAMS_SANITIZE_HTML = 'sanitize_html';
|
||||
/** @since 3.2.4 3.3.1 3.4.0 N°9436 */
|
||||
public const APPLY_PARAMS_SANITIZE_NONE = 'sanitize_none';
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// STATIC Members
|
||||
@@ -1642,10 +1648,10 @@ abstract class MetaModel
|
||||
if ($sFilterCode == 'id') {
|
||||
return true;
|
||||
}
|
||||
if (array_key_exists($sClass, self::$m_aMagicFields) && array_key_exists($sFilterCode, self::$m_aMagicFields[$sClass])) {
|
||||
if (array_key_exists($sClass, self::$m_aMagicFields) && in_array($sFilterCode, self::$m_aMagicFields[$sClass])) {
|
||||
return true;
|
||||
}
|
||||
if (array_key_exists($sClass, self::$m_aFilterForbiddenAttributes) && array_key_exists($sFilterCode, self::$m_aFilterForbiddenAttributes[$sClass])) {
|
||||
if (array_key_exists($sClass, self::$m_aFilterForbiddenAttributes) && in_array($sFilterCode, self::$m_aFilterForbiddenAttributes[$sClass])) {
|
||||
return false;
|
||||
}
|
||||
return self::IsValidAttCode($sClass, $sFilterCode);
|
||||
@@ -2963,8 +2969,9 @@ abstract class MetaModel
|
||||
self::$m_aMagicFields[] = $sClass;
|
||||
}
|
||||
self::$m_aMagicFields[$sClass][] = $sCode;
|
||||
self::$m_aAttribOrigins[$sClass][$sCode] = self::$m_aAttribOrigins[$sClass][$sAttCode];
|
||||
}
|
||||
if (!$oAttDef->IsSearchable()) {
|
||||
if (!$oAttDef->IsValidFilterAttribute()) {
|
||||
if (!array_key_exists($sClass, self::$m_aFilterForbiddenAttributes)) {
|
||||
self::$m_aFilterForbiddenAttributes[] = $sClass;
|
||||
}
|
||||
@@ -6700,14 +6707,23 @@ abstract class MetaModel
|
||||
* * foo->bar : Another static placeholder
|
||||
* * foo->object() : Will be developed into a set of placeholders depending on the attribute of the given \DBObject and their corresponding transformation methods {@see \AttributeDefinition::GetForTemplate()}
|
||||
* Example: foo->hyperlink(), foo->name, foo->html(name), foo->head(log), foo->head_html(log), ...
|
||||
* @param string|null $sApplySanitizeMode Allowed values are one of {@see self::APPLY_PARAMS_SANITIZE_HTML}, {@see self::APPLY_PARAMS_SANITIZE_NONE}. Default is null to keep compatibility with previous versions of iTop. @since 3.2.4 N°9436
|
||||
*
|
||||
* @link https://www.itophub.io/wiki/page?id=latest:admin:placeholders
|
||||
* @return string
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function ApplyParams($sInput, $aParams)
|
||||
public static function ApplyParams($sInput, $aParams, ?string $sApplySanitizeMode = null)
|
||||
{
|
||||
if ($sApplySanitizeMode === null) {
|
||||
DeprecatedCallsLog::NotifyDeprecatedPhpMethodSignature('Pass an explicit $sApplySanitizeMode parameter.');
|
||||
$sApplySanitizeMode = self::APPLY_PARAMS_SANITIZE_NONE;
|
||||
}
|
||||
if (in_array($sApplySanitizeMode, [self::APPLY_PARAMS_SANITIZE_HTML, self::APPLY_PARAMS_SANITIZE_NONE], true) === false) {
|
||||
throw new CoreException('Invalid value for $sApplySanitizeMode parameter', ['value' => $sApplySanitizeMode]);
|
||||
}
|
||||
|
||||
$aParams = static::AddMagicPlaceholders($aParams);
|
||||
|
||||
// Declare magic parameters
|
||||
@@ -6795,7 +6811,14 @@ abstract class MetaModel
|
||||
}
|
||||
}
|
||||
|
||||
return str_replace($aSearches, $aReplacements, $sInput);
|
||||
$sTemplate = str_replace($aSearches, $aReplacements, $sInput);
|
||||
|
||||
// HTML sanitization
|
||||
if ($sApplySanitizeMode === self::APPLY_PARAMS_SANITIZE_HTML) {
|
||||
$sTemplate = DOMSanitizer::Sanitize($sTemplate);
|
||||
}
|
||||
|
||||
return $sTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6865,10 +6888,24 @@ abstract class MetaModel
|
||||
require_once(APPROOT.'/core/dict.class.inc.php');
|
||||
Dict::ResetCache($sAppIdentity);
|
||||
|
||||
$iApcDeleteFailureCount = 0;
|
||||
if (function_exists('apc_delete')) {
|
||||
foreach (self::GetCacheEntries($sEnvironmentId) as $sKey => $aAPCInfo) {
|
||||
$sAPCKey = $aAPCInfo['info'];
|
||||
apc_delete($sAPCKey);
|
||||
if (!apc_delete($sAPCKey)) {
|
||||
$iApcDeleteFailureCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($iApcDeleteFailureCount > 0) {
|
||||
SetupLog::Warning("apc_delete failed for $iApcDeleteFailureCount entries for env $sEnvironment");
|
||||
}
|
||||
|
||||
if (function_exists('apc_clear_cache')) {
|
||||
// old style APC
|
||||
if (!apc_clear_cache()) {
|
||||
SetupLog::Warning("apc_clear_cache failed for env $sEnvironment");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6878,7 +6915,9 @@ abstract class MetaModel
|
||||
// Reset the opcache since otherwise the PHP "model" files may still be cached !!
|
||||
if (function_exists('opcache_reset')) {
|
||||
// Zend opcode cache
|
||||
opcache_reset();
|
||||
if (!opcache_reset()) {
|
||||
SetupLog::Warning("opcache_reset failed for env $sEnvironment");
|
||||
}
|
||||
}
|
||||
|
||||
require_once(APPROOT.'setup/setuputils.class.inc.php');
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,15 +60,13 @@ class OQLActualClassTreeResolver
|
||||
$aTranslateFields = [];
|
||||
foreach ($aExpectedAttributes as $sAttCode => $oExpression) {
|
||||
// 'id' is managed later
|
||||
if ($sAttCode == 'id') {
|
||||
if ($sAttCode === 'id') {
|
||||
continue;
|
||||
}
|
||||
// Attributes can be stored in attributes list or for magic ones into filter codes list.
|
||||
$sOriginClass = null;
|
||||
if (MetaModel::IsValidAttCode($sClass, $sAttCode)) {
|
||||
if (MetaModel::IsValidAttCode($sClass, $sAttCode) || MetaModel::IsValidFilterCode($sClass, $sAttCode)) {
|
||||
$sOriginClass = MetaModel::GetAttributeOrigin($sClass, $sAttCode);
|
||||
} elseif ($sAttCode == 'id') {
|
||||
$sOriginClass = $sClass;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -29,13 +29,14 @@ class SQLObjectQueryBuilder
|
||||
* @param array $aGroupByExpr
|
||||
* @param array $aSelectedClasses
|
||||
* @param array $aSelectExpr
|
||||
* @param bool $bSelectOnlyIds
|
||||
*
|
||||
* @return null|SQLObjectQuery
|
||||
* @throws \CoreException
|
||||
*/
|
||||
public function BuildSQLQueryStruct($aAttToLoad, $bGetCount, $aModifierProperties, $aGroupByExpr = null, $aSelectedClasses = null, $aSelectExpr = null)
|
||||
public function BuildSQLQueryStruct($aAttToLoad, $bGetCount, $aModifierProperties, $aGroupByExpr = null, $aSelectedClasses = null, $aSelectExpr = null, $bSelectOnlyIds = false)
|
||||
{
|
||||
if ($bGetCount || !is_null($aGroupByExpr)) {
|
||||
if ($bGetCount || !is_null($aGroupByExpr) || $bSelectOnlyIds) {
|
||||
// Avoid adding all the fields for counts or "group by" requests
|
||||
$aAttToLoad = [];
|
||||
foreach ($this->oDBObjetSearch->GetSelectedClasses() as $sClassAlias => $sClass) {
|
||||
|
||||
@@ -8,6 +8,13 @@
|
||||
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
||||
use Combodo\iTop\Application\WebPage\WebPage;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeExternalField;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeExternalKey;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeFriendlyName;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeHierarchicalKey;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeLinkedSet;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeStopWatch;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeSubItem;
|
||||
|
||||
/**
|
||||
* Bulk export: Tabular export: abstract base class for all "tabular" exports.
|
||||
@@ -91,8 +98,8 @@ abstract class TabularBulkExport extends BulkExport
|
||||
{
|
||||
$aResult = [];
|
||||
switch (get_class($oAttDef)) {
|
||||
case 'AttributeExternalKey':
|
||||
case 'AttributeHierarchicalKey':
|
||||
case AttributeExternalKey::class:
|
||||
case AttributeHierarchicalKey::class:
|
||||
|
||||
$bAddFriendlyName = true;
|
||||
$oKeyAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||
@@ -142,7 +149,7 @@ abstract class TabularBulkExport extends BulkExport
|
||||
}
|
||||
break;
|
||||
|
||||
case 'AttributeStopWatch':
|
||||
case AttributeStopWatch::class:
|
||||
foreach (MetaModel::ListAttributeDefs($sClass) as $sSubAttCode => $oSubAttDef) {
|
||||
if ($oSubAttDef instanceof AttributeSubItem) {
|
||||
if ($oSubAttDef->GetParentAttCode() == $sAttCode) {
|
||||
@@ -318,7 +325,7 @@ EOF
|
||||
$sQueryId = utils::ReadParam('query', null, true);
|
||||
$sFields = utils::ReadParam('fields', null, true, 'raw_data');
|
||||
if ((($sFields === null) || ($sFields === '')) && ($sQueryId === null)) {
|
||||
throw new BulkExportMissingParameterException('fields');
|
||||
$sFields = $this->GetFieldsFromQuery();
|
||||
} else {
|
||||
if (($sQueryId !== null) && ($sQueryId !== null)) {
|
||||
$oSearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', ['query_id' => $sQueryId]);
|
||||
@@ -329,11 +336,11 @@ EOF
|
||||
// No 'fields' parameter supplied, take the fields from the query phrasebook definition
|
||||
$sFields = trim($oQuery->Get('fields'));
|
||||
if ($sFields === '') {
|
||||
throw new BulkExportMissingParameterException('fields');
|
||||
$sFields = $this->GetFieldsFromQuery();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw BulkExportException('Invalid value for the parameter: query. There is no Query Phrasebook with id = '.$sQueryId, Dict::Format('Core:BulkExport:InvalidParameter_Query', $sQueryId));
|
||||
throw new BulkExportException('Invalid value for the parameter: query. There is no Query Phrasebook with id = '.$sQueryId, Dict::Format('Core:BulkExport:InvalidParameter_Query', $sQueryId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,6 +348,39 @@ EOF
|
||||
$this->SetFields($sFields);
|
||||
}
|
||||
|
||||
public function GetFieldsFromQuery(): string
|
||||
{
|
||||
if (is_null($this->oSearch)) {
|
||||
throw new BulkExportMissingParameterException("fields");
|
||||
}
|
||||
|
||||
$aSelectedClasses = $this->oSearch->GetSelectedClasses();
|
||||
$aAuthorizedClasses = [];
|
||||
$aFields = [];
|
||||
foreach ($aSelectedClasses as $sAlias => $sClassName) {
|
||||
if (UserRights::IsActionAllowed($sClassName, UR_ACTION_BULK_READ) == UR_ALLOWED_YES) {
|
||||
$aAuthorizedClasses[$sAlias] = $sClassName;
|
||||
}
|
||||
}
|
||||
foreach ($aAuthorizedClasses as $sAlias => $sClassName) {
|
||||
foreach (MetaModel::ListAttributeDefs($sClassName) as $oAttribute) {
|
||||
$sAttCode = $oAttribute->GetCode();
|
||||
if (! $this->IsExportableField($sClassName, $sAttCode, $oAttribute)) {
|
||||
continue;
|
||||
}
|
||||
$sCurrentAlias = utils::IsNullOrEmptyString($sAlias) ? "" : "$sAlias.";
|
||||
$aFields[] = "{$sCurrentAlias}{$sAttCode}";
|
||||
}
|
||||
}
|
||||
|
||||
if (count($aFields) === 0) {
|
||||
IssueLog::Error("User is not allowed to see any field for exported OQL");
|
||||
throw new BulkExportMissingParameterException("fields");
|
||||
}
|
||||
|
||||
return implode(',', $aFields);
|
||||
}
|
||||
|
||||
public function SetFields($sFields)
|
||||
{
|
||||
// Interpret (and check) the list of fields
|
||||
|
||||
@@ -42,7 +42,7 @@ css/backoffice/
|
||||
|– vendors/ # Third-party libs, should be either:
|
||||
| # - Overload of the lib SCSS variables (BEST way, but possible only if the lib exposes them. e.g. Bulma)
|
||||
| # - Overload of the lib necessary CSS classes only (not great as it duplicates some rules in the browser, which add weight and computation. e.g. dataTables)
|
||||
| # - Duplicate the lib CSS completly to insert SCSS variables (not great as it will be outdated when updating the lib itself. e.g. jQuery UI)
|
||||
| # - Duplicate the lib CSS completely to insert SCSS variables (not great as it will be outdated when updating the lib itself. e.g. jQuery UI)
|
||||
| |– _bulma-variables-overload.scss # Bulma CSS framework
|
||||
| |– _jquery-ui.scss # jQuery UI
|
||||
| ... # Etc…
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
$ibo-user-rights--padding-x: $ibo-spacing-400 !default;
|
||||
$ibo-user-rights--padding-y: $ibo-spacing-200 !default;
|
||||
$ibo-user-rights--padding-y: $ibo-spacing-100 !default;
|
||||
$ibo-user-rights--border-radius: $ibo-border-radius-400 !default;
|
||||
|
||||
$ibo-user-rights--is-success--background-color: $ibo-color-success-100 !default;
|
||||
@@ -18,6 +18,8 @@ $ibo-user-rights--is-failure--border-color: $ibo-color-danger-500 !default;
|
||||
$ibo-user-rights--is-failure--border: 1px solid $ibo-user-rights--is-failure--border-color !default;
|
||||
|
||||
.ibo-user-rights {
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
padding: $ibo-user-rights--padding-y $ibo-user-rights--padding-x;
|
||||
border-radius: $ibo-user-rights--border-radius;
|
||||
&.ibo-is-success {
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
@import "alert";
|
||||
@import "button";
|
||||
@import "button-bar";
|
||||
@import "button-separator";
|
||||
@import "button-group";
|
||||
@import "breadcrumbs";
|
||||
@import "quick-create";
|
||||
|
||||
43
css/backoffice/components/_button-bar.scss
Normal file
43
css/backoffice/components/_button-bar.scss
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
$ibo-button-bar--gap: 2px !default;
|
||||
$ibo-button-bar--track--gap: 6px !default;
|
||||
|
||||
/* button-bar.css */
|
||||
ibo-button-bar{
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
gap: $ibo-button-bar--gap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Keep content visible even if JS initialization is delayed. */
|
||||
|
||||
ibo-button-bar .ibo-button-bar--track{
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
gap: $ibo-button-bar--track--gap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
ibo-button-bar .ibo-button-bar--item{
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
ibo-button-bar .ibo-button-bar--item[hidden]{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
ibo-button-bar .ibo-button-bar--extra{
|
||||
flex: 0 0 auto;
|
||||
position: relative;
|
||||
}
|
||||
20
css/backoffice/components/_button-separator.scss
Normal file
20
css/backoffice/components/_button-separator.scss
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2026 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
$ibo-button-separator--width: 1px !default;
|
||||
$ibo-button-separator--height: 16px !default;
|
||||
$ibo-button-separator--margin-x: 0.75rem !default;
|
||||
$ibo-button-separator--margin-y: $ibo-spacing-0 !default;
|
||||
$ibo-button-separator--border-size: 1px !default;
|
||||
$ibo-button-separator--border-color: $ibo-color-grey-500 !default;
|
||||
|
||||
.ibo-button-separator {
|
||||
display: inline-flex;
|
||||
border-right: $ibo-button-separator--border-size solid $ibo-button-separator--border-color;
|
||||
width: $ibo-button-separator--width;
|
||||
height: $ibo-button-separator--height;
|
||||
margin: $ibo-button-separator--margin-y $ibo-button-separator--margin-x;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,12 @@ $ibo-field--enable-bulk--border-radius: $ibo-border-radius-500 !default;
|
||||
|
||||
$ibo-field--enable-bulk--checkbox--margin-left: $ibo-spacing-300 !default;
|
||||
|
||||
$ibo-field--label--action--margin-y: $ibo-spacing-0 !default;
|
||||
$ibo-field--label--action--margin-x: $ibo-spacing-100 !default;
|
||||
$ibo-field--label--action--size: $ibo-field--fullscreen-toggler--size !default;
|
||||
$ibo-field--label--action--padding: $ibo-spacing-0 !default;
|
||||
$ibo-field--label--action--font-size: $ibo-font-size-50 !default;
|
||||
|
||||
/* SCSS rules */
|
||||
.ibo-field {
|
||||
@extend %ibo-font-size-150;
|
||||
@@ -264,4 +270,32 @@ $ibo-field--enable-bulk--checkbox--margin-left: $ibo-spacing-300 !default;
|
||||
|
||||
.ibo-input-select--action-buttons a {
|
||||
@extend %ibo-hyperlink-inherited-colors;
|
||||
}
|
||||
|
||||
.ibo-field--label {
|
||||
.ibo-field--action:not(.ibo-button-separator) {
|
||||
display: inline-flex;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
vertical-align: middle;
|
||||
|
||||
width: $ibo-field--label--action--size;
|
||||
height: $ibo-field--label--action--size;
|
||||
padding: $ibo-field--label--action--padding;
|
||||
border-radius: $ibo-field--fullscreen-toggler--border-radius;
|
||||
font-size: $ibo-field--label--action--font-size;
|
||||
~ .ibo-field--action {
|
||||
margin-left: $ibo-field--label--action--margin-x;
|
||||
}
|
||||
}
|
||||
.ibo-field--action.ibo-button-separator {
|
||||
margin: $ibo-field--label--action--margin-y $ibo-field--label--action--margin-x;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
// Specific rule to ensure that the grouped actions popover of a field is visible in fullscreen mode
|
||||
body.ibo-has-fullscreen-descendant .ibo-popover-menu.ibo-field--grouped-actions-popover {
|
||||
z-index: 1060 !important;
|
||||
}
|
||||
@@ -8,70 +8,74 @@
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
|
||||
.help-text{
|
||||
padding: 1px 5px;
|
||||
background-color: #d7e3f8;
|
||||
border: 1px solid #c6e7f5;
|
||||
border-radius: 5px;
|
||||
margin: 5px 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.form-error ul{
|
||||
padding: 1px 5px;
|
||||
background-color: #f8d7da;
|
||||
border: 1px solid #f5c6cb;
|
||||
border-radius: 5px;
|
||||
margin: 5px 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.subform{
|
||||
background-color: #efefef;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.form-buttons{
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.form select{
|
||||
padding: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.form select option{
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.turbo-refreshing{
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
.ibo-field legend{
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
collection-entry-element {
|
||||
margin-top: 8px;
|
||||
display: block;
|
||||
padding: 10px 10px;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.ts-control{
|
||||
height: auto;
|
||||
min-height: 30px;
|
||||
}
|
||||
|
||||
.ibo-form-actions > .ibo-button > span{
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.ibo-form textarea{
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
// WIP SDK Forms
|
||||
//form[is="itop-form-element"] {
|
||||
//
|
||||
// .help-text{
|
||||
// padding: 1px 5px;
|
||||
// background-color: #d7e3f8;
|
||||
// border: 1px solid #c6e7f5;
|
||||
// border-radius: 5px;
|
||||
// margin: 5px 0;
|
||||
// font-size: 0.9em;
|
||||
// }
|
||||
//
|
||||
// .form-error ul{
|
||||
// padding: 1px 5px;
|
||||
// background-color: #f8d7da;
|
||||
// border: 1px solid #f5c6cb;
|
||||
// border-radius: 5px;
|
||||
// margin: 5px 0;
|
||||
// font-size: 0.9em;
|
||||
// }
|
||||
//
|
||||
// .subform{
|
||||
// background-color: #efefef;
|
||||
// border-radius: 5px;
|
||||
// padding: 10px;
|
||||
// }
|
||||
//
|
||||
// .form-buttons{
|
||||
// margin: 20px 0;
|
||||
// }
|
||||
//
|
||||
// .form select{
|
||||
// padding: 0;
|
||||
// overflow-y: auto;
|
||||
// }
|
||||
//
|
||||
// .form select option{
|
||||
// height: 30px;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// }
|
||||
//
|
||||
// .turbo-refreshing{
|
||||
// opacity: .5;
|
||||
// }
|
||||
//
|
||||
// .ibo-field legend{
|
||||
// margin-top: 24px;
|
||||
// }
|
||||
//
|
||||
// collection-entry-element {
|
||||
// margin-top: 8px;
|
||||
// display: block;
|
||||
// padding: 10px 10px;
|
||||
// background-color: #f5f5f5;
|
||||
// border-radius: 5px;
|
||||
// }
|
||||
// .ts-control{
|
||||
// height: auto;
|
||||
// min-height: 30px;
|
||||
// }
|
||||
//
|
||||
// .ibo-form-actions > .ibo-button > span{
|
||||
// margin-right: 5px;
|
||||
// }
|
||||
//
|
||||
// .ibo-form textarea{
|
||||
// resize: vertical;
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -21,6 +21,7 @@ $ibo-input-set--item--padding-x: 6px !default;
|
||||
$ibo-input-set--item--padding-y: $ibo-spacing-200 !default;
|
||||
$ibo-input-set--item--max-width: 360px !default;
|
||||
$ibo-input-set--item--background-color: $ibo-color-white-100 !default;
|
||||
$ibo-input-set--item--color: $ibo-color-grey-900 !default;
|
||||
$ibo-input-set--item--border: none !default;
|
||||
$ibo-input-set--item--border-radius: $ibo-border-radius-300 !default;
|
||||
$ibo-input-set--item--box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 1px 1px rgba(241, 241, 241, 0.7) !default;
|
||||
@@ -59,7 +60,7 @@ $ibo-input-set--item--box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 1px 1px rgb
|
||||
border-radius: $ibo-input-set--item--border-radius;
|
||||
box-shadow: $ibo-input-set--item--box-shadow;
|
||||
|
||||
color: $ibo-color-grey-900;
|
||||
color: $ibo-input-set--item--color;
|
||||
text-shadow: none;
|
||||
@extend %ibo-text-truncated-with-ellipsis;
|
||||
/* - Guaranty that if a set item has html sub-node, they correctly display ellipsis (eg. Link set set items) */
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
@import "navigation-menu";
|
||||
@import "top-bar";
|
||||
@import "content";
|
||||
@import "details";
|
||||
@import "tab-container/tab-container";
|
||||
@@ -15,4 +14,5 @@
|
||||
@import "wizard-container/wizard-container";
|
||||
@import "object/all";
|
||||
@import "activity-panel/all";
|
||||
@import "extension/all";
|
||||
@import "extension/all";
|
||||
@import "top-bar/all";
|
||||
@@ -793,8 +793,9 @@ $ibo-navigation-menu--user-info--height--is-expanded: 100% !default;
|
||||
color: $ibo-navigation-menu--user--text-color;
|
||||
}
|
||||
|
||||
.ibo-navigation-menu--user-notifications--toggler--icon {
|
||||
padding-left: $ibo-navigation-menu--user-notifications--toggler--icon--padding-left;
|
||||
.ibo-navigation-menu--user-notifications--toggler--icon {
|
||||
position: relative;
|
||||
padding-left: $ibo-navigation-menu--user-notifications--toggler--icon--padding-left;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
78
css/backoffice/layout/activity-panel/_activity-action.scss
Normal file
78
css/backoffice/layout/activity-panel/_activity-action.scss
Normal file
@@ -0,0 +1,78 @@
|
||||
$ibo-activity-panel--activity-actions--right: $ibo-activity-panel--add-caselog-entry-button--right !default;
|
||||
$ibo-activity-panel--activity-actions--top: 76px + $ibo-activity-panel--activity-actions--right !default;
|
||||
$ibo-activity-panel--activity-actions--gap: $ibo-spacing-300 !default;
|
||||
|
||||
$ibo-activity-panel--activity-action--diameter: $ibo-activity-panel--add-caselog-entry-button--diameter !default;
|
||||
$ibo-activity-panel--activity-action--background-color: $ibo-activity-panel--add-caselog-entry-button--background-color !default;
|
||||
$ibo-activity-panel--activity-action--background-color--on-hover: $ibo-activity-panel--add-caselog-entry-button--background-color--on-hover !default;
|
||||
$ibo-activity-panel--activity-action--background-color--is-active: $ibo-activity-panel--add-caselog-entry-button--background-color--is-active !default;
|
||||
$ibo-activity-panel--activity-action--color: $ibo-activity-panel--add-caselog-entry-button--color !default;
|
||||
$ibo-activity-panel--activity-action--border-radius: $ibo-border-radius-full !default;
|
||||
$ibo-activity-panel--activity-action--box-shadow: $ibo-activity-panel--add-caselog-entry-button--box-shadow !default;
|
||||
$ibo-activity-panel--activity-action--hover--box-shadow: $ibo-activity-panel--add-caselog-entry-button--hover--box-shadow !default;
|
||||
|
||||
$ibo-activity-panel--activity-action--icon--height: $ibo-activity-panel--add-caselog-entry-button--icon--height !default;
|
||||
$ibo-activity-panel--activity-action--icon--width: $ibo-activity-panel--activity-action--icon--height !default;
|
||||
$ibo-activity-panel--activity-action--icon--font-size: $ibo-activity-panel--add-caselog-entry-button--icon--font-size !default;
|
||||
$ibo-activity-panel--activity-action--icon--line-height: $ibo-activity-panel--add-caselog-entry-button--icon--line-height !default;
|
||||
$ibo-activity-panel--activity-action-separator--width: calc(#{$ibo-activity-panel--activity-action--diameter} / 1.5) !default;
|
||||
$ibo-activity-panel--activity-action-separator--height: 2px !default;
|
||||
$ibo-activity-panel--activity-action-separator--background-color: $ibo-color-grey-500 !default;
|
||||
|
||||
|
||||
.ibo-activity-panel--activity-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $ibo-activity-panel--activity-actions--gap;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
right: $ibo-activity-panel--activity-actions--right;
|
||||
top: $ibo-activity-panel--activity-actions--top;
|
||||
&.ibo-is-hidden{
|
||||
display: none;
|
||||
}
|
||||
&:has(+ .ibo-activity-panel--add-caselog-entry-button) {
|
||||
top: calc(#{$ibo-activity-panel--activity-actions--top} + #{$ibo-activity-panel--activity-action--diameter} + #{$ibo-activity-panel--activity-actions--gap});
|
||||
}
|
||||
}
|
||||
|
||||
.ibo-activity-panel--activity-action {
|
||||
@extend %ibo-baseline-centered-content;
|
||||
|
||||
width: $ibo-activity-panel--activity-action--diameter;
|
||||
height: $ibo-activity-panel--activity-action--diameter;
|
||||
|
||||
background-color: $ibo-activity-panel--activity-action--background-color;
|
||||
color: $ibo-activity-panel--activity-action--color;
|
||||
|
||||
border-radius: $ibo-activity-panel--activity-action--border-radius;
|
||||
box-shadow: $ibo-activity-panel--activity-action--box-shadow;
|
||||
|
||||
> i{
|
||||
text-align: center;
|
||||
height: $ibo-activity-panel--activity-action--icon--height;
|
||||
width: $ibo-activity-panel--activity-action--icon--width;
|
||||
font-size: $ibo-activity-panel--activity-action--icon--font-size;
|
||||
line-height: $ibo-activity-panel--activity-action--icon--line-height;
|
||||
}
|
||||
&:hover {
|
||||
color: $ibo-activity-panel--activity-action--color;
|
||||
background-color: $ibo-activity-panel--activity-action--background-color--on-hover;
|
||||
box-shadow: $ibo-activity-panel--activity-action--hover--box-shadow;
|
||||
}
|
||||
&:active {
|
||||
color: $ibo-activity-panel--activity-action--color;
|
||||
background-color: $ibo-activity-panel--activity-action--background-color--is-active;
|
||||
}
|
||||
&.ibo-is-hidden{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.ibo-activity-panel--activity-action-separator {
|
||||
display: block;
|
||||
width: $ibo-activity-panel--activity-action-separator--width;
|
||||
height: $ibo-activity-panel--activity-action-separator--height;
|
||||
margin: auto;
|
||||
background-color: $ibo-activity-panel--activity-action-separator--background-color;
|
||||
}
|
||||
@@ -137,7 +137,8 @@ $ibo-activity-panel--open-icon--margin-left: 0.75rem !default;
|
||||
|
||||
.ibo-activity-panel--header,
|
||||
.ibo-activity-panel--body,
|
||||
.ibo-activity-panel--add-caselog-entry-button {
|
||||
.ibo-activity-panel--add-caselog-entry-button,
|
||||
.ibo-activity-panel--activity-actions{
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,3 +10,4 @@
|
||||
@import "transition-entry";
|
||||
@import "edits-entry";
|
||||
@import "notification-entry";
|
||||
@import "activity-action";
|
||||
|
||||
@@ -59,4 +59,9 @@ $ibo-caselog-entry-form--lock-message--margin-left: 1rem !default;
|
||||
}
|
||||
.ibo-caselog-entry-form--action-buttons--main-actions > .ibo-popover-menu {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ibo-caselog-entry-form--action-buttons--extra-actions{
|
||||
overflow: hidden;
|
||||
flex-grow: 1;
|
||||
}
|
||||
2
css/backoffice/layout/top-bar/_all.scss
Normal file
2
css/backoffice/layout/top-bar/_all.scss
Normal file
@@ -0,0 +1,2 @@
|
||||
@import "top-bar";
|
||||
@import "top-bar-action";
|
||||
40
css/backoffice/layout/top-bar/_top-bar-action.scss
Normal file
40
css/backoffice/layout/top-bar/_top-bar-action.scss
Normal file
@@ -0,0 +1,40 @@
|
||||
$ibo-top-bar-quick-action--head--background-color: $ibo-color-white-100 !default;
|
||||
|
||||
$ibo-top-bar-quick-action--icon-padding-x: $ibo-spacing-500 !default;
|
||||
$ibo-top-bar-quick-action--icon-padding-y: $ibo-spacing-0 !default;
|
||||
$ibo-top-bar-quick-action--icon--color: $ibo-color-primary-600 !default;
|
||||
$ibo-top-bar-quick-action--icon--color--on-hover: $ibo-color-primary-700 !default;
|
||||
$ibo-top-bar-quick-action--icon--color--on-active: $ibo-color-primary-800 !default;
|
||||
$ibo-top-bar-quick-action-separator--width: 2px !default;
|
||||
$ibo-top-bar-quick-action-separator--background-color: $ibo-color-grey-300 !default;
|
||||
$ibo-top-bar-quick-action-separator--margin-y: $ibo-spacing-0 !default;
|
||||
$ibo-top-bar-quick-action-separator--margin-x: $ibo-spacing-300 !default;
|
||||
|
||||
.ibo-top-bar-quick-action{
|
||||
position: relative;
|
||||
@extend %ibo-full-height-content;
|
||||
}
|
||||
.ibo-top-bar-quick-action--head{
|
||||
@extend %ibo-full-height-content;
|
||||
height: 100%;
|
||||
background-color: $ibo-top-bar-quick-action--head--background-color;
|
||||
}
|
||||
.ibo-top-bar-quick-action--icon{
|
||||
color: $ibo-top-bar-quick-action--icon--color;
|
||||
align-self: center;
|
||||
padding: $ibo-top-bar-quick-action--icon-padding-y $ibo-top-bar-quick-action--icon-padding-x;
|
||||
@extend %ibo-font-ral-nor-400;
|
||||
|
||||
&:hover{
|
||||
color: $ibo-top-bar-quick-action--icon--color--on-hover;
|
||||
}
|
||||
&:active{
|
||||
color: $ibo-top-bar-quick-action--icon--color--on-active;
|
||||
}
|
||||
}
|
||||
|
||||
.ibo-top-bar-quick-action-separator {
|
||||
width: $ibo-top-bar-quick-action-separator--width;
|
||||
background-color: $ibo-top-bar-quick-action-separator--background-color;
|
||||
margin: $ibo-top-bar-quick-action-separator--margin-y $ibo-top-bar-quick-action-separator--margin-x;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ $ibo-vendors-ckeditor--ck-mentions--item--padding-y: $ibo-spacing-200 !default;
|
||||
}
|
||||
}
|
||||
|
||||
.ck-editor__editable_inline:not(.ck-comment__input *) {
|
||||
.ck-editor__editable_inline:not(.ck-comment__input *), .ck-source-editing-area {
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
@@ -84,11 +84,6 @@ $ibo-vendors-ckeditor--ck-mentions--item--padding-y: $ibo-spacing-200 !default;
|
||||
}
|
||||
}
|
||||
|
||||
// N°7552 Allow source editing area to be scrollable in full screen
|
||||
.ck-maximize_editor_main .ck-source-editing-area textarea{
|
||||
overflow: auto !important;
|
||||
}
|
||||
|
||||
/* Mentions */
|
||||
.ck-mentions {
|
||||
.ck-button {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.3">
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.4">
|
||||
<constants>
|
||||
</constants>
|
||||
<classes>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2013 XXXXX
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', [
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
/**
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2024 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Dict::Add('EN GB', 'British English', 'British English', [
|
||||
'CAS:Error:UserNotAllowed' => 'User not allowed',
|
||||
'CAS:Login:SignIn' => 'Sign in with CAS',
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Spanish Localized data
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author Miguel Turrubiates <miguel_tf@yahoo.com>
|
||||
* @notas Utilizar codificación UTF-8 para mostrar acentos y otros caracteres especiales
|
||||
*
|
||||
*/
|
||||
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
|
||||
'CAS:Error:UserNotAllowed' => 'Usuario no permitido',
|
||||
|
||||
@@ -5,9 +5,13 @@
|
||||
*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Dict::Add('ZH CN', 'Chinese', '简体中文', [
|
||||
'CAS:Error:UserNotAllowed' => '用户被禁止登录',
|
||||
'CAS:Login:SignIn' => '使用CAS登录',
|
||||
'CAS:Login:SignInTooltip' => '点击这里使用CAS服务器认证',
|
||||
'CAS:Login:SignIn' => '使用 CAS 登录',
|
||||
'CAS:Login:SignInTooltip' => '点击这里使用 CAS 服务器认证',
|
||||
]);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'authent-cas/3.3.0',
|
||||
'authent-cas/3.4.0',
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
* This file is part of iTop.
|
||||
*
|
||||
|
||||
@@ -3,39 +3,13 @@
|
||||
/**
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2024 Combodo SAS
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* 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
|
||||
* along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
// Dictionnay conventions
|
||||
// Class:<class_name>
|
||||
// Class:<class_name>+
|
||||
// Class:<class_name>/Attribute:<attribute_code>
|
||||
// Class:<class_name>/Attribute:<attribute_code>+
|
||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>
|
||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+
|
||||
// Class:<class_name>/Stimulus:<stimulus_code>
|
||||
// Class:<class_name>/Stimulus:<stimulus_code>+
|
||||
|
||||
//
|
||||
// Class: UserExternal
|
||||
//
|
||||
|
||||
Dict::Add('EN GB', 'British English', 'British English', [
|
||||
'Class:UserExternal' => 'External user',
|
||||
'Class:UserExternal+' => 'User authentified outside of '.ITOP_APPLICATION_SHORT,
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Spanish Localized data
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author Miguel Turrubiates <miguel_tf@yahoo.com>
|
||||
* @notas Utilizar codificación UTF-8 para mostrar acentos y otros caracteres especiales
|
||||
*
|
||||
*/
|
||||
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
|
||||
'Class:UserExternal' => 'Usuario externo',
|
||||
|
||||
@@ -12,5 +12,5 @@
|
||||
*/
|
||||
Dict::Add('HU HU', 'Hungarian', 'Magyar', [
|
||||
'Class:UserExternal' => 'Külső felhasználó',
|
||||
'Class:UserExternal+' => '',
|
||||
'Class:UserExternal+' => 'User authentified outside of '.ITOP_APPLICATION_SHORT.'~~',
|
||||
]);
|
||||
|
||||
@@ -12,5 +12,5 @@
|
||||
*/
|
||||
Dict::Add('PT BR', 'Brazilian', 'Brazilian', [
|
||||
'Class:UserExternal' => 'Usuário externo',
|
||||
'Class:UserExternal+' => '',
|
||||
'Class:UserExternal+' => 'User authentified outside of '.ITOP_APPLICATION_SHORT.'~~',
|
||||
]);
|
||||
|
||||
@@ -10,31 +10,7 @@
|
||||
/**
|
||||
* @author Robert Deng <denglx@gmail.com>
|
||||
*
|
||||
* 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
|
||||
* along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
// Dictionnay conventions
|
||||
// Class:<class_name>
|
||||
// Class:<class_name>+
|
||||
// Class:<class_name>/Attribute:<attribute_code>
|
||||
// Class:<class_name>/Attribute:<attribute_code>+
|
||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>
|
||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+
|
||||
// Class:<class_name>/Stimulus:<stimulus_code>
|
||||
// Class:<class_name>/Stimulus:<stimulus_code>+
|
||||
//
|
||||
// Class: UserExternal
|
||||
//
|
||||
Dict::Add('ZH CN', 'Chinese', '简体中文', [
|
||||
'Class:UserExternal' => '外部用户',
|
||||
'Class:UserExternal+' => '用户在'.ITOP_APPLICATION_SHORT.'外部验证身份',
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'authent-external/3.3.0',
|
||||
'authent-external/3.4.0',
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.3">
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.4">
|
||||
<classes>
|
||||
<class id="UserLDAP" _delta="define">
|
||||
<parent>cmdbAbstractObject</parent>
|
||||
|
||||
@@ -16,13 +16,6 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', [
|
||||
'Class:UserLDAP' => 'LDAP uživatel',
|
||||
'Class:UserLDAP+' => 'Uživatel ověřen přes LDAP',
|
||||
'UserLDAP:server' => 'Specifika LDAP',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('CS CZ', 'Czech', 'Čeština', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -15,13 +15,6 @@ Dict::Add('DA DA', 'Danish', 'Dansk', [
|
||||
'Class:UserLDAP' => 'LDAP-Bruger',
|
||||
'Class:UserLDAP+' => 'Bruger der godkendes via LDAP',
|
||||
'UserLDAP:server' => 'LDAP specifics~~',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('DA DA', 'Danish', 'Dansk', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -15,13 +15,6 @@ Dict::Add('DE DE', 'German', 'Deutsch', [
|
||||
'Class:UserLDAP' => 'LDAP-Benutzer',
|
||||
'Class:UserLDAP+' => 'Benutzer, der via LDAP authentifiziert wird',
|
||||
'UserLDAP:server' => 'LDAP-Einstellungen',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('DE DE', 'German', 'Deutsch', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'LDAP-Server',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => 'Optional: LDAP-Server, der zur Authentifizierung verwendet werden soll, falls mehrere LDAP-Server konfiguriert sind.',
|
||||
]);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
* This file is part of iTop.
|
||||
*
|
||||
|
||||
@@ -3,41 +3,17 @@
|
||||
/**
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2024 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* 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
|
||||
* along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
// Dictionnay conventions
|
||||
// Class:<class_name>
|
||||
// Class:<class_name>+
|
||||
// Class:<class_name>/Attribute:<attribute_code>
|
||||
// Class:<class_name>/Attribute:<attribute_code>+
|
||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>
|
||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+
|
||||
// Class:<class_name>/Stimulus:<stimulus_code>
|
||||
// Class:<class_name>/Stimulus:<stimulus_code>+
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('EN GB', 'British English', 'British English', [
|
||||
'Class:UserLDAP' => 'LDAP user',
|
||||
'Class:UserLDAP+' => 'User authenticated by LDAP',
|
||||
'UserLDAP:server' => 'LDAP specifics',
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -1,24 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Spanish Localized data
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license https://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author Miguel Turrubiates <miguel_tf@yahoo.com>
|
||||
* @notas Utilizar codificación UTF-8 para mostrar acentos y otros caracteres especiales
|
||||
*
|
||||
*/
|
||||
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
|
||||
'Class:UserLDAP' => 'Usuario LDAP',
|
||||
'Class:UserLDAP+' => 'Usuario autenticado vía LDAP',
|
||||
'UserLDAP:server' => 'Especificaciones LDAP',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -14,13 +14,6 @@ Dict::Add('FR FR', 'French', 'Français', [
|
||||
'Class:UserLDAP' => 'Utilisateur LDAP',
|
||||
'Class:UserLDAP+' => 'Utilisateur authentifié par un serveur LDAP',
|
||||
'UserLDAP:server' => 'Champs spécifiques pour LDAP',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('FR FR', 'French', 'Français', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Serveur LDAP',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => 'Serveur LDAP utilisé pour l\'authentification de cet utilisateur',
|
||||
]);
|
||||
|
||||
@@ -14,13 +14,6 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', [
|
||||
'Class:UserLDAP' => 'LDAP felhasználó',
|
||||
'Class:UserLDAP+' => 'LDAP vagy AD felhasználó',
|
||||
'UserLDAP:server' => 'LDAP specifics~~',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('HU HU', 'Hungarian', 'Magyar', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -14,13 +14,6 @@ Dict::Add('IT IT', 'Italian', 'Italiano', [
|
||||
'Class:UserLDAP' => 'Utente LDAP',
|
||||
'Class:UserLDAP+' => 'Utente autenticato da LDAP',
|
||||
'UserLDAP:server' => 'Specifiche LDAP',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('IT IT', 'Italian', 'Italiano', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -15,13 +15,6 @@ Dict::Add('JA JP', 'Japanese', '日本語', [
|
||||
'Class:UserLDAP' => 'LDAP ユーザー',
|
||||
'Class:UserLDAP+' => 'LDAP認証ユーザー',
|
||||
'UserLDAP:server' => 'LDAP specifics~~',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('JA JP', 'Japanese', '日本語', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -10,18 +10,12 @@
|
||||
/**
|
||||
* @author Thomas Casteleyn <thomas.casteleyn@super-visions.com>
|
||||
* @author Jeffrey Bostoen <info@jeffreybostoen.be> (2018 - 2022)
|
||||
*
|
||||
*/
|
||||
Dict::Add('NL NL', 'Dutch', 'Nederlands', [
|
||||
'Class:UserLDAP' => 'LDAP-gebruiker',
|
||||
'Class:UserLDAP+' => 'Gebruiker die aanmeldt via LDAP',
|
||||
'UserLDAP:server' => 'LDAP informatie',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('NL NL', 'Dutch', 'Nederlands', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -14,13 +14,6 @@ Dict::Add('PL PL', 'Polish', 'Polski', [
|
||||
'Class:UserLDAP' => 'Użytkownik LDAP',
|
||||
'Class:UserLDAP+' => 'Użytkownik uwierzytelniony przez LDAP',
|
||||
'UserLDAP:server' => 'Serwer LDAP',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('PL PL', 'Polish', 'Polski', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -12,15 +12,8 @@
|
||||
*/
|
||||
Dict::Add('PT BR', 'Brazilian', 'Brazilian', [
|
||||
'Class:UserLDAP' => 'Usuário externo via LDAP',
|
||||
'Class:UserLDAP+' => '',
|
||||
'Class:UserLDAP+' => 'User authenticated by LDAP~~',
|
||||
'UserLDAP:server' => 'LDAP specifics~~',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('PT BR', 'Brazilian', 'Brazilian', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -14,14 +14,7 @@
|
||||
Dict::Add('RU RU', 'Russian', 'Русский', [
|
||||
'Class:UserLDAP' => 'Пользователь LDAP',
|
||||
'Class:UserLDAP+' => 'Пользователь, аутентифицируемый через LDAP',
|
||||
'UserLDAP:server' => 'LDAP specifics~~',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('RU RU', 'Russian', 'Русский', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'UserLDAP:server' => 'Особенности LDAP',
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Сервер LDAP',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -14,13 +14,6 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', [
|
||||
'Class:UserLDAP' => 'LDAP užívateľ',
|
||||
'Class:UserLDAP+' => 'User authenticated by LDAP~~',
|
||||
'UserLDAP:server' => 'LDAP specifics~~',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('SK SK', 'Slovak', 'Slovenčina', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
@@ -15,13 +15,6 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', [
|
||||
'Class:UserLDAP' => 'LDAP kullanıcısı',
|
||||
'Class:UserLDAP+' => 'Yetki kontrolü LDAP tarafından yapılan',
|
||||
'UserLDAP:server' => 'LDAP specifics~~',
|
||||
]);
|
||||
|
||||
//
|
||||
// Class: UserLDAP
|
||||
//
|
||||
|
||||
Dict::Add('TR TR', 'Turkish', 'Türkçe', [
|
||||
'Class:UserLDAP/Attribute:ldap_server' => 'Ldap server~~',
|
||||
'Class:UserLDAP/Attribute:ldap_server+' => '~~',
|
||||
]);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user