if(!bounds) return false;
bounds.transform(this.map.getProjectionObject(), this.apiProjection);
- this.apiRequest("getBugs"
- + "?t="+this.round(bounds.top, 5)
- + "&r="+this.round(bounds.right, 5)
- + "&b="+this.round(bounds.bottom, 5)
- + "&l="+this.round(bounds.left, 5));
+ this.apiRequest("bugs"
+ + "?bbox="+this.round(bounds.left, 5)
+ + ","+this.round(bounds.bottom, 5)
+ + ","+this.round(bounds.right, 5)
+ + ","+this.round(bounds.top, 5));
},
/**
el1.appendChild(el2);
el2 = document.createElement("dd");
var inputUsername = document.createElement("input");
- inputUsername.value = this.username;
+ var inputUsername = document.createElement("input");;
+ if (typeof loginName === 'undefined') {
+ inputUsername.value = this.username;
+ } else {
+ inputUsername.value = loginName;
+ inputUsername.setAttribute('disabled','true');
+ }
inputUsername.className = "osbUsername";
inputUsername.onkeyup = function(){ layer.setUserName(inputUsername.value); };
el2.appendChild(inputUsername);
- el1.appendChild(el2);
+ el3 = document.createElement("a");
+ el3.setAttribute("href","login");
+ el3.className = "hide_if_logged_in";
+ el3.appendChild(document.createTextNode(OpenLayers.i18n("Login")));
+ el2.appendChild(el3)
+ el1.appendChild(el2);
el2 = document.createElement("dt");
el2.appendChild(document.createTextNode(OpenLayers.i18n("Comment")));
el1.appendChild(el2);
el2 = document.createElement("dd");
- var inputComment = document.createElement("input");
+ var inputComment = document.createElement("textarea");
+ inputComment.setAttribute("cols",40);
el2.appendChild(inputComment);
el1.appendChild(el2);
+
el_form.appendChild(el1);
el1 = document.createElement("ul");
* @param String description
*/
createBug: function(lonlat, description) {
- this.apiRequest("addPOIexec"
+ this.apiRequest("bug/create"
+ "?lat="+encodeURIComponent(lonlat.lat)
+ "&lon="+encodeURIComponent(lonlat.lon)
- + "&text="+encodeURIComponent(description + " [" + this.getUserName() + "]")
+ + "&text="+encodeURIComponent(description)
+ + "&name="+encodeURIComponent(this.getUserName())
+ "&format=js"
);
+ createBugCallBack();
},
/**
* @param String comment
*/
submitComment: function(id, comment) {
- this.apiRequest("editPOIexec"
- + "?id="+encodeURIComponent(id)
- + "&text="+encodeURIComponent(comment + " [" + this.getUserName() + "]")
+ this.apiRequest("bug/"+encodeURIComponent(id)+"/comment"
+ + "?text="+encodeURIComponent(comment)
+ + "&name="+encodeURIComponent(this.getUserName())
+ "&format=js"
);
},
* @param Number id
*/
closeBug: function(id) {
- this.apiRequest("closePOIexec"
- + "?id="+encodeURIComponent(id)
- + "&format=js"
+ this.apiRequest("bug/"+encodeURIComponent(id)+"/close"
+ + "?format=js"
);
},
el2.appendChild(document.createTextNode(OpenLayers.i18n("Nickname")));
el1.appendChild(el2);
el2 = document.createElement("dd");
- var inputUsername = document.createElement("input");
- inputUsername.value = this.osbLayer.username;
+ var inputUsername = document.createElement("input");;
+ if (typeof loginName === 'undefined') {
+ inputUsername.value = this.osbLayer.username;
+ } else {
+ inputUsername.value = loginName;
+ inputUsername.setAttribute('disabled','true');
+ }
inputUsername.className = "osbUsername";
+
inputUsername.onkeyup = function(){ control.osbLayer.setUserName(inputUsername.value); };
el2.appendChild(inputUsername);
+ el3 = document.createElement("a");
+ el3.setAttribute("href","login");
+ el3.className = "hide_if_logged_in";
+ el3.appendChild(document.createTextNode(OpenLayers.i18n("Login")));
+ el2.appendChild(el3);
el1.appendChild(el2);
el2 = document.createElement("dt");
el2.appendChild(document.createTextNode(OpenLayers.i18n("Bug description")));
el1.appendChild(el2);
el2 = document.createElement("dd");
- var inputDescription = document.createElement("input");
+ var inputDescription = document.createElement("textarea");
+ inputDescription.setAttribute("cols",40);
el2.appendChild(inputDescription);
el1.appendChild(el2);
el_form.appendChild(el1);