OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 174 Rev 177
Line 20... Line 20...
20
import org.openconcerto.ui.DefaultGridBagConstraints;
20
import org.openconcerto.ui.DefaultGridBagConstraints;
21
import org.openconcerto.ui.JDate;
21
import org.openconcerto.ui.JDate;
22
 
22
 
23
import java.awt.GridBagConstraints;
23
import java.awt.GridBagConstraints;
24
import java.awt.GridBagLayout;
24
import java.awt.GridBagLayout;
-
 
25
import java.beans.PropertyChangeEvent;
-
 
26
import java.beans.PropertyChangeListener;
25
import java.util.ArrayList;
27
import java.util.ArrayList;
26
import java.util.Arrays;
28
import java.util.Arrays;
27
import java.util.HashSet;
29
import java.util.HashSet;
28
import java.util.List;
30
import java.util.List;
29
import java.util.Set;
31
import java.util.Set;
Line 96... Line 98...
96
                JTextField textNature = new JTextField();
98
                JTextField textNature = new JTextField();
97
 
99
 
98
                this.add(labelNature, c);
100
                this.add(labelNature, c);
99
                c.gridx++;
101
                c.gridx++;
100
                c.weightx = 1;
102
                c.weightx = 1;
-
 
103
                c.gridwidth = 3;
101
                this.add(textNature, c);
104
                this.add(textNature, c);
102
 
105
 
-
 
106
                c.gridwidth = 1;
103
                // Catégorie socioprofessionnelle
107
                // Catégorie socioprofessionnelle
104
                JLabel labelCatSocio = new JLabel(getLabelFor("ID_CODE_EMPLOI"));
108
                JLabel labelCatSocio = new JLabel(getLabelFor("ID_CODE_EMPLOI"));
105
                labelCatSocio.setHorizontalAlignment(SwingConstants.RIGHT);
109
                labelCatSocio.setHorizontalAlignment(SwingConstants.RIGHT);
106
                ElementComboBox selCodeCatSocio = new ElementComboBox();
110
                ElementComboBox selCodeCatSocio = new ElementComboBox();
107
                selCodeCatSocio.setInfoIconVisible(false);
111
                selCodeCatSocio.setInfoIconVisible(false);
Line 111... Line 115...
111
                this.add(labelCatSocio, c);
115
                this.add(labelCatSocio, c);
112
                c.gridx++;
116
                c.gridx++;
113
                c.weightx = 1;
117
                c.weightx = 1;
114
                this.add(selCodeCatSocio, c);
118
                this.add(selCodeCatSocio, c);
115
                
119
 
116
                
-
 
117
                
-
 
118
                JLabel complPCSLabel = new JLabel(getLabelFor("COMPLEMENT_PCS"));
120
                JLabel complPCSLabel = new JLabel(getLabelFor("COMPLEMENT_PCS"));
119
                complPCSLabel.setHorizontalAlignment(SwingConstants.RIGHT);
121
                complPCSLabel.setHorizontalAlignment(SwingConstants.RIGHT);
120
                JTextField complPCS = new JTextField();
122
                JTextField complPCS = new JTextField();
121
                c.gridy++;
123
                c.gridx++;
122
                c.gridx = 0;
-
 
123
                c.weightx = 0;
124
                c.weightx = 0;
124
                this.add(complPCSLabel, c);
125
                this.add(complPCSLabel, c);
125
                c.gridx++;
126
                c.gridx++;
126
                c.weightx = 1;
127
                c.weightx = 1;
127
                this.add(complPCS, c);
128
                this.add(complPCS, c);
128
                addView(complPCS,"COMPLEMENT_PCS");
129
                addView(complPCS, "COMPLEMENT_PCS");
129
 
130
 
-
 
131
                JLabel objetSpecLabel = new JLabel(getLabelFor("SPECTACLE_OBJET"));
-
 
132
                objetSpecLabel.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
133
                JTextField objetSpec = new JTextField();
-
 
134
                c.gridy++;
-
 
135
                c.gridx = 0;
-
 
136
                c.weightx = 0;
-
 
137
                this.add(objetSpecLabel, c);
