Layout improvement in hyperlink_back function
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 16 Apr 2010 14:18:04 +0000 (14:18 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 16 Apr 2010 14:18:04 +0000 (14:18 +0000)
CHANGELOG.txt
includes/ui/ui_controls.inc

index 903df7b9b309f551143218e1a7d9a432ed28873e..3eb5338be83586204b1402331601bb09df972724 100644 (file)
@@ -22,6 +22,8 @@ $ -> Affected files
 16-Apr-2010 Joe Hunt
 # Minor fixes in voiding transactions
 $ /admin/void_transaction.php
+! Layout improvement in hyperlink_back function
+$ /includes/ui/ui_controls.inc
 
 15-Apr-2010 Joe Hunt
 ! Added an alternative way of presenting tax included on invoices.
index 6a43115f98fecf9b94df2d287425e6db42326a5d..287b446afbbc9f927ef0ae190f854843d24c854d 100644 (file)
@@ -151,20 +151,23 @@ function access_string($label, $clean=false)
 
 function hyperlink_back($center=true, $no_menu=true, $type_no=0, $trans_no=0)
 {
+       global $path_to_root;
+
        if ($center)
                echo "<center>";
-       start_table(false, "width=30%");
+       $id = 0;        
+       if ($no_menu && $type_no != 0 && $trans_no != 0)
+       {
+               include_once($path_to_root."/admin/db/attachments_db.inc");
+               $id = has_attachment($type_no, $trans_no);
+       }
+       $width = ($id != 0 ? "30%" : "20%");    
+       start_table(false, "width=$width");
        start_row();
        if ($no_menu)
        {
-               if ($type_no != 0 && $trans_no != 0)
-               {
-                       global $path_to_root;
-                       include_once($path_to_root."/admin/db/attachments_db.inc");
-                       $id = has_attachment($type_no, $trans_no);
-                       if ($id != 0)
-                               echo "<td align=center><a href='$path_to_root/admin/attachments.php?vw=$id' target='blanc_'>"._("View Attachment")."</a></td>\n";
-               }       
+               if ($id != 0)
+                       echo "<td align=center><a href='$path_to_root/admin/attachments.php?vw=$id' target='blanc_'>"._("View Attachment")."</a></td>\n";
                echo "<td align=center><a href='javascript:window.print();'>"._("Print")."</a></td>\n";
        }       
        echo "<td align=center><a href='javascript:goBack();'>".($no_menu ? _("Close") : _("Back"))."</a></td>\n";