Implemented Selectable Print Orientation (Portrait, Landscape) for all reports in...
[fa-stable.git] / includes / current_user.inc
index e393252d72cb4c7302443f4a077d2ceeb3b8a116..7f04eb778329e347b017f0523ad4d67f0eb2d68c 100644 (file)
@@ -610,6 +610,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);