OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 156 Rev 174
Line 26... Line 26...
26
import org.openconcerto.sql.model.SQLSelect;
26
import org.openconcerto.sql.model.SQLSelect;
27
import org.openconcerto.sql.model.SQLTable;
27
import org.openconcerto.sql.model.SQLTable;
28
import org.openconcerto.sql.model.Where;
28
import org.openconcerto.sql.model.Where;
29
import org.openconcerto.sql.request.ComboSQLRequest;
29
import org.openconcerto.sql.request.ComboSQLRequest;
30
import org.openconcerto.sql.sqlobject.itemview.SimpleRowItemView;
30
import org.openconcerto.sql.sqlobject.itemview.SimpleRowItemView;
-
 
31
import org.openconcerto.sql.ui.IColorChooser;
31
import org.openconcerto.sql.ui.Login;
32
import org.openconcerto.sql.ui.Login;
32
import org.openconcerto.sql.view.QuickAssignPanel;
33
import org.openconcerto.sql.view.QuickAssignPanel;
33
import org.openconcerto.sql.view.list.ITableModel;
34
import org.openconcerto.sql.view.list.ITableModel;
34
import org.openconcerto.sql.view.list.RowValuesTableModel;
35
import org.openconcerto.sql.view.list.RowValuesTableModel;
35
import org.openconcerto.sql.view.list.SQLTableElement;
36
import org.openconcerto.sql.view.list.SQLTableElement;
Line 218... Line 219...
218
            this.setLayout(layout);
219
            this.setLayout(layout);
219
 
220
 
220
            // Login
221
            // Login
221
            c.gridx = 0;
222
            c.gridx = 0;
222
            c.insets = new Insets(2, 2, 1, 2);
223
            c.insets = new Insets(2, 2, 1, 2);
223
            final JLabel labelLogin = new JLabel(getLabelFor("LOGIN"));
224
            final JLabel labelLogin = new JLabel(getLabelFor("LOGIN"), SwingConstants.RIGHT);
224
            labelLogin.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
225
            this.add(labelLogin, c);
225
            this.add(labelLogin, c);
226
            final JTextField textLogin = new JTextField();
226
            final JTextField textLogin = new JTextField();
227
            c.gridx++;
227
            c.gridx++;
228
            DefaultGridBagConstraints.lockMinimumSize(textLogin);
228
            DefaultGridBagConstraints.lockMinimumSize(textLogin);
229
            c.weightx = 1;
229
            c.weightx = 1;
Line 240... Line 240...
240
            c.gridy++;
240
            c.gridy++;
241
            c.gridwidth = 1;
241
            c.gridwidth = 1;
242
            c.gridx = 0;
242
            c.gridx = 0;
243
            c.weightx = 0;
243
            c.weightx = 0;
244
            c.insets = new Insets(2, 2, 1, 2);
244
            c.insets = new Insets(2, 2, 1, 2);
245
            final JLabel labelPass = new JLabel(getLabelFor("PASSWORD"));
245
            final JLabel labelPass = new JLabel(getLabelFor("PASSWORD"), SwingConstants.RIGHT);
246
            labelPass.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
247
            this.add(labelPass, c);
246
            this.add(labelPass, c);
248
            this.passField = new JPasswordField(15);
247
            this.passField = new JPasswordField(15);
249
            c.gridx++;
248
            c.gridx++;
250
            c.weightx = 1;
249
            c.weightx = 1;
251
            DefaultGridBagConstraints.lockMinimumSize(this.getPassField());
250
            DefaultGridBagConstraints.lockMinimumSize(this.getPassField());
252
            this.add(this.getPassField(), c);
251
            this.add(this.getPassField(), c);
253
 
252
 
254
            // Confirmation password
253
            // Confirmation password
255
            c.gridx++;
254
            c.gridx++;
256
            c.weightx = 0;
255
            c.weightx = 0;
257
            final JLabel labelConfirmationPass = new JLabel(getLabelFor("PASSWORD_CONFIRM"));
256
            final JLabel labelConfirmationPass = new JLabel(getLabelFor("PASSWORD_CONFIRM"), SwingConstants.RIGHT);
258
            labelConfirmationPass.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
259
            this.add(labelConfirmationPass, c);
