diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index dc741d9fa6d5ce4bbeca1e0a1ae26be985386fbf..fde937da3dd5a0e0078b9366521100e35b4f488b 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -496,13 +496,22 @@ function MainController(profile) { break; case "showEditSamplePageFromPermId": var _this = this; - this.serverFacade.searchWithUniqueId(arg, function(data) { + var permId = null; + var paginationInfo = null; + if((typeof arg) !== "string") { + permId = arg.permIdOrIdentifier; + paginationInfo = arg.paginationInfo; + arg = permId; + } else { + permId = arg; + } + this.serverFacade.searchWithUniqueId(permId, function(data) { if(!data[0]) { window.alert("The item is no longer available, refresh the page, if the problem persists tell your admin that the Lucene index is probably corrupted."); } else { document.title = "" + ELNDictionary.Sample + " " + data[0].code; var isELNSubExperiment = $.inArray(data[0].spaceCode, _this.profile.inventorySpaces) === -1 && _this.profile.inventorySpaces.length > 0; - _this._showEditSamplePage(data[0], isELNSubExperiment); + _this._showEditSamplePage(data[0], isELNSubExperiment, paginationInfo); //window.scrollTo(0,0); } }); @@ -510,8 +519,13 @@ function MainController(profile) { case "showViewSamplePageFromPermId": var _this = this; var permId = null; + var paginationInfo = null; if((typeof arg) !== "string") { permId = arg.permIdOrIdentifier; + paginationInfo = arg.paginationInfo; + arg = permId; + } else { + permId = arg; } this.serverFacade.searchWithUniqueId(permId, function(data) { if(!data[0]) { @@ -519,7 +533,7 @@ function MainController(profile) { } else { document.title = "" + ELNDictionary.Sample + " " + data[0].code; var isELNSubExperiment = $.inArray(data[0].spaceCode, _this.profile.inventorySpaces) === -1&& _this.profile.inventorySpaces.length > 0; - _this._showViewSamplePage(data[0], isELNSubExperiment, arg.paginationInfo); + _this._showViewSamplePage(data[0], isELNSubExperiment, paginationInfo); //window.scrollTo(0,0); } }); @@ -527,8 +541,13 @@ function MainController(profile) { case "showViewSamplePageFromIdentifier": var _this = this; var identifier = null; + var paginationInfo = null; if((typeof arg) !== "string") { identifier = arg.permIdOrIdentifier; + paginationInfo = arg.paginationInfo; + arg = permId; + } else { + identifier = arg; } this.serverFacade.searchWithIdentifiers([identifier], function(data) { if(!data[0]) { @@ -536,7 +555,7 @@ function MainController(profile) { } else { document.title = "" + ELNDictionary.Sample + " " + data[0].code; var isELNSubExperiment = $.inArray(data[0].spaceCode, _this.profile.inventorySpaces) === -1&& _this.profile.inventorySpaces.length > 0; - _this._showViewSamplePage(data[0], isELNSubExperiment, arg.paginationInfo); + _this._showViewSamplePage(data[0], isELNSubExperiment, paginationInfo); //window.scrollTo(0,0); } }); @@ -908,17 +927,17 @@ function MainController(profile) { this._showViewSamplePage = function(sample, isELNSubExperiment, paginationInfo) { //Show Form - var sampleFormController = new SampleFormController(this, FormMode.VIEW, sample); + var sampleFormController = new SampleFormController(this, FormMode.VIEW, sample, paginationInfo); this.currentView = sampleFormController; var views = this._getNewViewModel(true, true, true); sampleFormController.init(views); } - this._showEditSamplePage = function(sample, isELNSubExperiment) { + this._showEditSamplePage = function(sample, isELNSubExperiment, paginationInfo) { //Show Form var localInstance = this; this.serverFacade.searchWithUniqueId(sample.permId, function(data) { - var sampleFormController = new SampleFormController(localInstance, FormMode.EDIT, data[0]); + var sampleFormController = new SampleFormController(localInstance, FormMode.EDIT, data[0], paginationInfo); localInstance.currentView = sampleFormController; var views = localInstance._getNewViewModel(true, true, false); sampleFormController.init(views); diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js index 68db0c55deb1571a4b5ad156419be47380acce81..45a216cbfcb3bba0226650a8e1c29b40fb5b0b2d 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js @@ -14,9 +14,9 @@ * limitations under the License. */ -function SampleFormController(mainController, mode, sample) { +function SampleFormController(mainController, mode, sample, paginationInfo) { this._mainController = mainController; - this._sampleFormModel = new SampleFormModel(mode, sample); + this._sampleFormModel = new SampleFormModel(mode, sample, paginationInfo); this._sampleFormView = new SampleFormView(this, this._sampleFormModel); // this._storageControllers = []; this._plateController = null; diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormModel.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormModel.js index b475d1fac0cd2bfbebcff4b214ec7d9d49746aa1..e749c4a2972a57df7e24cf4766bc77b8246fdbc5 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormModel.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormModel.js @@ -14,7 +14,7 @@ * limitations under the License. */ -function SampleFormModel(mode, sample) { +function SampleFormModel(mode, sample, paginationInfo) { this.mode = mode; this.sample = sample; this.datasets = []; @@ -31,4 +31,5 @@ function SampleFormModel(mode, sample) { this.sampleLinksParents = null; this.sampleLinksChildren = null; this.sampleLinksNone = null; + this.paginationInfo = paginationInfo; } \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js index 71debc3c1c819d239fd497cc7f5c05e1d8169a80..e7c071f21807ccf83d03be85161b627fcf0baaf1 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js @@ -133,7 +133,12 @@ function SampleFormView(sampleFormController, sampleFormModel) { //Edit if(this._sampleFormModel.mode === FormMode.VIEW) { var $editButton = FormUtil.getButtonWithIcon("glyphicon-edit", function () { - mainController.changeView('showEditSamplePageFromPermId', _this._sampleFormModel.sample.permId); + var args = { + permIdOrIdentifier : _this._sampleFormModel.sample.permId, + paginationInfo : _this._sampleFormModel.paginationInfo + } + + mainController.changeView('showEditSamplePageFromPermId', args); }); toolbarModel.push({ component : $editButton, tooltip: "Edit" }); } @@ -259,6 +264,19 @@ function SampleFormView(sampleFormController, sampleFormModel) { toolbarModel.push({ component : $saveBtn, tooltip: "Save" }); } + if(this._sampleFormModel.mode !== FormMode.CREATE && this._sampleFormModel.paginationInfo) { + var $backBtn = FormUtil.getButtonWithIcon("glyphicon-arrow-left", function () { + + }); + toolbarModel.push({ component : $backBtn, tooltip: "Go to previous Object from list" }); + + var $nextBtn = FormUtil.getButtonWithIcon("glyphicon-arrow-right", function () { + + }); + toolbarModel.push({ component : $nextBtn, tooltip: "Go to next Object from list" }); + + } + var $header = views.header; $header.append($formTitle);