[Bps-public-commit] rt-extension-assets branch, user-assets-search-bulk, repushed
Todd Wade
todd at bestpractical.com
Tue Nov 25 07:11:47 EST 2014
The branch user-assets-search-bulk was deleted and repushed:
was f494df2fccc5281f9b34722e0c267e904ed6417b
now 0554a1a7301e7ba54cbd7eec9389733c1648f22b
1: f494df2 ! 1: 0554a1a allow searching and bulk updates for all of a user's assets
@@ -3,17 +3,58 @@
allow searching and bulk updates for all of a user's assets
* update AssetList to link to search showing the assets listed
+
* update asset searching to list all of a user's assets
- added AllRoles mode to ProcessAssetsSearchArguments
- updated code to not restrict on catalog when in this mode
* update asset bulk update to allow updating for all assets for a user
- - still in progress, its still restricting to default catalog
- - probably need to deal with unwantedly overwriting catalog
+ - allow AllRoles params to pass through to bulk updater
+ - show null option in SelectCatalog when called as UpdateCatalog
+
+ * TitleRight UserAssets portlet callback
+ - callback for user to set titleright properties on UserAssets titlebox
+ - pass through titleright options in AssetList
+
+diff --git a/html/Asset/Elements/SelectCatalog b/html/Asset/Elements/SelectCatalog
+--- a/html/Asset/Elements/SelectCatalog
++++ b/html/Asset/Elements/SelectCatalog
+@@
+ <& /Elements/SelectObject,
+ Name => "Catalog",
+ ShowAll => $ShowAll,
+- ShowNullOption => 0,
++ ShowNullOption => $ShowNullOption,
+ CheckRight => "CreateAsset",
+ %ARGS,
+ ObjectType => "Catalog",
+@@
+ $UpdateSession => 1
+ </%args>
+ <%init>
++my $ShowNullOption = 0;
+ my $catalog_obj = LoadDefaultCatalog($Default || '');
+-if ( $UpdateSession && $catalog_obj->Id ){
++
++if ( $ARGS{Name} && ($ARGS{Name} eq 'UpdateCatalog') ) {
++ $ShowNullOption = 1;
++} elsif ( $UpdateSession && $catalog_obj->Id ){
+ $session{'DefaultCatalog'} = $catalog_obj->Id;
+ $Default = $catalog_obj->Id;
+ }
diff --git a/html/Asset/Search/Bulk.html b/html/Asset/Search/Bulk.html
--- a/html/Asset/Search/Bulk.html
+++ b/html/Asset/Search/Bulk.html
+@@
+ <table>
+ <tr class="asset-catalog">
+ <td class="label"><label for="UpdateCatalog"><&|/l&>Catalog</&></label></td>
+- <td><& /Asset/Elements/SelectCatalog, Name => 'UpdateCatalog', Default => $catalog_obj->id, UpdateSession => 0, &></td>
++ <td><& /Asset/Elements/SelectCatalog, Name => 'UpdateCatalog', Default => ( $ARGS{'Catalog'} && $catalog_obj->id ), UpdateSession => 0, &></td>
+ </tr>
+ <tr class="asset-name">
+ <td class="label"><label for="UpdateName"><&|/l&>Name</&></label></td>
@@
$m->callback(ARGSRef => \%ARGS, Results => \@results, CallbackName => 'Initial');
@@ -41,6 +82,19 @@
my $assets = RT::Assets->new($session{CurrentUser});
my %search = ProcessAssetsSearchArguments(
+diff --git a/html/Callbacks/RT-Extension-Assets/Elements/Tabs/Privileged b/html/Callbacks/RT-Extension-Assets/Elements/Tabs/Privileged
+--- a/html/Callbacks/RT-Extension-Assets/Elements/Tabs/Privileged
++++ b/html/Callbacks/RT-Extension-Assets/Elements/Tabs/Privileged
+@@
+ my %search = map @{$_},
+ grep defined $_->[1] && length $_->[1],
+ map {ref $DECODED_ARGS->{$_} ? [$_, $DECODED_ARGS->{$_}[0]] : [$_, $DECODED_ARGS->{$_}] }
+- grep /^(?:q|SearchAssets|!?(Name|Description|Catalog|Status|Role\..+|CF\..+)|Order(?:By)?|Page)$/,
++ grep /^(?:q|SearchAssets|!?(Name|Description|Catalog|Status|Role\..+|CF\..+)|Order(?:By)?|Page|AllRoles|PrincipalId)$/,
+ keys %$DECODED_ARGS;
+ if ( $Path =~ /Bulk/) {
+ $page->child('search',
+
diff --git a/html/User/Elements/AssetList b/html/User/Elements/AssetList
--- a/html/User/Elements/AssetList
+++ b/html/User/Elements/AssetList
@@ -49,7 +103,7 @@
$m->callback( CallbackName => 'ModifyFormat', %ARGS, Format => \$Format );
</%init>
-<&| /Widgets/TitleBox, title => $Title, class => "user asset-list" &>
-+<&| /Widgets/TitleBox, title => $Title, title_href => $title_href, class => "user asset-list" &>
++<&| /Widgets/TitleBox, title => $Title, title_href => $title_href, class => "user asset-list", %$titleright &>
<& /Elements/CollectionList,
Collection => $assets,
OrderBy => 'id',
@@ -58,6 +112,7 @@
$Title
@Roles
+$title_href => ''
++$titleright => {}
</%args>
diff --git a/html/User/Elements/Portlets/UserAssets b/html/User/Elements/Portlets/UserAssets
@@ -70,6 +125,9 @@
+<%init>
+my $format = RT->Config->Get('WebPath') . '/Asset/Search/index.html?AllRoles=1&PrincipalId=%d&SearchAssets=Search';
+my $search = sprintf $format, $User->PrincipalId;
++
++my $titleright_args = {};
++$m->callback( CallbackName => 'TitleRight', %ARGS, TitleRightArgs => $titleright_args );
+</%init>
%# Roles => [''] triggers the magical RoleLimit behavior that matches any role
-<& /User/Elements/AssetList, User => $User, Roles => [''], Title => loc('Assigned Assets') &>
@@ -78,6 +136,7 @@
+ Roles => [''],
+ Title => loc('Assigned Assets'),
+ title_href => $search,
++ titleright => $titleright_args,
+&>
<%ARGS>
$User
More information about the Bps-public-commit
mailing list