Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2016-07-21 17:25:45 +02:00
commit 73aeb9fcce
2 changed files with 18 additions and 2 deletions

View File

@ -82,6 +82,7 @@ class ExtraFields
'chkbxlst' => 'ExtrafieldCheckBoxFromList', 'chkbxlst' => 'ExtrafieldCheckBoxFromList',
'link' => 'ExtrafieldLink', 'link' => 'ExtrafieldLink',
'separate' => 'ExtrafieldSeparator', 'separate' => 'ExtrafieldSeparator',
'password' => 'ExtrafieldPassword',
); );
/** /**
@ -199,6 +200,9 @@ class ExtraFields
} elseif ($type=='link') { } elseif ($type=='link') {
$typedb='int'; $typedb='int';
$lengthdb='11'; $lengthdb='11';
} elseif($type=='password') {
$typedb='varchar';
$lengthdb='50';
} else { } else {
$typedb=$type; $typedb=$type;
$lengthdb=$length; $lengthdb=$length;
@ -426,6 +430,9 @@ class ExtraFields
} elseif ($type=='link') { } elseif ($type=='link') {
$typedb='int'; $typedb='int';
$lengthdb='11'; $lengthdb='11';
} elseif($type=='password') {
$typedb='varchar';
$lengthdb='50';
} else { } else {
$typedb=$type; $typedb=$type;
$lengthdb=$length; $lengthdb=$length;
@ -1146,6 +1153,10 @@ class ExtraFields
$out.='Error bad setup of extrafield'; $out.='Error bad setup of extrafield';
} }
} }
elseif ($type == 'password')
{
$out='<input type="password" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="'.$showsize.'" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
}
if (!empty($hidden)) { if (!empty($hidden)) {
$out='<input type="hidden" value="'.$value.'" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="'.$keysuffix.'options_'.$key.$keyprefix.'"/>'; $out='<input type="hidden" value="'.$value.'" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="'.$keysuffix.'options_'.$key.$keyprefix.'"/>';
} }
@ -1404,6 +1415,10 @@ class ExtraFields
{ {
$value=dol_htmlentitiesbr($value); $value=dol_htmlentitiesbr($value);
} }
elseif ($type == 'password')
{
$value=preg_replace('/./i','*',$value);
}
else else
{ {
$showsize=round($size); $showsize=round($size);

View File

@ -349,6 +349,7 @@ ExtrafieldMail = Email
ExtrafieldSelect = Select list ExtrafieldSelect = Select list
ExtrafieldSelectList = Select from table ExtrafieldSelectList = Select from table
ExtrafieldSeparator=Separator ExtrafieldSeparator=Separator
ExtrafieldPassword=Password
ExtrafieldCheckBox=Checkbox ExtrafieldCheckBox=Checkbox
ExtrafieldRadio=Radio button ExtrafieldRadio=Radio button
ExtrafieldCheckBoxFromList= Checkbox from table ExtrafieldCheckBoxFromList= Checkbox from table