-
 
138
                c.gridx++;
-
 
139
                c.weightx = 1;
-
 
140
                this.add(objetSpec, c);
-
 
141
                addView(objetSpec, "SPECTACLE_OBJET");
-
 
142
                objetSpec.setEditable(false);
-
 
143
 
-
 
144
                JLabel jourContratLabel = new JLabel(getLabelFor("SPECTACLE_JOUR_CONTRAT"));
-
 
145
                jourContratLabel.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
146
                JTextField jourContrat = new JTextField();
-
 
147
                c.gridx++;
-
 
148
                c.weightx = 0;
-
 
149
                this.add(jourContratLabel, c);
-
 
150
                c.gridx++;
-
 
151
                c.weightx = 1;
-
 
152
                this.add(jourContrat, c);
-
 
153
                addView(jourContrat, "SPECTACLE_JOUR_CONTRAT");
-
 
154
                jourContrat.setEditable(false);
-
 
155
 
-
 
156
                final ElementComboBox selCaractActivite = new ElementComboBox();
-
 
157
                selCaractActivite.setInfoIconVisible(false);
-
 
158
                this.addRequiredSQLObject(selCaractActivite, "ID_CODE_CARACT_ACTIVITE");
-
 
159
                selCaractActivite.addModelListener("wantedID", new PropertyChangeListener() {
-
 
160
 
-
 
161
                    @Override
-
 
162
                    public void propertyChange(PropertyChangeEvent evt) {
-
 
163
                        final boolean b = selCaractActivite.getSelectedRow() != null && selCaractActivite.getSelectedRow().getString("CODE").equals("04");
-
 
164
                        objetSpec.setEditable(b);
-
 
165
                        jourContrat.setEditable(b);
-
 
166
                        if (!b) {
-
 
167
                            objetSpec.setText("");
-
 
168
                            ;
-
 
169
                            jourContrat.setText("");
-
 
170
                        }
-
 
171
                    }
-
 
172
                });
-
 
173
 
130
                // Contrat de travail
174
                // Contrat de travail
131
                JLabel labelContratTravail = new JLabel(getLabelFor("ID_CODE_CONTRAT_TRAVAIL"));
175
                JLabel labelContratTravail = new JLabel(getLabelFor("ID_CODE_CONTRAT_TRAVAIL"));
132
                labelContratTravail.setHorizontalAlignment(SwingConstants.RIGHT);
176
                labelContratTravail.setHorizontalAlignment(SwingConstants.RIGHT);
133
                ElementComboBox selContratTravail = new ElementComboBox();
177
                ElementComboBox selContratTravail = new ElementComboBox();
134
                selContratTravail.setInfoIconVisible(false);
178
                selContratTravail.setInfoIconVisible(false);
Line 143... Line 187...
143
                // Droit Contrat de travail
187
                // Droit Contrat de travail
144
                JLabel labelDroitContrat = new JLabel(getLabelFor("ID_CODE_DROIT_CONTRAT"));
188
                JLabel labelDroitContrat = new JLabel(getLabelFor("ID_CODE_DROIT_CONTRAT"));
145
                labelDroitContrat.setHorizontalAlignment(SwingConstants.RIGHT);
189
                labelDroitContrat.setHorizontalAlignment(SwingConstants.RIGHT);
146
                ElementComboBox selDroitContrat = new ElementComboBox();
190
                ElementComboBox selDroitContrat = new ElementComboBox();
147
                selDroitContrat.setInfoIconVisible(false);
191
                selDroitContrat.setInfoIconVisible(false);
148
                c.gridy++;
192
                c.gridx++;
149
                c.gridx = 0;
-
 
150
                c.weightx = 0;
193
                c.weightx = 0;
151
                this.add(labelDroitContrat, c);
194
                this.add(labelDroitContrat, c);
152
                c.gridx++;
195
                c.gridx++;
153
                c.weightx = 1;
196
                c.weightx = 1;
154
                this.add(selDroitContrat, c);
197
                this.add(selDroitContrat, c);
155
 
198
 
156
                // caracteristiques activité
199
                // caracteristiques activité
