-
Notifications
You must be signed in to change notification settings - Fork 6
Optional FAQID param in FAQSearch function. #64
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,11 @@ search in FAQ articles | |
|
|
||
| ServiceID => $ServiceID, # (optional) | ||
|
|
||
| # Use FAQSearch as an FAQ filter on a single FAQ item, | ||
| # or a predefined FAQ item list | ||
| FAQID => 1234, # (optional) | ||
| FAQID => [1234, 1235], # (optional) | ||
|
|
||
| # Approved | ||
| # Only available in internal interface (agent interface) | ||
| Approved => 1, # (optional) 1 or 0, | ||
|
|
@@ -431,6 +436,22 @@ sub FAQSearch { | |
| $Ext .= " LOWER(i.f_subject) LIKE LOWER('" . $Param{Title} . "') $Self->{LikeEscapeString}"; | ||
| } | ||
|
|
||
| # Limit the search to just one (or a list) FAQID (used by the otobo-ai package | ||
| # to filter for events on single FAQ items with the job's FAQ filter). | ||
| if ( IsStringWithData( $Param{FAQID} ) || IsArrayRefWithData( $Param{FAQID} ) ) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sounds good to me. Maybe it's worth considering changing it in |
||
|
|
||
| my $SQLQueryInCondition = $DBObject->QueryInCondition( | ||
| Key => 'i.id', | ||
| Values => ref $Param{FAQID} eq 'ARRAY' ? $Param{FAQID} : [ $Param{FAQID} ], | ||
| QuoteType => 'Integer', | ||
| BindMode => 0, | ||
| ); | ||
| if ($Ext) { | ||
| $Ext .= ' AND '; | ||
| } | ||
| $Ext .= ' ( ' . $SQLQueryInCondition . ' ) '; | ||
| } | ||
|
|
||
| # search for languages | ||
| if ( $Param{LanguageIDs} && ref $Param{LanguageIDs} eq 'ARRAY' && @{ $Param{LanguageIDs} } ) { | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*a FAQ, if I am not mistaken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would depend on how the word FAQ sounds phonetically, not necessarily how it's spelled.
I figured it starts with a pronounced "eff..." and so it is preceded by an "an". :)