81 Commits

Author SHA1 Message Date
Ankit Agarwal
50587d71a5 MDL-41312 groups: Remove old bulk events 2017-12-28 11:57:34 +05:30
Andrew Hancox
a63cd3e2ca MDL-50666 core: Add function get_viewable_roles to set role visibility 2017-12-19 13:53:23 +13:00
Damyon Wiese
bdb157653b Merge branch 'MDL-60174-master' of https://github.com/sammarshallou/moodle 2017-11-28 11:38:40 +08:00
sam marshall
a938e4096c MDL-60174 core_dml: fix miscellaneous incorrect recordset usage
The new recordset support for Postgres requires transactions and
will cause errors if recordsets are not closed correctly. This
commit fixes problems that were identified during unit tests, and
via some basic code analysis, across all core code. Most of these
are incorrect usage of recordset (forgetting to close them).
2017-11-27 11:10:33 +00:00
Shamim Rezaie
0897d6588e MDL-60188 groups: cache user's groups and groupings
The function groups_get_user_groups is called too often both before rendering the page and after the page is rendered (using ajax).
The function was executing a query joining 3 tables in each call. The plementation of the function has now modified to store the
query result in a request cache.
2017-11-27 10:46:35 +08:00
Damyon Wiese
f3ecea3af4 MDL-59368 groups: Peer review fixes
* Fix coalesce on postgres.
* The edit icon's alt shows the HTML entities causing
* enrol/tests/behat/add_to_group.feature Contains a '@doit' tag which I assume is there from testing.
* group/classes/output/user_groups_editable.php
** Missing MOODLE_INTERNAL check.
** Unused variables context_system and moodle_exception.
** The PHPDocs for the constructors are wrong.
** export_for_template() returns an array, not stdClass (according to parent docs).
** Change moodle_exception to coding_exception at the beginning.
* group/lib.php
** Missing docs for core_group_inplace_editable().
* user/classes/participants_table.php
** The docs for the class variables $groups, $course and $context need a '\' beforehand as they are in a namespace.
** I would prefer $this->context = $context; and $this->groups = ... to be done at the end of the constructor with the other class variable assignments.
** You could get rid of the class variable courseid if we are setting course and use $this->course->id instead.
** The function col_groups has @param \stdclass $row but it should be $data
* lib/amd/src/form-autocomplete.js and lib/amd/src/inplace_editable.js
** Some issues here CiBot has pointed out.
* lib/classes/output/inplace_editable.php
** @see should be on a new line.
2017-07-12 10:09:09 +08:00
Damyon Wiese
2fa35b8d16 MDL-59368 groups: Inplace editing for users groups 2017-07-12 10:07:57 +08:00
Vadim Dvorovenko
dd399f51ab MDL-45835 group: events for groupings assign/unassign 2016-03-24 10:59:35 +08:00
Mark Nelson
3ee812fab4 MDL-53072 group: minor changes to existing code
1) Tidied up conditional check and put additional variable on new line.
2) Prevented change of the default behaviour for 'groups_get_potential_members()'.
3) Added another behat test.
2016-02-26 11:42:14 +08:00
Niclas Tollstorff
7b96ffb044 MDL-53072 group: added 'only active' option when auto-creating groups 2016-02-26 11:42:14 +08:00
Dan Poltawski
53a2405c9c MDL-50357 groups: remove pointless option of groups_delete_group_members 2015-12-30 09:19:22 +00:00
Mark Nelson
04503c5cde MDL-50357 core_group: tidy up the function groups_delete_group_members 2015-12-30 09:27:05 +08:00
Marina Glancy
9c1561ef83 MDL-17929 groups: function to sync groups with enrolments 2015-04-22 14:36:38 +08:00
Frederic Massart
d996c620a9 MDL-46416 group: Allow group pictures to be deleted 2014-11-25 11:58:13 +08:00
Frederic Massart
21449d01b7 MDL-46416 group: Use a revision number for group pictures 2014-11-25 11:58:13 +08:00
Tony Butler
f84b9e65e4 MDL-46792 core_group: Check that $data->name is set before trimming
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-08-15 09:43:36 +01:00
Gregory Faller
e4ebf7ef0f MDL-46524: Auto-create groups from existing group or grouping membership 2014-08-06 10:50:14 +09:30
Syxton
55c9a15041 MDL-45991 groups: Auto-create ignore grouped users
MDL-45991 groups: Auto-create groups with ungrouped users only

