Code Monkey home page Code Monkey logo

moodle-block_advnotifications's People

Contributors

danielneis avatar gustavorivas96 avatar zpottie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-block_advnotifications's Issues

adding rss support

hi
i've done work to add rss support to advnotifications plugin. here's the respository URL:
https://github.com/brandeis-wmd/moodle-block_advnotifications

  • the rss code was copied from blocks/rss_client
  • it was integrated into the main object (might be better off done differently)
  • the way it works is that if advnotifications "message" is a URL, code tries to retrieve feed and will display first description it finds in feed

i'm writing at this point to get make you aware of this work and see how it can be integrated into the plugin if desired.

so it's not really a bug, but this is a way to go forward. let me know, thx!

WYSIWYG/HTML Editor

Add a basic WYSIWYG/HTML editor or allow basic HTML to be manually entered by more advanced users. This is to allow some additional basic customisation to message.

Likely to be added as optional feature (setting to enable/disable editor vs textbox). Entered HTML/content also to be filtered for security reasons.

This feature has been requested more than once on block's page at moodle.org.

Capital letters in titles

The default Moodle language pack "en" uses capital letters in first word of multi-word titles only. The block name should be "Advanced notifications" (not Notifications). This would help to achieve consistency with the rest of standard Moodle UI.

Add capability to allow any role to create/manage notifications

Currently a teacher (for example) can't add a new notification to a block. A common use-case may be for teachers to add notifications to their course - not globally.

I believe the capabilities are not set up correctly - likely the contexts. But also, finer granularity is needed. For example, a capability to only add non-global notifications, ideal for teachers, ensuring the notification is not shown in other contexts it wasn't intended for.

This issue was initially raised at https://moodle.org/plugins/block_advnotifications

Unit test failures

So we have few unit test failures, they do not influence the workflow itself but it would be nice to have it pass everything.

  1. provider_testcase::test_metadata_provider with data set "block_advnotifications" ('block_advnotifications', 'block_advnotifications\privac...ovider')
    Failed asserting that false is true.

/moodle/privacy/tests/provider_test.php:131
/moodle/lib/phpunit/classes/advanced_testcase.php:80

This one seems to fail because lines 72 and 85 of blocks/advnotifications/classes/privacy/provider.php (in release 1.4.1) do not have "block_" prefix for table names.

Additional thing is that you print output in testcases which marks them as risky, but that is already nitpicking.

Warning: key() expects parameter 1 to be array, string given in /moodle/blocks/advnotifications/settings.php on line 101

Upgrading from 1.3.9 to 1.3.11, on the upgradesettings.php page see the following warning:

"Warning: key() expects parameter 1 to be array, string given in [path]/moodle/blocks/advnotifications/settings.php on line 101"

Also am seeing it on the Site Administration page (/moodle/admin/search.php). I have Debug messages set to DEVELOPER and Display debug messages to Yes on my development site where I am seeing the warning. The message goes away if I turn Display debug messages off.

The plugin seems to function as expected but perhaps the warning should be addressed?

Versions:
Moodle 3.5.14
PHP 7.2.24

Sitewide instance of block interferes with forgot_password.php and change_password.php

When I create an instance of this block on the front page and set Page contexts to "Display throughout entire site", and if the setting block_advnotifications | enable is set to true, then both the forgotten password link on the front page and the forced password reset option on user accounts have errors. The former redirects back to the login page, and the latter gives an error ERR_TOO_MANY_REDIRECTS.

Note: I'm using the Essential theme and Moodle 3.4, some testing seems to indicate this error may only be with the Essential theme.

DB queries in the renderer

Renderers should not ever touch the database. The actual logic of obtaining data to render should stand outside the output rendering logic.

Additionally, SQL queries should not be called in loops. The number of SQL queries should remain constant regardless the number of notifications to display. Ideally you should be able to fetch all data in one query and pass them to the renderer.

Validation failure

From Moodle.org


"Hi.

I'm getting the message "Installation aborted due to validation failure" when I try to update.

Moodle 3.5.1+ (Build: 20180713)

Regards"

Request: Use language strings in the values of the types

Would it be possible to use language strings in the values of the Types (warning, success, etc.)? In the table view all the English language strings are translatable, except this one. (PS: maybe use in that case strotolower php function to de-capitalize the first letter).

Proposal: enlarge min-width of message field

The textarea for the message field is of the same (min-)width as the title field. Although there is an option to enlarge the message field, maybe it's an idea to enlarge the min-width because a message is usually (much) larger than the title field. Visually this would be more attractive, I think.

Debug info: ERROR: value "32768" is out of range for type smallint

Moodle 3.8.5+
PostgreSQL 12
PHP 7.4
Ubuntu 20.04


Debug info: ERROR: value "32768" is out of range for type smallint
UPDATE mdl_block_advnotificationsdissed SET seen = $1 WHERE id=$2
[array (
'seen' => 32768,
0 => '1',
)]
Error code: dmlwriteexception
Stack trace:

line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 259 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 1184 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 1217 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->update_record_raw()
line 99 of /blocks/advnotifications/locallib.php: call to pgsql_native_moodle_database->update_record()
line 66 of /blocks/advnotifications/block_advnotifications.php: call to prep_notifications()
line 341 of /blocks/moodleblock.class.php: call to block_advnotifications->get_content()
line 235 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
line 91 of /blocks/advnotifications/block_advnotifications.php: call to block_base->get_content_for_output()
line 1181 of /lib/blocklib.php: call to block_advnotifications->get_content_for_output()
line 1239 of /lib/blocklib.php: call to block_manager->create_block_contents()
line 374 of /lib/blocklib.php: call to block_manager->ensure_content_created()
line 3920 of /lib/outputrenderers.php: call to block_manager->region_has_content()
line 49 of /theme/fordson/layout/frontpage.php: call to core_renderer->blocks()
line 1374 of /lib/outputrenderers.php: call to include()
line 1304 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
line 100 of /index.php: call to core_renderer->header()

How to adjust date format for USA form(MM-DD-YYYY)

Hello,
When on the "Manage Notifications" page, I cannot find a way to adjust how the date is displayed. Currently, it's in DD-MM-YYYY and I don't see a language string to change it to MM-DD-YYYY. Is this something that can be adjusted?

can date be swapped

Different date format after saving a notification

When I make a new notification and put the dates into the date fields in the dd/mm/yyyy placeholder format, the dates are incorrect saved as: mm/dd/yyyy. And I have to edit the dates afterwards to solve this. When I fill it in as yyyy/mm/dd, the date fields are saved in the format dd/mm/yyyy, which is in my case the correct way to display the notification on the proper dates. I'm using Moodle 3.6 with a child theme of Boost theme. What could be the problem and solution?

Announcement Style is the same as Info style

There are 5 styles to choose from when setting up a notification: Info, Success, Warning, Danger, Announcement

When Announcement is selected, it is identical to Info (according to the CSS when viewing the browser tools).

Is it possible to make "announcement" a separate class? I'd love to make it a nice purple on my site.

Support multilang tags & filter

This will allow the content of the message to support multiple languages on a single Moodle site (since a notification's Title/Message won't be Moodle langstrings).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.