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 b05b3b8069b2ac010a77d8036b67cd87ba469da6 (commit)
from a067610301d2f45e2f26c9168ecce64e5992e5f4 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=b05b3b8069b2ac010a77d8036b67cd87ba469da6
commit b05b3b8069b2ac010a77d8036b67cd87ba469da6
Author: Franck Villaume <[email protected]>
Date: Tue Nov 8 20:14:51 2016 +0100
display number of associations in tab label
diff --git a/src/common/frs/views/shownotes.php
b/src/common/frs/views/shownotes.php
index 508b94d..df74210 100644
--- a/src/common/frs/views/shownotes.php
+++ b/src/common/frs/views/shownotes.php
@@ -54,7 +54,11 @@ if (forge_get_config('use_object_associations')) {
echo html_ao('div', array('id' => 'tabber'));
$elementsLi = array();
$elementsLi[] = array('content' => util_make_link('#tabber-changelog',
_('Change Log & Notes'), array('title' => _('View Changelog & Notes.')), true));
- $elementsLi[] = array('content' =>
util_make_link('#tabber-association', _('Associations'), array('title' =>
_('View Associated Objects.')), true));
+ $anf = '';
+ if ($frsr->getAssociationCounter()) {
+ $anf = ' ('.$frsr->getAssociationCounter().')';
+ }
+ $elementsLi[] = array('content' =>
util_make_link('#tabber-association', _('Associations').$anf, array('title' =>
_('View Associated Objects.')), true));
echo $HTML->html_list($elementsLi);
echo html_ao('div', array('id' => 'tabber-changelog', 'class' =>
'tabbertab'));
}
diff --git a/src/common/include/FFObject.class.php
b/src/common/include/FFObject.class.php
index bccc39b..83ad6fe 100644
--- a/src/common/include/FFObject.class.php
+++ b/src/common/include/FFObject.class.php
@@ -48,6 +48,12 @@ class FFObject extends FFError {
*/
var $associatedFromArray = array();
+ /**
+ *
+ * @var int $associationCounter
+ */
+ var $associationCounter = 0;
+
function __construct($id = false, $objectType = false) {
parent::__construct();
if (forge_get_config('use_object_associations') && $id &&
$objectType) {
@@ -56,6 +62,7 @@ class FFObject extends FFError {
if ($res && db_numrows($res)) {
while ($arr = db_fetch_array($res)) {
$this->associatedToArray[$arr[0]][$arr[1]][] = $arr[2];
+ $this->associationCounter++;
}
}
$res = db_query_params('SELECT from_object_type,
from_ref_id, from_id FROM fusionforge_object_assiociation WHERE to_id = $1 AND
to_object_type = $2',
@@ -63,6 +70,7 @@ class FFObject extends FFError {
if ($res && db_numrows($res)) {
while ($arr = db_fetch_array($res)) {
$this->associatedFromArray[$arr[0]][$arr[1]][] = $arr[2];
+ $this->associationCounter++;
}
}
}
@@ -77,6 +85,10 @@ class FFObject extends FFError {
return $this->associatedFromArray;
}
+ function getAssociationCounter() {
+ return $this->associationCounter;
+ }
+
function getRefID($object) {
switch (get_class($object)) {
case 'Document':
diff --git a/src/common/tracker/actions/detail.php
b/src/common/tracker/actions/detail.php
index 0e2d78f..cbe8239 100644
--- a/src/common/tracker/actions/detail.php
+++ b/src/common/tracker/actions/detail.php
@@ -156,8 +156,12 @@ foreach ($pluginsListeners as $pluginsListener) {
<?php if ($ah->hasRelations()) { ?>
<li><a href="#tabber-relations"><?php echo _('Relations'); ?></a></li>
<?php } ?>
- <?php if (forge_get_config('use_object_associations')) { ?>
- <li><a href="#tabber-object-associations"><?php echo _('Associations');
?></a></li>
+ <?php if (forge_get_config('use_object_associations')) {
+ $anf = '';
+ if ($this->getAssociationCounter()) {
+ $anf = ' ('.$this->getAssociationCounter().')';
+ } ?>
+ <li><a href="#tabber-object-associations"><?php echo
_('Associations').$anf; ?></a></li>
<?php } ?>
</ul>
<div id="tabber-comments" class="tabbertab">
diff --git a/src/common/tracker/actions/mod-limited.php
b/src/common/tracker/actions/mod-limited.php
index c312aba..dbb0160 100644
--- a/src/common/tracker/actions/mod-limited.php
+++ b/src/common/tracker/actions/mod-limited.php
@@ -185,8 +185,12 @@ foreach ($pluginsListeners as $pluginsListener) {
<?php if ($ah->hasRelations()) { ?>
<li><a href="#tabber-relations"><?php echo _('Relations'); ?></a></li>
<?php } ?>
- <?php if (forge_get_config('use_object_associations')) { ?>
- <li><a href="#tabber-object-associations"><?php echo _('Associations');
?></a></li>
+ <?php if (forge_get_config('use_object_associations')) {
+ $anf = '';
+ if ($this->getAssociationCounter()) {
+ $anf = ' ('.$this->getAssociationCounter().')';
+ } ?>
+ <li><a href="#tabber-object-associations"><?php echo
_('Associations').$anf; ?></a></li>
<?php } ?>
</ul>
<div id="tabber-comments" class="tabbertab">
diff --git a/src/common/tracker/actions/mod.php
b/src/common/tracker/actions/mod.php
index fbfaa61..209ed3a 100644
--- a/src/common/tracker/actions/mod.php
+++ b/src/common/tracker/actions/mod.php
@@ -225,8 +225,12 @@ foreach ($pluginsListeners as $pluginsListener) {
<?php if ($ah->hasRelations()) { ?>
<li><a href="#tabber-relations"><?php echo _('Relations'); ?></a></li>
<?php } ?>
- <?php if (forge_get_config('use_object_associations')) { ?>
- <li><a href="#tabber-object-associations"><?php echo _('Associations');
?></a></li>
+ <?php if (forge_get_config('use_object_associations')) {
+ $anf = '';
+ if ($this->getAssociationCounter()) {
+ $anf = ' ('.$this->getAssociationCounter().')';
+ } ?>
+ <li><a href="#tabber-object-associations"><?php echo
_('Associations').$anf; ?></a></li>
<?php } ?>
</ul>
<div id="tabber-comments" class="tabbertab">
-----------------------------------------------------------------------
Summary of changes:
src/common/frs/views/shownotes.php | 6 +++++-
src/common/include/FFObject.class.php | 12 ++++++++++++
src/common/tracker/actions/detail.php | 8 ++++++--
src/common/tracker/actions/mod-limited.php | 8 ++++++--
src/common/tracker/actions/mod.php | 8 ++++++--
5 files changed, 35 insertions(+), 7 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits