dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40846
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20797: event-capture: separate event details from dataelements/datavalues
------------------------------------------------------------
revno: 20797
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-10-20 11:25:25 +0200
message:
event-capture: separate event details from dataelements/datavalues
added:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/event-details.html
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js 2015-09-14 14:10:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js 2015-10-20 09:25:25 +0000
@@ -348,7 +348,7 @@
var p = d.promise();
dhis2.ec.store.get('programStages', program.programStages[0].id).done(function(obj) {
if(!obj || obj.version !== program.programStages[0].version) {
- promise = promise.then( getD2Object( program.programStages[0].id, 'programStages', '../api/programStages', 'fields=id,name,version,description,reportDateDescription,captureCoordinates,dataEntryForm,minDaysFromStart,repeatable,preGenerateUID,programStageSections[id,name,programStageDataElements[dataElement[id]]],programStageDataElements[displayInReports,sortOrder,allowProvidedElsewhere,allowFutureDate,compulsory,dataElement[id,name,valueType,optionSetValue,formName,optionSet[id]]]', 'idb' ) );
+ promise = promise.then( getD2Object( program.programStages[0].id, 'programStages', '../api/programStages', 'fields=id,name,version,description,excecutionDateLabel,captureCoordinates,dataEntryForm,minDaysFromStart,repeatable,preGenerateUID,programStageSections[id,name,programStageDataElements[dataElement[id]]],programStageDataElements[displayInReports,sortOrder,allowProvidedElsewhere,allowFutureDate,compulsory,dataElement[id,name,valueType,optionSetValue,formName,optionSet[id]]]', 'idb' ) );
}
d.resolve();
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html 2015-10-08 13:59:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html 2015-10-20 09:25:25 +0000
@@ -1,4 +1,5 @@
<div ng-if='!selectedProgramStage.programStageSections.length'>
+ <div ng-include="'views/event-details.html'"></div>
<table class="dhis2-list-table-striped">
<thead>
<tr>
@@ -10,64 +11,7 @@
</th>
</tr>
</thead>
- <tbody>
- <tr ng-if="selectedProgramStage.preGenerateUID || editingEventInFull">
- <td>
- {{'form_id' | translate}}
- </td>
- <td>
- <input type="text" ng-disabled="true" ng-model="currentEvent['uid']" class="form-control">
- </td>
- </tr>
- <tr>
- <td>
- {{selectedProgramStage.reportDateDescription ? selectedProgramStage.reportDateDescription : 'incident_date'| translate }}<span class="required">*</span>
- </td>
- <td>
- <input type="text"
- placeholder="{{dhis2CalendarFormat.keyDateFormat}}"
- d2-date
- max-date='0'
- ng-model="currentEvent.eventDate"
- ng-required="true"
- d2-date-validator
- name="eventDate"
- input-field-id='eventDate'
- class="form-control">
- <div ng-messages="outerForm.eventDate.$error" ng-if="interacted(outerForm.eventDate)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
- </div>
- </td>
- </tr>
- <tr ng-if="selectedProgramStage.captureCoordinates">
- <td>
- {{'latitude'| translate}}<span class="pull-right"><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>
- </td>
- <td>
- <input type="number"
- ng-model="currentEvent.coordinate.latitude"
- name="latitude"
- d2-coordinate-validator
- ng-required="false"
- class="form-control"/>
- <div ng-messages="outerForm.latitude.$error" ng-if="interacted(outerForm.latitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
- </div>
- </td>
- </tr>
- <tr ng-if="selectedProgramStage.captureCoordinates">
- <td>
- {{'longitude'| translate}}<span class="pull-right"><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>
- </td>
- <td>
- <input type="number"
- ng-model="currentEvent.coordinate.longitude"
- name="longitude"
- d2-coordinate-validator
- ng-required="false"
- class="form-control"/>
- <div ng-messages="outerForm.longitude.$error" ng-if="interacted(outerForm.longitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
- </div>
- </td>
- </tr>
+ <tbody>
<tr ng-repeat="eventGridColumn in eventGridColumns" ng-if="eventGridColumn.id !== 'comment' && eventGridColumn.id !== 'uid' && eventGridColumn.id !== 'eventDate' && !hiddenFields[eventGridColumn.id]">
<td >
{{eventGridColumn.name}}<span ng-if="eventGridColumn.compulsory" class="required">*</span>
@@ -264,67 +208,7 @@
</div>
<div ng-if='selectedProgramStage.programStageSections.length'>
- <table class="dhis2-list-table-striped">
- <tbody>
- <tr ng-if="selectedProgramStage.preGenerateUID && currentEvent['uid']">
- <td>
- {{'form_id' | translate}}
- </td>
- <td>
- <input type="text" ng-disabled="true" ng-model="currentEvent['uid']" class="form-control">
- </td>
- </tr>
- <tr>
- <td>
- {{selectedProgramStage.reportDateDescription ? selectedProgramStage.reportDateDescription : 'incident_date'| translate }}<span class="required">*</span>
- </td>
- <td>
- <input type="text"
- placeholder="{{dhis2CalendarFormat.keyDateFormat}}"
- d2-date
- max-date='0'
- ng-model="currentEvent.eventDate"
- ng-required="true"
- d2-date-validator
- name="eventDate"
- input-field-id='eventDate'
- class="form-control">
- <div ng-messages="outerForm.eventDate.$error" ng-if="interacted(outerForm.eventDate)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
- </div>
- </td>
- </tr>
- <tr ng-if="selectedProgramStage.captureCoordinates">
- <td>
- {{'latitude'| translate}}<span class="pull-right"><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>
- </td>
- <td>
- <input type="number"
- ng-model="currentEvent.coordinate.latitude"
- name="latitude"
- d2-coordinate-validator
- ng-required="false"
- class="form-control"/>
- <div ng-messages="outerForm.latitude.$error" ng-if="interacted(outerForm.latitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
- </div>
- </td>
- </tr>
- <tr ng-if="selectedProgramStage.captureCoordinates">
- <td>
- {{'longitude'| translate}}<span class="pull-right"><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>
- </td>
- <td>
- <input type="number"
- ng-model="currentEvent.coordinate.longitude"
- name="longitude"
- d2-coordinate-validator
- ng-required="false"
- class="form-control"/>
- <div ng-messages="outerForm.longitude.$error" ng-if="interacted(outerForm.longitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
- </div>
- </td>
- </tr>
- </tbody>
- </table>
+ <div ng-include="'views/event-details.html'"></div>
<div ng-repeat='section in selectedProgramStage.programStageSections' ng-if="section.id === selectedSection.id || selectedSection.id === 'ALL' && !hiddenSections[section.id] ">
<div class="vertical-spacing section-label">
=== added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/event-details.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/event-details.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/event-details.html 2015-10-20 09:25:25 +0000
@@ -0,0 +1,61 @@
+<table class="dhis2-list-table-striped">
+ <tbody>
+ <tr ng-if="selectedProgramStage.preGenerateUID && currentEvent['uid']">
+ <td>
+ {{'form_id'| translate}}
+ </td>
+ <td>
+ <input type="text" ng-disabled="true" ng-model="currentEvent['uid']" class="form-control">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {{selectedProgramStage.excecutionDateLabel ? selectedProgramStage.excecutionDateLabel : 'incident_date'| translate }}<span class="required">*</span>
+ </td>
+ <td>
+ <input type="text"
+ placeholder="{{dhis2CalendarFormat.keyDateFormat}}"
+ d2-date
+ max-date='0'
+ ng-model="currentEvent.eventDate"
+ ng-required="true"
+ d2-date-validator
+ name="eventDate"
+ input-field-id='eventDate'
+ class="form-control">
+ <div ng-messages="outerForm.eventDate.$error" ng-if="interacted(outerForm.eventDate)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
+ </div>
+ </td>
+ </tr>
+ <tr ng-if="selectedProgramStage.captureCoordinates">
+ <td>
+ {{'latitude'| translate}}<span class="pull-right"><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>
+ </td>
+ <td>
+ <input type="number"
+ ng-model="currentEvent.coordinate.latitude"
+ name="latitude"
+ d2-coordinate-validator
+ ng-required="false"
+ class="form-control"/>
+ <div ng-messages="outerForm.latitude.$error" ng-if="interacted(outerForm.latitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
+ </div>
+ </td>
+ </tr>
+ <tr ng-if="selectedProgramStage.captureCoordinates">
+ <td>
+ {{'longitude'| translate}}<span class="pull-right"><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>
+ </td>
+ <td>
+ <input type="number"
+ ng-model="currentEvent.coordinate.longitude"
+ name="longitude"
+ d2-coordinate-validator
+ ng-required="false"
+ class="form-control"/>
+ <div ng-messages="outerForm.longitude.$error" ng-if="interacted(outerForm.longitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
\ No newline at end of file