Skip to content

Instantly share code, notes, and snippets.

@gerneio
Created May 26, 2020 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerneio/23ed809451345d74c01150ea3e94c1f5 to your computer and use it in GitHub Desktop.
Save gerneio/23ed809451345d74c01150ea3e94c1f5 to your computer and use it in GitHub Desktop.
Jitbit Issue #11891: Allowed option to default search to search message replies and attachment names
function OverrideFunctions_IfExists() {
if (DoSearch) {
var local_DoSearch = DoSearch;
DoSearch = function() {
//local_DoSearch.apply(this, arguments);
document.location.href = globalRootAppUrl + "Tickets/Search?btnSearch=Search&isAdvancedSearch=true&searchInComments=true&dueDateTo=&dateFrom=10%2F01%2F2019&q=" + $("#tbQuery").val();
};
DoSearch.local = local_DoSearch;
}
}
function ChangeSearchQuery() {
if (!$("#tbQuery").length) return;
var atag = $("#tbQuery").siblings("a");
atag.attr("href", atag.attr("href") + "?isAdvancedSearch=true&searchInComments=true&dateFrom=10%2F01%2F2019");
}
// Call these two functions on load/ready
OverrideFunctions_IfExists();
ChangeSearchQuery();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment