рефакторинг публикации компонентов
This commit is contained in:
@@ -15,6 +15,7 @@ public class AppendBugReportField extends ClientPass<ComponentsServer, BugReport
|
||||
String oldValue;
|
||||
String addition;
|
||||
String newValue;
|
||||
BugReport actual;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Append.png";
|
||||
@@ -23,15 +24,13 @@ public class AppendBugReportField extends ClientPass<ComponentsServer, BugReport
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
protected boolean canUpdate() {
|
||||
return target.canModify(Global.mainModule.getAccount(), Log);
|
||||
}
|
||||
@Override
|
||||
protected ComponentsServer getServer() {
|
||||
return Global.componentsServer;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
actual = null;
|
||||
if (getServer().db.getTable(BugReport.class).getUI().CheckCurrent(Log)) {
|
||||
target = getServer().db.getTable(BugReport.class).getUI().getCurrent();
|
||||
if (!target.CheckNotDraft(Log))
|
||||
@@ -45,13 +44,18 @@ public class AppendBugReportField extends ClientPass<ComponentsServer, BugReport
|
||||
addition = Utils_.Brackets(Utils_.print_date(
|
||||
new Date())) + " " + Global.mainModule.getAccount().name
|
||||
+ " : " + addition;
|
||||
return canUpdate();
|
||||
if (canUpdate() && (SendRequest(ServerCode.AppendBugReportTextField, "", new BugReportAdditionJson(target, fieldName, addition)))) {
|
||||
actual = (BugReport) request.target;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
protected boolean canUpdate() {
|
||||
return target.canModify(Global.mainModule.getAccount(), Log);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
BugReport actual = (BugReport) getServer().ClientRequest(ServerCode.AppendBugReportTextField, "", new BugReportAdditionJson(target, fieldName, addition));
|
||||
target.SynchronizeFields(actual);
|
||||
Global.componentsServer.db.Update(target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user