Fixed email_row/link_row display for empty input value.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 10 Mar 2009 21:52:48 +0000 (21:52 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 10 Mar 2009 21:52:48 +0000 (21:52 +0000)
CHANGELOG.txt
includes/ui/ui_input.inc

index 84f85499246771bfa16acf3c14d410b0d2424ee0..bf80d966637042fac24c74326d063e58c228074a 100644 (file)
@@ -22,6 +22,8 @@ $ -> Affected files
 10-Mar-2009 Janusz Dobrowolski
 # [0000119] Fixed search by item description in sales item selector.
 $ /includes/ui/ui_lists.inc
+# Fixed email_row/link_row display for empty input value.
+$ /includes/ui/ui_inputs.inc
 
 ------------------------------- Release 2.1.0 RC ------------------------------------------------
 09-Mar-2009 Joe Hunt
index 3da07206ac88c05321bf6260661bc22f5f0839c5..6f33413e5b7c7edc30eb52812bd39d22cd232174 100644 (file)
@@ -448,22 +448,38 @@ function text_row_ex($label, $name, $size, $max=null, $title=null, $value=null,
 //-----------------------------------------------------------------------------------
 function email_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="")
 {
-       text_row("<a href='Mailto:".$_POST[$name]."'>$label</a>", $name, $value, $size, $max, $title, $params, $post_label);
+       if (get_post($name)) 
+               $label = "<a href='Mailto:".$_POST[$name]."'>$label</a>";
+       text_row($label, $name, $value, $size, $max, $title, $params, $post_label);
 }
 
 function email_row_ex($label, $name, $size, $max=null, $title=null, $value=null, $params=null, $post_label=null)
 {
-       text_row_ex("<a href='Mailto:".$_POST[$name]."'>$label</a>", $name, $size, $max, $title, $value, $params, $post_label);
+       if (get_post($name)) 
+               $label = "<a href='Mailto:".$_POST[$name]."'>$label</a>";
+       text_row_ex($label, $name, $size, $max, $title, $value, $params, $post_label);
 }
 
 function link_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="")
 {
-       text_row("<a href='".$_POST[$name]."' target='_blank'>$label</a>", $name, $value, $size, $max, $title, $params, $post_label);
+       $val = get_post($name);
+       if ($val) {
+               if (strpos($val,'http://')===false)
+                       $val = 'http://'.$val;
+               $label = "<a href='$val' target='_blank'>$label</a>";
+       }
+       text_row($label, $name, $value, $size, $max, $title, $params, $post_label);
 }
 
 function link_row_ex($label, $name, $size, $max=null, $title=null, $value=null, $params=null, $post_label=null)
 {
-       text_row_ex("<a href='".$_POST[$name]."' target='_blank'>$label</a>", $name, $size, $max, $title, $value, $params, $post_label);
+       $val = get_post($name);
+       if ($val) {
+               if (strpos($val,'http://')===false)
+                       $val = 'http://'.$val;
+               $label = "<a href='$val' target='_blank'>$label</a>";
+       }
+       text_row_ex($label, $name, $size, $max, $title, $value, $params, $post_label);
 }
 
 //-----------------------------------------------------------------------------------