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

Merge "Show last changed date for shared pages on the group homepage"

parents 5f14d7ae 574cd60e
......@@ -243,6 +243,14 @@ class ArtefactTypeComment extends ArtefactType {
update_record('artefact_comment_comment', $data, 'artefact');
}
if (!$this->get('private')) {
if ($this->get('onview')) {
set_field('view', 'mtime', db_format_timestamp(time()), 'id', $this->get('onview'));
}
else if ($this->get('onartefact')) {
execute_sql("UPDATE {view} SET mtime = ? WHERE id IN (SELECT va.view FROM {view_artefact} va WHERE va.artefact = ?)", array(db_format_timestamp(time()), $this->get('onartefact')));
}
}
db_commit();
$this->dirty = false;
}
......
......@@ -4401,7 +4401,7 @@ class View {
$ordersql = ' ORDER BY ' . $orderby . ', v.id';
}
$viewdata = get_records_sql_assoc('
SELECT DISTINCT v.id, v.title, v.startdate, v.stopdate, v.description, v.group, v.owner, v.ownerformat, v.institution, v.urlid, v.mtime '
SELECT DISTINCT v.id, v.title, v.startdate, v.stopdate, v.description, v.group, v.owner, v.ownerformat, v.institution, v.urlid, v.ctime, v.mtime '
. $from
. $where
. $ordersql,
......
......@@ -8,7 +8,7 @@
{if $view.template}
<div class="s fr">{$view.form|safe}</div>
{/if}
<h4 class="title"><a href="{$view.fullurl}">{$view.title}</a>
<h4 class="title"><a href="{$view.fullurl}">{$view.title}</a></h4>
{if $view.sharedby}
<span class="owner"> {str tag=by section=view}
{if $view.group}
......@@ -31,8 +31,11 @@
{$view.sharedby}
{/if}
</span>
<span class="postedon">
- {if $view.mtime == $view.ctime}{str tag=Created}{else}{str tag=Updated}{/if}
{$view.mtime|strtotime|format_date: 'strftimedate'}
</span>
{/if}
</h4>
<div class="detail">{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
{if $view.tags}
<div class="tags"><strong>{str tag=tags}:</strong> {list_tags owner=$view.owner tags=$view.tags}</div>
......
Supports Markdown
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