mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Compare commits
3 Commits
feature/88
...
feature/41
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2363f2fb21 | ||
|
|
c7eea3f51f | ||
|
|
5a77159ece |
99
.doc/README.md
Normal file
99
.doc/README.md
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
# Phpdoc dokuwiki template
|
||||||
|
This directory contains a template for rendering iTop phpdoc as dokuwiki pages.
|
||||||
|
|
||||||
|
|
||||||
|
Conventional tags that you should use:
|
||||||
|
* `@internal` : exclude from the documentation.
|
||||||
|
* `@api` : it means that a method is an api, thus it may be interacted with.
|
||||||
|
* `@see` : it points to another documented method
|
||||||
|
* `@link` : external url
|
||||||
|
* if you point to another page of the wiki, please use relative links.
|
||||||
|
* `@example` : let you provide example of code
|
||||||
|
* `@param`, `@return`, `@throws`, ...
|
||||||
|
|
||||||
|
|
||||||
|
## Special instructions
|
||||||
|
|
||||||
|
Some iTop specific tags were added :
|
||||||
|
* `@api-advanced`: it means that a method is an `@api` but mark it also as "complex" to use
|
||||||
|
* `@overwritable-hook`: used to mark a method as "designed to be extended"
|
||||||
|
* `@extension-hook`: not used for now
|
||||||
|
* `@phpdoc-tuning-exclude-inherited`: once this tag is present on a class, it's inherited methods won't be showed.
|
||||||
|
|
||||||
|
|
||||||
|
### known limitations:
|
||||||
|
#### `@see` tags must be very specific:
|
||||||
|
* always prefix class members (attributes or methods) with `ClassName::` (do not use self)
|
||||||
|
* for methods always suffix them with `()`,
|
||||||
|
* do not reference variables since they are not documented. If you have to, always prefix them with `$`
|
||||||
|
|
||||||
|
examples:
|
||||||
|
```
|
||||||
|
/**
|
||||||
|
* @see DBObject
|
||||||
|
* @see DBObject::Get()
|
||||||
|
* @see DBObject::$foo
|
||||||
|
*/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Do not use inline tags, they do not work properly, example:
|
||||||
|
```
|
||||||
|
/**
|
||||||
|
* This is a texts with an inline tag {@see [FQSEN] [<description>]} it must never be used
|
||||||
|
*/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### The `@example` tag must respect this very precise syntax
|
||||||
|
* the sentence in the first line (next to the tag) is the title, it must be enclosed by double quotes
|
||||||
|
* the following lines are the sample code.
|
||||||
|
* 💔 since we simply hack the official tag, this syntax must be respected carefully 💔
|
||||||
|
example:
|
||||||
|
```
|
||||||
|
/**
|
||||||
|
* @example "This is the title of the multiline example"
|
||||||
|
* $foo = DBObject::Get('foo');
|
||||||
|
* DBObject::Set('foo', ++$foo);
|
||||||
|
*/
|
||||||
|
```
|
||||||
|
|
||||||
|
## How content is included into the documentation
|
||||||
|
|
||||||
|
**For a class** those requirements have to be respected:
|
||||||
|
- the file containing the class must be listed in `/phpdoc/files/file[]` of `.doc/phpdoc-objects-manipulation.dist.xml`
|
||||||
|
- the class **must not** have the tag `@internal`
|
||||||
|
- the class **must** have at least one of: `@api`, `@api-advanced`, `@overwritable-hook`, `@extension-hook`
|
||||||
|
|
||||||
|
Then, **for a method** of an eligible class:
|
||||||
|
- **public** methods **must** have at least one of: `@api`, `@api-advanced`, `@overwritable-hook`, `@extension-hook`
|
||||||
|
- **protected** methods **must** have at least one of: `@overwritable-hook`, `@extension-hook`
|
||||||
|
- **private** methods are **always excluded**
|
||||||
|
|
||||||
|
**Class properties** and **constants** are never documented (this is subject to change).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## A note about the rendering engine
|
||||||
|
|
||||||
|
:notebook: as spaces are used to mark code, the templates (`.doc/phpdoc-templates/combodo-wiki/*`) have very few indentation, thus they are awful to read (sorry).
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```
|
||||||
|
cd .doc
|
||||||
|
composer require phpdocumentor/phpdocumentor:~2 --dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Generation
|
||||||
|
|
||||||
|
1. Switch to this directory : `cd /path/to/itop/.doc`
|
||||||
|
2. `composer install`
|
||||||
|
3. `./bin/build-doc-object-manipulation`
|
||||||
|
3. `./bin/build-doc-extensions`
|
||||||
|
4. Get the generated files from `/path/to/itop/data/phpdocumentor/output`
|
||||||
|
|
||||||
|
## Dokuwiki requirements
|
||||||
|
* the template uses the [wrap plugin](https://www.dokuwiki.org/plugin:wrap).
|
||||||
|
* the generated files have to be placed under an arbitrary directory of `[/path/to/dokuwiki]/data/pages`.
|
||||||
|
* the html has to be activated [config:htmlok](https://www.dokuwiki.org/config:htmlok)
|
||||||
|
* the generated files have to be in lowercase
|
||||||
6
.doc/bin/build-doc-extensions
Executable file
6
.doc/bin/build-doc-extensions
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
|
||||||
|
rm -rf /tmp/phpdoc-twig-cache/ && rm -rf data/phpdocumentor/output/extensions/ && rm -rf data/phpdocumentor/temp/extensions/ && ./vendor/bin/phpdoc -c ./phpdoc-extensions.dist.xml -vvv
|
||||||
|
|
||||||
|
# now wee need to lowercase every generated file because dokuwiki can't handle uppercase
|
||||||
|
cd ../data/phpdocumentor/output/extensions/ && for i in $(ls | grep [A-Z]); do mv -i $i $(echo $i | tr 'A-Z' 'a-z'); done
|
||||||
7
.doc/bin/build-doc-object-manipulation
Executable file
7
.doc/bin/build-doc-object-manipulation
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
|
||||||
|
rm -rf /tmp/phpdoc-twig-cache/ && rm -rf ../data/phpdocumentor/output/objects-manipulation/ && rm -rf ../data/phpdocumentor/temp/objects-manipulation/ && ./vendor/bin/phpdoc -c ./phpdoc-objects-manipulation.dist.xml -vvv
|
||||||
|
|
||||||
|
|
||||||
|
# now wee need to lowercase every generated file because dokuwiki can't handle uppercase
|
||||||
|
cd ../data/phpdocumentor/output/objects-manipulation/ && for i in $( ls | grep [A-Z] ); do mv -i $i `echo $i | tr 'A-Z' 'a-z'`; done
|
||||||
6
.doc/composer.json
Normal file
6
.doc/composer.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"require-dev": {
|
||||||
|
"phpdocumentor/phpdocumentor": "~2",
|
||||||
|
"jms/serializer": "1.7.*"
|
||||||
|
}
|
||||||
|
}
|
||||||
3015
.doc/composer.lock
generated
Normal file
3015
.doc/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 983 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
61
.doc/itop-version-history.md
Normal file
61
.doc/itop-version-history.md
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# iTop version history
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true,'mainBranchName': 'develop','rotateCommitLabel': true}} }%%
|
||||||
|
gitGraph
|
||||||
|
commit id: "2016-07-06" tag: "2.3.0"
|
||||||
|
branch support/2.3 order: 900
|
||||||
|
commit id: "2016-07-08" tag: "2.3.1"
|
||||||
|
commit id: "2016-12-22" tag: "2.3.3"
|
||||||
|
commit id: "2017-04-14" tag: "2.3.4"
|
||||||
|
checkout develop
|
||||||
|
commit id: "2017-07-12" tag: "2.4.0-beta" type: REVERSE
|
||||||
|
commit id: "2017-11-16" tag: "2.4.0"
|
||||||
|
branch support/2.4 order: 890
|
||||||
|
commit id: "2018-02-14" tag: "2.4.1"
|
||||||
|
checkout develop
|
||||||
|
commit id: "2018-04-25" tag: "2.5.0-beta" type: REVERSE
|
||||||
|
checkout support/2.4
|
||||||
|
commit id: "2018-06-14" tag: "2.4.2"
|
||||||
|
checkout develop
|
||||||
|
commit id: "2018-06-27" tag: "2.5.0"
|
||||||
|
branch support/2.5 order: 880
|
||||||
|
checkout develop
|
||||||
|
commit id: "2019-01-09" tag: "2.6.0"
|
||||||
|
branch support/2.6 order: 870
|
||||||
|
commit id: "2019-03-28" tag: "2.6.1"
|
||||||
|
checkout develop
|
||||||
|
commit id: "2019-12-18" tag: "2.7.0-beta" type: REVERSE
|
||||||
|
checkout support/2.5
|
||||||
|
commit id: "2020-01-22" tag: "2.5.4"
|
||||||
|
checkout support/2.6
|
||||||
|
commit id: "2020-01-23" tag: "2.6.3"
|
||||||
|
checkout develop
|
||||||
|
commit id: "2020-01-29" tag: "2.7.0-beta2" type: REVERSE
|
||||||
|
branch support/2.7 order: 860
|
||||||
|
commit id: "2020-04-01" tag: "2.7.0-1"
|
||||||
|
checkout support/2.6
|
||||||
|
commit id: "2020-04-22" tag: "2.6.4"
|
||||||
|
checkout support/2.7
|
||||||
|
commit id: "2020-06-26" tag: "2.7.1"
|
||||||
|
checkout support/2.7
|
||||||
|
commit id: "2020-12-09" tag: "2.7.3"
|
||||||
|
commit id: "2021-03-31" tag: "2.7.4"
|
||||||
|
checkout develop
|
||||||
|
commit id: "2021-04-06" tag: "3.0.0-beta" type: REVERSE
|
||||||
|
checkout support/2.7
|
||||||
|
commit id: "2021-07-05" tag: "2.7.5"
|
||||||
|
checkout develop
|
||||||
|
commit id: "2021-07-05." tag: "3.0.0-beta2" type: REVERSE
|
||||||
|
checkout support/2.7
|
||||||
|
commit id: "2021-12-17" tag: "2.7.6"
|
||||||
|
checkout develop
|
||||||
|
commit id: "2022-01-04" tag: "3.0.0"
|
||||||
|
branch support/3.0 order: 850
|
||||||
|
commit id: "2022-04-08" tag: "3.0.1"
|
||||||
|
checkout support/2.7
|
||||||
|
commit id: "2022-07-11" tag: "2.7.7"
|
||||||
|
checkout support/3.0
|
||||||
|
commit id: "2022-09-12" tag: "3.0.2-1"
|
||||||
|
checkout develop
|
||||||
|
```
|
||||||
20
.doc/phpdoc-extensions.dist.xml
Executable file
20
.doc/phpdoc-extensions.dist.xml
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<phpdoc>
|
||||||
|
<title><![CDATA[iTop extensions]]></title>
|
||||||
|
|
||||||
|
<parser>
|
||||||
|
<target>../data/phpdocumentor/temp/extensions</target>
|
||||||
|
</parser>
|
||||||
|
|
||||||
|
<transformer>
|
||||||
|
<target>../data/phpdocumentor/output/extensions</target>
|
||||||
|
</transformer>
|
||||||
|
|
||||||
|
<transformations>
|
||||||
|
<template name="phpdoc-templates/combodo-wiki"/>
|
||||||
|
</transformations>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<file>../application/applicationextension.inc.php</file>
|
||||||
|
</files>
|
||||||
|
</phpdoc>
|
||||||
58
.doc/phpdoc-objects-manipulation.dist.xml
Executable file
58
.doc/phpdoc-objects-manipulation.dist.xml
Executable file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<phpdoc>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
/**
|
||||||
|
The documentation of this file can be found here : https://docs.phpdoc.org/references/configuration.html
|
||||||
|
it has to be completed by the CLI parameters documentation which is more comprehensive: https://docs.phpdoc.org/references/commands/project_run.html#usage
|
||||||
|
|
||||||
|
usage:
|
||||||
|
vendor/bin/phpdoc -c phpdoc-objects-manipulation.dist.xml
|
||||||
|
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<title><![CDATA[iTop's objects manipulation API]]></title>
|
||||||
|
|
||||||
|
<parser>
|
||||||
|
<default-package-name>iTopORM</default-package-name>
|
||||||
|
<target>../data/phpdocumentor/temp/objects-manipulation</target>
|
||||||
|
<visibility>public,protected</visibility>
|
||||||
|
<markers>
|
||||||
|
<!--<item>TODO</item>-->
|
||||||
|
<!--<item>FIXME</item>-->
|
||||||
|
</markers>
|
||||||
|
<extensions>
|
||||||
|
<extension>php</extension>
|
||||||
|
</extensions>
|
||||||
|
</parser>
|
||||||
|
|
||||||
|
<transformer>
|
||||||
|
<target>../data/phpdocumentor/output/objects-manipulation</target>
|
||||||
|
</transformer>
|
||||||
|
|
||||||
|
<transformations>
|
||||||
|
<template name="phpdoc-templates/combodo-wiki"/>
|
||||||
|
</transformations>
|
||||||
|
|
||||||
|
<!--<logging>-->
|
||||||
|
<!--<level>warn</level>-->
|
||||||
|
<!--<paths>-->
|
||||||
|
<!--<!–<default>data/phpdocumentor/log/objects-manipulation/{DATE}.log</default>–>-->
|
||||||
|
<!--<!–<errors>data/phpdocumentor/log/objects-manipulation/{DATE}.errors.log</errors>–>-->
|
||||||
|
|
||||||
|
<!--<default>{APP_ROOT}/data/log/{DATE}.log</default>-->
|
||||||
|
<!--<errors>{APP_ROOT}/data/log/{DATE}.errors.log</errors>-->
|
||||||
|
<!--</paths>-->
|
||||||
|
<!--</logging>-->
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<file>../core/dbobject.class.php</file>
|
||||||
|
<file>../core/dbobjectsearch.class.php</file>
|
||||||
|
<file>../core/metamodel.class.php</file>
|
||||||
|
<file>../core/dbobjectset.class.php</file>
|
||||||
|
<file>../core/dbsearch.class.php</file>
|
||||||
|
<file>../core/dbunionsearch.class.php</file>
|
||||||
|
</files>
|
||||||
|
|
||||||
|
</phpdoc>
|
||||||
136
.doc/phpdoc-templates/combodo-wiki/class.txt.twig
Normal file
136
.doc/phpdoc-templates/combodo-wiki/class.txt.twig
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
{% extends 'layout.txt.twig' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<wrap button>[[start|🔙 Back]]</wrap>
|
||||||
|
|
||||||
|
{% if node.tags['internal'] is defined %}
|
||||||
|
====== {{ node.name }} ======
|
||||||
|
<WRAP alert>This class is "internal", and thus is not documented!</WRAP>
|
||||||
|
{% elseif node.tags['api'] is not defined and node.tags['api-advanced'] is not defined and node.tags['overwritable-hook'] is not defined and node.tags['extension-hook'] is not defined %}
|
||||||
|
====== {{ node.name }} ======
|
||||||
|
<WRAP alert>This class is neither "api", "api-advanced", "overwritable-hook" or "extension-hook", and thus is not documented!</WRAP>
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
====== {{ node.name }} ======
|
||||||
|
|
||||||
|
{% if node.deprecated %}<wrap danger>deprecated</wrap>{% endif %}
|
||||||
|
{% if node.abstract %}<wrap warning>abstract</wrap>{% endif %}
|
||||||
|
{% if node.final %}<wrap notice>final</wrap>{% endif %}
|
||||||
|
{% include 'includes/wrap-tags.txt.twig' with {structure:node, wrap: 'safety', wrapTags: ['api', 'api-advanced', 'overwritable-hook', 'extension-hook']} %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% if node.deprecated %}
|
||||||
|
=== **<del>Deprecated</del>**===
|
||||||
|
//{{ node.tags.deprecated[0].description }}//
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
== {{ node.summary|replace({"\n":""})|raw }} ==
|
||||||
|
<html>{{ node.description|markdown|raw }}</html>
|
||||||
|
|
||||||
|
|
||||||
|
{% include 'includes/code-examples.txt.twig' with {structure:node, title_level: '====='} %}
|
||||||
|
|
||||||
|
|
||||||
|
{% set class = node.parent %}
|
||||||
|
{% block hierarchy_element %}
|
||||||
|
|
||||||
|
{% if class and class.name is defined and class.name|trim != '' %}
|
||||||
|
==== parent ====
|
||||||
|
{% set child = class %}
|
||||||
|
{% set class = class.parent %}
|
||||||
|
{{ block('hierarchy_element') }}
|
||||||
|
[[{{ child.name }}|{{ child.name }}]]
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% for interface in node.interfaces|sort_asc %}
|
||||||
|
{% if loop.first %}
|
||||||
|
==== Implements ====
|
||||||
|
{% endif %}
|
||||||
|
{% if loop.length > 1 %} * {% endif %}{{ interface.fullyQualifiedStructuralElementName ?: interface }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
{% for trait in node.usedTraits|sort_asc %}
|
||||||
|
{% if loop.first %}
|
||||||
|
==== Uses traits ====
|
||||||
|
{% endif %}
|
||||||
|
{% if loop.length > 1 %} * {% endif %}{{ trait.fullyQualifiedStructuralElementName ?: trait }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
{% include 'includes/see-also.txt.twig' with {structure:node, title_level: '==='} %}
|
||||||
|
|
||||||
|
{% include 'includes/tags.txt.twig' with {structure:node, title_level: '=====', blacklist: ['link', 'see', 'abstract', 'example', 'method', 'property', 'property-read', 'property-write', 'package', 'subpackage', 'phpdoc-tuning-exclude-inherited', 'api', 'api-advanced', 'overwritable-hook', 'extension-hook', 'copyright', 'license', 'code-example']} %}
|
||||||
|
|
||||||
|
{% set methods = node.inheritedMethods.merge(node.methods.merge(node.magicMethods)) %}
|
||||||
|
{% include 'includes/tag-synthesys.txt.twig' with {methods:methods, tag:'api'} %}
|
||||||
|
{% include 'includes/tag-synthesys.txt.twig' with {methods:methods, tag:'api-advanced'} %}
|
||||||
|
{% include 'includes/tag-synthesys.txt.twig' with {methods:methods, tag:'overwritable-hook'} %}
|
||||||
|
{% include 'includes/tag-synthesys.txt.twig' with {methods:methods, tag:'extension-hook'} %}
|
||||||
|
|
||||||
|
|
||||||
|
{% include 'includes/code-examples.txt.twig' with {structure:node, title_level: '=====', sub_title_level: '=='} %}
|
||||||
|
|
||||||
|
<WRAP clear />
|
||||||
|
|
||||||
|
{% for method in methods|sort_asc
|
||||||
|
if method.visibility == 'public'
|
||||||
|
and (
|
||||||
|
method.tags['api'] is defined
|
||||||
|
or method.tags['api-advanced'] is defined
|
||||||
|
or method.tags['overwritable-hook'] is defined
|
||||||
|
or method.tags['extension-hook'] is defined
|
||||||
|
)
|
||||||
|
and (
|
||||||
|
node.tags['phpdoc-tuning-exclude-inherited'] is not defined
|
||||||
|
or method.parent.name == node.name
|
||||||
|
)
|
||||||
|
%}
|
||||||
|
{%- if loop.first %}
|
||||||
|
===== Public methods =====
|
||||||
|
{% endif %}
|
||||||
|
{{ block('method') }}
|
||||||
|
{% endfor %}
|
||||||
|
{% for method in methods|sort_asc if method.visibility == 'protected' and (method.tags['overwritable-hook'] is defined or method.tags['extension-hook'] is defined) %}
|
||||||
|
{%- if loop.first %}
|
||||||
|
===== Protected methods =====
|
||||||
|
{% endif %}
|
||||||
|
{{ block('method') }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% set constants = node.inheritedConstants.merge(node.constants) %}
|
||||||
|
{% if constants|length > 0 %}
|
||||||
|
===== Constants =====
|
||||||
|
{% for constant in constants|sort_asc %}
|
||||||
|
{{ block('constant') }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{#{% set properties = node.inheritedProperties.merge(node.properties.merge(node.magicProperties)) %}#}
|
||||||
|
{#{% for property in properties|sort_asc if property.visibility == 'public' %}#}
|
||||||
|
{#{%- if loop.first %}#}
|
||||||
|
{#===== Public properties =====#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
{#{{ block('property') }}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
{#{% for property in properties|sort_asc if property.visibility == 'protected' %}#}
|
||||||
|
{#{%- if loop.first %}#}
|
||||||
|
{#===== Protected properties =====#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
{#{{ block('property') }}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
|
||||||
|
|
||||||
|
{%- endif %} {#{% elseif node.tags['xxx'] is not defined and ... #}
|
||||||
|
|
||||||
|
<wrap button>[[start|🔙 Back]]</wrap>
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{% block constant %}
|
||||||
|
|
||||||
|
<WRAP group box >
|
||||||
|
<WRAP twothirds column >
|
||||||
|
==== {{ constant.name }} ====
|
||||||
|
</WRAP>{# twothirds column#}
|
||||||
|
|
||||||
|
<WRAP third column>
|
||||||
|
{% if constant.deprecated %}<wrap danger>deprecated</wrap> {% endif %}
|
||||||
|
{% if (node.parent is not null and constant.parent.fullyQualifiedStructuralElementName != node.fullyQualifiedStructuralElementName) %}<wrap notice>inherited</wrap> {% endif %}
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
|
||||||
|
== {{ constant.summary|replace({"\n":""})|raw }} ==
|
||||||
|
<html>{{ constant.description|markdown|raw }}</html>
|
||||||
|
|
||||||
|
{% if constant.deprecated %}
|
||||||
|
=== Deprecated ===
|
||||||
|
{{ constant.tags.deprecated[0].description|raw }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% include 'includes/inherited-from.txt.twig' with {structure:constant} %}
|
||||||
|
|
||||||
|
{% include 'includes/see-also.txt.twig' with {structure:constant, title_level: '=='} %}
|
||||||
|
|
||||||
|
{% include 'includes/uses.txt.twig' with {structure:constant, title_level: '=='} %}
|
||||||
|
|
||||||
|
{% include 'includes/tags.txt.twig' with {structure:constant, title_level: '==', blacklist: ['link', 'see', 'var', 'deprecated', 'uses', 'package', 'subpackage', 'todo', 'code-example']} %}
|
||||||
|
|
||||||
|
</WRAP>{# group #}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
95
.doc/phpdoc-templates/combodo-wiki/elements/method.txt.twig
Normal file
95
.doc/phpdoc-templates/combodo-wiki/elements/method.txt.twig
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
{% block method %}
|
||||||
|
|
||||||
|
|
||||||
|
<WRAP group box >
|
||||||
|
<WRAP twothirds column >
|
||||||
|
==== {{ method.name }} ====
|
||||||
|
</WRAP>{# twothirds column#}
|
||||||
|
<WRAP third column >
|
||||||
|
{% include 'includes/wrap-tags.txt.twig' with {structure:method, wrap: 'safety', wrapTags: ['api', 'api-advanced', 'overwritable-hook', 'extension-hook']} %}
|
||||||
|
{% if method.deprecated %}<wrap danger>deprecated</wrap> {% endif %}
|
||||||
|
{% if (node.parent is not null and method.parent.fullyQualifiedStructuralElementName != node.fullyQualifiedStructuralElementName) %}<wrap notice>inherited</wrap> {% endif %}
|
||||||
|
{% if method.abstract %}<wrap warning>abstract</wrap> {% endif %}
|
||||||
|
{% if method.final %}<wrap notice>final</wrap> {% endif %}
|
||||||
|
<wrap notice>{{ method.visibility }}</wrap>
|
||||||
|
{% if method.static %}<wrap warning>static</wrap> {% endif %}
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
|
||||||
|
|
||||||
|
== {{ method.summary|replace({"\n":""})|raw }} ==
|
||||||
|
<html>{{ method.description|markdown|raw }}</html>
|
||||||
|
|
||||||
|
<code php>{% if method.abstract %}abstract {% endif %}{% if method.final %}final {% endif %}{{ method.visibility }} {% if method.static %}static {% endif %}{{ method.name }}({% for argument in method.arguments %}{{ argument.isVariadic ? '...' }}{{ argument.name }}{{ argument.default ? (' = '~argument.default)|raw }}{% if not loop.last %}, {% endif %}{% endfor %})</code>
|
||||||
|
|
||||||
|
<WRAP twothirds column >
|
||||||
|
|
||||||
|
|
||||||
|
=== Parameters ===
|
||||||
|
{% if method.arguments|length > 0 -%}
|
||||||
|
^ types ^ name ^ default ^ description ^
|
||||||
|
{% for argument in method.arguments -%}
|
||||||
|
| **<nowiki>{{ argument.types|join('|')|raw }}</nowiki>** | {{ argument.name }} {{ argument.isVariadic ? '<small style="color: gray">variadic</small>' }} | <nowiki>{{ argument.default|raw }}</nowiki> | {{ argument.description|trim|replace("\n", ' ')|raw }} |{{ "\r\n" }}
|
||||||
|
{%- endfor %}
|
||||||
|
{% else %}
|
||||||
|
//none//
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{#=== Parameters ===#}
|
||||||
|
{#{% if method.arguments|length > 0 -%}#}
|
||||||
|
{#{% for argument in method.arguments -%}#}
|
||||||
|
{#== {{ argument.name }} ==#}
|
||||||
|
|
||||||
|
|
||||||
|
{#{% set varDesc %}#}
|
||||||
|
{#<span style="margin:0 10px; 0 20px; font-weight: bold;">{{ argument.types|join('|') }}</span>#}
|
||||||
|
{#{{ argument.isVariadic ? '<small style="color: gray">variadic</small>' }}#}
|
||||||
|
{#{{ argument.description|raw }}#}
|
||||||
|
{#{% endset %}#}
|
||||||
|
{#<html>{{ varDesc|markdown|raw }}</html>#}
|
||||||
|
{#{%- endfor %}#}
|
||||||
|
{#{% else %}#}
|
||||||
|
{#<wrap tip>This method has no parameter</wrap>#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
|
||||||
|
|
||||||
|
{% if method.response and method.response.types|join() != 'void' %}
|
||||||
|
=== Returns ===
|
||||||
|
<html>{{ ('**' ~ method.response.types|join('|')|trim ~ '** ' ~ method.response.description)|markdown|raw }}</html>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</WRAP>{# twothirds column#}
|
||||||
|
|
||||||
|
<WRAP third column >
|
||||||
|
|
||||||
|
{% if method.tags.throws|length > 0 or method.tags.throw|length > 0 %}
|
||||||
|
=== Throws ===
|
||||||
|
{% for exception in method.tags.throws -%}
|
||||||
|
{% if loop.length > 1 %} * {% endif %}''{{ exception.types|join('|')|raw }}'' <nowiki>{{ exception.description|raw }}</nowiki>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% include 'includes/inherited-from.txt.twig' with {structure:method} %}
|
||||||
|
|
||||||
|
{% include 'includes/see-also.txt.twig' with {structure:method, title_level: '==='} %}
|
||||||
|
|
||||||
|
{% include 'includes/uses.txt.twig' with {structure:method, title_level: '==='} %}
|
||||||
|
|
||||||
|
{% include 'includes/used-by.txt.twig' with {structure:method, title_level: '==='} %}
|
||||||
|
|
||||||
|
{% include 'includes/tags-with-description.txt.twig' with {structure:method, title_level: '===', WRAP: 'info', tagsWithDescription: ['api', 'api-advanced', 'overwritable-hook', 'extension-hook']} %}
|
||||||
|
|
||||||
|
{% include 'includes/tags.txt.twig' with {structure:method, title_level: '===', blacklist: ['todo', 'link', 'see', 'abstract', 'example', 'param', 'return', 'access', 'deprecated', 'throws', 'throw', 'uses', 'api', 'api-advanced', 'overwritable-hook', 'extension-hook', 'used-by', 'inheritdoc', 'code-example']} %}
|
||||||
|
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% include 'includes/code-examples.txt.twig' with {structure:method, title_level: '==='} %}
|
||||||
|
|
||||||
|
</WRAP>{# group #}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
{% block property %}
|
||||||
|
|
||||||
|
<WRAP group box>
|
||||||
|
<WRAP twothirds column >
|
||||||
|
==== ${{ property.name }} ====
|
||||||
|
</WRAP>{# twothirds column#}
|
||||||
|
|
||||||
|
<WRAP third column>
|
||||||
|
{% if property.deprecated %}<wrap danger>deprecated</wrap> {% endif %}
|
||||||
|
{% if (node.parent is not null and property.parent.fullyQualifiedStructuralElementName != node.fullyQualifiedStructuralElementName) %}<wrap notice>inherited</wrap> {% endif %}
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
== {{ property.summary|replace({"\n":""})|raw }} ==
|
||||||
|
<html>{{ property.description|markdown|raw }}</html>
|
||||||
|
{% if property.var.0.description %}<html>{{ property.var.0.description|markdown|raw }}</html>{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{#{% if property.types %}#}
|
||||||
|
{#== Type ==#}
|
||||||
|
{#{% for type in property.types %}#}
|
||||||
|
{#{% if loop.length > 1 %} * {% endif %}{{ type|raw }} : {{ type.description|raw }}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
{#{{ property.types|join('|')|raw }}#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
|
||||||
|
|
||||||
|
{% if property.deprecated %}
|
||||||
|
== Deprecated ==
|
||||||
|
{{ property.tags.deprecated[0].description }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% include 'includes/inherited-from.txt.twig' with {structure:property} %}
|
||||||
|
|
||||||
|
{% include 'includes/see-also.txt.twig' with {structure:property, title_level: '=='} %}
|
||||||
|
|
||||||
|
{% include 'includes/uses.txt.twig' with {structure:property, title_level: ''} %}
|
||||||
|
|
||||||
|
{% include 'includes/tags.txt.twig' with {structure:property, title_level: '==', blacklist: ['link', 'see', 'access', 'var', 'deprecated', 'uses', 'todo', 'code-example']} %}
|
||||||
|
|
||||||
|
|
||||||
|
<code php>{{ property.visibility }} ${{ property.name }}{% if property.types %} : {{ property.types|join('|')|raw }}{% endif %}</code>
|
||||||
|
|
||||||
|
</WRAP>{# group #}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
1
.doc/phpdoc-templates/combodo-wiki/file.source.txt.twig
Normal file
1
.doc/phpdoc-templates/combodo-wiki/file.source.txt.twig
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{{ node.source|raw }}
|
||||||
122
.doc/phpdoc-templates/combodo-wiki/file.txt.twig
Normal file
122
.doc/phpdoc-templates/combodo-wiki/file.txt.twig
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
{% extends 'layout.txt.twig' %}
|
||||||
|
|
||||||
|
{% block javascripts %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{#<section class="row-fluid">#}
|
||||||
|
{#<div class="span2 sidebar">#}
|
||||||
|
{#{% set namespace = project.namespace %}#}
|
||||||
|
{#{{ block('sidebarNamespaces') }}#}
|
||||||
|
{#</div>#}
|
||||||
|
{#</section>#}
|
||||||
|
{#<section class="row-fluid">#}
|
||||||
|
====== {{ node.path|split('/')|slice(0,-1)|join('/') }}{{ node.name }} ======
|
||||||
|
{{ node.summary }}
|
||||||
|
<html>{{ node.description|markdown|raw }}</html>
|
||||||
|
|
||||||
|
{% if node.traits|length > 0 %}
|
||||||
|
|
||||||
|
===== Traits =====
|
||||||
|
{% for trait in node.traits %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ trait|raw }}</td>
|
||||||
|
<td><em>{{ trait.summary }}</em></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{% if node.interfaces|length > 0 %}
|
||||||
|
===== Interfaces =====
|
||||||
|
{% for interface in node.interfaces %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ interface|raw }}</td>
|
||||||
|
<td><em>{{ interface.summary }}</em></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if node.classes|length > 0 %}
|
||||||
|
===== Classes =====
|
||||||
|
{% for class in node.classes %}
|
||||||
|
{{ class|raw }}
|
||||||
|
<em>{{ class.summary }}</em>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if node.package is not empty and node.package != '\\' %}
|
||||||
|
===== Package =====
|
||||||
|
{{ node.subpackage ? (node.package ~ '\\' ~ node.subpackage) : node.package }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% for tagName,tags in node.tags if tagName in ['link', 'see'] %}
|
||||||
|
{% if loop.first %}
|
||||||
|
===== See also =====
|
||||||
|
{% endif %}
|
||||||
|
{% for tag in tags %}
|
||||||
|
<dd><a href="{{ tag.reference ?: tag.link }}"><div class="namespace-wrapper">{{ tag.description ?: tag.reference }}</div></a></dd>
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<table class="table table-condensed">
|
||||||
|
{% for tagName,tags in node.tags if tagName not in ['link', 'see', 'package', 'subpackage'] %}
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
{{ tagName }}
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
{% for tag in tags %}
|
||||||
|
{{ tag.description|markdown|raw }}
|
||||||
|
{% endfor %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr><td colspan="2"><em>None found</em></td></tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</aside>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if node.constants|length > 0 %}
|
||||||
|
<div class="row-fluid">
|
||||||
|
<section class="span8 content file">
|
||||||
|
<h2>Constants</h2>
|
||||||
|
</section>
|
||||||
|
<aside class="span4 detailsbar"></aside>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% for constant in node.constants %}
|
||||||
|
{{ block('constant') }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if node.functions|length > 0 %}
|
||||||
|
<div class="row-fluid">
|
||||||
|
<section class="span8 content file">
|
||||||
|
<h2>Functions</h2>
|
||||||
|
</section>
|
||||||
|
<aside class="span4 detailsbar"></aside>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% for method in node.functions %}
|
||||||
|
{{ block('method') }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h3 id="source-view-label">{{ node.file.name }}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<pre data-src="{{ path('files/' ~ node.path ~ '.txt')|raw }}" class="language-php line-numbers"></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
42
.doc/phpdoc-templates/combodo-wiki/graphs/class.html.twig
Normal file
42
.doc/phpdoc-templates/combodo-wiki/graphs/class.html.twig
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{% extends 'layout.html.twig' %}
|
||||||
|
|
||||||
|
{% block stylesheets %}
|
||||||
|
<link href="{{ path('css/jquery.iviewer.css') }}" rel="stylesheet" media="all"/>
|
||||||
|
<style>
|
||||||
|
#viewer {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block javascripts %}
|
||||||
|
<script src="{{ path('js/jquery.mousewheel.js') }}" type="text/javascript"></script>
|
||||||
|
<script src="{{ path('js/jquery.iviewer.js') }}" type="text/javascript"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(window).resize(function(){
|
||||||
|
$("#viewer").height($(window).height() - 100);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("#viewer").iviewer({src: '{{ path('graphs/classes.svg') }}', zoom_animation: false});
|
||||||
|
$('#viewer img').bind('dragstart', function(event){
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
||||||
|
$(window).resize();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div class="wrapper">
|
||||||
|
<div id="viewer" class="viewer"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
5
.doc/phpdoc-templates/combodo-wiki/htaccess.dist
Normal file
5
.doc/phpdoc-templates/combodo-wiki/htaccess.dist
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Fixes a vulnerability in CentOS: http://stackoverflow.com/questions/20533279/prevent-php-from-parsing-non-php-files-such-as-somefile-php-txt
|
||||||
|
<FilesMatch \.php\.txt$>
|
||||||
|
RemoveHandler .php
|
||||||
|
ForceType text/plain
|
||||||
|
</FilesMatch>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{% if title_level is not defined %}
|
||||||
|
{%- set title_level = '==' -%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if sub_title_level is not defined %}
|
||||||
|
{%- set sub_title_level = title_level|slice(1) -%}
|
||||||
|
{% endif %}
|
||||||
|
{% if sub_title_level == '=' %}
|
||||||
|
{%- set sub_title_level = '' -%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{#{% for tagName,tags in structure.tags if tagName in ['code-example'] %}#}
|
||||||
|
{#{% if loop.first %}#}
|
||||||
|
{#{{title_level}} Examples {{title_level}}#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
{#{% for tag in tags %}#}
|
||||||
|
{#{%- set descToken = tag.description|split("\n", 2) -%}#}
|
||||||
|
{#{%- set title = descToken[0] -%}#}
|
||||||
|
{#{%- set code = descToken[1] -%}#}
|
||||||
|
{#{{sub_title_level}} {{ title }} {{sub_title_level}}#}
|
||||||
|
{#<code php>{{ code|raw }}</code>#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
|
||||||
|
|
||||||
|
{% for tagName,tags in structure.tags if tagName in ['example'] %}
|
||||||
|
{% if loop.first %}
|
||||||
|
{{title_level}} Examples {{title_level}}
|
||||||
|
{% endif %}
|
||||||
|
{% for tag in tags %}
|
||||||
|
{{ sub_title_level }} {{ tag.filePath|escape }}{{ sub_title_level }}
|
||||||
|
<code php>{{ tag.description|raw }}</code>
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{% if title_level is not defined %}
|
||||||
|
{% set title_level='' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (node.parent is null) %}
|
||||||
|
{{title_level}} File {{ structure.path }} {{title_level}}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (node.parent is not null and structure.parent.fullyQualifiedStructuralElementName != node.fullyQualifiedStructuralElementName) %}
|
||||||
|
{{title_level}} Inherited from {{title_level}}
|
||||||
|
[[{{structure.parent}}|{{structure.parent}}]]
|
||||||
|
{% endif %}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{% for structure in structures|sort_asc if structure.tags['internal'] is not defined and (structure.tags['api'] is defined or structure.tags['api-advanced'] is defined or structure.tags['overwritable-hook'] is defined or structure.tags['extension-hook'] is defined ) %}
|
||||||
|
{#{{ structure|raw }}#}
|
||||||
|
|
||||||
|
{% set structureName = structure|trim('\\', 'left') %}
|
||||||
|
|
||||||
|
<WRAP group box>
|
||||||
|
<WRAP twothirds column >
|
||||||
|
==== {{ structureName }} ====
|
||||||
|
</WRAP>{# twothirds column#}
|
||||||
|
|
||||||
|
<WRAP third column>
|
||||||
|
{% if structure.deprecated %}<wrap danger>deprecated</wrap>{% endif %}
|
||||||
|
{% if structure.abstract %}<wrap warning>abstract</wrap>{% endif %}
|
||||||
|
{% if structure.final %}<wrap notice>final</wrap>{% endif %}
|
||||||
|
{% if (node.parent is not null and structure.parent.fullyQualifiedStructuralElementName != node.fullyQualifiedStructuralElementName) %}<wrap notice>inherited</wrap> {% endif %}
|
||||||
|
{% include 'includes/wrap-tags.txt.twig' with {structure:structure, wrap: 'safety', wrapTags: ['api', 'api-advanced', 'overwritable-hook', 'extension-hook']} %}
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
|
||||||
|
|
||||||
|
{{ structure.summary|raw }}
|
||||||
|
[[{{structureName}}|More information]]
|
||||||
|
|
||||||
|
</WRAP>{# group #}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{% if title_level is not defined %}
|
||||||
|
{%- set title_level='==' -%}
|
||||||
|
{% endif %}
|
||||||
|
{% for tagName,tags in structure.tags if tagName in ['link', 'see'] %}
|
||||||
|
{% if loop.first %}
|
||||||
|
{{title_level}} See also {{title_level}}
|
||||||
|
{% endif %}
|
||||||
|
{% for tag in tags %}
|
||||||
|
{%- set linkTag = tag.reference|trim('\\', 'left') -%}
|
||||||
|
{% if not('()' in linkTag or '$' in linkTag or node.name in linkTag or '::' in linkTag ) %}
|
||||||
|
{%- set linkTag = linkTag|lower -%}
|
||||||
|
{% elseif node.name~'::' in linkTag %}
|
||||||
|
{%- set linkTag = linkTag|replace({(node.name~'::'): '#'})|lower -%}
|
||||||
|
{% elseif '::' in linkTag -%}
|
||||||
|
{%- set linkTag = linkTag|replace({'::': '#'})|lower -%}
|
||||||
|
{% else %}
|
||||||
|
{%- set linkTag = '#' ~ linkTag|lower -%}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{% if loop.length > 1 %} * {% endif %}{% if tag.reference is not empty -%}
|
||||||
|
[[{{linkTag}}|{{ (tag.reference)|trim('\\', 'left') }}]] {% if tag.description|trim is not empty %}: {{ tag.description|trim('\\', 'left') }} {% endif %}
|
||||||
|
{%- else -%}
|
||||||
|
{#{{ tag.description|trim('\\', 'left') }}#}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
{% if tag is not defined -%}
|
||||||
|
{# Do not display @api if @api-advanced is also present #}
|
||||||
|
{%- set tag = "api" -%}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{% if hidden_by is not defined -%}
|
||||||
|
{# Do not display @api if @api-advanced is also present #}
|
||||||
|
{%- set hidden_by = {"api" : "api-advanced"} -%}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% for method in methods|sort_asc
|
||||||
|
if (method.visibility == 'public')
|
||||||
|
and (
|
||||||
|
method.tags[tag] is defined
|
||||||
|
and (
|
||||||
|
hidden_by[tag] is not defined or method.tags[hidden_by[tag]] is not defined
|
||||||
|
)
|
||||||
|
)
|
||||||
|
%}
|
||||||
|
{%- if loop.first %}
|
||||||
|
{% if tag == 'api' %}
|
||||||
|
===== API synthesis =====
|
||||||
|
<WRAP>
|
||||||
|
List of the public API methods.
|
||||||
|
When manipulating {{ node.name }}, You can call those methods:
|
||||||
|
</WRAP>
|
||||||
|
{% elseif tag == 'api-advanced' %}
|
||||||
|
===== Advanced API synthesis =====
|
||||||
|
<WRAP>
|
||||||
|
List of advanced API methods
|
||||||
|
Beware they usage is recommended to advanced users only.
|
||||||
|
</WRAP>
|
||||||
|
{% elseif tag == 'overwritable-hook' %}
|
||||||
|
===== overwritable-hook synthesis =====
|
||||||
|
<WRAP >When inheriting from {{ node.name }},
|
||||||
|
you can overwrite those methods in order to add custom logic:
|
||||||
|
</WRAP>
|
||||||
|
{% elseif tag == 'extension-hook' %}
|
||||||
|
===== extension-hook synthesis =====
|
||||||
|
<WRAP >
|
||||||
|
When inheriting from {{ node.name }},
|
||||||
|
you can extend the behaviour of iTop by implementing:
|
||||||
|
</WRAP>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% set sanitizedMethod = method|trim('\\', 'left')|replace({(node.name~'::'): ''}) %}
|
||||||
|
{% if '::' in sanitizedMethod -%}
|
||||||
|
{%- if node.tags['phpdoc-tuning-exclude-inherited'] is not defined %}
|
||||||
|
* [[{{sanitizedMethod|replace({'::': '#'})|lower}}|↪{{sanitizedMethod}}]] — {{ method.summary|replace({"\n":""})|raw }}
|
||||||
|
{% endif %}
|
||||||
|
{%- else %}
|
||||||
|
* [[#{{sanitizedMethod}}|{{sanitizedMethod}}]] — {{ method.summary|replace({"\n":""})|raw }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{% if title_level is not defined %}
|
||||||
|
{% set title_level = '==' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{%- for tagName,tags in structure.tags if tagName in tagsWithDescription -%}
|
||||||
|
{%- for tag in tags -%}
|
||||||
|
{%- if tag.description is not empty -%}
|
||||||
|
{%- if WRAP is defined -%}
|
||||||
|
<WRAP {{WRAP}}>
|
||||||
|
{%- endif -%}
|
||||||
|
{{title_level}} {{ tagName }} {{title_level}}
|
||||||
|
{{ tag.description|escape }}
|
||||||
|
{%- if WRAP is defined -%}
|
||||||
|
</WRAP>
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
|
||||||
22
.doc/phpdoc-templates/combodo-wiki/includes/tags.txt.twig
Normal file
22
.doc/phpdoc-templates/combodo-wiki/includes/tags.txt.twig
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{% if title_level is not defined %}
|
||||||
|
{% set title_level='=====' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if blacklist is not defined %}
|
||||||
|
{% set blacklist =['link', 'see', 'abstract', 'example', 'method', 'property', 'property-read', 'property-write', 'package', 'subpackage', 'api', 'api-advanced', 'todo', 'code-example'] %}
|
||||||
|
{% endif %}
|
||||||
|
{% if hidden_by is not defined -%}
|
||||||
|
{# Do not display @api if @api-advanced is also present #}
|
||||||
|
{%- set hidden_by = {"api" : "api-advanced"} -%}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{#^ {% for tagName,tags in structure.tags if tagName not in blacklist -%}#}
|
||||||
|
{#{{ tagName }} ^#}
|
||||||
|
{#{%- endfor %}#}
|
||||||
|
|
||||||
|
{% for tagName,tags in structure.tags if tagName not in blacklist and (hidden_by[tagName] is not defined or structure.tags[hidden_by[tagName]] is not defined) %}
|
||||||
|
{%- if loop.first %}
|
||||||
|
{{title_level}} Tags {{title_level}}
|
||||||
|
{% endif %}
|
||||||
|
^ {{ tagName }} | {% for tag in tags %}{{ tag.version ? tag.version ~ ' ' : '' }}{{ tag.description}}{% endfor %} |
|
||||||
|
{% endfor %}
|
||||||
24
.doc/phpdoc-templates/combodo-wiki/includes/used-by.txt.twig
Normal file
24
.doc/phpdoc-templates/combodo-wiki/includes/used-by.txt.twig
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{% if title_level is not defined %}
|
||||||
|
{% set title_level='' %}
|
||||||
|
{% endif %}
|
||||||
|
{% for tagName,tags in structure.tags if tagName in ['used-by'] %}
|
||||||
|
{% if loop.first %}
|
||||||
|
{{title_level}} Used by {{title_level}}
|
||||||
|
{% endif %}
|
||||||
|
{% for tag in tags %}
|
||||||
|
{% if loop.length > 1 %} * {% endif %}{{ tag.reference ?: tag.link }} : {{ tag.description ?: tag.reference }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{#{% for tagName,tags in method.tags if tagName in ['uses'] %}#}
|
||||||
|
{#{% if loop.first %}#}
|
||||||
|
{#<dt>Uses</dt>#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
{#{% for tag in tags %}#}
|
||||||
|
{#<dd>{{ tag.reference|raw }}</dd>#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
24
.doc/phpdoc-templates/combodo-wiki/includes/uses.txt.twig
Normal file
24
.doc/phpdoc-templates/combodo-wiki/includes/uses.txt.twig
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{% if title_level is not defined %}
|
||||||
|
{% set title_level='' %}
|
||||||
|
{% endif %}
|
||||||
|
{% for tagName,tags in structure.tags if tagName in ['uses'] %}
|
||||||
|
{% if loop.first %}
|
||||||
|
{{title_level}} Uses {{title_level}}
|
||||||
|
{% endif %}
|
||||||
|
{% for tag in tags %}
|
||||||
|
{% if loop.length > 1 %} * {% endif %}{{ tag.reference ?: tag.link }} : {{ tag.description ?: tag.reference }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{#{% for tagName,tags in method.tags if tagName in ['uses'] %}#}
|
||||||
|
{#{% if loop.first %}#}
|
||||||
|
{#<dt>Uses</dt>#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
{#{% for tag in tags %}#}
|
||||||
|
{#<dd>{{ tag.reference|raw }}</dd>#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{% if wrap is not defined -%}
|
||||||
|
{% set wrap = 'notice' %}
|
||||||
|
{%- endif -%}
|
||||||
|
{% if hidden_by is not defined -%}
|
||||||
|
{# Do not display @api if @api-advanced is also present #}
|
||||||
|
{%- set hidden_by = {"api" : "api-advanced"} -%}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- for tagName,tags in structure.tags if tagName in wrapTags and (hidden_by[tagName] is not defined or structure.tags[hidden_by[tagName]] is not defined) %}
|
||||||
|
<wrap {{wrap}}>{{tagName}}</wrap>
|
||||||
|
{% endfor %}
|
||||||
121
.doc/phpdoc-templates/combodo-wiki/interface.txt.twig
Normal file
121
.doc/phpdoc-templates/combodo-wiki/interface.txt.twig
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
{% extends 'layout.txt.twig' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<wrap button>[[start|🔙 Back]]</wrap>
|
||||||
|
|
||||||
|
{% if node.tags['internal'] is defined %}
|
||||||
|
====== {{ node.name }} ======
|
||||||
|
<WRAP alert>This interface is "internal", and thus is not documented!</WRAP>
|
||||||
|
{% elseif node.tags['api'] is not defined and node.tags['api-advanced'] is not defined and node.tags['overwritable-hook'] is not defined and node.tags['extension-hook'] is not defined %}
|
||||||
|
====== {{ node.name }} ======
|
||||||
|
<WRAP alert>This interface is neither "api", "overwritable-hook" or "extension-hook", and thus is not documented!</WRAP>
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
====== {{ node.name }} ======
|
||||||
|
|
||||||
|
{% if node.deprecated %}<wrap danger>deprecated</wrap>{% endif %}
|
||||||
|
{% if node.abstract %}<wrap warning>abstract</wrap>{% endif %}
|
||||||
|
{% if node.final %}<wrap notice>final</wrap>{% endif %}
|
||||||
|
{% include 'includes/wrap-tags.txt.twig' with {structure:node, wrap: 'safety', wrapTags: ['api', 'api-advanced', 'overwritable-hook', 'extension-hook']} %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% if node.deprecated %}
|
||||||
|
=== **<del>Deprecated</del>**===
|
||||||
|
//{{ node.tags.deprecated[0].description }}//
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
== {{ node.summary|replace({"\n":""})|raw }} ==
|
||||||
|
<html>{{ node.description|markdown|raw }}</html>
|
||||||
|
|
||||||
|
|
||||||
|
{% include 'includes/code-examples.txt.twig' with {structure:node, title_level: '====='} %}
|
||||||
|
|
||||||
|
|
||||||
|
{% set class = node.parent %}
|
||||||
|
{% block hierarchy_element %}
|
||||||
|
|
||||||
|
{% if class and class.name is defined and class.name|trim != '' %}
|
||||||
|
==== parent ====
|
||||||
|
{% set child = class %}
|
||||||
|
{% set class = class.parent %}
|
||||||
|
{{ block('hierarchy_element') }}
|
||||||
|
[[{{ child.name }}|{{ child.name }}]]
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% for interface in node.interfaces|sort_asc %}
|
||||||
|
{% if loop.first %}
|
||||||
|
==== Implements ====
|
||||||
|
{% endif %}
|
||||||
|
{% if loop.length > 1 %} * {% endif %}{{ interface.fullyQualifiedStructuralElementName ?: interface }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
{% for trait in node.usedTraits|sort_asc %}
|
||||||
|
{% if loop.first %}
|
||||||
|
==== Uses traits ====
|
||||||
|
{% endif %}
|
||||||
|
{% if loop.length > 1 %} * {% endif %}{{ trait.fullyQualifiedStructuralElementName ?: trait }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
{% include 'includes/see-also.txt.twig' with {structure:node, title_level: '==='} %}
|
||||||
|
|
||||||
|
{% include 'includes/tags.txt.twig' with {structure:node, title_level: '=====', blacklist: ['link', 'see', 'abstract', 'example', 'method', 'property', 'property-read', 'property-write', 'package', 'subpackage', 'phpdoc-tuning-exclude-inherited', 'api', 'api-advanced', 'overwritable-hook', 'extension-hook', 'copyright', 'license', 'code-example']} %}
|
||||||
|
|
||||||
|
|
||||||
|
{% set methods = node.inheritedMethods.merge(node.methods) %}
|
||||||
|
{% include 'includes/tag-synthesys.txt.twig' with {methods:methods, tag:'api'} %}
|
||||||
|
{% include 'includes/tag-synthesys.txt.twig' with {methods:methods, tag:'api-advanced'} %}
|
||||||
|
{% include 'includes/tag-synthesys.txt.twig' with {methods:methods, tag:'overwritable-hook'} %}
|
||||||
|
{% include 'includes/tag-synthesys.txt.twig' with {methods:methods, tag:'extension-hook'} %}
|
||||||
|
|
||||||
|
<WRAP clear />
|
||||||
|
|
||||||
|
|
||||||
|
{% for method in methods|sort_asc if method.visibility == 'public' %}
|
||||||
|
{%- if loop.first %}
|
||||||
|
===== Public methods =====
|
||||||
|
{% endif %}
|
||||||
|
{{ block('method') }}
|
||||||
|
{% endfor %}
|
||||||
|
{% for method in methods|sort_asc if method.visibility == 'protected' %}
|
||||||
|
{%- if loop.first %}
|
||||||
|
===== Protected methods =====
|
||||||
|
{% endif %}
|
||||||
|
{{ block('method') }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% set constants = node.inheritedConstants.merge(node.constants) %}
|
||||||
|
{% if constants|length > 0 %}
|
||||||
|
===== Constants =====
|
||||||
|
{% for constant in constants|sort_asc %}
|
||||||
|
{{ block('constant') }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{#{% set properties = node.inheritedProperties.merge(node.properties) %}#}
|
||||||
|
{#{% for property in properties|sort_asc if property.visibility == 'public' %}#}
|
||||||
|
{#{%- if loop.first %}#}
|
||||||
|
{#===== Public properties =====#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
{#{{ block('property') }}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
{#{% for property in properties|sort_asc if property.visibility == 'protected' %}#}
|
||||||
|
{#{%- if loop.first %}#}
|
||||||
|
{#===== Protected properties =====#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
{#{{ block('property') }}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
|
||||||
|
|
||||||
|
{%- endif %} {#{% elseif node.tags['xxx'] is not defined and ... #}
|
||||||
|
|
||||||
|
<wrap button>[[start|🔙 Back]]</wrap>
|
||||||
|
{% endblock %}
|
||||||
5
.doc/phpdoc-templates/combodo-wiki/layout.txt.twig
Normal file
5
.doc/phpdoc-templates/combodo-wiki/layout.txt.twig
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{% use 'elements/constant.txt.twig' %}
|
||||||
|
{% use 'elements/property.txt.twig' %}
|
||||||
|
{% use 'elements/method.txt.twig' %}
|
||||||
|
|
||||||
|
{% block content %}{% endblock %}
|
||||||
51
.doc/phpdoc-templates/combodo-wiki/namespace.txt.twig
Normal file
51
.doc/phpdoc-templates/combodo-wiki/namespace.txt.twig
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{% extends 'layout.txt.twig' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% set namespace = project.namespace %}
|
||||||
|
{{ block('sidebarNamespaces') }}
|
||||||
|
|
||||||
|
{#{{ node.parent|raw }}#}
|
||||||
|
{#====== {{ node.parent.fullyQualifiedStructuralElementName }}{{ node.name }} ======#}
|
||||||
|
|
||||||
|
{% if node.children|length > 0 %}
|
||||||
|
=====Namespaces=====
|
||||||
|
{% include 'includes/namespace-structure-toc.html.twig' with {structures: node.children} %}
|
||||||
|
----
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if node.traits|length > 0 %}
|
||||||
|
===== Traits =====
|
||||||
|
{% include 'includes/namespace-structure-toc.html.twig' with {structures: node.traits} %}
|
||||||
|
----
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{% if node.interfaces|length > 0 %}
|
||||||
|
===== Interfaces =====
|
||||||
|
{% include 'includes/namespace-structure-toc.html.twig' with {structures: node.interfaces} %}
|
||||||
|
----
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if node.classes|length > 0 %}
|
||||||
|
===== Classes =====
|
||||||
|
{% include 'includes/namespace-structure-toc.html.twig' with {structures: node.classes} %}
|
||||||
|
----
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{#{% if node.constants|length > 0 %}#}
|
||||||
|
{#===== Constants =====#}
|
||||||
|
{#{% for constant in node.constants|sort_asc %}#}
|
||||||
|
{# {{ block('constant') }}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
|
||||||
|
{#{% if node.functions|length > 0 %}#}
|
||||||
|
{#===== Functions =====#}
|
||||||
|
|
||||||
|
{#{% for method in node.functions|sort_asc %}#}
|
||||||
|
{# {{ block('method') }}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
|
||||||
|
====== Deprecated elements ======
|
||||||
|
|
||||||
|
{#{% for element in project.indexes.elements if element.deprecated %}#}
|
||||||
|
{#{% if element.file.path != previousPath %}#}
|
||||||
|
{#<li><a href="#{{ element.file.path }}"><i class="icon-file"></i> {{ element.file.path }}</a></li>#}
|
||||||
|
{#{% endif %}#}
|
||||||
|
{#{% set previousPath = element.file.path %}#}
|
||||||
|
{#{% endfor %}#}
|
||||||
|
|
||||||
|
{% for element in project.indexes.elements if element.deprecated %}
|
||||||
|
{% if element.file.path != previousPath %}
|
||||||
|
{% if previousPath %}
|
||||||
|
</WRAP>{# group #}
|
||||||
|
{% endif %}
|
||||||
|
{#<a name="{{ element.file.path }}" id="{{ element.file.path }}"></a>#}
|
||||||
|
===== {{ element.file.path }} ({{ element.tags.deprecated.count }} found)=====
|
||||||
|
|
||||||
|
<WRAP group >
|
||||||
|
<WRAP third column >
|
||||||
|
Element
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
<WRAP third column >
|
||||||
|
Line
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
<WRAP third column >
|
||||||
|
Description
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% for tag in element.tags.deprecated %}
|
||||||
|
<WRAP group >
|
||||||
|
<WRAP third column >
|
||||||
|
{{ element.fullyQualifiedStructuralElementName }}
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
<WRAP third column >
|
||||||
|
{{ element.line }}
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
<WRAP third column >
|
||||||
|
{{ tag.description }}
|
||||||
|
</WRAP>{# third column#}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
</WRAP>{# group #}
|
||||||
|
{% set previousPath = element.file.path %}
|
||||||
|
{% else %}
|
||||||
|
<WRAP info>No deprecated elements have been found in this project.</WRAP>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
27
.doc/phpdoc-templates/combodo-wiki/template.xml
Normal file
27
.doc/phpdoc-templates/combodo-wiki/template.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<template>
|
||||||
|
<author>Bruno DA SILVA</author>
|
||||||
|
<email>contact [at] combodo.com</email>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<copyright>Combodo 2018</copyright>
|
||||||
|
<description><![CDATA[
|
||||||
|
|
||||||
|
Forked from the clean theme of https://github.com/phpDocumentor/phpDocumentor2 provided under the MIT licence.
|
||||||
|
The original work is copyright "Mike van Riel".
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
To improve performance you can add the following to your .htaccess:
|
||||||
|
|
||||||
|
<ifModule mod_deflate.c>
|
||||||
|
<filesMatch "\.(js|css|html)$">
|
||||||
|
SetOutputFilter DEFLATE
|
||||||
|
</filesMatch>
|
||||||
|
</ifModule>
|
||||||
|
]]></description>
|
||||||
|
<transformations>
|
||||||
|
<transformation writer="twig" query="namespace" source="templates/combodo-wiki/namespace.txt.twig" artifact="start.txt"/>
|
||||||
|
<transformation writer="twig" query="indexes.classes" source="templates/combodo-wiki/class.txt.twig" artifact="{{name}}.txt"/>
|
||||||
|
<transformation writer="twig" query="indexes.interfaces" source="templates/combodo-wiki/interface.txt.twig" artifact="{{name}}.txt" />
|
||||||
|
</transformations>
|
||||||
|
</template>
|
||||||
83
.github/pull_request_template.md
vendored
83
.github/pull_request_template.md
vendored
@@ -1,83 +0,0 @@
|
|||||||
<!--
|
|
||||||
|
|
||||||
IMPORTANT: Please follow the guidelines within this PR template before submitting it, it will greatly help us process your PR. 🙏
|
|
||||||
|
|
||||||
Any PRs not following the guidelines or with missing information will not be considered.
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Base information
|
|
||||||
| Question | Answer
|
|
||||||
|---------------------------------------------------------------|--------
|
|
||||||
| Related to a SourceForge thead / Another PR / Combodo ticket? | <!-- Put the URL -->
|
|
||||||
| Type of change? | Bug fix / Enhancement / Translations
|
|
||||||
|
|
||||||
|
|
||||||
## Symptom (bug) / Objective (enhancement)
|
|
||||||
<!--
|
|
||||||
If it's a bug
|
|
||||||
- Explain the symptom in details
|
|
||||||
- If possible put error messages, logs or screenshots (you can paste image directly in this editor).
|
|
||||||
|
|
||||||
If it's an enhancement
|
|
||||||
- Describe what is blocking you, what is the objective with as much details as possible.
|
|
||||||
- Add screenshots if it's related to UI.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
## Reproduction procedure (bug)
|
|
||||||
<!--
|
|
||||||
Remove this section only if it's NOT a bug.
|
|
||||||
|
|
||||||
Otherwise, explain step by step how to reproduce the issue on a standard iTop Community.
|
|
||||||
|
|
||||||
If it requires a custom datamodel, provide the minimal XML delta to reproduce it on a standard iTop Community.
|
|
||||||
-->
|
|
||||||
|
|
||||||
1. On iTop x.y.z <!-- Put complete iTop version (eg. 3.1.0-2) -->
|
|
||||||
2. With PHP x.y.z <!-- Put complete PHP version (eg. 8.1.24) -->
|
|
||||||
2. First go there
|
|
||||||
2. Then do that
|
|
||||||
3. ...
|
|
||||||
4. Finally, see that...
|
|
||||||
|
|
||||||
|
|
||||||
## Cause (bug)
|
|
||||||
<!--
|
|
||||||
Remove this section only if it's NOT a bug.
|
|
||||||
|
|
||||||
Otherwise, explain what is the cause of the issue (where in the code and why)
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
## Proposed solution (bug and enhancement)
|
|
||||||
<!--
|
|
||||||
Explain in details how you are proposing to solve this:
|
|
||||||
- What did you do in the code and why
|
|
||||||
- If you changed something in the UI, put before / after screenshots (you can paste image directly in this editor)
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
## Checklist before requesting a review
|
|
||||||
<!--
|
|
||||||
Don't remove these lines, check them once done.
|
|
||||||
-->
|
|
||||||
- [ ] I have performed a self-review of my code
|
|
||||||
- [ ] I have tested all changes I made on an iTop instance
|
|
||||||
- [ ] I have added a unit test, otherwise I have explained why I couldn't
|
|
||||||
- [ ] Is the PR clear and detailed enough so anyone can understand digging in the code?
|
|
||||||
|
|
||||||
## Checklist of things to do before PR is ready to merge
|
|
||||||
<!--
|
|
||||||
Things that needs to be done in the PR before it can be considered as ready to be merged
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
- Changes requested in the review
|
|
||||||
- Unit test to add
|
|
||||||
- Dictionary entries to translate
|
|
||||||
- ...
|
|
||||||
-->
|
|
||||||
|
|
||||||
- [ ] ...
|
|
||||||
- [ ] ...
|
|
||||||
- [ ] ...
|
|
||||||
43
.github/workflows/action.yml
vendored
43
.github/workflows/action.yml
vendored
@@ -1,43 +0,0 @@
|
|||||||
name: Add PRs to Combodo PRs Dashboard
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
|
|
||||||
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
|
|
||||||
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/Combodo/iTop/issues/${{ github.event.pull_request.number }}/labels \
|
|
||||||
-d '{"labels":["internal"]}'
|
|
||||||
env:
|
|
||||||
is_member: ${{ env.is_member }}
|
|
||||||
|
|
||||||
- name: Add PR to the appropriate project
|
|
||||||
uses: actions/add-to-project@v1.0.2
|
|
||||||
with:
|
|
||||||
project-url: ${{ env.project_url }}
|
|
||||||
github-token: ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}
|
|
||||||
23
.gitignore
vendored
23
.gitignore
vendored
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
# composer reserver directory, from sources, populate/update using "composer install"
|
# composer reserver directory, from sources, populate/update using "composer install"
|
||||||
vendor/*
|
vendor/*
|
||||||
tests/*/vendor/*
|
test/vendor/*
|
||||||
|
|
||||||
# all conf but listing prevention
|
# all conf but listing prevention
|
||||||
/conf/**
|
/conf/**
|
||||||
@@ -37,9 +37,7 @@ tests/*/vendor/*
|
|||||||
|
|
||||||
# iTop extensions
|
# iTop extensions
|
||||||
/extensions/**
|
/extensions/**
|
||||||
!/extensions/.htaccess
|
|
||||||
!/extensions/readme.txt
|
!/extensions/readme.txt
|
||||||
!/extensions/web.config
|
|
||||||
|
|
||||||
# all logs but listing prevention
|
# all logs but listing prevention
|
||||||
/log/**
|
/log/**
|
||||||
@@ -47,16 +45,8 @@ tests/*/vendor/*
|
|||||||
!/log/index.php
|
!/log/index.php
|
||||||
!/log/web.config
|
!/log/web.config
|
||||||
|
|
||||||
# NPM: `jquery-ui` package is just there for vulnerability scans, so we don't want to version its files (only `jquery-ui-dist` is used within the code base)
|
# PHPUnit cache file
|
||||||
/node_modules/jquery-ui/**
|
/test/.phpunit.result.cache
|
||||||
|
|
||||||
# Symfony: Local env file
|
|
||||||
/resources/symfony/.env.local
|
|
||||||
|
|
||||||
# PHPUnit: Cache file, local XML working copies
|
|
||||||
/tests/php-unit-tests/.phpunit.result.cache
|
|
||||||
/tests/php-unit-tests/phpunit.xml
|
|
||||||
/tests/php-unit-tests/postbuild_integration.xml
|
|
||||||
|
|
||||||
|
|
||||||
# Jetbrains
|
# Jetbrains
|
||||||
@@ -156,10 +146,3 @@ local.properties
|
|||||||
.cache-main
|
.cache-main
|
||||||
.scala_dependencies
|
.scala_dependencies
|
||||||
.worksheet
|
.worksheet
|
||||||
|
|
||||||
# Mac
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Windows
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ $iBeginTime = time();
|
|||||||
chdir(__DIR__);
|
chdir(__DIR__);
|
||||||
|
|
||||||
$aCommands = [
|
$aCommands = [
|
||||||
'php composer/rmUnnecessaryFolders.php',
|
'php composer/rmDeniedTestDir.php',
|
||||||
'php build/commands/setupCssCompiler.php',
|
'php build/commands/setupCssCompiler.php',
|
||||||
// 'bash /tmp/gabuzomeu.sh',
|
// 'bash /tmp/gabuzomeu.sh',
|
||||||
];
|
];
|
||||||
@@ -22,13 +22,13 @@ $iElapsed = time() - $iBeginTime;
|
|||||||
|
|
||||||
if (count($aFailedCommands))
|
if (count($aFailedCommands))
|
||||||
{
|
{
|
||||||
fwrite(STDERR, "\nafterBuild execution failed! (in {$iElapsed}s)\n");
|
fwrite(STDERR, "\nafterBuild execution failed! (in ${iElapsed}s)\n");
|
||||||
fwrite(STDERR, "List of failling commands:\n - " . implode("\n - ", $aFailedCommands) . "\n");
|
fwrite(STDERR, "List of failling commands:\n - " . implode("\n - ", $aFailedCommands) . "\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "\nDone ({$iElapsed}s)\n";
|
echo "\nDone (${iElapsed}s)\n";
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,7 +74,7 @@ function ExecCommand($cmd) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "| elapsed:{$iElapsed}s \n";
|
echo "| elapsed:${iElapsed}s \n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($stderr))
|
if (!empty($stderr))
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2010-2024 Combodo SAS
|
* Copyright (C) 2010-2021 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -27,7 +27,7 @@ $iTopFolder = __DIR__."/../../../";
|
|||||||
require_once("$iTopFolder/approot.inc.php");
|
require_once("$iTopFolder/approot.inc.php");
|
||||||
require_once(APPROOT."/application/utils.inc.php");
|
require_once(APPROOT."/application/utils.inc.php");
|
||||||
|
|
||||||
if (PHP_SAPI !== 'cli')
|
if (php_sapi_name() !== 'cli')
|
||||||
{
|
{
|
||||||
throw new \Exception('This script can only run from CLI');
|
throw new \Exception('This script can only run from CLI');
|
||||||
}
|
}
|
||||||
@@ -48,4 +48,4 @@ if (!file_exists($sCssFile))
|
|||||||
{
|
{
|
||||||
fwrite(STDERR, "Failed to compile $sCssFile, exiting.");
|
fwrite(STDERR, "Failed to compile $sCssFile, exiting.");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2010-2024 Combodo SAS
|
* Copyright (C) 2010-2021 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
* @link https://getcomposer.org/doc/03-cli.md#show
|
* @link https://getcomposer.org/doc/03-cli.md#show
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$iTopFolder = __DIR__."/../../../";
|
$iTopFolder = __DIR__."/../../";
|
||||||
|
|
||||||
require_once("$iTopFolder/approot.inc.php");
|
require_once("$iTopFolder/approot.inc.php");
|
||||||
$sApproot = APPROOT;
|
$sApproot = APPROOT;
|
||||||
73
.make/composer/rmDeniedTestDir.php
Normal file
73
.make/composer/rmDeniedTestDir.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2010-2021 Combodo SARL
|
||||||
|
*
|
||||||
|
* This file is part of iTop.
|
||||||
|
*
|
||||||
|
* iTop is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* iTop is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with iTop. If not, see <http: *www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Combodo\iTop\Composer\iTopComposer;
|
||||||
|
|
||||||
|
$iTopFolder = __DIR__ . "/../../" ;
|
||||||
|
|
||||||
|
require_once ("$iTopFolder/approot.inc.php");
|
||||||
|
require_once (APPROOT."/setup/setuputils.class.inc.php");
|
||||||
|
|
||||||
|
if (php_sapi_name() !== 'cli')
|
||||||
|
{
|
||||||
|
throw new \Exception('This script can only run from CLI');
|
||||||
|
}
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
$oiTopComposer = new iTopComposer();
|
||||||
|
$aDeniedButStillPresent = $oiTopComposer->ListDeniedButStillPresent();
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
|
foreach ($aDeniedButStillPresent as $sDir)
|
||||||
|
{
|
||||||
|
if (false === iTopComposer::IsTestDir($sDir))
|
||||||
|
{
|
||||||
|
echo "ERROR found INVALID denied test dir: '$sDir'\n";
|
||||||
|
throw new \Exception("$sDir must end with /Test/ or /test/");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false === file_exists($sDir)) {
|
||||||
|
echo "INFO $sDir is in denied list, but not existing on disk => skipping !\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
SetupUtils::rrmdir($sDir);
|
||||||
|
echo "OK Remove denied test dir: '$sDir'\n";
|
||||||
|
}
|
||||||
|
catch (\Exception $e) {
|
||||||
|
echo "\nFAILED to remove denied test dir: '$sDir'\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$aAllowedAndDeniedDirs = array_merge(
|
||||||
|
$oiTopComposer->ListAllowedTestDir(),
|
||||||
|
$oiTopComposer->ListDeniedTestDir()
|
||||||
|
);
|
||||||
|
$aExistingDirs = $oiTopComposer->ListAllTestDir();
|
||||||
|
$aMissing = array_diff($aExistingDirs, $aAllowedAndDeniedDirs);
|
||||||
|
if (false === empty($aMissing)) {
|
||||||
|
echo "Some new tests dirs exists !\n"
|
||||||
|
.' They must be declared either in the allowed or denied list in '.iTopComposer::class." (see N°2651).\n"
|
||||||
|
.' List of dirs:'."\n".var_export($aMissing, true);
|
||||||
|
}
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
courier.php
|
|
||||||
courierb.php
|
|
||||||
courierbi.php
|
|
||||||
courieri.php
|
|
||||||
dejavusans.ctg.z
|
|
||||||
dejavusans.php
|
|
||||||
dejavusans.z
|
|
||||||
dejavusansb.ctg.z
|
|
||||||
dejavusansb.php
|
|
||||||
dejavusansb.z
|
|
||||||
dejavusansbi.ctg.z
|
|
||||||
dejavusansbi.php
|
|
||||||
dejavusansbi.z
|
|
||||||
dejavusanscondensed.ctg.z
|
|
||||||
dejavusanscondensed.php
|
|
||||||
dejavusanscondensed.z
|
|
||||||
dejavusanscondensedb.ctg.z
|
|
||||||
dejavusanscondensedb.php
|
|
||||||
dejavusanscondensedb.z
|
|
||||||
dejavusanscondensedbi.ctg.z
|
|
||||||
dejavusanscondensedbi.php
|
|
||||||
dejavusanscondensedbi.z
|
|
||||||
dejavusanscondensedi.ctg.z
|
|
||||||
dejavusanscondensedi.php
|
|
||||||
dejavusanscondensedi.z
|
|
||||||
dejavusansextralight.ctg.z
|
|
||||||
dejavusansextralight.php
|
|
||||||
dejavusansextralight.z
|
|
||||||
dejavusansi.ctg.z
|
|
||||||
dejavusansi.php
|
|
||||||
dejavusansi.z
|
|
||||||
dejavusansmono.ctg.z
|
|
||||||
dejavusansmono.php
|
|
||||||
dejavusansmono.z
|
|
||||||
dejavusansmonob.ctg.z
|
|
||||||
dejavusansmonob.php
|
|
||||||
dejavusansmonob.z
|
|
||||||
dejavusansmonobi.ctg.z
|
|
||||||
dejavusansmonobi.php
|
|
||||||
dejavusansmonobi.z
|
|
||||||
dejavusansmonoi.ctg.z
|
|
||||||
dejavusansmonoi.php
|
|
||||||
dejavusansmonoi.z
|
|
||||||
droidsansfallback.ctg.z
|
|
||||||
droidsansfallback.php
|
|
||||||
droidsansfallback.z
|
|
||||||
helvetica.php
|
|
||||||
helveticab.php
|
|
||||||
helveticabi.php
|
|
||||||
helveticai.php
|
|
||||||
symbol.php
|
|
||||||
times.php
|
|
||||||
timesb.php
|
|
||||||
timesbi.php
|
|
||||||
timesi.php
|
|
||||||
zapfdingbats.php
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* This script will copy custom fonts in the TCPDF lib fonts directory.
|
|
||||||
* If you need to add other files :
|
|
||||||
* - add the corresponding files in this script directory
|
|
||||||
* - modify this script to copy also your files
|
|
||||||
*
|
|
||||||
* @since 2.7.0 N°1947 add DroidSansFallback font (see also PR #49 in the links below)
|
|
||||||
* @since 2.7.0 N°2435 TCPPDF lib forked and added in composer.json (at that time the lib was announced as deprecated and rewritten in tecnickcom/tc-lib-pdf)
|
|
||||||
* @since 3.2.0 N°7175 switch back to TCPDF original lib (which is finally still maintained, tecnickcom/tc-lib-pdf us still under dev), script creation to keep custom DroidSansFallback font
|
|
||||||
*
|
|
||||||
* @link https://github.com/Combodo/iTop/pull/49 add DroidSansFallback font
|
|
||||||
* @link https://github.com/tecnickcom/TCPDF?tab=readme-ov-file#note TCPDF is in support only mode
|
|
||||||
*/
|
|
||||||
|
|
||||||
$sItopRootFolder = realpath(__DIR__ . "/../../../../");
|
|
||||||
$sCurrentScriptFileName = basename(__FILE__);
|
|
||||||
|
|
||||||
|
|
||||||
require_once ("$sItopRootFolder/lib/autoload.php");
|
|
||||||
|
|
||||||
|
|
||||||
$sTcPdfRootFolder = $sItopRootFolder.'/lib/tecnickcom/tcpdf';
|
|
||||||
if (false === file_exists($sTcPdfRootFolder)) {
|
|
||||||
echo $sCurrentScriptFileName.": No TCPDF lib detected, exiting !\n";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$sTcPdfFontsFolder = $sTcPdfRootFolder.'/fonts/';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1) Cleaning up the fonts directory to keep only the ones we want in iTop
|
|
||||||
*/
|
|
||||||
echo $sCurrentScriptFileName.": ---1) Cleaning up the fonts files\n";
|
|
||||||
$aTcpdfDefaultFontsToKeepInItop = file(__DIR__.'/tcpdfDefaultFontsToKeepInItop.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
|
||||||
|
|
||||||
$aTcpdfFontsDirContent = scandir($sTcPdfFontsFolder);
|
|
||||||
foreach ($aTcpdfFontsDirContent as $sTcpdfFontResourceName) {
|
|
||||||
if ($sTcpdfFontResourceName === '.') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($sTcpdfFontResourceName === '..') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!in_array($sTcpdfFontResourceName, $aTcpdfDefaultFontsToKeepInItop, true)) {
|
|
||||||
echo $sCurrentScriptFileName.": Removing $sTcpdfFontResourceName !\n";
|
|
||||||
|
|
||||||
$sTcpdfFontResourceFullPath = $sTcPdfFontsFolder.$sTcpdfFontResourceName;
|
|
||||||
if (is_file($sTcpdfFontResourceFullPath)) {
|
|
||||||
unlink($sTcpdfFontResourceFullPath);
|
|
||||||
} elseif (is_dir($sTcpdfFontResourceFullPath)) {
|
|
||||||
rrmdir($sTcpdfFontResourceFullPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 2) Then adding the DroidSansFallback font (useful for CJK data for example)
|
|
||||||
*/
|
|
||||||
echo $sCurrentScriptFileName.": ---2) Copying font files to TCPDF ($sTcPdfFontsFolder)...\n";
|
|
||||||
$aFontFilesToCopy = glob(__DIR__.'\droidsansfallback.*');
|
|
||||||
foreach ($aFontFilesToCopy as $sFontFileToCopy) {
|
|
||||||
$sFontFileName = basename($sFontFileToCopy);
|
|
||||||
echo $sCurrentScriptFileName.': copying '.$sFontFileName."\n";
|
|
||||||
copy($sFontFileToCopy, $sTcPdfFontsFolder.$sFontFileName);
|
|
||||||
}
|
|
||||||
echo $sCurrentScriptFileName.": Done !\n";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recursively delete a directory and its content
|
|
||||||
*
|
|
||||||
* @param $sDirToRemovePath
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function rrmdir($sDirToRemovePath):void
|
|
||||||
{
|
|
||||||
if (is_dir($sDirToRemovePath)) {
|
|
||||||
$objects = scandir($sDirToRemovePath);
|
|
||||||
foreach ($objects as $object) {
|
|
||||||
if ($object != "." && $object != "..") {
|
|
||||||
if (filetype($sDirToRemovePath."/".$object) == "dir") {
|
|
||||||
rrmdir($sDirToRemovePath."/".$object);
|
|
||||||
} else {
|
|
||||||
unlink($sDirToRemovePath."/".$object);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
reset($objects);
|
|
||||||
rmdir($sDirToRemovePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Copyright (C) 2010-2024 Combodo SAS
|
|
||||||
*
|
|
||||||
* 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/>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensure that the files for folder browsing protection (.htaccess, web.config) are kept after an "npm install/update" command
|
|
||||||
*/
|
|
||||||
|
|
||||||
$iTopFolder = __DIR__."/../../../";
|
|
||||||
|
|
||||||
require_once("$iTopFolder/approot.inc.php");
|
|
||||||
|
|
||||||
$sDependenciesRootFolderAbsPath = APPROOT . "node_modules/";
|
|
||||||
$aFilesToCheck = [
|
|
||||||
".htaccess",
|
|
||||||
"web.config",
|
|
||||||
];
|
|
||||||
|
|
||||||
echo "This command aims at ensuring that folder browsing protection files (.htaccess, web.config) are present in the dependencies folder even after an install/upgrade command\n";
|
|
||||||
echo "Checking files:\n";
|
|
||||||
|
|
||||||
foreach($aFilesToCheck as $sFileToCheck) {
|
|
||||||
if (file_exists($sDependenciesRootFolderAbsPath . $sFileToCheck)) {
|
|
||||||
echo "✔️ $sFileToCheck is present\n";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If missing, copy the one from /lib as it contains the necessary allow/deny directives for third-parties
|
|
||||||
copy(APPROOT . "lib/$sFileToCheck", $sDependenciesRootFolderAbsPath . $sFileToCheck);
|
|
||||||
echo "✔️ $sFileToCheck was missing and has been re-created\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure separation with following scripts
|
|
||||||
echo "\n";
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Copyright (C) 2010-2024 Combodo SAS
|
|
||||||
*
|
|
||||||
* 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/>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
$iTopFolder = __DIR__ . "/../../" ;
|
|
||||||
|
|
||||||
require_once ("$iTopFolder/approot.inc.php");
|
|
||||||
require_once (APPROOT."/setup/setuputils.class.inc.php");
|
|
||||||
|
|
||||||
if (php_sapi_name() !== 'cli')
|
|
||||||
{
|
|
||||||
throw new \Exception('This script can only run from CLI');
|
|
||||||
}
|
|
||||||
|
|
||||||
clearstatcache();
|
|
||||||
|
|
||||||
// Read params
|
|
||||||
$key = array_search("--manager", $argv);
|
|
||||||
if (false === $key || false === isset($argv[$key + 1]) ) {
|
|
||||||
throw new \InvalidArgumentException("Usage: " . __FILE__ . " --manager composer|npm");
|
|
||||||
}
|
|
||||||
$sDependenciesHandlerCode = $argv[$key + 1];
|
|
||||||
|
|
||||||
switch ($sDependenciesHandlerCode) {
|
|
||||||
case "composer":
|
|
||||||
$sDependenciesHandlerFQCN = \Combodo\iTop\Dependencies\Composer\iTopComposer::class;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "npm":
|
|
||||||
$sDependenciesHandlerFQCN = \Combodo\iTop\Dependencies\NPM\iTopNPM::class;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new \Exception("Invalid dependencies handler code, $sDependenciesHandlerCode given, expected composer|npm");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start handler
|
|
||||||
$oDependenciesHandler = new $sDependenciesHandlerFQCN();
|
|
||||||
$aDeniedButStillPresent = $oDependenciesHandler->ListDeniedButStillPresentFilesAbsPaths();
|
|
||||||
|
|
||||||
echo "\n";
|
|
||||||
foreach ($aDeniedButStillPresent as $sDir)
|
|
||||||
{
|
|
||||||
if (false === $oDependenciesHandler::IsQuestionnableFile($sDir))
|
|
||||||
{
|
|
||||||
echo "ERROR found INVALID denied test dir: '$sDir'\n";
|
|
||||||
throw new \RuntimeException("$sDir is in the denied list but doesn't comply with the rule (see IsQuestionnableFolder method)");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (false === file_exists($sDir)) {
|
|
||||||
echo "INFO $sDir is in denied list, but not existing on disk => skipping !\n";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if(is_dir($sDir)){
|
|
||||||
SetupUtils::rrmdir($sDir);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
unlink($sDir);
|
|
||||||
}
|
|
||||||
echo "✔️ Remove denied test dir: '$sDir'\n";
|
|
||||||
}
|
|
||||||
catch (\Exception $e) {
|
|
||||||
echo "\n❌ FAILED to remove denied test dir: '$sDir'\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$aAllowedAndDeniedDirs = array_merge(
|
|
||||||
$oDependenciesHandler->ListAllowedFilesAbsPaths(),
|
|
||||||
$oDependenciesHandler->ListDeniedFilesAbsPaths()
|
|
||||||
);
|
|
||||||
$aExistingDirs = $oDependenciesHandler->ListAllFilesAbsPaths();
|
|
||||||
$aMissing = array_diff($aExistingDirs, $aAllowedAndDeniedDirs);
|
|
||||||
if (false === empty($aMissing)) {
|
|
||||||
echo "Some new tests dirs exists !\n"
|
|
||||||
." They must be declared either in the allowed or denied list in {$sDependenciesHandlerFQCN}\n"
|
|
||||||
.' List of dirs:'."\n".var_export($aMissing, true)."\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure separation with following scripts
|
|
||||||
echo "\n";
|
|
||||||
@@ -19,24 +19,17 @@
|
|||||||
* The target license file path is in `$xmlFilePath`
|
* The target license file path is in `$xmlFilePath`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$iTopFolder = __DIR__."/../../";
|
$iTopFolder = __DIR__ . "/../../" ;
|
||||||
$xmlFilePath = $iTopFolder."setup/licenses/community-licenses.xml";
|
$xmlFilePath = $iTopFolder . "setup/licenses/community-licenses.xml";
|
||||||
|
|
||||||
$jqExec = shell_exec("jq -V"); // a param is mandatory otherwise the script will freeze
|
function get_scope($product_node)
|
||||||
if ((null === $jqExec) || (false === $jqExec)) {
|
{
|
||||||
echo "/!\ JQ is required but cannot be launched :( \n";
|
|
||||||
echo "Check this script PHPDoc block for instructions\n";
|
|
||||||
die(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function get_scope($product_node) {
|
|
||||||
$scope = $product_node->getAttribute("scope");
|
$scope = $product_node->getAttribute("scope");
|
||||||
|
|
||||||
if ($scope === "") { //put iTop first
|
if ($scope === "")
|
||||||
|
{ //put iTop first
|
||||||
return "aaaaaaaaa";
|
return "aaaaaaaaa";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $scope;
|
return $scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,19 +6,11 @@
|
|||||||
* Will update version in the following files :
|
* Will update version in the following files :
|
||||||
*
|
*
|
||||||
* datamodels/2.x/.../datamodel.*.xml
|
* datamodels/2.x/.../datamodel.*.xml
|
||||||
* application/*.xml
|
|
||||||
* core/*.xml
|
|
||||||
*
|
*
|
||||||
* Usage :
|
* Usage :
|
||||||
* `php .make\release\update-xml.php "1.7"`
|
* `php .make\release\update-xml.php "1.7"`
|
||||||
* `php .make\release\update-xml.php`
|
|
||||||
*
|
*
|
||||||
* If no parameter provided then the current XML version will be used as target version
|
* @since 2.7.0
|
||||||
*
|
|
||||||
* @since 2.7.0 simple version change using regexp (not doing conversion)
|
|
||||||
* @since 3.1.0 N°5405 now does a real conversion
|
|
||||||
* @since 3.1.0 N°5633 allow to use without parameter
|
|
||||||
* @since 3.1.0 N°5633 add /application and /core XML files
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
@@ -30,12 +22,10 @@ require_once (__DIR__.DIRECTORY_SEPARATOR.'update.classes.inc.php');
|
|||||||
|
|
||||||
if (count($argv) === 1)
|
if (count($argv) === 1)
|
||||||
{
|
{
|
||||||
echo '/!\ No version passed: assuming target XML version is current XML version ('.ITOP_DESIGN_LATEST_VERSION.")\n";
|
echo '/!\ You must pass the new version as parameter';
|
||||||
$sVersionLabel = ITOP_DESIGN_LATEST_VERSION;
|
exit(1);
|
||||||
} else {
|
|
||||||
$sVersionLabel = $argv[1];
|
|
||||||
}
|
}
|
||||||
|
$sVersionLabel = $argv[1];
|
||||||
if (empty($sVersionLabel))
|
if (empty($sVersionLabel))
|
||||||
{
|
{
|
||||||
echo 'Version passed as parameter is empty !';
|
echo 'Version passed as parameter is empty !';
|
||||||
|
|||||||
@@ -125,31 +125,16 @@ class iTopVersionFileUpdater extends AbstractSingleFileVersionUpdater
|
|||||||
|
|
||||||
abstract class AbstractGlobFileVersionUpdater extends FileVersionUpdater
|
abstract class AbstractGlobFileVersionUpdater extends FileVersionUpdater
|
||||||
{
|
{
|
||||||
/** @var array|string glob patterns to seek for files to modify */
|
protected $sGlobPattern;
|
||||||
protected $globPattern;
|
|
||||||
|
|
||||||
public function __construct($globPattern)
|
public function __construct($sGlobPattern)
|
||||||
{
|
{
|
||||||
$this->globPattern = $globPattern;
|
$this->sGlobPattern = $sGlobPattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetFiles()
|
public function GetFiles()
|
||||||
{
|
{
|
||||||
$aGlobPatterns = (is_array($this->globPattern))
|
return glob($this->sGlobPattern);
|
||||||
? $this->globPattern
|
|
||||||
: [$this->globPattern];
|
|
||||||
|
|
||||||
$aFiles = [];
|
|
||||||
foreach ($aGlobPatterns as $sGlobPattern) {
|
|
||||||
$result = glob($sGlobPattern);
|
|
||||||
if (false === $result) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
/** @noinspection SlowArrayOperationsInLoopInspection */
|
|
||||||
$aFiles = array_merge($aFiles, $result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $aFiles;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,11 +166,7 @@ class DatamodelsXmlFiles extends AbstractGlobFileVersionUpdater
|
|||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct([
|
parent::__construct(APPROOT.'datamodels/2.x/*/datamodel.*.xml');
|
||||||
APPROOT.'datamodels/2.x/*/datamodel.*.xml',
|
|
||||||
APPROOT.'application/*.xml',
|
|
||||||
APPROOT.'core/*.xml',
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -193,40 +174,10 @@ class DatamodelsXmlFiles extends AbstractGlobFileVersionUpdater
|
|||||||
*/
|
*/
|
||||||
public function UpdateFileContent($sVersionLabel, $sFileContent, $sFileFullPath)
|
public function UpdateFileContent($sVersionLabel, $sFileContent, $sFileFullPath)
|
||||||
{
|
{
|
||||||
require_once APPROOT.'setup/itopdesignformat.class.inc.php';
|
return preg_replace(
|
||||||
$oFileXml = new DOMDocument();
|
'/(<itop_design .* version=")[^"]+(">)/',
|
||||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
'${1}'.$sVersionLabel.'${2}',
|
||||||
libxml_clear_errors();
|
$sFileContent
|
||||||
$oFileXml->formatOutput = true;
|
);
|
||||||
$oFileXml->preserveWhiteSpace = false;
|
|
||||||
$oFileXml->loadXML($sFileContent);
|
|
||||||
|
|
||||||
$oFileItopFormat = new iTopDesignFormat($oFileXml);
|
|
||||||
|
|
||||||
$sDesignVersionToSet = static::GetDesignVersionToSet($oFileItopFormat->GetVersion());
|
|
||||||
if (false === is_null($sDesignVersionToSet)) {
|
|
||||||
// N°5779 if same as target version, we will try to convert from version below
|
|
||||||
$oFileItopFormat->GetITopDesignNode()->setAttribute('version', $sDesignVersionToSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
$bConversionResult = $oFileItopFormat->Convert($sVersionLabel);
|
|
||||||
|
|
||||||
if (false === $bConversionResult) {
|
|
||||||
throw new Exception("Error when converting $sFileFullPath");
|
|
||||||
}
|
|
||||||
|
|
||||||
return $oFileItopFormat->GetXmlAsString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return ?string version to use : if file version is same as current version then return previous version, else return null
|
|
||||||
* @since 3.1.0 N°5779
|
|
||||||
*/
|
|
||||||
protected static function GetDesignVersionToSet($sFileDesignVersion):?string {
|
|
||||||
if ($sFileDesignVersion !== ITOP_DESIGN_LATEST_VERSION) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return iTopDesignFormat::GetPreviousDesignVersion(ITOP_DESIGN_LATEST_VERSION);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,16 +134,15 @@ Our tests are located in the `test/` directory, containing a PHPUnit config file
|
|||||||
|
|
||||||
When your code is working, please:
|
When your code is working, please:
|
||||||
|
|
||||||
* Squash as much as possible your commits,
|
* stash as much as possible your commits,
|
||||||
* Rebase your branch on our repo last commit,
|
* rebase your branch on our repo last commit,
|
||||||
* Create a pull request. _Detailed procedure to work on fork and create PR is available [in GitHub help pages](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)_.
|
* create a pull request
|
||||||
* Pull request description: mind to add all the information useful to understand why you're suggesting this modification and anything necessary to dive into your work. Especially:
|
* mind to check the "[Allow edits from maintainers](https://docs.github.com/en/github-ae@latest/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)" option !
|
||||||
- Bugfixes: exact steps to reproduce the bug (given/when/then), description of the bug cause and what solution is implemented
|
|
||||||
- Enhancements: use cases, implementation details if needed
|
Detailed procedure to work on fork and create PR is available [in GitHub help pages](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
|
||||||
* Mind to check the "[Allow edits from maintainers](https://docs.github.com/en/github-ae@latest/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)" option ! (note that if you are working with an org fork, this option [won't be available](https://github.com/orgs/community/discussions/5634))
|
|
||||||
|
|
||||||
|
|
||||||
## 🙏 We are thankful
|
### 🙏 We are thankful
|
||||||
|
|
||||||
We are thankful for all your contributions to the iTop universe! As a thank you gift, we will send stickers to every iTop (& extensions) contributors!
|
We are thankful for all your contributions to the iTop universe! As a thank you gift, we will send stickers to every iTop (& extensions) contributors!
|
||||||
|
|
||||||
@@ -159,6 +158,6 @@ We have one sticker per contribution type. You might get multiple stickers with
|
|||||||
* Beta tester: Test and give feedback on beta releases
|
* Beta tester: Test and give feedback on beta releases
|
||||||
* Extension developer: Develop and publish an extension
|
* Extension developer: Develop and publish an extension
|
||||||
|
|
||||||
Here is the design of each stickers for year 2024:
|
Here is the design of each stickers for year 2022:
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -1,14 +1,6 @@
|
|||||||
def infra
|
def infra
|
||||||
|
|
||||||
node(){
|
node(){
|
||||||
properties([
|
|
||||||
buildDiscarder(
|
|
||||||
logRotator(
|
|
||||||
daysToKeepStr: "28",
|
|
||||||
numToKeepStr: "500")
|
|
||||||
)
|
|
||||||
])
|
|
||||||
|
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
infra = load '/var/lib/jenkins/workspace/itop-test-infra_master/src/Infra.groovy'
|
infra = load '/var/lib/jenkins/workspace/itop-test-infra_master/src/Infra.groovy'
|
||||||
|
|||||||
23
README.md
23
README.md
@@ -1,15 +1,11 @@
|
|||||||
<p align="center"><a href="https://www.combodo.com/itop-193" target="_blank">
|
<p align="center"><a href="https://www.combodo.com/itop-193" target="_blank">
|
||||||
<picture>
|
<img src="https://www.combodo.com/logos/logo-itop-baseline.svg" width=350>
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="/images/logos/logo-itop-baseline-light.svg">
|
|
||||||
<source media="(prefers-color-scheme: light)" srcset="/images/logos/logo-itop-baseline-dark.svg">
|
|
||||||
<img src="/images/logos/logo-itop-baseline-light.svg" width="350" alt="Logo iTop with baseline" />
|
|
||||||
</picture>
|
|
||||||
</a></p>
|
</a></p>
|
||||||
|
|
||||||
|
|
||||||
iTop stands for IT Operations Portal. It is a complete open source and web-based IT service management platform, including a fully customizable CMDB, a helpdesk system, and a document management tool. It is ITIL compliant and easily customizable and extensible thanks to a high number of add-ons and web services to integrate with your IT.
|
iTop stands for IT Operations Portal. It is a complete open source and web based IT service management platform including a fully customizable CMDB, a helpdesk system and a document management tool. It is ITIL compliant and easily customizable and extensible thanks to a high number of adds-on and web services to integrate with your IT.
|
||||||
|
|
||||||
iTop also offers mass import tools to help you become even more efficient.
|
iTop also offers mass import tools to help you being even more efficient.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- Fully configurable [Configuration Management (CMDB)][10]
|
- Fully configurable [Configuration Management (CMDB)][10]
|
||||||
@@ -41,7 +37,7 @@ iTop also offers mass import tools to help you become even more efficient.
|
|||||||
- [iTop Forums][1]: community support
|
- [iTop Forums][1]: community support
|
||||||
- [iTop Tickets][2]: for feature requests and bug reports
|
- [iTop Tickets][2]: for feature requests and bug reports
|
||||||
- [Releases download][3]
|
- [Releases download][3]
|
||||||
- [iTop requirements][4]
|
- [Software requirements][4]
|
||||||
- [Documentation][5] covering both iTop and its official extensions
|
- [Documentation][5] covering both iTop and its official extensions
|
||||||
- [iTop Hub][6] : discover and install extensions !
|
- [iTop Hub][6] : discover and install extensions !
|
||||||
- [iTop versions history][7]
|
- [iTop versions history][7]
|
||||||
@@ -50,7 +46,7 @@ iTop also offers mass import tools to help you become even more efficient.
|
|||||||
[1]: https://sourceforge.net/p/itop/discussion/
|
[1]: https://sourceforge.net/p/itop/discussion/
|
||||||
[2]: https://sourceforge.net/p/itop/tickets/
|
[2]: https://sourceforge.net/p/itop/tickets/
|
||||||
[3]: https://sourceforge.net/projects/itop/files/itop/
|
[3]: https://sourceforge.net/projects/itop/files/itop/
|
||||||
[4]: https://www.itophub.io/wiki/page?id=latest:install:requirements
|
[4]: https://www.itophub.io/wiki/page?id=latest:install:upgrading_itop
|
||||||
[5]: https://www.itophub.io/wiki
|
[5]: https://www.itophub.io/wiki
|
||||||
[6]: https://store.itophub.io/en_US/
|
[6]: https://store.itophub.io/en_US/
|
||||||
[7]: .doc/itop-version-history.md
|
[7]: .doc/itop-version-history.md
|
||||||
@@ -69,7 +65,7 @@ iTop also offers mass import tools to help you become even more efficient.
|
|||||||
|
|
||||||
## About Us
|
## About Us
|
||||||
|
|
||||||
iTop development is sponsored, led, and supported by [Combodo][0].
|
iTop development is sponsored, led and supported by [Combodo][0].
|
||||||
|
|
||||||
[0]: https://www.combodo.com
|
[0]: https://www.combodo.com
|
||||||
|
|
||||||
@@ -91,11 +87,9 @@ We would like to give a special thank you 🤗 to the people from the community
|
|||||||
- Castro, Randall Badilla
|
- Castro, Randall Badilla
|
||||||
- Colantoni, Maria Laura
|
- Colantoni, Maria Laura
|
||||||
- Couronné, Guy
|
- Couronné, Guy
|
||||||
- Dejin, Bie (a.k.a [@bdejin](https://github.com/bdejin))
|
|
||||||
- Dvořák, Lukáš
|
- Dvořák, Lukáš
|
||||||
- Goethals, Stefan
|
- Goethals, Stefan
|
||||||
- Gumble, David
|
- Gumble, David
|
||||||
- Ji, Leeb (冀利斌) (a.k.a [@chileeb](https://github.com/chileeb))
|
|
||||||
- Kaltefleiter, Lars (a.k.a [@larhip](https://www.github.com/larhip))
|
- Kaltefleiter, Lars (a.k.a [@larhip](https://www.github.com/larhip))
|
||||||
- Khamit, Shamil
|
- Khamit, Shamil
|
||||||
- Kincel, Martin
|
- Kincel, Martin
|
||||||
@@ -110,17 +104,12 @@ We would like to give a special thank you 🤗 to the people from the community
|
|||||||
- Raenker, Martin
|
- Raenker, Martin
|
||||||
- Roháč, Richard (a.k.a [@RohacRichard](https://github.com/RohacRichard))
|
- Roháč, Richard (a.k.a [@RohacRichard](https://github.com/RohacRichard))
|
||||||
- Rosenke, Stephan
|
- Rosenke, Stephan
|
||||||
- Rossi, Tommaso (a.k.a [@tomrss](https://www.github.com/tomrss))
|
|
||||||
- Rudner, Björn (a.k.a [@rudnerbjoern](https://github.com/rudnerbjoern))
|
- Rudner, Björn (a.k.a [@rudnerbjoern](https://github.com/rudnerbjoern))
|
||||||
- Šafránek, Jaroslav (a.k.a [jkcinik](https://sourceforge.net/u/jkcinik/profile/) on SourceForge)
|
|
||||||
- Seki, Shoji
|
- Seki, Shoji
|
||||||
- Shilov, Vladimir
|
- Shilov, Vladimir
|
||||||
- Stetina, Pavel (a.k.a [@Stetinac](https://github.com/Stetinac))
|
|
||||||
- Stukalov, Ilya (a.k.a [@ilya](https://www.github.com/ilya)-stukalov)
|
- Stukalov, Ilya (a.k.a [@ilya](https://www.github.com/ilya)-stukalov)
|
||||||
- Tarjányi, Csaba (a.k.a [@tacsaby](https://github.com/tacsaby))
|
|
||||||
- Tulio, Marco
|
- Tulio, Marco
|
||||||
- Turrubiates, Miguel
|
- Turrubiates, Miguel
|
||||||
- Vlk, Karel (a.k.a [@vlk-charles](https://www.github.com/vlk-charles))
|
|
||||||
|
|
||||||
### Aliases
|
### Aliases
|
||||||
|
|
||||||
|
|||||||
12
SECURITY.md
12
SECURITY.md
@@ -18,7 +18,8 @@ to [itop-security@combodo.com](mailto:itop-security@combodo.com).
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 🔍 Combodo acknowledgment and investigation
|
## 📆 Disclosure Policy
|
||||||
|
|
||||||
Report sent to us will be acknowledged within the week.
|
Report sent to us will be acknowledged within the week.
|
||||||
|
|
||||||
Then, a Combodo developer will be assigned to the reported issue and will:
|
Then, a Combodo developer will be assigned to the reported issue and will:
|
||||||
@@ -33,12 +34,3 @@ Then, a Combodo developer will be assigned to the reported issue and will:
|
|||||||
Security issues always take precedence over bug fixes and feature work.
|
Security issues always take precedence over bug fixes and feature work.
|
||||||
|
|
||||||
The assignee will keep you informed of the resolution progress, and may ask you for additional information or guidance.
|
The assignee will keep you informed of the resolution progress, and may ask you for additional information or guidance.
|
||||||
|
|
||||||
|
|
||||||
## 📆 Disclosure Policy
|
|
||||||
Once the fix is done and acknowledged by every stakeholder, it will be included in the next iTop version.
|
|
||||||
Mind we have at least 2 active branches (LTS and STS, see [iTop Community Releases [iTop Documentation]](https://www.itophub.io/wiki/page?id=latest:release:start))
|
|
||||||
|
|
||||||
The release communications will include the information of the vulnerability fix.
|
|
||||||
|
|
||||||
Corresponding GitHub advisories and CVE will be published 3 months after the iTop version release date so that iTop instances can be updated.
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2021 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
/**
|
/**
|
||||||
* UserRightsMatrix (User management Module)
|
* UserRightsMatrix (User management Module)
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2021 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
* UserRightsNull
|
* UserRightsNull
|
||||||
* User management Module - say Yeah! to everything
|
* User management Module - say Yeah! to everything
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
define('ADMIN_PROFILE_NAME', 'Administrator');
|
define('ADMIN_PROFILE_NAME', 'Administrator');
|
||||||
define('PORTAL_PROFILE_NAME', 'Portal user');
|
define('PORTAL_PROFILE_NAME', 'Portal user');
|
||||||
|
|
||||||
@@ -36,15 +34,14 @@ class URP_Profiles extends UserRightsBaseClassGUI
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "addon/userrights,grant_by_profile,filter",
|
"category" => "addon/userrights,grant_by_profile,filter",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => "name",
|
"name_attcode" => "name",
|
||||||
"complementary_name_attcode" => array('description'),
|
"state_attcode" => "",
|
||||||
"state_attcode" => "",
|
"reconc_keys" => array(),
|
||||||
"reconc_keys" => array(),
|
"db_table" => "priv_urp_profiles",
|
||||||
"db_table" => "priv_urp_profiles",
|
"db_key_field" => "id",
|
||||||
"db_key_field" => "id",
|
"db_finalclass_field" => "",
|
||||||
"db_finalclass_field" => "",
|
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
//MetaModel::Init_InheritAttributes();
|
//MetaModel::Init_InheritAttributes();
|
||||||
@@ -94,15 +91,15 @@ class URP_Profiles extends UserRightsBaseClassGUI
|
|||||||
$bGrant = $oUserRights->GetProfileActionGrant($this->GetKey(), $sClass, $sAction);
|
$bGrant = $oUserRights->GetProfileActionGrant($this->GetKey(), $sClass, $sAction);
|
||||||
if (is_null($bGrant))
|
if (is_null($bGrant))
|
||||||
{
|
{
|
||||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||||
}
|
}
|
||||||
elseif ($bGrant)
|
elseif ($bGrant)
|
||||||
{
|
{
|
||||||
return '<span class="ibo-user-rights ibo-is-success">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
return '<span style="background-color: #ddffdd;">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,37 +219,24 @@ class URP_UserProfile extends UserRightsBaseClassGUI
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "addon/userrights,grant_by_profile,filter",
|
"category" => "addon/userrights,grant_by_profile,filter",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => array("userlogin", "profile"),
|
"name_attcode" => array("userlogin", "profile"),
|
||||||
"state_attcode" => "",
|
"state_attcode" => "",
|
||||||
"reconc_keys" => array(),
|
"reconc_keys" => array(),
|
||||||
"db_table" => "priv_urp_userprofile",
|
"db_table" => "priv_urp_userprofile",
|
||||||
"db_key_field" => "id",
|
"db_key_field" => "id",
|
||||||
"db_finalclass_field" => "",
|
"db_finalclass_field" => "",
|
||||||
"is_link" => true, /** @since 3.1.0 N°6482 */
|
|
||||||
'uniqueness_rules' => array(
|
|
||||||
'no_duplicate' => array(
|
|
||||||
'attributes' => array(
|
|
||||||
0 => 'userid',
|
|
||||||
1 => 'profileid',
|
|
||||||
),
|
|
||||||
'filter' => '',
|
|
||||||
'disabled' => false,
|
|
||||||
'is_blocking' => true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
//MetaModel::Init_InheritAttributes();
|
//MetaModel::Init_InheritAttributes();
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass" => "User", "jointype" => "", "allowed_values" => null, "sql" => "userid", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass"=>"User", "jointype"=> "", "allowed_values"=>null, "sql"=>"userid", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("userlogin", array("allowed_values" => null, "extkey_attcode" => 'userid', "target_attcode" => "login")));
|
MetaModel::Init_AddAttribute(new AttributeExternalField("userlogin", array("allowed_values"=>null, "extkey_attcode"=> 'userid', "target_attcode"=>"login")));
|
||||||
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid",
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass"=>"URP_Profiles", "jointype"=> "", "allowed_values"=>null, "sql"=>"profileid", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
array("targetclass" => "URP_Profiles", "jointype" => "", "allowed_values" => null, "sql" => "profileid", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array(), "allow_target_creation" => false)));
|
MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values"=>null, "extkey_attcode"=> 'profileid', "target_attcode"=>"name")));
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values" => null, "extkey_attcode" => 'profileid', "target_attcode" => "name")));
|
|
||||||
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("reason", array("allowed_values" => null, "sql" => "description", "default_value" => null, "is_null_allowed" => true, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeString("reason", array("allowed_values"=>null, "sql"=>"description", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('userid', 'profileid', 'reason')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('userid', 'profileid', 'reason')); // Attributes to be displayed for the complete details
|
||||||
@@ -448,12 +432,6 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
UR_ACTION_BULK_DELETE => 'bd',
|
UR_ACTION_BULK_DELETE => 'bd',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array $aUsersProfilesList Cache of users' profiles. Hash array of user ID => [profile ID => profile friendlyname, profile ID => profile friendlyname, ...]
|
|
||||||
* @since 2.7.10 3.0.4 3.1.1 3.2.0 N°6887
|
|
||||||
*/
|
|
||||||
private $aUsersProfilesList = [];
|
|
||||||
|
|
||||||
// Installation: create the very first user
|
// Installation: create the very first user
|
||||||
public function CreateAdministrator($sAdminUser, $sAdminPwd, $sLanguage = 'EN US')
|
public function CreateAdministrator($sAdminUser, $sAdminPwd, $sLanguage = 'EN US')
|
||||||
{
|
{
|
||||||
@@ -510,7 +488,6 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected $m_aUserOrgs = array(); // userid -> array of orgid
|
protected $m_aUserOrgs = array(); // userid -> array of orgid
|
||||||
protected $m_aAdministrators = null; // [user id]
|
|
||||||
|
|
||||||
// Built on demand, could be optimized if necessary (doing a query for each attribute that needs to be read)
|
// Built on demand, could be optimized if necessary (doing a query for each attribute that needs to be read)
|
||||||
protected $m_aObjectActionGrants = array();
|
protected $m_aObjectActionGrants = array();
|
||||||
@@ -567,7 +544,6 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
|
|
||||||
// Cache
|
// Cache
|
||||||
$this->m_aObjectActionGrants = array();
|
$this->m_aObjectActionGrants = array();
|
||||||
$this->m_aAdministrators = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function LoadCache()
|
public function LoadCache()
|
||||||
@@ -710,10 +686,12 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
*/
|
*/
|
||||||
private function GetAdministrators()
|
private function GetAdministrators()
|
||||||
{
|
{
|
||||||
if ($this->m_aAdministrators === null)
|
static $aAdministrators = null;
|
||||||
|
|
||||||
|
if ($aAdministrators === null)
|
||||||
{
|
{
|
||||||
// Find all administrators
|
// Find all administrators
|
||||||
$this->m_aAdministrators = array();
|
$aAdministrators = array();
|
||||||
$oAdministratorsFilter = new DBObjectSearch('User');
|
$oAdministratorsFilter = new DBObjectSearch('User');
|
||||||
$oLnkFilter = new DBObjectSearch('URP_UserProfile');
|
$oLnkFilter = new DBObjectSearch('URP_UserProfile');
|
||||||
$oExpression = new FieldExpression('profileid', 'URP_UserProfile');
|
$oExpression = new FieldExpression('profileid', 'URP_UserProfile');
|
||||||
@@ -726,10 +704,10 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
$oSet->OptimizeColumnLoad(array('User' => array('login')));
|
$oSet->OptimizeColumnLoad(array('User' => array('login')));
|
||||||
while($oUser = $oSet->Fetch())
|
while($oUser = $oSet->Fetch())
|
||||||
{
|
{
|
||||||
$this->m_aAdministrators[] = $oUser->GetKey();
|
$aAdministrators[] = $oUser->GetKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->m_aAdministrators;
|
return $aAdministrators;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -766,12 +744,8 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
$sAction = self::$m_aActionCodes[$iActionCode];
|
$sAction = self::$m_aActionCodes[$iActionCode];
|
||||||
|
|
||||||
$bStatus = null;
|
$bStatus = null;
|
||||||
// Cache user's profiles
|
|
||||||
if(false === array_key_exists($iUser, $this->aUsersProfilesList)){
|
|
||||||
$this->aUsersProfilesList[$iUser] = UserRights::ListProfiles($oUser);
|
|
||||||
}
|
|
||||||
// Call the API of UserRights because it caches the list for us
|
// Call the API of UserRights because it caches the list for us
|
||||||
foreach($this->aUsersProfilesList[$iUser] as $iProfile => $oProfile)
|
foreach(UserRights::ListProfiles($oUser) as $iProfile => $oProfile)
|
||||||
{
|
{
|
||||||
$bGrant = $this->GetProfileActionGrant($iProfile, $sClass, $sAction);
|
$bGrant = $this->GetProfileActionGrant($iProfile, $sClass, $sAction);
|
||||||
if (!is_null($bGrant))
|
if (!is_null($bGrant))
|
||||||
@@ -825,37 +799,48 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
{
|
{
|
||||||
// We are protected by GetSelectFilter: the object set contains objects allowed or shared for reading
|
// We are protected by GetSelectFilter: the object set contains objects allowed or shared for reading
|
||||||
// We have to answer NO for objects shared for reading purposes
|
// We have to answer NO for objects shared for reading purposes
|
||||||
if (self::HasSharing() && SharedObject::GetSharedClassProperties($sClass)) {
|
if (self::HasSharing())
|
||||||
// This class is shared, GetSelectFilter may allow some objects for read only
|
{
|
||||||
// But currently we are checking whether the objects might be written...
|
$aClassProps = SharedObject::GetSharedClassProperties($sClass);
|
||||||
// Let's exclude the objects based on the relevant criteria
|
if ($aClassProps)
|
||||||
|
{
|
||||||
|
// This class is shared, GetSelectFilter may allow some objects for read only
|
||||||
|
// But currently we are checking wether the objects might be written...
|
||||||
|
// Let's exclude the objects based on the relevant criteria
|
||||||
|
|
||||||
// Use $oInstanceSet only if sClass is the main class
|
$sOrgAttCode = self::GetOwnerOrganizationAttCode($sClass);
|
||||||
if (!is_a($oInstanceSet->GetClass(), $sClass, true)) {
|
if (!is_null($sOrgAttCode))
|
||||||
/** @var \DBObjectSet $oInstanceSet */
|
{
|
||||||
throw new CoreException(__FUNCTION__.': Expecting object set to be of class '.$sClass.' but it is of class '.$oInstanceSet->GetClass(), ['OQL_Query' => $oInstanceSet->GetFilter()->ToOQL(), 'classes' => $oInstanceSet->GetSelectedClasses()]);
|
$aUserOrgs = $this->GetUserOrgs($oUser, $sClass);
|
||||||
}
|
if (!is_null($aUserOrgs) && count($aUserOrgs) > 0)
|
||||||
$sOrgAttCode = self::GetOwnerOrganizationAttCode($sClass);
|
{
|
||||||
if (!is_null($sOrgAttCode)) {
|
$iCountNO = 0;
|
||||||
$aUserOrgs = $this->GetUserOrgs($oUser, $sClass);
|
$iCountYES = 0;
|
||||||
if (!is_null($aUserOrgs) && count($aUserOrgs) > 0) {
|
$oInstanceSet->Rewind();
|
||||||
$iCountNO = 0;
|
while($oObject = $oInstanceSet->Fetch())
|
||||||
$iCountYES = 0;
|
{
|
||||||
$oInstanceSet->Rewind();
|
$iOrg = $oObject->Get($sOrgAttCode);
|
||||||
while ($oObject = $oInstanceSet->Fetch()) {
|
if (in_array($iOrg, $aUserOrgs))
|
||||||
$iOrg = $oObject->Get($sOrgAttCode);
|
{
|
||||||
if (in_array($iOrg, $aUserOrgs)) {
|
$iCountYES++;
|
||||||
$iCountYES++;
|
}
|
||||||
} else {
|
else
|
||||||
$iCountNO++;
|
{
|
||||||
|
$iCountNO++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($iCountNO == 0)
|
||||||
|
{
|
||||||
|
$iPermission = UR_ALLOWED_YES;
|
||||||
|
}
|
||||||
|
elseif ($iCountYES == 0)
|
||||||
|
{
|
||||||
|
$iPermission = UR_ALLOWED_NO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$iPermission = UR_ALLOWED_DEPENDS;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ($iCountNO == 0) {
|
|
||||||
$iPermission = UR_ALLOWED_YES;
|
|
||||||
} elseif ($iCountYES == 0) {
|
|
||||||
$iPermission = UR_ALLOWED_NO;
|
|
||||||
} else {
|
|
||||||
$iPermission = UR_ALLOWED_DEPENDS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -886,16 +871,11 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
// Note: this code is VERY close to the code of IsActionAllowed()
|
// Note: this code is VERY close to the code of IsActionAllowed()
|
||||||
$iUser = $oUser->GetKey();
|
$iUser = $oUser->GetKey();
|
||||||
|
|
||||||
// Cache user's profiles
|
|
||||||
if(false === array_key_exists($iUser, $this->aUsersProfilesList)){
|
|
||||||
$this->aUsersProfilesList[$iUser] = UserRights::ListProfiles($oUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note: The object set is ignored because it was interesting to optimize for huge data sets
|
// Note: The object set is ignored because it was interesting to optimize for huge data sets
|
||||||
// and acceptable to consider only the root class of the object set
|
// and acceptable to consider only the root class of the object set
|
||||||
$bStatus = null;
|
$bStatus = null;
|
||||||
// Call the API of UserRights because it caches the list for us
|
// Call the API of UserRights because it caches the list for us
|
||||||
foreach($this->aUsersProfilesList[$iUser] as $iProfile => $oProfile)
|
foreach(UserRights::ListProfiles($oUser) as $iProfile => $oProfile)
|
||||||
{
|
{
|
||||||
$bGrant = $this->GetClassStimulusGrant($iProfile, $sClass, $sStimulusCode);
|
$bGrant = $this->GetClassStimulusGrant($iProfile, $sClass, $sStimulusCode);
|
||||||
if (!is_null($bGrant))
|
if (!is_null($bGrant))
|
||||||
@@ -924,9 +904,8 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sClass
|
* Find out which attribute is corresponding the the dimension 'owner org'
|
||||||
* @return string|null Find out which attribute is corresponding the dimension 'owner org'
|
* returns null if no such attribute has been found (no filtering should occur)
|
||||||
* returns null if no such attribute has been found (no filtering should occur)
|
|
||||||
*/
|
*/
|
||||||
public static function GetOwnerOrganizationAttCode($sClass)
|
public static function GetOwnerOrganizationAttCode($sClass)
|
||||||
{
|
{
|
||||||
@@ -971,3 +950,4 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
|
|
||||||
UserRights::SelectModule('UserRightsProfile');
|
UserRights::SelectModule('UserRightsProfile');
|
||||||
|
|
||||||
|
?>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2021 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -17,8 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
define('ADMIN_PROFILE_NAME', 'Administrator');
|
define('ADMIN_PROFILE_NAME', 'Administrator');
|
||||||
define('PORTAL_PROFILE_NAME', 'Portal user');
|
define('PORTAL_PROFILE_NAME', 'Portal user');
|
||||||
|
|
||||||
@@ -71,15 +69,14 @@ class URP_Profiles extends UserRightsBaseClassGUI
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "addon/userrights",
|
"category" => "addon/userrights",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => "name",
|
"name_attcode" => "name",
|
||||||
"complementary_name_attcode" => array('description'),
|
"state_attcode" => "",
|
||||||
"state_attcode" => "",
|
"reconc_keys" => array(),
|
||||||
"reconc_keys" => array(),
|
"db_table" => "priv_urp_profiles",
|
||||||
"db_table" => "priv_urp_profiles",
|
"db_key_field" => "id",
|
||||||
"db_key_field" => "id",
|
"db_finalclass_field" => "",
|
||||||
"db_finalclass_field" => "",
|
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
//MetaModel::Init_InheritAttributes();
|
//MetaModel::Init_InheritAttributes();
|
||||||
@@ -250,11 +247,11 @@ class URP_Profiles extends UserRightsBaseClassGUI
|
|||||||
$iGrant = $oUserRights->GetProfileActionGrant($this->GetKey(), $sClass, $sAction);
|
$iGrant = $oUserRights->GetProfileActionGrant($this->GetKey(), $sClass, $sAction);
|
||||||
if (!is_null($iGrant))
|
if (!is_null($iGrant))
|
||||||
{
|
{
|
||||||
return '<span class="ibo-user-rights ibo-is-success">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
return '<span style="background-color: #ddffdd;">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,26 +325,24 @@ class URP_UserProfile extends UserRightsBaseClassGUI
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "addon/userrights",
|
"category" => "addon/userrights",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => array("userlogin", "profile"),
|
"name_attcode" => array("userlogin", "profile"),
|
||||||
"state_attcode" => "",
|
"state_attcode" => "",
|
||||||
"reconc_keys" => array(),
|
"reconc_keys" => array(),
|
||||||
"db_table" => "priv_urp_userprofile",
|
"db_table" => "priv_urp_userprofile",
|
||||||
"db_key_field" => "id",
|
"db_key_field" => "id",
|
||||||
"db_finalclass_field" => "",
|
"db_finalclass_field" => "",
|
||||||
"is_link" => true, /** @since 3.1.0 N°6482 */
|
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
//MetaModel::Init_InheritAttributes();
|
//MetaModel::Init_InheritAttributes();
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass" => "User", "jointype" => "", "allowed_values" => null, "sql" => "userid", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass"=>"User", "jointype"=> "", "allowed_values"=>null, "sql"=>"userid", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("userlogin", array("allowed_values" => null, "extkey_attcode" => 'userid', "target_attcode" => "login")));
|
MetaModel::Init_AddAttribute(new AttributeExternalField("userlogin", array("allowed_values"=>null, "extkey_attcode"=> 'userid', "target_attcode"=>"login")));
|
||||||
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid",
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass"=>"URP_Profiles", "jointype"=> "", "allowed_values"=>null, "sql"=>"profileid", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
array("targetclass" => "URP_Profiles", "jointype" => "", "allowed_values" => null, "sql" => "profileid", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array(), "allow_target_creation" => false)));
|
MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values"=>null, "extkey_attcode"=> 'profileid', "target_attcode"=>"name")));
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values" => null, "extkey_attcode" => 'profileid', "target_attcode" => "name")));
|
|
||||||
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("reason", array("allowed_values" => null, "sql" => "description", "default_value" => null, "is_null_allowed" => true, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeString("reason", array("allowed_values"=>null, "sql"=>"description", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('userid', 'profileid', 'reason')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('userid', 'profileid', 'reason')); // Attributes to be displayed for the complete details
|
||||||
@@ -582,10 +577,10 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
/**
|
/**
|
||||||
* Read and cache organizations allowed to the given user
|
* Read and cache organizations allowed to the given user
|
||||||
*
|
*
|
||||||
* @param User $oUser
|
* @param $oUser
|
||||||
* @param string $sClass (not used here but can be used in overloads)
|
* @param $sClass (not used here but can be used in overloads)
|
||||||
*
|
*
|
||||||
* @return array keys of the User allowed org
|
* @return array
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2021 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -17,8 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
define('ADMIN_PROFILE_ID', 1);
|
define('ADMIN_PROFILE_ID', 1);
|
||||||
|
|
||||||
class UserRightsBaseClass extends cmdbAbstractObject
|
class UserRightsBaseClass extends cmdbAbstractObject
|
||||||
@@ -52,15 +50,14 @@ class URP_Profiles extends UserRightsBaseClass
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "addon/userrights",
|
"category" => "addon/userrights",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => "name",
|
"name_attcode" => "name",
|
||||||
"complementary_name_attcode" => array('description'),
|
"state_attcode" => "",
|
||||||
"state_attcode" => "",
|
"reconc_keys" => array(),
|
||||||
"reconc_keys" => array(),
|
"db_table" => "priv_urp_profiles",
|
||||||
"db_table" => "priv_urp_profiles",
|
"db_key_field" => "id",
|
||||||
"db_key_field" => "id",
|
"db_finalclass_field" => "",
|
||||||
"db_finalclass_field" => "",
|
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
//MetaModel::Init_InheritAttributes();
|
//MetaModel::Init_InheritAttributes();
|
||||||
@@ -82,11 +79,11 @@ class URP_Profiles extends UserRightsBaseClass
|
|||||||
$oGrant = $oUserRights->GetClassActionGrant($this->GetKey(), $sClass, $sAction);
|
$oGrant = $oUserRights->GetClassActionGrant($this->GetKey(), $sClass, $sAction);
|
||||||
if (is_object($oGrant) && ($oGrant->Get('permission') == 'yes'))
|
if (is_object($oGrant) && ($oGrant->Get('permission') == 'yes'))
|
||||||
{
|
{
|
||||||
return '<span class="ibo-user-rights ibo-is-success">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
return '<span style="background-color: #ddffdd;">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,26 +268,24 @@ class URP_UserProfile extends UserRightsBaseClass
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "addon/userrights",
|
"category" => "addon/userrights",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => array("userlogin", "profile"),
|
"name_attcode" => array("userlogin", "profile"),
|
||||||
"state_attcode" => "",
|
"state_attcode" => "",
|
||||||
"reconc_keys" => array(),
|
"reconc_keys" => array(),
|
||||||
"db_table" => "priv_urp_userprofile",
|
"db_table" => "priv_urp_userprofile",
|
||||||
"db_key_field" => "id",
|
"db_key_field" => "id",
|
||||||
"db_finalclass_field" => "",
|
"db_finalclass_field" => "",
|
||||||
"is_link" => true, /** @since 3.1.0 N°6482 */
|
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
//MetaModel::Init_InheritAttributes();
|
//MetaModel::Init_InheritAttributes();
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass" => "User", "jointype" => "", "allowed_values" => null, "sql" => "userid", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass"=>"User", "jointype"=> "", "allowed_values"=>null, "sql"=>"userid", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("userlogin", array("allowed_values" => null, "extkey_attcode" => 'userid', "target_attcode" => "login")));
|
MetaModel::Init_AddAttribute(new AttributeExternalField("userlogin", array("allowed_values"=>null, "extkey_attcode"=> 'userid', "target_attcode"=>"login")));
|
||||||
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid",
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass"=>"URP_Profiles", "jointype"=> "", "allowed_values"=>null, "sql"=>"profileid", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||||
array("targetclass" => "URP_Profiles", "jointype" => "", "allowed_values" => null, "sql" => "profileid", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array(), "allow_target_creation" => false)));
|
MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values"=>null, "extkey_attcode"=> 'profileid', "target_attcode"=>"name")));
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values" => null, "extkey_attcode" => 'profileid', "target_attcode" => "name")));
|
|
||||||
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("reason", array("allowed_values" => null, "sql" => "description", "default_value" => null, "is_null_allowed" => true, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeString("reason", array("allowed_values"=>null, "sql"=>"description", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('userid', 'profileid', 'reason')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('userid', 'profileid', 'reason')); // Attributes to be displayed for the complete details
|
||||||
|
|||||||
29
app.php
29
app.php
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
|
||||||
*
|
|
||||||
* This file is part of iTop.
|
|
||||||
*
|
|
||||||
* iTop is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* iTop is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Combodo\iTop\Kernel;
|
|
||||||
|
|
||||||
require_once __DIR__.'/lib/autoload_runtime.php';
|
|
||||||
|
|
||||||
require_once('approot.inc.php');
|
|
||||||
require_once('application/startup.inc.php');
|
|
||||||
|
|
||||||
return function (array $context) {
|
|
||||||
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
|
||||||
};
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
331
application/Html2Text.php
Normal file
331
application/Html2Text.php
Normal file
@@ -0,0 +1,331 @@
|
|||||||
|
<?php
|
||||||
|
namespace Html2Text;
|
||||||
|
|
||||||
|
if (!function_exists('mb_split'))
|
||||||
|
{
|
||||||
|
function mb_split($pattern, $subject, $limit = -1)
|
||||||
|
{
|
||||||
|
return preg_split('/'.$pattern.'/', $subject, $limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replace all occurrences of the search string with the replacement string.
|
||||||
|
*
|
||||||
|
* @author Sean Murphy <sean@iamseanmurphy.com>
|
||||||
|
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
|
||||||
|
* @license http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
* @link http://php.net/manual/function.str-replace.php
|
||||||
|
*
|
||||||
|
* @param mixed $search
|
||||||
|
* @param mixed $replace
|
||||||
|
* @param mixed $subject
|
||||||
|
* @param int $count
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function mb_str_replace($search, $replace, $subject, &$count = 0) {
|
||||||
|
if (!is_array($subject)) {
|
||||||
|
// Normalize $search and $replace so they are both arrays of the same length
|
||||||
|
$searches = is_array($search) ? array_values($search) : array($search);
|
||||||
|
$replacements = is_array($replace) ? array_values($replace) : array($replace);
|
||||||
|
$replacements = array_pad($replacements, count($searches), '');
|
||||||
|
foreach ($searches as $key => $search) {
|
||||||
|
$parts = mb_split(preg_quote($search), $subject);
|
||||||
|
if (is_array($parts))
|
||||||
|
{
|
||||||
|
$count += count($parts) - 1;
|
||||||
|
$subject = implode($replacements[$key], $parts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Call mb_str_replace for each subject in array, recursively
|
||||||
|
foreach ($subject as $key => $value) {
|
||||||
|
$subject[$key] = mb_str_replace($search, $replace, $value, $count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Copyright (c) 2010 Jevon Wright and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* or
|
||||||
|
*
|
||||||
|
* LGPL which is available at http://www.gnu.org/licenses/lgpl.html
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Jevon Wright - initial API and implementation
|
||||||
|
* Denis Flaven - some fixes for properly handling UTF-8 characters
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
class Html2Text {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tries to convert the given HTML into a plain text format - best suited for
|
||||||
|
* e-mail display, etc.
|
||||||
|
*
|
||||||
|
* <p>In particular, it tries to maintain the following features:
|
||||||
|
* <ul>
|
||||||
|
* <li>Links are maintained, with the 'href' copied over
|
||||||
|
* <li>Information in the <head> is lost
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param string html the input HTML
|
||||||
|
* @return string the HTML converted, as best as possible, to text
|
||||||
|
* @throws Html2TextException if the HTML could not be loaded as a {@link DOMDocument}
|
||||||
|
*/
|
||||||
|
static function convert($html) {
|
||||||
|
// replace with spaces
|
||||||
|
|
||||||
|
$html = str_replace(" ", " ", $html);
|
||||||
|
$html = mb_str_replace("\xc2\xa0", " ", $html); // DO NOT USE str_replace since it breaks the "à" character which is \xc3 \xa0 in UTF-8
|
||||||
|
|
||||||
|
$html = static::fixNewlines($html);
|
||||||
|
|
||||||
|
$doc = new \DOMDocument();
|
||||||
|
if (!@$doc->loadHTML('<?xml encoding="UTF-8">'.$html)) // Forces the UTF-8 character set for HTML fragments
|
||||||
|
{
|
||||||
|
throw new Html2TextException("Could not load HTML - badly formed?", $html);
|
||||||
|
}
|
||||||
|
|
||||||
|
$output = static::iterateOverNode($doc);
|
||||||
|
|
||||||
|
// remove leading and trailing spaces on each line
|
||||||
|
$output = preg_replace("/[ \t]*\n[ \t]*/im", "\n", $output);
|
||||||
|
$output = preg_replace("/ *\t */im", "\t", $output);
|
||||||
|
|
||||||
|
// remove unnecessary empty lines
|
||||||
|
$output = preg_replace("/\n\n\n*/im", "\n\n", $output);
|
||||||
|
|
||||||
|
// remove leading and trailing whitespace
|
||||||
|
$output = trim($output);
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unify newlines; in particular, \r\n becomes \n, and
|
||||||
|
* then \r becomes \n. This means that all newlines (Unix, Windows, Mac)
|
||||||
|
* all become \ns.
|
||||||
|
*
|
||||||
|
* @param string text text with any number of \r, \r\n and \n combinations
|
||||||
|
* @return string the fixed text
|
||||||
|
*/
|
||||||
|
static function fixNewlines($text) {
|
||||||
|
// replace \r\n to \n
|
||||||
|
$text = str_replace("\r\n", "\n", $text);
|
||||||
|
// remove \rs
|
||||||
|
$text = str_replace("\r", "\n", $text);
|
||||||
|
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function nextChildName($node) {
|
||||||
|
// get the next child
|
||||||
|
$nextNode = $node->nextSibling;
|
||||||
|
while ($nextNode != null) {
|
||||||
|
if ($nextNode instanceof \DOMElement) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$nextNode = $nextNode->nextSibling;
|
||||||
|
}
|
||||||
|
$nextName = null;
|
||||||
|
if ($nextNode instanceof \DOMElement && $nextNode != null) {
|
||||||
|
$nextName = strtolower($nextNode->nodeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $nextName;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function prevChildName($node) {
|
||||||
|
// get the previous child
|
||||||
|
$nextNode = $node->previousSibling;
|
||||||
|
while ($nextNode != null) {
|
||||||
|
if ($nextNode instanceof \DOMElement) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$nextNode = $nextNode->previousSibling;
|
||||||
|
}
|
||||||
|
$nextName = null;
|
||||||
|
if ($nextNode instanceof \DOMElement && $nextNode != null) {
|
||||||
|
$nextName = strtolower($nextNode->nodeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $nextName;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function iterateOverNode($node) {
|
||||||
|
if ($node instanceof \DOMText) {
|
||||||
|
// Replace whitespace characters with a space (equivilant to \s)
|
||||||
|
return preg_replace("/[\\t\\n\\f\\r ]+/im", " ", $node->wholeText);
|
||||||
|
}
|
||||||
|
if ($node instanceof \DOMDocumentType) {
|
||||||
|
// ignore
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$nextName = static::nextChildName($node);
|
||||||
|
$prevName = static::prevChildName($node);
|
||||||
|
|
||||||
|
$name = strtolower($node->nodeName);
|
||||||
|
|
||||||
|
// start whitespace
|
||||||
|
switch ($name) {
|
||||||
|
case "hr":
|
||||||
|
return "---------------------------------------------------------------\n";
|
||||||
|
|
||||||
|
case "style":
|
||||||
|
case "head":
|
||||||
|
case "title":
|
||||||
|
case "meta":
|
||||||
|
case "script":
|
||||||
|
// ignore these tags
|
||||||
|
return "";
|
||||||
|
|
||||||
|
case "h1":
|
||||||
|
case "h2":
|
||||||
|
case "h3":
|
||||||
|
case "h4":
|
||||||
|
case "h5":
|
||||||
|
case "h6":
|
||||||
|
case "ol":
|
||||||
|
case "ul":
|
||||||
|
// add two newlines, second line is added below
|
||||||
|
$output = "\n";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "td":
|
||||||
|
case "th":
|
||||||
|
// add tab char to separate table fields
|
||||||
|
$output = "\t";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "tr":
|
||||||
|
case "p":
|
||||||
|
case "div":
|
||||||
|
// add one line
|
||||||
|
$output = "\n";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "li":
|
||||||
|
$output = "- ";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// print out contents of unknown tags
|
||||||
|
$output = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// debug
|
||||||
|
//$output .= "[$name,$nextName]";
|
||||||
|
|
||||||
|
if (isset($node->childNodes)) {
|
||||||
|
for ($i = 0; $i < $node->childNodes->length; $i++) {
|
||||||
|
$n = $node->childNodes->item($i);
|
||||||
|
|
||||||
|
$text = static::iterateOverNode($n);
|
||||||
|
|
||||||
|
$output .= $text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// end whitespace
|
||||||
|
switch ($name) {
|
||||||
|
case "h1":
|
||||||
|
case "h2":
|
||||||
|
case "h3":
|
||||||
|
case "h4":
|
||||||
|
case "h5":
|
||||||
|
case "h6":
|
||||||
|
$output .= "\n";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "p":
|
||||||
|
case "br":
|
||||||
|
// add one line
|
||||||
|
if ($nextName != "div")
|
||||||
|
$output .= "\n";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "div":
|
||||||
|
// add one line only if the next child isn't a div
|
||||||
|
if ($nextName != "div" && $nextName != null)
|
||||||
|
$output .= "\n";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "a":
|
||||||
|
// links are returned in [text](link) format
|
||||||
|
$href = $node->getAttribute("href");
|
||||||
|
|
||||||
|
$output = trim($output);
|
||||||
|
|
||||||
|
// remove double [[ ]] s from linking images
|
||||||
|
if (substr($output, 0, 1) == "[" && substr($output, -1) == "]") {
|
||||||
|
$output = substr($output, 1, strlen($output) - 2);
|
||||||
|
|
||||||
|
// for linking images, the title of the <a> overrides the title of the <img>
|
||||||
|
if ($node->getAttribute("title")) {
|
||||||
|
$output = $node->getAttribute("title");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there is no link text, but a title attr
|
||||||
|
if (!$output && $node->getAttribute("title")) {
|
||||||
|
$output = $node->getAttribute("title");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($href == null) {
|
||||||
|
// it doesn't link anywhere
|
||||||
|
if ($node->getAttribute("name") != null) {
|
||||||
|
$output = "[$output]";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($href == $output || $href == "mailto:$output" || $href == "http://$output" || $href == "https://$output") {
|
||||||
|
// link to the same address: just use link
|
||||||
|
$output;
|
||||||
|
} else {
|
||||||
|
// replace it
|
||||||
|
if ($output) {
|
||||||
|
$output = "[$output]($href)";
|
||||||
|
} else {
|
||||||
|
// empty string
|
||||||
|
$output = $href;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// does the next node require additional whitespace?
|
||||||
|
switch ($nextName) {
|
||||||
|
case "h1": case "h2": case "h3": case "h4": case "h5": case "h6":
|
||||||
|
$output .= "\n";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "img":
|
||||||
|
if ($node->getAttribute("title")) {
|
||||||
|
$output = "[" . $node->getAttribute("title") . "]";
|
||||||
|
} elseif ($node->getAttribute("alt")) {
|
||||||
|
$output = "[" . $node->getAttribute("alt") . "]";
|
||||||
|
} else {
|
||||||
|
$output = "";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "li":
|
||||||
|
$output .= "\n";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
28
application/Html2TextException.php
Normal file
28
application/Html2TextException.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Copyright (c) 2010 Jevon Wright and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* or
|
||||||
|
*
|
||||||
|
* LGPL which is available at http://www.gnu.org/licenses/lgpl.html
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Jevon Wright - initial API and implementation
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
namespace Html2Text;
|
||||||
|
|
||||||
|
class Html2TextException extends \Exception {
|
||||||
|
var $more_info;
|
||||||
|
|
||||||
|
public function __construct($message = "", $more_info = "") {
|
||||||
|
parent::__construct($message);
|
||||||
|
$this->more_info = $more_info;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/AjaxPage.php, now loadable using autoloader
|
* @deprecated will be removed in 3.1.0 - moved to sources/Application/WebPage/AjaxPage.php, now loadable using autoloader
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// cannot notify depreciation for now as this is still load in autoloader
|
// cannot notify depreciation for now as this is still load in autoloader
|
||||||
//DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/AjaxPage.php, now loadable using autoloader');
|
//DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/AjaxPage.php, now loadable using autoloader');
|
||||||
use Combodo\iTop\Application\WebPage\AjaxPage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ajax_page
|
* Class ajax_page
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -12,7 +12,6 @@ require_once(APPROOT.'/application/applicationcontext.class.inc.php');
|
|||||||
require_once(APPROOT.'/application/cmdbabstract.class.inc.php');
|
require_once(APPROOT.'/application/cmdbabstract.class.inc.php');
|
||||||
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
||||||
require_once(APPROOT.'/application/audit.category.class.inc.php');
|
require_once(APPROOT.'/application/audit.category.class.inc.php');
|
||||||
require_once(APPROOT.'/application/audit.domain.class.inc.php');
|
|
||||||
require_once(APPROOT.'/application/audit.rule.class.inc.php');
|
require_once(APPROOT.'/application/audit.rule.class.inc.php');
|
||||||
require_once(APPROOT.'/application/query.class.inc.php');
|
require_once(APPROOT.'/application/query.class.inc.php');
|
||||||
require_once(APPROOT.'/setup/moduleinstallation.class.inc.php');
|
require_once(APPROOT.'/setup/moduleinstallation.class.inc.php');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2021 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Class ApplicationContext
|
* Class ApplicationContext
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -195,31 +195,16 @@ class ApplicationContext
|
|||||||
/**
|
/**
|
||||||
* Returns the context as string with the format name1=value1&name2=value2....
|
* Returns the context as string with the format name1=value1&name2=value2....
|
||||||
* @return string The context as a string to be appended to an href property
|
* @return string The context as a string to be appended to an href property
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function GetForLink(bool $bWithLeadingAmpersand = false)
|
public function GetForLink()
|
||||||
{
|
{
|
||||||
// If there are no parameters, return an empty string
|
|
||||||
if(empty($this->aValues)){
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build the query string with ampersand separated parameters
|
|
||||||
$aParams = array();
|
$aParams = array();
|
||||||
foreach($this->aValues as $sName => $sValue)
|
foreach($this->aValues as $sName => $sValue)
|
||||||
{
|
{
|
||||||
$aParams[] = "c[$sName]".'='.urlencode($sValue);
|
$aParams[] = "c[$sName]".'='.urlencode($sValue);
|
||||||
}
|
}
|
||||||
$sReturnValue = implode('&', $aParams);
|
return implode("&", $aParams);
|
||||||
|
|
||||||
// add the leading ampersand if requested
|
|
||||||
if($bWithLeadingAmpersand){
|
|
||||||
$sReturnValue = '&' . $sReturnValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $sReturnValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 3.0.0 N°2534 - dashboard: bug with autorefresh that deactivates filtering on organisation
|
* @since 3.0.0 N°2534 - dashboard: bug with autorefresh that deactivates filtering on organisation
|
||||||
* Returns the params as c[menu]:..., c[org_id]:....
|
* Returns the params as c[menu]:..., c[org_id]:....
|
||||||
@@ -253,7 +238,7 @@ class ApplicationContext
|
|||||||
{
|
{
|
||||||
$aContextInputBlocks = [];
|
$aContextInputBlocks = [];
|
||||||
foreach ($this->aValues as $sName => $sValue) {
|
foreach ($this->aValues as $sName => $sValue) {
|
||||||
$aContextInputBlocks[] = InputUIBlockFactory::MakeForHidden("c[$sName]", $sValue);
|
$aContextInputBlocks[] = InputUIBlockFactory::MakeForHidden("c[$sName]", utils::EscapeHtml($sValue));
|
||||||
}
|
}
|
||||||
return $aContextInputBlocks;
|
return $aContextInputBlocks;
|
||||||
}
|
}
|
||||||
@@ -391,19 +376,26 @@ class ApplicationContext
|
|||||||
{
|
{
|
||||||
$oAppContext = new ApplicationContext();
|
$oAppContext = new ApplicationContext();
|
||||||
|
|
||||||
if (is_null($sUrlMakerClass)) {
|
if (is_null($sUrlMakerClass))
|
||||||
$sUrlMakerClass = self::GetUrlMakerClass();
|
{
|
||||||
}
|
$sUrlMakerClass = self::GetUrlMakerClass();
|
||||||
|
}
|
||||||
$sUrl = call_user_func(array($sUrlMakerClass, 'MakeObjectUrl'), $sObjClass, $sObjKey);
|
$sUrl = call_user_func(array($sUrlMakerClass, 'MakeObjectUrl'), $sObjClass, $sObjKey);
|
||||||
if (utils::StrLen($sUrl) > 0) {
|
if (strlen($sUrl) > 0)
|
||||||
if ($bWithNavigationContext) {
|
{
|
||||||
return $sUrl.$oAppContext->GetForLink(true);
|
if ($bWithNavigationContext)
|
||||||
} else {
|
{
|
||||||
return $sUrl;
|
return $sUrl."&".$oAppContext->GetForLink();
|
||||||
}
|
}
|
||||||
} else {
|
else
|
||||||
return '';
|
{
|
||||||
}
|
return $sUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2021 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -20,9 +20,9 @@
|
|||||||
/**
|
/**
|
||||||
* This class manages the audit "categories". Each category defines a set of objects
|
* This class manages the audit "categories". Each category defines a set of objects
|
||||||
* to check and is linked to a set of rules that determine the valid or invalid objects
|
* to check and is linked to a set of rules that determine the valid or invalid objects
|
||||||
* inside the set
|
* inside the set
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -34,63 +34,27 @@ class AuditCategory extends cmdbAbstractObject
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "application,grant_by_profile",
|
"category" => "application, grant_by_profile",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => "name",
|
"name_attcode" => "name",
|
||||||
"state_attcode" => "",
|
"state_attcode" => "",
|
||||||
"reconc_keys" => array('name'),
|
"reconc_keys" => array('name'),
|
||||||
"db_table" => "priv_auditcategory",
|
"db_table" => "priv_auditcategory",
|
||||||
"db_key_field" => "id",
|
"db_key_field" => "id",
|
||||||
"db_finalclass_field" => "",
|
"db_finalclass_field" => "",
|
||||||
'style' => new ormStyle(null, null, null, null, null, '../images/icons/icons8-audit-folder.svg'),
|
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("name", array("description"=>"Short name for this category", "allowed_values"=>null, "sql"=>"name", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
|
MetaModel::Init_AddAttribute(new AttributeString("name", array("description"=>"Short name for this category", "allowed_values"=>null, "sql"=>"name", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values"=>null, "sql"=>"description", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
|
MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values"=>null, "sql"=>"description", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeOQL("definition_set", array("allowed_values"=>null, "sql"=>"definition_set", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
|
MetaModel::Init_AddAttribute(new AttributeOQL("definition_set", array("allowed_values"=>null, "sql"=>"definition_set", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeLinkedSet("rules_list", array("linked_class"=>"AuditRule", "ext_key_to_me"=>"category_id", "allowed_values"=>null, "count_min"=>0, "count_max"=>0, "depends_on"=>array(), "edit_mode" => LINKSET_EDITMODE_INPLACE, "tracking_level" => LINKSET_TRACKING_ALL)));
|
MetaModel::Init_AddAttribute(new AttributeLinkedSet("rules_list", array("linked_class"=>"AuditRule", "ext_key_to_me"=>"category_id", "allowed_values"=>null, "count_min"=>0, "count_max"=>0, "depends_on"=>array(), "edit_mode" => LINKSET_EDITMODE_INPLACE, "tracking_level" => LINKSET_TRACKING_ALL)));
|
||||||
MetaModel::Init_AddAttribute(new AttributeInteger("ok_error_tolerance", array("allowed_values"=>null, "sql"=>"ok_error_tolerance", "default_value"=>5, "is_null_allowed"=>true, "depends_on"=>array())));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeInteger("warning_error_tolerance", array("allowed_values" => null, "sql" => "warning_error_tolerance", "default_value" => 25, "is_null_allowed" => true, "depends_on" => array())));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("domains_list",
|
|
||||||
array("linked_class" => "lnkAuditCategoryToAuditDomain", "ext_key_to_me" => "category_id", "ext_key_to_remote" => "domain_id", "allowed_values" => null, "count_min" => 0, "count_max" => 0, "depends_on" => array(), "display_style" => 'property')));
|
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('name', 'description', 'definition_set', 'ok_error_tolerance', 'warning_error_tolerance', 'rules_list', 'domains_list')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('name', 'description', 'definition_set', 'rules_list')); // Attributes to be displayed for the complete details
|
||||||
MetaModel::Init_SetZListItems('list', array('description', )); // Attributes to be displayed for a list
|
MetaModel::Init_SetZListItems('list', array('description', )); // Attributes to be displayed for a list
|
||||||
// Search criteria
|
// Search criteria
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('description', 'definition_set')); // Criteria of the std search form
|
MetaModel::Init_SetZListItems('standard_search', array('description', 'definition_set')); // Criteria of the std search form
|
||||||
MetaModel::Init_SetZListItems('default_search', array('name', 'description')); // Criteria of the default search form
|
MetaModel::Init_SetZListItems('default_search', array('name', 'description')); // Criteria of the default search form
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $iTotal
|
|
||||||
* @param int $iErrors
|
|
||||||
*
|
|
||||||
* @return string A semantic color name (eg. red, green, orange, success, failure, ... {@see css/backoffice/utils/variables/colors/_semantic-palette.scss}) to use for this category depending on its error count and tolerance
|
|
||||||
* @throws \CoreException
|
|
||||||
*
|
|
||||||
* @since 3.1.0
|
|
||||||
*/
|
|
||||||
public function GetReportColor($iTotal, $iErrors)
|
|
||||||
{
|
|
||||||
$sResult = 'red';
|
|
||||||
if ( ($iTotal == 0) || ($iErrors / $iTotal) <= ($this->Get('ok_error_tolerance') / 100) ) {
|
|
||||||
$sResult = 'green';
|
|
||||||
} else if (($iErrors / $iTotal) <= ($this->Get('warning_error_tolerance') / 100)) {
|
|
||||||
$sResult = 'orange';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $sResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function GetShortcutActions($sFinalClass)
|
|
||||||
{
|
|
||||||
$aShortcutActions = parent::GetShortcutActions($sFinalClass);
|
|
||||||
if (!in_array('UI:Menu:RunAudit', $aShortcutActions)) {
|
|
||||||
$aShortcutActions[] = 'UI:Menu:RunAudit';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $aShortcutActions;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
<?php
|
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
|
||||||
//
|
|
||||||
// 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/>
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class manages the audit "categories". Each category defines a set of objects
|
|
||||||
* to check and is linked to a set of rules that determine the valid or invalid objects
|
|
||||||
* inside the set
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @since 3.1.0
|
|
||||||
*/
|
|
||||||
class AuditDomain extends cmdbAbstractObject
|
|
||||||
{
|
|
||||||
public static function Init()
|
|
||||||
{
|
|
||||||
$aParams = array
|
|
||||||
(
|
|
||||||
"category" => "application,grant_by_profile",
|
|
||||||
"key_type" => "autoincrement",
|
|
||||||
"name_attcode" => "name",
|
|
||||||
"complementary_name_attcode" => array('description'),
|
|
||||||
"state_attcode" => "",
|
|
||||||
"reconc_keys" => array('name'),
|
|
||||||
"db_table" => "priv_auditdomain",
|
|
||||||
"db_key_field" => "id",
|
|
||||||
"db_finalclass_field" => "",
|
|
||||||
'style' => new ormStyle(null, null, null, null, null, '../images/icons/icons8-audit-album.svg'),
|
|
||||||
);
|
|
||||||
MetaModel::Init_Params($aParams);
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("name", array("description" => "Short name for this category", "allowed_values" => null, "sql" => "name", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values" => null, "sql" => "description", "default_value" => "", "is_null_allowed" => true, "depends_on" => array())));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeImage("icon", array("is_null_allowed" => true, "depends_on" => array(), "display_max_width" => 96, "display_max_height" => 96, "storage_max_width" => 256, "storage_max_height" => 256, "default_image" => null, "always_load_in_tables" => false)));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("categories_list",
|
|
||||||
array("linked_class" => "lnkAuditCategoryToAuditDomain", "ext_key_to_me" => "domain_id", "ext_key_to_remote" => "category_id", "allowed_values" => null, "count_min" => 0, "count_max" => 0, "depends_on" => array())));
|
|
||||||
|
|
||||||
// Display lists
|
|
||||||
MetaModel::Init_SetZListItems('details', array('name', 'description', 'icon', 'categories_list')); // Attributes to be displayed for the complete details
|
|
||||||
MetaModel::Init_SetZListItems('list', array('description',)); // Attributes to be displayed for a list
|
|
||||||
// Search criteria
|
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('description')); // Criteria of the std search form
|
|
||||||
MetaModel::Init_SetZListItems('default_search', array('name', 'description')); // Criteria of the default search form
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function GetShortcutActions($sFinalClass)
|
|
||||||
{
|
|
||||||
$aShortcutActions = parent::GetShortcutActions($sFinalClass);
|
|
||||||
if (!in_array('UI:Menu:RunAudit', $aShortcutActions)) {
|
|
||||||
$aShortcutActions[] = 'UI:Menu:RunAudit';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $aShortcutActions;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @since 3.1.0
|
|
||||||
*/
|
|
||||||
class lnkAuditCategoryToAuditDomain extends cmdbAbstractObject
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @throws \CoreException
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
|
||||||
public static function Init()
|
|
||||||
{
|
|
||||||
$aParams = array
|
|
||||||
(
|
|
||||||
"category" => "application,grant_by_profile",
|
|
||||||
"key_type" => "autoincrement",
|
|
||||||
"name_attcode" => "",
|
|
||||||
"state_attcode" => "",
|
|
||||||
"reconc_keys" => array('category_id', 'domain_id'),
|
|
||||||
"db_table" => "priv_link_audit_category_domain",
|
|
||||||
"db_key_field" => "id",
|
|
||||||
"db_finalclass_field" => "",
|
|
||||||
"is_link" => true,
|
|
||||||
'uniqueness_rules' => array(
|
|
||||||
'no_duplicate' => array(
|
|
||||||
'attributes' => array(
|
|
||||||
0 => 'category_id',
|
|
||||||
1 => 'domain_id',
|
|
||||||
),
|
|
||||||
'filter' => '',
|
|
||||||
'disabled' => false,
|
|
||||||
'is_blocking' => true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
MetaModel::Init_Params($aParams);
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("category_id", array("targetclass" => "AuditCategory", "jointype" => '', "allowed_values" => null, "sql" => "category_id", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array())));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("category_name", array("allowed_values" => null, "extkey_attcode" => 'category_id', "target_attcode" => "name")));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("domain_id", array("targetclass" => "AuditDomain", "jointype" => '', "allowed_values" => null, "sql" => "domain_id", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array())));
|
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("domain_name", array("allowed_values" => null, "extkey_attcode" => 'domain_id', "target_attcode" => "name")));
|
|
||||||
|
|
||||||
// Display lists
|
|
||||||
MetaModel::Init_SetZListItems('details', array('category_id', 'domain_id'));
|
|
||||||
MetaModel::Init_SetZListItems('list', array('category_id', 'domain_id'));
|
|
||||||
// Search criteria
|
|
||||||
MetaModel::Init_SetZListItems('standard_search', array('category_id', 'domain_id'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2021 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
* or the "bad" ones. The core audit engines computes the complement to the definition
|
* or the "bad" ones. The core audit engines computes the complement to the definition
|
||||||
* set when needed to obtain either the valid objects, or the ones with an error
|
* set when needed to obtain either the valid objects, or the ones with an error
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -35,23 +35,22 @@ class AuditRule extends cmdbAbstractObject
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "application,grant_by_profile",
|
"category" => "application, grant_by_profile",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => "name",
|
"name_attcode" => "name",
|
||||||
"state_attcode" => "",
|
"state_attcode" => "",
|
||||||
"reconc_keys" => array('name'),
|
"reconc_keys" => array('name'),
|
||||||
"db_table" => "priv_auditrule",
|
"db_table" => "priv_auditrule",
|
||||||
"db_key_field" => "id",
|
"db_key_field" => "id",
|
||||||
"db_finalclass_field" => "",
|
"db_finalclass_field" => "",
|
||||||
'style' => new ormStyle(null, null, null, null, null, '../images/icons/icons8-audit.svg'),
|
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("name", array("allowed_values" => null, "sql" => "name", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeString("name", array("allowed_values"=>null, "sql"=>"name", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values" => null, "sql" => "description", "default_value" => "", "is_null_allowed" => true, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values"=>null, "sql"=>"description", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeOQL("query", array("allowed_values" => null, "sql" => "query", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeOQL("query", array("allowed_values"=>null, "sql"=>"query", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeEnum("valid_flag", array("allowed_values" => new ValueSetEnum('true,false'), "sql" => "valid_flag", "default_value" => "true", "is_null_allowed" => false, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeEnum("valid_flag", array("allowed_values"=>new ValueSetEnum('true,false'), "sql"=>"valid_flag", "default_value"=>"true", "is_null_allowed"=>false, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("category_id", array("allowed_values" => null, "sql" => "category_id", "targetclass" => "AuditCategory", "is_null_allowed" => false, "on_target_delete" => DEL_MANUAL, "depends_on" => array())));
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("category_id", array("allowed_values"=>null, "sql"=>"category_id", "targetclass"=>"AuditCategory", "is_null_allowed"=>false, "on_target_delete"=>DEL_MANUAL, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeExternalField("category_name", array("allowed_values" => null, "extkey_attcode" => 'category_id', "target_attcode" => "name")));
|
MetaModel::Init_AddAttribute(new AttributeExternalField("category_name", array("allowed_values"=>null, "extkey_attcode"=> 'category_id', "target_attcode"=>"name")));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('category_id', 'name', 'description', 'query', 'valid_flag')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('category_id', 'name', 'description', 'query', 'valid_flag')); // Attributes to be displayed for the complete details
|
||||||
@@ -60,16 +59,5 @@ class AuditRule extends cmdbAbstractObject
|
|||||||
MetaModel::Init_SetZListItems('standard_search', array('category_id', 'name', 'description', 'valid_flag', 'query')); // Criteria of the std search form
|
MetaModel::Init_SetZListItems('standard_search', array('category_id', 'name', 'description', 'valid_flag', 'query')); // Criteria of the std search form
|
||||||
MetaModel::Init_SetZListItems('default_search', array('name', 'description', 'category_id')); // Criteria of the advanced search form
|
MetaModel::Init_SetZListItems('default_search', array('name', 'description', 'category_id')); // Criteria of the advanced search form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function GetShortcutActions($sFinalClass)
|
|
||||||
{
|
|
||||||
$aShortcutActions = parent::GetShortcutActions($sFinalClass);
|
|
||||||
if (!in_array('UI:Menu:RunAudit', $aShortcutActions)) {
|
|
||||||
$aShortcutActions[] = 'UI:Menu:RunAudit';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $aShortcutActions;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/CaptureWebPage.php, now loadable using autoloader
|
* @deprecated will be removed in 3.1.0 - moved to sources/Application/WebPage/CaptureWebPage.php, now loadable using autoloader
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/CaptureWebPage.php, now loadable using autoloader');
|
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/CaptureWebPage.php, now loadable using autoloader');
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/CLIPage.php, now loadable using autoloader
|
* @deprecated will be removed in 3.1.0 - moved to sources/Application/WebPage/CLIPage.php, now loadable using autoloader
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/CLIPage.php, now loadable using autoloader');
|
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/CLIPage.php, now loadable using autoloader');
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2020 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/CSVPage.php, now loadable using autoloader
|
* @deprecated will be removed in 3.1.0 - moved to sources/Application/WebPage/CSVPage.php, now loadable using autoloader
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/CSVPage.php, now loadable using autoloader');
|
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/CSVPage.php, now loadable using autoloader');
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -9,8 +9,6 @@ use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
|
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
|
||||||
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
require_once(APPROOT.'application/dashboardlayout.class.inc.php');
|
require_once(APPROOT.'application/dashboardlayout.class.inc.php');
|
||||||
require_once(APPROOT.'application/dashlet.class.inc.php');
|
require_once(APPROOT.'application/dashlet.class.inc.php');
|
||||||
@@ -424,7 +422,7 @@ abstract class Dashboard
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage *
|
* @param \WebPage $oPage *
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @throws \ReflectionException
|
* @throws \ReflectionException
|
||||||
@@ -480,7 +478,7 @@ abstract class Dashboard
|
|||||||
CombodoTooltip.InitTooltipFromMarkup($("#attr_auto_reload_sec"));
|
CombodoTooltip.InitTooltipFromMarkup($("#attr_auto_reload_sec"));
|
||||||
$("#attr_auto_reload_sec").prop('disabled', !$('#attr_auto_reload').is(':checked'));
|
$("#attr_auto_reload_sec").prop('disabled', !$('#attr_auto_reload').is(':checked'));
|
||||||
|
|
||||||
$('#attr_auto_reload').on('change', function(ev) {
|
$('#attr_auto_reload').change( function(ev) {
|
||||||
$("#attr_auto_reload_sec").prop('disabled', !$(this).is(':checked'));
|
$("#attr_auto_reload_sec").prop('disabled', !$(this).is(':checked'));
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@@ -515,7 +513,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param bool $bCanEdit
|
* @param bool $bCanEdit
|
||||||
@@ -524,7 +522,9 @@ EOF
|
|||||||
*/
|
*/
|
||||||
public function Render($oPage, $bEditMode = false, $aExtraParams = array(), $bCanEdit = true)
|
public function Render($oPage, $bEditMode = false, $aExtraParams = array(), $bCanEdit = true)
|
||||||
{
|
{
|
||||||
$aExtraParams['dashboard_div_id'] = utils::Sanitize($aExtraParams['dashboard_div_id'] ?? null, $this->GetId(), utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER);
|
if (!array_key_exists('dashboard_div_id', $aExtraParams)) {
|
||||||
|
$aExtraParams['dashboard_div_id'] = utils::Sanitize($this->GetId(), '', 'element_identifier');
|
||||||
|
}
|
||||||
|
|
||||||
/** @var \DashboardLayoutMultiCol $oLayout */
|
/** @var \DashboardLayoutMultiCol $oLayout */
|
||||||
$oLayout = new $this->sLayoutClass();
|
$oLayout = new $this->sLayoutClass();
|
||||||
@@ -561,15 +561,15 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$bEditMode) {
|
if (!$bEditMode) {
|
||||||
$oPage->LinkScriptFromAppRoot('js/dashlet.js');
|
$oPage->add_linked_script('../js/dashlet.js');
|
||||||
$oPage->LinkScriptFromAppRoot('js/dashboard.js');
|
$oPage->add_linked_script('../js/dashboard.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $oDashboard;
|
return $oDashboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
*
|
*
|
||||||
* @throws \ReflectionException
|
* @throws \ReflectionException
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -592,7 +592,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*/
|
*/
|
||||||
public function RenderDashletsProperties(WebPage $oPage, $aExtraParams = array())
|
public function RenderDashletsProperties(WebPage $oPage, $aExtraParams = array())
|
||||||
@@ -918,11 +918,6 @@ class RuntimeDashboard extends Dashboard
|
|||||||
{
|
{
|
||||||
$bCustomized = false;
|
$bCustomized = false;
|
||||||
|
|
||||||
$sDashboardFileSanitized = utils::RealPath(APPROOT.$sDashboardFile, APPROOT);
|
|
||||||
if (false === $sDashboardFileSanitized) {
|
|
||||||
throw new SecurityException('Invalid dashboard file !');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Search for an eventual user defined dashboard
|
// Search for an eventual user defined dashboard
|
||||||
$oUDSearch = new DBObjectSearch('UserDashboard');
|
$oUDSearch = new DBObjectSearch('UserDashboard');
|
||||||
$oUDSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
|
$oUDSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
|
||||||
@@ -934,7 +929,7 @@ class RuntimeDashboard extends Dashboard
|
|||||||
$sDashboardDefinition = $oUserDashboard->Get('contents');
|
$sDashboardDefinition = $oUserDashboard->Get('contents');
|
||||||
$bCustomized = true;
|
$bCustomized = true;
|
||||||
} else {
|
} else {
|
||||||
$sDashboardDefinition = @file_get_contents($sDashboardFileSanitized);
|
$sDashboardDefinition = @file_get_contents($sDashboardFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -942,7 +937,7 @@ class RuntimeDashboard extends Dashboard
|
|||||||
$oDashboard = new RuntimeDashboard($sDashBoardId);
|
$oDashboard = new RuntimeDashboard($sDashBoardId);
|
||||||
$oDashboard->FromXml($sDashboardDefinition);
|
$oDashboard->FromXml($sDashboardDefinition);
|
||||||
$oDashboard->SetCustomFlag($bCustomized);
|
$oDashboard->SetCustomFlag($bCustomized);
|
||||||
$oDashboard->SetDefinitionFile($sDashboardFileSanitized);
|
$oDashboard->SetDefinitionFile($sDashboardFile);
|
||||||
} else {
|
} else {
|
||||||
$oDashboard = null;
|
$oDashboard = null;
|
||||||
}
|
}
|
||||||
@@ -1050,7 +1045,7 @@ EOF
|
|||||||
$sSelectorHtml .= '</div>';
|
$sSelectorHtml .= '</div>';
|
||||||
|
|
||||||
$sFile = addslashes($this->GetDefinitionFile());
|
$sFile = addslashes($this->GetDefinitionFile());
|
||||||
$sReloadURL = json_encode($this->GetReloadURL());
|
$sReloadURL = $this->GetReloadURL();
|
||||||
|
|
||||||
$bFromDashboardPage = isset($aAjaxParams['from_dashboard_page']) ? isset($aAjaxParams['from_dashboard_page']) : false;
|
$bFromDashboardPage = isset($aAjaxParams['from_dashboard_page']) ? isset($aAjaxParams['from_dashboard_page']) : false;
|
||||||
if ($bFromDashboardPage) {
|
if ($bFromDashboardPage) {
|
||||||
@@ -1109,15 +1104,15 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
protected function RenderEditionTools(WebPage $oPage, DashboardLayoutUIBlock $oDashboard, $aExtraParams)
|
protected function RenderEditionTools(WebPage $oPage, DashboardLayoutUIBlock $oDashboard, $aExtraParams)
|
||||||
{
|
{
|
||||||
$oPage->LinkScriptFromAppRoot('node_modules/blueimp-file-upload/js/jquery.iframe-transport.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.iframe-transport.js');
|
||||||
$oPage->LinkScriptFromAppRoot('node_modules/blueimp-file-upload/js/jquery.fileupload.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.fileupload.js');
|
||||||
$sId = utils::Sanitize($this->GetId(), '', 'element_identifier');
|
$sId = utils::Sanitize($this->GetId(), '', 'element_identifier');
|
||||||
|
|
||||||
$sMenuTogglerId = "ibo-dashboard-menu-toggler-{$sId}";
|
$sMenuTogglerId = "ibo-dashboard-menu-toggler-{$sId}";
|
||||||
@@ -1139,8 +1134,9 @@ JS
|
|||||||
->AddCSSClass('ibo-action-button');
|
->AddCSSClass('ibo-action-button');
|
||||||
|
|
||||||
$oToolbar->AddSubBlock($oActionButton);
|
$oToolbar->AddSubBlock($oActionButton);
|
||||||
|
|
||||||
$aActions = array();
|
$aActions = array();
|
||||||
$sFile = addslashes(utils::LocalPath($this->sDefinitionFile));
|
$sFile = addslashes($this->sDefinitionFile);
|
||||||
$sJSExtraParams = json_encode($aExtraParams);
|
$sJSExtraParams = json_encode($aExtraParams);
|
||||||
if ($this->HasCustomDashboard()) {
|
if ($this->HasCustomDashboard()) {
|
||||||
$oEdit = new JSPopupMenuItem('UI:Dashboard:Edit', Dict::S('UI:Dashboard:EditCustom'), "return EditDashboard('{$this->sId}', '$sFile', $sJSExtraParams)");
|
$oEdit = new JSPopupMenuItem('UI:Dashboard:Edit', Dict::S('UI:Dashboard:EditCustom'), "return EditDashboard('{$this->sId}', '$sFile', $sJSExtraParams)");
|
||||||
@@ -1163,7 +1159,7 @@ JS
|
|||||||
$oToolbar->AddSubBlock($oActionButton)
|
$oToolbar->AddSubBlock($oActionButton)
|
||||||
->AddSubBlock($oActionsMenu);
|
->AddSubBlock($oActionsMenu);
|
||||||
|
|
||||||
$sReloadURL = json_encode($this->GetReloadURL());
|
$sReloadURL = $this->GetReloadURL();
|
||||||
$oPage->add_script(
|
$oPage->add_script(
|
||||||
<<<EOF
|
<<<EOF
|
||||||
function EditDashboard(sId, sDashboardFile, aExtraParams)
|
function EditDashboard(sId, sDashboardFile, aExtraParams)
|
||||||
@@ -1227,7 +1223,7 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
*
|
*
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -1263,14 +1259,14 @@ EOF
|
|||||||
$sOkButtonLabel = Dict::S('UI:Button:Save');
|
$sOkButtonLabel = Dict::S('UI:Button:Save');
|
||||||
$sCancelButtonLabel = Dict::S('UI:Button:Cancel');
|
$sCancelButtonLabel = Dict::S('UI:Button:Cancel');
|
||||||
|
|
||||||
$sId = json_encode($this->sId);
|
$sId = addslashes($this->sId);
|
||||||
$sLayoutClass = json_encode($this->sLayoutClass);
|
$sLayoutClass = addslashes($this->sLayoutClass);
|
||||||
$sAutoReload = $this->bAutoReload ? 'true' : 'false';
|
$sAutoReload = $this->bAutoReload ? 'true' : 'false';
|
||||||
$sAutoReloadSec = (string) $this->iAutoReloadSec;
|
$sAutoReloadSec = (string) $this->iAutoReloadSec;
|
||||||
$sTitle = json_encode($this->sTitle);
|
$sTitle = addslashes($this->sTitle);
|
||||||
$sFile = json_encode($this->GetDefinitionFile());
|
$sFile = addslashes($this->GetDefinitionFile());
|
||||||
$sUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php';
|
$sUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php';
|
||||||
$sReloadURL = json_encode($this->GetReloadURL());
|
$sReloadURL = $this->GetReloadURL();
|
||||||
|
|
||||||
$sExitConfirmationMessage = addslashes(Dict::S('UI:NavigateAwayConfirmationMessage'));
|
$sExitConfirmationMessage = addslashes(Dict::S('UI:NavigateAwayConfirmationMessage'));
|
||||||
$sCancelConfirmationMessage = addslashes(Dict::S('UI:CancelConfirmationMessage'));
|
$sCancelConfirmationMessage = addslashes(Dict::S('UI:CancelConfirmationMessage'));
|
||||||
@@ -1324,15 +1320,15 @@ $('#dashboard_editor').dialog({
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#dashboard_editor .ui-layout-center').runtimedashboard({
|
$('#dashboard_editor .ui-layout-center').runtimedashboard({
|
||||||
dashboard_id: $sId,
|
dashboard_id: '$sId',
|
||||||
layout_class: $sLayoutClass,
|
layout_class: '$sLayoutClass',
|
||||||
title: $sTitle,
|
title: '$sTitle',
|
||||||
auto_reload: $sAutoReload,
|
auto_reload: $sAutoReload,
|
||||||
auto_reload_sec: $sAutoReloadSec,
|
auto_reload_sec: $sAutoReloadSec,
|
||||||
submit_to: '$sUrl',
|
submit_to: '$sUrl',
|
||||||
submit_parameters: {operation: 'save_dashboard', file: $sFile, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'},
|
submit_parameters: {operation: 'save_dashboard', file: '$sFile', extra_params: $sJSExtraParams, reload_url: '$sReloadURL'},
|
||||||
render_to: '$sUrl',
|
render_to: '$sUrl',
|
||||||
render_parameters: {operation: 'render_dashboard', file: $sFile, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'},
|
render_parameters: {operation: 'render_dashboard', file: '$sFile', extra_params: $sJSExtraParams, reload_url: '$sReloadURL'},
|
||||||
new_dashlet_parameters: {operation: 'new_dashlet'}
|
new_dashlet_parameters: {operation: 'new_dashlet'}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1487,7 +1483,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $sOQL
|
* @param $sOQL
|
||||||
*
|
*
|
||||||
* @throws \DictExceptionMissingString
|
* @throws \DictExceptionMissingString
|
||||||
@@ -1553,29 +1549,6 @@ JS
|
|||||||
return $this->sDefinitionFile;
|
return $this->sDefinitionFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sDashboardFileRelative can also be an absolute path (compatibility with old URL)
|
|
||||||
*
|
|
||||||
* @return string full path to the Dashboard file
|
|
||||||
* @throws \SecurityException if path isn't under approot
|
|
||||||
* @uses utils::RealPath()
|
|
||||||
* @since 2.7.8 3.0.3 3.1.0 N°4449 remove FPD
|
|
||||||
*/
|
|
||||||
public static function GetDashboardFileFromRelativePath($sDashboardFileRelative)
|
|
||||||
{
|
|
||||||
if (utils::RealPath($sDashboardFileRelative, APPROOT)) {
|
|
||||||
// compatibility with old URL containing absolute path !
|
|
||||||
return $sDashboardFileRelative;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sDashboardFile = APPROOT.$sDashboardFileRelative;
|
|
||||||
if (false === utils::RealPath($sDashboardFile, APPROOT)) {
|
|
||||||
throw new SecurityException('Invalid dashboard file !');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $sDashboardFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sDefinitionFile
|
* @param string $sDefinitionFile
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2021 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -19,12 +19,11 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
|||||||
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardColumn;
|
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardColumn;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
|
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardRow;
|
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardRow;
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dashboard presentation
|
* Dashboard presentation
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
abstract class DashboardLayout
|
abstract class DashboardLayout
|
||||||
@@ -107,7 +106,7 @@ abstract class DashboardLayoutMultiCol extends DashboardLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $aCells
|
* @param $aCells
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2012-2024 Combodo SAS
|
// Copyright (C) 2012-2021 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -23,14 +23,13 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
require_once(APPROOT.'application/forms.class.inc.php');
|
require_once(APPROOT.'application/forms.class.inc.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for all 'dashlets' (i.e. widgets to be inserted into a dashboard)
|
* Base class for all 'dashlets' (i.e. widgets to be inserted into a dashboard)
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
abstract class Dashlet
|
abstract class Dashlet
|
||||||
@@ -223,7 +222,7 @@ abstract class Dashlet
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param bool $bEnclosingDiv
|
* @param bool $bEnclosingDiv
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
@@ -299,7 +298,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -310,7 +309,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Rendering without the real data
|
* Rendering without the real data
|
||||||
*
|
*
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param bool $bEditMode
|
* @param bool $bEditMode
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -668,7 +667,7 @@ class DashletUnknown extends Dashlet
|
|||||||
*/
|
*/
|
||||||
public function GetPropertiesFields(DesignerForm $oForm)
|
public function GetPropertiesFields(DesignerForm $oForm)
|
||||||
{
|
{
|
||||||
$oField = new DesignerXMLField('xml', Dict::S('UI:DashletUnknown:Prop-XMLConfiguration'), $this->sOriginalDashletXML);
|
$oField = new DesignerLongTextField('xml', Dict::S('UI:DashletUnknown:Prop-XMLConfiguration'), $this->sOriginalDashletXML);
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -870,7 +869,7 @@ class DashletPlainText extends Dashlet
|
|||||||
public function Render($oPage, $bEditMode = false, $aExtraParams = array())
|
public function Render($oPage, $bEditMode = false, $aExtraParams = array())
|
||||||
{
|
{
|
||||||
$sText = $this->aProperties['text'];
|
$sText = $this->aProperties['text'];
|
||||||
$sText = utils::EscapeHtml(Dict::S($sText));
|
$sText = utils::EscapeHtml($sText);
|
||||||
$sText = str_replace(array("\r\n", "\n", "\r"), "<br/>", $sText);
|
$sText = str_replace(array("\r\n", "\n", "\r"), "<br/>", $sText);
|
||||||
|
|
||||||
$sId = 'plaintext_'.($bEditMode ? 'edit_' : '').$this->sId;
|
$sId = 'plaintext_'.($bEditMode ? 'edit_' : '').$this->sId;
|
||||||
@@ -2138,7 +2137,7 @@ class DashletHeaderDynamic extends Dashlet
|
|||||||
$oSet = new DBObjectSet($oFilter);
|
$oSet = new DBObjectSet($oFilter);
|
||||||
$iCount = $oSet->Count();
|
$iCount = $oSet->Count();
|
||||||
$oAppContext = new ApplicationContext();
|
$oAppContext = new ApplicationContext();
|
||||||
$sHyperlink = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=search'.$oAppContext->GetForLink(true).'&filter='.rawurlencode($oFilter->serialize());
|
$sHyperlink = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=search&'.$oAppContext->GetForLink().'&filter='.rawurlencode($oFilter->serialize());
|
||||||
$oSubTitle->AddHtml('<a class="summary" href="'.$sHyperlink.'">'.Dict::Format(str_replace('_', ':', $sSubtitle), $iCount).'</a>');
|
$oSubTitle->AddHtml('<a class="summary" href="'.$sHyperlink.'">'.Dict::Format(str_replace('_', ':', $sSubtitle), $iCount).'</a>');
|
||||||
|
|
||||||
return $oPanel;
|
return $oPanel;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.2">
|
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.1">
|
||||||
<classes>
|
<classes>
|
||||||
<class id="AbstractResource" _delta="define">
|
<class id="AbstractResource" _delta="define">
|
||||||
<parent>cmdbAbstractObject</parent>
|
<parent>cmdbAbstractObject</parent>
|
||||||
@@ -40,36 +40,6 @@
|
|||||||
<presentation/>
|
<presentation/>
|
||||||
<methods/>
|
<methods/>
|
||||||
</class>
|
</class>
|
||||||
<class id="WelcomePopupAcknowledge" _delta="define">
|
|
||||||
<parent>DBObject</parent>
|
|
||||||
<properties>
|
|
||||||
<comment>/** Acknowledge welcome popup messages */</comment>
|
|
||||||
<abstract>false</abstract>
|
|
||||||
<category></category>
|
|
||||||
<key_type>autoincrement</key_type>
|
|
||||||
<db_table>priv_welcome_popup_acknowledge</db_table>
|
|
||||||
</properties>
|
|
||||||
<fields>
|
|
||||||
<field id="message_uuid" xsi:type="AttributeString">
|
|
||||||
<sql>message_uuid</sql>
|
|
||||||
<default_value/>
|
|
||||||
<is_null_allowed>false</is_null_allowed>
|
|
||||||
</field>
|
|
||||||
<field id="user_id" xsi:type="AttributeExternalKey">
|
|
||||||
<sql>user_id</sql>
|
|
||||||
<target_class>User</target_class>
|
|
||||||
<is_null_allowed>false</is_null_allowed>
|
|
||||||
<on_target_delete>DEL_SILENT</on_target_delete>
|
|
||||||
</field>
|
|
||||||
<field id="acknowledge_date" xsi:type="AttributeDateTime">
|
|
||||||
<sql>acknowledge_date</sql>
|
|
||||||
<default_value/>
|
|
||||||
<is_null_allowed>false</is_null_allowed>
|
|
||||||
</field>
|
|
||||||
</fields>
|
|
||||||
<presentation/>
|
|
||||||
<methods/>
|
|
||||||
</class>
|
|
||||||
</classes>
|
</classes>
|
||||||
<portals>
|
<portals>
|
||||||
<portal id="backoffice" _delta="define">
|
<portal id="backoffice" _delta="define">
|
||||||
@@ -85,9 +55,9 @@
|
|||||||
<menus>
|
<menus>
|
||||||
<menu id="WelcomeMenu" xsi:type="MenuGroup" _delta="define">
|
<menu id="WelcomeMenu" xsi:type="MenuGroup" _delta="define">
|
||||||
<rank>10</rank>
|
<rank>10</rank>
|
||||||
<style>
|
<style>
|
||||||
<decoration_classes>fas fa-home</decoration_classes>
|
<decoration_classes>fas fa-home</decoration_classes>
|
||||||
</style>
|
</style>
|
||||||
</menu>
|
</menu>
|
||||||
<menu id="WelcomeMenuPage" xsi:type="DashboardMenuNode" _delta="define">
|
<menu id="WelcomeMenuPage" xsi:type="DashboardMenuNode" _delta="define">
|
||||||
<rank>10</rank>
|
<rank>10</rank>
|
||||||
@@ -181,14 +151,9 @@
|
|||||||
</menu>
|
</menu>
|
||||||
<menu id="ConfigurationTools" xsi:type="MenuGroup" _delta="define_if_not_exists">
|
<menu id="ConfigurationTools" xsi:type="MenuGroup" _delta="define_if_not_exists">
|
||||||
<rank>90</rank>
|
<rank>90</rank>
|
||||||
<style>
|
<style>
|
||||||
<decoration_classes>fas fa-cog</decoration_classes>
|
<decoration_classes>fas fa-cog</decoration_classes>
|
||||||
</style>
|
</style>
|
||||||
</menu>
|
|
||||||
<menu id="Integrations" xsi:type="TemplateMenuNode" _delta="define">
|
|
||||||
<rank>50</rank>
|
|
||||||
<parent>ConfigurationTools</parent>
|
|
||||||
<template_file/>
|
|
||||||
</menu>
|
</menu>
|
||||||
<menu id="DataSources" xsi:type="OQLMenuNode" _delta="define">
|
<menu id="DataSources" xsi:type="OQLMenuNode" _delta="define">
|
||||||
<rank>20</rank>
|
<rank>20</rank>
|
||||||
@@ -207,24 +172,22 @@
|
|||||||
</menu>
|
</menu>
|
||||||
<menu id="AdminTools" xsi:type="MenuGroup" _delta="define">
|
<menu id="AdminTools" xsi:type="MenuGroup" _delta="define">
|
||||||
<rank>80</rank>
|
<rank>80</rank>
|
||||||
<style>
|
<style>
|
||||||
<decoration_classes>fas fa-tools</decoration_classes>
|
<decoration_classes>fas fa-tools</decoration_classes>
|
||||||
</style>
|
</style>
|
||||||
</menu>
|
</menu>
|
||||||
<menu id="SystemTools" xsi:type="MenuGroup" _delta="define">
|
<menu id="SystemTools" xsi:type="MenuGroup" _delta="define">
|
||||||
<rank>100</rank>
|
<rank>100</rank>
|
||||||
<enable_class>ResourceSystemMenu</enable_class>
|
<enable_class>ResourceSystemMenu</enable_class>
|
||||||
<enable_action>UR_ACTION_MODIFY</enable_action>
|
<enable_action>UR_ACTION_MODIFY</enable_action>
|
||||||
<style>
|
<style>
|
||||||
<decoration_classes>fas fa-terminal</decoration_classes>
|
<decoration_classes>fas fa-terminal</decoration_classes>
|
||||||
</style>
|
</style>
|
||||||
</menu>
|
</menu>
|
||||||
</menus>
|
</menus>
|
||||||
<events>
|
<events>
|
||||||
<event id="EVENT_DB_BEFORE_WRITE" _delta="define">
|
<event id="EVENT_SERVICE_DB_INSERT_REQUESTED" _delta="define">
|
||||||
<name>Before create or update</name>
|
<description>An object insert in the database has been requested. All changes to the object will be persisted automatically.</description>
|
||||||
<description><![CDATA[An object is about to be written into the database.
|
|
||||||
The object can be modified.]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -234,53 +197,31 @@ The object can be modified.]]></description>
|
|||||||
<description>The object inserted</description>
|
<description>The object inserted</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="is_new">
|
|
||||||
<description>Creation flag</description>
|
|
||||||
<type>boolean</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="stimulus_applied">
|
|
||||||
<description>Life cycle stimulus applied (null if not within a transition)</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_CHECK_TO_WRITE" _delta="define">
|
<event id="EVENT_SERVICE_DB_ABOUT_TO_INSERT" _delta="define">
|
||||||
<name>Check to write</name>
|
<description>An object is about to be inserted in the database (no change possible)</description>
|
||||||
<description><![CDATA[Check an object before it is written into the database (no change possible).
|
|
||||||
Call $this->AddCheckIssue($sErrorMessage) to report a blocking issue.
|
|
||||||
Call $this->AddCheckWarning($sWarningMessage) to display a warning.
|
|
||||||
]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
<replaces>cmdbAbstractObject::DoCheckToWrite</replaces>
|
<replaces>DBObject::OnInsert</replaces>
|
||||||
<event_data>
|
<event_data>
|
||||||
<event_datum id="object">
|
<event_datum id="object">
|
||||||
<description>The object to check</description>
|
<description>The object inserted</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="is_new">
|
|
||||||
<description>Creation flag</description>
|
|
||||||
<type>boolean</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="stimulus_applied">
|
|
||||||
<description>Life cycle stimulus applied (null if not within a transition)</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_AFTER_WRITE" _delta="define">
|
<event id="EVENT_SERVICE_DB_INSERT_DONE" _delta="define">
|
||||||
<name>After create or update</name>
|
<description>An object has been inserted into the database (but not reloaded). All changes to the object will be persisted automatically.</description>
|
||||||
<description><![CDATA[An object has been written into the database.
|
|
||||||
The modifications can be propagated to other objects.]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -290,35 +231,21 @@ The modifications can be propagated to other objects.]]></description>
|
|||||||
<description>The object inserted</description>
|
<description>The object inserted</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="is_new">
|
|
||||||
<description>Creation flag</description>
|
|
||||||
<type>boolean</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="changes">
|
|
||||||
<description><![CDATA[For updates, the list of changes done during this operation]]></description>
|
|
||||||
<type>array</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="stimulus_applied">
|
|
||||||
<description>Life cycle stimulus applied (null if not within a transition)</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_CHECK_TO_DELETE" _delta="define">
|
<event id="EVENT_SERVICE_DB_UPDATE_REQUESTED" _delta="define">
|
||||||
<name>Check to delete</name>
|
<description>An object update has been requested. All changes to the object will be persisted automatically.</description>
|
||||||
<description><![CDATA[Check an object before it is deleted from the database.
|
|
||||||
Call $this->AddDeleteIssue($sIssueMessage) to signal an issue.]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
<replaces>cmdbAbstractObject::DoCheckToDelete</replaces>
|
<replaces>DBObject::OnUpdate, DBObject::DoComputeValues</replaces>
|
||||||
<event_data>
|
<event_data>
|
||||||
<event_datum id="object">
|
<event_datum id="object">
|
||||||
<description>The object to check</description>
|
<description>The object updated</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
@@ -327,16 +254,15 @@ Call $this->AddDeleteIssue($sIssueMessage) to signal an issue.]]></description>
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_ABOUT_TO_DELETE" _delta="define">
|
<event id="EVENT_SERVICE_DB_ABOUT_TO_UPDATE" _delta="define">
|
||||||
<name>Before delete</name>
|
<description>An object is about to be updated in the database (no change possible)</description>
|
||||||
<description><![CDATA[An object is about to be deleted from the database]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
<replaces>cmdbAbstractObject::OnDelete</replaces>
|
<replaces>DBObject::OnUpdate</replaces>
|
||||||
<event_data>
|
<event_data>
|
||||||
<event_datum id="object">
|
<event_datum id="object">
|
||||||
<description>The object about to be deleted</description>
|
<description>The object updated</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
@@ -345,9 +271,42 @@ Call $this->AddDeleteIssue($sIssueMessage) to signal an issue.]]></description>
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_AFTER_DELETE" _delta="define">
|
<event id="EVENT_SERVICE_DB_UPDATE_DONE" _delta="define">
|
||||||
<name>After delete</name>
|
<description>An object has been updated into the database and reloaded. All changes to the object will be persisted automatically.</description>
|
||||||
<description><![CDATA[An object has been deleted into the database]]></description>
|
<sources>
|
||||||
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
|
</sources>
|
||||||
|
<replaces>DBObject::AfterUpdate</replaces>
|
||||||
|
<event_data>
|
||||||
|
<event_datum id="object">
|
||||||
|
<description>The object updated</description>
|
||||||
|
<type>DBObject</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="debug_info">
|
||||||
|
<description>Debug string</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
</event_data>
|
||||||
|
</event>
|
||||||
|
<event id="EVENT_SERVICE_DB_ABOUT_TO_DELETE" _delta="define">
|
||||||
|
<description>An object is about to be deleted in the database</description>
|
||||||
|
<sources>
|
||||||
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
|
</sources>
|
||||||
|
<replaces>DBObject::OnDelete</replaces>
|
||||||
|
<event_data>
|
||||||
|
<event_datum id="object">
|
||||||
|
<description>The object deleted</description>
|
||||||
|
<type>DBObject</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="debug_info">
|
||||||
|
<description>Debug string</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
</event_data>
|
||||||
|
</event>
|
||||||
|
<event id="EVENT_SERVICE_DB_DELETE_DONE" _delta="define">
|
||||||
|
<description>An object has been deleted into the database</description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -363,10 +322,8 @@ Call $this->AddDeleteIssue($sIssueMessage) to signal an issue.]]></description>
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_ENUM_TRANSITIONS" _delta="define">
|
<event id="EVENT_SERVICE_DB_BEFORE_APPLY_STIMULUS" _delta="define">
|
||||||
<name>Enum transitions</name>
|
<description>A stimulus is about to be applied to an object</description>
|
||||||
<description><![CDATA[Manage the allowed transitions in current object state.
|
|
||||||
The only action allowed is to deny transitions with $this->DenyTransition($sTransitionCode)]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -375,9 +332,21 @@ The only action allowed is to deny transitions with $this->DenyTransition($sTran
|
|||||||
<description>The object where the stimulus is targeted</description>
|
<description>The object where the stimulus is targeted</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="allowed_stimuli">
|
<event_datum id="stimulus">
|
||||||
<description>The list of available stimuli in the current state</description>
|
<description>Current stimulus applied</description>
|
||||||
<type>array</type>
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="previous_state">
|
||||||
|
<description>Object previous state</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="new_state">
|
||||||
|
<description>Object new state</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="save_object">
|
||||||
|
<description>The object must be saved in the database</description>
|
||||||
|
<type>boolean</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
@@ -385,27 +354,76 @@ The only action allowed is to deny transitions with $this->DenyTransition($sTran
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_LINKS_CHANGED" _delta="define">
|
<event id="EVENT_SERVICE_DB_AFTER_APPLY_STIMULUS" _delta="define">
|
||||||
<name>Links on object have changed</name>
|
<description>A stimulus has been applied to an object</description>
|
||||||
<description><![CDATA[At least one link class was changed]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
<event_data>
|
<event_data>
|
||||||
<event_datum id="object">
|
<event_datum id="object">
|
||||||
<description>The object where the link is or was pointing to</description>
|
<description>The object where the stimulus is targeted</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
|
<event_datum id="stimulus">
|
||||||
|
<description>Current stimulus applied</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="previous_state">
|
||||||
|
<description>Object previous state</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="new_state">
|
||||||
|
<description>Object new state</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="save_object">
|
||||||
|
<description>The object is asked to be saved in the database</description>
|
||||||
|
<type>boolean</type>
|
||||||
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_OBJECT_RELOAD" _delta="define">
|
<event id="EVENT_SERVICE_DB_APPLY_STIMULUS_FAILED" _delta="define">
|
||||||
<name>Object reload</name>
|
<description>A stimulus has failed</description>
|
||||||
<internal>true</internal>
|
<sources>
|
||||||
<description><![CDATA[An object has been re-loaded from the database]]></description>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
|
</sources>
|
||||||
|
<event_data>
|
||||||
|
<event_datum id="action">
|
||||||
|
<description>The action that failed to apply the stimulus</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="object">
|
||||||
|
<description>The object where the stimulus is targeted</description>
|
||||||
|
<type>DBObject</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="stimulus">
|
||||||
|
<description>Current stimulus applied</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="previous_state">
|
||||||
|
<description>Object previous state</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="new_state">
|
||||||
|
<description>Object new state</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="save_object">
|
||||||
|
<description>The object must be saved in the database</description>
|
||||||
|
<type>boolean</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="debug_info">
|
||||||
|
<description>Debug string</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
</event_data>
|
||||||
|
</event>
|
||||||
|
<event id="EVENT_SERVICE_DB_OBJECT_RELOAD" _delta="define">
|
||||||
|
<description>An object has been re-loaded from the database</description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -420,9 +438,8 @@ The only action allowed is to deny transitions with $this->DenyTransition($sTran
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_COMPUTE_VALUES" _delta="define">
|
<event id="EVENT_SERVICE_DB_COMPUTE_VALUES" _delta="define">
|
||||||
<name>Recompute object values</name>
|
<description>An object needs to be recomputed after changes</description>
|
||||||
<description><![CDATA[An object needs to be recomputed after changes]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -432,23 +449,56 @@ The only action allowed is to deny transitions with $this->DenyTransition($sTran
|
|||||||
<description>The object inserted</description>
|
<description>The object inserted</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="is_new">
|
<event_datum id="debug_info">
|
||||||
<description>Creation flag</description>
|
<description>Debug string</description>
|
||||||
<type>boolean</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="stimulus_applied">
|
|
||||||
<description>Life cycle stimulus applied (null if not within a transition)</description>
|
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
|
</event_data>
|
||||||
|
</event>
|
||||||
|
<event id="EVENT_SERVICE_DB_CHECK_TO_WRITE" _delta="define">
|
||||||
|
<description>Check an object before it is written into the database (no change possible)</description>
|
||||||
|
<sources>
|
||||||
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
|
</sources>
|
||||||
|
<replaces>cmdbAbstractObject::DoCheckToWrite</replaces>
|
||||||
|
<event_data>
|
||||||
|
<event_datum id="object">
|
||||||
|
<description>The object to check</description>
|
||||||
|
<type>DBObject</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="error_messages">
|
||||||
|
<description>Array of strings where all the errors found during the object checking are added</description>
|
||||||
|
<type>array</type>
|
||||||
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_ARCHIVE" _delta="define">
|
<event id="EVENT_SERVICE_DB_CHECK_TO_DELETE" _delta="define">
|
||||||
<name>Object archived</name>
|
<description>Check an object before it is deleted from the database (no change possible)</description>
|
||||||
<description><![CDATA[An object has been archived]]></description>
|
<sources>
|
||||||
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
|
</sources>
|
||||||
|
<replaces>cmdbAbstractObject::DoCheckToDelete</replaces>
|
||||||
|
<event_data>
|
||||||
|
<event_datum id="object">
|
||||||
|
<description>The object to check</description>
|
||||||
|
<type>DBObject</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="error_messages">
|
||||||
|
<description>Array of strings where all the errors found during the object checking are added</description>
|
||||||
|
<type>array</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="debug_info">
|
||||||
|
<description>Debug string</description>
|
||||||
|
<type>string</type>
|
||||||
|
</event_datum>
|
||||||
|
</event_data>
|
||||||
|
</event>
|
||||||
|
<event id="EVENT_SERVICE_DB_ARCHIVE" _delta="define">
|
||||||
|
<description>An object has been archived</description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -463,9 +513,8 @@ The only action allowed is to deny transitions with $this->DenyTransition($sTran
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_UNARCHIVE" _delta="define">
|
<event id="EVENT_SERVICE_DB_UNARCHIVE" _delta="define">
|
||||||
<name>Object unarchived</name>
|
<description>An object has been unarchived</description>
|
||||||
<description><![CDATA[An object has been unarchived]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -480,49 +529,8 @@ The only action allowed is to deny transitions with $this->DenyTransition($sTran
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_DB_SET_ATTRIBUTES_FLAGS" _delta="define">
|
<event id="EVENT_SERVICE_DOWNLOAD_DOCUMENT" _delta="define">
|
||||||
<name>Set attributes flags</name>
|
<description>A document has been downloaded from the GUI</description>
|
||||||
<description><![CDATA[Set object attributes flags.
|
|
||||||
Call $this->AddAttributeFlags($sAttCode, $iFlags) for all the attributes to be set for this target state.]]></description>
|
|
||||||
<sources>
|
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
|
||||||
</sources>
|
|
||||||
<event_data>
|
|
||||||
<event_datum id="object">
|
|
||||||
<description>The current object</description>
|
|
||||||
<type>DBObject</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="target_state">
|
|
||||||
<description>The target state in which to evaluate the flags</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="debug_info">
|
|
||||||
<description>Debug string</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
</event_data>
|
|
||||||
</event>
|
|
||||||
<event id="EVENT_DB_SET_INITIAL_ATTRIBUTES_FLAGS" _delta="define">
|
|
||||||
<name>Set initial attributes flags</name>
|
|
||||||
<description><![CDATA[Set object initial attributes flags.
|
|
||||||
Call $this->AddInitialAttributeFlags($sAttCode, $iFlags) for all the initial attributes to be set initially.]]></description>
|
|
||||||
<sources>
|
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
|
||||||
</sources>
|
|
||||||
<event_data>
|
|
||||||
<event_datum id="object">
|
|
||||||
<description>The current object</description>
|
|
||||||
<type>DBObject</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="debug_info">
|
|
||||||
<description>Debug string</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
</event_data>
|
|
||||||
</event>
|
|
||||||
<event id="EVENT_DOWNLOAD_DOCUMENT" _delta="define">
|
|
||||||
<name>Document downloaded</name>
|
|
||||||
<description><![CDATA[A document has been downloaded from the GUI]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="Document">Document</source>
|
<source id="Document">Document</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -531,28 +539,18 @@ Call $this->AddInitialAttributeFlags($sAttCode, $iFlags) for all the initial att
|
|||||||
<description>The object containing the document</description>
|
<description>The object containing the document</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="att_code">
|
|
||||||
<description>The optional object attribute code hosting the document</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="document">
|
<event_datum id="document">
|
||||||
<description>The document downloaded</description>
|
<description>The document downloaded</description>
|
||||||
<type>ormDocument</type>
|
<type>ormDocument</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="content_disposition">
|
|
||||||
<description>The content disposition of the document ("inline" or "attachment")</description>
|
|
||||||
<type>string</type>
|
|
||||||
</event_datum>
|
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_LOGIN" _delta="define">
|
<event id="EVENT_SERVICE_LOGIN" _delta="define">
|
||||||
<name>Login</name>
|
<description>Inform the listeners about the connection states</description>
|
||||||
<internal>true</internal>
|
|
||||||
<description><![CDATA[Inform the listeners about the connection states]]></description>
|
|
||||||
<event_data>
|
<event_data>
|
||||||
<event_datum id="code">
|
<event_datum id="code">
|
||||||
<description>The login step result code (LoginWebPage::EXIT_CODE_...) </description>
|
<description>The login step result code (LoginWebPage::EXIT_CODE_...) </description>
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2021 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -63,8 +61,8 @@ class DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param DataTableSettings $oSettings
|
* @param \DataTableSettings $oSettings
|
||||||
* @param $bActionsMenu
|
* @param $bActionsMenu
|
||||||
* @param $sSelectMode
|
* @param $sSelectMode
|
||||||
* @param $bViewLink
|
* @param $bViewLink
|
||||||
@@ -143,7 +141,7 @@ class DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
* @param $iPageIndex
|
* @param $iPageIndex
|
||||||
@@ -238,7 +236,7 @@ class DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $sSelectMode
|
* @param $sSelectMode
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -257,7 +255,7 @@ class DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
* @param $iPageIndex
|
* @param $iPageIndex
|
||||||
@@ -326,7 +324,6 @@ class DataTable
|
|||||||
$sPagesLinks = implode('', $aPagesToDisplay);
|
$sPagesLinks = implode('', $aPagesToDisplay);
|
||||||
$sPagesList = '['.implode(',', array_keys($aPagesToDisplay)).']';
|
$sPagesList = '['.implode(',', array_keys($aPagesToDisplay)).']';
|
||||||
|
|
||||||
$sAppRootUrl = utils::GetAbsoluteUrlAppRoot();
|
|
||||||
$sSelectionMode = ($iNbPages == 1) ? '' : 'positive';
|
$sSelectionMode = ($iNbPages == 1) ? '' : 'positive';
|
||||||
$sHtml =
|
$sHtml =
|
||||||
<<<EOF
|
<<<EOF
|
||||||
@@ -334,11 +331,11 @@ class DataTable
|
|||||||
<div $sPagerStyle>
|
<div $sPagerStyle>
|
||||||
<table id="pager{$this->iListId}" class="pager"><tr>
|
<table id="pager{$this->iListId}" class="pager"><tr>
|
||||||
<td>$sPages</td>
|
<td>$sPages</td>
|
||||||
<td><img src="{$sAppRootUrl}images/first.png" class="first"/>AAAA</td>
|
<td><img src="../images/first.png" class="first"/></td>
|
||||||
<td><img src="{$sAppRootUrl}images/prev.png" class="prev"/></td>
|
<td><img src="../images/prev.png" class="prev"/></td>
|
||||||
<td><span id="index">$sPagesLinks</span></td>
|
<td><span id="index">$sPagesLinks</span></td>
|
||||||
<td><img src="{$sAppRootUrl}images/next.png" class="next"/></td>
|
<td><img src="../images/next.png" class="next"/></td>
|
||||||
<td><img src="{$sAppRootUrl}images/last.png" class="last"/></td>
|
<td><img src="../images/last.png" class="last"/></td>
|
||||||
<td>$sPageSizeCombo</td>
|
<td>$sPageSizeCombo</td>
|
||||||
<td><span id="loading"> </span><input type="hidden" name="selectionMode" value="$sSelectionMode"></input>
|
<td><span id="loading"> </span><input type="hidden" name="selectionMode" value="$sSelectionMode"></input>
|
||||||
</td>
|
</td>
|
||||||
@@ -351,7 +348,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $aExtraParams
|
* @param $aExtraParams
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -378,7 +375,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $aExtraParams
|
* @param $aExtraParams
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -389,7 +386,7 @@ EOF;
|
|||||||
if (!$oPage->IsPrintableVersion())
|
if (!$oPage->IsPrintableVersion())
|
||||||
{
|
{
|
||||||
$sMenuTitle = Dict::S('UI:ConfigureThisList');
|
$sMenuTitle = Dict::S('UI:ConfigureThisList');
|
||||||
$sHtml = '<div class="itop_popup toolkit_menu" id="tk_'.$this->iListId.'"><ul><li aria-label="'.Dict::S('UI:Menu:Toolkit').'"><i class="fas fa-tools"></i><i class="fas fa-caret-down"></i><ul>';
|
$sHtml = '<div class="itop_popup toolkit_menu" id="tk_'.$this->iListId.'"><ul><li><i class="fas fa-tools"></i><i class="fas fa-caret-down"></i><ul>';
|
||||||
|
|
||||||
$oMenuItem1 = new JSPopupMenuItem('iTop::ConfigureList', $sMenuTitle, "$('#datatable_dlg_".$this->iListId."').dialog('open');");
|
$oMenuItem1 = new JSPopupMenuItem('iTop::ConfigureList', $sMenuTitle, "$('#datatable_dlg_".$this->iListId."').dialog('open');");
|
||||||
$aActions = array(
|
$aActions = array(
|
||||||
@@ -408,7 +405,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $aColumns
|
* @param $aColumns
|
||||||
* @param $bViewLink
|
* @param $bViewLink
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
@@ -566,7 +563,7 @@ EOF;
|
|||||||
{
|
{
|
||||||
if (is_object($aObjects[$sAlias]))
|
if (is_object($aObjects[$sAlias]))
|
||||||
{
|
{
|
||||||
$sHilightClass = MetaModel::GetHilightClass($sClassName, $aObjects[$sAlias]);
|
$sHilightClass = $aObjects[$sAlias]->GetHilightClass();
|
||||||
if ($sHilightClass != '')
|
if ($sHilightClass != '')
|
||||||
{
|
{
|
||||||
$aRow['@class'] = $sHilightClass;
|
$aRow['@class'] = $sHilightClass;
|
||||||
@@ -661,7 +658,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $aColumns
|
* @param $aColumns
|
||||||
* @param $sSelectMode
|
* @param $sSelectMode
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
@@ -793,7 +790,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
* @param $iStart
|
* @param $iStart
|
||||||
*/
|
*/
|
||||||
@@ -821,7 +818,7 @@ JS
|
|||||||
class PrintableDataTable extends DataTable
|
class PrintableDataTable extends DataTable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
* @param $iDefaultPageSize
|
* @param $iDefaultPageSize
|
||||||
* @param $iPageIndex
|
* @param $iPageIndex
|
||||||
@@ -847,7 +844,7 @@ class PrintableDataTable extends DataTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $aColumns
|
* @param $aColumns
|
||||||
* @param $sSelectMode
|
* @param $sSelectMode
|
||||||
* @param $iPageSize
|
* @param $iPageSize
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/ErrorPage.php, now loadable using autoloader
|
* @deprecated will be removed in 3.1.0 - moved to sources/Application/WebPage/ErrorPage.php, now loadable using autoloader
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/ErrorPage.php, now loadable using autoloader');
|
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/ErrorPage.php, now loadable using autoloader');
|
||||||
@@ -1,8 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Combodo\iTop\Application\WebPage\CLIPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\Page;
|
|
||||||
|
|
||||||
require_once('xlsxwriter.class.php');
|
require_once('xlsxwriter.class.php');
|
||||||
|
|
||||||
class ExcelExporter
|
class ExcelExporter
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -40,19 +40,15 @@ class CoreCannotSaveObjectException extends CoreException
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
* @since 3.2.3 add param $bWithHeader
|
|
||||||
*/
|
*/
|
||||||
public function getHtmlMessage($bWithHeader = false)
|
public function getHtmlMessage()
|
||||||
{
|
{
|
||||||
$sTitle = Dict::S('UI:Error:SaveFailed');
|
$sTitle = Dict::S('UI:Error:SaveFailed');
|
||||||
$sContent = "<span><strong>".utils::HtmlEntities($sTitle)."</strong></span>";
|
$sContent = "<span><strong>".utils::HtmlEntities($sTitle)."</strong></span>";
|
||||||
if ($bWithHeader) {
|
|
||||||
$oObject = MetaModel::GetObject($this->sObjectClass, $this->iObjectId, true, true);
|
|
||||||
$sContent .= " <span>".$oObject->Get('friendlyname')."</span>";
|
|
||||||
}
|
|
||||||
if (count($this->aIssues) == 1) {
|
if (count($this->aIssues) == 1) {
|
||||||
$sIssue = reset($this->aIssues);
|
$sIssue = reset($this->aIssues);
|
||||||
$sContent .= " <span>".utils::HtmlEntities($sIssue)."</span>";
|
$sContent .= " <span>".utils::HtmlEntities($sIssue)."</span>";
|
||||||
} else {
|
} else {
|
||||||
$sContent .= '<ul>';
|
$sContent .= '<ul>';
|
||||||
foreach ($this->aIssues as $sError) {
|
foreach ($this->aIssues as $sError) {
|
||||||
@@ -64,24 +60,6 @@ class CoreCannotSaveObjectException extends CoreException
|
|||||||
return $sContent;
|
return $sContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTextMessage()
|
|
||||||
{
|
|
||||||
$sTitle = Dict::S('UI:Error:SaveFailed');
|
|
||||||
$sContent = $sTitle;
|
|
||||||
|
|
||||||
if (count($this->aIssues) == 1) {
|
|
||||||
$sIssue = reset($this->aIssues);
|
|
||||||
$sContent .= $sIssue;
|
|
||||||
} else {
|
|
||||||
foreach ($this->aIssues as $sError) {
|
|
||||||
$sContent .= " " . $sError . ", ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $sContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function getIssues()
|
public function getIssues()
|
||||||
{
|
{
|
||||||
return $this->aIssues;
|
return $this->aIssues;
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CoreException extends Exception
|
class CoreException extends Exception
|
||||||
{
|
{
|
||||||
protected $m_sIssue;
|
|
||||||
protected $m_sImpact;
|
|
||||||
protected $m_aContextData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CoreException constructor.
|
* CoreException constructor.
|
||||||
*
|
*
|
||||||
@@ -67,7 +63,7 @@ class CoreException extends Exception
|
|||||||
|
|
||||||
public function getHtmlDesc($sHighlightHtmlBegin = '<b>', $sHighlightHtmlEnd = '</b>')
|
public function getHtmlDesc($sHighlightHtmlBegin = '<b>', $sHighlightHtmlEnd = '</b>')
|
||||||
{
|
{
|
||||||
return utils::EscapeHtml($this->getMessage());
|
return $this->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @since 2.7.10 3.0.4 3.1.1 3.2.0 N°6458 object creation
|
|
||||||
*/
|
|
||||||
class InvalidExternalKeyValueException extends CoreUnexpectedValue
|
|
||||||
{
|
|
||||||
private const ENUM_PARAMS_OBJECT = 'current_object';
|
|
||||||
private const ENUM_PARAMS_ATTCODE = 'attcode';
|
|
||||||
private const ENUM_PARAMS_ATTVALUE = 'attvalue';
|
|
||||||
private const ENUM_PARAMS_USER = 'current_user';
|
|
||||||
|
|
||||||
public function __construct($oObject, $sAttCode, $aContextData = null, $oPrevious = null)
|
|
||||||
{
|
|
||||||
$aContextData[self::ENUM_PARAMS_OBJECT] = get_class($oObject) . '::' . $oObject->GetKey();
|
|
||||||
$aContextData[self::ENUM_PARAMS_ATTCODE] = $sAttCode;
|
|
||||||
$aContextData[self::ENUM_PARAMS_ATTVALUE] = $oObject->Get($sAttCode);
|
|
||||||
|
|
||||||
$oCurrentUser = UserRights::GetUserObject();
|
|
||||||
if (false === is_null($oCurrentUser)) {
|
|
||||||
$aContextData[self::ENUM_PARAMS_USER] = get_class($oCurrentUser) . '::' . $oCurrentUser->GetKey();
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::__construct('Attribute pointing to an object that is either non existing or not readable by the current user', $aContextData, '', $oPrevious);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function GetAttCode(): string
|
|
||||||
{
|
|
||||||
return $this->getContextData()[self::ENUM_PARAMS_ATTCODE];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function GetAttValue(): string
|
|
||||||
{
|
|
||||||
return $this->getContextData()[self::ENUM_PARAMS_ATTVALUE];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user