[Fusionforge-commits] FusionForge branch master updated. v6.0.5-1286-g73d142d

Franck Villaume nerville at libremir.placard.fr.eu.org
Mon Dec 26 02:06:11 CET 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  73d142dbe4b4a17b28b85ef951d2f605b8ff58fd (commit)
      from  878d835b1b1bb2163ce8412bdca6d735c484f31a (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=73d142dbe4b4a17b28b85ef951d2f605b8ff58fd

commit 73d142dbe4b4a17b28b85ef951d2f605b8ff58fd
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Mon Dec 26 02:05:46 2016 +0100

    Artifact Display Widget: make preference edition more generic.

diff --git a/src/common/widget/Widget_TrackerContent.class.php b/src/common/widget/Widget_TrackerContent.class.php
index 8e6973b..cd44cea 100644
--- a/src/common/widget/Widget_TrackerContent.class.php
+++ b/src/common/widget/Widget_TrackerContent.class.php
@@ -451,7 +451,12 @@ class Widget_TrackerContent extends Widget {
 	function getPreferencesForm($layout_id, $owner_id, $owner_type) {
 		global $HTML;
 		global $aid;
-		$prefs  = $HTML->openForm(array('method' => 'post', 'action' => '/widgets/widget.php?owner='.$owner_type.$owner_id.'&action=update&name['.$this->id.']='.$this->getInstanceId().'&content_id='.$this->getInstanceId().'&layout_id='.$layout_id.'&func=detail&aid='.$aid));
+		global $func;
+		$url = '/widgets/widget.php?owner='.$owner_type.$owner_id.'&action=update&name['.$this->id.']='.$this->getInstanceId().'&content_id='.$this->getInstanceId().'&layout_id='.$layout_id.'&func='.$func;
+		if ($aid) {
+			$url .= '&aid='.$aid;
+		}
+		$prefs  = $HTML->openForm(array('method' => 'post', 'action' => $url));
 		$prefs .= html_ao('fieldset').html_e('legend', array(), _('Preferences'));
 		$prefs .= $this->getPreferences();
 		$prefs .= html_e('br');
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index b8f4f44..e5ac4b7 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -1411,8 +1411,10 @@ if (isset($params['group']) && $params['group']) {
 			if (strlen($widget->hasPreferences())) {
 				$url = '/widgets/updatelayout.php?owner='.$owner_type.$owner_id.'&action=preferences&name['.$widget->id.']='.$widget->getInstanceId().'&layout_id='.$layout_id;
 				if ($owner_type == WidgetLayoutManager::OWNER_TYPE_TRACKER) {
-					global $aid;
-					$url .= '&func=detail&aid='.$aid;
+					$url .= '&func='.getStringFromRequest('func');
+					if (getIntFromRequest('aid')) {
+						$url .= '&aid='.getIntFromRequest('aid');
+					}
 				}
 				echo html_e('div', array('class' => 'widget_titlebar_prefs'), util_make_link($url, _('Preferences')));
 			}
diff --git a/src/www/widgets/updatelayout.php b/src/www/widgets/updatelayout.php
index 094ed5e..86855ab 100644
--- a/src/www/widgets/updatelayout.php
+++ b/src/www/widgets/updatelayout.php
@@ -70,8 +70,11 @@ if ($owner) {
 				$_REQUEST['group_id'] = $_GET['group_id'] = $at->Group->getID();
 				$request->params['group_id'] = $at->Group->getID(); //bad!
 				$redirect = '/tracker/?group_id='.$at->Group->getID().'&atid='.$at->getID();
-				if ($request->get('func') == 'detail' && $request->get('aid')) {
-					$redirect .= '&func=detail&aid='.$request->get('aid');
+				if ((strlen($request->get('func')) > 0)) {
+					$redirect .= '&func='.$request->get('func');
+					if ($request->get('aid')) {
+						$redirect .= '&aid='.$request->get('aid');
+					}
 				}
 				if (!forge_check_global_perm('forge_admin') && !forge_check_perm('tracker_admin', $at->getID())) {
 					$GLOBALS['Response']->redirect($redirect);
@@ -104,7 +107,6 @@ if ($owner) {
 										} elseif (($owner_type == WidgetLayoutManager::OWNER_TYPE_HOME) && (forge_check_global_perm('forge_admin'))) {
 												$lm->removeWidget($owner_id, $owner_type, $layout_id, $name, $instance_id, $widget);
 										} elseif (($owner_type == WidgetLayoutManager::OWNER_TYPE_TRACKER) && (forge_check_perm('tracker_admin', $owner_id))) {
-												error_log('ici');
 												$lm->removeWidget($owner_id, $owner_type, $layout_id, $name, $instance_id, $widget);
 										} else {
 											$lm->removeWidget($owner_id, $owner_type, $layout_id, $name, $instance_id, $widget);
diff --git a/src/www/widgets/widget.php b/src/www/widgets/widget.php
index aa275d9..e0c4449 100644
--- a/src/www/widgets/widget.php
+++ b/src/www/widgets/widget.php
@@ -64,8 +64,11 @@ if ($request->valid($vOwner)) {
 				$_REQUEST['group_id'] = $_GET['group_id'] = $at->Group->getID();
 				$request->params['group_id'] = $at->Group->getID(); //bad!
 				$redirect = '/tracker/?group_id='.$at->Group->getID().'&atid='.$at->getID();
-				if ($request->get('func') == 'detail' && $request->get('aid')) {
-					$redirect .= '&func=detail&aid='.$request->get('aid');
+				if ((strlen($request->get('func')) > 0)) {
+					$redirect .= '&func='.$request->get('func');
+					if ($request->get('aid')) {
+						$redirect .= '&aid='.$request->get('aid');
+					}
 				}
 				if (!forge_check_global_perm('forge_admin') && !forge_check_perm('tracker_admin', $at->getID())) {
 					$GLOBALS['Response']->redirect($redirect);

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

Summary of changes:
 src/common/widget/Widget_TrackerContent.class.php | 7 ++++++-
 src/www/include/Layout.class.php                  | 6 ++++--
 src/www/widgets/updatelayout.php                  | 8 +++++---
 src/www/widgets/widget.php                        | 7 +++++--
 4 files changed, 20 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list