CoreBOSBB
Suggestion - function for put a Mask in filed - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17)
+--- Forum: Administrator Support (https://discussions.corebos.org/forumdisplay.php?fid=8)
+--- Thread: Suggestion - function for put a Mask in filed (/showthread.php?tid=1309)



Suggestion - function for put a Mask in filed - rslemer - 10-21-2018

One funcionality missed in coreBOS is a capable shows data with mask

Example:

User input a telephone number 551120201999

and system exhibit as :

Telephone +55 (11) 2020-1999

I know architecture of system turn this compliated

But I suggest, create a funcition in Workflow for put a mask in fields, this way, the problem is minimized.

Example of code, for ilustrate my suggestion

<?
function mask($val, $mask) {
$maskared = '';
$k = 0;
for ($i = 0; $i <= strlen($mask) - 1; $i++) {
if ($mask[$i] == '#') {
if (isset ($val[$k]))
$maskared .= $val[$k++];
} else {
if (isset ($mask[$i]))
$maskared .= $mask[$i];
}
}
return $maskared;
}
?>