Skip to content

Commit 5f2bb6d

Browse files
reagan-meantreagan
andauthored
ATT-35: Info message telling why when no file upload widget.
* ATT-35:Informative message explaining why upload widget is missing * ATT-35:Informative message explaining why upload widget is missing * ATT-35:Informative message explaining why upload widget is missing Co-authored-by: reagan <reaganment@gmail.com>
1 parent b2b27de commit 5f2bb6d

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

api/src/main/resources/messages.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ ${project.parent.artifactId}.thumbail.save.error=An error occurred and the attac
2727
${project.parent.artifactId}.thumbail.delete.success=The attachment was successfully deleted.
2828
${project.parent.artifactId}.thumbail.delete.error=An error occurred and the attachment could not be deleted.
2929

30-
${project.parent.artifactId}.misc.label.enterCaption=Enter a caption
30+
${project.parent.artifactId}.misc.label.enterCaption=Enter a caption
31+
32+
${project.parent.artifactId}.noActiveVisit=The file upload is disabled while there is no active visit.

omod/src/main/java/org/openmrs/module/attachments/page/controller/AttachmentsPageController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void controller(@RequestParam("patient") Patient patient,
4848

4949
// For Core Apps's patient header.
5050
model.put("patient", patient);
51+
model.put("visit", visitWrapper);
5152
}
5253

5354
protected VisitDomainWrapper getVisitDomainWrapper(DomainWrapperFactory domainWrapperFactory, Patient patient,

omod/src/main/webapp/pages/attachments.gsp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,25 @@ ${ ui.includeFragment("coreapps", "patientHeader", [ patient: patient ]) }
5353

5454
<div id="att-page-main">
5555

56+
<% if(visit == null){ %>
57+
58+
<h5>${ ui.message("attachments.noActiveVisit") }</h5>
59+
60+
<% } else{ %>
61+
5662
<div ng-controller="FileUploadCtrl" class="att_main-section">
5763
<att-file-upload config="config"></att-file-upload>
5864
</div>
5965

6066
<div ng-controller="GalleryCtrl" class="att_main-section">
6167
<att-gallery obs-query="obsQuery" options="{canEdit:true}"></att-gallery>
6268
</div>
63-
69+
<% } %>
6470
</div>
6571

6672

6773
<script type="text/javascript">
74+
6875
// manually bootstrap angular app, in case there are multiple angular apps on a page
6976
angular.bootstrap('#att-page-main', ['att.page.main']);
7077
</script>

0 commit comments

Comments
 (0)