Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Commit

rt branch, 4.0/context-on-custom-fields, updated. rt-4.0.4-47-gefcbff7

 

 

Request Tracker commit RSS feed   Index | Next | Previous | View Threaded


sunnavy at bestpractical

Mar 19, 2012, 9:40 PM

Post #1 of 1 (82 views)
Permalink
rt branch, 4.0/context-on-custom-fields, updated. rt-4.0.4-47-gefcbff7

The branch, 4.0/context-on-custom-fields has been updated
via efcbff7d37d182f5bb93d3cc19632565cb0768b0 (commit)
from 8f11bb396670e47b66d4755b33113530374a70d8 (commit)

Summary of changes:
share/html/Elements/EditCustomFieldAutocomplete | 4 ++--
share/html/Helpers/Autocomplete/CustomFieldValues | 7 +++++++
2 files changed, 9 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit efcbff7d37d182f5bb93d3cc19632565cb0768b0
Author: sunnavy <sunnavy [at] bestpractical>
Date: Tue Mar 20 12:08:18 2012 +0800

add queue object to cf's context object when creating tickets

as in ticket create page, there is no valid ticket object, thus we
can't get Queue from the ticket object but from Queue args.

see also #19570

diff --git a/share/html/Elements/EditCustomFieldAutocomplete b/share/html/Elements/EditCustomFieldAutocomplete
index a7576eb..24b661b 100644
--- a/share/html/Elements/EditCustomFieldAutocomplete
+++ b/share/html/Elements/EditCustomFieldAutocomplete
@@ -52,7 +52,7 @@
var id = '<% $name . '-Values' %>';
id = id.replace(/:/g,'\\:');
jQuery('#'+id).autocomplete( {
- source: "<%RT->Config->Get('WebPath')%>/Helpers/Autocomplete/CustomFieldValues?<% $name . '-Values' %>",
+ source: "<%RT->Config->Get('WebPath')%>/Helpers/Autocomplete/CustomFieldValues?<% $name . '-Values' %><% $ARGS{Queue} ? "&Queue=$ARGS{Queue}" : '' |n %>",
focus: function () {
// prevent value inserted on focus
return false;
@@ -76,7 +76,7 @@ jQuery('#'+id).autocomplete( {
var id = '<% $name . '-Value' %>';
id = id.replace(/:/g,'\\:');
jQuery('#'+id).autocomplete( {
- source: "<%RT->Config->Get('WebPath')%>/Helpers/Autocomplete/CustomFieldValues?<% $name . '-Value' %>",
+ source: "<%RT->Config->Get('WebPath')%>/Helpers/Autocomplete/CustomFieldValues?<% $name . '-Value' %><% $ARGS{Queue} ? "&Queue=$ARGS{Queue}" : '' |n %>"
}
);
% }
diff --git a/share/html/Helpers/Autocomplete/CustomFieldValues b/share/html/Helpers/Autocomplete/CustomFieldValues
index d8985bb..8706c15 100644
--- a/share/html/Helpers/Autocomplete/CustomFieldValues
+++ b/share/html/Helpers/Autocomplete/CustomFieldValues
@@ -76,6 +76,13 @@ if ( $Type eq 'RT::Ticket' && $ObjectId) {
$CustomFieldObj->SetContextObject( $ticket->QueueObj );
}
}
+elsif ( $ARGS{Queue} ) {
+ my $queue = RT::Queue->new( $session{'CurrentUser'} );
+ $queue->Load($ARGS{Queue});
+ if ( $queue->id ) {
+ $CustomFieldObj->SetContextObject( $queue );
+ }
+}

my $values = $CustomFieldObj->Values;
$values->Limit(

-----------------------------------------------------------------------
_______________________________________________
Rt-commit mailing list
Rt-commit [at] lists
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit

Request Tracker commit RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.