Added journal entry view link.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 8 May 2009 10:25:13 +0000 (10:25 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 8 May 2009 10:25:13 +0000 (10:25 +0000)
includes/ui/ui_view.inc

index e2265f9d62522b1454f59a0718a5ec173a15de1e..f2f36f534eb2d8bd77e526da94438ba6289366d3 100644 (file)
@@ -117,8 +117,6 @@ function get_banking_trans_view_str($type, $trans_no, $label="",
                $viewer = "gl_payment_view.php";
        elseif ($type == 2)
                $viewer = "gl_deposit_view.php";
-       elseif ($type == 0)
-               return $label;
        else
                return null;
 
@@ -186,6 +184,22 @@ function get_dimensions_trans_view_str($type, $trans_no, $label="", $icon=false,
 
        return viewer_link($label, $viewer, $class, $id,  $icon);
 }
+/*
+       Journal entry or cost update postings link
+*/
+function get_journal_trans_view_str($type, $trans_no, $label="", $icon=false, 
+       $class='', $id='')
+{
+       if ($type == 0 || $type == 35)
+               $viewer = "gl/view/gl_trans_view.php?type_id=$type&trans_no=$trans_no";
+       else
+               return null;
+
+       if ($label == "")
+               $label = $trans_no;
+
+       return viewer_link($label, $viewer, $class, $id,  $icon);
+}
 
 //--------------------------------------------------------------------------------------
 
@@ -216,6 +230,10 @@ function get_trans_view_str($type, $trans_no, $label="", $icon=false,
        if ($view_str != null)
                return $view_str;
 
+       $view_str = get_journal_trans_view_str($type, $trans_no, $label, $icon, $class, $id);
+       if ($view_str != null)
+               return $view_str;
+
        return null;
 }