| 
      
      
      From: Benjamin C. <bc...@us...> - 2001-07-15 23:39:43
      
     | 
| Update of /cvsroot/phpbt/phpbt/admin
In directory usw-pr-cvs1:/tmp/cvs-serv1636
Modified Files:
	version.php 
Log Message:
Set the creation date when creating a new version
Index: version.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/version.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- version.php	2001/02/03 18:16:04	1.3
+++ version.php	2001/07/15 23:39:40	1.4
@@ -3,9 +3,10 @@
 include '../include.php';
 
 page_open(array('sess' => 'usess', 'auth' => 'uauth', 'perm' => 'uperm'));
+$u = $auth->auth['uid'];
 
 function do_form($versionid = 0) {
-  global $q, $me, $projectid, $version, $active, $STRING;
+  global $q, $me, $projectid, $version, $active, $STRING, $now, $u;
   
   // Validation
   if (!$version = trim($version)) 
@@ -14,11 +15,9 @@
   
   if (!$active) $active = 0;
   if (!$versionid) {
-    $q->query("insert into Version (VersionID, ProjectID, Name, Active) values 
-      (".$q->nextid('Version').", $projectid, '$version', '$active')");
+    $q->query("insert into Version (VersionID, ProjectID, Name, Active, CreatedBy, CreatedDate) values (".$q->nextid('Version').", $projectid, '$version', '$active', $u, $now)");
   } else {
-    $q->query("update Version set ProjectID=$projectid, Name='$version', 
-      Active='$active' where VersionID = '$versionid'");
+    $q->query("update Version set ProjectID=$projectid, Name='$version', Active='$active' where VersionID = '$versionid'");
   }
   header("Location: project.php?op=edit&id=$projectid");
 }  
 |