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

Add POI type trap [VIPSUTV-404]

parent d0f979be
No related branches found
No related tags found
No related merge requests found
Showing
with 77 additions and 7 deletions
......@@ -64,6 +64,7 @@ public class PointOfInterestType implements Serializable {
public static final int POINT_OF_INTEREST_TYPE_FARM = 2;
public static final int POINT_OF_INTEREST_TYPE_FIELD = 3;
public static final int POINT_OF_INTEREST_TYPE_REGION = 4;
public static final int POINT_OF_INTEREST_TYPE_TRAP = 5;
public PointOfInterestType() {
}
......
/*
* 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.entity;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @copyright 2023 <a href="http://www.nibio.no/">NIBIO</a>
* @author Tor-Einar Skog <tor-einar.skog@nibio.no>
*/
@Entity
@DiscriminatorValue("5")
@Table(name = "point_of_interest_trap")
public class PointOfInterestTypeTrap extends PointOfInterest implements Serializable {
}
......@@ -19,12 +19,7 @@
package no.nibio.vips.logic.entity.helpers;
import no.nibio.vips.logic.entity.PointOfInterest;
import no.nibio.vips.logic.entity.PointOfInterestType;
import no.nibio.vips.logic.entity.PointOfInterestTypeFarm;
import no.nibio.vips.logic.entity.PointOfInterestTypeField;
import no.nibio.vips.logic.entity.PointOfInterestTypeRegion;
import no.nibio.vips.logic.entity.PointOfInterestWeatherStation;
import no.nibio.vips.logic.entity.*;
/**
* @copyright 2020 <a href="http://www.nibio.no/">NIBIO</a>
......@@ -42,6 +37,8 @@ public class PointOfInterestFactory {
return new PointOfInterestTypeField();
case PointOfInterestType.POINT_OF_INTEREST_TYPE_REGION:
return new PointOfInterestTypeRegion();
case PointOfInterestType.POINT_OF_INTEREST_TYPE_TRAP:
return new PointOfInterestTypeTrap();
default:
return new PointOfInterest();
}
......
/*
* Copyright (c) 2020 NIBIO <http://www.nibio.no/>.
*
* This file is part of VIPSLogic.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/**
* Author: Tor-Einar Skog <tor-einar.skog@nibio.no>
* Created: May 10th, 2023
*/
-- Create POI type trap as entity
CREATE TABLE public.point_of_interest_trap (
point_of_interest_id INTEGER REFERENCES public.point_of_interest(point_of_interest_id) PRIMARY KEY REFERENCES public.point_of_interest(point_of_interest_id)
);
INSERT INTO public.point_of_interest_type (point_of_interest_type_id, default_name)
VALUES (5, 'Trap');
......@@ -1042,3 +1042,4 @@ allRoles=All roles
allStatuses=All statuses
LEAFBLOTCH=Leaf blotch model
universalMessageSettingsLink_tpl=To edit your notification subscriptions, please use this link: {0}
pointOfInterestType_5=Trap
......@@ -1035,3 +1035,4 @@ allRoles=All roles
allStatuses=All statuses
LEAFBLOTCH=Leaf blotch model
universalMessageSettingsLink_tpl=To edit your VIPS notification subscriptions, please use this link: {0}
pointOfInterestType_5=Trap
......@@ -1034,3 +1034,4 @@ allRoles=All roles
allStatuses=All statuses
LEAFBLOTCH=Leaf blotch model
universalMessageSettingsLink_tpl=To edit your notification subscriptions, please use this link: {0}
pointOfInterestType_5=Trap
......@@ -1043,3 +1043,4 @@ allRoles=Alle roller
allStatuses=Alle statuser
LEAFBLOTCH=Bladflekksjukdomsmodell
universalMessageSettingsLink_tpl=For endre dine abonnement p push-varsler fra VIPS, bruk denne lenken: {0}
pointOfInterestType_5=Felle
......@@ -1036,3 +1036,4 @@ allRoles=All roles
allStatuses=All statuses
LEAFBLOTCH=Leaf blotch model
universalMessageSettingsLink_tpl=To edit your notification subscriptions, please use this link: {0}
pointOfInterestType_5=Trap
......@@ -1029,3 +1029,4 @@ allRoles=All roles
allStatuses=All statuses
LEAFBLOTCH=Leaf blotch model
universalMessageSettingsLink_tpl=To edit your notification subscriptions, please use this link: {0}
pointOfInterestType_5=Trap
......@@ -84,7 +84,7 @@
<div class="form-group">
<label for="pointOfInterestTypeId">${i18nBundle.pointOfInterestType}</label>
<select class="form-control" name="pointOfInterestTypeId" onblur="validateField(this);">
<#list 0..3 as pointOfInterestTypeId>
<#list [0,1,2,3,5] as pointOfInterestTypeId>
<#if pointOfInterestTypeId != 1>
<option value="${pointOfInterestTypeId}"<#if
poi.pointOfInterestTypeId?has_content && pointOfInterestTypeId == poi.pointOfInterestTypeId
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment