OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 149 → Rev 150

/trunk/Modules/Module Operation/src/org/openconcerto/modules/operation/ModuleOperation.java
5,7 → 5,6
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
28,7 → 27,6
import org.openconcerto.erp.modules.MenuContext;
import org.openconcerto.erp.modules.ModuleFactory;
import org.openconcerto.modules.operation.action.LockAction;
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.element.SQLElement;
import org.openconcerto.sql.element.SQLElementDirectory;
import org.openconcerto.sql.model.SQLRowValues;
45,6 → 43,8
public static final String TABLE_SITE = "SITE";
public static final String TABLE_OPERATION = "OPERATION";
 
public static final Flag FREE_TIME_FLAG = new Flag("freeTime", null, "Non travaillé", "");
 
public ModuleOperation(ModuleFactory f) throws IOException {
super(f);
}
57,7 → 57,6
dir.addSQLElement(new SiteSQLElement(this));
dir.addSQLElement(new OperationSQLElement(this));
 
Configuration.getInstance().getShowAs().show("SITE", Arrays.asList("NAME"));
// SQLRequestLog.setEnabled(true);
// SQLRequestLog.showFrame();
TemplateManager.getInstance().register(OPERATIONS_REPORT_TEMPLATE_ID);
69,7 → 68,7
@Override
protected void setupMenu(MenuContext ctxt) {
ctxt.addMenuItem(ctxt.createListAction(TABLE_SITE), "operation");
final SQLElement element = Configuration.getInstance().getDirectory().getElement(TABLE_OPERATION);
final SQLElement element = ctxt.getElement(TABLE_OPERATION);
final AbstractAction aOperations = new AbstractAction(getTM().trM("listAction.name", "element", element.getName())) {
 
@Override
160,9 → 159,11
Flag.register(new Flag("planned", icon, "Planifié", ""));
icon = new ImageIcon(LockAction.class.getResource("locked.png"));
Flag.register(new Flag("locked", icon, "Verrouillé", ""));
Flag.register(FREE_TIME_FLAG);
 
comp = new OperationCalendarPanel();
comp2 = new DailyOperationCalendarPanel();
final ComptaPropsConfiguration conf = ComptaPropsConfiguration.getInstanceCompta();
comp = new OperationCalendarPanel(conf);
comp2 = new DailyOperationCalendarPanel(conf);
 
MainFrame.getInstance().getTabbedPane().addTab("Planning", comp);
MainFrame.getInstance().getTabbedPane().addTab("Planning journalier", comp2);
185,11 → 186,11
public static List<Long> getOperationIdsFrom(Set<JCalendarItemDB> toDelete) {
final List<Long> ids = new ArrayList<Long>();
for (JCalendarItemDB jCalendarItemDB : toDelete) {
if (!jCalendarItemDB.getTableSource().equals(ModuleOperation.TABLE_OPERATION)) {
throw new IllegalStateException("Table is not " + ModuleOperation.TABLE_OPERATION + " but " + jCalendarItemDB.getTableSource());
if (jCalendarItemDB.getSourceElement().getClass() != OperationSQLElement.class) {
throw new IllegalStateException("Table is not " + ModuleOperation.TABLE_OPERATION + " but " + jCalendarItemDB.getSource());
 
}
final long sourceId = jCalendarItemDB.getSourceId();
final long sourceId = jCalendarItemDB.getSource().getID();
if (!ids.contains(sourceId)) {
ids.add(sourceId);
}