← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21370: Updated the print function

 

------------------------------------------------------------
revno: 21370
committer: jijukjose <jijukjose@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-12-08 13:40:25 +0100
message:
  Updated the print function
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js


--
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-07 20:24:47 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-12-08 12:40:25 +0000
@@ -97,14 +97,22 @@
 
     $scope.model= {};
 
-    $scope.printDiv = function( divName ) {
-        var elements = document.getElementsByClassName(divName);
-        var printContents = elements[3].innerHTML + elements[0].innerHTML + elements[1].innerHTML + elements[2].innerHTML;
-        var popupWin = window.open('', '_blank', 'width=800,height=800');
-        //popupWin.document.open();
-        popupWin.document.write('<html><head><link rel="stylesheet" type="text/css" href="style.css" /></head><body onload="window.print()">' + printContents + '</html>');
+    $scope.print = function(divName){
+        $scope.showProgramReportDetailsDiv = false;
+        var printContents = document.getElementById(divName).innerHTML;
+        var popupWin = window.open('', '_blank', 'fullscreen=1');
+        popupWin.document.open();
+        popupWin.document.write('<html>\n\
+                                     <head>\n\
+                                         <link rel="stylesheet" type="text/css" href="../dhis-web-commons/bootstrap/css/bootstrap.min.css" />\n\
+                                         <link rel="stylesheet" type="text/css" href="../dhis-web-commons/css/print.css" />\n\
+                                         <link rel="stylesheet" type="text/css" href="styles/style.css" />\n\
+                                         <link rel="stylesheet" type="text/css" href="styles/print.css" />\n\
+                                     </head>\n\
+                                     <body onload="window.print()">' + printContents +
+                                '</html>');
         popupWin.document.close();
-    }
+    };
 
 
     var processRuleEffect = function(event){