Added error trapping on category name and field label.
This commit is contained in:
parent
c78a57d1a5
commit
b0b2bfecc8
1 changed files with 12 additions and 6 deletions
|
|
@ -153,8 +153,11 @@ sub www_editProfileCategory {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editProfileCategorySave {
|
sub www_editProfileCategorySave {
|
||||||
my ($categoryId, $sequenceNumber);
|
my ($categoryId, $sequenceNumber, $test);
|
||||||
if (WebGUI::Privilege::isInGroup(3)) {
|
if (WebGUI::Privilege::isInGroup(3)) {
|
||||||
|
$session{form}{categoryName} = 'Unamed' if ($session{form}{categoryName} eq "" || $session{form}{categoryName} eq "''");
|
||||||
|
$test = eval($session{form}{categoryName});
|
||||||
|
$session{form}{categoryName} = "'".$session{form}{categoryName}."'" if ($test eq "");
|
||||||
if ($session{form}{cid} eq "new") {
|
if ($session{form}{cid} eq "new") {
|
||||||
$categoryId = getNextId("profileCategoryId");
|
$categoryId = getNextId("profileCategoryId");
|
||||||
($sequenceNumber) = WebGUI::SQL->quickArray("select max(sequenceNumber) from userProfileCategory");
|
($sequenceNumber) = WebGUI::SQL->quickArray("select max(sequenceNumber) from userProfileCategory");
|
||||||
|
|
@ -165,6 +168,7 @@ sub www_editProfileCategorySave {
|
||||||
profileCategoryId=$session{form}{cid}");
|
profileCategoryId=$session{form}{cid}");
|
||||||
}
|
}
|
||||||
return www_editProfileSettings();
|
return www_editProfileSettings();
|
||||||
|
return $test;
|
||||||
} else {
|
} else {
|
||||||
return WebGUI::Privilege::adminOnly();
|
return WebGUI::Privilege::adminOnly();
|
||||||
}
|
}
|
||||||
|
|
@ -187,8 +191,8 @@ sub www_editProfileField {
|
||||||
$f->text("fid",WebGUI::International::get(470));
|
$f->text("fid",WebGUI::International::get(470));
|
||||||
}
|
}
|
||||||
$f->text("fieldLabel",WebGUI::International::get(472),$data{fieldLabel});
|
$f->text("fieldLabel",WebGUI::International::get(472),$data{fieldLabel});
|
||||||
$f->checkbox("visible",WebGUI::International::get(473),$data{visible});
|
$f->yesNo("visible",WebGUI::International::get(473),$data{visible});
|
||||||
$f->checkbox("required",WebGUI::International::get(474),$data{required});
|
$f->yesNo("required",WebGUI::International::get(474),$data{required});
|
||||||
tie %hash, 'Tie::IxHash';
|
tie %hash, 'Tie::IxHash';
|
||||||
%hash = ( 'text'=>WebGUI::International::get(475),
|
%hash = ( 'text'=>WebGUI::International::get(475),
|
||||||
'textarea'=>WebGUI::International::get(476),
|
'textarea'=>WebGUI::International::get(476),
|
||||||
|
|
@ -199,8 +203,7 @@ sub www_editProfileField {
|
||||||
'phone'=>WebGUI::International::get(481),
|
'phone'=>WebGUI::International::get(481),
|
||||||
'integer'=>WebGUI::International::get(482),
|
'integer'=>WebGUI::International::get(482),
|
||||||
'yesNo'=>WebGUI::International::get(483),
|
'yesNo'=>WebGUI::International::get(483),
|
||||||
'select'=>WebGUI::International::get(484),
|
'select'=>WebGUI::International::get(484)
|
||||||
'checkbox'=>WebGUI::International::get(485)
|
|
||||||
);
|
);
|
||||||
$f->select("dataType",\%hash,WebGUI::International::get(486),[$data{dataType}]);
|
$f->select("dataType",\%hash,WebGUI::International::get(486),[$data{dataType}]);
|
||||||
$f->textarea("dataValues",WebGUI::International::get(487),$data{dataValues});
|
$f->textarea("dataValues",WebGUI::International::get(487),$data{dataValues});
|
||||||
|
|
@ -221,8 +224,11 @@ sub www_editProfileField {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editProfileFieldSave {
|
sub www_editProfileFieldSave {
|
||||||
my ($sequenceNumber, $fieldName);
|
my ($sequenceNumber, $fieldName, $test);
|
||||||
if (WebGUI::Privilege::isInGroup(3)) {
|
if (WebGUI::Privilege::isInGroup(3)) {
|
||||||
|
$session{form}{fieldLabel} = 'Unamed' if ($session{form}{fieldLabel} eq "" || $session{form}{fieldLabel} eq "''");
|
||||||
|
$test = eval($session{form}{fieldLabel});
|
||||||
|
$session{form}{fieldLabel} = "'".$session{form}{fieldLabel}."'" if ($test eq "");
|
||||||
if ($session{form}{new}) {
|
if ($session{form}{new}) {
|
||||||
($fieldName) = WebGUI::SQL->quickArray("select count(*) from userProfileField
|
($fieldName) = WebGUI::SQL->quickArray("select count(*) from userProfileField
|
||||||
where fieldName=".quote($session{form}{fid}));
|
where fieldName=".quote($session{form}{fid}));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue