fixes for matrix and inbox
This commit is contained in:
parent
080eb061ef
commit
b84d068229
3 changed files with 15 additions and 12 deletions
|
|
@ -527,11 +527,11 @@ sub www_editListing {
|
|||
);
|
||||
if ($self->canEdit) {
|
||||
$f->selectBox(
|
||||
-name=>"maintainerId",
|
||||
-value=>[$listing->{maintainerId}],
|
||||
-label=>$i18n->get('listing maintainer'),
|
||||
-options=>$self->session->db->buildHashRef("select userId,username from users order by username")
|
||||
-hoverHelp=>$i18n->get('listing maintainer description'),
|
||||
options=>$self->session->db->buildHashRef("select userId,username from users order by username"),
|
||||
name=>"maintainerId",
|
||||
value=>$listing->{maintainerId},
|
||||
label=>$i18n->get('listing maintainer'),
|
||||
hoverHelp=>$i18n->get('listing maintainer description'),
|
||||
);
|
||||
}
|
||||
my %goodBad = (
|
||||
|
|
@ -665,13 +665,14 @@ sub www_editListingSave {
|
|||
$data{assetId} = $self->getId;
|
||||
my $listingId = $self->session->db->setRow("Matrix_listing","listingId",\%data);
|
||||
if ($data{status} eq "pending" && !$listing->{approvalMessageId}) {
|
||||
$data{approvalMessageId} = WebGUI::Inbox->new($self->session)->addMessage({
|
||||
my $approvalMessage = WebGUI::Inbox->new($self->session)->addMessage({
|
||||
status=>'pending',
|
||||
groupId=>$self->get("groupIdEdit"),
|
||||
userId=>$self->get("ownerUserId"),
|
||||
subject=>"New Listing Added",
|
||||
message=>"A new listing, ".$data{productName}.", is waiting to be added.\n\n".$self->session->url->getSiteURL()."/".$self->formatURL("viewDetail",$listingId)
|
||||
});
|
||||
$self->session->db->setRow("Matrix_listing","listingId",{listingId=>$listingId, approvalMessageId=>$approvalMessage->getId});
|
||||
}
|
||||
my $a = $self->session->db->read("select fieldId, name, fieldType from Matrix_field");
|
||||
while (my ($id, $name, $type) = $a->array) {
|
||||
|
|
|
|||
|
|
@ -234,19 +234,21 @@ to the case of the values.
|
|||
=cut
|
||||
|
||||
sub orderedHash {
|
||||
my ($self) = @_;
|
||||
my ($self) = @_;
|
||||
my %options;
|
||||
tie %options, 'Tie::IxHash';
|
||||
if ($self->get("sortByValue")) {
|
||||
foreach my $optionKey (sort {"\L${$self->get('options')}{$a}" cmp "\L${$self->get('options')}{$b}" } keys %{$self->get('options')}) {
|
||||
$options{$optionKey} = $self->get('options')->{$optionKey};
|
||||
my $original = $self->get("options");
|
||||
if ($self->{sortByValue}) {
|
||||
foreach my $optionKey (sort {"\L${$original}{$a}" cmp "\L${$original}}{$b}" } keys %{$original}) {
|
||||
$options{$optionKey} = $original->{$optionKey};
|
||||
}
|
||||
} else {
|
||||
%options = %{$self->get('options')};
|
||||
%options = %{$original};
|
||||
}
|
||||
return %options;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 toHtmlAsHidden ( )
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ sub getMessagesForUser {
|
|||
my $limit = shift || 50;
|
||||
my @messages = ();
|
||||
my $counter = 0;
|
||||
my $rs = $self->session->db->read("select messageId, userId, groupId from inbox order by status='pending', dateStamp");
|
||||
my $rs = $self->session->db->read("select messageId, userId, groupId from inbox order by status='pending' desc, dateStamp desc");
|
||||
while (my ($messageId, $userId, $groupId) = $rs->array) {
|
||||
if ($user->userId eq $userId || $user->isInGroup($groupId)) {
|
||||
push(@messages, $self->getMessage($messageId));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue