IDEMPIERE-5347 Minor scheduler improvement (#1393)
This commit is contained in:
parent
b2f5a7a0ae
commit
73aecb1145
|
@ -167,6 +167,8 @@ public class ProcessInfo implements Serializable
|
|||
|
||||
private int languageID = 0;
|
||||
|
||||
private int m_AD_Scheduler_ID = 0;
|
||||
|
||||
public int getLanguageID() {
|
||||
return languageID;
|
||||
}
|
||||
|
@ -958,4 +960,20 @@ public class ProcessInfo implements Serializable
|
|||
this.m_IsReplaceTabContent = !(MSysConfig.getBooleanValue(MSysConfig.ZK_REPORT_TABLE_OPEN_IN_NEW_TAB, false, Env.getAD_Client_ID(Env.getCtx())));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return AD_Scheduler_ID or 0 if not running from scheduler
|
||||
*/
|
||||
public int getAD_Scheduler_ID() {
|
||||
return m_AD_Scheduler_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param AD_Scheduler_ID
|
||||
*/
|
||||
public void setAD_Scheduler_ID(int AD_Scheduler_ID) {
|
||||
this.m_AD_Scheduler_ID = AD_Scheduler_ID;
|
||||
}
|
||||
|
||||
} // ProcessInfo
|
||||
|
|
|
@ -205,6 +205,7 @@ public class Scheduler extends AdempiereServer
|
|||
pi.setIsBatch(true);
|
||||
pi.setPrintPreview(true);
|
||||
pi.setReportType(scheduler.getReportOutputType());
|
||||
pi.setAD_Scheduler_ID(scheduler.getAD_Scheduler_ID());
|
||||
int AD_PrintFormat_ID = scheduler.getAD_PrintFormat_ID();
|
||||
if (AD_PrintFormat_ID > 0)
|
||||
{
|
||||
|
@ -333,7 +334,7 @@ public class Scheduler extends AdempiereServer
|
|||
String mailContent = "";
|
||||
|
||||
if (mailTemplate.is_new()){
|
||||
mailContent = scheduler.getDescription();
|
||||
mailContent = scheduler.getDescription() != null ? scheduler.getDescription() : "";
|
||||
}else{
|
||||
mailTemplate.setUser(user);
|
||||
mailTemplate.setLanguage(Env.getContext(getCtx(), Env.LANGUAGE));
|
||||
|
@ -358,7 +359,7 @@ public class Scheduler extends AdempiereServer
|
|||
pLog.saveEx();
|
||||
}
|
||||
} else {
|
||||
if (!client.sendEMail(from, user, schedulerName, mailContent + "\n" + pi.getSummary() + " " + pi.getLogInfo(), null)) {
|
||||
if (!client.sendEMail(from, user, schedulerName, mailContent + "\n" + pi.getSummary() + "\n" + pi.getLogInfo(), null)) {
|
||||
StringBuilder summary = new StringBuilder(Msg.getMsg(Env.getCtx(), "SchedulerSendNotificationFailed"));
|
||||
summary.append(user.getName());
|
||||
String error = (String) Env.getCtx().remove(EMail.EMAIL_SEND_MSG);
|
||||
|
|
Loading…
Reference in New Issue