From 27ae9095639bb228a1b7ff86a3ebe4264abf05be Mon Sep 17 00:00:00 2001
From: mschaefers <mschaefers@scoop-gmbh.de>
Date: Thu, 29 Nov 2012 12:33:09 -0500
Subject: [PATCH] feature: when using LdapUserService one can configure Gitblit to fetch all users from ldap that can possibly login. This allows to see newly generated LDAP users instantly in Gitblit. By now an LDAP user had to log in once to appear in GitBlit.
---
src/com/gitblit/models/IssueModel.java | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/com/gitblit/models/IssueModel.java b/src/com/gitblit/models/IssueModel.java
index 19241c2..c903891 100644
--- a/src/com/gitblit/models/IssueModel.java
+++ b/src/com/gitblit/models/IssueModel.java
@@ -59,7 +59,8 @@
public List<Change> changes;
public IssueModel() {
- created = new Date((System.currentTimeMillis() / 1000) * 1000);
+ // the first applied change set the date appropriately
+ created = new Date(0);
type = Type.Defect;
status = Status.New;
@@ -106,7 +107,21 @@
return attachment;
}
+ public List<Attachment> getAttachments() {
+ List<Attachment> list = new ArrayList<Attachment>();
+ for (Change change : changes) {
+ if (change.hasAttachments()) {
+ list.addAll(change.attachments);
+ }
+ }
+ return list;
+ }
+
public void applyChange(Change change) {
+ if (changes.size() == 0) {
+ // first change created the issue
+ created = change.created;
+ }
changes.add(change);
if (change.hasFieldChanges()) {
@@ -282,8 +297,8 @@
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(TimeUtils.timeAgo(created));
+ StringBuilder sb = new StringBuilder();
+ sb.append(new TimeUtils().timeAgo(created));
switch (code) {
case '+':
sb.append(" created by ");
--
Gitblit v1.9.1