[Devel] [GIT] OpenBioMaps GIT repository, branch devel_2.0 updated: relation 'internal language'

banm at vocs.unideb.hu banm at vocs.unideb.hu
Wed Jun 14 18:17:31 CEST 2017


    The project "OpenBioMaps GIT repository":

    The branch, devel_2.0 has been updated
       via  90bf7bd1c931d9ccbd907a4be0c23fcd41709094 (commit)
      from  55b634c558be713809088f5d0797faf0446eb429 (commit)


- Log -----------------------------------------------------------------
commit 90bf7bd1c931d9ccbd907a4be0c23fcd41709094
Author: Bán Miklós <banm at vocs.unideb.hu>
Date:   Wed Jun 14 18:01:52 2017 +0200

relation 'internal language'
This is an extension to create cross column checkis in upload forms
It has own flexible syntax:

The relation `language` definition:

rel_field = rel_statement | rel_type = rel_value

explanation:
IF the related cell value (rel_field) match to (rel_statement) THEN  (rel_type) function will be applied with (rel_value) over current cell value or ...

rel_type is a function related to the field type
It works with the following field types:
datum:          funcion:       year            extraxt year component from a datum string
text,numeric:   function:      minmax          minmax range check
all type:       function:      obligatory      change obligatory setting
rel_statement can be a regexp based function. In
case statement should be start with !! and followed by a regexp e.g.  !!^(d{2})$
If statement is regexp rel_value also can be a function
.       means replace current cell value with matched string from the matched string from the rel_field
.+      means append current cell value to matched string from the rel_field
+.      means append matched string from the rel_field to the current cell value

examples:
In a numeric cell with min:max range (5:50):
sex=female|minmax=20:40

If the related 'sex' field's value is 'female' the min:max range will be
changed to 20:40

In a date cell:
year=!!^(d{4})$|year=.

If the related 'year' field contains four digits the current cell value
will be replaces with these numbers

In a non-obligatory numeric field:
clutch_size=3|obligatory=1

If the related clutch_size field value is '3' this field is obligatory
to fill.

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

Summary of changes:
 libs/upload_funcs.php |  100 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 91 insertions(+), 9 deletions(-)

-- 
OpenBioMaps GIT repository


More information about the Devel mailing list