mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Compare commits
44 Commits
support/3.
...
3.1.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46aaeb4301 | ||
|
|
affed69999 | ||
|
|
64a216e0f6 | ||
|
|
d5754fc568 | ||
|
|
ccb1ca9d79 | ||
|
|
44290db312 | ||
|
|
025af923ea | ||
|
|
858b12abaa | ||
|
|
a7bc4bd411 | ||
|
|
a07f66c061 | ||
|
|
c49ceae75e | ||
|
|
4da975cb64 | ||
|
|
8980f627e9 | ||
|
|
ec61b52238 | ||
|
|
072596a53b | ||
|
|
160bfd714b | ||
|
|
1c5cb1547f | ||
|
|
8d58372074 | ||
|
|
5780f26817 | ||
|
|
343f3286b8 | ||
|
|
37fc1a5723 | ||
|
|
1fa50f695d | ||
|
|
692cf4f635 | ||
|
|
95aa444ee6 | ||
|
|
f5de808c7c | ||
|
|
cbb4281a37 | ||
|
|
06dcae1dd1 | ||
|
|
e03033ce52 | ||
|
|
c70d62a51e | ||
|
|
0d5ff261fe | ||
|
|
374b35f78a | ||
|
|
9371bc6d7b | ||
|
|
58e964fb8c | ||
|
|
e8ecc85828 | ||
|
|
04bd8cc5ce | ||
|
|
88756a443a | ||
|
|
052e2a1a42 | ||
|
|
eb1ecff7d8 | ||
|
|
8141723869 | ||
|
|
8cb701bda3 | ||
|
|
1b29746806 | ||
|
|
fb9c317256 | ||
|
|
8c704951e1 | ||
|
|
24c23628d6 |
Binary file not shown.
|
Before Width: | Height: | Size: 4.8 MiB |
@@ -1,14 +1,7 @@
|
|||||||
# iTop version history
|
# iTop version history
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'themeVariables': {
|
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true,'mainBranchName': 'develop','rotateCommitLabel': true}} }%%
|
||||||
'git0': 'lawngreen',
|
|
||||||
'git3': 'dodgerblue',
|
|
||||||
'git4': 'grey',
|
|
||||||
'git5': 'grey',
|
|
||||||
'git6': 'grey',
|
|
||||||
'git7': 'grey'
|
|
||||||
}, 'gitGraph': {'showBranches': true,'mainBranchName': 'develop','rotateCommitLabel': true}} }%%
|
|
||||||
gitGraph
|
gitGraph
|
||||||
commit id: "2016-07-06" tag: "2.3.0" type: HIGHLIGHT
|
commit id: "2016-07-06" tag: "2.3.0" type: HIGHLIGHT
|
||||||
branch support/2.3 order: 900
|
branch support/2.3 order: 900
|
||||||
@@ -75,16 +68,6 @@ gitGraph
|
|||||||
branch support/3.1 order: 840
|
branch support/3.1 order: 840
|
||||||
checkout support/3.1
|
checkout support/3.1
|
||||||
commit id: "2023-08-09" tag: "3.1.0-2"
|
commit id: "2023-08-09" tag: "3.1.0-2"
|
||||||
checkout support/2.7
|
|
||||||
commit id: "2023-08-10" tag: "2.7.9"
|
|
||||||
checkout support/3.1
|
|
||||||
commit id: "2023-12-20" tag: "3.1.1"
|
|
||||||
checkout support/2.7
|
|
||||||
commit id: "2024-01-17" tag: "2.7.10"
|
|
||||||
checkout develop
|
|
||||||
commit id: "2024-06-25" tag: "3.2.0-beta1" type: HIGHLIGHT
|
|
||||||
branch support/3.2 order: 830
|
|
||||||
checkout support/3.2
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To learn more, check the [iTop community versions history on the official wiki](https://www.itophub.io/wiki/page?id=latest:release:start).
|
To learn more, check the [iTop community versions history on the official wiki](https://www.itophub.io/wiki/page?id=latest:release:start).
|
||||||
|
|||||||
43
.github/workflows/action.yml
vendored
Normal file
43
.github/workflows/action.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
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 }}
|
||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -47,12 +47,6 @@ 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)
|
|
||||||
/node_modules/jquery-ui/**
|
|
||||||
|
|
||||||
# Symfony: Local env file
|
|
||||||
/resources/symfony/.env.local
|
|
||||||
|
|
||||||
# PHPUnit: Cache file, local XML working copies
|
# PHPUnit: Cache file, local XML working copies
|
||||||
/tests/php-unit-tests/.phpunit.result.cache
|
/tests/php-unit-tests/.phpunit.result.cache
|
||||||
/tests/php-unit-tests/phpunit.xml
|
/tests/php-unit-tests/phpunit.xml
|
||||||
|
|||||||
@@ -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-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2010-2024 Combodo SAS
|
* Copyright (C) 2010-2023 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-2023 Combodo SARL
|
||||||
|
*
|
||||||
|
* This file is part of iTop.
|
||||||
|
*
|
||||||
|
* iTop is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* iTop is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* 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 !== '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);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -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";
|
|
||||||
@@ -140,7 +140,7 @@ When your code is working, please:
|
|||||||
* Pull request description: mind to add all the information useful to understand why you're suggesting this modification and anything necessary to dive into your work. Especially:
|
* Pull request description: mind to add all the information useful to understand why you're suggesting this modification and anything necessary to dive into your work. Especially:
|
||||||
- Bugfixes: exact steps to reproduce the bug (given/when/then), description of the bug cause and what solution is implemented
|
- Bugfixes: exact steps to reproduce the bug (given/when/then), description of the bug cause and what solution is implemented
|
||||||
- Enhancements: use cases, implementation details if needed
|
- Enhancements: use cases, implementation details if needed
|
||||||
* Mind to check the "[Allow edits from maintainers](https://docs.github.com/en/github-ae@latest/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)" option ! (note that if you are working with an org fork, this option [won't be available](https://github.com/orgs/community/discussions/5634))
|
* 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 !
|
||||||
|
|
||||||
|
|
||||||
## 🙏 We are thankful
|
## 🙏 We are thankful
|
||||||
@@ -159,6 +159,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:
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -87,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
|
||||||
@@ -107,11 +105,9 @@ We would like to give a special thank you 🤗 to the people from the community
|
|||||||
- Roháč, Richard (a.k.a [@RohacRichard](https://github.com/RohacRichard))
|
- Roháč, Richard (a.k.a [@RohacRichard](https://github.com/RohacRichard))
|
||||||
- Rosenke, Stephan
|
- Rosenke, Stephan
|
||||||
- Rudner, Björn (a.k.a [@rudnerbjoern](https://github.com/rudnerbjoern))
|
- Rudner, Björn (a.k.a [@rudnerbjoern](https://github.com/rudnerbjoern))
|
||||||
- Šafránek, Jaroslav (a.k.a [jkcinik](https://sourceforge.net/u/jkcinik/profile/) on SourceForge)
|
|
||||||
- Seki, Shoji
|
- Seki, Shoji
|
||||||
- Shilov, Vladimir
|
- Shilov, Vladimir
|
||||||
- Stetina, Pavel (a.k.a [@Stetinac](https://github.com/Stetinac))
|
- Stukalov, Ilya (a.k.a [@ilya](https://www.github.com/ilya-stukalov))
|
||||||
- Stukalov, Ilya (a.k.a [@ilya](https://www.github.com/ilya)-stukalov)
|
|
||||||
- Tarjányi, Csaba (a.k.a [@tacsaby](https://github.com/tacsaby))
|
- Tarjányi, Csaba (a.k.a [@tacsaby](https://github.com/tacsaby))
|
||||||
- Tulio, Marco
|
- Tulio, Marco
|
||||||
- Turrubiates, Miguel
|
- Turrubiates, Miguel
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2023 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-2023 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-2023 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-2023 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-2023 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');
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2023 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');
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2023 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
|
||||||
|
|||||||
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-2023 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,12 +2,11 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/AjaxPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 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-2023 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-2023 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-2023 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-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -19,8 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||||
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
use Symfony\Component\DependencyInjection\Container;
|
use Symfony\Component\DependencyInjection\Container;
|
||||||
|
|
||||||
require_once(APPROOT.'application/newsroomprovider.class.inc.php');
|
require_once(APPROOT.'application/newsroomprovider.class.inc.php');
|
||||||
@@ -31,7 +29,7 @@ require_once(APPROOT.'application/newsroomprovider.class.inc.php');
|
|||||||
* Definition of interfaces that can be implemented to customize iTop.
|
* Definition of interfaces that can be implemented to customize iTop.
|
||||||
* You may implement such interfaces in a module file (e.g. main.mymodule.php)
|
* You may implement such interfaces in a module file (e.g. main.mymodule.php)
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
* @since 2.7.0
|
* @since 2.7.0
|
||||||
*/
|
*/
|
||||||
@@ -272,14 +270,14 @@ interface iPreferencesExtension
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function DisplayPreferences(WebPage $oPage);
|
public function DisplayPreferences(WebPage $oPage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param string $sOperation
|
* @param string $sOperation
|
||||||
*
|
*
|
||||||
* @return bool true if the operation has been used
|
* @return bool true if the operation has been used
|
||||||
@@ -1274,6 +1272,8 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
|
|||||||
*/
|
*/
|
||||||
public function GetNorthPaneHtml(iTopWebPage $oPage)
|
public function GetNorthPaneHtml(iTopWebPage $oPage)
|
||||||
{
|
{
|
||||||
|
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1282,6 +1282,8 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
|
|||||||
*/
|
*/
|
||||||
public function GetSouthPaneHtml(iTopWebPage $oPage)
|
public function GetSouthPaneHtml(iTopWebPage $oPage)
|
||||||
{
|
{
|
||||||
|
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1290,6 +1292,8 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
|
|||||||
*/
|
*/
|
||||||
public function GetBannerHtml(iTopWebPage $oPage)
|
public function GetBannerHtml(iTopWebPage $oPage)
|
||||||
{
|
{
|
||||||
|
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2281,91 +2285,4 @@ interface iKPILoggerExtension
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function LogOperation($oKpiLogData);
|
public function LogOperation($oKpiLogData);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implement this interface to add files to the backup
|
|
||||||
*
|
|
||||||
* @api
|
|
||||||
* @since 3.2.0
|
|
||||||
*/
|
|
||||||
interface iBackupExtraFilesExtension
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @api
|
|
||||||
* @return string[] Array of relative paths (from app root) for files and directories to be included in the backup
|
|
||||||
*/
|
|
||||||
public function GetExtraFilesRelPaths(): array;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface to provide messages to be displayed in the "Welcome Popup"
|
|
||||||
*
|
|
||||||
* @api
|
|
||||||
* @since 3.2.0
|
|
||||||
*/
|
|
||||||
interface iWelcomePopupExtension
|
|
||||||
{
|
|
||||||
// Importance for ordering messages
|
|
||||||
// Just two levels since less important messages have nothing to do in the welcome popup
|
|
||||||
public const ENUM_IMPORTANCE_CRITICAL = 0;
|
|
||||||
public const ENUM_IMPORTANCE_HIGH = 1;
|
|
||||||
public const DEFAULT_IMPORTANCE = self::ENUM_IMPORTANCE_HIGH;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overload this method if you need to display an icon representing the provider (eg. your own company logo, module icon, ...)
|
|
||||||
*
|
|
||||||
* @api
|
|
||||||
* @return string Relative path (from app. root) of the icon representing the provider
|
|
||||||
*/
|
|
||||||
public function GetIconRelPath(): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @api
|
|
||||||
* @return \Combodo\iTop\Application\WelcomePopup\Message[]
|
|
||||||
*/
|
|
||||||
public function GetMessages(): array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overload this method if the provider needs to do some additional processing after the message ($sMessageId) has been acknowledged by the current user
|
|
||||||
*
|
|
||||||
* @param string $sMessageId
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
public function AcknowledgeMessage(string $sMessageId): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Inherit from this class to provide messages to be displayed in the "Welcome Popup"
|
|
||||||
*
|
|
||||||
* @api
|
|
||||||
* @since 3.2.0
|
|
||||||
*/
|
|
||||||
abstract class AbstractWelcomePopupExtension implements iWelcomePopupExtension
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
public function GetIconRelPath(): string
|
|
||||||
{
|
|
||||||
return \Combodo\iTop\Application\Branding::$aLogoPaths[\Combodo\iTop\Application\Branding::ENUM_LOGO_TYPE_MAIN_LOGO_COMPACT]['default'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
public function GetMessages(): array
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
public function AcknowledgeMessage(string $sMessageId): void
|
|
||||||
{
|
|
||||||
// No need to process the acknowledgment notice by default
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2023 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
* 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-2023 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-2023 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
* 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-2023 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-2023 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-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/CaptureWebPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 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-2023 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');
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/CLIPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 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-2023 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');
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\Helper\CKEditorHelper;
|
|
||||||
use Combodo\iTop\Application\Helper\FormHelper;
|
use Combodo\iTop\Application\Helper\FormHelper;
|
||||||
use Combodo\iTop\Application\Helper\Session;
|
use Combodo\iTop\Application\Helper\Session;
|
||||||
use Combodo\iTop\Application\Helper\WebResourcesHelper;
|
use Combodo\iTop\Application\Helper\WebResourcesHelper;
|
||||||
@@ -27,7 +26,7 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\Html\HtmlFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Html\HtmlFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Input\SelectUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenuItem\JsPopoverMenuItem;
|
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenuItem\JsPopoverMenuItem;
|
||||||
@@ -43,9 +42,6 @@ use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Links\Direct\BlockDirectLinkSetViewTable;
|
use Combodo\iTop\Application\UI\Links\Direct\BlockDirectLinkSetViewTable;
|
||||||
use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinkSetViewTable;
|
use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinkSetViewTable;
|
||||||
use Combodo\iTop\Application\UI\Links\Set\LinkSetUIBlockFactory;
|
use Combodo\iTop\Application\UI\Links\Set\LinkSetUIBlockFactory;
|
||||||
use Combodo\iTop\Application\WebPage\AjaxPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
use Combodo\iTop\Renderer\BlockRenderer;
|
use Combodo\iTop\Renderer\BlockRenderer;
|
||||||
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
|
||||||
use Combodo\iTop\Renderer\Console\ConsoleFormRenderer;
|
use Combodo\iTop\Renderer\Console\ConsoleFormRenderer;
|
||||||
@@ -291,7 +287,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param \cmdbAbstractObject $oObj
|
* @param \cmdbAbstractObject $oObj
|
||||||
* @param array $aParams
|
* @param array $aParams
|
||||||
*
|
*
|
||||||
@@ -360,7 +356,7 @@ JS
|
|||||||
* @param int $iKey The identifier of the object
|
* @param int $iKey The identifier of the object
|
||||||
* @param string $sMessageId Your id or one of the well-known ids: 'create', 'update' and 'apply_stimulus'
|
* @param string $sMessageId Your id or one of the well-known ids: 'create', 'update' and 'apply_stimulus'
|
||||||
* @param string $sMessage The HTML message (must be correctly escaped)
|
* @param string $sMessage The HTML message (must be correctly escaped)
|
||||||
* @param string $sSeverity Any of the WebPage::ENUM_SESSION_MESSAGE_SEVERITY_XXX constants
|
* @param string $sSeverity Any of the \WebPage::ENUM_SESSION_MESSAGE_SEVERITY_XXX constants
|
||||||
* @param float $fRank Ordering of the message: smallest displayed first (can be negative)
|
* @param float $fRank Ordering of the message: smallest displayed first (can be negative)
|
||||||
* @param bool $bMustNotExist Do not alter any existing message (considering the id)
|
* @param bool $bMustNotExist Do not alter any existing message (considering the id)
|
||||||
*
|
*
|
||||||
@@ -382,7 +378,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage Warning, since 3.0.0 this parameter was kept for compatibility reason. You shouldn't write directly on the page!
|
* @param \WebPage $oPage Warning, since 3.0.0 this parameter was kept for compatibility reason. You shouldn't write directly on the page!
|
||||||
* When writing to the page, markup will be put above the real header of the panel.
|
* When writing to the page, markup will be put above the real header of the panel.
|
||||||
* To insert something IN the panel, we now need to add UIBlocks in either the "subtitle" or "toolbar" sections of the array that will be returned.
|
* To insert something IN the panel, we now need to add UIBlocks in either the "subtitle" or "toolbar" sections of the array that will be returned.
|
||||||
* @param bool $bEditMode Deprecated parameter in iTop 3.0.0, use {@see GetDisplayMode()} and ENUM_DISPLAY_MODE_* constants instead
|
* @param bool $bEditMode Deprecated parameter in iTop 3.0.0, use {@see GetDisplayMode()} and ENUM_DISPLAY_MODE_* constants instead
|
||||||
@@ -560,7 +556,7 @@ HTML
|
|||||||
/**
|
/**
|
||||||
* Display properties tab of an object
|
* Display properties tab of an object
|
||||||
*
|
*
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
||||||
* @param string $sPrefix
|
* @param string $sPrefix
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
@@ -599,7 +595,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $sAttCode
|
* @param $sAttCode
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -640,7 +636,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
||||||
*
|
*
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
@@ -867,7 +863,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
* @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead
|
||||||
* @param string $sPrefix
|
* @param string $sPrefix
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
@@ -1061,12 +1057,17 @@ HTML
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fields with CKEditor need to have the highlight.js lib loaded even if they are in read-only, as it is needed to format code snippets
|
||||||
|
if ($bHasFieldsWithRichTextEditor) {
|
||||||
|
WebResourcesHelper::EnableCKEditorToWebPage($oPage);
|
||||||
|
}
|
||||||
|
|
||||||
return $aFieldsMap;
|
return $aFieldsMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param bool $bEditMode Note that this parameter is no longer used in this method, {@see static::$sDisplayMode} is used instead, but we cannot remove it as it part of the base interface (iDisplay)...
|
* @param bool $bEditMode Note that this parameter is no longer used in this method, {@see static::$sDisplayMode} is used instead, but we cannot remove it as it part of the base interface (iDisplay)...
|
||||||
*
|
*
|
||||||
* @throws \ApplicationException
|
* @throws \ApplicationException
|
||||||
@@ -1113,8 +1114,10 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note: DisplayBareHeader is called before adding $oObjectDetails to the page, so it can inject HTML before it through $oPage.
|
// Note: DisplayBareHeader is called before adding $oObjectDetails to the page, so it can inject HTML before it through $oPage.
|
||||||
/** @var iTopWebPage $oPage */
|
/** @var \iTopWebPage $oPage */
|
||||||
|
$oKPI = new ExecutionKPI();
|
||||||
$aHeadersBlocks = $this->DisplayBareHeader($oPage, $bEditMode);
|
$aHeadersBlocks = $this->DisplayBareHeader($oPage, $bEditMode);
|
||||||
|
$oKPI->ComputeStatsForExtension($this, 'DisplayBareHeader');
|
||||||
if (false === empty($aHeadersBlocks['subtitle'])) {
|
if (false === empty($aHeadersBlocks['subtitle'])) {
|
||||||
$oObjectDetails->AddSubTitleBlocks($aHeadersBlocks['subtitle']);
|
$oObjectDetails->AddSubTitleBlocks($aHeadersBlocks['subtitle']);
|
||||||
}
|
}
|
||||||
@@ -1127,8 +1130,12 @@ HTML
|
|||||||
$oPage->AddTabContainer(OBJECT_PROPERTIES_TAB, '', $oObjectDetails);
|
$oPage->AddTabContainer(OBJECT_PROPERTIES_TAB, '', $oObjectDetails);
|
||||||
$oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB);
|
$oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB);
|
||||||
$oPage->SetCurrentTab('UI:PropertiesTab');
|
$oPage->SetCurrentTab('UI:PropertiesTab');
|
||||||
|
$oKPI = new ExecutionKPI();
|
||||||
$this->DisplayBareProperties($oPage, $bEditMode);
|
$this->DisplayBareProperties($oPage, $bEditMode);
|
||||||
|
$oKPI->ComputeStatsForExtension($this, 'DisplayBareProperties');
|
||||||
|
$oKPI = new ExecutionKPI();
|
||||||
$this->DisplayBareRelations($oPage, $bEditMode);
|
$this->DisplayBareRelations($oPage, $bEditMode);
|
||||||
|
$oKPI->ComputeStatsForExtension($this, 'DisplayBareRelations');
|
||||||
|
|
||||||
|
|
||||||
// Note: Adding the JS snippet which enables the image upload should have been done directly by the ActivityPanel which would have kept the independance principle
|
// Note: Adding the JS snippet which enables the image upload should have been done directly by the ActivityPanel which would have kept the independance principle
|
||||||
@@ -1148,7 +1155,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
*
|
*
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
@@ -1171,7 +1178,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aExtraParams See possible values in {@see DataTableUIBlockFactory::RenderDataTable()}
|
* @param array $aExtraParams See possible values in {@see DataTableUIBlockFactory::RenderDataTable()}
|
||||||
*
|
*
|
||||||
@@ -1233,7 +1240,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param \DBObjectSet $oSet
|
* @param \DBObjectSet $oSet
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -1405,7 +1412,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aExtraParams key used :
|
* @param array $aExtraParams key used :
|
||||||
* <ul>
|
* <ul>
|
||||||
@@ -1528,7 +1535,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aParams
|
* @param array $aParams
|
||||||
* @param string $sCharset
|
* @param string $sCharset
|
||||||
@@ -1687,7 +1694,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aParams
|
* @param array $aParams
|
||||||
*
|
*
|
||||||
@@ -1900,7 +1907,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aParams
|
* @param array $aParams
|
||||||
*
|
*
|
||||||
@@ -1978,7 +1985,7 @@ HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param \CMDBObjectSet $oSet
|
* @param \CMDBObjectSet $oSet
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -2009,7 +2016,7 @@ HTML
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param string $sAttCode
|
* @param string $sAttCode
|
||||||
* @param \AttributeDefinition $oAttDef
|
* @param \AttributeDefinition $oAttDef
|
||||||
@@ -2303,7 +2310,7 @@ JS
|
|||||||
$sHidden = "<input type=\"hidden\" id=\"{$iId}_count\" value=\"$iEntriesCount\"/>"; // To know how many entries the case log already contains
|
$sHidden = "<input type=\"hidden\" id=\"{$iId}_count\" value=\"$iEntriesCount\"/>"; // To know how many entries the case log already contains
|
||||||
|
|
||||||
$sHTMLValue = "$sHeader<div class=\"ibo-caselog-entry-form--text-input\" $sStyle data-role=\"ibo-caselog-entry-form--text-input\">";
|
$sHTMLValue = "$sHeader<div class=\"ibo-caselog-entry-form--text-input\" $sStyle data-role=\"ibo-caselog-entry-form--text-input\">";
|
||||||
$sHTMLValue .= "<textarea class=\"htmlEditor ibo-input-richtext-placeholder\" style=\"border:0;width:100%\" title=\"$sHelpText\" name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" rows=\"8\" cols=\"40\" id=\"$iId\">".CKEditorHelper::PrepareCKEditorValueTextEncodingForTextarea($sEditValue)."</textarea>";
|
$sHTMLValue .= "<textarea class=\"htmlEditor ibo-input-richtext-placeholder\" style=\"border:0;width:100%\" title=\"$sHelpText\" name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" rows=\"8\" cols=\"40\" id=\"$iId\">".utils::EscapeHtml($sEditValue)."</textarea>";
|
||||||
$sHTMLValue .= "$sPreviousLog</div>{$sValidationSpan}{$sReloadSpan}$sHidden";
|
$sHTMLValue .= "$sPreviousLog</div>{$sValidationSpan}{$sReloadSpan}$sHidden";
|
||||||
|
|
||||||
// Note: This should be refactored for all types of attribute (see at the end of this function) but as we are doing this for a maintenance release, we are scheduling it for the next main release in to order to avoid regressions as much as possible.
|
// Note: This should be refactored for all types of attribute (see at the end of this function) but as we are doing this for a maintenance release, we are scheduling it for the next main release in to order to avoid regressions as much as possible.
|
||||||
@@ -2315,10 +2322,39 @@ JS
|
|||||||
|
|
||||||
$oPage->add_ready_script("$('#$iId').on('keyup change validate', function(evt, sFormId) { return ValidateCaseLogField('$iId', $bMandatory, sFormId, $sNullValue, $sOriginalValue) } );"); // Custom validation function
|
$oPage->add_ready_script("$('#$iId').on('keyup change validate', function(evt, sFormId) { return ValidateCaseLogField('$iId', $bMandatory, sFormId, $sNullValue, $sOriginalValue) } );"); // Custom validation function
|
||||||
|
|
||||||
// configure CKEditor
|
// Replace the text area with CKEditor
|
||||||
CKEditorHelper::ConfigureCKEditorElementForWebPage($oPage, $iId, $sOriginalValue, true, [
|
// To change the default settings of the editor,
|
||||||
'placeholder' => Dict::S('UI:CaseLogTypeYourTextHere'),
|
// a) edit the file /js/ckeditor/config.js
|
||||||
]);
|
// b) or override some of the configuration settings, using the second parameter of ckeditor()
|
||||||
|
$aConfig = utils::GetCkeditorPref();
|
||||||
|
$aConfig['placeholder'] = Dict::S('UI:CaseLogTypeYourTextHere');
|
||||||
|
|
||||||
|
// - Final config
|
||||||
|
$sConfigJS = json_encode($aConfig);
|
||||||
|
|
||||||
|
WebResourcesHelper::EnableCKEditorToWebPage($oPage);
|
||||||
|
$oPage->add_ready_script("$('#$iId').ckeditor(function() { /* callback code */ }, $sConfigJS);"); // Transform $iId into a CKEdit
|
||||||
|
|
||||||
|
$oPage->add_ready_script(
|
||||||
|
<<<EOF
|
||||||
|
$('#$iId').on('update', function(evt){
|
||||||
|
BlockField('cke_$iId', $('#$iId').attr('disabled'));
|
||||||
|
//Delayed execution - ckeditor must be properly initialized before setting readonly
|
||||||
|
var retryCount = 0;
|
||||||
|
var oMe = $('#$iId');
|
||||||
|
var delayedSetReadOnly = function () {
|
||||||
|
if (oMe.data('ckeditorInstance').editable() == undefined && retryCount++ < 10) {
|
||||||
|
setTimeout(delayedSetReadOnly, retryCount * 100); //Wait a while longer each iteration
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
oMe.data('ckeditorInstance').setReadOnly(oMe.prop('disabled'));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
setTimeout(delayedSetReadOnly, 50);
|
||||||
|
});
|
||||||
|
EOF
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'HTML':
|
case 'HTML':
|
||||||
@@ -2396,7 +2432,7 @@ HTML;
|
|||||||
$sInputType = self::ENUM_INPUT_TYPE_IMAGE;
|
$sInputType = self::ENUM_INPUT_TYPE_IMAGE;
|
||||||
$aEventsList[] = 'validate';
|
$aEventsList[] = 'validate';
|
||||||
$aEventsList[] = 'change';
|
$aEventsList[] = 'change';
|
||||||
$oPage->LinkScriptFromAppRoot('js/edit_image.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/edit_image.js');
|
||||||
$oDocument = $value; // Value is an ormDocument objectm
|
$oDocument = $value; // Value is an ormDocument objectm
|
||||||
$sDefaultUrl = $oAttDef->Get('default_image');
|
$sDefaultUrl = $oAttDef->Get('default_image');
|
||||||
if (is_object($oDocument) && !$oDocument->IsEmpty()) {
|
if (is_object($oDocument) && !$oDocument->IsEmpty()) {
|
||||||
@@ -2512,11 +2548,11 @@ HTML;
|
|||||||
$sHTMLValue .= '</div></div>';
|
$sHTMLValue .= '</div></div>';
|
||||||
$sHTMLValue .= '<div>'.$sReloadSpan.'</div>'; // No validation span for this one: it does handle its own validation!
|
$sHTMLValue .= '<div>'.$sReloadSpan.'</div>'; // No validation span for this one: it does handle its own validation!
|
||||||
$sHTMLValue .= "<input name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" type=\"hidden\" id=\"$iId\" value=\"\"/>\n";
|
$sHTMLValue .= "<input name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" type=\"hidden\" id=\"$iId\" value=\"\"/>\n";
|
||||||
$oPage->LinkScriptFromAppRoot('js/form_handler.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/form_handler.js');
|
||||||
$oPage->LinkScriptFromAppRoot('js/console_form_handler.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/console_form_handler.js');
|
||||||
$oPage->LinkScriptFromAppRoot('js/field_set.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/field_set.js');
|
||||||
$oPage->LinkScriptFromAppRoot('js/form_field.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/form_field.js');
|
||||||
$oPage->LinkScriptFromAppRoot('js/subform_field.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/subform_field.js');
|
||||||
$oPage->add_ready_script(
|
$oPage->add_ready_script(
|
||||||
<<<JS
|
<<<JS
|
||||||
$('#{$iId}_field_set').field_set($sFieldSetOptions);
|
$('#{$iId}_field_set').field_set($sFieldSetOptions);
|
||||||
@@ -2542,9 +2578,9 @@ JS
|
|||||||
case 'Set':
|
case 'Set':
|
||||||
case 'TagSet':
|
case 'TagSet':
|
||||||
$sInputType = self::ENUM_INPUT_TYPE_TAGSET;
|
$sInputType = self::ENUM_INPUT_TYPE_TAGSET;
|
||||||
$oPage->LinkScriptFromAppRoot('js/selectize.min.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/selectize.min.js');
|
||||||
$oPage->LinkStylesheetFromAppRoot('css/selectize.default.css');
|
$oPage->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/selectize.default.css');
|
||||||
$oPage->LinkScriptFromAppRoot('js/jquery.itop-set-widget.js');
|
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.itop-set-widget.js');
|
||||||
|
|
||||||
$oPage->add_dict_entry('Core:AttributeSet:placeholder');
|
$oPage->add_dict_entry('Core:AttributeSet:placeholder');
|
||||||
|
|
||||||
@@ -2575,13 +2611,6 @@ JS
|
|||||||
$iFieldSize = $oAttDef->GetMaxSize();
|
$iFieldSize = $oAttDef->GetMaxSize();
|
||||||
if ($aAllowedValues !== null)
|
if ($aAllowedValues !== null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// convert AttributeBoolean value due to issue with radio style when value is false
|
|
||||||
// @see N°2443 - Boolean don't accept yes/no value
|
|
||||||
if($oAttDef instanceof AttributeBoolean){
|
|
||||||
$value = $value === false ? 0 : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Discrete list of values, use a SELECT or RADIO buttons depending on the config
|
// Discrete list of values, use a SELECT or RADIO buttons depending on the config
|
||||||
$sDisplayStyle = $oAttDef->GetDisplayStyle();
|
$sDisplayStyle = $oAttDef->GetDisplayStyle();
|
||||||
switch ($sDisplayStyle)
|
switch ($sDisplayStyle)
|
||||||
@@ -2726,7 +2755,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
@@ -3131,7 +3160,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Select the derived class to create
|
* Select the derived class to create
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param WebPage $oP
|
* @param \WebPage $oP
|
||||||
* @param \ApplicationContext $oAppContext
|
* @param \ApplicationContext $oAppContext
|
||||||
* @param array $aPossibleClasses
|
* @param array $aPossibleClasses
|
||||||
* @param array $aHiddenFields
|
* @param array $aHiddenFields
|
||||||
@@ -3226,7 +3255,7 @@ EOF
|
|||||||
return $oBlock;
|
return $oBlock;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param \DBObject|null $oSourceObject Object to use for the creation form, can be either the class to instantiate, an object to clone or an object to use (eg. already prefilled / modeled object)
|
* @param \DBObject|null $oSourceObject Object to use for the creation form, can be either the class to instantiate, an object to clone or an object to use (eg. already prefilled / modeled object)
|
||||||
* @param array $aArgs
|
* @param array $aArgs
|
||||||
@@ -3311,7 +3340,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param string $sStimulus
|
* @param string $sStimulus
|
||||||
* @param array|null $aPrefillFormParam
|
* @param array|null $aPrefillFormParam
|
||||||
* @param bool $bDisplayBareProperties Whether to display the object details or not
|
* @param bool $bDisplayBareProperties Whether to display the object details or not
|
||||||
@@ -3426,7 +3455,7 @@ EOF
|
|||||||
// Dummy collapsible section created in order to get JS files
|
// Dummy collapsible section created in order to get JS files
|
||||||
$oCollapsibleSection = new CollapsibleSection('');
|
$oCollapsibleSection = new CollapsibleSection('');
|
||||||
foreach ($oCollapsibleSection->GetJsFilesUrlRecursively(true) as $sJSFile) {
|
foreach ($oCollapsibleSection->GetJsFilesUrlRecursively(true) as $sJSFile) {
|
||||||
$oPage->LinkScriptFromURI($sJSFile);
|
$oPage->add_linked_script($sJSFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, $aArgs);
|
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, $aArgs);
|
||||||
@@ -3566,26 +3595,16 @@ EOF
|
|||||||
$oPage->add_ready_script(InlineImage::EnableCKEditorImageUpload($this, $sTempId));
|
$oPage->add_ready_script(InlineImage::EnableCKEditorImageUpload($this, $sTempId));
|
||||||
} else {
|
} else {
|
||||||
//we can directly apply the stimuli
|
//we can directly apply the stimuli
|
||||||
$sExceptionMessage = null;
|
|
||||||
try {
|
|
||||||
$bApplyStimulus = $this->ApplyStimulus($sStimulus); // will write the object in the DB
|
$bApplyStimulus = $this->ApplyStimulus($sStimulus); // will write the object in the DB
|
||||||
}
|
if (!$bApplyStimulus) {
|
||||||
catch (Exception $oException) {
|
throw new ApplicationException(Dict::S('UI:FailedToApplyStimuli'));
|
||||||
// Catch any exception happening during the stimulus
|
} else {
|
||||||
$bApplyStimulus = false;
|
|
||||||
$sExceptionMessage = ($oException instanceof CoreCannotSaveObjectException) ? $oException->getHtmlMessage() : $oException->getMessage();
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
if ($sOwnershipToken !== null) {
|
if ($sOwnershipToken !== null) {
|
||||||
// Release the concurrent lock, if any
|
// Release the concurrent lock, if any
|
||||||
iTopOwnershipLock::ReleaseLock($sClass, $iKey, $sOwnershipToken);
|
iTopOwnershipLock::ReleaseLock($sClass, $iKey, $sOwnershipToken);
|
||||||
}
|
}
|
||||||
if (!$bApplyStimulus) {
|
|
||||||
// Throw an application oriented exception if necessary
|
return true;
|
||||||
throw new ApplicationException($sExceptionMessage ?? Dict::S('UI:FailedToApplyStimuli'));
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3734,7 +3753,7 @@ HTML;
|
|||||||
/**
|
/**
|
||||||
* Displays a blob document *inline* (if possible, depending on the type of the document)
|
* Displays a blob document *inline* (if possible, depending on the type of the document)
|
||||||
*
|
*
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $sAttCode
|
* @param $sAttCode
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -4846,7 +4865,7 @@ HTML;
|
|||||||
/**
|
/**
|
||||||
* Special display where the case log uses the whole "screen" at the bottom of the "Properties" tab
|
* Special display where the case log uses the whole "screen" at the bottom of the "Properties" tab
|
||||||
*
|
*
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param string $sAttCode
|
* @param string $sAttCode
|
||||||
* @param string $sComment
|
* @param string $sComment
|
||||||
* @param string $sPrefix
|
* @param string $sPrefix
|
||||||
@@ -4950,7 +4969,7 @@ HTML
|
|||||||
/**
|
/**
|
||||||
* Special display where the case log uses the whole "screen" at the bottom of the "Properties" tab
|
* Special display where the case log uses the whole "screen" at the bottom of the "Properties" tab
|
||||||
*
|
*
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param string $sAttCode
|
* @param string $sAttCode
|
||||||
* @param string $sComment
|
* @param string $sComment
|
||||||
* @param string $sPrefix
|
* @param string $sPrefix
|
||||||
@@ -5075,7 +5094,7 @@ HTML
|
|||||||
* Display a form for modifying several objects at once
|
* Display a form for modifying several objects at once
|
||||||
* The form will be submitted to the current page, with the specified additional values
|
* The form will be submitted to the current page, with the specified additional values
|
||||||
*
|
*
|
||||||
* @param iTopWebPage $oP
|
* @param \iTopWebPage $oP
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param array $aSelectedObj
|
* @param array $aSelectedObj
|
||||||
* @param string $sCustomOperation
|
* @param string $sCustomOperation
|
||||||
@@ -5319,7 +5338,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Process the reply made from a form built with DisplayBulkModifyForm
|
* Process the reply made from a form built with DisplayBulkModifyForm
|
||||||
*
|
*
|
||||||
* @param WebPage $oP
|
* @param \WebPage $oP
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
* @param array $aSelectedObj
|
* @param array $aSelectedObj
|
||||||
* @param string $sCustomOperation
|
* @param string $sCustomOperation
|
||||||
@@ -5459,7 +5478,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Perform all the needed checks to delete one (or more) objects
|
* Perform all the needed checks to delete one (or more) objects
|
||||||
*
|
*
|
||||||
* @param WebPage $oP
|
* @param \WebPage $oP
|
||||||
* @param $sClass
|
* @param $sClass
|
||||||
* @param \DBObject[] $aObjects
|
* @param \DBObject[] $aObjects
|
||||||
* @param $bPreview
|
* @param $bPreview
|
||||||
@@ -6087,7 +6106,9 @@ JS
|
|||||||
// We want to avoid launching the listener twice, first here, and secondly after saving the Ticket in the listener
|
// We want to avoid launching the listener twice, first here, and secondly after saving the Ticket in the listener
|
||||||
// By disabling the event to be fired, we can remove the current object from the attribute !
|
// By disabling the event to be fired, we can remove the current object from the attribute !
|
||||||
$oObject = MetaModel::GetObject($sClass, $sId, false);
|
$oObject = MetaModel::GetObject($sClass, $sId, false);
|
||||||
self::FireEventDbLinksChangedForObject($oObject);
|
if (!is_null($oObject)) {
|
||||||
|
self::FireEventDbLinksChangedForObject($oObject);
|
||||||
|
}
|
||||||
self::RemoveObjectAwaitingEventDbLinksChanged($sClass, $sId);
|
self::RemoveObjectAwaitingEventDbLinksChanged($sClass, $sId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6095,13 +6116,11 @@ JS
|
|||||||
{
|
{
|
||||||
self::SetEventDBLinksChangedBlocked(true);
|
self::SetEventDBLinksChangedBlocked(true);
|
||||||
// N°6408 The object can have been deleted
|
// N°6408 The object can have been deleted
|
||||||
if (!is_null($oObject)) {
|
$oObject->FireEvent(EVENT_DB_LINKS_CHANGED);
|
||||||
$oObject->FireEvent(EVENT_DB_LINKS_CHANGED);
|
|
||||||
|
|
||||||
// Update the object if needed
|
// Update the object if needed
|
||||||
if (count($oObject->ListChanges()) !== 0) {
|
if (count($oObject->ListChanges()) !== 0) {
|
||||||
$oObject->DBUpdate();
|
$oObject->DBUpdate();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cmdbAbstractObject::SetEventDBLinksChangedBlocked(false);
|
cmdbAbstractObject::SetEventDBLinksChangedBlocked(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/CSVPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 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-2023 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-2023 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
|
||||||
@@ -563,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
|
||||||
@@ -594,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())
|
||||||
@@ -1111,15 +1109,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}";
|
||||||
@@ -1230,7 +1228,7 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
*
|
*
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
@@ -1266,13 +1264,12 @@ 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 = utils::HtmlEntities($this->sId);
|
$sId = json_encode($this->sId);
|
||||||
$sLayoutClass = utils::HtmlEntities($this->sLayoutClass);
|
$sLayoutClass = json_encode($this->sLayoutClass);
|
||||||
$sAutoReload = $this->bAutoReload ? 'true' : 'false';
|
$sAutoReload = $this->bAutoReload ? 'true' : 'false';
|
||||||
$sAutoReloadSec = (string) $this->iAutoReloadSec;
|
$sAutoReloadSec = (string) $this->iAutoReloadSec;
|
||||||
$sTitle = utils::HtmlEntities($this->sTitle);
|
$sTitle = json_encode($this->sTitle);
|
||||||
$sFile = utils::HtmlEntities($this->GetDefinitionFile());
|
$sFile = json_encode($this->GetDefinitionFile());
|
||||||
$sFileForJS = json_encode($this->GetDefinitionFile());
|
|
||||||
$sUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php';
|
$sUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php';
|
||||||
$sReloadURL = $this->GetReloadURL();
|
$sReloadURL = $this->GetReloadURL();
|
||||||
|
|
||||||
@@ -1328,15 +1325,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: {$sFileForJS}, 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: {$sFileForJS}, 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'}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1491,7 +1488,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param $sOQL
|
* @param $sOQL
|
||||||
*
|
*
|
||||||
* @throws \DictExceptionMissingString
|
* @throws \DictExceptionMissingString
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2023 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-2023 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-2023 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-2023 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
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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">
|
||||||
@@ -185,11 +155,6 @@
|
|||||||
<decoration_classes>fas fa-cog</decoration_classes>
|
<decoration_classes>fas fa-cog</decoration_classes>
|
||||||
</style>
|
</style>
|
||||||
</menu>
|
</menu>
|
||||||
<menu id="Integrations" xsi:type="TemplateMenuNode" _delta="define">
|
|
||||||
<rank>50</rank>
|
|
||||||
<parent>ConfigurationTools</parent>
|
|
||||||
<template_file/>
|
|
||||||
</menu>
|
|
||||||
<menu id="DataSources" xsi:type="OQLMenuNode" _delta="define">
|
<menu id="DataSources" xsi:type="OQLMenuNode" _delta="define">
|
||||||
<rank>20</rank>
|
<rank>20</rank>
|
||||||
<parent>ConfigurationTools</parent>
|
<parent>ConfigurationTools</parent>
|
||||||
@@ -247,9 +212,7 @@ The object can be modified.]]></description>
|
|||||||
<event id="EVENT_DB_CHECK_TO_WRITE" _delta="define">
|
<event id="EVENT_DB_CHECK_TO_WRITE" _delta="define">
|
||||||
<name>Check to write</name>
|
<name>Check to write</name>
|
||||||
<description><![CDATA[Check an object before it is written into the database (no change possible).
|
<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->AddCheckIssue() to signal an issue.]]></description>
|
||||||
Call $this->AddCheckWarning($sWarningMessage) to display a warning.
|
|
||||||
]]></description>
|
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -299,7 +262,7 @@ The modifications can be propagated to other objects.]]></description>
|
|||||||
<event id="EVENT_DB_CHECK_TO_DELETE" _delta="define">
|
<event id="EVENT_DB_CHECK_TO_DELETE" _delta="define">
|
||||||
<name>Check to delete</name>
|
<name>Check to delete</name>
|
||||||
<description><![CDATA[Check an object before it is deleted from the database.
|
<description><![CDATA[Check an object before it is deleted from the database.
|
||||||
Call $this->AddDeleteIssue($sIssueMessage) to signal an issue.]]></description>
|
Call $this->AddDeleteIssue() to signal an issue.]]></description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -354,7 +317,7 @@ Call $this->AddDeleteIssue($sIssueMessage) to signal an issue.]]></description>
|
|||||||
<event id="EVENT_ENUM_TRANSITIONS" _delta="define">
|
<event id="EVENT_ENUM_TRANSITIONS" _delta="define">
|
||||||
<name>Enum transitions</name>
|
<name>Enum transitions</name>
|
||||||
<description><![CDATA[Manage the allowed transitions in current object state.
|
<description><![CDATA[Manage the allowed transitions in current object state.
|
||||||
The only action allowed is to deny transitions with $this->DenyTransition($sTransitionCode)]]></description>
|
The only action allowed is to deny transitions with $this->DenyTransition()]]></description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -463,7 +426,7 @@ The only action allowed is to deny transitions with $this->DenyTransition($sTran
|
|||||||
<event id="EVENT_DB_SET_ATTRIBUTES_FLAGS" _delta="define">
|
<event id="EVENT_DB_SET_ATTRIBUTES_FLAGS" _delta="define">
|
||||||
<name>Set attributes flags</name>
|
<name>Set attributes flags</name>
|
||||||
<description><![CDATA[Set object attributes flags.
|
<description><![CDATA[Set object attributes flags.
|
||||||
Call $this->AddAttributeFlags($sAttCode, $iFlags) for all the attributes to be set for this target state.]]></description>
|
Call $this->AddAttributeFlags() for all the attributes to be set for this target state.]]></description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -485,7 +448,7 @@ Call $this->AddAttributeFlags($sAttCode, $iFlags) for all the attributes to be s
|
|||||||
<event id="EVENT_DB_SET_INITIAL_ATTRIBUTES_FLAGS" _delta="define">
|
<event id="EVENT_DB_SET_INITIAL_ATTRIBUTES_FLAGS" _delta="define">
|
||||||
<name>Set initial attributes flags</name>
|
<name>Set initial attributes flags</name>
|
||||||
<description><![CDATA[Set object initial attributes flags.
|
<description><![CDATA[Set object initial attributes flags.
|
||||||
Call $this->AddInitialAttributeFlags($sAttCode, $iFlags) for all the initial attributes to be set initially.]]></description>
|
Call $this->AddInitialAttributeFlags() for all the initial attributes to be set initially.]]></description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
</sources>
|
</sources>
|
||||||
@@ -511,18 +474,10 @@ 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>
|
||||||
|
|||||||
@@ -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-2023 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
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -24,8 +24,6 @@ use Combodo\iTop\Application\UI\DisplayBlock\BlockChartAjaxBars\BlockChartAjaxBa
|
|||||||
use Combodo\iTop\Application\UI\DisplayBlock\BlockChartAjaxPie\BlockChartAjaxPie;
|
use Combodo\iTop\Application\UI\DisplayBlock\BlockChartAjaxPie\BlockChartAjaxPie;
|
||||||
use Combodo\iTop\Application\UI\DisplayBlock\BlockCsv\BlockCsv;
|
use Combodo\iTop\Application\UI\DisplayBlock\BlockCsv\BlockCsv;
|
||||||
use Combodo\iTop\Application\UI\DisplayBlock\BlockList\BlockList;
|
use Combodo\iTop\Application\UI\DisplayBlock\BlockList\BlockList;
|
||||||
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
use Combodo\iTop\Service\Router\Router;
|
use Combodo\iTop\Service\Router\Router;
|
||||||
|
|
||||||
require_once(APPROOT.'/application/utils.inc.php');
|
require_once(APPROOT.'/application/utils.inc.php');
|
||||||
@@ -570,7 +568,7 @@ class DisplayBlock
|
|||||||
} else {
|
} else {
|
||||||
// render it as an Ajax (asynchronous) call
|
// render it as an Ajax (asynchronous) call
|
||||||
$oHtml->AddCSSClass("loading");
|
$oHtml->AddCSSClass("loading");
|
||||||
$oHtml->AddHtml("<p><img src=\"".utils::GetAbsoluteUrlAppRoot()."images/indicator_arrows.gif\"> ".Dict::S('UI:Loading').'</p>');
|
$oHtml->AddHtml("<p><img src=\"../images/indicator_arrows.gif\"> ".Dict::S('UI:Loading').'</p>');
|
||||||
$oPage->add_script('
|
$oPage->add_script('
|
||||||
$.post("ajax.render.php?style='.$this->m_sStyle.'",
|
$.post("ajax.render.php?style='.$this->m_sStyle.'",
|
||||||
{ operation: "ajax", filter: "'.$sFilter.'", extra_params: "'.$sExtraParams.'" },
|
{ operation: "ajax", filter: "'.$sFilter.'", extra_params: "'.$sExtraParams.'" },
|
||||||
@@ -597,7 +595,7 @@ class DisplayBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @throws \ApplicationException
|
* @throws \ApplicationException
|
||||||
@@ -706,7 +704,7 @@ class DisplayBlock
|
|||||||
if ($bDoSearch)
|
if ($bDoSearch)
|
||||||
{
|
{
|
||||||
// Keep the table_id identifying this table if we're performing a search
|
// Keep the table_id identifying this table if we're performing a search
|
||||||
$sTableId = utils::ReadParam('_table_id_', null, false, 'raw_data');
|
$sTableId = utils::ReadParam('_table_id_', null, false, utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER);
|
||||||
if ($sTableId != null)
|
if ($sTableId != null)
|
||||||
{
|
{
|
||||||
$aExtraParams['table_id'] = $sTableId;
|
$aExtraParams['table_id'] = $sTableId;
|
||||||
@@ -1356,7 +1354,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @return \Combodo\iTop\Application\UI\Base\iUIBlock
|
* @return \Combodo\iTop\Application\UI\Base\iUIBlock
|
||||||
@@ -1380,7 +1378,7 @@ JS
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
*
|
*
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
* @throws \ConfigException
|
* @throws \ConfigException
|
||||||
@@ -1458,7 +1456,7 @@ JS
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
*
|
*
|
||||||
* @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
|
* @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
|
||||||
* @throws \ApplicationException
|
* @throws \ApplicationException
|
||||||
@@ -1566,7 +1564,7 @@ JS
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.1.0 N°5957
|
* @deprecated 3.1.0 N°5957
|
||||||
*
|
*
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
*
|
*
|
||||||
* @return \Combodo\iTop\Application\UI\Base\Component\Html\Html|\Combodo\iTop\Application\UI\Base\Layout\UIContentBlock|string
|
* @return \Combodo\iTop\Application\UI\Base\Component\Html\Html|\Combodo\iTop\Application\UI\Base\Layout\UIContentBlock|string
|
||||||
@@ -1666,7 +1664,7 @@ JS
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
*
|
*
|
||||||
* @throws \ArchivedObjectException
|
* @throws \ArchivedObjectException
|
||||||
* @throws \CoreException
|
* @throws \CoreException
|
||||||
@@ -1832,7 +1830,7 @@ class MenuBlock extends DisplayBlock
|
|||||||
* an object in with the same tab active by default as the tab that was active when selecting
|
* an object in with the same tab active by default as the tab that was active when selecting
|
||||||
* the "Modify..." action.
|
* the "Modify..." action.
|
||||||
*
|
*
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param string|null $sId
|
* @param string|null $sId
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/ErrorPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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-2023 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 (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2023 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -15,13 +15,12 @@
|
|||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper class to build interactive forms to be used either in stand-alone
|
* Helper class to build interactive forms to be used either in stand-alone
|
||||||
* modal dialog or in "property-sheet" panes.
|
* modal dialog or in "property-sheet" panes.
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
class DesignerForm
|
class DesignerForm
|
||||||
@@ -209,7 +208,7 @@ class DesignerForm
|
|||||||
public function RenderAsPropertySheet($oP, $bReturnHTML = false, $sNotifyParentSelector = null)
|
public function RenderAsPropertySheet($oP, $bReturnHTML = false, $sNotifyParentSelector = null)
|
||||||
{
|
{
|
||||||
$sReturn = '';
|
$sReturn = '';
|
||||||
$sActionUrl = addslashes($this->sSubmitTo ?? '');
|
$sActionUrl = addslashes($this->sSubmitTo);
|
||||||
$sJSSubmitParams = json_encode($this->aSubmitParams);
|
$sJSSubmitParams = json_encode($this->aSubmitParams);
|
||||||
$sFormId = $this->GetFormId();
|
$sFormId = $this->GetFormId();
|
||||||
if ($this->oParentForm == null) {
|
if ($this->oParentForm == null) {
|
||||||
@@ -829,7 +828,7 @@ class DesignerFormField
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WebPage $oP
|
* @param \WebPage $oP
|
||||||
* @param string $sFormId
|
* @param string $sFormId
|
||||||
* @param string $sRenderMode
|
* @param string $sRenderMode
|
||||||
*
|
*
|
||||||
@@ -1330,8 +1329,7 @@ class DesignerComboField extends DesignerFormField
|
|||||||
{
|
{
|
||||||
if ($this->bMultipleSelection)
|
if ($this->bMultipleSelection)
|
||||||
{
|
{
|
||||||
$iSize = max(1, min(8, count($this->aAllowedValues)));
|
$sHtml = "<span><select $sCSSClasses multiple size=\"8\"id=\"$sId\" name=\"$sName\">";
|
||||||
$sHtml = "<span><select $sCSSClasses multiple size=\"$iSize\" id=\"$sId\" name=\"$sName\">";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2023 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Persistent class InputOutputTask
|
* Persistent class InputOutputTask
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/iTopWebPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/iTopWebPage.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-2023 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// cannot notify depreciation for now as this is still MASSIVELY used in iTop core !
|
// cannot notify depreciation for now as this is still MASSIVELY used in iTop core !
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/iTopWizardWebPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/iTopWizardWebPage.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-2023 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/iTopWizardWebPage.php, now loadable using autoloader');
|
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/iTopWizardWebPage.php, now loadable using autoloader');
|
||||||
@@ -5,7 +5,7 @@ use Combodo\iTop\Application\Helper\Session;
|
|||||||
/**
|
/**
|
||||||
* Class LoginBasic
|
* Class LoginBasic
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 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-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -53,12 +53,6 @@ class LoginDefaultBefore extends AbstractLoginFSMExtension
|
|||||||
{
|
{
|
||||||
// Force login mode
|
// Force login mode
|
||||||
LoginWebPage::SetLoginModeAndReload($sProposedLoginMode);
|
LoginWebPage::SetLoginModeAndReload($sProposedLoginMode);
|
||||||
} else {
|
|
||||||
$sRawLoginMode = utils::ReadParam('login_mode', '', false, utils::ENUM_SANITIZATION_FILTER_RAW_DATA);
|
|
||||||
if ($sProposedLoginMode !== $sRawLoginMode) {
|
|
||||||
IssueLog::Error("Authentication issue due to login_mode parameter sanitization. Please avoid special characters", null, ['sRawLoginMode' => $sRawLoginMode]);
|
|
||||||
//IssueLog::Error("Authentication issue due to login_mode parameter sanitization. Please avoid special characters", null, ['sRawLoginMode' => utils::HtmlEntities($sRawLoginMode)]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return LoginWebPage::LOGIN_FSM_CONTINUE;
|
return LoginWebPage::LOGIN_FSM_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use Combodo\iTop\Application\Helper\Session;
|
|||||||
/**
|
/**
|
||||||
* Class LoginExternal
|
* Class LoginExternal
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -140,11 +140,7 @@ class LoginForm extends AbstractLoginFSMExtension implements iLoginUIExtension
|
|||||||
$oLoginContext->AddBlockExtension('login_form_footer', new LoginBlockExtension('extensionblock/loginformfooter.html.twig'));
|
$oLoginContext->AddBlockExtension('login_form_footer', new LoginBlockExtension('extensionblock/loginformfooter.html.twig'));
|
||||||
|
|
||||||
$bEnableResetPassword = MetaModel::GetConfig()->Get('forgot_password');
|
$bEnableResetPassword = MetaModel::GetConfig()->Get('forgot_password');
|
||||||
$sResetPasswordUrl = MetaModel::GetConfig()->Get('forgot_password.url');
|
$sResetPasswordUrl = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?loginop=forgot_pwd';
|
||||||
if ($sResetPasswordUrl == '')
|
|
||||||
{
|
|
||||||
$sResetPasswordUrl = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?loginop=forgot_pwd';
|
|
||||||
}
|
|
||||||
$aData = array(
|
$aData = array(
|
||||||
'bEnableResetPassword' => $bEnableResetPassword,
|
'bEnableResetPassword' => $bEnableResetPassword,
|
||||||
'sResetPasswordUrl' => $sResetPasswordUrl,
|
'sResetPasswordUrl' => $sResetPasswordUrl,
|
||||||
|
|||||||
@@ -2,14 +2,13 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
use Combodo\iTop\Application\Branding;
|
use Combodo\iTop\Application\Branding;
|
||||||
use Combodo\iTop\Application\TwigBase\Twig\Extension;
|
use Combodo\iTop\Application\TwigBase\Twig\Extension;
|
||||||
use Combodo\iTop\Application\WebPage\NiceWebPage;
|
|
||||||
use Twig\Environment;
|
use Twig\Environment;
|
||||||
use Twig\Loader\ChainLoader;
|
use Twig\Loader\ChainLoader;
|
||||||
use Twig\Loader\FilesystemLoader;
|
use Twig\Loader\FilesystemLoader;
|
||||||
@@ -52,13 +51,12 @@ class LoginTwigContext
|
|||||||
/**
|
/**
|
||||||
* Set the absolute path on disk of the folder containing the twig templates
|
* Set the absolute path on disk of the folder containing the twig templates
|
||||||
*
|
*
|
||||||
|
* @param string $sPath absolute path of twig templates directory
|
||||||
* @api
|
* @api
|
||||||
*
|
|
||||||
*@param string $sAbsPath Absolute path of twig templates directory
|
|
||||||
*/
|
*/
|
||||||
public function SetLoaderPath($sAbsPath)
|
public function SetLoaderPath($sPath)
|
||||||
{
|
{
|
||||||
$this->sTwigLoaderPath = $sAbsPath;
|
$this->sTwigLoaderPath = $sPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,27 +83,24 @@ class LoginTwigContext
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the absolute URL of a CSS file to link to the login screen
|
* Add the URL of a CSS file to link to the login screen
|
||||||
*
|
*
|
||||||
|
* @param string $sFile URL of the CSS file to link
|
||||||
* @api
|
* @api
|
||||||
*
|
|
||||||
* @param string $sFileAbsURL Absolute URL of the CSS file to link
|
|
||||||
*/
|
*/
|
||||||
public function AddCSSFile($sFileAbsURL)
|
public function AddCSSFile($sFile)
|
||||||
{
|
{
|
||||||
$this->aCSSFiles[] = $sFileAbsURL;
|
$this->aCSSFiles[] = $sFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the absolute URL of a javascript file to link to the login screen
|
* Add the URL of a javascript file to link to the login screen
|
||||||
*
|
* @param string $sFile URL of the javascript file to link
|
||||||
* @api
|
* @api
|
||||||
*
|
|
||||||
* @param string $sFileAbsURL Absolute URL of the javascript file to link
|
|
||||||
*/
|
*/
|
||||||
public function AddJsFile($sFileAbsURL)
|
public function AddJsFile($sFile)
|
||||||
{
|
{
|
||||||
$this->aJsFiles[] = $sFileAbsURL;
|
$this->aJsFiles[] = $sFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,7 +132,7 @@ class LoginTwigContext
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array Absolute URLs of the CSS files
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function GetCSSFiles()
|
public function GetCSSFiles()
|
||||||
{
|
{
|
||||||
@@ -145,7 +140,7 @@ class LoginTwigContext
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array Absolute URLs of the JS files
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function GetJsFiles()
|
public function GetJsFiles()
|
||||||
{
|
{
|
||||||
@@ -278,12 +273,12 @@ class LoginTwigRenderer
|
|||||||
$aCSSFiles = $oFormData->GetCSSFiles();
|
$aCSSFiles = $oFormData->GetCSSFiles();
|
||||||
foreach ($aCSSFiles as $sCSSFile)
|
foreach ($aCSSFiles as $sCSSFile)
|
||||||
{
|
{
|
||||||
$oPage->LinkStylesheetFromURI($sCSSFile);
|
$oPage->add_linked_stylesheet($sCSSFile);
|
||||||
}
|
}
|
||||||
$aJsFiles = $oFormData->GetJsFiles();
|
$aJsFiles = $oFormData->GetJsFiles();
|
||||||
foreach ($aJsFiles as $sJsFile)
|
foreach ($aJsFiles as $sJsFile)
|
||||||
{
|
{
|
||||||
$oPage->LinkScriptFromURI($sJsFile);
|
$oPage->add_linked_script($sJsFile);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use Combodo\iTop\Application\Helper\Session;
|
|||||||
/**
|
/**
|
||||||
* Class LoginURL
|
* Class LoginURL
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 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-2023 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -20,14 +20,12 @@
|
|||||||
/**
|
/**
|
||||||
* Class LoginWebPage
|
* Class LoginWebPage
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\Branding;
|
use Combodo\iTop\Application\Branding;
|
||||||
use Combodo\iTop\Application\Helper\Session;
|
use Combodo\iTop\Application\Helper\Session;
|
||||||
use Combodo\iTop\Application\WebPage\ErrorPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\NiceWebPage;
|
|
||||||
use Combodo\iTop\Service\Events\EventData;
|
use Combodo\iTop\Service\Events\EventData;
|
||||||
use Combodo\iTop\Service\Events\EventService;
|
use Combodo\iTop\Service\Events\EventService;
|
||||||
|
|
||||||
@@ -82,7 +80,7 @@ class LoginWebPage extends NiceWebPage
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected static $m_sLoginFailedMessage = '';
|
protected static $m_sLoginFailedMessage = '';
|
||||||
|
|
||||||
public function __construct($sTitle = null)
|
public function __construct($sTitle = null)
|
||||||
{
|
{
|
||||||
if ($sTitle === null) {
|
if ($sTitle === null) {
|
||||||
@@ -97,17 +95,8 @@ class LoginWebPage extends NiceWebPage
|
|||||||
|
|
||||||
public function SetStyleSheet()
|
public function SetStyleSheet()
|
||||||
{
|
{
|
||||||
$this->LinkStylesheetFromAppRoot('css/login.css');
|
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/login.css');
|
||||||
$this->LinkStylesheetFromAppRoot('css/font-awesome/css/all.min.css');
|
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/all.min.css');
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
* @since 3.2.0
|
|
||||||
*/
|
|
||||||
protected function GetFaviconAbsoluteUrl()
|
|
||||||
{
|
|
||||||
return Branding::GetLoginFavIconAbsoluteUrl();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetLoginFailedMessage($sMessage)
|
public static function SetLoginFailedMessage($sMessage)
|
||||||
@@ -919,13 +908,13 @@ class LoginWebPage extends NiceWebPage
|
|||||||
$aAllProfiles = array();
|
$aAllProfiles = array();
|
||||||
while ($oProfile = $oProfilesSet->Fetch())
|
while ($oProfile = $oProfilesSet->Fetch())
|
||||||
{
|
{
|
||||||
$aAllProfiles[mb_strtolower($oProfile->GetName())] = $oProfile->GetKey();
|
$aAllProfiles[strtolower($oProfile->GetName())] = $oProfile->GetKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
$aProfiles = array();
|
$aProfiles = array();
|
||||||
foreach ($aRequestedProfiles as $sRequestedProfile)
|
foreach ($aRequestedProfiles as $sRequestedProfile)
|
||||||
{
|
{
|
||||||
$sRequestedProfile = mb_strtolower($sRequestedProfile);
|
$sRequestedProfile = strtolower($sRequestedProfile);
|
||||||
if (isset($aAllProfiles[$sRequestedProfile]))
|
if (isset($aAllProfiles[$sRequestedProfile]))
|
||||||
{
|
{
|
||||||
$aProfiles[] = $aAllProfiles[$sRequestedProfile];
|
$aProfiles[] = $aAllProfiles[$sRequestedProfile];
|
||||||
@@ -971,7 +960,7 @@ class LoginWebPage extends NiceWebPage
|
|||||||
}
|
}
|
||||||
else if($ret === false)
|
else if($ret === false)
|
||||||
{
|
{
|
||||||
throw new Exception('Nowhere to go: Your combination of user Profiles denies you access to any '.ITOP_APPLICATION_SHORT.' portal. Please contact your administrator');
|
throw new Exception('Nowhere to go??');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -22,7 +22,6 @@
|
|||||||
// Maintenance message display functions
|
// Maintenance message display functions
|
||||||
// Only included by approot.inc.php
|
// Only included by approot.inc.php
|
||||||
//
|
//
|
||||||
use Combodo\iTop\Application\WebPage\ErrorPage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use a setup page to display the maintenance message
|
* Use a setup page to display the maintenance message
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Combodo\iTop\Application\Helper\WebResourcesHelper;
|
use Combodo\iTop\Application\Helper\WebResourcesHelper;
|
||||||
use Combodo\iTop\Application\WebPage\ErrorPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
require_once(APPROOT.'/application/utils.inc.php');
|
require_once(APPROOT.'/application/utils.inc.php');
|
||||||
require_once(APPROOT.'/application/template.class.inc.php');
|
require_once(APPROOT.'/application/template.class.inc.php');
|
||||||
@@ -125,7 +122,9 @@ class ApplicationMenu
|
|||||||
*/
|
*/
|
||||||
public static function CheckMenuIdEnabled($sMenuId)
|
public static function CheckMenuIdEnabled($sMenuId)
|
||||||
{
|
{
|
||||||
if (self::IsMenuIdEnabled($sMenuId) === false)
|
self::LoadAdditionalMenus();
|
||||||
|
$oMenuNode = self::GetMenuNode(self::GetMenuIndexById($sMenuId));
|
||||||
|
if (is_null($oMenuNode) || !$oMenuNode->IsEnabled())
|
||||||
{
|
{
|
||||||
require_once(APPROOT.'/setup/setuppage.class.inc.php');
|
require_once(APPROOT.'/setup/setuppage.class.inc.php');
|
||||||
$oP = new ErrorPage(Dict::S('UI:PageTitle:FatalError'));
|
$oP = new ErrorPage(Dict::S('UI:PageTitle:FatalError'));
|
||||||
@@ -136,19 +135,6 @@ class ApplicationMenu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $sMenuId
|
|
||||||
*
|
|
||||||
* @return bool true if the menu exists and current user is allowed to see the menu
|
|
||||||
* @since 3.2.0
|
|
||||||
*/
|
|
||||||
public static function IsMenuIdEnabled($sMenuId):bool
|
|
||||||
{
|
|
||||||
self::LoadAdditionalMenus();
|
|
||||||
$oMenuNode = self::GetMenuNode(self::GetMenuIndexById($sMenuId));
|
|
||||||
return is_null($oMenuNode) === false && $oMenuNode->IsEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function to add a menu entry into the application, can be called during the definition
|
* Main function to add a menu entry into the application, can be called during the definition
|
||||||
* of the data model objects
|
* of the data model objects
|
||||||
@@ -280,11 +266,9 @@ class ApplicationMenu
|
|||||||
$oMenuNode = static::GetMenuNode($sMenuGroupIdx);
|
$oMenuNode = static::GetMenuNode($sMenuGroupIdx);
|
||||||
|
|
||||||
if (!($oMenuNode instanceof MenuGroup)) {
|
if (!($oMenuNode instanceof MenuGroup)) {
|
||||||
IssueLog::Error('Menu node without parent (root menu) must be of type menu group. Parent menu is missing or not visible to user.', LogChannels::CONSOLE, [
|
IssueLog::Error('Menu node was not displayed as a menu group as it is actually not a menu group', LogChannels::CONSOLE, [
|
||||||
'menu_node_class' => get_class($oMenuNode),
|
'menu_node_class' => get_class($oMenuNode),
|
||||||
'menu_node_id' => $oMenuNode->GetMenuID(),
|
|
||||||
'menu_node_label' => $oMenuNode->GetLabel(),
|
'menu_node_label' => $oMenuNode->GetLabel(),
|
||||||
'current_user_id' => UserRights::GetUserId(),
|
|
||||||
]);
|
]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -361,7 +345,7 @@ class ApplicationMenu
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point to display the whole menu into the web page, used by iTopWebPage
|
* Entry point to display the whole menu into the web page, used by iTopWebPage
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @throws DictExceptionMissingString
|
* @throws DictExceptionMissingString
|
||||||
*
|
*
|
||||||
@@ -435,7 +419,7 @@ EOF
|
|||||||
/**
|
/**
|
||||||
* Handles the display of the sub-menus (called recursively if necessary)
|
* Handles the display of the sub-menus (called recursively if necessary)
|
||||||
*
|
*
|
||||||
* @param WebPage $oPage
|
* @param \WebPage $oPage
|
||||||
* @param array $aMenus
|
* @param array $aMenus
|
||||||
* @param array $aExtraParams
|
* @param array $aExtraParams
|
||||||
* @param int $iActiveMenu
|
* @param int $iActiveMenu
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2023 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/NiceWebPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/NiceWebPage.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-2023 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/NiceWebPage.php, now loadable using autoloader');
|
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/NiceWebPage.php, now loadable using autoloader');
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/PDFPage.php, now loadable using autoloader
|
* @deprecated 3.0.0 will be removed in 3.1.0 - moved to sources/Application/WebPage/PDFPage.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-2023 Combodo SARL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/PDFPage.php, now loadable using autoloader');
|
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/PDFPage.php, now loadable using autoloader');
|
||||||
@@ -9,17 +9,11 @@ class PortalDispatcher
|
|||||||
$this->sPortalid = $sPortalId;
|
$this->sPortalid = $sPortalId;
|
||||||
$this->aData = PortalDispatcherData::GetData($sPortalId);
|
$this->aData = PortalDispatcherData::GetData($sPortalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function IsUserAllowed()
|
||||||
* @param \User|null $oUser
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
* @since 3.2.0 N°2039 Add $oUser parameter
|
|
||||||
*/
|
|
||||||
public function IsUserAllowed(?User $oUser = null)
|
|
||||||
{
|
{
|
||||||
$bRet = true;
|
$bRet = true;
|
||||||
$aProfiles = UserRights::ListProfiles($oUser);
|
$aProfiles = UserRights::ListProfiles();
|
||||||
|
|
||||||
foreach($this->aData['deny'] as $sDeniedProfile)
|
foreach($this->aData['deny'] as $sDeniedProfile)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2010-2024 Combodo SAS
|
* Copyright (C) 2010-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -21,7 +21,6 @@ use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory;
|
|||||||
use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSetUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSetUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
|
||||||
use Combodo\iTop\Application\UI\Base\Component\Input\TextArea;
|
use Combodo\iTop\Application\UI\Base\Component\Input\TextArea;
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
abstract class Query extends cmdbAbstractObject
|
abstract class Query extends cmdbAbstractObject
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2023 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -16,14 +16,13 @@
|
|||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persistent class Shortcut and derived
|
* Persistent class Shortcut and derived
|
||||||
* Shortcuts of any kind
|
* Shortcuts of any kind
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -293,7 +292,7 @@ $("#attr_auto_reload_sec").attr('data-tooltip-content', '$sRateTitle');
|
|||||||
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'));
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2024 Combodo SAS
|
// Copyright (C) 2010-2023 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -27,7 +27,7 @@ require_once(APPROOT.'setup/setuputils.class.inc.php');
|
|||||||
/**
|
/**
|
||||||
* File to include to initialize the datamodel in memory
|
* File to include to initialize the datamodel in memory
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
* @copyright Copyright (C) 2010-2023 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 (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -17,9 +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\iTopWebPage;
|
|
||||||
use Combodo\iTop\Application\WebPage\WebPage;
|
|
||||||
|
|
||||||
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
require_once(APPROOT.'/application/displayblock.class.inc.php');
|
||||||
/**
|
/**
|
||||||
* This class manages the special template format used internally to build the iTop web pages
|
* This class manages the special template format used internally to build the iTop web pages
|
||||||
@@ -232,13 +229,12 @@ class DisplayTemplate
|
|||||||
static public function UnitTest()
|
static public function UnitTest()
|
||||||
{
|
{
|
||||||
require_once(APPROOT.'/application/startup.inc.php');
|
require_once(APPROOT.'/application/startup.inc.php');
|
||||||
|
|
||||||
$sAppRootUrl = utils::GetAbsoluteUrlAppRoot();
|
|
||||||
$sTemplate = '<div class="page_header">
|
$sTemplate = '<div class="page_header">
|
||||||
<div class="actions_details"><a href="#"><span>Actions</span></a></div>
|
<div class="actions_details"><a href="#"><span>Actions</span></a></div>
|
||||||
<h1>$class$: <span class="hilite">$name$</span></h1>
|
<h1>$class$: <span class="hilite">$name$</span></h1>
|
||||||
</div>
|
</div>
|
||||||
<img src="'.$sAppRootUrl.'images/connect_to_network.png" style="margin-top:-10px; margin-right:10px; float:right">
|
<img src="../../images/connect_to_network.png" style="margin-top:-10px; margin-right:10px; float:right">
|
||||||
<itoptabs>
|
<itoptabs>
|
||||||
<itoptab name="Interfaces">
|
<itoptab name="Interfaces">
|
||||||
<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql">SELECT Interface AS i WHERE i.device_id = $id$</itopblock>
|
<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql">SELECT Interface AS i WHERE i.device_id = $id$</itopblock>
|
||||||
@@ -351,8 +347,7 @@ class ObjectDetailsTemplate extends DisplayTemplate
|
|||||||
if ($iFlags & OPT_ATT_SLAVE)
|
if ($iFlags & OPT_ATT_SLAVE)
|
||||||
{
|
{
|
||||||
$iSynchroFlags = $this->m_oObj->GetSynchroReplicaFlags($sAttCode, $aReasons);
|
$iSynchroFlags = $this->m_oObj->GetSynchroReplicaFlags($sAttCode, $aReasons);
|
||||||
$sAppRooturl = utils::GetAbsoluteUrlAppRoot();
|
$sSynchroIcon = " <img id=\"synchro_$iInputId\" src=\"../images/transp-lock.png\" style=\"vertical-align:middle\"/>";
|
||||||
$sSynchroIcon = " <img id=\"synchro_$iInputId\" src=\"{$sAppRooturl}images/transp-lock.png\" style=\"vertical-align:middle\"/>";
|
|
||||||
$sTip = '';
|
$sTip = '';
|
||||||
foreach($aReasons as $aRow)
|
foreach($aReasons as $aRow)
|
||||||
{
|
{
|
||||||
|
|||||||
29
application/templates/welcome_popup.html
Normal file
29
application/templates/welcome_popup.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<div style="width:100%;background: #fff url(../images/welcome.jpg) top left no-repeat;">
|
||||||
|
<style>
|
||||||
|
.welcome_popup_cell {
|
||||||
|
vertical-align:top;
|
||||||
|
width:50%;
|
||||||
|
border:0px solid #000;
|
||||||
|
-moz-border-radius:10px;
|
||||||
|
padding:5px;
|
||||||
|
text-align:left;
|
||||||
|
}
|
||||||
|
tr td.welcome_popup_cell, tr td.welcome_popup_cell ul {
|
||||||
|
font-size:10pt;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<p></p>
|
||||||
|
<p></p>
|
||||||
|
<p style="text-align:left; font-size:32px;padding-left:400px;padding-top:40px;margin-bottom:30px;margin-top:0;color:#FFFFFF;"><itopstring>UI:WelcomeMenu:Title</itopstring></p>
|
||||||
|
<p></p>
|
||||||
|
<table border="0" style="padding:10px;border-spacing: 10px;width:100%">
|
||||||
|
<tr>
|
||||||
|
<td class="welcome_popup_cell">
|
||||||
|
<itopstring>UI:WelcomeMenu:LeftBlock</itopstring>
|
||||||
|
</td>
|
||||||
|
<td class="welcome_popup_cell">
|
||||||
|
<itopstring>UI:WelcomeMenu:RightBlock</itopstring>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2024 Combodo SAS
|
* Copyright (C) 2013-2023 Combodo SARL
|
||||||
*
|
*
|
||||||
* This file is part of iTop.
|
* This file is part of iTop.
|
||||||
*
|
*
|
||||||
@@ -536,7 +536,7 @@ CSS;
|
|||||||
if (static::HasImageExtension($sImg)
|
if (static::HasImageExtension($sImg)
|
||||||
&& ! array_key_exists($sImg, $aImages))
|
&& ! array_key_exists($sImg, $aImages))
|
||||||
{
|
{
|
||||||
$sFilePath = utils::RealPath($sImg, APPROOT);
|
$sFilePath = realpath($sImg);
|
||||||
if ($sFilePath !== false) {
|
if ($sFilePath !== false) {
|
||||||
$sFilePathWithSlashes = str_replace('\\', '/', $sFilePath);
|
$sFilePathWithSlashes = str_replace('\\', '/', $sFilePath);
|
||||||
$aImages[$sImg] = $sFilePathWithSlashes;
|
$aImages[$sImg] = $sFilePathWithSlashes;
|
||||||
@@ -544,7 +544,7 @@ CSS;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sCanonicalPath = static::CanonicalizePath($sTargetThemeFolderPath.'/'.$sImg);
|
$sCanonicalPath = static::CanonicalizePath($sTargetThemeFolderPath.'/'.$sImg);
|
||||||
$sFilePath = utils::RealPath($sCanonicalPath, APPROOT);
|
$sFilePath = realpath($sCanonicalPath);
|
||||||
if ($sFilePath !== false) {
|
if ($sFilePath !== false) {
|
||||||
$sFilePathWithSlashes = str_replace('\\', '/', $sFilePath);
|
$sFilePathWithSlashes = str_replace('\\', '/', $sFilePath);
|
||||||
$aImages[$sImg] = $sFilePathWithSlashes;
|
$aImages[$sImg] = $sFilePathWithSlashes;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user