When using auto-create groups, sometimes it is needed to only create
groups with users that are not already inside a course group.  This
patch creates a checkbox that will ignore users that are in already
existing groups.  It alters the groups_get_potential_members function so
that the eligible users are retrieved entirely though sql.
2014-07-10 15:44:21 -04:00
Marina Glancy
24c32bdf2f MDL-44403 events: added public method to get eventdata 2014-03-04 15:16:15 +08:00
Adrian Greeve
60f55a2f72 MDL-42238 - Groups: Alternate name sql update to groups_get_potential_members(). 2013-10-10 14:05:53 +08:00
Frederic Massart
861b0510e5 MDL-39959: Replace Legacy events - Groups
This combines the following changes:

* Event for group member added
* Event for group member removed
* Event for group created
* Event for grouping created
* Event for group updated
* Event for grouping updated
* Event for group deleted
* Event for grouping deleted
* Adding tests for deleting functions
* Bulk remove of members uses low-level API

    The reason for this is that a bulk event has no value from a logging
    perspective as it is not granular. So now, the API is a bit slower,
    but the information the events contain makes sense, beside this is
    not (and should not be) used very often.

    The reason why the events_trigger_legacy() is kept is because we
    cannot create a new event for this, as we don't encourage developers
    to created bulk events, for the reasons mentioned above.

    I removed the call that gets the user record from the function
    groups_remove_member() as it was not required and only appeared
    to check if the user existed. It appears to be safe not to do
    this check as nothing would fail down the line.

* Bulk unassign of groupings uses low-level API

    As the previous commit, we keep the legacy event for now as it would
    be wrong to create a new event to replace it.

    Also, the code has been changed to call the low-level API to unassign
    groups from groupins, even though at the moment there are no
    events for that function.

* Bulk deletion of groups uses low-level API

    Again, we keep the legacy event because replacing it would force
    us to create a new event that does not make sense. See MDL-41312.

* Bulk deleting of groupings uses low-level API
* Asserting legacy event name in unit tests
* Minor SQL query and code improvements
2013-08-26 15:03:17 +08:00
Damyon Wiese
74df2951d1 Revert "MDL-39876 Change get_record('course') calls to get_course"
This reverts commit ab7632b74c331540c90229bf03d13aa2e6bdd9be.
2013-08-21 13:42:30 +08:00
sam marshall
ab7632b74c MDL-39876 Change get_record('course') calls to get_course 2013-08-15 11:31:20 +01:00
Mark Nelson
4e829d48d1 MDL-40468 libraries: removed usages of get_related_contexts_string() in core
Also tidied up the functions by removing unused parameters.
2013-07-19 15:17:50 +08:00
Petr Škoda
b0d1d941c9 MDL-40220 use new core_component::get_component_directory() 2013-07-16 22:42:37 +02:00
Petr Škoda
689096bc26 MDL-38654 do not test $CFG->gdversion
GD PHP extension is now required. Add-ons need to remove $CFG->gdversion tests. The worst case regression is that add-on will think GD is not available.
2013-03-22 16:57:55 +01:00
Dan Poltawski
f6623fe130 Merge branch 'MDL-27164-master' of git://github.com/micaherne/moodle 2013-01-22 12:51:51 +08:00
Sam Hemelryk
e17dbeeb1a MDL-34398 groups: implemented caching of group information. 2013-01-17 09:24:58 +13:00
Adrian Greeve
51e8d287f9 MDL-30797 - backup groups: Added a parameter to the groups_assign_grouping function.
$timeadded has now been included so that the backup / restore functions can now use
this API rather than duplicating the code.
2013-01-14 10:24:37 +08:00
Michael Aherne
d6af3d847f MDL-27164 groups Do not show multiple instances of the same role as multiple 2013-01-11 11:12:33 +00:00
Eloy Lafuente (stronk7)
c740703c18 Merge branch 'w40_MDL-31437_m24_cohortsync' of git://github.com/skodak/moodle
Conflicts:
	lib/upgrade.txt
