[Fusionforge-commits] FusionForge branch master updated. 6.0.4-1093-gfb87874

Franck Villaume nerville at libremir.placard.fr.eu.org
Sun Oct 23 19:03:50 CEST 2016


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  fb878748146dd39aef85af4cfc121b5906287ebc (commit)
      from  13b718c26c8adfd364f8bda713f602549764ec72 (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=fb878748146dd39aef85af4cfc121b5906287ebc

commit fb878748146dd39aef85af4cfc121b5906287ebc
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Oct 23 19:03:33 2016 +0200

    Association: support display in Document

diff --git a/src/common/docman/views/editfile.php b/src/common/docman/views/editfile.php
index 86f7358..8409fce 100644
--- a/src/common/docman/views/editfile.php
+++ b/src/common/docman/views/editfile.php
@@ -48,7 +48,8 @@ jQuery(document).ready(function() {
 		buttonFile:		jQuery('#editButtonFile'),
 		buttonUrl:		jQuery('#editButtonUrl'),
 		buttonManualUpload:	jQuery('#editButtonManualUpload'),
-		buttonEditor:		jQuery('#editButtonEditor')
+		buttonEditor:		jQuery('#editButtonEditor'),
+		divAssociation:		jQuery('#tabbereditfile-association')
 	});
 });
 
@@ -66,6 +67,14 @@ $cells[] = array(_('State')._(':'), 'class' => 'docman_editfile_title');
 $cells[][] = html_e('select', array('name' => 'stateid', 'id' => 'stateid'), '', false);
 echo $HTML->multiTableRow(array(), $cells);
 echo $HTML->listTableBottom();
