Пример #1
0
 /**
  * Define a form that is used to capture a set of predetermined values that apply to every record during an import.
  */
 public function fixed_values_form()
 {
     $srefs = array();
     $systems = spatial_ref::system_list();
     foreach ($systems as $code => $title) {
         $srefs[] = "{$code}:{$title}";
     }
     $retVal = array('website_id' => array('display' => 'Website', 'description' => 'Select the website to import records into.', 'datatype' => 'lookup', 'population_call' => 'direct:website:id:title', 'filterIncludesNulls' => true), 'survey_id' => array('display' => 'Survey', 'description' => 'Select the survey to import records into.', 'datatype' => 'lookup', 'population_call' => 'direct:survey:id:title', 'linked_to' => 'website_id', 'linked_filter_field' => 'website_id'), 'sample:entered_sref_system' => array('display' => 'Spatial Ref. System', 'description' => 'Select the spatial reference system used in this import file. Note, if you have a file with a mix of spatial reference systems then you need a ' . 'column in the import file which is mapped to the Sample Spatial Reference System field containing the spatial reference system code.', 'datatype' => 'lookup', 'lookup_values' => implode(',', $srefs)), 'occurrence:fkFilter:taxa_taxon_list:taxon_list_id' => array('display' => 'Species list', 'description' => 'Select the species checklist which will be used when attempting to match species names.', 'datatype' => 'lookup', 'population_call' => 'direct:taxon_list:id:title', 'linked_to' => 'website_id', 'linked_filter_field' => 'website_id', 'filterIncludesNulls' => true), 'occurrence:record_status' => array('display' => 'Record Status', 'description' => 'Select the initial status for imported species records', 'datatype' => 'lookup', 'lookup_values' => 'C:Data entry complete/unverified,V:Verified,I:Data entry still in progress', 'default' => 'C'));
     if (self::_check_module_active('occurrence_associations')) {
         $retVal['useAssociations'] = array('display' => 'Use Associations', 'description' => 'Select if this import uses occurrence associations: implies two species records uploaded for each entry in the file.', 'datatype' => 'checkbox');
     }
     // default off
     $retVal['occurrence_association:fkFilter:association_type:termlist_id'] = array('display' => 'Term list for association types', 'description' => 'Select the term list which will be used to match the association types.', 'datatype' => 'lookup', 'population_call' => 'direct:termlist:id:title');
     $retVal['occurrence_2:fkFilter:taxa_taxon_list:taxon_list_id'] = array('display' => 'Second Species list', 'description' => 'Select the species checklist which will be used when attempting to match second species names.', 'datatype' => 'lookup', 'population_call' => 'direct:taxon_list:id:title', 'linked_to' => 'website_id', 'linked_filter_field' => 'website_id', 'filterIncludesNulls' => true);
     $retVal['occurrence_2:record_status'] = array('display' => 'Record Status', 'description' => 'Select the initial status for second imported species records', 'datatype' => 'lookup', 'lookup_values' => 'C:Data entry complete/unverified,V:Verified,I:Data entry still in progress', 'default' => 'C');
     return $retVal;
 }
Пример #2
0
 /**
  * Define a form that is used to capture a set of predetermined values that apply to every record during an import.
  */
 public function fixed_values_form()
 {
     $srefs = array();
     $systems = spatial_ref::system_list();
     foreach ($systems as $code => $title) {
         $srefs[] = "{$code}:{$title}";
     }
     $sample_methods = array(":Defined in file");
     $terms = $this->db->select('id, term')->from('list_termlists_terms')->where('termlist_external_key', 'indicia:sample_methods')->orderby('term', 'asc')->get()->result();
     foreach ($terms as $term) {
         $sample_methods[] = $term->id . ":" . $term->term;
     }
     $location_types = array(":No filter");
     $terms = $this->db->select('id, term')->from('list_termlists_terms')->where('termlist_external_key', 'indicia:location_types')->orderby('term', 'asc')->get()->result();
     foreach ($terms as $term) {
         $location_types[] = $term->id . ':' . $term->term;
     }
     return array('website_id' => array('display' => 'Website', 'description' => 'Select the website to import records into.', 'datatype' => 'lookup', 'population_call' => 'direct:website:id:title'), 'survey_id' => array('display' => 'Survey', 'description' => 'Select the survey to import records into.', 'datatype' => 'lookup', 'population_call' => 'direct:survey:id:title', 'linked_to' => 'website_id', 'linked_filter_field' => 'website_id'), 'sample:entered_sref_system' => array('display' => 'Spatial Ref. System', 'description' => 'Select the spatial reference system used in this import file. Note, if you have a file with a mix of spatial reference systems then you need a ' . 'column in the import file which is mapped to the Sample Spatial Reference System field containing the spatial reference system code.', 'datatype' => 'lookup', 'lookup_values' => implode(',', $srefs)), 'sample:sample_method_id' => array('display' => 'Sample Method', 'description' => 'Select the sample method used for records in this import file. Note, if you have a file with a mix of sample methods then you need a ' . 'column in the import file which is mapped to the Sample Sample Method field, containing the sample method.', 'datatype' => 'lookup', 'lookup_values' => implode(',', $sample_methods)), 'fkFilter:location:location_type_id' => array('display' => 'Location Type', 'description' => 'If this import file includes samples which reference locations records, you can restrict the type of locations looked ' . 'up by setting this location type. It is not currently possible to use a column in the file to do this on a sample by sample basis.', 'datatype' => 'lookup', 'lookup_values' => implode(',', $location_types)));
 }
