[Rt-commit] rt branch, 4.4/asset-sql-foundation, created. rt-4.4.0-255-g9bab0d5
Shawn Moore
shawn at bestpractical.com
Wed Jun 15 16:57:34 EDT 2016
The branch, 4.4/asset-sql-foundation has been created
at 9bab0d5098fdae5831badcf6fa5650edf6c041b6 (commit)
- Log -----------------------------------------------------------------
commit fe4242ffcd8514510da06ada6abc00238b20f201
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Tue Jun 14 20:39:37 2016 +0000
Allow ordering assets by CustomField.… syntax
In addition to CF.…
diff --git a/lib/RT/Assets.pm b/lib/RT/Assets.pm
index b52308a..e05a7ae 100644
--- a/lib/RT/Assets.pm
+++ b/lib/RT/Assets.pm
@@ -241,7 +241,7 @@ sub OrderByCols {
my $class = $self->_RoleGroupClass;
for my $row (@_) {
- if ($row->{FIELD} =~ /^CF\.(?:\{(.*)\}|(.*))$/) {
+ if ($row->{FIELD} =~ /^(?:CF|CustomField)\.(?:\{(.*)\}|(.*))$/) {
my $name = $1 || $2;
my $cf = RT::CustomField->new( $self->CurrentUser );
$cf->LoadByNameAndCatalog(
commit a69f40de53317c0e39e6cdc4a002af8c0b59b087
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Tue Jun 14 21:31:48 2016 +0000
Have SelectCatalog take a $ShowNullOption parameter
diff --git a/share/html/Asset/Elements/SelectCatalog b/share/html/Asset/Elements/SelectCatalog
index aa5d5fc..8c65e46 100644
--- a/share/html/Asset/Elements/SelectCatalog
+++ b/share/html/Asset/Elements/SelectCatalog
@@ -48,7 +48,7 @@
<& /Elements/SelectObject,
Name => "Catalog",
ShowAll => $ShowAll,
- ShowNullOption => 0,
+ ShowNullOption => $ShowNullOption,
CheckRight => "CreateAsset",
%ARGS,
ObjectType => "Catalog",
@@ -59,6 +59,7 @@
$ShowAll => 0
$Default => undef
$UpdateSession => 1
+$ShowNullOption => 0
</%args>
<%init>
my $catalog_obj = LoadDefaultCatalog($Default || '');
commit 007689c2ad47b1292b79404cd2a7633194c2c8e3
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Tue Jun 14 21:47:32 2016 +0000
Handle multiple lifecycles in Asset SelectStatus
diff --git a/share/html/Asset/Elements/AssetSearchBasics b/share/html/Asset/Elements/AssetSearchBasics
index de9c35b..9557c8c 100644
--- a/share/html/Asset/Elements/AssetSearchBasics
+++ b/share/html/Asset/Elements/AssetSearchBasics
@@ -54,7 +54,7 @@
</td></tr>
<tr class="asset-status"><td class="label"><label for="Status"><&|/l&>Status</&></label></td>
<td class="value" colspan="3">
-<& /Asset/Elements/SelectStatus, Name => 'Status', CatalogObj => $CatalogObj, DefaultValue => 1,
+<& /Asset/Elements/SelectStatus, Name => 'Status', Catalogs => { $CatalogObj->id => 1 }, DefaultValue => 1,
Default => ($ARGS{'Status'} || '') &>
</td></tr>
<tr class="asset-name"><td class="label"><label for="Name"><&|/l&>Name</&></label></td>
diff --git a/share/html/Asset/Elements/SelectStatus b/share/html/Asset/Elements/SelectStatus
index ef3e826..99717da 100644
--- a/share/html/Asset/Elements/SelectStatus
+++ b/share/html/Asset/Elements/SelectStatus
@@ -45,22 +45,27 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Elements/SelectStatus, %ARGS &>
+<& /Elements/SelectStatus, %ARGS, Type => 'asset', Object => $AssetObj && $AssetObj->id ? $AssetObj : $CatalogObj, Lifecycles => \@Lifecycles &>
<%init>
-if ($AssetObj and $AssetObj->Id) {
+my @Lifecycles;
+for my $id (keys %Catalogs) {
+ my $catalog = RT::Catalog->new($session{'CurrentUser'});
+ $catalog->Load($id);
+ push @Lifecycles, $catalog->LifecycleObj if $catalog->id;
+}
+
+if ($AssetObj && $AssetObj->id) {
$ARGS{DefaultValue} = 0;
$ARGS{Default} = $DECODED_ARGS->{Status} || $ARGS{Default};
$ARGS{Object} = $AssetObj;
-} else {
- my $lifecycle = ($CatalogObj || "RT::Catalog")->LifecycleObj;
- if ( not $ARGS{DefaultValue} ){
- $ARGS{DefaultValue} = 0;
- $ARGS{Default} ||= $DECODED_ARGS->{Status} || $lifecycle->DefaultOnCreate;
- }
- $ARGS{Statuses} = [ $AssetObj ? $lifecycle->Transitions("") : $lifecycle->Valid ];
+} elsif ( $CatalogObj ) {
+ my $lifecycle = $CatalogObj->LifecycleObj;
+ $ARGS{DefaultValue} = 0;
+ $ARGS{Default} ||= $DECODED_ARGS->{Status} || $lifecycle->DefaultOnCreate;
}
</%init>
<%args>
$AssetObj => undef
$CatalogObj => undef
+%Catalogs => ()
</%args>
commit fbd25c2be853f77fec52043b481e4786669248ce
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Tue Jun 14 22:02:11 2016 +0000
Provide Type to Lifecycle->Load
diff --git a/share/html/Elements/SelectStatus b/share/html/Elements/SelectStatus
index 7eb678d..3183a90 100644
--- a/share/html/Elements/SelectStatus
+++ b/share/html/Elements/SelectStatus
@@ -94,7 +94,7 @@ if ( @Statuses ) {
}
if (not keys %statuses_by_lifecycle) {
- for my $lifecycle (map { RT::Lifecycle->Load($_) } RT::Lifecycle->List($Type)) {
+ for my $lifecycle (map { RT::Lifecycle->Load(Type => $Type, Name => $_) } RT::Lifecycle->List($Type)) {
$statuses_by_lifecycle{$lifecycle->Name} = [ $lifecycle->Valid ];
}
}
commit c4a45984885b0ad045edad66be2e6a236be7128d
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Tue Jun 14 22:02:21 2016 +0000
Include ARGSRef for primary Tabs callbacks
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index f4ac8a9..e672e3b 100644
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -1107,7 +1107,7 @@ my $build_main_nav = sub {
PageMenu()->child( edit => title => loc('Edit'), path => '/Prefs/MyRT.html' );
}
- $m->callback( CallbackName => 'Privileged', Path => $request_path );
+ $m->callback( CallbackName => 'Privileged', Path => $request_path, ARGSRef => \%ARGS );
};
my $build_selfservice_nav = sub {
@@ -1174,7 +1174,7 @@ my $build_selfservice_nav = sub {
}
}
- $m->callback( CallbackName => 'SelfService', Path => $request_path );
+ $m->callback( CallbackName => 'SelfService', Path => $request_path, ARGSRef => \%ARGS );
};
commit 3376497542adf6e96300d7a6e27461dd6fea9cf4
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed Jun 15 18:54:01 2016 +0000
Add Initial callback to /Asset/Search/
diff --git a/share/html/Asset/Search/index.html b/share/html/Asset/Search/index.html
index f1ebfa5..903ceb4 100644
--- a/share/html/Asset/Search/index.html
+++ b/share/html/Asset/Search/index.html
@@ -58,6 +58,7 @@ my $title = ( $ARGS{'SearchAssets'} or $ARGS{q} ) ?
loc("Found [quant,_1,asset,assets]",$assets->Count)
: loc("Assets");
+$m->callback( CallbackName => 'Initial', Assets => $assets, ARGSRef => \%ARGS);
</%init>
<& /Elements/Header, Title => $title &>
<& /Elements/Tabs &>
commit 9bab0d5098fdae5831badcf6fa5650edf6c041b6
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed Jun 15 19:13:07 2016 +0000
Add IncludeTicketLinks option to Search EditFormat
This lets us reuse this (updated for 4.4) component in AssetSQL
diff --git a/share/html/Search/Elements/EditFormat b/share/html/Search/Elements/EditFormat
index 4e2bfd8..4c305d2 100644
--- a/share/html/Search/Elements/EditFormat
+++ b/share/html/Search/Elements/EditFormat
@@ -97,10 +97,12 @@ jQuery( function() {
<select name="Link">
<option value="None">-</option>
<option value="Display"><&|/l&>Display</&></option>
+% if ($IncludeTicketLinks) {
<option value="Take"><&|/l&>Take</&></option>
<option value="Respond"><&|/l&>Respond</&></option>
<option value="Comment"><&|/l&>Comment</&></option>
<option value="Resolve"><&|/l&>Resolve</&></option>
+% }
</select>
</span>
</div>
@@ -159,4 +161,5 @@ $selected{$_}++ for grep {defined} @{ $selected };
<%ARGS>
$CurrentFormat => undef
$AvailableColumns => undef
+$IncludeTicketLinks => 1
</%ARGS>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list