Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Notifications CMS functionality #3103

Open
wants to merge 60 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d8028eb
Added "notifications"-CMS functionality.
jschultze Sep 19, 2023
af189aa
Merge branch 'dev-admin-cms' into dev_vnc
jschultze Sep 19, 2023
5c15d74
Refactoring.
jschultze Sep 19, 2023
e3e3a3d
Merge branch 'dev' into dev_vnc
jschultze Sep 19, 2023
cf63adb
Bugfixes in Notifications-factories.
jschultze Sep 20, 2023
6d9b5d5
Added CSS files with Notifications styles included.
jschultze Sep 20, 2023
2fab4ba
Added permissions example for Notifications.
jschultze Sep 20, 2023
82ab950
Added ability to close each broadcast for the remaining session.
jschultze Nov 7, 2023
b11d7e7
Changed the permission needed to access the notifications administrat…
jschultze Dec 5, 2023
61f7643
Moved the route configuration to the VuFindAdmin module.
jschultze Dec 5, 2023
2a0ecf0
Merge branch 'dev' into dev_vufind_notifications_cms
demiankatz Dec 15, 2023
72a9ee5
Add EOF newlines.
demiankatz Dec 15, 2023
dfbb948
php-cs-fixer
demiankatz Dec 15, 2023
7d5cb9c
phpcbf
demiankatz Dec 15, 2023
8b7b4b5
Fixed indentation and set encoding to utf8.
jschultze Feb 23, 2024
c2dd301
Merge remote-tracking branch 'vufind_notifications_cms/dev_vufind_not…
jschultze Feb 23, 2024
791ea99
Update of PHP version to match current requirements.
jschultze Mar 1, 2024
59b508a
Merge branch 'dev' into dev_vufind_notifications_cms
jschultze Mar 1, 2024
85e14a4
Changed the way the dataTables-library is included from directy copy …
jschultze Mar 4, 2024
34a578c
Removed unused code.
jschultze Mar 4, 2024
72d02c6
Removed jQuery IU and implemented custom tab navigation for notificat…
jschultze Mar 15, 2024
6e727c3
Added generated style and script files.
jschultze Mar 15, 2024
7d42817
Changed check of $templateDir and $templateName to flag in $this->lay…
jschultze Mar 19, 2024
b3415ba
Changed list of dependencies to alphabetic order.
jschultze Mar 19, 2024
8519318
Moved JavaScript and CSS of the datatables plugin from a global inclu…
jschultze Mar 19, 2024
a574e04
Cleaned up translations in templates and added translations to the la…
jschultze Mar 19, 2024
ea64672
Changed translation key to placeholder token.
jschultze Mar 19, 2024
a22c434
Added basic help pages for markdown and emojis.
jschultze Mar 20, 2024
c62480c
Fixed links to markdown help.
jschultze Mar 20, 2024
5e4c6d5
Update lockfile.
demiankatz Mar 20, 2024
9d6c242
Fixed typo in name of database column.
jschultze Mar 21, 2024
bb3ba81
Added missing database columns.
jschultze Mar 21, 2024
7189c11
Added missing configuration files for notifications.
jschultze Mar 21, 2024
0581300
Pages will not be selected based on language. They will be displayed …
jschultze Mar 22, 2024
244c350
Changed page id from being part of url to value of parameter "page_id".
jschultze Mar 22, 2024
cde9c59
Changed "color" to "background_color" to be more clear about the purp…
jschultze Mar 22, 2024
f13e9da
Fixed id for ajax requests in broadcast overview table.
jschultze Mar 22, 2024
84f0ec2
Set color in broadcast links for better visibility.
jschultze Mar 22, 2024
138a8f4
Moved the broadcasts above the search box on search/home.
jschultze Mar 22, 2024
b2573e8
Moved global permission check to methods where permission checks are …
jschultze Jul 3, 2024
a902b3e
Changed height of search header from height to min-height to allow no…
jschultze Jul 3, 2024
f2202ef
Bugfix of JavaScript source: the script crashed as no element #notifi…
jschultze Jul 3, 2024
eb4b0f7
Moved broadcasts in header to be always visible on mobile screens.
jschultze Jul 3, 2024
a658e4c
Removed hard coded date format.
jschultze Sep 26, 2024
0140266
Added line break at the end of the configuration file.
jschultze Sep 26, 2024
9a5aa33
Cleanup of translation keys.
jschultze Sep 26, 2024
485a60d
Cleanup of translation keys.
jschultze Sep 26, 2024
264e8bc
Cleanup of translation keys.
jschultze Sep 26, 2024
6040127
Changed start- and end-date for broadcasts from datetime to date.
jschultze Nov 7, 2024
50ff480
Added fixes from @maccabeelevine.
jschultze Nov 7, 2024
a251e91
Merge branch 'dev' into vufind_notifications_cms_merge_dev
jschultze Nov 20, 2024
10f15ac
Added composer packages for emoji support in notifications.
jschultze Nov 20, 2024
0ff8950
Added compiled css files for bootprint3, bootstrap3 and sandal themes.
jschultze Nov 20, 2024
2c2afa9
Added notification templates to bootstrap5 theme.
jschultze Nov 20, 2024
1d28f84
Added generated style and script files.
jschultze Nov 20, 2024
1dbd344
Added notifications additions to bootstrap5 theme.
jschultze Nov 20, 2024
e75ae07
Added layout variable hide notifications in the header on Search/Home.
jschultze Nov 20, 2024
b1c57b2
Added missing notifications view helper to bootstrap5.
jschultze Nov 20, 2024
ef1fe79
Fixed styles for notifications forms.
jschultze Nov 20, 2024
47225ab
Added initial sql for PostgreSQL.
jschultze Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"colinmollenhour/credis": "1.16.1",
"composer/package-versions-deprecated": "1.11.99.5",
"composer/semver": "3.4.3",
"elgigi/commonmark-emoji": "2.0.0",
"endroid/qr-code": "5.1.0",
"guzzlehttp/guzzle": "7.9.2",
"jaybizzle/crawler-detect": "^1.2",
Expand Down
42 changes: 40 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions config/vufind/Notifications.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Configuration file for notifications

