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

Bugfix enabling organization admin to add new weather station

parent a9a71484
Branches
Tags
2 merge requests!17Develop,!12Ny server 2019
This commit is part of merge request !17. Comments created here will be created in the context of that merge request.
...@@ -361,6 +361,7 @@ public class PointOfInterestController extends HttpServlet { ...@@ -361,6 +361,7 @@ public class PointOfInterestController extends HttpServlet {
request.setAttribute("weatherStation", weatherStation); request.setAttribute("weatherStation", weatherStation);
request.setAttribute("defaultMapCenter",user.getOrganizationId().getDefaultMapCenter()); request.setAttribute("defaultMapCenter",user.getOrganizationId().getDefaultMapCenter());
request.setAttribute("defaultMapZoom", user.getOrganizationId().getDefaultMapZoom()); request.setAttribute("defaultMapZoom", user.getOrganizationId().getDefaultMapZoom());
request.setAttribute("returnURL","weatherStation?organizationId=" + user.getOrganizationId().getOrganizationId());
request.getSession().setAttribute("dataSources", SessionControllerGetter.getPointOfInterestBean().getWeatherStationDataSources()); request.getSession().setAttribute("dataSources", SessionControllerGetter.getPointOfInterestBean().getWeatherStationDataSources());
request.getSession().setAttribute("availableTimeZones", Globals.availableTimeZones); request.getSession().setAttribute("availableTimeZones", Globals.availableTimeZones);
request.getSession().setAttribute("defaultTimeZoneId", user.getOrganizationId().getDefaultTimeZone()); request.getSession().setAttribute("defaultTimeZoneId", user.getOrganizationId().getDefaultTimeZone());
......
This diff is collapsed.
...@@ -252,6 +252,12 @@ var loadScript = function(url, callback) ...@@ -252,6 +252,12 @@ var loadScript = function(url, callback)
document.head.appendChild(script); document.head.appendChild(script);
}; };
/**
* Loads elements (e.g. script elements) into the parent page
* @param {type} type the type of element
* @param {type} attributes the attributes (like src) of the element
* @param {type} callback What do do after the loading is done
*/
var loadHeadElement = function(type, attributes, callback) var loadHeadElement = function(type, attributes, callback)
{ {
var elm = document.createElement(type); var elm = document.createElement(type);
......
...@@ -164,6 +164,8 @@ ...@@ -164,6 +164,8 @@
</select> </select>
<span class="help-block" id="${formId}_userId_validation"></span> <span class="help-block" id="${formId}_userId_validation"></span>
</div> </div>
<#else>
<input type="hidden" name="userId" value="<#if weatherStation.userId?has_content>${weatherStation.userId.userId}<#else>${user.userId}</#if>"/>
</#if> </#if>
<button type="submit" class="btn btn-default">${i18nBundle.submit}</button> <button type="submit" class="btn btn-default">${i18nBundle.submit}</button>
<#if weatherStation.pointOfInterestId?has_content> <#if weatherStation.pointOfInterestId?has_content>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment