[evolvis-commits] r18437: [#2989] option for resetting columns in tracker to default

mirabilos at evolvis.org mirabilos at evolvis.org
Wed May 30 17:55:28 CEST 2012


Author: mirabilos
Date: 2012-05-30 17:55:28 +0200 (Wed, 30 May 2012)
New Revision: 18437

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/tracker/ArtifactType.class.php
   trunk/gforge_base/evolvisforge-5.1/src/www/tracker/admin/form-customizelist.php
   trunk/gforge_base/evolvisforge-5.1/src/www/tracker/admin/updates.php
Log:
[#2989] option for resetting columns in tracker to default

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/tracker/ArtifactType.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/tracker/ArtifactType.class.php	2012-05-30 15:55:24 UTC (rev 18436)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/tracker/ArtifactType.class.php	2012-05-30 15:55:28 UTC (rev 18437)
@@ -1045,11 +1045,18 @@
 	 *	@return	boolean	success.
 	 */
 	function setBrowseList($list) {
-		$res=db_query_params ('UPDATE artifact_group_list 
-		    SET browse_list=$1
-			WHERE group_artifact_id=$2',
-			array($list,
-				$this->getID()));
+		if ($list !== false) {
+			$res = db_query_params('UPDATE artifact_group_list
+				SET browse_list=$1
+				WHERE group_artifact_id=$2',
+			    array($list, $this->getID()));
+		} else {
+			/* reset to defaults, which come from DB */
+			$res = db_query_params('UPDATE artifact_group_list
+				SET browse_list = DEFAULT
+				WHERE group_artifact_id=$1',
+			    array($this->getID()));
+		}
 		$this->fetchData($this->getID());
 		return $res;
 	}

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/tracker/admin/form-customizelist.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/tracker/admin/form-customizelist.php	2012-05-30 15:55:24 UTC (rev 18436)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/tracker/admin/form-customizelist.php	2012-05-30 15:55:28 UTC (rev 18437)
@@ -75,6 +75,8 @@
 
 <p>
 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+<p><input type="submit" name="reset_to_default"
+ value="<?php echo _('Reset to Default'); ?>" /></p>
 </form>
 <?php
 

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/tracker/admin/updates.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/tracker/admin/updates.php	2012-05-30 15:55:24 UTC (rev 18436)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/tracker/admin/updates.php	2012-05-30 15:55:28 UTC (rev 18437)
@@ -327,6 +327,9 @@
 					$browse_fields[] = $name;
 			}
 			$browse_fields = join(',', $browse_fields);
+			if (getStringFromRequest('reset_to_default')) {
+				$browse_fields = false;
+			}
 			if (!$ath->setBrowseList($browse_fields)) {
 				$error_msg .= _('Error updating').' : '.$ath->getErrorMessage();
 				$ath->clearError();



More information about the evolvis-commits mailing list