519 Commits

Author SHA1 Message Date
Ferran Recio
2a0991113b MDL-75234 mod_data: load default templates when empty
The mod_data is forcing teachers to understand how to write templates
even if they want to use basic forms. With this patch the default
templates will be auto updated unless the user manually define the
templates.
2022-10-03 15:58:28 +02:00
Ferran Recio
2b48b29c86 MDL-75149 mod_data: add preview to presets 2022-09-14 12:30:13 +02:00
Amaia Anabitarte
ae5dc809ec MDL-75187 mod_data: Move delete preset to a modal
Co-author: Ferran Recio <ferran@moodle.com>
2022-09-02 16:01:38 +02:00
Sara Arjona
cb4b6f125b MDL-75353 mod_data: always return str in data_generate_default_template
From now on, the data_generate_default_template method will always return
a string with the template content or an empty string when there is no
content available (for instance, when the database has no fields).
This method won't return a boolean anymore.
2022-08-19 08:42:15 +02:00
Amaia Anabitarte
cb01747608 MDL-75137 mod_data: Add entry throws an exception if there is no field 2022-08-12 15:46:08 +02:00
Sara Arjona
aecb87f53e MDL-75142 mod_data: Add description to presets
This commit adds support to description field for presets:
- For plugin presets, description will be stored in the module_help
string in lang files.
- For saved presets, a new element, <description>, has been added
to the preset.xml file, to include this information.

