Commit 08a3f4c2 authored by Leigh Stoller's avatar Leigh Stoller

Separate profile creator from updater so we do not reassign the profile

to the person updating it. Minor changes to the templates for display.
parent 911067a2
......@@ -405,11 +405,13 @@ sub NewVersion($$)
goto bad
if (! DBQueryWarn("insert into apt_profile_versions ".
" (name,profileid,version,pid,pid_idx, ".
" creator,creator_idx,created,uuid, ".
" creator,creator_idx,updater,updater_idx, ".
" created,uuid, ".
" parent_profileid,parent_version,rspec, ".
" script,paramdefs) ".
"select name,profileid,'$newvers',pid,pid_idx, ".
" '$uid','$uid_idx',now(),uuid(),'$profileid', ".
" creator,creator_idx,'$uid','$uid_idx',".
" now(),uuid(),'$profileid', ".
" '$version',rspec,script,paramdefs ".
"from apt_profile_versions as v ".
"where v.profileid='$profileid' and ".
......
......@@ -377,6 +377,7 @@ if (! isset($create)) {
$defaults["profile_script"] = $profile->script();
}
$defaults["profile_creator"] = $profile->creator();
$defaults["profile_updater"] = $profile->updater();
$defaults["profile_created"] =
DateStringGMT($profile->created());
$defaults["profile_published"] =
......
<?php
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -72,7 +72,7 @@ while ($row = mysql_fetch_array($query_result)) {
$pid = $row["pid"];
$created = $row["created"];
$published = $row["published"];
$creator = $row["creator"];
$creator = ($version == 0 ? $row["creator"] : $row["updater"]);
$rspec = $row["rspec"];
$desc = '';
......
......@@ -105,6 +105,8 @@ class Profile
function version() { return $this->field('version'); }
function creator() { return $this->field('creator'); }
function creator_idx() { return $this->field('creator_idx'); }
function updater() { return $this->field('updater'); }
function updater_idx() { return $this->field('updater_idx'); }
function pid() { return $this->field('pid'); }
function pid_idx() { return $this->field('pid_idx'); }
function created() { return $this->field('created'); }
......
......@@ -90,6 +90,7 @@ $defaults["profile_name"] = $profile->name();
$defaults["profile_rspec"] = $profile->rspec();
$defaults["profile_version"] = $profile->version();
$defaults["profile_creator"] = $profile->creator();
$defaults["profile_updater"] = $profile->updater();
$defaults["profile_pid"] = $profile->pid();
$defaults["profile_created"] = DateStringGMT($profile->created());
$defaults["profile_published"] = DateStringGMT($profile->published());
......
......@@ -40,8 +40,19 @@
<td><a href='user-dashboard.php?user=<%= formfields.profile_creator %>'>
<%- formfields.profile_creator %></a></td>
</tr>
<% if (formfields.profile_version != 0) { %>
<tr>
<td>Updated by:</td>
<td><a href='user-dashboard.php?user=<%= formfields.profile_updater %>'>
<%- formfields.profile_updater %></a></td>
</tr>
<% } %>
<tr>
<td>Created:</td>
<% if (formfields.profile_version == 0) { %>
<td>Created:</td>
<% } else { %>
<td>Updated:</td>
<% } %>
<td class='format-date' style='word-wrap:break-word;'>
<%- formfields.profile_created %></td>
</tr>
......
......@@ -16,13 +16,13 @@
</tr>
<tr>
<td>Version:</td><td>
<% if (history) { %>
<a href='profile-history.php?uuid=<%= profile_uuid %>'>
<%- fields.profile_version %></a>
<% } else { %>
<%- fields.profile_version %>
<% } %>
</td></tr>
<% if (history) { %>
<a href='profile-history.php?uuid=<%= profile_uuid %>'>
<%- fields.profile_version %></a>
<% } else { %>
<%- fields.profile_version %>
<% } %>
</td></tr>
<tr>
<td>Project:</td>
<td><%- fields.profile_pid %></td>
......@@ -31,8 +31,18 @@
<td>Creator:</td>
<td><%- fields.profile_creator %></td>
</tr>
<% if (fields.profile_version != 0) { %>
<tr>
<td>Updated by:</td>
<td><%- fields.profile_updater %></td>
</tr>
<% } %>
<tr>
<td>Created:</td>
<% if (fields.profile_version == 0) { %>
<td>Created:</td>
<% } else { %>
<td>Updated:</td>
<% } %>
<td class='format-date' style='word-wrap:break-word;'>
<%- fields.profile_created %></td>
</tr>
......
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