Notifications:
# Activated languages.
# Add more as two character abbreviations.
languages:
- "en"

# Types of broadcasts.
# Add more by specifying a name ("success") ad the two colors for the box.
broadcast_types:
success:
background_color: "#E2EEDA"
border_color: "#74B566"
info:
background_color: "#DDECF6"
border_color: "#75BFDB"
warning:
background_color: "#FBF8E5"
border_color: "#E7AF5F"
danger:
background_color: "#EFDFDE"
border_color: "#C95C54"
3 changes: 3 additions & 0 deletions config/vufind/permissionBehavior.ini
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@ deniedTemplateBehavior = showTemplate:error/loginForAccess
; block this for some users, you should change the defaultAccountPage in
; config.ini to avoid causing login problems.
;deniedControllerBehavior = "exception::You are not logged in!"

[notifications.Admin]
deniedControllerBehavior = "showMessage:Access to notifications administration not granted"
7 changes: 7 additions & 0 deletions config/vufind/permissions.ini
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,10 @@ role = loggedin
;permission[] = "access.alma.webhook.challenge"
;require = ALL
;ipRange[] = "127.0.0.1"

; Example permission for Notifications
[notifications.Admin]
permission[] = notifications.Admin
role = loggedin
; Add usernames to restrict the access to certain users
;username[] = admin
21 changes: 21 additions & 0 deletions languages/de.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ account_requests_other = "Anderer Status"
Add a Library Card = "Bibliotheksausweis hinzufügen"
Add a Library Card using login = "Hinzufügen einer Bibliothekskarte mit institutionellem Login"
Add a Note = "Bemerkung hinzufügen"
Add New Notification = "Neu"
Add Tag = "Tag hinzufügen"
Add Tags = "Tags hinzufügen"
Add to another list = "Einer anderen Liste hinzufügen"
Expand Down Expand Up @@ -143,6 +144,13 @@ bound_with_intro = "Folgende Werke befinden sich in dem Buch mit der oben genann
Braille = "Blindenschrift"
Breadcrumbs = "Navigation"
Brief View = "Übersicht"
Broadcast = "Broadcast"
Broadcasts = "Broadcasts"
broadcasts_color = "Farbe"
broadcasts_enddate = "Bis"
broadcasts_startdate = "Von"
broadcasts_visible = "Sichtbar auf der Startseite"
broadcasts_visible_global = "Sichtbar auf jeder Seite"
Browse = "Durchstöbern"
Browse Alphabetically = "Alphabetisch durchstöbern"
Browse for Authors = "Nach Verfasser durchstöbern"
Expand Down Expand Up @@ -936,6 +944,19 @@ note_785_7 = "Fusioniert mit / Bildet"
note_785_8 = "Wieder u.d. Tit."
note_787 = "Andere Beziehung"
Notes = "Anmerkungen"
notifications_broadcasts = "Notifications Broadcasts"
notifications_broadcast_close_for_this_session = "Broadcast für diese Sitzung schließen"
notifications_content = "Inhalt"
notifications_delete_page_warning = "Sind Sie sicher, dass Sie den folgenden Eintrag löschen möchten?"
notifications_markdown_help = "Hilfe zu Markdown und Emojis"
notifications_pages = "Notifications Pages"
notifications_pages_external_url = "Externe URL"
notifications_pages_headline = "Überschrift"
notifications_pages_is_external_url = "Auf externe Seite verlinken"
notifications_pages_nav_title = "Anzeige Navigation"
notifications_pages_short = "Pages"
notifications_pages_visible = "Sichtbar"
notifications_tab_header = "Inhalt"
Number = "Nummer"
number_decimal_point = ","
number_thousands_separator = "."
Expand Down
21 changes: 21 additions & 0 deletions languages/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ account_requests_other = "Other Status"
Add a Library Card = "Add a Library Card"
Add a Library Card using login = "Add a Library Card using institutional Login"
Add a Note = "Add a Note"
Add New Notification = "New"
Add Tag = "Add Tag"
Add Tags = "Add Tags"
Add to another list = "Add to another list"
Expand Down Expand Up @@ -143,6 +144,13 @@ bound_with_intro = "The following works are all found in the book indicated by t
Braille = "Braille"
Breadcrumbs = "Breadcrumbs"
Brief View = "Brief View"
Broadcast = "Broadcast"
Broadcasts = "Broadcasts"
broadcasts_color = "Color"
broadcasts_enddate = "To"
broadcasts_startdate = "From"
broadcasts_visible = "Visible on the home page"
broadcasts_visible_global = "Visible on every page"
Browse = "Browse"
Browse Alphabetically = "Browse Alphabetically"
Browse for Authors = "Browse for Authors"
Expand Down Expand Up @@ -942,6 +950,19 @@ note_785_7 = "Merged with / Forms"
note_785_8 = "Changed back to"
note_787 = "Other relationship"
Notes = "Notes"
notifications_broadcasts = "Notifications Broadcasts"
notifications_broadcast_close_for_this_session = "Close broadcast for this session"
notifications_content = "Content"
notifications_delete_page_warning = "Are you sure you want to delete the following page?"
notifications_markdown_help = "Markdown and emojis help"
notifications_pages = "Notifications Pages"
notifications_pages_external_url = "External URL"
notifications_pages_headline = "Headline"
notifications_pages_is_external_url = "Link to exteral page"
notifications_pages_nav_title = "Navigation title"
notifications_pages_short = "Pages"
notifications_pages_visible = "Visible"
notifications_tab_header = "Content"
Number = "Number"
number_decimal_point = "."
number_thousands_separator = ","
Expand Down
10 changes: 10 additions & 0 deletions module/VuFind/config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
'VuFind\Controller\LibraryCardsController' => 'VuFind\Controller\AbstractBaseFactory',
'VuFind\Controller\MissingrecordController' => 'VuFind\Controller\AbstractBaseFactory',
'VuFind\Controller\MyResearchController' => 'VuFind\Controller\MyResearchControllerFactory',
'VuFind\Controller\NotificationsController' => 'VuFind\Controller\AbstractBaseFactory',
'VuFind\Controller\OaiController' => 'VuFind\Controller\AbstractBaseFactory',
'VuFind\Controller\OAuth2Controller' => 'VuFind\Controller\OAuth2ControllerFactory',
'VuFind\Controller\OverdriveController' => 'VuFind\Controller\AbstractBaseFactory',
Expand Down Expand Up @@ -312,6 +313,8 @@
'missingrecord' => 'VuFind\Controller\MissingrecordController',
'MyResearch' => 'VuFind\Controller\MyResearchController',
'myresearch' => 'VuFind\Controller\MyResearchController',
'Notifications' => 'VuFind\Controller\NotificationsController',
'notifications' => 'VuFind\Controller\NotificationsController',
'OAI' => 'VuFind\Controller\OaiController',
'oai' => 'VuFind\Controller\OaiController',
'OAuth2' => 'VuFind\Controller\OAuth2Controller',
Expand Down Expand Up @@ -398,6 +401,12 @@
'storageRetrievalRequests' => 'VuFind\Controller\Plugin\StorageRetrievalRequests',
],
],
'form_elements' => [
'factories' => [
'VuFind\Form\BroadcastsForm' => 'VuFind\Form\BroadcastsFormFactory',
'VuFind\Form\PagesForm' => 'VuFind\Form\PagesFormFactory',
],
],
'service_manager' => [
'allow_override' => true,
'factories' => [
Expand Down Expand Up @@ -768,6 +777,7 @@
'Feedback' => ['feedback-form' => 'Form/[:id]'],
'MyResearch' => ['userList' => 'MyList/[:id]', 'editList' => 'EditList/[:id]'],
'LibraryCards' => ['editLibraryCard' => 'editCard/[:id]'],
'Notifications' => ['notifications-page' => 'Page/[:page_id]'],
];

// Define static routes -- Controller/Action strings
Expand Down
42 changes: 42 additions & 0 deletions module/VuFind/sql/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,48 @@ CREATE TABLE `access_token` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `notifications_broadcasts`
--

CREATE TABLE `notifications_broadcasts` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`broadcast_id` int(11) DEFAULT NULL,
`visibility` tinyint(1) DEFAULT NULL,
`visibility_global` tinyint(1) DEFAULT NULL,
`priority` int(11) DEFAULT NULL,
`author_id` int(11) DEFAULT NULL,
`content` text DEFAULT NULL,
`color` varchar(255) DEFAULT NULL,
`startdate` date DEFAULT NULL,
`enddate` date DEFAULT NULL,
`change_date` datetime DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`language` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;

--
-- Table structure for table `notifications_pages`
--

CREATE TABLE `notifications_pages` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`page_id` int(11) DEFAULT NULL,
`visibility` tinyint(1) DEFAULT NULL,
`is_external_url` tinyint(1) DEFAULT NULL,
`priority` int(11) DEFAULT NULL,
`author_id` int(11) DEFAULT NULL,
`headline` varchar(255) DEFAULT NULL,
`nav_title` varchar(255) DEFAULT NULL,
`content` text DEFAULT NULL,
`external_url` varchar(255) DEFAULT NULL,
`change_date` datetime DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`language` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;

--
-- Table structure for table `login_token`
--
Expand Down
46 changes: 46 additions & 0 deletions module/VuFind/sql/pgsql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,52 @@ revoked boolean NOT NULL DEFAULT '0',
PRIMARY KEY (id, type)
);