157
                JLabel labelCaractActivite = new JLabel(getLabelFor("ID_CODE_CARACT_ACTIVITE"));
200
                JLabel labelCaractActivite = new JLabel(getLabelFor("ID_CODE_CARACT_ACTIVITE"));
158
                labelCaractActivite.setHorizontalAlignment(SwingConstants.RIGHT);
201
                labelCaractActivite.setHorizontalAlignment(SwingConstants.RIGHT);
159
                ElementComboBox selCaractActivite = new ElementComboBox();
-
 
160
                selCaractActivite.setInfoIconVisible(false);
-
 
-
 
202
 
161
                c.gridy++;
203
                c.gridy++;
162
                c.gridx = 0;
204
                c.gridx = 0;
163
                c.weightx = 0;
205
                c.weightx = 0;
164
                this.add(labelCaractActivite, c);
206
                this.add(labelCaractActivite, c);
165
                c.gridx++;
207
                c.gridx++;
Line 169... Line 211...
169
                // Statut profesionnel
211
                // Statut profesionnel
170
                JLabel labelStatutProf = new JLabel(getLabelFor("ID_CODE_STATUT_PROF"));
212
                JLabel labelStatutProf = new JLabel(getLabelFor("ID_CODE_STATUT_PROF"));
171
                labelStatutProf.setHorizontalAlignment(SwingConstants.RIGHT);
213
                labelStatutProf.setHorizontalAlignment(SwingConstants.RIGHT);
172
                ElementComboBox selStatutProf = new ElementComboBox();
214
                ElementComboBox selStatutProf = new ElementComboBox();
173
                selStatutProf.setInfoIconVisible(false);
215
                selStatutProf.setInfoIconVisible(false);
174
                c.gridy++;
216
                c.gridx++;
175
                c.gridx = 0;
-
 
176
                c.weightx = 0;
217
                c.weightx = 0;
177
                this.add(labelStatutProf, c);
218
                this.add(labelStatutProf, c);
178
                c.gridx++;
219
                c.gridx++;
179
                c.weightx = 1;
220
                c.weightx = 1;
180
                this.add(selStatutProf, c);
221
                this.add(selStatutProf, c);
Line 187... Line 228...
187
                c.gridy++;
228
                c.gridy++;
188
                c.gridx = 0;
229
                c.gridx = 0;
189
                c.weightx = 0;
230
                c.weightx = 0;
190
                this.add(labelStatutCat, c);
231
                this.add(labelStatutCat, c);
191
                c.gridx++;
232
                c.gridx++;
192
                c.weighty = 1;
-
 
193
                c.weightx = 1;
233
                c.weightx = 1;
194
                this.add(selStatutCat, c);
234
                this.add(selStatutCat, c);
195
 
235
 
196
                // Statut categoriel
236
                // Statut categoriel
197
                JLabel labelStatutCatConv = new JLabel(getLabelFor("ID_CODE_STATUT_CAT_CONV"));
237
                JLabel labelStatutCatConv = new JLabel(getLabelFor("ID_CODE_STATUT_CAT_CONV"));
198
                labelStatutCatConv.setHorizontalAlignment(SwingConstants.RIGHT);
238
                labelStatutCatConv.setHorizontalAlignment(SwingConstants.RIGHT);
199
                ElementComboBox selStatutCatConv = new ElementComboBox();
239
                ElementComboBox selStatutCatConv = new ElementComboBox();
200
                selStatutCatConv.setInfoIconVisible(false);
240
                selStatutCatConv.setInfoIconVisible(false);
201
                c.gridy++;
241
                c.gridx++;
202
                c.gridx = 0;
-
 
203
                c.weightx = 0;
242
                c.weightx = 0;
204
                this.add(labelStatutCatConv, c);
243
                this.add(labelStatutCatConv, c);
205
                c.gridx++;
244
                c.gridx++;
206
                c.weighty = 1;
-
 
207
                c.weightx = 1;
245
                c.weightx = 1;
208
                this.add(selStatutCatConv, c);
246
                this.add(selStatutCatConv, c);
209
 
247
 
