Commit d2696dd9 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1714830: group homepage-display portfolios instead of only pages"

parents ade006b7 16e75896
......@@ -54,7 +54,9 @@ if (!isset($configdata['sortgroupviewsby']) || $configdata['sortgroupviewsby'] =
else {
$sort[] = array('column' => 'mtime', 'desc' => true);
}
$groupviews = (array)View::view_search(null, null, (object) array('group' => $groupid), null, $limit, $offset, true, $sort);
$groupviews = (array)View::view_search(null, null, (object) array('group' => $groupid),
null, $limit, $offset, true, $sort, null,
false, null, null, null, null, true);
foreach ($groupviews['data'] as &$view) {
if (isset($view['template']) && $view['template']) {
$view['form'] = pieform(create_view_form(null, null, $view['id']));
......
......@@ -15,7 +15,7 @@ defined('INTERNAL') || die();
$string['title'] = 'Group pages';
$string['description'] = 'Display the pages related to the group';
$string['displaygroupviews'] = 'Display group pages';
$string['displaygroupviewsdesc'] = 'Group pages - pages created in the group';
$string['displaygroupviewsdesc'] = 'Group pages - portfolios created in the group';
$string['displaysharedviews'] = 'Display shared pages';
$string['displaysharedviewsdesc1'] = 'Show a list of pages shared with this group (excluding pages in collections).';
$string['displaysharedcollections'] = 'Display shared collections';
......
......@@ -315,7 +315,9 @@ class PluginBlocktypeGroupViews extends MaharaCoreBlocktype {
else {
$sort[] = array('column' => 'mtime', 'desc' => true);
}
$data['groupviews'] = View::view_search(null, null, (object) array('group' => $group->id), null, $limit, 0, true, $sort);
$data['groupviews'] = View::view_search(null, null, (object) array('group' => $group->id),
null, $limit, 0, true, $sort, null, false, null, null,
null, null, true);
foreach ($data['groupviews']->data as &$view) {
if (!$editing && isset($view['template']) && $view['template']) {
$view['form'] = pieform(create_view_form(null, null, $view['id']));
......
......@@ -4557,6 +4557,11 @@ class View {
';
$orderby .= "COALESCE(sg.name, si.displayname, CASE WHEN su.preferredname IS NOT NULL AND su.preferredname != '' THEN su.preferredname ELSE su.firstname || ' ' || su.lastname END)";
}
// in case we are grouping by collection and there is no tablealias
// we should not force the alias to be 'v'
else if (empty($item['tablealias']) && $groupbycollection) {
$orderby .= $item['column'];
}
else {
$orderby .= (!empty($item['tablealias']) ? $item['tablealias'] : 'v') . '.' . $item['column'];
}
......
......@@ -6,6 +6,11 @@
<div class="clearfix">
<h5 class="pull-left list-group-item-heading">
{$view.title}
{if $view.collid}
<strong>
({str tag=nviews section=view arg1=$view.numpages})
</strong>
{/if}
<br>
<span class="postedon text-small text-midtone">
{if $view.mtime == $view.ctime}
......
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