Add project url to email template keywords, allow url keyword in timesheet template
This commit is contained in:
parent
02800f97db
commit
1e58368f3e
4 changed files with 255 additions and 166 deletions
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
package org.libreplan.importers.notifications;
|
package org.libreplan.importers.notifications;
|
||||||
|
|
||||||
|
//import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.libreplan.business.common.entities.ConnectorProperty;
|
import org.libreplan.business.common.entities.ConnectorProperty;
|
||||||
|
|
@ -33,9 +35,20 @@ import org.libreplan.web.email.IEmailTemplateModel;
|
||||||
import org.libreplan.web.planner.tabs.MultipleTabsPlannerController;
|
import org.libreplan.web.planner.tabs.MultipleTabsPlannerController;
|
||||||
import org.libreplan.web.resources.worker.IWorkerModel;
|
import org.libreplan.web.resources.worker.IWorkerModel;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
//import org.springframework.beans.factory.annotation;
|
||||||
import org.springframework.beans.factory.config.BeanDefinition;
|
import org.springframework.beans.factory.config.BeanDefinition;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.core.env.AbstractEnvironment;
|
||||||
|
|
||||||
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
|
||||||
import org.zkoss.zul.Messagebox;
|
import org.zkoss.zul.Messagebox;
|
||||||
|
|
||||||
import javax.mail.Message;
|
import javax.mail.Message;
|
||||||
|
|
@ -45,243 +58,304 @@ import javax.mail.Session;
|
||||||
import javax.mail.Transport;
|
import javax.mail.Transport;
|
||||||
import javax.mail.internet.InternetAddress;
|
import javax.mail.internet.InternetAddress;
|
||||||
import javax.mail.internet.MimeMessage;
|
import javax.mail.internet.MimeMessage;
|
||||||
|
import javax.management.AttributeNotFoundException;
|
||||||
|
import javax.management.InstanceNotFoundException;
|
||||||
|
import javax.management.MBeanException;
|
||||||
|
import javax.management.MBeanServer;
|
||||||
|
import javax.management.MalformedObjectNameException;
|
||||||
|
import javax.management.ObjectName;
|
||||||
|
import javax.management.Query;
|
||||||
|
import javax.management.ReflectionException;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
import javax.naming.Context;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.lang.management.ManagementFactory;
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
|
import org.springframework.core.env.MapPropertySource;
|
||||||
|
|
||||||
import static org.libreplan.web.I18nHelper._;
|
import static org.libreplan.web.I18nHelper._;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends E-mail to users with data that storing in notification_queue table
|
* Sends E-mail to users with data that storing in notification_queue table and
|
||||||
* and that are treat to incoming {@link EmailNotification}.
|
* that are treat to incoming {@link EmailNotification}.
|
||||||
*
|
*
|
||||||
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
|
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Configuration
|
||||||
@Component
|
@Component
|
||||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||||
public class ComposeMessage {
|
public class ComposeMessage {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IWorkerModel workerModel;
|
private IWorkerModel workerModel;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IEmailTemplateModel emailTemplateModel;
|
private IEmailTemplateModel emailTemplateModel;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmailConnectionValidator emailConnectionValidator;
|
private EmailConnectionValidator emailConnectionValidator;
|
||||||
|
|
||||||
private String protocol;
|
// @Autowired
|
||||||
|
// private Environment environment;
|
||||||
|
|
||||||
private String host;
|
@Autowired
|
||||||
|
private WebApplicationContext webApplicationContext;
|
||||||
|
|
||||||
private String port;
|
// @Autowired
|
||||||
|
// private ServletContext servletContext;
|
||||||
|
|
||||||
private String sender;
|
private String protocol;
|
||||||
|
|
||||||
private String usrnme;
|
private String host;
|
||||||
|
|
||||||
private String psswrd;
|
private String port;
|
||||||
|
|
||||||
private Properties properties;
|
private String sender;
|
||||||
|
|
||||||
private static final Log LOG = LogFactory.getLog(ComposeMessage.class);
|
private String usrnme;
|
||||||
|
|
||||||
|
private String psswrd;
|
||||||
|
|
||||||
public boolean composeMessageForUser(EmailNotification notification) {
|
private Properties properties;
|
||||||
// Gather data about EmailTemplate needs to be used
|
|
||||||
Resource resource = notification.getResource();
|
|
||||||
EmailTemplateEnum type = notification.getType();
|
|
||||||
Locale locale;
|
|
||||||
Worker currentWorker = getCurrentWorker(resource.getId());
|
|
||||||
|
|
||||||
UserRole currentUserRole = getCurrentUserRole(notification.getType());
|
private static final Log LOG = LogFactory.getLog(ComposeMessage.class);
|
||||||
|
|
||||||
if (currentWorker != null && currentWorker.getUser().isInRole(currentUserRole)) {
|
public boolean composeMessageForUser(EmailNotification notification) {
|
||||||
if (currentWorker.getUser().getApplicationLanguage().equals(Language.BROWSER_LANGUAGE)) {
|
// Gather data about EmailTemplate needs to be used
|
||||||
locale = new Locale(System.getProperty("user.language"));
|
Resource resource = notification.getResource();
|
||||||
} else {
|
EmailTemplateEnum type = notification.getType();
|
||||||
locale = new Locale(currentWorker.getUser().getApplicationLanguage().getLocale().getLanguage());
|
Locale locale;
|
||||||
}
|
Worker currentWorker = getCurrentWorker(resource.getId());
|
||||||
|
|
||||||
EmailTemplate currentEmailTemplate = findCurrentEmailTemplate(type, locale);
|
UserRole currentUserRole = getCurrentUserRole(notification.getType());
|
||||||
|
|
||||||
if (currentEmailTemplate == null) {
|
if (currentWorker != null && currentWorker.getUser().isInRole(currentUserRole)) {
|
||||||
LOG.error("Email template is null");
|
if (currentWorker.getUser().getApplicationLanguage().equals(Language.BROWSER_LANGUAGE)) {
|
||||||
return false;
|
locale = new Locale(System.getProperty("user.language"));
|
||||||
}
|
} else {
|
||||||
|
locale = new Locale(currentWorker.getUser().getApplicationLanguage().getLocale().getLanguage());
|
||||||
|
}
|
||||||
|
|
||||||
// Modify text that will be composed
|
EmailTemplate currentEmailTemplate = findCurrentEmailTemplate(type, locale);
|
||||||
String text = currentEmailTemplate.getContent();
|
|
||||||
text = replaceKeywords(text, currentWorker, notification);
|
|
||||||
|
|
||||||
String receiver = currentWorker.getUser().getEmail();
|
if (currentEmailTemplate == null) {
|
||||||
|
LOG.error("Email template is null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
setupConnectionProperties();
|
// Modify text that will be composed
|
||||||
|
String text = currentEmailTemplate.getContent();
|
||||||
|
text = replaceKeywords(text, currentWorker, notification);
|
||||||
|
|
||||||
final String username = usrnme;
|
String receiver = currentWorker.getUser().getEmail();
|
||||||
final String password = psswrd;
|
|
||||||
|
|
||||||
// It is very important to use Session.getInstance() instead of Session.getDefaultInstance()
|
setupConnectionProperties();
|
||||||
Session mailSession = Session.getInstance(properties, new javax.mail.Authenticator() {
|
|
||||||
@Override
|
|
||||||
protected PasswordAuthentication getPasswordAuthentication() {
|
|
||||||
return new PasswordAuthentication(username, password);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send message
|
final String username = usrnme;
|
||||||
try {
|
final String password = psswrd;
|
||||||
MimeMessage message = new MimeMessage(mailSession);
|
|
||||||
|
|
||||||
message.setFrom(new InternetAddress(sender));
|
// It is very important to use Session.getInstance() instead of
|
||||||
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(receiver));
|
// Session.getDefaultInstance()
|
||||||
|
Session mailSession = Session.getInstance(properties, new javax.mail.Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(username, password);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
String subject = currentEmailTemplate.getSubject();
|
// Send message
|
||||||
message.setSubject(subject);
|
try {
|
||||||
|
MimeMessage message = new MimeMessage(mailSession);
|
||||||
|
|
||||||
message.setText(text);
|
message.setFrom(new InternetAddress(sender));
|
||||||
|
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(receiver));
|
||||||
|
|
||||||
Transport.send(message);
|
String subject = currentEmailTemplate.getSubject();
|
||||||
|
message.setSubject(subject);
|
||||||
|
|
||||||
return true;
|
message.setText(text);
|
||||||
|
|
||||||
} catch (MessagingException e) {
|
Transport.send(message);
|
||||||
throw new RuntimeException(e);
|
|
||||||
} catch (NullPointerException e) {
|
|
||||||
if (receiver == null) {
|
|
||||||
Messagebox.show(
|
|
||||||
_(currentWorker.getUser().getLoginName() + " - this user have not filled E-mail"),
|
|
||||||
_("Error"), Messagebox.OK, Messagebox.ERROR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Worker getCurrentWorker(Long resourceID){
|
return true;
|
||||||
List<Worker> workerList = workerModel.getWorkers();
|
|
||||||
|
|
||||||
for (Worker aWorkerList : workerList) {
|
} catch (MessagingException e) {
|
||||||
if (aWorkerList.getId().equals(resourceID)) {
|
throw new RuntimeException(e);
|
||||||
return aWorkerList;
|
} catch (NullPointerException e) {
|
||||||
}
|
if (receiver == null) {
|
||||||
}
|
Messagebox.show(_(currentWorker.getUser().getLoginName() + " - this user have not filled E-mail"),
|
||||||
|
_("Error"), Messagebox.OK, Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
private Worker getCurrentWorker(Long resourceID) {
|
||||||
}
|
List<Worker> workerList = workerModel.getWorkers();
|
||||||
|
|
||||||
private EmailTemplate findCurrentEmailTemplate(EmailTemplateEnum templateEnum, Locale locale) {
|
for (Worker aWorkerList : workerList) {
|
||||||
List<EmailTemplate> emailTemplates;
|
if (aWorkerList.getId().equals(resourceID)) {
|
||||||
emailTemplates = emailTemplateModel.getAll();
|
return aWorkerList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (EmailTemplate item : emailTemplates) {
|
return null;
|
||||||
if ( item.getType().equals(templateEnum) && item.getLanguage().getLocale().equals(locale) ) {
|
}
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
private EmailTemplate findCurrentEmailTemplate(EmailTemplateEnum templateEnum, Locale locale) {
|
||||||
|
List<EmailTemplate> emailTemplates;
|
||||||
|
emailTemplates = emailTemplateModel.getAll();
|
||||||
|
|
||||||
return null;
|
for (EmailTemplate item : emailTemplates) {
|
||||||
}
|
if (item.getType().equals(templateEnum) && item.getLanguage().getLocale().equals(locale)) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
private String replaceKeywords(String text, Worker currentWorker, EmailNotification notification) {
|
}
|
||||||
String newText = text;
|
|
||||||
|
|
||||||
if ( notification.getType().equals(EmailTemplateEnum.TEMPLATE_ENTER_DATA_IN_TIMESHEET) ) {
|
return null;
|
||||||
// It is because there is no other data for
|
}
|
||||||
// EmailNotification of TEMPLATE_ENTER_DATA_IN_TIMESHEET notification type
|
|
||||||
newText = newText.replaceAll("\\{resource\\}", notification.getResource().getName());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
newText = newText.replaceAll("\\{username\\}", currentWorker.getUser().getLoginName());
|
|
||||||
newText = newText.replaceAll("\\{firstname\\}", currentWorker.getUser().getFirstName());
|
|
||||||
newText = newText.replaceAll("\\{lastname\\}", currentWorker.getUser().getLastName());
|
|
||||||
newText = newText.replaceAll("\\{project\\}", notification.getProject().getName());
|
|
||||||
newText = newText.replaceAll("\\{resource\\}", notification.getResource().getName());
|
|
||||||
newText = newText.replaceAll("\\{task\\}", notification.getTask().getName());
|
|
||||||
newText = newText.replaceAll("\\{url\\}", MultipleTabsPlannerController.WELCOME_URL);
|
|
||||||
}
|
|
||||||
return newText;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupConnectionProperties() {
|
private String replaceKeywords(String text, Worker currentWorker, EmailNotification notification) {
|
||||||
List<ConnectorProperty> emailConnectorProperties = emailConnectionValidator.getEmailConnectorProperties();
|
String newText = text;
|
||||||
|
|
||||||
for (int i = 0; i < emailConnectorProperties.size(); i++) {
|
// replace {url} in all messages even timesheet reminder emails
|
||||||
switch (i) {
|
// as a link may be helpful
|
||||||
|
newText = newText.replaceAll("\\{url\\}", MultipleTabsPlannerController.WELCOME_URL);
|
||||||
|
if (notification.getType().equals(EmailTemplateEnum.TEMPLATE_ENTER_DATA_IN_TIMESHEET)) {
|
||||||
|
// It is because there is no other data for
|
||||||
|
// EmailNotification of TEMPLATE_ENTER_DATA_IN_TIMESHEET
|
||||||
|
// notification type
|
||||||
|
newText = newText.replaceAll("\\{resource\\}", notification.getResource().getName());
|
||||||
|
} else {
|
||||||
|
newText = newText.replaceAll("\\{username\\}", currentWorker.getUser().getLoginName());
|
||||||
|
newText = newText.replaceAll("\\{firstname\\}", currentWorker.getUser().getFirstName());
|
||||||
|
newText = newText.replaceAll("\\{lastname\\}", currentWorker.getUser().getLastName());
|
||||||
|
newText = newText.replaceAll("\\{project\\}", notification.getProject().getName());
|
||||||
|
newText = newText.replaceAll("\\{resource\\}", notification.getResource().getName());
|
||||||
|
newText = newText.replaceAll("\\{task\\}", notification.getTask().getName());
|
||||||
|
newText = newText.replaceAll("\\{projecturl\\}", MultipleTabsPlannerController.WELCOME_URL+ ";order=" + notification.getProject().getProjectCode());
|
||||||
|
}
|
||||||
|
return newText;
|
||||||
|
}
|
||||||
|
|
||||||
case 1:
|
List<String> getEndPoints() throws MalformedObjectNameException, NullPointerException, UnknownHostException,
|
||||||
protocol = emailConnectorProperties.get(1).getValue();
|
AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException {
|
||||||
break;
|
|
||||||
|
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
|
||||||
|
|
||||||
|
Set<ObjectName> objs = mbs.queryNames(new ObjectName("*:type=Connector,*"),
|
||||||
|
Query.match(Query.attr("protocol"), Query.value("HTTP/1.1")));
|
||||||
|
|
||||||
|
String hostname = InetAddress.getLocalHost().getHostName();
|
||||||
|
|
||||||
|
InetAddress[] addresses = InetAddress.getAllByName(hostname);
|
||||||
|
|
||||||
|
ArrayList<String> endPoints = new ArrayList<String>();
|
||||||
|
for (Iterator<ObjectName> i = objs.iterator(); i.hasNext();) {
|
||||||
|
ObjectName obj = i.next();
|
||||||
|
String scheme = mbs.getAttribute(obj, "scheme").toString();
|
||||||
|
String port = obj.getKeyProperty("port");
|
||||||
|
for (InetAddress addr : addresses) {
|
||||||
|
String host = addr.getHostAddress();
|
||||||
|
String ep = scheme + "://" + host + ":" + port;
|
||||||
|
endPoints.add(ep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return endPoints;
|
||||||
|
}
|
||||||
|
|
||||||
case 2:
|
private void setupConnectionProperties() {
|
||||||
host = emailConnectorProperties.get(2).getValue();
|
List<ConnectorProperty> emailConnectorProperties = emailConnectionValidator.getEmailConnectorProperties();
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
for (int i = 0; i < emailConnectorProperties.size(); i++) {
|
||||||
port = emailConnectorProperties.get(3).getValue();
|
switch (i) {
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
case 1:
|
||||||
sender = emailConnectorProperties.get(4).getValue();
|
protocol = emailConnectorProperties.get(1).getValue();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 2:
|
||||||
usrnme = emailConnectorProperties.get(5).getValue();
|
host = emailConnectorProperties.get(2).getValue();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 3:
|
||||||
psswrd = emailConnectorProperties.get(6).getValue();
|
port = emailConnectorProperties.get(3).getValue();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
case 4:
|
||||||
break;
|
sender = emailConnectorProperties.get(4).getValue();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 5:
|
||||||
}
|
usrnme = emailConnectorProperties.get(5).getValue();
|
||||||
|
break;
|
||||||
|
|
||||||
properties = new Properties();
|
case 6:
|
||||||
|
psswrd = emailConnectorProperties.get(6).getValue();
|
||||||
|
break;
|
||||||
|
|
||||||
if ( "STARTTLS".equals(protocol) ) {
|
default:
|
||||||
properties.put("mail.smtp.starttls.enable", "true");
|
break;
|
||||||
properties.put("mail.smtp.host", host);
|
|
||||||
properties.put("mail.smtp.socketFactory.port", port);
|
|
||||||
properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
|
||||||
properties.put("mail.smtp.auth", "true");
|
|
||||||
properties.put("mail.smtp.port", port);
|
|
||||||
}
|
|
||||||
else if ( "SMTP".equals(protocol) ) {
|
|
||||||
properties.put("mail.smtp.host", host);
|
|
||||||
properties.put("mail.smtp.port", port);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private UserRole getCurrentUserRole(EmailTemplateEnum type) {
|
}
|
||||||
switch (type) {
|
}
|
||||||
|
|
||||||
case TEMPLATE_TASK_ASSIGNED_TO_RESOURCE:
|
properties = new Properties();
|
||||||
return UserRole.ROLE_EMAIL_TASK_ASSIGNED_TO_RESOURCE;
|
|
||||||
|
|
||||||
case TEMPLATE_RESOURCE_REMOVED_FROM_TASK:
|
if ("STARTTLS".equals(protocol)) {
|
||||||
return UserRole.ROLE_EMAIL_RESOURCE_REMOVED_FROM_TASK;
|
properties.put("mail.smtp.starttls.enable", "true");
|
||||||
|
properties.put("mail.smtp.host", host);
|
||||||
|
properties.put("mail.smtp.socketFactory.port", port);
|
||||||
|
properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
||||||
|
properties.put("mail.smtp.auth", "true");
|
||||||
|
properties.put("mail.smtp.port", port);
|
||||||
|
} else if ("SMTP".equals(protocol)) {
|
||||||
|
properties.put("mail.smtp.host", host);
|
||||||
|
properties.put("mail.smtp.port", port);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case TEMPLATE_MILESTONE_REACHED:
|
private UserRole getCurrentUserRole(EmailTemplateEnum type) {
|
||||||
return UserRole.ROLE_EMAIL_MILESTONE_REACHED;
|
switch (type) {
|
||||||
|
|
||||||
case TEMPLATE_TODAY_TASK_SHOULD_START:
|
case TEMPLATE_TASK_ASSIGNED_TO_RESOURCE:
|
||||||
return UserRole.ROLE_EMAIL_TASK_SHOULD_START;
|
return UserRole.ROLE_EMAIL_TASK_ASSIGNED_TO_RESOURCE;
|
||||||
|
|
||||||
case TEMPLATE_TODAY_TASK_SHOULD_FINISH:
|
case TEMPLATE_RESOURCE_REMOVED_FROM_TASK:
|
||||||
return UserRole.ROLE_EMAIL_TASK_SHOULD_FINISH;
|
return UserRole.ROLE_EMAIL_RESOURCE_REMOVED_FROM_TASK;
|
||||||
|
|
||||||
case TEMPLATE_ENTER_DATA_IN_TIMESHEET:
|
case TEMPLATE_MILESTONE_REACHED:
|
||||||
return UserRole.ROLE_EMAIL_TIMESHEET_DATA_MISSING;
|
return UserRole.ROLE_EMAIL_MILESTONE_REACHED;
|
||||||
|
|
||||||
default:
|
case TEMPLATE_TODAY_TASK_SHOULD_START:
|
||||||
/* There is no other template */
|
return UserRole.ROLE_EMAIL_TASK_SHOULD_START;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
case TEMPLATE_TODAY_TASK_SHOULD_FINISH:
|
||||||
|
return UserRole.ROLE_EMAIL_TASK_SHOULD_FINISH;
|
||||||
|
|
||||||
|
case TEMPLATE_ENTER_DATA_IN_TIMESHEET:
|
||||||
|
return UserRole.ROLE_EMAIL_TIMESHEET_DATA_MISSING;
|
||||||
|
|
||||||
|
default:
|
||||||
|
/* There is no other template */
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9291,6 +9291,10 @@ msgstr ""
|
||||||
msgid "Welcome page"
|
msgid "Welcome page"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: libreplan-webapp/src/main/webapp/email/email_templates.zul:124
|
||||||
|
msgid "Project details page"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: libreplan-business/src/main/java/org/libreplan/business/orders/entities/OrderStatusEnum.java:43
|
#: libreplan-business/src/main/java/org/libreplan/business/orders/entities/OrderStatusEnum.java:43
|
||||||
msgid "ARCHIVED"
|
msgid "ARCHIVED"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,11 @@
|
||||||
<label value="{url}"/>
|
<label value="{url}"/>
|
||||||
<label value="${i18n:_('Welcome page')}"/>
|
<label value="${i18n:_('Welcome page')}"/>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
<row>
|
||||||
|
<label value="{projecturl}"/>
|
||||||
|
<label value="${i18n:_('Project details page')}"/>
|
||||||
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
|
|
||||||
</grid>
|
</grid>
|
||||||
|
|
|
||||||
6
pom.xml
6
pom.xml
|
|
@ -866,6 +866,12 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
<version>1.7.21</version>
|
<version>1.7.21</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue