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
This commit is contained in:
Frederic Debuire
2008-02-07 16:12:34 +00:00
parent 4ad64d5271
commit 0308c822c6
5 changed files with 160 additions and 21 deletions

View File

@@ -11,14 +11,19 @@
<script type='text/javascript'>
function init() {
fillTable();
//fillTable2();
//fillTable();
setTimeout("fillTable2()", 500);
setTimeout("fillTable()", 500);
}
var peopleCache = { };
var peopleCache2 = { };
var viewed = -1;
function fillTable() {
AddCriteriaJS.getAllCriteria(function(criteria) {
AddCriteriaJS.getCriteriaAdded(function(criteria) {
// Delete all the rows except for the "pattern" row
dwr.util.removeAllRows("criteriabody", { filter:function(tr) {
return (tr.id != "pattern");
@@ -37,6 +42,31 @@ function fillTable() {
dwr.util.setValue("tableCriterionMax" + id, person.max);
$("tableCriterion").style.display = "";
$("pattern" + id).style.display = "";
peopleCache2[id] = person;
}
});
}
function fillTable2() {
AddCriteriaJS.getCriteriaAll(function(criteria) {
// Delete all the rows except for the "pattern" row
dwr.util.removeAllRows("criteriabodyAll", { filter:function(tr) {
return (tr.id != "patternAll");
}});
// Create a new set cloned from the pattern row
var person, id;
criteria.sort(function(p1, p2) { return p1.label.localeCompare(p2.label); });
if (criteria.length == 0)
$("tableCriterionAll").style.display = "none";
for (var i = 0; i < criteria.length; i++) {
person = criteria[i];
id = person.id;
dwr.util.cloneNode("patternAll", { idSuffix:id });
dwr.util.setValue("tableCriterionAll" + id, person.label);
dwr.util.setValue("tableCriterionMinAll" + id, person.min);
dwr.util.setValue("tableCriterionMaxAll" + id, person.max);
$("tableCriterionAll").style.display = "";
$("patternAll" + id).style.display = "";
peopleCache[id] = person;
}
});
@@ -44,28 +74,46 @@ function fillTable() {
function editClicked(eleid) {
// we were an id of the form "edit{id}", eg "edit42". We lookup the "42"
var person = peopleCache[eleid.substring(4)];
var person = peopleCache2[eleid.substring(4)];
dwr.util.setValues(person);
}
function deleteClicked(eleid) {
// we were an id of the form "delete{id}", eg "delete42". We lookup the "42"
var person = peopleCache[eleid.substring(6)];
var person = peopleCache2[eleid.substring(6)];
if (confirm("Are you sure you want to delete " + person.label + "?")) {
dwr.engine.beginBatch();
AddCriteriaJS.deleteCriterion(person);
fillTable();
setTimeout("fillTable2()", 500);
setTimeout("fillTable()", 500);
dwr.engine.endBatch();
}
viewed = -1;
dwr.util.setValues({ id:-1, label:null, min:null, max:null });
}
function addClicked(eleid) {
var person = peopleCache[eleid.substring(3)];
//person.id = -1;
dwr.engine.beginBatch();
AddCriteriaJS.setCriterion(person);
setTimeout("fillTable2()", 500);
setTimeout("fillTable()", 500);
dwr.engine.endBatch();
viewed = -1;
dwr.util.setValues({ id:-1, label:null, min:null, max:null });
}
function writePerson() {
var person = { id:viewed, label:null, min:null, max:null };
dwr.util.getValues(person);
dwr.engine.beginBatch();
AddCriteriaJS.setCriterion(person);
fillTable();
AddCriteriaJS.setCriterionClick(person);
//fillTable2();
//fillTable();
setTimeout("fillTable()", 500);
dwr.engine.endBatch();
}
@@ -84,6 +132,36 @@ function clearPerson() {
<form:form commandName="formConference" name="monForm">
This step allows you to add criterion which will be used when someone will evaluate an article.<br/>
You can add a new criterion using the input form, or add an existing criterion.<br/>
<br/>
<fieldset><legend>Existing criteria</legend>
<table border="1" id="tableCriterionAll" style="display: none;">
<thead>
<tr>
<th>Criterion</th>
<th>Min</th>
<th>Max</th>
<th>Action</th>
</tr>
</thead>
<tbody id="criteriabodyAll">
<tr id="patternAll" style="display: none;">
<td><span id="tableCriterionAll">Criterion</span></td>
<td><span id="tableCriterionMinAll">Min</span></td>
<td><span id="tableCriterionMaxAll">Max</span></td>
<td>
<a id="add" href="#" onclick="addClicked(this.id)" >Add</a>
</td>
</tr>
</tbody>
</table>
</fieldset>
<br />
<fieldset><legend>Criteria</legend>
<table class="plain">
<tr>