OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 157 → Rev 158

/trunk/Modules/Module Operation/src/org/openconcerto/modules/operation/SQLElementNames_fr.xml
File deleted
/trunk/Modules/Module Operation/src/org/openconcerto/modules/operation/SQLElementNames_en.xml
File deleted
/trunk/Modules/Module Operation/src/org/openconcerto/modules/operation/labels_en.xml
1,2 → 1,5
<?xml version="1.0" encoding="UTF-8" ?>
<ROOT />
<ROOT>
<element refid="org.openconcerto.modules.operation/SITE" nameClass="masculine" name="site" />
<element refid="org.openconcerto.modules.operation/OPERATION" nameClass="masculine" name="operation" />
</ROOT>
/trunk/Modules/Module Operation/src/org/openconcerto/modules/operation/OperationCalendarItemPrinter.java
10,7 → 10,7
import org.jopencalendar.print.CalendarItemPrinter;
 
public class OperationCalendarItemPrinter extends CalendarItemPrinter {
public static final Font FONT_LINE = new Font("Arial", Font.PLAIN, 10);
public static final Font FONT_LINE = new Font("Arial", Font.PLAIN, 9);
 
public OperationCalendarItemPrinter(String title, List<JCalendarItem> items, PageFormat pf) {
super(title, items, pf);
/trunk/Modules/Module Operation/src/org/openconcerto/modules/operation/CalendarPrintPanel.java
7,6 → 7,7
import java.awt.event.ActionListener;
import java.awt.print.PageFormat;
import java.awt.print.Pageable;
import java.awt.print.Paper;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import java.util.ArrayList;
15,6 → 16,11
import java.util.Comparator;
import java.util.List;
 
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.Size2DSyntax;
import javax.print.attribute.standard.MediaPrintableArea;
import javax.print.attribute.standard.MediaSizeName;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
25,6 → 31,7
 
import org.jopencalendar.model.JCalendarItem;
import org.jopencalendar.print.CalendarItemPrinter;
import org.openconcerto.erp.generationDoc.A4;
import org.openconcerto.sql.users.User;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.ui.JDate;
33,6 → 40,7
public class CalendarPrintPanel extends JPanel {
final JCheckBox preview = new JCheckBox("Aperçu");
final JButton bPrint = new JButton("Imprimer");
private static final double POINTS_PER_INCH = 72.0;
 
public CalendarPrintPanel(final OperationCalendarManager manager, final int week, final int year, final List<User> selectedUsers, final List<String> selectedStates) {
preview.setSelected(true);
86,10 → 94,10
return;
}
 
final List<Pageable> p = new ArrayList<Pageable>();
final List<Pageable> p = new ArrayList<>();
 
for (User user : selectedUsers) {
final List<User> l = new ArrayList<User>();
final List<User> l = new ArrayList<>();
l.add(user);
final List<JCalendarItem> itemInWeek = manager.getItemIn(d1.getDate(), d2.getDate(), l, selectedStates);
if (!itemInWeek.isEmpty()) {
139,14 → 147,21
PrinterJob job = PrinterJob.getPrinterJob();
boolean ok = job.printDialog();
if (ok) {
final PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
final MediaSizeName media = MediaSizeName.ISO_A4;
attributes.add(media);
final Paper paper = new A4();
 
final MediaPrintableArea printableArea = new MediaPrintableArea((float) (paper.getImageableX() / POINTS_PER_INCH), (float) (paper.getImageableY() / POINTS_PER_INCH),
(float) (paper.getImageableWidth() / POINTS_PER_INCH), (float) (paper.getImageableHeight() / POINTS_PER_INCH), Size2DSyntax.INCH);
attributes.add(printableArea);
 
for (Pageable document : pageables) {
PageFormat p = job.getPageFormat(null);
System.err.println("CalendarPrintPanel.printPages():Size: " + p.getWidth() + " x " + p.getHeight());
System.err.println("CalendarPrintPanel.printPages():Imagageable: " + p.getImageableWidth() + " x " + p.getImageableHeight());
job.getPageFormat(null).getImageableHeight();
job.setPageable(document);
try {
job.print();
job.print(attributes);
} catch (PrinterException e) {
e.printStackTrace();
}
/trunk/Modules/Module Operation/src/org/openconcerto/modules/operation/labels_fr.xml
1,17 → 1,17
<?xml version="1.0" encoding="UTF-8" ?>
<ROOT>
<TABLE name="OPERATION">
<element refid="org.openconcerto.modules.operation/OPERATION" nameClass="feminine" name="intervention">
<FIELD name="ID_SITE" label="Chantier" />
<FIELD name="ID_USER_COMMON" label="Salarié" />
<FIELD name="TYPE" label="Nature de la prestation" />
<FIELD name="STATUS" label="Etat" />
<FIELD name="DESCRIPTION" label="Description" />
</TABLE>
<TABLE name="SITE">
</element>
<element refid="org.openconcerto.modules.operation/SITE" nameClass="masculine" name="chantier">
<FIELD name="NAME" label="Libellé" />
<FIELD name="ID_CLIENT" label="Client" />
<FIELD name="ID_ADRESSE" label="Adresse spécifique" />
<FIELD name="COMMENT" label="Commentaire" />
<FIELD name="INFO" label="Informations complémentaires" />
</TABLE>
</element>
</ROOT>