A new field has been added to the "Save as preset" modal, to let users
define description (which is empty by default, to support pre-existing
presets that won't have it).

Apart from that, the "Save as preset" workflow has been slightly improved,
following the Product UX/UX suggestions to hide the checkbox to overwrite
the preset by default and show it only if the user tries to save a preset
with an existing name.
2022-08-05 14:51:49 +02:00
Sara Arjona
9d10f7d19e MDL-75148 mod_data: Add isplugin info to presets
This activity currently supports two different preset types:
- Datapreset plugins, that can be installed copying them to the
mod/data/preset folder.
- Presets saved manually by users.

This commit adds an attribute to the presets to mark them, in order
to identify them later (because, for instance, the plugins can't be
removed).

Apart from that, the methods in lib.php, involved with this issue, have
been deprecated. New methods have been implemented in the manager class,
covering them with PHPUnit tests.
2022-08-01 12:08:16 +02:00
Sara Arjona
bc9b915a32 MDL-75146 mod_data: Fix comments raised during int-review 2022-07-22 07:27:40 +02:00
Ferran Recio
776e48748f MDL-75146 mod_data: refactor template parser 2022-07-22 07:27:40 +02:00
Ferran Recio
e2da14bbb8 MDL-75146 mod_data: migrate templates editor to mustache 2022-07-22 07:27:40 +02:00
Ferran Recio
c6db008496 MDL-75146 mod_data: add a manager class 2022-07-22 07:27:40 +02:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Mihail Geshoski
4a9c83ac9e MDL-73532 navigation: Modify methods that extend the setting nav
Introduces some changes to the exising _extend_settings_navigation()
methods that utilize the global $PAGE object. In order to accomodate
the changes done for the secondary navigation for single activity
courses, the methods that extend the settings navigation can no longer
rely on the $PAGE object, instead the more reliabe way to obtain this
infomation is through the get_page() method from settings_navigation
class.
2022-02-14 09:40:27 +08:00
Mihail Geshoski
4cc2b15e51 MDL-73357 mod_data: Update tertiary navigation
The following commit disables the acivity header information in
pages where this information is not required, adds missing headings,
updates the breadcrumbs, repositions the groups selector in the
database view page.
2022-02-01 11:45:12 +08:00
Adrian Greeve
0a04ebde11 MDL-72930 navigation: Remove duplicated navigation boxes.
Some pages have settings that really aren't required anymore.
These have been removed and a function has been aded so that other
developers can turn off the navigation overflow if they want.
2022-01-04 15:58:52 +08:00
Bas Brands
f2ddd23ec1 MDL-71457 theme_boost: activity icon styling 2021-12-20 15:02:24 +01:00
Peter Dias
535bbed24e MDL-72413 data: Use the common module for setting the header 2021-12-13 09:49:34 +08:00
Mihail Geshoski
6470282e93 MDL-71913 mod_data: Add tertiary navigation 2021-10-13 11:05:29 +08:00
Simey Lameze
9afd980b4e MDL-72543 block_timeline: change the display of event names 2021-10-07 14:05:34 +08:00
Michael Hawkins
1ea2ae17be MDL-71162 mod_data: Ensure completion conditions displayed on all tabs 2021-04-29 00:41:07 +08:00
Sara Arjona
12f64a02c9 Merge branch 'MDL-71144-master' of git://github.com/rezaies/moodle 2021-04-23 13:16:01 +02:00
Jun Pataleta
08fb6a71b7 MDL-71144 mod_data: Deprecate data_get_completion_state() 2021-04-22 10:08:10 +10:00
Luca Bösch
aee27d0a9b MDL-71118 core: Add grade (verb) string.
AMOS BEGIN
 CPY [grade,core],[gradenoun,core]
 CPY [grade,core],[gradeverb,core]
AMOS END
2021-04-17 11:46:09 +02: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
Luca Bösch
ac3a15c287 MDL-68893 mod_data: use own RSS feed string.
AMOS BEGIN
 CPY [rsstype,core],[rsstype,mod_data]
AMOS END
2021-01-29 23:43:18 +01:00
Andrew Nicols
bcce0270fe MDL-66496 mod_data: Fixes during integration 2019-10-17 12:20:54 +08:00
Andrew Nicols
a7139f7600 Merge branch 'MDL-66496-master' of git://github.com/tobiasreischmann/moodle 2019-10-17 11:05:34 +08:00
Jun Pataleta
4f71255e61 MDL-66874 mod_data: Explicitly add btn-secondary class to select all
* Plus use correct option attribute 'classes' for the slave
  checkboxes
2019-10-14 11:27:19 +08:00
Tobias Reischmann
8bb0d5fb5f
MDL-66496 mod_data: Make import functionality testable 2019-10-04 19:34:53 +02:00
Justus Dieckmann
ba2fc8bd94
MDL-66496 mod_data: Import author information on csv import 2019-10-04 19:33:54 +02:00
Andrew Nicols
4bb39eabc7 MDL-66733 grade: Add helper to get correct user date for grade 2019-09-20 09:50:17 +08:00
Jun Pataleta
e274f1b29e MDL-65933 mod_data: Use new core/checkbox_toggleall 2019-08-02 16:30:39 +08:00
Mathew May
2ddd7605d8 MDL-65606 mod_data: Add approvalstatusclass to template 2019-05-27 13:38:25 +08: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
40fe153816 MDL-64878 grades: Update delete_instance
When grades are deleted, it needs to know the context so any files
in the gradebook can be deleted. This means module delete_instance
functions must delete the grade_item before they delete the module record.
2019-02-27 10:37:54 +08:00
Marcus Fabriczy
f5d1dbb37f MDL-62893 mod: Grade visibility bug in the Outline/Complete reports
Grades that have been hidden will appear in the outline/complete
report - even if the user is a student.

The modules that have been fixed are:
* mod_assign
* mod_data
* mod_forum
* mod_glossary
* mod_lesson
* mod_scorm
* mod_workshop
2019-02-05 20:01:32 +10:30
Tim Hunt
939218c2b6 MDL-46783 permissions: let some moodle/ caps be overriden in all mods
The capabilities changed ('contextlevel' => CONTEXT_COURSE changed to
'contextlevel' => CONTEXT_MODULE) are:

* moodle/site:accessallgroups
* moodle/site:viewfullnames
* moodle/site:trustcontent
* moodle/site:viewuseridentity

This list came from reviewing the _get_extra_capabilities functions in
all core activities. They were all somewhat inconsistent, but I think it
makes sense that these capabilities are consistently overridable in all
activities. E.g. moodle/site:accessallgroups affects conditional
availability even if there is no other user of groups, and
moodle/site:viewuseridentity and moodle/site:viewfullnames affect the
logs report, if nothing else.

As a result of this, several _get_extra_capabilities functions are no
longer needed, and all the rest have been simplified.
2018-12-05 16:44:25 +00:00
Eloy Lafuente (stronk7)
bd5fdcfccd MDL-63422 general: review core loop / switch / case / continue
This commit reviews all continue uses in core happening within a
loop / switch / case hierarchy. This does not cover:

- Changes to libraries. Will be handled in another issue / commit.
- Uses out from loops, will be reviewed by other commit.

The policy followed has been:
- When possible, take rid of the continue.
- When clearly the intention was to jump to next element in loop
  change to continue 2
- When it was not clear, keep old behavior switching to break, no
  matter how weird the behavior may be.
2018-10-31 00:17:59 +01:00
Shamim Rezaie
eb4c801cef MDL-63136 mod_data: Check if the module is visible to the user 2018-09-07 17:40:29 +10:00
Shamim Rezaie
362f9e7c61 MDL-63136 mod_data: Add userid param to mod_data calendar callbacks 2018-09-07 17:40:16 +10:00
Marina Glancy
b03c67e978 MDL-61876 mod_data: call format_text on template before replacement
Otherwise when $CFG->forceclean is enabled all search input fields are stripped out
2018-05-07 11:21:06 +08:00
Simey Lameze
5e401a2a51 MDL-60060 mod_data: add calendar drag and drop callbacks 2017-12-11 14:05:00 +08:00
Mark Nelson
3dfd48ba9c MDL-57455 mod_data: moved export tag checkbox and set default
Also capitalised string 'tags'.

AMOS BEGIN
 CPY [tags,core],[tags,mod_data]
AMOS END
2017-10-18 16:03:17 +08:00
Eloy Lafuente (stronk7)
76feb5ac9b MDL-57455 mod_data: table aliases cannot use AS for crossdb 2017-10-16 19:16:17 +02:00
Mark Nelson
822b3346ce MDL-57455 mod_data: added 'Manage standard tags' link 2017-10-12 16:59:16 +08:00
Mark Nelson
80effa0faa MDL-57455 mod_data: added reset tags functionality 2017-10-12 16:59:16 +08:00
Andrew Hancox
04f7b079bc MDL-57455 mod_data: Import and export tags 2017-10-12 16:59:15 +08:00
Andrew Hancox
d45c7a6823 MDL-57455 mod_data: Extend advanced search to cover tags
Also removed redundant code as $advtables, $advwhere etc.
are only used below when constructing $fromsql which is
only used if advanced is empty.
2017-10-12 16:59:15 +08:00
Andrew Hancox
ca5f3e0a2e MDL-57455 mod_data: Implement tagging 2017-10-12 16:59:14 +08:00