[Fusionforge-commits] r10465 - trunk/src/plugins/contribtracker/www

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Mon Sep 13 22:46:42 CEST 2010


Author: nerville
Date: 2010-09-13 22:46:42 +0200 (Mon, 13 Sep 2010)
New Revision: 10465

Modified:
   trunk/src/plugins/contribtracker/www/project_admin.php
Log:
fix error_msg & date calculation

Modified: trunk/src/plugins/contribtracker/www/project_admin.php
===================================================================
--- trunk/src/plugins/contribtracker/www/project_admin.php	2010-09-13 20:06:48 UTC (rev 10464)
+++ trunk/src/plugins/contribtracker/www/project_admin.php	2010-09-13 20:46:42 UTC (rev 10465)
@@ -59,7 +59,7 @@
 	if (!$tmp) {
 		$date = time () ;
 	} else {
-		$date = mktime (0,0,0,$tmp['tm_mon']+1,$tmp['tm_mday'],$tmp['tm_year']);
+		$date = mktime (0,0,0,$tmp['tm_mon']+1,$tmp['tm_mday'],$tmp['tm_year']+1900);
 	}
 	return $date ;
 }
@@ -133,10 +133,12 @@
 case 'post_add_contrib':
 	$contrib = new ContribTrackerContribution () ;
 	if (!$contrib->create ($name, $date, $desc, $group)) {
-		exit_error ($contrib->getErrorMessage()) ;
+		$error_msg = $contrib->getErrorMessage() ;
+		$action = 'display';
+	} else {
+		$contrib_id = $contrib->getId() ;
+		$action = 'edit_contrib' ;
 	}
-	$contrib_id = $contrib->getId() ;
-	$action = 'edit_contrib' ;
 	break ;
 case 'del_contrib':
 	$contrib = new ContribTrackerContribution ($contrib_id) ;
@@ -174,6 +176,9 @@
 
 // Display appropriate forms
 
+if(isset($error_msg) && !empty($error_msg)) {
+	echo "<div class='error'>".$error_msg."</div>";
+}
 switch ($action) {
 case 'add_contrib':
 	print '<h1>'._('Register a new contribution').'</h1>' ;




More information about the Fusionforge-commits mailing list