fixing bugs
This commit is contained in:
parent
a20aa5f587
commit
bfffdae8a9
4 changed files with 12 additions and 31 deletions
|
|
@ -155,11 +155,11 @@ sub www_viewProfile {
|
|||
|
||||
my @array = ();
|
||||
foreach my $category (@{WebGUI::ProfileCategory->getCategories}) {
|
||||
next unless ($category->get("visible");
|
||||
next unless ($category->get("visible"));
|
||||
push(@array, {'profile.category' => $category->getLabel});
|
||||
foreach my $field (@{$category->getFields}) {
|
||||
next unless ($field->get("visible"));
|
||||
next if ($field->get("fieldName") eq "email" && !$u->profileField("publicEmail")
|
||||
next if ($field->get("fieldName") eq "email" && !$u->profileField("publicEmail"));
|
||||
push(@array, {
|
||||
'profile.label' => $field->getLabel,
|
||||
'profile.value' => $u->profileField($field->getId)
|
||||
|
|
|
|||
|
|
@ -23,28 +23,8 @@ use WebGUI::Session;
|
|||
use WebGUI::SQL;
|
||||
use WebGUI::Operation::Shared;
|
||||
use WebGUI::Form::FieldType;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _reorderCategories {
|
||||
my ($sth, $i, $id);
|
||||
$sth = WebGUI::SQL->read("select profileCategoryId from userProfileCategory order by sequenceNumber");
|
||||
while (($id) = $sth->array) {
|
||||
$i++;
|
||||
WebGUI::SQL->write("update userProfileCategory set sequenceNumber='$i' where profileCategoryId=".quote($id));
|
||||
}
|
||||
$sth->finish;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _reorderFields {
|
||||
my ($sth, $i, $id);
|
||||
$sth = WebGUI::SQL->read("select fieldName from userProfileField where profileCategoryId=".quote($_[0])." order by sequenceNumber");
|
||||
while (($id) = $sth->array) {
|
||||
$i++;
|
||||
WebGUI::SQL->write("update userProfileField set sequenceNumber='$i' where fieldName=".quote($id));
|
||||
}
|
||||
$sth->finish;
|
||||
}
|
||||
use WebGUI::ProfileField;
|
||||
use WebGUI::ProfileCategory;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _submenu {
|
||||
|
|
@ -75,6 +55,7 @@ sub _submenu {
|
|||
sub www_deleteProfileCategoryConfirm {
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
return WebGUI::AdminConsole->new("userProfiling")->render(WebGUI::Privilege::vitalComponent()) if (length($session{form}{cid}) != 22 && $session{form}{cid} < 1000 && $session{form}{cid} > 0);
|
||||
|
||||
WebGUI::SQL->write("delete from userProfileCategory where profileCategoryId=".quote($session{form}{cid}));
|
||||
WebGUI::SQL->write("update userProfileField set profileCategoryId='1' where profileCategoryId=".quote($session{form}{cid}));
|
||||
return www_editProfileSettings();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue