Subversion Repositories eFlore/Applications.del

Rev

Rev 919 | Rev 933 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 919 Rev 922
Line 7... Line 7...
7
public class PropositionDetermination extends InterventionForum implements Serializable {
7
public class PropositionDetermination extends InterventionForum implements Serializable {
Line 8... Line 8...
8
 
8
 
9
	private static final long serialVersionUID = 840032625524143547L;
9
	private static final long serialVersionUID = 840032625524143547L;
10
	private String id, espece, commentaire;
10
	private String id, espece, commentaire;
11
	private int nbCommentaires = 0;
-
 
Line 12... Line 11...
12
	
11
	private int nbCommentaires = 0;
13
 
12
 
14
	private Map<String, VoteDetermination> votesDeterminations = new HashMap<String, VoteDetermination>();
13
	private Map<String, VoteDetermination> votesDeterminations = new HashMap<String, VoteDetermination>();
15
	private Observation observation;
14
	private Observation observation;
16
	
15
 
17
	public PropositionDetermination(String id, Contributeur contributeur, String texte) {
16
	public PropositionDetermination(String id, Contributeur contributeur, String texte) {
18
		setId(id);
17
		setId(id);
19
		setContributeur(contributeur);
18
		setContributeur(contributeur);
20
		setCommentaire(texte);
19
		setCommentaire(texte);
21
	}
20
	}
22
	
21
 
23
	public PropositionDetermination(Observation observation) {
22
	public PropositionDetermination(Observation observation) {
Line 24... Line 23...
24
		this.observation = observation;
23
		this.observation = observation;
Line 49... Line 48...
49
	}
48
	}
Line 50... Line 49...
50
 
49
 
51
	public void setVotesDeterminations(Map<String, VoteDetermination> votesDeterminations) {
50
	public void setVotesDeterminations(Map<String, VoteDetermination> votesDeterminations) {
52
		this.votesDeterminations = votesDeterminations;
51
		this.votesDeterminations = votesDeterminations;
53
	}
52
	}
54
	
53
 
55
	public boolean utilisateurAVotePourDetermination(String idContributeur) {
54
	public boolean utilisateurAVotePourDetermination(String idContributeur) {
56
		return votesDeterminations.containsKey(idContributeur);
55
		return votesDeterminations.containsKey(idContributeur);
Line 57... Line 56...
57
	}
56
	}
Line 61... Line 60...
61
	}
60
	}
Line 62... Line 61...
62
 
61
 
63
	public void setObservation(Observation observation) {
62
	public void setObservation(Observation observation) {
64
		this.observation = observation;
63
		this.observation = observation;
65
	}
64
	}
66
	
65
 
67
	public void setCommentaire(String commentaire) {
66
	public void setCommentaire(String commentaire) {
68
		this.commentaire = commentaire;
67
		this.commentaire = commentaire;
Line 69... Line 68...
69
	}
68
	}
70
 
69
 
71
	public String getCommentaire() {
70
	public String getCommentaire() {
72
		return commentaire;
71
		return commentaire;
73
	}
72
	}
74
	
73
 
75
	public void setNbCommentaires(int nbCommentaires) {
74
	public void setNbCommentaires(int nbCommentaires) {
76
		this.nbCommentaires = nbCommentaires;
75
		this.nbCommentaires = nbCommentaires;
77
	}
76
	}
78
	
77
 
79
	public int getTotalCommentaires() {
78
	public int getTotalCommentaires() {
-
 
79
		if (nbCommentaires == 0) {
-
 
80
			nbCommentaires = super.getTotalCommentaires();
-
 
81
			if (this.getCommentaire() != null&&this.getCommentaire()!="") {
80
		if(nbCommentaires == 0) {
82
				nbCommentaires += 1;
81
			nbCommentaires =  super.getTotalCommentaires();
83
			}
82
		}
84
		}
83
		
85
 
84
		return nbCommentaires;
86
		return nbCommentaires;