diff --git a/js/core/view/shipping/caseform.js b/js/core/view/shipping/caseform.js index b992bf810..a9077f9d7 100644 --- a/js/core/view/shipping/caseform.js +++ b/js/core/view/shipping/caseform.js @@ -14,7 +14,6 @@ function CaseForm(args) { this.showTitle = args.showTitle; } } - this.onSaved = new Event(this); } @@ -40,9 +39,9 @@ CaseForm.prototype.getDewar = function() { this.dewar.code = Ext.getCmp(this.id + "dewar_code").getValue(); this.dewar.comments = Ext.getCmp(this.id + "dewar_comments").getValue(); this.dewar.transportValue = Ext.getCmp(this.id + "dewar_transportValue").getValue(); -// this.dewar.storageLocation = Ext.getCmp("dewar_storageLocation").getValue(); this.dewar.storageLocation = this.storageLocationComboBox.getValue(); //this.dewar.firstExperimentId = this.sessionsCombo.getValue(); + return this.dewar; }; @@ -60,29 +59,17 @@ CaseForm.prototype.setDewar = function(dewar) { Ext.getCmp(this.id + "dewar_code").setValue(this.dewar.code); Ext.getCmp(this.id + "dewar_comments").setValue(this.dewar.comments); Ext.getCmp(this.id + "dewar_transportValue").setValue(this.dewar.transportValue); -// Ext.getCmp("dewar_storageLocation").setValue(this.dewar.storageLocation); this.storageLocationComboBox.setValue(this.dewar.storageLocation); - /*if (this.dewar.sessionVO != null) { - this.sessionsCombo.setValue(this.dewar.sessionVO.sessionId); - }*/ + }; -/* -CaseForm.prototype.getSessionCombo = function() { - this.sessionsCombo = BIOSAXS_COMBOMANAGER.getComboSessions(EXI.proposalManager.getFutureSessions(), { - labelWidth : 200, - margin : '5 0 00 0', - width : 500 - }); - return this.sessionsCombo; -};*/ - CaseForm.prototype.getStorageLocationCombo = function() { this.storageLocationComboBox = BIOSAXS_COMBOMANAGER.getComboStorageTemperature(); return this.storageLocationComboBox; }; -CaseForm.prototype.getPanel = function(dewar) { +CaseForm.prototype.getPanel = function(dewar, hideReimb) { + this.panel = Ext.create('Ext.form.Panel', { width : this.width - 10, // cls : 'border-grid', @@ -106,30 +93,31 @@ CaseForm.prototype.getPanel = function(dewar) { id : this.id + 'dewar_code', labelWidth : 200, width : 500 - } + }, ] - }, - this.getStorageLocationCombo(), - { - xtype : 'numberfield', - width : 500, - labelWidth : 200, - margin : '10 0 0 0', - fieldLabel : 'Transport Value', - id : this.id + 'dewar_transportValue' - }, - { - xtype : 'textareafield', - name : 'comments', - fieldLabel : 'Comments', - labelWidth : 200, - width : 500, - margin : '10 0 0 0', - height : 100, - id : this.id + 'dewar_comments' - } ] - } ] - }); + }, + this.getStorageLocationCombo(), + { + xtype : 'numberfield', + width : 500, + labelWidth : 200, + margin : '10 0 0 0', + fieldLabel : 'Transport Value', + id : this.id + 'dewar_transportValue' + }, + { + xtype : 'textareafield', + name : 'comments', + fieldLabel : 'Comments', + labelWidth : 200, + width : 500, + margin : '10 0 0 0', + height : 100, + id : this.id + 'dewar_comments' + }, + ]}] + }); + this.refresh(dewar); return this.panel; -}; +}; \ No newline at end of file diff --git a/js/core/view/shipping/containerspreadsheet.js b/js/core/view/shipping/containerspreadsheet.js index 25abf790d..99deaab65 100644 --- a/js/core/view/shipping/containerspreadsheet.js +++ b/js/core/view/shipping/containerspreadsheet.js @@ -221,14 +221,16 @@ ContainerSpreadSheet.prototype.getHeader = function() { { text : '#', id: 'position', column : {width : 20}}, { text :'Protein
Acronym', id :'Protein Acronym', column : { width : 80, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', source: this.getAcronyms() } }, { text :'Sample
Name', id :'Sample Name', column : {width : 120}}, { text :'Crystal Form', id : 'Crystal Form',column : { width : 230, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', source: function(query, process) { var colIndex = _this.getColumnIndex("Protein Acronym"); var protein = EXI.proposalManager.getProteinByAcronym(this.instance.getDataAtCell(this.row,colIndex)); @@ -243,7 +245,8 @@ ContainerSpreadSheet.prototype.getHeader = function() { }, { text :'Exp.
Type', id : 'Experiment Type', column : { width : 100, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', source: [ "Default", "MXPressE", "MXPressO", "MXPressI", "MXPressE_SAD", "MXScore", "MXPressM", "MXPressP", "MXPressP_SAD" ] } }, @@ -257,9 +260,10 @@ ContainerSpreadSheet.prototype.getHeader = function() { { text :'Required
multiplicity', id :'Required multiplicity', column : {width : 60}}, { text :'Required
Completeness', id :'Required Completeness', column : {width : 80}}, - { text :'Forced
Space G.', id : 'Space Group', column : { + { text :'Forced
Space G.', id : 'Space Group', column : { width : 55, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', source: _.concat([""], ExtISPyB.spaceGroups) } }, diff --git a/js/core/view/shipping/csvcontainerspreadsheet.js b/js/core/view/shipping/csvcontainerspreadsheet.js index 02bf60232..e2c61a952 100644 --- a/js/core/view/shipping/csvcontainerspreadsheet.js +++ b/js/core/view/shipping/csvcontainerspreadsheet.js @@ -585,7 +585,8 @@ CSVContainerSpreadSheet.prototype.getHeader = function() { { text : '#', id: 'position', column : {width : 20, renderer: samplePositionParameterRenderer}}, { text :'Protein
Acronym', id :'Protein Acronym', column : { width : 80, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', renderer: proteinParameterRenderer, source: this.getAcronyms() } @@ -599,7 +600,8 @@ CSVContainerSpreadSheet.prototype.getHeader = function() { { text :'Exp.
Type', id : 'experimentKind', column : { width : 100, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', renderer: mandatoryParameterRenderer, source: [ "Default", "MXPressE", "MXPressO", "MXPressI", "MXPressE_SAD", "MXScore", "MXPressM", "MXPressP", "MXPressP_SAD" ] } @@ -607,7 +609,8 @@ CSVContainerSpreadSheet.prototype.getHeader = function() { { text :'Space
group', id : 'Space Group', column : { width : 70, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', renderer: mandatoryParameterRenderer, source: _.concat([""], ExtISPyB.spaceGroups) }}, @@ -625,7 +628,8 @@ CSVContainerSpreadSheet.prototype.getHeader = function() { { text :'Required
Completeness', id :'Required Completeness', column : {width : 80}}, { text :'Forced
SPG', id :'forced', column : { width : 70, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', source: _.concat([""], ExtISPyB.spaceGroups) }}, diff --git a/js/core/view/shipping/genericcontainerspreadsheet.js b/js/core/view/shipping/genericcontainerspreadsheet.js index 96534c271..5c55478ed 100644 --- a/js/core/view/shipping/genericcontainerspreadsheet.js +++ b/js/core/view/shipping/genericcontainerspreadsheet.js @@ -105,7 +105,8 @@ GenericContainerSpreadSheet.prototype.getHeader = function() { header = [{ text : '#', id: 'position', column : {width : 20}}, { text :'Samplesheet
Acronym', id :'Protein Acronym', column : { width : 100, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', source: this.getAcronyms() } }, diff --git a/js/core/view/shipping/parcelgrid.js b/js/core/view/shipping/parcelgrid.js index a677994bf..c29c01eaf 100644 --- a/js/core/view/shipping/parcelgrid.js +++ b/js/core/view/shipping/parcelgrid.js @@ -13,6 +13,8 @@ function ParcelGrid(args) { this.btnEditVisible = true; this.btnRemoveVisible = true; + this.reimbursementId = this.id + "_reimbursement_panel"; + if (args != null) { if (args.height != null) { this.height = args.height; @@ -43,6 +45,40 @@ function ParcelGrid(args) { this.onRemove = new Event(this); } +ParcelGrid.prototype.getReimbursementContentHTML = function(currentReimbursedDewars, maxReimbursedDewars ) { + return "("+ currentReimbursedDewars +" reimbursed out of " + maxReimbursedDewars +" allowed)"; +}; +ParcelGrid.prototype.getReimbursementHTML = function(currentReimbursedDewars, maxReimbursedDewars ) { + if (maxReimbursedDewars){ + if (maxReimbursedDewars > 0){ + return "" + this.getReimbursementContentHTML(currentReimbursedDewars, maxReimbursedDewars)+ "" + } + } + return ""; +}; + +ParcelGrid.prototype.refreshReimbursementContentHTML = function(currentReimbursedDewars, maxReimbursedDewars ) { + $("#" + this.reimbursementId).html(this.getReimbursementContentHTML(currentReimbursedDewars, maxReimbursedDewars)); +}; + +ParcelGrid.prototype.displayContentLabel = function(dewars,nSamples,nMeasured, currentReimbursedDewars, maxReimbursedDewars ) { + + $("#" + this.id + "-label").html("Content (" + dewars.length + " Parcels " + this.getReimbursementHTML(currentReimbursedDewars, maxReimbursedDewars) + " - " + nSamples + " Samples - " + nMeasured + " Measured )"); +}; + +ParcelGrid.prototype.getAuthorizedReimbursedDewars = function(sessions) { + if (sessions){ + if (sessions.length > 0){ + return sessions[0].nbReimbDewars; + } + }; + return 0; +}; + +ParcelGrid.prototype.getCurrentReimbursedDewars = function(dewars) { + return _.filter(dewars, function(o){ return o.isReimbursed == true}).length; +}; + ParcelGrid.prototype.load = function(shipment,hasExportedData,samples,withoutCollection) { var _this = this; this.shipment = shipment; @@ -50,22 +86,30 @@ ParcelGrid.prototype.load = function(shipment,hasExportedData,samples,withoutCol this.hasExportedData = hasExportedData; nSamples = 0; nMeasured = 0; + this.maxReimbursedDewars = 0; + this.currentReimbursedDewars = 0; if (samples) { nSamples = samples.length; nMeasured = nSamples - withoutCollection.length; this.samples = _.groupBy(samples,"Dewar_dewarId"); this.withoutCollection = _.groupBy(withoutCollection,"Dewar_dewarId"); + }; + + if (shipment){ + this.maxReimbursedDewars = this.getAuthorizedReimbursedDewars(this.shipment.sessions); + this.currentReimbursedDewars = this.getCurrentReimbursedDewars(this.dewars); } - + this.dewars.sort(function(a, b) { return a.dewarId - b.dewarId; }); - $("#" + this.id + "-label").html("Content (" + this.dewars.length + " Parcels - " + nSamples + " Samples - " + nMeasured + " Measured)"); + this.displayContentLabel(this.dewars, nSamples, nMeasured, this.currentReimbursedDewars, this.maxReimbursedDewars); $("#" + this.id + "-add-button").removeClass("disabled"); $("#" + this.id + "-add-button").unbind('click').click(function(sender){ _this.edit(); }); + if (nSamples > 0) { $("#" + this.id + "-export").removeClass("disabled"); $("#" + this.id + "-export").unbind('click').click(function(sender){ @@ -74,14 +118,15 @@ ParcelGrid.prototype.load = function(shipment,hasExportedData,samples,withoutCol exportForm.show(); }); } - + this.fillTab("content", this.dewars); this.attachCallBackAfterRender(); }; ParcelGrid.prototype.fillTab = function (tabName, dewars) { - var _this = this; + var _this = this; + $("#" + tabName + "-" + this.id).html(""); this.parcelPanels[tabName] = Ext.create('Ext.panel.Panel', { // cls : 'border-grid', @@ -98,20 +143,22 @@ ParcelGrid.prototype.fillTab = function (tabName, dewars) { dewar["shippingId"] = _this.shipment.shippingId; var onSuccess = function(sender, shipment) { - _this.panel.setLoading(false); - _this.panel.doLayout(); + _this.panel.setLoading(false); + _this.refreshReimbursementContentHTML( _this.getCurrentReimbursedDewars(shipment.dewarVOs), _this.getAuthorizedReimbursedDewars(shipment.sessions)); + _this.currentReimbursedDewars = _this.getCurrentReimbursedDewars(shipment.dewarVOs); + _this.panel.doLayout(); }; EXI.getDataAdapter({onSuccess : onSuccess}).proposal.dewar.saveDewar(_this.shipment.shippingId, dewar); } for ( var i in dewars) { var parcelPanel = new ParcelPanel({ - height : 90, - width : this.panel.getWidth()*0.9, + height : 110, + width : this.panel.getWidth()*0.9, shippingId : this.shipment.shippingId, shippingStatus : this.shipment.shippingStatus, index : Number(i)+1, - currentTab : tabName + currentTab : tabName, }); this.parcelPanels[tabName].insert(parcelPanel.getPanel()); parcelPanel.load(this.dewars[i],this.shipment,this.samples[this.dewars[i].dewarId],this.withoutCollection[this.dewars[i].dewarId]); @@ -130,7 +177,7 @@ ParcelGrid.prototype.edit = function(dewar) { width : 600, modal : true, layout : 'fit', - items : [ caseForm.getPanel(dewar) ], + items : [ caseForm.getPanel(dewar, true) ], listeners : { afterrender : function(component, eOpts) { if (_this.puck != null) { diff --git a/js/core/view/shipping/reimbursementform.js b/js/core/view/shipping/reimbursementform.js new file mode 100644 index 000000000..15cd9e1e3 --- /dev/null +++ b/js/core/view/shipping/reimbursementform.js @@ -0,0 +1,116 @@ +/** + * @showTitle + * + * #onSaved + * #onAddPlates + * #onRemovePlates + **/ +function ReimbForm(args) { + this.id = BUI.id(); + this.width = 600; + this.showTitle = true; + if (args != null) { + if (args.showTitle != null) { + this.showTitle = args.showTitle; + } + } + this.onSaved = new Event(this); +} + +ReimbForm.prototype.fillStores = function() { + var _this = this; + this.panel.setLoading("Loading Labcontacts from database"); + + var proposal = BUI.getProposal(); + proposal.onDataRetrieved.attach(function(sender, data) { + _this.labContactForSendingStore.loadData(data, false); + _this.labContactForReturnStore.loadData(data, false); + _this.panel.setLoading(false); + }); + proposal.getLabContactsByProposalId(); + +}; + +ReimbForm.prototype.refresh = function(dewar) { + this.setDewar(dewar); +}; + +ReimbForm.prototype.getDewar = function() { + this.dewar.isReimbursed = Ext.getCmp(this.id + "dewar_isReimbursed").getValue(); + return this.dewar; +}; + +ReimbForm.prototype.setDewar = function(dewar) { + this.dewar = dewar; + + if (this.dewar == null){ + this.dewar={}; + this.dewar["isReimbursed"] = ""; + } + + Ext.getCmp(this.id + "dewar_isReimbursed").setValue(this.dewar.isReimbursed); +}; + +ReimbForm.prototype.getCurrentReimbursedDewars = function(dewars) { + return _.filter(dewars, function(o){ return o.isReimbursed == true}).length; +}; + +ReimbForm.prototype.hideReimbursedButton = function(shipment, dewar){ + this.maxReimb = 0; + debugger; + if (shipment) { + if (shipment.sessions.length > 0){ + this.maxReimb = shipment.sessions[0].nbReimbDewars; + } + } + if (dewar.isReimbursed) + return false; + if (this.getCurrentReimbursedDewars(shipment.dewarVOs) < this.maxReimb){ + return false; + } + return true; +} + +ReimbForm.prototype.getBoxLabelText = function(shipment, dewar){ + + boxLabel = 'By setting this parcel to reimbursed, the labels printed for the sending
will contain the fedex account that you should use to send your dewars.
Please note that you MUST NOT use this account to ship more
than the allowed number of dewars.
In case of abuse, your proposal will no more benefit
from parcel reimbursement.'; + if (this.hideReimbursedButton(shipment, dewar) == true){ + boxLabel = "You are not authorized to select another parcel to be reimbursed"; + } + return boxLabel; +} + +ReimbForm.prototype.getPanel = function(dewar, shipment) { + this.panel = Ext.create('Ext.form.Panel', { + width : this.width - 10, + title : this.getBoxLabelText(shipment, dewar), +// cls : 'border-grid', +// margin : 10, + padding : 10, + height : 320, + items : [ { + xtype : 'container', + margin : "2 2 2 2", + collapsible : false, + defaultType : 'textfield', + layout : 'anchor', + items : [ + { + xtype: 'checkbox', + fieldLabel : ' ', + boxLabel : 'Click if you agree with these conditions and you want to have this parcel automatically reimbursed.', + hideLabel:true, + labelWidth : 500, + name : 'isReimbursed', + id : this.id + 'dewar_isReimbursed', + trueText: 'true', + falseText: 'false' , + hidden : this.hideReimbursedButton(shipment, dewar) //false //'{4 < 3}' + }, + + ]}] + }); + + this.refresh(dewar); + return this.panel; +}; \ No newline at end of file diff --git a/js/core/view/shipping/shipmentform.js b/js/core/view/shipping/shipmentform.js index da8065a4a..b3d45ff1b 100644 --- a/js/core/view/shipping/shipmentform.js +++ b/js/core/view/shipping/shipmentform.js @@ -42,11 +42,12 @@ ShipmentForm.prototype.load = function(shipment,hasExportedData) { if (shipment){ if (shipment.sessions.length > 0){ beamlineName = shipment.sessions[0].beamlineName; + nbReimbDewars = shipment.sessions[0].nbReimbDewars; startDate = moment(shipment.sessions[0].startDate).format("DD/MM/YYYY"); } } - dust.render("shipping.form.template", {id : this.id, to : toData, from : fromData, beamlineName : beamlineName, startDate : startDate, shipment : shipment}, function(err, out){ + dust.render("shipping.form.template", {id : this.id, to : toData, from : fromData, beamlineName : beamlineName, startDate : startDate, shipment : shipment, nbReimbDewars : nbReimbDewars}, function(err, out){ html = out; }); diff --git a/js/core/widget/parcelpanel.js b/js/core/widget/parcelpanel.js index 8bfc04ea0..8792cb115 100644 --- a/js/core/widget/parcelpanel.js +++ b/js/core/widget/parcelpanel.js @@ -21,6 +21,8 @@ function ParcelPanel(args) { this.shippingStatus = ""; this.containersPanel = null; this.currentTab = "content"; + + this.maxReimb = 0; this.isSaveButtonHidden = false; this.isHidden = false; @@ -56,11 +58,14 @@ function ParcelPanel(args) { ParcelPanel.prototype.load = function(dewar, shipment, samples, withoutCollection) { var _this = this; this.dewar = dewar; + this.oldDewar = dewar; this.dewar.index = this.index; this.shipment = shipment; + if (shipment){ if (shipment.sessions.length > 0){ this.dewar.beamlineName = shipment.sessions[0].beamlineName; + this.maxReimb = shipment.sessions[0].nbReimbDewars; } } this.samples = samples; @@ -86,8 +91,17 @@ ParcelPanel.prototype.load = function(dewar, shipment, samples, withoutCollectio $("#" + this.id + "-edit-button").click(function () { _this.showCaseForm(); }); + //debugger + if (this.maxReimb > 0) { + $("#" + this.id + "-euro-button").removeClass("disabled"); + $("#" + this.id + "-euro-button").click(function () { + _this.showReimbForm(); + }); + } else { + $("#" + this.id + "-euro-button").hide(); + } } - + $("#" + this.id + "-print-button").click(function () { var dewarId = _this.dewar.dewarId; var url = EXI.getDataAdapter().proposal.shipping.getDewarLabelURL(dewarId, dewarId); @@ -121,7 +135,12 @@ ParcelPanel.prototype.load = function(dewar, shipment, samples, withoutCollectio ParcelPanel.prototype.renderDewarParameters = function (dewar) { var html = ""; - dust.render("parcel.panel.parameter.table.template", {id : this.id, dewar : dewar, height : this.height}, function(err, out){ + if (dewar.isReimbursed){ + this.isSelectedForReimb = " (R)"; + } else { + this.isSelectedForReimb = ""; + } + dust.render("parcel.panel.parameter.table.template", {id : this.id, dewar : dewar, height : this.height, isSelectedForReimb : this.isSelectedForReimb}, function(err, out){ html = out; }); $('#' + this.id + "-parameters-div").hide().html(html).fadeIn("fast"); @@ -316,6 +335,13 @@ ParcelPanel.prototype.addContainerToDewar = function(containerVO) { */ ParcelPanel.prototype.showCaseForm = function() { var _this = this; + var hideReimb = true; + if (this.dewar.isReimbursed) { + hideReimb = false; + } + if (this.maxReimbursedDewars > this.currentReimbursedDewars) { + hideReimb = false; + } /** Opens a window with the cas form **/ var caseForm = new CaseForm(); var window = Ext.create('Ext.window.Window', { @@ -325,7 +351,7 @@ ParcelPanel.prototype.showCaseForm = function() { modal : true, layout: 'fit', items: [ - caseForm.getPanel(_this.dewar) + caseForm.getPanel(_this.dewar, hideReimb) ], buttons : [ { text : 'Save', @@ -348,6 +374,47 @@ ParcelPanel.prototype.showCaseForm = function() { window.show(); }; +/** +* It displays a window with the reimbursement form +* +* @method showReimbForm +*/ +ParcelPanel.prototype.showReimbForm = function() { + var _this = this; + /** Opens a window with the cas form **/ + var reimbForm = new ReimbForm(); + var window = Ext.create('Ext.window.Window', { + title: 'Reimburse Parcel', + height: 450, + width: 600, + modal : true, + layout: 'fit', + items: [ + reimbForm.getPanel(_this.dewar, _this.shipment) + ], + buttons : [ { + text : 'Save', + handler : function() { + _this.onSavedClick.notify(reimbForm.getDewar()); + window.close(); + if (_this.currentTab == "content") { + _this.renderDewarParameters(_this.dewar); + } + _this.renderDewarComments(_this.dewar); + _this.panel.doLayout(); + + } + }, + { + text : 'Cancel', + handler : function() { + window.close(); + } + } ] + }); + window.show(); +}; + /** * It displays a window with an adding container form * diff --git a/js/mx/view/prepareexperiment/containerspreparepreadsheet.js b/js/mx/view/prepareexperiment/containerspreparepreadsheet.js index fa766051f..0b18fa912 100644 --- a/js/mx/view/prepareexperiment/containerspreparepreadsheet.js +++ b/js/mx/view/prepareexperiment/containerspreparepreadsheet.js @@ -163,7 +163,8 @@ ContainerPrepareSpreadSheet.prototype.getPanel = function() { header : 'Beamline', dataIndex: 'beamlineName', hidden : true, - type: 'dropdown', + type: 'autocomplete', + filter: 'true', flex: 1, source: EXI.credentialManager.getBeamlineNames() }, diff --git a/js/saxs/widget/framesgrid.js b/js/saxs/widget/framesgrid.js index c132dd452..a053020f7 100644 --- a/js/saxs/widget/framesgrid.js +++ b/js/saxs/widget/framesgrid.js @@ -9,7 +9,7 @@ FramesGrid.prototype.getPanel = function () { return { html : '
', autoScroll : true - } + }; }; FramesGrid.prototype.load = function (frames) { @@ -64,23 +64,23 @@ FramesGrid.prototype.setClickListeners = function () { } _this.onSelectionChange.notify(_this.parseSelected()); }); -} +}; FramesGrid.prototype.select = function (domId) { this.selectedFrames.push(this.getFrameByDomId(domId)); $("#" + domId).addClass('x-grid-item-selected'); -} +}; FramesGrid.prototype.deselect = function (domId) { var _this = this; _.remove(this.selectedFrames,function(o) {return o.domId == domId}); $("#" + domId).removeClass('x-grid-item-selected'); -} +}; FramesGrid.prototype.deselectAll = function () { this.selectedFrames = []; $(".frame-cell-element").removeClass("x-grid-item-selected"); -} +}; // FramesGrid.prototype.getFileName = function (filePath) { // var withExtension = filePath.substring(filePath.lastIndexOf('/')+1); @@ -118,4 +118,4 @@ FramesGrid.prototype.parseSelected = function () { } } return parsed; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/js/saxs/widget/network/vertexgraphformatter.js b/js/saxs/widget/network/vertexgraphformatter.js index 7cab4d959..12874f4a7 100644 --- a/js/saxs/widget/network/vertexgraphformatter.js +++ b/js/saxs/widget/network/vertexgraphformatter.js @@ -1,3 +1,7 @@ +function VertexGraphFormatter(defaultFormat, selectedFormat, overFormat, draggingFormat){ + ItemGraphFormatter.prototype.constructor.call(this, defaultFormat, selectedFormat, overFormat, draggingFormat); +} + VertexGraphFormatter.prototype.getDefault = ItemGraphFormatter.prototype.getDefault; VertexGraphFormatter.prototype.getSelected = ItemGraphFormatter.prototype.getSelected; VertexGraphFormatter.prototype.getOver = ItemGraphFormatter.prototype.getOver; @@ -7,11 +11,33 @@ VertexGraphFormatter.prototype.toJSON = ItemGraphFormatter.prototype.toJSON; VertexGraphFormatter.prototype.loadFromJSON = ItemGraphFormatter.prototype.loadFromJSON; VertexGraphFormatter.prototype._setEvents = ItemGraphFormatter.prototype._setEvents; - -function VertexGraphFormatter(defaultFormat, selectedFormat, overFormat, draggingFormat){ - ItemGraphFormatter.prototype.constructor.call(this, defaultFormat, selectedFormat, overFormat, draggingFormat); -}; - +function CircleVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ + VertexGraphFormatter.prototype.constructor.call(this, id, defaultFormat, selectedFormat, overFormat, draggingFormat); + this.args.type = "CircleVertexGraphFormatter"; + if (defaultFormat != null){ + if (defaultFormat.radius != null){ + this.defaultFormat.args.radius = defaultFormat.radius; + } + } + + if (selectedFormat != null){ + if (selectedFormat.radius != null){ + this.selected.args.radius = selectedFormat.radius; + } + } + + if (overFormat != null){ + if (overFormat.radius != null){ + this.over.args.radius = overFormat.radius; + } + } + + if (draggingFormat != null){ + if (draggingFormat.radius != null){ + this.dragging.args.draggingFormat = draggingFormat.radius; + } + } +} CircleVertexGraphFormatter.prototype.getDefault = VertexGraphFormatter.prototype.getDefault; CircleVertexGraphFormatter.prototype.getSelected = VertexGraphFormatter.prototype.getSelected; @@ -22,9 +48,9 @@ CircleVertexGraphFormatter.prototype.toJSON = VertexGraphFormatter.prototype.toJ CircleVertexGraphFormatter.prototype.loadFromJSON = VertexGraphFormatter.prototype.loadFromJSON; CircleVertexGraphFormatter.prototype._setEvents = VertexGraphFormatter.prototype._setEvents; -function CircleVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ +function SquareVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ VertexGraphFormatter.prototype.constructor.call(this, id, defaultFormat, selectedFormat, overFormat, draggingFormat); - this.args.type = "CircleVertexGraphFormatter"; + this.args.type = "SquareVertexGraphFormatter"; if (defaultFormat != null){ if (defaultFormat.radius != null){ this.defaultFormat.args.radius = defaultFormat.radius; @@ -48,9 +74,7 @@ function CircleVertexGraphFormatter(id, defaultFormat, selectedFormat, overForma this.dragging.args.draggingFormat = draggingFormat.radius; } } -}; - - +} SquareVertexGraphFormatter.prototype.getDefault = VertexGraphFormatter.prototype.getDefault; SquareVertexGraphFormatter.prototype.getSelected = VertexGraphFormatter.prototype.getSelected; @@ -61,9 +85,9 @@ SquareVertexGraphFormatter.prototype.toJSON = VertexGraphFormatter.prototype.toJ SquareVertexGraphFormatter.prototype.loadFromJSON = VertexGraphFormatter.prototype.loadFromJSON; SquareVertexGraphFormatter.prototype._setEvents = VertexGraphFormatter.prototype._setEvents; -function SquareVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ +function EllipseVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ VertexGraphFormatter.prototype.constructor.call(this, id, defaultFormat, selectedFormat, overFormat, draggingFormat); - this.args.type = "SquareVertexGraphFormatter"; + this.args.type = "EllipseVertexGraphFormatter"; if (defaultFormat != null){ if (defaultFormat.radius != null){ this.defaultFormat.args.radius = defaultFormat.radius; @@ -87,9 +111,7 @@ function SquareVertexGraphFormatter(id, defaultFormat, selectedFormat, overForma this.dragging.args.draggingFormat = draggingFormat.radius; } } -}; - - +} EllipseVertexGraphFormatter.prototype.getDefault = VertexGraphFormatter.prototype.getDefault; EllipseVertexGraphFormatter.prototype.getSelected = VertexGraphFormatter.prototype.getSelected; EllipseVertexGraphFormatter.prototype.getOver = VertexGraphFormatter.prototype.getOver; @@ -99,9 +121,9 @@ EllipseVertexGraphFormatter.prototype.toJSON = VertexGraphFormatter.prototype.to EllipseVertexGraphFormatter.prototype.loadFromJSON = VertexGraphFormatter.prototype.loadFromJSON; EllipseVertexGraphFormatter.prototype._setEvents = VertexGraphFormatter.prototype._setEvents; -function EllipseVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ +function RectangleVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ VertexGraphFormatter.prototype.constructor.call(this, id, defaultFormat, selectedFormat, overFormat, draggingFormat); - this.args.type = "EllipseVertexGraphFormatter"; + this.args.type = "RectangleVertexGraphFormatter"; if (defaultFormat != null){ if (defaultFormat.radius != null){ this.defaultFormat.args.radius = defaultFormat.radius; @@ -125,9 +147,7 @@ function EllipseVertexGraphFormatter(id, defaultFormat, selectedFormat, overForm this.dragging.args.draggingFormat = draggingFormat.radius; } } -}; - - +} RectangleVertexGraphFormatter.prototype.getDefault = ItemGraphFormatter.prototype.getDefault; RectangleVertexGraphFormatter.prototype.getSelected = ItemGraphFormatter.prototype.getSelected; @@ -138,9 +158,9 @@ RectangleVertexGraphFormatter.prototype.toJSON = ItemGraphFormatter.prototype.to RectangleVertexGraphFormatter.prototype.loadFromJSON = ItemGraphFormatter.prototype.loadFromJSON; RectangleVertexGraphFormatter.prototype._setEvents = ItemGraphFormatter.prototype._setEvents; -function RectangleVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ +function RoundedVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ VertexGraphFormatter.prototype.constructor.call(this, id, defaultFormat, selectedFormat, overFormat, draggingFormat); - this.args.type = "RectangleVertexGraphFormatter"; + this.args.type = "RoundedVertexGraphFormatter"; if (defaultFormat != null){ if (defaultFormat.radius != null){ this.defaultFormat.args.radius = defaultFormat.radius; @@ -164,9 +184,7 @@ function RectangleVertexGraphFormatter(id, defaultFormat, selectedFormat, overFo this.dragging.args.draggingFormat = draggingFormat.radius; } } -}; - - +} RoundedVertexGraphFormatter.prototype.getDefault = ItemGraphFormatter.prototype.getDefault; RoundedVertexGraphFormatter.prototype.getSelected = ItemGraphFormatter.prototype.getSelected; @@ -177,9 +195,9 @@ RoundedVertexGraphFormatter.prototype.toJSON = ItemGraphFormatter.prototype.toJS RoundedVertexGraphFormatter.prototype.loadFromJSON = ItemGraphFormatter.prototype.loadFromJSON; RoundedVertexGraphFormatter.prototype._setEvents = ItemGraphFormatter.prototype._setEvents; -function RoundedVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ +function OctagonVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ VertexGraphFormatter.prototype.constructor.call(this, id, defaultFormat, selectedFormat, overFormat, draggingFormat); - this.args.type = "RoundedVertexGraphFormatter"; + this.args.type = "OctagonVertexGraphFormatter"; if (defaultFormat != null){ if (defaultFormat.radius != null){ this.defaultFormat.args.radius = defaultFormat.radius; @@ -203,9 +221,7 @@ function RoundedVertexGraphFormatter(id, defaultFormat, selectedFormat, overForm this.dragging.args.draggingFormat = draggingFormat.radius; } } -}; - - +} OctagonVertexGraphFormatter.prototype.getDefault = ItemGraphFormatter.prototype.getDefault; OctagonVertexGraphFormatter.prototype.getSelected = ItemGraphFormatter.prototype.getSelected; @@ -214,33 +230,4 @@ OctagonVertexGraphFormatter.prototype.getDragging = ItemGraphFormatter.prototype OctagonVertexGraphFormatter.prototype.getId = ItemGraphFormatter.prototype.getId; OctagonVertexGraphFormatter.prototype.toJSON = ItemGraphFormatter.prototype.toJSON; OctagonVertexGraphFormatter.prototype.loadFromJSON = ItemGraphFormatter.prototype.loadFromJSON; -OctagonVertexGraphFormatter.prototype._setEvents = ItemGraphFormatter.prototype._setEvents; - -function OctagonVertexGraphFormatter(id, defaultFormat, selectedFormat, overFormat, draggingFormat){ - VertexGraphFormatter.prototype.constructor.call(this, id, defaultFormat, selectedFormat, overFormat, draggingFormat); - this.args.type = "OctagonVertexGraphFormatter"; - if (defaultFormat != null){ - if (defaultFormat.radius != null){ - this.defaultFormat.args.radius = defaultFormat.radius; - } - } - - if (selectedFormat != null){ - if (selectedFormat.radius != null){ - this.selected.args.radius = selectedFormat.radius; - } - } - - if (overFormat != null){ - if (overFormat.radius != null){ - this.over.args.radius = overFormat.radius; - } - } - - if (draggingFormat != null){ - if (draggingFormat.radius != null){ - this.dragging.args.draggingFormat = draggingFormat.radius; - } - } -}; - +OctagonVertexGraphFormatter.prototype._setEvents = ItemGraphFormatter.prototype._setEvents; \ No newline at end of file diff --git a/js/tracking/menu/trackingmainmenu.js b/js/tracking/menu/trackingmainmenu.js index 09e1383d5..acbe3dc73 100644 --- a/js/tracking/menu/trackingmainmenu.js +++ b/js/tracking/menu/trackingmainmenu.js @@ -51,7 +51,7 @@ TrackingMainMenu.prototype.getShipmentItem = function() { cls : 'ExiSAXSMenuToolBar', icon : '../images/icon/ic_email_black_24dp.png', handler : function(){ - location.hash = "/proposal/shipping/nav" + location.hash = "/proposal/shipping/nav"; } }; }; diff --git a/mx/config.js b/mx/config.js index 0c1a435e8..87d772840 100644 --- a/mx/config.js +++ b/mx/config.js @@ -2,7 +2,7 @@ var ExtISPyB ={ version : 'alpha-u3', release_date : '2017/03/01', - spaceGroups : ["P1", "P2", "P21", "C2", "P222", "P2221", "P21212", "P212121", "C222", "C2221", "F222", "I222", "I212121", "P4", "P41", "P42", "P43", "P422", "P4212", "P4122", "P41212", "P4222", "P42212", "P4322", "P43212", "I4", "I41", "I422", "I4122", "P3", "P31", "P32", "P31", "P321", "P3112", "P3121", "P3212", "P3221", "P6", "P61", "P65", "P62", "P64", "P63", "P622", "P6122", "P6522", "P6222", "P6422", "P6322", "R3", "R32", "P23", "P213", "P432", "P4232", "P4332", "P4132", "F23", "F432", "F4132", "I23", "I213", "I432", "I4132"], + spaceGroups : ["P1", "P2", "P21", "C2", "P222", "P2221", "P21212", "P212121", "C2221", "C222", "F222", "I222", "I212121", "P4", "P41", "P42", "P43", "I4", "I41", "P422", "P4212", "P4122", "P41212", "P4222", "P42212", "P4322", "P43212", "I422", "I4122", "P3", "P31", "P32", "H3", "R3", "P312", "P321", "P3112", "P3121", "P3212", "P3221", "H32", "R32", "P6", "P61", "P65", "P62", "P64", "P63", "P622", "P6122", "P6522", "P6222", "P6422", "P6322", "P23", "F23", "I23", "P213", "I213", "P432", "P4232", "F432", "F4132", "I432", "P4332", "P4132", "I4132"], sites:[ @@ -206,6 +206,56 @@ var ExtISPyB ={ sampleChangerType : 'FlexHCD' }, + { + name : "ID23-2", + sampleChangerType : 'SC3' + }, + { + name : "ID29", + sampleChangerType : 'FlexHCD' + }, + { + name : "ID30A-1", + sampleChangerType : 'RoboDiff' + }, + { + name : "ID30A-2", + sampleChangerType : 'SC3' + }, + { + name : "ID30A-3", + sampleChangerType : 'SC3' + }, + { + name : "ID30B", + sampleChangerType : 'FlexHCD' + }, + { + name : "BM14U", + sampleChangerType : 'FlexHCD' + }, + { + name : "BM30A", + sampleChangerType : 'FlexHCD' + } + ] + } + }, + { + name:'ESRF localhost', + url:'http://localhost:8080/ispyb/ispyb-ws/rest', + icon : '../images/site/dev.esrf.png', + exiUrl:'http://localhost:8080/ispyb/ispyb-ws/rest', + beamlines:{ + SAXS:[ + + + ], + MX:[ + { + name : "ID23-1", + sampleChangerType : 'FlexHCD' + }, { name : "ID23-2", sampleChangerType : 'SC3' diff --git a/mx/dev.html b/mx/dev.html index c6d5744fd..572139eae 100644 --- a/mx/dev.html +++ b/mx/dev.html @@ -46,7 +46,6 @@ - @@ -92,7 +91,6 @@ - @@ -304,6 +302,7 @@ + diff --git a/saxs/dev.html b/saxs/dev.html index 8d47389d8..f6d320b71 100644 --- a/saxs/dev.html +++ b/saxs/dev.html @@ -49,7 +49,6 @@ - @@ -95,7 +94,6 @@ - @@ -296,6 +294,7 @@ + diff --git a/templates/core/parcel.grid.template.js b/templates/core/parcel.grid.template.js index f8e801e3e..0c1f6a221 100644 --- a/templates/core/parcel.grid.template.js +++ b/templates/core/parcel.grid.template.js @@ -8,9 +8,12 @@ - + + +
diff --git a/templates/core/parcel.panel.parameter.table.template.js b/templates/core/parcel.panel.parameter.table.template.js index c88bf9569..e99a3b1a8 100644 --- a/templates/core/parcel.panel.parameter.table.template.js +++ b/templates/core/parcel.panel.parameter.table.template.js @@ -1,7 +1,7 @@ - + diff --git a/templates/core/parcel.panel.template.js b/templates/core/parcel.panel.template.js index f9cdfa8bc..f8fff7b25 100644 --- a/templates/core/parcel.panel.template.js +++ b/templates/core/parcel.panel.template.js @@ -30,6 +30,13 @@ + + + + + + +
Name: {dewar.code}{dewar.code}{isSelectedForReimb}
Status:
+ + Reimburse + +
diff --git a/templates/core/shipping.form.information.template.js b/templates/core/shipping.form.information.template.js index f22820e9b..e194f63b5 100644 --- a/templates/core/shipping.form.information.template.js +++ b/templates/core/shipping.form.information.template.js @@ -16,6 +16,10 @@
Status: {shipment.shippingStatus}
Reimb. parcels:{.nbReimbDewars}
diff --git a/test/dev.html b/test/dev.html index 0f51a14dc..16e1e851a 100644 --- a/test/dev.html +++ b/test/dev.html @@ -49,7 +49,6 @@ - @@ -95,7 +94,6 @@ - view-source:http://lindemaria:8082/EXI/test/dev.html#/welcome @@ -299,6 +297,7 @@ + diff --git a/tracking/dev.html b/tracking/dev.html index 3317b775e..375ef6264 100644 --- a/tracking/dev.html +++ b/tracking/dev.html @@ -46,7 +46,6 @@ - @@ -92,7 +91,6 @@ - @@ -246,6 +244,7 @@ +