Beispiel #1
0
        if ($field_title === '') {
            $field_title = '(' . $field_id . ')';
        }
        $currvalue = '';
        if (isset($ptrow[$field_id])) {
            $currvalue = $ptrow[$field_id];
        }
        /*****************************************************************
           $newvalue = '';
           if (isset($result['fields'][$reskey])) $newvalue = $result['fields'][$reskey];
           //// Zero-length input means nothing will change.
           // if ($newvalue === '') $newvalue = $currvalue;
           // $newvalue = trim($newvalue);
           $newvalue = cms_field_to_lbf($newvalue, $data_type, $field_id);
           *****************************************************************/
        $newvalue = cms_field_to_lbf($data_type, $reskey, $result['fields']);
        echo " <tr class='detail'>\n";
        echo "  <td class='bold'>" . text($field_title) . "</td>\n";
        echo "  <td>" . generate_display_field($lorow, $currvalue) . "</td>\n";
        echo "  <td>";
        generate_form_field($lorow, $newvalue);
        echo "</td>\n";
        echo " </tr>\n";
    }
}
$field_id = 'cmsportal_login';
if (empty($ptrow[$field_id])) {
    if ($result['post']['user'] !== '') {
        // Registered in portal but still need to record that in openemr.
        echo "</table>\n";
        echo "<input type='hidden' name='form_{$field_id}' value='" . attr($result['post']['user']) . "' />\n";
Beispiel #2
0
     $andor = empty($condition['andor']) ? '' : $condition['andor'];
     if ($condition_str) {
         $condition_str .= ",\n";
     }
     $condition_str .= "{" . "target:'" . addslashes($field_id) . "', " . "id:'" . addslashes($condition['id']) . "', " . "itemid:'" . addslashes($condition['itemid']) . "', " . "operator:'" . addslashes($condition['operator']) . "', " . "value:'" . addslashes($condition['value']) . "', " . "andor:'" . addslashes($andor) . "'}";
 }
 $currvalue = '';
 if ($frow['edit_options'] == 'H') {
     // This data comes from static history
     if (isset($shrow[$field_id])) {
         $currvalue = $shrow[$field_id];
     }
 } else {
     // $currvalue = lbf_current_value($frow, $formid, $is_lbf ? 0 : $encounter);
     if (!$formid && $source == 'F' && $portalres) {
         $currvalue = cms_field_to_lbf($data_type, $field_id, $portalres['fields']);
     }
     if ($currvalue === '') {
         $currvalue = lbf_current_value($frow, $formid, $is_lbf ? 0 : $encounter);
     }
     if ($currvalue === FALSE) {
         continue;
     }
     // column does not exist, should not happen
     // Handle "P" edit option to default to the previous value of a form field.
     if (!$is_lbf && empty($currvalue) && strpos($edit_options, 'P') !== FALSE) {
         if ($source == 'F' && !$formid) {
             // Form attribute for new form, get value from most recent form instance.
             // Form attributes of existing forms are expected to have existing values.
             $tmp = sqlQuery("SELECT encounter, form_id FROM forms WHERE " . "pid = ? AND formdir = ? AND deleted = 0 " . "ORDER BY date DESC LIMIT 1", array($pid, $formname));
             if (!empty($tmp['encounter'])) {