Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvanbreda committed Nov 13, 2016
2 parents 350201a + f030a33 commit 1cd4bff
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
4 changes: 2 additions & 2 deletions application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
/**
* @var string The application files version number.
*/
$config['version'] = '1.14.0';
$config['release_date'] = '2016-11-08';
$config['version'] = '1.15.0';
$config['release_date'] = '2016-11-12';
$config['repository'] = 'https://github.com/Indicia-Team/warehouse/releases';

?>
19 changes: 16 additions & 3 deletions application/helpers/report_standard_params_occurrences.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public static function getOperationParameters() {
'description'=>'Mode for filtering by taxon rank in the hierarchy',
'lookup_values'=>'=:include only this level in the hierarchy,>=:include this level and lower,<=:include this level and higher'
),
'identification_difficulty' => array('datatype'=>'lookup', 'default'=>'', 'display'=>'Identification difficulty operation',
'description'=>'Identification difficulty lookup operation', 'lookup_values'=>'=:is,>=:is at least,<=:is at most'
),
);
}

Expand Down Expand Up @@ -389,7 +392,14 @@ public static function getParameters() {
"join taxa_taxon_designations ttd on ttd.taxon_id=ttlpref.taxon_id and ttd.deleted=false " .
"and ttd.taxon_designation_id in (#taxon_designation_list#)")
),
)
),
'identification_difficulty' => array('datatype'=>'integer', 'default'=>'', 'display'=>'Identification difficulty',
'description'=>'Identification difficulty on a scale of 1 to 5',
'wheres' => array(
array('value'=>'', 'operator'=>'',
'sql'=>"coalesce(o.identification_difficulty, 0) #identification_difficulty_op# #identification_difficulty#")
)
),
);
}

Expand Down Expand Up @@ -427,7 +437,8 @@ public static function getLegacyStructureParameters() {
'edited_date_to' => array(
'wheres' => array(
array('value'=>'', 'operator'=>'',
'sql'=>"('#edited_date_to#'='Click here' OR (o.cache_updated_on <= '#edited_date_to#'::timestamp OR (length('#edited_date_to#')<=10 AND o.cache_updated_on < cast('#input_date_to#' as date) + '1 day'::interval)))")
'sql'=>"('#edited_date_to#'='Click here' OR (o.cache_updated_on <= '#edited_date_to#'::timestamp ' .
'OR (length('#edited_date_to#')<=10 AND o.cache_updated_on < cast('#input_date_to#' as date) + '1 day'::interval)))")
)
),
'edited_date_age' => array(
Expand Down Expand Up @@ -459,7 +470,7 @@ public static function getLegacyStructureParameters() {
'wheres' => array(
array('value'=>'', 'operator'=>'', 'sql'=>"o.images is not null")
)
),
)
);
}

Expand All @@ -476,12 +487,14 @@ public static function getDefaultParameterValues() {
'input_form_list_op'=>'in',
'location_list_op'=>'in',
'indexed_location_list_op'=>'in',
'identification_difficulty_op'=>'=',
'occurrence_id_op_context'=>'=',
'website_list_op_context'=>'in',
'survey_list_op_context'=>'in',
'input_form_list_op_context'=>'in',
'location_list_op_context'=>'in',
'indexed_location_list_op_context'=>'in',
'identification_difficulty_op_context'=>'=',
'release_status'=>'R'
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE cache_occurrences_functional ADD COLUMN identification_difficulty integer;

COMMENT ON COLUMN cache_occurrences_functional.identification_difficulty IS
'Identification difficulty assigned by the data_cleaner module, on a scale from 1 (easy) to 5 (difficult)';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- #slow script#

update cache_occurrences_functional o
set identification_difficulty=vrd.value::integer
from verification_rule_data vrd
join verification_rules vr on vr.id=vrd.verification_rule_id and vr.deleted=false
and vr.test_type='IdentificationDifficulty'
where vrd.header_name='Data' and upper(vrd.key)=o.taxa_taxon_list_external_key and vrd.deleted=false;

0 comments on commit 1cd4bff

Please sign in to comment.