[Fusionforge-commits] FusionForge branch master updated. 73c30d4950ad4e4c2cf24ef3cc5ad7df112cf233

Franck Villaume nerville at fusionforge.org
Sun Mar 30 00:05:07 CET 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  73c30d4950ad4e4c2cf24ef3cc5ad7df112cf233 (commit)
       via  432998e587bcba71a2aec0c3a20a2d63833fe3fa (commit)
      from  6144d9bf54616cc82f21af66030ff50b7f30ebe3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 73c30d4950ad4e4c2cf24ef3cc5ad7df112cf233
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Mar 30 00:04:41 2014 +0100

    more HTML helpers

diff --git a/src/www/forum/forum.php b/src/www/forum/forum.php
index 3de0a09..1a25eb7 100644
--- a/src/www/forum/forum.php
+++ b/src/www/forum/forum.php
@@ -259,11 +259,7 @@ if ($forum_id) {
 		while (($i < $rows) && ($total_rows < $max_rows)) {
 			$msg =& $msg_arr["0"][$i];
 			$total_rows++;
-
-			$ret_val .= '<tr '. $HTML->boxGetAltRowStyle($total_rows) .'>
-				<td><a href="'.util_make_url ('/forum/message.php?msg_id='.$msg->getID().
-							      '&group_id='.$group_id).'&reply=0">'.
-				html_image('ic/msg.png').' ';
+			$cells = array();
 			/*
 				See if this message is new or not
 				If so, highlite it in bold
@@ -278,10 +274,10 @@ if ($forum_id) {
 			/*
 				show the subject and poster
 			*/
-			$ret_val .= $bold_begin.$msg->getSubject() .$bold_end.'</a></td>'.
-				'<td>'.util_display_user($msg->getPosterName(), $msg->getPosterID(), $msg->getPosterRealName()).'</td>'.
-				'<td>'.relative_date($msg->getPostDate()).'</td></tr>';
-
+			$cells[][] = util_make_link('/forum/message.php?msg_id='.$msg->getID().'&group_id='.$group_id.'&reply=0', html_image('ic/msg.png').' '.$bold_begin.$msg->getSubject().$bold_end);
+			$cells[][] = util_display_user($msg->getPosterName(), $msg->getPosterID(), $msg->getPosterRealName());
+			$cells[][] = relative_date($msg->getPostDate());
+			$ret_val .= $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($total_rows, true)), $cells);
 			if ($msg->hasFollowups()) {
 				$ret_val .= $fh->showSubmessages($msg_arr,$msg->getID(),1);
 			}