2012-10-02 22:00:12 +02:00
Eloy Lafuente (stronk7)
8614cd72f0 Merge branch 'MDL-34657' of git://github.com/timhunt/moodle 2012-10-01 23:22:39 +02:00
Petr Škoda
7881024ec4 MDL-31437 add group sync option to enrol_cohort
This patch includes following changes and new features:
* Group sync in enrol_cohort plugin.
* Option for editing of role in existing cohort sync instance.
* Group memberships are now restored after enrolments.
* New enrol method for restore of protected group membership.
* New component callback 'restore_group_member' for restore of general plugin group membership.
* New component callback 'restore_role_assignment' for restore of general plugin role assignments.
* Implemented group membership protection in enrolment UI.
* Other minor fixes and cleanup.

Notes:
* The YUI base enrolment page is not reimplemented yet - see MDL-35618.
2012-09-28 21:00:00 +02:00
Tim Hunt
9695ff811b MDL-34657 user sorting: consistent sorting everywhere.
This commit coverts everything in the codebase to use the new
users_order_by_sql function when sorting lists of users. More details in
the bug.

Note that this does not change places where users are displayed in a
sortable table, and the sort order comes from the table.
2012-09-27 12:41:42 +01:00
Mark Nelson
5a45b936bf MDL-35637 group: Fix form submission error that occurs when GD version is not set. 2012-09-27 12:00:02 +08:00
sam marshall
1d1917aeaa MDL-31973 Groups: groups_members table should have 'component', 'itemid' fields 2012-08-24 15:30:13 +01:00
Ankit Agarwal
bf0f06b1be MDL-34471 libraries: Replace all uses of get_context_instance() with respective context_XXXX::instance() method 2012-08-02 15:37:38 +08:00
Petr Skoda
c52551dc3c MDL-8249 localise standard role names and descriptions if empty 2012-07-06 08:22:34 +02:00
Andrew Robert Nicols
74b714df7e MDL-32005 Add idnumber field to groups and groupings 2012-05-15 09:38:51 +01:00
Adrian Greeve
4d8e241742 MDL-30997 - group - update of the api block documentation. 2012-02-21 11:17:27 +08:00
Petr Skoda
16ef46e7b6 MDL-29450 improve and cleanup course content removal
New keep roles/enrolments and groups/groupings options, notification CSS fixed, standardised notification texts, added missing delete of module blocks, fixed file deleting and some other minor issues.
2011-11-23 18:37:36 +01:00
Petr Skoda
1c7a2f84db MDL-24787 fixing group UI to work for users without roles too 2010-10-26 13:38:05 +00:00
Petr Skoda
d490ca8161 MDL-24690 fixed incorrect cohort condition when auto-creating groups 2010-10-18 08:26:57 +00:00
Petr Skoda
ace9051cc1 MDL-24321 switching to stdClass in /g*/ 2010-09-21 08:16:49 +00:00
Petr Skoda
d08787af90 MDL-23202 gdlib api cleanup 2010-07-11 13:12:53 +00:00
Petr Skoda
e88dd87685 MDL-23202 group icons now stored in file storage pool 2010-07-11 13:07:24 +00:00
Petr Skoda
64f93798d4 MDL-22950 adding new component column to the files table, unfortunately this change requires changes in all 2.0dev code, please review all custom code that was already upgraded to 2.0; fixing multiple problems and regressions in mod/assignment 2010-07-03 13:37:13 +00:00
Petr Skoda
df997f841f MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
    MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
    MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
    MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
    MOV [enrolenddate,core],[enrolenddate,enrol_self]
    CPY [welcometocourse,core],[welcometocourse,enrol_self]
    CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
    MOV [notenrollable,core],[notenrollable,core_enrol]
    MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
    MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
    MOV [coursemanager,core_admin],[coursecontact,core_admin]
    MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
    MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
    MOV [enrolme,core],[enrolme,core_enrol]
    MOV [unenrol,core],[unenrol,core_enrol]
    MOV [unenrolme,core],[unenrolme,core_enrol]
    MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
    MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
    MOV [enrolments,core],[enrolments,core_enrol]
    MOV [enrolperiod,core],[enrolperiod,core_enrol]
    MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
Petr Skoda
64fa9aa723 fixed comment typo 2010-05-21 19:25:13 +00:00
Petr Skoda
92343cd2eb MDL-21781 added support for autocreation of groups from cohorts 2010-04-23 09:15:55 +00:00