Skip to content

Commit

Permalink
Merge pull request #252 from 2pisoftware/feat/remove-inbox
Browse files Browse the repository at this point in the history
Remove Inbox module and references
  • Loading branch information
mattbell87 authored Feb 19, 2024
2 parents ecffd8f + 5bd3739 commit 38ba32f
Show file tree
Hide file tree
Showing 35 changed files with 27 additions and 1,340 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Removes the inbox table from the Inbox module that is no longer used or supported.
*/

class InboxRemoveTable extends CmfiveMigration
{
public function up(): void
{
//Drop the tables
$this->dropTable('inbox');
$this->dropTable('inbox_message');

//Clear out the related user roles
$this->w->db->delete('user_role')->where('role', 'inbox_sender')->execute();
$this->w->db->delete('user_role')->where('role', 'inbox_reader')->execute();
}

public function down(): void
{
}

public function description() {
return 'Remove inbox table and roles';
}
}
10 changes: 1 addition & 9 deletions system/modules/admin/models/NotificationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class NotificationService extends DbService
{
const TYPE_EMAIL = 'email';
const TYPE_INBOX = 'inbox';

/**
* Sends a notification to a user
Expand Down Expand Up @@ -36,12 +35,6 @@ public function send(string $subject, string $module, string $template_name, Use
$output = TemplateService::getInstance($this->w)->render($template, $template_data);

switch ($method) {
case NotificationService::TYPE_INBOX:
if (Config::get('inbox.active') === true) {
InboxService::getInstance($this->w)->addMessage($subject, $output, $recipient_user->id, null, null, false);
}
break;

case NotificationService::TYPE_EMAIL:
default:
MailService::getInstance($this->w)->sendMail(
Expand Down Expand Up @@ -126,8 +119,7 @@ public function getUserPreferences(User $user)
public function getAvailableNotificationMethods()
{
return [
NotificationService::TYPE_EMAIL,
NotificationService::TYPE_INBOX
NotificationService::TYPE_EMAIL
];
}
}
5 changes: 0 additions & 5 deletions system/modules/inbox/actions/allread.php

This file was deleted.

17 changes: 0 additions & 17 deletions system/modules/inbox/actions/archive.php

This file was deleted.

16 changes: 0 additions & 16 deletions system/modules/inbox/actions/delete.php

This file was deleted.

15 changes: 0 additions & 15 deletions system/modules/inbox/actions/deleteforever.php

This file was deleted.

29 changes: 0 additions & 29 deletions system/modules/inbox/actions/index.php

This file was deleted.

25 changes: 0 additions & 25 deletions system/modules/inbox/actions/read.php

This file was deleted.

29 changes: 0 additions & 29 deletions system/modules/inbox/actions/send.php

This file was deleted.

40 changes: 0 additions & 40 deletions system/modules/inbox/actions/showarchive.php

This file was deleted.

30 changes: 0 additions & 30 deletions system/modules/inbox/actions/trash.php

This file was deleted.

17 changes: 0 additions & 17 deletions system/modules/inbox/actions/view.php

This file was deleted.

8 changes: 0 additions & 8 deletions system/modules/inbox/config.php

This file was deleted.

9 changes: 0 additions & 9 deletions system/modules/inbox/help/inbox_toc.help

This file was deleted.

12 changes: 0 additions & 12 deletions system/modules/inbox/help/index.help

This file was deleted.

8 changes: 0 additions & 8 deletions system/modules/inbox/help/send.help

This file was deleted.

3 changes: 0 additions & 3 deletions system/modules/inbox/help/test_extra.help

This file was deleted.

6 changes: 0 additions & 6 deletions system/modules/inbox/inbox.hooks.php

This file was deleted.

17 changes: 0 additions & 17 deletions system/modules/inbox/inbox.roles.php

This file was deleted.

Loading

0 comments on commit 38ba32f

Please sign in to comment.