diff --git a/src/www/people/admin/index.php b/src/www/people/admin/index.php
index abe1987..62d5392 100644
--- a/src/www/people/admin/index.php
+++ b/src/www/people/admin/index.php
@@ -162,10 +162,10 @@ if (forge_check_global_perm('forge_admin')) {
 		people_header(array('title' => _('People Administration')));
 
 		echo '<p>
-			<a href="'.getStringFromServer('PHP_SELF').'?people_cat=1" >'._('Add Job Categories').'</a><br />';
+			'.util_make_link('/people/admin/?people_cat=1', _('Add Job Categories')).'<br />';
 	//	echo "\nAdd categories of bugs like, 'mail module','gant chart module','interface', etc<p>";
 
-		echo "\n".'<a href="'.getStringFromServer('PHP_SELF').'?people_skills=1" >'._('Add Job Skills').'</a><br />';
+		echo "\n".util_make_link('/people/admin/?people_skills=1', _('Add Job Skills')).'<br />';
 	//	echo "\nAdd Groups of bugs like 'future requests','unreproducible', etc<p>";
 		echo '</p>';
 
diff --git a/src/www/people/index.php b/src/www/people/index.php
index 57ecbea..edb46b2 100644
--- a/src/www/people/index.php
+++ b/src/www/people/index.php
@@ -89,7 +89,7 @@ if ($group_id) {
 				AND people_job.status_id=1
 				ORDER BY post_date DESC', array(), 5);
         echo people_show_job_list($result);
-        echo '<p><a href="helpwanted-latest.php">['._('more latest posts').']</a></p>';
+        echo '<p>'.util_make_link('/people/helpwanted-latest.php', '['._('more latest posts').']').'</p>';
 
 }
 
diff --git a/src/www/pm/include/ProjectTaskHTML.class.php b/src/www/pm/include/ProjectTaskHTML.class.php
index 2f03ef3..82fd861 100644
--- a/src/www/pm/include/ProjectTaskHTML.class.php
+++ b/src/www/pm/include/ProjectTaskHTML.class.php
@@ -58,14 +58,13 @@ class ProjectTaskHTML extends ProjectTask {
 	}
 
 	function showDependentTasks () {
-
+		global $HTMl;
 		$result=db_query_params ('SELECT project_task.project_task_id,project_task.summary
 			FROM project_task,project_dependencies
 			WHERE project_task.project_task_id=project_dependencies.project_task_id
 			AND project_dependencies.is_dependent_on_task_id=$1',
 			array($this->getID() ));
 		$rows=db_numrows($result);
-
 		if ($rows > 0) {
 			echo '<h3>'._('Tasks That Depend on This Task').'</h3>';
 
@@ -73,24 +72,22 @@ class ProjectTaskHTML extends ProjectTask {
 			$title_arr[]=_('Task Id');
 			$title_arr[]=_('Task Summary');
 
-			echo $GLOBALS['HTML']->listTableTop ($title_arr);
+			echo $HTMl->listTableTop ($title_arr);
 
-			for ($i=0; $i < $rows; $i++) {
-				echo '
-				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>
-					<td>'
-					.util_make_link ('/pm/task.php?func=detailtask&project_task_id='. db_result($result, $i, 'project_task_id'). '&group_id='. $this->ProjectGroup->Group->getID() . '&group_project_id='. $this->ProjectGroup->getID(), db_result($result, $i, 'project_task_id')).'</td>
-					<td>'.db_result($result, $i, 'summary').'</td></tr>';
+			for ($i = 0; $i < $rows; $i++) {
+				$cells = array();
+				$cells[][] = util_make_link('/pm/task.php?func=detailtask&project_task_id='. db_result($result, $i, 'project_task_id'). '&group_id='. $this->ProjectGroup->Group->getID() . '&group_project_id='. $this->ProjectGroup->getID(), db_result($result, $i, 'project_task_id'));
+				$cells[][] = db_result($result, $i, 'summary');
+				echo $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($i, true)), $cells);
 			}
-
-			echo $GLOBALS['HTML']->listTableBottom();
-
+			echo $HTMl->listTableBottom();
 		} else {
 			echo '<p>'._('No Tasks are Dependent on This Task').'</p>';
 		}
 	}
 
 	function showRelatedArtifacts() {
+		global $HTML;
 		$res=$this->getRelatedArtifacts();
 
 		$rows=db_numrows($res);
@@ -110,26 +107,27 @@ class ProjectTaskHTML extends ProjectTask {
 			$title_arr[]=_('Open Date');
 			(($is_admin) ? $title_arr[]=_('Remove Relation') : '');
 
-			echo $GLOBALS['HTML']->listTableTop ($title_arr);
-
-			for ($i=0; $i < $rows; $i++) {
-				echo '
-				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>
-					<td>'.util_make_link ('/tracker/?func=detail&aid='.db_result($res,$i,'artifact_id').'&group_id='.db_result($res,$i,'group_id').'&atid='.db_result($res,$i,'group_artifact_id'), db_result($res,$i,'summary')).'</td>
-					<td>'. db_result($res,$i,'name') .'</td>
-					<td>'. db_result($res,$i,'status_name') . '</td>
-					<td>'. date(_('Y-m-d H:i'),db_result($res,$i,'open_date')) .'</td>'.
-					(($is_admin) ? '<td><input type="checkbox" name="rem_artifact_id[]" value="'.db_result($res,$i,'artifact_id').'" /></td>' : '').
-					'</tr>';
-			}
+			echo $HTML->listTableTop ($title_arr);
 
-			echo $GLOBALS['HTML']->listTableBottom();
+			for ($i = 0; $i < $rows; $i++) {
+				$cells = array();
+				$cells[][] = util_make_link('/tracker/?func=detail&aid='.db_result($res,$i,'artifact_id').'&group_id='.db_result($res,$i,'group_id').'&atid='.db_result($res,$i,'group_artifact_id'), db_result($res,$i,'summary'));
+				$cells[][] = db_result($res,$i,'name');
+				$cells[][] = db_result($res,$i,'status_name');
+				$cells[][] = date(_('Y-m-d H:i'),db_result($res,$i,'open_date'))
+				if ($is_admin) {
+					$cells[][] = '<input type="checkbox" name="rem_artifact_id[]" value="'.db_result($res,$i,'artifact_id').'" />';
+				}
+				echo $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($i, true)), $cells);
+			}
+			echo $HTML->listTableBottom();
 		} else {
 			echo '<p>'._('No Related Tracker Items Have Been Added').'</p>';
 		}
 	}
 
