рефакторинг. переносил текущие объекты в другое место
This commit is contained in:
@@ -2,6 +2,7 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current_;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.BugReportInterface;
|
||||
@@ -27,12 +28,12 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
return "";
|
||||
}
|
||||
protected boolean canUpdate() {
|
||||
return Current.getAccount().CheckAccessRights(target.sender_address, Log);
|
||||
return Global.mainModule.getAccount().CheckAccessRights(target.sender_address, Log);
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current_.Check(Log, Current.BugReport)) {
|
||||
target = Current.getBugReport();
|
||||
if (Global.mainModule.Check(Log, Current.BugReport)) {
|
||||
target = Global.mainModule.getBugReport();
|
||||
if (!BugReportInterface.CheckNotDraft(target,Log))
|
||||
return false;
|
||||
fieldName = (String) args[0];
|
||||
@@ -51,7 +52,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
target.SynchronizeFields((BugReport) response.object);
|
||||
oldValue = (String) BugReport.class.getField(fieldName).get(target);
|
||||
newValue = oldValue + "\n" + Utils_.Brackets(Utils_.print_date(
|
||||
new Date())) + " " + Current.getAccount().name
|
||||
new Date())) + " " + Global.mainModule.getAccount().name
|
||||
+ " : " + addition;
|
||||
//2. дописываем нужное поле.
|
||||
BugReport.class.getField(fieldName).set(target, newValue);
|
||||
@@ -85,7 +86,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
}
|
||||
passes.get(PassCode.Email).Do(
|
||||
new EmailMessage(
|
||||
message_header + " " + Utils_.Brackets(Current.getAccount().name),
|
||||
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
|
||||
message_text,
|
||||
BugReportInterface.getRecipients(target)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user