From 1eb1440489a2ec9c1ff51473232daac941e727bb Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 10 Mar 2009 21:52:48 +0000 Subject: [PATCH] Fixed email_row/link_row display for empty input value. --- CHANGELOG.txt | 2 ++ includes/ui/ui_input.inc | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 84f85499..bf80d966 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index 3da07206..6f33413e 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -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("$label", $name, $value, $size, $max, $title, $params, $post_label); + if (get_post($name)) + $label = "$label"; + 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("$label", $name, $size, $max, $title, $value, $params, $post_label); + if (get_post($name)) + $label = "$label"; + 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("$label", $name, $value, $size, $max, $title, $params, $post_label); + $val = get_post($name); + if ($val) { + if (strpos($val,'http://')===false) + $val = 'http://'.$val; + $label = "$label"; + } + 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("$label", $name, $size, $max, $title, $value, $params, $post_label); + $val = get_post($name); + if ($val) { + if (strpos($val,'http://')===false) + $val = 'http://'.$val; + $label = "$label"; + } + text_row_ex($label, $name, $size, $max, $title, $value, $params, $post_label); } //----------------------------------------------------------------------------------- -- 2.30.2