3 * Script for the globals editor.
5 * Copyright (C) 2010 Rod Roark <rod@sunsetsystems.com>
6 * Copyright (C) 2016 Brady Miller <brady@sparmy.com>
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @author Rod Roark <rod@sunsetsystems.com>
21 * @author Brady Miller <brady@sparmy.com>
22 * @link http://www.open-emr.org
25 $fake_register_globals=false;
26 $sanitize_all_escapes=true;
28 require_once("../globals.php");
29 require_once("../../custom/code_types.inc.php");
30 require_once("$srcdir/acl.inc");
31 require_once("$srcdir/globals.inc.php");
32 require_once("$srcdir/user.inc");
33 require_once(dirname(__FILE__
)."/../../myportal/soap_service/portal_connectivity.php");
35 $userMode = (array_key_exists('mode', $_GET) && $_GET['mode'] == 'user');
38 // Check authorization.
39 $thisauth = acl_check('admin', 'super');
40 if (!$thisauth) die(xlt('Not authorized'));
43 function checkCreateCDB(){
44 $globalsres = sqlStatement("SELECT gl_name, gl_index, gl_value FROM globals WHERE gl_name IN
45 ('couchdb_host','couchdb_user','couchdb_pass','couchdb_port','couchdb_dbase','document_storage_method')");
47 while($globalsrow = sqlFetchArray($globalsres)){
48 $GLOBALS[$globalsrow['gl_name']] = $globalsrow['gl_value'];
50 $directory_created = false;
51 if( !empty($GLOBALS['document_storage_method']) ) {
52 // /documents/temp/ folder is required for CouchDB
53 if(!is_dir($GLOBALS['OE_SITE_DIR'] . '/documents/temp/')){
54 $directory_created = mkdir($GLOBALS['OE_SITE_DIR'] . '/documents/temp/',0777,true);
55 if(!$directory_created){
56 echo htmlspecialchars( xl("Failed to create temporary folder. CouchDB will not work."),ENT_NOQUOTES
);
59 $couch = new CouchDB();
60 if(!$couch->check_connection()) {
61 echo "<script type='text/javascript'>alert('".addslashes(xl("CouchDB Connection Failed."))."');</script>";
64 if($GLOBALS['couchdb_host'] ||
$GLOBALS['couchdb_port'] ||
$GLOBALS['couchdb_dbase']){
65 $couch->createDB($GLOBALS['couchdb_dbase']);
66 $couch->createView($GLOBALS['couchdb_dbase']);
73 * Update background_services table for a specific service following globals save.
76 function updateBackgroundService($name,$active,$interval) {
77 //order important here: next_run change dependent on _old_ value of execute_interval so it comes first
78 $sql = 'UPDATE background_services SET active=?, '
79 . 'next_run = next_run + INTERVAL (? - execute_interval) MINUTE, execute_interval=? WHERE name=?';
80 return sqlStatement($sql,array($active,$interval,$interval,$name));
84 * Make any necessary changes to background_services table when globals are saved.
85 * To prevent an unexpected service call during startup or shutdown, follow these rules:
86 * 1. Any "startup" operations should occur _before_ the updateBackgroundService() call.
87 * 2. Any "shutdown" operations should occur _after_ the updateBackgroundService() call. If these operations
88 * would cause errors in a running service call, it would be best to make the shutdown function itself
89 * a background service that is activated here, does nothing if active=1 or running=1 for the
90 * parent service, then deactivates itself by setting active=0 when it is done shutting the parent service
91 * down. This will prevent nonresponsiveness to the user by waiting for a service to finish.
92 * 3. If any "previous" values for globals are required for startup/shutdown logic, they need to be
93 * copied to a temp variable before the while($globalsrow...) loop.
96 function checkBackgroundServices(){
97 //load up any necessary globals
98 $bgservices = sqlStatement("SELECT gl_name, gl_index, gl_value FROM globals WHERE gl_name IN
99 ('phimail_enable','phimail_interval')");
100 while($globalsrow = sqlFetchArray($bgservices)){
101 $GLOBALS[$globalsrow['gl_name']] = $globalsrow['gl_value'];
104 //Set up phimail service
105 $phimail_active = empty($GLOBALS['phimail_enable']) ?
'0' : '1';
106 $phimail_interval = max(0, (int) $GLOBALS['phimail_interval']);
107 updateBackgroundService('phimail', $phimail_active, $phimail_interval);
118 // If we are saving user_specific globals.
120 if (array_key_exists('form_save', $_POST) && $_POST['form_save'] && $userMode) {
122 foreach ($GLOBALS_METADATA as $grpname => $grparr) {
123 if (in_array($grpname, $USER_SPECIFIC_TABS)) {
124 foreach ($grparr as $fldid => $fldarr) {
125 if (in_array($fldid, $USER_SPECIFIC_GLOBALS)) {
126 list($fldname, $fldtype, $flddef, $flddesc) = $fldarr;
127 $label = "global:".$fldid;
128 $fldvalue = trim($_POST["form_$i"]);
129 setUserSetting($label,$fldvalue,$_SESSION['authId'],FALSE);
130 if ( $_POST["toggle_$i"] == "YES" ) {
131 removeUserSetting($label);
138 echo "<script type='text/javascript'>";
139 echo "if (parent.left_nav.location) {";
140 echo " parent.left_nav.location.reload();";
141 echo " parent.Title.location.reload();";
142 echo " if(self.name=='RTop'){";
143 echo " parent.RBot.location.reload();";
145 echo " parent.RTop.location.reload();";
148 echo "self.location.href='edit_globals.php?mode=user&unique=yes';";
152 if (array_key_exists('form_download', $_POST) && $_POST['form_download']) {
153 $client = portal_connection();
155 $response = $client->getPortalConnectionFiles($credentials);
158 error_log('SoapFault Error');
159 error_log(var_dump(get_object_vars($e)));
162 error_log('Exception Error');
163 error_log(var_dump(get_object_vars($e)));
165 if(array_key_exists('status', $response) && $response['status'] == "1") {//WEBSERVICE RETURNED VALUE SUCCESSFULLY
166 $tmpfilename = realpath(sys_get_temp_dir())."/".date('YmdHis').".zip";
167 $fp = fopen($tmpfilename,"wb");
168 fwrite($fp,base64_decode($response['value']));
170 $practice_filename = $response['file_name'];//practicename.zip
173 header("Cache-Control: public");
174 header("Content-Description: File Transfer");
175 header("Content-Disposition: attachment; filename=".$practice_filename);
176 header("Content-Type: application/zip");
177 header("Content-Transfer-Encoding: binary");
178 // Read the file from disk
179 readfile($tmpfilename);
180 unlink($tmpfilename);
183 else{//WEBSERVICE CALL FAILED AND RETURNED AN ERROR MESSAGE
186 <script type
="text/javascript">
187 alert('<?php echo xls('Offsite Portal web Service Failed
').":\\n".text($response['value
']);?>');
197 // If we are saving main globals.
199 if (array_key_exists('form_save', $_POST) && $_POST['form_save'] && !$userMode) {
200 $force_off_enable_auditlog_encryption = true;
201 // Need to force enable_auditlog_encryption off if the php mycrypt module
203 if (extension_loaded('mcrypt')) {
204 $force_off_enable_auditlog_encryption = false;
207 // Aug 22, 2014: Ensoftek: For Auditable events and tamper-resistance (MU2)
208 // Check the current status of Audit Logging
209 $auditLogStatusFieldOld = $GLOBALS['enable_auditlog'];
212 * Compare form values with old database values.
213 * Only save if values differ. Improves speed.
216 // Get all the globals from DB
217 $old_globals = sqlGetAssoc( 'SELECT gl_name, gl_index, gl_value FROM `globals` ORDER BY gl_name, gl_index',false,true );
220 foreach ($GLOBALS_METADATA as $grpname => $grparr) {
221 foreach ($grparr as $fldid => $fldarr) {
222 list($fldname, $fldtype, $flddef, $flddesc) = $fldarr;
223 if($fldtype == 'pwd'){
224 $pass = sqlQuery("SELECT gl_value FROM globals WHERE gl_name = ?", array($fldid) );
225 $fldvalueold = $pass['gl_value'];
228 /* Multiple choice fields - do not compare , overwrite */
229 if (!is_array($fldtype) && substr($fldtype, 0, 2) == 'm_') {
230 if (isset($_POST["form_$i"])) {
233 sqlStatement("DELETE FROM globals WHERE gl_name = ?", array( $fldid ) );
235 foreach ($_POST["form_$i"] as $fldvalue) {
236 $fldvalue = trim($fldvalue);
237 sqlStatement('INSERT INTO `globals` ( gl_name, gl_index, gl_value ) VALUES ( ?,?,?)', array( $fldid, $fldindex, $fldvalue ) );
243 /* check value of single field. Don't update if the database holds the same value */
244 if (isset($_POST["form_$i"])) {
245 $fldvalue = trim($_POST["form_$i"]);
250 if($fldtype=='pwd') $fldvalue = $fldvalue ?
SHA1($fldvalue) : $fldvalueold; // TODO: salted passwords?
252 // We rely on the fact that set of keys in globals.inc === set of keys in `globals` table!
255 !isset( $old_globals[$fldid]) // if the key not found in database - update database
257 ( isset($old_globals[$fldid]) && $old_globals[ $fldid ]['gl_value'] !== $fldvalue ) // if the value in database is different
259 // Need to force enable_auditlog_encryption off if the php mcrypt module
261 if ( $force_off_enable_auditlog_encryption && ($fldid == "enable_auditlog_encryption") ) {
262 error_log("OPENEMR ERROR: UNABLE to support auditlog encryption since the php mcrypt module is not installed",0);
265 // special treatment for some vars
267 case 'first_day_week':
268 // update PostCalendar config as well
269 sqlStatement("UPDATE openemr_module_vars SET pn_value = ? WHERE pn_name = 'pcFirstDayOfWeek'", array($fldvalue));
272 // Replace old values
273 sqlStatement( 'DELETE FROM `globals` WHERE gl_name = ?', array( $fldid ) );
274 sqlStatement( 'INSERT INTO `globals` ( gl_name, gl_index, gl_value ) VALUES ( ?, ?, ? )', array( $fldid, 0, $fldvalue ) );
276 //error_log("No need to update $fldid");
283 checkBackgroundServices();
285 // July 1, 2014: Ensoftek: For Auditable events and tamper-resistance (MU2)
286 // If Audit Logging status has changed, log it.
287 $auditLogStatusNew = sqlQuery("SELECT gl_value FROM globals WHERE gl_name = 'enable_auditlog'");
288 $auditLogStatusFieldNew = $auditLogStatusNew['gl_value'];
289 if ( $auditLogStatusFieldOld != $auditLogStatusFieldNew )
291 auditSQLAuditTamper($auditLogStatusFieldNew);
293 echo "<script type='text/javascript'>";
294 echo "if (parent.left_nav.location) {";
295 echo " parent.left_nav.location.reload();";
296 echo " parent.Title.location.reload();";
297 echo " if(self.name=='RTop'){";
298 echo " parent.RBot.location.reload();";
300 echo " parent.RTop.location.reload();";
303 echo "self.location.href='edit_globals.php?unique=yes';";
308 <!-- supporting javascript code
-->
309 <script type
="text/javascript" src
="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
310 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-3-2/index.js"></script
>
311 <script type
="text/javascript" src
="../../library/js/common.js"></script
>
312 <script type
="text/javascript" src
="../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
313 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jscolor-1-4-5/jscolor.js"></script
>
314 <link rel
="stylesheet" type
="text/css" href
="../../library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
316 <link rel
="stylesheet" href
='<?php echo $css_header ?>' type
='text/css'>
317 <?php
if ($userMode) { ?
>
318 <title
><?php
echo xlt('User Settings'); ?
></title
>
320 <title
><?php
echo xlt('Global Settings'); ?
></title
>
324 tr
.head
{ font
-size
:10pt
; background
-color
:#cccccc; text-align:center; }
325 tr
.detail
{ font
-size
:10pt
; }
326 td
{ font
-size
:10pt
; }
327 input
{ font
-size
:10pt
; }
329 <script type
="text/javascript">
330 function validate_file(){
333 url
: "<?php echo $GLOBALS['webroot']?>/library/ajax/offsite_portal_ajax.php",
335 action
: 'check_file',
338 success
: function( message
)
341 document
.getElementById('form_download').value
= 1;
342 document
.getElementById('file_error_message').innerHTML
= '';
343 document
.forms
[0].submit();
346 document
.getElementById('form_download').value
= 0;
347 document
.getElementById('file_error_message').innerHTML
= message
;
356 <body
class="body_top">
358 <?php
if ($userMode) { ?
>
359 <form method
='post' name
='theform' id
='theform' action
='edit_globals.php?mode=user' onsubmit
='return top.restoreSession()'>
361 <form method
='post' name
='theform' id
='theform' action
='edit_globals.php' onsubmit
='return top.restoreSession()'>
364 <?php
if ($userMode) { ?
>
365 <p
><b
><?php
echo xlt('Edit User Settings'); ?
></b
>
367 <p
><b
><?php
echo xlt('Edit Global Settings'); ?
></b
>
370 <?php
// mdsupport - Optional server based searching mechanism for large number of fields on this screen. ?>
371 <span style
='float: right;'>
372 <input name
='srch_desc' size
='20'
373 value
='<?php echo (!empty($_POST['srch_desc
']) ? htmlspecialchars($_POST['srch_desc
']) : '') ?>' />
374 <input type
='submit' name
='form_search' value
='<?php echo xla('Search
'); ?>' />
380 foreach ($GLOBALS_METADATA as $grpname => $grparr) {
381 if ( !$userMode ||
in_array($grpname, $USER_SPECIFIC_TABS) ) {
382 echo " <li" . ($i ?
"" : " class='current'") .
384 xlt($grpname) . "</a></li>\n";
391 <div
class="tabContainer">
394 foreach ($GLOBALS_METADATA as $grpname => $grparr) {
395 if ( !$userMode ||
in_array($grpname, $USER_SPECIFIC_TABS) ) {
396 echo " <div class='tab" . ($i ?
"" : " current") .
397 "' style='height:auto;width:97%;'>\n";
403 echo "<th> </th>";
404 echo "<th>" . htmlspecialchars( xl('User Specific Setting'), ENT_NOQUOTES
) . "</th>";
405 echo "<th>" . htmlspecialchars( xl('Default Setting'), ENT_NOQUOTES
) . "</th>";
406 echo "<th> </th>";
407 echo "<th>" . htmlspecialchars( xl('Set to Default'), ENT_NOQUOTES
) . "</th>";
411 foreach ($grparr as $fldid => $fldarr) {
412 if ( !$userMode ||
in_array($fldid, $USER_SPECIFIC_GLOBALS) ) {
413 list($fldname, $fldtype, $flddef, $flddesc) = $fldarr;
414 // mdsupport - Check for matches
416 if (!empty($_POST['srch_desc']) && (stristr(($fldname.$flddesc), $_POST['srch_desc']) !== FALSE)) {
417 $srch_cl = 'class="srch"';
420 // Most parameters will have a single value, but some will be arrays.
421 // Here we cater to both possibilities.
422 $glres = sqlStatement("SELECT gl_index, gl_value FROM globals WHERE " .
423 "gl_name = ? ORDER BY gl_index", array($fldid));
425 while ($glrow = sqlFetchArray($glres)) $glarr[] = $glrow;
427 // $fldvalue is meaningful only for the single-value cases.
428 $fldvalue = count($glarr) ?
$glarr[0]['gl_value'] : $flddef;
430 // Collect user specific setting if mode set to user
432 $settingDefault = "checked='checked'";
434 $userSettingArray = sqlQuery("SELECT * FROM user_settings WHERE setting_user=? AND setting_label=?",array($_SESSION['authId'],"global:".$fldid));
435 $userSetting = $userSettingArray['setting_value'];
436 $globalValue = $fldvalue;
437 if (!empty($userSettingArray)) {
438 $fldvalue = $userSetting;
439 $settingDefault = "";
443 echo " <tr $srch_cl title='" . attr($flddesc) . "'><td valign='top'><b>" . text($fldname) . "</b></td><td valign='top'>\n";
445 if (is_array($fldtype)) {
446 echo " <select name='form_$i' id='form_$i'>\n";
447 foreach ($fldtype as $key => $value) {
449 if ($globalValue == $key) $globalTitle = $value;
451 echo " <option value='" . attr($key) . "'";
453 //Casting value to string so the comparison will be always the same type and the only thing that will check is the value
454 //Tried to use === but it will fail in already existing variables
455 if ((string)$key == (string)$fldvalue) echo " selected";
463 else if ($fldtype == 'bool') {
465 if ($globalValue == 1) {
466 $globalTitle = htmlspecialchars( xl('Checked'), ENT_NOQUOTES
);
469 $globalTitle = htmlspecialchars( xl('Not Checked'), ENT_NOQUOTES
);
472 echo " <input type='checkbox' name='form_$i' id='form_$i' value='1'";
473 if ($fldvalue) echo " checked";
477 else if ($fldtype == 'num') {
479 $globalTitle = $globalValue;
481 echo " <input type='text' name='form_$i' id='form_$i' " .
482 "size='6' maxlength='15' value='" . attr($fldvalue) . "' />\n";
485 else if ($fldtype == 'text') {
487 $globalTitle = $globalValue;
489 echo " <input type='text' name='form_$i' id='form_$i' " .
490 "size='50' maxlength='255' value='" . attr($fldvalue) . "' />\n";
492 else if ($fldtype == 'pwd') {
494 $globalTitle = $globalValue;
496 echo " <input type='password' name='form_$i' " .
497 "size='50' maxlength='255' value='' />\n";
500 else if ($fldtype == 'pass') {
502 $globalTitle = $globalValue;
504 echo " <input type='password' name='form_$i' " .
505 "size='50' maxlength='255' value='" . attr($fldvalue) . "' />\n";
508 else if ($fldtype == 'lang') {
509 $res = sqlStatement("SELECT * FROM lang_languages ORDER BY lang_description");
510 echo " <select name='form_$i' id='form_$i'>\n";
511 while ($row = sqlFetchArray($res)) {
512 echo " <option value='" . attr($row['lang_description']) . "'";
513 if ($row['lang_description'] == $fldvalue) echo " selected";
515 echo xlt($row['lang_description']);
521 else if ($fldtype == 'all_code_types') {
523 echo " <select name='form_$i' id='form_$i'>\n";
524 foreach (array_keys($code_types) as $code_key ) {
525 echo " <option value='" . attr($code_key) . "'";
526 if ($code_key == $fldvalue) echo " selected";
528 echo xlt($code_types[$code_key]['label']);
534 else if ($fldtype == 'm_lang') {
535 $res = sqlStatement("SELECT * FROM lang_languages ORDER BY lang_description");
536 echo " <select multiple name='form_{$i}[]' id='form_{$i}[]' size='3'>\n";
537 while ($row = sqlFetchArray($res)) {
538 echo " <option value='" . attr($row['lang_description']) . "'";
539 foreach ($glarr as $glrow) {
540 if ($glrow['gl_value'] == $row['lang_description']) {
546 echo xlt($row['lang_description']);
552 else if ($fldtype == 'color_code') {
554 $globalTitle = $globalValue;
556 echo " <input type='text' class='color {hash:true}' name='form_$i' id='form_$i' " .
557 "size='6' maxlength='15' value='" . attr($fldvalue) . "' />" .
558 "<input type='button' value='Default' onclick=\"document.forms[0].form_$i.color.fromString('" . attr($flddef) . "')\">\n";
561 else if ($fldtype == 'css') {
563 $globalTitle = $globalValue;
565 $themedir = "$webserver_root/interface/themes";
566 $dh = opendir($themedir);
568 echo " <select name='form_$i' id='form_$i'>\n";
569 while (false !== ($tfname = readdir($dh))) {
570 // Only show files that contain style_ as options
571 // Skip style_blue.css since this is used for
572 // lone scripts such as setup.php
573 // Also skip style_pdf.css which is for PDFs and not screen output
574 if (!preg_match("/^style_.*\.css$/", $tfname) ||
575 $tfname == 'style_blue.css' ||
$tfname == 'style_pdf.css')
577 echo "<option value='" . attr($tfname) . "'";
578 // Drop the "style_" part and any replace any underscores with spaces
579 $styleDisplayName = str_replace("_", " ", substr($tfname, 6));
580 // Strip the ".css" and uppercase the first character
581 $styleDisplayName = ucfirst(str_replace(".css", "", $styleDisplayName));
582 if ($tfname == $fldvalue) echo " selected";
584 echo text($styleDisplayName);
592 else if ($fldtype == 'tabs_css') {
594 $globalTitle = $globalValue;
596 $themedir = "$webserver_root/interface/themes";
597 $dh = opendir($themedir);
599 echo " <select name='form_$i' id='form_$i'>\n";
600 while (false !== ($tfname = readdir($dh))) {
601 // Only show files that contain tabs_style_ as options
602 if (!preg_match("/^tabs_style_.*\.css$/", $tfname)) continue;
603 echo "<option value='" . attr($tfname) . "'";
604 // Drop the "tabs_style_" part and any replace any underscores with spaces
605 $styleDisplayName = str_replace("_", " ", substr($tfname, 11));
606 // Strip the ".css" and uppercase the first character
607 $styleDisplayName = ucfirst(str_replace(".css", "", $styleDisplayName));
608 if ($tfname == $fldvalue) echo " selected";
610 echo text($styleDisplayName);
618 else if ($fldtype == 'hour') {
620 $globalTitle = $globalValue;
622 echo " <select name='form_$i' id='form_$i'>\n";
623 for ($h = 0; $h < 24; ++
$h) {
624 echo "<option value='$h'";
625 if ($h == $fldvalue) echo " selected";
627 if ($h == 0) echo "12 AM";
628 else if ($h < 12) echo "$h AM";
629 else if ($h == 12) echo "12 PM";
630 else echo ($h - 12) . " PM";
637 echo "<td align='center' style='color:red;'>" . attr($globalTitle) . "</td>\n";
638 echo "<td> </td>";
639 echo "<td align='center'><input type='checkbox' value='YES' name='toggle_" . $i . "' id='toggle_" . $i . "' " . attr($settingDefault) . "/></td>\n";
640 echo "<input type='hidden' id='globaldefault_" . $i . "' value='" . attr($globalValue) . "'>\n";
644 echo " </td></tr>\n";
648 if( trim(strtolower($fldid)) == 'portal_offsite_address_patient_link' && !empty($GLOBALS['portal_offsite_enable']) && !empty($GLOBALS['portal_offsite_providerid']) ){
649 echo "<input type='hidden' name='form_download' id='form_download'>";
650 echo "<tr><td><input onclick=\"return validate_file()\" type='button' value='".xla('Download Offsite Portal Connection Files')."' /></td><td id='file_error_message' style='color:red'></td></tr>";
661 <input type
='submit' name
='form_save' value
='<?php echo xla('Save
'); ?>' />
669 <script language
="JavaScript">
671 $
(document
).ready(function(){
675 <?php
// mdsupport - Highlight search results ?>
676 $
('.srch td').wrapInner("<mark></mark>");
677 $
('.tab > table').find('tr.srch:first').each(function() {
678 var srch_div
= $
(this
).closest('div').prevAll().length +
1;
679 $
('.tabNav > li:nth-child('+srch_div+
') a').wrapInner("<mark></mark>");
681 // Use the counter ($i) to make the form user friendly for user-specific globals use
682 <?php
if ($userMode) { ?
>
683 <?php
for ($j = 0; $j <= $i; $j++
) { ?
>
684 $
("#form_<?php echo $j ?>").change(function() {
685 $
("#toggle_<?php echo $j ?>").attr('checked',false);
687 $
("#toggle_<?php echo $j ?>").change(function() {
688 if ($
('#toggle_<?php echo $j ?>').attr('checked')) {
689 var defaultGlobal
= $
("#globaldefault_<?php echo $j ?>").val();
690 $
("#form_<?php echo $j ?>").val(defaultGlobal
);