[Bps-public-commit] assets branch, user-summary-asset-list-links, created. 1.05-2-g4d14c84

Dustin Graves dustin at bestpractical.com
Thu Dec 10 14:17:55 EST 2015


The branch, user-summary-asset-list-links has been created
        at  4d14c841516216b245cc266e14c0539e3d74938c (commit)

- Log -----------------------------------------------------------------
commit 4d14c841516216b245cc266e14c0539e3d74938c
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Thu Dec 10 19:05:32 2015 +0000

    add links to 'Assigned Assets' User Summary Portlet
    
            Title links to Assets search like other portlets
            New 'Bulk Update' link to right of title

diff --git a/html/User/Elements/AssetList b/html/User/Elements/AssetList
index ef5a6a9..3ed1a03 100644
--- a/html/User/Elements/AssetList
+++ b/html/User/Elements/AssetList
@@ -61,8 +61,54 @@ my $Format = q[
     Description,
 ];
 $m->callback( CallbackName => 'ModifyFormat', %ARGS, Format => \$Format );
+
+my $search_format = q[
+    '<a href="__WebHomePath__/Asset/Display.html?id=__id__">__Name__</a>/TITLE:Name',
+    Description,
+    '__Status__ (__Catalog__)/ATTRIBUTE:Status',
+    Owner,
+    HeldBy,
+    Contacts,
+    '__ActiveTickets__ __InactiveTickets__/TITLE:Related tickets',
+];
+
+my %QueryProperties = (
+    Query      => join(' OR ', map { "$_.id = ".$User->Id } ('HeldBy', 'Contact', 'Owner') ),
+    OrderBy    => 'id',
+    Order      => 'ASC',
+    Format     => $search_format,
+);
+
+$m->callback( CallbackName => 'ModifyQueryProperties',
+    %ARGS,
+    QueryProperties => \%QueryProperties,
+);
+
+my $query_string = $m->comp('/Elements/QueryString',
+    Query       => $QueryProperties{Query},
+    OrderBy     => $QueryProperties{OrderBy},
+    Order       => $QueryProperties{Order},
+    Format      => $QueryProperties{Format},
+);
+
+my $search_url  =
+    RT->Config->Get('WebPath') .
+    '/Asset/Search/Results.html?' .
+    $query_string;
+
+my $bulk_update_url  =
+    RT->Config->Get('WebPath') .
+    '/Asset/Search/Bulk.html?' .
+    $query_string;
+
 </%init>
-<&| /Widgets/TitleBox, title => $Title, class => "user asset-list" &>
+<&| /Widgets/TitleBox,
+    title => $Title,
+    title_href => $search_url,
+    titleright => 'Bulk Update',
+    titleright_href => $bulk_update_url,
+    class => "user asset-list",
+&>
     <& /Elements/CollectionList,
         Collection      => $assets,
         OrderBy         => 'id',

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list