Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 2b61d3c

Browse files
author
Hai Nguyen
committed
* Tuning email template
* Add copyright message for public release
1 parent e13472b commit 2b61d3c

335 files changed

Lines changed: 5873 additions & 296 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

mycollab-app-community/src/main/java/com/esofthead/mycollab/jetty/CommunityServerRunner.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
*/
1717
package com.esofthead.mycollab.jetty;
1818

19+
import org.eclipse.jetty.servlet.ServletHolder;
1920
import org.eclipse.jetty.webapp.WebAppContext;
2021

22+
import com.esofthead.mycollab.servlet.SetupServlet;
23+
2124
/**
2225
*
2326
* @author MyCollab Ltd.
@@ -33,6 +36,7 @@ public WebAppContext buildContext(String baseDir) {
3336
webAppContext.setClassLoader(Thread.currentThread()
3437
.getContextClassLoader());
3538
webAppContext.setResourceBase(baseDir);
39+
webAppContext.addServlet(new ServletHolder(new SetupServlet()), "/setup");
3640
return webAppContext;
3741
}
3842

mycollab-config/src/main/java/com/esofthead/mycollab/configuration/MyCollabAssets.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* This file is part of mycollab-config.
3+
*
4+
* mycollab-config is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* mycollab-config is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with mycollab-config. If not, see <http://www.gnu.org/licenses/>.
16+
*/
117
package com.esofthead.mycollab.configuration;
218

319
import com.esofthead.mycollab.core.DeploymentMode;

mycollab-core/src/main/java/com/esofthead/mycollab/core/utils/DateTimeUtils.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,20 @@ public static Date trimHMSOfDate(Date value) {
6666
}
6767

