Skip to content

Commit

Permalink
Issue #1449: WIP Detailed Search
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter committed Jan 12, 2022
1 parent 98d14aa commit be682f9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions var/httpd/htdocs/js/Core.Agent.DynamicFieldDBSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ Core.Agent.DynamicFieldDBSearch = (function(TargetNS) {

if(isJQueryObject($Element)) {

var LiElementId = $Element.parents().closest('li.Activity').attr('id');
var ActivityDialogId = '';
if ( typeof LiElementId !== 'undefined' ) {
ActivityDialogId = LiElementId.match(/^Process_ActivityDialog-([0-9a-f]{32})$/)[1];
}

// Get the ticket id.
/TicketID=(\d+)/.exec(document.URL);
TicketID = RegExp.$1;
Expand All @@ -209,7 +215,11 @@ Core.Agent.DynamicFieldDBSearch = (function(TargetNS) {

// Register event for the detailed search dialog
$('#DynamicFieldDBDetailedSearch_' + DynamicFieldName).on('click', function () {
OpenDetailedSearchDialog($(this).attr('field'), TicketID);
var FieldName = $(this).attr('field');
if ( ActivityDialogId !== '' ) {
FieldName = FieldName.substring(0, FieldName.indexOf('_' + ActivityDialogId));
}
OpenDetailedSearchDialog(FieldName, TicketID);
return false;
});

Expand Down Expand Up @@ -261,8 +271,7 @@ Core.Agent.DynamicFieldDBSearch = (function(TargetNS) {
// for usage in process context
var LiElementId = $Element.parents().closest('li.Activity').attr('id');
var DynamicFieldNameQuery = DynamicFieldName;
if (typeof LiElementId !== 'undefined') {
var ActivityDialogId = LiElementId.match(/^Process_ActivityDialog-([0-9a-f]{32})$/)[1];
if (ActivityDialogId !== '') {
DynamicFieldNameQuery = DynamicFieldNameQuery.substring(0, DynamicFieldNameQuery.indexOf('_' + ActivityDialogId));
}

Expand Down

0 comments on commit be682f9

Please sign in to comment.