Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
2b0f183d
Commit
2b0f183d
authored
Oct 08, 2013
by
Aaron Wells
Browse files
Removing unnecessary group code; cleaning up orphaned group content
Bug1236661 Change-Id: I0a9141df124a47c635b37e97cade15eff50f187d
parent
e2cbebf9
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/grouptype/course/lib.php
View file @
2b0f183d
...
...
@@ -62,10 +62,6 @@ class GroupTypeCourse extends GroupType {
return
array
(
'member'
,
'tutor'
,
'admin'
);
}
public
static
function
get_view_editing_roles
()
{
return
array
(
'tutor'
,
'admin'
);
}
public
static
function
get_view_moderating_roles
()
{
return
array
(
'tutor'
,
'admin'
);
}
...
...
htdocs/grouptype/lib.php
View file @
2b0f183d
...
...
@@ -96,8 +96,6 @@ abstract class GroupType {
*/
public
static
abstract
function
get_roles
();
public
static
abstract
function
get_view_editing_roles
();
public
static
abstract
function
get_view_moderating_roles
();
public
static
abstract
function
get_view_assessing_roles
();
...
...
htdocs/grouptype/standard/lib.php
View file @
2b0f183d
...
...
@@ -60,10 +60,6 @@ class GroupTypeStandard extends GroupType {
return
array
(
'member'
,
'admin'
);
}
public
static
function
get_view_editing_roles
()
{
return
array
(
'member'
,
'admin'
);
}
public
static
function
get_view_moderating_roles
()
{
return
array
(
'admin'
);
}
...
...
htdocs/lib/db/upgrade.php
View file @
2b0f183d
...
...
@@ -3449,5 +3449,35 @@ function xmldb_core_upgrade($oldversion=0) {
add_field
(
$table
,
$field
);
}
if
(
$oldversion
<
2013100800
)
{
// Prior to Mahara 1.4, we did not delete group data when the group was deleted.
// So, let's just take a moment to clear that out now.
$deletedgroups
=
get_column
(
'group'
,
'id'
,
'deleted'
,
1
);
if
(
$deletedgroups
)
{
require_once
(
get_config
(
'libroot'
)
.
'group.php'
);
foreach
(
$deletedgroups
as
$groupid
)
{
// Temporarily set the group's "deleted" flag to 0 so that the group_delete()
// function can process it properly. By putting this inside a transaction we
// can make sure no page loads will see it as an active group. It should get
// set back to 0 by group_delete()
db_begin
();
set_field
(
'group'
,
'deleted'
,
0
,
'id'
,
$groupid
);
try
{
// Delete any remaining records for this group. Don't notify group members.
// This will have the side effect of double-munging the deleted group's
// name, but I think that's acceptable.
group_delete
(
$groupid
,
null
,
null
,
false
);
}
catch
(
Exception
$e
)
{
// Out of an abundance of caution, try to catch any Exception that
// might happen while cleaning out these groups, and make sure the
// group remains set deleted at the end.
set_field
(
'group'
,
'deleted'
,
1
,
'id'
,
$groupid
);
}
db_commit
();
}
}
}
return
$status
;
}
htdocs/lib/version.php
View file @
2b0f183d
...
...
@@ -31,7 +31,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/index.php/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config
->
version
=
2013
093
00
1
;
$config
->
version
=
2013
1008
00
;
$config
->
release
=
'1.8rc2dev'
;
$config
->
minupgradefrom
=
2008040200
;
$config
->
minupgraderelease
=
'1.0.0 (release tag 1.0.0_RELEASE)'
;
...
...
htdocs/lib/view.php
View file @
2b0f183d
...
...
@@ -325,15 +325,6 @@ class View {
if
(
empty
(
$this
->
columnsperrow
))
{
$this
->
columnsperrow
=
get_records_assoc
(
'view_rows_columns'
,
'view'
,
$this
->
get
(
'id'
),
'row'
,
'row, columns'
);
}
if
(
$this
->
group
)
{
$group
=
get_record
(
'group'
,
'id'
,
$this
->
group
);
if
(
$group
->
deleted
)
{
throw
new
ViewNotFoundException
(
get_string
(
'viewnotfound'
,
'error'
,
$id
));
}
safe_require
(
'grouptype'
,
$group
->
grouptype
);
$this
->
editingroles
=
call_static_method
(
'GroupType'
.
ucfirst
(
$group
->
grouptype
),
'get_view_editing_roles'
);
}
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment