[Fusionforge-commits] FusionForge branch master updated. f0efc8b7d0660b9a615058d018583543e96ada4a

Alain Peyrat aljeux at fusionforge.org
Fri Dec 7 16:07:13 CET 2012


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  f0efc8b7d0660b9a615058d018583543e96ada4a (commit)
      from  4def7dd3114276163175f09fd9eb1da8a1aed053 (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 f0efc8b7d0660b9a615058d018583543e96ada4a
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Fri Dec 7 16:07:05 2012 +0100

    Clean code in trackers

diff --git a/src/common/tracker/actions/detail.php b/src/common/tracker/actions/detail.php
index 0c0834d..8cae3aa 100644
--- a/src/common/tracker/actions/detail.php
+++ b/src/common/tracker/actions/detail.php
@@ -165,16 +165,8 @@ $nb = $count? ' ('.$count.')' : '';
 </table>
 </div>
 <div class="tabbertab" title="<?php echo _('Changes'); ?>">
-<table width="80%">
-	<tr>
-	<td colspan="2">
-	<h2><?php echo _('Changes') ?>:</h2>
-	<?php
-	echo $ah->showHistory();
-	?>
-	</td>
-	</tr>
-</table>
+	<h2><?php echo _('Changes') ?></h2>
+	<?php $ah->showHistory(); ?>
 </div>
 <?php $ah->showRelations(); ?>
 </div>
diff --git a/src/common/tracker/actions/mod-limited.php b/src/common/tracker/actions/mod-limited.php
index 296532d..a04d17c 100644
--- a/src/common/tracker/actions/mod-limited.php
+++ b/src/common/tracker/actions/mod-limited.php
@@ -33,7 +33,7 @@ global $aid;
 global $atid;
 
 html_use_coolfieldset();
-$ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
+$ath->header(array ('title'=> $ah->getStringID().' '. $ah->getSummary(), 'atid'=>$ath->getID()));
 
 echo notepad_func();
 
@@ -112,40 +112,39 @@ if (session_loggedin()) {
 
 	<tr>
 		<td><strong><?php echo _('Assigned to')?>:</strong><br />
-		<span id="tracker-assigned_to" title="<?php echo util_html_secure(html_get_tooltip_description('assigned_to')) ?>">
+		<span id="tracker-assigned_to" title="<?php echo html_get_tooltip_description('assigned_to') ?>">
 		<?php echo $ah->getAssignedRealName(); ?> (<?php echo $ah->getAssignedUnixName(); ?>)
 		</span></td>
 		<td>
 		<strong><?php echo _('Priority') ?>:</strong><br />
-		<span id="tracker-priority" title="<?php echo util_html_secure(html_get_tooltip_description('priority')) ?>">
+		<span id="tracker-priority" title="<?php echo html_get_tooltip_description('priority') ?>">
 		<?php echo $ah->getPriority(); ?>
 		</span></td>
 	</tr>
 
+	<?php if (!$ath->usesCustomStatuses()) { ?>
 	<tr>
 		<td>
-		<?php if (!$ath->usesCustomStatuses()) { ?>
 			<strong><?php echo _('State') ?>:</strong><br />
 			<span id="tracker-status_id" title="<?php echo util_html_secure(html_get_tooltip_description('status_id')) ?>">
 			<?php echo $ath->statusBox ('status_id', $ah->getStatusID() ); ?>
 			<span>
-		<?php } ?>
 		</td>
 		<td>
 		</td>
 	</tr>
+	<?php } ?>
 	<?php
 		$ath->renderRelatedTasks($group, $ah);
 		$ath->renderFiles($group_id, $ah);
 	?>
 	<tr>
 		<td colspan="2"><strong><?php echo _('Summary')?><?php echo utils_requiredField(); ?>:</strong><br />
-			<span id="tracker-summary" title="<?php echo util_html_secure(html_get_tooltip_description('summary')) ?>">
+			<span id="tracker-summary" title="<?php echo html_get_tooltip_description('summary') ?>">
 			<?php echo $ah->getSummary(); ?>
 			</span>
 		</td>
 	</tr>
-
 	<tr><td colspan="2">
 		<br />
 		<?php echo $ah->showDetails(); ?>
@@ -189,7 +188,7 @@ $nb = $count? ' ('.$count.')' : '';
 		<h2><?php echo _('Attached Files') ?>:</h2>
 		<?php
 		//
-		//  print a list of files attached to this Artifact
+		// print a list of files attached to this Artifact
 		//
 			$ath->renderFiles($group_id, $ah);
 		?>
@@ -207,18 +206,12 @@ $nb = $count? ' ('.$count.')' : '';
 </table>
 </div>
 <div class="tabbertab" title="<?php echo _('Changes'); ?>">
-<table border="0" width="80%">
-	<tr><td colspan="2">
-		<h2><?php echo _('Change Log') ?>:</h2>
-		<?php
-			echo $ah->showHistory();
-		?>
-	</td></tr>
-</table>
+	<h2><?php echo _('Changes') ?></h2>
+	<?php $ah->showHistory(); ?>
 </div>
 <?php $ah->showRelations(); ?>
 </div>
-		</form>
+</form>
 <?php
 
 $ath->footer(array());
diff --git a/src/common/tracker/actions/mod.php b/src/common/tracker/actions/mod.php
index 13752c4..4cdd8c1 100644
--- a/src/common/tracker/actions/mod.php
+++ b/src/common/tracker/actions/mod.php
@@ -34,7 +34,8 @@ global $aid;
 global $atid;
 
 html_use_coolfieldset();
-$ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
+$ath->header(array ('title'=> $ah->getStringID().' '. $ah->getSummary(), 'atid'=>$ath->getID()));
+
 
 echo notepad_func();
 
@@ -140,7 +141,8 @@ echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
 		<td><strong><?php echo _('Assigned to')?>:</strong><br />
 		<?php
 		echo $ath->technicianBox('assigned_to', $ah->getAssignedTo() );
-		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&update_users=1','('._('Admin').')');
+		echo " ";
+		echo util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&update_users=1','('._('Admin').')');
 		?>
 		</td><td>
 		<strong><?php echo _('Priority') ?>:</strong><br />
@@ -148,19 +150,15 @@ echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
 		</td>
 	</tr>
 
+	<?php if (!$ath->usesCustomStatuses()) { ?>
 	<tr>
 		<td>
-		<?php if (!$ath->usesCustomStatuses()) { ?>
-		<strong><?php echo _('State') ?>:</strong><br />
-		<?php
-
-		echo $ath->statusBox ('status_id', $ah->getStatusID() );
-		}
-		?>
-		</td>
-		<td>
+			<strong><?php echo _('State') ?>:</strong><br />
+			<?php echo $ath->statusBox ('status_id', $ah->getStatusID() ); ?>
 		</td>
+		<td></td>
 	</tr>
+	<?php } ?>
 	<?php
 		$ath->renderRelatedTasks($group, $ah);
 		$ath->renderFiles($group_id, $ah);
@@ -168,7 +166,7 @@ echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
 
 	<tr>
 		<td colspan="2"><strong><?php echo _('Summary')?><?php echo utils_requiredField(); ?>:</strong><br />
-		<input id="tracker-summary" title="<?php echo util_html_secure(_('The summary text-box represents a short tracker item summary. Useful when browsing through several tracker items.')) ?>" type="text" name="summary" size="70" value="<?php
+		<input id="tracker-summary" required="required" title="<?php echo _('The summary text-box represents a short tracker item summary. Useful when browsing through several tracker items.') ?>" type="text" name="summary" size="70" value="<?php
 			echo $ah->getSummary();
 			?>" maxlength="255" />
 		</td>
@@ -177,10 +175,10 @@ echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
 		<div id="edit" style="display:none;">
 		<strong><?php echo _('Detailed description') ?><?php echo utils_requiredField(); ?>: <?php echo notepad_button('document.forms.trackermodform.description') ?></strong>
 		<br />
-		<textarea id="tracker-description" name="description" rows="30" cols="79" title="<?php echo util_html_secure(html_get_tooltip_description('description')) ?>"><?php echo $ah->getDetails(); ?></textarea>
+		<textarea id="tracker-description" required="required" name="description" rows="30" cols="79" title="<?php echo html_get_tooltip_description('description') ?>"><?php echo $ah->getDetails(); ?></textarea>
 		</div>
 		<div id="show" style="display:block;">
-		<?php echo $ah->showDetails(true); ?>
+		<?php $ah->showDetails(true); ?>
 		</div>
 	</td></tr>
 </table>
@@ -195,7 +193,8 @@ $nb = $count? ' ('.$count.')' : '';
 		<br /><strong><?php echo _('Use Canned Response') ?>:</strong><br />
 		<?php
 		echo $ath->cannedResponseBox('canned_response');
-		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&add_canned=1','('._('Admin').')');
+		echo " ";
+		echo util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&add_canned=1','('._('Admin').')');
 		?>
 		<script type="text/javascript">/* <![CDATA[ */
 			$('#tracker-canned_response').change(function() {
@@ -251,7 +250,7 @@ $nb = $count? ' ('.$count.')' : '';
         <input type="file" name="input_file4" size="30" /><br />
 		<?php
 		//
-		//	print a list of files attached to this Artifact
+		// print a list of files attached to this Artifact
 		//
 		$ath->renderFiles($group_id, $ah);
 		?>
@@ -269,20 +268,12 @@ $nb = $count? ' ('.$count.')' : '';
 </table>
 </div>
 <div class="tabbertab" title="<?php echo _('Changes'); ?>">
-<table border="0" width="80%">
-	<tr>
-	<td colspan="2">
-		<h2><?php echo _('Changes') ?>:</h2>
-		<?php
-			echo $ah->showHistory();
-		?>
-	</td>
-	</tr>
-</table>
+	<h2><?php echo _('Changes') ?></h2>
+	<?php $ah->showHistory(); ?>
 </div>
 <?php $ah->showRelations(); ?>
 </div>
-		</form>
+</form>
 <?php
 
 $ath->footer(array());
diff --git a/src/common/tracker/views/form-addextrafieldoption.php b/src/common/tracker/views/form-addextrafieldoption.php
index 5179c68..ead9d72 100644
--- a/src/common/tracker/views/form-addextrafieldoption.php
+++ b/src/common/tracker/views/form-addextrafieldoption.php
@@ -32,7 +32,7 @@
 	} elseif ($ac->isError()) {
 		exit_error($ac->getErrorMessage(),'tracker');
 	} else {
-	  	$efearr=$ath->getExtraFieldElements($boxid);
+		$efearr=$ath->getExtraFieldElements($boxid);
 		$title = sprintf(_('Add/Update Custom Field Elements in %s'), $ath->getName());
 		$ath->adminHeader(array ('title'=>$title));
 
diff --git a/src/common/tracker/views/form-deleteextrafield.php b/src/common/tracker/views/form-deleteextrafield.php
index 6b4bd88..552207a 100644
--- a/src/common/tracker/views/form-deleteextrafield.php
+++ b/src/common/tracker/views/form-deleteextrafield.php
@@ -21,7 +21,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-
 $ath->adminHeader(array('title'=>sprintf(_('Delete a custom field for %s'),$ath->getName())));
 
 $id = getStringFromRequest('id');
diff --git a/src/common/tracker/views/form-edittemplate.php b/src/common/tracker/views/form-edittemplate.php
index 4e12994..3a27e35 100644
--- a/src/common/tracker/views/form-edittemplate.php
+++ b/src/common/tracker/views/form-edittemplate.php
@@ -4,14 +4,12 @@ $title = sprintf(_('Edit Layout Template for %s'), $ath->getName()) ;
 $ath->adminHeader(array('title'=>$title, 'modal'=>1));
 
 $params = array() ;
-$params['body'] = '<table>'.$ath->getRenderHTML(array(), 'DETAIL').'</table>';
+$params['body'] = isset($body)? $body : '<table>'.$ath->getRenderHTML(array(),'DETAIL').'</table>';
 $params['height'] = "500";
 $params['group'] = $group_id;
 $params['content'] = '<textarea name="body"  rows="30" cols="80">' . $params['body'] . '</textarea>';
 plugin_hook_by_reference("text_editor",$params);
 
-echo _('Notes:');
-
 ?>
 <h2>Important</h2>
 <ul>

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

Summary of changes:
 src/common/tracker/actions/detail.php              |   12 +-----
 src/common/tracker/actions/mod-limited.php         |   27 +++++-------
 src/common/tracker/actions/mod.php                 |   45 ++++++++------------
 .../tracker/views/form-addextrafieldoption.php     |    2 +-
 src/common/tracker/views/form-deleteextrafield.php |    1 -
 src/common/tracker/views/form-edittemplate.php     |    4 +-
 6 files changed, 32 insertions(+), 59 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list