BrightSide Workbench Full Report + Source Code
IssueWizard.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2012 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.issue.wizard;
20 
21 import java.util.Date;
22 import org.turro.dossier.entity.Issue;
23 import org.turro.dossier.task.Subtask;
24 import org.turro.i18n.I_;
25 import org.turro.jpa.entity.EntityArray;
26 import org.turro.registry.BooleanChange;
27 import org.turro.registry.ChangeCategory;
28 import org.turro.registry.Changes;
29 import org.turro.registry.StringChange;
30 import org.zkoss.zk.ui.Executions;
31 
36 public class IssueWizard {
37 
38  public final Changes changes = new Changes();
39  public Issue issue;
40  public String comment;
41  public double expenses, hours, price;
42  public boolean show, cancelMail;
43  public Date date;
45  public int repeatCount = 0;
46  public Subtask subtask;
47 
48  public IssueWizard() {
49  this.issue = (Issue) Executions.getCurrent().getArg().get("issue");
50  this.subtask = (Subtask) Executions.getCurrent().getArg().get("subtask");
51  checkNewValues();
52  }
53 
54  public Changes getChanges() {
55  return changes;
56  }
57 
58  public Issue getIssue() {
59  return issue;
60  }
61 
62  private void checkNewValues() {
63  date = new Date();
64  if(issue.getId() == null || issue.getId() == 0) {
65  if(issue.isMilestone()) {
66  ChangeCategory issueCat = new ChangeCategory(2, I_.get("Changes"));
67  changes.addChange(new BooleanChange(issueCat, I_.get("Milestone"),
68  false, true));
69  }
70  if(issue.getDossier() != null) {
71  ChangeCategory issueCat = new ChangeCategory(2, I_.get("Changes"));
72  changes.addChange(new StringChange(issueCat, I_.get("Dossier"),
74  }
75  }
76  }
77 
78 }
static String get(String msg)
Definition: I_.java:41