Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 9.33 KB | None | 0 0
  1. Index: test/org/openmrs/module/formentry/test/PublishInfoPathTest.java
  2. ===================================================================
  3. --- test/org/openmrs/module/formentry/test/PublishInfoPathTest.java (revision 20657)
  4. +++ test/org/openmrs/module/formentry/test/PublishInfoPathTest.java (working copy)
  5. @@ -199,10 +199,16 @@
  6.        
  7.     }
  8.    
  9. +   /**
  10. +    * Requires that the host system know how to compile/publish xsn files.
  11. +    * If on linux, install cabextract and lcab.
  12. +    * @throws Exception
  13. +    */
  14.     @Test
  15. -   public void shouldUpdateXslFile() throws Exception {
  16. -       executeDataSet("org/openmrs/module/formentry/test/include/standardTestDataset.xml");
  17. -       InputStream xslFileInputStream = this.getClass().getClassLoader().getResourceAsStream("org/openmrs/module/formentry/test/include/pre1.4.xsn");
  18. +   public void shouldUpdateXslFileButKeepNamesAsTriplets() throws Exception {
  19. +       executeDataSet("org/openmrs/include/standardTestDataset.xml");
  20. +       executeDataSet("org/openmrs/module/formentry/test/include/extraConcepts.xml");
  21. +       InputStream xslFileInputStream = getClass().getClassLoader().getResourceAsStream("org/openmrs/module/formentry/test/include/pre1.4.xsn");
  22.         Form form = PublishInfoPath.publishXSN(xslFileInputStream);
  23.        
  24.         FormEntryService formEntryService = (FormEntryService)Context.getService(FormEntryService.class);
  25. @@ -214,8 +220,8 @@
  26.         String xslString = OpenmrsUtil.getFileAsString(xsl);
  27.        
  28.         // the concept names should have been inserted into the xsl file
  29. -       assertFalse(xslString.contains("xd:onValue=\"1142^MTCT STAFF^99DCT\""));
  30. -       assertFalse(xslString.contains("\"obs/pay_category/value="1142^MTCT STAFF^99DCT"\""));
  31. +       assertTrue(xslString.contains("xd:onValue=\"1142^MTCT STAFF^99DCT\""));
  32. +       assertTrue(xslString.contains("\"obs/pay_category/value="1142^MTCT STAFF^99DCT"\""));
  33.         tempDir.delete();
  34.     }
  35.  }
  36. Index: test/org/openmrs/module/formentry/test/FormEntryUtilTest.java
  37. ===================================================================
  38. --- test/org/openmrs/module/formentry/test/FormEntryUtilTest.java   (revision 20657)
  39. +++ test/org/openmrs/module/formentry/test/FormEntryUtilTest.java   (working copy)
  40. @@ -9,6 +9,6 @@
  41.    
  42.     @Test
  43.     public void shouldEncodeUtf8() throws Exception {
  44. -       Assert.assertEquals("HEIGHT a\\u00c2a\\u00c2a (CM)^", FormEntryUtil.encodeUTF8String("HEIGHT aÂaÂa (CM)^"));
  45. +       Assert.assertEquals("HEIGHT - \\u00d0 - (CM)^", FormEntryUtil.encodeUTF8String("HEIGHT - Ð - (CM)^"));
  46.     }
  47.  }
  48. Index: web/module/taskpane/concept.jsp
  49. ===================================================================
  50. --- web/module/taskpane/concept.jsp (revision 20657)
  51. +++ web/module/taskpane/concept.jsp (working copy)
  52. @@ -30,29 +30,29 @@
  53.     function miniConcept(n) {
  54.         this.conceptId = "<%= org.openmrs.util.OpenmrsConstants.PROPOSED_CONCEPT_IDENTIFIER %>";
  55.         if (n == null)
  56. -           this.name = $('proposedText').innerHTML;
  57. +           this.name = $j('#proposedText').html();
  58.         else
  59.             this.name = n;
  60.     }
  61.    
  62.     function showProposeConceptForm() {
  63. -       $('searchForm').style.display = "none";
  64. -       $('proposeConceptForm').style.display = "block";
  65. -       txt = $('proposedText');
  66. +       $j('#searchForm').hide();
  67. +       $j('#proposeConceptForm').show();
  68. +       txt = document.getElementById('proposedText');
  69.         txt.value = "";
  70.         insertContent(txt, searchWidget.lastPhraseSearched);
  71.         return false;
  72.     }
  73.    
  74.     function proposeConcept() {
  75. -       var box = $('proposedText');
  76. +       var box = document.getElementById('proposedText');
  77.         if (box.text == '')  {
  78.             alert("Proposed Concept text must be entered");
  79.             box.focus();
  80.         }
  81.         else {
  82. -           $('proposeConceptForm').style.display = "none";
  83. -           $('searchForm').style.display = "";
  84. +           $j('#proposeConceptForm').hide();
  85. +           $j('#searchForm').show();
  86.             DWRConceptService.findProposedConcepts(box.value, preProposedConcepts);
  87.         }
  88.     }
  89. @@ -63,8 +63,8 @@
  90.         }
  91.         else {
  92.             //display a box telling them to pick a preposed concept:
  93. -           $("preProposedAlert").style.display = "block";
  94. -           $('searchForm').style.display = "";
  95. +           $j('#preProposedAlert').show();
  96. +           $j('#searchForm').show();
  97.             searchWidget.doObjectsFound(concepts);
  98.         }
  99.     }
  100. @@ -168,7 +168,7 @@
  101.             function(msg) {
  102.                 <%-- Do not allow proposed concepts if there is 'extra' information --%>
  103.                 <c:if test="${empty param.extraNodePath}">
  104. -                   if ($("preProposedAlert").style.display != "block")
  105. +                   if (document.getElementById("preProposedAlert").style.display != "block")
  106.                         msg.objs.push("<a href='#proposeConcept' onclick='javascript:return showProposeConceptForm();'><spring:message code="ConceptProposal.propose.new"/></a>");
  107.                 </c:if>
  108.             }
  109. Index: web/module/taskpane/user.jsp
  110. ===================================================================
  111. --- web/module/taskpane/user.jsp    (revision 20657)
  112. +++ web/module/taskpane/user.jsp    (working copy)
  113. @@ -7,7 +7,9 @@
  114.         <c:set var="nodePath" value="${param.nodePath}"/>
  115.     </c:when>
  116.     <c:otherwise>
  117. -       alert("You must provide the nodePath query parameter with the node to fill in (e.g. nodePath=//encounter.provider_id)");
  118. +       <script type="text/javascript">
  119. +           alert("You must provide the nodePath query parameter with the node to fill in (e.g. nodePath='//encounter.provider_id)')");
  120. +       </script>
  121.     </c:otherwise>
  122.  </c:choose>
  123.  
  124. Index: web/module/taskpane/taskpaneHeader.jsp
  125. ===================================================================
  126. --- web/module/taskpane/taskpaneHeader.jsp  (revision 20657)
  127. +++ web/module/taskpane/taskpaneHeader.jsp  (working copy)
  128. @@ -10,21 +10,32 @@
  129.     <head>
  130.         <openmrs:htmlInclude file="/openmrs.js" />
  131.         <openmrs:htmlInclude file="/scripts/openmrsmessages.js" /> <%-- appendLocale=true is not on here for backwards compatibility --%>
  132. +
  133.         <openmrs:htmlInclude file="/openmrs.css" />
  134.         <openmrs:htmlInclude file="/style.css" />
  135. -       <c:if test="${empty DO_NOT_INCLUDE_JQUERY}">
  136. -           <openmrs:htmlInclude file="/scripts/jquery/jquery.min.js" />
  137. -           <openmrs:htmlInclude file="/scripts/jquery-ui/js/jquery-ui.custom.min.js" />
  138. -           <openmrs:htmlInclude file="/scripts/jquery-ui/js/jquery-ui-datepicker-i18n.js" />
  139. -           <openmrs:htmlInclude file="/scripts/jquery-ui/css/redmond/jquery-ui.custom.css" />
  140. -       </c:if>
  141. +       <openmrs:htmlInclude file="/moduleResources/formentry/taskpane.css" />
  142. +
  143. +       <openmrs:htmlInclude file="/scripts/jquery/jquery.min.js" />
  144. +       <openmrs:htmlInclude file="/scripts/jquery-ui/js/jquery-ui.custom.min.js" />
  145. +       <openmrs:htmlInclude file="/scripts/jquery-ui/js/jquery-ui-datepicker-i18n.js" />
  146. +       <openmrs:htmlInclude file="/scripts/jquery-ui/css/redmond/jquery-ui.custom.css" />
  147. +       <openmrs:htmlInclude file="/scripts/jquery/dataTables/css/dataTables_jui.css"/>
  148. +       <openmrs:htmlInclude file="/scripts/jquery/dataTables/js/jquery.dataTables.min.js"/>
  149. +       <openmrs:htmlInclude file="/scripts/jquery-ui/js/openmrsSearch.js" />
  150.        
  151. +       <%-- These are imported here because IE doesn't like our import js from js and dwr doesn't get loaded properly --%>
  152. +       <openmrs:htmlInclude file="/scripts/dojoConfig.js" />
  153. +       <openmrs:htmlInclude file="/scripts/dojo/dojo.js" />
  154. +       <openmrs:htmlInclude file="/dwr/engine.js" />
  155. +       <openmrs:htmlInclude file="/dwr/util.js" />
  156. +
  157. +       <openmrs:htmlInclude file="/moduleResources/formentry/taskpane.js" />
  158. +      
  159.         <title><spring:message code="openmrs.title"/></title>
  160.        
  161.         <script type="text/javascript">
  162. -           <c:if test="${empty DO_NOT_INCLUDE_JQUERY}">
  163.             var $j = jQuery.noConflict();
  164. -           </c:if>
  165. +
  166.             /* variable used in js to know the context path */
  167.             var openmrsContextPath = '${pageContext.request.contextPath}';
  168.             var dwrLoadingMessage = '<spring:message code="general.loading" />';
  169. @@ -37,33 +48,30 @@
  170.            
  171.             var handler = function(msg, ex) {
  172.                 if (!pageIsExiting) {
  173. -                   var div = document.getElementById("openmrs_dwr_error");
  174. -                   div.style.display = ""; // show the error div
  175. -                   var msgDiv = document.getElementById("openmrs_dwr_error_msg");
  176. -                   msgDiv.innerHTML = '<spring:message code="error.dwr"/>' + " <b>" + msg + "</b>";
  177. +                   $j("#openmrs_dwr_error_msg").html('<spring:message code="error.dwr"/> <b>' + msg + '</b>');
  178. +                   $j("#openmrs_dwr_error").show();
  179.                 }
  180. -              
  181.             };
  182. +
  183.             dwr.engine.setErrorHandler(handler);
  184.             dwr.engine.setWarningHandler(handler);
  185.         </script>
  186.  
  187. -       <openmrs:htmlInclude file="/moduleResources/formentry/taskpane.css" />
  188. -       <openmrs:htmlInclude file="/moduleResources/formentry/taskpane.js" />
  189. -      
  190. -       <%-- These are imported here because IE doesn't like our import js from js and dwr doesn't get loaded properly --%>
  191. -       <openmrs:htmlInclude file="/scripts/dojoConfig.js" />
  192. -       <openmrs:htmlInclude file="/scripts/dojo/dojo.js" />
  193. -       <openmrs:htmlInclude file="/dwr/engine.js" />
  194. -       <openmrs:htmlInclude file="/dwr/util.js" />
  195. -
  196.         <meta http-equiv="msthemecompatible" content="yes" />
  197.         <meta http-equiv="pragma" content="no-cache" />
  198.         <meta http-equiv="expires" content="-1" />
  199. +
  200.         <%@ include file="keepalive.jsp" %>
  201.  
  202.     </head>
  203.  
  204.  <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  205. +   <div id="openmrs_dwr_error" style="display:none" class="error">
  206. +       <div id="openmrs_dwr_error_msg"></div>
  207. +       <div id="openmrs_dwr_error_close" class="smallMessage">
  208. +           <i><spring:message code="error.dwr.stacktrace"/></i>
  209. +           <a href="#" onclick="this.parentNode.parentNode.style.display='none'"><spring:message code="error.dwr.hide"/></a>
  210. +       </div>
  211. +   </div>
  212.     <div id="pageBody">
  213.         <div id="contentMinimal">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement