[evolvis-commits] r17534: [#1590] Possibility to hide tracker items with the resolution fixed on "My Page"

papel at evolvis.org papel at evolvis.org
Tue Sep 6 13:40:39 CEST 2011


Author: papel
Date: 2011-09-06 13:40:39 +0200 (Tue, 06 Sep 2011)
New Revision: 17534

Modified:
   branches/evolvis-pa/www/my/index.php
Log:
[#1590] Possibility to hide tracker items with the resolution fixed on "My Page"

Modified: branches/evolvis-pa/www/my/index.php
===================================================================
--- branches/evolvis-pa/www/my/index.php	2011-09-05 12:18:39 UTC (rev 17533)
+++ branches/evolvis-pa/www/my/index.php	2011-09-06 11:40:39 UTC (rev 17534)
@@ -57,87 +57,54 @@
 	
 	$allAssignedArtifacts =& $artifactsForUser->getAssignedArtifactBugsGroups();
 
-	/* if(count($requestedExtraFieldParams) > 0) {
-	 	$pref_ = minijson_encode($requestedExtraField, false);
-	 	$user->setPreference('mypage_bug_res_'.$artifact_type_id,$pref_);
-	 } 	else { */	
-	 
-	#$strJson=$user->getPreference('mypage_bug_res_'.$artifact_type_id);
-	#minijson_decode($strJson, &$requestedExtraField);
-	
-		
-	 //} 	
-	
-	$assignedArtifacts =& $artifactsForUser->getAssignedBugsByGroup($requestedExtraField);
-	
-	#echo count($assignedArtifacts);
+ 	$pref_ = minijson_encode($requestedExtraField, false);
+ 	if($artifact_type_id != 0) {
+ 		$user->setPreference('mypage_bug_res_'.$artifact_type_id,$pref_);
+ 	}
 
-	$arrGroupProjectValues = array('group_id' => array(), 'group_artifact_type_id' => array(), 'group_public_name' => array(), 'group_artifact_name' => array(), 'artifact_extra_fields' => array(), 'group' => array());
-	$i = 0;
+
+	$arrGroupProjectValues = array('group_id' => array(), 'group_artifact_type_id' => array(), 'group_public_name' => array(), 'group_artifact_name' => array(), 'artifact_extra_fields' => array(), 'element_ids' => array(), 'group' => array());
 	
 	$tmpGroupId = null;
+	$arrTest = array();
+	$requestedExtraFieldIds = array();
 	foreach($allAssignedArtifacts as $thisArtifact) {	
 		if($tmpGroupId != $thisArtifact->ArtifactType->Group->getID()) {
 			array_push($arrGroupProjectValues['group_id'], $thisArtifact->ArtifactType->Group->getID());
 			array_push($arrGroupProjectValues['group_artifact_type_id'], $thisArtifact->ArtifactType->getID());
+			
+			$strJson=$user->getPreference('mypage_bug_res_'.$thisArtifact->ArtifactType->getID());
+			if($strJson != '') {
+				minijson_decode($strJson, &$requestedExtraFieldIds);
+				array_push($arrGroupProjectValues['element_ids'], $requestedExtraFieldIds);
+			}		
+			
 			array_push($arrGroupProjectValues['group_public_name'], $thisArtifact->ArtifactType->Group->getPublicName());
 			array_push($arrGroupProjectValues['group_artifact_name'], $thisArtifact->ArtifactType->getName());
 			array_push($arrGroupProjectValues['artifact_extra_fields'], $thisArtifact->ArtifactType->getExtraFields());
-			
 			array_push($arrGroupProjectValues['group'], $thisArtifact->ArtifactType->getGroup());
 		}
 		$tmpGroupId = $thisArtifact->ArtifactType->Group->getID();
 	}
 	
-		
+	$requestedExtraFieldIds = array();
+	
+	foreach($arrGroupProjectValues['element_ids'] as $extraIds) {
+		foreach($extraIds as $id) {
+			array_push($requestedExtraFieldIds, $id);
+		}
+	}
+
+	$assignedArtifacts =& $artifactsForUser->getAssignedBugsByGroup($requestedExtraFieldIds);
+	
+	
 	/* 
 	 * Only default tracker have a datatype bigger 0 in database table artifact_group_list.
 	 * There are four default tracker with the datatypes 1,2,3,4.
 	 * The trackers are automatically created on creating a new project.
 	 * */
-	 
-	 /*
 
 	/*
-gforge=# SELECT * FROM user_preferences;
- user_id | preference_name              |                                         preference_value                                         |  set_date
----------+------------------------------+--------------------------------------------------------------------------------------------------+------------
-     156 | art_query151                 |                                                                                                  | 1314955456
-     156 | art_cust151                  | {"assigned_to":156,"status":1,"order_col":"priority","sort":"DESC","changed":0,"submitted_by":0} | 1314955456
-     156 | mypage_bug_res_131           | {"assigned_to":156,"status":1,"order_col":"priority","sort":"DESC","changed":0,"submitted_by":0} | 1314955456
-     156 | mypage_task_state_151        | {"assigned_to":156,"status":1,"order_col":"priority","sort":"DESC","changed":0,"submitted_by":0} | 1314955456
-	*/
-
-	 
-	/* 
-		If the query_id = -1, unset the pref and use regular browse boxes
-	Look here to change
-if (session_loggedin()) {
-	$u =& session_get_user();
-	if (getStringFromRequest('setpaging')) {
-
-		$paging = getIntFromRequest('nres');
-		if (!$paging)
-			$paging = 25;
-		$u->setPreference("paging", $paging);
-	}
-	if($query_id) {
-		if ($query_id == '-1') {
-			$u->setPreference('art_query'.$ath->getID(),'');
-		} else {
-			$aq = new ArtifactQuery($ath,$query_id);
-			if (!$aq || !is_object($aq)) {
-				exit_error('Error',$aq->getErrorMessage());
-			}
-			$aq->makeDefault();
-		}
-	} else {
-		$query_id=$u->getPreference('art_query'.$ath->getID(),'');
-	}
-}
-	 */
-	 
-	/*
 //needs security audit
 	 *  If user has valid "remember-me" hash, instantiate not-logged in
 	 *  session for one.
@@ -196,9 +163,7 @@
 		$groupName = $arrGroupProjectValues['group'][$j]->getPublicName();
 		$artifactTypeName = $arrGroupProjectValues['group_artifact_name'][$j];
 		$arrExtraFieldData = $arrGroupProjectValues['artifact_extra_fields'][$j];
-		#$strJson=$user->getPreference('mypage_bug_res_'.$artifactTypeId);
-		#minijson_decode($strJson, &$requestedExtraField);
-
+		
 					echo '
 					<tr><td colspan="4" class="tablecontent myPageArtifactGroupHeader">'.
 					'<form action="'.getStringFromServer('PHP_SELF').'" method="post">';
@@ -211,9 +176,8 @@
 
 							if($extraFieldData['field_name'] == 'Resolution') {
 								$id = $extraFieldData['extra_field_id'];							
-
 								$ath = new ArtifactTypeHtml($group);
-								echo $ath->renderCheckbox($id, $requestedExtraField, false, 'none', 'horizontal');					
+								echo $ath->renderCheckbox($id, $requestedExtraFieldIds, false, 'none', 'horizontal');					
 							} 
 						}
 				
@@ -258,12 +222,6 @@
 
 <div class="tabbertab myPageArtifactTaskDiv" title="<?php echo _('Assigned Artifacts'); ?>">
 	<?php
-	/*
-		Artifacts
-	*/
-	
-	/* SELECT * FROM artifact_extra_field_list 
-	 * */
 	 
 	$last_group=0;
 	$order_name_arr=array();



More information about the evolvis-commits mailing list