Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autocomplete for assets #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gibus
Copy link

@gibus gibus commented Dec 29, 2016

Add support of autocompletion for assets (with RT::Assets-SimpleSearch,
therefore using RT->Config->Get('AssetSearchFields') and
RT->Config->Get('DefaultCatalog')) in field "Add an asset to this
ticket" of the ticket display form.

Also add support of completion both for tickets and for assets in each
input field of the AddLinks form. Completion is done for tickets (as
usual) until the entered term starts with "asset:", where the completion
is switched for assets.

Signed-off-by: gibus gibus@easter-eggs.com

(NB: I've previously submitted this patch on https://issues.bestpractical.com/Ticket/Display.html?id=29204 but was advised by @elacour that code review may be easier with a pull request on github)

Add support of autocompletion for assets (with RT::Assets-SimpleSearch,
therefore using RT->Config->Get('AssetSearchFields') and
RT->Config->Get('DefaultCatalog')) in field "Add an asset to this
ticket" of the ticket display form.

Also add support of completion both for tickets and for assets in each
input field of the AddLinks form. Completion is done for tickets (as
usual) until the entered term starts with "asset:", where the completion
is switched for assets.

Signed-off-by: gibus <gibus@easter-eggs.com>
@mnadai
Copy link

mnadai commented Jan 30, 2017

Hello gibus

I'm working on something similar and run into your patch.

Have you considered adding the ability to autocomplete based on asset name and/or description?

After all, tickets can be looked up by ticket# or subject, and most likely an asset number won't mean much to whoever is working on a ticket.

Thanks
Maurizio

@gibus
Copy link
Author

gibus commented Jan 30, 2017

Hi Maurizio,

You can do this through the $AssetSearchFields configuration parameter (see documentation in RT_Config.pm).

For instance, with :

Set($AssetSearchFields, {
    Name        => 'LIKE',
    'CF.{Serial number}' => 'STARTWITH',
});

the autocompletion is based on Name and the custom field 'Serial number'.

@ktm-github
Copy link

Hi,
I have patched my RT 4.4.4 instance it it worked once I set the DefaultCatalog but it is not sticky and the only catalog you can use is that one even though the simple search is sticky once you change to a different default catalog, this autocomplete does not. Do you have any ideas?

Regards,
Ken

bestpractical-mirror pushed a commit that referenced this pull request Nov 19, 2023
Commit is partially based on code in pull request 203 created by:
Gérald SÉDRATI gibus

See #203
bestpractical-mirror pushed a commit that referenced this pull request Nov 26, 2023
Commit is partially based on code in pull request 203 created by:
Gérald SÉDRATI gibus

See #203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants