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  7d0208b0531fd95baaa7a953707b8427b98a52b4 (commit)
      from  43c8745eaf02c0b492c2113e09aa0b666d5aaf80 (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=7d0208b0531fd95baaa7a953707b8427b98a52b4

commit 7d0208b0531fd95baaa7a953707b8427b98a52b4
Author: Stéphane-Eymeric Bredthauer <[email protected]>
Date:   Sat Mar 18 12:00:03 2017 +0100

    Tracker: Formula, priority as integer + intval function

diff --git a/src/common/tracker/ArtifactExpression.class.php 
b/src/common/tracker/ArtifactExpression.class.php
index 356be38..00aa49a 100644
--- a/src/common/tracker/ArtifactExpression.class.php
+++ b/src/common/tracker/ArtifactExpression.class.php
@@ -62,11 +62,13 @@ class ArtifactExpression extends FFError {
        {
                $this->functionsDescription['in_array'] = _('Test if a value is 
in an (json) array');
                $this->functionsDescription['datetime_add'] = _('Add to a 
date/time a duration (duration in ISO 8601 Format)');
+               $this->functionsDescription['intval'] = _('Get the integer 
value of a variable');
                $this->expression = new Expression;
                $this->expression->suppress_errors = true;
                $this->expression->fb = array();
                $this->expression->functions ['in_array'] = 'expr_in_array';
                $this->expression->functions ['datetime_add'] = 
'expr_datetime_add';
+               $this->expression->functions ['intval'] = 'expr_intval';
        }
 
        public function evaluate($expression) {
@@ -145,3 +147,7 @@ function expr_datetime_add($datetime, $interval) {
        $dateTimeObj->add($intervalObj);
        return $dateTimeObj->format(_('Y-m-d H:i'));
 }
+
+function expr_intval($value) {
+       return intval($value);
+}
diff --git a/src/common/tracker/actions/ajax.php 
b/src/common/tracker/actions/ajax.php
index 6014d81..b829a4b 100644
--- a/src/common/tracker/actions/ajax.php
+++ b/src/common/tracker/actions/ajax.php
@@ -40,7 +40,7 @@ switch ($function) {
                $extra_fields = getArrayFromRequest('extra_fields');
                $status = getStringFromRequest('status');
                $assigned_to = getStringFromRequest('assigned_to');
-               $priority = getStringFromRequest('priority');
+               $priority = getIntFromRequest('priority',3);
                $summary = getStringFromRequest('summary');
                $description = getStringFromRequest('description');
                echo get_formulas_results($group, $atid, $extra_fields, 
$status, $assigned_to, $priority, $summary, $description);

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

Summary of changes:
 src/common/tracker/ArtifactExpression.class.php | 6 ++++++
 src/common/tracker/actions/ajax.php             | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
FusionForge

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

Reply via email to