Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
34d836c7
Commit
34d836c7
authored
Aug 02, 2016
by
Robert Lyon
Committed by
Gerrit Code Review
Aug 02, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1527456: removing the last remnants of the accessconf stuff"
parents
93e03f8e
2816ade1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
16 deletions
+14
-16
htdocs/lib/db/install.xml
htdocs/lib/db/install.xml
+0
-1
htdocs/lib/db/upgrade.php
htdocs/lib/db/upgrade.php
+9
-1
htdocs/lib/view.php
htdocs/lib/view.php
+4
-13
test/behat/features/group/group_view_block.feature
test/behat/features/group/group_view_block.feature
+1
-1
No files found.
htdocs/lib/db/install.xml
View file @
34d836c7
...
...
@@ -793,7 +793,6 @@
<FIELD
NAME=
"visits"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
DEFAULT=
"0"
/>
<FIELD
NAME=
"allowcomments"
TYPE=
"int"
LENGTH=
"1"
NOTNULL=
"true"
DEFAULT=
"1"
/>
<FIELD
NAME=
"approvecomments"
TYPE=
"int"
LENGTH=
"1"
NOTNULL=
"true"
DEFAULT=
"0"
/>
<FIELD
NAME=
"accessconf"
TYPE=
"char"
LENGTH=
"40"
NOTNULL=
"false"
/>
<FIELD
NAME=
"locked"
TYPE=
"int"
LENGTH=
"1"
DEFAULT=
"0"
NOTNULL=
"true"
/>
<FIELD
NAME=
"urlid"
TYPE=
"char"
LENGTH=
"100"
NOTNULL=
"false"
/>
<FIELD
NAME=
"anonymise"
TYPE=
"int"
LENGTH=
"1"
NOTNULL=
"true"
DEFAULT=
"0"
/>
...
...
htdocs/lib/db/upgrade.php
View file @
34d836c7
...
...
@@ -4501,7 +4501,7 @@ function xmldb_core_upgrade($oldversion=0) {
}
if
(
$oldversion
<
2016062900
)
{
log_debug
(
'Assign an i
n
stitution for each existing group that doesn\'t have one.'
);
log_debug
(
'Assign an istitution for each existing group that doesn\'t have one.'
);
$groups
=
execute_sql
(
"UPDATE
{
group
}
SET institution = 'mahara'
WHERE (institution IS NULL OR institution = '') AND deleted = 0"
,
array
());
}
...
...
@@ -4636,7 +4636,15 @@ function xmldb_core_upgrade($oldversion=0) {
add_key
(
$table
,
$key
);
}
}
}
if
(
$oldversion
<
2016072500
)
{
log_debug
(
'Drop obsolete column "accessconf" from "view" table'
);
$table
=
new
XMLDBTable
(
'view'
);
$field
=
new
XMLDBField
(
'accessconf'
);
if
(
field_exists
(
$table
,
$field
))
{
drop_field
(
$table
,
$field
);
}
}
if
(
$oldversion
<
2016072500
)
{
...
...
htdocs/lib/view.php
View file @
34d836c7
...
...
@@ -58,7 +58,6 @@ class View {
private
$allowcomments
;
private
$approvecomments
;
private
$collection
;
private
$accessconf
;
private
$locked
;
private
$urlid
;
private
$skin
;
...
...
@@ -1009,7 +1008,6 @@ class View {
// Hash the config object so later on we can easily find
// all the views with the same config/access rights
$config
[
'accesslist'
]
=
$fullaccesslist
;
$accessconf
=
substr
(
md5
(
serialize
(
$config
)),
0
,
10
);
foreach
(
$viewids
as
$viewid
)
{
$v
=
new
View
((
int
)
$viewid
);
...
...
@@ -1025,7 +1023,6 @@ class View {
if
(
isset
(
$config
[
'copynewgroups'
]))
{
$v
->
set
(
'copynewgroups'
,
$config
[
'copynewgroups'
]);
}
$v
->
set
(
'accessconf'
,
$accessconf
);
$v
->
commit
();
}
...
...
@@ -6022,18 +6019,18 @@ class View {
* @param mixed $owner integer userid or array of userids
* @param mixed $group integer groupid or array of groupids
* @param mixed $institution string institution name or array of institution names
* @param
string $matchconfig record all matches with given config hash (see set_access)
* @param
null $obsoleteparam Former "$matchconfig" parameter, value now ignored, param kept only to avoid breaking back-compatibility.
* @param boolean $includeprofile include profile view
* @param integer $submittedgroup return only views & collections submitted to this group
* @param $string $sort Order to sort by (defaults to 'c.name, v.title')
*
* @return array, array
*/
function
get_views_and_collections
(
$owner
=
null
,
$group
=
null
,
$institution
=
null
,
$
matchconfig
=
null
,
$includeprofile
=
true
,
$submittedgroup
=
null
,
$sort
=
null
)
{
function
get_views_and_collections
(
$owner
=
null
,
$group
=
null
,
$institution
=
null
,
$
obsoleteparam
=
null
,
$includeprofile
=
true
,
$submittedgroup
=
null
,
$sort
=
null
)
{
$excludelocked
=
$group
&&
group_user_access
(
$group
)
!=
'admin'
;
$sql
=
"
SELECT v.id, v.type, v.title,
v.accessconf,
v.ownerformat, v.startdate, v.stopdate, v.template,
SELECT v.id, v.type, v.title, v.ownerformat, v.startdate, v.stopdate, v.template,
v.owner, v.group, v.institution, v.urlid, v.submittedgroup, v.submittedhost, "
.
db_format_tsfield
(
'v.submittedtime'
,
'submittedtime'
)
.
", v.submittedstatus,
c.id AS cid, c.name AS cname,
...
...
@@ -6122,17 +6119,11 @@ class View {
$collections
[
$cid
][
'ownername'
]
=
$v
[
'ownername'
];
$collections
[
$cid
][
'ownerurl'
]
=
$v
[
'ownerurl'
];
}
if
(
$matchconfig
&&
$matchconfig
==
$r
[
'accessconf'
])
{
$collections
[
$cid
][
'match'
]
=
true
;
}
}
$collections
[
$cid
][
'views'
][
$vid
]
=
$v
;
}
else
{
$views
[
$vid
]
=
$v
;
if
(
$matchconfig
&&
$matchconfig
==
$r
[
'accessconf'
])
{
$views
[
$vid
][
'match'
]
=
true
;
}
}
}
...
...
@@ -6166,7 +6157,7 @@ class View {
/**
* Get all views & collections for a (user,group), grouped
* by their accesslists
as defined by the accessconf column
* by their accesslists
*
* @param integer $owner
* @param integer $group
...
...
test/behat/features/group/group_view_block.feature
View file @
34d836c7
...
...
@@ -150,7 +150,7 @@ These list must take into account the sort option choosen in the block config (B
# Change the sort options in the "Group pages" block
Given
I log in as
"userA"
with password
"Kupuhipa1"
And
I should see
"Group Z"
And
I follow
"Group Z"
And
I follow
"Group Z
(Administrator)
"
And
I should see
"Page userB_01"
And
I follow
"Pages"
in the
"ul.nav-inpage"
"css_element"
And
I click on
"Edit \"
Group homepage\""
...
...
Write
Preview
Markdown
is supported
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