Calculated Fields Form - Version 1.1.117

Version Description

  • Modifies the SUM operation.
  • Implements the SIGMA operation.
  • Implements the CURRENTLATLNG operation in the Distance operations module (Developer and Platinum plugin versions).
Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Calculated Fields Form
Version 1.1.117
Comparing to
See all releases

Code changes from version 1.1.116 to 1.1.117

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://cff.dwbooster.com
4
  Tags: form,quote form,contact form,form builder,calculator,calculated,quote calculator,forms,form editor,advanced forms,payment calculator,payment,recurring payment,quote,fields,calculated field,price calculator,email,form design,paypal,equation editor,formula,equation,quote calculator,post,posts,plugin,widget,admin,sidebar,images,image,page,shortcode,products form,woocommerce,addons,layout,session,post,cookie,get,webhook,Dropbox,pdf,language
5
  Requires at least: 3.0.5
6
  Tested up to: 6.0
7
- Stable tag: 1.1.116
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -965,6 +965,12 @@ A: Please, follow the steps below:
965
 
966
  == Changelog ==
967
 
 
 
 
 
 
 
968
  = 1.1.116 =
969
 
970
  * Modifies the calculated fields to reduce the number of endless loops.
@@ -1010,9 +1016,4 @@ A: Please, follow the steps below:
1010
 
1011
  = 1.1.108 =
1012
 
1013
- * Implements the create form from the templates library module.
1014
-
1015
- = 1.1.107 =
1016
-
1017
- * Allows the associate audio tutorials to the form fields.
1018
- * Modifies the WooCommerce add-on to support third-party plugins like 'Ajax add to cart for WooCommerce'.
4
  Tags: form,quote form,contact form,form builder,calculator,calculated,quote calculator,forms,form editor,advanced forms,payment calculator,payment,recurring payment,quote,fields,calculated field,price calculator,email,form design,paypal,equation editor,formula,equation,quote calculator,post,posts,plugin,widget,admin,sidebar,images,image,page,shortcode,products form,woocommerce,addons,layout,session,post,cookie,get,webhook,Dropbox,pdf,language
5
  Requires at least: 3.0.5
6
  Tested up to: 6.0
7
+ Stable tag: 1.1.117
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
965
 
966
  == Changelog ==
967
 
968
+ = 1.1.117 =
969
+
970
+ * Modifies the SUM operation.
971
+ * Implements the SIGMA operation.
972
+ * Implements the CURRENTLATLNG operation in the Distance operations module (Developer and Platinum plugin versions).
973
+
974
  = 1.1.116 =
975
 
976
  * Modifies the calculated fields to reduce the number of endless loops.
1016
 
1017
  = 1.1.108 =
1018
 
1019
+ * Implements the create form from the templates library module.
 
 
 
 
 
changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
3
  = 1.1.116 =
4
 
5
  * Modifies the calculated fields to reduce the number of endless loops.
1
  == Changelog ==
2
 
3
+ = 1.1.117 =
4
+
5
+ * Modifies the SUM operation.
6
+ * Implements the SIGMA operation.
7
+ * Implements the CURRENTLATLNG operation in the Distance operations module (Developer and Platinum plugin versions).
8
+
9
  = 1.1.116 =
10
 
11
  * Modifies the calculated fields to reduce the number of endless loops.
cp_calculatedfieldsf_free.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Calculated Fields Form
4
  Plugin URI: https://cff.dwbooster.com
5
  Description: Create forms with field values calculated based in other form field values.
6
- Version: 1.1.116
7
  Text Domain: calculated-fields-form
8
  Author: CodePeople
9
  Author URI: https://cff.dwbooster.com
@@ -15,7 +15,7 @@ if ( ! defined( 'WP_DEBUG' ) || true != WP_DEBUG ) {
15
  }
16
 
17
  // Defining main constants
18
- define( 'CP_CALCULATEDFIELDSF_VERSION', '1.1.116' );
19
  define( 'CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
20
  define( 'CP_CALCULATEDFIELDSF_BASE_PATH', dirname( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
21
  define( 'CP_CALCULATEDFIELDSF_BASE_NAME', plugin_basename( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
3
  Plugin Name: Calculated Fields Form
4
  Plugin URI: https://cff.dwbooster.com
5
  Description: Create forms with field values calculated based in other form field values.
6
+ Version: 1.1.117
7
  Text Domain: calculated-fields-form
8
  Author: CodePeople
9
  Author URI: https://cff.dwbooster.com
15
  }
16
 
17
  // Defining main constants
18
+ define( 'CP_CALCULATEDFIELDSF_VERSION', '1.1.117' );
19
  define( 'CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
20
  define( 'CP_CALCULATEDFIELDSF_BASE_PATH', dirname( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
21
  define( 'CP_CALCULATEDFIELDSF_BASE_NAME', plugin_basename( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
inc/cpcff_main.inc.php CHANGED
@@ -1055,7 +1055,7 @@ if ( ! class_exists( 'CPCFF_MAIN' ) ) {
1055
  } // End rocket_exclude_inline_js
1056
 
1057
  public static function breeze_check_content( $content ) {
1058
- if ( strpos( $content, 'form_structure_' ) !== false ) {
1059
  global $cff_breeze_content_bk;
1060
  $cff_breeze_content_bk = $content;
1061
  }
1055
  } // End rocket_exclude_inline_js
1056
 
1057
  public static function breeze_check_content( $content ) {
1058
+ if ( strpos( $content, 'form_structure_' ) !== false || strpos( $content, 'cp_calculatedfieldsf_fbuilder_config_' ) !== false ) {
1059
  global $cff_breeze_content_bk;
1060
  $cff_breeze_content_bk = $content;
1061
  }
js/fbuilder-pro-public.jquery.js CHANGED
@@ -1,4 +1,4 @@
1
- $.fbuilder['version'] = '1.1.116';
2
  $.fbuilder['controls'] = $.fbuilder['controls'] || {};
3
  $.fbuilder['forms'] = $.fbuilder['forms'] || {};
4
 
1
+ $.fbuilder['version'] = '1.1.117';
2
  $.fbuilder['controls'] = $.fbuilder['controls'] || {};
3
  $.fbuilder['forms'] = $.fbuilder['forms'] || {};
4
 
js/modules/01_mathematical_logical/admin/module_admin.js CHANGED
@@ -15,7 +15,8 @@ fbuilderjQuery[ 'fbuilder' ][ 'modules' ][ 'default' ] = {
15
  { "value" : "(", "code" : "(", "tip" : "" },
16
  { "value" : ")", "code" : ")", "tip" : "" },
17
  { "value" : ",", "code" : ",", "tip" : "" },
18
- { "value" : "SUM", "code" : "SUM(", "tip" : "Returns the sum of values passed by parameter. <strong>SUM(3,10,11)</strong> returns <strong>24</strong>" },
 
19
  { "value" : "CONCATENATE", "code" : "CONCATENATE(", "tip" : "Returns a text with all parameters concatenated. <strong>CONCATENATE(1, 2, 3)</strong> returns <strong>123</strong>" },
20
  { "value" : "REMAINDER", "code" : "REMAINDER(", "tip" : "The remainder is the integer left over after dividing one integer by another to produce an integer quotient (integer division). <strong>REMAINDER(7, 2)</strong> returns <strong>1</strong>" },
21
  { "value" : "ABS", "code" : "ABS(", "tip" : "Returns the absolute value of the number passed as parameter. <strong>ABS(number)</strong>" },
15
  { "value" : "(", "code" : "(", "tip" : "" },
16
  { "value" : ")", "code" : ")", "tip" : "" },
17
  { "value" : ",", "code" : ",", "tip" : "" },
18
+ { "value" : "SUM", "code" : "SUM(", "tip" : "Returns the sum of the values passed as parameter.<br><br><strong>SUM(3,10,11)</strong><br>returns <strong>24</strong><br></br>If the last parameter is a function, calls the function with each of the numbers, and sums the results.<br><br>Sum of squares:<br><strong>SUM(1,2,3,4, function(x){return POW(x,2)})</strong><br>returns <strong>30</strong><br><br>Sum even numbers:<br><strong>SUM(1,2,3,4, function(x){if(x%2 == 0) return x;})</strong><br>returns <strong>6</strong>" },
19
+ { "value" : "SIGMA", "code" : "SIGMA(", "tip" : "<strong>SIGMA(n, m, callback);</strong><br>Applies the summation from x=n to m, passing x to the callback function.<br><br><strong>SIGMA(1, 4, function(x){return 2*x+1;})</strong><br>returns <strong>24</strong><br></br><strong>SIGMA(1, 3, function(x){return x*(x+1);})</strong><br>returns <strong>20</strong>" },
20
  { "value" : "CONCATENATE", "code" : "CONCATENATE(", "tip" : "Returns a text with all parameters concatenated. <strong>CONCATENATE(1, 2, 3)</strong> returns <strong>123</strong>" },
21
  { "value" : "REMAINDER", "code" : "REMAINDER(", "tip" : "The remainder is the integer left over after dividing one integer by another to produce an integer quotient (integer division). <strong>REMAINDER(7, 2)</strong> returns <strong>1</strong>" },
22
  { "value" : "ABS", "code" : "ABS(", "tip" : "Returns the absolute value of the number passed as parameter. <strong>ABS(number)</strong>" },
js/modules/01_mathematical_logical/public/module_public.js CHANGED
@@ -140,23 +140,63 @@ fbuilderjQuery[ 'fbuilder' ][ 'modules' ][ 'default' ] = {
140
  {
141
  window.SUM = window.sum = function ()
142
  {
143
- var r = 0, t;
144
- for(var i in arguments)
145
- {
146
- if(Array.isArray(arguments[i]))
147
- r += SUM.apply(this,arguments[i]);
148
- else if(jQuery.isPlainObject(arguments[i]))
149
- r += SUM.apply(this,Object.values(arguments[i]));
150
- else
151
  {
152
- t = arguments[i]*1;
153
- if(!isNaN(t)) r += t;
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
  }
156
  return r;
157
  };
158
  } // End if window.SUM
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  if(window.CONCATENATE == undefined)
161
  {
162
  window.CONCATENATE = window.concatenate = function ()
140
  {
141
  window.SUM = window.sum = function ()
142
  {
143
+ var r = 0, l = arguments.length, t, callback = function(x){return x;};
144
+ if(l) {
145
+ if(typeof arguments[l-1] == 'function') {
146
+ callback = arguments[l-1];
147
+ l -= 1;
148
+ }
149
+ for(var i=0; i < l; i++)
 
150
  {
151
+ if(Array.isArray(arguments[i]))
152
+ r += SUM.apply(this,arguments[i].concat(callback));
153
+ else if(jQuery.isPlainObject(arguments[i]))
154
+ r += SUM.apply(this,Object.values(arguments[i]).concat(callback));
155
+ else
156
+ {
157
+ t = arguments[i]*1;
158
+ if(!isNaN(t))
159
+ {
160
+ t = callback(t);
161
+ if(!isNaN(t)) r += t;
162
+ }
163
+
164
+ }
165
  }
166
  }
167
  return r;
168
  };
169
  } // End if window.SUM
170
 
171
+ if(window.SIGMA == undefined)
172
+ {
173
+ window.SIGMA = window.sigma = function ()
174
+ {
175
+ var r = 0,
176
+ l = arguments.length,
177
+ n,m,callback,t;
178
+ if(l == 3) {
179
+
180
+ n = parseInt(arguments[0]);
181
+ m = parseInt(arguments[1]);
182
+ callback = arguments[2];
183
+
184
+ if(
185
+ !isNaN(n) &&
186
+ !isNaN(m) &&
187
+ typeof callback == 'function'
188
+ ) {
189
+
190
+ for(var i=n; i<=m; i++) {
191
+ t = callback(i);
192
+ if(!isNaN(t)) r += t;
193
+ }
194
+ }
195
+ }
196
+ return r;
197
+ };
198
+ } // End if window.SIGMA
199
+
200
  if(window.CONCATENATE == undefined)
201
  {
202
  window.CONCATENATE = window.concatenate = function ()