diff --git a/WNPRC_EHR/resources/web/wnprc_ehr/ext4/components/buttons/husbandryButtons.js b/WNPRC_EHR/resources/web/wnprc_ehr/ext4/components/buttons/husbandryButtons.js index 942ca3c9f..9e2a945ff 100644 --- a/WNPRC_EHR/resources/web/wnprc_ehr/ext4/components/buttons/husbandryButtons.js +++ b/WNPRC_EHR/resources/web/wnprc_ehr/ext4/components/buttons/husbandryButtons.js @@ -250,4 +250,28 @@ Ext4.define('EHR.window.SubmitForReviewWindowHusbandry', { this.callParent(arguments); }, -}); \ No newline at end of file +}); + + +EHR.DataEntryUtils.registerDataEntryFormButton('SUBMIT_WATER', { + text: 'Submit Water', + name: 'submit_water', + requiredQC: 'Completed', + targetQC: 'Scheduled', + errorThreshold: 'WARN', + successURL: LABKEY.ActionURL.getParameter('srcURL') || LABKEY.ActionURL.buildURL('wnprc_ehr', 'dataEntry.view'), + disabled: true, + itemId: 'submitWtr', + disableOn: 'ERROR', + handler: function(btn){ + let waterGiven = btn.up('gridpanel').store; + if (store.getFields().get('waterSource')){ + + + } + //var panel = btn.up('ehr-dataentrypanel'); + + + } + +}); diff --git a/WNPRC_EHR/resources/web/wnprc_ehr/ext4/data/SingleAnimal/WaterStoreCollection.js b/WNPRC_EHR/resources/web/wnprc_ehr/ext4/data/SingleAnimal/WaterStoreCollection.js index fd0c6d8fd..489d7e9ea 100644 --- a/WNPRC_EHR/resources/web/wnprc_ehr/ext4/data/SingleAnimal/WaterStoreCollection.js +++ b/WNPRC_EHR/resources/web/wnprc_ehr/ext4/data/SingleAnimal/WaterStoreCollection.js @@ -1,6 +1,28 @@ Ext4.define('WNPRC.ext.data.WaterStoreCollection', { extend: 'WNPRC.ext.data.TaskStoreCollection', + /*constructor: function(){ + this.callParent(arguments); + this.on('update', this.onRecordUpdate, this); + }, + getWaterRecordStore: function (){ + if (this.waterRecordStore){ + return this.waterRecordStore; + } + this.waterRecordStore = this.getClientStoreByName('waterGiven'); + LDK.Assert.assertNotEmpty('Unbale to find water given store'); + return this.waterRecordStore; + + }, + getWaterRecords: function(){ + console.log("call water records"); + var waterStore = this.getWaterRecordStore(); + if (waterStore){ + return waterStore; + } + + },*/ + //Set a custom type (wnprc-waterserverstore) for the storeConfig addServerStoreFromConfig: function(config){ var storeConfig = Ext4.apply({}, config); diff --git a/WNPRC_EHR/resources/web/wnprc_ehr/ext4/utils/DataEntryButtons.js b/WNPRC_EHR/resources/web/wnprc_ehr/ext4/utils/DataEntryButtons.js index 953f5569c..844843a2e 100644 --- a/WNPRC_EHR/resources/web/wnprc_ehr/ext4/utils/DataEntryButtons.js +++ b/WNPRC_EHR/resources/web/wnprc_ehr/ext4/utils/DataEntryButtons.js @@ -120,7 +120,7 @@ tooltip: "Set the status of this record to Complete, save the record, and leave this page." })); - var SubmitWaterButtonName = 'WNPRC_SUBMIT_WATER'; + /*var SubmitWaterButtonName = 'WNPRC_SUBMIT_WATER'; registerBtn(SubmitWaterButtonName, _.extend(getBtn("SUBMIT"), { text: "Submit Water", name: "submit_water", @@ -153,6 +153,7 @@ width: '300', buttons: Ext4.MessageBox.YESNO, icon: Ext4.MessageBox.QUESTION, + scope: this, fn: function proceed(resp){ if (resp == 'yes'){ this.onSubmit(btn); @@ -164,7 +165,7 @@ } } } - })); + }));*/ /* * Prompt the user for a yes or no answer. Resolves on "yes" and rejects with an error with a diff --git a/WNPRC_EHR/src/org/labkey/wnprc_ehr/dataentry/forms/WaterMonitoring/EnterMultipleWater.java b/WNPRC_EHR/src/org/labkey/wnprc_ehr/dataentry/forms/WaterMonitoring/EnterMultipleWater.java index d23c207d3..5048a2b2c 100644 --- a/WNPRC_EHR/src/org/labkey/wnprc_ehr/dataentry/forms/WaterMonitoring/EnterMultipleWater.java +++ b/WNPRC_EHR/src/org/labkey/wnprc_ehr/dataentry/forms/WaterMonitoring/EnterMultipleWater.java @@ -29,6 +29,8 @@ public EnterMultipleWater(DataEntryFormContext ctx, Module owner) this.addClientDependency(ClientDependency.supplierFromPath("wnprc_ehr/model/sources/Encounter.js")); this.addClientDependency(ClientDependency.supplierFromPath("wnprc_ehr/ext4/data/SingleAnimal/WaterServerStore.js")); this.addClientDependency(ClientDependency.supplierFromPath("wnprc_ehr/ext4/data/SingleAnimal/WaterStoreCollection.js")); + this.addClientDependency(ClientDependency.supplierFromPath("wnprc_ehr/ext4/components/buttons/husbandryButtons.js")); + for (FormSection section : this.getFormSections()){ // section.addConfigSource("Husbandry"); @@ -41,6 +43,8 @@ public EnterMultipleWater(DataEntryFormContext ctx, Module owner) @Override protected List getButtonConfigs(){ List buttons = super.getButtonConfigs(); + //buttons.add("WNPRC_SUBMIT_WATER"); + buttons.add("SUBMIT_WATER"); buttons.add("WNPRC_SUBMIT_FINAL"); buttons.remove("WNPRC_SAVE"); buttons.remove("WNPRC_SAVE_AND_EXIT"); diff --git a/WNPRC_EHR/src/org/labkey/wnprc_ehr/notification/BloodDrawsTodayAll.java b/WNPRC_EHR/src/org/labkey/wnprc_ehr/notification/BloodDrawsTodayAll.java index e0f62e965..c91a4f7cd 100644 --- a/WNPRC_EHR/src/org/labkey/wnprc_ehr/notification/BloodDrawsTodayAll.java +++ b/WNPRC_EHR/src/org/labkey/wnprc_ehr/notification/BloodDrawsTodayAll.java @@ -118,8 +118,7 @@ public static class BloodDrawsTodayObject { // Creates filter. Date todayDate = dateToolkit.getDateToday(); SimpleFilter myFilter = new SimpleFilter("Id/DataSet/Demographics/calculated_status", "Alive", CompareType.EQUAL); -// myFilter.addCondition("date", todayDate, CompareType.DATE_EQUAL); //TODO: Uncomment this after testing. - myFilter.addCondition("date", dateToolkit.getDateXDaysFromNow(-800), CompareType.DATE_GTE); //TODO: Delete this after testing. + myFilter.addCondition("date", todayDate, CompareType.DATE_EQUAL); // Creates sort. Sort mySort = new Sort("date");