Corrections in calendars listing
The derived calendars will be below of the base calendar which the current work week belongs to. Change the list adding to new columns: From Date and Up to date. FEA: AnA08S09CalendarAdminInterface
This commit is contained in:
parent
cf2bba29c9
commit
859e35e125
3 changed files with 30 additions and 1 deletions
|
|
@ -296,6 +296,30 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
|
|||
nameTreecell.appendChild(nameLabel);
|
||||
treerow.appendChild(nameTreecell);
|
||||
|
||||
// append start date of the current work week
|
||||
Treecell startDateTreecell = new Treecell();
|
||||
Label startDateLabel = new Label();
|
||||
CalendarData version = baseCalendar.getCalendarData(LocalDate
|
||||
.fromDateFields(new Date()));
|
||||
CalendarData prevVersion = baseCalendar.getPrevious(version);
|
||||
if ((prevVersion != null)
|
||||
&& (prevVersion.getExpiringDate() != null)) {
|
||||
startDateLabel.setValue(prevVersion
|
||||
.getExpiringDate().toString());
|
||||
}
|
||||
startDateTreecell.appendChild(startDateLabel);
|
||||
treerow.appendChild(startDateTreecell);
|
||||
|
||||
// append expiring date of the current work week
|
||||
Treecell expiringDateTreecell = new Treecell();
|
||||
Label expiringDateLabel = new Label();
|
||||
if (version.getExpiringDate() != null) {
|
||||
expiringDateLabel
|
||||
.setValue(version.getExpiringDate().toString());
|
||||
}
|
||||
expiringDateTreecell.appendChild(expiringDateLabel);
|
||||
treerow.appendChild(expiringDateTreecell);
|
||||
|
||||
Treecell operationsTreecell = new Treecell();
|
||||
|
||||
Button createDerivedButton = new Button();
|
||||
|
|
|
|||
|
|
@ -22,10 +22,12 @@
|
|||
package org.navalplanner.web.calendars;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.calendars.entities.BaseCalendar;
|
||||
import org.zkoss.zul.SimpleTreeModel;
|
||||
import org.zkoss.zul.SimpleTreeNode;
|
||||
|
|
@ -83,7 +85,8 @@ public class BaseCalendarsTreeModel extends SimpleTreeModel {
|
|||
}
|
||||
|
||||
for (BaseCalendar derived : derivedCalendars) {
|
||||
BaseCalendar parent = derived.getParent();
|
||||
BaseCalendar parent = derived.getCalendarData(
|
||||
LocalDate.fromDateFields(new Date())).getParent();
|
||||
List<BaseCalendar> siblings = result.get(parent);
|
||||
|
||||
if (siblings == null) {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
zclass="z-dottree">
|
||||
<treecols sizable="true">
|
||||
<treecol label="${i18n:_('Name')}" />
|
||||
<treecol label="${i18n:_('Start date')}" align="center"/>
|
||||
<treecol label="${i18n:_('Expiring date')}" align="center"/>
|
||||
<treecol label="${i18n:_('Operations')}" />
|
||||
</treecols>
|
||||
</tree>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue