Add new password extrafields type
This commit is contained in:
parent
9b1caefbf9
commit
52f2e228f1
@ -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;
|
||||||
@ -1144,6 +1151,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.'"/>';
|
||||||
}
|
}
|
||||||
@ -1402,6 +1413,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);
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user