Commit d9937085 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Mark templates on my views page

parent 09c48dcf
...@@ -1321,21 +1321,21 @@ class View { ...@@ -1321,21 +1321,21 @@ class View {
if ($groupid) { if ($groupid) {
$count = count_records('view', 'group', $groupid); $count = count_records('view', 'group', $groupid);
$viewdata = get_records_sql_array('SELECT v.id,v.title,v.startdate,v.stopdate,v.description $viewdata = get_records_sql_array('SELECT v.id,v.title,v.startdate,v.stopdate,v.description, v.template
FROM {view} v FROM {view} v
WHERE v.group = ' . $groupid . ' WHERE v.group = ' . $groupid . '
ORDER BY v.title, v.id', '', $offset, $limit); ORDER BY v.title, v.id', '', $offset, $limit);
} }
else if ($institution) { else if ($institution) {
$count = count_records('view', 'institution', $institution); $count = count_records('view', 'institution', $institution);
$viewdata = get_records_sql_array('SELECT v.id,v.title,v.startdate,v.stopdate,v.description $viewdata = get_records_sql_array('SELECT v.id,v.title,v.startdate,v.stopdate,v.description, v.template
FROM {view} v FROM {view} v
WHERE v.institution = ? WHERE v.institution = ?
ORDER BY v.title, v.id', array($institution), $offset, $limit); ORDER BY v.title, v.id', array($institution), $offset, $limit);
} }
else { else {
$count = count_records('view', 'owner', $userid); $count = count_records('view', 'owner', $userid);
$viewdata = get_records_sql_array('SELECT v.id,v.title,v.startdate,v.stopdate,v.description, g.id AS groupid, g.name $viewdata = get_records_sql_array('SELECT v.id,v.title,v.startdate,v.stopdate,v.description, v.template, g.id AS groupid, g.name
FROM {view} v FROM {view} v
LEFT OUTER JOIN {group} g ON (v.submittedto = g.id AND g.deleted = 0) LEFT OUTER JOIN {group} g ON (v.submittedto = g.id AND g.deleted = 0)
WHERE v.owner = ' . $userid . ' WHERE v.owner = ' . $userid . '
...@@ -1388,6 +1388,7 @@ class View { ...@@ -1388,6 +1388,7 @@ class View {
else if ($viewdata[$i]->stopdate) { else if ($viewdata[$i]->stopdate) {
$data[$i]['access'] = get_string('accessuntildate', 'view', format_date(strtotime($viewdata[$i]->stopdate), 'strftimedate')); $data[$i]['access'] = get_string('accessuntildate', 'view', format_date(strtotime($viewdata[$i]->stopdate), 'strftimedate'));
} }
$data[$i]['template'] = $viewdata[$i]->template;
} }
// Go through all the artefact records and put them in with the // Go through all the artefact records and put them in with the
// views they belong to. // views they belong to.
......
...@@ -1378,6 +1378,11 @@ fieldset.collapsed .mceEditor td { ...@@ -1378,6 +1378,11 @@ fieldset.collapsed .mceEditor td {
#myviewstable h3 a { #myviewstable h3 a {
color: #1e6297 !important; color: #1e6297 !important;
} }
#myviewstable .template {
color: #000;
font-weight: normal;
font-size: 13px;
}
#myviewstable .viewitem { #myviewstable .viewitem {
margin-bottom: 5px; margin-bottom: 5px;
font-size: 11px; font-size: 11px;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
{if !$view.submittedto} {if !$view.submittedto}
<a href="{$WWWROOT}view/delete.php?id={$view.id}" class="fr" id="btn-deletethisview">{str tag="deletethisview" section="view"}</a> <a href="{$WWWROOT}view/delete.php?id={$view.id}" class="fr" id="btn-deletethisview">{str tag="deletethisview" section="view"}</a>
{/if} {/if}
<h3><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title|escape}</a></h3> <h3><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title|escape}</a>{if $view.template} <span class="template">({str tag=Template section=view})</span>{/if}</h3>
<div class="viewitem"> <div class="viewitem">
{if !$view.submittedto} {if !$view.submittedto}
<a href="{$WWWROOT}view/edit.php?id={$view.id}" id="editviewdetails">{str tag="editviewnameanddescription" section="view"}</a> <a href="{$WWWROOT}view/edit.php?id={$view.id}" id="editviewdetails">{str tag="editviewnameanddescription" section="view"}</a>
......
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