This commit helps in the following
authorTeny <teny@zhservices.com>
Wed, 26 Dec 2012 16:28:16 +0000 (26 21:58 +0530)
committerbradymiller <bradymiller@users.sourceforge.net>
Thu, 27 Dec 2012 19:43:08 +0000 (27 11:43 -0800)
1)The javascript error in openemr new patient validation has been corrected.
  The fields marked as 'Required' in layout will be correctly validated both in openemr and patient portal.
2)Now the option to put the provider Id in 'Portal' tab (In Administration -> Globals) has been provided.It will also be displayed during  'Create Offsite Portal Credentials' and 'Reset Offsite Portal Credentials'
Changed the code as mentioned in Git Hub comments.

Signed-off-by: Teny <teny@zhservices.com>
Additional minor change in a English constant by bradymiller.

interface/new/new_comprehensive.php
interface/patient_file/summary/create_portallogin.php
interface/patient_file/summary/demographics.php
library/globals.inc.php
myportal/soap_service/server_side.php

index cd7f069..7bf8270 100644 (file)
@@ -250,7 +250,8 @@ function trimlen(s) {
 }
 
 function validate(f) {
-<?php generate_layout_validation('DEM'); ?>
+  var errMsgs = new Array();
+  <?php generate_layout_validation('DEM'); ?>
   <?php if($GLOBALS['erx_enable']){ ?>
   alertMsg='';
   for(i=0;i<f.length;i++){
@@ -278,6 +279,17 @@ function validate(f) {
     return false;
   }
   <?php } ?>
+  var msg = "";
+  msg += "<?php echo htmlspecialchars(xl('The following fields are required'),ENT_QUOTES); ?>:\n\n";
+  for ( var i = 0; i < errMsgs.length; i++ ) {
+         msg += errMsgs[i] + "\n";
+  }
+  msg += "\n<?php echo htmlspecialchars(xl('Please fill them in before continuing.'),ENT_QUOTES); ?>";
+  if ( errMsgs.length > 0 ) {
+         alert(msg);
+         return false;
+  }
  return true;
 }
 
index 1305509..4140f0f 100644 (file)
@@ -82,7 +82,10 @@ function messageCreate($uname,$pass,$site){
        $offsite_portal_patient_link = $GLOBALS['portal_offsite_address_patient_link'] ?  htmlspecialchars($GLOBALS['portal_offsite_address_patient_link'],ENT_QUOTES) : htmlspecialchars("https://mydocsportal.com",ENT_QUOTES);
         $message .= "<a href='" . $offsite_portal_patient_link . "'>" .
                     $offsite_portal_patient_link . "</a><br><br>";
+       $message .= htmlspecialchars(xl("Provider Id"),ENT_NOQUOTES) . ": " .
+                   htmlspecialchars($GLOBALS['portal_offsite_providerid'],ENT_NOQUOTES) . "<br><br>";              
     }
+    
         $message .= htmlspecialchars(xl("User Name"),ENT_NOQUOTES) . ": " .
                     htmlspecialchars($uname,ENT_NOQUOTES) . "<br><br>" .
                     htmlspecialchars(xl("Password"),ENT_NOQUOTES) . ": " .
@@ -176,6 +179,16 @@ function convertPass(){
         <tr class="text">
             <th colspan="5" align="center"><?php echo htmlspecialchars(xl("Generate Username And Password For")." ".$row['fname'],ENT_QUOTES);?></th>
         </tr>
+       <?php
+               if($portalsite == 'off'){
+       ?>
+        <tr class="text">
+            <td><?php echo htmlspecialchars(xl('Provider Id').':',ENT_QUOTES);?></td>
+            <td><span><?php echo htmlspecialchars($GLOBALS['portal_offsite_providerid'],ENT_QUOTES);?></span></td>
+        </tr>                  
+       <?php           
+               }
+       ?>
         <tr class="text">
             <td><?php echo htmlspecialchars(xl('User Name').':',ENT_QUOTES);?></td>
             <td><input type="text" name="uname" value="<?php if($row['portal_username']) echo htmlspecialchars($row['portal_username'],ENT_QUOTES); else echo htmlspecialchars($row['fname'].$row['id'],ENT_QUOTES);?>" size="10" readonly></td>
index abb2188..ec1395d 100644 (file)
@@ -374,7 +374,7 @@ $(document).ready(function(){
   $(".small_modal").fancybox( {
        'overlayOpacity' : 0.0,
        'showCloseButton' : true,
-       'frameHeight' : 180,
+       'frameHeight' : 200,
        'frameWidth' : 380,
             'centerOnScroll' : false
   });
index 2d22b05..505f24e 100644 (file)
@@ -1367,6 +1367,13 @@ $GLOBALS_METADATA = array(
       xl('Enable Offsite Patient Portal.')
     ),
 
+    'portal_offsite_providerid' => array(
+      xl('Offsite Patient Portal Provider ID'),
+      'text',                           // data type
+      '',
+      xl('Offsite Patient Portal Provider ID(Put Blank If not Registered).')
+    ),    
+
     'portal_offsite_username' => array(
       xl('Offsite Patient Portal Username'),
       'text',                           // data type
index 177854e..5c7f317 100644 (file)
@@ -40,6 +40,7 @@ ob_start();
 
 require_once("../../interface/globals.php");
 require_once(dirname(__FILE__)."/../../controllers/C_Document.class.php");
+require_once(dirname(__FILE__)."/../../library/options.inc.php");
 $err = '';
 if(!extension_loaded("soap")){
   dl("php_soap.dll");
@@ -524,7 +525,14 @@ static  public function batch_despatch($var,$func,$data_credentials){
                $x['ok']='ok';
                return UserService::function_return_to_xml($x);
         }
-       
+       elseif($func=='generate_layout_validation')
+        {
+               $form_id=$var['form_id'];
+               ob_start();
+               generate_layout_validation($form_id);
+               $x = ob_get_clean();
+               return $x;
+        }
        }
        else{
                throw new SoapFault("Server", "credentials failed");
@@ -773,7 +781,7 @@ static  public function batch_despatch($var,$func,$data_credentials){
 
 
   public function getversion($data){
-         return '1.2';
+         return '1.3';
     }