mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-23 01:44:12 +01:00
Compare commits
4 Commits
feature/64
...
test_eric
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ada74e63f | ||
|
|
0ccb452ab7 | ||
|
|
0dae7346d1 | ||
|
|
cdfded766f |
@@ -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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ use Combodo\iTop\Application\UI\Base\Component\Button\Button;
|
||||
use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory;
|
||||
use Combodo\iTop\Application\UI\Base\Component\ButtonGroup\ButtonGroupUIBlockFactory;
|
||||
use Combodo\iTop\Application\UI\Base\Component\CollapsibleSection\CollapsibleSection;
|
||||
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
||||
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory;
|
||||
use Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\StaticTable;
|
||||
use Combodo\iTop\Application\UI\Base\Component\Field\Field;
|
||||
@@ -3446,15 +3447,7 @@ EOF
|
||||
} catch (Exception $oException) {
|
||||
// Catch any exception happening during the stimulus
|
||||
$sExceptionMessage = ($oException instanceof CoreCannotSaveObjectException) ? $oException->getHtmlMessage() : $oException->getMessage();
|
||||
\IssueLog::Error(__METHOD__, null, [$oException->getTraceAsString(), $oException->getMessage()]);
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
//N°4720 : with deprecation removals: ease maintenance via additional logs
|
||||
// Catch any Throwable happening during the stimulus
|
||||
$sExceptionMessage = $e->getMessage();
|
||||
\IssueLog::Error(__METHOD__, null, [$e->getTraceAsString(), $e->getMessage()]);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
if ($sOwnershipToken !== null) {
|
||||
// Release the concurrent lock, if any
|
||||
iTopOwnershipLock::ReleaseLock($sClass, $iKey, $sOwnershipToken);
|
||||
|
||||
@@ -903,13 +903,7 @@ class TemplateMenuNode extends MenuNode
|
||||
{
|
||||
parent::__construct($sMenuId, $iParentIndex, $fRank, $sEnableClass, $iActionCode, $iAllowedResults, $sEnableStimulus);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function GetHyperlink($aExtraParams)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @throws \Exception
|
||||
|
||||
@@ -542,9 +542,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;
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,44 @@
|
||||
.ibo-prop-header {
|
||||
@extend %ibo-font-size-150;
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.help-text{
|
||||
padding: 1px 5px;
|
||||
background-color: #d7e3f8;
|
||||
border: 1px solid #c6e7f5;
|
||||
border-radius: 5px;
|
||||
margin: 5px 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.form-error ul{
|
||||
padding: 1px 5px;
|
||||
background-color: #f8d7da;
|
||||
border: 1px solid #f5c6cb;
|
||||
border-radius: 5px;
|
||||
margin: 5px 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.subform{
|
||||
background-color: #efefef;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.form-buttons{
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
#form select{
|
||||
padding: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#form select option{
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
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,73 +1,73 @@
|
||||
$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-950: darken($nord11, 25%) !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-red-950: darken($nord11, 25%);
|
||||
|
||||
$ibo-color-error-100: $ibo-color-red-100 !default;
|
||||
$ibo-color-error-200: $ibo-color-red-200 !default;
|
||||
$ibo-color-error-300: $ibo-color-red-300 !default;
|
||||
$ibo-color-error-400: $ibo-color-red-400 !default;
|
||||
$ibo-color-error-500: $ibo-color-red-500 !default;
|
||||
$ibo-color-error-600: $ibo-color-red-600 !default;
|
||||
$ibo-color-error-700: $ibo-color-red-700 !default;
|
||||
$ibo-color-error-800: $ibo-color-red-800 !default;
|
||||
$ibo-color-error-900: $ibo-color-red-900 !default;
|
||||
$ibo-color-error-950: $ibo-color-red-950 !default;
|
||||
$ibo-color-error-100: $ibo-color-red-100;
|
||||
$ibo-color-error-200: $ibo-color-red-200;
|
||||
$ibo-color-error-300: $ibo-color-red-300;
|
||||
$ibo-color-error-400: $ibo-color-red-400;
|
||||
$ibo-color-error-500: $ibo-color-red-500;
|
||||
$ibo-color-error-600: $ibo-color-red-600;
|
||||
$ibo-color-error-700: $ibo-color-red-700;
|
||||
$ibo-color-error-800: $ibo-color-red-800;
|
||||
$ibo-color-error-900: $ibo-color-red-900;
|
||||
$ibo-color-error-950: $ibo-color-red-950;
|
||||
|
||||
$ibo-color-danger-100: $ibo-color-red-100 !default;
|
||||
$ibo-color-danger-200: $ibo-color-red-200 !default;
|
||||
$ibo-color-danger-300: $ibo-color-red-300 !default;
|
||||
$ibo-color-danger-400: $ibo-color-red-400 !default;
|
||||
$ibo-color-danger-500: $ibo-color-red-500 !default;
|
||||
$ibo-color-danger-600: $ibo-color-red-600 !default;
|
||||
$ibo-color-danger-700: $ibo-color-red-700 !default;
|
||||
$ibo-color-danger-800: $ibo-color-red-800 !default;
|
||||
$ibo-color-danger-900: $ibo-color-red-900 !default;
|
||||
$ibo-color-danger-950: $ibo-color-red-950 !default;
|
||||
$ibo-color-danger-100: $ibo-color-red-100;
|
||||
$ibo-color-danger-200: $ibo-color-red-200;
|
||||
$ibo-color-danger-300: $ibo-color-red-300;
|
||||
$ibo-color-danger-400: $ibo-color-red-400;
|
||||
$ibo-color-danger-500: $ibo-color-red-500;
|
||||
$ibo-color-danger-600: $ibo-color-red-600;
|
||||
$ibo-color-danger-700: $ibo-color-red-700;
|
||||
$ibo-color-danger-800: $ibo-color-red-800;
|
||||
$ibo-color-danger-900: $ibo-color-red-900;
|
||||
$ibo-color-danger-950: $ibo-color-red-950;
|
||||
|
||||
$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;
|
||||
@@ -112,7 +112,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;
|
||||
|
||||
@@ -198,13 +198,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;
|
||||
@@ -312,12 +310,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;
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,8 @@
|
||||
|
||||
$sTicketListAttCode = 'tickets_list';
|
||||
|
||||
if (MetaModel::HasChildrenClasses('Ticket') && MetaModel::IsValidAttCode(get_class($this), $sTicketListAttCode)) {
|
||||
if (MetaModel::IsValidAttCode(get_class($this), $sTicketListAttCode))
|
||||
{
|
||||
// Display one list per leaf class (the only way to display the status as of now)
|
||||
|
||||
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sTicketListAttCode);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
Dict::Add('CS CZ', 'Czech', 'Čeština', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Editor konfiguračního souboru',
|
||||
'config-edit-title' => 'Editor konfiguračního souboru',
|
||||
'config-edit-intro' => 'Při úpravách konfiguračního souboru buďte velice opatrní. Nesprávné nastavení může vést k nedostupnosti '.ITOP_APPLICATION_SHORT, 'Menu:ConfigEditor' => 'Konfigurace',
|
||||
'config-apply' => 'Použít',
|
||||
'config-apply-title' => 'Použít (Ctrl+S)',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
Dict::Add('DA DA', 'Danish', 'Dansk', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Configuration File Editor~~',
|
||||
'config-edit-title' => 'Configuration File Editor~~',
|
||||
'config-edit-intro' => 'Be very cautious when editing the configuration file.~~',
|
||||
'Menu:ConfigEditor' => 'General configuration~~',
|
||||
'config-apply' => 'Apply~~',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
Dict::Add('DE DE', 'German', 'Deutsch', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Konfigurations-Editor',
|
||||
'config-edit-title' => 'Konfigurations-Editor',
|
||||
'config-edit-intro' => 'Achtung: Eine falsche Konfiguration kann dazu führen, dass '.ITOP_APPLICATION_SHORT.' für alle Benutzer unbenutzbar ist!',
|
||||
'Menu:ConfigEditor' => 'Konfiguration',
|
||||
'config-apply' => 'Anwenden (Ctrl+S)',
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor',
|
||||
'itop-config/Operation:Edit/Title' => 'Configuration File Editor',
|
||||
'config-edit-title' => 'Configuration File Editor',
|
||||
'config-edit-intro' => 'Be very cautious when editing the configuration file.',
|
||||
'config-apply' => 'Apply',
|
||||
'config-apply-title' => 'Apply (Ctrl+S)',
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
Dict::Add('EN GB', 'British English', 'British English', array(
|
||||
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor',
|
||||
'itop-config/Operation:Edit/Title' => 'Configuration File Editor',
|
||||
'config-edit-title' => 'Configuration File Editor',
|
||||
'config-edit-intro' => 'Be very cautious when editing the configuration file.',
|
||||
'config-apply' => 'Apply',
|
||||
'config-apply-title' => 'Apply (Ctrl+S)',
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Editor de Archivo de Configuración',
|
||||
'config-edit-title' => 'Editor de Archivo de Configuración',
|
||||
'config-edit-intro' => 'Sea muy cuidadoso cuando edite el archivo de configuración. En particular, sólo los elementos superiores (ejem.: the global configuration y modules settings) deberian ser editados.',
|
||||
'Menu:ConfigEditor' => 'Configuración',
|
||||
'config-apply' => 'Aplicar',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
Dict::Add('FR FR', 'French', 'Français', array(
|
||||
'Menu:ConfigFileEditor' => 'Éditeur de texte brut',
|
||||
'itop-config/Operation:Edit/Title' => 'Éditeur du Fichier de Configuration',
|
||||
'config-edit-title' => 'Éditeur du Fichier de Configuration',
|
||||
'config-edit-intro' => 'Attention: une configuration incorrecte peut rendre '.ITOP_APPLICATION_SHORT.' inopérant pour tous les utilisateurs!',
|
||||
'config-apply' => 'Enregistrer',
|
||||
'config-apply-title' => 'Enregistrer (Ctrl+S)',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
Dict::Add('HU HU', 'Hungarian', 'Magyar', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Konfigurációs fájl szerkesztő',
|
||||
'config-edit-title' => 'Konfigurációs fájl szerkesztő',
|
||||
'config-edit-intro' => 'Legyen nagyon óvatos a konfiguráció szerkesztésénél!',
|
||||
'Menu:ConfigEditor' => 'Konfiguráció szerkesztő',
|
||||
'config-apply' => 'Alkalmaz',
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*/
|
||||
Dict::Add('IT IT', 'Italian', 'Italiano', array(
|
||||
'itop-config/Operation:Edit/Title' => 'Modifica file di configurazione',
|
||||
'config-edit-title' => 'Modifica file di configurazione',
|
||||
'config-edit-intro' => 'Prestare molta attenzione durante la modifica del file di configurazione.',
|
||||
'Menu:ConfigEditor' => 'Configurazione',
|
||||
'config-apply' => 'Applica',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
Dict::Add('JA JP', 'Japanese', '日本語', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Configuration File Editor~~',
|
||||
'config-edit-title' => 'Configuration File Editor~~',
|
||||
'config-edit-intro' => 'Be very cautious when editing the configuration file.~~',
|
||||
'Menu:ConfigEditor' => 'General configuration~~',
|
||||
'config-apply' => 'Apply~~',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
Dict::Add('NL NL', 'Dutch', 'Nederlands', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Aanpassen configuratie',
|
||||
'config-edit-title' => 'Aanpassen configuratie',
|
||||
'config-edit-intro' => 'Wees uiterst voorzichtig bij het aanpassen van de configuratie.',
|
||||
'Menu:ConfigEditor' => 'Configuratie',
|
||||
'config-apply' => 'Opslaan',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
Dict::Add('PL PL', 'Polish', 'Polski', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Edycja pliku konfiguracyjnego',
|
||||
'config-edit-title' => 'Edycja pliku konfiguracyjnego',
|
||||
'config-edit-intro' => 'Zachowaj ostrożność podczas edycji pliku konfiguracyjnego.',
|
||||
'Menu:ConfigEditor' => 'Konfiguracja ogólna',
|
||||
'config-apply' => 'Zastosuj',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
Dict::Add('PT BR', 'Brazilian', 'Brazilian', array(
|
||||
'Menu:ConfigFileEditor' => 'Configurações',
|
||||
'itop-config/Operation:Edit/Title' => 'Editor do arquivo de configuração',
|
||||
'config-edit-title' => 'Editor do arquivo de configuração',
|
||||
'config-edit-intro' => 'Tenha cuidado ao editar o arquivo de configuração',
|
||||
'Menu:ConfigEditor' => 'Configurações',
|
||||
'config-apply' => 'Aplicar',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
Dict::Add('RU RU', 'Russian', 'Русский', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Редактор файла конфигурации',
|
||||
'config-edit-title' => 'Редактор файла конфигурации',
|
||||
'config-edit-intro' => 'Будьте очень осторожны при редактировании файла конфигурации. В частности, отредактированы могут быть только глобальная конфигурация и настройки модулей.',
|
||||
'Menu:ConfigEditor' => 'Основные настройки',
|
||||
'config-apply' => 'Применить',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
Dict::Add('SK SK', 'Slovak', 'Slovenčina', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Configuration File Editor~~',
|
||||
'config-edit-title' => 'Configuration File Editor~~',
|
||||
'config-edit-intro' => 'Be very cautious when editing the configuration file.~~',
|
||||
'Menu:ConfigEditor' => 'General configuration~~',
|
||||
'config-apply' => 'Apply~~',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
Dict::Add('TR TR', 'Turkish', 'Türkçe', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'itop-config/Operation:Edit/Title' => 'Configuration File Editor~~',
|
||||
'config-edit-title' => 'Configuration File Editor~~',
|
||||
'config-edit-intro' => 'Be very cautious when editing the configuration file.~~',
|
||||
'Menu:ConfigEditor' => 'General configuration~~',
|
||||
'config-apply' => 'Apply~~',
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
Dict::Add('ZH CN', 'Chinese', '简体中文', array(
|
||||
'Menu:ConfigFileEditor' => 'Plain text editor~~',
|
||||
'Menu:ConfigEditor' => '编辑配置文件',
|
||||
'itop-config/Operation:Edit/Title' => '配置文件编辑器',
|
||||
'config-edit-title' => '配置文件编辑器',
|
||||
'config-edit-intro' => '编辑配置文件时请务必格外小心.',
|
||||
'config-apply' => '应用',
|
||||
'config-apply-title' => '应用 (Ctrl+S)',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{% UIAlert ForSuccess{sContent: sSuccess} %}{% EndUIAlert %}
|
||||
{% endfor %}
|
||||
|
||||
{% UITitle ForPage {'sTitle':'itop-config/Operation:Edit/Title'|dict_s} %}{% EndUITitle %}
|
||||
{% UITitle ForPage {'sTitle':'config-edit-title'|dict_s} %}{% EndUITitle %}
|
||||
|
||||
{% if bShowEditor %}
|
||||
<p>{{ 'config-edit-intro'|dict_s }}</p>
|
||||
|
||||
@@ -91,10 +91,11 @@ editor.commands.addCommand({
|
||||
name: 'save',
|
||||
bindKey: {win: "Ctrl-S", "mac": "Cmd-S"},
|
||||
exec: function(editor) {
|
||||
let submitButton = document.getElementById('submit_button');
|
||||
var editorForm = EditorUtils.getEditorForm(editor);
|
||||
var submitButton = document.getElementById('submit_button');
|
||||
|
||||
if (!submitButton.disabled) {
|
||||
submitButton.click();
|
||||
if (submitButton.is(":enabled")) {
|
||||
editorForm.trigger('submit');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', array(
|
||||
'Portal:Form:Close:Warning' => 'Opravdu chcete opustit tento formulář? Data vložená do formuláře budou ztracena ',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Chyba: objekt nelze vytvořit. Před opětovným odesláním tohoto formuláře zkontrolujte související objekty a přílohy.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Chyba: objekt nelze vytvořit. Před opětovným odesláním tohoto formuláře zkontrolujte související objekty a přílohy.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('DA DA', 'Danish', 'Dansk', array(
|
||||
'Portal:Form:Close:Warning' => 'Do you want to leave this form? Data entered may be lost~~',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: object cannot be created. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('DE DE', 'German', 'Deutsch', array(
|
||||
'Portal:Form:Close:Warning' => 'Soll diese Eingabemaske verlassen werden? Eingegebene Daten werden nicht gespeichert.',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: Objekt kann nicht erzeugt werden. Prüfen Sie verknüpfte Objekte und Anhänge bevor Sie dieses Formular erneut abschicken.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: Objekt kann nicht geupdated werden. Prüfen Sie verknüpfte Objekte und Anhänge bevor Sie dieses Formular erneut abschicken.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -70,7 +70,6 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Portal:Form:Close:Warning' => 'Do you want to leave this form? Data entered may be lost',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: object cannot be created. Check associated objects and attachments before submitting this form again.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated. Check associated objects and attachments before submitting this form again.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -57,7 +57,6 @@ Dict::Add('EN GB', 'British English', 'British English', array(
|
||||
'Portal:Form:Close:Warning' => 'Do you want to leave this form? Data entered may be lost',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: object cannot be created. Check associated objects and attachments before submitting this form again.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated. Check associated objects and attachments before submitting this form again.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -59,7 +59,6 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array(
|
||||
'Portal:Form:Close:Warning' => '¿Desea abandorar este formulario? Datos modificados se perderan',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: no se puede crear el objeto. Verifique los objetos asociados y archivos adjuntos antes de enviar nuevamente este formulario.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: no se puede actualizar el objeto. Verifique los objetos asociados y archivos adjuntos antes de enviar nuevamente este formulario.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('FR FR', 'French', 'Français', array(
|
||||
'Portal:Form:Close:Warning' => 'Voulez-vous quitter ce formulaire ? Les données saisies seront perdues',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Erreur: L\'objet n\'a pas été créé. Vérifiez les objets liés et les attachements avant de soumettre à nouveau le formulaire.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Erreur: L\'objet n\'a pas été modifié. Vérifiez les objets liés et les attachements avant de soumettre à nouveau le formulaire.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Erreur durant la validation du champ \'%1$s\' : %2$s',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', array(
|
||||
'Portal:Form:Close:Warning' => 'Szeretné elhagyni ezt az űrlapot? A megadott adatok elveszhetnek',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Hiba: az objektum nem hozható létre. Ellenőrizze a kapcsolódó objektumokat és mellékleteket, mielőtt újra elküldi ezt az űrlapot.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Hiba: az objektum nem frissíthető. Ellenőrizze a kapcsolódó objektumokat és mellékleteket, mielőtt újra elküldi ezt az űrlapot.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('IT IT', 'Italian', 'Italiano', array(
|
||||
'Portal:Form:Close:Warning' => 'Do you want to leave this form? Data entered may be lost~~',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: object cannot be created. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('JA JP', 'Japanese', '日本語', array(
|
||||
'Portal:Form:Close:Warning' => 'Do you want to leave this form? Data entered may be lost~~',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: object cannot be created. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -62,7 +62,6 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', array(
|
||||
'Portal:Form:Close:Warning' => 'Ben je zeker dat je dit venster wil sluiten? Ingevoerde gegevens kunnen verloren gaan.',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Fout: object kan niet worden aangemaakt. Kijk verwante objecten en bijlagen na vooraleer dit formulier opnieuw te versturen.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Fout: object kan niet worden aangepast. Kijk verwante objecten en bijlagen na vooraleer dit formulier opnieuw te versturen.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('PL PL', 'Polish', 'Polski', array(
|
||||
'Portal:Form:Close:Warning' => 'Chcesz opuścić ten formularz? Wprowadzone dane mogą zostać utracone',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Błąd: nie można utworzyć obiektu. Sprawdź powiązane obiekty i załączniki przed ponownym przesłaniem tego formularza.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Błąd: nie można zaktualizować obiektu. Sprawdź powiązane obiekty i załączniki przed ponownym przesłaniem tego formularza.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', array(
|
||||
'Portal:Form:Close:Warning' => 'Você deseja abandonar esta página? Os dados digitados podem ser perdidos',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Erro: objeto não pode ser criado. Verifique os objetos e anexos associados antes de enviar novamente este formulário',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Erro: objeto não pode ser atualizado. Verifique os objetos e anexos associados antes de enviar novamente este formulário',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -62,7 +62,6 @@ Dict::Add('RU RU', 'Russian', 'Русский', array(
|
||||
'Portal:Form:Close:Warning' => 'Вы действительно хотите закрыть эту форму? Введённые данные могут быть утеряны.',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: object cannot be created. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', array(
|
||||
'Portal:Form:Close:Warning' => 'Do you want to leave this form? Data entered may be lost~~',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: object cannot be created. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -61,7 +61,6 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', array(
|
||||
'Portal:Form:Close:Warning' => 'Do you want to leave this form? Data entered may be lost~~',
|
||||
'Portal:Error:ObjectCannotBeCreated' => 'Error: object cannot be created. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated. Check associated objects and attachments before submitting this form again.~~',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -70,7 +70,6 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array(
|
||||
'Portal:Form:Close:Warning' => '确定要离开表单吗? 已输入数据会丢失',
|
||||
'Portal:Error:ObjectCannotBeCreated' => '错误: 无法创建对象. 请在再次提交表单前检查相关对象和附件.',
|
||||
'Portal:Error:ObjectCannotBeUpdated' => '错误: 无法更新对象. 请在再次提交表单前检查相关对象和附件.',
|
||||
'Portal:Error:CheckToWriteFailed' => 'Error during validation of field \'%1$s\': %2$s~~',
|
||||
));
|
||||
|
||||
// UserProfile brick
|
||||
|
||||
@@ -337,18 +337,7 @@ class ObjectFormHandlerHelper
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$sErrorMessages = '';
|
||||
foreach ($aFormData['validation']['messages']['error'] as $sFieldId => $aMessages) {
|
||||
if ($sFieldId == '_main') {
|
||||
$sErrorMessages .= implode(' - ', $aFormData['validation']['messages']['error']['_main']);
|
||||
} else {
|
||||
$oObj = $oFormManager->GetObject();
|
||||
$sLabel = $oObj->GetLabel($sFieldId);
|
||||
$sErrorMessages .= Dict::Format('Portal:Error:CheckToWriteFailed', $sLabel, (is_array($aMessages) ? implode(' - ', $aMessages) : $aMessages));
|
||||
}
|
||||
}
|
||||
|
||||
throw new HttpException(Response::HTTP_INTERNAL_SERVER_ERROR, $sErrorMessages);
|
||||
throw new HttpException(Response::HTTP_INTERNAL_SERVER_ERROR, implode('<br/>', $aFormData['validation']['messages']['error']['_main']));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -473,6 +473,16 @@ return array(
|
||||
'Combodo\\iTop\\Form\\Validator\\MultipleChoicesValidator' => $baseDir . '/sources/Form/Validator/MultipleChoicesValidator.php',
|
||||
'Combodo\\iTop\\Form\\Validator\\NotEmptyExtKeyValidator' => $baseDir . '/sources/Form/Validator/NotEmptyExtKeyValidator.php',
|
||||
'Combodo\\iTop\\Form\\Validator\\SelectObjectValidator' => $baseDir . '/sources/Form/Validator/SelectObjectValidator.php',
|
||||
'Combodo\\iTop\\Forms\\Dependency\\DependencyDescription' => $baseDir . '/sources/Forms/Dependency/DependencyDescription.php',
|
||||
'Combodo\\iTop\\Forms\\Dependency\\DependencyHandler' => $baseDir . '/sources/Forms/Dependency/DependencyHandler.php',
|
||||
'Combodo\\iTop\\Forms\\FormBuilder\\FormBuilder' => $baseDir . '/sources/Forms/FormBuilder/FormBuilder.php',
|
||||
'Combodo\\iTop\\Forms\\FormBuilder\\FormTypeExtension' => $baseDir . '/sources/Forms/FormBuilder/FormTypeExtension.php',
|
||||
'Combodo\\iTop\\Forms\\FormBuilder\\ResolvedFormType' => $baseDir . '/sources/Forms/FormBuilder/ResolvedFormType.php',
|
||||
'Combodo\\iTop\\Forms\\FormBuilder\\ResolvedFormTypeFactory' => $baseDir . '/sources/Forms/FormBuilder/ResolvedFormTypeFactory.php',
|
||||
'Combodo\\iTop\\Forms\\FormType\\AttributeChoiceType' => $baseDir . '/sources/Forms/FormType/AttributeChoiceType.php',
|
||||
'Combodo\\iTop\\Forms\\FormType\\AttributeValueChoiceType' => $baseDir . '/sources/Forms/FormType/AttributeValueChoiceType.php',
|
||||
'Combodo\\iTop\\Forms\\FormType\\OqlType' => $baseDir . '/sources/Forms/FormType/OqlType.php',
|
||||
'Combodo\\iTop\\Forms\\Forms' => $baseDir . '/sources/Forms/Forms.php',
|
||||
'Combodo\\iTop\\Forms\\Twig\\Extension\\FormCompatibilityExtension' => $baseDir . '/sources/Forms/Twig/Extension/FormCompatibilityExtension.php',
|
||||
'Combodo\\iTop\\PhpParser\\Evaluation\\PhpExpressionEvaluator' => $baseDir . '/sources/PhpParser/Evaluation/PhpExpressionEvaluator.php',
|
||||
'Combodo\\iTop\\Renderer\\BlockRenderer' => $baseDir . '/sources/Renderer/BlockRenderer.php',
|
||||
|
||||
@@ -854,6 +854,16 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||
'Combodo\\iTop\\Form\\Validator\\MultipleChoicesValidator' => __DIR__ . '/../..' . '/sources/Form/Validator/MultipleChoicesValidator.php',
|
||||
'Combodo\\iTop\\Form\\Validator\\NotEmptyExtKeyValidator' => __DIR__ . '/../..' . '/sources/Form/Validator/NotEmptyExtKeyValidator.php',
|
||||
'Combodo\\iTop\\Form\\Validator\\SelectObjectValidator' => __DIR__ . '/../..' . '/sources/Form/Validator/SelectObjectValidator.php',
|
||||
'Combodo\\iTop\\Forms\\Dependency\\DependencyDescription' => __DIR__ . '/../..' . '/sources/Forms/Dependency/DependencyDescription.php',
|
||||
'Combodo\\iTop\\Forms\\Dependency\\DependencyHandler' => __DIR__ . '/../..' . '/sources/Forms/Dependency/DependencyHandler.php',
|
||||
'Combodo\\iTop\\Forms\\FormBuilder\\FormBuilder' => __DIR__ . '/../..' . '/sources/Forms/FormBuilder/FormBuilder.php',
|
||||
'Combodo\\iTop\\Forms\\FormBuilder\\FormTypeExtension' => __DIR__ . '/../..' . '/sources/Forms/FormBuilder/FormTypeExtension.php',
|
||||
'Combodo\\iTop\\Forms\\FormBuilder\\ResolvedFormType' => __DIR__ . '/../..' . '/sources/Forms/FormBuilder/ResolvedFormType.php',
|
||||
'Combodo\\iTop\\Forms\\FormBuilder\\ResolvedFormTypeFactory' => __DIR__ . '/../..' . '/sources/Forms/FormBuilder/ResolvedFormTypeFactory.php',
|
||||
'Combodo\\iTop\\Forms\\FormType\\AttributeChoiceType' => __DIR__ . '/../..' . '/sources/Forms/FormType/AttributeChoiceType.php',
|
||||
'Combodo\\iTop\\Forms\\FormType\\AttributeValueChoiceType' => __DIR__ . '/../..' . '/sources/Forms/FormType/AttributeValueChoiceType.php',
|
||||
'Combodo\\iTop\\Forms\\FormType\\OqlType' => __DIR__ . '/../..' . '/sources/Forms/FormType/OqlType.php',
|
||||
'Combodo\\iTop\\Forms\\Forms' => __DIR__ . '/../..' . '/sources/Forms/Forms.php',
|
||||
'Combodo\\iTop\\Forms\\Twig\\Extension\\FormCompatibilityExtension' => __DIR__ . '/../..' . '/sources/Forms/Twig/Extension/FormCompatibilityExtension.php',
|
||||
'Combodo\\iTop\\PhpParser\\Evaluation\\PhpExpressionEvaluator' => __DIR__ . '/../..' . '/sources/PhpParser/Evaluation/PhpExpressionEvaluator.php',
|
||||
'Combodo\\iTop\\Renderer\\BlockRenderer' => __DIR__ . '/../..' . '/sources/Renderer/BlockRenderer.php',
|
||||
|
||||
@@ -26,6 +26,7 @@ use Combodo\iTop\Application\WebPage\ErrorPage;
|
||||
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||
use Combodo\iTop\Application\WebPage\WebPage;
|
||||
use Combodo\iTop\Controller\AbstractController;
|
||||
use Combodo\iTop\Forms\Forms;
|
||||
use Combodo\iTop\Service\InterfaceDiscovery\InterfaceDiscovery;
|
||||
use Dict;
|
||||
use Exception;
|
||||
@@ -45,7 +46,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormFactoryBuilderInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormRenderer;
|
||||
use Symfony\Component\Form\Forms;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Security\Csrf\CsrfTokenManager;
|
||||
use Twig\Error\SyntaxError;
|
||||
@@ -496,6 +496,14 @@ abstract class Controller extends AbstractController
|
||||
$sTemplateName = $this->m_sOperation;
|
||||
}
|
||||
$aParams = array_merge($this->GetDefaultParameters(), $aParams);
|
||||
foreach (InterfaceDiscovery::GetInstance()->FindItopClasses(iProfilerExtension::class) as $sExtension) {
|
||||
/** @var \Combodo\iTop\Application\TwigBase\Controller\iProfilerExtension $oExtensionInstance */
|
||||
$oExtensionInstance = $sExtension::GetInstance();
|
||||
if ($oExtensionInstance->IsEnabled()) {
|
||||
$aParams = array_merge($aParams, $oExtensionInstance->GetDebugParams($aParams));
|
||||
}
|
||||
}
|
||||
|
||||
$this->CreatePage($sPageType);
|
||||
$sHTMLContent = $this->RenderTemplate($aParams, $sTemplateName, 'html', $sErrorMsg);
|
||||
if ($sHTMLContent !== false) {
|
||||
|
||||
@@ -22,7 +22,7 @@ abstract class AbstractInput extends UIBlock
|
||||
/**@var string */
|
||||
protected $sPlaceholder;
|
||||
|
||||
public function GetName(): string
|
||||
public function GetName(): ?string
|
||||
{
|
||||
return $this->sName;
|
||||
}
|
||||
|
||||
@@ -53,15 +53,13 @@ class SetUIBlockFactory extends AbstractUIBlockFactory
|
||||
* @param string $sValueField Field used for option value
|
||||
* @param array $aSearchFields Fields used for searching
|
||||
* @param string|null $sGroupField Field used for grouping
|
||||
* @param string $sName Field name
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Set\Set
|
||||
*/
|
||||
public static function MakeForSimple(string $sId, array $aOptions, string $sLabelFields, string $sValueField, array $aSearchFields, ?string $sGroupField = null, ?string $sTooltipField = null, string $sName = ''): Set
|
||||
public static function MakeForSimple(string $sId, array $aOptions, string $sLabelFields, string $sValueField, array $aSearchFields, ?string $sGroupField = null, ?string $sTooltipField = null): Set
|
||||
{
|
||||
// Create set ui block
|
||||
$oSetUIBlock = new Set($sId);
|
||||
$oSetUIBlock->SetName($sName);
|
||||
|
||||
// Simple data provider
|
||||
$oDataProvider = new SimpleDataProvider($aOptions);
|
||||
@@ -93,15 +91,13 @@ class SetUIBlockFactory extends AbstractUIBlockFactory
|
||||
* @param string $sValueField Field used for value
|
||||
* @param array $aSearchFields Fields used for search
|
||||
* @param string|null $sGroupField Field used for grouping
|
||||
* @param string $sName Field name
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Set\Set
|
||||
*/
|
||||
public static function MakeForAjax(string $sId, string $sAjaxRoute, array $aAjaxRouteParams, string $sLabelFields, string $sValueField, array $aSearchFields, ?string $sGroupField = null, string $sName = ''): Set
|
||||
public static function MakeForAjax(string $sId, string $sAjaxRoute, array $aAjaxRouteParams, string $sLabelFields, string $sValueField, array $aSearchFields, ?string $sGroupField = null): Set
|
||||
{
|
||||
// Create set ui block
|
||||
$oSetUIBlock = new Set($sId);
|
||||
$oSetUIBlock->SetName($sName);
|
||||
|
||||
// Ajax data provider
|
||||
$oDataProvider = new AjaxDataProvider($sAjaxRoute, $aAjaxRouteParams);
|
||||
@@ -133,15 +129,13 @@ class SetUIBlockFactory extends AbstractUIBlockFactory
|
||||
* @param string|null $sWizardHelperJsVarName Wizard helper name
|
||||
* @param array $aFieldsToLoad Additional fields to load on objects
|
||||
* @param string|null $sGroupField Field used for grouping
|
||||
* @param string $sName Field name
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Set\Set
|
||||
*/
|
||||
public static function MakeForOQL(string $sId, string $sObjectClass, string $sOql, string $sWizardHelperJsVarName = null, array $aFieldsToLoad = [], ?string $sGroupField = null, string $sName = ''): Set
|
||||
public static function MakeForOQL(string $sId, string $sObjectClass, string $sOql, string $sWizardHelperJsVarName = null, array $aFieldsToLoad = [], ?string $sGroupField = null): Set
|
||||
{
|
||||
// Create set ui block
|
||||
$oSetUIBlock = new Set($sId);
|
||||
$oSetUIBlock->SetName($sName);
|
||||
|
||||
// Renderers
|
||||
$oSetUIBlock->SetOptionsTemplate('application/object/set/option_renderer.html.twig');
|
||||
|
||||
107
sources/Forms/Dependency/DependencyDescription.php
Normal file
107
sources/Forms/Dependency/DependencyDescription.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\Dependency;
|
||||
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
|
||||
class DependencyDescription
|
||||
{
|
||||
private array $aPostSetData = [];
|
||||
|
||||
private array $aPostSubmitData = [];
|
||||
|
||||
private bool $isAdded = false;
|
||||
|
||||
public function __construct(public readonly array $aDependencies, public readonly string|FormBuilderInterface $child, public readonly ?string $type = null, public readonly array $options = [])
|
||||
{
|
||||
}
|
||||
|
||||
public function IsAdded(): bool
|
||||
{
|
||||
return $this->isAdded;
|
||||
}
|
||||
|
||||
public function SetAdded(bool $bAdded): void
|
||||
{
|
||||
$this->isAdded = $bAdded;
|
||||
}
|
||||
|
||||
public function IsDataReady(string $sEventType): bool
|
||||
{
|
||||
$aData = ($sEventType === FormEvents::POST_SET_DATA) ? $this->aPostSetData : $this->aPostSubmitData;
|
||||
|
||||
foreach (array_keys($this->aDependencies) as $sInput){
|
||||
if(!array_key_exists($sInput, $aData) || $aData[$sInput] == null){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function IsPostSetDataReady(): bool
|
||||
{
|
||||
foreach ($this->aDependencies as $sData => $sValue) {
|
||||
if (!array_key_exists($sData, $this->aPostSetData)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function IsPostSubmitDataReady(): bool
|
||||
{
|
||||
foreach ($this->aDependencies as $sData => $sValue) {
|
||||
if (!array_key_exists($sData, $this->aPostSubmitData)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function SetData(string $sEventType, string $sData, mixed $oValue): void
|
||||
{
|
||||
if($oValue === null) return;
|
||||
|
||||
if($sEventType === FormEvents::POST_SET_DATA){
|
||||
$this->aPostSetData[$sData] = $oValue;
|
||||
}
|
||||
else{
|
||||
$this->aPostSubmitData[$sData] = $oValue;
|
||||
}
|
||||
}
|
||||
|
||||
public function GetData(string $sEventType): array
|
||||
{
|
||||
if($sEventType === FormEvents::POST_SET_DATA){
|
||||
return $this->aPostSetData;
|
||||
}
|
||||
else{
|
||||
return $this->aPostSubmitData;
|
||||
}
|
||||
}
|
||||
|
||||
public function SetPostSetData(string $sInput, mixed $oData): void
|
||||
{
|
||||
$this->aPostSetData[$sInput] = $oData;
|
||||
}
|
||||
|
||||
public function SetPostSubmitData(string $sInput, mixed $oData): void
|
||||
{
|
||||
$this->aPostSubmitData[$sInput] = $oData;
|
||||
}
|
||||
|
||||
public function IsReady(string $sEventType): bool
|
||||
{
|
||||
$aData = ($sEventType === FormEvents::POST_SET_DATA) ? $this->aPostSetData : $this->aPostSubmitData;
|
||||
|
||||
foreach (array_keys($this->aDependencies) as $sInput){
|
||||
if(!array_key_exists($sInput, $aData)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
173
sources/Forms/Dependency/DependencyHandler.php
Normal file
173
sources/Forms/Dependency/DependencyHandler.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\Dependency;
|
||||
|
||||
use Exception;
|
||||
use Symfony\Component\Form\Event\PostSetDataEvent;
|
||||
use Symfony\Component\Form\Event\PostSubmitEvent;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
|
||||
class DependencyHandler
|
||||
{
|
||||
/** @var array dépendencies descriptions stored on builder add */
|
||||
private array $aDependenciesDescription = [];
|
||||
|
||||
/** @var array dependencies map computed on form pre set data */
|
||||
private array $aDependenciesMap = [];
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param FormBuilderInterface $builder
|
||||
*/
|
||||
public function __construct(public FormBuilderInterface $builder)
|
||||
{
|
||||
// Initialize the dependencies listeners once the form is built
|
||||
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
|
||||
$oForm = $event->getForm();
|
||||
$this->InitializeDependenciesMap($oForm);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*Initialize the dependencies map and register listeners on the dependencies inputs.
|
||||
*
|
||||
* @param FormInterface $oForm
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function InitializeDependenciesMap(FormInterface $oForm): void
|
||||
{
|
||||
|
||||
/** iterate throw dependencies descriptions... @var DependencyDescription $oDependencyDescription */
|
||||
foreach ($this->aDependenciesDescription as $oDependencyDescription) {
|
||||
|
||||
/** iterate throw dependencies items... */
|
||||
foreach ($oDependencyDescription->aDependencies as $sInput => $aData) {
|
||||
|
||||
// get the dependency field name
|
||||
$sDependency = $aData['source'];
|
||||
|
||||
// get the field input name
|
||||
$sOutput = array_key_exists('output', $aData) ? $aData['output'] : null;
|
||||
|
||||
// add the dependency to the map
|
||||
if(!array_key_exists($sDependency, $this->aDependenciesMap)){
|
||||
$this->aDependenciesMap[$sDependency] = [];
|
||||
}
|
||||
$this->aDependenciesMap[$sDependency][] = ['description' => $oDependencyDescription, 'input' => $sInput, 'output' => $sOutput];
|
||||
}
|
||||
}
|
||||
|
||||
/** iterate throw dependencies... */
|
||||
foreach (array_keys($this->aDependenciesMap) as $sDependency){
|
||||
|
||||
// Listen the dependency
|
||||
$this->builder->get($sDependency)->addEventListener(FormEvents::POST_SET_DATA, $this->GetEventListeningCallback());
|
||||
$this->builder->get($sDependency)->addEventListener(FormEvents::POST_SUBMIT, $this->GetEventListeningCallback());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a dependency description.
|
||||
*
|
||||
* @param DependencyDescription $oDependencyDescription
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function AddDependencyDescription(DependencyDescription $oDependencyDescription): void
|
||||
{
|
||||
$this->aDependenciesDescription[] = $oDependencyDescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* The event handling callback.
|
||||
*
|
||||
* @return callable
|
||||
*/
|
||||
private function GetEventListeningCallback(): callable
|
||||
{
|
||||
return function (FormEvent $event){
|
||||
|
||||
// Get the event type
|
||||
$sEventType = $this->GetEventType($event);
|
||||
|
||||
// Get the form
|
||||
$oForm = $event->getForm();
|
||||
|
||||
/** Iterate throw dependencies map... */
|
||||
foreach ($this->aDependenciesMap[$event->getForm()->getName()] as $aData){
|
||||
|
||||
// Get the map data
|
||||
$oDependencyDescription = $aData['description'];
|
||||
$sInput = $aData['input'];
|
||||
$sOutput = $aData['output'];
|
||||
|
||||
// Compute output value
|
||||
$oValue = $event->getData();
|
||||
if(array_key_exists('outputs', $event->getForm()->getConfig()->getOptions())){
|
||||
$aOutputs = $event->getForm()->getConfig()->getOptions()['outputs'];
|
||||
if(array_key_exists($sOutput, $aOutputs)){
|
||||
$oValue = $aOutputs[$sOutput]($oValue);
|
||||
}
|
||||
}
|
||||
|
||||
// Store the input value
|
||||
$oDependencyDescription->SetData($sEventType, $sInput, $oValue);
|
||||
|
||||
// When dependencies met, add the dependent field if not already done
|
||||
if(!$oDependencyDescription->IsAdded() && $oDependencyDescription->IsDataReady($sEventType)) {
|
||||
|
||||
// Get the dependent field options
|
||||
$aOptions = $oDependencyDescription->options;
|
||||
|
||||
// Add the listener callback to the dependent field if it is also a dependency for another field
|
||||
if(is_string($oDependencyDescription->child) && array_key_exists($oDependencyDescription->child, $this->aDependenciesMap)) {
|
||||
$aOptions = array_merge($aOptions, [
|
||||
'listener_callback' => $this->GetEventListeningCallback(),
|
||||
]);
|
||||
}
|
||||
|
||||
// Add the dependent field to the form
|
||||
$oForm->getParent()->add($oDependencyDescription->child, $oDependencyDescription->type, array_merge($aOptions, $oDependencyDescription->type::GetOptionsFromInputs($oDependencyDescription->GetData($sEventType))));
|
||||
|
||||
// Mark the dependency as added
|
||||
$oDependencyDescription->SetAdded(true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event type.
|
||||
*
|
||||
* @param FormEvent $event
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
private function GetEventType(FormEvent $event): string
|
||||
{
|
||||
if($event instanceof PostSetDataEvent) {
|
||||
return FormEvents::POST_SET_DATA;
|
||||
}
|
||||
else if($event instanceof PostSubmitEvent) {
|
||||
return FormEvents::POST_SUBMIT;
|
||||
}
|
||||
|
||||
throw new Exception(sprintf("Unknown event type %s", get_class($event)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
429
sources/Forms/FormBuilder/FormBuilder.php
Normal file
429
sources/Forms/FormBuilder/FormBuilder.php
Normal file
@@ -0,0 +1,429 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\FormBuilder;
|
||||
|
||||
use Combodo\iTop\Forms\Dependency\DependencyDescription;
|
||||
use Combodo\iTop\Forms\Dependency\DependencyHandler;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\Form\DataMapperInterface;
|
||||
use Symfony\Component\Form\DataTransformerInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormConfigInterface;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\RequestHandlerInterface;
|
||||
use Symfony\Component\Form\ResolvedFormTypeInterface;
|
||||
use Symfony\Component\PropertyAccess\PropertyPathInterface;
|
||||
use Traversable;
|
||||
|
||||
class FormBuilder implements FormBuilderInterface, \IteratorAggregate
|
||||
{
|
||||
/** @var DependencyHandler|null dependencies handler */
|
||||
private DependencyHandler|null $dependencyHandler = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param FormBuilderInterface $builder
|
||||
*/
|
||||
public function __construct(private FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a dependency description to the form builder.
|
||||
* The associate form will be created as a hidden field and added later when all its dependencies were met.
|
||||
*
|
||||
* @param DependencyDescription $oDependencyDescription the dependency description
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function AddDependency(DependencyDescription $oDependencyDescription): void
|
||||
{
|
||||
if($this->dependencyHandler === null){
|
||||
\IssueLog::Error('create dependency handler ' . $this->builder->getName());
|
||||
$this->dependencyHandler = new DependencyHandler($this->builder);
|
||||
}
|
||||
|
||||
$this->dependencyHandler->AddDependencyDescription($oDependencyDescription);
|
||||
}
|
||||
|
||||
public function add(string|FormBuilderInterface $child, ?string $type = null, array $options = []): static
|
||||
{
|
||||
if(!empty($options['bindings'])) {
|
||||
$this->builder->add($child, HiddenType::class);
|
||||
$this->AddDependency(new DependencyDescription($options['bindings'], $child, $type, $options));
|
||||
}
|
||||
else{
|
||||
$this->builder->add($child, $type, $options);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addExpression(string $name, string $expression): static
|
||||
{
|
||||
$options['bindings'] = [$expression];
|
||||
return $this->add($name, null, $options);
|
||||
}
|
||||
|
||||
// pure decoration of FormBuilderInterface
|
||||
|
||||
public function getIterator(): Traversable
|
||||
{
|
||||
return $this->builder->getIterator();
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return $this->builder->count();
|
||||
}
|
||||
public function create(string $name, ?string $type = null, array $options = []): FormBuilderInterface
|
||||
{
|
||||
return $this->builder->create($name, $type, $options);
|
||||
}
|
||||
|
||||
public function get(string $name): FormBuilderInterface
|
||||
{
|
||||
return $this->builder->get($name);
|
||||
}
|
||||
|
||||
public function remove(string $name): static
|
||||
{
|
||||
$this->builder->remove($name);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function has(string $name): bool
|
||||
{
|
||||
return $this->builder->has($name);
|
||||
}
|
||||
|
||||
public function all(): array
|
||||
{
|
||||
return $this->builder->all();
|
||||
}
|
||||
|
||||
public function getForm(): FormInterface
|
||||
{
|
||||
return $this->builder->getForm();
|
||||
}
|
||||
|
||||
public function addEventListener(string $eventName, callable $listener, int $priority = 0): static
|
||||
{
|
||||
$this->builder->addEventListener($eventName, $listener, $priority);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addEventSubscriber(EventSubscriberInterface $subscriber): static
|
||||
{
|
||||
$this->builder->addEventSubscriber($subscriber);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addViewTransformer(DataTransformerInterface $viewTransformer, bool $forcePrepend = false): static
|
||||
{
|
||||
$this->builder->addViewTransformer($viewTransformer, $forcePrepend);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function resetViewTransformers(): static
|
||||
{
|
||||
$this->builder->resetViewTransformers();
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addModelTransformer(DataTransformerInterface $modelTransformer, bool $forceAppend = false): static
|
||||
{
|
||||
$this->builder->addModelTransformer($modelTransformer, $forceAppend);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function resetModelTransformers(): static
|
||||
{
|
||||
$this->builder->resetModelTransformers();
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setAttribute(string $name, mixed $value): static
|
||||
{
|
||||
$this->builder->setAttribute($name, $value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setAttributes(array $attributes): static
|
||||
{
|
||||
$this->builder->setAttributes($attributes);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDataMapper(?DataMapperInterface $dataMapper): static
|
||||
{
|
||||
$this->builder->setDataMapper($dataMapper);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDisabled(bool $disabled): static
|
||||
{
|
||||
$this->builder->setDisabled($disabled);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setEmptyData(mixed $emptyData): static
|
||||
{
|
||||
$this->builder->setEmptyData($emptyData);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setErrorBubbling(bool $errorBubbling): static
|
||||
{
|
||||
$this->builder->setErrorBubbling($errorBubbling);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setRequired(bool $required): static
|
||||
{
|
||||
$this->builder->setRequired($required);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPropertyPath(PropertyPathInterface|string|null $propertyPath): static
|
||||
{
|
||||
$this->builder->setPropertyPath($propertyPath);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setMapped(bool $mapped): static
|
||||
{
|
||||
$this->builder->setMapped($mapped);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setByReference(bool $byReference): static
|
||||
{
|
||||
$this->builder->setByReference($byReference);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setInheritData(bool $inheritData): static
|
||||
{
|
||||
$this->builder->setInheritData($inheritData);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCompound(bool $compound): static
|
||||
{
|
||||
$this->builder->setCompound($compound);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setType(ResolvedFormTypeInterface $type): static
|
||||
{
|
||||
$this->builder->setType($type);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setData(mixed $data): static
|
||||
{
|
||||
$this->builder->setData($data);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDataLocked(bool $locked): static
|
||||
{
|
||||
$this->builder->setDataLocked($locked);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFormFactory(FormFactoryInterface $formFactory)
|
||||
{
|
||||
$this->builder->setFormFactory($formFactory);
|
||||
}
|
||||
|
||||
public function setAction(string $action): static
|
||||
{
|
||||
$this->builder->setAction($action);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setMethod(string $method): static
|
||||
{
|
||||
$this->builder->setMethod($method);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setRequestHandler(RequestHandlerInterface $requestHandler): static
|
||||
{
|
||||
$this->builder->setRequestHandler($requestHandler);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setAutoInitialize(bool $initialize): static
|
||||
{
|
||||
$this->builder->setAutoInitialize($initialize);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFormConfig(): FormConfigInterface
|
||||
{
|
||||
return $this->builder->getFormConfig();
|
||||
}
|
||||
|
||||
public function setIsEmptyCallback(?callable $isEmptyCallback): static
|
||||
{
|
||||
$this->builder->setIsEmptyCallback($isEmptyCallback);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEventDispatcher(): EventDispatcherInterface
|
||||
{
|
||||
return $this->builder->getEventDispatcher();
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->builder->getName();
|
||||
}
|
||||
|
||||
public function getPropertyPath(): ?PropertyPathInterface
|
||||
{
|
||||
return $this->builder->getPropertyPath();
|
||||
}
|
||||
|
||||
public function getMapped(): bool
|
||||
{
|
||||
return $this->builder->getMapped();
|
||||
}
|
||||
|
||||
public function getByReference(): bool
|
||||
{
|
||||
return $this->builder->getByReference();
|
||||
}
|
||||
|
||||
public function getInheritData(): bool
|
||||
{
|
||||
return $this->builder->getInheritData();
|
||||
}
|
||||
|
||||
public function getCompound(): bool
|
||||
{
|
||||
return $this->builder->getCompound();
|
||||
}
|
||||
|
||||
public function getType(): ResolvedFormTypeInterface
|
||||
{
|
||||
return $this->builder->getType();
|
||||
}
|
||||
|
||||
public function getViewTransformers(): array
|
||||
{
|
||||
return $this->builder->getViewTransformers();
|
||||
}
|
||||
|
||||
public function getModelTransformers(): array
|
||||
{
|
||||
return $this->builder->getModelTransformers();
|
||||
}
|
||||
|
||||
public function getDataMapper(): ?DataMapperInterface
|
||||
{
|
||||
return $this->builder->getDataMapper();
|
||||
}
|
||||
|
||||
public function getRequired(): bool
|
||||
{
|
||||
return $this->builder->getRequired();
|
||||
}
|
||||
|
||||
public function getDisabled(): bool
|
||||
{
|
||||
return $this->builder->getDisabled();
|
||||
}
|
||||
|
||||
public function getErrorBubbling(): bool
|
||||
{
|
||||
return $this->builder->getErrorBubbling();
|
||||
}
|
||||
|
||||
public function getEmptyData(): mixed
|
||||
{
|
||||
return $this->builder->getEmptyData();
|
||||
}
|
||||
|
||||
public function getAttributes(): array
|
||||
{
|
||||
return $this->builder->getAttributes();
|
||||
}
|
||||
|
||||
public function hasAttribute(string $name): bool
|
||||
{
|
||||
return $this->builder->hasAttribute($name);
|
||||
}
|
||||
|
||||
public function getAttribute(string $name, mixed $default = null): mixed
|
||||
{
|
||||
return $this->builder->getAttribute($name, $default);
|
||||
}
|
||||
|
||||
public function getData(): mixed
|
||||
{
|
||||
return $this->builder->getData();
|
||||
}
|
||||
|
||||
public function getDataClass(): ?string
|
||||
{
|
||||
return $this->builder->getDataClass();
|
||||
}
|
||||
|
||||
public function getDataLocked(): bool
|
||||
{
|
||||
return $this->builder->getDataLocked();
|
||||
}
|
||||
|
||||
public function getFormFactory(): FormFactoryInterface
|
||||
{
|
||||
return $this->builder->getFormFactory();
|
||||
}
|
||||
|
||||
public function getAction(): string
|
||||
{
|
||||
return $this->builder->getAction();
|
||||
}
|
||||
|
||||
public function getMethod(): string
|
||||
{
|
||||
return $this->builder->getMethod();
|
||||
}
|
||||
|
||||
public function getRequestHandler(): RequestHandlerInterface
|
||||
{
|
||||
return $this->builder->getRequestHandler();
|
||||
}
|
||||
|
||||
public function getAutoInitialize(): bool
|
||||
{
|
||||
return $this->builder->getAutoInitialize();
|
||||
}
|
||||
|
||||
public function getOptions(): array
|
||||
{
|
||||
return $this->builder->getOptions();
|
||||
}
|
||||
|
||||
public function hasOption(string $name): bool
|
||||
{
|
||||
return $this->builder->hasOption($name);
|
||||
}
|
||||
|
||||
public function getOption(string $name, mixed $default = null): mixed
|
||||
{
|
||||
return $this->builder->getOption($name, $default);
|
||||
}
|
||||
|
||||
public function getIsEmptyCallback(): ?callable
|
||||
{
|
||||
return $this->builder->getIsEmptyCallback();
|
||||
}
|
||||
}
|
||||
39
sources/Forms/FormBuilder/FormTypeExtension.php
Normal file
39
sources/Forms/FormBuilder/FormTypeExtension.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\FormBuilder;
|
||||
|
||||
use Symfony\Component\Form\AbstractTypeExtension;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class FormTypeExtension extends AbstractTypeExtension
|
||||
{
|
||||
|
||||
public static function getExtendedTypes(): iterable
|
||||
{
|
||||
return [
|
||||
FormType::class
|
||||
];
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefined([
|
||||
'inputs',
|
||||
'outputs',
|
||||
'bindings',
|
||||
'listener_callback'
|
||||
]);
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
if(array_key_exists('listener_callback', $options)) {
|
||||
$builder->addEventListener(FormEvents::POST_SET_DATA, $options['listener_callback']);
|
||||
$builder->addEventListener(FormEvents::POST_SUBMIT, $options['listener_callback']);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
21
sources/Forms/FormBuilder/ResolvedFormType.php
Normal file
21
sources/Forms/FormBuilder/ResolvedFormType.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Forms\FormBuilder;
|
||||
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
use Symfony\Component\Form\ResolvedFormType as SymfonyResolvedFormType;
|
||||
use Symfony\Component\Form\ResolvedFormTypeInterface;
|
||||
|
||||
class ResolvedFormType extends SymfonyResolvedFormType implements ResolvedFormTypeInterface
|
||||
{
|
||||
protected function newBuilder(string $name, ?string $dataClass, FormFactoryInterface $factory, array $options): FormBuilderInterface
|
||||
{
|
||||
$builder = parent::newBuilder($name, $dataClass, $factory, $options);
|
||||
return new FormBuilder($builder);
|
||||
}
|
||||
}
|
||||
22
sources/Forms/FormBuilder/ResolvedFormTypeFactory.php
Normal file
22
sources/Forms/FormBuilder/ResolvedFormTypeFactory.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Forms\FormBuilder;
|
||||
|
||||
use Symfony\Component\Form\FormTypeInterface;
|
||||
use Symfony\Component\Form\ResolvedFormTypeFactoryInterface;
|
||||
use Symfony\Component\Form\ResolvedFormTypeInterface;
|
||||
|
||||
/**
|
||||
* Plumbing for iTop custom form builder.
|
||||
*/
|
||||
class ResolvedFormTypeFactory implements ResolvedFormTypeFactoryInterface
|
||||
{
|
||||
public function createResolvedType(FormTypeInterface $type, array $typeExtensions, ?ResolvedFormTypeInterface $parent = null): ResolvedFormTypeInterface
|
||||
{
|
||||
return new ResolvedFormType($type, $typeExtensions, $parent);
|
||||
}
|
||||
}
|
||||
68
sources/Forms/FormType/AttributeChoiceType.php
Normal file
68
sources/Forms/FormType/AttributeChoiceType.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\FormType;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Event\PreSubmitEvent;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AttributeChoiceType extends AbstractType
|
||||
{
|
||||
public function getParent(): string
|
||||
{
|
||||
return ChoiceType::class;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
|
||||
$resolver->setDefault('inputs', [
|
||||
'object_class' => 'string'
|
||||
]);
|
||||
|
||||
$resolver->setDefault('outputs', [
|
||||
'attribute' => function($oData) {
|
||||
return $oData;
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
// on pre submit
|
||||
$builder->addEventListener(FormEvents::PRE_SUBMIT, function (PreSubmitEvent $event) use ($options){
|
||||
|
||||
// reset value if not in available choices
|
||||
if(!empty($event->getData()) && !$this->CheckValue($event->getData(), $options)){
|
||||
$event->getForm()->addError(new FormError("The value has been reset because it is not part of the available choices anymore."));
|
||||
$event->setData(null);
|
||||
}
|
||||
|
||||
}, 1);
|
||||
}
|
||||
|
||||
private function CheckValue($oValue, $options): bool
|
||||
{
|
||||
|
||||
if(!in_array($oValue, $options['choices'])){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function GetOptionsFromInputs(array $inputs): array
|
||||
{
|
||||
$aAttributeCodes = \MetaModel::GetAttributesList($inputs['object_class']);
|
||||
|
||||
return [
|
||||
'choices' => array_combine($aAttributeCodes, $aAttributeCodes)
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
79
sources/Forms/FormType/AttributeValueChoiceType.php
Normal file
79
sources/Forms/FormType/AttributeValueChoiceType.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\FormType;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Event\PreSubmitEvent;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AttributeValueChoiceType extends AbstractType
|
||||
{
|
||||
public function getParent(): string
|
||||
{
|
||||
return ChoiceType::class;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefault('required', false);
|
||||
$resolver->setDefault('multiple', true);
|
||||
|
||||
$resolver->setDefault('attr', array(
|
||||
'size' => 10,
|
||||
'style' => 'height: auto;'
|
||||
));
|
||||
|
||||
$resolver->setDefault('inputs', array(
|
||||
'object_class' => 'string',
|
||||
'attribute' => 'string'
|
||||
));
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
// on pre submit
|
||||
$builder->addEventListener(FormEvents::PRE_SUBMIT, function (PreSubmitEvent $event) use ($options){
|
||||
|
||||
// reset value if not in available choices
|
||||
if(!empty($event->getData()) && !$this->CheckValue($event->getData(), $options)){
|
||||
$event->getForm()->addError(new FormError("The value has been reset because it is not part of the available choices anymore."));
|
||||
$event->setData(null);
|
||||
}
|
||||
|
||||
}, 1);
|
||||
}
|
||||
|
||||
private function CheckValue($oValue, $options): bool
|
||||
{
|
||||
if(!is_array($oValue)){
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($oValue as $v){
|
||||
if(!in_array($v, $options['choices'])){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function GetOptionsFromInputs(array $inputs): array
|
||||
{
|
||||
$aValues = [];
|
||||
|
||||
if(!empty($inputs['attribute'])){
|
||||
$oAttDef = \MetaModel::GetAttributeDef($inputs['object_class'], $inputs['attribute']);
|
||||
$aValues = $oAttDef->GetAllowedValues();
|
||||
$aValues = $aValues !== null ? array_combine($aValues, $aValues) : [];
|
||||
}
|
||||
|
||||
return [
|
||||
'choices' => $aValues
|
||||
];
|
||||
}
|
||||
}
|
||||
29
sources/Forms/FormType/OqlType.php
Normal file
29
sources/Forms/FormType/OqlType.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\FormType;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class OqlType extends AbstractType
|
||||
{
|
||||
public function getParent(): string
|
||||
{
|
||||
return TextType::class;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefault('outputs', array(
|
||||
'selected_class' => function($oData) {
|
||||
if($oData === null)
|
||||
return null;
|
||||
// extract selected class
|
||||
preg_match('/SELECT\s+(\w+)/', $oData, $aMatches);
|
||||
return $aMatches[1] ?? null;
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
46
sources/Forms/Forms.php
Normal file
46
sources/Forms/Forms.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Forms;
|
||||
|
||||
use Combodo\iTop\Forms\FormBuilder\FormTypeExtension;
|
||||
use Combodo\iTop\Forms\FormBuilder\ResolvedFormTypeFactory;
|
||||
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension;
|
||||
use Symfony\Component\Form\FormFactoryBuilder;
|
||||
use Symfony\Component\Form\FormFactoryBuilderInterface;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
|
||||
/**
|
||||
* Plumbing for iTop custom form builder.
|
||||
*/
|
||||
final class Forms
|
||||
{
|
||||
/**
|
||||
* Creates a form factory with the iTop configuration.
|
||||
*/
|
||||
public static function createFormFactory(): FormFactoryInterface
|
||||
{
|
||||
return self::createFormFactoryBuilder()->getFormFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a form factory builder with the iTop configuration.
|
||||
*/
|
||||
public static function createFormFactoryBuilder(): FormFactoryBuilderInterface
|
||||
{
|
||||
return (new FormFactoryBuilder())
|
||||
->addExtension(new HttpFoundationExtension())
|
||||
->addTypeExtension(new FormTypeExtension())
|
||||
->setResolvedTypeFactory(new ResolvedFormTypeFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
* This class cannot be instantiated.
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
{% if type == 'text' %}{% set ibo_class='ibo-input-string' %}{% else %}{% set ibo_class='ibo-input-' ~ type %}{% endif %}
|
||||
{% set attr = attr|merge({class: (attr.class|default('') ~ ' ibo-input ' ~ ibo_class)|trim}) %}
|
||||
{{- parent() -}}
|
||||
onChange="this.form.requestSubmit();"
|
||||
{%- endblock widget_attributes -%}
|
||||
|
||||
{%- block form_label -%}
|
||||
@@ -21,3 +22,9 @@
|
||||
{% set row_attr = row_attr|merge({class: (row_attr.class|default('') ~ ' ibo-field ibo-content-block ibo-block ibo-field-small')|trim}) %}
|
||||
{{- parent() -}}
|
||||
{%- endblock form_row -%}
|
||||
|
||||
{%- block form_errors -%}
|
||||
<div class="form-error">
|
||||
{{- parent() -}}
|
||||
</div>
|
||||
{%- endblock form_errors -%}
|
||||
|
||||
@@ -548,33 +548,39 @@ $aOptions = [
|
||||
];
|
||||
$oPage->add_style('.demo_set{color:red;}');
|
||||
|
||||
$oSimpleSetBlock = SetUIBlockFactory::MakeForSimple('SetSimple', $aOptions, 'label', 'value', ['label'], null, null, 'SimpleSetBlock');
|
||||
$oSimpleSetBlock = SetUIBlockFactory::MakeForSimple('SetSimple', $aOptions, 'label', 'value', ['label']);
|
||||
$oSimpleSetBlock->SetName('SimpleSetBlock');
|
||||
$oPage->AddUiBlock($oSimpleSetBlock);
|
||||
|
||||
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Add Option Button', 3));
|
||||
|
||||
$oSimpleAddSetBlock = SetUIBlockFactory::MakeForSimple('SetWithAddOption', $aOptions, 'label', 'value', ['label'], null, null, 'SetWithAddOption');
|
||||
$oSimpleAddSetBlock = SetUIBlockFactory::MakeForSimple('SetWithAddOption', $aOptions, 'label', 'value', ['label']);
|
||||
$oSimpleAddSetBlock->SetName('SetWithAddOption');
|
||||
$oSimpleAddSetBlock->SetHasAddOptionButton(true);
|
||||
$oPage->AddUiBlock($oSimpleAddSetBlock);
|
||||
|
||||
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Renderer', 3));
|
||||
|
||||
$oSimpleSetBlockRenderer = SetUIBlockFactory::MakeForSimple('SetRenderer', $aOptions, 'label', 'value', ['label'], null, null, 'SimpleSetBlockWithRenderer');
|
||||
$oSimpleSetBlockRenderer = SetUIBlockFactory::MakeForSimple('SetRenderer', $aOptions, 'label', 'value', ['label']);
|
||||
$oSimpleSetBlockRenderer->SetName('SimpleSetBlockWithRenderer');
|
||||
$oSimpleSetBlockRenderer->SetOptionsTemplate('base/components/input/set/simple_option_renderer.html.twig');
|
||||
$oSimpleSetBlockRenderer->SetItemsTemplate('base/components/input/set/simple_option_renderer.html.twig');
|
||||
$oPage->AddUiBlock($oSimpleSetBlockRenderer);
|
||||
|
||||
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Grouping', 3));
|
||||
|
||||
$oSimpleSetBlockGroup = SetUIBlockFactory::MakeForSimple('SetGroup', $aOptions, 'label', 'value', ['label'], 'group', null, 'SimpleSetBlockWithGroup');
|
||||
$oSimpleSetBlockGroup = SetUIBlockFactory::MakeForSimple('SetGroup', $aOptions, 'label', 'value', ['label'], 'group');
|
||||
$oSimpleSetBlockGroup->SetName('SimpleSetBlockWithGroup');
|
||||
$oPage->AddUiBlock($oSimpleSetBlockGroup);
|
||||
|
||||
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('OQL', 3));
|
||||
|
||||
$oSimpleSetBlockOql = SetUIBlockFactory::MakeForOQL('SetOql', 'Person', 'SELECT Person', null, [], null, 'OqlSet');
|
||||
$oSimpleSetBlockOql = SetUIBlockFactory::MakeForOQL('SetOql', 'Person', 'SELECT Person');
|
||||
$oSimpleSetBlockOql->SetName('OqlSet');
|
||||
$oPage->AddUiBlock($oSimpleSetBlockOql);
|
||||
|
||||
$oSimpleSetBlockOql2 = SetUIBlockFactory::MakeForOQL('SetOql2', 'Location', 'SELECT Location', null, [], null, 'OqlSet2');
|
||||
$oSimpleSetBlockOql2 = SetUIBlockFactory::MakeForOQL('SetOql2', 'Location', 'SELECT Location');
|
||||
$oSimpleSetBlockOql2->SetName('OqlSet2');
|
||||
$oPage->AddUiBlock($oSimpleSetBlockOql2);
|
||||
|
||||
$oPage->output();
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace UI\Base\Layout;
|
||||
|
||||
use ApplicationContext;
|
||||
use ApplicationMenu;
|
||||
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
|
||||
use Combodo\iTop\Application\UI\Base\Layout\NavigationMenu\NavigationMenu;
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
@@ -62,20 +61,4 @@ class NavigationMenuTest extends ItopDataTestCase {
|
||||
$this->assertEquals(true, $isAllowed);
|
||||
unlink($sTmpFilePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* test GetHyperlink return empty for TemplateMenuNode and ShortcutContainerMenuNode only
|
||||
*/
|
||||
public function testGetHyperlink(){
|
||||
ApplicationMenu::LoadAdditionalMenus();
|
||||
foreach (ApplicationMenu::$aMenusIndex as $sMenuId => $aMenu) {
|
||||
//echo ' **** '. get_class($aMenu['node']);
|
||||
if(in_array(get_class($aMenu['node']), ['TemplateMenuNode','ShortcutContainerMenuNode']) ){
|
||||
$this->assertEquals('', $aMenu['node']->GetHyperlink([]), 'Menu node '.$sMenuId.' is a TemplateMenuNode. It should have empty hyperlink');
|
||||
} else {
|
||||
$this->assertNotEquals('', $aMenu['node']->GetHyperlink([]),'Menu node '.$sMenuId.' is a '.get_class($aMenu['node']).'. It should have not empty hyperlink');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user