[Fusionforge-commits] FusionForge branch master updated. 529ecd9292a7d69448b3e02c9759c7148f63b7d1

Franck VILLAUME nerville at fusionforge.org
Thu Feb 27 18:41:22 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  529ecd9292a7d69448b3e02c9759c7148f63b7d1 (commit)
       via  247d404a78c4ce704cc543dbf181e352920c61e3 (commit)
       via  a2d762dd2e7566571aa2699c86d227ec7fa4aef4 (commit)
       via  6fef2b4662a6f0e913fca66db5eb6dae32bdb60a (commit)
       via  5e5ff28dba69962f0ddac012d86d49c02f817e3c (commit)
       via  82a65dc23759a0e417db0bf366668fc92e448b6a (commit)
       via  fc0de5416ef0ad6ed74d9aba9b16e350dcba58a0 (commit)
       via  fb3555d6fc840422b0eaa104c954b7c80defb997 (commit)
       via  176716b06c48b9137320b6704831099146ef5e11 (commit)
       via  8bcc2148847a1905c3683b3b6fd055f64bdb85d4 (commit)
       via  52e94c86eb90676a5a013213da12e4abbddf5e0b (commit)
      from  49562072b292ff1de5cbf676e10cadcdb118a51f (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 529ecd9292a7d69448b3e02c9759c7148f63b7d1
Merge: 5e5ff28 247d404
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 27 18:40:42 2014 +0100

    merge Branch_5_3

diff --cc src/www/themes/funky-wOw/Theme.class.php
index b28bded,73b7d2a..a1e1134
--- a/src/www/themes/funky-wOw/Theme.class.php
+++ b/src/www/themes/funky-wOw/Theme.class.php
@@@ -248,38 -257,44 +248,37 @@@ class Theme extends Layout 
  
  		$accumulated_width = 0;
  
 -		for ($i=0; $i<$count; $i++) {
 -			$tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width ;
 -			$accumulated_width += $tabwidth ;
 -
 -			$return .= "\n";
 +		for ($i = 0; $i < $count; $i++) {
 +			$tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width;
 +			$accumulated_width += $tabwidth;
  
  			// middle part
 -			$return .= '<td class="tg-middle" style="width:'.$tabwidth.'%;"><a ';
 -			$return .= 'id="'.md5($TABS_DIRS[$i]).'" ';
 -			$return .= 'href="'.$TABS_DIRS[$i].'">' . "\n";
 -			$return .= '<span';
 -
 +			$attrs = array();
 +			$attrs['class'] = 'tg-middle';
 +			$attrs['style'] = 'width:'.$tabwidth.'%';
 +			$return .= html_ao('td', $attrs);
 +			if ($i == 0) {
 +				$class_a = 'tabtitle-nw';
 +			} else if ( $i == ($count - 1)) {
 +				$class_a = 'tabtitle-ne';
 +			} else {
 +				$class_a = 'tabtitle';
 +			}
- 			$return .= html_ao('a', array('href' => $TABS_DIRS[$i], 'id' => md5($TABS_DIRS[$i]), 'class' => $class_a, 'title' => $TABS_TOOLTIPS[$i]));
++			$return .= html_ao('a', array('href' => $TABS_DIRS[$i], 'id' => md5($TABS_DIRS[$i])));
 +			$attrs = array();
  			if ($selected == $i)
 -				$return .= ' class="selected"';
 -			$return .= '>';
 -			$return .= '<span';
 +				$attrs['class'] = 'selected';
  
 -			$classes = '';
 +			$return .= html_ao('span', $attrs);
- 			$attrs = array();
++			$attrs = array('title' => $TABS_TOOLTIPS[$i], 'class' => $class_a);
  			if ($nested)
- 				$attrs['class'] = 'nested';
 -				$classes .= 'nested ';
 -
 -			if ($use_tooltips) {
 -				$classes .= ' tabtitle ';
 -				if  (isset($TABS_TOOLTIPS[$i])) {
 -					$return .= ' title="'.$TABS_TOOLTIPS[$i].'" ';
 -				}
 -			}
 -                        $return .= ' class="'.$classes.'" ';
 -			$return .= '>' . "\n";
 -			$return .= ''.$TABS_TITLES[$i].'' . "\n";
 -			$return .= '</span>';
 -			$return .= '</span>' . "\n";
 -			$return .= '</a></td>' . "\n";
++				$attrs['class'] .= ' nested';
  
 +			$return .= html_e('span', $attrs, $TABS_TITLES[$i], false);
 +			$return .= html_ac(html_ap() - 3);
- 
  		}
  
 -		$return .= '</tr></table><!-- end tabs -->';
 -
 +		$return .= html_ac(html_ap() -2).'<!-- end tabs -->'."\n";
  		return $return;
  	}
  
diff --cc src/www/themes/funky/Theme.class.php
index 8285859,31070fa..9f068ea
--- a/src/www/themes/funky/Theme.class.php
+++ b/src/www/themes/funky/Theme.class.php
@@@ -248,38 -273,44 +248,37 @@@ class Theme extends Layout 
  
  		$accumulated_width = 0;
  
 -		for ($i=0; $i<$count; $i++) {
 -			$tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width ;
 -			$accumulated_width += $tabwidth ;
 -
 -			$return .= "\n";
 +		for ($i = 0; $i < $count; $i++) {
 +			$tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width;
 +			$accumulated_width += $tabwidth;
  
  			// middle part
 -			$return .= '<td class="tg-middle" style="width:'.$tabwidth.'%;"><a ';
 -			$return .= 'id="'.md5($TABS_DIRS[$i]).'" ';
 -			$return .= 'href="'.$TABS_DIRS[$i].'">' . "\n";
 -			$return .= '<span';
 -
 +			$attrs = array();
 +			$attrs['class'] = 'tg-middle';
 +			$attrs['style'] = 'width:'.$tabwidth.'%';
 +			$return .= html_ao('td', $attrs);
 +			if ($i == 0) {
 +				$class_a = 'tabtitle-nw';
 +			} else if ( $i == ($count - 1)) {
 +				$class_a = 'tabtitle-ne';
 +			} else {
 +				$class_a = 'tabtitle';
 +			}
- 			$return .= html_ao('a', array('href' => $TABS_DIRS[$i], 'id' => md5($TABS_DIRS[$i]), 'class' => $class_a, 'title' => $TABS_TOOLTIPS[$i]));
++			$return .= html_ao('a', array('href' => $TABS_DIRS[$i], 'id' => md5($TABS_DIRS[$i])));
 +			$attrs = array();
  			if ($selected == $i)
 -				$return .= ' class="selected"';
 -			$return .= '>';
 -			$return .= '<span';
 +				$attrs['class'] = 'selected';
  
 -			$classes = '';
 +			$return .= html_ao('span', $attrs);
- 			$attrs = array();
++			$attrs = array('title' => $TABS_TOOLTIPS[$i], 'class' => $class_a);
  			if ($nested)
- 				$attrs['class'] = 'nested';
 -				$classes .= 'nested ';
 -
 -			if ($use_tooltips) {
 -				$classes .= ' tabtitle ';
 -				if  (isset($TABS_TOOLTIPS[$i])) {
 -					$return .= ' title="'.$TABS_TOOLTIPS[$i].'" ';
 -				}
 -			}
 -                        $return .= ' class="'.$classes.'" ';
 -			$return .= '>' . "\n";
 -			$return .= ''.$TABS_TITLES[$i].'' . "\n";
 -			$return .= '</span>';
 -			$return .= '</span>' . "\n";
 -			$return .= '</a></td>' . "\n";
++				$attrs['class'] .= ' nested';
  
 +			$return .= html_e('span', $attrs, $TABS_TITLES[$i], false);
 +			$return .= html_ac(html_ap() - 3);
- 
  		}
  
 -		$return .= '</tr></table><!-- end tabs -->';
 -
 +		$return .= html_ac(html_ap() -2).'<!-- end tabs -->'."\n";
  		return $return;
  	}
  

commit 5e5ff28dba69962f0ddac012d86d49c02f817e3c
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 27 18:03:44 2014 +0100

    [#638]: migration tabber.js : tracker browse use jQuery tabs

diff --git a/src/common/tracker/actions/browse.php b/src/common/tracker/actions/browse.php
index adabfa7..c3c444c 100644
--- a/src/common/tracker/actions/browse.php
+++ b/src/common/tracker/actions/browse.php
@@ -156,8 +156,7 @@ if (!$art_arr && $af->isError()) {
 //build page title to make bookmarking easier
 //if a user was selected, add the user_name to the title
 //same for status
-use_javascript('/tabber/tabber.js');
-
+html_use_jqueryui();
 html_use_coolfieldset();
 
 $ath->header(array('atid'=>$ath->getID(), 'title'=>$ath->getName()));
@@ -331,8 +330,22 @@ print '<span rev="doap:bug-database sioc:space_of" resource="'. $proj_url .'" />
 print "</div>\n"; // end of about
 
 echo '
+<script type="text/javascript">//<![CDATA[
+jQuery(document).ready(function() {';
+if ($af->query_type == 'custom') {
+	echo '	jQuery("#tabber").tabs({active: 1});';
+} else {
+	echo '	jQuery("#tabber").tabs();';
+}
+echo '
+});
+//]]></script>
 <div id="tabber" class="tabber">
-	<div class="tabbertab" title="'._('Advanced queries').'">';
+	<ul>
+	<li><a href="#tabber-advancedquery">'._('Advanced queries').'</a></li>
+	<li><a href="#tabber-simplefiltering">'._('Simple Filtering and Sorting').'</a></li>
+	</ul>
+	<div id="tabber-advancedquery" title="'._('Advanced queries').'">';
 
 if (session_loggedin()) {
 	$res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
@@ -388,7 +401,7 @@ if (db_numrows($res)>0) {
 	</form>';
 	?>
 		<script type="text/javascript">/* <![CDATA[ */
-		$('#query_id').change(function() {
+		jQuery('#query_id').change(function() {
 			location.href = '<?php echo getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'&power_query=1&query_id=' ?>'+$('#query_id').val();
 		});
 		/* ]]> */</script>
@@ -399,7 +412,7 @@ if (db_numrows($res)>0) {
 }
 echo '
 	</div>
-	<div class="tabbertab'.($af->query_type == 'custom' ? ' tabbertabdefault' : '').'" title="'._('Simple Filtering and Sorting').'">
+	<div id="tabber-simplefiltering" title="'._('Simple Filtering and Sorting').'">
 	<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
 	<input type="hidden" name="query_id" value="-1" />
 	<input type="hidden" name="set" value="custom" />

commit 82a65dc23759a0e417db0bf366668fc92e448b6a
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 27 14:15:31 2014 +0100

    [#638]: migration tabber.js : login-form use jquery tabs

diff --git a/src/www/include/login-form.php b/src/www/include/login-form.php
index ce00065..acd5f1b 100644
--- a/src/www/include/login-form.php
+++ b/src/www/include/login-form.php
@@ -3,6 +3,7 @@
  * FusionForge login form functions
  *
  * Copyright 2011, Roland Mas
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -20,8 +21,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-use_javascript('/tabber/tabber.js');
-
 function validate_return_to(&$return_to = '/') {
 	$newrt = '/';
 
@@ -75,21 +74,39 @@ function display_login_form($return_to = '/', $triggered = false, $full_page = f
 
 	if (count ($params['html_snippets']) > 1) {
 		$use_tabber = true;
-		echo '<div id="tabber" class="tabber">';
+		html_use_jqueryui();
+		echo $HTML->getJavascripts();
+		echo $HTML->getStylesheets();
+		echo '
+			<script type="text/javascript">//<![CDATA[
+			jQuery(document).ready(function() {
+				jQuery("#tabber").tabs();
+			});
+			//]]></script>';
+		echo '<div id="tabber">';
 	} else {
 		$use_tabber = false;
 	}
 
+	$htmlCodeUl = '<ul>';
+	$htmlCode = '';
 	foreach ($params['html_snippets'] as $p => $s) {
 		$plugin = plugin_get_object($p);
 		if ($use_tabber) {
-			echo '<div class="tabbertab" title="'.$plugin->text.'">';
+			$htmlCodeUl .= '<li><a href="#tabber-'.$plugin->name.'">'.$plugin->text.'</a></li>';
+			$htmlCode .= '<div id="tabber-'.$plugin->name.'" class="tabbertab" title="'.$plugin->text.'">';
 		}
-		echo $s;
+		$htmlCode .= $s;
 		if ($use_tabber) {
-			echo '</div>';
+			$htmlCode .= '</div>';
 		}
 	}
+	$htmlCodeUl .= '</ul>';
+	if ($use_tabber) {
+		echo $htmlCodeUl;
+	}
+
+	echo $htmlCode;
 
 	if ($use_tabber) {
 		echo '</div>';

commit fc0de5416ef0ad6ed74d9aba9b16e350dcba58a0
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 27 12:08:06 2014 +0100

    [#638]: migration tabber.js : tracker mod & mod-limited now use jquery tabs

diff --git a/src/common/tracker/actions/mod-limited.php b/src/common/tracker/actions/mod-limited.php
index 3876442..9f633e0 100644
--- a/src/common/tracker/actions/mod-limited.php
+++ b/src/common/tracker/actions/mod-limited.php
@@ -24,8 +24,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-use_javascript('/tabber/tabber.js');
-
 global $ath;
 global $ah;
 global $group_id;
@@ -33,12 +31,19 @@ global $group;
 global $aid;
 global $atid;
 
+html_use_jqueryui();
 html_use_coolfieldset();
 $ath->header(array ('title'=> $ah->getStringID().' '. $ah->getSummary(), 'atid'=>$ath->getID()));
 
 echo notepad_func();
 
 ?>
+<script type="text/javascript">//<![CDATA[
+jQuery(document).ready(function() {
+	jQuery("#tabber").tabs();
+});
+//]]></script>
+
 	<h1>[#<?php echo $ah->getID(); ?>] <?php echo $ah->getSummary(); ?></h1>
 
 <form id="trackermodlimitedform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>" enctype="multipart/form-data" method="post">
@@ -166,31 +171,48 @@ if (session_loggedin()) {
 		<?php $ah->showDetails(); ?>
 	</td></tr>
 </table>
-<div id="tabber" class="tabber">
+<div id="tabber">
 <?php
 $count=db_numrows($ah->getMessages());
 $nb = $count? ' ('.$count.')' : '';
+$pm = new PluginManager();
+$pluginsListeners = $pm->GetHookListeners('artifact_extra_detail');
+$pluginfound = false;
+foreach ($pluginsListeners as $pluginsListener) {
+	if ($ath->Group->usesPlugin($pluginsListener)) {
+		$pluginfound = true;
+		break;
+	}
+}
 ?>
-<div class="tabbertab" title="<?php echo _('Comments').$nb; ?>">
-<table width="80%">
-	<tr><td colspan="2">
-		<br /><strong><?php echo _('Add A Comment') ?>: <?php echo notepad_button('document.forms.trackermodlimitedform.details') ?></strong><br />
-		<textarea id="tracker-comment" name="details" rows="7" cols="60" title="<?php echo util_html_secure(html_get_tooltip_description('comment')) ?>"></textarea>
-		<p>
-		<h2><?php echo _('Comments')._(': ');
-echo '</h2>';
-$ah->showMessages();
-		?>
-	</td></tr>
-</table>
-</div>
+	<ul>
+	<li><a href="#tabber-comments"><?php echo _('Comments'); ?></a></li>
+	<li><a href="#tabber-attachments"><?php echo _('Attachments'); ?></a></li>
+	<?php if ($pluginfound) { ?>
+	<li><a href="#tabber-commits"><?php echo _('Commits'); ?></a></li>
+	<?php } ?>
+	<li><a href="#tabber-changes"><?php echo _('Changes'); ?></a></li>
+	</ul>
+	<div id="tabber-comments" class="tabbertab" title="<?php echo _('Comments').$nb; ?>">
+	<table width="80%">
+		<tr><td colspan="2">
+			<br /><strong><?php echo _('Add A Comment') ?>: <?php echo notepad_button('document.forms.trackermodlimitedform.details') ?></strong><br />
+			<textarea id="tracker-comment" name="details" rows="7" cols="60" title="<?php echo util_html_secure(html_get_tooltip_description('comment')) ?>"></textarea>
+			<p>
+			<h2><?php echo _('Comments')._(': ');
+	echo '</h2>';
+	$ah->showMessages();
+			?>
+		</td></tr>
+	</table>
+	</div>
 <?php
 $tabcnt=0;
 $file_list = $ah->getFiles();
 $count=count($file_list);
 $nb = $count? ' ('.$count.')' : '';
 ?>
-<div class="tabbertab" title="<?php echo _('Attachments').$nb; ?>">
+<div id="tabber-attachments" class="tabbertab" title="<?php echo _('Attachments').$nb; ?>">
 <h2><?php echo _('Existing Files')._(':'); ?></h2>
 <table width="80%">
 	<tr><td colspan="2">
@@ -211,7 +233,8 @@ $nb = $count? ' ('.$count.')' : '';
 	</td></tr>
 </table>
 </div>
-<div class="tabbertab" title="<?php echo _('Commits'); ?>">
+<?php if ($pluginfound) { ?>
+<div id="tabber-commits" class="tabbertab" title="<?php echo _('Commits'); ?>">
 <table width="80%">
 <tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
 	<?php
@@ -221,7 +244,8 @@ $nb = $count? ' ('.$count.')' : '';
 	?>
 </table>
 </div>
-<div class="tabbertab" title="<?php echo _('Changes'); ?>">
+<?php } ?>
+<div id="tabber-changes" class="tabbertab" title="<?php echo _('Changes'); ?>">
 	<h2><?php echo _('Changes') ?></h2>
 	<?php $ah->showHistory(); ?>
 </div>
diff --git a/src/common/tracker/actions/mod.php b/src/common/tracker/actions/mod.php
index 1583f17..5d8d072 100644
--- a/src/common/tracker/actions/mod.php
+++ b/src/common/tracker/actions/mod.php
@@ -25,8 +25,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-use_javascript('/tabber/tabber.js');
-
 global $ath;
 global $ah;
 global $group_id;
@@ -41,12 +39,18 @@ function gettipspan($idpart, $content) {
 	$content . '</span>';
 }
 
+html_use_jqueryui();
 html_use_coolfieldset();
 $ath->header(array ('title'=> $ah->getStringID().' '. $ah->getSummary(), 'atid'=>$ath->getID()));
 
 echo notepad_func();
 
 ?>
+<script type="text/javascript">//<![CDATA[
+jQuery(document).ready(function() {
+	jQuery("#tabber").tabs();
+});
+//]]></script>
 <form id="trackermodform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>" enctype="multipart/form-data" method="post">
 <input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
 <input type="hidden" name="func" value="postmod" />
@@ -208,12 +212,32 @@ echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
 		</div>
 	</td></tr>
 </table>
-<div id="tabber" class="tabber">
+<div id="tabber" >
 <?php
 $count=db_numrows($ah->getMessages());
 $nb = $count? ' ('.$count.')' : '';
+$pm = new PluginManager();
+$pluginsListeners = $pm->GetHookListeners('artifact_extra_detail');
+$pluginfound = false;
+foreach ($pluginsListeners as $pluginsListener) {
+	if ($ath->Group->usesPlugin($pluginsListener)) {
+		$pluginfound = true;
+		break;
+	}
+}
 ?>
-<div class="tabbertab" title="<?php echo _('Comments').$nb; ?>">
+	<ul>
+	<li><a href="#tabber-comments"><?php echo _('Comments'); ?></a></li>
+	<?php if ($group->usesPM()) { ?>
+	<li><a href="#tabber-tasks"><?php echo _('Related Tasks'); ?></a></li>
+	<?php } ?>
+	<li><a href="#tabber-attachments"><?php echo _('Attachments'); ?></a></li>
+	<?php if ($pluginfound) { ?>
+	<li><a href="#tabber-commits"><?php echo _('Commits'); ?></a></li>
+	<?php } ?>
+	<li><a href="#tabber-changes"><?php echo _('Changes'); ?></a></li>
+	</ul>
+<div id="tabber-comments" class="tabbertab" title="<?php echo _('Comments').$nb; ?>">
 <table width="80%">
 	<tr><td colspan="2">
 		<br /><strong><?php echo _('Use Canned Response')._(':'); ?></strong><br />
@@ -252,7 +276,7 @@ $ah->showMessages();
 <?php
 if ($group->usesPM()) {
 ?>
-<div class="tabbertab" title="<?php echo _('Related Tasks'); ?>">
+<div id="tabber-tasks" class="tabbertab" title="<?php echo _('Related Tasks'); ?>">
 	<?php
 		$ath->renderRelatedTasks($group, $ah);
 	?>
@@ -264,7 +288,7 @@ $file_list = $ah->getFiles();
 $count=count($file_list);
 $nb = $count? ' ('.$count.')' : '';
 ?>
-<div class="tabbertab" title="<?php echo _('Attachments').$nb; ?>">
+<div id="tabber-attachments" class="tabbertab" title="<?php echo _('Attachments').$nb; ?>">
 <h2><?php echo _('Existing Files')._(':'); ?></h2>
 <table width="80%">
 	<tr><td colspan="2">
@@ -283,7 +307,8 @@ $nb = $count? ' ('.$count.')' : '';
 	</td></tr>
 </table>
 </div>
-<div class="tabbertab" title="<?php echo _('Commits'); ?>">
+<?php if ($pluginfound) { ?>
+<div id="tabber-commits" class="tabbertab" title="<?php echo _('Commits'); ?>">
 <table width="80%">
 <tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
 	<?php
@@ -293,7 +318,8 @@ $nb = $count? ' ('.$count.')' : '';
 	?>
 </table>
 </div>
-<div class="tabbertab" title="<?php echo _('Changes'); ?>">
+<?php } ?>
+<div id="tabber-changes" class="tabbertab" title="<?php echo _('Changes'); ?>">
 	<h2><?php echo _('Changes') ?></h2>
 	<?php $ah->showHistory(); ?>
 </div>

commit fb3555d6fc840422b0eaa104c954b7c80defb997
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 27 11:18:03 2014 +0100

    tracker: detail, display commit only if artifact_extra_detail hook is used

diff --git a/src/common/tracker/actions/detail.php b/src/common/tracker/actions/detail.php
index bbfb544..0b96ef1 100644
--- a/src/common/tracker/actions/detail.php
+++ b/src/common/tracker/actions/detail.php
@@ -143,12 +143,23 @@ jQuery(document).ready(function() {
 <?php
 $count=db_numrows($ah->getMessages());
 $nb = $count? ' ('.$count.')' : '';
+$pm = new PluginManager();
+$pluginsListeners = $pm->GetHookListeners('artifact_extra_detail');
+$pluginfound = false;
+foreach ($pluginsListeners as $pluginsListener) {
+	if ($ath->Group->usesPlugin($pluginsListener)) {
+		$pluginfound = true;
+		break;
+	}
+}
 ?>
 <div id="tabber">
 	<ul>
 	<li><a href="#tabber-comments"><?php echo _('Comments'); ?></a></li>
 	<li><a href="#tabber-attachments"><?php echo _('Attachments'); ?></a></li>
+	<?php if ($pluginfound) { ?>
 	<li><a href="#tabber-commits"><?php echo _('Commits'); ?></a></li>
+	<?php } ?>
 	<li><a href="#tabber-changes"><?php echo _('Changes'); ?></a></li>
 	</ul>
 	<div id="tabber-comments" class="tabbertab" title="<?php echo _('Comments').$nb; ?>">
@@ -196,6 +207,9 @@ $nb = $count? ' ('.$count.')' : '';
 		?>
 	</table>
 	</div>
+<?php
+	if ($pluginfound) {
+?>
 	<div id="tabber-commits" class="tabbertab" title="<?php echo _('Commits'); ?>" >
 	<table width="80%">
 	<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
@@ -206,6 +220,9 @@ $nb = $count? ' ('.$count.')' : '';
 		?>
 	</table>
 	</div>
+<?php
+	}
+?>
 	<div id="tabber-changes" class="tabbertab" title="<?php echo _('Changes'); ?>">
 		<?php $ah->showHistory(); ?>
 	</div>

commit 176716b06c48b9137320b6704831099146ef5e11
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 27 11:17:33 2014 +0100

    PluginManager: add GetHookListeners helper: return array of listening plugins of a specific hookname

diff --git a/src/common/include/PluginManager.class.php b/src/common/include/PluginManager.class.php
index c5a472c..53d3fa5 100644
--- a/src/common/include/PluginManager.class.php
+++ b/src/common/include/PluginManager.class.php
@@ -3,6 +3,7 @@
  * FusionForge plugin system
  *
  * Copyright 2002, 2009, Roland Mas
+ * Copyright 2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -290,6 +291,20 @@ class PluginManager extends Error {
 		}
 	}
 
+	/**
+	 * GetHookListeners() - list of plugins listening on a particular hook
+	 *
+	 * @param	string	$hookname	name of the hook
+	 * @return	array	array of plugin names, listening for this hookname
+	 */
+	function GetHookListeners($hookname) {
+		if (isset($this->hooks_to_plugins[$hookname])) {
+			return $this->hooks_to_plugins[$hookname];
+		} else {
+			return array();
+		}
+	}
+
 	function isPluginAllowedForProject($p, $group_id) {
 		$Group = group_get_object($group_id);
 		return $Group->usesPlugin($p->getName());

commit 8bcc2148847a1905c3683b3b6fd055f64bdb85d4
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 27 10:34:53 2014 +0100

    [#638]: migration tabber.js : tracker detail now use jquery tabs

diff --git a/src/common/tracker/actions/detail.php b/src/common/tracker/actions/detail.php
index 8f2acde..bbfb544 100644
--- a/src/common/tracker/actions/detail.php
+++ b/src/common/tracker/actions/detail.php
@@ -29,7 +29,7 @@ global $ah;
 global $group_id;
 global $aid;
 
-use_javascript('/tabber/tabber.js');
+html_use_jqueryui();
 html_use_coolfieldset();
 
 $ath->header(array ('title'=> $ah->getStringID().' '. $ah->getSummary(), 'atid'=>$ath->getID()));
@@ -37,6 +37,13 @@ $ath->header(array ('title'=> $ah->getStringID().' '. $ah->getSummary(), 'atid'=
 echo notepad_func();
 
 ?>
+
+<script type="text/javascript">//<![CDATA[
+jQuery(document).ready(function() {
+	jQuery("#tabber").tabs();
+});
+//]]></script>
+
 	<form id="trackerdetailform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>" method="post" enctype="multipart/form-data">
 
 <?php if (session_loggedin()) { ?>
@@ -133,73 +140,75 @@ echo notepad_func();
 			<?php $ah->showDetails(); ?>
 		</td></tr>
 </table>
-<div id="tabber" class="tabber">
 <?php
 $count=db_numrows($ah->getMessages());
 $nb = $count? ' ('.$count.')' : '';
 ?>
-<div class="tabbertab" title="<?php echo _('Comments').$nb; ?>">
-	<table width="80%">
-		<tr><td colspan="2">
-			<?php if (forge_check_perm ('tracker',$ath->getID(),'submit')) { ?>
-			<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
-			<input type="hidden" name="func" value="postmod" />
-			<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
-			<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>" />
-			<p>
-			<strong><?php echo _('Add A Comment')._(':'); ?></strong>
-			<?php echo notepad_button('document.forms.trackerdetailform.details') ?><br />
-			<textarea name="details" rows="10" cols="60"></textarea>
-			</p>
-			<?php } ?>
-		</td></tr>
-		<tr><td colspan="2">
-		<h2><?php echo _('Comments')._(': '); ?></h2>
-		<?php $ah->showMessages(); ?>
-		</td></tr>
-</table>
-</div>
+<div id="tabber">
+	<ul>
+	<li><a href="#tabber-comments"><?php echo _('Comments'); ?></a></li>
+	<li><a href="#tabber-attachments"><?php echo _('Attachments'); ?></a></li>
+	<li><a href="#tabber-commits"><?php echo _('Commits'); ?></a></li>
+	<li><a href="#tabber-changes"><?php echo _('Changes'); ?></a></li>
+	</ul>
+	<div id="tabber-comments" class="tabbertab" title="<?php echo _('Comments').$nb; ?>">
+		<table width="80%">
+			<tr><td colspan="2">
+				<?php if (forge_check_perm ('tracker',$ath->getID(),'submit')) { ?>
+				<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
+				<input type="hidden" name="func" value="postmod" />
+				<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
+				<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>" />
+				<p>
+				<strong><?php echo _('Add A Comment')._(':'); ?></strong>
+				<?php echo notepad_button('document.forms.trackerdetailform.details') ?><br />
+				<textarea name="details" rows="10" cols="60"></textarea>
+				</p>
+				<?php } ?>
+			</td></tr>
+			<tr><td colspan="2">
+			<?php $ah->showMessages(); ?>
+			</td></tr>
+	</table>
+	</div>
 <?php
 $tabcnt=0;
 $file_list = $ah->getFiles();
 $count=count($file_list);
 $nb = $count? ' ('.$count.')' : '';
 ?>
-<div class="tabbertab" title="<?php echo _('Attachments').$nb; ?>">
-<table width="80%">
-	<tr><td colspan="2">
-	<?php if (session_loggedin() && ($ah->getSubmittedBy() == user_getid())) { ?>
-		<strong><?php echo _('Attach Files')._(':'); ?></strong>  <?php echo('('._('max upload size: '.human_readable_bytes(util_get_maxuploadfilesize())).')') ?><br />
-		<input type="file" name="input_file0" /><br />
-		<input type="file" name="input_file1" /><br />
-		<input type="file" name="input_file2" /><br />
-		<input type="file" name="input_file3" /><br />
-		<input type="file" name="input_file4" /><br />
-	<?php } ?>
-	<h2><?php echo _('Attached Files')._(':'); ?></h2>
-	</td></tr>
-<?php
-	//
-	// print a list of files attached to this Artifact
-	//
-		$ath->renderFiles($group_id, $ah);
-	?>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Commits'); ?>" >
-<table width="80%">
-<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
+	<div id="tabber-attachments" class="tabbertab" title="<?php echo _('Attachments').$nb; ?>">
+	<table width="80%">
+		<tr><td colspan="2">
+		<?php if (session_loggedin() && ($ah->getSubmittedBy() == user_getid())) { ?>
+			<strong><?php echo _('Attach Files')._(':'); ?></strong>  <?php echo('('._('max upload size: '.human_readable_bytes(util_get_maxuploadfilesize())).')') ?><br />
+			<input type="file" name="input_file0" /><br />
+			<input type="file" name="input_file1" /><br />
+			<input type="file" name="input_file2" /><br />
+			<input type="file" name="input_file3" /><br />
+			<input type="file" name="input_file4" /><br />
+		<?php } ?>
 	<?php
-		$hookParams['artifact_id'] = $aid;
-		$hookParams['group_id'] = $group_id;
-		plugin_hook("artifact_extra_detail",$hookParams);
-	?>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Changes'); ?>">
-	<h2><?php echo _('Changes') ?></h2>
-	<?php $ah->showHistory(); ?>
-</div>
+		//
+		// print a list of files attached to this Artifact
+		//
+			$ath->renderFiles($group_id, $ah);
+		?>
+	</table>
+	</div>
+	<div id="tabber-commits" class="tabbertab" title="<?php echo _('Commits'); ?>" >
+	<table width="80%">
+	<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
+		<?php
+			$hookParams['artifact_id'] = $aid;
+			$hookParams['group_id'] = $group_id;
+			plugin_hook("artifact_extra_detail",$hookParams);
+		?>
+	</table>
+	</div>
+	<div id="tabber-changes" class="tabbertab" title="<?php echo _('Changes'); ?>">
+		<?php $ah->showHistory(); ?>
+	</div>
 	<?php $ah->showRelations(); ?>
 </div>
 </form>

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

Summary of changes:
 src/common/include/PluginManager.class.php |   15 +++
 src/common/tracker/actions/browse.php      |   23 ++++-
 src/common/tracker/actions/detail.php      |  140 +++++++++++++++++-----------
 src/common/tracker/actions/mod-limited.php |   62 ++++++++----
 src/common/tracker/actions/mod.php         |   42 +++++++--
 src/www/include/login-form.php             |   29 ++++--
 src/www/themes/funky-wOw/Theme.class.php   |    7 +-
 src/www/themes/funky/Theme.class.php       |    7 +-
 8 files changed, 222 insertions(+), 103 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list