[evolvis-commits] r17533: backup

papel at evolvis.org papel at evolvis.org
Mon Sep 5 14:18:39 CEST 2011


Author: papel
Date: 2011-09-05 14:18:39 +0200 (Mon, 05 Sep 2011)
New Revision: 17533

Modified:
   branches/evolvis-pa/plugins/jenkins/common/JenkinsPlugin.class.php
   branches/evolvis-pa/www/my/index.php
Log:
backup


Modified: branches/evolvis-pa/plugins/jenkins/common/JenkinsPlugin.class.php
===================================================================
--- branches/evolvis-pa/plugins/jenkins/common/JenkinsPlugin.class.php	2011-09-05 11:18:07 UTC (rev 17532)
+++ branches/evolvis-pa/plugins/jenkins/common/JenkinsPlugin.class.php	2011-09-05 12:18:39 UTC (rev 17533)
@@ -532,7 +532,6 @@
 				}
 			}
 
-//			echo '<hr size="1" />';
 			echo "</div>\n";
 			echo $HTML->boxBottom();
 
@@ -577,7 +576,7 @@
 		// 0 = Nor error Connection
 		// 111 = Connection refused
 
-		/*-
+		/*
 		 * 1 = blocking mode => too slow
 		 * 0 = non-blocking mode
 		 */
@@ -820,7 +819,7 @@
 		// 0 = Nor error Connection
 		// 111 = Connection refused
 
-		/*-
+		/*
 		 * 1 = blocking mode => too slow
 		 * 0 = non-blocking mode
 		 */
@@ -847,16 +846,16 @@
 				break;
 			}
 
-			if (strpos($result, "</jenkins>")) {
+			if (strpos($result, "</hudson>")) {
 				break;
 			}
 		}
 
-		$arrResult = split('<jenkins>', $result);
+		$arrResult = split('<hudson>', $result);
 
 		fclose($fp);
 
-		$xmlFile = trim('<jenkins>' . util_ifsetor($arrResult[1], ""));
+		$xmlFile = trim('<hudson>' . util_ifsetor($arrResult[1], ""));
 
 		$this->setCurrXmlTag('');
 		$this->setProjectFoundInXml(false);
@@ -1128,7 +1127,7 @@
 		case 'description':
 			$xmlWriter->text($projectInfo['description']);
 			break;
-		case 'jenkins.security.AuthorizationMatrixProperty':
+		case 'hudson.security.AuthorizationMatrixProperty':
 			$groupUnixName = $this->getGroup()->getUnixName();
 			/*
 			 * Only groups have to be specified in the project
@@ -1137,31 +1136,31 @@
 			 */
 
 			$xmlWriter->startElement('permisson');
-			$xmlWriter->text('jenkins.model.Item.Read:'.$groupUnixName);
+			$xmlWriter->text('hudson.model.Item.Read:'.$groupUnixName);
 			$xmlWriter->endElement();
 
 			$xmlWriter->startElement('permisson');
-			$xmlWriter->text('jenkins.model.Item.Build:'.$groupUnixName);
+			$xmlWriter->text('hudson.model.Item.Build:'.$groupUnixName);
 			$xmlWriter->endElement();
 
 			$xmlWriter->startElement('permisson');
-			$xmlWriter->text('jenkins.model.Item.Workspace:'.$groupUnixName);
+			$xmlWriter->text('hudson.model.Item.Workspace:'.$groupUnixName);
 			$xmlWriter->endElement();
 
 			$xmlWriter->startElement('permisson');
-			$xmlWriter->text('jenkins.model.Item.Configure:'.$groupUnixName);
+			$xmlWriter->text('hudson.model.Item.Configure:'.$groupUnixName);
 			$xmlWriter->endElement();
 
 			$xmlWriter->startElement('permisson');
