[Rt-commit] rt branch, 5.0/assetsql, repushed
? sunnavy
sunnavy at bestpractical.com
Mon Apr 13 18:52:06 EDT 2020
The branch 5.0/assetsql was deleted and repushed:
was 64bd4503520504d41fb1a12a5fb09c184079616d
now 738992409649545f5722f9dfa041c86851cef2bd
1: 4e53efb2fd ! 1: 4aff358e40 Core RT-Extension-AssetSQL
@@ -25,9 +25,9 @@
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@
- 'RT::Extension::RightsInspector' => '5.0',
'RT::Extension::ConfigInDatabase' => '5.0',
'RT::Extension::CustomRole::Visibility' => '5.0',
+ 'RT::Extension::PriorityAsString' => '5.0',
+ 'RT::Extension::AssetSQL' => '5.0',
);
2: c89707c28f = 2: ec2fa1e561 Core AssetSQL tests
3: d3e5d68ce3 = 3: 628f98f022 Drop ParseAssetSQL since ParseSQL now supports Assets too
4: f8b7ff5947 = 4: 95ec79bc5b Use txn's custom field search names for txn searches
5: 6c226559f5 = 5: 335d0aa649 Enable $IncludeTicketLinks for tickets only in search builder
6: 5d7bf584a2 ! 6: a1502ee212 Fix txn display link generated in txn search builder
@@ -36,7 +36,7 @@
- elsif ( $Link eq "Resolve" ) {
- $column{Prefix} .= q{<a HREF="__WebPath__/Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=__id__">};
- $column{Suffix} .= "</a>";
-+ if ( $Class eq 'RT::Tickets' ) {
++ elsif ( $Class eq 'RT::Tickets' ) {
+ if ( $Link eq "Display" ) {
+ $column{Prefix} .= q{<a HREF="__WebPath__/Ticket/Display.html?id=__id__">};
+ $column{Suffix} .= "</a>";
7: 12af1b0f9e = 7: d5f7253fb2 Limit to asset lifecycles to find active/inactive statuses in asset searches
8: 0cafed958f ! 8: b104060b1f Default ObjectType to RT::Ticket only for transactions
@@ -3,6 +3,19 @@
Default ObjectType to RT::Ticket only for transactions
It's confusing to have "RT::Ticket" as ObjectType for asset searches.
+
+diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
+--- a/lib/RT/Interface/Web/MenuBuilder.pm
++++ b/lib/RT/Interface/Web/MenuBuilder.pm
+@@
+ ),
+ );
+ $fallback_query_args{Class} ||= $class;
+- $fallback_query_args{ObjectType} ||= 'RT::Ticket';
++ $fallback_query_args{ObjectType} ||= 'RT::Ticket' if $class eq 'RT::Transactions';
+
+ if ($query_string) {
+ $args = '?' . $query_string;
diff --git a/share/html/Elements/CollectionList b/share/html/Elements/CollectionList
--- a/share/html/Elements/CollectionList
9: 27ef9b50aa = 9: 947bf96344 Fix refresh select name on search results page
10: fa3d730d12 ! 10: 57e62b20cd Use consistent names in session for searches
@@ -23,7 +23,8 @@
- $hash_name = join '-', 'CurrentSearchHash', $class, $HTML::Mason::Commands::DECODED_ARGS->{ObjectType} || 'RT::Ticket';
}
-+ my $hash_name = join '-', 'CurrentSearchHash', $class, $HTML::Mason::Commands::DECODED_ARGS->{ObjectType} || ();
++ my $hash_name = join '-', 'CurrentSearchHash', $class,
++ $HTML::Mason::Commands::DECODED_ARGS->{ObjectType} || ( $class eq 'RT::Transactions' ? 'RT::Ticket' : () );
my $current_search = $HTML::Mason::Commands::session{$hash_name} || {};
my $search_id = $HTML::Mason::Commands::DECODED_ARGS->{'SavedSearchLoad'} || $HTML::Mason::Commands::DECODED_ARGS->{'SavedSearchId'} || $current_search->{'SearchId'} || '';
my $chart_id = $HTML::Mason::Commands::DECODED_ARGS->{'SavedChartSearchId'} || $current_search->{SavedChartSearchId};
11: b06d5f45da ! 11: b087eddc40 Merge asset search pages into general search pages(/Search)
@@ -93,6 +93,126 @@
);
}
} elsif ($request_path =~ m{^/Admin/Global/CustomFields/Catalog-Assets\.html$}) {
+
+diff --git a/share/html/Asset/Elements/SelectAttachmentField b/share/html/Asset/Elements/SelectAttachmentField
+deleted file mode 100644
+--- a/share/html/Asset/Elements/SelectAttachmentField
++++ /dev/null
+@@
+-%# BEGIN BPS TAGGED BLOCK {{{
+-%#
+-%# COPYRIGHT:
+-%#
+-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+-%# <sales at bestpractical.com>
+-%#
+-%# (Except where explicitly superseded by other copyright notices)
+-%#
+-%#
+-%# LICENSE:
+-%#
+-%# This work is made available to you under the terms of Version 2 of
+-%# the GNU General Public License. A copy of that license should have
+-%# been provided with this software, but in any event can be snarfed
+-%# from www.gnu.org.
+-%#
+-%# This work is distributed in the hope that it will be useful, but
+-%# WITHOUT ANY WARRANTY; without even the implied warranty of
+-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-%# General Public License for more details.
+-%#
+-%# You should have received a copy of the GNU General Public License
+-%# along with this program; if not, write to the Free Software
+-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-%# 02110-1301 or visit their web page on the internet at
+-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+-%#
+-%#
+-%# CONTRIBUTION SUBMISSION POLICY:
+-%#
+-%# (The following paragraph is not intended to limit the rights granted
+-%# to you to modify and distribute this software under the terms of
+-%# the GNU General Public License and is only of importance to you if
+-%# you choose to contribute your changes and enhancements to the
+-%# community by submitting them to Best Practical Solutions, LLC.)
+-%#
+-%# By intentionally submitting any modifications, corrections or
+-%# derivatives to this work, or any other work intended for use with
+-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+-%# you are the copyright holder for those contributions and you grant
+-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+-%# royalty-free, perpetual, license to use, copy, create derivative
+-%# works based on those contributions, and sublicense and distribute
+-%# those contributions and any derivatives thereof.
+-%#
+-%# END BPS TAGGED BLOCK }}}
+-<select name="<%$Name%>">
+-<option value="Name"><&|/l&>Name</&></option>
+-<option value="Description"><&|/l&>Description</&></option>
+-</select>
+-<%ARGS>
+-$Name => 'AttachmentField'
+-</%ARGS>
+
+diff --git a/share/html/Asset/Elements/SelectDateType b/share/html/Asset/Elements/SelectDateType
+deleted file mode 100644
+--- a/share/html/Asset/Elements/SelectDateType
++++ /dev/null
+@@
+-%# BEGIN BPS TAGGED BLOCK {{{
+-%#
+-%# COPYRIGHT:
+-%#
+-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+-%# <sales at bestpractical.com>
+-%#
+-%# (Except where explicitly superseded by other copyright notices)
+-%#
+-%#
+-%# LICENSE:
+-%#
+-%# This work is made available to you under the terms of Version 2 of
+-%# the GNU General Public License. A copy of that license should have
+-%# been provided with this software, but in any event can be snarfed
+-%# from www.gnu.org.
+-%#
+-%# This work is distributed in the hope that it will be useful, but
+-%# WITHOUT ANY WARRANTY; without even the implied warranty of
+-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-%# General Public License for more details.
+-%#
+-%# You should have received a copy of the GNU General Public License
+-%# along with this program; if not, write to the Free Software
+-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-%# 02110-1301 or visit their web page on the internet at
+-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+-%#
+-%#
+-%# CONTRIBUTION SUBMISSION POLICY:
+-%#
+-%# (The following paragraph is not intended to limit the rights granted
+-%# to you to modify and distribute this software under the terms of
+-%# the GNU General Public License and is only of importance to you if
+-%# you choose to contribute your changes and enhancements to the
+-%# community by submitting them to Best Practical Solutions, LLC.)
+-%#
+-%# By intentionally submitting any modifications, corrections or
+-%# derivatives to this work, or any other work intended for use with
+-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+-%# you are the copyright holder for those contributions and you grant
+-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+-%# royalty-free, perpetual, license to use, copy, create derivative
+-%# works based on those contributions, and sublicense and distribute
+-%# those contributions and any derivatives thereof.
+-%#
+-%# END BPS TAGGED BLOCK }}}
+-<select name="<%$Name%>">
+-<option value="Created"><&|/l&>Created</&></option>
+-<option value="LastUpdated"><&|/l&>Last Updated</&></option>
+-</select>
+-<%ARGS>
+-$Name => 'DateType'
+-</%ARGS>
diff --git a/share/html/Asset/Search/Build.html b/share/html/Asset/Search/Build.html
deleted file mode 100644
@@ -1660,6 +1780,80 @@
-
-</%INIT>
+diff --git a/share/html/Asset/Search/index.html b/share/html/Asset/Search/index.html
+--- a/share/html/Asset/Search/index.html
++++ b/share/html/Asset/Search/index.html
+@@
+ %# END BPS TAGGED BLOCK }}}
+ <%init>
+ if (RT->Config->Get('AssetSQL_HideSimpleSearch')) {
+- $m->redirect( RT->Config->Get("WebPath") .'/Asset/Search/Build.html' );
++ $m->redirect( RT->Config->Get("WebPath") .'/Search/Build.html?Class=RT::Assets' );
+ }
+
+ my $catalog_obj = LoadDefaultCatalog($ARGS{'Catalog'} || '');
+
+diff --git a/share/html/Elements/SelectAttachmentField b/share/html/Elements/SelectAttachmentField
+--- a/share/html/Elements/SelectAttachmentField
++++ b/share/html/Elements/SelectAttachmentField
+@@
+ %#
+ %# END BPS TAGGED BLOCK }}}
+ <select name="<%$Name%>" class="form-control selectpicker">
+-<option value="Subject"><&|/l&>Subject</&></option>
++% if ( $Class eq 'RT::Assets' ) {
++ <option value="Name"><&|/l&>Name</&></option>
++ <option value="Description"><&|/l&>Description</&></option>
++% } else {
++ <option value="Subject"><&|/l&>Subject</&></option>
+ % if ( RT->Config->Get('FullTextSearch')->{'Enable'} ) {
+-<option value="Content"><&|/l&>Content</&></option>
++ <option value="Content"><&|/l&>Content</&></option>
++% }
++ <option value="ContentType"><&|/l&>Content-Type</&></option>
++ <option value="Filename"><&|/l&>Filename</&></option>
+ % }
+-<option value="ContentType"><&|/l&>Content-Type</&></option>
+-<option value="Filename"><&|/l&>Filename</&></option>
+ </select>
+ <%ARGS>
++$Class => 'RT::Tickets'
+ $Name => 'AttachmentField'
+ </%ARGS>
+
+diff --git a/share/html/Elements/SelectDateType b/share/html/Elements/SelectDateType
+--- a/share/html/Elements/SelectDateType
++++ b/share/html/Elements/SelectDateType
+@@
+ <%ARGS>
+ $Name => 'DateType'
+ $Prefix => ''
+- at Options => qw(Created Started Resolved Told LastUpdated Starts Due Updated) # loc_qw
++$Class => 'RT::Tickets'
++ at Options => $Class eq 'RT::Assets' ? qw(Created LastUpdated) : qw(Created Started Resolved Told LastUpdated Starts Due Updated) # loc_qw
+ </%ARGS>
+
+diff --git a/share/html/Elements/ShowSearch b/share/html/Elements/ShowSearch
+--- a/share/html/Elements/ShowSearch
++++ b/share/html/Elements/ShowSearch
+@@
+ $query_link_url = RT->Config->Get('WebPath') . "/Transaction/Search/Results.html";
+ }
+ elsif ( $SearchArg->{SearchType} eq 'Asset' ) {
+- $class = 'RT::Assets';
+- $query_link_url = RT->Config->Get('WebPath') . "/Asset/Search/Results.html";
+- $customize = RT->Config->Get('WebPath') . '/Asset/Search/Build.html?'
+- . $m->comp( '/Elements/QueryString',
+- SavedSearchLoad => $SavedSearch );
++ $class = $SearchArg->{Class} = 'RT::Assets';
++ $customize
++ = RT->Config->Get('WebPath')
++ . '/Search/Build.html?'
++ . $m->comp( '/Elements/QueryString', SavedSearchLoad => $SavedSearch, Class => 'RT::Assets' );
+ }
+ elsif ( $SearchArg->{SearchType} ne 'Ticket' ) {
+
+
diff --git a/share/html/Search/Build.html b/share/html/Search/Build.html
--- a/share/html/Search/Build.html
+++ b/share/html/Search/Build.html
@@ -1818,7 +2012,7 @@
+ $column{Suffix} .= "</a>";
+ }
+ }
- if ( $Class eq 'RT::Tickets' ) {
+ elsif ( $Class eq 'RT::Tickets' ) {
if ( $Link eq "Display" ) {
$column{Prefix} .= q{<a HREF="__WebPath__/Ticket/Display.html?id=__id__">};
@@ -1908,7 +2102,8 @@
+ Name => 'Attachment',
+ Field => {
+ Type => 'component',
-+ Path => '/Asset/Elements/SelectAttachmentField',
++ Path => '/Elements/SelectAttachmentField',
++ Arguments => { Class => 'RT::Assets' },
+ },
+ Op => {
+ Type => 'component',
@@ -1955,7 +2150,7 @@
+ Field => {
+ Type => 'component',
+ Path => 'SelectPersonType',
-+ Arguments => { Default => 'Owner' },
++ Arguments => { Default => 'Owner', Class => 'RT::Assets' },
+ },
+ Op => {
+ Type => 'component',
@@ -1968,7 +2163,7 @@
+ Field => {
+ Type => 'component',
+ Path => 'SelectPersonType',
-+ Arguments => { Default => 'Owner', Suffix => 'Group' },
++ Arguments => { Default => 'Owner', Suffix => 'Group', Class => 'RT::Assets' },
+ },
+ Op => {
+ Type => 'select',
@@ -1980,7 +2175,8 @@
+ Name => 'Date',
+ Field => {
+ Type => 'component',
-+ Path => '/Asset/Elements/SelectDateType',
++ Path => '/Elements/SelectDateType',
++ Arguments => { Class => 'RT::Assets' },
+ },
+ Op => {
+ Type => 'component',
@@ -2092,7 +2288,6 @@
-elsif ($Suffix eq 'Group') {
- @types = qw(Owner Requestor Cc AdminCc Watcher);
+my ( @types, @subtypes );
-+
+if ( $Class eq 'RT::Assets' ) {
+ @types = qw(Owner HeldBy Contact);
+ @subtypes = @{ $RT::Assets::SEARCHABLE_SUBFIELDS{'User'} };
12: 5c5cc68ba0 = 12: 47272c797f Get rid of duplicated inputs on asset bulk update page from simple searches
13: 1a1cf77848 = 13: 422de426ad Hide AssetSQL links from simple search's bulk update page
14: 5f9ed69893 ! 14: d55029fda8 Tweak asset search menu to show current search
@@ -1,6 +1,9 @@
Author: sunnavy <sunnavy at bestpractical.com>
- Tweak asset search menu to show current search like ticket/txn searches
+ Tweak asset search menu to show current search
+
+ Previously there was no menu link to current asset search. Now it's more
+ consistent with ticket search menu.
diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
--- a/lib/RT/Interface/Web/MenuBuilder.pm
15: 14ce8833e2 ! 15: eae6b9c895 Show current search on individual asset pages like ticket/txn
@@ -17,15 +17,16 @@
$search_assets->child("asset_simple", title => loc("Simple Search"), path => "/Asset/Search/");
}
@@
- my $has_query = '';
- if (
- (
-- $request_path =~ m{^/(?:Ticket|Transaction|Search)/}
-+ $request_path =~ m{^/(?:Ticket|Transaction|Asset|Search)/}
- && $request_path !~ m{^/Search/Simple\.html}
)
|| ( $request_path =~ m{^/Search/Simple\.html}
-@@
+ && $HTML::Mason::Commands::DECODED_ARGS->{'q'} )
++
++ # TODO: Asset simple search and SQL search don't share query, we
++ # can't simply link to SQL search page on asset pages without
++ # identifying if it's from simple search or SQL search. For now,
++ # show "Current Search" only if asset simple search is disabled.
++
++ || ( $search_assets && $request_path =~ m{^/Asset/(?!Search/)} && RT->Config->Get('AssetSQL_HideSimpleSearch') )
)
{
my $class = $HTML::Mason::Commands::DECODED_ARGS->{Class}
@@ -48,7 +49,7 @@
if ( $class eq 'RT::Tickets' && $request_path =~ m{^/Ticket}
- || $class eq 'RT::Transactions' && $request_path =~ m{^/Transaction} )
+ || $class eq 'RT::Transactions' && $request_path =~ m{^/Transaction}
-+ || $class eq 'RT::Assets' && $request_path =~ m{^/Asset} )
++ || $class eq 'RT::Assets' && $request_path =~ m{^/Asset/(?!Search/)} )
{
$current_search_menu = $search->child( current_search => title => loc('Current Search') );
$current_search_menu->path("/Search/Results.html$args") if $has_query;
16: b2127b8462 ! 16: 4f76e38957 Respect %TransactionShowSearchResultCount to show saved txn searches
@@ -12,5 +12,5 @@
+ $ShowCount = RT->Config->Get('TransactionShowSearchResultCount')->{'RT::Ticket'};
}
elsif ( $SearchArg->{SearchType} eq 'Asset' ) {
- $class = 'RT::Assets';
+ $class = $SearchArg->{Class} = 'RT::Assets';
17: 5f0a5e3faf ! 17: 62c2554584 Rename config $AssetSQL_HideSimpleSearch to $AssetHideSimpleSearch
@@ -64,6 +64,15 @@
$assets->child( "simple_search", title => loc("Simple Search"), path => "/Asset/Search/" );
}
}
+@@
+ # identifying if it's from simple search or SQL search. For now,
+ # show "Current Search" only if asset simple search is disabled.
+
+- || ( $search_assets && $request_path =~ m{^/Asset/(?!Search/)} && RT->Config->Get('AssetSQL_HideSimpleSearch') )
++ || ( $search_assets && $request_path =~ m{^/Asset/(?!Search/)} && RT->Config->Get('AssetHideSimpleSearch') )
+ )
+ {
+ my $class = $HTML::Mason::Commands::DECODED_ARGS->{Class}
diff --git a/share/html/Asset/Search/index.html b/share/html/Asset/Search/index.html
--- a/share/html/Asset/Search/index.html
@@ -74,7 +83,7 @@
<%init>
-if (RT->Config->Get('AssetSQL_HideSimpleSearch')) {
+if (RT->Config->Get('AssetHideSimpleSearch')) {
- $m->redirect( RT->Config->Get("WebPath") .'/Asset/Search/Build.html' );
+ $m->redirect( RT->Config->Get("WebPath") .'/Search/Build.html?Class=RT::Assets' );
}
18: fa411aa9ac = 18: f6161ca103 Rename config $AssetSearchFormat to $AssetSimpleSearchFormat
19: cb8f548329 = 19: 38d53540b0 Add config $AssetDefaultSearchResultFormat for AssetSQL searches
20: e40d28c4e4 = 20: 72d950a803 Add configs $AssetDefaultSearchResultOrderBy and $AssetDefaultSearchResultOrder
21: 35b0ef364e ! 21: 9a1fc66f31 Add config $AssetShowSearchResultCount for asset saved searches
@@ -41,9 +41,9 @@
--- a/share/html/Elements/ShowSearch
+++ b/share/html/Elements/ShowSearch
@@
- $customize = RT->Config->Get('WebPath') . '/Asset/Search/Build.html?'
- . $m->comp( '/Elements/QueryString',
- SavedSearchLoad => $SavedSearch );
+ = RT->Config->Get('WebPath')
+ . '/Search/Build.html?'
+ . $m->comp( '/Elements/QueryString', SavedSearchLoad => $SavedSearch, Class => 'RT::Assets' );
+ $ShowCount = RT->Config->Get('AssetShowSearchResultCount');
}
elsif ( $SearchArg->{SearchType} ne 'Ticket' ) {
22: 8bcdb6be02 = 22: 17caf22242 Fix custom field list for AssetSQL searches on bulk update page
--: ------- > 23: 0fca135af1 Fix header link and show edit link for transaction saved search widgets
--: ------- > 24: 813959636d Show "Spreadsheet" under "Feeds" for asset bulk page from SQL search
--: ------- > 25: 5a881a49cc Make search menus under "Assets" more consistent with top "Search" menu
--: ------- > 26: b4cdb379ba Prettier related ticket buttons on asset search result
--: ------- > 27: 95bd085f77 Tweak asset default search format to show more info and show it more clearly
--: ------- > 28: fce585f28b Always pass args to "Edit Search" link in "Current Search"
23: 64bd450352 ! 29: d88d5d7daa Add asset query builder basic tests
@@ -33,7 +33,17 @@
+ $m->follow_link_ok( { text => 'New Search', url_regex => qr/Class=RT::Assets/ }, 'Query builder' );
+ $m->title_is('Asset Query Builder');
+
-+ $m->form_name('BuildQuery');
++ my $form = $m->form_name('BuildQuery');
++ is_deeply( [$form->find_input('AttachmentField')->possible_values], [qw/Name Description/], 'AttachmentField options' );
++
++ my @watcher_options = ( '' );
++ for my $role ( qw/Owner HeldBy Contact/ ) {
++ for my $field ( qw/EmailAddress Name RealName Nickname Organization Address1 Address2 City State Zip Country WorkPhone HomePhone MobilePhone PagerPhone id/ ) {
++ push @watcher_options, "$role.$field";
++ }
++ }
++ is_deeply( [ $form->find_input('WatcherField')->possible_values ], \@watcher_options, 'WatcherField options' );
++
+ $m->field( ValueOfCatalog => 'General assets' );
+ $m->click('AddClause');
+
@@ -89,13 +99,18 @@
+ is_deeply(
+ $attr->Content,
+ { 'Order' => 'ASC|ASC|ASC|ASC',
-+ 'Format' => '\'<a href="__WebHomePath__/Asset/Display.html?id=__id__">__Name__</a>/TITLE:Name\',
-+Description,
-+\'__Status__ (__Catalog__)/TITLE:Status\',
++ 'Format' => q{'<a href="__WebPath__/Asset/Display.html?id=__id__">__id__</a>/TITLE:#',
++'<a href="__WebHomePath__/Asset/Display.html?id=__id__">__Name__</a>/TITLE:Name',
++Status,
++Catalog,
+Owner,
-+HeldBy,
-+Contacts,
-+\'__ActiveTickets__ __InactiveTickets__/TITLE:Related tickets\'',
++'__ActiveTickets__ __InactiveTickets__/TITLE:Related tickets',
++'__NEWLINE__',
++'__NBSP__',
++'<small>__Description__</small>',
++'<small>__CreatedRelative__</small>',
++'<small>__LastUpdatedRelative__</small>',
++'<small>__Contacts__</small>'},
+ 'SearchType' => 'Asset',
+ 'RowsPerPage' => '50',
+ 'OrderBy' => 'Name|||',
@@ -107,3 +122,4 @@
+}
+
+done_testing;
+
--: ------- > 30: 7389924096 Make sure default value of RowsPerPage is numeric
More information about the rt-commit
mailing list