Compare commits

...

33 Commits

Author SHA1 Message Date
Anne-Cath
6efe0f5dac fix comment 2026-04-20 10:36:37 +02:00
Anne-Cath
ef720cf0be WIP 2026-04-20 10:19:09 +02:00
Anne-Cath
f90d10114d Fix test 2026-04-20 10:19:09 +02:00
Anne-Cath
da0066dd14 fix php doc 2026-04-20 10:19:08 +02:00
Anne-Catherine
3f68e161be Update application/cmdbabstract.class.inc.php
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com>
2026-04-20 10:19:08 +02:00
Anne-Cath
cc8c3d3bf1 N°7577 - Issue with GetAttributeFlags when Attributes are set to HIDDEN 2026-04-20 10:19:05 +02:00
Molkobain
f439490bfc Merge remote-tracking branch 'origin/support/3.2' into develop
# Conflicts:
#	approot.inc.php
#	core/config.class.inc.php
#	datamodels/2.x/authent-cas/module.authent-cas.php
#	datamodels/2.x/authent-external/module.authent-external.php
#	datamodels/2.x/authent-ldap/module.authent-ldap.php
#	datamodels/2.x/authent-local/module.authent-local.php
#	datamodels/2.x/combodo-backoffice-darkmoon-theme/module.combodo-backoffice-darkmoon-theme.php
#	datamodels/2.x/combodo-backoffice-fullmoon-high-contrast-theme/module.combodo-backoffice-fullmoon-high-contrast-theme.php
#	datamodels/2.x/combodo-backoffice-fullmoon-protanopia-deuteranopia-theme/module.combodo-backoffice-fullmoon-protanopia-deuteranopia-theme.php
#	datamodels/2.x/combodo-backoffice-fullmoon-tritanopia-theme/module.combodo-backoffice-fullmoon-tritanopia-theme.php
#	datamodels/2.x/combodo-db-tools/module.combodo-db-tools.php
#	datamodels/2.x/itop-attachments/module.itop-attachments.php
#	datamodels/2.x/itop-backup/module.itop-backup.php
#	datamodels/2.x/itop-bridge-cmdb-services/module.itop-bridge-cmdb-services.php
#	datamodels/2.x/itop-bridge-cmdb-ticket/module.itop-bridge-cmdb-ticket.php
#	datamodels/2.x/itop-bridge-datacenter-mgmt-services/module.itop-bridge-datacenter-mgmt-services.php
#	datamodels/2.x/itop-bridge-endusers-devices-services/module.itop-bridge-endusers-devices-services.php
#	datamodels/2.x/itop-bridge-storage-mgmt-services/module.itop-bridge-storage-mgmt-services.php
#	datamodels/2.x/itop-bridge-virtualization-mgmt-services/module.itop-bridge-virtualization-mgmt-services.php
#	datamodels/2.x/itop-bridge-virtualization-storage/module.itop-bridge-virtualization-storage.php
#	datamodels/2.x/itop-change-mgmt-itil/module.itop-change-mgmt-itil.php
#	datamodels/2.x/itop-change-mgmt/module.itop-change-mgmt.php
#	datamodels/2.x/itop-config-mgmt/module.itop-config-mgmt.php
#	datamodels/2.x/itop-config/module.itop-config.php
#	datamodels/2.x/itop-core-update/module.itop-core-update.php
#	datamodels/2.x/itop-datacenter-mgmt/module.itop-datacenter-mgmt.php
#	datamodels/2.x/itop-endusers-devices/module.itop-endusers-devices.php
#	datamodels/2.x/itop-faq-light/module.itop-faq-light.php
#	datamodels/2.x/itop-files-information/module.itop-files-information.php
#	datamodels/2.x/itop-full-itil/module.itop-full-itil.php
#	datamodels/2.x/itop-hub-connector/module.itop-hub-connector.php
#	datamodels/2.x/itop-incident-mgmt-itil/module.itop-incident-mgmt-itil.php
#	datamodels/2.x/itop-knownerror-mgmt/module.itop-knownerror-mgmt.php
#	datamodels/2.x/itop-oauth-client/module.itop-oauth-client.php
#	datamodels/2.x/itop-portal-base/module.itop-portal-base.php
#	datamodels/2.x/itop-portal/module.itop-portal.php
#	datamodels/2.x/itop-problem-mgmt/module.itop-problem-mgmt.php
#	datamodels/2.x/itop-profiles-itil/module.itop-profiles-itil.php
#	datamodels/2.x/itop-request-mgmt-itil/module.itop-request-mgmt-itil.php
#	datamodels/2.x/itop-request-mgmt/module.itop-request-mgmt.php
#	datamodels/2.x/itop-service-mgmt-provider/module.itop-service-mgmt-provider.php
#	datamodels/2.x/itop-service-mgmt/module.itop-service-mgmt.php
#	datamodels/2.x/itop-sla-computation/module.itop-sla-computation.php
#	datamodels/2.x/itop-storage-mgmt/module.itop-storage-mgmt.php
#	datamodels/2.x/itop-structure/module.itop-structure.php
#	datamodels/2.x/itop-themes-compat/module.itop-themes-compat.php
#	datamodels/2.x/itop-tickets/module.itop-tickets.php
#	datamodels/2.x/itop-virtualization-mgmt/module.itop-virtualization-mgmt.php
#	datamodels/2.x/itop-welcome-itil/module.itop-welcome-itil.php
#	datamodels/2.x/version.xml
2026-04-20 09:24:02 +02:00
Molkobain
39011faedd Update ITOP_VERSION constant version for 3.2.3 release 2026-04-20 09:17:18 +02:00
Stephen Abello
46f8f5faeb Update modules and constants version for 3.2.3 release 2026-04-17 15:24:10 +02:00
Stephen Abello
170d24d0ad Update licenses for 3.2.3 release 2026-04-17 15:17:55 +02:00
v-dumas
9683b8d96a N°9499 - Ticket ITIL: remove 'request type' from UserRequest details 2026-04-17 09:51:01 +02:00
Molkobain
a6171c896b Merge remote-tracking branch 'origin/support/3.2' into develop 2026-04-17 09:20:18 +02:00
Benjamin DALSASS
89231976f8 Revert N°8638 - Adapt mysqldump calls to follow iTop SSL configuration 2026-04-16 15:00:01 +02:00
Stephen Abello
4e24ac508d Merge branch 'support/3.2' into develop 2026-04-15 17:01:58 +02:00
Molkobain
e1c804139f 👥 Add Lénaick to the sample data, welcome! 🙌 2026-04-15 16:55:19 +02:00
Stephen Abello
f0a95cbb3d N°9447 - Harmonize title and panel logo rules 2026-04-15 16:49:52 +02:00
Stephen Abello
265acb4a1e Merge branch 'support/3.2' into develop
# Conflicts:
#	css/setup.css
2026-04-15 15:16:01 +02:00
Stephen Abello
30f720b9ad N°9447 - Setup logo is repeating vertically (#884) 2026-04-15 15:13:28 +02:00
Benjamin DALSASS
1992c7e7c1 Merge remote-tracking branch 'origin/support/3.2' into develop 2026-04-14 09:09:23 +02:00
Benjamin DALSASS
87dd003a6d N°8638 - Adapt mysqldump calls to follow iTop SSL configuration
- fix unitary test
2026-04-14 08:54:54 +02:00
Benjamin DALSASS
4dbaaad2b9 N°9379 - PHP unserialze function - security hardening 2026-04-14 08:43:47 +02:00
Benjamin DALSASS
2fe49fbff4 Merge remote-tracking branch 'origin/support/3.2' into develop
# Conflicts:
#	core/attributedef.class.inc.php
#	css/backoffice/_shame.scss
#	pages/csvimport.php
2026-04-14 08:41:54 +02:00
Benjamin Dalsass
7201bef8db N°8638 - Adapt mysqldump calls to follow iTop SSL configuration (#883) 2026-04-14 08:08:17 +02:00
Benjamin Dalsass
af01ff9e62 N°9121 - CSV Import : The advanced mode option no longer works as bef… (#863) 2026-04-14 08:02:00 +02:00
Molkobain
ab1290dfd0 N°8766 - Fix user's login displayed in backoffice log entry instead of user's contact friendlyname when user is disabled 2026-04-13 21:14:03 +02:00
Stephen Abello
68d14c4de6 N°9468 - Fix double scroll down bars in input set (#876) 2026-04-13 16:28:56 +02:00
Benjamin Dalsass
a96e1c286d N°9379 PHP unserialize encapsulation (#878) 2026-04-13 16:04:00 +02:00
Stephen Abello
b799be3cb7 N°9177 - Blockquote in HTML field are unreadable in darkmoon (again) 2026-04-13 10:24:55 +02:00
jf-cbd
bcf1bb003c Merge remote-tracking branch 'origin/support/3.2' into develop 2026-04-13 10:17:26 +02:00
jf-cbd
d000d93b19 N°8766 - Fix wrong author on portal log (#880) 2026-04-13 10:10:40 +02:00
v-dumas
83a67dff96 N°9138 - restore old fieldset ids to ease migration 2026-04-10 16:53:26 +02:00
Stephen Abello
9f25635a64 N°9177 - Blockquote in HTML field are unreadable in darkmoon 2026-04-09 15:19:15 +02:00
Stephen Abello
6bd34dc73e N°4460 - Fix date and date time picker in Darkmoon 2026-04-08 14:59:36 +02:00
30 changed files with 527 additions and 500 deletions

View File

@@ -175,6 +175,10 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
*/ */
protected $sDisplayMode; protected $sDisplayMode;
protected $aFieldsMap; protected $aFieldsMap;
/**
* @var array Store posted values in order to be used in GetAttributeFlags
*/
protected $aPostedValues = [];
/** /**
* If true, bypass IsActionAllowedOnAttribute when writing this object * If true, bypass IsActionAllowedOnAttribute when writing this object
@@ -3794,7 +3798,33 @@ HTML;
return $aWriteableAttList; return $aWriteableAttList;
} }
/** /**
* function to test if the posted value or if not exists the existing value matches the expected value
* this is used to check the current value in GetAttributeFlags function (useful to manage dynamic readonly attributes)
* @param $sAttCode
*/
public function GetCurrentValueInScreen($sAttCode)
{
if (array_key_exists($sAttCode, $this->aPostedValues)) {
return $this->aPostedValues[$sAttCode];
}
return $this->Get($sAttCode);
}
/*
* This function checks if the value of the attribute has been modified in screen
* this is used to check if field has been modified in GetAttributeFlags function (useful to manage dynamic readonly attributes)
* @param $sAttCode
*/
public function IsModifiedValueInScreen($sAttCode)
{
if (array_key_exists($sAttCode, $this->aPostedValues)) {
return $this->aPostedValues[$sAttCode] != $this->Get($sAttCode);
}
return false;
}
/**
* Compute the attribute flags depending on the object state * Compute the attribute flags depending on the object state
*/ */
public function GetFormAttributeFlags($sAttCode) public function GetFormAttributeFlags($sAttCode)
@@ -3986,6 +4016,7 @@ HTML;
$aErrors = []; $aErrors = [];
$aFinalValues = []; $aFinalValues = [];
$this->aPostedValues = $aValues; // Store the values for later use (e.g. in GetAttributeFlags)
foreach ($this->GetWriteableAttList(array_keys($aValues), $aErrors, $aAttFlags) as $sAttCode => $oAttDef) { foreach ($this->GetWriteableAttList(array_keys($aValues), $aErrors, $aAttFlags) as $sAttCode => $oAttDef) {
$aFinalValues[$sAttCode] = $aValues[$sAttCode]; $aFinalValues[$sAttCode] = $aValues[$sAttCode];
} }

View File

@@ -1423,12 +1423,21 @@ class ShortcutMenuNode extends MenuNode
public function GetHyperlink($aExtraParams) public function GetHyperlink($aExtraParams)
{ {
$sContext = $this->oShortcut->Get('context'); $sContext = $this->oShortcut->Get('context');
$aContext = unserialize($sContext); try {
if (isset($aContext['menu'])) { $aContext = utils::Unserialize($sContext);
unset($aContext['menu']); if (isset($aContext['menu'])) {
} unset($aContext['menu']);
foreach ($aContext as $sArgName => $sArgValue) { }
$aExtraParams[$sArgName] = $sArgValue; foreach ($aContext as $sArgName => $sArgValue) {
$aExtraParams[$sArgName] = $sArgValue;
}
} catch (Exception $e) {
IssueLog::Warning("User shortcut corrupted, delete the shortcut", LogChannels::CONSOLE, [
'shortcut_name' => $this->oShortcut->GetName(),
'root_cause' => $e->getMessage(),
]);
// delete the shortcut
$this->oShortcut->DBDelete();
} }
return parent::GetHyperlink($aExtraParams); return parent::GetHyperlink($aExtraParams);
} }

View File

@@ -3146,4 +3146,50 @@ TXT
return $aTrace; return $aTrace;
} }
/**
* PHP unserialize encapsulation, allow throwing exception when not allowed object class is detected (for security hardening)
*
* @param string $data data to unserialize
* @param array $aOptions PHP @unserialise options
* @param bool $bThrowNotAllowedObjectClassException flag to throw exception
*
* @return mixed PHP @unserialise return
* @throws Exception
*/
public static function Unserialize(string $data, array $aOptions = ['allowed_classes' => false], bool $bThrowNotAllowedObjectClassException = true): mixed
{
$data = unserialize($data, $aOptions);
if ($bThrowNotAllowedObjectClassException) {
try {
self::AssertNoIncompleteClassDetected($data);
} catch (Exception $e) {
throw new CoreException('Unserialization failed because an incomplete class was detected.', [], '', $e);
}
}
return $data;
}
/**
* Assert that data provided doesn't contain any incomplete class.
*
* @throws Exception
*/
public static function AssertNoIncompleteClassDetected(mixed $data): void
{
if (is_object($data)) {
if ($data instanceof __PHP_Incomplete_Class) {
throw new Exception('__PHP_Incomplete_Class_Name object detected');
}
foreach (get_object_vars($data) as $property) {
self::AssertNoIncompleteClassDetected($property);
}
} elseif (is_array($data)) {
foreach ($data as $value) {
self::AssertNoIncompleteClassDetected($value);
}
}
}
} }

View File

@@ -1182,7 +1182,7 @@ class UserRights
return self::$m_oUser->GetKey(); return self::$m_oUser->GetKey();
} else { } else {
// find the id out of the login string // find the id out of the login string
$oUser = self::FindUser($sLogin); $oUser = self::FindUser($sLogin, bAllowDisabledUsers: true);
if (is_null($oUser)) { if (is_null($oUser)) {
return null; return null;
} }
@@ -1375,7 +1375,7 @@ class UserRights
if (empty($sLogin)) { if (empty($sLogin)) {
$oUser = self::$m_oUser; $oUser = self::$m_oUser;
} else { } else {
$oUser = self::FindUser($sLogin); $oUser = self::FindUser($sLogin, bAllowDisabledUsers: true);
} }
if (is_null($oUser)) { if (is_null($oUser)) {
return ''; return '';

View File

@@ -56,6 +56,8 @@ $ibo-shame--slider--is-round--border-radius: 20px !default;
$ibo-shame--slider--is-round--before--border-radius: 7px !default; $ibo-shame--slider--is-round--before--border-radius: 7px !default;
$ibo-blockquote--color: $ibo-body-text-color !default;
// N°2847 - Recolor svg illustrations with iTop's primary color // N°2847 - Recolor svg illustrations with iTop's primary color
.ibo-svg-illustration--container > svg *[fill="#6c63ff"]{ .ibo-svg-illustration--container > svg *[fill="#6c63ff"]{
fill: $ibo-svg-illustration--fill; fill: $ibo-svg-illustration--fill;
@@ -126,3 +128,11 @@ input:checked + .slider:before {
.slider.round:before { .slider.round:before {
border-radius: $ibo-shame--slider--is-round--before--border-radius; border-radius: $ibo-shame--slider--is-round--before--border-radius;
} }
/*
Bulma sets blockquote background color through a variable, it affects ckeditor and html display.
This rule is needed harmonize the blockquote text color in both contexts.
*/
.ibo-is-html-content blockquote {
color: $ibo-blockquote--color;
}

View File

@@ -185,16 +185,20 @@ $ibo-panel--is-selectable--body--after--font-size: $ibo-font-size-700 !default;
.ibo-panel--icon-img, .ibo-panel--icon-background { // second class is deprecated, remove it when dealing with N°9317 .ibo-panel--icon-img, .ibo-panel--icon-background { // second class is deprecated, remove it when dealing with N°9317
width: 100%; width: 100%;
height: 100%; height: 100%;
object-position: center;
object-fit: $ibo-panel--icon-img--size--must-contain;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: $ibo-panel--icon-img--size--must-contain; background-size: $ibo-panel--icon-img--size--must-contain;
} }
.ibo-panel--icon-img--must-contain, .ibo-panel--icon-background--must-contain { // second class is deprecated, remove it when dealing with N°9317 .ibo-panel--icon-img--must-contain, .ibo-panel--icon-background--must-contain { // second class is deprecated, remove it when dealing with N°9317
object-fit: $ibo-panel--icon-img--size--must-contain;
background-size: $ibo-panel--icon-img--size--must-contain; background-size: $ibo-panel--icon-img--size--must-contain;
} }
.ibo-panel--icon-img--must-cover, .ibo-panel--icon-background--must-cover { // second class is deprecated, remove it when dealing with N°9317 .ibo-panel--icon-img--must-cover, .ibo-panel--icon-background--must-cover { // second class is deprecated, remove it when dealing with N°9317
object-fit: $ibo-panel--icon-img--size--must-cover;
background-size: $ibo-panel--icon-img--size--must-cover; background-size: $ibo-panel--icon-img--size--must-cover;
} }

View File

@@ -51,19 +51,23 @@ $ibo-title--icon-img--size--must-zoomout: $ibo-title--icon-background--size--mus
width: 100%; width: 100%;
height: 100%; height: 100%;
object-position: center; object-position: center;
object-fit: $ibo-title--icon-img--size--must-contain;
background-size: $ibo-title--icon-img--size--must-contain; background-size: $ibo-title--icon-img--size--must-contain;
} }
.ibo-title--icon-img--must-contain, .ibo-title--icon-background--must-contain { // second class is deprecated, remove it when dealing with N°9317 .ibo-title--icon-img--must-contain, .ibo-title--icon-background--must-contain { // second class is deprecated, remove it when dealing with N°9317
object-fit: $ibo-title--icon-img--size--must-contain;
background-size: $ibo-title--icon-img--size--must-contain; background-size: $ibo-title--icon-img--size--must-contain;
} }
.ibo-title--icon-img--must-cover, .ibo-title--icon-background--must-cover { // second class is deprecated, remove it when dealing with N°9317 .ibo-title--icon-img--must-cover, .ibo-title--icon-background--must-cover { // second class is deprecated, remove it when dealing with N°9317
object-fit: $ibo-title--icon-img--size--must-cover;
background-size: $ibo-title--icon-img--size--must-cover; background-size: $ibo-title--icon-img--size--must-cover;
} }
.ibo-title--icon-img--must-zoomout, .ibo-title--icon-background--must-zoomout { // second class is deprecated, remove it when dealing with N°9317 .ibo-title--icon-img--must-zoomout, .ibo-title--icon-background--must-zoomout { // second class is deprecated, remove it when dealing with N°9317
background-size: $ibo-title--icon-img--size--must-zoomout; width: $ibo-title--icon-img--size--must-zoomout;
height: $ibo-title--icon-img--size--must-zoomout;
} }
.ibo-title--for-object-details { .ibo-title--for-object-details {

View File

@@ -203,8 +203,9 @@ $ibo-input-select--autocomplete-item-image--border: 1px solid $ibo-color-grey-60
} }
// N°7982 Default selectize stylesheet override // N°7982 Default selectize stylesheet override
// N°9468 Dropdown content needs to be a few pixel shorter than the dropdown itself to avoid double scrollbar
.selectize-dropdown-content{ .selectize-dropdown-content{
max-height: $ibo-input-select-selectize--dropdown--max-height; max-height: calc(#{$ibo-input-select-selectize--dropdown--max-height} - 4px);
} }
.selectize-dropdown.ui-menu .ui-state-active { .selectize-dropdown.ui-menu .ui-state-active {

View File

@@ -21,6 +21,7 @@ $text-strong: inherit !default;
* See https://bulma.io/documentation/elements/content/ * See https://bulma.io/documentation/elements/content/
*/ */
$content-block-margin-bottom: 0 !default; $content-block-margin-bottom: 0 !default;
$content-blockquote-background-color: $ibo-color-grey-200 !default;
/* Table: Reset style as much as possible to match rich text editor preview, which is the browser's default stylesheet. /* Table: Reset style as much as possible to match rich text editor preview, which is the browser's default stylesheet.
* As there is no way to avoid bulma rules, we simply make them invalid by setting an invalid variable value, the rules will then be ignored by the browser. * As there is no way to avoid bulma rules, we simply make them invalid by setting an invalid variable value, the rules will then be ignored by the browser.

File diff suppressed because one or more lines are too long

View File

@@ -76,6 +76,7 @@ $text-strong: inherit !default;
$code: $ibo-color-primary-400 !default; $code: $ibo-color-primary-400 !default;
$code-background: $ibo-color-grey-700 !default; $code-background: $ibo-color-grey-700 !default;
$pre-background: $ibo-color-grey-600 !default; $pre-background: $ibo-color-grey-600 !default;
$content-blockquote-background-color: $ibo-color-grey-600 !default;
$ibo-scrollbar--scrollbar-track-background-color: $ibo-color-grey-700 !default; $ibo-scrollbar--scrollbar-track-background-color: $ibo-color-grey-700 !default;
$ibo-scrollbar--scrollbar-thumb-background-color: $ibo-color-grey-900 !default; $ibo-scrollbar--scrollbar-thumb-background-color: $ibo-color-grey-900 !default;
@@ -198,6 +199,7 @@ $ibo-input-select--action-button--color: $ibo-input-select-wrapper--after--color
$ibo-input-select-selectize--item--active--text-color: $ibo-color-grey-100 !default; $ibo-input-select-selectize--item--active--text-color: $ibo-color-grey-100 !default;
$ibo-input-select-selectize--item--active--background-color: $ibo-color-grey-500 !default; $ibo-input-select-selectize--item--active--background-color: $ibo-color-grey-500 !default;
$ibo-input-select--autocomplete-item-image--background-color: $ibo-color-grey-800 !default; $ibo-input-select--autocomplete-item-image--background-color: $ibo-color-grey-800 !default;
$ibo-input-date--button--color: $ibo-input-select--action-button--color;
$ibo-vendors-selectize-input--color: $ibo-body-text-color !default; $ibo-vendors-selectize-input--color: $ibo-body-text-color !default;
$ibo-vendors-selectize-input--background-color: $ibo-input--background-color !default; $ibo-vendors-selectize-input--background-color: $ibo-input--background-color !default;
$ibo-vendors-selectize--input--border-color: $ibo-input--border-color !default; $ibo-vendors-selectize--input--border-color: $ibo-input--border-color !default;
@@ -245,6 +247,11 @@ $ibo-vendors-datatables--row-highlight--colors:('red': ($ibo-color-red-700),'dan
$ibo-vendors-jqueryui--ui-dialog--background-color: $ibo-color-grey-800 !default; $ibo-vendors-jqueryui--ui-dialog--background-color: $ibo-color-grey-800 !default;
$ibo-vendors-jqueryui--ui-dialog-titlebar--border-bottom: solid 1px $ibo-color-grey-500 !default; $ibo-vendors-jqueryui--ui-dialog-titlebar--border-bottom: solid 1px $ibo-color-grey-500 !default;
$ibo-vendors-jqueryui--ui-datepicker--background-color: $ibo-color-grey-700 !default;
$ibo-vendors-jqueryui--ui-datepicker-days--color: $ibo-color-primary-200 !default;
$ibo-vendors-jqueryui--ui-datepicker-days--highlight--background-color: $ibo-color-primary-800 !default;
$ibo-vendors-jqueryui--ui-datepicker-days--hover--background-color: $ibo-color-primary-500 !default;
$ibo-vendors-jqueryui--ui-datepicker-days--active--background-color: $ibo-color-primary-700 !default;

View File

@@ -1089,7 +1089,7 @@
<item id="col:col1"> <item id="col:col1">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="fieldset:ConfigMgmt:baseinfo"> <item id="fieldset:Server:baseinfo">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="name"> <item id="name">
@@ -1152,7 +1152,7 @@
<item id="col:col2"> <item id="col:col2">
<rank>20</rank> <rank>20</rank>
<items> <items>
<item id="fieldset:ConfigMgmt:dates"> <item id="fieldset:Server:Date">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="move2production"> <item id="move2production">
@@ -1186,7 +1186,7 @@
</item> </item>
</items> </items>
</item> </item>
<item id="fieldset:ConfigMgmt:otherinfo"> <item id="fieldset:Server:otherinfo">
<rank>30</rank> <rank>30</rank>
<items> <items>
<item id="description"> <item id="description">
@@ -1485,7 +1485,7 @@
<item id="col:col1"> <item id="col:col1">
<rank>120</rank> <rank>120</rank>
<items> <items>
<item id="fieldset:ConfigMgmt:baseinfo"> <item id="fieldset:Server:baseinfo">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="name"> <item id="name">
@@ -1554,7 +1554,7 @@
<item id="col:col2"> <item id="col:col2">
<rank>130</rank> <rank>130</rank>
<items> <items>
<item id="fieldset:ConfigMgmt:dates"> <item id="fieldset:Server:Date">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="move2production"> <item id="move2production">
@@ -1588,7 +1588,7 @@
</item> </item>
</items> </items>
</item> </item>
<item id="fieldset:ConfigMgmt:otherinfo"> <item id="fieldset:Server:otherinfo">
<rank>30</rank> <rank>30</rank>
<items> <items>
<item id="description"> <item id="description">

View File

@@ -1598,9 +1598,6 @@
<item id="fieldset:Ticket:Type"> <item id="fieldset:Ticket:Type">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="request_type">
<rank>10</rank>
</item>
<item id="impact"> <item id="impact">
<rank>20</rank> <rank>20</rank>
</item> </item>

View File

@@ -865,7 +865,7 @@
<item id="col:col1"> <item id="col:col1">
<rank>100</rank> <rank>100</rank>
<items> <items>
<item id="fieldset:ConfigMgmt:baseinfo"> <item id="fieldset:Server:baseinfo">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="name"> <item id="name">
@@ -891,7 +891,7 @@
</item> </item>
</items> </items>
</item> </item>
<item id="fieldset:Storage:moreinfo"> <item id="fieldset:Server:moreinfo">
<rank>20</rank> <rank>20</rank>
<items> <items>
<item id="brand_id"> <item id="brand_id">
@@ -919,7 +919,7 @@
<item id="col:col2"> <item id="col:col2">
<rank>110</rank> <rank>110</rank>
<items> <items>
<item id="fieldset:ConfigMgmt:dates"> <item id="fieldset:Server:Date">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="move2production"> <item id="move2production">
@@ -950,7 +950,7 @@
</item> </item>
</items> </items>
</item> </item>
<item id="fieldset:ConfigMgmt:otherinfo"> <item id="fieldset:Server:otherinfo">
<rank>30</rank> <rank>30</rank>
<items> <items>
<item id="description"> <item id="description">

File diff suppressed because one or more lines are too long

View File

@@ -812,7 +812,7 @@
<item id="col:col1"> <item id="col:col1">
<rank>90</rank> <rank>90</rank>
<items> <items>
<item id="fieldset:ConfigMgmt:baseinfo"> <item id="fieldset:Server:baseinfo">
<rank>10</rank> <rank>10</rank>
<items> <items>
<item id="name"> <item id="name">
@@ -871,7 +871,7 @@
</item> </item>
</items> </items>
</item> </item>
<item id="fieldset:ConfigMgmt:otherinfo"> <item id="fieldset:Server:otherinfo">
<rank>20</rank> <rank>20</rank>
<items> <items>
<item id="description"> <item id="description">

View File

@@ -120,6 +120,7 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
this.sFormAttCode = sFormAttCode; this.sFormAttCode = sFormAttCode;
var me = this; var me = this;
const iDropdownContentHeightDifference = 4;
this.Init = function () { this.Init = function () {
// make sure that the form is clean // make sure that the form is clean
@@ -171,7 +172,7 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
// To avoid dropdown to be cut by the container's overflow hidden rule // To avoid dropdown to be cut by the container's overflow hidden rule
dropdownParent: 'body', dropdownParent: 'body',
onDropdownOpen: function (oDropdownElem) { onDropdownOpen: function (oDropdownElem) {
me.UpdateDropdownPosition(this.$control, oDropdownElem); me.UpdateDropdownPosition(this.$control, oDropdownElem, this.$dropdown_content);
}, },
}); });
let $selectize = $select[0].selectize; // This stores the selectize object to a variable (with name 'selectize') let $selectize = $select[0].selectize; // This stores the selectize object to a variable (with name 'selectize')
@@ -314,13 +315,14 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
}; };
/** /**
* Update the dropdown's position so it always fits in the screen * Update the dropdown's position so it always fits in the screen
* *
* @param {object} oControlElem jQuery object representing the "control" input (= where the user types) of the external key * @param {object} oControlElem jQuery object representing the "control" input (= where the user types) of the external key
* @param {object} oDropdownElem jQuery object representing the results dropdown * @param {object} oDropdownElem jQuery object representing the results dropdown
* @return {void} * @param {object|undefined} oDropdownContentElem
*/ * @return {void}
this.UpdateDropdownPosition = function (oControlElem, oDropdownElem) { */
this.UpdateDropdownPosition = function (oControlElem, oDropdownElem, oDropdownContentElem) {
// First fix width to ensure it's not too long // First fix width to ensure it's not too long
const fControlWidth = oControlElem.outerWidth(); const fControlWidth = oControlElem.outerWidth();
oDropdownElem.css('width', fControlWidth); oDropdownElem.css('width', fControlWidth);
@@ -328,6 +330,13 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
// Then, fix height / position to ensure it's within the viewport // Then, fix height / position to ensure it's within the viewport
const fWindowHeight = window.innerHeight; const fWindowHeight = window.innerHeight;
// Clear previously set rule so the comparison is done with dropdown real height
oDropdownElem.css('max-height', '');
if(oDropdownContentElem) {
oDropdownContentElem.css('max-height', '');
}
const fControlTopY = oControlElem.offset().top; const fControlTopY = oControlElem.offset().top;
const fControlHeight = oControlElem.outerHeight(); const fControlHeight = oControlElem.outerHeight();
@@ -338,14 +347,38 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
if (fDropdownBottomY > fWindowHeight) { if (fDropdownBottomY > fWindowHeight) {
// Set dropdown max-height to 1/3 of the screen, this way we are sure the dropdown will fit in either the top / bottom half of the screen // Set dropdown max-height to 1/3 of the screen, this way we are sure the dropdown will fit in either the top / bottom half of the screen
oDropdownElem.css('max-height', '30vh'); oDropdownElem.css({
maxHeight: '30vh',
});
fDropdownHeight = oDropdownElem.outerHeight(); fDropdownHeight = oDropdownElem.outerHeight();
// Position dropdown above input if not enough space on the bottom part of the screen // N°9468 Dropdown content needs to be a few pixel shorter than the dropdown itself to avoid double scrollbar
if(oDropdownContentElem) {
oDropdownContentElem.css('max-height', `calc(30vh - ${iDropdownContentHeightDifference}px)`);
}
/* Position dropdown above input if not enough space on the bottom part of the screen
Doesn't seem to work with selectize as an internal plugin "auto_position" refreshes the top position after
this method is called, input set use a custom plugin to avoid fix this issue "plugin_combodo_auto_position"
This would need to take the potential 4px difference (iDropdownContentHeightDifference) into account if this is fixed.
*/
if ((fDropdownTopY / fWindowHeight) > 0.6) { if ((fDropdownTopY / fWindowHeight) > 0.6) {
oDropdownElem.css('top', fDropdownTopY - fDropdownHeight - fControlHeight); oDropdownElem.css({
} top: fDropdownTopY - fDropdownHeight - fControlHeight,
borderTop: oDropdownElem.css('border-bottom')
});
}
else {
oDropdownElem.css({
borderTop: 'none'
})
}
} }
else {
oDropdownElem.css({
borderTop: 'none'
})
}
}; };
this.ManageScroll = function () { this.ManageScroll = function () {
if ($('#label_'+me.id).scrollParent()[0].tagName != 'HTML') { if ($('#label_'+me.id).scrollParent()[0].tagName != 'HTML') {

View File

@@ -19,10 +19,11 @@ Selectize.define("combodo_auto_position", function (aOptions) {
// Selectize instance // Selectize instance
let oSelf = this; let oSelf = this;
const iDropdownContentHeightDifference = 4;
// Plugin options // Plugin options
aOptions = $.extend({ aOptions = $.extend({
maxDropDownHeight: 200, maxDropDownHeight: '200px',
}, },
aOptions aOptions
); );
@@ -33,28 +34,47 @@ Selectize.define("combodo_auto_position", function (aOptions) {
// Override position dropdown function // Override position dropdown function
oSelf.positionDropdown = (function () { oSelf.positionDropdown = (function () {
return function () { return function () {
let iRefHeight = oSelf.$dropdown.outerHeight() < aOptions.maxDropDownHeight ? // Clear previously set rules so the comparison is done with dropdown real height
oSelf.$dropdown.outerHeight() : aOptions.maxDropDownHeight; oSelf.$dropdown.css({
'max-height': '',
});
if(oSelf.$control.offset().top + oSelf.$control.outerHeight() + iRefHeight > window.innerHeight){ oSelf.$dropdown_content.css({
'max-height': '',
});
oSelf.$dropdown.css({ let iDropdownHeight = oSelf.$dropdown.outerHeight();
top: oSelf.$control.offset().top - iRefHeight, if(oSelf.$control.offset().top + oSelf.$control.outerHeight() + iDropdownHeight > window.innerHeight){
left: oSelf.$control.offset().left,
// Apply max-height as we are overflowing, that'll allow us to calculate where we should place ourselves later
oSelf.$dropdown.css({
maxHeight: `${aOptions.maxDropDownHeight}`,
})
iDropdownHeight = oSelf.$dropdown.outerHeight();
oSelf.$dropdown.css({
top: oSelf.$control.offset().top - iDropdownHeight + iDropdownContentHeightDifference, // Content will be shorter, so our real height too
left: oSelf.$control.offset().left,
width: oSelf.$wrapper.outerWidth(), width: oSelf.$wrapper.outerWidth(),
'max-height': `${aOptions.maxDropDownHeight}px`, overflowY: 'auto',
'overflow-y': 'auto', borderTop : oSelf.$dropdown.css('border-bottom')
'border-top': '1px solid #d0d0d0',
}); });
// N°9468 Dropdown content needs to be a few pixel shorter than the dropdown itself to avoid double scrollbar
oSelf.$dropdown_content.css({
'max-height': `calc(${aOptions.maxDropDownHeight} - ${iDropdownContentHeightDifference}px)`
});
} }
else{ else{
oSelf.$dropdown.css({ oSelf.$dropdown.css({
top: oSelf.$control.offset().top + oSelf.$control.outerHeight(), top: oSelf.$control.offset().top + oSelf.$control.outerHeight(),
left: oSelf.$control.offset().left, left: oSelf.$control.offset().left,
width: oSelf.$wrapper.outerWidth(), width: oSelf.$wrapper.outerWidth(),
'max-height': `${aOptions.maxDropDownHeight}px`, overflowY: 'auto',
'overflow-y': 'auto' borderTop: 'none'
}); });
} }
}; };
}()); }());

View File

@@ -134,6 +134,7 @@ return array(
'Combodo\\iTop\\Application\\Helper\\CKEditorHelper' => $baseDir . '/sources/Application/Helper/CKEditorHelper.php', 'Combodo\\iTop\\Application\\Helper\\CKEditorHelper' => $baseDir . '/sources/Application/Helper/CKEditorHelper.php',
'Combodo\\iTop\\Application\\Helper\\ExportHelper' => $baseDir . '/sources/Application/Helper/ExportHelper.php', 'Combodo\\iTop\\Application\\Helper\\ExportHelper' => $baseDir . '/sources/Application/Helper/ExportHelper.php',
'Combodo\\iTop\\Application\\Helper\\FormHelper' => $baseDir . '/sources/Application/Helper/FormHelper.php', 'Combodo\\iTop\\Application\\Helper\\FormHelper' => $baseDir . '/sources/Application/Helper/FormHelper.php',
'Combodo\\iTop\\Application\\Helper\\ImportHelper' => $baseDir . '/sources/Application/Helper/ImportHelper.php',
'Combodo\\iTop\\Application\\Helper\\SearchHelper' => $baseDir . '/sources/Application/Helper/SearchHelper.php', 'Combodo\\iTop\\Application\\Helper\\SearchHelper' => $baseDir . '/sources/Application/Helper/SearchHelper.php',
'Combodo\\iTop\\Application\\Helper\\Session' => $baseDir . '/sources/Application/Helper/Session.php', 'Combodo\\iTop\\Application\\Helper\\Session' => $baseDir . '/sources/Application/Helper/Session.php',
'Combodo\\iTop\\Application\\Helper\\WebResourcesHelper' => $baseDir . '/sources/Application/Helper/WebResourcesHelper.php', 'Combodo\\iTop\\Application\\Helper\\WebResourcesHelper' => $baseDir . '/sources/Application/Helper/WebResourcesHelper.php',

View File

@@ -520,6 +520,7 @@ class ComposerStaticInitfc0e9e9dea11dcbb6272414776c30685
'Combodo\\iTop\\Application\\Helper\\CKEditorHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/CKEditorHelper.php', 'Combodo\\iTop\\Application\\Helper\\CKEditorHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/CKEditorHelper.php',
'Combodo\\iTop\\Application\\Helper\\ExportHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/ExportHelper.php', 'Combodo\\iTop\\Application\\Helper\\ExportHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/ExportHelper.php',
'Combodo\\iTop\\Application\\Helper\\FormHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/FormHelper.php', 'Combodo\\iTop\\Application\\Helper\\FormHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/FormHelper.php',
'Combodo\\iTop\\Application\\Helper\\ImportHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/ImportHelper.php',
'Combodo\\iTop\\Application\\Helper\\SearchHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/SearchHelper.php', 'Combodo\\iTop\\Application\\Helper\\SearchHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/SearchHelper.php',
'Combodo\\iTop\\Application\\Helper\\Session' => __DIR__ . '/../..' . '/sources/Application/Helper/Session.php', 'Combodo\\iTop\\Application\\Helper\\Session' => __DIR__ . '/../..' . '/sources/Application/Helper/Session.php',
'Combodo\\iTop\\Application\\Helper\\WebResourcesHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/WebResourcesHelper.php', 'Combodo\\iTop\\Application\\Helper\\WebResourcesHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/WebResourcesHelper.php',

View File

@@ -5,9 +5,11 @@
* @license http://opensource.org/licenses/AGPL-3.0 * @license http://opensource.org/licenses/AGPL-3.0
*/ */
use Combodo\iTop\Application\Helper\ImportHelper;
use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\Select;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\TextArea; use Combodo\iTop\Application\UI\Base\Component\Input\TextArea;
@@ -387,6 +389,14 @@ EOF
} }
break; break;
case 'display_classes_select':
$oPage = new AjaxPage("");
$sClassName = utils::ReadPostedParam('class_name', '', utils::ENUM_SANITIZATION_FILTER_CLASS);
$bAdvanced = utils::ReadPostedParam('advanced', 'false');
$oClassesSelect = ImportHelper::GetClassesSelectUIBlock('class_name', $sClassName, UR_ACTION_BULK_MODIFY, $bAdvanced === 'true');
$oPage->AddSubBlock($oClassesSelect);
break;
case 'get_csv_template': case 'get_csv_template':
$sClassName = utils::ReadParam('class_name'); $sClassName = utils::ReadParam('class_name');
$sFormat = utils::ReadParam('format', 'csv'); $sFormat = utils::ReadParam('format', 'csv');

View File

@@ -5,6 +5,7 @@
* @license http://opensource.org/licenses/AGPL-3.0 * @license http://opensource.org/licenses/AGPL-3.0
*/ */
use Combodo\iTop\Application\Helper\ImportHelper;
use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\CollapsibleSection\CollapsibleSectionUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\CollapsibleSection\CollapsibleSectionUIBlockFactory;
@@ -14,7 +15,6 @@ use Combodo\iTop\Application\UI\Base\Component\Form\FormUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Html\Html; use Combodo\iTop\Application\UI\Base\Component\Html\Html;
use Combodo\iTop\Application\UI\Base\Component\Input\FileSelect\FileSelectUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Input\FileSelect\FileSelectUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\Select;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\TextArea; use Combodo\iTop\Application\UI\Base\Component\Input\TextArea;
@@ -30,7 +30,6 @@ use Combodo\iTop\Application\WebPage\AjaxPage;
use Combodo\iTop\Application\WebPage\ErrorPage; use Combodo\iTop\Application\WebPage\ErrorPage;
use Combodo\iTop\Application\WebPage\iTopWebPage; use Combodo\iTop\Application\WebPage\iTopWebPage;
use Combodo\iTop\Application\WebPage\WebPage; use Combodo\iTop\Application\WebPage\WebPage;
use Combodo\iTop\Renderer\BlockRenderer;
use Combodo\iTop\Service\Import\CSVImportPageProcessor; use Combodo\iTop\Service\Import\CSVImportPageProcessor;
try { try {
@@ -52,46 +51,6 @@ try {
$oPage = new iTopWebPage(Dict::S('UI:Title:BulkImport')); $oPage = new iTopWebPage(Dict::S('UI:Title:BulkImport'));
$oPage->SetBreadCrumbEntry('ui-tool-bulkimport', Dict::S('Menu:CSVImportMenu'), Dict::S('UI:Title:BulkImport+'), '', 'fas fa-file-import', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES); $oPage->SetBreadCrumbEntry('ui-tool-bulkimport', Dict::S('Menu:CSVImportMenu'), Dict::S('UI:Title:BulkImport+'), '', 'fas fa-file-import', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES);
/**
* Helper function to build a select from the list of valid classes for a given action
*
* @param string $sName The name of the select in the HTML form
* @param $sDefaultValue
* @param integer $iWidthPx The width (in pixels) of the drop-down list
* @param integer $iActionCode The ActionCode (from UserRights) to check for authorization for the classes
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Select\
*/
function GetClassesSelectUIBlock(string $sName, $sDefaultValue, int $iActionCode, bool $bAdvanced = false): Select
{
$oSelectBlock = SelectUIBlockFactory::MakeForSelect($sName, 'select_'.$sName);
$oOption = SelectOptionUIBlockFactory::MakeForSelectOption("", Dict::S('UI:CSVImport:ClassesSelectOne'), false);
$oSelectBlock->AddSubBlock($oOption);
$aValidClasses = [];
$aClassCategories = ['bizmodel', 'addon/authentication'];
if ($bAdvanced) {
$aClassCategories[] = 'grant_by_profile';
}
if (UserRights::IsAdministrator()) {
$aClassCategories[] = 'application';
}
foreach ($aClassCategories as $sClassCategory) {
foreach (MetaModel::GetClasses($sClassCategory) as $sClassName) {
if ((is_null($iActionCode) || UserRights::IsActionAllowed($sClassName, $iActionCode)) &&
(!MetaModel::IsAbstract($sClassName))) {
$sDisplayName = ($bAdvanced) ? MetaModel::GetName($sClassName)." ($sClassName)" : MetaModel::GetName($sClassName);
$aValidClasses[$sDisplayName] = SelectOptionUIBlockFactory::MakeForSelectOption($sClassName, $sDisplayName, ($sClassName == $sDefaultValue));
}
}
}
ksort($aValidClasses);
foreach ($aValidClasses as $sValue => $oBlock) {
$oSelectBlock->AddSubBlock($oBlock);
}
return $oSelectBlock;
}
/** /**
* Helper to 'check' an input in an HTML form if the current value equals the value given * Helper to 'check' an input in an HTML form if the current value equals the value given
* *
@@ -330,7 +289,7 @@ try {
$oClassesSelect->AddSubBlock($oDefaultSelect); $oClassesSelect->AddSubBlock($oDefaultSelect);
$aSynchroUpdate = utils::ReadParam('synchro_update', []); $aSynchroUpdate = utils::ReadParam('synchro_update', []);
} else { } else {
$oClassesSelect = GetClassesSelectUIBlock('class_name', $sClassName, UR_ACTION_BULK_MODIFY, (bool)$bAdvanced); $oClassesSelect = ImportHelper::GetClassesSelectUIBlock('class_name', $sClassName, UR_ACTION_BULK_MODIFY, (bool)$bAdvanced);
} }
$oPanel = TitleUIBlockFactory::MakeForPage(Dict::S('UI:Title:CSVImportStep3')); $oPanel = TitleUIBlockFactory::MakeForPage(Dict::S('UI:Title:CSVImportStep3'));
$oPage->AddSubBlock($oPanel); $oPage->AddSubBlock($oPanel);
@@ -354,11 +313,9 @@ try {
$oAdvancedMode->GetInput()->SetIsChecked(($bAdvanced == 1)); $oAdvancedMode->GetInput()->SetIsChecked(($bAdvanced == 1));
$oAdvancedMode->SetBeforeInput(false); $oAdvancedMode->SetBeforeInput(false);
$oAdvancedMode->GetInput()->AddCSSClass('ibo-input-checkbox'); $oAdvancedMode->GetInput()->AddCSSClass('ibo-input-checkbox');
$oAdvancedMode->SetDescription(utils::EscapeHtml(Dict::S('UI:CSVImport:AdvancedMode+')));
$oMulticolumn->AddColumn(ColumnUIBlockFactory::MakeForBlock($oAdvancedMode)); $oMulticolumn->AddColumn(ColumnUIBlockFactory::MakeForBlock($oAdvancedMode));
$oDivAdvancedHelp = UIContentBlockUIBlockFactory::MakeStandard("advanced_help")->AddCSSClass('ibo-is-hidden');
$oForm->AddSubBlock($oDivAdvancedHelp);
$oDivMapping = UIContentBlockUIBlockFactory::MakeStandard("mapping")->AddCSSClass('mt-5'); $oDivMapping = UIContentBlockUIBlockFactory::MakeStandard("mapping")->AddCSSClass('mt-5');
$oMessage = AlertUIBlockFactory::MakeForInformation(Dict::S('UI:CSVImport:SelectAClassFirst'))->SetIsClosable(false)->SetIsCollapsible(false); $oMessage = AlertUIBlockFactory::MakeForInformation(Dict::S('UI:CSVImport:SelectAClassFirst'))->SetIsClosable(false)->SetIsCollapsible(false);
$oDivMapping->AddSubBlock($oMessage); $oDivMapping->AddSubBlock($oMessage);
@@ -395,7 +352,7 @@ try {
$oPage->add_ready_script( $oPage->add_ready_script(
<<<EOF <<<EOF
$('#select_class_name').on('change', function(ev) { DoMapping(); } ); $('#select_class_name').on('change', function(ev) { DoMapping(); } );
$('#advanced').on('click', function(ev) { DoReload(); } ); $('#advanced').on('click', function(ev) { DoAdvanced(); } );
EOF EOF
); );
if ($sClassName != '') { if ($sClassName != '') {
@@ -408,15 +365,15 @@ EOF
} }
$oPage->add_script( $oPage->add_script(
<<<EOF <<<JS
var aDefaultKeys = new Array(); var aDefaultKeys = new Array();
var aReadOnlyKeys = new Array(); var aReadOnlyKeys = new Array();
function DoReload() function DoAdvanced()
{ {
$('input[name=step]').val(3); $('input[name=step]').val(3);
$('#wizForm').removeAttr('onsubmit'); // No need to perform validation checks when going back $('#wizForm').removeAttr('onsubmit'); // No need to perform validation checks when going back
$('#wizForm').trigger('submit'); $('#wizForm').submit();
} }
function CSVGoBack() function CSVGoBack()
@@ -441,14 +398,7 @@ EOF
{ {
var class_name = $('select[name=class_name]').val(); var class_name = $('select[name=class_name]').val();
var advanced = $('input[name=advanced]:checked').val(); var advanced = $('input[name=advanced]:checked').val();
if (advanced != 1)
{
$('#advanced_help').hide();
}
else
{
$('#advanced_help').show();
}
if (class_name != '') if (class_name != '')
{ {
var separator = $('input[name=separator]').val(); var separator = $('input[name=separator]').val();
@@ -496,6 +446,26 @@ EOF
} }
} }
function UpdateClassesSelect()
{
const aParams = {
operation: 'display_classes_select',
class_name: $('#select_class_name').val(),
advanced: $('#advanced').is(':checked'),
};
$('#select_class_name').block();
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.csvimport.php',
aParams,
function(data) {
$('#select_class_name').replaceWith($(data));
$('#select_class_name').on('change', function(ev) { DoMapping(); } );
DoMapping();
}
);
}
function CheckValues() function CheckValues()
{ {
// Reset the highlight in case the check has already been executed with failure // Reset the highlight in case the check has already been executed with failure
@@ -626,7 +596,7 @@ EOF
} }
} }
} }
EOF JS
); );
} }
@@ -1044,7 +1014,7 @@ EOF
}*/ }*/
//Tab:Template //Tab:Template
$oTabTemplate = $oTabContainer->AddTab('tabsTemplate', Dict::S('UI:CSVImport:Tab:Templates')); $oTabTemplate = $oTabContainer->AddTab('tabsTemplate', Dict::S('UI:CSVImport:Tab:Templates'));
$oFieldTemplate = FieldUIBlockFactory::MakeFromObject(Dict::S('UI:CSVImport:PickClassForTemplate'), GetClassesSelectUIBlock('template_class', '', UR_ACTION_BULK_MODIFY)); $oFieldTemplate = FieldUIBlockFactory::MakeFromObject(Dict::S('UI:CSVImport:PickClassForTemplate'), ImportHelper::GetClassesSelectUIBlock('template_class', '', UR_ACTION_BULK_MODIFY));
$oTabTemplate->AddSubBlock($oFieldTemplate); $oTabTemplate->AddSubBlock($oFieldTemplate);
$oDivTemplate = UIContentBlockUIBlockFactory::MakeStandard("template")->AddCSSClass("ibo-is-visible"); $oDivTemplate = UIContentBlockUIBlockFactory::MakeStandard("template")->AddCSSClass("ibo-is-visible");
$oTabTemplate->AddSubBlock($oDivTemplate); $oTabTemplate->AddSubBlock($oDivTemplate);

View File

@@ -2643,6 +2643,58 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
]]></text>
</license>
<license>
<product scope="lib">doctrine/lexer</product>
<author>Guilherme Blanco - Roman Borschel - Johannes Schmitt</author>
<license_type>MIT</license_type>
<text><![CDATA[
Copyright (c) 2006-2018 Doctrine Project
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]></text>
</license>
<license>
<product scope="lib">egulias/email-validator</product>
<author>Eduardo Gulias Davis</author>
<license_type>MIT</license_type>
<text><![CDATA[
Copyright (c) 2013-2023 Eduardo Gulias Davis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]></text> ]]></text>
</license> </license>
<license> <license>
@@ -2778,204 +2830,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
]]></text>
</license>
<license>
<product scope="lib">laminas/laminas-loader</product>
<author/>
<license_type>BSD-3-Clause</license_type>
<text><![CDATA[
Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Laminas Foundation nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]></text>
</license>
<license>
<product scope="lib">laminas/laminas-mail</product>
<author/>
<license_type>BSD-3-Clause</license_type>
<text><![CDATA[
Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Laminas Foundation nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]></text>
</license>
<license>
<product scope="lib">laminas/laminas-mime</product>
<author/>
<license_type>BSD-3-Clause</license_type>
<text><![CDATA[
Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Laminas Foundation nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]></text>
</license>
<license>
<product scope="lib">laminas/laminas-servicemanager</product>
<author/>
<license_type>BSD-3-Clause</license_type>
<text><![CDATA[
Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Laminas Foundation nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]></text>
</license>
<license>
<product scope="lib">laminas/laminas-stdlib</product>
<author/>
<license_type>BSD-3-Clause</license_type>
<text><![CDATA[
Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Laminas Foundation nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]></text>
</license>
<license>
<product scope="lib">laminas/laminas-validator</product>
<author/>
<license_type>BSD-3-Clause</license_type>
<text><![CDATA[
Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Laminas Foundation nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]></text> ]]></text>
</license> </license>
<license> <license>
@@ -2985,7 +2839,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<text><![CDATA[ <text><![CDATA[
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2013-2020 Alex Bilbie <hello@alexbilbie.com> Copyright (c) 2013-2023 Alex Bilbie <hello@alexbilbie.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -3032,79 +2886,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
]]></text>
</license>
<license>
<product scope="lib">masterminds/html5</product>
<author>Matt Butcher - Matt Farina - Asmir Mustafic</author>
<license_type>MIT</license_type>
<text><![CDATA[
## HTML5-PHP License
Copyright (c) 2013 The Authors of HTML5-PHP
Matt Butcher - mattbutcher@google.com
Matt Farina - matt@mattfarina.com
Asmir Mustafic - goetas@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## HTML5Lib License
Portions of this are based on html5lib's PHP version, which was a
sub-project of html5lib. The following is the list of contributors from
html5lib:
html5lib:
Copyright (c) 2006-2009 The Authors
Contributors:
James Graham - jg307@cam.ac.uk
Anne van Kesteren - annevankesteren@gmail.com
Lachlan Hunt - lachlan.hunt@lachy.id.au
Matt McDonald - kanashii@kanashii.ca
Sam Ruby - rubys@intertwingly.net
Ian Hickson (Google) - ian@hixie.ch
Thomas Broyer - t.broyer@ltgt.net
Jacques Distler - distler@golem.ph.utexas.edu
Henri Sivonen - hsivonen@iki.fi
Adam Barth - abarth@webkit.org
Eric Seidel - eric@webkit.org
The Mozilla Foundation (contributions from Henri Sivonen since 2008)
David Flanagan (Mozilla) - dflanagan@mozilla.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]></text> ]]></text>
</license> </license>
<license> <license>
@@ -3141,34 +2922,6 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]></text>
</license>
<license>
<product scope="lib">paragonie/random_compat</product>
<author>Paragon Initiative Enterprises</author>
<license_type>MIT</license_type>
<text><![CDATA[
The MIT License (MIT)
Copyright (c) 2015 Paragon Initiative Enterprises
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]></text> ]]></text>
</license> </license>
<license> <license>
@@ -3499,7 +3252,7 @@ SOFTWARE.
</license> </license>
<license> <license>
<product scope="lib">sabberworm/php-css-parser</product> <product scope="lib">sabberworm/php-css-parser</product>
<author>Raphael Schweikert</author> <author>Raphael Schweikert - Oliver Klee - Jake Hotson</author>
<license_type>MIT</license_type> <license_type>MIT</license_type>
<text><![CDATA[ <text><![CDATA[
MIT License MIT License
@@ -3550,6 +3303,34 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]></text>
</license>
<license>
<product scope="lib">soundasleep/html2text</product>
<author>Jevon Wright</author>
<license_type>MIT</license_type>
<text><![CDATA[
MIT License
Copyright (c) 2019 Jevon Wright
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]></text> ]]></text>
</license> </license>
<license> <license>
@@ -3985,6 +3766,58 @@ to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]></text>
</license>
<license>
<product scope="lib">symfony/mailer</product>
<author>Fabien Potencier - Symfony Community</author>
<license_type>MIT</license_type>
<text><![CDATA[
Copyright (c) 2019-present Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]></text>
</license>
<license>
<product scope="lib">symfony/mime</product>
<author>Fabien Potencier - Symfony Community</author>
<license_type>MIT</license_type>
<text><![CDATA[
Copyright (c) 2010-present Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -4115,58 +3948,6 @@ to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]></text>
</license>
<license>
<product scope="lib">symfony/polyfill-php72</product>
<author>Nicolas Grekas - Symfony Community</author>
<license_type>MIT</license_type>
<text><![CDATA[
Copyright (c) 2015-present Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]></text>
</license>
<license>
<product scope="lib">symfony/polyfill-php80</product>
<author>Ion Bazan - Nicolas Grekas - Symfony Community</author>
<license_type>MIT</license_type>
<text><![CDATA[
Copyright (c) 2020-present Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -4535,7 +4316,7 @@ THE SOFTWARE.
published by the Free Software Foundation, either version 3 of the published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version. License, or (at your option) any later version.
2002-2023 Nicola Asuni - Tecnick.com LTD 2002-2025 Nicola Asuni - Tecnick.com LTD
********************************************************************** **********************************************************************
********************************************************************** **********************************************************************
@@ -5448,33 +5229,6 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]></text>
</license>
<license>
<product scope="lib">webmozart/assert</product>
<author>Bernhard Schussek</author>
<license_type>MIT</license_type>
<text><![CDATA[
The MIT License (MIT)
Copyright (c) 2014 Bernhard Schussek
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]></text> ]]></text>
</license> </license>
<license> <license>

View File

@@ -0,0 +1,65 @@
<?php
namespace Combodo\iTop\Application\Helper;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\Select;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\SelectUIBlockFactory;
use CoreException;
use Dict;
use DictExceptionMissingString;
use MetaModel;
use UserRights;
/**
* Class
* ImportHelper
*
* @internal
* @since 3.2.3
* @package Combodo\iTop\Application\Helper
*/
class ImportHelper
{
/**
* Get classes select UI block.
*
* @param string $sName
* @param $sDefaultValue
* @param int $iActionCode
* @param bool $bAdvanced
*
* @return Select
* @throws CoreException
* @throws DictExceptionMissingString
*/
public static function GetClassesSelectUIBlock(string $sName, $sDefaultValue, int $iActionCode, bool $bAdvanced = false): Select
{
$oSelectBlock = SelectUIBlockFactory::MakeForSelect($sName, 'select_'.$sName);
$oOption = SelectOptionUIBlockFactory::MakeForSelectOption("", Dict::S('UI:CSVImport:ClassesSelectOne'), false);
$oSelectBlock->AddSubBlock($oOption);
$aValidClasses = [];
$aClassCategories = ['bizmodel', 'addon/authentication'];
if ($bAdvanced) {
$aClassCategories[] = 'grant_by_profile';
}
if (UserRights::IsAdministrator()) {
$aClassCategories[] = 'application';
}
foreach ($aClassCategories as $sClassCategory) {
foreach (MetaModel::GetClasses($sClassCategory) as $sClassName) {
if ((is_null($iActionCode) || UserRights::IsActionAllowed($sClassName, $iActionCode)) &&
(!MetaModel::IsAbstract($sClassName))) {
$sDisplayName = ($bAdvanced) ? MetaModel::GetName($sClassName)." ($sClassName)" : MetaModel::GetName($sClassName);
$aValidClasses[$sDisplayName] = SelectOptionUIBlockFactory::MakeForSelectOption($sClassName, $sDisplayName, ($sClassName == $sDefaultValue));
}
}
}
ksort($aValidClasses);
foreach ($aValidClasses as $sValue => $oBlock) {
$oSelectBlock->AddSubBlock($oBlock);
}
return $oSelectBlock;
}
}

View File

@@ -8,8 +8,13 @@ use AttributeFriendlyName;
use AttributeLinkedSet; use AttributeLinkedSet;
use cmdbAbstract; use cmdbAbstract;
use cmdbAbstractObject; use cmdbAbstractObject;
use CoreException;
use Dict; use Dict;
use Exception;
use IssueLog;
use LogChannels;
use Metamodel; use Metamodel;
use utils;
/** /**
* Class DataTableSettings * Class DataTableSettings
@@ -130,7 +135,10 @@ class DataTableSettings
*/ */
public function unserialize($sData) public function unserialize($sData)
{ {
$aData = unserialize($sData); $aData = utils::Unserialize($sData);
if (!is_array($aData)) {
throw new CoreException('Wrong data table settings format, expected an array', ['datatable_settings_data' => $aData]);
}
$this->iDefaultPageSize = $aData['iDefaultPageSize']; $this->iDefaultPageSize = $aData['iDefaultPageSize'];
$this->aColumns = $aData['aColumns']; $this->aColumns = $aData['aColumns'];
foreach ($this->aClassAliases as $sAlias => $sClass) { foreach ($this->aClassAliases as $sAlias => $sClass) {
@@ -269,7 +277,19 @@ class DataTableSettings
return null; return null;
} }
} }
$oSettings->unserialize($pref);
try {
$oSettings->unserialize($pref);
} catch (Exception $e) {
IssueLog::Warning("User table settings corrupted, back to the default values provided by the data model", LogChannels::CONSOLE, [
'table_id' => $sTableId,
'root_cause' => $e->getMessage(),
]);
// unset the preference
appUserPreferences::UnsetPref($oSettings->GetPrefsKey($sTableId));
// use the default values provided by the data model
return null;
}
return $oSettings; return $oSettings;
} }

View File

@@ -218,7 +218,7 @@ class AttributeCaseLog extends AttributeLongText
} }
if (strlen($sIndex) > 0) { if (strlen($sIndex) > 0) {
$aIndex = unserialize($sIndex); $aIndex = utils::Unserialize($sIndex);
$value = new ormCaseLog($sLog, $aIndex); $value = new ormCaseLog($sLog, $aIndex);
} else { } else {
$value = new ormCaseLog($sLog); $value = new ormCaseLog($sLog);

View File

@@ -23,7 +23,7 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
}, },
{# PLUGIN combodo auto position #} {# PLUGIN combodo auto position #}
'combodo_auto_position' : { 'combodo_auto_position' : {
maxDropDownHeight: 300, {# in px #} maxDropDownHeight: '30vh', {# same value as external key widget #}
}, },
{# PLUGIN combodo add button #} {# PLUGIN combodo add button #}
{% if oUIBlock.HasAddOptionButton() %} {% if oUIBlock.HasAddOptionButton() %}

View File

@@ -2,7 +2,9 @@
<div id="{{ oUIBlock.GetId() }}" class="{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} {% if oUIBlock.HasIcon() %}ibo-has-icon{% endif %}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" data-role="ibo-title"> <div id="{{ oUIBlock.GetId() }}" class="{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} {% if oUIBlock.HasIcon() %}ibo-has-icon{% endif %}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" data-role="ibo-title">
{% if oUIBlock.HasIcon() %} {% if oUIBlock.HasIcon() %}
<div class="ibo-title--icon"> <div class="ibo-title--icon">
<div class="ibo-title--icon-background ibo-title--icon-background--must-{{ oUIBlock.GetIconCoverMethod() }} ibo-title--icon-level-{{ oUIBlock.GetLevel() }}" style="background-image: url('{{ oUIBlock.GetIconUrl()|raw }}');"></div> <img class="ibo-title--icon-background ibo-title--icon-background--must-{{ oUIBlock.GetIconCoverMethod() }} ibo-title--icon-level-{{ oUIBlock.GetLevel() }}"
{% if oUIBlock.HasLazyLoadIcon %} loading="lazy" {% endif %}
data-role="ibo-title--icon-img" src="{{ oUIBlock.GetIconUrl()|raw }}" alt="" aria-hidden="true"/>
</div> </div>
{% endif %} {% endif %}
<div class="ibo-title--content"> <div class="ibo-title--content">

View File

@@ -22,6 +22,7 @@
namespace Combodo\iTop\Test\VisualTest\Backoffice; namespace Combodo\iTop\Test\VisualTest\Backoffice;
use Combodo\iTop\Application\Branding;
use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Button\Button; 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\Button\ButtonUIBlockFactory;
@@ -402,7 +403,8 @@ $oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Title example 1', 1));
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Title example 2', 2)); $oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Title example 2', 2));
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Title example 3', 3)); $oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Title example 3', 3));
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Title example 4', 4)); $oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Title example 4', 4));
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral('Title example 5', 5)); $oPage->AddUiBlock(TitleUIBlockFactory::MakeForPageWithIcon('Title example 5', MetaModel::GetClassIcon('Organization', false)));
$oPage->AddUiBlock(TitleUIBlockFactory::MakeForPageWithIcon('Title example 6', Branding::GetFullMainLogoAbsoluteUrl()));
///////// /////////
// DataTable // DataTable

View File

@@ -23,6 +23,7 @@
namespace Combodo\iTop\Test\UnitTest\Application; namespace Combodo\iTop\Test\UnitTest\Application;
use Combodo\iTop\Test\UnitTest\ItopTestCase; use Combodo\iTop\Test\UnitTest\ItopTestCase;
use CoreException;
use ormDocument; use ormDocument;
use utils; use utils;
@@ -983,4 +984,21 @@ INI;
unlink($sTmpFileOutsideItop); unlink($sTmpFileOutsideItop);
} }
public function testUnserialize()
{
// data to unserialize containing an object
$sData = 'a:2:{s:6:"string";s:9:"My string";s:6:"object";O:8:"DateTime":3:{s:4:"date";s:26:"2026-04-13 09:09:23.033175";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";}}';
// allow the DateTime object (no exception triggered)
utils::Unserialize($sData, ['allowed_classes' => ['DateTime']]);
// flag to avoid throwing an exception
utils::Unserialize($sData, ['allowed_classes' => false], false);
// flag to require throwing an exception
$this->expectException(CoreException::class);
utils::Unserialize($sData);
}
} }