3131import java .util .List ;
3232import java .util .Locale ;
3333
34+ import static org .woehlke .java .simpleworklist .domain .taskworkflow .TaskState .PROJECTS ;
35+
3436/**
3537 * Created by tw on 14.02.16.
3638 */
@@ -82,6 +84,7 @@ public final String projectTaskAddGet(
8284 model .addAttribute ("breadcrumb" , breadcrumb );
8385 model .addAttribute ("task" , task );
8486 model .addAttribute ("userSession" , userSession );
87+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
8588 model .addAttribute ("dataPage" , true );
8689 return "project/id/task/add" ;
8790 }
@@ -96,6 +99,7 @@ public final String projectTaskAddPost(
9699 ) {
97100 Context context = super .getContext (userSession );
98101 UserAccount userAccount = context .getUserAccount ();
102+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
99103 model .addAttribute ("dataPage" , true );
100104 if (result .hasErrors ()) {
101105 for (ObjectError e : result .getAllErrors ()) {
@@ -162,13 +166,13 @@ public final String project(
162166 model .addAttribute ("breadcrumb" , breadcrumb );
163167 model .addAttribute ("thisProject" , thisProject );
164168 model .addAttribute ("taskPage" , taskPage );
165- model .addAttribute ("myTaskState" ,"PROJECT" );
166169 if (message != null ){
167170 model .addAttribute ("message" ,message );
168171 model .addAttribute ("isDeleted" ,isDeleted );
169172 }
170173 model .addAttribute ("userSession" , userSession );
171- model .addAttribute ("dataPage" , true );
174+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
175+ model .addAttribute ("dataPage" , true );
172176 return "project/id/show" ;
173177 }
174178
@@ -182,6 +186,7 @@ public final String projectAddProjectGet(
182186 Context context = super .getContext (userSession );
183187 projectControllerService .addNewProjectToProjectIdForm (projectId , userSession , context , locale , model );
184188 model .addAttribute ("userSession" , userSession );
189+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
185190 model .addAttribute ("dataPage" , true );
186191 return "project/id/project/add" ;
187192 }
@@ -196,6 +201,7 @@ public final String projectAddProjectPost(
196201 ) {
197202 log .info ("private addNewProjectPost (POST) projectId=" +projectId +" " +project .toString ());
198203 Context context = super .getContext (userSession );
204+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
199205 return projectControllerService .addNewProjectToProjectIdPersist (
200206 projectId ,
201207 userSession ,
@@ -219,6 +225,7 @@ public final String projectMoveToProjectGet(
219225 Project targetProject = projectService .findByProjectId (targetProjectId );
220226 thisProject = projectService .moveProjectToAnotherProject (thisProject , targetProject );
221227 model .addAttribute ("userSession" , userSession );
228+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
222229 model .addAttribute ("dataPage" , true );
223230 return thisProject .getUrl ();
224231 }
@@ -240,6 +247,7 @@ public final String projectEditGet(
240247 model .addAttribute ("thisProject" , thisProject );
241248 model .addAttribute ("project" , thisProject );
242249 model .addAttribute ("userSession" , userSession );
250+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
243251 model .addAttribute ("dataPage" , true );
244252 return "project/id/edit" ;
245253 }
@@ -255,7 +263,8 @@ public final String projectEditPost(
255263 Context context = super .getContext (userSession );
256264 UserAccount thisUser = context .getUserAccount ();
257265 Project thisProject ;
258- model .addAttribute ("dataPage" , true );
266+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
267+ model .addAttribute ("dataPage" , true );
259268 if (result .hasErrors ()) {
260269 for (ObjectError e : result .getAllErrors ()) {
261270 log .info (e .toString ());
@@ -334,7 +343,8 @@ public final String projectDeleteGet(
334343 model .addAttribute ("breadcrumb" , breadcrumb );
335344 model .addAttribute ("thisProject" , project );
336345 model .addAttribute ("userSession" , userSession );
337- model .addAttribute ("dataPage" , true );
346+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
347+ model .addAttribute ("dataPage" , true );
338348 return "project/id/show" ;
339349 }
340350 }
@@ -360,7 +370,7 @@ public String moveTaskToTaskAndChangeTaskOrderInProject(
360370 log .info (" DONE: taskMoveService.moveOrderIdProject" );
361371 log .info ("-------------------------------------------------" );
362372 model .addAttribute ("userSession" , userSession );
363- model .addAttribute ("dataPage" , true );
373+ model .addAttribute ("dataPage" , true );
364374 return thisProject .getUrl ();
365375 }
366376
@@ -374,7 +384,8 @@ public final String moveAllCompletedToTrash(
374384 Context context = super .getContext (userSession );
375385 taskService .moveAllCompletedToTrash (context );
376386 model .addAttribute ("userSession" , userSession );
377- model .addAttribute ("dataPage" , true );
387+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
388+ model .addAttribute ("dataPage" , true );
378389 return thisProject .getUrl ();
379390 }
380391
@@ -388,7 +399,8 @@ public final String emptyTrash(
388399 Context context = super .getContext (userSession );
389400 taskService .emptyTrash (context );
390401 model .addAttribute ("userSession" , userSession );
391- model .addAttribute ("dataPage" , true );
402+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
403+ model .addAttribute ("dataPage" , true );
392404 return thisProject .getUrl ();
393405 }
394406
@@ -411,7 +423,8 @@ public final String editTaskGet(
411423 model .addAttribute ("task" , task );
412424 model .addAttribute ("contexts" , contexts );
413425 model .addAttribute ("userSession" , userSession );
414- model .addAttribute ("dataPage" , true );
426+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
427+ model .addAttribute ("dataPage" , true );
415428 return "project/id/task/edit" ;
416429 }
417430
@@ -426,7 +439,8 @@ public final String editTaskPost(
426439 Model model
427440 ) {
428441 log .info ("editTaskPost" );
429- model .addAttribute ("dataPage" , true );
442+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
443+ model .addAttribute ("dataPage" , true );
430444 if (task .getTaskState ()==TaskState .SCHEDULED && task .getDueDate ()==null ){
431445 String objectName ="task" ;
432446 String field ="dueDate" ;
@@ -486,7 +500,8 @@ public final String setDoneTaskGet(
486500 task .setOrderIdTaskState (++maxOrderIdTaskState );
487501 task = taskService .updatedViaTaskstate (task );
488502 model .addAttribute ("userSession" , userSession );
489- model .addAttribute ("dataPage" , true );
503+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
504+ model .addAttribute ("dataPage" , true );
490505 return thisProject .getUrl ();
491506 }
492507
@@ -503,7 +518,8 @@ public final String unsetDoneTaskGet(
503518 task .setOrderIdTaskState (++maxOrderIdTaskState );
504519 task = taskService .updatedViaTaskstate (task );
505520 model .addAttribute ("userSession" , userSession );
506- model .addAttribute ("dataPage" , true );
521+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
522+ model .addAttribute ("dataPage" , true );
507523 return thisProject .getUrl ();
508524 }
509525
@@ -518,7 +534,8 @@ public final String setFocusGet(
518534 task .setFocus ();
519535 task = taskService .updatedViaTaskstate (task );
520536 model .addAttribute ("userSession" , userSession );
521- model .addAttribute ("dataPage" , true );
537+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
538+ model .addAttribute ("dataPage" , true );
522539 return thisProject .getUrl ();
523540 }
524541
@@ -533,7 +550,8 @@ public final String unsetFocusGet(
533550 task .unsetFocus ();
534551 task = taskService .updatedViaTaskstate (task );
535552 model .addAttribute ("userSession" , userSession );
536- model .addAttribute ("dataPage" , true );
553+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
554+ model .addAttribute ("dataPage" , true );
537555 return thisProject .getUrl ();
538556 }
539557
@@ -546,7 +564,8 @@ public final String moveTaskToAnotherProject(
546564 ) {
547565 task = taskService .moveTaskToRootProject (task );
548566 model .addAttribute ("userSession" , userSession );
549- model .addAttribute ("dataPage" , true );
567+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
568+ model .addAttribute ("dataPage" , true );
550569 return "redirect:/project/root" ;
551570 }
552571
@@ -560,7 +579,8 @@ public final String moveTaskToAnotherProject(
560579 ) {
561580 task = taskService .moveTaskToAnotherProject (task ,otherProject );
562581 model .addAttribute ("userSession" , userSession );
563- model .addAttribute ("dataPage" , true );
582+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
583+ model .addAttribute ("dataPage" , true );
564584 return otherProject .getUrl ();
565585 }
566586
@@ -575,7 +595,8 @@ public final String moveTaskToInbox(
575595 task .moveToInbox ();
576596 taskService .updatedViaTaskstate (task );
577597 model .addAttribute ("userSession" , userSession );
578- model .addAttribute ("dataPage" , true );
598+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
599+ model .addAttribute ("dataPage" , true );
579600 return thisProject .getUrl ();
580601 }
581602
@@ -590,7 +611,8 @@ public final String moveTaskToToday(
590611 task .moveToToday ();
591612 taskService .updatedViaTaskstate (task );
592613 model .addAttribute ("userSession" , userSession );
593- model .addAttribute ("dataPage" , true );
614+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
615+ model .addAttribute ("dataPage" , true );
594616 return thisProject .getUrl ();
595617 }
596618
@@ -605,7 +627,8 @@ public final String moveTaskToNext(
605627 task .moveToNext ();
606628 taskService .updatedViaTaskstate (task );
607629 model .addAttribute ("userSession" , userSession );
608- model .addAttribute ("dataPage" , true );
630+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
631+ model .addAttribute ("dataPage" , true );
609632 return thisProject .getUrl ();
610633 }
611634
@@ -620,7 +643,8 @@ public final String moveTaskToWaiting(
620643 task .moveToWaiting ();
621644 taskService .updatedViaTaskstate (task );
622645 model .addAttribute ("userSession" , userSession );
623- model .addAttribute ("dataPage" , true );
646+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
647+ model .addAttribute ("dataPage" , true );
624648 return thisProject .getUrl ();
625649 }
626650
@@ -635,7 +659,8 @@ public final String moveTaskToSomeday(
635659 task .moveToSomeday ();
636660 taskService .updatedViaTaskstate (task );
637661 model .addAttribute ("userSession" , userSession );
638- model .addAttribute ("dataPage" , true );
662+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
663+ model .addAttribute ("dataPage" , true );
639664 return thisProject .getUrl ();
640665 }
641666
@@ -650,7 +675,8 @@ public final String moveTaskToFocus(
650675 task .moveToFocus ();
651676 taskService .updatedViaTaskstate (task );
652677 model .addAttribute ("userSession" , userSession );
653- model .addAttribute ("dataPage" , true );
678+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
679+ model .addAttribute ("dataPage" , true );
654680 return thisProject .getUrl ();
655681 }
656682
@@ -665,7 +691,8 @@ public final String moveTaskToCompleted(
665691 task .moveToCompletedTasks ();
666692 taskService .updatedViaTaskstate (task );
667693 model .addAttribute ("userSession" , userSession );
668- model .addAttribute ("dataPage" , true );
694+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
695+ model .addAttribute ("dataPage" , true );
669696 return thisProject .getUrl ();
670697 }
671698
@@ -683,7 +710,8 @@ public final String moveTaskToTrash(
683710 userSession .setLastTaskState (task .getTaskState ());
684711 userSession .setLastTaskId (task .getId ());
685712 model .addAttribute ("userSession" , userSession );
686- model .addAttribute ("dataPage" , true );
713+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
714+ model .addAttribute ("dataPage" , true );
687715 return thisProject .getUrl ();
688716 }
689717
@@ -698,7 +726,8 @@ public final String transformTaskIntoProjectGet(
698726 userSession .setLastProjectId (thisProject .getId ());
699727 userSession .setLastTaskState (task .getTaskState ());
700728 userSession .setLastTaskId (task .getId ());
701- model .addAttribute ("dataPage" , true );
729+ model .addAttribute ("taskstateType" ,PROJECTS .getType ());
730+ model .addAttribute ("dataPage" , true );
702731 return transformTaskIntoProjektService .transformTaskIntoProjectGet (task , userSession , model );
703732 }
704733}
0 commit comments