| Line 447... |
Line 447... |
| 447 |
if (personnesSaisiesComboBox.getValeur() instanceof ModelData) {
|
447 |
if (personnesSaisiesComboBox.getValeur() instanceof ModelData) {
|
| 448 |
// N'ajouter l'auteur que s'il n'est pas déjà présent dans la grille et dans les valeurs initiales
|
448 |
// N'ajouter l'auteur que s'il n'est pas déjà présent dans la grille et dans les valeurs initiales
|
| 449 |
Personne personneSaisieSelectionnee = new Personne(personnesSaisiesComboBox.getValeur());
|
449 |
Personne personneSaisieSelectionnee = new Personne(personnesSaisiesComboBox.getValeur());
|
| 450 |
PublicationAPersonne pap = new PublicationAPersonne();
|
450 |
PublicationAPersonne pap = new PublicationAPersonne();
|
| 451 |
pap.setPersonne(personneSaisieSelectionnee);
|
451 |
pap.setPersonne(personneSaisieSelectionnee);
|
| - |
|
452 |
pap.setOrdreAuteurs(String.valueOf(grilleAuteurs.getStore().getCount()+1));
|
| 452 |
if (modeDeCreation != Formulaire.MODE_AJOUTER) pap.setPublicationLiee(publication);
|
453 |
if (modeDeCreation != Formulaire.MODE_AJOUTER) {
|
| - |
|
454 |
pap.setPublicationLiee(publication);
|
| - |
|
455 |
pap.setIdPublication(publicationId);
|
| - |
|
456 |
}
|
| 453 |
if (grilleAuteurs.getStore().findModel(pap) != null) {
|
457 |
if (grilleAuteurs.getStore().findModel(pap) != null) {
|
| 454 |
Info.display("Information", "La personne est déjà présente dans la liste d'auteurs");
|
458 |
Info.display("Information", "La personne est déjà présente dans la liste d'auteurs");
|
| 455 |
} else {
|
459 |
} else {
|
| 456 |
ajouterDansGrille(pap);
|
460 |
ajouterDansGrille(pap);
|
| 457 |
personnesSaisiesComboBox.getCombo().setValue(null);
|
461 |
personnesSaisiesComboBox.getCombo().setValue(null);
|
| Line 460... |
Line 464... |
| 460 |
}
|
464 |
}
|
| 461 |
});
|
465 |
});
|
| 462 |
}
|
466 |
}
|
| Line 463... |
Line 467... |
| 463 |
|
467 |
|
| 464 |
private void ajouterDansGrille(PublicationAPersonne pap) {
|
468 |
private void ajouterDansGrille(PublicationAPersonne pap) {
|
| 465 |
ajouterDansGrille(pap, 0);
|
469 |
ajouterDansGrille(pap, grilleAuteurs.getStore().getCount());
|
| Line 466... |
Line 470... |
| 466 |
}
|
470 |
}
|
| 467 |
|
471 |
|
| 468 |
private void ajouterDansGrille(PublicationAPersonne pap, int index) {
|
472 |
private void ajouterDansGrille(PublicationAPersonne pap, int index) {
|
| Line 865... |
Line 869... |
| 865 |
}
|
869 |
}
|
| Line 866... |
Line 870... |
| 866 |
|
870 |
|
| 867 |
// - Envoyer au médiateur SSI personnes à modifier
|
871 |
// - Envoyer au médiateur SSI personnes à modifier
|
| 868 |
if (listeAuteursAModifier.size() > 0) {
|
872 |
if (listeAuteursAModifier.size() > 0) {
|
| 869 |
int seqId = sequenceur.lancerRequeteSynchrone(this);
|
873 |
int seqId = sequenceur.lancerRequeteSynchrone(this);
|
| 870 |
mediateur.modifierPublicationAPersonne(sequenceur, publication.getId(), listeAuteursAModifier, PublicationAPersonne.ROLE_AUTEUR, seqId);
|
874 |
mediateur.modifierPublicationAPersonne(sequenceur, this.publicationId, listeAuteursAModifier, PublicationAPersonne.ROLE_AUTEUR, seqId);
|
| Line 871... |
Line 875... |
| 871 |
}
|
875 |
}
|
| 872 |
|
876 |
|
| Line 1187... |
Line 1191... |
| 1187 |
soumettreAuteurs();
|
1191 |
soumettreAuteurs();
|
| 1188 |
} else if (info.getType().equals("ajout_publication")) {
|
1192 |
} else if (info.getType().equals("ajout_publication")) {
|
| 1189 |
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String && ((String) info.getDonnee(0)).matches("[0-9]+")) {
|
1193 |
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String && ((String) info.getDonnee(0)).matches("[0-9]+")) {
|
| 1190 |
String idPublication = (String) info.getDonnee(0);
|
1194 |
String idPublication = (String) info.getDonnee(0);
|
| 1191 |
this.publicationId = idPublication;
|
1195 |
this.publicationId = idPublication;
|
| - |
|
1196 |
this.publication.setId(idPublication);
|
| 1192 |
soumettreAuteurs();
|
1197 |
soumettreAuteurs();
|
| 1193 |
InfoLogger.display("Ajout d'une publication", "La publication '"+publicationId+"' a bien été ajoutée");
|
1198 |
InfoLogger.display("Ajout d'une publication", "La publication '"+publicationId+"' a bien été ajoutée");
|
| 1194 |
} else {
|
1199 |
} else {
|
| 1195 |
InfoLogger.display("Ajout d'une publication", info.toString());
|
1200 |
InfoLogger.display("Ajout d'une publication", info.toString());
|
| 1196 |
}
|
1201 |
}
|