diff --git a/application/config/version.php b/application/config/version.php index 3275348405..e86a3a3b10 100644 --- a/application/config/version.php +++ b/application/config/version.php @@ -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'; ?> diff --git a/application/helpers/report_standard_params_occurrences.php b/application/helpers/report_standard_params_occurrences.php index 1eb4221b4d..8ee424b6ff 100644 --- a/application/helpers/report_standard_params_occurrences.php +++ b/application/helpers/report_standard_params_occurrences.php @@ -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' + ), ); } @@ -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#") + ) + ), ); } @@ -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( @@ -459,7 +470,7 @@ public static function getLegacyStructureParameters() { 'wheres' => array( array('value'=>'', 'operator'=>'', 'sql'=>"o.images is not null") ) - ), + ) ); } @@ -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' ); } diff --git a/modules/cache_builder/db/version_0_1_1/.gitignore b/modules/cache_builder/db/version_0_1_1/.gitignore deleted file mode 100644 index 86d0cb2726..0000000000 --- a/modules/cache_builder/db/version_0_1_1/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/modules/cache_builder/db/version_1_15_0/201611121607_cache_occurrences_id_diff.sql b/modules/cache_builder/db/version_1_15_0/201611121607_cache_occurrences_id_diff.sql new file mode 100644 index 0000000000..ce20ccbec5 --- /dev/null +++ b/modules/cache_builder/db/version_1_15_0/201611121607_cache_occurrences_id_diff.sql @@ -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)'; \ No newline at end of file diff --git a/modules/cache_builder/db/version_1_15_0/201611121607_cache_occurrences_id_diff_data.sql b/modules/cache_builder/db/version_1_15_0/201611121607_cache_occurrences_id_diff_data.sql new file mode 100644 index 0000000000..86389c9d0d --- /dev/null +++ b/modules/cache_builder/db/version_1_15_0/201611121607_cache_occurrences_id_diff_data.sql @@ -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; \ No newline at end of file