← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21400: Modified the print implmentation to use the scope variables

 

------------------------------------------------------------
revno: 21400
committer: jijukjose <jijukjose@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-12-10 11:59:55 +0100
message:
  Modified the print implmentation to use the scope variables
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/profile/profile.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css


--
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	2015-12-09 14:58:14 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-12-10 10:59:55 +0000
@@ -99,8 +99,7 @@
 
     $scope.print = function(divName){
         $scope.showProgramReportDetailsDiv = false;
-        var elements =  document.getElementsByClassName(divName);
-        var printContents =  elements[1].innerHTML + elements[0].innerHTML;
+        var printContents =  document.getElementById(divName).innerHTML;
         var popupWin = window.open('', '_blank', 'fullscreen=1');
         popupWin.document.open();
         popupWin.document.write('<html>\n\

=== 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	2015-12-09 15:02:11 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2015-12-10 10:59:55 +0000
@@ -1,32 +1,7 @@
-<div class="panel panel-info print-section" ng-controller="DataEntryController">
-
-    <table class="table-borderless table-striped not-for-screen">
-        <tr class="col-md-12">
-            <td class="col-md-6">
-                {{'enrolling_orgunit' | translate}}
-            </td>
-            <td class="col-md-6">
-                <input type="text" class="form-control" value={{selectedEnrollment.orgUnitName}} ng-disabled="true"/>
-            </td>
-        </tr>
-        <tr class="col-md-12">
-            <td class="col-md-6">
-                {{selectedProgram.enrollmentDateLabel}}
-            </td>
-            <td class="col-md-6">
-                <input type="text" value={{selectedEnrollment.enrollmentDate}} ng-disabled="true"/>
-            </td>
-        </tr>
-        <tr class="col-md-12" ng-if="selectedProgram.displayIncidentDate">
-            <td class="col-md-6">
-                {{selectedProgram.incidentDateLabel}}
-            </td>
-            <td class="col-md-6">
-                <input type="text" value={{selectedEnrollment.incidentDate}} ng-disabled="true"/>
-            </td>
-        </tr>
-    </table>
-
+<div id="print-div" class="panel panel-info" ng-controller="DataEntryController">
+
+    <div ng-include="'components/dataentry/dataentry-print.html'">
+    </div>
     <div class="panel-heading handle bold">
         {{dataentryWidget.title| translate}}        
         <span class="pull-right widget-link">
@@ -211,7 +186,7 @@
                     <a href ng-click="deleteEvent()" 
                        ng-disabled="currentEvent.enrollmentStatus === 'COMPLETED' || currentEvent.editingNotAllowed || currentEvent.orgUnit !== selectedOrgUnit.id"
                        class="btn btn-danger">{{'delete'| translate}}</a>
-                    <a href class="btn btn-primary" ng-click="print('print-section');">{{'print_form'| translate}}</a>
+                    <a href class="btn btn-primary" ng-click="print('print-div');">{{'print_form'| translate}}</a>
                 </div>
                 <!-- data entry/event buttons ends -->
 

=== 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	2015-12-09 14:58:14 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2015-12-10 10:59:55 +0000
@@ -1,4 +1,4 @@
-<div class="panel panel-info print-section" 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-if="!enrollmentEditing && !selectedTei.inactive">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-12-09 14:58:14 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-12-10 10:59:55 +0000
@@ -16,10 +16,6 @@
     }
 }
 
-.print-section {
-    display: block;
-}
-
 h1 {    
     font-size: 1.8em;
 }