/
en_us.fndefs.php
2565 lines (2562 loc) · 71.2 KB
/
en_us.fndefs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/*************************************************************************************************
* Copyright 2020 JPL TSolucio, S.L. -- This file is a part of TSOLUCIO coreBOS Customizations.
* Licensed under the vtiger CRM Public License Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You can redistribute it and/or modify it
* under the terms of the License. JPL TSolucio, S.L. reserves all rights not expressly
* granted by the License. coreBOS distributed by JPL TSolucio S.L. is distributed in
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Unless required by
* applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT ANY WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing
* permissions and limitations under the License. You may obtain a copy of the License
* at <http://corebos.org/documentation/doku.php?id=en:devel:vpl11>
*************************************************************************************************
* Module : Workflow Expression Function Definitions
* Version : 1.0
* Definition Template *
'function name' => array( // see functions in modules/com_vtiger_workflow/expression_engine/VTExpressionsManager.inc
'name' => usually the same as function name but may be different, will be shown to user,
'desc' => description of the function,
'params' => parameters of the function, array(
'param name' => array(
'type' => 'String' | 'Boolean' | 'Integer' | 'Float' | 'Date' | 'DateTime' | 'Multiple',
'optional' => true/false,
'desc' => 'description of the parameter',
)
),
'categories' => array of categories the function belongs to
'examples' => array of one-line examples,
)
# the list of categories can be found n modules/com_vtiger_workflow/expression_engine/VTExpressionsManager.inc (expressionFunctionCategories)
# translators: translate 'desc' and 'type' entries only
*************************************************************************************************/
$WFExpressionFunctionDefinitons = array(
'concat' => array(
'name' => 'concat(a, b,...)',
'desc' => 'Combine multiple text elements into one',
'params' => array(
array(
'name' => 'a',
'type' => 'String',
'optional' => false,
'desc' => 'any literal text string or valid field name',
),
array(
'name' => 'b',
'type' => 'String',
'optional' => false,
'desc' => 'any literal text string or valid field name',
),
),
'categories' => array('Text'),
'examples' => array(
"concat(firstname, ' ', lastname)",
),
),
'coalesce' => array(
'name' => 'coalesce(a, b,...)',
'desc' => 'Returns the first non-empty value found in the list of parameters',
'params' => array(
array(
'name' => 'a',
'type' => 'Multiple',
'optional' => false,
'desc' => 'any value or valid field name',
),
array(
'name' => 'b',
'type' => 'Multiple',
'optional' => true,
'desc' => 'any value or valid field name',
),
),
'categories' => array('Text'),
'examples' => array(
'coalesce(email1, email2)'
),
),
'time_diffdays' => array(
'name' => 'time_diffdays(a, b)',
'desc' => 'Calculates the difference of time (in days) between two specific date fields',
'params' => array(
array(
'name' => 'a',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'b',
'type' => 'Date',
'optional' => true,
'desc' => 'any valid date or date type field name. if left empty the current date will be used',
),
),
'categories' => array('Date and Time'),
'examples' => array(
'time_diffdays(invoicedate, duedate)',
'time_diffdays(duedate)',
),
),
'time_diffyears' => array(
'name' => 'time_diffyears(a, b)',
'desc' => 'Calculates the difference of time (in years) between two specific date fields',
'params' => array(
array(
'name' => 'a',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'b',
'type' => 'Date',
'optional' => true,
'desc' => 'any valid date or date type field name. if left empty the current date will be used',
),
),
'categories' => array('Date and Time'),
'examples' => array(
'time_diffyears(invoicedate, duedate)',
'time_diffyears(duedate)',
),
),
'time_diffweekdays' => array(
'name' => 'time_diffweekdays(a, b)',
'desc' => 'Calculates the difference of time (in days) between two specific date fields excluding weekends',
'params' => array(
array(
'name' => 'a',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'b',
'type' => 'Date',
'optional' => true,
'desc' => 'any valid date or date type field name. if left empty the current date will be used',
),
),
'categories' => array('Date and Time'),
'examples' => array(
'time_diffweekdays(invoicedate, duedate)',
'time_diffweekdays(duedate)',
),
),
'time_diff' => array(
'name' => 'time_diff(a, b)',
'desc' => 'Calculates the difference of time (in seconds) between two specific date fields',
'params' => array(
array(
'name' => 'a',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'b',
'type' => 'Date',
'optional' => true,
'desc' => 'any valid date or date type field name. if left empty the current date will be used',
),
),
'categories' => array('Date and Time'),
'examples' => array(
'time_diff(invoicedate, duedate)',
'time_diff(duedate)',
),
),
'holidaydifference' => array(
'name' => 'holidaydifference(startDate, endDate, include_saturdays, holidays)',
'desc' => 'Calculates the difference of time (in days) between two specific date fields, excluding Saturdays and Holidays if given. Unlike networkdays it does not include the enddate so, usually, there is a one day difference',
'params' => array(
array(
'name' => 'startDate',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'endDate',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'include_saturdays',
'type' => 'Integer',
'optional' => false,
'desc' => 'if set to 0, Saturdays will not be added, if set to any other value, they will be added',
),
array(
'name' => 'holidays',
'type' => 'String',
'optional' => false,
'desc' => 'name of an Information Map that contains the holiday dates to exclude<br>'.nl2br(htmlentities("<map>\n<information>\n<infotype>Holidays in France 2020</infotype>\n<value>date1</value>\n<value>date2</value>\n</information>\n</map>")).'</pre>',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"holidaydifference('2020-01-01', '2020-06-30', 0, 'holidays in Spain 2020')",
"holidaydifference('2020-01-01', '2020-06-30', 1, 'holidays in Spain 2020')",
"holidaydifference('2020-01-01', '2020-06-30', 0, 'holidays in France 2020')",
),
),
'networkdays' => array(
'name' => 'networkdays(startDate, endDate, holidays)',
'desc' => 'Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Unlike holidaydifference it includes the enddate so, usually, there is a one day difference',
'params' => array(
array(
'name' => 'startDate',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'endDate',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name, today will be used if not given',
),
array(
'name' => 'holidays',
'type' => 'String',
'optional' => true,
'desc' => 'name of an Information Map that contains the holiday dates to exclude<br>'.nl2br(htmlentities("<map>\n<information>\n<infotype>Holidays in France 2020</infotype>\n<value>date1</value>\n<value>date2</value>\n</information>\n</map>")).'</pre>',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"networkdays('2020-01-01', '2020-06-30', 'holidays in Spain 2020')",
"networkdays('2020-01-01', '2020-06-30', 'holidays in France 2020')",
),
),
'isholidaydate' => array(
'name' => 'isholidaydate(date, saturdayisholiday, holidays)',
'desc' => 'Returns true if the given date falls on a holiday, Sunday or Saturday. If Saturday is considered a holiday or not can be defined.',
'params' => array(
array(
'name' => 'date',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'saturdayisholiday',
'type' => 'Boolean',
'optional' => false,
'desc' => 'if set to 1, Saturdays will be considered as non-work days (like Sunday)',
),
array(
'name' => 'holidays',
'type' => 'String',
'optional' => true,
'desc' => 'comma-separated list of holidays or the name of an Information Map that contains the holiday dates<br>'.nl2br(htmlentities("<map>\n<information>\n<infotype>Holidays in France 2020</infotype>\n<value>date1</value>\n<value>date2</value>\n</information>\n</map>")).'</pre>',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"isholidaydate('2021-01-01', 0, 'holidays in Spain 2021')",
"isholidaydate('2021-01-01', 1, 'holidays in Spain 2021')",
"isholidaydate('2021-01-01', 0, 'holidays in France 2021')",
),
),
'aggregate_time' => array(
'name' => 'aggregate_time(relatedModuleName, relatedModuleField, conditions)',
'desc' => 'This function returns an aggregate time of a field on a related module with optional filtering of the records',
'params' => array(
array(
'name' => 'relatedModuleName',
'type' => 'String',
'optional' => false,
'desc' => 'related module to aggregate',
),
array(
'name' => 'relatedModuleField',
'type' => 'String',
'optional' => false,
'desc' => 'related field name to aggregate',
),
array(
'name' => 'conditions',
'type' => 'String',
'optional' => true,
'desc' => 'optional condition used to filter the records: [field,op,value,glue],[...]',
),
),
'categories' => array('Statistics'),
'examples' => array(
"aggregate_time('InventoryDetails','quantity*listprice')"
),
),
'add_days' => array(
'name' => 'add_days(datefield, noofdays)',
'desc' => 'Compute a new date based on a given date with a specified number of days added',
'params' => array(
array(
'name' => 'datefield',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'noofdays',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of days',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"add_days(2020-10-10,60)",
"add_days(2020-10-12,40)",
),
),
'add_workdays' => array(
'name' => 'add_workdays(date, numofdays, addsaturday, holidays)',
'desc' => 'Compute a working days date based on a given date with a specified number of days, Saturdays and holidays added',
'params' => array(
array(
'name' => 'date',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'numofdays',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of days',
),
array(
'name' => 'addsaturday',
'type' => 'Integer',
'optional' => false,
'desc' => 'if set to 0, Saturdays will not be added, if set to any other value, they will be added',
),
array(
'name' => 'holidays',
'type' => 'String',
'optional' => false,
'desc' => 'name of an Information Map that contains the holiday dates to exclude',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"add_dadd_workdaysays('2020-10-01', '40', 2, 'holidays in 2020')",
"add_workdays('2020-10-01', '60', 3, 'holidays in 2020')",
),
),
'sub_days' => array(
'name' => 'sub_days(datefield, noofdays)',
'desc' => 'Compute a new date based on a given date with a specified number of days deducted',
'params' => array(
array(
'name' => 'datefield',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'noofdays',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of days',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"sub_days(2020-10-01,60)",
"sub_days(2020-10-01,40)",
),
),
'sub_workdays' => array(
'name' => 'sub_workdays(date, numofdays, removesaturday, holidays)',
'desc' => 'Compute a new working days date based on a given date with a specified number of days, Saturday and holiday deducted',
'params' => array(
array(
'name' => 'date',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'numofdays',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of days',
),
array(
'name' => 'removesaturday',
'type' => 'Integer',
'optional' => false,
'desc' => 'if set to 0, Saturdays will not be added, if set to any other value, they will be added',
),
array(
'name' => 'holidays',
'type' => 'String',
'optional' => false,
'desc' => 'name of an Information Map that contains the holiday dates to exclude',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"sub_workdays('2020-10-01', '60', 0, 'holidays in 2020')",
"sub_workdays('2020-10-01', '60', 0, 'holidays in 2020')",
),
),
'add_months' => array(
'name' => 'add_months(datefield, noofmonths)',
'desc' => 'Compute a new date based on a given date with a specified number of months added',
'params' => array(
array(
'name' => 'datefield',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'noofmonths',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of months',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"add_months('2020-10-01', '10')",
"add_months('2020-10-01', '5')",
),
),
'sub_months' => array(
'name' => 'sub_months(datefield, noofmonths)',
'desc' => 'Compute a new date based on a given date with a specified number of months deducted',
'params' => array(
array(
'name' => 'datefield',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'noofmonths',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of months',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"sub_months('2020-10-01', 5)",
),
),
'add_time' => array(
'name' => 'add_time(timefield, minutes)',
'desc' => 'Compute a new time based on a given time, with the specified minutes added',
'params' => array(
array(
'name' => 'timefield',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid time or time type field name',
),
array(
'name' => 'minutes',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of minutes',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"add_time(start_time, 180)",
"add_time('12:00', 40)",
),
),
'sub_time' => array(
'name' => 'sub_time(timefield, minutes)',
'desc' => 'Compute a new time based on a given time, with the specified minutes deducted',
'params' => array(
array(
'name' => 'timefield',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid time or time type field name',
),
array(
'name' => 'minutes',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of minutes',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"sub_time(start_time, 90)",
"sub_time('12:00', 90)",
),
),
'today' => array(
'name' => "get_date('today')",
'desc' => 'This function returns the current date as a date value',
'params' => array(
array(
'name' => 'today',
'type' => 'String',
'optional' => true,
'desc' => 'the string today',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"get_date('today')'",
),
),
'today' => array(
'name' => "get_date('now')",
'desc' => 'This function returns the current date-time as a date value',
'params' => array(
array(
'name' => 'now',
'type' => 'String',
'optional' => true,
'desc' => 'the string now',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"get_date('now')",
),
),
'tomorrow' => array(
'name' => "get_date('tomorrow')",
'desc' => 'This function returns tomorrow date as a date value',
'params' => array(
array(
'name' => 'tomorrow',
'type' => 'String',
'optional' => false,
'desc' => 'the word tomorrow',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"get_date('tomorrow')",
),
),
'yesterday' => array(
'name' => "get_date('yesterday')",
'desc' => 'This function returns yesterday date as a date value.',
'params' => array(
array(
'name' => 'yesterday',
'type' => 'String',
'optional' => false,
'desc' => 'the word yesterday',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"get_date('yesterday')",
),
),
'time' => array(
'name' => "get_date('time')",
'desc' => 'This function returns the current time.',
'params' => array(
array(
'name' => 'time',
'type' => 'String',
'optional' => false,
'desc' => 'the word time',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"get_date('time')"
),
),
'format_date' => array(
'name' => 'format_date(date,format)',
'desc' => 'This function applies a specific format to a date.',
'params' => array(
array(
'name' => 'date',
'type' => 'Date',
'optional' => false,
'desc' => 'the date you need to format',
),
array(
'name' => 'format',
'type' => 'String',
'optional' => false,
'desc' => 'PHP date format specification',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"format_date('2020-06-20','d-m-Y')",
"format_date(due_date,'d-m-Y H:i:s')",
),
),
'next_date' => array(
'name' => 'get_nextdate(startDate, days, holidays, include_weekend)',
'desc' => 'Compute a next date based on a given date with specified days, Saturday and holiday excluded',
'params' => array(
array(
'name' => 'startDate',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'days',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of days',
),
array(
'name' => 'holidays',
'type' => 'String',
'optional' => true,
'desc' => 'name of an Information Map that contains the holiday dates to include',
),
array(
'name' => 'include_weekend',
'type' => 'Integer',
'optional' => true,
'desc' => 'if set to 0, weekend will not be added, if set to any other value, they will be included',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"get_nextdate('2020-10-01', '15,30', 'holidays in 2020', 0)",
"get_nextdate('2020-10-01', '30', 'holidays in 2020' ,1)",
),
),
'next_date_laborable' => array(
'name' => 'get_nextdatelaborable(startDate,days,holidays,saturday_laborable)',
'desc' => 'Compute a next working date based on a given date with specified days, Saturday and holiday excluded',
'params' => array(
array(
'name' => 'startDate',
'type' => 'Date',
'optional' => false,
'desc' => 'any valid date or date type field name',
),
array(
'name' => 'days',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of days',
),
array(
'name' => 'holidays',
'type' => 'String',
'optional' => true,
'desc' => 'name of an Information Map that contains the holiday dates to include',
),
array(
'name' => 'saturday_laborable',
'type' => 'Integer',
'optional' => true,
'desc' => 'if set to 0, weekend will not be added, if set to any other value, they will be included',
),
),
'categories' => array('Date and Time'),
'examples' => array(
"get_nextdate('2020-10-01', '15,30', 'holidays in 2020', 0)",
"get_nextdate('2020-10-01', '30', 'holidays in 2020', 1)",
),
),
'stringposition' => array(
'name' => 'stringposition(haystack,needle)',
'desc' => 'This function allows you to find the position of the first occurrence of a substring in a string.',
'params' => array(
array(
'name' => 'haystack',
'type' => 'String',
'optional' => false,
'desc' => 'Specifies the string to search in',
),
array(
'name' => 'needle',
'type' => 'String',
'optional' => false,
'desc' => 'Specifies the string to find',
),
),
'categories' => array('Text'),
'examples' => array(
"stringposition('abc','a')",
),
),
'stringlength' => array(
'name' => 'stringlength(string)',
'desc' => 'This function returns the length of a string.',
'params' => array(
array(
'name' => 'string',
'type' => 'String',
'optional' => false,
'desc' => 'Specifies the string to measure',
),
),
'categories' => array('Text'),
'examples' => array(
"stringlength('Strings')",
),
),
'stringreplace' => array(
'name' => 'stringreplace(search,replace,subject)',
'desc' => 'This function returns a string with all occurrences of search in subject replaced with the given replace value.',
'params' => array(
array(
'name' => 'search',
'type' => 'String',
'optional' => false,
'desc' => 'the value being searched for',
),
array(
'name' => 'replace',
'type' => 'String',
'optional' => false,
'desc' => 'the replacement value',
),
array(
'name' => 'subject',
'type' => 'String',
'optional' => false,
'desc' => 'the string being searched and replaced on',
),
),
'categories' => array('Text'),
'examples' => array(
"stringreplace('ERICA','JON','MIKE AND ERICA ') //wants to replace erica with jon",
),
),
'regexreplace' => array(
'name' => 'regexreplace(pattern,replace,subject)',
'desc' => 'This function returns a string with all occurrences of regex pattern in subject replaced with the given replace value.',
'params' => array(
array(
'name' => 'pattern',
'type' => 'String',
'optional' => false,
'desc' => 'the regex pattern being searched for',
),
array(
'name' => 'replace',
'type' => 'String',
'optional' => false,
'desc' => 'the replacement value',
),
array(
'name' => 'subject',
'type' => 'String',
'optional' => false,
'desc' => 'the string being searched and replaced on',
),
),
'categories' => array('Text'),
'examples' => array(
"regexreplace('[A-za-z]+','J','MIKE AND ERICA ') //will return all Js"
),
),
'randomstring' => array(
'name' => 'randomstring(length)',
'desc' => 'This function returns a random string of the given length.',
'params' => array(
array(
'name' => 'length',
'type' => 'Integer',
'optional' => false,
'desc' => 'number of random characters to return',
),
),
'categories' => array('Text'),
'examples' => array(
'randomstring(12) // 02E373931343',
),
),
'randomnumber' => array(
'name' => 'randomnumber(min,max)',
'desc' => 'This function returns a random number.',
'params' => array(
array(
'name' => 'min',
'type' => 'Integer',
'optional' => true,
'desc' => 'minimum random number to return',
),
array(
'name' => 'max',
'type' => 'Integer',
'optional' => true,
'desc' => 'maximum random number to return. If minimum is given, maximum is mandatory.',
),
),
'categories' => array('Math'),
'examples' => array(
'randomnumber(12) // some random number because maximum is missing',
'randomnumber() // some random number',
'randomnumber(1,8) // some random number between 1 and 8 inclusive',
),
),
'faker' => array(
'name' => 'faker(operation,parameters)',
'desc' => 'This function will generate fake data.',
'params' => array(
array(
'name' => 'operation',
'type' => 'String',
'optional' => false,
'desc' => 'function that you want to use',
),
array(
'name' => 'parameters',
'type' => 'String',
'optional' => true,
'desc' => 'parameters that a specific faker function has',
),
),
'categories' => array('Text'),
'examples' => array(
'faker(\'sentence\',3) // Quae eaque adipisci.',
'faker(\'randomDigit\') // 2',
'<a href="https://github.com/fzaninotto/Faker">Here, you can find the faker functions.</a>'
),
),
'power' => array(
'name' => 'power(base, exponential)',
'desc' => 'This function is used to calculate the power of any number such as calculating squares and cube on integer fields.',
'params' => array(
array(
'name' => 'base',
'type' => 'Integer',
'optional' => false,
'desc' => 'the base to exponent',
),
array(
'name' => 'exponential',
'type' => 'Integer',
'optional' => false,
'desc' => 'the number of exponent to base',
),
),
'categories' => array('Math'),
'examples' => array(
'power(2, 3)',
),
),
'log' => array(
'name' => 'log(number, base)',
'desc' => 'This function is used to calculate the logarithm of any number with the given base.',
'params' => array(
array(
'name' => 'number',
'type' => 'Integer',
'optional' => false,
'desc' => 'the number to logarithm',
),
array(
'name' => 'base',
'type' => 'Integer',
'optional' => true,
'desc' => 'logarithm base, if not given the natural logarithm will be used',
),
),
'categories' => array('Math'),
'examples' => array(
'log(10)',
'log(10, 10)',
),
),
'substring' => array(
'name' => 'substring(stringfield,start,length)',
'desc' => 'This function returns the portion of stringfield specified by the start and length parameters.',
'params' => array(
array(
'name' => 'stringfield',
'type' => 'String',
'optional' => false,
'desc' => 'The string from which to extract the substring',
),
array(
'name' => 'start',
'type' => 'Integer',
'optional' => false,
'desc' => 'Specifies where to start in the string, 0 is the first character in the string. A negative number counts backward from the end of the string',
),
array(
'name' => 'length',
'type' => 'Integer',
'optional' => true,
'desc' => 'Specifies the length of the returned string. If the length parameter is 0, NULL, or FALSE it returns an empty string',
),
),
'categories' => array('Text'),
'examples' => array(
'substring("Hello world",1,8)',
),
),
'uppercase' => array(
'name' => 'uppercase(stringfield)',
'desc' => 'This function converts a specified string to upper case.',
'params' => array(
array(
'name' => 'string',
'type' => 'String',
'optional' => false,
'desc' => 'The string to convert to upper case',
),
),
'categories' => array('Text'),
'examples' => array(
"uppercase('hello world')",
),
),
'lowercase' => array(
'name' => 'lowercase(stringfield)',
'desc' => 'This function converts a specified string to lower case.',
'params' => array(
array(
'name' => 'string',
'type' => 'String',
'optional' => false,
'desc' => 'The string to convert to lower case',
),
),
'categories' => array('Text'),
'examples' => array(
"lowercase('HELLO WORLD')",
),
),
'uppercasefirst' => array(
'name' => 'uppercasefirst(stringfield)',
'desc' => 'This function converts the first character of the given string to upper case.',
'params' => array(
array(
'name' => 'stringfield',
'type' => 'String',
'optional' => false,
'desc' => 'The string to convert first character to upper case',
),
),
'categories' => array('Text'),
'examples' => array(
"uppercasefirst('hello world')",
),
),
'uppercasewords' => array(
'name' => 'uppercasewords(stringfield)',
'desc' => 'This function converts the first character of each word in a string to upper case.',
'params' => array(
array(
'name' => 'stringfield',
'type' => 'String',
'optional' => false,
'desc' => 'The string to convert each first character to upper case',
),
),
'categories' => array('Text'),
'examples' => array(
"uppercasewords('hello world')",
),
),
'num2str' => array(
'name' => 'num2str(number|field, language)',
'desc' => 'This function converts a number into its textual representation.',
'params' => array(
array(
'name' => 'number|field',
'type' => 'Number',
'optional' => false,
'desc' => 'valid number or field name',
),
array(
'name' => 'language',
'type' => 'String',
'optional' => false,
'desc' => 'The language you want the textual representation in',
),
),
'categories' => array('Text'),
'examples' => array(
"num2str('2017.34','en')",
),
),
'number_format' => array(
'name' => 'number_format(number, decimals, decimal_separator, thousands_separator)',
'desc' => 'This function formats a number with grouped thousands.',
'params' => array(
array(
'name' => 'number',
'type' => 'Number',