Small improvement of code for some variable.
[openemr.git] / interface / globals.php
blob53a1f02cb3f58252d3b3447492f0ddf74f4b8bde
1 <?
2 require_once(dirname(__FILE__) . "/../includes/config.php");
3 // Global variable file in which colors and paths are set for the interface.
4 ///////////////////////////////////////////////////////////////////
5 // THESE VALUES MUST BE SET BEFORE OPENEMR WILL FUNCTION:
6 ///////////////////////////////////////////////////////////////////
7 // Set this to the full absolute directory path for openemr:
8 $webserver_root = "/mnt/htdocs/openemr";
10 // Set this to the relative html path, ie. what you would type into the web
11 // browser after the server address to get to OpenEMR. For example, if you
12 // type "http://127.0.0.1/clinic/openemr/" to load OpenEMR, set $web_root
13 // to "/clinic/openemr" without the trailing slash.
14 $web_root = "/openemr";
16 ///////////////////////////////////////////////////////////////////
18 // This is the return mail address used when sending prescriptions by email:
19 $GLOBALS['practice_return_email_path'] = "prescription_mail@example.com";
21 // Root directory, relative to the webserver root:
22 $GLOBALS['rootdir'] = "$web_root/interface";
23 // Absolute path to the source code include and headers file directory (Full path):
24 $GLOBALS['srcdir'] = "$webserver_root/library";
25 // Absolute path to the location of documentroot directory for use with include statements:
26 $GLOBALS['fileroot'] = "$webserver_root";
27 // Absolute path to the location of interface directory for use with include statements:
28 $include_root = "$webserver_root/interface";
29 // Absolute path to the location of documentroot directory for use with include statements:
30 $GLOBALS['webroot'] = $web_root;
32 $GLOBALS['template_dir'] = $GLOBALS['fileroot'] . "/templates/";
33 $GLOBALS['incdir'] = $include_root;
34 // Location of the login screen file
35 $GLOBALS['login_screen'] = "$rootdir/login_screen.php";
37 // Language Control Section (will add toggling)
38 // English:1, Swedish:2, Spanish:3, German:4, Dutch:5, Hebrew:6
39 define ('LANGUAGE',1);
40 include_once (dirname(__FILE__) . "/../library/translation.inc.php");
42 include_once (dirname(__FILE__) . "/../library/date_functions.php");
44 // Default category for find_patient screen
45 $GLOBALS['default_category'] = 5;
46 $GLOBALS['default_event_title'] = 'Office Visit';
48 // The session name appears in cookies stored in the browser. If you have
49 // multiple OpenEMR installations running on the same server, you should
50 // customize this name so they cannot interfere with each other.
51 session_name("OpenEMR");
53 session_start();
55 // Set this to true to activate support for the new frame layout.
57 $GLOBALS['concurrent_layout'] = true;
59 // Theme definition:
60 if ($GLOBALS['concurrent_layout']) {
61 $top_bg_line = ' bgcolor="#dddddd" ';
62 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
63 $bottom_bg_line = $top_bg_line;
64 $title_bg_line = ' bgcolor="#bbbbbb" ';
65 $nav_bg_line = ' bgcolor="#94d6e7" ';
66 } else {
67 $top_bg_line = ' bgcolor="#94d6e7" ';
68 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
69 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
70 $title_bg_line = ' bgcolor="#aaffff" ';
71 $nav_bg_line = ' bgcolor="#94d6e7" ';
73 $login_filler_line = ' bgcolor="#f7f0d5" ';
74 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
75 $css_header = "$rootdir/themes/style_sky_blue.css";
76 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
77 $linepic = "$rootdir/pic/repeat_vline9.gif";
78 $table_bg = ' bgcolor="#cccccc" ';
79 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
80 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
81 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
82 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
84 // The height in pixels of the Logo bar at the top of the login page:
85 $GLOBALS['logoBarHeight'] = 110;
86 // The height in pixels of the Navigation bar:
87 $GLOBALS['navBarHeight'] = 22;
88 // The height in pixels of the Title bar:
89 $GLOBALS['titleBarHeight'] = 20;
91 // The assistant word, MORE printed next to titles that can be clicked:
92 $tmore = "(More)";
93 // The assistant word, BACK printed next to titles that return to previous screens:
94 $tback = "(Back)";
96 // This is the idle logout function:
97 // if a page has not been refreshed within this many seconds, the interface
98 // will return to the login page
99 if (!empty($special_timeout)) {
100 $timeout = intval($special_timeout);
102 else {
103 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
104 $timeout = 7200;
107 //Version tags
109 $v_major = '2';
110 $v_minor = '8';
111 $v_patch = '3';
112 $tag = '-dev'; // release candidate, e.g. '-rc1'
114 // This name appears on the login page and in the title bar of most windows.
115 // It's nice to customize this to be the name of your clinic.
116 $openemr_name = 'OpenEMR';
118 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
120 $rootdir = $GLOBALS['rootdir'];
121 $srcdir = $GLOBALS['srcdir'];
122 $login_screen = $GLOBALS['login_screen'];
123 $GLOBALS['css_header'] = $css_header;
124 $GLOBALS['backpic'] = $backpic;
125 $GLOBALS['rootdir'] = $rootdir;
127 // change these to reflect when the daily view should start to display times
128 // as well as it should end. ex schedule_start = 9 schedule_end = 17
129 // start end times in hours
130 $GLOBALS['schedule_start'] = 8;
131 $GLOBALS['schedule_end'] = 17;
133 // This is the time granularity of the calendar and the smallest interval
134 // in minutes for an appointment slot:
135 $GLOBALS['calendar_interval'] = 15;
137 // Include the authentication module code here, but the rule is
138 // if the file has the word "login" in the source code file name,
139 // don't include the authentication module - we do this to avoid
140 // include loops.
141 if ((isset ($ignoreAuth)) && (!$ignoreAuth)) {
142 include_once("$srcdir/auth.inc");
145 // If you do not want your accounting system to have a customer added to it
146 // for each insurance company, then set this to true. SQL-Ledger currently
147 // (2005-03-21) does nothing useful with insurance companies as customers.
148 $GLOBALS['insurance_companies_are_not_customers'] = true;
150 // If OpenEMR is being used by an athletic team rather than in a traditional
151 // clinical setting, set this to true.
152 $GLOBALS['athletic_team'] = false;
154 // True if this is a weight loss clinic:
155 $GLOBALS['weight_loss_clinic'] = false;
157 // The telephone country code of this installation. 1 = USA.
158 // See http://www.wtng.info/ for a list.
159 $GLOBALS['phone_country_code'] = '1';
161 // This determines how appointments display on the calendar:
162 // 1 = lastname; 2 = last,first; 3 = last,first(title);
163 // 4 = last,first(title: description)
164 $GLOBALS['calendar_appt_style'] = 2;
166 // Make this true if you want providers to see all appointments by default
167 // and not just their own.
168 $GLOBALS['docs_see_entire_calendar'] = false;
170 // Set this to true if you want the drug database and support for in-house
171 // prescription dispensing.
172 $GLOBALS['inhouse_pharmacy'] = false;
174 // True to omit insurance and some other things from the demographics form:
175 $GLOBALS['simplified_demographics'] = false;
177 // True to omit form, route and interval which then become part of dosage:
178 $GLOBALS['simplified_prescriptions'] = false;
180 // True to omit method of payment from the copay panel:
181 $GLOBALS['simplified_copay'] = false;
183 // You may put text here as the default complaint in the New Patient form:
184 $GLOBALS['default_chief_complaint'] = '';
186 // This was added for sports teams needing to fill out injury forms, but might
187 // have other applications.
188 $GLOBALS['default_new_encounter_form'] = '';
190 // If you want a new encounter to be automatically created when appointment
191 // status is set to "@" (arrived), then make this true.
192 $GLOBALS['auto_create_new_encounters'] = true;
194 // If you don't want employer information, country, title in patient demographics.
195 $GLOBALS['omit_employers'] = false;
197 // You can set this to the category name of a document to link to from the
198 // patient summary page. Normally this is the category for insurance cards.
199 // This lets you click on the patient's name to see their ID card.
200 $GLOBALS['patient_id_category_name'] = '';
202 // If you want Hylafax support then uncomment and customize the following
203 // statements, and also customize custom/faxcover.txt:
205 // $GLOBALS['hylafax_server'] = 'localhost';
206 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
207 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
209 // For scanner support, uncomment and customize the following. This is
210 // the directory in which scanned-in documents may be found, and may for
211 // example be a smbfs-mounted share from the PC supporting the scanner:
213 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
215 // Customize these if you are using SQL-Ledger with OpenEMR.
216 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
217 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
218 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
219 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
220 $sl_dbname = 'sql-ledger'; // sql-ledger database name
221 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
222 $sl_dbpass = 'secret'; // sql-ledger database login password
224 // Don't change anything below this line. ////////////////////////////
226 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
228 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
229 $_SESSION['pid'] = $_GET['pid'];
231 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
232 $_SESSION['pid'] = $_POST['pid'];
234 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
235 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
236 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
238 // global interface function to format text length using ellipses
239 function strterm($string,$length) {
240 if (strlen($string) >= ($length-3)) {
241 return substr($string,0,$length-3) . "...";
242 } else {
243 return $string;
247 // required for normal operation because of recent changes in PHP:
248 $ps = strpos($_SERVER['REQUEST_URI'],"myadmin");
249 if ($ps === false) {
250 extract($_GET);
251 extract($_POST);
254 // turn off PHP compatibility warnings
255 ini_set("session.bug_compat_warn","off");