@@ -75,8 +75,8 @@ function gotoToDo()
75
75
}
76
76
77
77
function ifCorrectFormExecute (callback ) {
78
- var errorMsg = " " ;
79
- var errorNb = 0 ;
78
+ let errorMsg = " " ;
79
+ let errorNb = 0 ;
80
80
81
81
if (isWhitespace (document .todoEditForm .Name .value )) {
82
82
errorMsg += " - '<%= todo. getString(" nomToDo" ) % > ' <%= todo. getString(" MustContainsText" ) % >\n " ;
@@ -89,7 +89,7 @@ function ifCorrectFormExecute(callback) {
89
89
errorNb++ ;
90
90
}
91
91
92
- var dateErrors = isPeriodValid (' StartDate' , ' EndDate' );
92
+ const dateErrors = isPeriodValid (' StartDate' , ' EndDate' );
93
93
$ (dateErrors).each (function (index , error ) {
94
94
errorMsg += " - " + error .message + " \n " ;
95
95
errorNb++ ;
@@ -112,25 +112,25 @@ function ifCorrectFormExecute(callback) {
112
112
}
113
113
114
114
115
- function reallyAdd ()
115
+ function save ()
116
116
{
117
117
ifCorrectFormExecute (function () {
118
- document .todoEditForm .Action .value = " ReallyAdd " ;
118
+ document .todoEditForm .Action .value = " Save " ;
119
119
document .todoEditForm .submit ();
120
120
});
121
121
}
122
122
123
- function reallyUpdate ()
123
+ function update ()
124
124
{
125
- document .todoEditForm .Name .disabled = false ;
125
+ document .todoEditForm .Name .disabled = false ;
126
126
document .todoEditForm .PercentCompleted .disabled = false ;
127
127
document .todoEditForm .Description .disabled = false ;
128
128
document .todoEditForm .StartDate .disabled = false ;
129
129
document .todoEditForm .EndDate .disabled = false ;
130
130
document .todoEditForm .Classification .disabled = false ;
131
131
document .todoEditForm .Priority .disabled = false ;
132
132
ifCorrectFormExecute (function () {
133
- document .todoEditForm .Action .value = " ReallyUpdate " ;
133
+ document .todoEditForm .Action .value = " Update " ;
134
134
document .todoEditForm .submit ();
135
135
});
136
136
}
@@ -164,7 +164,7 @@ function test(){
164
164
String toPrint = null ;
165
165
166
166
167
- if (action. equals(" Add" ) || action. equals(" Update " )) {
167
+ if (action. equals(" Add" ) || action. equals(" Edit " )) {
168
168
todo. setCurrentToDoHeader(null );
169
169
todo. setCurrentAttendees(null );
170
170
}
@@ -177,12 +177,12 @@ function test(){
177
177
String toDoId = request. getParameter(" ToDoId" );
178
178
179
179
if (toDoId != null ) {
180
- if (toDoId. length() == 0 ) {
180
+ if (toDoId. isEmpty() ) {
181
181
toDoId = null ;
182
182
}
183
183
}
184
184
185
- /* Update et premier acces a la page */
185
+ /* Edit et premier acces a la page */
186
186
if (toDoId != null ) {
187
187
todoHeader = todo. getToDoHeader(toDoId);
188
188
attendees = todo. getToDoAttendees(toDoId);
@@ -264,8 +264,8 @@ function test(){
264
264
< / head>
265
265
266
266
<%
267
- /* ReallyAdd || ReallyUpdate */
268
- if (action. equals(" ReallyAdd " ) || action. equals(" ReallyUpdate " )) {
267
+ /* Save || Update */
268
+ if (action. equals(" Save " ) || action. equals(" Update " )) {
269
269
String name = request. getParameter(" Name" );
270
270
String description = request. getParameter(" Description" );
271
271
String priority = request. getParameter(" Priority" );
@@ -290,11 +290,11 @@ function test(){
290
290
Date date1 = null ;
291
291
if (name == null )
292
292
throw new Exception (" nameErreur" );
293
- else if (name. length() == 0 )
293
+ else if (name. isEmpty() )
294
294
throw new Exception (" nameErreur" );
295
295
296
296
try {
297
- if (startDate. trim(). length() > 0 )
297
+ if (! startDate. trim(). isEmpty() )
298
298
date1 = DateUtil . stringToDate(startDate, todo. getLanguage());
299
299
}
300
300
catch (java.text. ParseException e) {
@@ -304,7 +304,7 @@ function test(){
304
304
Date date2 = null ;
305
305
306
306
try {
307
- if (endDate. trim(). length() == 0 )
307
+ if (endDate. trim(). isEmpty() )
308
308
date2 = date1;
309
309
else
310
310
date2 = DateUtil . stringToDate(endDate, todo. getLanguage());
@@ -325,7 +325,7 @@ function test(){
325
325
j++ ;
326
326
}
327
327
328
- /* ReallyAdd */
328
+ /* Save */
329
329
// now diffusion list can be empty
330
330
if (todoHeader. getId() == null ) {
331
331
String id = todo. addToDo(name, description, priority, classification, date1, startHour, date2, endHour, percent);
@@ -336,7 +336,7 @@ function test(){
336
336
return ;
337
337
}
338
338
339
- /* ReallyUpdate */
339
+ /* Update */
340
340
else {
341
341
if (todo. getUserId(). equals(todoHeader. getDelegatorId())) {
342
342
todo. updateToDo(todoHeader. getId(), name, description, priority, classification, date1, startHour, date2, endHour, percent);
@@ -416,8 +416,8 @@ function test(){
416
416
out. println(" </div>" );
417
417
}
418
418
419
- /* Add || Update || View || DiffusionListOK */
420
- else if (action. equals(" Update " ) || action. equals(" Add" ) || action. equals(" View" ) || action. equals(" DiffusionListOK" )) {
419
+ /* Add || Edit || View || DiffusionListOK */
420
+ else if (action. equals(" Edit " ) || action. equals(" Add" ) || action. equals(" View" ) || action. equals(" DiffusionListOK" )) {
421
421
% >
422
422
<center >
423
423
<view:board >
@@ -617,9 +617,9 @@ out.println(frame.printMiddle());
617
617
ButtonPane pane = graphicFactory. getButtonPane();
618
618
Button button = null ;
619
619
if (todoHeader. getId() != null )
620
- button = graphicFactory. getFormButton(todo. getString(" mettreAJour" ), " javascript:onClick=reallyUpdate ()" , false );
620
+ button = graphicFactory. getFormButton(todo. getString(" mettreAJour" ), " javascript:onClick=update ()" , false );
621
621
else
622
- button = graphicFactory. getFormButton(todo. getString(" ajouter" ), " javascript:onClick=reallyAdd ()" , false );
622
+ button = graphicFactory. getFormButton(todo. getString(" ajouter" ), " javascript:onClick=save ()" , false );
623
623
624
624
pane. addButton(button);
625
625
0 commit comments