210
                List<String> dsnFF = Arrays.asList("ID_CONTRAT_MODALITE_TEMPS", "ID_CONTRAT_REGIME_MALADIE", "ID_CONTRAT_REGIME_VIEILLESSE", "ID_CONTRAT_DETACHE_EXPATRIE",
248
                List<String> dsnFF = Arrays.asList("ID_CONTRAT_MODALITE_TEMPS", "ID_CONTRAT_REGIME_MALADIE", "ID_CONTRAT_REGIME_VIEILLESSE", "ID_CONTRAT_DETACHE_EXPATRIE",
211
                        "ID_CONTRAT_DISPOSITIF_POLITIQUE");
249
                        "ID_CONTRAT_DISPOSITIF_POLITIQUE", "ID_CONTRAT_MOTIF_RECOURS");
212
 
-
 
-
 
250
                int p = 0;
213
                for (String ffName : dsnFF) {
251
                for (String ffName : dsnFF) {
214
                    JLabel labelFF = new JLabel(getLabelFor(ffName));
252
                    JLabel labelFF = new JLabel(getLabelFor(ffName));
215
                    labelFF.setHorizontalAlignment(SwingConstants.RIGHT);
253
                    labelFF.setHorizontalAlignment(SwingConstants.RIGHT);
216
                    ElementComboBox selFF = new ElementComboBox();
254
                    ElementComboBox selFF = new ElementComboBox();
217
                    selFF.setInfoIconVisible(false);
255
                    selFF.setInfoIconVisible(false);
-
 
256
                    if (p % 2 == 0) {
218
                    c.gridy++;
257
                        c.gridy++;
219
                    c.gridx = 0;
258
                        c.gridx = 0;
220
                    c.weightx = 0;
259
                    } else {
221
                    this.add(labelFF, c);
-
 
222
                    c.gridx++;
260
                        c.gridx++;
223
                    c.weighty = 1;
-
 
224
                    c.weightx = 1;
-
 
225
                    this.add(selFF, c);
-
 
226
                    this.addRequiredSQLObject(selFF, ffName);
-
 
227
                }
261
                    }
228
                JLabel labelFF = new JLabel(getLabelFor("ID_CONTRAT_MOTIF_RECOURS"));
-
 
229
                labelFF.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
230
                ElementComboBox selFF = new ElementComboBox();
-
 
231
                selFF.setInfoIconVisible(false);
-
 
232
                c.gridy++;
262
                    p++;
233
                c.gridx = 0;
-
 
234
                c.weightx = 0;
263
                    c.weightx = 0;
235
                this.add(labelFF, c);
264
                    this.add(labelFF, c);
236
                c.gridx++;
265
                    c.gridx++;
237
                c.weighty = 1;
266
                    c.weighty = 1;
238
                c.weightx = 1;
267
                    c.weightx = 1;
239
                this.add(selFF, c);
268
                    this.add(selFF, c);
240
                this.addSQLObject(selFF, "ID_CONTRAT_MOTIF_RECOURS");
269
                    if (ffName.equals("ID_CONTRAT_MOTIF_RECOURS")) {
-
 
270
                        this.addSQLObject(selFF, ffName);
-
 
271
                    } else {
-
 
272
                        this.addRequiredSQLObject(selFF, ffName);
-
 
273
                    }
-
 
274
                }
241
 
275
 
242
                // Code Arrco, agirc retirés du contrat et ajoutés dans les caisses de cotisations
276
                // Code Arrco, agirc retirés du contrat et ajoutés dans les caisses de cotisations
243
 
277
 
244
                // Code UGRR
278
                // Code UGRR
245
 
279
 
Line 336... Line 370...
336
                // c.weighty = 1;
370
                // c.weighty = 1;
337
                // c.weightx = 1;
371
                // c.weightx = 1;
338
                // this.add(textCodeRegimeRetraite, c);
372
                // this.add(textCodeRegimeRetraite, c);
339
                // addRequiredSQLObject(textCodeRegimeRetraite, "CODE_REGIME_RETRAITE_DSN");
373
                // addRequiredSQLObject(textCodeRegimeRetraite, "CODE_REGIME_RETRAITE_DSN");
