Skip to content

Commit

Permalink
Merge branch 'feature-downloads' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvanbreda committed Jul 19, 2017
2 parents 6d3eaba + 854a56d commit ec751cc
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 162 deletions.
53 changes: 33 additions & 20 deletions reports/library/occurrences/filterable_occurrences_download.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
<column name='family' display='Family' sql='cttl.family_taxon' datatype='text' />
<column name='taxonversionkey' display='TaxonVersionKey' sql='o.taxa_taxon_list_external_key' datatype="text" />
<column name='taxa_taxon_list_id' visible='false' sql='o.taxa_taxon_list_id' datatype='integer' />
<column name='record_comment' display='Comment' sql="onf.comment" datatype="text" />
<column name='location_name' display='Site name' sql="case when onf.sensitivity_precision is null and onf.privacy_precision is null then o.location_name else 'Sensitive. Lat long is approximate.' end" datatype='text' />
<column name='entered_sref' display='Grid ref' sql="case snf.entered_sref_system when '4326' then snf.public_entered_sref else replace(snf.public_entered_sref, ' ', '') end" datatype='text' />
<column name='lat' display='Latitude' sql="substring(st_astext(st_transform(st_centroid(o.public_geom), 4326)) from E'POINT\\(.+ (.+)\\)')" datatype="text" />
Expand All @@ -60,43 +59,57 @@
sql="get_sref_precision(snf.public_entered_sref, snf.entered_sref_system, snf.attr_sref_precision)" />
<column name='output_sref' display='Output map ref' sql="onf.output_sref" datatype='text' />
<column name='output_sref_system' display='Output map ref system' sql="onf.output_sref_system" datatype='text' />
<column name='attr_biotope' display='Biotope' sql="snf.attr_biotope" datatype='text' />
<column name="vicecounty_number" display="VC number" sql="vc.code" datatype="text" />
<column name="vicecounty" display="Vice county" sql="vc.name" datatype="text" />
<column name="vicecounty_code" display="VC code" sql="vc.code" datatype="text" />
<column name="date" display="Date interpreted" datatype="date" />
<column name="date_start" display="Date from" sql="o.date_start" visible="true" />
<column name="date_end" display="Date to" sql="o.date_end" visible="true" />
<column name="date_type" sql="o.date_type" visible="false" />
<column name="date" display="Interpreted date" datatype="date" />
<column name='input_date' sql='o.created_on' display='Input on date' datatype='date' />
<column name='last_edit_date' sql='o.updated_on' display='Last edited on date' datatype='date' />
<column name='recorder' display='Recorder' sql="rtrim(snf.recorders, ', ')" datatype="text" />
<column name='determiner' display='Determiner' datatype="text"
sql="CASE WHEN onf.attr_det_full_name IS NULL THEN
CASE WHEN onf.attr_det_last_name IS NULL THEN NULL ELSE onf.attr_det_last_name || COALESCE(', ' || onf.attr_det_first_name, '') END
ELSE onf.attr_det_full_name END" />
<column name='verifier' display='Verifier' sql='onf.verifier' datatype="text" />
<column name='verified_on' display='Verified on' sql='o.verified_on' datatype="text" />
<column name='sample_comment' display='Sample comment' sql="snf.comment" datatype="text" />
<column name='certainty' display="Recorder certainty" sql="CASE o.certainty WHEN 'C' THEN 'Certain' WHEN 'L' THEN 'Likely' WHEN 'U' THEN 'Uncertain' END" />
<column name='attr_sex' display='Sex' sql="onf.attr_sex" datatype='text' />
<column name='attr_stage' display='Stage' sql="onf.attr_stage" datatype='text' />
<column name='attr_sex_stage_count' display='Count of sex or state' sql="onf.attr_sex_stage_count" datatype='text' />
<column name='zeroabundance' display='Zero abundance' sql='upper(cast (o.zero_abundance as character))' datatype="text" />
<column name='record_status' display='State'
<column name='record_comment' display='Comment' sql="onf.comment" datatype="text" />
<column name='sample_comment' display='Sample comment' sql="snf.comment" datatype="text" />
<column name='images' display='Images' sql="case when onf.media is null then null else '#uploadFolder#' || replace(onf.media, ',', ', #uploadFolder#') end"/>
<column name='input_date' sql='o.created_on' display='Input on date' datatype='date' />
<column name='last_edit_date' sql='o.updated_on' display='Last edited on date' datatype='date' />
<column name='record_status' display='Verification status 1'
sql="CASE o.record_status
WHEN 'V' THEN 'Accepted'
WHEN 'C' THEN 'Unconfirmed'
WHEN 'R' THEN 'Rejected'
WHEN 'I' THEN 'Input still in progress'
WHEN 'D' THEN 'Queried'
WHEN 'S' THEN 'Awaiting check'
ELSE o.record_status
END" />
<column name="record_substatus" display="Verification status 2"
sql="CASE o.record_status
WHEN 'V' THEN
CASE o.record_substatus WHEN 1 THEN 'Accepted as correct' WHEN 2 THEN 'Accepted as considered correct' ELSE 'Accepted' END
CASE o.record_substatus WHEN 1 THEN 'correct' WHEN 2 THEN 'Considered correct' ELSE NULL END
WHEN 'C' THEN
CASE o.record_substatus WHEN 3 THEN 'Plausible' ELSE 'Record Submitted' END
WHEN 'D' THEN 'Queried'
CASE o.record_substatus WHEN 3 THEN 'Plausible' ELSE 'Not reviewed' END
WHEN 'R' THEN
CASE o.record_substatus WHEN 4 THEN 'Rejected as considered incorrect' WHEN 5 THEN 'Rejected as incorrect' ELSE 'Rejected' END
WHEN 'I' THEN 'Input still in progress'
WHEN 'S' THEN 'Awaiting check'
ELSE o.record_status END" />
<column name='belongs_to_user' display='Belongs to user' sql="CASE CAST(o.created_by_id AS character varying) WHEN '#currentUser#' THEN true ELSE false END" visible="false" />
<column name='certainty' display="Recorder certainty" sql="CASE o.certainty WHEN 'C' THEN 'Certain' WHEN 'L' THEN 'Likely' WHEN 'U' THEN 'Uncertain' END" />
CASE o.record_substatus WHEN 4 THEN 'Unable to verify' WHEN 5 THEN 'Incorrect' ELSE NULL END
ELSE NULL
END" />
<column name='verifier' display='Verifier' sql='onf.verifier' datatype="text" />
<column name='verified_on' display='Verified on' sql='o.verified_on' datatype="text" />
<column name='licence_code' sql='onf.licence_code' display="Licence" />
<column name='attr_det_full_name' display='Determiner name' sql="onf.attr_det_full_name" datatype='text' />
<!-- the following can only be filled in for sure if we have an exact match with the recorder, since we only know the record created by ID.-->
<column name='recorder_person_id' sql="case when snf.recorders = p.surname || ', ' || p.first_name or snf.recorders = p.first_name || ' ' || p.surname then cast(p.id as varchar(20)) else 'unknown' end" />
<column name='determiner_person_id' sql="case when snf.recorders = onf.attr_det_last_name || ', ' || onf.attr_det_first_name
or snf.recorders = onf.attr_det_first_name || ' ' || onf.attr_det_last_name
or snf.recorders = onf.attr_det_full_name then cast(p.id as varchar(20)) else 'unknown' end" />
<column name='images' display='Images' sql="case when onf.media is null then null else '#uploadFolder#' || replace(onf.media, ',', ', #uploadFolder#') end"/>
<column name='licence_code' sql='onf.licence_code' display="Licence" />
<column name='belongs_to_user' display='Belongs to user' sql="CASE CAST(o.created_by_id AS character varying) WHEN '#currentUser#' THEN true ELSE false END" visible="false" />
</columns>
</report>
54 changes: 34 additions & 20 deletions reports/library/occurrences/filterable_occurrences_download_gis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<column name='taxon_group' display='Taxon group' sql='cttl.taxon_group' datatype='text' />
<column name='taxonversionkey' display='TaxonVersionKey' sql='o.taxa_taxon_list_external_key' datatype="text" />
<column name='taxa_taxon_list_id' visible='false' sql='o.taxa_taxon_list_id' datatype='integer' />
<column name='record_comment' display='Comment' sql="onf.comment" datatype="text" />
<column name='location_name' display='Site name' sql="case when onf.sensitivity_precision is null and onf.privacy_precision is null then o.location_name else 'Sensitive. Lat long is approximate.' end" datatype='text' />
<column name='entered_sref' display='Grid ref' sql="case snf.entered_sref_system when '4326' then snf.public_entered_sref else replace(snf.public_entered_sref, ' ', '') end" datatype='text' />
<column name='lat' display='Latitude' sql="substring(st_astext(st_transform(st_centroid(o.public_geom), 4326)) from E'POINT\\(.+ (.+)\\)')" datatype="text" />
Expand All @@ -58,44 +57,59 @@
sql="get_sref_precision(snf.public_entered_sref, snf.entered_sref_system, snf.attr_sref_precision)" />
<column name='output_sref' display='Output map ref' sql="onf.output_sref" datatype='text' />
<column name='output_sref_system' display='Output map ref system' sql="onf.output_sref_system" datatype='text' />
<column name='attr_biotope' display='Biotope' sql="snf.attr_biotope" datatype='text' />
<column name="vicecounty_number" display="VC number" sql="vc.code" datatype="text" />
<column name="vicecounty" display="Vice county" sql="vc.name" datatype="text" />
<column name="vicecounty_code" display="VC code" sql="vc.code" datatype="text" />
<column name="date" display="Date interpreted" datatype="date" />
<column name="date_start" display="Date from" sql="o.date_start" visible="true" />
<column name="date_end" display="Date to" sql="o.date_end" visible="true" />
<column name="date_type" sql="o.date_type" visible="false" />
<column name="date" display="Interpreted date" datatype="date" />
<column name='input_date' sql='o.created_on' display='Input on date' datatype='date' />
<column name='last_edit_date' sql='o.updated_on' display='Last edited on date' datatype='date' />
<column name='recorder' display='Recorder' sql="rtrim(snf.recorders, ', ')" datatype="text" />
<column name='determiner' display='Determiner' datatype="text"
sql="CASE WHEN onf.attr_det_full_name IS NULL THEN
CASE WHEN onf.attr_det_last_name IS NULL THEN NULL ELSE onf.attr_det_last_name || COALESCE(', ' || onf.attr_det_first_name, '') END
ELSE onf.attr_det_full_name END" />
<column name='verifier' display='Verifier' sql='onf.verifier' datatype="text" />
<column name='sample_comment' display='Sample comment' sql="snf.comment" datatype="text" />
<column name='certainty' display="Recorder certainty" sql="CASE o.certainty WHEN 'C' THEN 'Certain' WHEN 'L' THEN 'Likely' WHEN 'U' THEN 'Uncertain' END" />
<column name='attr_sex' display='Sex' sql="onf.attr_sex" datatype='text' />
<column name='attr_stage' display='Stage' sql="onf.attr_stage" datatype='text' />
<column name='attr_sex_stage_count' display='Count of sex or state' sql="onf.attr_sex_stage_count" datatype='text' />
<column name='zeroabundance' display='Zero abundance' sql='upper(cast (o.zero_abundance as character))' datatype="text" />
<column name='record_status' display='State'
sql="CASE o.record_status
<column name='record_comment' display='Comment' sql="onf.comment" datatype="text" />
<column name='sample_comment' display='Sample comment' sql="snf.comment" datatype="text" />
<column name='images' display='Images' sql='onf.media' img='true' />
<column name='input_date' sql='o.created_on' display='Input on date' datatype='date' />
<column name='last_edit_date' sql='o.updated_on' display='Last edited on date' datatype='date' />
<column name='record_status' display='Verification status 1'
sql="CASE o.record_status
WHEN 'V' THEN 'Accepted'
WHEN 'C' THEN 'Unconfirmed'
WHEN 'R' THEN 'Rejected'
WHEN 'I' THEN 'Input still in progress'
WHEN 'D' THEN 'Queried'
WHEN 'S' THEN 'Awaiting check'
ELSE o.record_status
END" />
<column name="record_substatus" display="Verification status 2"
sql="CASE o.record_status
WHEN 'V' THEN
CASE o.record_substatus WHEN 1 THEN 'Accepted as correct' WHEN 2 THEN 'Accepted as considered correct' ELSE 'Accepted' END
CASE o.record_substatus WHEN 1 THEN 'correct' WHEN 2 THEN 'Considered correct' ELSE NULL END
WHEN 'C' THEN
CASE o.record_substatus WHEN 3 THEN 'Plausible' ELSE 'Record Submitted' END
WHEN 'D' THEN 'Queried'
CASE o.record_substatus WHEN 3 THEN 'Plausible' ELSE 'Not reviewed' END
WHEN 'R' THEN
CASE o.record_substatus WHEN 4 THEN 'Rejected as considered incorrect' WHEN 5 THEN 'Rejected as incorrect' ELSE 'Rejected' END
WHEN 'I' THEN 'Input still in progress'
WHEN 'S' THEN 'Awaiting check'
ELSE o.record_status END" />
<column name='belongs_to_user' display='Belongs to User' sql="CASE CAST(o.created_by_id AS character varying) WHEN '#currentUser#' THEN true ELSE false END" visible="false" />
<column name='certainty' display="Recorder certainty" sql="CASE o.certainty WHEN 'C' THEN 'Certain' WHEN 'L' THEN 'Likely' WHEN 'U' THEN 'Uncertain' END" />
CASE o.record_substatus WHEN 4 THEN 'Unable to verify' WHEN 5 THEN 'Incorrect' ELSE NULL END
ELSE NULL
END" />
<column name='verifier' display='Verifier' sql='onf.verifier' datatype="text" />
<column name='verified_on' display='Verified on' sql='o.verified_on' datatype="text" />
<column name='licence_code' sql='onf.licence_code' display="Licence" />
<column name='attr_det_full_name' display='Determiner name' sql="onf.attr_det_full_name" datatype='text' />
<!-- the following can only be filled in for sure if we have an exact match with the recorder, since we only know the record created by ID.-->
<column name='recorder_person_id' sql="case when snf.recorders = p.surname || ', ' || p.first_name or snf.recorders = p.first_name || ' ' || p.surname then cast(p.id as varchar(20)) else 'unknown' end" />
<column name='determiner_person_id' sql="case when snf.recorders = onf.attr_det_last_name || ', ' || onf.attr_det_first_name
or snf.recorders = onf.attr_det_first_name || ' ' || onf.attr_det_last_name
or snf.recorders = onf.attr_det_full_name then cast(p.id as varchar(20)) else 'unknown' end" />
<column name='images' display='Images' sql='onf.media' img='true' />
<column name='belongs_to_user' display='Belongs to User' sql="CASE CAST(o.created_by_id AS character varying) WHEN '#currentUser#' THEN true ELSE false END" visible="false" />
<column name='geom' display='Geometry' sql="st_astext(st_transform(o.public_geom, 4326))" datatype="text" />
<column name='point_geom' display='Geometry' sql="st_astext(st_transform(st_centroid(o.public_geom), 4326))" datatype="text" />
<column name='licence_code' sql='onf.licence_code' display="Licence" />
</columns>
</report>
Loading

0 comments on commit ec751cc

Please sign in to comment.