Skip to content

Commit

Permalink
🔨 BASE FIXED #210 mudado mascará
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinaldo Araujo Barreto Junior committed Nov 29, 2019
1 parent 1fbe8d4 commit df4c15a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
6 changes: 3 additions & 3 deletions base/classes/webform/TFone.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ public function getFormated()
$value=substr($value, 0, 4).'-'.substr($value, 4);
}
elseif (strlen($value)==9) {
$value='(0xx'.substr($value, 0, 2).') '.substr($value, 2, 3).'-'.substr($value, 5);
$value='('.substr($value, 0, 2).') '.substr($value, 2, 3).'-'.substr($value, 5);
}
elseif (strlen($value)==10) {
$value='(0xx'.substr($value, 1, 2).') '.substr($value, 3, 3).'-'.substr($value, 6);
$value='('.substr($value, 1, 2).') '.substr($value, 3, 3).'-'.substr($value, 6);
}
elseif (strlen($value) > 10 ) {
$value='(0xx'.substr($value, 1, 2).') '.substr($value, 3, 4).'-'.substr($value, 7);
$value='('.substr($value, 1, 2).') '.substr($value, 3, 4).'-'.substr($value, 7);
}
return $value;
}
Expand Down
5 changes: 3 additions & 2 deletions base/classes/webform/TForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7066,8 +7066,9 @@ public function addFoneField( $strName
, $boolLabelAbove=null
, $boolNoWrapLabel=null )
{
$field = new TFone( $strName, $strValue, $boolRequired );
$this->addDisplayControl( new TDisplayControl( $strLabel, $field, $boolLabelAbove, $boolNewLine, $boolNoWrapLabel ) );
$field = new TFone( $strName, $strValue, $boolRequired );
$displayControl = new TDisplayControl( $strLabel, $field, $boolLabelAbove, $boolNewLine, $boolNoWrapLabel );
$this->addDisplayControl( $displayControl );
return $field;
}

Expand Down
24 changes: 2 additions & 22 deletions base/js/FormDin4.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,26 +803,6 @@ function fwValidarEmail(campo,alertar)
return r;
}
//-------------------------------------------------------------------------------------
/*
function fwFormatarTelefone(e) {
var s = "";
var res = "";
s = fwFiltraCampo(e.value);
while ( s.substring(0,1) == "0" ) {
s1 = s.substring(1,s.length);
s = s1;
}
s = s.substring(0,10);
res = s.substring(s.length-4,s.length);
if ( s.length > 4 && s.length < 9 )
res = s.substring(0,s.length-4)+"-"+res;
if ( s.length > 8 )
res = "(0xx" + s.substring(0,2) + ") " +
s.substring(2,s.length-4) + "-" + res;
e.value = res;
return res;
}
*/

function fwFormatarTelefone(e) {
var s = "";
Expand Down Expand Up @@ -859,14 +839,14 @@ function fwFormatarTelefone(e) {
{
if(s.length == 11 )
{
res = "(0xx" + s.substring(0,2) + ") " + s.substring(2,s.length-4) + "-" + res;
res = "(" + s.substring(0,2) + ") " + s.substring(2,s.length-4) + "-" + res;
}
else if(s.length == 9 )
{
res = s.substring(0,5)+'-'+res;
}
else
res = "(0xx" + s.substring(0,2) + ") " + s.substring(2,s.length-4) + "-" + res;
res = "(" + s.substring(0,2) + ") " + s.substring(2,s.length-4) + "-" + res;
}

}
Expand Down

0 comments on commit df4c15a

Please sign in to comment.