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 acd1b9d1d310e126bb4f59735f393f68d3ee2c67 (commit)
via 1484375ddd167f9d9a0eb31ed3b3702f42f20f91 (commit)
from c414662e488115033840ab8bfff1140b20c4f0b5 (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=acd1b9d1d310e126bb4f59735f393f68d3ee2c67
commit acd1b9d1d310e126bb4f59735f393f68d3ee2c67
Author: Franck Villaume <[email protected]>
Date: Tue Dec 27 11:46:07 2016 +0100
artifact display widget: support clone from template tracker
diff --git a/src/common/tracker/actions/admin-updates.php
b/src/common/tracker/actions/admin-updates.php
index 5962d8f..e94fc21 100644
--- a/src/common/tracker/actions/admin-updates.php
+++ b/src/common/tracker/actions/admin-updates.php
@@ -24,6 +24,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+require_once $gfcommon.'widget/WidgetLayoutManager.class.php';
+
global $ath;
global $error_msg;
global $feedback;
@@ -395,11 +397,16 @@ if (getStringFromRequest('add_extrafield')) {
if (!$clone_id) {
exit_missing_param('',array(_('Clone ID')),'tracker');
}
- if (!$ath->cloneFieldsFrom($clone_id)) {
- exit_error(_('Error cloning fields:
').$ath->getErrorMessage(),'tracker');
- } else {
+ $newEFIds = $ath->cloneFieldsFrom($clone_id);
+ if (is_array($newEFIds)) {
+ if (forge_get_config('use_tracker_widget_display')) {
+ $lm = new WidgetLayoutManager();
+ $lm->createDefaultLayoutForTracker($ath->getID(),
$clone_id, $newEFIds);
+ }
$feedback .= _('Successfully Cloned Tracker Fields ');
$next = '*main*';
+ } else {
+ exit_error(_('Error cloning fields')._(':
').$ath->getErrorMessage(), 'tracker');
}
//
diff --git a/src/common/widget/WidgetLayoutManager.class.php
b/src/common/widget/WidgetLayoutManager.class.php
index 30fc41a..95eaa93 100644
--- a/src/common/widget/WidgetLayoutManager.class.php
+++ b/src/common/widget/WidgetLayoutManager.class.php
@@ -229,6 +229,16 @@ class WidgetLayoutManager {
if ($template_id) {
$res = db_query_params('SELECT layout_id FROM
owner_layouts WHERE owner_type = $1 AND owner_id = $2',
array(self::OWNER_TYPE_TRACKER, $template_id));
if ($res && db_numrows($res) == 1) {
+ $res = db_query_params('SELECT content_id FROM
layouts_contents WHERE content_id != $1 AND owner_type = $2 AND owner_id = $3',
array(0, 't', $owner_id));
+ if ($res && db_numrows($res) > 0) {
+ $contentIdArr =
util_result_column_to_array($res);
+ foreach ($contentIdArr as $contentId) {
+ db_query_params('DELETE FROM
artifact_display_widget_field WHERE id = $1', array($contentId));
+ db_query_params('DELETE FROM
artifact_display_widget WHERE id = $1 AND owner_id = $2', array($contentId,
$owner_id));
+ }
+ }
+ db_query_params('DELETE FROM layouts_contents
WHERE owner_id = $1 AND owner_type = $2', array($owner_id, 't'));
+ db_query_params('DELETE FROM owner_layouts
WHERE owner_id = $1 AND owner_type = $2', array($owner_id, 't'));
$res = db_query_params('INSERT INTO
owner_layouts(layout_id, is_default, owner_id, owner_type)
SELECT layout_id, is_default,
$1, owner_type
FROM owner_layouts
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=1484375ddd167f9d9a0eb31ed3b3702f42f20f91
commit 1484375ddd167f9d9a0eb31ed3b3702f42f20f91
Author: Franck Villaume <[email protected]>
Date: Tue Dec 27 11:10:50 2016 +0100
artifact display widget: fix menu access, fix defaultaction widget to be
able to reorganize the page on brand new tracker
diff --git a/src/common/tracker/actions/widget_artifact_display.php
b/src/common/tracker/actions/widget_artifact_display.php
index 5adfec5..96075a8 100644
--- a/src/common/tracker/actions/widget_artifact_display.php
+++ b/src/common/tracker/actions/widget_artifact_display.php
@@ -55,20 +55,6 @@ if ($func == 'add') {
$ath->header(array('title'=> $ah->getStringID().' '. $ah->getSummary(),
'atid'=>$ath->getID()));
}
-if (forge_check_perm('tracker_admin', $atid)) {
- $url = '/widgets/widgets.php?owner=t'.$atid.'&layout_id='.$id;
- $labels = array(_('Add widgets'), _('Customize Layout'));
- $urls = array($url, $url.'&update=layout');
- $attrs = array();
- $attrs[] = array('title' => _('Customfields must be linked to a widget
to be displayed. Use “Add widgets” to create new widget to link and organize
your customfields.'));
- $attrs[] = array('title' => _('General layout to display “Submit New”
form or detailed view of an existing artifact can be customize. Use “Customize
Layout” to that purpose.'));
- $elementsLi = array();
- for ($i = 0; $i < count($urls); $i++) {
- $elementsLi[] = array('content' => util_make_link($urls[$i],
$labels[$i]), 'attrs' => $attrs[$i]);
- }
- echo $HTML->html_list($elementsLi, array('class' => 'widget_toolbar'));
-}
-
echo $HTML->openForm(array('id' => 'trackerform', 'name' => 'trackerform',
'action' => '/tracker/?group_id='.$group_id.'&atid='.$ath->getID(), 'enctype'
=> 'multipart/form-data', 'method' => 'post'));
echo html_e('input', array('type' => 'hidden', 'name' => 'form_key', 'value'
=> form_generate_key(), 'form' => 'trackerform'));
if ($func == 'add') {
diff --git a/src/common/tracker/include/ArtifactTypeHtml.class.php
b/src/common/tracker/include/ArtifactTypeHtml.class.php
index 153a587..52cdd7e 100644
--- a/src/common/tracker/include/ArtifactTypeHtml.class.php
+++ b/src/common/tracker/include/ArtifactTypeHtml.class.php
@@ -32,6 +32,7 @@ require_once
$gfcommon.'tracker/ArtifactExtraFieldElement.class.php';
require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
require_once $gfcommon.'include/utils_crossref.php';
require_once $gfcommon.'include/UserManager.class.php';
+require_once $gfcommon.'widget/WidgetLayoutManager.class.php';
class ArtifactTypeHtml extends ArtifactType {
@@ -85,6 +86,27 @@ class ArtifactTypeHtml extends ArtifactType {
$labels[] = _('Administration');
$links[] =
'/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID();
$attr[] = array('title' => _('Global
administration for trackers. Create, clone, workflow, fields ...'));
+
+ if
(forge_get_config('use_tracker_widget_display')) {
+ $sql = "SELECT l.* FROM layouts AS l
INNER JOIN owner_layouts AS o ON(l.id = o.layout_id)
+ WHERE o.owner_type = $1
+ AND o.owner_id = $2
+ AND o.is_default = 1";
+ $res = db_query_params($sql,array('t',
$this->getID()));
+ if($res && db_numrows($res) < 1) {
+ $lm = new WidgetLayoutManager();
+
$lm->createDefaultLayoutForTracker($this->getID());
+ $res =
db_query_params($sql,array('t', $this->getID()));
+ }
+ $id = db_result($res, 0 , 'id');
+ $url =
'/widgets/widgets.php?owner=t'.$this->getID().'&layout_id='.$id;
+ $labels[] = _('Add widgets');
+ $labels[] = _('Customize Layout');
+ $attr[] = array('title' =>
_('Customfields must be linked to a widget to be displayed. Use “Add widgets”
to create new widget to link and organize your customfields.'));
+ $attr[] = array('title' => _('General
layout to display “Submit New” form or detailed view of an existing artifact
can be customize. Use “Customize Layout” to that purpose.'));
+ $links[] = $url;
+ $links[] = $url.'&update=layout';
+ }
}
}
diff --git a/src/common/tracker/views/form-updatetracker.php
b/src/common/tracker/views/form-updatetracker.php
index b08e13a..d107507 100644
--- a/src/common/tracker/views/form-updatetracker.php
+++ b/src/common/tracker/views/form-updatetracker.php
@@ -41,31 +41,6 @@ $ath->adminHeader(array('title'=>sprintf(_('Update settings
for %s'),
$ath->getName()),
'modal'=>1));
-if (forge_get_config('use_tracker_widget_display')) {
- $sql = "SELECT l.* FROM layouts AS l INNER JOIN owner_layouts AS o
ON(l.id = o.layout_id)
- WHERE o.owner_type = $1
- AND o.owner_id = $2
- AND o.is_default = 1";
- $res = db_query_params($sql,array('t', $atid));
- if($res && db_numrows($res) < 1) {
- $lm = new WidgetLayoutManager();
- $lm->createDefaultLayoutForTracker($atid);
- $res = db_query_params($sql,array('t', $atid));
- }
- $id = db_result($res, 0 , 'id');
- $url = '/widgets/widgets.php?owner=t'.$atid.'&layout_id='.$id;
- $labels = array(_('Add widgets'), _('Customize Layout'));
- $attrs = array();
- $attrs[] = array('title' => _('Customfields must be linked to a widget
to be displayed. Use “Add widgets” to create new widget to link and organize
your customfields.'));
- $attrs[] = array('title' => _('General layout to display “Submit New”
form or detailed view of an existing artifact can be customize. Use “Customize
Layout” to that purpose.'));
- $urls = array($url, $url.'&update=layout');
- $elementsLi = array();
- for ($i = 0; $i < count($urls); $i++) {
- $elementsLi[] = array('content' => util_make_link($urls[$i],
$labels[$i]), 'attrs' => $attrs[$i]);
- }
- echo $HTML->html_list($elementsLi, array('class' => 'widget_toolbar'));
-}
-
echo $HTML->openForm(array('action' =>
'/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID(), 'method' =>
'post'));
echo html_e('input', array('type'=>'hidden', 'name'=>'update_type',
'value'=>'y'));
diff --git a/src/common/widget/Widget_TrackerDefaultActions.class.php
b/src/common/widget/Widget_TrackerDefaultActions.class.php
index 147a563..76b78b8 100644
--- a/src/common/widget/Widget_TrackerDefaultActions.class.php
+++ b/src/common/widget/Widget_TrackerDefaultActions.class.php
@@ -34,7 +34,7 @@ class Widget_TrackerDefaultActions extends Widget {
if (!$owner_id) {
$owner_id = $request->get('atid');
}
- if (forge_check_perm('tracker', $owner_id, 'tech') && ($func ==
'detail')) {
+ if ($func == 'detail' || forge_check_perm('tracker_admin',
$owner_id)) {
parent::__construct('trackerdefaultactions', $owner_id,
WidgetLayoutManager::OWNER_TYPE_TRACKER);
$this->content['title'] = _('Actions');
}
@@ -59,43 +59,48 @@ class Widget_TrackerDefaultActions extends Widget {
global $group;
global $aid;
global $atid;
+ global $func;
global $HTML;
- $return = $HTML->listTableTop();
- $cells = array();
- if ($ah->isMonitoring()) {
- $img="xmail16w.png";
- $text=_('Stop monitoring');
- } else {
- $img="mail16w.png";
- $text=_('Monitor');
- }
- $i = 0;
- $cells[][] =
util_make_link('/tracker/?group_id='.$group_id.'&artifact_id='.$ah->getID().'&atid='.$ath->getID().'&func=monitor',
html_e('strong', array(), html_image('ic/'.$img, 20, 20).' '.$text),
array('id' => 'tracker-monitor', 'title' =>
util_html_secure(html_get_tooltip_description('monitor'))));
- $return .= $HTML->multiTableRow(array('class' =>
$HTML->boxGetAltRowStyle($i++, true)), $cells);
- $votes = $ah->getVotes();
- if ($votes[1]) {
+ if ($func == 'detail') {
+ $return = $HTML->listTableTop();
$cells = array();
- $cellContent = html_e('span', array('id' =>
'tracker-votes', 'title' => html_get_tooltip_description('votes')),
html_e('strong', array(), _('Votes') . _(': ')).sprintf('%1$d/%2$d (%3$d%%)',
$votes[0], $votes[1], $votes[2]));
- if ($ath->canVote()) {
- if ($ah->hasVote()) {
- $key = 'pointer_down';
- $txt = _('Retract Vote');
- } else {
- $key = 'pointer_up';
- $txt = _('Cast Vote');
- }
- $cellContent .=
util_make_link('/tracker/?group_id='.$group_id.'&aid='.$ah->getID().'&atid='.$ath->getID().'&func='.$key,
html_image('ic/'.$key.'.png', 16, 16), array('id' => 'tracker-vote', 'alt' =>
$txt, 'title' => util_html_secure(html_get_tooltip_description('vote'))));
+ if ($ah->isMonitoring()) {
+ $img="xmail16w.png";
+ $text=_('Stop monitoring');
+ } else {
+ $img="mail16w.png";
+ $text=_('Monitor');
}
- $cells[][] = $cellContent;
- $return .= $HTML->multiTableRow(array('class' =>
$HTML->boxGetAltRowStyle($i++, true)), $cells);
- }
- if (forge_check_perm('tracker', $atid, 'manager')) {
- $cells = array();
- $cells[][] =
util_make_link('/tracker/?func=deleteartifact&aid='.$aid.'&group_id='.$group_id.'&atid='.$atid,
$HTML->getDeletePic().html_e('strong', array(), _('Delete')));
+ $i = 0;
+ $cells[][] =
util_make_link('/tracker/?group_id='.$group_id.'&artifact_id='.$ah->getID().'&atid='.$ath->getID().'&func=monitor',
html_e('strong', array(), html_image('ic/'.$img, 20, 20).' '.$text),
array('id' => 'tracker-monitor', 'title' =>
util_html_secure(html_get_tooltip_description('monitor'))));
$return .= $HTML->multiTableRow(array('class' =>
$HTML->boxGetAltRowStyle($i++, true)), $cells);
+ $votes = $ah->getVotes();
+ if ($votes[1]) {
+ $cells = array();
+ $cellContent = html_e('span', array('id' =>
'tracker-votes', 'title' => html_get_tooltip_description('votes')),
html_e('strong', array(), _('Votes') . _(': ')).sprintf('%1$d/%2$d (%3$d%%)',
$votes[0], $votes[1], $votes[2]));
+ if ($ath->canVote()) {
+ if ($ah->hasVote()) {
+ $key = 'pointer_down';
+ $txt = _('Retract Vote');
+ } else {
+ $key = 'pointer_up';
+ $txt = _('Cast Vote');
+ }
+ $cellContent .=
util_make_link('/tracker/?group_id='.$group_id.'&aid='.$ah->getID().'&atid='.$ath->getID().'&func='.$key,
html_image('ic/'.$key.'.png', 16, 16), array('id' => 'tracker-vote', 'alt' =>
$txt, 'title' => util_html_secure(html_get_tooltip_description('vote'))));
+ }
+ $cells[][] = $cellContent;
+ $return .= $HTML->multiTableRow(array('class'
=> $HTML->boxGetAltRowStyle($i++, true)), $cells);
+ }
+ if (forge_check_perm('tracker', $atid, 'manager')) {
+ $cells = array();
+ $cells[][] =
util_make_link('/tracker/?func=deleteartifact&aid='.$aid.'&group_id='.$group_id.'&atid='.$atid,
$HTML->getDeletePic().html_e('strong', array(), _('Delete')));
+ $return .= $HTML->multiTableRow(array('class'
=> $HTML->boxGetAltRowStyle($i++, true)), $cells);
+ }
+ $return .= $HTML->listTableBottom();
+ return $return;
+ } else {
+ return $HTML->information(_('No action available.'));
}
- $return .= $HTML->listTableBottom();
- return $return;
}
function canBeRemove() {
-----------------------------------------------------------------------
Summary of changes:
src/common/tracker/actions/admin-updates.php | 13 +++-
.../tracker/actions/widget_artifact_display.php | 14 -----
.../tracker/include/ArtifactTypeHtml.class.php | 22 +++++++
src/common/tracker/views/form-updatetracker.php | 25 --------
src/common/widget/WidgetLayoutManager.class.php | 10 +++
.../widget/Widget_TrackerDefaultActions.class.php | 71 ++++++++++++----------
6 files changed, 80 insertions(+), 75 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits