[Fusionforge-commits] FusionForge branch master updated. 6.0.4-1131-gfb0117f

Franck Villaume nerville at libremir.placard.fr.eu.org
Sun Nov 6 19:13:06 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  fb0117fac57e0db0eb6edc6bbab25536f60044b7 (commit)
      from  d6738de2e86f51df50a3a10c72b06877f4d17188 (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=fb0117fac57e0db0eb6edc6bbab25536f60044b7

commit fb0117fac57e0db0eb6edc6bbab25536f60044b7
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 6 19:12:49 2016 +0100

    tracker: option to overwrite the standard & default query on export and soap call

diff --git a/src/common/tracker/actions/csv.php b/src/common/tracker/actions/csv.php
index fe1fcac..c6434c9 100644
--- a/src/common/tracker/actions/csv.php
+++ b/src/common/tracker/actions/csv.php
@@ -118,20 +118,21 @@ $format = $headers ? _(' with headers') : _(' without headers');
 $format .= _(' using ')."'".htmlentities($sep)."'"._(' as separator.');
 ?>
 <p><?php echo _('This page allows you to export the items using a CSV (<a href="http://en.wikipedia.org/wiki/Comma-separated_values">Comma Separated Values</a>) File. This format can be used to view your entries using your favorite spreadsheet software.'); ?></p>
-<h2><?php echo _('Export as a CSV file'); ?></h2>
-
-<strong><?php echo _('Selected CSV Format')._(': '); ?></strong>CSV<?php echo $format.' '.util_make_link($url.'&func=format_csv', $HTML->getConfigurePic(_('Modify this CSV format.'))); ?>
 <?php
+echo $HTML->information(_('By default, export uses filter as setup in the browse page. To overwrite, please use Advanced Options'));
+echo html_e('h2', array(), _('Export as a CSV file'));
+echo html_e('strong', array(), _('Selected CSV Format')._(': ')).'CSV'.$format.' '.util_make_link($url.'&func=format_csv', $HTML->getConfigurePic(_('Modify this CSV format.')));
 echo $HTML->openForm(array('action' => $url.'&func=downloadcsv', 'method' => 'post'));
 echo html_ao('fieldset', array('id' => 'fieldset1_closed', 'class' => 'coolfieldset'));
 echo html_e('legend', array(), _('Advanced Options'));
 echo html_ao('div');
+echo html_e('p', array(), _('Overwrite default filter. (No filtering)')._(': ').html_e('input', array('type' => 'checkbox', 'name' => 'overwrite_filter', 'value' => 'overwrite')));
 $attrsInputLimitByStartDate = array('type' => 'checkbox', 'id' => 'limitByLastModifiedDate', 'name' => 'limitByLastModifiedDate', 'value' => 1, 'title' => _('Set last modified date limitation for this export. If not enable, not limitation.'));
 $attrsDatePickerLimitByStartDate = array('id' => 'datepicker_start', 'name' => '_changed_from', 'size' => 10, 'maxlength' => 10, 'disabled' => 'disabled');
 echo html_e('p', array(), _('Set dates')._(': ').html_e('br').
 			_('From')._(': ').html_e('input', $attrsInputLimitByStartDate).html_e('input', $attrsDatePickerLimitByStartDate));
 echo html_ac(html_ap() - 2);
-echo html_e('input', array('type' => 'submit', 'value' => _('Download CSV file')));
+echo html_e('p', array(), html_e('input', array('type' => 'submit', 'value' => _('Download CSV file'))));
 echo $HTML->closeForm();
 
 $ath->footer();
diff --git a/src/common/tracker/actions/downloadcsv.php b/src/common/tracker/actions/downloadcsv.php
index bef548b..9c47de2 100644
--- a/src/common/tracker/actions/downloadcsv.php
+++ b/src/common/tracker/actions/downloadcsv.php
@@ -36,12 +36,11 @@ if (!$af || !is_object($af)) {
 
 $headers = getIntFromRequest('headers');
 $sep = getFilteredStringFromRequest('sep', '/^[,;]$/', ',');
-$date = date('Y-m-d-His');
 $date_format = _('Y-m-d');
 
 sysdebug_off();
 header('Content-type: text/csv');
-header('Content-disposition: filename="trackers-'.$date.'.csv"');
+header('Content-disposition: filename="trackers-'.date('Y-m-d-His').'.csv"');
 
 $offset = getStringFromRequest('offset');
 $_sort_col = getStringFromRequest('_sort_col');
@@ -51,6 +50,10 @@ $set = getStringFromRequest('set');
 $_assigned_to = getIntFromRequest('_assigned_to');
 $_status = getIntFromRequest('_status');
 $received_changed_from = getStringFromRequest('_changed_from', 0);
+$overwrite_filter = getStringFromRequest('overwrite_filter', false);
+if ($overwrite_filter) {
+	$set = $overwrite_filter;
+}
 if ($received_changed_from) {
 	$arrDateBegin = DateTime::createFromFormat($date_format, $received_changed_from);
 	$_changed_from = $arrDateBegin->getTimestamp();
diff --git a/src/www/soap/tracker/tracker.php b/src/www/soap/tracker/tracker.php
index 2fc7921..aefe8f8 100644
--- a/src/www/soap/tracker/tracker.php
+++ b/src/www/soap/tracker/tracker.php
@@ -204,7 +204,8 @@ $server->register(
 		'group_artifact_id'=>'xsd:int',
 		'assigned_to'=>'xsd:int',
 		'status'=>'xsd:int',
-		'changed_from' => 'xsd:int'
+		'changed_from' => 'xsd:int',
+		'overwrite_query' => 'xsd:int'
 	),
 	array('getArtifactsResponse'=>'tns:ArrayOfArtifact'),
 	$uri,$uri.'#getArtifacts','rpc','encoded'
@@ -281,7 +282,8 @@ $server->register(
 		'group_artifact_id'=>'xsd:int',
 		'assigned_to'=>'xsd:int',
 		'status'=>'xsd:int',
-		'changed_from' => 'xsd:int'
+		'changed_from' => 'xsd:int',
+		'overwrite_query' => 'xsd:int'
 	),
 	array('getArtifactsResponse'=>'tns:ArrayOfFlattedArtifact'),
 	$uri,$uri.'#getFlattedArtifacts','rpc','encoded'
@@ -775,7 +777,7 @@ function getArtifactTechnicians($session_ser,$group_id,$group_artifact_id) {
 //
 //	getArtifacts
 //
-function getArtifacts($session_ser, $group_id, $group_artifact_id, $assigned_to, $status, $changed_from) {
+function getArtifacts($session_ser, $group_id, $group_artifact_id, $assigned_to, $status, $changed_from, $overwrite_query) {
 	continue_session($session_ser);
 	$grp = group_get_object($group_id);
 	if (!$grp || !is_object($grp)) {
@@ -799,7 +801,9 @@ function getArtifacts($session_ser, $group_id, $group_artifact_id, $assigned_to,
 	}
 
 	// this is a bit hacky...
-	if ($assigned_to || $status) {
+	if ($overwrite_query) {
+		$set = 'overwrite';
+	} elseif ($assigned_to || $status) {
 		$set = "custom";
 	} else {
 		$set = false;
@@ -817,7 +821,7 @@ function getArtifacts($session_ser, $group_id, $group_artifact_id, $assigned_to,
 //
 //	getFlattedArtifacts
 //
-function getFlattedArtifacts($session_ser, $group_id, $group_artifact_id, $assigned_to, $status, $changed_from) {
+function getFlattedArtifacts($session_ser, $group_id, $group_artifact_id, $assigned_to, $status, $changed_from, $overwrite_query) {
 	continue_session($session_ser);
 	$grp = group_get_object($group_id);
 	if (!$grp || !is_object($grp)) {
@@ -841,7 +845,9 @@ function getFlattedArtifacts($session_ser, $group_id, $group_artifact_id, $assig
 	}
 
 	// this is a bit hacky...
-	if ($assigned_to || $status) {
+	if ($overwrite_query) {
+		$set = 'overwrite';
+	} elseif ($assigned_to || $status) {
 		$set = "custom";
 	} else {
 		$set = false;

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

Summary of changes:
 src/common/tracker/actions/csv.php         |  9 +++++----
 src/common/tracker/actions/downloadcsv.php |  7 +++++--
 src/www/soap/tracker/tracker.php           | 18 ++++++++++++------
 3 files changed, 22 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list