-	function showMessages($asc=true,$whereto='/') {
+	function showMessages($asc = true, $whereto = '/') {
+		global $HTML;
 		/*
 			Show the details rows from task_history
 		*/
@@ -140,48 +138,40 @@ class ProjectTaskHTML extends ProjectTask {
 			echo '<h3>'._('Comments')._(': ');
 
 			if ($asc) {
-				echo '<a href="' .
-					util_make_url($whereto . '&commentsort=anti') .
-					'">' . _('Sort comments antichronologically') . '</a>';
+				echo util_make_link($whereto.'&commentsort=anti', _('Sort comments antichronologically'));
 			} else {
-				echo '<a href="' .
-					util_make_url($whereto . '&commentsort=chrono') .
-					'">' . _('Sort comments chronologically') . '</a>';
+				echo util_make_link($whereto.'&commentsort=chrono', _('Sort comments chronologically'));
 			}
 			echo "</h3>\n";
 
-			$title_arr=array();
-			$title_arr[]=_('Comment');
-			$title_arr[]=_('Date');
-			$title_arr[]=_('By');
+			$title_arr = array();
+			$title_arr[] = _('Comment');
+			$title_arr[] = _('Date');
+			$title_arr[] = _('By');
 
-			echo $GLOBALS['HTML']->listTableTop ($title_arr);
+			echo $HTML->listTableTop($title_arr);
 
-			for ($i=0; $i < $rows; $i++) {
-				echo '
-				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>
-				<td>';
+			for ($i = 0; $i < $rows; $i++) {
+				$cells = array();
 				$sanitizer = new TextSanitizer();
 				$body = $sanitizer->SanitizeHtml(db_result($result, $i, 'body'));
 				if (strpos($body,'<') === false) {
-					echo nl2br(db_result($result, $i, 'body'));
+					$cells[][] = nl2br(db_result($result, $i, 'body'));
 				} else {
-					echo $body;
+					$cells[][] = $body;
 				}
-
-				echo '</td>
-					<td class="top">'.date(_('Y-m-d H:i'),db_result($result, $i, 'postdate')).'</td>
-					<td class="top">'.db_result($result, $i, 'user_name').'</td></tr>';
+				$cells[][] = date(_('Y-m-d H:i'),db_result($result, $i, 'postdate'));
+				$cells[][] = db_result($result, $i, 'user_name');
+				echo $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($i, true)), $cells);
 			}
-
-			echo $GLOBALS['HTML']->listTableBottom();
-
+			echo $HTML->listTableBottom();
 		} else {
 			echo '<p>'._('No Comments Have Been Posted').'</p>';
 		}
 	}
 
 	function showHistory() {
+		global $HTML;
 		/*
 			show the project_history rows that are
 			relevant to this project_task_id, excluding details
@@ -199,42 +189,32 @@ class ProjectTaskHTML extends ProjectTask {
 			$title_arr[]=_('Date');
 			$title_arr[]=_('By');
 
-			echo $GLOBALS['HTML']->listTableTop ($title_arr);
-
-			for ($i=0; $i < $rows; $i++) {
-				$field=db_result($result, $i, 'field_name');
-
-				echo '
-					<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>'.$field.'</td><td>';
+			echo $HTML->listTableTop ($title_arr);
 
+			for ($i = 0; $i < $rows; $i++) {
+				$field = db_result($result, $i, 'field_name');
+				$cells = array();
+				$cells[][] = $field;
+				$content = '';
 				if ($field == 'status_id') {
 //tdP - convert to actual status name
-					echo db_result($result, $i, 'old_value');
-
+					$content .= db_result($result, $i, 'old_value');
 				} elseif ($field == 'category_id') {
 //tdP convert to actual category_name
-					echo db_result($result, $i, 'old_value');
-
+					$content .= db_result($result, $i, 'old_value');
 				} elseif ($field == 'start_date') {
-
-					echo date('Y-m-d',db_result($result, $i, 'old_value'));
-
+					$content .= date('Y-m-d', db_result($result, $i, 'old_value'));
 				} elseif ($field == 'end_date') {
-
-					echo date('Y-m-d',db_result($result, $i, 'old_value'));
-
+					$content .= date('Y-m-d', db_result($result, $i, 'old_value'));
 				} else {
-
-					echo db_result($result, $i, 'old_value');
-
+					$content .= db_result($result, $i, 'old_value');
 				}
-				echo '</td>
-					<td>'. date(_('Y-m-d H:i'),db_result($result, $i, 'mod_date')) .'</td>
-					<td>'.db_result($result, $i, 'user_name').'</td></tr>';
+				$cells[][] = $content;
+				$cells[][] = date(_('Y-m-d H:i'),db_result($result, $i, 'mod_date'));
+				$cells[][] = db_result($result, $i, 'user_name');
+				echo $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($i, true)), $cells);
 			}
-
-			echo $GLOBALS['HTML']->listTableBottom();
-
+			echo $HTML->listTableBottom();
 		} else {
 			echo '<p>'._('No Changes Have Been Made').'</p>';
 		}
diff --git a/src/www/project/admin/users.php b/src/www/project/admin/users.php
index 5807b3c..460f8e4 100644
--- a/src/www/project/admin/users.php
+++ b/src/www/project/admin/users.php
@@ -239,10 +239,9 @@ project_admin_header(array('title'=>sprintf(_('Members of %s'), $group->getPubli
 		<input type="hidden" name="form_unix_name" value="<?php echo $user->getUnixName(); ?>" />
 		<table width="100%">
 			<tr>
-				<td style="white-space: nowrap;"><a
-					href="/users/<?php
-						echo $user->getUnixName();
-					?>"><?php echo $user->getRealName(); ?></a>
+				<td style="white-space: nowrap;"><?php
+					echo util_display_user($user->getUnixName(), $user->getId(), $user->getRealName());
+					?>
 				</td>
 				<td style="white-space: nowrap; text-align: right;"><?php
 					echo role_box($group_id,'role_id'); ?>
@@ -282,10 +281,8 @@ project_admin_header(array('title'=>sprintf(_('Members of %s'), $group->getPubli
 			<input type="submit" name="adduser" value="<?php echo _("Add Member") ?>" />
 		</div>
 		</form></div>
-		<div style="clear:both;">
-			<a href="massadd.php?group_id=<?php echo $group_id; ?>">
-				<?php echo _("Add Users From List"); ?>
-			</a>
+		<div style="clear:both;"><?php
+			echo util_make_link('/project/admin/massadd.php?group_id='.$group_id, _('Add Users From List')); ?>
 		</div>
 			<?php
 		}
@@ -323,15 +320,13 @@ foreach ($members as $user) {
 	foreach ($roles as $role) {
 		echo '<tr '. $HTML->boxGetAltRowStyle($i) . '>' ;
 		if (!$seen) {
-			echo '<td style="white-space: nowrap;" rowspan="'.(count($roles)+1).'">
-			<a href="/users/'.$user->getUnixName().'">';
+			echo '<td style="white-space: nowrap;" rowspan="'.(count($roles)+1).'">';
 			$display = $user->getRealName();
-			if (!empty($display)) {
-				echo $user->getRealName();
-			} else {
-				echo $user->getUnixName();
+			if (empty($display)) {
+				$display = $user->getUnixName();
 			}
-			echo "</a></td>\n";
+			echo util_display_user($user->getUnixName(), $user->getID(), $display);
+			echo "</td>\n";
 			$seen = true ;
 		}
 
diff --git a/src/www/snippet/add_snippet_to_package.php b/src/www/snippet/add_snippet_to_package.php
index c9eb894..4250e83 100644
--- a/src/www/snippet/add_snippet_to_package.php
+++ b/src/www/snippet/add_snippet_to_package.php
@@ -82,7 +82,7 @@ if (session_loggedin()) {
 						array($snippet_version_id));
 			if (!$result || db_numrows($result) < 1) {
 				echo $HTML->error_msg(_('Error: snippet does not exist'));
-				echo util_make_link ('/snippet/add_snippet_to_package.php?snippet_package_version_id='.$snippet_package_version_id,_('Back To Add Page'));
+				echo util_make_link('/snippet/add_snippet_to_package.php?snippet_package_version_id='.$snippet_package_version_id,_('Back To Add Page'));
 				handle_add_exit();
 			}
 
@@ -96,7 +96,7 @@ if (session_loggedin()) {
 							$snippet_version_id));
 			if ($result && db_numrows($result) > 0) {
 				echo $HTML->error_msg(_('Error: That snippet was already added to this package.'));
-				echo util_make_link ('/snippet/add_snippet_to_package.php?snippet_package_version_id='.$snippet_package_version_id,_('Back To Add Page'));
+				echo util_make_link('/snippet/add_snippet_to_package.php?snippet_package_version_id='.$snippet_package_version_id,_('Back To Add Page'));
 				handle_add_exit();
 			}
 
@@ -113,7 +113,7 @@ if (session_loggedin()) {
 			}
 		} else {
 			echo $HTML->error_msg(_('Error: Go back and fill in all the information'));
-			echo util_make_link ('/snippet/add_snippet_to_package.php?snippet_package_version_id='.$snippet_package_version_id,_('Back To Add Page'));
+			echo util_make_link('/snippet/add_snippet_to_package.php?snippet_package_version_id='.$snippet_package_version_id,_('Back To Add Page'));
 			handle_add_exit();
 		}
 	}
@@ -186,9 +186,9 @@ for ($i=0; $i<$combolistrows; $i++)
 		echo $HTML->listTableTop();
 		for ($i=0; $i<$rows; $i++) {
 			echo '
-			<tr '. $HTML->boxGetAltRowStyle($i) .'><td class="align-center">
-				<a href="'.util_make_url ('/snippet/delete.php?type=frompackage&snippet_version_id='.db_result($result,$i,'snippet_version_id').'&snippet_package_version_id='.$snippet_package_version_id).
-				'">' . html_image("ic/trash.png","16","16") . '</a></td><td style="width:99%">'.
+			<tr '. $HTML->boxGetAltRowStyle($i) .'><td class="align-center">'.
+				util_make_link('/snippet/delete.php?type=frompackage&snippet_version_id='.db_result($result,$i,'snippet_version_id').'&snippet_package_version_id='.$snippet_package_version_id,
+						html_image("ic/trash.png","16","16")).'</td><td style="width:99%">'.
 				db_result($result,$i,'name').' '.db_result($result,$i,'version')."</td></tr>";
 
 			$last_group=db_result($result,$i,'group_id');

commit 432998e587bcba71a2aec0c3a20a2d63833fe3fa
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sat Mar 29 17:19:17 2014 +0100

    pm: ProjectGroupHTML uses html_build_select_box_from_arrays

diff --git a/src/www/pm/include/ProjectGroupHTML.class.php b/src/www/pm/include/ProjectGroupHTML.class.php
index 6c4bb45..104e5ba 100644
--- a/src/www/pm/include/ProjectGroupHTML.class.php
+++ b/src/www/pm/include/ProjectGroupHTML.class.php
@@ -150,21 +150,18 @@ class ProjectGroupHTML extends ProjectGroup {
 		return html_build_select_box($res,$name,$checked,$show_100,$text_100);
 	}
 
-	function percentCompleteBox($name='percent_complete', $selected = 0, $display = true) {
-		$html = '
-		<select name="'.$name.'">';
-		$html .= '
-		<option value="0">'._('Not Started'). '</option>';
-		for ($i=5; $i<101; $i+=5) {
-			$html .= '
-			<option value="'.$i.'"';
-			if ($i==$selected) {
-				$html .= ' selected="selected"';
+	function percentCompleteBox($name = 'percent_complete', $selected = 0, $display = true) {
+		$vals = array(0);
+		$texts = array(_('Not Started'));
+		$checked_val = 0;
+		for ($i = 5; $i < 101; $i += 5) {
+			$vals[] = $i;
+			$texts[] = $i.'%';
+			if ($i == $selected) {
+				$checked_val = $i;
 			}
-			$html .= '>'.$i.'%</option>';
 		}
-		$html .= '
-		</select>';
+		$html = html_build_select_box_from_arrays($vals, $texts, $name, $checked_val, false, '', false, '');
 		if ($display) {
 			echo $html;
 		} else {
@@ -173,33 +170,28 @@ class ProjectGroupHTML extends ProjectGroup {
 	}
 
 	function showMonthBox($name, $select_month = 0, $display = true) {
-		$html = '
-		<select name="'.$name.'" size="1">';
+		$vals = array();
 		$monthlist = array(
-			'1'=>_('January'),
-			'2'=>_('February'),
-			'3'=>_('March'),
-			'4'=>_('April'),
-			'5'=>_('May'),
-			'6'=>_('June'),
-			'7'=>_('July'),
-			'8'=>_('August'),
-			'9'=>_('September'),
-			'10'=>_('October'),
-			'11'=>_('November'),
-			'12'=>_('December'));
-
-		for ($i=1; $i<=count($monthlist); $i++) {
+			_('January'),
+			_('February'),
+			_('March'),
+			_('April'),
+			_('May'),
+			_('June'),
+			_('July'),
+			_('August'),
+			_('September'),
+			_('October'),
+			_('November'),
+			_('December'));
+		$checked_val = 1;
+		for ($i = 1; $i <= count($monthlist); $i++) {
+			$vals[] = $i;
 			if ($i == $select_month) {
-				$html .= '
-				<option selected="selected" value="'.$i.'">'.$monthlist[$i].'</option>';
-			} else {
-				$html .= '
-				<option value="'.$i.'">'.$monthlist[$i].'</option>';
+				$checked_val = $i;
 			}
 		}
-		$html .= '
-		</select>';
+		$html = html_build_select_box_from_arrays($vals, $monthlist, $name, $checked_val, false, '', false, '');
 		if ($display) {
 			echo $html;
 		} else {
@@ -208,19 +200,15 @@ class ProjectGroupHTML extends ProjectGroup {
 	}
 
 	function showDayBox($name, $day = 1, $display = true) {
-		$html = '
-		<select name="'.$name.'" size="1">';
-		for ($i=1; $i<=31; $i++) {
+		$vals = array();
+		$checked_val = 1;
+		for ($i = 1; $i <= 31; $i++) {
+			$vals[] = $i;
 			if ($i == $day) {
-				$html .= '
-				<option selected="selected" value="'.$i.'">'.$i.'</option>';
-			} else {
-				$html .= '
-				<option value="'.$i.'">'.$i.'</option>';
+				$checked_val = $i;
 			}
 		}
-		$html .= '
-		</select>';
+		$html = html_build_select_box_from_arrays($vals, $vals, $name, $checked_val, false, '', false, '');
 		if ($display) {
 			echo $html;
 		} else {
@@ -229,20 +217,16 @@ class ProjectGroupHTML extends ProjectGroup {
 	}
 
 	function showYearBox($name, $year = 1, $display = true) {
+		$vals = array();
 		$current_year = date('Y');
-		$html = '
-		<select name="'.$name.'" size="1">';
-		for ($i=$current_year-5; $i<=$current_year+8; $i++) {
+		$checked_val = $current_year;
+		for ($i = $current_year - 5; $i <= $current_year + 8; $i++) {
+			$vals[] = $i;
 			if ($i == $year) {
-				$html .= '
-				<option selected="selected" value="'.$i.'">'.$i.'</option>';
-			} else {
-				$html .= '
-				<option value="'.$i.'">'.$i.'</option>';
+				$checked_val = $i;
 			}
 		}
-		$html .= '
-		</select>';
+		$html = html_build_select_box_from_arrays($vals, $vals, $name, $checked_val, false, '', false, '');
 		if ($display) {
 			echo $html;
 		} else {
@@ -251,19 +235,15 @@ class ProjectGroupHTML extends ProjectGroup {
 	}
 
 	function showHourBox($name, $hour = 1, $display = true) {
-		$html = '
-		<select name="'.$name.'" size="1">';
+		$vals = array();
+		$checked_val = 1;
 		for ($i=0; $i<=23; $i++) {
+			$vals[] = $i;
 			if ($i == $hour) {
-				$html .= '
-				<option selected="selected" value="'.$i.'">'.$i.'</option>';
-			} else {
-				$html .= '
-				<option value="'.$i.'">'.$i.'</option>';
+				$checked_val = $i;
 			}
 		}
-		$html .= '
-		</select>';
+		$html = html_build_select_box_from_arrays($vals, $vals, $name, $checked_val, false, '', false, '');
 		if ($display) {
 			echo $html;
 		} else {
@@ -272,17 +252,15 @@ class ProjectGroupHTML extends ProjectGroup {
 	}
 
 	function showMinuteBox($name, $minute = 0, $display = true) {
-		$html = '	<select name="'.$name.'" size="1">';
-		for ($i=0; $i<=45; $i=$i+15) {
+		$vals = array();
+		$checked_val = 0;
+		for ($i = 0; $i <= 45; $i = $i + 15) {
+			$vals[] = $i;
 			if ($i == $minute) {
-				$html .= '	<option selected="selected" value="'.$i.'">'.$i.'</option>';
-			} else {
-				$html .= '
-				<option value="'.$i.'">'.$i.'</option>';
+				$checked_val = $i;
 			}
 		}
-		$html .= '
-		</select>';
+		$html = html_build_select_box_from_arrays($vals, $vals, $name, $checked_val, false, '', false, '');
 		if ($display) {
 			echo $html;
 		} else {

-----------------------------------------------------------------------

Summary of changes:
 src/www/forum/forum.php                       |   14 +--
 src/www/people/admin/index.php                |    4 +-
 src/www/people/index.php                      |    2 +-
 src/www/pm/include/ProjectGroupHTML.class.php |  124 ++++++++++-------------
 src/www/pm/include/ProjectTaskHTML.class.php  |  132 +++++++++++--------------
 src/www/project/admin/users.php               |   25 ++---
 src/www/snippet/add_snippet_to_package.php    |   12 +--
 7 files changed, 131 insertions(+), 182 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list