From 1a8de82be5a967fcd6cebfa891d2aa4850c12eb1 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Thu, 29 Feb 2024 11:07:48 +0100 Subject: [PATCH 1/3] Add toast feedback when resetting newsroom cache or change image placeholder in preferences --- dictionaries/cs.dictionary.itop.ui.php | 1 + dictionaries/da.dictionary.itop.ui.php | 1 + dictionaries/de.dictionary.itop.ui.php | 1 + dictionaries/en.dictionary.itop.ui.php | 1 + dictionaries/es_cr.dictionary.itop.ui.php | 1 + dictionaries/fr.dictionary.itop.ui.php | 1 + dictionaries/hu.dictionary.itop.ui.php | 1 + dictionaries/it.dictionary.itop.ui.php | 1 + dictionaries/ja.dictionary.itop.ui.php | 1 + dictionaries/nl.dictionary.itop.ui.php | 1 + dictionaries/pl.dictionary.itop.ui.php | 1 + dictionaries/pt_br.dictionary.itop.ui.php | 1 + dictionaries/ru.dictionary.itop.ui.php | 1 + dictionaries/sk.dictionary.itop.ui.php | 1 + dictionaries/tr.dictionary.itop.ui.php | 1 + .../ui/pages/preferences/cs.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/da.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/de.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/en.dictionary.itop.preferences.php | 1 + .../pages/preferences/es_cr.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/fr.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/hu.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/it.dictionary.itop.preferences.php | 2 +- .../ui/pages/preferences/ja.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/nl.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/pl.dictionary.itop.preferences.php | 1 + .../pages/preferences/pt_br.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/ru.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/sk.dictionary.itop.preferences.php | 1 + .../ui/pages/preferences/tr.dictionary.itop.preferences.php | 1 + .../pages/preferences/zh_cn.dictionary.itop.preferences.php | 1 + dictionaries/zh_cn.dictionary.itop.ui.php | 1 + js/components/newsroom-menu.js | 1 + pages/preferences.php | 4 ++++ 34 files changed, 37 insertions(+), 1 deletion(-) diff --git a/dictionaries/cs.dictionary.itop.ui.php b/dictionaries/cs.dictionary.itop.ui.php index 2d236e11b..142180d32 100755 --- a/dictionaries/cs.dictionary.itop.ui.php +++ b/dictionaries/cs.dictionary.itop.ui.php @@ -1623,6 +1623,7 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', array( 'UI:Newsroom:Preferences' => 'Nastavení novinek a upozornění', 'UI:Newsroom:ConfigurationLink' => 'Konfigurace', 'UI:Newsroom:ResetCache' => 'Resetuj cache', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Zobrazit zprávy od %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Zobrazit %1$s zpráv v menu %2$s', )); diff --git a/dictionaries/da.dictionary.itop.ui.php b/dictionaries/da.dictionary.itop.ui.php index d0ee60239..f575ec5c5 100644 --- a/dictionaries/da.dictionary.itop.ui.php +++ b/dictionaries/da.dictionary.itop.ui.php @@ -1614,6 +1614,7 @@ Dict::Add('DA DA', 'Danish', 'Dansk', array( 'UI:Newsroom:Preferences' => 'Newsroom preferences~~', 'UI:Newsroom:ConfigurationLink' => 'Configuration~~', 'UI:Newsroom:ResetCache' => 'Reset cache~~', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Display messages from %1$s~~', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Display up to %1$s messages in the %2$s menu.~~', )); diff --git a/dictionaries/de.dictionary.itop.ui.php b/dictionaries/de.dictionary.itop.ui.php index 47948708a..d9d68e989 100644 --- a/dictionaries/de.dictionary.itop.ui.php +++ b/dictionaries/de.dictionary.itop.ui.php @@ -1612,6 +1612,7 @@ Dict::Add('DE DE', 'German', 'Deutsch', array( 'UI:Newsroom:Preferences' => 'Newsroom-Einstellungen', 'UI:Newsroom:ConfigurationLink' => 'Konfiguration', 'UI:Newsroom:ResetCache' => 'Cache zurücksetzen', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Nachrichten von %1$s anzeigen', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Zeigen Sie höchstens %1$s Beiträge im Menü (%2$s) an.', )); diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index 949f73f72..997cae8d7 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -1710,6 +1710,7 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Newsroom:Preferences' => 'Newsroom preferences', 'UI:Newsroom:ConfigurationLink' => 'Configuration', 'UI:Newsroom:ResetCache' => 'Reset cache', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Display messages from %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Display up to %1$s messages in the %2$s menu.', )); diff --git a/dictionaries/es_cr.dictionary.itop.ui.php b/dictionaries/es_cr.dictionary.itop.ui.php index 04e46046c..66e2e0186 100644 --- a/dictionaries/es_cr.dictionary.itop.ui.php +++ b/dictionaries/es_cr.dictionary.itop.ui.php @@ -1631,6 +1631,7 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array( 'UI:Newsroom:Preferences' => 'Preferencia de Notificaciones', 'UI:Newsroom:ConfigurationLink' => 'Configuración', 'UI:Newsroom:ResetCache' => 'Borrar caché', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Desplegar mensajes de %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Desplegar hasta %1$s mensajes en el menú %2$s.', )); diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index 59889989f..ec3ed20b4 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -1620,6 +1620,7 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Newsroom:Preferences' => 'Préférences du centre d\'information', 'UI:Newsroom:ConfigurationLink' => 'Configuration', 'UI:Newsroom:ResetCache' => 'Ràz du cache', + 'UI:Newsroom:ResetCache:Success:Message' => 'Le cache a été réinitialisé avec succès', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Afficher les messages de %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Afficher au plus %1$s messages dans le menu %2$s.', )); diff --git a/dictionaries/hu.dictionary.itop.ui.php b/dictionaries/hu.dictionary.itop.ui.php index 2b1493795..d211a86b1 100755 --- a/dictionaries/hu.dictionary.itop.ui.php +++ b/dictionaries/hu.dictionary.itop.ui.php @@ -1615,6 +1615,7 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', array( 'UI:Newsroom:Preferences' => 'Hírfolyam beállítások', 'UI:Newsroom:ConfigurationLink' => 'Konfiguráció', 'UI:Newsroom:ResetCache' => 'Gyorstár ürítése', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => '%1$s üzeneteinek megjelenítése', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Mutasson %1$s üzenetet a %2$s menüben.', )); diff --git a/dictionaries/it.dictionary.itop.ui.php b/dictionaries/it.dictionary.itop.ui.php index db230eeab..1420b88f5 100644 --- a/dictionaries/it.dictionary.itop.ui.php +++ b/dictionaries/it.dictionary.itop.ui.php @@ -1631,6 +1631,7 @@ Dict::Add('IT IT', 'Italian', 'Italiano', array( 'UI:Newsroom:Preferences' => 'Preferenze Newsroom', 'UI:Newsroom:ConfigurationLink' => 'Configurazione', 'UI:Newsroom:ResetCache' => 'Resetta la cache', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Mostra messaggi da %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Mostra fino a %1$s messaggi nel menu %2$s.', diff --git a/dictionaries/ja.dictionary.itop.ui.php b/dictionaries/ja.dictionary.itop.ui.php index 43104e33b..d00b7d8ca 100644 --- a/dictionaries/ja.dictionary.itop.ui.php +++ b/dictionaries/ja.dictionary.itop.ui.php @@ -1613,6 +1613,7 @@ Dict::Add('JA JP', 'Japanese', '日本語', array( 'UI:Newsroom:Preferences' => 'Newsroom preferences~~', 'UI:Newsroom:ConfigurationLink' => 'Configuration~~', 'UI:Newsroom:ResetCache' => 'Reset cache~~', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Display messages from %1$s~~', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Display up to %1$s messages in the %2$s menu.~~', )); diff --git a/dictionaries/nl.dictionary.itop.ui.php b/dictionaries/nl.dictionary.itop.ui.php index 09ccd68b7..412985fd3 100644 --- a/dictionaries/nl.dictionary.itop.ui.php +++ b/dictionaries/nl.dictionary.itop.ui.php @@ -1628,6 +1628,7 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', array( 'UI:Newsroom:Preferences' => 'Voorkeuren voor Newsroom', 'UI:Newsroom:ConfigurationLink' => 'Configuratie', 'UI:Newsroom:ResetCache' => 'Maak cache leeg', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Bekijk berichten van %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Toon maximaal %1$s berichten in het %2$s menu.', )); diff --git a/dictionaries/pl.dictionary.itop.ui.php b/dictionaries/pl.dictionary.itop.ui.php index f5c9838ef..c680bfa99 100644 --- a/dictionaries/pl.dictionary.itop.ui.php +++ b/dictionaries/pl.dictionary.itop.ui.php @@ -1625,6 +1625,7 @@ Dict::Add('PL PL', 'Polish', 'Polski', array( 'UI:Newsroom:Preferences' => 'Preferencje newsroomu', 'UI:Newsroom:ConfigurationLink' => 'Konfiguracja', 'UI:Newsroom:ResetCache' => 'Zresetuj pamięć podręczną', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Wyświetl wiadomości od %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Wyświetlaj do %1$s wiadomiości w %2$s menu.', )); diff --git a/dictionaries/pt_br.dictionary.itop.ui.php b/dictionaries/pt_br.dictionary.itop.ui.php index 825c1791d..99333d4e3 100644 --- a/dictionaries/pt_br.dictionary.itop.ui.php +++ b/dictionaries/pt_br.dictionary.itop.ui.php @@ -1625,6 +1625,7 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', array( 'UI:Newsroom:Preferences' => 'Preferências da sala de notícias', 'UI:Newsroom:ConfigurationLink' => 'Configuração', 'UI:Newsroom:ResetCache' => 'Redefinir cache', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Exibir mensagens do(a) %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Exibir até %1$s mensagem(ns) no menu %2$s', )); diff --git a/dictionaries/ru.dictionary.itop.ui.php b/dictionaries/ru.dictionary.itop.ui.php index 78053fc6c..dd5115bb0 100644 --- a/dictionaries/ru.dictionary.itop.ui.php +++ b/dictionaries/ru.dictionary.itop.ui.php @@ -1625,6 +1625,7 @@ Dict::Add('RU RU', 'Russian', 'Русский', array( 'UI:Newsroom:Preferences' => 'Центр новостей', 'UI:Newsroom:ConfigurationLink' => 'Конфигурация', 'UI:Newsroom:ResetCache' => 'Сбросить кеш', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Показать сообщения от %1$s', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Отобразите не более %1$s сообщений в меню %2$s.', )); diff --git a/dictionaries/sk.dictionary.itop.ui.php b/dictionaries/sk.dictionary.itop.ui.php index 4465f1abc..9923753e2 100644 --- a/dictionaries/sk.dictionary.itop.ui.php +++ b/dictionaries/sk.dictionary.itop.ui.php @@ -1617,6 +1617,7 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', array( 'UI:Newsroom:Preferences' => 'Newsroom preferences~~', 'UI:Newsroom:ConfigurationLink' => 'Configuration~~', 'UI:Newsroom:ResetCache' => 'Reset cache~~', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Display messages from %1$s~~', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Display up to %1$s messages in the %2$s menu.~~', )); diff --git a/dictionaries/tr.dictionary.itop.ui.php b/dictionaries/tr.dictionary.itop.ui.php index 26f1d74c0..88f348c82 100644 --- a/dictionaries/tr.dictionary.itop.ui.php +++ b/dictionaries/tr.dictionary.itop.ui.php @@ -1625,6 +1625,7 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', array( 'UI:Newsroom:Preferences' => 'Newsroom preferences~~', 'UI:Newsroom:ConfigurationLink' => 'Configuration~~', 'UI:Newsroom:ResetCache' => 'Reset cache~~', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => 'Display messages from %1$s~~', 'UI:Newsroom:DisplayAtMost_X_Messages' => 'Display up to %1$s messages in the %2$s menu.~~', )); diff --git a/dictionaries/ui/pages/preferences/cs.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/cs.dictionary.itop.preferences.php index 20e8d8637..0d6dff9bb 100644 --- a/dictionaries/ui/pages/preferences/cs.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/cs.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Scrollable~~', 'UI:Preferences:ChooseAPlaceholder' => 'User placeholder image~~', 'UI:Preferences:ChooseAPlaceholder+' => 'Choose a placeholder image that will be displayed if the contact linked to your user doesn\'t have one~~', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/da.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/da.dictionary.itop.preferences.php index 6cd28d02a..f26416c25 100644 --- a/dictionaries/ui/pages/preferences/da.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/da.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('DA DA', 'Danish', 'Dansk', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Scrollable~~', 'UI:Preferences:ChooseAPlaceholder' => 'User placeholder image~~', 'UI:Preferences:ChooseAPlaceholder+' => 'Choose a placeholder image that will be displayed if the contact linked to your user doesn\'t have one~~', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/de.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/de.dictionary.itop.preferences.php index f6a66270b..0cc05fd37 100644 --- a/dictionaries/ui/pages/preferences/de.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/de.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('DE DE', 'German', 'Deutsch', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'scrollbar', 'UI:Preferences:ChooseAPlaceholder' => 'Platzhalterbild für Profilbild', 'UI:Preferences:ChooseAPlaceholder+' => 'Nutzen Sie ein Platzhalterbild, das angezeigt wird, wenn der Kontakt, der mit dem User verlinkt ist, kein Profilbild gesetzt hat.', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/en.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/en.dictionary.itop.preferences.php index 5fb768156..04b888b3c 100644 --- a/dictionaries/ui/pages/preferences/en.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/en.dictionary.itop.preferences.php @@ -51,6 +51,7 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Preferences:General:Toasts:Top' => 'Top', 'UI:Preferences:ChooseAPlaceholder' => 'User placeholder image', 'UI:Preferences:ChooseAPlaceholder+' => 'Choose a placeholder image that will be displayed if the contact linked to your user doesn\'t have one', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated', 'UI:Preferences:Notifications' => 'Notifications', 'UI:Preferences:Notifications+' => 'Configure the notifications you want to receive on this page.', diff --git a/dictionaries/ui/pages/preferences/es_cr.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/es_cr.dictionary.itop.preferences.php index 7b3ba5ec5..27ef0220a 100644 --- a/dictionaries/ui/pages/preferences/es_cr.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/es_cr.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Desplazable', 'UI:Preferences:ChooseAPlaceholder' => 'Imagen de marcador de posición de usuario', 'UI:Preferences:ChooseAPlaceholder+' => 'Elija una imagen de marcador de posición que se mostrará si el contacto vinculado a su usuario no tiene uno', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/fr.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/fr.dictionary.itop.preferences.php index b060a660b..19d257b62 100644 --- a/dictionaries/ui/pages/preferences/fr.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/fr.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Défilement', 'UI:Preferences:ChooseAPlaceholder' => 'Avatar de l\'utilisateur', 'UI:Preferences:ChooseAPlaceholder+' => 'Choisissez un avatar qui sera affiché si le contact associé à votre compte utilisateur n\'en possède pas', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Votre avatar a été mis à jour avec succès', )); diff --git a/dictionaries/ui/pages/preferences/hu.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/hu.dictionary.itop.preferences.php index 7eb766374..a29cf2cb5 100644 --- a/dictionaries/ui/pages/preferences/hu.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/hu.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Görgethető', 'UI:Preferences:ChooseAPlaceholder' => 'Felhasználói helyettesítő kép', 'UI:Preferences:ChooseAPlaceholder+' => 'Válasszon ki egy helyettesítő képet, amely akkor jelenik meg, ha a kapcsolattartói beállításaiban még nem adott meg fényképet.', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/it.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/it.dictionary.itop.preferences.php index 1afb50f27..f3fbf0c2d 100644 --- a/dictionaries/ui/pages/preferences/it.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/it.dictionary.itop.preferences.php @@ -47,5 +47,5 @@ Dict::Add('IT IT', 'Italian', 'Italiano', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Scorrevole', 'UI:Preferences:ChooseAPlaceholder' => 'Seleziona un\'immagine placeholder utente', 'UI:Preferences:ChooseAPlaceholder+' => 'Scegli un\'immagine placeholder che verrà visualizzata se il contatto associato al tuo utente non ne ha una', - + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/ja.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/ja.dictionary.itop.preferences.php index 7743ed209..c5fdfaa40 100644 --- a/dictionaries/ui/pages/preferences/ja.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/ja.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('JA JP', 'Japanese', '日本語', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Scrollable~~', 'UI:Preferences:ChooseAPlaceholder' => 'User placeholder image~~', 'UI:Preferences:ChooseAPlaceholder+' => 'Choose a placeholder image that will be displayed if the contact linked to your user doesn\'t have one~~', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/nl.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/nl.dictionary.itop.preferences.php index a3fa52550..2a9b749e6 100644 --- a/dictionaries/ui/pages/preferences/nl.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/nl.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Scrollbaar', 'UI:Preferences:ChooseAPlaceholder' => 'Gebruikersafbeelding placeholder', 'UI:Preferences:ChooseAPlaceholder+' => 'Kies een standaard afbeelding die getoond wordt als het contact gelinkt aan jouw gebruiker geen eigen afbeelding heeft.', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/pl.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/pl.dictionary.itop.preferences.php index 22bfe6d14..e5257baba 100644 --- a/dictionaries/ui/pages/preferences/pl.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/pl.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('PL PL', 'Polish', 'Polski', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Przewijana', 'UI:Preferences:ChooseAPlaceholder' => 'Obraz zastępczy użytkownika', 'UI:Preferences:ChooseAPlaceholder+' => 'Wybierz obraz zastępczy, który będzie wyświetlany, jeśli kontakt powiązany z Twoim użytkownikiem go nie ma', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/pt_br.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/pt_br.dictionary.itop.preferences.php index 6c9c476b4..c93dc2695 100644 --- a/dictionaries/ui/pages/preferences/pt_br.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/pt_br.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Rolável', 'UI:Preferences:ChooseAPlaceholder' => 'Avatar padrão do usuário', 'UI:Preferences:ChooseAPlaceholder+' => 'Escolha uma imagem padrão que será exibida caso o contato associado ao usuário não possuir nenhuma', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/ru.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/ru.dictionary.itop.preferences.php index 050b547a3..4e5f7d5a0 100755 --- a/dictionaries/ui/pages/preferences/ru.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/ru.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('RU RU', 'Russian', 'Русский', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Прокручиваемая', 'UI:Preferences:ChooseAPlaceholder' => 'Аватар пользователя', 'UI:Preferences:ChooseAPlaceholder+' => 'Выберите аватар, который будет отображаться, если у связанного с вашей учетной записью контакта нет фотографии', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/sk.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/sk.dictionary.itop.preferences.php index 186ce7916..468b106e1 100644 --- a/dictionaries/ui/pages/preferences/sk.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/sk.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Scrollable~~', 'UI:Preferences:ChooseAPlaceholder' => 'User placeholder image~~', 'UI:Preferences:ChooseAPlaceholder+' => 'Choose a placeholder image that will be displayed if the contact linked to your user doesn\'t have one~~', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/tr.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/tr.dictionary.itop.preferences.php index 948638d97..92bba4931 100644 --- a/dictionaries/ui/pages/preferences/tr.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/tr.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => 'Scrollable~~', 'UI:Preferences:ChooseAPlaceholder' => 'User placeholder image~~', 'UI:Preferences:ChooseAPlaceholder+' => 'Choose a placeholder image that will be displayed if the contact linked to your user doesn\'t have one~~', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/ui/pages/preferences/zh_cn.dictionary.itop.preferences.php b/dictionaries/ui/pages/preferences/zh_cn.dictionary.itop.preferences.php index 02df88ccd..595e2d29b 100644 --- a/dictionaries/ui/pages/preferences/zh_cn.dictionary.itop.preferences.php +++ b/dictionaries/ui/pages/preferences/zh_cn.dictionary.itop.preferences.php @@ -47,4 +47,5 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array( 'UI:Preferences:Tabs:Scrollable:Scrollable' => '可滚动', 'UI:Preferences:ChooseAPlaceholder' => '用户的默认头像', 'UI:Preferences:ChooseAPlaceholder+' => '选择一个占位图片, 将在用户联系人没有设定头像图片时显示', + 'UI:Preferences:ChooseAPlaceholder:Success:Message' => 'Your placeholder image has been successfully updated~~', )); diff --git a/dictionaries/zh_cn.dictionary.itop.ui.php b/dictionaries/zh_cn.dictionary.itop.ui.php index 127d1eff4..75a6fafcb 100644 --- a/dictionaries/zh_cn.dictionary.itop.ui.php +++ b/dictionaries/zh_cn.dictionary.itop.ui.php @@ -1709,6 +1709,7 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array( 'UI:Newsroom:Preferences' => '消息选项', 'UI:Newsroom:ConfigurationLink' => '配置', 'UI:Newsroom:ResetCache' => '刷新缓存', + 'UI:Newsroom:ResetCache:Success:Message' => 'Your newsroom cache has been successfully reset~~', 'UI:Newsroom:DisplayMessagesFor_Provider' => '显示来自%1$s的消息', 'UI:Newsroom:DisplayAtMost_X_Messages' => '在%2$s菜单中最多显示%1$s条消息.', )); diff --git a/js/components/newsroom-menu.js b/js/components/newsroom-menu.js index 8168e7274..b619300ea 100644 --- a/js/components/newsroom-menu.js +++ b/js/components/newsroom-menu.js @@ -363,6 +363,7 @@ $(function() var sKey = this._makeCacheKey(idx); localStorage.removeItem(sKey); } + CombodoToast.OpenSuccessToast(Dict.S('UI:Newsroom:ResetCache:Success:Message')); }, _makeCacheKey: function(idxProvider) { diff --git a/pages/preferences.php b/pages/preferences.php index d710ba737..23321326b 100644 --- a/pages/preferences.php +++ b/pages/preferences.php @@ -434,6 +434,7 @@ JS } $sUserPicturePlaceHolderHtml .= ' '; } + $sUserPictureChangedSuccessMessage = Dict::S('UI:Preferences:ChooseAPlaceholder:Success:Message'); $oP->add_ready_script( << Date: Thu, 29 Feb 2024 16:14:43 +0100 Subject: [PATCH 2/3] =?UTF-8?q?N=C2=B05170=20-=20In=20a=20transition=20DoC?= =?UTF-8?q?heckToWrite=20returned=20error,=20generes=20a=20Fatal=20error?= =?UTF-8?q?=20(#539)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cmdbabstract.class.inc.php | 20 ++++++++++++++----- .../portal/src/Form/ObjectFormManager.php | 11 +++++++++- .../src/Helper/ObjectFormHandlerHelper.php | 2 ++ pages/UI.php | 10 +++++++++- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 030e97db7..c23ec696a 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -3592,16 +3592,26 @@ EOF $oPage->add_ready_script(InlineImage::EnableCKEditorImageUpload($this, $sTempId)); } else { //we can directly apply the stimuli + $sExceptionMessage = null; + try { $bApplyStimulus = $this->ApplyStimulus($sStimulus); // will write the object in the DB - if (!$bApplyStimulus) { - throw new ApplicationException(Dict::S('UI:FailedToApplyStimuli')); - } else { + } + catch (Exception $oException) { + // Catch any exception happening during the stimulus + $bApplyStimulus = false; + $sExceptionMessage = ($oException instanceof CoreCannotSaveObjectException) ? $oException->getHtmlMessage() : $oException->getMessage(); + } + finally { if ($sOwnershipToken !== null) { // Release the concurrent lock, if any iTopOwnershipLock::ReleaseLock($sClass, $iKey, $sOwnershipToken); } - - return true; + if (!$bApplyStimulus) { + // Throw an application oriented exception if necessary + throw new ApplicationException($sExceptionMessage ?? Dict::S('UI:FailedToApplyStimuli')); + } else { + return true; + } } } diff --git a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php index eb853ab24..07aedd49a 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php @@ -1222,9 +1222,18 @@ class ObjectFormManager extends FormManager } } } + catch (CoreCannotSaveObjectException $e) { + $aData['valid'] = false; + $aData['messages']['error'] += array('_main' => array($e->getHtmlMessage())); + if (false === $bExceptionLogged) { + IssueLog::Error(__METHOD__.' at line '.__LINE__.' : '.$e->getMessage()); + } + } catch (Exception $e) { $aData['valid'] = false; - $aData['messages']['error'] += array('_main' => array($e->getMessage())); + $aData['messages']['error'] += [ + '_main' => [ ($e instanceof CoreCannotSaveObjectException) ? $e->getHtmlMessage() : $e->getMessage()] + ]; if (false === $bExceptionLogged) { IssueLog::Error(__METHOD__.' at line '.__LINE__.' : '.$e->getMessage()); } diff --git a/datamodels/2.x/itop-portal-base/portal/src/Helper/ObjectFormHandlerHelper.php b/datamodels/2.x/itop-portal-base/portal/src/Helper/ObjectFormHandlerHelper.php index 775ce7bb6..0bbbcc078 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Helper/ObjectFormHandlerHelper.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Helper/ObjectFormHandlerHelper.php @@ -333,6 +333,8 @@ class ObjectFormHandlerHelper 'modal' => true, ); } + } else { + throw new HttpException(Response::HTTP_INTERNAL_SERVER_ERROR, implode('
', $aFormData['validation']['messages']['error']['_main'])); } break; diff --git a/pages/UI.php b/pages/UI.php index 48660d198..aef1f3cd0 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -1206,8 +1206,16 @@ try $bApplyTransition = $oObj->DisplayStimulusForm($oP, $sStimulus, $aPrefillFormParam); } catch (ApplicationException $e) { + $bApplyTransition = false; $sMessage = $e->getMessage(); - $sSeverity = 'info'; + $sSeverity = 'warning'; + ReloadAndDisplay($oP, $oObj, 'stimulus', $sMessage, $sSeverity); + } + catch (CoreCannotSaveObjectException $e) { + $bApplyTransition = false; + $aIssues = $e->getIssues(); + $sMessage = $e->getHtmlMessage(); + $sSeverity = 'warning'; ReloadAndDisplay($oP, $oObj, 'stimulus', $sMessage, $sSeverity); } if ($bApplyTransition) { From 90a5a7a9a77f5aac093f6263505f78f2a1b31c02 Mon Sep 17 00:00:00 2001 From: Anne-Catherine <57360138+accognet@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:18:03 +0100 Subject: [PATCH 3/3] =?UTF-8?q?N=C2=B06968=20-=20Audit=20duration=20:=20ad?= =?UTF-8?q?d=20of=20a=20rule=20multiplie=20by=204=20the=20time=20of=20resp?= =?UTF-8?q?onse=20(#575)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbsearch.class.php | 59 +++++++- core/userrights.class.inc.php | 4 +- pages/audit.php | 8 +- .../unitary-tests/core/DBSearchTest.php | 130 ++++++++++++++---- 4 files changed, 165 insertions(+), 36 deletions(-) diff --git a/core/dbsearch.class.php b/core/dbsearch.class.php index c4af180c2..0544f0fc7 100644 --- a/core/dbsearch.class.php +++ b/core/dbsearch.class.php @@ -851,11 +851,11 @@ abstract class DBSearch return; } - if (count($aColumns) == 0) - { - $aColumns = array_keys(MetaModel::ListAttributeDefs($this->GetClass())); - // Add the standard id (as first column) - array_unshift($aColumns, 'id'); + if (count($aColumns) == 0) + { + $aColumns = array_keys(MetaModel::ListAttributeDefs($this->GetClass())); + // Add the standard id (as first column) + array_unshift($aColumns, 'id'); } $aQueryCols = CMDBSource::GetColumns($resQuery, $sSQL); @@ -885,6 +885,55 @@ abstract class DBSearch return $aRes; } + /** + * Selects a column ($sAttCode) from the specified class ($sClassAlias - default main class) of the DBsearch object and gives the result as an array + * @param string $sAttCode + * @param string|null $sClassAlias + * + * @return array + * @throws ConfigException + * @throws CoreException + * @throws MissingQueryArgument + * @throws MySQLException + * @throws MySQLHasGoneAwayException + */ + public function SelectAttributeToArray(string $sAttCode, ?string $sClassAlias = null):array + { + if(is_null($sClassAlias)) { + $sClassAlias = $this->GetClassAlias(); + } + + $sClass = $this->GetClass(); + if($sAttCode === 'id'){ + $aAttToLoad[$sClassAlias]=[]; + } else { + $aAttToLoad[$sClassAlias][$sAttCode] = MetaModel::GetAttributeDef($sClass, $sAttCode); + } + + $sSQL = $this->MakeSelectQuery([], [], $aAttToLoad); + $resQuery = CMDBSource::Query($sSQL); + if (!$resQuery) + { + return []; + } + + $sColName = $sClassAlias.$sAttCode; + + $aRes = []; + while ($aRow = CMDBSource::FetchArray($resQuery)) + { + $aMappedRow = array(); + if($sAttCode === 'id') { + $aMappedRow[$sAttCode] = $aRow[$sColName]; + } else { + $aMappedRow[$sAttCode] = $aAttToLoad[$sClassAlias][$sAttCode]->FromSQLToValue($aRow, $sColName); + } + $aRes[] = $aMappedRow; + } + CMDBSource::FreeResult($resQuery); + return $aRes; + } + //////////////////////////////////////////////////////////////////////////// // // Construction of the SQL queries diff --git a/core/userrights.class.inc.php b/core/userrights.class.inc.php index ae5d6026f..1dd824f99 100644 --- a/core/userrights.class.inc.php +++ b/core/userrights.class.inc.php @@ -162,7 +162,7 @@ abstract class UserRightsAddOnAPI $oSearchSharers->AllowAllData(); $oSearchSharers->AddCondition_ReferencedBy($oShareSearch, 'sharing_org_id'); $aSharers = array(); - foreach($oSearchSharers->ToDataArray(array('id')) as $aRow) + foreach($oSearchSharers->SelectAttributeToArray('id') as $aRow) { $aSharers[] = $aRow['id']; } @@ -187,7 +187,7 @@ abstract class UserRightsAddOnAPI $oOrgField = new FieldExpression('org_id', $sShareClass); $oSearchShares->AddConditionExpression(new BinaryExpression($oOrgField, 'IN', $oListExpr)); $aShared = array(); - foreach($oSearchShares->ToDataArray(array($sShareAttCode)) as $aRow) + foreach($oSearchShares->SelectAttributeToArray($sShareAttCode) as $aRow) { $aShared[] = $aRow[$sShareAttCode]; } diff --git a/pages/audit.php b/pages/audit.php index d6492f9a4..5aed36d67 100644 --- a/pages/audit.php +++ b/pages/audit.php @@ -114,7 +114,7 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext) { // The query returns only the valid elements, all the others are invalid // Warning : we're generating a `WHERE ID IN`... query, and this could be very slow if there are lots of id ! - $aValidRows = $oRuleFilter->ToDataArray(array('id')); + $aValidRows = $oRuleFilter->ToDataArray(array('id')); $aValidIds = array(); foreach($aValidRows as $aRow) { @@ -431,7 +431,7 @@ try } else { try { $oFilter = GetRuleResultFilter($oAuditRule->GetKey(), $oDefinitionFilter, $oAppContext); - $aErrors = $oFilter->ToDataArray(array('id')); + $aErrors = $oFilter->SelectAttributeToArray('id'); $iErrorsCount = count($aErrors); foreach ($aErrors as $aErrorRow) { $aObjectsWithErrors[$aErrorRow['id']] = true; @@ -471,7 +471,7 @@ try $oP->AddUiBlock($oErrorAlert); continue; } - + $oAuditCategoryPanelBlock->SetColorFromColorSemantic($sClass); $oAuditCategoryPanelBlock->AddCSSClass('ibo-audit--audit-category--panel'); $aData = []; @@ -490,7 +490,7 @@ try 'nb_err' => array('label' => Dict::S('UI:Audit:HeaderNbErrors'), 'description' => Dict::S('UI:Audit:HeaderNbErrors')), 'percentage_ok' => array('label' => Dict::S('UI:Audit:PercentageOk'), 'description' => Dict::S('UI:Audit:PercentageOk')), ); - + $oAttachmentTableBlock = DataTableUIBlockFactory::MakeForStaticData('', $aAttribs, $aData, null, [], "", array('pageLength' => -1)); $oAuditCategoryPanelBlock->AddSubBlock($oAttachmentTableBlock); $aAuditCategoryPanels[] = $oAuditCategoryPanelBlock; diff --git a/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php index 09265d8d4..8d5a9d4ef 100644 --- a/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php +++ b/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php @@ -746,30 +746,110 @@ class DBSearchTest extends ItopDataTestCase $oSearch->MakeSelectQuery(); self::assertTrue(true); } + /** + * @dataProvider QueriesProvider + * @param $sOQL + * + * @return void + */ + public function testQueries($sOQL) + { + $oSearch = DBSearch::FromOQL($sOQL); + $oSet = new DBObjectSet($oSearch); + if ($oSet->Count() > 0) { + $aSelectedAliases = array_keys($oSearch->GetSelectedClasses()); + $aFirstRow = $oSet->FetchAssoc(); + $aAliases = array_keys($aFirstRow); + $this->assertEquals($aSelectedAliases, $aAliases); + } + } - /** - * @dataProvider QueriesProvider - * @param $sOQL - * - * @return void - */ - public function testQueries($sOQL) - { - $oSearch = DBSearch::FromOQL($sOQL); - $oSet = new DBObjectSet($oSearch); - if ($oSet->Count() > 0) { - $aSelectedAliases = array_keys($oSearch->GetSelectedClasses()); - $aFirstRow = $oSet->FetchAssoc(); - $aAliases = array_keys($aFirstRow); - $this->assertEquals($aSelectedAliases, $aAliases); - } - } + public function QueriesProvider() + { + return [ + ['SELECT L,P FROM Person AS P JOIN Location AS L ON P.location_id=L.id'], + ['SELECT P,L FROM Person AS P JOIN Location AS L ON P.location_id=L.id'], + ]; + } + public function SelectAttributeToArrayProvider() + { + return array( + 'select id from FunctionalCI' => array( + 'SELECT FunctionalCI', + 'id', + ), + 'select name from FunctionalCI' => array( + 'SELECT FunctionalCI', + 'name', + ), + 'select org_id from FunctionalCI' => array( + 'SELECT FunctionalCI', + 'org_id', + ), + 'select organization_name from FunctionalCI' => array( + 'SELECT FunctionalCI', + 'organization_name', + ), + 'select business_criticity from FunctionalCI' => array( + 'SELECT FunctionalCI', + 'business_criticity', + ), + 'select org_id from FunctionalCI' => array( + 'SELECT FunctionalCI', + 'org_id', + ), + 'select email from Person' => array( + 'SELECT Person', + 'email', + ), + 'select phone from Person' => array( + 'SELECT Person', + 'phone', + ), + 'select picture from Person' => array( + 'SELECT Person', + 'picture', + ), + 'select description from Ticket' => array( + 'SELECT Ticket', + 'description', + ), + 'select start_date from Ticket' => array( + 'SELECT Ticket', + 'start_date', + ), + 'select private_log from Ticket' => array( + 'SELECT Ticket', + 'private_log', + ), + ); + } - public function QueriesProvider() - { - return [ - ['SELECT L,P FROM Person AS P JOIN Location AS L ON P.location_id=L.id'], - ['SELECT P,L FROM Person AS P JOIN Location AS L ON P.location_id=L.id'], - ]; - } -} + /** + * @dataProvider SelectAttributeToArrayProvider + * + * @return void + * @throws \ConfigException + * @throws \CoreException + * @throws \MissingQueryArgument + * @throws \MySQLException + * @throws \MySQLHasGoneAwayException + * @throws \OQLException + */ + public function testSelectAttributeToArray($sQuery, $sField){ + + $oSearch = \DBObjectSearch::FromOQL($sQuery); + $aResToDataArray=[]; + $oSet = new \DBObjectSet($oSearch); + while ($oRecord = $oSet->Fetch()) { + $aMappedRow[$sField] =$oRecord->Get($sField); + $aResToDataArray[] = $aMappedRow; + } + array_multisort (array_column($aResToDataArray, $sField), SORT_DESC, $aResToDataArray); + + $aResSelectColumnToArray = $oSearch->SelectAttributeToArray($sField); + array_multisort (array_column($aResSelectColumnToArray, $sField), SORT_DESC, $aResSelectColumnToArray); + + self::assertEquals( $aResToDataArray, $aResSelectColumnToArray, 'The array constructed using the OQL query and the result of testSelectAttributeToArray must be the same'); + } +} \ No newline at end of file