Skip to content
Snippets Groups Projects
Commit 61cd3a73 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

First assumed complete version of the barkbeetle module

parent d2b7ac9d
Branches
No related tags found
No related merge requests found
Showing
with 475 additions and 60 deletions
...@@ -50,6 +50,7 @@ public class VIPSLogicApplication extends Application ...@@ -50,6 +50,7 @@ public class VIPSLogicApplication extends Application
resources.add(no.nibio.vips.logic.modules.barleynetblotch.BarleyNetBlotchModelService.class); resources.add(no.nibio.vips.logic.modules.barleynetblotch.BarleyNetBlotchModelService.class);
resources.add(no.nibio.vips.logic.modules.wheatleafblotch.WheatLeafBlotchModelService.class); resources.add(no.nibio.vips.logic.modules.wheatleafblotch.WheatLeafBlotchModelService.class);
resources.add(no.nibio.vips.logic.modules.roughage.RoughageService.class); resources.add(no.nibio.vips.logic.modules.roughage.RoughageService.class);
resources.add(no.nibio.vips.logic.modules.barkbeetle.BarkbeetleService.class);
resources.add(no.nibio.vips.observationdata.ObservationDataService.class); resources.add(no.nibio.vips.observationdata.ObservationDataService.class);
resources.add(no.nibio.vips.logic.messaging.sms.SMSHandlingService.class); resources.add(no.nibio.vips.logic.messaging.sms.SMSHandlingService.class);
resources.add(no.nibio.vips.logic.modules.applefruitmoth.AppleFruitMothService.class); resources.add(no.nibio.vips.logic.modules.applefruitmoth.AppleFruitMothService.class);
...@@ -70,6 +71,7 @@ public class VIPSLogicApplication extends Application ...@@ -70,6 +71,7 @@ public class VIPSLogicApplication extends Application
private void addRestResourceClasses(Set<Class<?>> resources) { private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(no.nibio.vips.logic.messaging.sms.SMSHandlingService.class); resources.add(no.nibio.vips.logic.messaging.sms.SMSHandlingService.class);
resources.add(no.nibio.vips.logic.modules.applefruitmoth.AppleFruitMothService.class); resources.add(no.nibio.vips.logic.modules.applefruitmoth.AppleFruitMothService.class);
resources.add(no.nibio.vips.logic.modules.barkbeetle.BarkbeetleService.class);
resources.add(no.nibio.vips.logic.modules.barleynetblotch.BarleyNetBlotchModelService.class); resources.add(no.nibio.vips.logic.modules.barleynetblotch.BarleyNetBlotchModelService.class);
resources.add(no.nibio.vips.logic.modules.roughage.RoughageService.class); resources.add(no.nibio.vips.logic.modules.roughage.RoughageService.class);
resources.add(no.nibio.vips.logic.modules.wheatleafblotch.WheatLeafBlotchModelService.class); resources.add(no.nibio.vips.logic.modules.wheatleafblotch.WheatLeafBlotchModelService.class);
......
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
package no.nibio.vips.logic.modules.barkbeetle; package no.nibio.vips.logic.modules.barkbeetle;
import de.micromata.opengis.kml.v_2_2_0.Coordinate;
import de.micromata.opengis.kml.v_2_2_0.Document;
import de.micromata.opengis.kml.v_2_2_0.Kml;
import de.micromata.opengis.kml.v_2_2_0.KmlFactory;
import de.micromata.opengis.kml.v_2_2_0.Placemark;
import java.util.List; import java.util.List;
import javax.ejb.LocalBean; import javax.ejb.LocalBean;
import javax.ejb.Stateless; import javax.ejb.Stateless;
...@@ -26,8 +31,9 @@ import javax.naming.InitialContext; ...@@ -26,8 +31,9 @@ import javax.naming.InitialContext;
import javax.naming.NamingException; import javax.naming.NamingException;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext; import javax.persistence.PersistenceContext;
import no.nibio.vips.logic.util.GISEntityUtil;
import no.nibio.vips.logic.util.Globals;
import no.nibio.vips.logic.util.SessionControllerGetter; import no.nibio.vips.logic.util.SessionControllerGetter;
import org.locationtech.jts.geom.Point;
/** /**
* @copyright 2020 <a href="http://www.nibio.no/">NIBIO</a> * @copyright 2020 <a href="http://www.nibio.no/">NIBIO</a>
...@@ -117,4 +123,51 @@ public class BarkbeetleBean { ...@@ -117,4 +123,51 @@ public class BarkbeetleBean {
trapsite.setTrapsiteRegistrationCollection(registrations); trapsite.setTrapsiteRegistrationCollection(registrations);
return em.merge(trapsite); return em.merge(trapsite);
} }
public Kml getSeasonTrapsitesKml(Integer season, Integer excludeSeasonTrapsiteId, String serverName) {
String iconPath = Globals.PROTOCOL + "://" + serverName + "/images/modules/barkbeetle/";
List<SeasonTrapsite> traps = this.getSeasonTrapsites(season);
// Initialization
final Kml kml = KmlFactory.createKml();
final Document document = kml.createAndSetDocument()
.withName("Barkbillefellelokaliteter").withDescription("Barkbillefellelokaliteter for sesongen " + season);
document.createAndAddStyle()
.withId("trapsite_icon")
.createAndSetIconStyle()
.withScale(0.55)
.createAndSetIcon()
.withHref(iconPath + "dot_blue.png");
document.createAndAddStyle()
.withId("trapsite_icon_highlighted")
.createAndSetIconStyle()
.withScale(0.55)
.createAndSetIcon()
.withHref(iconPath + "trapsite.png");
String styleUrl = "#trapsite_icon";
GISEntityUtil gisUtil = new GISEntityUtil();
for(SeasonTrapsite trap:traps)
{
if(excludeSeasonTrapsiteId != null && excludeSeasonTrapsiteId.equals(trap.getSeasonTrapsiteId()))
{
continue;
}
final Placemark placemark = document.createAndAddPlacemark()
.withName(trap.getCountyName() + "/" + trap.getMunicipalityName())
.withDescription(
"<ul>"
+ "<li>Eier: " + trap.getOwnerName() + ", tlf: " + trap.getOwnerPhone() + "</li>"
+ "<li>Registrant: <a href='mailto:" + trap.getUserId().getEmail() + "'>" + trap.getUserId().getFirstName() + " " + trap.getUserId().getLastName() + "</a>, tlf: " + trap.getUserId().getPhone() + "</li>"
+ "</ul>")
.withStyleUrl(styleUrl)
.withId(trap.getSeasonTrapsiteId().toString());
final de.micromata.opengis.kml.v_2_2_0.Point point = placemark.createAndSetPoint();
List<Coordinate> coord = point.createAndSetCoordinates();
coord.add(gisUtil.getKMLCoordinateFromJTSCoordinate(trap.getGisGeom().getCoordinate()));
}
return kml;
}
} }
...@@ -49,8 +49,6 @@ import no.nibio.vips.util.ServletUtil; ...@@ -49,8 +49,6 @@ import no.nibio.vips.util.ServletUtil;
import no.nibio.web.forms.FormValidation; import no.nibio.web.forms.FormValidation;
import no.nibio.web.forms.FormValidationException; import no.nibio.web.forms.FormValidationException;
import no.nibio.web.forms.FormValidator; import no.nibio.web.forms.FormValidator;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.CoordinateXYZM;
import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Point;
/** /**
...@@ -171,6 +169,7 @@ public class BarkbeetleController extends HttpServlet { ...@@ -171,6 +169,7 @@ public class BarkbeetleController extends HttpServlet {
{ {
request.setAttribute("userIsAdmin",SessionControllerGetter.getUserBean().authorizeUser(user, VipsLogicRole.BARKBEETLE_ADMIN, VipsLogicRole.BARKBEETLE_COUNTY_ADMIN, VipsLogicRole.SUPERUSER)); request.setAttribute("userIsAdmin",SessionControllerGetter.getUserBean().authorizeUser(user, VipsLogicRole.BARKBEETLE_ADMIN, VipsLogicRole.BARKBEETLE_COUNTY_ADMIN, VipsLogicRole.SUPERUSER));
request.setAttribute("seasonTrapsite", trapsite); request.setAttribute("seasonTrapsite", trapsite);
request.setAttribute("isExtended", trapsite.getTrapsiteType().getTrapsiteTypeId().equals(TrapsiteType.TRAPSITE_TYPE_EXTENDED));
Set<Integer> missingWeeks = new HashSet(trapsite.getTrapsiteType().getTrapsiteTypeId().equals(TrapsiteType.TRAPSITE_TYPE_STANDARD)? Set<Integer> missingWeeks = new HashSet(trapsite.getTrapsiteType().getTrapsiteTypeId().equals(TrapsiteType.TRAPSITE_TYPE_STANDARD)?
Arrays.asList(new Integer[]{21,24,28,33}) Arrays.asList(new Integer[]{21,24,28,33})
: Arrays.asList(new Integer[]{21,24,28,33,37})); : Arrays.asList(new Integer[]{21,24,28,33,37}));
......
/*
* Copyright (c) 2020 NIBIO <http://www.nibio.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the NIBIO Open Source License as published by
* NIBIO, either version 1 of the License, or (at your option) any
* later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* NIBIO Open Source License for more details.
*
* You should have received a copy of the NIBIO Open Source License
* along with VIPSLogic. If not, see <http://www.nibio.no/licenses/>.
*
*/
package no.nibio.vips.logic.modules.barkbeetle;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import no.nibio.vips.util.ServletUtil;
/**
* @copyright 2020 <a href="http://www.nibio.no/">NIBIO</a>
* @author Tor-Einar Skog <tor-einar.skog@nibio.no>
*/
@Path("rest/barkbeetle")
public class BarkbeetleService {
@PersistenceContext(unitName="VIPSLogic-PU")
EntityManager em;
@Context
private HttpServletRequest httpServletRequest;
@GET
@Path("seasontrapsites/{season}/kml")
@Produces("application/vnd.google-earth.kml+xml;charset=utf-8")
public Response getSeasonTrapsites(
@PathParam("season") Integer season,
@QueryParam("excludeSeasonTrapsiteId") Integer excludeSeasonTrapsiteId)
{
return Response.ok().entity(BarkbeetleBean.getInstance().getSeasonTrapsitesKml(season, excludeSeasonTrapsiteId, ServletUtil.getServerName(httpServletRequest))).build();
}
}
File added
File added
File added
src/main/webapp/images/modules/barkbeetle/dot_blue.png

1.82 KiB

src/main/webapp/images/modules/barkbeetle/trapsite.png

16.7 KiB

/*
* Copyright (c) 2020 NIBIO <http://www.nibio.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the NIBIO Open Source License as published by
* NIBIO, either version 1 of the License, or (at your option) any
* later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* NIBIO Open Source License for more details.
*
* You should have received a copy of the NIBIO Open Source License
* along with VIPSLogic. If not, see <http://www.nibio.no/licenses/>.
*
*/
/*
* Map with barkbeetle trap information
* @author Tor-Einar Skog <tor-einar.skog@nibio.no>
*/
var map;
var trapMarker;
function initMap(season, currentSeasonTrapsiteId, currentSeasonTrapsiteCoordinate){
// Background layer is OpenStreetMap
var backgroundLayer = new ol.layer.Tile({
source: new ol.source.OSM({
attributions: [
new ol.Attribution({
html: mapConstants.MAP_ATTRIBUTION
})
]
})
});
// The trapsite layer
var trapLayer = new ol.layer.Vector({
source: new ol.source.Vector({
url: "/rest/barkbeetle/seasontrapsites/" + season + "/kml/" + (currentSeasonTrapsiteId != null ? "?excludeSeasonTrapsiteId=" + currentSeasonTrapsiteId : ""),
projection: "EPSG:3857",
format: new ol.format.KML()
})
});
// Creating the map
map = new ol.Map({
target: 'seasonTrapsiteFormMap',
layers: [backgroundLayer, trapLayer],
//overlays: [popOverlay],
renderer: 'canvas'
});
// Setting zoom and center for the map (need to do this after creating map. so that we kan transform our
// center to correct map projection)
var view = new ol.View({
center: ol.proj.transform([10.0,63.0], 'EPSG:4326', map.getView().getProjection().getCode()),
zoom: 5
});
map.setView(view);
// Marker overlay
trapMarker = new ol.Overlay({
position: currentSeasonTrapsiteId !== null ? ol.proj.transform(currentSeasonTrapsiteCoordinate, 'EPSG:4326', map.getView().getProjection().getCode()) : undefined,
positioning: 'bottom-center',
element: document.getElementById('trapMarker'),
stopEvent: false
});
map.addOverlay(trapMarker);
// Listening for single clicks, position observation pin and updating form element
map.on(['singleclick'], function(evt) {
updateLocationPosition(evt.coordinate);
});
}
function updateLocationPosition(coordinate)
{
var locationPosition = ol.coordinate.toStringXY(ol.proj.transform(coordinate, map.getView().getProjection().getCode(), 'EPSG:4326'),4);
// Set/move location pin
trapMarker.setPosition(coordinate);
// Update form field "location"
var locationEl = document.getElementById("gisGeom");
//console.log(locationEl);
locationEl.value=locationPosition;
// Adding a little animation
$("#gisGeom").animate({borderWidth: "4"},500, function(){
$("#gisGeom").animate({borderWidth: "1"},500, function(){});
});
handleLocationChanged(locationEl);
}
/**
* Places the station marker on the coordinates given in Location input field,
* and centers the map around these coordinates
*/
function updateMarkerPosition()
{
var locationEl = document.getElementById("gisGeom");
var coordinate = locationEl.value.split(",");
coordinate[0] = parseFloat(coordinate[0]);
coordinate[1] = parseFloat(coordinate[1]);
//console.log(coordinate);
var markerPosition = ol.proj.transform(coordinate, 'EPSG:4326', map.getView().getProjection().getCode());
trapMarker.setPosition(markerPosition);
}
\ No newline at end of file
/*
* Copyright (c) 2020 NIBIO <http://www.nibio.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the NIBIO Open Source License as published by
* NIBIO, either version 1 of the License, or (at your option) any
* later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* NIBIO Open Source License for more details.
*
* You should have received a copy of the NIBIO Open Source License
* along with VIPSLogic. If not, see <http://www.nibio.no/licenses/>.
*
*/
/*
* Map with barkbeetle trap information
* @author Tor-Einar Skog <tor-einar.skog@nibio.no>
*/
var map;
var popOverlay;
var poiDetails;
function initMap(season){
// Background layer is OpenStreetMap
var backgroundLayer = new ol.layer.Tile({
source: new ol.source.OSM({
attributions: [
new ol.Attribution({
html: mapConstants.MAP_ATTRIBUTION
})
]
})
});
// The trapsite layer
var trapLayer = new ol.layer.Vector({
source: new ol.source.Vector({
url: "/rest/barkbeetle/seasontrapsites/" + season + "/kml/",
projection: "EPSG:3857",
format: new ol.format.KML()
})
});
// Using Bootstrap's popover plugin. See http://getbootstrap.com/javascript/#popovers
poiDetails = $("#popover");
// Layer for popup
popOverlay = new ol.Overlay({
element: document.getElementById("popover")
});
// Creating the map
map = new ol.Map({
target: 'seasonTrapsiteListMap',
layers: [backgroundLayer, trapLayer],
overlays: [popOverlay],
renderer: 'canvas'
});
// Setting zoom and center for the map (need to do this after creating map. so that we kan transform our
// center to correct map projection)
var view = new ol.View({
center: ol.proj.transform([10.0,63.0], 'EPSG:4326', map.getView().getProjection().getCode()),
zoom: 5
});
map.setView(view);
// On click, display site details in popup
map.on('singleclick', function(evt) {
var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureDetails(pixel);
});
}
// Displays popup with forecasts for a given station
// (if there is a station where the click event is fired)
var displayFeatureDetails = function(pixel, coordinate) {
var feature = map.forEachFeatureAtPixel(pixel, function(feature,layer){
return feature;
});
if (feature) {
// Position the popup, and hiding it
// Resetting information from (possible) former popups
var geometry = feature.getGeometry();
popOverlay.setPosition(geometry.getCoordinates());
poiDetails.popover('destroy');
// Create the popup, showing it
poiDetails.popover({
animation: true,
trigger: 'manual',
html: true,
placement: "auto top",
title: feature.get("name"),
content: feature.get("description")
});
poiDetails.popover('show');
} else {
poiDetails.popover('destroy');
}
};
\ No newline at end of file
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
<title>Barkbilleregistrering: Rediger fellelokalitet for ${season}</title> <title>Barkbilleregistrering: Rediger fellelokalitet for ${season}</title>
</#macro> </#macro>
<#macro custom_js> <#macro custom_js>
<script type="text/javascript" src="/js/constants.js"></script>
<script type="text/javascript" src="/js/3rdparty/ol.js"></script>
<script type="text/javascript" src="/js/modules/barkbeetle/seasonTrapsiteFormMap.js"></script>
<script type="text/javascript" src="/js/resourcebundle.js"></script> <script type="text/javascript" src="/js/resourcebundle.js"></script>
<script src="/js/validateForm.js"></script> <script src="/js/validateForm.js"></script>
<script src="//code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script> <script src="//code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
...@@ -27,17 +30,17 @@ ...@@ -27,17 +30,17 @@
<script type="text/javascript" src="/js/3rdparty/proj4.js"></script> <script type="text/javascript" src="/js/3rdparty/proj4.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var theForm = document.getElementById("${formId}"); var theForm = document.getElementById("${formId}");
// Make sure that there is a date picker present for HTML5 $(document).ready(function() {
// date input fields // Make sure that there is a date picker present for HTML5
if (!Modernizr.inputtypes.date) { // date input fields
$('input[type=date]').datepicker({ dateFormat: 'yy-mm-dd' }); if (!Modernizr.inputtypes.date) {
} $('input[type=date]').datepicker({ dateFormat: 'yy-mm-dd' });
// Load main form definition (for validation) }
loadFormDefinition("seasonTrapsiteForm","/formdefinitions/modules/barkbeetle/"); // Load main form definition (for validation)
loadFormDefinition("seasonTrapsiteForm","/formdefinitions/modules/barkbeetle/");
initMap(${season},${seasonTrapsite.seasonTrapsiteId!"null"},[${(seasonTrapsite.longitude?c)!"0"},${(seasonTrapsite.latitude?c)!"0"}]);
});
function updateMarkerPosition(){
console.info("TODO: updateMarkerPosition");
}
function handleLocationChanged(locationField){ function handleLocationChanged(locationField){
// Input control first // Input control first
...@@ -71,10 +74,21 @@ ...@@ -71,10 +74,21 @@
fetch("/corsproxy/https://proxy1.nibio.no/municipality_cache_ws/kommuneListe/N2000/4326/2019?lon=" + lon + "&lat=" + lat) fetch("/corsproxy/https://proxy1.nibio.no/municipality_cache_ws/kommuneListe/N2000/4326/2019?lon=" + lon + "&lat=" + lat)
.then(response => response.json()) .then(response => response.json())
.then(municInfo =>{ .then(municInfo =>{
theForm["countyNo"].value=municInfo[0]["fylkenr"]; if(municInfo.length == 0)
theForm["countyName"].value=municInfo[0]["fylkenavn"]; {
theForm["municipalityNo"].value=municInfo[0]["komnr"]; alert("Posisjonen er utenfor Norges grenser. Vennligst korriger dette");
theForm["municipalityName"].value=municInfo[0]["komnavn"]; theForm["countyNo"].value = 0;
theForm["countyName"].value = "Utlandet";
theForm["municipalityNo"].value = 0;
theForm["municipalityName"].value = "Utlandet";
}
else
{
theForm["countyNo"].value=municInfo[0]["fylkenr"];
theForm["countyName"].value=municInfo[0]["fylkenavn"];
theForm["municipalityNo"].value=municInfo[0]["komnr"];
theForm["municipalityName"].value=municInfo[0]["komnavn"];
}
} }
) )
.catch( error => console.info(error));; .catch( error => console.info(error));;
...@@ -104,31 +118,45 @@ ...@@ -104,31 +118,45 @@
</#macro> </#macro>
<#macro custom_css> <#macro custom_css>
<link href="//code.jquery.com/ui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" /> <link href="//code.jquery.com/ui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="/css/3rdparty/ol.css"/ >
<style type="text/css">
#seasonTrapsiteFormMap {
height: 600px;
}
</style>
</#macro> </#macro>
<#macro page_contents> <#macro page_contents>
<#if messageKey?has_content> <#if messageKey?has_content>
<div class="alert alert-success">Data ble lagret ${.now}</div> <div class="alert alert-success">Data ble lagret ${.now}</div>
</#if> </#if>
<p>
<a href="/barkbeetle?season=${season}" class="btn btn-default back" role="button">${i18nBundle.back}</a>
</p>
<h1><#if seasonTrapsite.seasonTrapsiteId?has_content>Rediger<#else>Ny</#if> fellelokalitet</h1> <h1><#if seasonTrapsite.seasonTrapsiteId?has_content>Rediger<#else>Ny</#if> fellelokalitet</h1>
<div class="row"> <div class="row">
<div class="col-md-11"> <div class="col-md-11">
<p style="clear: left;"> <p>Alle feller må være av typen BEKA (=Nove, se bildet) og feromon av typen
[Her trengs tekstforslag]: Barkbilleregistreringen er organisert gjennom XXX <a href="http://kjemikonsult.no/Norsk/Produkter.html" target="new">Ipslure</a>
og slik og sånn. Alle feller må være av typen BEKA (også kalt Novefella) (se bildet), og feromonet som (=Norlure; tilsendt fra Nibio). Plasser lokaliteten med et trykk
brukes må være av typen <a href="http://kjemikonsult.no/Norsk/Produkter.html" target="new">Ipslure</a>. Les <a href="/images/modules/barkbeetle/Instruks_2020.pdf">årets instruks</a> på kartet, så genereres koordinater og flere av feltene automatisk. Alle
og <a href="/images/modules/barkbeetle/Montering_av_barkbillefelle.pdf">monteringsanvisningen.</a> øvrige felt med stjerne må fylles inn. Fyll også inn dato og kommentar
nederst i skjemaet dersom montering av feller skjer senere enn 20. april.
Se utdypende informasjon i
<a href="/images/modules/barkbeetle/Instruks_registranter_i_Barkbilleovervakingen.pdf" target="new">Instruks registranter</a>
og <a href="/images/modules/barkbeetle/Montering_av_barkbillefelle.pdf">Monteringsanvisning
Beka-felle</a>
</p>
<p>
<#if seasonTrapsite.seasonTrapsiteId?has_content>
<a href="/barkbeetle?action=registerData&seasonTrapsiteId=${seasonTrapsite.seasonTrapsiteId}" class="btn btn-default" role="button">Registrer data</a>
</#if>
</p> </p>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<img src="/images/modules/barkbeetle/Bilde_BEKA_felle.jpg" style="height: 150px;"/> <img src="/images/modules/barkbeetle/Bilde_BEKA_felle.jpg" style="height: 150px;"/>
</div> </div>
</div> </div>
<p>
<a href="/barkbeetle?season=${season}" class="btn btn-default back" role="button">${i18nBundle.back}</a>
<#if seasonTrapsite.seasonTrapsiteId?has_content>
<a href="/barkbeetle?action=registerData&seasonTrapsiteId=${seasonTrapsite.seasonTrapsiteId}" class="btn btn-default" role="button">Registrer data</a>
</#if>
</p>
<div class="singleBlockContainer"> <div class="singleBlockContainer">
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
...@@ -167,7 +195,7 @@ ...@@ -167,7 +195,7 @@
<button class="btn btn-default" type="button" onclick="convertProjection();">Konverter til WGS84</button> <button class="btn btn-default" type="button" onclick="convertProjection();">Konverter til WGS84</button>
</div> </div>
</label> </label>
<input type="text" class="form-control" id="gisGeom" name="gisGeom" placeholder="Lokalitet" value="${(seasonTrapsite.longitude?c)!""},${(seasonTrapsite.latitude?c)!""}" onblur="validateField(this);" onchange="if(validateField(this)){handleLocationChanged(this);}" /> <input type="text" class="form-control" id="gisGeom" name="gisGeom" placeholder="Lokalitet" value="${(seasonTrapsite.longitude?c)!""},${(seasonTrapsite.latitude?c)!""}" onblur="validateField(this);" onchange="if(validateField(this)){handleLocationChanged(this);updateMarkerPosition();}" />
<span class="help-block" id="${formId}_gisGeom_validation"></span> <span class="help-block" id="${formId}_gisGeom_validation"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -250,9 +278,12 @@ ...@@ -250,9 +278,12 @@
</form> </form>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
Kartet kommer her! <div id="seasonTrapsiteFormMap" class="map">
<div id="popover"></div>
</div>
</div> </div>
</div> </div>
<div style="display: none;"><div id="trapMarker" title="Marker"><img src="/images/modules/barkbeetle/trapsite.png"/></div></div>
</div> </div>
</#macro> </#macro>
<@page_html/> <@page_html/>
\ No newline at end of file
...@@ -22,16 +22,53 @@ ...@@ -22,16 +22,53 @@
<#macro page_contents> <#macro page_contents>
<h1>Fellelokaliteter for sesongen ${season}</h1> <h1>Fellelokaliteter for sesongen ${season}</h1>
<div class="row"> <div class="row">
<div class="col-md-11"> <div class="col-md-7">
<p style="clear: left;"> <p>Barkbilleovervåkingen er organisert gjennom «"Barkbilleadministratorer»
[Her trengs tekstforslag]: Barkbilleregistreringen er organisert gjennom XXX ved Nibio, «Barkbillefylkeskontakter» og «Registranter». Alle feller må være
og slik og sånn. Alle feller må være av typen BEKA (også kalt Novefella) (se bildet), og feromonet som av typen BEKA (også kalt Novefella) (se bildet), og feromonet som brukes må
brukes må være av typen <a href="http://kjemikonsult.no/Norsk/Produkter.html" target="new">Ipslure</a>. Les <a href="/images/modules/barkbeetle/Instruks_2020.pdf">årets instruks</a> være av typen <a href="http://kjemikonsult.no/Norsk/Produkter.html" target="new">Ipslure</a>
og <a href="/images/modules/barkbeetle/Montering_av_barkbillefelle.pdf">monteringsanvisningen.</a> (=Norlure; tilsendt fra Nibio). Les instruksjoner som
</p> er aktuelle for deg nøye, slik som
<a href="/images/modules/barkbeetle/Instruks_Barkbillefylkeskontakter.pdf" target="new">Instruks
Barkbillefylkeskontakter</a>,
<a href="/images/modules/barkbeetle/Instruks_registranter_i_Barkbilleovervakingen.pdf" target="new">Instruks registranter</a>, og
<a href="/images/modules/barkbeetle/Montering_av_barkbillefelle.pdf">Monteringsanvisning
Beka-felle</a> (kun noen få har i tillegg
<a href="/images/modules/barkbeetle/Instruks_utvidet_sesong.pdf" target="new">utvidet
sesong</a> med egen instruksjon).</p>
<p><strong>Barkbillefylkeskontakt</strong> oppretter her lokaliteter for sitt fylke («Legg til
ny») og tildeler disse registranter som sørger for fellemontering, tømming
av feller og fortløpende innlegging av data gjennom sesongen. Det bør være
lokaliteter i alle kommuner som tidligere har vært med (<strong>NB</strong> kommuner før
sammenslåinger etter 2012). Liste over registranter, inkludert navn/telefon
og epost, sendes tor-einar.skog@nibio.no så tidlig som mulig før sesong for
å opprette tilgang i systemet for registrantene. Etter dette får registrantene
innloggingsadgang tilsendt per epost. Se utdypende informasjon i
<a href="/images/modules/barkbeetle/Instruks_Barkbillefylkeskontakter.pdf" target="new">Instruks
Barkbillefylkeskontakter</a> (se også
<a href="/images/modules/barkbeetle/Instruks_registranter_i_Barkbilleovervakingen.pdf" target="new">Instruks
Registranter</a> for å forstå deres oppgaver).</p>
<p><strong>Registranter</strong> må oppdatere informasjon under «Endre lokalitetsinfo» for
sin(e) lokalitet(er) så snart som mulig og sørge for at feller blir montert
innen 20. april. Fellene i standardlokaliteter tømmes etter hver av fire
perioder, dvs. på mandag eller tirsdag i ukene 21, 24, 28 og 33. Data fra
hver tømming skal legges inn under «Registrer» innen mandag i påfølgende uke,
og blir dermed del av en fortløpende kartvisning av barkbillenivået gjennom
sesongen. Se utdypende informasjon i
<a href="/images/modules/barkbeetle/Instruks_registranter_i_Barkbilleovervakingen.pdf" target="new">Instruks
Registranter</a>, og
<a href="/images/modules/barkbeetle/Montering_av_barkbillefelle.pdf">Monteringsanvisning
Beka-felle</a></p>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<img src="/images/modules/barkbeetle/Bilde_BEKA_felle.jpg" style="height: 150px;"/> <img src="/images/modules/barkbeetle/Bilde_BEKA_felle.jpg" style="height: 250px;"/>
</div>
<div class="col-md-4">
<div id="seasonTrapsiteListMap" class="map">
<div id="popover"></div>
</div>
</div> </div>
</div> </div>
<#if userIsAdmin> <#if userIsAdmin>
...@@ -40,11 +77,6 @@ ...@@ -40,11 +77,6 @@
</p> </p>
</#if> </#if>
<div class="singleBlockContainer"> <div class="singleBlockContainer">
<div class="row">
<div class="col-md-12">
<h1>Kartet kommer her!</h1>
</div>
</div>
<div class="row"> <div class="row">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
...@@ -80,12 +112,17 @@ ...@@ -80,12 +112,17 @@
</div> </div>
</#macro> </#macro>
<#macro custom_js> <#macro custom_js>
<script type="text/javascript" src="/js/constants.js"></script>
<script type="text/javascript" src="/js/3rdparty/ol.js"></script>
<script type="text/javascript" src="/js/modules/barkbeetle/seasonTrapsiteListMap.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// TODO? $(document).ready(function() {
initMap(${season});
});
</script> </script>
</#macro> </#macro>
<#macro custom_css> <#macro custom_css>
<link rel="stylesheet" type="text/css" href="/css/3rdparty/ol.css"/ >
<style type="text/css"> <style type="text/css">
td.status_1 { td.status_1 {
background-color: #ffe066 !important; background-color: #ffe066 !important;
...@@ -97,7 +134,9 @@ ...@@ -97,7 +134,9 @@
background-color: #ff6e66 !important; background-color: #ff6e66 !important;
} }
#seasonTrapsiteListMap {
height: 500px;
}
</style> </style>
</#macro> </#macro>
<@page_html/> <@page_html/>
\ No newline at end of file
...@@ -24,23 +24,33 @@ ...@@ -24,23 +24,33 @@
<#if messageKey?has_content> <#if messageKey?has_content>
<div class="alert alert-success">Data ble lagret ${.now}</div> <div class="alert alert-success">Data ble lagret ${.now}</div>
</#if> </#if>
<p>
<a href="/barkbeetle?action=editSeasonTrapsite&season=${seasonTrapsite.season}&seasonTrapsiteId=${seasonTrapsite.seasonTrapsiteId}" class="btn btn-default back" role="button">${i18nBundle.back}</a>
</p>
<h1>Registrer data for lokalitet ${siteName}, sesong ${seasonTrapsite.season}</h1> <h1>Registrer data for lokalitet ${siteName}, sesong ${seasonTrapsite.season}</h1>
<div class="row"> <div class="row">
<div class="col-md-11"> <div class="col-md-11">
<p style="clear: left;"> <p>
[Her trengs tekstforslag]: Barkbilleregistreringen er organisert gjennom XXX Påse at
og slik og sånn. Alle feller må være av typen BEKA (også kalt Novefella) (se bildet), og feromonet som </p>
brukes må være av typen <a href="http://kjemikonsult.no/Norsk/Produkter.html" target="new">Ipslure</a>. Les <a href="/images/modules/barkbeetle/Instruks_2020.pdf">årets instruks</a> <ul>
og <a href="/images/modules/barkbeetle/Montering_av_barkbillefelle.pdf">monteringsanvisningen.</a> <li>alle feller er av typen <strong>BEKA</strong> (=Nove, se bildet) og feromon av typen
<a href="http://kjemikonsult.no/Norsk/Produkter.html" target="new">Ipslure</a>
(= Norlure; tilsendt fra Nibio).</li>
<li>antall biller legges inn for rett tømmeperiode i rett ukenummer</li>
<li>tallet legges inn på rett sted, som enten antall biller eller antall ml (volum målt med målebeger; omregning til antall biller skjer automatisk).</li>
</ul>
<p>
Se utdypende informasjon i
<a href="/images/modules/barkbeetle/Instruks_registranter_i_Barkbilleovervakingen.pdf" target="new">Instruks registranter</a>
og <a href="/images/modules/barkbeetle/Montering_av_barkbillefelle.pdf">Monteringsanvisning
Beka-felle</a>
</p> </p>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<img src="/images/modules/barkbeetle/Bilde_BEKA_felle.jpg" style="height: 150px;"/> <img src="/images/modules/barkbeetle/Bilde_BEKA_felle.jpg" style="height: 150px;"/>
</div> </div>
</div> </div>
<p>
<a href="/barkbeetle?action=editSeasonTrapsite&season=${seasonTrapsite.season}&seasonTrapsiteId=${seasonTrapsite.seasonTrapsiteId}" class="btn btn-default back" role="button">${i18nBundle.back}</a>
</p>
<#if userIsAdmin> <#if userIsAdmin>
<div class="alert alert-info">Registrant: <strong>${seasonTrapsite.userId.firstName} ${seasonTrapsite.userId.lastName}</strong>, tlf <strong>${seasonTrapsite.userId.phone!"Ikke oppgitt"}</strong>, e-post <strong>${seasonTrapsite.userId.email}</strong></div> <div class="alert alert-info">Registrant: <strong>${seasonTrapsite.userId.firstName} ${seasonTrapsite.userId.lastName}</strong>, tlf <strong>${seasonTrapsite.userId.phone!"Ikke oppgitt"}</strong>, e-post <strong>${seasonTrapsite.userId.email}</strong></div>
</#if> </#if>
...@@ -84,10 +94,10 @@ ...@@ -84,10 +94,10 @@
<td><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap1" value="${reg.trap1!"M"}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap1" value="${reg.trap1!"M"}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td>
<td><input class="form-control" type="number" name="${reg.trapsiteRegistrationPK.week}_trap2_ml" onblur="setCalculatedAmount(this);" value=""<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td><input class="form-control" type="number" name="${reg.trapsiteRegistrationPK.week}_trap2_ml" onblur="setCalculatedAmount(this);" value=""<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td>
<td><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap2" value="${reg.trap2!"M"}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap2" value="${reg.trap2!"M"}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td>
<td><input class="form-control" type="number" name="${reg.trapsiteRegistrationPK.week}_trap3_ml" onblur="setCalculatedAmount(this);" value=""<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td><input class="form-control" type="number" name="${reg.trapsiteRegistrationPK.week}_trap3_ml" onblur="setCalculatedAmount(this);" value=""<#if reg.trapsiteRegistrationPK.week gt currentWeek || isExtended> disabled="disabled"</#if>/></td>
<td><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap3" value="${reg.trap3!"M"}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap3" value="${reg.trap3!"M"}"<#if reg.trapsiteRegistrationPK.week gt currentWeek || isExtended> disabled="disabled"</#if>/></td>
<td><input class="form-control" type="number" name="${reg.trapsiteRegistrationPK.week}_trap4_ml" onblur="setCalculatedAmount(this);" value=""<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td><input class="form-control" type="number" name="${reg.trapsiteRegistrationPK.week}_trap4_ml" onblur="setCalculatedAmount(this);" value=""<#if reg.trapsiteRegistrationPK.week gt currentWeek || isExtended> disabled="disabled"</#if>/></td>
<td><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap4" value="${reg.trap4!"M"}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap4" value="${reg.trap4!"M"}"<#if reg.trapsiteRegistrationPK.week gt currentWeek || isExtended> disabled="disabled"</#if>/></td>
<td rowspan="2"> <td rowspan="2">
<#if reg.dateRegistration?has_content> <#if reg.dateRegistration?has_content>
...@@ -105,8 +115,8 @@ ...@@ -105,8 +115,8 @@
<tr> <tr>
<td colspan="2"><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap1Remarks" placeholder="Kommentar felle 1" value="${reg.trap1Remarks!""}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td colspan="2"><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap1Remarks" placeholder="Kommentar felle 1" value="${reg.trap1Remarks!""}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td>
<td colspan="2"><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap2Remarks" placeholder="Kommentar felle 2" value="${reg.trap2Remarks!""}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td colspan="2"><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap2Remarks" placeholder="Kommentar felle 2" value="${reg.trap2Remarks!""}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td>
<td colspan="2"><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap3Remarks" placeholder="Kommentar felle 3" value="${reg.trap3Remarks!""}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td colspan="2"><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap3Remarks" placeholder="Kommentar felle 3" value="${reg.trap3Remarks!""}"<#if reg.trapsiteRegistrationPK.week gt currentWeek || isExtended> disabled="disabled"</#if>/></td>
<td colspan="2"><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap4Remarks" placeholder="Kommentar felle 4" value="${reg.trap4Remarks!""}"<#if reg.trapsiteRegistrationPK.week gt currentWeek> disabled="disabled"</#if>/></td> <td colspan="2"><input class="form-control" type="text" name="${reg.trapsiteRegistrationPK.week}_trap4Remarks" placeholder="Kommentar felle 4" value="${reg.trap4Remarks!""}"<#if reg.trapsiteRegistrationPK.week gt currentWeek || isExtended> disabled="disabled"</#if>/></td>
</tr> </tr>
</#list> </#list>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment