Skip to content

Commit

Permalink
New Sliding Menu Module and Support for User Specific Globals:
Browse files Browse the repository at this point in the history
1. New snazzy slising menu layout style in
     Administration->Globals->Appearance settings
2. Full support for additional themes in
     Administration->Globals->Appearance settings
3. Support for User Specific settings at
     Miscellaneous->Preferences. Can set several
     options such as layout preference, theme preference,
     measurement units, date format, and time format.
  • Loading branch information
Ajil authored and bradymiller committed Feb 24, 2011
1 parent 4605859 commit 8815623
Show file tree
Hide file tree
Showing 25 changed files with 3,629 additions and 124 deletions.
Binary file added images/admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/approve_patient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fee.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/inventory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/messages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/misc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/patient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/procedures.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/reports.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 23 additions & 1 deletion interface/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,20 @@ function undoMagicQuotes($array, $topLevel=true) {

$glrow = sqlQuery("SHOW TABLES LIKE 'globals'");
if (!empty($glrow)) {
// Collect user specific settings from user_settings table.
//
$gl_user = array();
if (!empty($_SESSION['authUserID'])) {
$glres_user = sqlStatement("SELECT `setting_label`, `setting_value` " .
"FROM `user_settings` " .
"WHERE `setting_user` = ? " .
"AND `setting_label` LIKE 'global:%'", array($_SESSION['authUserID']) );
for($iter=0; $row=sqlFetchArray($glres_user); $iter++) {
//remove global_ prefix from label
$row['setting_label'] = substr($row['setting_label'],7);
$gl_user[$iter]=$row;
}
}
// Set global parameters from the database globals table.
// Some parameters require custom handling.
//
Expand All @@ -199,6 +213,14 @@ function undoMagicQuotes($array, $topLevel=true) {
while ($glrow = sqlFetchArray($glres)) {
$gl_name = $glrow['gl_name'];
$gl_value = $glrow['gl_value'];
// Adjust for user specific settings
if (!empty($gl_user)) {
foreach ($gl_user as $setting) {
if ($gl_name == $setting['setting_label']) {
$gl_value = $setting['setting_value'];
}
}
}
if ($gl_name == 'language_menu_other') {
$GLOBALS['language_menu_show'][] = $gl_value;
}
Expand All @@ -216,7 +238,7 @@ function undoMagicQuotes($array, $topLevel=true) {
else if ($gl_value == '3') $GLOBALS['sell_non_drug_products'] = 2;
}
else {
$GLOBALS[$gl_name] = $glrow['gl_value'];
$GLOBALS[$gl_name] = $gl_value;
}
}
// Language cleanup stuff.
Expand Down
171 changes: 118 additions & 53 deletions interface/main/left_nav.php

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions interface/main/main_navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class='link'>&nbsp;<?php xl('Find','e'); ?>&nbsp;<?php xl('Patient','e'); ?></a>
<?php xl('Password','e'); ?></a>&nbsp;
</td>

<td align="center" nowrap>
&nbsp;<a href="../super/edit_globals.php?mode=user" target="Main" class="menu" onclick="top.restoreSession()">
<?php xl('Settings','e'); ?></a>&nbsp;
</td>

<?php if (acl_check('admin', 'calendar') || acl_check('admin', 'database') ||
acl_check('admin', 'forms') || acl_check('admin', 'practice') ||
acl_check('admin', 'users') || acl_check('admin', 'acl')) { ?>
Expand Down
3 changes: 1 addition & 2 deletions interface/patient_file/encounter/encounter_top.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
<head>
<? html_header_show();?>
</head>
<frameset cols="*,200">
<frameset cols="*">
<frame src="forms.php" name="Forms" scrolling="auto">
<frame src="new_form.php" name="New Form" scrolling="auto">
</frameset>
</html>
5 changes: 4 additions & 1 deletion interface/patient_file/encounter/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ function divtoggle(spanid, divid) {
</style>

</head>

<?php
$hide=1;
require_once("$incdir/patient_file/encounter/new_form.php");
?>
<body class="body_top">

<div id="encounter_forms">
Expand Down
8 changes: 8 additions & 0 deletions interface/patient_file/encounter/load_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
include_once("$incdir/forms/LBF/new.php");
}
else {
if( (!empty($_GET['pid'])) && ($_GET['pid'] > 0) )
{
$pid = $_GET['pid'];
$encounter = $_GET['encounter'];
}
if($_GET["formname"] != "newpatient" ){
include_once("$incdir/patient_file/encounter/new_form.php");
}
include_once("$incdir/forms/" . $_GET["formname"] . "/new.php");
}
?>
192 changes: 161 additions & 31 deletions interface/patient_file/encounter/new_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,120 @@
function openNewForm(sel) {
top.restoreSession();
<?php if ($GLOBALS['concurrent_layout']) { ?>
parent.location.href = sel.options[sel.selectedIndex].value;
FormNameValueArray = sel.split('formname=');
if(FormNameValueArray[1] == 'newpatient')
{
parent.location.href = sel
}
else
{
parent.Forms.location.href = sel;
}
<?php } else { ?>
top.frames['Main'].location.href = sel.options[sel.selectedIndex].value;
top.frames['Main'].location.href = sel;
<?php } ?>
}
function toggleFrame1(fnum) {
top.frames['left_nav'].document.forms[0].cb_top.checked=false;
top.window.parent.left_nav.toggleFrame(fnum);
}
</script>
<style type="text/css">
#sddm
{ margin: 0;
padding: 0;
z-index: 30;
}

</style>
<script type="text/javascript" language="javascript">

var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
var oldddmenuitem = 0;
var flag = 0;

// open hidden layer
function mopen(id)
{
// cancel close timer
//mcancelclosetime();

flag=10;

// close old layer
//if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
//if(ddmenuitem) ddmenuitem.style.display = 'none';

// get new layer and show it
oldddmenuitem = ddmenuitem;
ddmenuitem = document.getElementById(id);
if((ddmenuitem.style.visibility == '')||(ddmenuitem.style.visibility == 'hidden')){
if(oldddmenuitem) oldddmenuitem.style.visibility = 'hidden';
if(oldddmenuitem) oldddmenuitem.style.display = 'none';
ddmenuitem.style.visibility = 'visible';
ddmenuitem.style.display = 'block';
}else{
ddmenuitem.style.visibility = 'hidden';
ddmenuitem.style.display = 'none';
}
}
// close showed layer
function mclose()
{
if(flag==10)
{
flag=11;
return;
}
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
if(ddmenuitem) ddmenuitem.style.display = 'none';
}

// close layer when click-out
document.onclick = mclose;
//=================================================
function findPosX(id)
{
obj=document.getElementById(id);
var curleft = 0;
if(obj.offsetParent)
while(1)
{
curleft += obj.offsetLeft;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.x)
curleft += obj.x;
PropertyWidth=document.getElementById(id).offsetWidth;
if(PropertyWidth>curleft)
{
document.getElementById(id).style.left=0;
}
}

function findPosY(obj)
{
var curtop = 0;
if(obj.offsetParent)
while(1)
{
curtop += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.y)
curtop += obj.y;
return curtop;
}
</script>

</head>
<body class="body_top">
<body class="bgcolor2">
<dl>
<?php //DYNAMIC FORM RETREIVAL
include_once("$srcdir/registry.inc");
Expand All @@ -49,47 +153,73 @@ function myGetRegistered($state="1", $limit="unlimited", $offset="0") {

$reg = myGetRegistered();
$old_category = '';
echo "<FORM METHOD=POST NAME='choose'>\n";

$DivId=1;

if (!empty($reg)) {
$StringEcho= '<ul id="sddm">';
if(isset($hide)){
$StringEcho.= "<li><a id='enc2' >Encounter Summary</a></li>";
}else{
$StringEcho.= "<li><a href='JavaScript:void(0);' id='enc2' onclick=\" return top.window.parent.left_nav.loadFrame2('enc2','RBot','patient_file/encounter/encounter_top.php')\">Encounter Summary</a></li>";
}
foreach ($reg as $entry) {
$new_category = trim($entry['category']);
$new_nickname = trim($entry['nickname']);
if ($new_category == '') {$new_category = 'miscellaneous';}
if ($new_nickname != '') {$nickname = $new_nickname;}
else {$nickname = $entry['name'];}
if ($old_category != $new_category) {
$new_category_ = $new_category;
$new_category_ = str_replace(' ','_',$new_category_);
if ($old_category != '') {echo "</select>\n";}
echo "<select name=" . $new_category_ . " onchange='openNewForm(this)'>\n";
echo " <option value=" . $new_category_ . ">" . $new_category . "</option>\n";
$old_category = $new_category;
}
echo " <option value='" . $rootdir .
'/patient_file/encounter/load_form.php?formname=' .
urlencode($entry['directory']) . "'>" . xl_form_title($nickname) . "</option>\n";
$new_category = trim($entry['category']);
$new_nickname = trim($entry['nickname']);
if ($new_category == '') {$new_category = htmlspecialchars(xl('Miscellaneous'),ENT_QUOTES);}
if ($new_nickname != '') {$nickname = $new_nickname;}
else {$nickname = $entry['name'];}
if ($old_category != $new_category) {
$new_category_ = $new_category;
$new_category_ = str_replace(' ','_',$new_category_);
if ($old_category != '') {$StringEcho.= "</table></div></li>";}
$StringEcho.= "<li><a href='JavaScript:void(0);' onClick=\"mopen('$DivId');\" >$new_category</a><div id='$DivId' ><table border='0' cellspacing='0' cellpadding='0'>";
$old_category = $new_category;
$DivId++;
}
$StringEcho.= "<tr><td style='border-top: 1px solid #000000;padding:0px;'><a onclick=\"openNewForm('" . $rootdir .'/patient_file/encounter/load_form.php?formname=' .urlencode($entry['directory']) .
"')\" href='JavaScript:void(0);'>" . xl_form_title($nickname) . "</a></td></tr>";
}
echo "</select>\n";
$StringEcho.= '</table></div></li>';
}

if($StringEcho){
$StringEcho2= '<div style="clear:both"></div>';
}else{
$StringEcho2="";
}
?>
<!--<table style="border:solid 1px black" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><?php //echo $StringEcho; ?></td>
</tr>
</table>-->
<?php
//$StringEcho='';
// This shows Layout Based Form names just like the above.
//
$lres = sqlStatement("SELECT * FROM list_options " .
"WHERE list_id = 'lbfnames' ORDER BY seq, title");
if (sqlNumRows($lres)) {
echo "<select name='lbfnames' onchange='openNewForm(this)'>\n";
echo "<option value='lbfnames'>" . xl('Layout Based') . "</option>\n";
if(!$StringEcho){
$StringEcho= '<ul id="sddm">';
}
$StringEcho.= "<li><a href='JavaScript:void(0);' onClick=\"mopen('lbf');\" >".xl('Layout Based') ."</a><div id='lbf' ><table border='0' cellspacing='0' cellpadding='0'>";
while ($lrow = sqlFetchArray($lres)) {
$option_id = $lrow['option_id']; // should start with LBF
$title = $lrow['title'];
echo "<option value='$rootdir/patient_file/encounter/load_form.php?" .
"formname=$option_id'>" . xl_form_title($title) . "</option>\n";
$option_id = $lrow['option_id']; // should start with LBF
$title = $lrow['title'];
$StringEcho.= "<tr><td style='border-top: 1px solid #000000;padding:0px;'><a href='" . $rootdir .'/patient_file/encounter/load_form.php?formname='
.urlencode($option_id) ."' >" . xl_form_title($title) . "</a></td></tr>";
}
echo "</select>\n";
}

echo "</FORM>\n";
if($StringEcho){
$StringEcho.= "</table></div></li></ul>".$StringEcho2;
}
?>
<table cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top"><?php echo $StringEcho; ?></td>
</tr>
</table>
</dl>

</body>
Expand Down
Loading

0 comments on commit 8815623

Please sign in to comment.