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  476aebf6334cc157a15d68c11ce0e60d57e0a414 (commit)
       via  9786dd9c9827ca3852ba1caaefacc73c916cac01 (commit)
       via  6406e883e0acec9137d284cb8b9cf550759b4493 (commit)
      from  2207e4c50d57257bb54d068b09947ce49cca6efc (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=476aebf6334cc157a15d68c11ce0e60d57e0a414

commit 476aebf6334cc157a15d68c11ce0e60d57e0a414
Author: Franck Villaume <[email protected]>
Date:   Sat Nov 5 11:06:17 2016 +0100

    tracker: lastModifiedDate, make downloadcsv aware

diff --git a/src/CHANGES b/src/CHANGES
index da7fe10..b544802 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -14,7 +14,7 @@ FusionForge 6.X:
 * FRS: link package release to tracker roadmap. (TrivialDev)
 * Layout: new dynamic quickNav menu: based on user activity to select 5 more 
visited projects (TrivialDev)
 * Plugin AuthBuiltin: add captcha after 3 attempts with the same login [#795] 
(TrivialDev)
-* Plugin AuthLDAP: support X_FORWARD_USER to delegate authentication and then 
retry user from LDAP (TrivialDev)
+* Plugin AuthLDAP: support X_FORWARD_USER to delegate authentication and then 
retrieve user from LDAP (TrivialDev)
 * Plugin GlobalActivity: forge-wide aggregation for project activities (Roland 
Mas)
 * Projects Page: add paging system in full_list and tag_cloud subpages 
(TrivialDev)
 * SearchEngine: support only FTI queries (TrivialDev)
@@ -34,6 +34,7 @@ FusionForge 6.X:
 * Tracker: fix extrafield cloning when not using default template fusionforge 
project [#829] (TrivialDev)
 * Tracker: add support for autoassign [#151] & [#149] (TrivialDev)
 * Tracker: add default value support for extrafields (TrivialDev)
+* Tracker: CSV export, support lastModifiedDate filtering (TrivialDev)
 * Utils: cross ref document/release. Use [DNNN]/[RNNN] where NNN is the ID of 
the document/frs release. (TrivialDev)
 * Web UI: upgrade splitter jquery plugin to 0.20.0 (TrivialDev)
 * Web UI: upgrade jquery ui to 1.12.1 (TrivialDev)
diff --git a/src/common/tracker/ArtifactFactory.class.php 
b/src/common/tracker/ArtifactFactory.class.php
index 07a7523..8ae5fca 100644
--- a/src/common/tracker/ArtifactFactory.class.php
+++ b/src/common/tracker/ArtifactFactory.class.php
@@ -4,7 +4,7 @@
  *
  * Copyright 2002, GForge, LLC
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2014, Franck Villaume - TrivialDev
+ * Copyright 2014,2016, Franck Villaume - TrivialDev
  * Copyright 2016, Stéphane-Eymeric Bredthauer - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -80,7 +80,7 @@ class ArtifactFactory extends FFError {
                        return;
                }
                $this->ArtifactType =& $ArtifactType;
-               $this->changed_from = 0x7ffffff; // Any
+               $this->changed_from = 0; // Any
        }
 
        /**
@@ -94,7 +94,7 @@ class ArtifactFactory extends FFError {
         * @param       int     $_assigned_to   Include this param if you want 
to limit to a certain assignee.
         * @param       int     $_status        Include this param if you want 
to limit to a particular status.
         * @param       array   $_extra_fields  Array of extra fields & 
elements to limit the query to.
-        * @param       int     $_changed_from  Set this param if you want to 
limit to a specific range of time (now minus _changed_from int value)
+        * @param       int     $_changed_from  Set this param if you want to 
limit from an UNIX epoch time. Default = 0, no limit in time.
         */
        function setup($offset, $order_col, $sort, $max_rows, $set, 
$_assigned_to, $_status, $_extra_fields = array(), $_changed_from = 0) {
 
@@ -269,17 +269,7 @@ class ArtifactFactory extends FFError {
                $this->status=$_status;
                $this->assigned_to=$_assigned_to;
                $this->extra_fields=$_extra_fields;
-               $this->setChangedFrom($_changed);
-       }
-
-       /**
-        * setChangedFrom - sets up changed-from and last-changed before you 
call getArtifacts().
-        *
-        * @param       int     $changed_from   The changed_from - offset 
time(sec) from now
-        */
-       function setChangedFrom($changed_from) {
-               $this->changed_from = ($changed_from <= 0) ? 0x7fffffff : 
$changed_from;
-               $this->last_changed = time() - $this->changed_from;
+               $this->last_changed=$_changed;
        }
 
        /**
diff --git a/src/common/tracker/actions/csv.php 
b/src/common/tracker/actions/csv.php
index fe0a32c..fe1fcac 100644
--- a/src/common/tracker/actions/csv.php
+++ b/src/common/tracker/actions/csv.php
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent
- * Copyright 2012-2014, Franck Villaume - TrivialDev
+ * Copyright 2012-2014,2016, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -41,13 +41,9 @@
  * ALONE BASIS."
  */
 
-//
-//     This page contains a form with a file-upload button
-//     so a user can choose a file to upload a .csv file and store it in task 
mgr
-//
-
 global $ath;
 global $group_id;
+global $HTML;
 
 $ath->header(array('atid'=>$ath->getID(), 'title'=>$ath->getName()));
 
@@ -71,19 +67,71 @@ if (session_loggedin()) {
        }
 }
 
-$url_set_format = 
'/tracker/?group_id='.$group_id.'&amp;atid='.$ath->getID().'&amp;func=format_csv&amp;sep='.urlencode($sep).'&amp;headers='.$headers;
+echo html_ao('script', array('type' => 'text/javascript'));
+?>
+//<![CDATA[
+
+TrackerCSVController = function(params)
+{
+       this.csvparams  = params;
+       this.bindControls();
+};
+
+TrackerCSVController.prototype =
+{
+       /*! Binds the controls to the actions
+        */
+       bindControls: function() {
+               this.csvparams.buttonStartDate.click(jQuery.proxy(this, 
'setStartDate'));
+       },
+
+       setStartDate: function() {
+               if (this.csvparams.buttonStartDate.is(':checked')) {
+                       
this.csvparams.datePickerStartDate.removeAttr('disabled');
+                       this.csvparams.datePickerStartDate.attr('required', 
'required');
+               } else {
+                       this.csvparams.datePickerStartDate.attr('disabled', 
'disabled');
+                       
this.csvparams.datePickerStartDate.removeAttr('required');
+               }
+       },
+};
+
+var controllerCSV;
 
-$url_export = 
'/tracker/?group_id='.$group_id.'&amp;atid='.$ath->getID().'&amp;func=downloadcsv&amp;sep='.urlencode($sep).'&amp;headers='.$headers;
+jQuery(document).ready(function() {
+       controllerCSV = new TrackerCSVController({
+               buttonStartDate:        jQuery('#limitByLastModifiedDate'),
+               datePickerStartDate:    jQuery('#datepicker_start'),
+       });
 
-$format = $headers ? ' with headers' : ' without headers';
-$format .= " using '".htmlentities($sep)."' as separator.";
+       jQuery('#datepicker_start').datepicker({
+               dateFormat: "<?php echo _('yy-mm-dd'); ?>"
+       });
+});
+
+//]]>
+<?php
+echo html_ac(html_ap() - 1);
+
+$url = 
'/tracker/?group_id='.$group_id.'&atid='.$ath->getID().'&sep='.urlencode($sep).'&headers='.$headers;
+$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 ?> <a href="<?php echo $url_set_format ?>"><?php echo _('(Change)'); 
?></a>
-
-<p><a href="<?php echo $url_export ?>"><?php echo _('Download CSV file'); 
?></a></p>
-
+<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->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');
+$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->closeForm();
+
 $ath->footer();
diff --git a/src/common/tracker/actions/downloadcsv.php 
b/src/common/tracker/actions/downloadcsv.php
index a2bee3a..bef548b 100644
--- a/src/common/tracker/actions/downloadcsv.php
+++ b/src/common/tracker/actions/downloadcsv.php
@@ -24,15 +24,6 @@ require_once $gfcommon.'tracker/ArtifactFactory.class.php';
 
 global $ath;
 
-$headers = getIntFromRequest('headers');
-$sep = getFilteredStringFromRequest('sep', '/^[,;]$/', ',');
-
-$date = date('Y-m-d');
-
-sysdebug_off();
-header('Content-type: text/csv');
-header('Content-disposition: filename="trackers-'.$date.'.csv"');
-
 session_require_perm ('tracker', $ath->getID(), 'read') ;
 
 $af = new ArtifactFactory($ath);
@@ -42,6 +33,16 @@ if (!$af || !is_object($af)) {
        exit_error($af->getErrorMessage(),'tracker');
 }
 
+
+$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"');
+
 $offset = getStringFromRequest('offset');
 $_sort_col = getStringFromRequest('_sort_col');
 $_sort_ord = getStringFromRequest('_sort_ord');
@@ -49,7 +50,13 @@ $max_rows = getIntFromRequest('max_rows');
 $set = getStringFromRequest('set');
 $_assigned_to = getIntFromRequest('_assigned_to');
 $_status = getIntFromRequest('_status');
-$_changed_from = getIntFromRequest('_changed_from', 0);
+$received_changed_from = getStringFromRequest('_changed_from', 0);
+if ($received_changed_from) {
+       $arrDateBegin = DateTime::createFromFormat($date_format, 
$received_changed_from);
+       $_changed_from = $arrDateBegin->getTimestamp();
+} else {
+       $_changed_from = 0;
+}
 
 
$af->setup($offset,$_sort_col,$_sort_ord,$max_rows,$set,$_assigned_to,$_status, 
array(), $_changed_from);
 

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=9786dd9c9827ca3852ba1caaefacc73c916cac01

commit 9786dd9c9827ca3852ba1caaefacc73c916cac01
Author: Franck Villaume <[email protected]>
Date:   Sat Nov 5 11:05:19 2016 +0100

    fix PHP warning

diff --git a/src/common/tracker/actions/browse.php 
b/src/common/tracker/actions/browse.php
index 5f8ace9..0dff514 100644
--- a/src/common/tracker/actions/browse.php
+++ b/src/common/tracker/actions/browse.php
@@ -501,7 +501,7 @@ if ($art_arr && $art_cnt > 0) {
                $legend = '';
                if (is_array($states)) {
                        foreach($states as $name) {
-                               if ($count[$name]) {
+                               if (isset($count[$name]) && $count[$name]) {
                                        $graph  .= '<td style="background: 
'.$colors[$i].'; width: '.$percent[$name].'%;">&nbsp;</td>';
                                        $legend .= '<td style="white-space: 
nowrap; width: '.$percent[$name].'%;">'."<i>$name: $count[$name] 
($percent[$name]%)</i></td>";
                                }

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=6406e883e0acec9137d284cb8b9cf550759b4493

commit 6406e883e0acec9137d284cb8b9cf550759b4493
Author: Franck Villaume <[email protected]>
Date:   Sat Nov 5 11:04:57 2016 +0100

    coding style

diff --git a/src/common/tracker/ArtifactQuery.class.php 
b/src/common/tracker/ArtifactQuery.class.php
index 61f5a74..535012e 100644
--- a/src/common/tracker/ArtifactQuery.class.php
+++ b/src/common/tracker/ArtifactQuery.class.php
@@ -24,7 +24,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-/*
+/**
  * Standard Alcatel-Lucent disclaimer for contributing to open source
  *
  * "The Artifact ("Contribution") has not been tested and/or

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

Summary of changes:
 src/CHANGES                                  |  3 +-
 src/common/tracker/ArtifactFactory.class.php | 18 ++-----
 src/common/tracker/ArtifactQuery.class.php   |  2 +-
 src/common/tracker/actions/browse.php        |  2 +-
 src/common/tracker/actions/csv.php           | 76 +++++++++++++++++++++++-----
 src/common/tracker/actions/downloadcsv.php   | 27 ++++++----
 6 files changed, 87 insertions(+), 41 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to