mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-16 08:54:12 +01:00
Compare commits
2 Commits
feature/88
...
feature/Co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a82aa3c666 | ||
|
|
2a1fab6eb3 |
@@ -94,15 +94,15 @@ class URP_Profiles extends UserRightsBaseClassGUI
|
||||
$bGrant = $oUserRights->GetProfileActionGrant($this->GetKey(), $sClass, $sAction);
|
||||
if (is_null($bGrant))
|
||||
{
|
||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
}
|
||||
elseif ($bGrant)
|
||||
{
|
||||
return '<span class="ibo-user-rights ibo-is-success">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||
return '<span style="background-color: #ddffdd;">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -250,11 +250,11 @@ class URP_Profiles extends UserRightsBaseClassGUI
|
||||
$iGrant = $oUserRights->GetProfileActionGrant($this->GetKey(), $sClass, $sAction);
|
||||
if (!is_null($iGrant))
|
||||
{
|
||||
return '<span class="ibo-user-rights ibo-is-success">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||
return '<span style="background-color: #ddffdd;">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,11 +82,11 @@ class URP_Profiles extends UserRightsBaseClass
|
||||
$oGrant = $oUserRights->GetClassActionGrant($this->GetKey(), $sClass, $sAction);
|
||||
if (is_object($oGrant) && ($oGrant->Get('permission') == 'yes'))
|
||||
{
|
||||
return '<span class="ibo-user-rights ibo-is-success">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||
return '<span style="background-color: #ddffdd;">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,16 +40,12 @@ class CoreCannotSaveObjectException extends CoreException
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @since 3.2.3 add param $bWithHeader
|
||||
*/
|
||||
public function getHtmlMessage($bWithHeader = false)
|
||||
public function getHtmlMessage()
|
||||
{
|
||||
$sTitle = Dict::S('UI:Error:SaveFailed');
|
||||
$sContent = "<span><strong>".utils::HtmlEntities($sTitle)."</strong></span>";
|
||||
if ($bWithHeader) {
|
||||
$oObject = MetaModel::GetObject($this->sObjectClass, $this->iObjectId, true, true);
|
||||
$sContent .= " <span>".$oObject->Get('friendlyname')."</span>";
|
||||
}
|
||||
|
||||
if (count($this->aIssues) == 1) {
|
||||
$sIssue = reset($this->aIssues);
|
||||
$sContent .= " <span>".utils::HtmlEntities($sIssue)."</span>";
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
*/
|
||||
|
||||
|
||||
use Combodo\iTop\Core\Configuration\ConfigManager;
|
||||
|
||||
define('ITOP_APPLICATION', 'iTop');
|
||||
define('ITOP_APPLICATION_SHORT', 'iTop');
|
||||
|
||||
@@ -2096,76 +2098,21 @@ class Config
|
||||
{
|
||||
$this->CheckFile('configuration', $sConfigFile);
|
||||
|
||||
$sConfigCode = trim(file_get_contents($sConfigFile));
|
||||
|
||||
// Variables created when doing an eval() on the config file
|
||||
/** @var array $MySettings */
|
||||
$MySettings = null;
|
||||
/** @var array $MyModuleSettings */
|
||||
$MyModuleSettings = null;
|
||||
/** @var array $MyModules */
|
||||
$MyModules = null;
|
||||
|
||||
// This does not work on several lines
|
||||
// preg_match('/^<\\?php(.*)\\?'.'>$/', $sConfigCode, $aMatches)...
|
||||
// So, I've implemented a solution suggested in the PHP doc (search for phpWrapper)
|
||||
try
|
||||
{
|
||||
ob_start();
|
||||
eval('?'.'>'.trim($sConfigCode));
|
||||
$sNoise = trim(ob_get_contents());
|
||||
ob_end_clean();
|
||||
}
|
||||
catch (Error $e)
|
||||
{
|
||||
// PHP 7
|
||||
throw new ConfigException('Error in configuration file',
|
||||
array('file' => $sConfigFile, 'error' => $e->getMessage().' at line '.$e->getLine()));
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// well, never reach in case of parsing error :-(
|
||||
// will be improved in PHP 6 ?
|
||||
throw new ConfigException('Error in configuration file',
|
||||
array('file' => $sConfigFile, 'error' => $e->getMessage()));
|
||||
}
|
||||
if (strlen($sNoise) > 0)
|
||||
{
|
||||
// Note: sNoise is an html output, but so far it was ok for me (e.g. showing the entire call stack)
|
||||
throw new ConfigException('Syntax error in configuration file',
|
||||
array('file' => $sConfigFile, 'error' => '<tt>'.utils::EscapeHtml($sNoise, ENT_QUOTES).'</tt>'));
|
||||
}
|
||||
|
||||
if (!isset($MySettings) || !is_array($MySettings))
|
||||
{
|
||||
throw new ConfigException('Missing array in configuration file',
|
||||
array('file' => $sConfigFile, 'expected' => '$MySettings'));
|
||||
}
|
||||
|
||||
if (!array_key_exists('addons', $MyModules))
|
||||
{
|
||||
throw new ConfigException('Missing item in configuration file',
|
||||
array('file' => $sConfigFile, 'expected' => '$MyModules[\'addons\']'));
|
||||
}
|
||||
if (!array_key_exists('user rights', $MyModules['addons']))
|
||||
{
|
||||
// Add one, by default
|
||||
$MyModules['addons']['user rights'] = '/addons/userrights/userrightsnull.class.inc.php';
|
||||
}
|
||||
[$MySettings, $MyModuleSettings, $MyModules] = ConfigManager::GetInstance()->Load($sConfigFile);
|
||||
|
||||
$this->m_aAddons = $MyModules['addons'];
|
||||
|
||||
foreach ($MySettings as $sPropCode => $rawvalue)
|
||||
foreach ($MySettings as $sPropCode => $rawValue)
|
||||
{
|
||||
if ($this->IsProperty($sPropCode))
|
||||
{
|
||||
if (is_string($rawvalue))
|
||||
if (is_string($rawValue))
|
||||
{
|
||||
$value = trim($rawvalue);
|
||||
$value = trim($rawValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $rawvalue;
|
||||
$value = $rawValue;
|
||||
}
|
||||
$this->Set($sPropCode, $value, $sConfigFile, true);
|
||||
}
|
||||
|
||||
@@ -745,6 +745,17 @@ abstract class LogAPI
|
||||
static::Log(self::LEVEL_TRACE, $sMessage, $sChannel, $aContext);
|
||||
}
|
||||
|
||||
public static function Exception(string $sMessage, throwable $previous): void
|
||||
{
|
||||
if (is_null($previous)) {
|
||||
$previous = new Exception('');
|
||||
}
|
||||
|
||||
$aContext['error'] = $previous->getMessage();
|
||||
$aContext['stack'] = $previous->getTraceAsString();
|
||||
static::Error($sMessage, static::CHANNEL_DEFAULT, $aContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \ConfigException if log wrongly configured
|
||||
*/
|
||||
|
||||
@@ -859,15 +859,6 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
|
||||
return $oLinkSet;
|
||||
}
|
||||
|
||||
public function RemoveRemoved()
|
||||
{
|
||||
$this->aRemoved = [];
|
||||
}
|
||||
public function GetRemoved()
|
||||
{
|
||||
return $this->aRemoved ;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetValues.
|
||||
*
|
||||
|
||||
@@ -540,9 +540,9 @@ abstract class User extends cmdbAbstractObject
|
||||
function GetGrantAsHtml($sClass, $iAction)
|
||||
{
|
||||
if (UserRights::IsActionAllowed($sClass, $iAction, null, $this)) {
|
||||
return '<span class="ibo-user-rights ibo-is-success">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||
return '<span style="background-color: #ddffdd;">'.Dict::S('UI:UserManagement:ActionAllowed:Yes').'</span>';
|
||||
} else {
|
||||
return '<span class="ibo-user-rights ibo-is-failure">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
return '<span style="background-color: #ffdddd;">'.Dict::S('UI:UserManagement:ActionAllowed:No').'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,5 +7,4 @@
|
||||
@import "display-block/all";
|
||||
@import "linked-set/all";
|
||||
@import "tabular-fields/all";
|
||||
@import "welcome-popup/all";
|
||||
@import "user-rights";
|
||||
@import "welcome-popup/all";
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
$ibo-user-rights--padding-x: $ibo-spacing-400 !default;
|
||||
$ibo-user-rights--padding-y: $ibo-spacing-200 !default;
|
||||
$ibo-user-rights--border-radius: $ibo-border-radius-400 !default;
|
||||
|
||||
$ibo-user-rights--is-success--background-color: $ibo-color-success-100 !default;
|
||||
$ibo-user-rights--is-success--color: $ibo-color-success-950 !default;
|
||||
$ibo-user-rights--is-success--border-color: $ibo-color-success-500 !default;
|
||||
$ibo-user-rights--is-success--border: 1px solid $ibo-user-rights--is-success--border-color !default;
|
||||
|
||||
$ibo-user-rights--is-failure--background-color: $ibo-color-danger-100 !default;
|
||||
$ibo-user-rights--is-failure--color: $ibo-color-danger-950 !default;
|
||||
$ibo-user-rights--is-failure--border-color: $ibo-color-danger-500 !default;
|
||||
$ibo-user-rights--is-failure--border: 1px solid $ibo-user-rights--is-failure--border-color !default;
|
||||
|
||||
.ibo-user-rights {
|
||||
padding: $ibo-user-rights--padding-y $ibo-user-rights--padding-x;
|
||||
border-radius: $ibo-user-rights--border-radius;
|
||||
&.ibo-is-success {
|
||||
background-color: $ibo-user-rights--is-success--background-color;
|
||||
color: $ibo-user-rights--is-success--color;
|
||||
border: $ibo-user-rights--is-success--border;
|
||||
}
|
||||
&.ibo-is-failure {
|
||||
background-color: $ibo-user-rights--is-failure--background-color;
|
||||
color: $ibo-user-rights--is-failure--color;
|
||||
border: $ibo-user-rights--is-failure--border;
|
||||
}
|
||||
}
|
||||
5
css/backoffice/vendors/_selectize.scss
vendored
5
css/backoffice/vendors/_selectize.scss
vendored
@@ -34,10 +34,6 @@ $ibo-vendors-selectize--dropdown--color: $ibo-vendors-selectize-input--color!de
|
||||
$ibo-vendors-selectize--header--padding-x: 8px !default;
|
||||
$ibo-vendors-selectize--header--padding-y: 5px !default;
|
||||
|
||||
.selectize-dropdown, .selectize-input, .selectize-input input {
|
||||
color: $ibo-vendors-selectize-input--color;
|
||||
}
|
||||
|
||||
.selectize-control.single .selectize-input {
|
||||
box-shadow: unset;
|
||||
background-color: $ibo-vendors-selectize-input--background-color;
|
||||
@@ -70,7 +66,6 @@ $ibo-vendors-selectize--header--padding-y: 5px !default;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
|
||||
.selectize-control.single .selectize-input, .selectize-dropdown.single {
|
||||
border-color: $ibo-vendors-selectize--input--border-color;
|
||||
}
|
||||
|
||||
0
data/.compilation-symlinks
Normal file
0
data/.compilation-symlinks
Normal file
@@ -1,50 +1,50 @@
|
||||
$ibo-color-grey-950: darken($nord0, 15%) !default;
|
||||
$ibo-color-grey-900: darken($nord0, 10%) !default;
|
||||
$ibo-color-grey-850: darken($nord0, 5%) !default;
|
||||
$ibo-color-grey-800: $nord0 !default;
|
||||
$ibo-color-grey-700: $nord1 !default;
|
||||
$ibo-color-grey-600: $nord2 !default;
|
||||
$ibo-color-grey-500: $nord3 !default;
|
||||
$ibo-color-grey-400: lighten($ibo-color-grey-500, 10%) !default;
|
||||
$ibo-color-grey-300: lighten($ibo-color-grey-400, 10%) !default;
|
||||
$ibo-color-grey-250: lighten($ibo-color-grey-300, 15%) !default;
|
||||
$ibo-color-grey-200: $nord4 !default;
|
||||
$ibo-color-grey-100: $nord5 !default;
|
||||
$ibo-color-grey-50: $nord6 !default;
|
||||
$ibo-color-grey-950: darken($nord0, 15%);
|
||||
$ibo-color-grey-900: darken($nord0, 10%);
|
||||
$ibo-color-grey-850: darken($nord0, 5%);
|
||||
$ibo-color-grey-800: $nord0 ;
|
||||
$ibo-color-grey-700: $nord1;
|
||||
$ibo-color-grey-600: $nord2;
|
||||
$ibo-color-grey-500: $nord3;
|
||||
$ibo-color-grey-400: lighten($ibo-color-grey-500, 10%);
|
||||
$ibo-color-grey-300: lighten($ibo-color-grey-400, 10%);
|
||||
$ibo-color-grey-250: lighten($ibo-color-grey-300, 15%);
|
||||
$ibo-color-grey-200: $nord4;
|
||||
$ibo-color-grey-100: $nord5;
|
||||
$ibo-color-grey-50: $nord6;
|
||||
|
||||
$ibo-color-red-100: lighten($nord11, 40%) !default;
|
||||
$ibo-color-red-200: lighten($nord11, 35%) !default;
|
||||
$ibo-color-red-300: lighten($nord11, 22%) !default;
|
||||
$ibo-color-red-400: lighten($nord11, 15%) !default;
|
||||
$ibo-color-red-500: lighten($nord11, 7%) !default;
|
||||
$ibo-color-red-600: $nord11 !default;
|
||||
$ibo-color-red-700: darken($nord11, 7%) !default;
|
||||
$ibo-color-red-800: darken($nord11, 15%) !default;
|
||||
$ibo-color-red-900: darken($nord11, 22%) !default;
|
||||
$ibo-color-red-100: lighten($nord11, 40%);
|
||||
$ibo-color-red-200: lighten($nord11, 35%);
|
||||
$ibo-color-red-300: lighten($nord11, 22%);
|
||||
$ibo-color-red-400: lighten($nord11, 15%);
|
||||
$ibo-color-red-500: lighten($nord11, 7%);
|
||||
$ibo-color-red-600: $nord11;
|
||||
$ibo-color-red-700: darken($nord11, 7%);
|
||||
$ibo-color-red-800: darken($nord11, 15%);
|
||||
$ibo-color-red-900: darken($nord11, 22%);
|
||||
|
||||
$ibo-color-primary-100: lighten($nord8, 15%) !default;
|
||||
$ibo-color-primary-200: darken($ibo-color-primary-100, 7%) !default;
|
||||
$ibo-color-primary-300: $nord8 !default;
|
||||
$ibo-color-primary-400: darken($ibo-color-primary-300, 7%) !default;
|
||||
$ibo-color-primary-500: $nord9 !default;
|
||||
$ibo-color-primary-600: darken($ibo-color-primary-500, 7%) !default;
|
||||
$ibo-color-primary-700: lighten($nord10, 7%) !default;
|
||||
$ibo-color-primary-800: $nord10 !default;
|
||||
$ibo-color-primary-900: darken($ibo-color-primary-800, 20%) !default;
|
||||
$ibo-color-primary-950: darken($ibo-color-primary-900, 10%) !default;
|
||||
$ibo-color-primary-100: lighten($nord8, 15%);
|
||||
$ibo-color-primary-200: darken($ibo-color-primary-100, 7%);
|
||||
$ibo-color-primary-300: $nord8;
|
||||
$ibo-color-primary-400: darken($ibo-color-primary-300, 7%);
|
||||
$ibo-color-primary-500: $nord9;
|
||||
$ibo-color-primary-600: darken($ibo-color-primary-500, 7%);
|
||||
$ibo-color-primary-700: lighten($nord10, 7%);
|
||||
$ibo-color-primary-800: $nord10;
|
||||
$ibo-color-primary-900: darken($ibo-color-primary-800, 20%);
|
||||
$ibo-color-primary-950: darken($ibo-color-primary-900, 10%);
|
||||
|
||||
/* - Secondary color of the brand */
|
||||
$ibo-color-secondary-100: $ibo-color-grey-100 !default;
|
||||
$ibo-color-secondary-200: $ibo-color-grey-200 !default;
|
||||
$ibo-color-secondary-300: $ibo-color-grey-300 !default;
|
||||
$ibo-color-secondary-400: $ibo-color-grey-400 !default;
|
||||
$ibo-color-secondary-500: $ibo-color-grey-500 !default;
|
||||
$ibo-color-secondary-600: $ibo-color-grey-600 !default;
|
||||
$ibo-color-secondary-700: $ibo-color-grey-700 !default;
|
||||
$ibo-color-secondary-800: $ibo-color-grey-800 !default;
|
||||
$ibo-color-secondary-850: $ibo-color-grey-850 !default;
|
||||
$ibo-color-secondary-900: $ibo-color-grey-900 !default;
|
||||
$ibo-color-secondary-950: $ibo-color-grey-950 !default;
|
||||
$ibo-color-secondary-100: $ibo-color-grey-100;
|
||||
$ibo-color-secondary-200: $ibo-color-grey-200;
|
||||
$ibo-color-secondary-300: $ibo-color-grey-300;
|
||||
$ibo-color-secondary-400: $ibo-color-grey-400;
|
||||
$ibo-color-secondary-500: $ibo-color-grey-500;
|
||||
$ibo-color-secondary-600: $ibo-color-grey-600;
|
||||
$ibo-color-secondary-700: $ibo-color-grey-700;
|
||||
$ibo-color-secondary-800: $ibo-color-grey-800;
|
||||
$ibo-color-secondary-850: $ibo-color-grey-850;
|
||||
$ibo-color-secondary-900: $ibo-color-grey-900;
|
||||
$ibo-color-secondary-950: $ibo-color-grey-950;
|
||||
|
||||
$text : $ibo-color-grey-100;
|
||||
$text-invert: $ibo-color-grey-800;
|
||||
@@ -89,7 +89,7 @@ $ibo-field--fullscreen-toggler--background-color--on-hover: $ibo-color-grey-500;
|
||||
|
||||
$ibo-input-wrapper--is-error--background-color: $ibo-color-red-800;
|
||||
$ibo-input-wrapper--is-error--border-color: $ibo-color-red-700;
|
||||
$ibo-field-validation: $ibo-color-red-300;
|
||||
$ibo-field-validation: $ibo-color-red-200;
|
||||
$ibo-field--background-color--is-fullscreen: $ibo-color-grey-700;
|
||||
$ibo-field--label--background-color--is-fullscreen: $ibo-color-grey-800;
|
||||
|
||||
@@ -175,13 +175,11 @@ $ibo-input-select-wrapper--after--color: $ibo-color-secondary-300;
|
||||
$ibo-input-select--action-button--color: $ibo-input-select-wrapper--after--color;
|
||||
$ibo-input-select-selectize--item--active--text-color: $ibo-color-grey-100;
|
||||
$ibo-input-select-selectize--item--active--background-color: $ibo-color-grey-500;
|
||||
$ibo-input-select--autocomplete-item-image--background-color: $ibo-color-grey-800;
|
||||
$ibo-vendors-selectize-input--color: $ibo-body-text-color;
|
||||
$ibo-vendors-selectize-input--background-color: $ibo-input--background-color;
|
||||
$ibo-vendors-selectize--input--border-color: $ibo-input--border-color;
|
||||
$ibo-vendors-selectize--element--active--background: $ibo-color-grey-400;
|
||||
$ibo-vendors-selectize--element--active--color: $ibo-body-text-color;
|
||||
$ibo-vendors-selectize-control--plugin-add-button--add-option--color: $ibo-input-select--action-button--color;
|
||||
|
||||
$ibo-popover-menu--item-separator--background-color: $ibo-color-grey-500;
|
||||
$ibo-popover-menu--item--text-color: $ibo-color-grey-200;
|
||||
@@ -289,12 +287,4 @@ $ibo-welcome-popup--stack-item--background-color: $ibo-color-grey-600;
|
||||
$ibo-welcome-popup--stack-item--border-color: $ibo-color-grey-800;
|
||||
$ibo-welcome-popup--stack-item--is-active--border-color: $ibo-color-grey-900;
|
||||
|
||||
$ibo-vendors-ckeditor--ck-content--text-color: $ibo-color-grey-900;
|
||||
|
||||
$ibo-user-rights--is-success--background-color: $ibo-color-success-950 !default;
|
||||
$ibo-user-rights--is-success--color: $ibo-color-success-100 !default;
|
||||
$ibo-user-rights--is-success--border-color: $ibo-color-success-950 !default;
|
||||
|
||||
$ibo-user-rights--is-failure--background-color: $ibo-color-danger-950 !default;
|
||||
$ibo-user-rights--is-failure--color: $ibo-color-danger-100 !default;
|
||||
$ibo-user-rights--is-failure--border-color: $ibo-color-danger-950 !default;
|
||||
$ibo-vendors-ckeditor--ck-content--text-color: $ibo-color-grey-900;
|
||||
@@ -1,8 +1,3 @@
|
||||
$ibo-color-success-50: common-adjust-lightness($ibo-color-success-100, $ibo-color-base-lightness-100) !default;
|
||||
$ibo-color-danger-50: common-adjust-lightness($ibo-color-success-100, $ibo-color-danger-100) !default;
|
||||
$ibo-color-information-50: common-adjust-lightness($ibo-color-success-100, $ibo-color-information-100) !default;
|
||||
$ibo-color-warning-50: common-adjust-lightness($ibo-color-success-100, $ibo-color-warning-100) !default;
|
||||
|
||||
$ibo-navigation-menu--menu-group-title--text-color--is-active: $ibo-color-blue-grey-900;
|
||||
$ibo-navigation-menu--menu-group--background-color--is-active: $ibo-color-white-100;
|
||||
$ibo-navigation-menu--menu-node--background-color: $ibo-color-grey-100;
|
||||
@@ -69,12 +64,4 @@ $ibo-button-colors: ( 'regular': ( /* Semantics */
|
||||
$ibo-panel-colors: ('primary': $ibo-color-primary-800,'secondary': $ibo-color-secondary-800,'neutral': $ibo-color-grey-800,'information': $ibo-color-information-800,'success': $ibo-color-success-800,'failure': $ibo-color-danger-800,'warning': $ibo-color-warning-800,'danger': $ibo-color-danger-800,'grey' : $ibo-color-grey-800,'blue-grey': $ibo-color-blue-grey-800,'blue': $ibo-color-blue-800,'cyan': $ibo-color-cyan-800,'green': $ibo-color-green-800,'orange' : $ibo-color-orange-800,'red': $ibo-color-red-800,'pink': $ibo-color-pink-800,);
|
||||
|
||||
$ibo-welcome-popup--stack-item--border-color: $ibo-color-grey-950;
|
||||
$ibo-welcome-popup--stack-item--is-active--border-color: $ibo-color-grey-900;
|
||||
|
||||
$ibo-user-rights--is-success--background-color: $ibo-color-success-50 !default;
|
||||
$ibo-user-rights--is-success--color: $ibo-color-success-950 !default;
|
||||
$ibo-user-rights--is-success--border-color: $ibo-color-success-950 !default;
|
||||
|
||||
$ibo-user-rights--is-failure--background-color: $ibo-color-danger-100 !default;
|
||||
$ibo-user-rights--is-failure--color: $ibo-color-danger-950 !default;
|
||||
$ibo-user-rights--is-failure--border-color: $ibo-color-danger-950 !default;
|
||||
$ibo-welcome-popup--stack-item--is-active--border-color: $ibo-color-grey-900;
|
||||
@@ -18,10 +18,6 @@ $ibo-toast--icon--font-size: 2rem !default;
|
||||
$ibo-toast--icon--top: calc(50% - #{$ibo-toast--icon--font-size} / 2) !default;
|
||||
$ibo-toast--icon--left: $ibo-spacing-400 !default;
|
||||
|
||||
$ibo-user-rights--icon--margin-right: $ibo-spacing-200 !default;
|
||||
$ibo-user-rights--is-success--icon: '\f00c' !default;
|
||||
$ibo-user-rights--is-failure--icon: '\f00d' !default;
|
||||
|
||||
|
||||
@each $sName, $sIcon in $ibo-alert--icons {
|
||||
%ibo-alert-#{$sName}, .ibo-alert.ibo-is-#{$sName} {
|
||||
@@ -150,17 +146,4 @@ $ibo-user-rights--is-failure--icon: '\f00d' !default;
|
||||
|
||||
.ibo-welcome-popup--stack-item.ibo-is-active {
|
||||
border-width: 2px;
|
||||
}
|
||||
|
||||
.ibo-user-rights {
|
||||
&.ibo-is-success::before {
|
||||
content: $ibo-user-rights--is-success--icon;
|
||||
@extend %fa-solid-base;
|
||||
margin-right: $ibo-user-rights--icon--margin-right;
|
||||
}
|
||||
&.ibo-is-failure::before {
|
||||
content: $ibo-user-rights--is-failure--icon;
|
||||
@extend %fa-solid-base;
|
||||
margin-right: $ibo-user-rights--icon--margin-right;
|
||||
}
|
||||
}
|
||||
@@ -1,71 +1,71 @@
|
||||
$ibo-color-primary-100: $ibo-color-blue-100 !default;
|
||||
$ibo-color-primary-200: $ibo-color-blue-200 !default;
|
||||
$ibo-color-primary-300: $ibo-color-blue-300 !default;
|
||||
$ibo-color-primary-400: $ibo-color-blue-400 !default;
|
||||
$ibo-color-primary-500: $ibo-color-blue-500 !default;
|
||||
$ibo-color-primary-600: $ibo-color-blue-600 !default;
|
||||
$ibo-color-primary-700: $ibo-color-blue-700 !default;
|
||||
$ibo-color-primary-800: $ibo-color-blue-800 !default;
|
||||
$ibo-color-primary-900: $ibo-color-blue-900 !default;
|
||||
$ibo-color-primary-950: $ibo-color-blue-950 !default;
|
||||
$ibo-color-primary-100: $ibo-color-blue-100;
|
||||
$ibo-color-primary-200: $ibo-color-blue-200;
|
||||
$ibo-color-primary-300: $ibo-color-blue-300;
|
||||
$ibo-color-primary-400: $ibo-color-blue-400;
|
||||
$ibo-color-primary-500: $ibo-color-blue-500;
|
||||
$ibo-color-primary-600: $ibo-color-blue-600;
|
||||
$ibo-color-primary-700: $ibo-color-blue-700;
|
||||
$ibo-color-primary-800: $ibo-color-blue-800;
|
||||
$ibo-color-primary-900: $ibo-color-blue-900;
|
||||
$ibo-color-primary-950: $ibo-color-blue-950;
|
||||
|
||||
|
||||
$ibo-color-danger-100: $ibo-color-orange-100 !default;
|
||||
$ibo-color-danger-200: $ibo-color-orange-200 !default;
|
||||
$ibo-color-danger-300: $ibo-color-orange-300 !default;
|
||||
$ibo-color-danger-400: $ibo-color-orange-400 !default;
|
||||
$ibo-color-danger-500: $ibo-color-orange-500 !default;
|
||||
$ibo-color-danger-600: $ibo-color-orange-600 !default;
|
||||
$ibo-color-danger-700: $ibo-color-orange-700 !default;
|
||||
$ibo-color-danger-800: $ibo-color-orange-800 !default;
|
||||
$ibo-color-danger-900: $ibo-color-orange-900 !default;
|
||||
$ibo-color-danger-950: $ibo-color-orange-950 !default;
|
||||
$ibo-color-danger-100: $ibo-color-orange-100;
|
||||
$ibo-color-danger-200: $ibo-color-orange-200;
|
||||
$ibo-color-danger-300: $ibo-color-orange-300;
|
||||
$ibo-color-danger-400: $ibo-color-orange-400;
|
||||
$ibo-color-danger-500: $ibo-color-orange-500;
|
||||
$ibo-color-danger-600: $ibo-color-orange-600;
|
||||
$ibo-color-danger-700: $ibo-color-orange-700;
|
||||
$ibo-color-danger-800: $ibo-color-orange-800;
|
||||
$ibo-color-danger-900: $ibo-color-orange-900;
|
||||
$ibo-color-danger-950: $ibo-color-orange-950;
|
||||
|
||||
|
||||
$ibo-color-yellow-100: #fefce8 !default;
|
||||
$ibo-color-yellow-200: #fef9c3 !default;
|
||||
$ibo-color-yellow-300: #fef08a !default;
|
||||
$ibo-color-yellow-400: #fde047 !default;
|
||||
$ibo-color-yellow-500: #facc15 !default;
|
||||
$ibo-color-yellow-600: #eab308 !default;
|
||||
$ibo-color-yellow-700: #ca8a04 !default;
|
||||
$ibo-color-yellow-800: #a16207 !default;
|
||||
$ibo-color-yellow-900: #854d0e !default;
|
||||
$ibo-color-yellow-950: #713f12 !default;
|
||||
$ibo-color-yellow-100: #fefce8;
|
||||
$ibo-color-yellow-200: #fef9c3;
|
||||
$ibo-color-yellow-300: #fef08a;
|
||||
$ibo-color-yellow-400: #fde047;
|
||||
$ibo-color-yellow-500: #facc15;
|
||||
$ibo-color-yellow-600: #eab308;
|
||||
$ibo-color-yellow-700: #ca8a04;
|
||||
$ibo-color-yellow-800: #a16207;
|
||||
$ibo-color-yellow-900: #854d0e;
|
||||
$ibo-color-yellow-950: #713f12;
|
||||
|
||||
$ibo-color-warning-100: $ibo-color-yellow-100 !default;
|
||||
$ibo-color-warning-200: $ibo-color-yellow-200 !default;
|
||||
$ibo-color-warning-300: $ibo-color-yellow-300 !default;
|
||||
$ibo-color-warning-400: $ibo-color-yellow-400 !default;
|
||||
$ibo-color-warning-500: $ibo-color-yellow-500 !default;
|
||||
$ibo-color-warning-600: $ibo-color-yellow-600 !default;
|
||||
$ibo-color-warning-700: $ibo-color-yellow-700 !default;
|
||||
$ibo-color-warning-800: $ibo-color-yellow-800 !default;
|
||||
$ibo-color-warning-900: $ibo-color-yellow-900 !default;
|
||||
$ibo-color-warning-950: $ibo-color-yellow-950 !default;
|
||||
$ibo-color-warning-100: $ibo-color-yellow-100;
|
||||
$ibo-color-warning-200: $ibo-color-yellow-200;
|
||||
$ibo-color-warning-300: $ibo-color-yellow-300;
|
||||
$ibo-color-warning-400: $ibo-color-yellow-400;
|
||||
$ibo-color-warning-500: $ibo-color-yellow-500;
|
||||
$ibo-color-warning-600: $ibo-color-yellow-600;
|
||||
$ibo-color-warning-700: $ibo-color-yellow-700;
|
||||
$ibo-color-warning-800: $ibo-color-yellow-800;
|
||||
$ibo-color-warning-900: $ibo-color-yellow-900;
|
||||
$ibo-color-warning-950: $ibo-color-yellow-950;
|
||||
|
||||
|
||||
$ibo-color-success-100: $ibo-color-blue-100 !default;
|
||||
$ibo-color-success-200: $ibo-color-blue-200 !default;
|
||||
$ibo-color-success-300: $ibo-color-blue-300 !default;
|
||||
$ibo-color-success-400: $ibo-color-blue-400 !default;
|
||||
$ibo-color-success-500: $ibo-color-blue-500 !default;
|
||||
$ibo-color-success-600: $ibo-color-blue-600 !default;
|
||||
$ibo-color-success-700: $ibo-color-blue-700 !default;
|
||||
$ibo-color-success-800: $ibo-color-blue-800 !default;
|
||||
$ibo-color-success-900: $ibo-color-blue-900 !default;
|
||||
$ibo-color-success-950: $ibo-color-blue-950 !default;
|
||||
$ibo-color-success-100: $ibo-color-blue-100;
|
||||
$ibo-color-success-200: $ibo-color-blue-200;
|
||||
$ibo-color-success-300: $ibo-color-blue-300;
|
||||
$ibo-color-success-400: $ibo-color-blue-400;
|
||||
$ibo-color-success-500: $ibo-color-blue-500;
|
||||
$ibo-color-success-600: $ibo-color-blue-600;
|
||||
$ibo-color-success-700: $ibo-color-blue-700;
|
||||
$ibo-color-success-800: $ibo-color-blue-800;
|
||||
$ibo-color-success-900: $ibo-color-blue-900;
|
||||
$ibo-color-success-950: $ibo-color-blue-950;
|
||||
|
||||
$ibo-color-information-100: #f1f5f9 !default;
|
||||
$ibo-color-information-200: #e2e8f0 !default;
|
||||
$ibo-color-information-300: #cbd5e1 !default;
|
||||
$ibo-color-information-400: #94a3b8 !default;
|
||||
$ibo-color-information-500: #64748b !default;
|
||||
$ibo-color-information-600: #475569 !default;
|
||||
$ibo-color-information-700: #334155 !default;
|
||||
$ibo-color-information-800: #1e293b !default;
|
||||
$ibo-color-information-900: #0f172a !default;
|
||||
$ibo-color-information-950: #020617 !default;
|
||||
$ibo-color-information-100: #f1f5f9;
|
||||
$ibo-color-information-200: #e2e8f0;
|
||||
$ibo-color-information-300: #cbd5e1;
|
||||
$ibo-color-information-400: #94a3b8;
|
||||
$ibo-color-information-500: #64748b;
|
||||
$ibo-color-information-600: #475569;
|
||||
$ibo-color-information-700: #334155;
|
||||
$ibo-color-information-800: #1e293b;
|
||||
$ibo-color-information-900: #0f172a;
|
||||
$ibo-color-information-950: #020617;
|
||||
|
||||
|
||||
$ibo-lifecycle-new-state-primary-color: $ibo-color-information-600;
|
||||
|
||||
@@ -15,10 +15,6 @@ $ibo-toast--icon--font-size: 2rem !default;
|
||||
$ibo-toast--icon--top: calc(50% - #{$ibo-toast--icon--font-size} / 2) !default;
|
||||
$ibo-toast--icon--left: $ibo-spacing-400 !default;
|
||||
|
||||
$ibo-user-rights--icon--margin-right: $ibo-spacing-200 !default;
|
||||
$ibo-user-rights--is-success--icon: '\f00c' !default;
|
||||
$ibo-user-rights--is-failure--icon: '\f00d' !default;
|
||||
|
||||
|
||||
@each $sName, $sIcon in $ibo-alert--icons {
|
||||
%ibo-alert-#{$sName}, .ibo-alert.ibo-is-#{$sName} {
|
||||
@@ -75,16 +71,3 @@ $ibo-user-rights--is-failure--icon: '\f00d' !default;
|
||||
}
|
||||
}
|
||||
|
||||
.ibo-user-rights {
|
||||
&.ibo-is-success::before {
|
||||
content: $ibo-user-rights--is-success--icon;
|
||||
@extend %fa-solid-base;
|
||||
margin-right: $ibo-user-rights--icon--margin-right;
|
||||
}
|
||||
&.ibo-is-failure::before {
|
||||
content: $ibo-user-rights--is-failure--icon;
|
||||
@extend %fa-solid-base;
|
||||
margin-right: $ibo-user-rights--icon--margin-right;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
$ibo-color-yellow-100: #fefce8 !default;
|
||||
$ibo-color-yellow-200: #fef9c3 !default;
|
||||
$ibo-color-yellow-300: #fef08a !default;
|
||||
$ibo-color-yellow-400: #fde047 !default;
|
||||
$ibo-color-yellow-500: #facc15 !default;
|
||||
$ibo-color-yellow-600: #eab308 !default;
|
||||
$ibo-color-yellow-700: #ca8a04 !default;
|
||||
$ibo-color-yellow-800: #a16207 !default;
|
||||
$ibo-color-yellow-900: #854d0e !default;
|
||||
$ibo-color-yellow-950: #713f12 !default;
|
||||
$ibo-color-yellow-100: #fefce8;
|
||||
$ibo-color-yellow-200: #fef9c3;
|
||||
$ibo-color-yellow-300: #fef08a;
|
||||
$ibo-color-yellow-400: #fde047;
|
||||
$ibo-color-yellow-500: #facc15;
|
||||
$ibo-color-yellow-600: #eab308;
|
||||
$ibo-color-yellow-700: #ca8a04;
|
||||
$ibo-color-yellow-800: #a16207;
|
||||
$ibo-color-yellow-900: #854d0e;
|
||||
$ibo-color-yellow-950: #713f12;
|
||||
|
||||
$ibo-color-success-100: $ibo-color-blue-100 !default;
|
||||
$ibo-color-success-200: $ibo-color-blue-200 !default;
|
||||
$ibo-color-success-300: $ibo-color-blue-300 !default;
|
||||
$ibo-color-success-400: $ibo-color-blue-400 !default;
|
||||
$ibo-color-success-500: $ibo-color-blue-500 !default;
|
||||
$ibo-color-success-600: $ibo-color-blue-600 !default;
|
||||
$ibo-color-success-700: $ibo-color-blue-700 !default;
|
||||
$ibo-color-success-800: $ibo-color-blue-800 !default;
|
||||
$ibo-color-success-900: $ibo-color-blue-900 !default;
|
||||
$ibo-color-success-950: $ibo-color-blue-950 !default;
|
||||
$ibo-color-success-100: $ibo-color-blue-100;
|
||||
$ibo-color-success-200: $ibo-color-blue-200;
|
||||
$ibo-color-success-300: $ibo-color-blue-300;
|
||||
$ibo-color-success-400: $ibo-color-blue-400;
|
||||
$ibo-color-success-500: $ibo-color-blue-500;
|
||||
$ibo-color-success-600: $ibo-color-blue-600;
|
||||
$ibo-color-success-700: $ibo-color-blue-700;
|
||||
$ibo-color-success-800: $ibo-color-blue-800;
|
||||
$ibo-color-success-900: $ibo-color-blue-900;
|
||||
$ibo-color-success-950: $ibo-color-blue-950;
|
||||
|
||||
$ibo-color-information-100: #f1f5f9 !default;
|
||||
$ibo-color-information-200: #e2e8f0 !default;
|
||||
$ibo-color-information-300: #cbd5e1 !default;
|
||||
$ibo-color-information-400: #94a3b8 !default;
|
||||
$ibo-color-information-500: #64748b !default;
|
||||
$ibo-color-information-600: #475569 !default;
|
||||
$ibo-color-information-700: #334155 !default;
|
||||
$ibo-color-information-800: #1e293b !default;
|
||||
$ibo-color-information-900: #0f172a !default;
|
||||
$ibo-color-information-950: #020617 !default;
|
||||
$ibo-color-information-100: #f1f5f9;
|
||||
$ibo-color-information-200: #e2e8f0;
|
||||
$ibo-color-information-300: #cbd5e1;
|
||||
$ibo-color-information-400: #94a3b8;
|
||||
$ibo-color-information-500: #64748b;
|
||||
$ibo-color-information-600: #475569;
|
||||
$ibo-color-information-700: #334155;
|
||||
$ibo-color-information-800: #1e293b;
|
||||
$ibo-color-information-900: #0f172a;
|
||||
$ibo-color-information-950: #020617;
|
||||
|
||||
|
||||
$ibo-lifecycle-new-state-primary-color: $ibo-color-information-600;
|
||||
|
||||
@@ -15,10 +15,6 @@ $ibo-toast--icon--font-size: 2rem !default;
|
||||
$ibo-toast--icon--top: calc(50% - #{$ibo-toast--icon--font-size} / 2) !default;
|
||||
$ibo-toast--icon--left: $ibo-spacing-400 !default;
|
||||
|
||||
$ibo-user-rights--icon--margin-right: $ibo-spacing-200 !default;
|
||||
$ibo-user-rights--is-success--icon: '\f00c' !default;
|
||||
$ibo-user-rights--is-failure--icon: '\f00d' !default;
|
||||
|
||||
|
||||
@each $sName, $sIcon in $ibo-alert--icons {
|
||||
%ibo-alert-#{$sName}, .ibo-alert.ibo-is-#{$sName} {
|
||||
@@ -75,15 +71,3 @@ $ibo-user-rights--is-failure--icon: '\f00d' !default;
|
||||
}
|
||||
}
|
||||
|
||||
.ibo-user-rights {
|
||||
&.ibo-is-success::before {
|
||||
content: $ibo-user-rights--is-success--icon;
|
||||
@extend %fa-solid-base;
|
||||
margin-right: $ibo-user-rights--icon--margin-right;
|
||||
}
|
||||
&.ibo-is-failure::before {
|
||||
content: $ibo-user-rights--is-failure--icon;
|
||||
@extend %fa-solid-base;
|
||||
margin-right: $ibo-user-rights--icon--margin-right;
|
||||
}
|
||||
}
|
||||
@@ -968,7 +968,6 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'UI:SystemIntrusion' => 'Access denied. You have requested an operation that is not allowed for you.',
|
||||
'UI:FatalErrorMessage' => 'Fatal error, '.ITOP_APPLICATION_SHORT.' cannot continue.',
|
||||
'UI:Error_Details' => 'Error: %1$s.',
|
||||
'UI:LinkedSet:RemovedObjectsDuringRefresh' => 'Warning: removed object(s) in <b>%1$s</b> are there again : <br>%2$s',
|
||||
|
||||
'UI:PageTitle:ProfileProjections' => ITOP_APPLICATION_SHORT.' user management - profile projections',
|
||||
'UI:UserManagement:Class' => 'Class',
|
||||
|
||||
@@ -414,6 +414,7 @@ return array(
|
||||
'Combodo\\iTop\\Core\\Authentication\\Client\\OAuth\\OAuthClientProviderFactory' => $baseDir . '/sources/Core/Authentication/Client/OAuth/OAuthClientProviderFactory.php',
|
||||
'Combodo\\iTop\\Core\\Authentication\\Client\\OAuth\\OAuthClientProviderGoogle' => $baseDir . '/sources/Core/Authentication/Client/OAuth/OAuthClientProviderGoogle.php',
|
||||
'Combodo\\iTop\\Core\\CMDBChange\\CMDBChangeOrigin' => $baseDir . '/sources/Core/CMDBChange/CMDBChangeOrigin.php',
|
||||
'Combodo\\iTop\\Core\\Configuration\\ConfigManager' => $baseDir . '/sources/Core/Configuration/ConfigManager.php',
|
||||
'Combodo\\iTop\\Core\\DbConnectionWrapper' => $baseDir . '/core/DbConnectionWrapper.php',
|
||||
'Combodo\\iTop\\Core\\Email\\EMailSymfony' => $baseDir . '/sources/Core/Email/EmailSymfony.php',
|
||||
'Combodo\\iTop\\Core\\Email\\EmailFactory' => $baseDir . '/sources/Core/Email/EmailFactory.php',
|
||||
|
||||
@@ -779,6 +779,7 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||
'Combodo\\iTop\\Core\\Authentication\\Client\\OAuth\\OAuthClientProviderFactory' => __DIR__ . '/../..' . '/sources/Core/Authentication/Client/OAuth/OAuthClientProviderFactory.php',
|
||||
'Combodo\\iTop\\Core\\Authentication\\Client\\OAuth\\OAuthClientProviderGoogle' => __DIR__ . '/../..' . '/sources/Core/Authentication/Client/OAuth/OAuthClientProviderGoogle.php',
|
||||
'Combodo\\iTop\\Core\\CMDBChange\\CMDBChangeOrigin' => __DIR__ . '/../..' . '/sources/Core/CMDBChange/CMDBChangeOrigin.php',
|
||||
'Combodo\\iTop\\Core\\Configuration\\ConfigManager' => __DIR__ . '/../..' . '/sources/Core/Configuration/ConfigManager.php',
|
||||
'Combodo\\iTop\\Core\\DbConnectionWrapper' => __DIR__ . '/../..' . '/core/DbConnectionWrapper.php',
|
||||
'Combodo\\iTop\\Core\\Email\\EMailSymfony' => __DIR__ . '/../..' . '/sources/Core/Email/EmailSymfony.php',
|
||||
'Combodo\\iTop\\Core\\Email\\EmailFactory' => __DIR__ . '/../..' . '/sources/Core/Email/EmailFactory.php',
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
namespace Combodo\iTop\Controller\Base\Layout;
|
||||
|
||||
use AttributeLinkedSet;
|
||||
use Combodo\iTop\Application\WebPage\AjaxPage;
|
||||
use ApplicationContext;
|
||||
use ApplicationException;
|
||||
@@ -662,35 +661,13 @@ JS;
|
||||
// Found issues, explain and give the user a second chance
|
||||
//
|
||||
$bDisplayDetails = false;
|
||||
$aIssues = $e->getIssues();
|
||||
if ($this->IsHandlingXmlHttpRequest()) {
|
||||
$aResult['data'] = ['error_message' => $e->getHtmlMessage()];
|
||||
} else {
|
||||
//8807 - displayModifyForm fail if a linkset is removed -> remove removed linkset and display a specific message
|
||||
$bWithLinkedSetRemoved = false;
|
||||
foreach ($oObj->ListChanges() as $sAttCode => $aChange) {
|
||||
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||
if ($oAttDef instanceof AttributeLinkedSet) {
|
||||
$aRemoved = $aChange->GetRemoved();
|
||||
if (count($aRemoved) > 0) {
|
||||
$bWithLinkedSetRemoved = true;
|
||||
$sLinkedClass = $oAttDef->GetLinkedClass();
|
||||
$aRemovedObjectFriendlyName = [];
|
||||
foreach ($aRemoved as $key=>$value) {
|
||||
$oLinkedObject = MetaModel::GetObject($sLinkedClass, $key, true, true);
|
||||
$aRemovedObjectFriendlyName[] = $oLinkedObject->Get('friendlyname');
|
||||
}
|
||||
$aChange->RemoveRemoved();
|
||||
$sRemovedMessage = Dict::Format('UI:LinkedSet:RemovedObjectsDuringRefresh', $oAttDef->GetLabel(), implode('<br> ', $aRemovedObjectFriendlyName));
|
||||
$oPage->AddHeaderMessage($sRemovedMessage, 'message_info');
|
||||
}
|
||||
}
|
||||
}
|
||||
if($bWithLinkedSetRemoved) {
|
||||
$oPage->AddHeaderMessage($e->getHtmlMessage(true), 'message_error');
|
||||
} else {
|
||||
$oPage->AddHeaderMessage($e->getHtmlMessage(), 'message_error');
|
||||
}
|
||||
$oObj->DisplayModifyForm($oPage, array('wizard_container' => true)); // wizard_container: display the wizard border and the title
|
||||
$oPage->AddHeaderMessage($e->getHtmlMessage(), 'message_error');
|
||||
$oObj->DisplayModifyForm($oPage,
|
||||
array('wizard_container' => true)); // wizard_container: display the wizard border and the title
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
167
sources/Core/Configuration/ConfigManager.php
Normal file
167
sources/Core/Configuration/ConfigManager.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Core\Configuration;
|
||||
|
||||
use ConfigException;
|
||||
use Error;
|
||||
use Exception;
|
||||
use IssueLog;
|
||||
use SetupUtils;
|
||||
use utils;
|
||||
|
||||
class ConfigManager
|
||||
{
|
||||
private static ConfigManager $oInstance;
|
||||
private ?array $aMySettings = null;
|
||||
private ?array $aMyModuleSettings = null;
|
||||
private ?array $aMyModules = null;
|
||||
|
||||
protected function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
final public static function GetInstance(): ConfigManager
|
||||
{
|
||||
if (!isset(static::$oInstance)) {
|
||||
static::$oInstance = new ConfigManager();
|
||||
}
|
||||
|
||||
return static::$oInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load iTop configuration from regular php file and json files
|
||||
* @param string $sConfigFile
|
||||
*
|
||||
* @return array returns [$MySettings, $MyModuleSettings, $MyModules]
|
||||
* @throws \ConfigException
|
||||
*/
|
||||
public function Load(string $sConfigFile): array
|
||||
{
|
||||
$sConfigCode = trim(file_get_contents($sConfigFile));
|
||||
|
||||
if (!is_null($this->aMySettings)) {
|
||||
return [$this->aMySettings, $this->aMyModuleSettings, $this->aMyModules];
|
||||
}
|
||||
|
||||
// Variables created when doing an eval() on the config file
|
||||
/** @var array $MySettings */
|
||||
$MySettings = null;
|
||||
/** @var array $MyModuleSettings */
|
||||
$MyModuleSettings = [];
|
||||
/** @var array $MyModules */
|
||||
$MyModules = null;
|
||||
|
||||
// This does not work on several lines
|
||||
// preg_match('/^<\\?php(.*)\\?'.'>$/', $sConfigCode, $aMatches)...
|
||||
// So, I've implemented a solution suggested in the PHP doc (search for phpWrapper)
|
||||
try
|
||||
{
|
||||
ob_start();
|
||||
eval('?'.'>'.trim($sConfigCode));
|
||||
$sNoise = trim(ob_get_contents());
|
||||
ob_end_clean();
|
||||
}
|
||||
catch (Error $e)
|
||||
{
|
||||
// PHP 7
|
||||
throw new ConfigException('Error in configuration file',
|
||||
array('file' => $sConfigFile, 'error' => $e->getMessage().' at line '.$e->getLine()));
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// well, never reach in case of parsing error :-(
|
||||
// will be improved in PHP 6 ?
|
||||
throw new ConfigException('Error in configuration file',
|
||||
array('file' => $sConfigFile, 'error' => $e->getMessage()));
|
||||
}
|
||||
if (strlen($sNoise) > 0)
|
||||
{
|
||||
// Note: sNoise is an html output, but so far it was ok for me (e.g. showing the entire call stack)
|
||||
throw new ConfigException('Syntax error in configuration file',
|
||||
array('file' => $sConfigFile, 'error' => '<tt>'.utils::EscapeHtml($sNoise, ENT_QUOTES).'</tt>'));
|
||||
}
|
||||
|
||||
if (!is_array($MySettings))
|
||||
{
|
||||
throw new ConfigException('Missing array in configuration file',
|
||||
array('file' => $sConfigFile, 'expected' => '$MySettings'));
|
||||
}
|
||||
|
||||
if (!array_key_exists('addons', $MyModules))
|
||||
{
|
||||
throw new ConfigException('Missing item in configuration file',
|
||||
array('file' => $sConfigFile, 'expected' => '$MyModules[\'addons\']'));
|
||||
}
|
||||
if (!array_key_exists('user rights', $MyModules['addons']))
|
||||
{
|
||||
// Add one, by default
|
||||
$MyModules['addons']['user rights'] = '/addons/userrights/userrightsnull.class.inc.php';
|
||||
}
|
||||
|
||||
$this->aMySettings = $MySettings;
|
||||
$this->aMyModuleSettings = $MyModuleSettings;
|
||||
$this->aMyModules = $MyModules;
|
||||
|
||||
$this->LoadModulesConfig(dirname($sConfigFile));
|
||||
|
||||
return [$this->aMySettings, $this->aMyModuleSettings, $this->aMyModules];
|
||||
}
|
||||
|
||||
private function LoadModulesConfig(string $sConfigDir): void
|
||||
{
|
||||
foreach ($this->ListConfigFiles($sConfigDir) as $sJSONModuleFiles) {
|
||||
$aConf = json_decode(file_get_contents($sJSONModuleFiles), true);
|
||||
if (is_null($aConf)) {
|
||||
IssueLog::Exception('Error reading configuration file: '.$sJSONModuleFiles, new Exception());
|
||||
continue;
|
||||
}
|
||||
if (is_array($aConf['MySettings'] ?? null)) {
|
||||
$this->aMySettings = array_merge($this->aMySettings, $aConf['MySettings']);
|
||||
}
|
||||
if (is_array($aConf['MyModuleSettings'] ?? null)) {
|
||||
$this->aMyModuleSettings = array_merge($this->aMyModuleSettings, $aConf['MyModuleSettings']);
|
||||
}
|
||||
if (is_array($aConf['MyModules'] ?? null)) {
|
||||
$this->aMyModules = array_merge($this->aMyModules, $aConf['MyModules']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all json files under $sRootDir
|
||||
* @param string $sRootDir
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function ListConfigFiles(string $sRootDir): array
|
||||
{
|
||||
$aConfigFiles = [];
|
||||
while($aDirs = glob($sRootDir . '/*', GLOB_ONLYDIR)) {
|
||||
$sRootDir .= '/*';
|
||||
foreach ($aDirs as $sConfDir) {
|
||||
$aConfigFiles = array_merge($aConfigFiles, glob($sConfDir.'/*.json'));
|
||||
}
|
||||
}
|
||||
|
||||
return $aConfigFiles;
|
||||
}
|
||||
|
||||
public function SaveModuleConfig(string $sModule, array $MyModuleSettings, array $MySettings = null, array $MyModules = null): void
|
||||
{
|
||||
$sConfigFile = dirname(utils::GetConfigFilePath()).'/modules/'.$sModule.'/'.$sModule.'.json';
|
||||
SetupUtils::builddir(dirname($sConfigFile));
|
||||
$aConf = ['MyModuleSettings' => $MyModuleSettings];
|
||||
if (is_array($MySettings)) {
|
||||
$aConf['MySettings'] = $MySettings;
|
||||
}
|
||||
if (is_array($MyModules)) {
|
||||
$aConf['MyModules'] = $MyModules;
|
||||
}
|
||||
file_put_contents($sConfigFile, json_encode($aConf, JSON_PRETTY_PRINT));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user