N°2039 - Add iTop notifications to newsroom (#590)

* N°2039 - Add iTop notifications to newsroom

* Update sources/Controller/Newsroom/iTopNewsroomController.php

Co-authored-by: Molkobain <lajarige.guillaume@free.fr>

* Update sources/Controller/Newsroom/iTopNewsroomController.php

Co-authored-by: Molkobain <lajarige.guillaume@free.fr>

* Update sources/Service/Notification/Event/EventiTopNotificationGC.php

Co-authored-by: Molkobain <lajarige.guillaume@free.fr>

* Add a default value to Action url attribute, check if there's an object in the context before adding it to the event

* Phpdoc

* Fix default config values

* Replace MetaModel::EnumPlugins calls for iNewsroomProvider

* Replace hardcoded url with generated routes

* Add dict entries

* Correclty throw error when trying to display a non existing event

* Fix unit test

* Migrate old action email language values to its parent table

* Migrate Action and Event class to XML, generate their dictionary entries, add meta data for ActionNotification and EventNotification

* Fix issue in dictionary definition

* Allows Action to create Events for users that the current user can't see

* Dump autoloader

* Remove classes from homemade "autoloader" as they are now loaded through XML

* Apply suggestions from code review

* Remove class from homemade "autoloader" as they are now loaded through GetClassesForInterfaces

* Apply suggestions from code review

Co-authored-by: Molkobain <lajarige.guillaume@free.fr>

---------

Co-authored-by: Molkobain <lajarige.guillaume@free.fr>
This commit is contained in:
Stephen Abello
2023-12-22 12:02:19 +01:00
committed by GitHub
parent 2681abbeed
commit 05db99aa69
17 changed files with 778 additions and 21 deletions

View File

@@ -240,9 +240,10 @@ JS
//////////////////////////////////////////////////////////////////////////
$iCountProviders = 0;
$oUser = UserRights::GetUserObject();
$aProviders = MetaModel::EnumPlugins('iNewsroomProvider');
foreach($aProviders as $oProvider)
$aProviders = utils::GetClassesForInterface('iNewsroomProvider', '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]', '[\\\\/]tests[\\\\/]'));
foreach($aProviders as $cProvider)
{
$oProvider = new $cProvider();
if ($oProvider->IsApplicable($oUser))
{
$iCountProviders++;
@@ -268,8 +269,9 @@ JS
* @var iNewsroomProvider[] $aProviders
*/
$sAppRootUrl = utils::GetAbsoluteUrlAppRoot();
foreach($aProviders as $oProvider)
foreach($aProviders as $cProvider)
{
$oProvider = new $cProvider();
if ($oProvider->IsApplicable($oUser))
{
$sUrl = $oProvider->GetPreferencesUrl();
@@ -830,8 +832,9 @@ try {
case 'apply_newsroom_preferences':
$iCountProviders = 0;
$oUser = UserRights::GetUserObject();
$aProviders = MetaModel::EnumPlugins('iNewsroomProvider');
foreach ($aProviders as $oProvider) {
$aProviders = utils::GetClassesForInterface('iNewsroomProvider', '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]', '[\\\\/]tests[\\\\/]'));
foreach ($aProviders as $cProvider) {
$oProvider = new $cProvider();
if ($oProvider->IsApplicable($oUser)) {
$iCountProviders++;
}