226 Commits

Author SHA1 Message Date
Paul Holden
ca6731dff7
MDL-78117 comment: use new context entity in system report. 2023-08-02 08:05:50 +01:00
Paul Holden
d8df4ad675
MDL-78117 reportbuilder: use context entity in report sources.
Deprecate existing columns, to be replaced by corresponding elements
from the new entity.
2023-08-02 08:05:50 +01:00
Simey Lameze
9382d66b4a MDL-76635 comment: render the delete icon in the right place
Special thanks to Andrew Lyons.
2023-06-21 11:27:41 +08:00
Meirza
0d3a840154 MDL-77350 comment: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-16 00:33:19 +07:00
Andrew Nicols
511401f4f6 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Andrew Nicols
33b1e41f13 MDL-75012 js: Full build of all grunt things 2023-03-02 11:55:32 +08:00
Paul Holden
76327f04ac MDL-76591 comment: create test generators and Behat scenarios.
The added scenarios cover the management of comments: viewing,
filtering and deletion.
2023-01-30 16:00:25 +00:00
Paul Holden
35f3847064 MDL-76591 comment: implement new management interface elements.
Convert existing JS modules, call existing external service for
comment deletion.
2023-01-30 15:54:00 +00:00
Paul Holden
648b80c201 MDL-76591 comment: convert existing overview page to system report.
Re-use the entity definitions previously created in fdf2f8f3 for
custom reporting, to create a new system report class.
2023-01-30 15:53:59 +00:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Paul Holden
fdf2f8f31b MDL-75352 comment: implement comments datasource for custom reporting.
Create entity definition for a comment, join with user entity in new
report source to provide data for reportbuilder editor.
2022-10-20 13:37:56 +01:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Paul Holden
53d6b18237 MDL-74344 comment: consistent capability check for accessing report.
Co-authored-by: David Wipperfurth <dwipperfurth@webcourseworks.com>
2022-05-13 10:31:16 +01:00
Eloy Lafuente (stronk7)
9f53b0e965 MDL-73971 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- Some fixtures, initially defined in the test files have been
  moved to new files in fixtures subdirectory, leaving the unit
  test files clearer:
  - moodle2_course_format_test.php
- Rename wrong named test:
  - baseoptiogroup_test = baseoptigroup_test
2022-05-06 18:29:11 +02:00
Bas Brands
6f3a7998af MDL-73632 core_comment: useravatar styles new comments 2022-02-01 12:21:55 +01:00
Eloy Lafuente (stronk7)
100bc51f1d MDL-73485 phpunit: externallib, generator and filter tescase names
All externallib_test, generator_test and filter_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under testing/tests:

1) The core_testing component doesn't exist.
2) But testing/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have testing_xxxx as prefix.

Finally, also modified calendar/tests/events/events_test.php because it uses
some renamed (core_calendar_externallib_testcase => \core_calendar\externallib_test)
classes.
2022-01-21 19:48:23 +01:00
Eloy Lafuente (stronk7)
e4a2d9c1d4 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:02 +01:00
Eloy Lafuente (stronk7)
57e6fb7ad9 MDL-73348 phpunit: privacy and privacy_provider testcase names
All privacy_test and privacy_provider_test classes:

- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
2021-12-17 14:21:02 +01:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Neill Magill
2987182e16 MDL-64525 comments: Should not be able to delete frozen comments
Before this change in a frozen context a user would be able to delete
their own comments.