340
 
374
 
341
                JLabel labelDateModif = new JLabel(getLabelFor("DATE_MODIFICATION"));
375
                // JLabel labelDateModif = new JLabel(getLabelFor("DATE_MODIFICATION"));
342
                labelDateModif.setHorizontalAlignment(SwingConstants.RIGHT);
376
                // labelDateModif.setHorizontalAlignment(SwingConstants.RIGHT);
343
                JDate textDateModif = new JDate();
377
                // JDate textDateModif = new JDate();
344
                c.gridy++;
378
                // c.gridy++;
345
                c.gridx = 0;
379
                // c.gridx = 0;
346
                c.weightx = 0;
380
                // c.weightx = 0;
347
                this.add(textDateModif, c);
381
                // this.add(textDateModif, c);
348
                c.gridx++;
382
                // c.gridx++;
349
                c.weighty = 1;
383
                // c.weighty = 1;
350
                c.weightx = 1;
384
                // c.weightx = 1;
351
                this.add(textDateModif, c);
385
                // this.add(textDateModif, c);
352
                addSQLObject(textDateModif, "DATE_MODIFICATION");
386
                // addSQLObject(textDateModif, "DATE_MODIFICATION");
353
 
387
 
354
                // JLabel labelCM = new JLabel(getLabelFor("ID_INFOS_SALARIE_PAYE_MODIFIE"));
388
                // JLabel labelCM = new JLabel(getLabelFor("ID_INFOS_SALARIE_PAYE_MODIFIE"));
355
                // labelCM.setHorizontalAlignment(SwingConstants.RIGHT);
389
                // labelCM.setHorizontalAlignment(SwingConstants.RIGHT);
356
                // ElementComboBox selCM = new ElementComboBox();
390
                // ElementComboBox selCM = new ElementComboBox();
357
                // final SQLElement elementInfosPaye =
391
                // final SQLElement elementInfosPaye =
Line 374... Line 408...
374
                c.gridy++;
408
                c.gridy++;
375
                c.gridx = 0;
409
                c.gridx = 0;
376
                c.weightx = 0;
410
                c.weightx = 0;
377
                this.add(labelDateDebut, c);
411
                this.add(labelDateDebut, c);
378
                c.gridx++;
412
                c.gridx++;
379
                c.weighty = 1;
-
 
380
                c.weightx = 1;
413
                c.weightx = 1;
381
                this.add(textDateDebut, c);
414
                this.add(textDateDebut, c);
382
                addSQLObject(textDateDebut, "DATE_DEBUT", REQ);
415
                addSQLObject(textDateDebut, "DATE_DEBUT", REQ);
383
 
416
 
384
                JLabel labelDateFin = new JLabel(getLabelFor("DATE_PREV_FIN"));
417
                JLabel labelDateFin = new JLabel(getLabelFor("DATE_PREV_FIN"));
385
                labelDateFin.setHorizontalAlignment(SwingConstants.RIGHT);
418
                labelDateFin.setHorizontalAlignment(SwingConstants.RIGHT);
386
                JDate textDateFin = new JDate();
419
                JDate textDateFin = new JDate();
387
                c.gridy++;
420
                c.gridx++;
388
                c.gridx = 0;
-
 
389
                c.weightx = 0;
421
                c.weightx = 0;
390
                this.add(labelDateFin, c);
422
                this.add(labelDateFin, c);
391
                c.gridx++;
423
                c.gridx++;
392
                c.weighty = 1;
-
 
393
                c.weightx = 1;
424
                c.weightx = 1;
394
                this.add(textDateFin, c);
425
                this.add(textDateFin, c);
395
                addSQLObject(textDateFin, "DATE_PREV_FIN");
426
                addSQLObject(textDateFin, "DATE_PREV_FIN");
396
 
427
 
-
 
428
                JLabel labelAmen = new JLabel(getLabelFor("ID_CODE_AMENAGEMENT_PARTIEL"));
-
 
429
                labelAmen.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
430
                ElementComboBox selAmen = new ElementComboBox();
-
 
