shelves can see skus under them as well as by keyword

This commit is contained in:
JT Smith 2008-05-18 17:23:03 +00:00
parent d849aacc51
commit f88cf54053
3 changed files with 14 additions and 7 deletions

View file

@ -91,7 +91,7 @@ sub view {
} }
# get other child skus # get other child skus
my @childSkus = @{$self->getLineage(['children'],{includeOnlyClasses=>['WebGUI::Asset::Wobject::Shelf']})}; my @childSkus = @{$self->getLineage(['children'],{isa=>'WebGUI::Asset::Sku'})};
# find products based upon keywords # find products based upon keywords
my @keywords = $self->get('keywords'); my @keywords = $self->get('keywords');
@ -107,8 +107,7 @@ sub view {
# generate template variables # generate template variables
my @skus = (); my @skus = ();
foreach my $row (@{$p->getPageData}) { foreach my $id (@{$p->getPageData}) {
my $id = $row->{assetId};
my $asset = WebGUI::Asset->newByDynamicClass($session, $id); my $asset = WebGUI::Asset->newByDynamicClass($session, $id);
if (defined $asset) { if (defined $asset) {
my $sku = $asset->get; my $sku = $asset->get;

View file

@ -308,6 +308,10 @@ A boolean indicating whether the resulting asset tree should be returned in reve
An array reference containing a list of asset classes to include in the result. If this is specified then no other classes except these will be returned. The opposite of the excludeClasses rule. An array reference containing a list of asset classes to include in the result. If this is specified then no other classes except these will be returned. The opposite of the excludeClasses rule.
=head4 isa
A classname where you can look for classes of a similar base class. For example, if you're looking for Donations, Subscriptions, Products and other subclasses of WebGUI::Asset::Sku, then set isa to 'WebGUI::Asset::Sku'.
=head4 includeArchived =head4 includeArchived
A boolean indicating that we should include archived assets in the result set. A boolean indicating that we should include archived assets in the result set.
@ -437,6 +441,10 @@ sub getLineage {
if (exists $rules->{includeOnlyClasses}) { if (exists $rules->{includeOnlyClasses}) {
$where .= ' and (asset.className in ('.$self->session->db->quoteAndJoin($rules->{includeOnlyClasses}).'))'; $where .= ' and (asset.className in ('.$self->session->db->quoteAndJoin($rules->{includeOnlyClasses}).'))';
} }
## isa
if (exists $rules->{isa}) {
$where .= ' and (asset.className like '.$self->session->db->quote($rules->{isa}.'%').')';
}
## finish up our where clause ## finish up our where clause
if (!scalar(@whereModifiers)) { if (!scalar(@whereModifiers)) {
return []; return [];

View file

@ -2699,8 +2699,8 @@ div.tabs {
}, },
'10' => { '10' => {
message => q|Manage trash.|, message => q|Manage my trash.|,
lastUpdated => 1031514049 lastUpdated =>1211131614
}, },
'958' => { '958' => {
@ -3034,8 +3034,8 @@ or are under your current version tag.</p>
}, },
'trash' => { 'trash' => {
message => q|My Trash|, message => q|Trash|,
lastUpdated =>1207859655, lastUpdated =>1211131614,
context => q|Title of the trash manager for the admin console.| context => q|Title of the trash manager for the admin console.|
}, },