Merge remote-tracking branch 'refs/remotes/origin/support/3.2' into develop

This commit is contained in:
jf-cbd
2024-04-30 15:12:21 +02:00
5 changed files with 42 additions and 8 deletions

View File

@@ -1686,16 +1686,19 @@ JS
$aRes = CMDBSource::QueryToArray($sSql);
$oContext = new ApplicationContext();
$sContextParam = $oContext->GetForLink();
/** @var AttributeDefinition $oGroupByAttDef */
$oGroupByAttDef = $aGroupBy["grouped_by_1"]->GetAttDef();
$iTotalCount = 0;
$aURLs = array();
foreach ($aRes as $iRow => $aRow) {
$sValue = $aRow['grouped_by_1'];
$sHtmlValue = $oGroupByExp->MakeValueLabel($this->m_oFilter, $sValue, $sValue);
$sPlainTextValue = $oGroupByAttDef->GetValueLabel($sValue);
$sHtmlValue = utils::EscapeHtml($sPlainTextValue);
$iTotalCount += $aRow['_itop_count_'];
$aValues[] = array(
'label' => $sValue,
'label' => $sPlainTextValue,
'label_html' => $sHtmlValue,
'value' => (float)$aRow[$sFctVar],
);

View File

@@ -9,11 +9,17 @@ class PortalDispatcher
$this->sPortalid = $sPortalId;
$this->aData = PortalDispatcherData::GetData($sPortalId);
}
public function IsUserAllowed()
/**
* @param \User|null $oUser
*
* @return bool
* @since 3.2.0 N°2039 Add $oUser parameter
*/
public function IsUserAllowed(?User $oUser = null)
{
$bRet = true;
$aProfiles = UserRights::ListProfiles();
$aProfiles = UserRights::ListProfiles($oUser);
foreach($this->aData['deny'] as $sDeniedProfile)
{

View File

@@ -284,9 +284,32 @@
while ($oRecipient = $oRecipientsSet->Fetch()) {
// Skip recipients that have no users
if (get_class($oRecipient) === Person::class && UserRights::GetUserFromPerson($oRecipient) === null) {
if ($oRecipient instanceof Person && UserRights::GetUserFromPerson($oRecipient, false) === null) {
continue;
}
// Skip recipient that have no user with access to the backoffice
$oRecipientUsersSearch = DBObjectSearch::FromOQL("SELECT User WHERE contactid = " . $oRecipient->GetKey() . " AND status = 'enabled'");
$oRecipientUsersSearch->AllowAllData();
$oRecipientUsersSet = new DBObjectSet($oRecipientUsersSearch);
$oPortalDispatcher = new PortalDispatcher('backoffice');
// - Check if the user has access to the backoffice
$bHasAccessToBackoffice = false;
while ($oRecipientUser = $oRecipientUsersSet->Fetch()) {
// Skip recipients with user that don't have access to the backoffice
if (false === $oPortalDispatcher->IsUserAllowed($oRecipientUser)) {
continue;
}
$bHasAccessToBackoffice = true;
break;
}
// - Skip it if necessary
if (false === $bHasAccessToBackoffice) {
continue;
}
// Skip recipients that have unsubscribed
if (!\Combodo\iTop\Service\Notification\NotificationsService::GetInstance()->IsSubscribed($oTrigger, $this, $oRecipient)) {
continue;
}

View File

@@ -4,6 +4,7 @@
*/
$ibo-vendors-selectize-input--color: $ibo-color-grey-900 !default;
$ibo-vendors-selectize-input--background-color: $ibo-color-white-100 !default;
$ibo-vendors-selectize-control--plugin-add-button--add-option--right: $ibo-spacing-0 !default;
$ibo-vendors-selectize-control--plugin-add-button--add-option--height: 100% !default;
$ibo-vendors-selectize-control--plugin-add-button--add-option--width: $ibo-size-350 !default;
@@ -23,7 +24,7 @@ $ibo-vendors-selectize--input-error--border: 1px solid $ibo-color-red-600 !defau
.selectize-control.single .selectize-input {
box-shadow: unset;
background-color: unset;
background-color: $ibo-vendors-selectize-input--background-color;
background-image: unset;
background-repeat: unset;
}
@@ -31,6 +32,7 @@ $ibo-vendors-selectize--input-error--border: 1px solid $ibo-color-red-600 !defau
.selectize-input,
.selectize-control.single .selectize-input.input-active {
background: unset;
background-color: $ibo-vendors-selectize-input--background-color;
cursor: text;
display: inline-flex;
}

File diff suppressed because one or more lines are too long