After this change a user will only be able to delete their own comments
if they still have the capability to post new comments or the capability
to delete comments from any user.
2020-08-24 07:59:27 +01:00
Neill Magill
7603ca3080 MDL-64525 comments: Tests for deleting frozen comments 2020-08-24 07:59:27 +01:00
Jake Dallimore
0c3eaf9ee6 MDL-64588 core_comment: fix unnecessary type check in add_comments
We should rely on the return type, else an exception with be thrown.
2019-10-02 09:23:43 +08:00
Jake Dallimore
93ea6612bd MDL-64588 core_comment: make external test code use helper method
Instead of using setUp to create testing objects, use a helper.
2019-10-02 09:23:43 +08:00
Jake Dallimore
ae94d477a6 MDL-64588 core_comment: fix get_comment ordering when timestamps match
Include id in the sorting, to be sure that we always get the correct
record in cases where the comment timestamps are the same.
2019-10-02 09:23:43 +08:00
Jake Dallimore
6cd3d398a9 MDL-64588 core_comment: use comment structure in external get_comments
Other minor changes include:
- added the since tag to newly added external functions
- Changed 'web service' to 'external function' in comment/upgrade.txt
2019-10-02 09:23:33 +08:00
Juan Leyva
09899abc55 MDL-64588 comment: New WebService core_comment_delete_comment 2019-10-01 09:26:01 +08:00
Juan Leyva
8e4a9ed854 MDL-64588 comment: New WebService core_comment_add_comment 2019-10-01 09:26:01 +08:00
Juan Leyva
2234b6c9dc MDL-64588 comment: Return whether the user can post in a comments area 2019-10-01 09:25:36 +08:00
Juan Leyva
48f5ca7bee MDL-66061 comments: Support pagination and sorting in get_comments WS 2019-08-19 10:42:25 +01:00
Mathew May
5cac5fa428 MDL-64506 templates: BS2 m-x-x to BS4 mx-x 2019-04-03 19:47:11 +08:00
Damyon Wiese
5d87464bc6 MDL-64651 comments: Do not send referrer
Use blanktarget option on all comments to prevent malicious links.
2019-03-05 04:24:53 +01:00
Adrian Greeve
a1b0ac60fe MDL-64339 core_comment: Update comment display to link to profile. 2018-12-07 11:13:16 +01:00
Andrew Nicols
c96cd71102 MDL-63924 privacy: Add shared user providers to subsytsems 2018-11-08 21:26:18 +08:00
Adrian Greeve
d2148f32ca MDL-63531 privacy: Update to comments provider to simplfy sql.
This updates the get_users_in_context_from_sql query to include
the context id to simplify the calls made from other components.
2018-10-30 09:47:14 +08:00
Michael Hawkins
cea5338780 MDL-63495 comment: Added provider::get_users_in_context_from_sql
This issue is part of the MDL-62560 Epic.
2018-10-22 12:48:13 +02:00
Michael Hawkins
d744b15bc6 MDL-63495 comment: Added provider::delete_comments_for_users
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:12:18 +08:00
Charles YVANES
458453cee0 MDL-29895 core: removed require_login() when not needed 2018-09-10 11:22:50 +02:00
Mihail Geshoski
329a84b489 MDL-35977 comments: Missing label in blog and assignment comment area 2018-07-23 08:55:14 +08:00
Marina Glancy
70703d4c51 MDL-61937 comment: do not use API in provider
When exporting comments we can not use comments API because:
- we don't need to call component validate, comments may be disabled right now but
  are still stored
- we don't need to call display callback
- we need to export all comments and not only first 15 of them
2018-05-04 11:22:14 +08:00
Adrian Greeve
1b33e410b5 MDL-62035 core_comment: Update to deletion methods.
Also clarification with the export method to clarify that it
is only for one context.
2018-04-20 10:42:24 +08:00
Andrew Nicols
fa983cfcc0 MDL-61836 comment: Add missing require 2018-04-20 08:17:15 +08:00
Luca Bösch
a07249826a MDL-38099 comments: year in comments date 2018-04-17 22:40:36 +02:00
Andrew Nicols
e98f0cf7ff MDL-61307 privacy: Rename deletion functions 2018-03-13 08:48:13 +08:00
Andrew Nicols
70f0923499 MDL-61307 core: Remove deletion_criteria 2018-03-13 08:48:12 +08:00
Adrian Greeve
5be028ab82 MDL-61307 core_comment: Add implementation of privacy API 2018-03-09 12:24:38 +08:00
John Okely
672f483670 MDL-42834 admin: Removal of httpswwwroot 2017-10-23 12:25:36 +08:00
Juan Leyva
e71687baf9 MDL-60198 webservice: Add missing MOODLE_INTERNAL checks 2017-09-21 13:01:28 +02:00
Damyon Wiese
dc633a24b9 MDL-40759 fontawesome: lang strings comments 2017-03-21 11:13:43 +08:00