Commit 18da862b authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1667181: Collection mtime not updated when add/remove pages



behatnotneeded

Change-Id: I788f932f721b070f188d97891ab21f0f5f77811b
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent ad3e71a3
......@@ -863,6 +863,9 @@ class Collection {
View::update_view_access($viewconfig, $viewids);
}
// Now that we have added views to the collection we need to update the collection modified date
$this->mtime = db_format_timestamp(time());
$this->commit();
db_commit();
return $count;
......@@ -890,6 +893,10 @@ class Collection {
// @todo: add user message to whatever calls this.
delete_records_select('view_access', 'view = ? AND token IS NOT NULL', array($view));
// Now that we have removed views from the collection we need to update the collection modified date
$this->mtime = db_format_timestamp(time());
$this->commit();
db_commit();
}
......
......@@ -3814,7 +3814,8 @@ class View {
}
else if ($av->group) {
$av->displayname = $av->groupname;
if ($data['submittedstatus'] != 0 && $av->group == $data['submitgroupid']) {
// A submitted view/collection adds 'admin' role access to group
if (!empty($data['submittedstatus']) && $av->group == $data['submitgroupid'] && $av->role == 'admin') {
$av->displayname .= ' (' . get_string('submitted', 'group') . ')';
}
else if (!empty($av->role)) {
......
......@@ -663,6 +663,8 @@ EOD;
else if (!empty($record['owner'])) {
$data->owner = $record['owner'];
}
$data->navigation = 1;
$data->submittedstatus = 0;
$collection = new Collection(0, $data);
$collection->commit();
// Add views to the collection
......
......@@ -524,7 +524,7 @@ h4.list-group-item-heading {
position: relative;
}
&.seperator {
border-bottom: 1px solid #aaa;
border-bottom: 1px solid $dropdown-border;
}
}
}
......
......@@ -42,7 +42,7 @@
</button>
<span class="collnum-arrow icon icon-chevron-down"></span>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
{if $view.collid}
{if $view.collid && !$view.submittedto}
<li>
<a href="{$WWWROOT}collection/views.php?id={$view.collid}" title="{str tag=manageviews section=collection}">
<span class="icon icon-list left" role="presentation" aria-hidden="true"></span>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment