← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16636: tracker capture - scheduling intergrated with data entry; applied some coloring to widgets

 

------------------------------------------------------------
revno: 16636
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-09-05 14:52:43 +0200
message:
  tracker capture - scheduling intergrated with data entry; applied some coloring to widgets
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/scheduling-messaging/scheduling-messaging-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/scheduling-messaging/scheduling-messaging.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/en.json


--
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-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2014-09-01 15:32:05 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2014-09-05 12:52:43 +0000
@@ -18,6 +18,7 @@
     $scope.dataEntryOuterForm = {};
     $scope.displayCustomForm = false;
     $scope.currentElement = {};
+    $scope.schedulingEnabled = false;
     
     var loginDetails = storage.get('LOGIN_DETAILS');
     var storedBy = '';
@@ -142,6 +143,10 @@
         $scope.showEventCreationDiv = !$scope.showEventCreationDiv;
     };
     
+    $scope.enableRescheduling = function(){
+        $scope.schedulingEnabled = !$scope.schedulingEnabled;
+    };
+    
     $scope.showDummyEventCreation = function(dummyEvent){
 
         if(dummyEvent){    
@@ -455,15 +460,14 @@
                         $scope.dhis2Events[i].statusColor = statusColor;
                         continueLoop = false;
                     }
-                } 
+                }
+                $scope.schedulingEnabled = !$scope.schedulingEnabled;
             });
         }              
     };
     
     $scope.addNote = function(){
-        
         if(!angular.isUndefined($scope.note) && $scope.note != ""){
-
             var newNote = {value: $scope.note};
 
             if(angular.isUndefined( $scope.currentEvent.notes) ){
@@ -487,6 +491,10 @@
         }        
     };    
     
+    $scope.clearNote = function(){
+         $scope.note = '';           
+    };
+    
     $scope.getInputNotifcationClass = function(id, custom){
         if($scope.currentElement.id){
             if($scope.currentElement.saved && ($scope.currentElement.id === id)){

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2014-09-01 15:32:05 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2014-09-05 12:52:43 +0000
@@ -1,4 +1,4 @@
-<div class="panel panel-default" ng-controller="DataEntryController">
+<div class="panel panel-info" ng-controller="DataEntryController">
     <div class="panel-heading handle bold">
         {{dataentryWidget.title| translate}}        
         <span class="nav-pills" ng-if="allowEventCreation">
@@ -18,7 +18,7 @@
             <table class="table-borderless">
                 <tbody>
                     <tr>
-                        <td class="inline-block" ng-repeat="dhis2Event in dhis2Events | orderBy:'sortingDate':reverse">
+                        <td class="inline-block" ng-repeat="dhis2Event in dhis2Events| orderBy:'sortingDate':reverse">
                             <span class="block align-center">{{dhis2Event.orgUnitName}}</span>                                              
                             <span class="stage-container"                                                     
                                   ng-class="{'current-stage': currentEvent && currentEvent.event == dhis2Event.event, '{{dhis2Event.statusColor}}': true}"                                                      
@@ -32,14 +32,14 @@
                 </tbody>                
             </table>
         </div>     
-        <div ng-if="!dhis2Events && selectedEnrollment" class="alert alert-warning">{{'no_event_is_yet_created'| translate}}</div>
+        <div ng-if="!dhis2Events && selectedEnrollment" class="alert alert-danger">{{'no_event_is_yet_created'| translate}}</div>
         <div ng-if="dhis2Events && showEventCreationDiv" class="alert alert-warning">{{'event_creation'| translate}}</div>
-        <div ng-if="!selectedEnrollment" class="alert alert-warning">{{'not_yet_enrolled_data_entry'| translate}}</div> 
+        <div ng-if="!selectedEnrollment" class="alert alert-danger">{{'not_yet_enrolled_data_entry'| translate}}</div> 
         <div ng-show="dummyEvents && showEventCreationDiv">            
             <table class="table-borderless">
                 <tbody>
                     <tr>
-                        <td class="inline-block" ng-repeat="dummyEvent in dummyEvents | orderBy:'sortingDate':reverse">
+                        <td class="inline-block" ng-repeat="dummyEvent in dummyEvents| orderBy:'sortingDate':reverse">
                             <span class="block align-center">{{dhis2Event.orgUnitName}}</span>                                              
                             <span class="stage-container"                                                     
                                   ng-class="{'current-stage': currentDummyEvent && currentDummyEvent.programStage == dummyEvent.programStage, '{{dummyEvent.statusColor}}': true}"                                                      
@@ -87,10 +87,15 @@
                            ng-model="currentEvent.eventDate" 
                            ng-required="true" 
                            blur-or-change="saveEventDate()"/>
-                    <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>     
+                    <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>
                 </div>
                 <div class="col-md-6">
-                    {{'due_date'| translate}}
+                    <span ng-if="currentEvent.eventDate">
+                        {{'due_date'| translate}}
+                    </span>
+                    <span ng-if="!currentEvent.eventDate">
+                        <a href ng-click="enableRescheduling()" title="{{ schedulingEnabled ? 'disable_rescheduling' : 'enable_rescheduling' | translate}}"><span class="text-primary bold">{{'due_date'| translate}}</span></a>                        
+                    </span>                    
                     <input type="text" 
                            name="dueDate" 
                            placeholder="yyyy-mm-dd"
@@ -99,56 +104,59 @@
                            ng-date 
                            ng-model="currentEvent.dueDate" 
                            blur-or-change="saveDueDate()" 
-                           ng-disabled="currentEvent.eventDate"/>
+                           ng-disabled="currentEvent.eventDate || !schedulingEnabled"/>
+                    <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>
                 </div>                        
             </div>
-            <div ng-if="currentEvent.eventDate">
-            
-                <div class='row'><hr></div>
+            <div ng-if="currentEvent.eventDate">                            
                 <div class='col-md-12' ng-if="customForm">
                     <a href ng-click="switchDataEntryForm()" title="{{displayCustomForm ? 'default_form' : 'custom_form'| translate}}"><span class="primary pull-right"><i class="fa fa-file-text fa-2x"></i></span></a>                
                 </div>
                 <div class="vertical-spacing" ng-if="displayCustomForm" ng-include="'components/dataentry/custom-form.html'"></div>  
                 <div class="vertical-spacing" ng-if="!displayCustomForm" ng-include="'components/dataentry/default-form.html'"></div>
-                <div class='row'><hr></div>                                
-            </div>
-            <div class="row">
-                <div class="col-md-10">
-                    <textarea class="form-control" rows="3" ng-model="note" placeholder="{{'add_your_note_here'| translate}}"></textarea>
-                </div>
-                <div class="col-md-2 add-default-top-margin">
-                    <button type="button" 
-                            class="btn btn-primary"
-                            ng-click="addNote()">
-                        {{'add'| translate}}
-                    </button>
-                </div>
+            </div>            
 
-                <table class="table table-striped dhis2-table-hover">
-                    <tr ng-repeat="note in currentEvent.notes">
-                        <td class="overflow-ellipsis">
-                            <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
-                                <div>{{note.value}}</div>
-                            </d2-pop-over>
-                            <script type="text/ng-template" id="note.html">
-                                <p>{{content.value}}</p>
-                                <hr>
-                                <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
-                                <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
-                            </script>
-                        </td> 
-                    </tr>
-                </table>
-            </div>
             <div class="form-group">
-                <div">
-                        <a href ng-click="completeIncompleteEvent()" class="btn btn-warning" ng-if="currentEvent.eventDate && (currentEvent.status === 'ACTIVE' || currentEvent.status === 'VISITED')">{{'complete'| translate}}</a>
-                        <a href ng-click="completeIncompleteEvent()" class="btn btn-warning" ng-if="currentEvent.eventDate && currentEvent.status === 'COMPLETED'">{{'incomplete'| translate}}</a>                       
-                        <a href ng-click="validateEvent()" class="btn btn-info" ng-disabled="true" ng-if="currentEvent.eventDate">{{'validate'| translate}}</a>                        
-                        <a href ng-click="skipUnskipEvent()" class="btn btn-warning" ng-if="!currentEvent.eventDate">{{currentEvent.status === 'SKIPPED' ? 'unskip' : 'skip' | translate}}</a>
-                    <a href ng-click="deleteEvent()" class="btn btn-danger">{{'delete'| translate}}</a>
-                </div>
-            </div>
+                <div class='row'><hr></div>
+                <a href ng-click="completeIncompleteEvent()" class="btn btn-warning" ng-if="currentEvent.eventDate && (currentEvent.status === 'ACTIVE' || currentEvent.status === 'VISITED')">{{'complete'| translate}}</a>
+                <a href ng-click="completeIncompleteEvent()" class="btn btn-warning" ng-if="currentEvent.eventDate && currentEvent.status === 'COMPLETED'">{{'incomplete'| translate}}</a>                       
+                <a href ng-click="validateEvent()" class="btn btn-info" ng-disabled="true" ng-if="currentEvent.eventDate">{{'validate'| translate}}</a>                        
+                <a href ng-click="skipUnskipEvent()" class="btn btn-warning" ng-if="!currentEvent.eventDate">{{currentEvent.status === 'SKIPPED' ? 'unskip' : 'skip'| translate}}</a>
+                <a href ng-click="deleteEvent()" class="btn btn-danger">{{'delete'| translate}}</a>
+            </div>
+        </div>
+
+        <div ng-show="currentEvent && !showEventCreationDiv" class='remove-default-padding overflow-ellipsis'>
+            <div class='row'><hr></div>
+            <textarea class="form-control" rows="3" ng-model="note" placeholder="{{'add_new_note_here'| translate}}"></textarea> 
+            <div class="vertical-spacing">
+                <button type="button" 
+                        class="btn btn-primary small-horizonal-spacing"
+                        ng-click="addNote()">
+                    {{'add'| translate}}
+                </button>        
+                <button type="button" 
+                        class="btn btn-default small-horizonal-spacing" 
+                        ng-click="clearNote()">
+                    {{'clear'| translate}}
+                </button>
+            </div>
+
+            <table class="table table-striped dhis2-table-hover">
+                <tr ng-repeat="note in currentEvent.notes">
+                    <td class="overflow-ellipsis">
+                        <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
+                            <div>{{note.value}}</div>
+                        </d2-pop-over>
+                        <script type="text/ng-template" id="note.html">
+                            <p>{{content.value}}</p>
+                            <hr>
+                            <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
+                            <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
+                        </script>
+                    </td> 
+                </tr>
+            </table>
+        </div>
     </div>        
-    </div>
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2014-09-01 13:08:57 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2014-09-05 12:52:43 +0000
@@ -1,4 +1,4 @@
-<div class="panel panel-default" ng-controller="EnrollmentController">
+<div class="panel panel-info" ng-controller="EnrollmentController">
     <div class="panel-heading handle bold">                                            
         <!--<span ng-class="{'text-primary': !showEnrollmentHistoryDiv}">{{enrollmentWidget.title| translate}}</span>-->
         {{enrollmentWidget.title| translate}}
@@ -165,10 +165,10 @@
             <div class="alert alert-warning">{{'not_active_enrollment_exists'| translate}}</div> 
         </div>
         <div ng-if="!selectedProgram && programExists">
-            <div class="alert alert-warning">{{'please_select_a_program_for_enrollment'| translate}}</div> 
+            <div class="alert alert-danger">{{'please_select_a_program_for_enrollment'| translate}}</div> 
         </div>
         <div ng-if="!programExists">
-            <div class="alert alert-warning">{{'no_program_exists_enrollment'| translate}}</div> 
+            <div class="alert alert-danger">{{'no_program_exists_enrollment'| translate}}</div> 
         </div>
 
     </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js	2014-07-15 13:13:11 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js	2014-09-05 12:52:43 +0000
@@ -66,8 +66,7 @@
         }        
     };
     
-    $scope.closeAddNote = function(){
-         $scope.addNoteField = false;
+    $scope.clearNote = function(){
          $scope.note = '';           
     };
     

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html	2014-07-23 09:56:14 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html	2014-09-05 12:52:43 +0000
@@ -1,4 +1,4 @@
-<div class="panel panel-default" ng-controller="NotesController">
+<div class="panel panel-info" ng-controller="NotesController">
     <div class="panel-heading handle bold">
         {{notesWidget.title| translate}}        
         <span class="nav-pills" ng-show="selectedEnrollment">
@@ -12,40 +12,36 @@
             <a class="small-horizonal-spacing" href ng-click="removeWidget(notesWidget)" title="{{'remove'| translate}}"><i class="fa fa-times-circle"></i></a>            
         </span>        
     </div>
-    <div ng-show="notesWidget.expand" class="panel-body dashboard-widget-container">
-        <div ng-show="selectedEnrollment && !selectedEnrollment.notes" class="alert alert-info">{{'empty_notes'| translate}}</div> 
-        <div ng-show="!selectedEnrollment" class="alert alert-warning">{{'not_yet_enrolled_note'| translate}}</div>
-        
-        <div class="add-note" ng-show="addNoteField">
-            <textarea class="form-control" rows="3" ng-model="note" placeholder="{{'add_your_note_here'| translate}}"></textarea> 
-            <div class="vertical-spacing">
-	            <button type="button" 
-	                    class="btn btn-primary"
-	                    ng-click="addNote()">
-	                {{'save'| translate}}
-	            </button>        
-	            <button type="button" 
-	                    class="btn btn-default small-horizonal-spacing" 
-	                    ng-click="closeAddNote()">
-	                {{'cancel'| translate}}
-	            </button>
-	        </div>
-        </div>
-
+    <div ng-show="notesWidget.expand" class="panel-body dashboard-widget-container">        
+        <div ng-show="!selectedEnrollment" class="alert alert-danger">{{'not_yet_enrolled_note'| translate}}</div>
         <div ng-show='selectedEnrollment' class='remove-default-padding overflow-ellipsis'>
+                <textarea class="form-control" rows="3" ng-model="note" placeholder="{{'add_new_note_here'| translate}}"></textarea> 
+                <div class="vertical-spacing">
+                    <button type="button" 
+                            class="btn btn-primary small-horizonal-spacing"
+                            ng-click="addNote()">
+                        {{'add'| translate}}
+                    </button>        
+                    <button type="button" 
+                            class="btn btn-default small-horizonal-spacing" 
+                            ng-click="clearNote()">
+                        {{'clear'| translate}}
+                    </button>
+                </div>
+            <div ng-show="!selectedEnrollment.notes" class="alert alert-warning">{{'empty_notes'| translate}}</div> 
             <table class="table table-striped dhis2-table-hover">
                 <tr ng-repeat="note in selectedEnrollment.notes| filter:noteSearchText">
                     <td>
-                        <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
-                            <div>{{note.value}}</div>
-                        </d2-pop-over>
-                        <script type="text/ng-template" id="note.html">
-                            <p>{{content.value}}</p>
-                            <hr>
-                            <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
-                            <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
-                        </script>
-                    </td> 
+                <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
+                    <div>{{note.value}}</div>
+                </d2-pop-over>
+                <script type="text/ng-template" id="note.html">
+                    <p>{{content.value}}</p>
+                    <hr>
+                    <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
+                    <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
+                </script>
+                </td> 
                 </tr>
             </table>
         </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2014-09-05 09:21:39 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2014-09-05 12:52:43 +0000
@@ -31,7 +31,6 @@
         //if no program, display attributesInNoProgram
         TEIService.processAttributes($scope.selectedTei, $scope.selectedProgram, $scope.selectedEnrollment).then(function(tei){
             $scope.selectedTei = tei; 
-            console.log('The tei is:  ', $scope.selectedTei);
         });
     });
     

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2014-08-08 14:59:22 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2014-09-05 12:52:43 +0000
@@ -1,4 +1,4 @@
-<div class="panel panel-default" ng-controller="ProfileController">
+<div class="panel panel-info" ng-controller="ProfileController">
     <div class="panel-heading handle bold">
         {{profileWidget.title| translate}}
         <span class="nav-pills" ng-show="selectedTei.attributes.length">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2014-07-10 13:17:04 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2014-09-05 12:52:43 +0000
@@ -1,4 +1,4 @@
-<div class="panel panel-default" ng-controller="RelationshipController">
+<div class="panel panel-info" ng-controller="RelationshipController">
     <div class="panel-heading handle bold">
         {{relationshipWidget.title| translate}}
         <span class="nav-pills" ng-show="selectedTei">
@@ -13,8 +13,8 @@
         </span>        
     </div>
     <div ng-show="relationshipWidget.expand" class="panel-body dashboard-widget-container">
-        <div ng-show="selectedTei && !selectedTei.relationships" class="alert alert-info">{{'no_relationship'| translate}}</div> 
-        <div ng-show="!selectedTei" class="alert alert-info">{{'relationship_not_possible'| translate}}</div> 
+        <div ng-show="selectedTei && !selectedTei.relationships" class="alert alert-warning">{{'no_relationship'| translate}}</div> 
+        <div ng-show="!selectedTei" class="alert alert-danger">{{'relationship_not_possible'| translate}}</div> 
         
         <div ng-show="selectedTei" class="remove-default-padding">
             <table class="table table-striped dhis2-table-hover">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report.html	2014-08-18 10:01:22 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report.html	2014-09-05 12:52:43 +0000
@@ -1,4 +1,4 @@
-<div class="panel panel-default" ng-controller="TeiReportController">
+<div class="panel panel-info" ng-controller="TeiReportController">
     <div class="panel-heading handle bold not-printable">
         {{reportWidget.title| translate}}        
         <span class="pull-right">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/scheduling-messaging/scheduling-messaging-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/scheduling-messaging/scheduling-messaging-controller.js	2014-09-05 09:21:39 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/scheduling-messaging/scheduling-messaging-controller.js	2014-09-05 12:52:43 +0000
@@ -37,6 +37,10 @@
                 $scope.selectedTei && 
                 $scope.selectedEnrollment){            
             
+            angular.forEach($scope.selectedProgram.programStages, function(stage){
+                $scope.selectedProgramWithStage[stage.id] = stage;
+            });
+            
             //check if the selected TEI has any of the contact attributes
             //that can be used for communication
             TEIService.processAttributes($scope.selectedTei, $scope.selectedProgram, $scope.selectedEnrollment).then(function(tei){
@@ -49,38 +53,37 @@
                         continueLoop = false;
                     }
                 }
-            });
-        
-            angular.forEach($scope.selectedProgram.programStages, function(stage){
-                $scope.selectedProgramWithStage[stage.id] = stage;
-            });
-            
-            DHIS2EventFactory.getEventsByStatus($scope.selectedTei.trackedEntityInstance, $scope.selectedOrgUnit.id, $scope.selectedProgram.id, 'ACTIVE').then(function(eventList){                
-                angular.forEach(eventList, function(dhis2Event){                    
-                    if( dhis2Event.enrollment === $scope.selectedEnrollment.enrollment && 
-                        dhis2Event.status === 'SCHEDULE' &&
-                        angular.isUndefined(dhis2Event.eventDate)){
-                        var eventStage = $scope.selectedProgramWithStage[dhis2Event.programStage];
-                        if(angular.isObject(eventStage)){
-                            
-                            $scope.dhis2Events.push(dhis2Event);
-                            dhis2Event.name = eventStage.name; 
-                            dhis2Event.reportDateDescription = eventStage.reportDateDescription;
-                            dhis2Event.dueDate = DateUtils.format(dhis2Event.dueDate);
-
-                            if(dhis2Event.eventDate){
-                                dhis2Event.eventDate = DateUtils.format(dhis2Event.eventDate);
-                                dhis2Event.sortingDate = DateUtils.format(dhis2Event.eventDate);
-                            }
-                            else{
-                                dhis2Event.sortingDate = dhis2Event.dueDate;
-                            }                            
-                            dhis2Event.statusColor = EventUtils.getEventStatusColor(dhis2Event);  
-                            dhis2Event = EventUtils.setEventOrgUnitName(dhis2Event);                            
-                        } 
+                        
+                DHIS2EventFactory.getEventsByStatus($scope.selectedTei.trackedEntityInstance, $scope.selectedOrgUnit.id, $scope.selectedProgram.id, 'ACTIVE').then(function(eventList){                
+                    angular.forEach(eventList, function(dhis2Event){                    
+                        if( dhis2Event.enrollment === $scope.selectedEnrollment.enrollment && 
+                            dhis2Event.status === 'SCHEDULE' &&
+                            angular.isUndefined(dhis2Event.eventDate)){
+                            var eventStage = $scope.selectedProgramWithStage[dhis2Event.programStage];
+                            if(angular.isObject(eventStage)){
+
+                                $scope.dhis2Events.push(dhis2Event);
+                                dhis2Event.name = eventStage.name; 
+                                dhis2Event.reportDateDescription = eventStage.reportDateDescription;
+                                dhis2Event.dueDate = DateUtils.format(dhis2Event.dueDate);
+
+                                if(dhis2Event.eventDate){
+                                    dhis2Event.eventDate = DateUtils.format(dhis2Event.eventDate);
+                                    dhis2Event.sortingDate = DateUtils.format(dhis2Event.eventDate);
+                                }
+                                else{
+                                    dhis2Event.sortingDate = dhis2Event.dueDate;
+                                }                            
+                                dhis2Event.statusColor = EventUtils.getEventStatusColor(dhis2Event);  
+                                dhis2Event = EventUtils.setEventOrgUnitName(dhis2Event);                            
+                            } 
+                        }
+                    });                
+                    $scope.schedulingPossible = $scope.dhis2Events.length > 0 ? true : false;
+                    if($scope.schedulingPossible && $scope.messagingPossible){
+                        
                     }
-                });                
-                $scope.schedulingPossible = $scope.dhis2Events.length > 0 ? true : false;
+                });
             });
         }
     });

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/scheduling-messaging/scheduling-messaging.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/scheduling-messaging/scheduling-messaging.html	2014-09-05 09:21:39 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/scheduling-messaging/scheduling-messaging.html	2014-09-05 12:52:43 +0000
@@ -9,8 +9,7 @@
             <span ng-if="schedulingPossible">|</span> <a href ng-click="showMessaging()" title="{{'show_hide_messaging'| translate}}">
                 <span class="bold" ng-class="{'text-primary': showMessagingDiv}">{{'messaging'| translate}}</span>
             </a>
-        </span>
-
+        </span>        
         <span class="pull-right">
             <a class="small-horizonal-spacing" href ng-click="expandCollapse(schedulingMessagingWidget)">
                 <span ng-show="schedulingMessagingWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span>
@@ -21,8 +20,31 @@
     </div>
 
     <div ng-show="schedulingMessagingWidget.expand" class="panel-body dashboard-element-container">        
-        <div ng-if="!selectedEnrollment" class="alert alert-warning">{{'not_yet_enrolled_scheduling'| translate}}</div>        
-        <div class="remove-default-padding" ng-if="showSchedulingDiv && schedulingPossible">
+        <div ng-if="!selectedEnrollment" class="alert alert-warning">{{'not_yet_enrolled_scheduling'| translate}}</div>
+        <div ng-if="showSchedulingDiv && schedulingPossible">
+            <div ng-switch="dhis2Events.length">
+                <div ng-switch-when="0" class="alert alert-warning">
+                    {{'no_event_to_schedule'| translate}}
+                </div>
+                <div ng-switch-default>
+                    <table class="table-borderless table-striped">
+                        <tr ng-click="showSchedulingDetails(dhis2Event)" ng-repeat="dhis2Event in dhis2Events">                   
+                            <td>
+                                {{dhis2Event.name}}
+                            </td>
+                            <td>
+                                {{dhis2Event.dueDate}}
+                                <input type="text" placeholder="yyyy-mm-dd" class="form-control" ng-date ng-model="dhis2Event.dueDate"/>
+                            </td>
+                        </tr>
+                    </table>
+                    <div ng-if="showEventSchedulingDiv">
+                        <pre>{{currentEvent}}</pre>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <!--<div class="remove-default-padding" ng-if="showSchedulingDiv && schedulingPossible">
             <div ng-switch="dhis2Events.length">
                 <div ng-switch-when="0" class="alert alert-warning">
                     {{'no_event_to_schedule'| translate}}
@@ -43,7 +65,7 @@
                     </div>
                 </div>
             </div>
-        </div>
+        </div>-->
         <div class="remove-default-padding" ng-if="showMessagingDiv && messagingPossible">            
             <div ng-switch="dhis2Events.length">
                 <div ng-switch-when="0" class="alert alert-warning add-default-padding">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/en.json	2014-09-05 09:21:39 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/en.json	2014-09-05 12:52:43 +0000
@@ -65,10 +65,11 @@
     "delete": "Delete",
     "remove": "Remove",
     "entity": "Entity",
+    "clear": "Clear",
     "add": "Add",
     "add_note": "Add note",
     "search_note": "Search notes",
-    "add_your_note_here": "Add your note here",
+    "add_new_note_here": "Add new note here",
     "skipped": "Skipped",
     "skip": "Skip",
     "unskip": "Schedule back",
@@ -162,6 +163,8 @@
     "list_programs": "List programs",
     "program_stage": "Program stage",
     "due_date": "Due date",
+    "enable_rescheduling": "Enable rescheduling",
+    "disable_rescheduling": "Disable rescheduling",
     "show_hide_scheduling": "Show/hide scheduling form",
     "show_hide_messaging": "Show/hide messaging form",
     "messaging": "Messaging",