diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index dd19300b7..a439e6c4c 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -12,6 +12,7 @@ - fix: Recover Password by Profile Field can now work with subclasses of WebGUI::Auth::WebGUI and with custom WebGUI::Form::Controls as profile fields. + - Add indicator to trash and clipboard in asset has children 7.4.0 diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index 113d3084e..6b947a2b3 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -390,13 +390,14 @@ $self->session->style->setLink($self->session->url->extras('assetManager/assetMa \n"; foreach my $child (@{$self->getAssetsInClipboard($limit)}) { my $title = $child->getTitle; + my $plus = $child->getChildCount({includeTrash => 1}) ? "+ " : "    "; $title =~ s/\'/\\\'/g; $output .= "assetManager.AddLine('" .WebGUI::Form::checkbox($self->session,{ name=>'assetId', value=>$child->getId }) - ."','getUrl("func=manageAssets")."\">".$title + ."','" . $plus . "getUrl("func=manageAssets")."\">" . $title ."','

getIcon(1)."\" style=\"border-style:none;vertical-align:middle;\" alt=\"".$child->getName."\" />

".$child->getName ."','".$self->session->datetime->epochToHuman($child->get("revisionDate")) ."','".formatBytes($child->get("assetSize"))."');\n"; diff --git a/lib/WebGUI/AssetLineage.pm b/lib/WebGUI/AssetLineage.pm index 2cfe6e857..d094cd2d8 100644 --- a/lib/WebGUI/AssetLineage.pm +++ b/lib/WebGUI/AssetLineage.pm @@ -176,7 +176,9 @@ Returns the number of children this asset has. This excludes assets in the trash sub getChildCount { my $self = shift; - my ($count) = $self->session->db->quickArray("select count(*) from asset where state in ('published','archived') and parentId=?", [$self->getId]); + my $opts = shift || {}; + my $stateWhere = $opts->{includeTrash} ? '' : "state in ('published','archived') and"; + my ($count) = $self->session->db->quickArray("select count(*) from asset where $stateWhere parentId=?", [$self->getId]); return $count; } diff --git a/lib/WebGUI/AssetTrash.pm b/lib/WebGUI/AssetTrash.pm index 6a963a0b9..e13ce1280 100644 --- a/lib/WebGUI/AssetTrash.pm +++ b/lib/WebGUI/AssetTrash.pm @@ -293,12 +293,13 @@ sub www_manageTrash { foreach my $child (@{$self->getAssetsInTrash($limit)}) { my $title = $child->getTitle; $title =~ s/\'/\\\'/g; + my $plus =$child->getChildCount({includeTrash => 1}) ? "+ " : "    "; $output .= "assetManager.AddLine('" .WebGUI::Form::checkbox($self->session, { name=>'assetId', value=>$child->getId }) - ."','getUrl("func=manageAssets")."\">".$title + ."','" . $plus . "getUrl("func=manageAssets")."\">" . $title ."','

getIcon(1)."\" style=\"vertical-align:middle;border-style:none;\" alt=\"".$child->getName."\" />

".$child->getName ."','".$self->session->datetime->epochToHuman($child->get("revisionDate")) ."','".formatBytes($child->get("assetSize"))."');\n";