Skip to content

Commit

Permalink
Merge pull request #24 from Indicia-Team/hotfix-league_reports
Browse files Browse the repository at this point in the history
Hotfix league reports
  • Loading branch information
johnvanbreda committed Oct 13, 2015
2 parents 4ef3401 + 679cb72 commit c5cdcf0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @var string The application files version number.
*/
$config['version'] = '0.9.1.7';
$config['release_date'] = '2015-10-08';
$config['release_date'] = '2015-10-10';
$config['repository'] = 'https://github.com/Indicia-Team/warehouse/releases';

?>
4 changes: 2 additions & 2 deletions reports/library/users/filterable_record_counts_league.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
FROM people p
JOIN users u ON u.person_id=p.id AND u.deleted=false AND u.id<>1
JOIN cache_occurrences o ON o.created_by_id=u.id
#filters#
#agreements_join#
#joins#
WHERE #sharing_filter#
AND p.deleted=false
#filters#
</query>
<order_bys>
<order_by>value DESC</order_by>
Expand All @@ -20,6 +20,6 @@
<columns>
<column name="id" visible="false" sql="u.id" />
<column name="name" display="Recorder" sql="COALESCE(p.first_name || ' ', '') || p.surname" />
<column name="value" display="No. of Species" sql="COUNT(o.id)" aggregate="true"/>
<column name="value" display="No. of Records" sql="COUNT(o.id)" aggregate="true"/>
</columns>
</report>
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>

<report title="Species counts league position for records, with standard params" description="Retrieves your position in the league table for count of records.">
<report title="Records counts league position for records, with standard params" description="Retrieves your position in the league table for count of records.">
<query website_filter_field="o.website_id" standard_params="true">
SELECT * FROM (
SELECT #columns#
FROM people p
JOIN users u ON u.person_id=p.id AND u.deleted=false AND u.id&lt;&gt;1
JOIN cache_occurrences o ON o.created_by_id=u.id
#filters#
JOIN cache_occurrences o ON o.created_by_id=u.id
#agreements_join#
#joins#
WHERE #sharing_filter#
AND p.deleted=false
#filters#
#group_bys#
) AS sub WHERE id=#user_id#
</query>
Expand Down
2 changes: 1 addition & 1 deletion reports/library/users/filterable_species_counts_league.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
FROM people p
JOIN users u ON u.person_id=p.id AND u.deleted=false AND u.id&lt;&gt;1
JOIN cache_occurrences o ON o.created_by_id=u.id
#filters#
#agreements_join#
#joins#
WHERE #sharing_filter#
AND p.deleted=false
#filters#
</query>
<order_bys>
<order_by>value DESC</order_by>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
FROM people p
JOIN users u ON u.person_id=p.id AND u.deleted=false AND u.id&lt;&gt;1
JOIN cache_occurrences o ON o.created_by_id=u.id
#filters#
#agreements_join#
#joins#
WHERE #sharing_filter#
AND p.deleted=false
#filters#
#group_bys#
) AS sub WHERE id=#user_id#
</query>
Expand All @@ -24,6 +24,6 @@
<columns>
<column name="id" visible="false" sql="u.id" />
<column name="position" display="League position" sql="row_number() over (order by count(DISTINCT CASE o.zero_abundance WHEN true THEN NULL ELSE o.taxa_taxon_list_external_key END) desc)" aggregate="true" />
<column name="value" display="No. of taxa" sql="count(distinct o.taxa_taxon_list_external_key)" aggregate="true" />
<column name="value" display="No. of taxa" sql="count(DISTINCT CASE o.zero_abundance WHEN true THEN NULL ELSE o.taxa_taxon_list_external_key END)" aggregate="true" />
</columns>
</report>

0 comments on commit c5cdcf0

Please sign in to comment.