From 16489b92acbc217e3789430726ffcad9de89a391 Mon Sep 17 00:00:00 2001 From: Ralph Asendeteufrer Date: Mon, 15 Oct 2012 09:57:21 -0400 Subject: [PATCH] BUG 9876 Knowledge Tree: Incorrect Windows size and scroll bar inside Map Fields on ProcessMaker PROBLEM When the dropdown contents bigger, they extend out of the Map grid. SOLUTION Show part of the label part of the dynaform dropdown objects, for now is a secure patch. --- gulliver/system/class.g.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 675ca52bc..15ae084d3 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -5430,6 +5430,23 @@ function getDirectorySize($path,$maxmtime=0) return $reservedWordsSql; } + + /** + * getMinText, Used with longer size labels to minimize them, don't like it but works. + * + * @text Contains the text to be cut according to $maxTextLenght + * @maxTextLength got the max length of the text. + * return the min text plus '...' + */ + function getMinText ($text,$maxTextLenght) + { + $points = "..."; + $lengthPoints = strlen($points); + if(strlen($text) > $maxTextLenght){ + $text = substr($text,0,$maxTextLenght - $lengthPoints) . $points; + } + return $text;//TODO: perhaps it shouls return an array to don't loose the original string text + } } /** @@ -5514,4 +5531,3 @@ function __($msgID , $lang = SYS_LANG, $data = null) { return G::LoadTranslation($msgID, $lang, $data); } -