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  918087b8fea1646ac65493e02ea0e807c9c78e17 (commit)
       via  161fa81de763b2574c2400dddb5402453dc2d7da (commit)
       via  b15e5869b3a851c7987e98c4e791d7da00f99bac (commit)
       via  d9cea9b8e0371d58ae512cbd204b473123816060 (commit)
      from  5179a9df23abfdbd5d421ce86ac00781777e795b (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=918087b8fea1646ac65493e02ea0e807c9c78e17

commit 918087b8fea1646ac65493e02ea0e807c9c78e17
Author: Franck Villaume <[email protected]>
Date:   Sun Apr 30 19:41:27 2017 +0200

    forge cli: initial code for trackerImport

diff --git a/src/bin/forge b/src/bin/forge
index 6ba8218..c880c69 100755
--- a/src/bin/forge
+++ b/src/bin/forge
@@ -58,11 +58,21 @@ class CliActions {
                                echo "to dump an artifact from a specific 
tracker of a project.\n";
                                echo $dumpFormatInfo;
                                break;
+                       case 'artifactImport':
+                               echo "Use: .../forge artifactImport <file> 
[json|raw]\n";
+                               echo "to import an artifact.\n";
+                               echo $dumpFormatInfo.$importFormatInfo;
+                               break;
                        case 'trackerDump':
                                echo "Use: .../forge trackerDump <atid> 
[json|raw]\n";
                                echo "to dump a tracker from a specific 
project.\n";
                                echo $dumpFormatInfo;
                                break;
+                       case 'trackerImport':
+                               echo "Use: .../forge trackerImport <file> 
[json|raw]\n";
+                               echo "to import a tracker and all his 
elements.\n";
+                               echo $dumpFormatInfo.$importFormatInfo;
+                               break;
                        case 'documentDump':
                                echo "Use: .../forge documentDump <docid> 
[json|raw]\n";
                                echo "to dump a document from a specific 
project.\n";
@@ -78,6 +88,11 @@ class CliActions {
                                echo "to dump a document group (folder) from a 
specific project.\n";
                                echo $dumpFormatInfo;
                                break;
+                       case 'docgroupImport':
+                               echo "Use: .../forge docgroupImport <file> 
[json|raw]\n";
+                               echo "to import a document group (folder) and 
all his elements.\n";
+                               echo $dumpFormatInfo.$importFormatInfo;
+                               break;
                        case 'docmanDump':
                                echo "Use: .../forge docmanDump <groupid> 
[json|raw]\n";
                                echo "to dump docman from a specific 
project.\n";
@@ -239,7 +254,7 @@ class CliActions {
                                return false;
                        }
                        db_commit();
-                       
$importRefMapping['artifact'][$stream['data_array']['artifact_id']] = null;
+                       
$importRefMapping['artifact'][$stream['data_array']['artifact_id']] = 
$artf->getID();
                        echo _('Artifact injected')."\n";
                        return true;
                } else {
@@ -361,6 +376,53 @@ class CliActions {
                return $trackerDump;
        }
 
+       function trackerImport($file, $format = 'json') {
+               global $importRefMapping;
+               $stream = $this->loadFile($file, $format);
+               if (!$stream) {
+                       return false;
+               }
+               $group_id = $this->getMappingId($stream['setup']['group_id'], 
'group');
+               $group = group_get_object($group_id);
+               if ($group && is_object($group) && !$group->isError() && 
$group->usesTracker()) {
+                       db_begin();
+                       $at = new ArtifactType($group);
+                       $name = $stream['setup']['name'];
+                       $description = $stream['setup']['description'];
+                       $email_all = $stream['setup']['email_all_updates'];
+                       $email_address = $stream['setup']['email_address'];
+                       $due_period = 
$stream['setup']['due_period']/(60*60*24); //in days
+                       $submit_instructions = 
$stream['setup']['submit_instructions'];
+                       $browse_instructions = 
$stream['setup']['browse_instructions'];
+                       if (!$at->create($name, $description, $email_all, 
$email_address, $due_period, 0, $submit_instructions, $browse_instructions)) {
+                               echo $at->getErrorMessage()."\n";
+                               db_rollback();
+                               return false;
+                       }
+                       if (isset($stream['setup']['extra_fields']) && 
is_array($stream['setup']['extra_fields'])) {
+                               foreach ($stream['setup']['extra_fields'] as 
$extra_field) {
+                                       $ef = new ArtifactExtraField($at);
+                                       if (!$ef->create($extra_field['name'], 
$extra_field['field_type'], $extra_field['attribute1'], 
$extra_field['attribute2'],
+                                                       
$extra_field['is_required'], $extra_field['alias'], $extra_field['show100'], 
$extra_field['show100label'],
+                                                       
$extra_field['description'], $extra_field['pattern'], $extra_field['parent'], 
$extra_field['autoassign'],
+                                                       
$extra_field['is_hidden_on_submit'], $extra_field['is_disabled'])) {
+                                               echo 
$ef->getErrorMessage()."\n";
+                                               db_rollback();
+                                               return false;
+                                       }
+                                       
$importRefMapping['extrafield'][$extra_field['extra_field_id']] = $ef->getID();
+                               }
+                       }
+                       db_commit();
+                       
$importRefMapping['artifact_type'][$stream['setup']['group_artifact_id']] = 
$at->getID();
+                       echo _('Tracker injected')."\n";
+                       return true;
+               } else {
+                       echo _('Unable to get project to inject tracker')._(': 
').$group_id."\n";
+                       return false;
+               }
+       }
+
        function documentDump($docid, $format = 'json') {
                $doc = document_get_object($docid);
                if ($doc && is_object($doc) && !$doc->isError()) {

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

commit 161fa81de763b2574c2400dddb5402453dc2d7da
Author: Franck Villaume <[email protected]>
Date:   Sun Apr 30 19:37:37 2017 +0200

    clean-up & add missing exported values in tracker settings

diff --git a/src/common/tracker/ArtifactType.class.php 
b/src/common/tracker/ArtifactType.class.php
index 3d7bb1e..9a465f4 100644
--- a/src/common/tracker/ArtifactType.class.php
+++ b/src/common/tracker/ArtifactType.class.php
@@ -208,7 +208,7 @@ class ArtifactType extends FFError {
         * @param       bool    $email_all              (1) true (0) false - 
whether to email on all updates.
         * @param       string  $email_address          The address to send new 
entries and updates to.
         * @param       int     $due_period             Days before this item 
is considered overdue.
-        * @param       bool    $use_resolution         (1) true (0) false - 
whether the resolution box should be shown.
+        * @param       bool    $use_resolution         (1) true (0) false - 
whether the resolution box should be shown. //TODO: unused parameter. to be 
drop!
         * @param       string  $submit_instructions    Free-form string that 
project admins can place on the submit page.
         * @param       string  $browse_instructions    Free-form string that 
project admins can place on the browse page.
         * @param       int     $datatype               (1) bug tracker, (2) 
Support Tracker, (3) Patch Tracker, (4) features (0) other.
@@ -235,7 +235,6 @@ class ArtifactType extends FFError {
                        }
                }
 
-               $use_resolution = ((!$use_resolution) ? 0 : $use_resolution);
                $email_all = ((!$email_all) ? 0 : $email_all);
 
                db_begin();
@@ -1340,7 +1339,7 @@ class ArtifactType extends FFError {
         * @param       string  $email_address          The address to send new 
entries and updates to.
         * @param       int     $due_period             Days before this item 
is considered overdue.
         * @param       int     $status_timeout          Days before stale 
items time out.
-        * @param       bool    $use_resolution         (1) true (0) false - 
whether the resolution box should be shown.
+        * @param       bool    $use_resolution         (1) true (0) false - 
whether the resolution box should be shown. //TODO: unused parameter. to be 
drop!
         * @param       string  $submit_instructions    Free-form string that 
project admins can place on the submit page.
         * @param       string  $browse_instructions    Free-form string that 
project admins can place on the browse page.
         * @return      bool    true on success, false on failure.
@@ -1383,7 +1382,6 @@ class ArtifactType extends FFError {
                }
 
                $email_all = ((!$email_all) ? 0 : $email_all);
-               $use_resolution = ((!$use_resolution) ? 0 : $use_resolution);
 
                $res = db_query_params('UPDATE artifact_group_list SET
                        name=$1,
@@ -1497,7 +1495,7 @@ class ArtifactType extends FFError {
                $res = db_query_params ('UPDATE artifact_group_list SET 
unit_set_id=$1 WHERE group_artifact_id=$2',
                                array($unit_set_id, $this->getID()));
                if ($res) {
-                       $this->data_array['unit_set_id']=$unit_set_id;
+                       $this->data_array['unit_set_id'] = $unit_set_id;
                        db_commit();
                        return true;
                } else {
@@ -1531,34 +1529,51 @@ class ArtifactType extends FFError {
                        $avtmp = $aefobj->getAvailableValues();
                        $avs = array();
                        for ($j=0; $j < count($avtmp); $j++) {
-                               $avs[$j]["element_id"] = 
$avtmp[$j]["element_id"];
-                               $avs[$j]["element_name"] = 
$avtmp[$j]["element_name"];
-                               $avs[$j]["status_id"] = $avtmp[$j]["status_id"];
+                               $avs[$j]['auto_assign_to']      = 
$avtmp[$j]['auto_assign_to'];
+                               $avs[$j]['element_id']          = 
$avtmp[$j]['element_id'];
+                               $avs[$j]['element_name']        = 
$avtmp[$j]['element_name'];
+                               $avs[$j]['is_default']          = 
$avtmp[$j]['is_default'];
+                               $avs[$j]['status_id']           = 
$avtmp[$j]['status_id'];
                        }
 
                        $extrafields[] = array(
-                               "extra_field_id"        => $aefobj->getID(),
-                               "field_name"            => $aefobj->getName(),
-                               "field_type"            => $aefobj->getType(),
-                               "attribute1"            => 
$aefobj->getAttribute1(),
-                               "attribute2"            => 
$aefobj->getAttribute2(),
-                               "is_required"           => 
$aefobj->isRequired(),
-                               "alias"                 => $aefobj->getAlias(),
-                               "available_values"      => $avs,
-                               "default_selected_id"   => 0            //TODO 
(not implemented yet)
-                       );
+                               'alias'                 => $aefobj->getAlias(),
+                               'attribute1'            => 
$aefobj->getAttribute1(),
+                               'attribute2'            => 
$aefobj->getAttribute2(),
+                               'autoassign'            => 
$aefobj->isAutoAssign(),
+                               'available_values'      => $avs,
+                               'description'           => 
$aefobj->getDescription(),
+                               'extra_field_id'        => $aefobj->getID(),
+                               'field_name'            => $aefobj->getName(),
+                               'field_type'            => $aefobj->getType(),
+                               'is_disabled'           => 
$aefobj->isDisabled(),
+                               'is_hidden_on_submit'   => 
$aefobj->isHiddenOnSubmit(),
+                               'is_required'           => 
$aefobj->isRequired(),
+                               'name'                  => $aefobj->getName(),
+                               'pattern'               => 
$aefobj->getPattern(),
+                               'parent'                => $aefobj->getParent(),
+                               'show100'               => 
$aefobj->getShow100(),
+                               'show100label'          => 
$aefobj->getShow100label()
+                                                       );
                }
 
                $return = array(
-                               'group_artifact_id'     => 
$this->data_array['group_artifact_id'],
-                               'group_id'              => 
$this->data_array['group_id'],
-                               'name'                  => 
$this->data_array['name'],
-                               'description'           => 
$this->data_array['description'],
-                               'due_period'            => 
$this->data_array['due_period'],
-                               'datatype'              => 
$this->data_array['datatype'],
-                               'status_timeout'        => 
$this->data_array['status_timeout'],
+                               'browse_list'           => 
$this->getBrowseList(),
+                               'browse_instructions'   => 
$this->getBrowseInstructions(),
+                               'custom_status_field'   => 
$this->getCustomStatusField(),
+                               'datatype'              => $this->getDataType(),
+                               'description'           => 
$this->getDescription(),
+                               'due_period'            => 
$this->getDuePeriod(),
+                               'email_address'         => 
$this->getEmailAddress(),
+                               'email_all_updates'     => $this->emailAll(),
                                'extra_fields'          => $extrafields,
-                               'custom_status_field'   => 
$this->data_array['custom_status_field'],
+
+                               'group_artifact_id'     => $this->getID(),
+                               'group_id'              => 
$this->getGroup()->getID(),
+                               'name'                  => $this->getName(),
+                               'status_timeout'        => 
$this->getStatusTimeout(),
+                               'submit_instructions'   => 
$this->getSubmitInstructions(),
+                               'unit_set_id'           => 
$this->getEffortUnitSet(),
                                'use_tracker_widget_display' => 
$this->getWidgetLayoutConfig());
                return $return;
        }

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

commit b15e5869b3a851c7987e98c4e791d7da00f99bac
Author: Franck Villaume <[email protected]>
Date:   Sun Apr 30 19:36:26 2017 +0200

    clean-up, space

diff --git a/src/common/tracker/ArtifactExtraFieldElement.class.php 
b/src/common/tracker/ArtifactExtraFieldElement.class.php
index 382bebf..302476a 100644
--- a/src/common/tracker/ArtifactExtraFieldElement.class.php
+++ b/src/common/tracker/ArtifactExtraFieldElement.class.php
@@ -6,6 +6,7 @@
  * Copyright 2009, Roland Mas
  * Copyright 2009, Alcatel-Lucent
  * Copyright 2016, Stéphane-Eymeric Bredthauer - TrivialDev
+ * Copyright 2017, 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
@@ -23,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
@@ -68,7 +69,7 @@ class ArtifactExtraFieldElement extends FFError {
         * @param       object          $ArtifactExtraField     
ArtifactExtraField object.
         * @param       array|bool      $data                   (all fields 
from artifact_file_user_vw) OR id from database.
         */
-       function __construct(&$ArtifactExtraField,$data=false) {
+       function __construct(&$ArtifactExtraField, $data = false) {
                parent::__construct();
 
                // Was ArtifactExtraField legit?
@@ -99,9 +100,11 @@ class ArtifactExtraFieldElement extends FFError {
         *
         * @param       string  $name           Name of the choice
         * @param       int     $status_id      Id the box that contains the 
choice (optional).
+        * @param       int     $auto_assign_to Id of user for autoassign rule. 
Default value is 100
+        * @param       int     $is_default     is this value by default? 
Default value is 0 => No.
         * @return      bool    true on success / false on failure.
         */
-       function create($name,$status_id=0,$auto_assign_to=100,$is_default=0) {
+       function create($name, $status_id = 0, $auto_assign_to = 100, 
$is_default = 0) {
                //
                //      data validation
                //
@@ -227,7 +230,7 @@ class ArtifactExtraFieldElement extends FFError {
        }
 
        /**
-        * getBoxID - get this  artifact box id.
+        * getBoxID - get this artifact box id.
         *
         * @return      int     The id #.
         */
@@ -355,7 +358,7 @@ class ArtifactExtraFieldElement extends FFError {
                        $row = db_fetch_array($res);
                        $return = $row['formula'];
                } else {
-                       $return ='';
+                       $return = '';
                }
                return $return;
        }

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

commit d9cea9b8e0371d58ae512cbd204b473123816060
Author: Franck Villaume <[email protected]>
Date:   Sun Apr 30 19:35:54 2017 +0200

    clean-up, space

diff --git a/src/common/tracker/ArtifactExtraField.class.php 
b/src/common/tracker/ArtifactExtraField.class.php
index 45d6325..6f83370 100644
--- a/src/common/tracker/ArtifactExtraField.class.php
+++ b/src/common/tracker/ArtifactExtraField.class.php
@@ -781,9 +781,9 @@ class ArtifactExtraField extends FFError {
        function getAvailableValues() {
                $type = $this->getType();
                if (in_array($type, 
unserialize(ARTIFACT_EXTRAFIELDTYPEGROUP_VALUE))) {
-                       $return = array();;
+                       $return = array();
                } else {
-                       $res = db_query_params ('SELECT *, 0 AS is_default
+                       $res = db_query_params('SELECT *, 0 AS is_default
                                                FROM 
artifact_extra_field_elements
                                                WHERE extra_field_id=$1
                                                ORDER BY element_pos ASC, 
element_id ASC',
@@ -793,29 +793,29 @@ class ArtifactExtraField extends FFError {
                        $return = array();
                        if (in_array($type, 
unserialize(ARTIFACT_EXTRAFIELDTYPEGROUP_SINGLECHOICE))) {
                                while ($row = db_fetch_array($res)) {
-                                       if ($row['element_id']==$default) {
-                                               $row['is_default']=1;
+                                       if ($row['element_id'] == $default) {
+                                               $row['is_default'] = 1;
                                        }
                                        $return[] = $row;
                                }
                        } elseif (in_array($type, 
unserialize(ARTIFACT_EXTRAFIELDTYPEGROUP_MULTICHOICE))) {
                                while ($row = db_fetch_array($res)) {
                                        if (is_array($default) && 
in_array($row['element_id'], $default)) {
-                                               $row['is_default']=1;
+                                               $row['is_default'] = 1;
                                        }
                                        $return[] = $row;
                                }
                        } elseif ($type == ARTIFACT_EXTRAFIELDTYPE_USER || 
$type == ARTIFACT_EXTRAFIELDTYPE_RELEASE) {
                                while ($row = db_fetch_array($res)) {
-                                       if ($row['element_id']==$default) {
-                                               $row['is_default']=1;
+                                       if ($row['element_id'] == $default) {
+                                               $row['is_default'] = 1;
                                        }
                                        $return[] = $row;
                                }
                        } else {
                                while ($row = db_fetch_array($res)) {
                                        if (!is_null($default) && 
in_array($row['element_id'],$default)) {
-                                               $row['is_default']=1;
+                                               $row['is_default'] = 1;
                                        }
                                        $return[] = $row;
                                }
@@ -896,7 +896,7 @@ class ArtifactExtraField extends FFError {
         * @param       int     $parent         Parent extra field id.
         * @return      bool    success.
         */
-       function update($name, $attribute1, $attribute2, $is_required = 0, 
$alias = "", $show100 = true, $show100label = 'none', $description = '', 
$pattern='', $parent=100, $autoassign=0, $is_hidden_on_submit=0, 
$is_disabled=0) {
+       function update($name, $attribute1, $attribute2, $is_required = 0, 
$alias = "", $show100 = true, $show100label = 'none', $description = '', 
$pattern = '', $parent = 100, $autoassign = 0, $is_hidden_on_submit = 0, 
$is_disabled = 0) {
                if (!forge_check_perm ('tracker_admin', 
$this->ArtifactType->Group->getID())) {
                        $this->setPermissionDeniedError();
                        return false;

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

Summary of changes:
 src/bin/forge                                      | 64 ++++++++++++++++++++-
 src/common/tracker/ArtifactExtraField.class.php    | 18 +++---
 .../tracker/ArtifactExtraFieldElement.class.php    | 13 +++--
 src/common/tracker/ArtifactType.class.php          | 67 +++++++++++++---------
 4 files changed, 121 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