257
            this.add(labelConfirmationPass, c);
260
            this.passFieldConfirm = new JPasswordField(15);
258
            this.passFieldConfirm = new JPasswordField(15);
261
            c.gridx++;
259
            c.gridx++;
262
            c.weightx = 1;
260
            c.weightx = 1;
263
            DefaultGridBagConstraints.lockMinimumSize(this.getPassFieldConfirm());
261
            DefaultGridBagConstraints.lockMinimumSize(this.getPassFieldConfirm());
Line 265... Line 263...
265
 
263
 
266
            // Nom
264
            // Nom
267
            c.gridx = 0;
265
            c.gridx = 0;
268
            c.gridy++;
266
            c.gridy++;
269
            c.weightx = 0;
267
            c.weightx = 0;
270
            final JLabel labelNom = new JLabel(getLabelFor("NOM"));
268
            final JLabel labelNom = new JLabel(getLabelFor("NOM"), SwingConstants.RIGHT);
271
            labelNom.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
272
            this.add(labelNom, c);
269
            this.add(labelNom, c);
273
            final JTextField textNom = new JTextField();
270
            final JTextField textNom = new JTextField();
274
            c.gridx++;
271
            c.gridx++;
275
            c.weightx = 1;
272
            c.weightx = 1;
276
            this.add(textNom, c);
273
            this.add(textNom, c);
277
 
274
 
278
            // Prenom
275
            // Prenom
279
            c.gridx++;
276
            c.gridx++;
280
            c.weightx = 0;
277
            c.weightx = 0;
281
            final JLabel labelPrenom = new JLabel(getLabelFor("PRENOM"));
278
            final JLabel labelPrenom = new JLabel(getLabelFor("PRENOM"), SwingConstants.RIGHT);
282
            labelPrenom.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
283
            this.add(labelPrenom, c);
279
            this.add(labelPrenom, c);
284
            final JTextField textPrenom = new JTextField();
280
            final JTextField textPrenom = new JTextField();
285
            c.gridx++;
281
            c.gridx++;
286
            c.weightx = 1;
282
            c.weightx = 1;
287
            this.add(textPrenom, c);
283
            this.add(textPrenom, c);
288
 
284
 
289
            // Surnom
285
            // Surnom
290
            c.gridx = 0;
286
            c.gridx = 0;
291
            c.gridy++;
287
            c.gridy++;
292
            c.weightx = 0;
288
            c.weightx = 0;
293
            final JLabel labelSurnom = new JLabel(getLabelFor("SURNOM"));
289
            final JLabel labelSurnom = new JLabel(getLabelFor("SURNOM"), SwingConstants.RIGHT);
294
            labelSurnom.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
295
            this.add(labelSurnom, c);
290
            this.add(labelSurnom, c);
296
            final JTextField textSurnom = new JTextField();
291
            final JTextField textSurnom = new JTextField();
297
            c.gridx++;
292
            c.gridx++;
298
            c.weightx = 1;
293
            c.weightx = 1;
299
            this.add(textSurnom, c);
294
            this.add(textSurnom, c);
Line 311... Line 306...
311
            c.gridwidth = 1;
306
            c.gridwidth = 1;
312
            c.gridx = 0;
307
            c.gridx = 0;
313
            c.weightx = 0;
308
            c.weightx = 0;
314
 
309
 
315
            if (getTable().contains("MAIL")) {
310
            if (getTable().contains("MAIL")) {
316
                final JLabel labelMail = new JLabel(getLabelFor("MAIL"));
311
                final JLabel labelMail = new JLabel(getLabelFor("MAIL"), SwingConstants.RIGHT);
317
                labelMail.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
318
                c.anchor = GridBagConstraints.NORTHWEST;
312
                c.anchor = GridBagConstraints.NORTHWEST;
319
                this.add(labelMail, c);
313
                this.add(labelMail, c);
320
                c.gridx++;
314
                c.gridx++;
321
                final JTextField textMail = new JTextField();
315
                final JTextField textMail = new JTextField();
322
                c.gridwidth = 1;
316
                c.gridwidth = 1;
323
                c.weightx = 1;
317
                c.weightx = 1;
324
 
318
 
325
                this.add(textMail, c);
319
                this.add(textMail, c);
326
                this.addView(textMail, "MAIL");
320
                this.addView(textMail, "MAIL");
327
            }
321
            }
-
 
322
 
328
            if (getTable().contains("OUT")) {
323
            if (getTable().contains("OUT")) {
329
                c.gridx++;
324
                c.gridx++;
330
                final JCheckBox boxOut = new JCheckBox(getLabelFor("OUT"));
325
                final JCheckBox boxOut = new JCheckBox(getLabelFor("OUT"));
331
                c.gridwidth = 1;
326
                c.gridwidth = 1;
332
                c.weightx = 1;
327
                c.weightx = 1;
Line 343... Line 338...
343
                    this.add(boxDisabled, c);
338
                    this.add(boxDisabled, c);
344
                    this.addView(boxDisabled, "DISABLED");
339
                    this.addView(boxDisabled, "DISABLED");
345
                }
340
                }
346
            }
341
            }
347
            c.gridy++;
342
            c.gridy++;
-
 
343
 
-
 
344
            if (getTable().contains("COMPTE_NUMERO")) {
-
 
345
                final JLabel labelMail = new JLabel(getLabelFor("COMPTE_NUMERO"));
-
 
346
                labelMail.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
347
                c.anchor = GridBagConstraints.NORTHWEST;
-
 
348
                this.add(labelMail, c);
-
 
349
                c.gridx++;
-
 
350
                final JTextField textMail = new JTextField();
-
 
351
                c.gridwidth = 1;
-
 
352
                c.weightx = 1;
-
 
353
                c.gridy++;
-
 
354
                this.add(textMail, c);
-
 
355
                this.addView(textMail, "COMPTE_NUMERO");
-
 
356
            }
-
 
357
 
348
            if (getTable().contains("TEL")) {
358
            if (getTable().contains("TEL")) {
349
                c.gridx = 0;
359
                c.gridx = 0;
350
                final JLabel labelTel = new JLabel(getLabelFor("TEL"));
360
                final JLabel labelTel = new JLabel(getLabelFor("TEL"), SwingConstants.RIGHT);
351
                c.gridwidth = 1;
361
                c.gridwidth = 1;
352
                c.weightx = 0;
362
                c.weightx = 0;
353
                this.add(labelTel, c);
363
                this.add(labelTel, c);
354
                final JTextField fieldTel = new JTextField(20);
364
                final JTextField fieldTel = new JTextField(20);
355
                c.gridx++;
365
                c.gridx++;
Line 363... Line 373...
363
                c.weightx = 1;
373
                c.weightx = 1;
364
                c.gridwidth = GridBagConstraints.REMAINDER;
374
                c.gridwidth = GridBagConstraints.REMAINDER;
365
                this.add(boxCalUser, c);
375
                this.add(boxCalUser, c);
366
                this.addView(boxCalUser, "CALENDAR_USER");
376
                this.addView(boxCalUser, "CALENDAR_USER");
367
            }
377
            }
-
 
378
            if (getTable().contains("COLOR")) {
-
 
379
                c.gridy++;
-
 
380
                c.gridx = 0;
-
 
381
                final JLabel labelTel = new JLabel(getLabelFor("COLOR"), SwingConstants.RIGHT);
-
 
382
                c.gridwidth = 1;
-
 
383
                c.weightx = 0;
-
 
384
                this.add(labelTel, c);
-
 
385
                final IColorChooser colorChooser = new IColorChooser(getLabelFor("COLOR"));
-
 
386
                c.gridx++;
-
 
387
                c.weightx = 1;
-
 
388
                c.fill = GridBagConstraints.HORIZONTAL;
-
 
389
                this.add(colorChooser, c);
-
 
390
                this.addView(colorChooser, "COLOR");
-
 
391
            }
368
 
392
 
369
            final boolean gestionHoraire = false;
393
            final boolean gestionHoraire = false;
370
            if (Configuration.getInstance().getAppName().startsWith("OpenConcerto") && gestionHoraire) {
394
            if (Configuration.getInstance().getAppName().startsWith("OpenConcerto") && gestionHoraire) {
371
 
395
 
372
                c.gridwidth = 1;
396
                c.gridwidth = 1;