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  fd9ec048665275045a53d620a029b54ecc29b8b5 (commit)
       via  1b477b5f4b13cbc1ec38baf3445c151ecde84d1e (commit)
      from  32cd27b3e1188fdba46378477bf22a88cc9e1c0b (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=fd9ec048665275045a53d620a029b54ecc29b8b5

commit fd9ec048665275045a53d620a029b54ecc29b8b5
Author: Stéphane-Eymeric Bredthauer <[email protected]>
Date:   Tue Sep 6 16:49:55 2016 +0200

    Tracker: improve import 2

diff --git a/src/common/tracker/Artifact.class.php 
b/src/common/tracker/Artifact.class.php
index 2818a69..96284c8 100644
--- a/src/common/tracker/Artifact.class.php
+++ b/src/common/tracker/Artifact.class.php
@@ -1043,8 +1043,7 @@ class Artifact extends FFError {
                                        if ($type == 
ARTIFACT_EXTRAFIELDTYPE_TEXT ||
                                                $type == 
ARTIFACT_EXTRAFIELDTYPE_INTEGER ||
                                                $type == 
ARTIFACT_EXTRAFIELDTYPE_TEXTAREA ||
-                                               $type == 
ARTIFACT_EXTRAFIELDTYPE_RELATION ||
-                                               $type == 
ARTIFACT_EXTRAFIELDTYPE_DATE) {
+                                               $type == 
ARTIFACT_EXTRAFIELDTYPE_RELATION) {
                                                $new_extra_fields[$new_id] = 
$value;
                                        } else {
                                                $values = 
$newArtifactType->getExtraFieldElements($new_id);
@@ -1840,7 +1839,6 @@ class Artifact extends FFError {
                                case ARTIFACT_EXTRAFIELDTYPE_TEXTAREA:
                                case ARTIFACT_EXTRAFIELDTYPE_RELATION:
                                case ARTIFACT_EXTRAFIELDTYPE_INTEGER:
-                               case ARTIFACT_EXTRAFIELDTYPE_DATE:
                                        if (isset($efd[$efid])) {
                                                $value = $efd[$efid];
                                        } else {
diff --git a/src/common/tracker/ArtifactExtraField.class.php 
b/src/common/tracker/ArtifactExtraField.class.php
index 1001539..3b5cf4d 100644
--- a/src/common/tracker/ArtifactExtraField.class.php
+++ b/src/common/tracker/ArtifactExtraField.class.php
@@ -41,10 +41,7 @@ define('ARTIFACT_EXTRAFIELDTYPE_FORMULA',11);
 /* reserved for Evolvis extension, for merge into FusionForge */
 define('ARTIFACT_EXTRAFIELDTYPE_DATETIME',12);
 /* reserved */
-define('ARTIFACT_EXTRAFIELDTYPE_DATE',13);
 define('ARTIFACT_EXTRAFIELDTYPE_USER',14);
-define('ARTIFACT_EXTRAFIELDTYPE_RELEASE',15);
-
 
 class ArtifactExtraField extends FFError {
 

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

commit 1b477b5f4b13cbc1ec38baf3445c151ecde84d1e
Author: Stéphane-Eymeric Bredthauer <[email protected]>
Date:   Tue Sep 6 14:00:29 2016 +0200

    Tracker: improved import

diff --git a/src/common/tracker/Artifact.class.php 
b/src/common/tracker/Artifact.class.php
index 5e8b291..2818a69 100644
--- a/src/common/tracker/Artifact.class.php
+++ b/src/common/tracker/Artifact.class.php
@@ -764,7 +764,7 @@ class Artifact extends FFError {
         * @param       bool    $send_followup  Whether $bool to email out a 
followup.
         * @return      bool    success.
         */
-       function addMessage($body,$by=false,$send_followup=false) {
+       function addMessage($body,$by=false,$send_followup=false,$importData = 
array()) {
                if (!$body) {
                        $this->setMissingParamsError();
                        return false;
@@ -773,36 +773,49 @@ class Artifact extends FFError {
                        $this->setError(_('You are not currently allowed to 
submit items to this tracker.'));
                        return false;
                }
-               if (session_loggedin()) {
-                       $user_id=user_getid();
-                       $user = user_get_object($user_id);
-                       if (!$user || !is_object($user)) {
-                               $this->setError('Error: Logged In User But 
Could Not Get User Object');
-                               return false;
-                       }
-                       //      we'll store this email even though it will 
likely never be used -
-                       //      since we have their correct user_id, we can 
join the USERS table to get email
-                       $by=$user->getEmail();
+               
+               if(array_key_exists('user', $importData)){
+                               $user = user_get_object($importData['user']);
+                               if (!$user || !is_object($user)) {
+                                       $this->setError('Error: Logged In User 
But Could Not Get User Object');
+                                       return false;
+                               }
+                               $by=$user->getEmail();
                } else {
-                       $user_id=100;
-                       if (!$by || !validate_email($by)) {
-                               $this->setMissingParamsError();
-                               return false;
+                       if (session_loggedin()) {
+                               $user_id=user_getid();
+                               $user = user_get_object($user_id);
+                               if (!$user || !is_object($user)) {
+                                       $this->setError('Error: Logged In User 
But Could Not Get User Object');
+                                       return false;
+                               }
+                               //      we'll store this email even though it 
will likely never be used -
+                               //      since we have their correct user_id, we 
can join the USERS table to get email
+                               $by=$user->getEmail();
+                       } else {
+                               $user_id=100;
+                               if (!$by || !validate_email($by)) {
+                                       $this->setMissingParamsError();
+                                       return false;
+                               }
                        }
                }
-
-               $now = time();
+               if(array_key_exists('time', $importData)){
+                       $time = $importData['time'];;
+               } else {
+                       $time = time();
+               }
                $res = db_query_params ('INSERT INTO artifact_message 
(artifact_id,submitted_by,from_email,adddate,body) VALUES ($1,$2,$3,$4,$5)',
                                        array ($this->getID(),
                                               $user_id,
                                               $by,
-                                              $now,
+                                              $time,
                                               htmlspecialchars($body))) ;
 
                $this->updateLastModifiedDate();
 
                if ($send_followup) {
-                       $this->mailFollowupEx($now, 2, false);
+                       $this->mailFollowupEx($time, 2, false);
                }
                return $res;
        }
@@ -1030,7 +1043,8 @@ class Artifact extends FFError {
                                        if ($type == 
ARTIFACT_EXTRAFIELDTYPE_TEXT ||
                                                $type == 
ARTIFACT_EXTRAFIELDTYPE_INTEGER ||
                                                $type == 
ARTIFACT_EXTRAFIELDTYPE_TEXTAREA ||
-                                               $type == 
ARTIFACT_EXTRAFIELDTYPE_RELATION) {
+                                               $type == 
ARTIFACT_EXTRAFIELDTYPE_RELATION ||
+                                               $type == 
ARTIFACT_EXTRAFIELDTYPE_DATE) {
                                                $new_extra_fields[$new_id] = 
$value;
                                        } else {
                                                $values = 
$newArtifactType->getExtraFieldElements($new_id);
@@ -1826,6 +1840,7 @@ class Artifact extends FFError {
                                case ARTIFACT_EXTRAFIELDTYPE_TEXTAREA:
                                case ARTIFACT_EXTRAFIELDTYPE_RELATION:
                                case ARTIFACT_EXTRAFIELDTYPE_INTEGER:
+                               case ARTIFACT_EXTRAFIELDTYPE_DATE:
                                        if (isset($efd[$efid])) {
                                                $value = $efd[$efid];
                                        } else {
diff --git a/src/common/tracker/ArtifactExtraField.class.php 
b/src/common/tracker/ArtifactExtraField.class.php
index fba94d6..1001539 100644
--- a/src/common/tracker/ArtifactExtraField.class.php
+++ b/src/common/tracker/ArtifactExtraField.class.php
@@ -43,6 +43,8 @@ define('ARTIFACT_EXTRAFIELDTYPE_DATETIME',12);
 /* reserved */
 define('ARTIFACT_EXTRAFIELDTYPE_DATE',13);
 define('ARTIFACT_EXTRAFIELDTYPE_USER',14);
+define('ARTIFACT_EXTRAFIELDTYPE_RELEASE',15);
+
 
 class ArtifactExtraField extends FFError {
 
diff --git a/src/common/tracker/ArtifactType.class.php 
b/src/common/tracker/ArtifactType.class.php
index 494badb..fe62ed7 100644
--- a/src/common/tracker/ArtifactType.class.php
+++ b/src/common/tracker/ArtifactType.class.php
@@ -283,6 +283,7 @@ class ArtifactType extends FFError {
        function fetchData($artifact_type_id) {
                $this->voters = false;
                $this->extra_field = false;
+               $this->extra_fields = false;
                $res = db_query_params('SELECT * FROM artifact_group_list_vw
                        WHERE group_artifact_id=$1
                        AND group_id=$2',

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

Summary of changes:
 src/common/tracker/Artifact.class.php           | 51 ++++++++++++++++---------
 src/common/tracker/ArtifactExtraField.class.php |  1 -
 src/common/tracker/ArtifactType.class.php       |  1 +
 3 files changed, 33 insertions(+), 20 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