Пример #3
0
<div id="details">
<?php 
echo $metadata;
?>
  <fieldset>
  <legend>Location details</legend>
  <input type="hidden" name="location:id" value="<?php 
echo html::initial_value($values, 'location:id');
?>
" />
  <?php 
echo data_entry_helper::text_input(array('label' => 'Name', 'fieldname' => 'location:name', 'default' => html::initial_value($values, 'location:name'), 'validation' => 'required', 'disabled' => $disabled));
echo data_entry_helper::text_input(array('label' => 'Code', 'fieldname' => 'location:code', 'default' => html::initial_value($values, 'location:code'), 'disabled' => $disabled));
echo data_entry_helper::select(array('label' => 'Type', 'fieldname' => 'location:location_type_id', 'default' => html::initial_value($values, 'location:location_type_id'), 'lookupValues' => $other_data['type_terms'], 'blankText' => '<Please select>', 'disabled' => $disabled));
echo data_entry_helper::textarea(array('label' => 'Comment', 'fieldname' => 'location:comment', 'default' => html::initial_value($values, 'location:comment'), 'disabled' => $disabled));
echo data_entry_helper::sref_and_system(array('label' => 'Spatial Ref', 'fieldname' => 'location:centroid_sref', 'geomFieldname' => 'location:centroid_geom', 'default' => html::initial_value($values, 'location:centroid_sref'), 'defaultGeom' => html::initial_value($values, 'location:centroid_geom'), 'systems' => spatial_ref::system_list(), 'defaultSystem' => html::initial_value($values, 'location:centroid_sref_system'), 'class' => 'control-width-3', 'validation' => 'required', 'disabled' => $disabled));
?>
  <input type="hidden" name="location:boundary_geom" id="imp-boundary-geom" value="<?php 
echo $boundary_geom;
?>
"/>
  <p class="instruct">Zoom the map in by double-clicking then single click on the location's centre to set the
  spatial reference. The more you zoom in, the more accurate the reference will be.</p>
  <?php 
$readAuth = data_entry_helper::get_read_auth(0 - $_SESSION['auth_user']->id, kohana::config('indicia.private_key'));
echo map_helper::map_panel(array('readAuth' => $readAuth, 'presetLayers' => array('osm'), 'editLayer' => true, 'layers' => array(), 'initial_lat' => 52, 'initial_long' => -2, 'initial_zoom' => 7, 'width' => 870, 'height' => 400, 'initialFeatureWkt' => $centroid_geom, 'standardControls' => $disabled_input === 'YES' ? array('layerSwitcher', 'panZoomBar') : array('layerSwitcher', 'panZoomBar', 'drawPolygon', 'drawLine', 'modifyFeature'), 'allowPolygonRecording' => true));
echo data_entry_helper::autocomplete(array('label' => 'Parent location', 'fieldname' => 'location:parent_id', 'table' => 'location', 'captionField' => 'name', 'valueField' => 'id', 'extraParams' => $readAuth, 'default' => html::initial_value($values, 'location:parent_id'), 'defaultCaption' => html::initial_value($values, 'parent:name'), 'disabled' => $disabled));
if ($this->auth->logged_in('CoreAdmin')) {
    //Only core admin can create public locations.
    echo data_entry_helper::checkbox(array('label' => 'Available to all websites', 'fieldname' => 'location:public', 'default' => html::initial_value($values, 'location:public'), 'disabled' => $disabled));
}
Пример #4
0
 /**
  * Define a form that is used to capture a set of predetermined values that apply to every record during an import.
  */
 public function fixed_values_form()
 {
     $srefs = array();
     $systems = spatial_ref::system_list();
     foreach ($systems as $code => $title) {
         $srefs[] = "{$code}:{$title}";
     }
     return array('website_id' => array('display' => 'Website', 'description' => 'Select the website to import records into.', 'datatype' => 'lookup', 'population_call' => 'direct:website:id:title'), 'survey_id' => array('display' => 'Survey', 'description' => 'Select the survey to import records into.', 'datatype' => 'lookup', 'population_call' => 'direct:survey:id:title', 'linked_to' => 'website_id', 'linked_filter_field' => 'website_id'), 'sample:entered_sref_system' => array('display' => 'Spatial Ref. System', 'description' => 'Select the spatial reference system used in this import file. Note, if you have a file with a mix of spatial reference systems then you need a ' . 'column in the import file which is mapped to the Sample Spatial Reference System field containing the spatial reference system code.', 'datatype' => 'lookup', 'lookup_values' => implode(',', $srefs)), 'fkFilter:taxa_taxon_list:taxon_list_id' => array('display' => 'Species list', 'description' => 'Select the species checklist which will be used when attempting to match species names.', 'datatype' => 'lookup', 'population_call' => 'direct:taxon_list:id:title', 'linked_to' => 'website_id', 'linked_filter_field' => 'website_id'), 'occurrence:record_status' => array('display' => 'Record Status', 'description' => 'Select the initial status for imported records', 'datatype' => 'lookup', 'lookup_values' => 'C:Data entry complete/unverified,V:Verified,I:Data entry still in progress', 'default' => 'C'));
 }