6868
public static Date convertDateByString(String strDate, String format) {
69-
if (strDate != null && !strDate.equals("") && format != null
70-
&& !format.equals("")) {
71-
SimpleDateFormat formatter = new SimpleDateFormat(format);
69+
if (strDate != null && !strDate.equals("")) {
70+
try {
71+
SimpleDateFormat formatter = new SimpleDateFormat(format);
72+
return formatter.parse(strDate);
73+
} catch (ParseException e) {
74+
log.error("Error while parse date", e);
75+
}
76+
}
77+
return new Date();
78+
}
79+
80+
public static Date convertDateByString(String strDate,
81+
SimpleDateFormat formatter) {
82+
if (strDate != null && !strDate.equals("")) {
7283
try {
7384
return formatter.parse(strDate);
7485
} catch (ParseException e) {
@@ -78,6 +89,12 @@ public static Date convertDateByString(String strDate, String format) {
7889
return new Date();
7990
}
8091

92+
public static String converToStringWithUserTimeZone(String dateVal,
93+
String userTimeZone) {
94+
Date date = convertDateByFormatW3C(dateVal);
95+
return converToStringWithUserTimeZone(date, userTimeZone);
96+
}
97+
8198
/**
8299
*
83100
* @param strDate

mycollab-mobile/src/main/java/com/esofthead/mycollab/mobile/module/crm/ui/CrmGenericPresenter.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* This file is part of mycollab-mobile.
3+
*
4+
* mycollab-mobile is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* mycollab-mobile is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with mycollab-mobile. If not, see <http://www.gnu.org/licenses/>.
16+
*/
117
package com.esofthead.mycollab.mobile.module.crm.ui;
218

319
import com.esofthead.mycollab.mobile.mvp.AbstractPresenter;

mycollab-mobile/src/main/java/com/esofthead/mycollab/mobile/module/crm/view/account/AccountAddPresenter.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* This file is part of mycollab-mobile.
3+
*
4+
* mycollab-mobile is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* mycollab-mobile is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with mycollab-mobile. If not, see <http://www.gnu.org/licenses/>.
16+
*/
117
package com.esofthead.mycollab.mobile.module.crm.view.account;
218

319
import com.esofthead.mycollab.common.UrlEncodeDecoder;

mycollab-mobile/src/main/java/com/esofthead/mycollab/mobile/module/crm/view/account/AccountAddView.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* This file is part of mycollab-mobile.
3+
*
4+
* mycollab-mobile is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* mycollab-mobile is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with mycollab-mobile. If not, see <http://www.gnu.org/licenses/>.
16+
*/
117
package com.esofthead.mycollab.mobile.module.crm.view.account;
218

319
import com.esofthead.mycollab.module.crm.domain.SimpleAccount;

mycollab-mobile/src/main/java/com/esofthead/mycollab/mobile/module/crm/view/account/AccountAddViewImpl.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* This file is part of mycollab-mobile.
3+
*
4+
* mycollab-mobile is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* mycollab-mobile is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with mycollab-mobile. If not, see <http://www.gnu.org/licenses/>.
16+
*/
117
package com.esofthead.mycollab.mobile.module.crm.view.account;
218

319
import com.esofthead.mycollab.mobile.form.view.DynaFormLayout;
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/**
2+
* This file is part of mycollab-mobile.
3+
*
4+
* mycollab-mobile is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* mycollab-mobile is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with mycollab-mobile. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
package com.esofthead.mycollab.mobile.module.crm.view.account;
18+
19+
import com.esofthead.mycollab.mobile.module.user.ui.components.ActiveUserComboBox;
20+
import com.esofthead.mycollab.module.crm.domain.Account;
21+
import com.esofthead.mycollab.vaadin.ui.AbstractBeanFieldGroupEditFieldFactory;
22+
import com.esofthead.mycollab.vaadin.ui.CountryComboBox;
23+
import com.esofthead.mycollab.vaadin.ui.GenericBeanForm;
24+
import com.esofthead.mycollab.vaadin.ui.IndustryComboBox;
25+
import com.vaadin.ui.Field;
26+
import com.vaadin.ui.TextArea;
27+
import com.vaadin.ui.TextField;
28+
29+
public class AccountEditFormFieldFactory<B extends Account> extends
30+
AbstractBeanFieldGroupEditFieldFactory<B> {
31+
32+
private static final long serialVersionUID = 1L;
33+
34+
public AccountEditFormFieldFactory(GenericBeanForm<B> form) {
35+
super(form);
36+
}
37+
38+
AccountEditFormFieldFactory(GenericBeanForm<B> form, boolean isValidateForm) {
39+
super(form, isValidateForm);
40+
}
41+
42+
@Override
43+
protected Field<?> onCreateField(Object propertyId) {
44+
if ("type".equals(propertyId)) {
45+
AccountTypeComboBox accountTypeBox = new AccountTypeComboBox();
46+
return accountTypeBox;
47+
} else if ("industry".equals(propertyId)) {
48+
IndustryComboBox accountIndustryBox = new IndustryComboBox();
49+
return accountIndustryBox;
50+
} else if ("assignuser".equals(propertyId)) {
51+
ActiveUserComboBox userBox = new ActiveUserComboBox();
52+
userBox.select(attachForm.getBean().getAssignuser());
53+
return userBox;
54+
} else if ("description".equals(propertyId)) {
55+
TextArea textArea = new TextArea("", "");
56+
textArea.setNullRepresentation("");
57+
return textArea;
58+
} else if ("billingcountry".equals(propertyId)
59+
|| "shippingcountry".equals(propertyId)) {
60+
CountryComboBox billingCountryComboBox = new CountryComboBox();
61+
return billingCountryComboBox;
62+
} else if (propertyId.equals("accountname")) {
63+
TextField tf = new TextField();
64+
if (isValidateForm) {
65+
tf.setNullRepresentation("");
66+
tf.setRequired(true);
67+
tf.setRequiredError("Please enter an Account Name");
68+
}
69+
70+
return tf;
71+
}
72+
73+
return null;
74+
}
75+
76+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* This file is part of mycollab-mobile.
3+
*
4+
* mycollab-mobile is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* mycollab-mobile is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with mycollab-mobile. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* This file is part of mycollab-web.
19+
*
20+
* mycollab-web is free software: you can redistribute it and/or modify
21+
* it under the terms of the GNU General Public License as published by
22+
* the Free Software Foundation, either version 3 of the License, or
23+
* (at your option) any later version.
24+
*
25+
* mycollab-web is distributed in the hope that it will be useful,
26+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+
* GNU General Public License for more details.
29+
*
30+
* You should have received a copy of the GNU General Public License
31+
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
32+
*/
33+
package com.esofthead.mycollab.mobile.module.crm.view.account;
34+
35+
import com.esofthead.mycollab.module.crm.CrmDataTypeFactory;
36+
import com.esofthead.mycollab.vaadin.ui.ValueComboBox;
37+
38+
public class AccountTypeComboBox extends ValueComboBox {
39+
private static final long serialVersionUID = 1L;
40+
41+
public AccountTypeComboBox() {
42+
super();
43+
setCaption(null);
44+
this.loadData(CrmDataTypeFactory.getAccountTypeList());
45+
}
46+
47+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/**
2+
* This file is part of mycollab-mobile.
3+
*
4+
* mycollab-mobile is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* mycollab-mobile is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with mycollab-mobile. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* This file is part of mycollab-web.
19+
*
20+
* mycollab-web is free software: you can redistribute it and/or modify
21+
* it under the terms of the GNU General Public License as published by
22+
* the Free Software Foundation, either version 3 of the License, or
23+
* (at your option) any later version.
24+
*
25+
* mycollab-web is distributed in the hope that it will be useful,
26+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+
* GNU General Public License for more details.
29+
*
30+
* You should have received a copy of the GNU General Public License
31+
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
32+
*/
33+
package com.esofthead.mycollab.mobile.module.user.ui.components;
34+
35+
import java.util.List;
36+
37+
import com.esofthead.mycollab.core.arguments.NumberSearchField;
38+
import com.esofthead.mycollab.core.arguments.SearchField;
39+
import com.esofthead.mycollab.core.arguments.SearchRequest;
40+
import com.esofthead.mycollab.core.arguments.SetSearchField;
41+
import com.esofthead.mycollab.module.billing.RegisterStatusConstants;
42+
import com.esofthead.mycollab.module.user.domain.SimpleUser;
43+
import com.esofthead.mycollab.module.user.domain.criteria.UserSearchCriteria;
44+
import com.esofthead.mycollab.module.user.service.UserService;
45+
import com.esofthead.mycollab.spring.ApplicationContextUtil;
46+
import com.esofthead.mycollab.vaadin.AppContext;
47+
import com.esofthead.mycollab.vaadin.ui.UserAvatarControlFactory;
48+
import com.vaadin.ui.ComboBox;
49+
50+
/**
51+
*
52+
* @author MyCollab Ltd.
53+
* @since 2.0
54+
*
55+
*/
56+
public class ActiveUserComboBox extends ComboBox {
57+
58+
private static final long serialVersionUID = 1L;
59+
60+
@SuppressWarnings("unchecked")
61+
public ActiveUserComboBox() {
62+
super();
63+
this.setItemCaptionMode(ItemCaptionMode.EXPLICIT);
64+
65+
UserSearchCriteria criteria = new UserSearchCriteria();
66+
criteria.setSaccountid(new NumberSearchField(SearchField.AND,
67+
AppContext.getAccountId()));
68+
criteria.setRegisterStatuses(new SetSearchField<String>(
69+
SearchField.AND,
70+
new String[] { RegisterStatusConstants.ACTIVE }));
71+
72+
UserService userService = ApplicationContextUtil
73+
.getSpringBean(UserService.class);
74+
List<SimpleUser> userList = userService
75+
.findPagableListByCriteria(new SearchRequest<UserSearchCriteria>(
76+
criteria, 0, Integer.MAX_VALUE));
77+
loadUserList(userList);
78+
79+
}
80+
81+
public ActiveUserComboBox(List<SimpleUser> userList) {
82+
super();
83+
this.setItemCaptionMode(ItemCaptionMode.EXPLICIT);
84+
loadUserList(userList);
85+
}
86+
87+
private void loadUserList(List<SimpleUser> userList) {
88+
89+
for (SimpleUser user : userList) {
90+
this.addItem(user.getUsername());
91+
this.setItemCaption(user.getUsername(), user.getDisplayName());
92+
this.setItemIcon(
93+
user.getUsername(),
94+
UserAvatarControlFactory.createAvatarResource(
95+
user.getAvatarid(), 16));
96+
}
97+
}
98+
}

0 commit comments

Comments
 (0)