+if (forge_get_config('use_object_associations')) {
+	echo html_ao('div', array('id' => 'tabbereditfile'));
+	$elementsLi = array();
+	$elementsLi[] = array('content' => util_make_link('#tabbereditfile-version', _('Edit Versions'), array('title' => _('View/Add/Remove document version.')), true));
+	$elementsLi[] = array('content' => util_make_link('#tabbereditfile-association', _('Associations'), array('title' => _('Add/Remove associated objects.')), true));
+	echo $HTML->html_list($elementsLi);
+	echo html_ao('div', array('id' => 'tabbereditfile-version', 'class' => 'tabbertab'));
+}
 $thArr = array(_('ID (x)'), _('Filename'), _('Title'), _('Description'), _('Comment'), _('Author'), _('Last Time'), _('Size'), _('Actions'));
 $thTitle = array(_('x does mark the current version'), '', '', '', '', '', '', '', '', '', '');
 $thSizeCssArr = array(array('style' => 'width: 60px'), array('style' => 'width: 150px'), array('style' => 'width: 150px'), array('style' => 'width: 150px'), array('style' => 'width: 110px'),
@@ -146,5 +155,15 @@ echo $HTML->listTableBottom();
 echo html_e('input', array('type' => 'hidden', 'id' => 'docid', 'name' => 'docid'));
 echo html_e('input', array('type' => 'hidden', 'id' => 'edit_version', 'name' => 'edit_version'));
 echo html_e('input', array('type' => 'hidden', 'id' => 'new_version', 'name' => 'new_version', 'value' => 0));
+if (forge_get_config('use_object_associations')) {
+	echo html_ac(html_ap() -1);
+	echo html_e('div', array('id' => 'tabbereditfile-association', 'class' => 'tabbertab'), '', false);
+	echo '<script type="text/javascript">//<![CDATA[
+			jQuery(document).ready(function() {
+				jQuery("#tabbereditfile").tabs();
+			});
+			//]]></script>';
+	echo html_ac(html_ap() -1);
+}
 echo $HTML->closeForm();
 echo html_ac(html_ap() -1);
diff --git a/src/common/frs/views/editrelease.php b/src/common/frs/views/editrelease.php
index 6333797..772b953 100644
--- a/src/common/frs/views/editrelease.php
+++ b/src/common/frs/views/editrelease.php
@@ -207,9 +207,9 @@ if ($g->usesTracker()) {
 if (forge_get_config('use_object_associations')) {
 	echo html_e('hr');
 	echo html_e('h2', array(), _('Associate Objects To/From This Release'));
-	$frsr->showAssociations('/frs/?action=deleteassociation&group_id='.$group_id.'&package_id='.$package_id.'&release_id='.$release_id);
+	echo $frsr->showAssociations('/frs/?action=deleteassociation&group_id='.$group_id.'&package_id='.$package_id.'&release_id='.$release_id);
 	echo $HTML->openForm(array('action' => '/frs/?action=addassociation&group_id='.$group_id.'&package_id='.$package_id.'&release_id='.$release_id, 'method' => 'post'));
-	$frsr->showAddAssociations();
+	echo $frsr->showAddAssociations();
 	echo html_e('input', array('type' => 'submit', 'name' => 'submit', 'value' => _('Associate Objects')));
 	echo $HTML->closeForm();
 }
diff --git a/src/common/frs/views/shownotes.php b/src/common/frs/views/shownotes.php
index 7b88af3..508b94d 100644
--- a/src/common/frs/views/shownotes.php
+++ b/src/common/frs/views/shownotes.php
@@ -83,7 +83,6 @@ if (strlen($frsr->getChanges())) {
 
 if (forge_get_config('use_object_associations')) {
 	echo html_ac(html_ap() -1);
-	echo html_ao('div', array('id' => 'tabber-association', 'class' => 'tabbertab'));
-	echo $frsr->showAssociations();
-	echo html_ac(html_ap() -2);
+	echo html_e('div', array('id' => 'tabber-association', 'class' => 'tabbertab'), $frsr->showAssociations());
+	echo html_ac(html_ap() -1);
 }
diff --git a/src/common/include/FFObject.class.php b/src/common/include/FFObject.class.php
index e94fd6e..b4e8e0f 100644
--- a/src/common/include/FFObject.class.php
+++ b/src/common/include/FFObject.class.php
@@ -274,6 +274,7 @@ class FFObject extends FFError {
 	function showAssociations($url = false) {
 		global $HTML;
 		$displayHeader = false;
+		$content = '';
 		if (count($this->getAssociatedTo()) > 0) {
 			foreach ($this->getAssociatedTo() as $objectType => $objectRefIds) {
 				foreach ($objectRefIds as $objectRefId => $objectIds) {
@@ -282,11 +283,11 @@ class FFObject extends FFError {
 							$tabletop = array('', _('Associated Object'), _('Associated Object ID'));
 							$classth = array('', '', '');
 							if ($url !== false) {
-								echo html_e('p', array(), _('Remove all associations')._(': ').util_make_link($url.'&link=any', $HTML->getDeletePic(_('Drop all associated from and to objects.'))));
+								$content .= html_e('p', array(), _('Remove all associations')._(': ').util_make_link($url.'&link=any', $HTML->getDeletePic(_('Drop all associated from and to objects.'))));
 								$tabletop[] = _('Actions');
 								$classth[] = 'unsortable';
 							}
-							echo $HTML->listTableTop($tabletop, array(), 'sortable', 'sortable_association', $classth);
+							$content .= $HTML->listTableTop($tabletop, array(), 'sortable', 'sortable_association', $classth);
 							$displayHeader = true;
 						}
 						foreach ($objectIds as $objectId) {
@@ -297,7 +298,7 @@ class FFObject extends FFError {
 							if ($url !== false) {
 								$cells[][] = util_make_link($url.'&link=to&objecttype='.$objectType.'&objectrefid='.$objectRefId.'&objectid='.$objectId, $HTML->getDeletePic(_('Remove this association'), _('Remove this association')));
 							}
-							echo $HTML->multiTableRow(array(), $cells);
+							$content .= $HTML->multiTableRow(array(), $cells);
 						}
 					}
 				}
@@ -311,11 +312,11 @@ class FFObject extends FFError {
 							$tabletop = array('', _('Associated Object'), _('Associated Object ID'));
 							$classth = array('', '', '');
 							if ($url !== false) {
-								echo html_e('p', array(), util_make_link($url.'&link=any', $HTML->getDeletePic(_('Remove all associations'), _('Remove all associations'))));
+								$content .= html_e('p', array(), util_make_link($url.'&link=any', $HTML->getDeletePic(_('Remove all associations'), _('Remove all associations'))));
 								$tabletop[] = _('Actions');
 								$classth[] = 'unsortable';
 							}
-							echo $HTML->listTableTop($tabletop, array(), 'sortable', 'sortable_association', $classth);
+							$content .= $HTML->listTableTop($tabletop, array(), 'sortable', 'sortable_association', $classth);
 							$displayHeader = true;
 						}
 						foreach ($objectIds as $objectId) {
@@ -326,29 +327,32 @@ class FFObject extends FFError {
 							if ($url !== false) {
 								$cells[][] = util_make_link($url.'&link=from&objecttype='.$objectType.'&objectRefId='.$objectRefId.'&objectId='.$objectId, $HTML->getDeletePic(_('Remove this association'), _('Remove this association')));
 							}
-							echo $HTML->multiTableRow(array(), $cells);
+							$content .= $HTML->multiTableRow(array(), $cells);
 						}
 					}
 				}
 			}
 		}
 		if ($displayHeader) {
-			echo $HTML->listTableBottom();
+			$content .= $HTML->listTableBottom();
 		} else {
-			echo $HTML->information(_('No associated object.'));
+			$content .= $HTML->information(_('No associated object.'));
 		}
+		return $content;
 	}
 
 	function showAddAssociations($url = false) {
 		global $HTML;
+		$content = '';
 		echo _('Add new associate object')._(':');
 		if ($url !== false) {
-			echo $HTML->openForm(array('action' => $url, 'method' => 'post'));
+			$content .= $HTML->openForm(array('action' => $url, 'method' => 'post'));
 		}
-		echo html_e('input', array('type' => 'text', 'value' => '', 'name' => 'newobjectsassociation', 'title' => _('Use standard reference such #nnn, Dnnn, to add object association. Comma separeted')));
+		$content .= html_e('input', array('type' => 'text', 'value' => '', 'name' => 'newobjectsassociation', 'title' => _('Use standard reference such #nnn, Dnnn, to add object association. Comma separeted')));
 		if ($url !== false) {
-			echo html_e('input', array('type' => 'submit', 'value' => _('Add')));
-			echo $HTML->closeForm();
+			$content .= html_e('input', array('type' => 'submit', 'value' => _('Add')));
+			$content .= $HTML->closeForm();
 		}
+		return $content;
 	}
 }
diff --git a/src/common/tracker/actions/detail.php b/src/common/tracker/actions/detail.php
index 8d00de9..0e2d78f 100644
--- a/src/common/tracker/actions/detail.php
+++ b/src/common/tracker/actions/detail.php
@@ -233,10 +233,10 @@ if ($group->usesPM()) {
 	<?php if (forge_get_config('use_object_associations')) { ?>
 	<div id="tabber-object-associations" class="tabbertab">
 	<?php if (forge_check_perm ('tracker',$ath->getID(),'submit')) {
-		$ah->showAssociations('/tracker/?rtype=ajax&aid='.$ah->getID().'&group_id='.$ath->Group->getID().'&atid='.$ath->getID().'&func=removeassoc');
-		$ah->showAddAssociations();
+			echo $ah->showAssociations('/tracker/?rtype=ajax&aid='.$ah->getID().'&group_id='.$ath->Group->getID().'&atid='.$ath->getID().'&func=removeassoc');
+			echo $ah->showAddAssociations();
 		} else {
-		$ah->showAssociations();
+			echo $ah->showAssociations();
 		} ?>
 	</div>
 	<?php } ?>
diff --git a/src/common/tracker/actions/mod-limited.php b/src/common/tracker/actions/mod-limited.php
index 859a579..c312aba 100644
--- a/src/common/tracker/actions/mod-limited.php
+++ b/src/common/tracker/actions/mod-limited.php
@@ -250,10 +250,10 @@ if ($group->usesPM()) {
 <?php if (forge_get_config('use_object_associations')) { ?>
 <div id="tabber-object-associations" class="tabbertab">
 	<?php if (forge_check_perm ('tracker',$ath->getID(),'submit')) {
-		$ah->showAssociations('/tracker/?rtype=ajax&aid='.$ah->getID().'&group_id='.$ath->Group->getID().'&atid='.$ath->getID().'&func=removeassoc');
-		$ah->showAddAssociations();
+			echo $ah->showAssociations('/tracker/?rtype=ajax&aid='.$ah->getID().'&group_id='.$ath->Group->getID().'&atid='.$ath->getID().'&func=removeassoc');
+			echo $ah->showAddAssociations();
 		} else {
-		$ah->showAssociations();
+			echo $ah->showAssociations();
 		} ?>
 </div>
 <?php } ?>
diff --git a/src/common/tracker/actions/mod.php b/src/common/tracker/actions/mod.php
index c9e83ea..fbfaa61 100644
--- a/src/common/tracker/actions/mod.php
+++ b/src/common/tracker/actions/mod.php
@@ -311,10 +311,10 @@ if ($group->usesPM()) {
 	<?php if (forge_get_config('use_object_associations')) { ?>
 	<div id="tabber-object-associations" class="tabbertab">
 	<?php if (forge_check_perm ('tracker',$ath->getID(),'submit')) {
-		$ah->showAssociations('/tracker/?func=removeassoc&aid='.$ah->getID().'&group_id='.$ath->Group->getID().'&atid='.$ath->getID());
-		$ah->showAddAssociations();
+			echo $ah->showAssociations('/tracker/?func=removeassoc&aid='.$ah->getID().'&group_id='.$ath->Group->getID().'&atid='.$ath->getID());
+			echo $ah->showAddAssociations();
 		} else {
-		$ah->showAssociations();
+			echo $ah->showAssociations();
 		} ?>
 	</div>
 	<?php } ?>
diff --git a/src/www/docman/scripts/DocManController.js b/src/www/docman/scripts/DocManController.js
index 2f019e4..b01ae10 100644
--- a/src/www/docman/scripts/DocManController.js
+++ b/src/www/docman/scripts/DocManController.js
@@ -440,6 +440,15 @@ DocManListFileController.prototype =
 				}
 			}, this));
 
+		jQuery.getJSON(this.listfileparams.docManURL + '/?group_id=' + docid_groupid + '&action=getassociations&docid='+ this.docparams.id, jQuery.proxy(function(data){
+			if (typeof data.html != 'undefined') {
+					jQuery('#tabbereditfile-association > .feedback').remove();
+					jQuery('#tabbereditfile-association > .error').remove();
+					jQuery('#tabbereditfile-association > .warning_msg').remove();
+					jQuery('#tabbereditfile-association').prepend(data.html);
+				}
+			}, this));
+
 		jQuery('#editdocdata').attr('action', this.docparams.action);
 
 		jQuery.get(this.docparams.docManURL+'/', {

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

Summary of changes:
 src/common/docman/views/editfile.php       | 21 ++++++++++++++++++++-
 src/common/frs/views/editrelease.php       |  4 ++--
 src/common/frs/views/shownotes.php         |  5 ++---
 src/common/include/FFObject.class.php      | 28 ++++++++++++++++------------
 src/common/tracker/actions/detail.php      |  6 +++---
 src/common/tracker/actions/mod-limited.php |  6 +++---
 src/common/tracker/actions/mod.php         |  6 +++---
 src/www/docman/scripts/DocManController.js |  9 +++++++++
 8 files changed, 58 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list