Files
yacos/YACOSWeb/WebContent/WEB-INF/jsp/addConference5.jsp
Frederic Debuire 0308c822c6 Les anciens critères sont affichés.
Les dates sont validées.
Policy failures:   
Code warning
- failed on resource ConferenceValidator.java. Reason: Class is a raw type. References to generic type Class<T> should be parameterized, line 1
Override reason:   
haha
2008-02-07 16:12:34 +00:00

182 lines
4.7 KiB
Plaintext

<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head>
<script type='text/javascript' src='./dwr/engine.js'></script>
<script type='text/javascript' src='./dwr/util.js'></script>
<script type='text/javascript' src='./dwr/interface/AddCriteriaJS.js'></script>
<script type='text/javascript' src='./javascripts/prototype.js'></script>
<script type='text/javascript'>
function init() {
dwr.engine.setAsync(false); // a vérifier
//AddCriteriaJS.initPerson();
dwr.engine.setAsync(true);
setTimeout("fillTable()", 500);
setTimeout("fillTable2()", 500);
}
var peopleCache = { };
var peopleCache2 = { };
var viewed = -1;
function fillTable() {
AddCriteriaJS.getUsersFiltered(function(people) {
// Delete all the rows except for the "pattern" row
dwr.util.removeAllRows("personbody", { filter:function(tr) {
return (tr.id != "pattern");
}});
// Create a new set cloned from the pattern row
var person, id;
people.sort(function(p1, p2) { return p1.firstName.localeCompare(p2.firstName); });
if (people.length == 0)
$("tableName").style.display = "none";
for (var i = 0; i < people.length; i++) {
person = people[i];
id = person.id;
dwr.util.cloneNode("pattern", { idSuffix:id });
dwr.util.setValue("tablePerson" + id, person.firstName + " " + person.lastName);
$("tableName").style.display = "";
$("pattern" + id).style.display = "";
peopleCache[id] = person;
}
});
}
function fillTable2() {
AddCriteriaJS.getUsersAdded(function(people) {
// Delete all the rows except for the "pattern" row
dwr.util.removeAllRows("personbodyadded", { filter:function(tr) {
return (tr.id != "patternadded");
}});
// Create a new set cloned from the pattern row
var person, id;
people.sort(function(p1, p2) { return p1.firstName.localeCompare(p2.lastName); });
if (people.length == 0)
$("tableNameAdded").style.display = "none";
for (var i = 0; i < people.length; i++) {
person = people[i];
id = person.id;
dwr.util.cloneNode("patternadded", { idSuffix:id });
dwr.util.setValue("tablePersonadded" + id, person.firstName + " " + person.lastName);
$("tableNameAdded").style.display = "";
$("patternadded" + id).style.display = "";
peopleCache2[id] = person; // voir ici pr re-remplir après le back :)
}
});
}
function addPerson(eleid) {
var person = peopleCache[eleid.substring(6)];
dwr.engine.beginBatch();
AddCriteriaJS.setPerson(person);
fillTable();
fillTable2();
dwr.engine.endBatch();
}
function addInvitation() {
var email = $("emailAddress").value;
dwr.engine.beginBatch();
AddCriteriaJS.addInvitation(email);
fillTable();
fillTable2();
dwr.engine.endBatch();
}
function deletePerson(eleid) {
var person = peopleCache2[eleid.substring(11)];
if (confirm("Are you sure you want to delete " + person.firstName + " " + person.lastName + "?")) {
dwr.engine.beginBatch();
AddCriteriaJS.deletePerson(person);
filterUser(null, dwr.util.getValue("myfilter"));
fillTable();
fillTable2();
dwr.engine.endBatch();
}
}
Event.observe(window, 'load', function() {
new Form.Element.Observer('myfilter', 1, filterUser)
});
function filterUser(el, value) {
AddCriteriaJS.fillUser(value);
setTimeout("fillTable()", 500);
}
</script>
</head>
<body>
<h4 class="title"><fmt:message key="conference.titleMenu" /></h4>
<form:form commandName="formConference" name="monForm">
Filter <form:input id="myfilter" path="myfilter" />
<br /> <br />
<table border="1" id="tableName" style="display: none;">
<thead>
<tr>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="personbody">
<tr id="pattern" style="display: none;">
<td><span id="tablePerson">Person</span></td>
<td>
<a id="addNew" href="#" onclick="addPerson(this.id)" >Add</a>
</td>
</tr>
</tbody>
</table>
<br />
<fmt:message key="invitation.send"/> <br/>
Mail: <input id="emailAddress" type="text"/> <a id="invitationEmail" href="#" onclick="addInvitation()" >Invite</a>
<br />
<br />
<table border="1" id="tableNameAdded" style="display: none;">
<thead>
<tr>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="personbodyadded">
<tr id="patternadded" style="display: none;">
<td><span id="tablePersonadded">Person</span></td>
<td>
<a id="supprPerson" href="#" onclick="deletePerson(this.id)" >Delete</a>
</td>
</tr>
</tbody>
</table>
<br />
<input type="submit" align="middle" name="_target3" value="Back">
<input type="submit" align="middle" name="_finish" value="Finish" />
</form:form>
<script type="text/javascript">
init();
</script>
<br />
<br />
<a href="<c:url value="main.htm"/>">Home</a>
</body>
</html>