431
                selAmen.setInfoIconVisible(false);
-
 
432
                c.gridy++;
-
 
433
                c.gridx = 0;
-
 
434
                c.weightx = 0;
-
 
435
                this.add(labelAmen, c);
-
 
436
                c.gridx++;
-
 
437
                c.weightx = 1;
-
 
438
                this.add(selAmen, c);
-
 
439
                this.addSQLObject(selAmen, "ID_CODE_AMENAGEMENT_PARTIEL");
-
 
440
 
-
 
441
                JLabel labelSupsension = new JLabel(getLabelFor("ID_CODE_SUSPENSION"));
-
 
442
                labelSupsension.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
443
                ElementComboBox selSupsension = new ElementComboBox();
-
 
444
                selSupsension.setInfoIconVisible(false);
-
 
445
                c.gridx++;
-
 
446
                c.weightx = 0;
-
 
447
                this.add(labelSupsension, c);
-
 
448
                c.gridx++;
-
 
449
                c.weightx = 1;
-
 
450
                this.add(selSupsension, c);
-
 
451
                this.addSQLObject(selSupsension, "ID_CODE_SUSPENSION");
-
 
452
 
-
 
453
                JLabel labelDateDebutSusp = new JLabel(getLabelFor("DATE_DEBUT_SUSPENSION"));
-
 
454
                labelDateDebutSusp.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
455
                JDate textDateDebutSups = new JDate();
-
 
456
                c.gridy++;
-
 
457
                c.gridx = 0;
-
 
458
                c.weightx = 0;
-
 
459
                this.add(labelDateDebutSusp, c);
-
 
460
                c.gridx++;
-
 
461
                c.weightx = 1;
-
 
462
                this.add(textDateDebutSups, c);
-
 
463
                this.addSQLObject(textDateDebutSups, "DATE_DEBUT_SUSPENSION");
-
 
464
 
-
 
465
                JLabel labelDateFinSups = new JLabel(getLabelFor("DATE_FIN_SUSPENSION"));
-
 
466
                labelDateFinSups.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
467
                JDate textDateFinSuspension = new JDate();
-
 
468
                c.gridx++;
-
 
469
                c.weightx = 0;
-
 
470
                this.add(labelDateFinSups, c);
-
 
471
                c.gridx++;
-
 
472
                c.weightx = 1;
-
 
473
                this.add(textDateFinSuspension, c);
-
 
474
                this.addSQLObject(textDateFinSuspension, "DATE_FIN_SUSPENSION");
-
 
475
 
397
                this.addRequiredSQLObject(selCodeCatSocio, "ID_CODE_EMPLOI");
476
                this.addRequiredSQLObject(selCodeCatSocio, "ID_CODE_EMPLOI");
398
                this.addRequiredSQLObject(selContratTravail, "ID_CODE_CONTRAT_TRAVAIL");
477
                this.addRequiredSQLObject(selContratTravail, "ID_CODE_CONTRAT_TRAVAIL");
399
                this.addRequiredSQLObject(selCaractActivite, "ID_CODE_CARACT_ACTIVITE");
-
 
400
                this.addRequiredSQLObject(selDroitContrat, "ID_CODE_DROIT_CONTRAT");
478
                this.addRequiredSQLObject(selDroitContrat, "ID_CODE_DROIT_CONTRAT");
401
                this.addRequiredSQLObject(selStatutProf, "ID_CODE_STATUT_PROF");
479
                this.addRequiredSQLObject(selStatutProf, "ID_CODE_STATUT_PROF");
402
                this.addRequiredSQLObject(selStatutCat, "ID_CODE_STATUT_CATEGORIEL");
480
                this.addRequiredSQLObject(selStatutCat, "ID_CODE_STATUT_CATEGORIEL");
403
                this.addRequiredSQLObject(selStatutCatConv, "ID_CODE_STATUT_CAT_CONV");
481
                this.addRequiredSQLObject(selStatutCatConv, "ID_CODE_STATUT_CAT_CONV");
404
                this.addRequiredSQLObject(textNature, "NATURE");
482
                this.addRequiredSQLObject(textNature, "NATURE");