Commit 1d31928b authored by Aaron Wells's avatar Aaron Wells

Show collections in "Latest pages" block (Bug 1476491)

Change-Id: I0ee53499dfb6b5a9fc6b77b12244e2ec7391334c
parent c2a427e2
......@@ -36,7 +36,23 @@ class PluginBlocktypeNewViews extends SystemBlocktype {
$nviews = isset($configdata['limit']) ? intval($configdata['limit']) : 5;
$sort = array(array('column' => 'mtime', 'desc' => true));
$views = View::view_search(null, null, null, null, $nviews, 0, true, $sort, array('portfolio'));
$views = View::view_search(
null, // $query
null, // $ownerquery
null, // $ownedby
null, // $copyableby
$nviews, // $limit
0, // $offset
true, // $extra
$sort, // $sort
array('portfolio'), // $types
null, // $collection
null, // $accesstypes
null, // $tag
null, // $viewid
null, // $excludeowner
true // $groupbycollection
);
$smarty = smarty_core();
$smarty->assign('loggedin', $USER->is_logged_in());
$smarty->assign('views', $views->data);
......
......@@ -10,6 +10,7 @@
<div class="list-group-item">
<h4 class="list-group-item-heading">
<a href="{$view.fullurl}">{$view.title}</a>
{if $view.collid}({str tag=nviews section=view arg1=$view.numpages}){/if}
</h4>
{if $view.description}
......
@javascript @core @blocktype @blocktype_newviews
Feature: Looking at the "Latest Pages" (newviews) block on my dashboard
In order to see new pages across the site
So I can know what people are up to
Background:
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname | role |
| userA | Password1 | test01@example.com | Pete | Mc | mahara | internal | member |
| userB | Password1 | test02@example.com | Son | Nguyen | mahara | internal | member |
And the following "pages" exist:
| title | description| ownertype | ownername |
| Shared page | This is a page that is shared with me| user | userA |
| Private page | This is a page shared with no one | user | userA |
| C1P1 | Page 1 in Collection 1 | user | userA |
| C1P2 | Page 2 in Collection 1 | user | userA |
| C2P1 | Page 1 in Collection 2 | user | userA |
| C2P2 | Page 2 in Collection 2 | user | userA |
And the following "collections" exist:
| title | description| ownertype | ownername | pages |
| Shared Collection 01 | This is the collection 01 | user | userA | C1P1, C1P2 |
| Private Collection 02 | This is the collection 02 | user | userA | C2P1, C2P2 |
And the following "permissions" exist:
| title | accesstype |
| Shared page | public |
| Shared Collection 01 | public |
Scenario: Share pages and collections to a group.
The list of shared pages must take into account of access date (Bug 1374163)
And I log in as "userB" with password "Password1"
Then I should see "Shared page" in the "div.bt-newviews" "css_element"
And I should see "Shared Collection 01" in the "div.bt-newviews" "css_element"
# I shouldn't see the pages I didn't share
And I should not see "Private page" in the "div.bt-newviews" "css_element"
And I should not see "Private Collection 02" in the "div.bt-newviews" "css_element"
# I shouldn't see the individual pages in a collection
And I should not see "C1P1" in the "div.bt-newviews" "css_element"
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