--
-- Table structure for table `notifications_broadcasts`
--

DROP TABLE IF EXISTS "notifications_broadcasts";

CREATE TABLE notifications_broadcasts (
id serial,
broadcast_id int DEFAULT NULL,
visibility tinyint DEFAULT NULL,
visibility_global tinyint DEFAULT NULL,
priority int DEFAULT NULL,
author_id int DEFAULT NULL,
content text DEFAULT NULL,
color varchar(255) DEFAULT NULL,
startdate date DEFAULT NULL,
enddate date DEFAULT NULL,
change_date date DEFAULT NULL,
create_date date DEFAULT NULL,
language varchar(255) DEFAULT NULL,
PRIMARY KEY (id)
);

--
-- Table structure for table `notifications_pages`
--

DROP TABLE IF EXISTS "notifications_pages";

CREATE TABLE notifications_pages (
id serial,
page_id int DEFAULT NULL,
visibility tinyint DEFAULT NULL,
is_external_url tinyint DEFAULT NULL,
priority int DEFAULT NULL,
author_id int DEFAULT NULL,
headline varchar(255) DEFAULT NULL,
nav_title varchar(255) DEFAULT NULL,
content text DEFAULT NULL,
external_url varchar(255) DEFAULT NULL,
change_date date DEFAULT NULL,
create_date date DEFAULT NULL,
language varchar(255) DEFAULT NULL,
PRIMARY KEY (id)
);

--
-- Table structure for table `login_token`
--
Expand Down
Loading