X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fcurrent_user.inc;h=7d80febbe3b4f02f8f1acb00a5bd1a8d6f3d1903;hb=1571869d54be48452fdbe08f25130972ff0a7b5a;hp=ae0a4d753dcf152924a014a28d8520c7b2c90bf7;hpb=264c09696d65efe4532c197f317162daf8c24f32;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index ae0a4d75..7d80febb 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -22,6 +22,7 @@ class current_user var $loginname; var $username; var $name; + var $email; var $company; // user's company var $pos; var $access; @@ -130,6 +131,7 @@ class current_user $this->username = $this->loginname; $this->prefs = new user_prefs($myrow); $this->user = @$myrow["id"]; + $this->email = @$myrow["email"]; update_user_visitdate($this->username); $this->logged = true; $this->last_act = time(); @@ -631,6 +633,14 @@ function array_search_key($needle, $haystack, $valuekey=null) return @$keys[0]; } +// Recalculate report columns if orientation is landscape. +function recalculate_cols(&$cols) +{ + $factor = (user_pagesize() == "A4" ? 1.4 : 1.3); + foreach($cols as $key => $col) + $cols[$key] = intval($col * $factor); +} + function flush_dir($path, $wipe = false) { $dir = opendir($path);