OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 158 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 158 Rev 181
Line 9... Line 9...
9
import org.jopencalendar.model.JCalendarItem;
9
import org.jopencalendar.model.JCalendarItem;
10
import org.jopencalendar.print.CalendarItemPrinter;
10
import org.jopencalendar.print.CalendarItemPrinter;
11
 
11
 
12
public class OperationCalendarItemPrinter extends CalendarItemPrinter {
12
public class OperationCalendarItemPrinter extends CalendarItemPrinter {
13
    public static final Font FONT_LINE = new Font("Arial", Font.PLAIN, 9);
13
    public static final Font FONT_LINE = new Font("Arial", Font.PLAIN, 9);
-
 
14
    private List<JCalendarItem> itemsToWork;
14
 
15
 
15
    public OperationCalendarItemPrinter(String title, List<JCalendarItem> items, PageFormat pf) {
16
    public OperationCalendarItemPrinter(String title, List<JCalendarItem> items, PageFormat pf, List<JCalendarItem> itemsToWork) {
16
        super(title, items, pf);
17
        super(title, items, pf);
-
 
18
        this.itemsToWork = itemsToWork;
17
    }
19
    }
18
 
20
 
19
    @Override
21
    @Override
20
    public String getLine1Text(JCalendarItem item) {
22
    public String getLine1Text(JCalendarItem item) {
21
        final String siteName = ((JCalendarItemDB) item).getSiteName().toUpperCase();
23
        final String siteName = ((JCalendarItemDB) item).getSiteName().toUpperCase();
Line 36... Line 38...
36
        return type;
38
        return type;
37
    }
39
    }
38
 
40
 
39
    @Override
41
    @Override
40
    public String getTitle() {
42
    public String getTitle() {
41
        final List<JCalendarItem> items = this.getItems();
43
        final List<JCalendarItem> items = this.itemsToWork;
42
        int totalMinutes = 0;
44
        int totalMinutes = 0;
43
        for (JCalendarItem jCalendarItem : items) {
45
        for (JCalendarItem jCalendarItem : items) {
44
            long t2 = jCalendarItem.getDtEnd().getTimeInMillis();
46
            long t2 = jCalendarItem.getDtEnd().getTimeInMillis();
45
            long t1 = jCalendarItem.getDtStart().getTimeInMillis();
47
            long t1 = jCalendarItem.getDtStart().getTimeInMillis();
46
            int min = (int) ((t2 - t1) / (1000 * 60));
48
            int min = (int) ((t2 - t1) / (1000 * 60));