-			$xmlWriter->text('jenkins.model.Item.Delete:'.$groupUnixName);
+			$xmlWriter->text('hudson.model.Item.Delete:'.$groupUnixName);
 			$xmlWriter->endElement();
 
 			$xmlWriter->startElement('permisson');
-			$xmlWriter->text('jenkins.model.Run.Delete:'.$groupUnixName);
+			$xmlWriter->text('hudson.model.Run.Delete:'.$groupUnixName);
 			$xmlWriter->endElement();
 
 			$xmlWriter->startElement('permisson');
-			$xmlWriter->text('jenkins.model.Run.Update:'.$groupUnixName);
+			$xmlWriter->text('hudson.model.Run.Update:'.$groupUnixName);
 			$xmlWriter->endElement();
 
 
@@ -1198,65 +1197,65 @@
 				switch($memberRoleName) {
 				case 'Admin':
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Read:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Read:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Build:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Build:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Workspace:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Workspace:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Configure:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Configure:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Delete:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Delete:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Run.Delete:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Run.Delete:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Run.Update:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Run.Update:'.$memberUnixName);
 					$xmlWriter->endElement();
 					break;
 
 				case 'Senior Developer':
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Read:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Read:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Build:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Build:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Workspace:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Workspace:'.$memberUnixName);
 					$xmlWriter->endElement();
 					break;
 
 				case 'Junior Developer':
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Read:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Read:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Build:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Build:'.$memberUnixName);
 					$xmlWriter->endElement();
 
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Workspace:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Workspace:'.$memberUnixName);
 					$xmlWriter->endElement();
 					break;
 
 				default:
 					$xmlWriter->startElement('permisson');
-					$xmlWriter->text('jenkins.model.Item.Read:'.$memberUnixName);
+					$xmlWriter->text('hudson.model.Item.Read:'.$memberUnixName);
 					$xmlWriter->endElement();
 					break;
 				}

Modified: branches/evolvis-pa/www/my/index.php
===================================================================
--- branches/evolvis-pa/www/my/index.php	2011-09-05 11:18:07 UTC (rev 17532)
+++ branches/evolvis-pa/www/my/index.php	2011-09-05 12:18:39 UTC (rev 17533)
@@ -26,6 +26,7 @@
 require_once('../env.inc.php');
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'include/vote_function.php';
+require_once $gfcommon.'include/minijson.php';
 require_once $gfcommon.'tracker/ArtifactsForUser.class.php';
 require_once $gfcommon.'forum/ForumsForUser.class.php';
 require_once $gfcommon.'pm/ProjectTasksForUser.class.php';
@@ -37,21 +38,106 @@
 
 } else {
 
+	$user = session_get_user();	
+
 	$requestedExtraFieldParams = array();
+
 	$requestedExtraFieldParams = getArrayFromRequest('extra_fields');
+	
+	$artifact_type_id = getIntFromRequest('artifact_type_id');
+	$requestedExtraField = array();
+	
+		foreach($requestedExtraFieldParams as $requestedExtraFieldParam) {
+			foreach($requestedExtraFieldParam as $param) {
+				array_push($requestedExtraField, $param);
+			}
+		}	
+	
+	$artifactsForUser = new ArtifactsForUser($user);
+	
+	$allAssignedArtifacts =& $artifactsForUser->getAssignedArtifactBugsGroups();
 
-			$requestedExtraField = array();
-			foreach($requestedExtraFieldParams as $requestedExtraFieldParam) {
-				foreach($requestedExtraFieldParam as $param) {
-					array_push($requestedExtraField, $param);
-				}
-			}			
+	/* 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);
 	
-	$artifactsForUser = new ArtifactsForUser(session_get_user());
+		
+	 //} 	
+	
 	$assignedArtifacts =& $artifactsForUser->getAssignedBugsByGroup($requestedExtraField);
+	
+	#echo count($assignedArtifacts);
 
+	$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;
+	
+	$tmpGroupId = null;
+	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());
+			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();
+	}
+	
+		
+	/* 
+	 * 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.
@@ -71,7 +157,6 @@
 	}
 */
 
-
 	echo site_user_header(array('title'=>sprintf(_('Personal Page For %s'),user_getname())));
 	$tabcnt=0;	
 	?>
@@ -85,18 +170,12 @@
 
 <?php if ($GLOBALS['sys_use_tracker']) { ?>
 
-<div><b><?php echo _('Assigned Bugs'); ?></b></div>
+<div><b><?php echo _('Assigned bugs'); ?></b></div>
 
 <!-- [#1590] Possibility to hide tracker items with the resolution fixed on "My Page" -->
 
 <div class="tabbertab myPageArtifactTaskDiv" title="<?php echo _('Assigned Bugs'); ?>">
 	<?php
-	/*
-		Artifacts
-	*/
-	
-	/* SELECT * FROM artifact_extra_field_list 
-	 * */
 	 
 	$last_group=0;
 	$order_name_arr=array();
@@ -107,43 +186,62 @@
 
 	echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
 
-	if (count($assignedArtifacts) > 0) {
-		$i=0;
-		foreach($assignedArtifacts as $art) {
-			$artifact_id = $art->ArtifactType->getID();
-			$arrExtraFieldData = $art->ArtifactType->getExtraFields();
-			if ($artifact_id != $last_group) {
-					
-				echo '
-				<tr><td colspan="4" class="tablecontent myPageArtifactGroupHeader">'.
-				'<form action="'.getStringFromServer('PHP_SELF').'" method="post">'.
-				util_make_link ( '/tracker/?group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(), $art->ArtifactType->Group->getPublicName().' - '.$art->ArtifactType->getName());
+	if(count($arrGroupProjectValues['group_id']) > 0) {
+		
+		$j = 0;
+		foreach($arrGroupProjectValues['group_id'] as $thisGroupId) {
+		$artifactTypeId = $arrGroupProjectValues['group_artifact_type_id'][$j];
+		$publicName = $arrGroupProjectValues['group_public_name'][$j];
+		$group = $arrGroupProjectValues['group'][$j];
+		$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">';
+					echo '<input type="hidden" name="artifact_type_id" value="'.$artifactTypeId.'" />';
+					echo util_make_link ( '/tracker/?group_id='.$thisGroupId.'&atid='.$artifactTypeId, $groupName.' - '.$artifactTypeName);
 				
-				echo '   ';
-					foreach($arrExtraFieldData as $extraFieldData) {
+					echo '   ';
+						
+						foreach($arrExtraFieldData as $extraFieldData) {
 
-						if($extraFieldData['field_name'] == 'Resolution') {
-							$id = $extraFieldData['extra_field_id'];							
-	
-							$ath = new ArtifactTypeHtml($art->ArtifactType->getGroup());
-							echo $ath->renderCheckbox($id, $requestedExtraField, false, 'none', 'horizontal');					
-						} 
-					}
+							if($extraFieldData['field_name'] == 'Resolution') {
+								$id = $extraFieldData['extra_field_id'];							
+
+								$ath = new ArtifactTypeHtml($group);
+								echo $ath->renderCheckbox($id, $requestedExtraField, false, 'none', 'horizontal');					
+							} 
+						}
 				
-				echo '   <input type="submit" value="'._('Hide selected').'" /></form></td>';
+					echo '   <input type="submit" value="'._('Hide selected').'" /></form></td>';
 
-				echo '</tr>';
+					echo '</tr>';
+
+			$j++;
+			$i=0;
+			foreach($assignedArtifacts as $art) {
+			
+				$artifact_type_id = $art->ArtifactType->getID();
+				$group_id = $art->ArtifactType->Group->getID();
+				
+				if($group_id === $thisGroupId) {
+				
+				$i++;
+				echo '
+				<tr '. $HTML->boxGetAltRowStyle($i++) .'>
+				<td width="10%">'.$art->getID().'</td>
+				<td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
+				<td>'.
+				util_make_link ('/tracker/?func=detail&aid='.$art->getID().'&group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->getSummary()).'</td>' .
+				'<td>'.$art->getElementName().'</td></tr>';
+
+				$last_group = $art->ArtifactType->getID();
+				}
 			}
-			$i++;
-			echo '
-			<tr '. $HTML->boxGetAltRowStyle($i++) .'>
-			<td width="10%">'.$art->getID().'</td>
-			<td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
-			<td>'.
-			util_make_link ('/tracker/?func=detail&aid='.$art->getID().'&group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->getSummary()).'</td>' .
-			'<td>'.$art->getElementName().'</td></tr>';
-
-			$last_group = $art->ArtifactType->getID();
 		}
 	} else {
 		echo '
@@ -156,7 +254,7 @@
 
 
 
-<div><b><?php echo _('Assigned Artifacts'); ?></b></div>
+<div><b><?php echo _('Remaining'). ' '._('assigned artifacts'); ?></b></div>
 
 <div class="tabbertab myPageArtifactTaskDiv" title="<?php echo _('Assigned Artifacts'); ?>">
 	<?php
@@ -174,16 +272,16 @@
 	$order_name_arr[]=_('Summary');
 	
 	echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
-	$artifactsForUser = new ArtifactsForUser(session_get_user());
+	$artifactsForUser = new ArtifactsForUser($user);
 	$assignedArtifacts =& $artifactsForUser->getAssignedArtifactsWithoutBugsByGroup($requestedExtraField); 
 	
 	if (count($assignedArtifacts) > 0) {
 		
 		$i=0;
 		foreach($assignedArtifacts as $art) {
-			$artifact_id = $art->ArtifactType->getID();
+			$artifact_type_id = $art->ArtifactType->getID();
 			$arrExtraFieldData = $art->ArtifactType->getExtraFields();
-			if ($artifact_id != $last_group) {
+			if ($artifact_type_id != $last_group) {
 					
 				echo '
 				<tr><td colspan="3" class="tablecontent myPageArtifactGroupHeader">'.
@@ -238,7 +336,7 @@
 	$order_name_arr[]=_('Priority');
 	$order_name_arr[]=_('Summary');
 	echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
-	$projectTasksForUser = new ProjectTasksForUser(session_get_user());
+	$projectTasksForUser = new ProjectTasksForUser($user);
 	$userTasks =& $projectTasksForUser->getTasksByGroupProjectName();
 	
 	if (count($userTasks) > 0) {
@@ -280,7 +378,7 @@
 <?php } ?>
 <?php if ($GLOBALS['sys_use_tracker']) { ?>
 
-<div><b><?php echo _('Submitted Artifacts'); ?></b></div>
+<div><b><?php echo _('All').' '._('submitted artifacts'); ?></b></div>
 
 <div class="tabbertab myPageArtifactTaskDiv" 
 title="<?php echo _('Submitted Artifacts'); ?>">
@@ -292,7 +390,7 @@
 	$order_name_arr[]=_('Priority');
 	$order_name_arr[]=_('Summary');
 	echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
-	$artifactsForUser = new ArtifactsForUser(session_get_user());
+	$artifactsForUser = new ArtifactsForUser($user);
 	$submittedArtifacts =& $artifactsForUser->getSubmittedArtifactsByGroup(); 
 	
 	if (count($submittedArtifacts) > 0) {
@@ -333,7 +431,7 @@
 		$order_name_arr[]=_('Remove');
 		$order_name_arr[]=_('Monitored Forums');
 		echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
-		$forumsForUser = new ForumsForUser(session_get_user());
+		$forumsForUser = new ForumsForUser($user);
 		$forums = $forumsForUser->getMonitoredForums();
 		if (count($forums) < 1) {
 			echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'._('You are not monitoring any forums.').'</strong></center></td></tr>';



More information about the evolvis-commits mailing list