Skip to content
Snippets Groups Projects
Commit 644a5788 authored by juanf's avatar juanf
Browse files

SSDM-2283 : Change way codes are automatically generated when entities are duplicated.

SVN: 34488
parent 63902678
No related branches found
No related tags found
No related merge requests found
......@@ -542,7 +542,8 @@ function SampleFormView(sampleFormController, sampleFormModel) {
var _this = this;
return function() {
Util.blockUINoMessage();
_this._sampleFormController.getNextCopyCode(function(defaultCode) {
var copyFunction = function(defaultCode) {
var component = "<div class='form-horizontal'>"
component += "<legend>Duplicate Entity</legend>";
component += "<div class='form-inline'>";
......@@ -599,7 +600,15 @@ function SampleFormView(sampleFormController, sampleFormModel) {
$("#copyCancel").on("click", function(event) {
Util.unblockUI();
});
});
};
var spaceCode = _this._sampleFormModel.sample.spaceCode;
if(profile.isInventorySpace(spaceCode)) {
var sampleType = profile.getSampleTypeForSampleTypeCode(_this._sampleFormModel.sample.sampleTypeCode);
mainController.serverFacade.generateCode(sampleType, copyFunction);
} else {
_this._sampleFormController.getNextCopyCode(copyFunction);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment